1

Let's say I have $9$ variables $(a, b, c, d, e, f, g, h, i)$ and I know they are all different and they all have values between $1$ and $9$ included. Basically these variables will each have a different value between 1 and 9.

So:

$$a, b, c, d, e, f, g, h, i \in [1, 9]$$

$$a \neq b \neq c \neq d \neq e \neq f \neq g \neq h \neq i$$

I also know that:

$$a + b + c + d + e = 22$$

$$a + b + f + g + h = 22$$

$$d + e + g + h + i = 22$$

How do I determine the values of $a, b, c, d, e, f, g, h, i$?

TShiong
  • 1,257
user
  • 1,123

3 Answers3

2

The first thing to notice is that there is likely to be a lot of solutions since given any solution we can interchange various pairs of letters and keep the same sums.

The letters $c,f,i$ are special in that they all occur in only one equation and can all be interchanged with each other.

The sums of five numbers adding to $22$ and containing a $9$ are $$1,2,3,7,9$$ $$1,2,4,6,9$$ $$1,3,4,5,9$$ Any one of these solutions has three elements in common with any other. This is not the case for your equations and so the $9$ can only be in one of the equations i.e. $9$ must be one of $c,f,i$.

Similarly, $8$ must also be one of $c,f,i$ and then $7$ also is one of $c,f,i$. Without loss of generality we can suppose $$c=9,f=8,i=7. $$

The equations are now easy to solve. For example:

$abcdefghi$ are respectively $249168357$.

Number of solutions

There are $3!$ possibilities for $c,f,i$. For each of these possibilities $a+b,d+e,g+h$ are then determined as $6,7,8$ in a particular order. These can be split as either $1+5,3+4,2+6$ or $2+4,1+6,3+5$. The total number of solutions is therefore $$3!\times2\times2^3=96.$$

2

Let

$$\begin{cases}A&:=&a+b\\ B&:=&d+e\\ C&:=&g+h\end{cases}\tag{*}$$

giving for the initial system:

$\begin{cases}A+B+c&=&22\\ A+C+f&=&22\\B+C+i&=&22\end{cases}\tag{1}$

Besides, knowing that the sum of integers from $1$ to $9$ is $45$, the complementary system of the initial system is:

$\begin{cases}C+f+i&=&23\\ B+c+i&=&23\\A+c+f&=&23\end{cases}\tag{2}$

Let $s=c+f+i$ and $S=A+B+C$, we get by adding the equations in (1) and in (2):

$\begin{cases}2S+s&=&23\\S+2s&=&69\end{cases}\tag{3}$

a linear system whose solution is

$$s=c+f+i=24 \ \text{and} \ \ S=A+B+C=21\tag{4}$$

The first relationship in (4) is especially interesting because it means that:

$$\{c,f,i\}=\{7,8,9\}\tag{5}$$

implying that

$$\{a,b,d,e,g,h\}=\{1,2,3,4,5,6\}\tag{6}$$

Now, an exhaustive search can be obtained by writing (2) under the form:

$\begin{cases}C&=&23-f-i\\ B&=&23-c-i\\A&=&23-c-f\end{cases}\tag{7}$

for the $3!=6$ different combinations:

$$(c,f,i)=(7,8,9), \ \ (7,9,8), ... (9,8,7)$$

and checking each time whether the values of the triple $(A,B,C)$ are compatible with constraints (*) and (6).

Remark: in fact, an exhaustive search is rapidly done with the two solutions :

$$\begin{cases}A&=&2+4\\ B&=&1+6\\C&=&3+5\end{cases} \ \ \text{or} \ \ \begin{cases}A&=&1+5\\ B&=&3+4\\C&=&2+6\end{cases}\tag{8}$$

and their permutations.

This gives a total number of $96$ solutions in agreement with the result found by @S. Dolan (to whom I am indebted for having found a flaw in my computations).

Edit : Here is the list of the $96=2 \times 6 \times 8 $ solutions (ranked by lexicographic order, see below), the examination of which helps to understanding the declination of the 2 families of solutions (see (8)) with a tree structure with $6 \times 8$ branches. Indeed, there are $6$ ways to interchange the positions of $c,f,i$ ; and $8$ ways to arrange a solution, for given $A$ or $B$ or $C$, due to resp. exchanges:

$$a \leftrightarrow b, \ \ d \leftrightarrow e, \ \ g \leftrightarrow h.$$

$$\begin{array}{1} 158269347\\ 158269437\\ 158629347\\ 158629437\\ 159348267\\ 159348627\\ 159438267\\ 159438627\\ 167359248\\ 167359428\\ 167539248\\ 167539428\\ 169247358\\ 169247538\\ 169427358\\ 169427538\\ 248359167\\ 248359617\\ 248539167\\ 248539617\\ 249168357\\ 249168537\\ 249618357\\ 249618537\\ 267348159\\ 267348519\\ 267438159\\ 267438519\\ 268157349\\ 268157439\\ 268517349\\ 268517439\\ 347269158\\ 347269518\\ 347629158\\ 347629518\\ 349157268\\ 349157628\\ 349517268\\ 349517628\\ 357168249\\ 357168429\\ 357618249\\ 357618429\\ 358247169\\ 358247619\\ 358427169\\ 358427619\\ 428359167\\ 428359617\\ 428539167\\ 428539617\\ 429168357\\ 429168537\\ 429618357\\ 429618537\\ 437269158\\ 437269518\\ 437629158\\ 437629518\\ 439157268\\ 439157628\\ 439517268\\ 439517628\\ 518269347\\ 518269437\\ 518629347\\ 518629437\\ 519348267\\ 519348627\\ 519438267\\ 519438627\\ 537168249\\ 537168429\\ 537618249\\ 537618429\\ 538247169\\ 538247619\\ 538427169\\ 538427619\\ 617359248\\ 617359428\\ 617539248\\ 617539428\\ 619247358\\ 619247538\\ 619427358\\ 619427538\\ 627348159\\ 627348519\\ 627438159\\ 627438519\\ 628157349\\ 628157439\\ 628517349\\ 628517439 \end{array}$$

Jean Marie
  • 81,803
1

Adding all the equations gives $$2a+2b+c+2d+2e+f+2g+2h+i=66$$ Since twice the sum of all the letters is $90$ we have $c+f+i=24$ and therefore $c,f,i$ are $7,8,9$ in some order.

Now use either of the earlier answers!