Question 1: you'll need no more than
30 days (rounded up to full days)
using this strategy:
Use 1/30 of the limit each day. On day 30, first use the missing 30th, and wait a bit. If you get no text, use another 30th, and wait again. Repeat until you get the text. The total number of 30ths that you needed to use on day 30 is equal to the number of the first day of the cycle.
Trying this same method on day 29 (or earlier) will have a failure mode; the second 30th of data will cause a text if the first day of the cycle is either day 30 or day 1, and if you use any additional data on day 30 to figure out which it is, you risk running over the limit, so you cannot do that. So in this case, 30 days (again, rounded up to full days) seems to be the absolute minimum.
For question 2, the best I could do is (THIS IS ALL MESSED UP. YOU'LL RUN OVER THE DATA LIMIT ON DAY 60 ALMOST CERTAINLY. I removed my misguided answer for question 2, and will take a new look in the morning, looks like I'm too tired to wrap my head around the question right now.)
Below is the answer I posted before asking for clarification on the response speed of the text message from the carrier. I assumed that the messages would only come at the end of each day.
Assuming the reset always happens at a known time (say, midnight), you'll need no more than
58 days (rounding up to full days. With careful timing, 57 days + 1 minute would do.)
I have no idea if this is optimal, but couldn't figure out a better way. The method is this:
Start by using a bit of data each day. On day 30, subtract the accumulated data from your data cap, and use that much. If you get the text, the cycle resets the next day.
If you didn't get the text, on every following day, use the exact same amount of data as you did last month on that day. If you get text, the cycle will reset the next day.
On day 58, if you didn't get the text, you already know that you'd get the text on day 59, so you don't have to wait that long.
Commenting on question 2: How on earth did I get coerced into getting a plan that not only has a data limit, but the limit period (and thus, the average allowed daily usage) is unknown and can vary by a factor of 60? :-)