question from Saint Petersburg selection competition of 1989, about determining the difference between the size of two sets $A$ and $B$

122 Views Asked by At

I was just trying to do the following question:

We have tickets which are 6-digit numbers from 000000 till 999999. A ticket is considered lucky, if the addition of its first 3 digits is equal to the addition of its last 3. It is considered medium if the addition of its digits is equal to 27. I state that $A$ and $B$ are the are the amounts of lucky and medium tickets correspondingly. Calculate $A-B$.

Despite trying for a lot of time to solve it, I did not succeed and had to look at the solution. The solution goes as follows:

We have that $A-B=0$ from the fact that the correspondence $abcxyz\rightarrow abc(9-x)(9-y)(9-z)$ between lucky and medium tickets is (injective-bijective-onebyone I'm not sure what it translates to, I used a translator for this word and these are the terms that came up).

I feel that this is a beautiful solution, however I can't understand it. Could you please explain to me the thought process and why what the author is saying, holds true?

1

There are 1 best solutions below

1
On BEST ANSWER

Suppose $abcxyz$ is lucky, then $$a+b+c =x+y+z$$ It follows that $$a+b+c+(9-x)+(9-y)+(9-z)=27$$ The correspondence $x\to 9-x$ is one to one (in fact bijective) for digits $0,1,\cdots,9$ (say by parity arguement),so it follows that the mapping of tickets $$abcxyz\rightarrow abc(9-x)(9-y)(9-z)$$ is also one-to-one, in fact bijective as this is an involution (meaning $9-(9-x)=x$). This tells us that given a lucky ticket, there is a unique medium ticket associated through this correspondence, and vice-versa, so there must be the same number of lucky and medium tickets, i.e. $A=B$