I would like to answer following question. Is it possible to get six using four nines and adding, subtracting, multiplying, division and parentheses? For instance:
(9+9+9)/9=3
(9*9+9)/9=10
and now how can I get:
9 ? 9 ? 9 ? 9 = 6
I would like to answer following question. Is it possible to get six using four nines and adding, subtracting, multiplying, division and parentheses? For instance:
(9+9+9)/9=3
(9*9+9)/9=10
and now how can I get:
9 ? 9 ? 9 ? 9 = 6
It is not possible with just the operations that you mention. In this case, the proof isn't too hard; we can just enumerate all the possibilities. Start by noticing that there are only five distinct trees of operations on four nodes (the four $9$s), which correspond to $((9\circ 9)\circ 9)\circ 9$, $(9\circ (9\circ 9))\circ 9$, $((9\circ 9)\circ(9\circ 9))$, $9\circ ((9\circ 9)\circ 9)$, and $9\circ (9\circ (9\circ 9))$.
Now, we could look at all $4^3$ assignments of operations to each tree and look at the $5\cdot 4^3=320$ possible values that result, and this isn't too complicated in its own right, but fortunately there are shortcuts by 'memoizing' the relevant values. We can start by finding all of the values $9\circ 9$ for $\circ\in\mathcal{O}$, where $\mathcal{O}$ is the set of operators $\mathcal{O} = \{+, -, \times, \div\}$; this set is $A=\{0, 1, 18, 81\}$. This by itself is enough to eliminate the structure $((9\circ 9)\circ (9\circ 9))$ because it's clear that none of the 64 expressions $a\circ b$ for $a,b\in A$ and $\circ\in\mathcal{O}$ can result in $6$.
The rest of the structures are all of the form $9\circ b$ or $b\circ 9$, where $b$ is of the form $9\circ a$ or $a\circ 9$ for $a\in A$, so next we look at the possible results $b$ of the operations $b=9\circ a$ and $b=a\circ 9$ for $a\in A$. Since $+$ and $\times$ are commutative, there are only 24 possible values here, and it turns out that many of them conflate. The total set of results is $B=\{0, \frac19, \frac12, 2, \pm 8, \pm 9, 10, 27, \pm 72, 90, 162, 729\}$.
Finally, we could compute $9\circ b$ and $b\circ 9$ for all $b\in B$ and $\circ\in \mathcal{O}$, but this would be a lot of possible values, and it turns out that there's a shortcut: if $b\circ 9=6$ or $9\circ b=6$, for $b\in B$, then we could invert our $\circ$ operator (note that each member of our set of operators $\mathcal{O}$ has its inverse in $\mathcal{O}$) to get $b=6\circ 9$ or $b=9\circ 6$ for some other $\circ\in\mathcal{O}$. Now, the set of possible values of $9\circ 6$ and $6\circ 9$ are $\{15, \pm 3, 54, \frac32, \frac23\}$ and by inspection none of these is in $B$.