Donate SIGN UP

Enough Random Numbers For Me

Avatar Image
fairyrak | 18:47 Sat 20th Dec 2014 | Science
27 Answers
I want to generate a chain of x random numbers from 0 to 10:
(actually x=687 but I prefer to call it x)

what's the formula to calculate the probability that somewhere in that chain of x numbers there each and any these numbers formed by two digits will appear at least once?:

00, 01, 02 , 03 , 04, 05, 06, 07 , 08, 09, 10, 11, 12, 13 and so on. . . to 99
Gravatar

Answers

1 to 20 of 27rss feed

1 2 Next Last

Avatar Image
Wow - quite a hairy problem! Try this piecemeal approach, although it's not quite exact :- 687 digits have (on average) 68.7 occurrences of each of the ten possible digits, each one followed by another digit; the chance of each of those following digits NOT being the digit you "want" is 9 out of 10, so the chance of NONE of them being the digit you want is 0.9^68.7...
18:03 Sun 21st Dec 2014
You can rule out 11-99 for a start?
Do you mean your random numbers should be from 0-9 inclusive?
If you allow 10 then your pairs could include things like 810 and 1010 so wouldn't all be two digits.
Do you just mean you want to have random numbers from 0 (written as 00) to 99?
Fairyrak: I think your reference to "x" rather confuses things. Also do you really mean random numbers 0 - 10? It would make more sense to identify 2 digit numbers in the string if they were produced by random single digits 0 - 9 (as Factor suggests in his post).
Can you confirm the following:
--- You have a method of randomly generating a single digit in the range 0 to 9 which you use 687 times to create a string of digits. ---
If this is so, we may be able to help you with the probability of 2 digit numbers in the range 00 to 99 appearing in the string. But as Factor will no doubt remind us, these problems can be tricky and must be well defined.
I had assumed that the problem was equivalent to something like asking the probability of a particular string of letters, say ABRACADABRA, being generated in a random sequence of letters ABFJSHTDJDGBEJGJDKFSFHSKJDFN... etc. If so, then it may be rather tricky as the various pairs considered aren't necessarily independent, eg if you were looking for the pair 43 and the sequence so far ended in 9, then adding one more digit won't increase the chances of 43 appearing, but adding two digits will. This could make the problem more complicated.
Wow - quite a hairy problem!

Try this piecemeal approach, although it's not quite exact :-

687 digits have (on average) 68.7 occurrences of each of the ten possible digits, each one followed by another digit; the chance of each of those following digits NOT being the digit you "want" is 9 out of 10, so the chance of NONE of them being the digit you want is 0.9^68.7 or just about 1 in 1392. So you have 1391 chances in 1392 of getting at least one occurrence of any and every particular pair. But to get all 100 of them, you have to pull off that 1391-in-1392 chance a hundred times in a row. For numbers so very very close to 1, that's easily approximated as 1291 in 1391, or about 93 per cent.

Don't try this for numbers a lot smaller than 687; I think the fact that you've managed to get one the numbers that you wanted will have a tiny detrimental effect on the chances of getting the others, which the above simplified treatment doesn't allow for.
Question Author
yes, my pairs could mean 158 or 157 or 15 for the presence of a 15, I don't care
or 021 or 026, or 4478521, I only care about the % of finding the presence of all the 100 pairs in the chain with length of x of random digits (x should be long enough of course)
Question Author
yes, the numbers are all from 0 to 9, , the numbers in the chain x are random, so if i had for example these random numbers 1151577894915161654801165140246461603 there I would have the chain 01 and 02 and 03 and 91 and 15 and 56 and 16 and 51 and many others for x=36 but let's assume that x is long enough so that there is at least space to find all the pairs so that I don't have 0% to find all the pairs. But one thing is to have space and another one the % to find all the pairs that I want in the chain and what I want is the formula to calculate the % of finding all the pairs, based on the length x of the chain. x is fixed, it's a constant and the chains are random because the number would be generated randomly
Question Author
and all the numbers in the chain of x numbers would be random as there would be many chains, but all of the chains would be of length x to generate when I wanted
Question Author
@Jonathan-Joe
Yes, I confirm it
Question Author
the numbers are random from 0 to 9
x is the length of the chain

But we want to examine the probability of finding all my pairs of numbers, no matter what pair appears first
Question Author
@factor fiction: from 00 to 99
if for example there appears 01 and 02 and 08 etc but the pair 00 doesnt appear but just for example 60 at the end then i wouldnt have found all the pairs that I wanted!
Question Author
@factor fiction: 1010 or 62210 or 105 whatever surrounds at least a single pair of 10, the only important thing is to find a 10 in the chain of length x (actually I know secretly that what i want is for x= 687 like I said but I would be interested in saying x so that if someday I have another x there I know what to do)
For all sequential two digit values from 00 - 99 the minimum for x is 101 . . . with these as the only two possible sequences:

00112131415161718191022324252627282920334353637383930445464748494055657585950667686960778797088980990

01121314151617181910223242526272829203343536373839304454647484940556575859506676869607787970889809900

What’s the probability for that?
Oops . . . found two more:

09908988079787706968676605958575655049484746454403938373635343302928272625242322019181716151413121100

00990898807978770696867660595857565504948474645440393837363534330292827262524232201918171615141312110
Having tried several different configurations, apparently there are more ways to arrange these same 101 digits which still meet the stated requirements than there are atoms in the observable universe.
Sorry, fairyrak- maybe my brain has shut down in line with the school calendar but I am still not sure exactly what you want to know.
Are you saying that in a chain of 687 random digits from 0-9, what is the probability that each of the combinations of two digits (from 00 to 99) will appear at some point in consecutive digits?
Good luck though- there are some expert mathematicians on here and once there is an understanding of what you want I'm sure you'll get lots of help
I think I understand the problem. The thing is that I don't know the solution, at least not at the moment. If I understand it correctly it's as I have stated below:

Given a random string, of length x, of single-digit numbers, what is the probability that a particular string of length n will occur, for n less than x? The string you are searching for could be two digits long, ie 00 or 49, etc, while the string you generate can be arbitrarily long.

Like I said, the problem is complicated because there is some overlap between the strings you would test: in the string 14342, say, there are four generated pairs of numbers: 14, 43, 34, 42. If you were searching for 22 then the probability it can occur in the second pair is conditional on what the first pair actually was, and in particular if it ended in 2 or not. This makes the problem trickier because each pair you test is dependent on the previous one. It very possibly also means that the problem depends on the string you are interested in, as 22 and 25 have different symmetry properties, and one might end up having a different analysis from the other (although I would need to solve the problem first to confirm this).
Question Author
"
factor-fiction
Mark as Best Answer
Sorry, fairyrak- maybe my brain has shut down in line with the school calendar but I am still not sure exactly what you want to know.
Are you saying that in a chain of 687 random digits from 0-9, what is the probability that each of the combinations of two digits (from 00 to 99) will appear at some point in consecutive digits?
Good luck though- there are some expert mathematicians on here and once there is an understanding of what you want I'm sure you'll get lots of help\"

in consecutive places of the pair only, for example 8999301454026545 contains the pairs 01 02 and some many others but i dont care if its like that or like this 89930102454, i only care that there is at least one ocurrence of all the pairs that I need
Question Author
@jim360 yes, there could be 100 chains of lengh 2 scattered in the chain of length x (success). Or there might not be but x should be always the length. The only thing is that the whole chain of length x is formed with random numbers! so there is a probability that all my pairs appear or not!

I might let's say get tired of this and start to take statistics and generate 1000 chains of 687 digits and regrettably turn out to have only 100 chains among them that turn out to contain all the pairs 00, 02, 01, 03, 06, etc etc etc, 99 98 (that is to say all the pairs that exist in whatever places the pairs want to appear surrounded with whatever in the chain and how many times they want to appear, as long as all the pairs appear)

I think that I already understood the problem perfectly well, and gave a useful enough answer (on Sunday at 17:03). I don't understand why there's been so much inconclusive crosstalk about it since then.

1 to 20 of 27rss feed

1 2 Next Last

Do you know the answer?

Enough Random Numbers For Me

Answer Question >>

Related Questions