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

B Need to find the odds for my game

Tags:
  1. Jun 12, 2016 #1
    Okay so I have made a game, it's a grid 10x10 going from 0-99. I need to find out the odds going up from 1 to 9 numbers. 9 is the limit or else it's possible for them to go in a diagonal line accross the board and lose every time. That's because after 5-10 seconds a line will appear destroying 10 blocks going vertically or horizontally. So there's a 1-100 chance any number will be chosen, then there's a 50/50 chance it will go vertically or horizontally, if I chose just the number 0 do I have a 10% chance to lose? Because there's a 1% chance right off the bat it will get chosen, then 18% chance one of the blocks adjacent to it will be chosen, then the 18% halves because it can got in the other direction. Can someone check my math or give me a way to figure this out please?

    You can play a demo of the game here to understand better: http://codepen.io/sotacan/pen/MeKEjY

    Click on 1-9 numbers and just hit confirm, then wait for the line to fully appear.
     
  2. jcsd
  3. Jun 12, 2016 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Yes. In that case there is an even easier calculation: all cells are the same (they are in exactly one row and one column), and 10 cells get destroyed, giving a 10% chance that your chosen cell is among them.
     
  4. Jun 12, 2016 #3
    Thank you, now how would I figure out if they chose say 9 blocks from 0-9 (1-10 shown in the demo)? And they could also do it in a diagonal line, like 1, 10, 12, 21 for example.
     
  5. Jun 12, 2016 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    In the most general case: There are 20 ways to choose a line, they all have the same probability. Go through all of them, check for collisions.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted