I want to compare the permutations of decks

48 Views Asked by At

The goal is to (dis)prove a concept by comparing permutations of decks of cards.

A deck contains a number of blue cards(b) and red cards(r). These can be any permutation of that amount of b and r. If it's a 3 card deck with two blue cards and one red, the possibilities would be:

bbr, brb, rbb

For phase 1, the fact that "b1" and "b2" could be in either position is irrelevant. Those permutations are the same, by comparison.

Therefore,

  • A 9 card deck with 4 blue cards and 5 red cards would have outcome X.
  • A 10 card deck with 4 blue cards and 6 red cards would have outcome Y.
  • If you start with the above 4b/6r deck and randomly remove 1 red card, you will have outcome Z.

The possible permutations of outcomes X and Y are, of course, different. The outcomes of X and Z should be equivalent. (I believe.)

Phase 2 would now consider the probabilities of each permutation. So, for outcomes X and Z, we want to know if the odds of each permutation are the same between X and Z. (I believe they are, again.)

My bit of searching on my own has led me to believe I want to be using itertools, but I am having trouble putting that into the context that I need it for this exercise.

0

There are 0 best solutions below