# Reveal all five equations

Five men enter a bar.

• 1st man order 1 Pepsi and 1 Cocacola
• 2nd man order 2 Pepsi and 1 Cocacola
• 3rd man order 3 Pepsi and 1 Cocacola
• 4th man order 4 Pepsi and 1 Cocacola
• 5th man order 5 Pepsi and 1 Cocacola

But the bar runs out of Pepsi and Cocacola.

To avoid the customers' disappointement, the bartender comes up with a solution.
He gives each man a glass of cocktail, and explains :

If each letter represents a digit, we can write it like this :

1 pepsi + 1 cocacola = 1 cocktail
or
2 pepsi + 1 cocacola = 1 cocktail
or
3 pepsi + 1 cocacola = 1 cocktail
or
4 pepsi + 1 cocacola = 1 cocktail
or
5 pepsi + 1 cocacola = 1 cocktail

After hearing the bartender's explanation, the five men accept his reason, and they are all happy about this mathematical reasoning.

Your task :

Reveal all five math equations !

• Can I ask, did you mean to switch the numbers? So, should "1 pepsi + 2 cocacola = 1 cocktail" be instead "2 pepsi + 1 cocacola = 1 cocktail"? Commented Aug 19, 2016 at 10:40
• I have edited the question, thanks for the correction. Commented Aug 19, 2016 at 11:03

## 2 Answers

I'm not sure I get it right.
If our task is to give a distinct one-digit numerical value to all the letters so that all the equations hold, then this might work (although not the only solution - there are 2x2x3!x3!x3x3!=2592 of them, I won't post them all):

a=9; c=8; e=2; i=4; k=3; l=7; o=1; p=0; s=5; t=6

Then

pepsi $=0\times2\times0\times5\times4=0$
cocacola $=8\times1\times8\times9\times8\times1\times7\times9=290304$
cocktail $=8\times1\times8\times3\times6\times9\times4\times7=290304$
So, no matter how many times you add pepsi (0) to the cocacola (290304), it still remains cocktail (290304).

However, if my interpretation of products is wrong, and @Marius has the good approach with concatenation, then the possible answers are these:

n pepsi cocacola cocktail
1 42497  6010681  6053178
1 24296  8010871  8035167
1 26294  8010851  8037145
1 47492  6010631  6058123
1 40497 26212681 26253178
1 43489 27212701 27256190
1 42489 37313701 37356190
1 20296 48414871 48435167
1 20294 68616851 68637145
1 40492 76717631 76758123
1 75781  4020432  4096213
1 34378 19121902 19156280
1 31378 49424902 49456280
1 70781 54525432 54596213
1 19183 70727052 70746235
1 17183 90929052 90946235
1 51563  8040874  8092437
1 50563 18141874 18192437
1 15123 46474607 46489730
1 14123 56575607 56589730
2 15192 76707640 76738024
2  4083 69616971 69625137
2  6089 52535213 52547391
2 27264 58535813 58590341
2  6097 12141284 12153478
2  8021 34353475 34369517
3  4078 39313951 39326185
3 20239 54515481 54576198
3 27204 65616531 65698143
3 26204 85818531 85897143
3 12176 80858035 80894563
4 18153 64606420 64679032
4 10179 35323582 35364298
4 10173 85828542 85869234
4  8014 52535293 52567349
4 10137 59545924 59586472
4  7069 43454315 43482591
4  1028 94959475 94963587
4  7013 45464586 45492638
4  3071 45484528 45496812
5 12149 73707350 73768095
5 13169 82808250 82874095
5  7015 42434283 42469358
5  1075 69636983 69642358

Where n stands for which equation we are referring to: n pepsi + 1 cocacola = 1 cocktail.
I posted answers which have leading zeros, if those are considered invalid, just neglect them.
I did not come up with these manually, used a few lines of python code to get them:
 import itertools as it for n in range(1,6): for (a,c,e,i,k,l,o,p,s,t) in it.permutations(range(10)): pepsi = 10100*p+1000*e+10*s+i cocacola = 10101000*c+1000100*o+10001*a+10*l cocktail = 10100000*c+1000000*o+10000*k+1000*t+100*a+10*i+l if n*pepsi+cocacola==cocktail: print '{0:1d} {1:5d} {2:8d} {3:8d}'.format(n, pepsi, cocacola, cocktail) 

• Amazing, What I expected is the answer like marius, but you came with another good answer (reasoning). Commented Aug 19, 2016 at 12:54

Partial Answer:

I'll start with the last one because it looks easier:

    PEPSI +
PEPSI +
PEPSI +
PEPSI +
PEPSI +
COCACOLA =
COCKTAIL


Because COC is repeated in the last line and in the result it means that P has to be 1. Otherwise we cat a carry from the 10 thousands place and the sum breaks.

Now we have:

    1E1SI +
1E1SI +
1E1SI +
1E1SI +
1E1SI +
COCACOLA =
COCKTAIL


Other restrictions.

A <= 4 because of the same reason as above.
I is odd, otherwise A = L ($5*I + A$ would end in A).
From the above we conclude that $L = A+5$
This immediately results $E=0$ (otherwise we get a carry) and A not being 4 because it will result in $K=L=9$.
Continuing with $A = 3$. This means $L = 8$
now we have

    1E1SI +
1E1SI +
1E1SI +
1E1SI +
1E1SI +
COC3CO83 =
COCKT3I8


E can be either 0 or 2 so we won't get on the thousands column a carriage over 2 that will lead in a carriage on the 10thousands column.
but for $E = 0$ would result in $K = 8$ but $L = 8$ already. So $E = 2$

Now we have :

    121SI +
121SI +
121SI +
121SI +
121SI +
COC3CO83 =
COC9T3I8


based on the conclusions above trying with $i=5$ we get $S = 7$ and we reach a contradiction later because we either get $C=K=9$ ($T = S = 7$).
Following the same logic we can disprove that A can be 2.
So we end up with $A = 0$

Now we have:

    1E1SI +
1E1SI +
1E1SI +
1E1SI +
1E1SI +
COC0CO50 =
COCKT0I5     (L = 5 because I is odd)


Further on:

Trying the possible values 3,7,9 for $I$, I ended up with 2 solutions:

    12149 +
12149 +
12149 +
12149 +
12149 +
73707350 =
73768095


And
    13169 +
13169 +
13169 +
13169 +
13169 +
82808250 =
82874095


That's it for now. I will try an other equation later.

• great work on equations. +1
– A J
Commented Aug 19, 2016 at 17:46