rec.puzzles Archive

How many six-digit tickets (000001 to 999999) have the sum of the first three digits equal to the sum of...

combinatorics/lucky.ticket New

New entry, edited from material collected for the archive and not yet in a released version.

Problem

How many six-digit tickets (000001 to 999999) have the sum of the first
three digits equal to the sum of the last three?

In Russia, you pay for a street transport (buses, trolleybuses, trams)
in the following way: you buy a "band" of tickets (printed on a band of
perforated paper) beforehand, and when you come into a bus, you tear
off one ticket and puncture it in a punch. Each ticket has a 6-digit
number (from 000001 to 999999, and there are also some letters for the
series, that we would not mention here). It is a common belief, that
some tickets are "lucky", namely, those in which the sum of the first
three digits equals to the sum of the last three digits, e.g., 136082.

The question is, how many lucky tickets are there in one series? How
often will you come upon a "lucky" ticket, if you go by one kind of
public transport two times on each working day?

-- Leonid Asanov <olimpus@dol.ru> (posted by Chris Cole)
Show solution
The ticket abcdef will be lucky iff the ticket abc(9-d)(9-e)(9-f) has
digits which add to 27.  Therefore the number of lucky tickets in a
series is the same as the number of ways of picking 6 digits which add
to 27 (minus 1, since ticket 000000 does not exist.)  This is the same
as the coefficient of x^27 in (1+x+...+x^9)^6 = (1-x^10)^6/(1-x)^6.
Recalling that the coefficient of x^i in 1/(1-x)^r is the binomial
coefficient C(r+i-1,r-1), we find the number of ways to be
C(32,5) - C(6,1) C(22,5) + C(6,2) C(12,5) = 55252.  Subtracting 1 gives
us 55251 lucky tickets out of 999999, so at 2 tickets per day we expect
a lucky one every 9 days or so.

-- David Moews <dmoews@xraysgi.ims.uconn.edu>