>>11338219you're answering a different question, namely: "what is the chance of getting four 90-99's in a row?".

>In each roll you have 10/100 or 1/10 = 10% chance of getting a 90-99. So getting four 90-99's in a row has a (1/10)^4 = 0.01% chance.the question in the OP is more complex: if you roll 100k numbers, what is the chance that at least one sequence of four 90-99's resides within that string of 100k numbers?

the answer is probably 50+%, but I don't know how to calculate it exactly.

if you want to find the answer with programming, you'd have to repeat rolling 100k numbers like a 1000 times and checking each time if a string of four 90-99's is present.

there is a way to simplify OP's question: instead of generating 1-100, generate 0-9 and let a 9 equal a 90-99. the chance of hitting a 9 out of 0-9 is the same as hitting a 90-99 out of 1-100, so you're not changing the odds. then all you'd need to do is generate 100k digits from 0 to 9 and check how many times on average you encounter at least one string of 9999 in the string of 100k digits.