# I How do I find out the exact probability of this...

1. Mar 21, 2016

### Alanay

I am making a game, there are 1-100 numbers presented on a 10 by 10 table. To make your guess you choose a range from 1-100. So I can choose 45-55. Then the server generates a range from 1-100 and as long as my guesses range is inside of that range I win. How do I find the exact probability I will win on something like 45-55?

Ranges like 70-90 and 10-30 are possible. So starting from 1 a random number is chosen and it will blocks all numbers between 1 and that number and then the same thing happens but from the 0 side of the table.

2. Mar 21, 2016

### mathman

The rules are too vague, particularly about what the server is doing. Can it be any size range? What is the probability distribution of the server range choices?

Guess range inside means completely inside or partially inside?

3. Mar 21, 2016

### Alanay

The server generates 2 random numbers, the lowest one will block 1-that number and the highest will block 100-that number. If they're the same number then no tiles will be blocked and no matter what you choose you win. All blocks in your range must be within the random range or you lose.

4. Mar 21, 2016

### ChrisVer

so you mean that the PC chooses a lower number x and a higher number y and takes the range [x,y]
and you want your range [w,r] to be a subset of [x,y]?

5. Mar 21, 2016

### Alanay

If by subset you mean inside of then yes :D

6. Mar 21, 2016

### ChrisVer

Wanna try it with just 1-6?
you choose let's say [3,4]
the possible PC choices are:
[1,2] , [1,3], [1,4], [1,5], [1,6]
_____ [2,3] [2 4] [2 5] [2 6]
__________[3 4] [3 5] [3 6]
_______________[4 5] [4 6]
____________________ [5 6]
Right? So it's 15...
Expanding the above logic not until 6 but until N, it is $\frac{N^2 - N}{2}$ (see it as a half-matrix????) with N the max number... for example the above is 6 : $\frac{6^2 -6}{2} = \frac{36-6}{2} = \frac{30}{2} =15$
so, the total number of ranges the computer can choose (randomly I suppose you meant with a uniform probability for all) is $R=\frac{N^2 -N}{2}$
For $N=100 \rightarrow R = \frac{100^2 -100}{2} = 4950$
Now then, the answer depends on your choice.... so it depends on your minimum number $k$ and the length $L$... if you choose [30,40] your minimum number is 30 and the length is 10.
Why? because then you can go to that matrix and choose the rows and columns to count of the computer that will lead to "victory".
let's say that you choose [45,55] (as your example). Any element then in the matrix that would have [46, ...] will be tossed out because it would make you lose... the length is also 10, so anything in the computer that has length less than that can be tossed because it would make you lose. Or another way is that you need to know your lowest $k$ and your highest number $m$.

Well back to my initial example of 1-6 with your choice [3,4], the winning ones are:
[X,X] , [X,X], [1,4], [1,5], [1,6]
_____[X,X] [2 4] [2 5] [2 6]
__________[3 4] [3 5] [3 6]
_______________[X X] [X X]
____________________[X X]
those that pass are 9 combinations... the probability is so 9/15 ~60%
[X,X] , [X,X], [X,X], [1,5], [1,6]
_____[X,X] [X X] [2 5] [2 6]
__________[X X] [X X] [X X]
_______________[X X] [X X]
____________________[X X]
4/15 ~ 27%

see how the upper limit $k+L=m$ cut the collumn (first column starts with [...,m] )
also see how the $k$ cut the row (lowest elements start with [k,...])
It looks pretty much like $k \times (N-m+1)$ (box's area) can give the correct answer for the "winning" patterns. Eg to the above examples:
1 [k=3, m=4]: $3 \times (6-3)= 3 \times 3 = 9$
2 [k=2, m=5] :$2 \times (6-5+1)= 2 \times 2 = 4$

I think my logic is RIGHT, and so I deduce that the probability to win in general is:
$P = \frac{ \text{success}}{\text{total}} = \frac{ k \times (N-m+1)}{ N ( N-1)/2 }$

So I give the answer for [45,55] to be:
$P = \frac{45 \times (100-55+1)}{4950 } \approx 42 \%$

7. Mar 21, 2016

### ChrisVer

For such problems I would suggest bringing down the numbers to something that you can work with on a scrap of paper...Obviously 1-100 is not that easy to handle... Get practical!!!
Then try, instead of giving computational answers (in the above counting boxes), to give a general formula that contains information that you need in "any" dimension... in the above that's what I did by trying to find the successes in relation to the player's choice $[k,m]$ (which holds in any range game) or the total number of pc range-combinations [seeing it as a matrix]. Search and Find patterns!!!
Test that formula on your range... maybe create another easy range and test your formula on it too (I didn't do that here, but that's why I said 'I think my logic is RIGHT', because intuitively it felt right to me)... Convince yourself!!!
... and GET SOLUTION
Then you can deduce what's happening to any range.... I'm pretty sure my answer holds for any:
[1-X] range game
and any player's choice [k,m].

8. Mar 22, 2016

### Alanay

Thank you for doing so much math to help me. I will take your advice and reduce the max possible range to 1-25 for simplicity and easier math. Thanks again!

9. Mar 22, 2016

### ChrisVer

if you believe that 1-25 is easier... to me easy to write down on paper are 4,5,6 ... 7 at worst...
I even made a 2D plot giving the probability ... the x axis is the player's lower choice, the y axis is the player' higher choice...
So the most probable victory points for the player have small length/range and the lower value is around 50.... and the most probable to win (with about 50% probability) is the player=[50,51]...