Calculation Challenge Game
Using 4 integer factors, how many different equations can you write that equal the Goal integer? You may only combine the 4 factors using addition, subtraction, multiplication, and division. Be sure to include any necessary parentheses to ensure the operations are performed in the intended order in your equations.
Excellent work done quickly.
1. Enter a Goal integer.
2. Either enter 4 integer factors of your choosing OR let the game choose 4 factors for you.
3. Write as many equations as you can using those 4 factors to result in the Goal integer.
4. Compare your equations with the game’s equations. Did you find all the equations?
Tip: If you are stuck and think you may have an unsolvable set of factors (i.e. no combination of the 4 factors will equal the Goal integer), click the “Only calculate statistics” button to see if any solutions exist.
Notes on Calculation Challenge Game:
· In the Restrictions section, the range’s end value must be at least one more than the range’s start value.
· Negative numbers and zero are valid factors if allowed in the Restrictions section. The Goal integer can always be negative or zero.
· Some solutions are mathematically equivalent. For example, if the 4 factors are 9, 11, 12, and 13, this game counts the following equations as separate valid equations even though they are all mathematically equivalent, i.e. each equation says to divide the sum of 9 and 13 by 11 and to multiply that result by 12:
((9 + 13) / 11) x 12
((13 + 9) / 11) x 12
12 x ((9 + 13) / 11)
12 x ((13 + 9) / 11)
It can be enlightening to see the different ways an equation can be expressed.
· For simplicity of the game’s programming and statistics, repeated factors are treated as unique factors. For example, if the 4 factors are 6, 6, 6, and 6, the game will treat each 6 as if it were unique: 61, 62, 63, and 64. This means that as far as the game is concerned, 61 + 62 + 63 + 64, 62 + 63 + 64 + 61, 62 + 61 + 64 + 63, etc. are all different equations. Since I don’t make each repeated factor visibly unique (by adding subscripts, for example) when outputting the solutions, it will appear as if identical equations are listed as solutions. For example, if all the factors are 6, there will be many solutions listed as 6 + 6 + 6 + 6. As far as the game is concerned, they’re not indentical since each solution is actually one of the 7680 possible equations for any set of 4 factors that can be combined with 4 operations (see next bullet).
· There are 7680 possible equations for any set of 4 factors that can be combined with 4 operations. We have 3 sets of items to place:
4 integer factors in any order
These can be arranged in 4! = 24 ways because there are 4 choices for the first factor and therefore 3 choices for the second factor and therefore 2 choices for the third factor and finally only one choice for the fourth factor: 4 x 3 x 2 x 1 = 4! = 24 ways
Each operator can be one of four different operations: addition, subtraction, multiplication, and division. Therefore, there are 4 choices for the first operator and 4 choices for the second operator and 4 choices for the third operator: 4 x 4 x 4 = 43 = 64 ways
2 sets of parentheses
2 sets of parentheses are required to guarantee the operations are done in the intended order regardless of operator precedence. There are 5 different arrangements of these 2 sets of parentheses (in the examples below, a—d are integers and op is one of the 4 possible operations):
Cases where (a op b) must be performed first:
1. ((a op b) op c) op d
2. (a op b) op (c op d)
Cases where (b op c) must be performed first:
3. (a op (b op c)) op d
4. a op ((b op c) op d)
Cases where (c op d) must be performed first:
5. a op (b op (c op d))
There is a 6th arrangement, but it is a repeat of a previous arrangement:
(a op b) op (c op d)
Hence, we have 24 x 64 x 5 = 7680 ways to write an equation comprised of 4 factors in any order, 3 operators that are each one of 4 operations, and 2 sets of parentheses.
· What Goal integer and factors gives the largest number of solutions? The smallest non-zero number of solutions? Here are my answers so far.
· Some statistics specific to the Calculation Challenge Game in which the Goal integer = 24 and the factor range is 1 to 13 are given here.