I'm having a bit of a brain fart and I wonder if someone can help me.
I made a game in python that has a 25 square field (5 squares across x 5 squares down). I wanted each square to have a chance of being occupied by a mine. To have a slightly higher control over the chance I made it like this:
mine = randint(1, 4) So mine has a 1 in 4 chance of existing (25% chance).
Then, I made it so that each square has a 25% chance (1 in 4) of having the same number as the mine:
square = randint(1, 4)
Then I made it so that both compare and if both numbers equal, the square is occupied by a mine.
So, I have 25% chance that a square is... let's say 3. And I have 25% chance that a mine is 3. What is the actual percentage for the chance of both having 3?
Is it 25%x25% = ~ 6.something% It doesn't sound right, so I wonder if anyone can help me. I just want to know for myself. I didn't want squares to have static numbers that mine has to match.
I made a game in python that has a 25 square field (5 squares across x 5 squares down). I wanted each square to have a chance of being occupied by a mine. To have a slightly higher control over the chance I made it like this:
mine = randint(1, 4) So mine has a 1 in 4 chance of existing (25% chance).
Then, I made it so that each square has a 25% chance (1 in 4) of having the same number as the mine:
square = randint(1, 4)
Then I made it so that both compare and if both numbers equal, the square is occupied by a mine.
So, I have 25% chance that a square is... let's say 3. And I have 25% chance that a mine is 3. What is the actual percentage for the chance of both having 3?
Is it 25%x25% = ~ 6.something% It doesn't sound right, so I wonder if anyone can help me. I just want to know for myself. I didn't want squares to have static numbers that mine has to match.
-
I want to get this straight. If the box is a 3 and the mine is a three, then the box is the mine? But how is there only a 25% chance then that the mine exists? If the first is correct, yes, the chance of the box being a bomb is 6.25% (25% x 25%). However, If I'm not interpreting it correctly, I'm not totally sure.
(If the bomb needs a certain number to exist, and then you pick the bomb number and the box number, it would be 25% * 25% * 25%)
(If the bomb needs a certain number to exist, and then you pick the bomb number and the box number, it would be 25% * 25% * 25%)
-
The probability that both numbers are 3 is 1/4 x 1/4 = 1/16, that's 6¼%.
The probability that both numbers are the same is 4 x 6¼% = 25%.
The probability that both numbers are the same is 4 x 6¼% = 25%.
-
idk