Lucky numbers?

A bus ticket has 4 numbers, and ranges from 0000 to 9999. It is considered lucky if the sum of the first 2 numbers equals the sum of the last two numbers. How many lucky tickets are there?

  • This question has been reposted from Brilliant. I request that Quora users do not post their solutions till July 31 - Calvin Lin, Brilliant Challenge Master. Clarification: Bus tickets can start with the number 0. The bus ticket 0000 is a lucky ticket.

  • Answer:

    The highest sum you get for the first 2 numbers is 18 (9+9). The next highest is 17, which can be formed from 9+8,8+9. The 3rd highest is obviously 16, which can be formed by 9+7, 8+8,7+9. Similarly 15 can be formed by 9+6, 8+7, 7+8, 6+9.     We wish to find how many ways we can find such sums for an integer0⩽x⩽180⩽x⩽180 \leqslant x  \leqslant 18. Notice that xxx and 18−x18−x18-x have the same answer since for each combination a+ba+ba+b there is the combination (9−a)+(9−b)(9−a)+(9−b) (9-a)+(9-b) (which makes since because all summands must be at most 9). Also, we are guaranteed there are no more combinations of 18−x18−x18-x  since if there was (say, c+dc+dc+d), then (9−c)+(9−d)\eq18−(c+d)\eq18−(18−x)\eqx(9−c)+(9−d)\eq18−(c+d)\eq18−(18−x)\eqx(9-c)+(9-d) \eq 18-(c+d) \eq 18-(18-x) \eq x .     So without a loss of generality we can let xxx be at least 9. As you can see from the example in the beginning, all of the combinations can be organized by the first summand. For example, 15's combinations can be seen as 9,8,7,6. Thus it will suffice to find the last number in this sequence for xxx. This is because it will tell us how many numbers are in the sequence (ie. 10 minus the last number) which is the same as the number of combinations. The last number is x−9x−9x-9 since it corresponds with the combination (x−9)+9(x−9)+9(x-9)+9 (which is the last one purely because of how we order them).

Alec Greene at Quora Visit the source

Was this solution helpful to you?

Other answers

Let f(x) be the number of ways two decimal digits can sum to x. Then the number of lucky tickets is 18∑i=0f(i)2∑i=018f(i)2\sum\limits_{i=0}^{18} f(i)^2 f(0), f(1), ... f(18) = 1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1 So the number of lucky tickets is 1+4+9+16+25+36+49+64+81+64+49+36+25+16+9+4+1 = 489

Andrew Weimholt

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.