Kazakov
Kazakov
Joined: May 8, 2018
  • Threads: 3
  • Posts: 4
July 2nd, 2022 at 12:33:18 AM permalink
Hi!
I have a slot machine 4*5. Periodically some fixed number of Wilds drop in game field, for example, 7 random Wilds.
How to calculate probabilities of combinations?

I tried tu use 1-line model, but it works wrong. One line contains 5 positions, i have 7 Wilds. Looks like model should take more than 1 line or use other logic.

Please, give me some advice or link on thread or book. Thank you!
ThatDonGuy
ThatDonGuy
Joined: Jun 22, 2011
  • Threads: 110
  • Posts: 5448
Thanks for this post from:
smoothgrhKazakov
July 2nd, 2022 at 8:28:05 AM permalink
If the wilds can drop anywhere, and each square is equally likely to get one, then, if you have N Wilds, there are C(20,N) different sets of N squares where the Wilds can appear.

Here is one way to do it:
First, start with the array [1, 2, 3, ..., 20]
Choose a random number R from 1 to 20; switch the first number and the Rth number
Choose a random number R from 2 to 20; switch the second number and the Rth number
Choose a random number R from 3 to 20; switch the third number and the Rth number
Repeat for the fourth, fifth, sixth, and seventh number
When you are done, the first seven numbers in the array are where the wilds go.

  • Jump to: