Is it possible to determine whether a number, can be made from 3 (or 4) others?

43 Views Asked by At

I am writing a numbers game involving 3 (or 4) die. The person has to make a number (from 1-25 for 3 die, and 1-100 for 4), and get from one end of a board to the other.

For example: Dice 1 = 3, Dice 2 = 5, Dice 3 = 4

Player chooses 60: (3 * 4) * 5

Is there an "easy" way to check this rather than going through all the possible arithmetic combinations? Please bare in mind that I have rusty high-school level mathematics knowledge!

3

There are 3 best solutions below

3
On BEST ANSWER

Depending on choices, you have 288 possibilities per set of rolls. But, depending on properties of operations used, you can cut out a lot of duplicates:

$$\begin{eqnarray}3\cdot4\cdot5=3\cdot 5\cdot 4=5\cdot4\cdot3=5\cdot3\cdot4=4\cdot5\cdot3=4\cdot3\cdot5\end{eqnarray}$$ and each of these have 2 parenthesized equivalents. addition with addition, also has these possibilities to eliminate without trying more than 1. etc. subtraction and division don't have as much freedom but they do have some.

1
On

Let $n$ be the number of 6-sided dices you roll, $x$ the number obtained as the product of the number displayed by each dice. Then $$x= 2^{k_1} 3^{k_2} 5^{k_3}$$ with $k_i\in \mathbb{N}$ and $1\leq k_1 \leq n$, $1\leq k_2 \leq n$, $1\leq k_3\leq 2n$. The three integers $k_1, k_2, k_3$ are not independent as if e.g. $k_3=n$ then each dice rolled a 5, hence $k_1=k_2 =1$. Essentially, your number has no prime factor other than 2,3,5. This follows because the number is obtained by multiplying numbers from 1 to 6 and 4=2*2, 6=2*3. So e.g. no 42 as 42=7*3*2.

1
On

I've just found this on StackOverflow - it looks like the problem is NP-complete - which i think means there can be no easy solution!

https://stackoverflow.com/questions/13824843/how-to-check-if-a-number-can-be-represented-as-a-sum-of-some-given-numbers