How many valid expressions for countdown numbers round? If you haven't seen Countdown before watch a quick numbers round. For the more detailed constraints please read. I'll paraphrase the rules below.
Given a list $A$ of $n$ positive integers, how many unique sequences of calculations are possible? Each sequence is subject to:

*

*It only uses the four basic operations of addition, subtraction, multiplication and division.

*Not all $n$ integers have to be used to be considered a sequence.

*A number may not appear more times than it is provided in $A$.

*Division can only be performed if there is no remainder.

*Only positive integers may be obtained as a result at any stage of the calculation.

*Associative calculations should only be counted once e.g. $(4 + 2) - 5$ is considered the same as $(2 + 4) - 5$.

My observation:

*

*For any pair of integers there are only 4 possible permutations not 8. Because addition and multiplication are associative so we only count them once leaving us with 6. One of the permutations will result in a fraction, leaving us with 5. One of the permutations will result in a negative number leaving us with 4. The last two observations hold where the numbers are different but the operations will be redundant if the numbers are identical so we still end up with 4.

Following this I came up with

$$
total = n!4^n + (n-1)!4^{n-2} + ... + 1!4^{0}
$$
$$
total = \sum_{i=1}^{n} i!4^{i-1}
$$
So for $n=6$ as in the game there are 769,641?
This is a decent upper bound but there will still be whole branches of calculations which will be void because there could be some fraction, zero division or negative number.
Any way to get a better approximation?
 A: I have created a python3 script to generate all solutions to a countdown numbers game, available on github: https://github.com/armchaircaver/Countdown-numbers-game
The program produces some analysis for a few random selections of cards.  A typical set of 6 cards, either 5 small + 1 large or 4 small+2 large, produces up to 40000 (approx) valid expressions that are in the range 101 to 999, the target range for the countdown game.
Without the constraint that the expression has a value in the range 101-999, there are typically up to 100,000 valid expressions for a set of cards.
Additional comments 10/8/2021:
Here are results of a larger statistical test, using samples of 100 for each type of card combination:
Random combinations of 2 top + 4 bottom, counting all expressions
mean: 58451.15 , median: 50650 , st dev: 21933.5
minimum: 15046 ,maximum: 110308
Random combinations of 1 top + 5 bottom, counting all expressions
mean: 51877.96 , median: 47105 , st dev: 21859.7
minimum: 9461 ,maximum: 125137
The variabilility of the number of expressions and the sensitivity of the number of valid expressions to the cards selected suggest that it would be difficult to obtain a mathematical formula for the number of solutions, and that a statistical analysis is the only realistic approach.
