Numbers possible sequences of playing cards with multiple restrictions.

54 Views Asked by At

I was trying to work out how many sequences of 5 standard playing cards I could make with the following characteristics.

The card in position number 5 is a 5 (of any suit)

However the card in position 1 cannon be an ace, the card in position 2 cannot be a 2, the card in position 3 cannot be a 3 and the card in position 4 cannot be a 4.

The cards are all drawn from a standard deck so no repeats.

I was thinking of just doing $4\times51P4-4\times51P3$ which is 4 options for the card in position 5 multiplied by all of the possible ways to arrange the other 4 cards and then subtracting the 4 options for the card in position 4 multiplied by the ways to arrange the other 3 cards.

This gives me the same answer as when I work out the number of ways to get a 1 card sequence with an ace (4 ways) then the number of ways to get a 2 card sequence that ends with a two and subtracting the one card sequence and then repeating that process working up to a five card sequence.

The number that comes out is 23 490 600.

I realised my method might have been off when I was working out the two card sequence (as in a 2 in position two but without the Ace as the first card).

The first thing I did was $4 \times 47$, 4 for the four twos and then 47 for the first card (excluding the 4 Aces and the already used 2).

But when I thought about it another way I did $51 \times4-4$ which was 51 options for the first card (just excluding the already used 4) then multiplying by 4 for the four potential 2s and then subtracting the 4 for the options where I had one of the four aces as the first card).

I feel like the first option is right and then the second method is not accounting for something, but then that made me realise that my whole technique might be off.

It feels like just subtracting the four isn't enough, I need to subtract $4 \times 4$ to give all the two card sequences with an ace first and a two second, however I don't know how to generalise that technique to sequences of more than two cards.

Can anyone show me the correct way to do this (and also let me know what error, if any, I am making)?

1

There are 1 best solutions below

1
On BEST ANSWER

Let $N$ be the number of five-card sequences with a five in the fifth position. Since there are four fives in the deck, there are $4$ ways to fill the fifth position, which leaves $51$ ways to fill the first position, $50$ ways to fill the second position, $49$ ways to fill the third position, and $48$ ways to fill the fourth position. Hence, there are $$N = 51 \cdot 50 \cdot 49 \cdot 48 \cdot 4$$ five-card sequences with a five in the fifth position. From these, we wish to wish to subtract those sequences which violate one of the other four restrictions.

Let $A_k$, $1 \leq i \leq 4$, be the set of outcomes in which an $i$ appears in the $i$th position and a five appears in the fifth position, where we treat an ace as a one. Then, by the Inclusion-Exclusion Principle, the number of five-card sequences which have a five in the fifth position, but do not have an ace in the first position or a two in the second position or a three in the third position or a four in the fourth position is \begin{align*} N - & |A_1 \cup A_2 \cup A_3 \cup A_4|\\ & = N - \sum_{i = 1}^{4} |A_i| + \sum_{1 \leq i < j \leq 4} |A_i \cap A_j| - \sum_{1 \leq i < j < k \leq 4} |A_i \cap A_j \cap A_k| + |A_1 \cap A_2 \cap A_3 \cap A_4| \end{align*}

$|A_1|$: There are four ways to place an ace in the first position, four ways to place a five in the fifth position, which leaves $50$ ways to place a card in the second position, $49$ ways to place a card in the third position, and $48$ ways to place a card in the fourth position. Hence, $$|A_1| = 4 \cdot 50 \cdot 49 \cdot 48 \cdot 4$$

By symmetry, $$|A_1| = |A_2| = |A_3| = |A_4|$$

$|A_1 \cap A_2|$: There are four ways to place an ace in the first position, four ways to place a two in the second position, and four ways to place a five in the fifth position, leaving $49$ ways to place a card in the third position and $48$ ways to place a card in the fourth position. Hence, $$|A_1 \cap A_2| = 4 \cdot 4 \cdot 49 \cdot 48 \cdot 4$$

By symmetry, $$|A_1 \cap A_2| = |A_1 \cap A_3| = |A_1 \cap A_4| = |A_2 \cap A_3| = |A_2 \cap A_4| = |A_3 \cap A_4|$$

$|A_1 \cap A_2 \cap A_3|$: There are four ways to place an ace in the first position, four ways to place a two in the second position, four ways to place a three in the third position, and four ways to place a five in the fifth position, leaving $48$ ways to place a card in the fourth position. Hence, $$|A_1 \cap A_2 \cap A_3| = 4 \cdot 4 \cdot 4 \cdot 48 \cdot 4$$

By symmetry, $$|A_1 \cap A_2 \cap A_3| = |A_1 \cap A_2 \cap A_4| = |A_1 \cap A_3 \cap A_4| = |A_2 \cap A_3 \cap A_4|$$

$|A_1 \cap A_2 \cap A_3 \cap A_4|$: There are four ways to place an ace in the first position, four ways to place a two in the second position, four ways to place a three in the third position, four ways to place a four in the fourth position, and four ways to place a five in the fifth position. Hence, $$|A_1 \cap A_2 \cap A_3 \cap A_4| = 4 \cdot 4 \cdot 4 \cdot 4 \cdot 4$$

Thus, by the Inclusion-Exclusion Principle, the number of admissible five-card sequences is $$51 \cdot 50 \cdot 49 \cdot 48 \cdot 4 - 4 \cdot 4 \cdot 50 \cdot 49 \cdot 48 \cdot 4 + 6 \cdot 4 \cdot 4 \cdot 49 \cdot 48 \cdot 4 - 4 \cdot 4 \cdot 4 \cdot 4 \cdot 48 \cdot 4 + 4 \cdot 4 \cdot 4 \cdot 4 \cdot 4$$