Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Mar 21, 2016 #1
    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. jcsd
  3. Mar 21, 2016 #2

    mathman

    User Avatar
    Science Advisor
    Gold Member

    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?
     
  4. Mar 21, 2016 #3
    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.
     
  5. Mar 21, 2016 #4

    ChrisVer

    User Avatar
    Gold Member

    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]?
     
  6. Mar 21, 2016 #5
    If by subset you mean inside of then yes :D
     
  7. Mar 21, 2016 #6

    ChrisVer

    User Avatar
    Gold Member

    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 [itex]\frac{N^2 - N}{2}[/itex] (see it as a half-matrix????) with N the max number... for example the above is 6 : [itex] \frac{6^2 -6}{2} = \frac{36-6}{2} = \frac{30}{2} =15[/itex]
    so, the total number of ranges the computer can choose (randomly I suppose you meant with a uniform probability for all) is [itex] R=\frac{N^2 -N}{2}[/itex]
    For [itex]N=100 \rightarrow R = \frac{100^2 -100}{2} = 4950 [/itex]
    Now then, the answer depends on your choice.... so it depends on your minimum number [itex]k[/itex] and the length [itex]L[/itex]... 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 [itex]k[/itex] and your highest number [itex]m[/itex].

    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%
    If your choice was [2,5]:
    [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 [itex]k+L=m[/itex] cut the collumn (first column starts with [...,m] )
    also see how the [itex]k[/itex] cut the row (lowest elements start with [k,...])
    It looks pretty much like [itex] k \times (N-m+1)[/itex] (box's area) can give the correct answer for the "winning" patterns. Eg to the above examples:
    1 [k=3, m=4]: [itex] 3 \times (6-3)= 3 \times 3 = 9[/itex]
    2 [k=2, m=5] :[itex] 2 \times (6-5+1)= 2 \times 2 = 4[/itex]

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

    So I give the answer for [45,55] to be:
    [itex] P = \frac{45 \times (100-55+1)}{4950 } \approx 42 \%[/itex]
     
  8. Mar 21, 2016 #7

    ChrisVer

    User Avatar
    Gold Member

    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 [itex][k,m][/itex] (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].
     
  9. Mar 22, 2016 #8
    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!
     
  10. Mar 22, 2016 #9

    ChrisVer

    User Avatar
    Gold Member

    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]...
    justforfun.jpg
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: How do I find out the exact probability of this...
Loading...