Consider a deck of cards with values $1$ through $13$, each with multiplicity $4$, so that $$S = \left( \bigcup_{i=1}^{13} \{ i \} \right) \times \{1,2,3,4\}$$
Supposedly, there exists a game in which four cards $(v,m)$ in $S$ are selected (here $m$ stands in for the suit), and participants try to devise a series of operations using:
- addition $+$;
- subtraction $-$;
- multiplication $\times$;
- division $\div$;
- exponentiation $\wedge$;
- factorial-ization $!$; and
- any number of parentheses $()$
on the $v$-values that yields $24$. For example,
$$(2, 1) \times (10,3) - (2,4) + (3,2)! = 24$$
- Do there exist any combinations of cards for which no series of operations yielding $24$ exists?
- What mathematical processes could one use to analyze other aspects of solutions, such as how many solutions exist?
This is a post-examination game we are playing in class to kill time. I haven’t the slightest idea of how one would approach any sort of ‘proof.’
EDIT: there was a bug in my code so it missed some solutions. There are actually only 48 unsolvable hands, not 56.
EDIT 2: due to rounding errors, my code thought [9,7,5,5] was solvable, when in fact it is not (see update below).
I have played that game too, so when I saw your question I was pretty sure there are some hands that have no series reaching 24. Since there's only $\binom{52}{4} = 270,725$ possible hands of 4 cards (even less since this game doesn't count suits), I figured it would be feasible to do a computer search to find all of these solutions (see the bottom for my code).
My program found solutions for all but 48 hands (ignoring different suits):
Counting suits, this works out to be 2413 possibilities out of the 270,725 total hands, or a probability of just a tad below 0.9%.
Since my program did not use factorials of any numbers larger than 13, so it is possible that some of these 48 actually do have solutions, but I don't find that very likely. Among these combinations all have repeated cards. None of the combinations have a 2, 3, 4, or 5, and only one has a 12. Surprisingly, the most common number in the unsolvable hands is 10 (accounting for suits, it shows up in 1109 out of the 2413 unsolvable hands). As someone who has played this game a lot, I was expecting 11 or 13 to be the most likely to give an unsolvable hand, but they only showed up in 845 and 1073 unsolvable hands, respectively.
As for the number of ways to get to 24 from a given hand, my program didn't really look at that because I was trying not to make the program take up to much computational power, and it was much easier to simply remember a single boolean than a whole chain.
Rounding errors update:
[9,7,5,5] is not a solution, but my code thinks it is due to rounding errors. For example, it couldn't distinguish $9^{5-7!}$ from $0$, and found this "solution":$$ \left(5 - \left(9^{5-7!}\right)!\right)! \approx 24 $$ If you use the gamma function to interpolate the factorials, this is off by only about$5\times 10^{-4804}$.
Removing exponentiation from the options, other than using $1^a = 1$, shows that this is the only solution that took advantage of this particular numerical error. Since I didn't ever take a factorial of a number bigger than 13, the factorials should not have introduced any other fake solutions.
Some interesting example hands: Among the hands that have solutions, I've chosen to highlight a few particularly interesting ones:
If you want to challenge yourself, see if you can solve these before looking at the solutions.
[13,11,10,6]
[13,6,1,1]
[9,7,7,7]
If you disallow factorials, there are fully 430 unsolvable hands (not counting suits). Some of my favorite solutions without factorials include [11,11,1,5], [13,12,10,8], [11,11,5,5] and [5,1,1,1], which have the following unique non-factorial solutions:
[13,12,10,8]
[11,11,5,5]
[11,11,5,1]
[5,1,1,1]
Below is my Haskell program. Programming is not my strong point, so excuse the messiness.