Discrete Solutions
Discrete Solutions
1. Katy writes down an odd composite positive integer less than 1000. Katy then generates a new
integer by reversing the digits of her initial number. The new number is a multiple of 25 and is
also less than her initial number. What was the initial number that Katy wrote down?
Answer: 573
Solution: Because the reversed number is a multiple of 25, it must end in either 00, 25, 50, or
75. However, because the leading digit of the initial number cannot be a 0, the reversed number
must end in 25 or 75. Therefore, the initial number must start with either the digits 52 or 57.
Because the reversed number is less than the initial number, the last digit of the initial number
must be less than 5. Furthermore, since the initial number is odd, the last digit must be either
1 or 3. Therefore, the four possible values of Katy’s initial number are 521, 523, 571, and 573.
Of these, only 573 is composite as it is equal to 3 · 191. Therefore, Katy’s initial number was
573.
2. Find the probability that a randomly selected divisor of 20! is a multiple of 2000.
6
Answer: 19
Solution: The prime factorization of 2000 is 2000 = 24 · 53 . So we essentially need to find the
probability that a randomly selected divisor of 20! has both a factor of 24 and of 53 . The prime
factorization of:
20! = 218 · 38 · 54 · · ·
so a randomly selected divisor of 20! is in the form 2a · 5b · k where k is an integer with no factor
of 2 or 5, a is chosen randomly from {0, 1, . . ., 18} and b is chosen randomly from {0, 1, . . . ,
4}. There are 15 successful choices for a of a possible 19 and 6 successful choices for 2 out of a
15 2 6
possible 5. Hence our probability is 19 · 5 = 19 .
n n
d ni e and B(n) = b ni c. Compute A(2020) − B(2020).
P P
3. Let A(n) =
i=1 i=1
Answer: 2008
Solution:
2020
X
2020 2020
A(2020) − B(2020) = − ,
i i
i=1
4. What is the smallest positive multiple of 2020 that has all distinct digits?
Answer: 351480
Solution: A number is divisible by 2020 if and only if it is divisible by both 20 and 101. For
a number to be divisible by 20, it must end in either 00, 20, 40, 60, or 80. Because 101 ≡ −1
(mod 100), a number is divisible by 101 if and only if the sum of alternating two-digit blocks is
divisible by 101.
Note that there are no four-digit numbers that fit the condition as 2020, 4040, 6060, and 8080
each have two 0s as digits. Therefore, the smallest number must have at least 5 digits. In order
for a five-digit number ABCDE to be divisible by 2020, D must be even, E must be 0, and
A + DE − BC must be a multiple of 101. Because A + DE ≤ 9 + 80 < 101, A + DE − BC can
SMT 2020 Discrete Math Test Solutions February 22, 2020
Answer: 7
Solution: The natural first step is to start by taking the base-2 logarithm of the right hand
side:
16
1616 16
log2 16 = 4 · 1616 .
Hence
2 22
22 16 22
22 1616 22
2 < 16 <2 ,
and the answer is n = 7.
6. William has a bag of white, milk, and dark chocolate bars. Each minute he reaches into the bag,
selects a chocolate bar at random, and eats it. Given that there are 17 milk chocolate bars, 12
dark chocolate bars, and 19 white chocolate bars, what is the probability that William runs out
of milk chocolate bars first and dark chocolate bars second?
Answer:
19
116
SMT 2020 Discrete Math Test Solutions February 22, 2020
Solution: We can equivalently find the probability that William runs out of white chocolate
bars LAST and dark chocolate bars second to last. Equivalently this is the probability that
the last remaining bar is white chocolate, and INDEPENDENTLY among the milk and dark
chocolate bars, the last one remaining is dark. The probability that the last remaining bar is
white is:
19 19
=
17 + 12 + 19 48
because it is just the probability of randomly selecting a white chocolate bar from all of the bars
in the bag. The probability that among the milk and dark chocolate bars, the last remaining is
dark is equivalently the probability of randomly selecting a dark chocolate bar from among the
dark and milk which is:
12 12
=
17 + 12 29
Multiplying our independent probabilities we get:
19 12 19
· =
48 29 116
7. A rook is on a chess board with 8 rows and 8 columns. The rows are numbered 1, 2, . . ., 8
and the columns are lettered a, b, . . ., h. The rook begins at a1 (the square in both row 1 and
column a). Every minute, the rook randomly moves to a different square either in the same row
or the same column. The rook continues to move until it arrives a square in either row 8 or
column h. After infinite time, what is the probability the rook ends at a8?
1
Answer: 6
Solution: Observe that there are are a total of 14 possible squares that the rook can end at
as the rook can never reach h8. By symmetry, if the rook is at square xY where x represents a
column from a to g and Y represents a row from 1 to 7, Rook has equal probability at x8 and
hY. We will denote this probability as x. Similarly, the rook has an equal probability of ending
at each of the other 12 reachable squares in column h or row 8. We will denote this probability
as y. This gives us the equation 2x + 12y = 1. Furthermore, note that x is the probability that
the rook ends at a8 when the rook starts at a1.
Now consider the probability that the rook ends at a8 after the first move. The rook has 14
possible first moves (which can be split into 4 cases):
1
(a) The rook moves directly to a8 and stops. This occurs with probability 14 .
6
(b) The rook moves to one of a2, a3, ..., a7. This occurs with probability 14 and from each
these positions, the rook has probability x of ending at a8.
6
(c) The rook moves to one of b1, c1, ..., g1. This occurs with probability 14 and from each
these positions, the rook has probability y of ending at a8.
1
(d) The rook moves directly to h1, stops and cannot reach a8. This occurs with probability 14 .
1 6 6
Together we have x = 14 · 1 + 14 · x + 14 · y + 0. Solving with our earlier equation, we get x = 61 .
8. Suppose Joey is at the origin and wants to walk to the point (20, 20). At each lattice point,
Joey has three possible options. He can either travel 1 lattice point to the right, 1 lattice point
above, or diagonally to the lattice point 1 above and 1 to the right. If none of the lattice points
SMT 2020 Discrete Math Test Solutions February 22, 2020
Joey reaches have their coordinates sum to a multiple of 3 (excluding his starting point), how
many different paths can Joey take to get to (20, 20)?
Answer: 4356
Solution: Notice that the sum of the coordinates will either increase by one if he travels directly
upwards or directly to the right or increase by two if he travels diagonally. Therefore, when the
sum of the coordinates is congruent to 2 mod 3, he must travel diagonally and when the sum
of the coordinates is congruent to 1 mod 3, he must travel directly upwards or directly to the
right. If we denote travelling diagonally with the letter D and travelling either upwards or to
the right with the letter S, there are two possible combinations for Joey’s path.
If Joey’s first step is diagonal, he must take the path D |{z} DS D, where 6 of the S steps are
12 times
travelling to the right and the other 6 of the S steps are travelling upwards. There are 12
6 = 924
possible paths that fit this condition. If Joey’s first step is not diagonal, he must take the path
SS |{z}
DS D, where 7 of the S steps are travelling to the right and the other 7 of the S steps
12 times
are travelling upwards. There are 14
7 = 3432 possible paths that fit this condition. Therefore,
there are a total of 12 14
6 + 7 = 924 + 3432 = 4356 possible paths Joey can take.
9. Elena and Mina are making volleyball teams for a tournament, so they find 15 classmates and
have them stand in a line from tallest to shortest. They each select six students, such that no
two students on the same team stood next to each other in line. How many ways are there to
choose teams?
Answer: 2570
Solution: Case 0: 0 parity swaps (EMEMEMEMEMEM)
15
In this case, we know the ordering is fixed as EMEMEMEMEMEM, so there are simply 3 =
455 ways to insert 3 unchosen players into this ordering.
In this case, note that the size of the two sections we divide our chosen player into must both be
even, as an odd section contains one extra player of a given team, and two adjacent odd sections
will therefore have 2 extra players from that team, by parity (EX: EME|EMEMEMEME has 2
more E players than M players). There are 5 ways to divide our interval of length 12 into two
nonempty even sections, using an unchosen player, and if the remaining two unchosen players are
not placed adjacent to one another, they can be inserted in 13·12
2 = 78 ways (note that the choice
of placing another unchosen player immediately before or after our original unchosen player is
indistinguishable, meaning there are only 13 distinguishable spots to begin with). If they are
placed adjacent to one another, this adds 13 possibilities, giving a total of 5 · (78 + 13) = 455.
In this case, we either divide our 12 person roster into 3 even length intervals, or an odd, even,
odd, in that order (our only condition on odd length intervals is that we couldn’t put them
adjacent to one another). The number of ways to have 3 nonempty even intervals summing
SMT 2020 Discrete Math Test Solutions February 22, 2020
to 12 is 3+2
2 = 10 by stars and bars, and the number of ways to have an odd, even, odd is
4+2
2 = 15, as it is equivalent to picking 4 (possibly empty) even intervals summing to 8, after
we subtract 1 from each odd and 2 from the even interval. In all cases, we can again insert the
final unchosen player in 13 ways, giving a total of (10 + 15) · 13 = 325.
Case 3: 3 parity swaps (EME|EMEM|MEM|EM)
In this case, our options for interval lengths are either 4 evens, or one of {even, odd, even, odd},
{odd, even, odd, even}. This is because we must have an even number of odd length intervals
(since the total, 12, is even), we cannot have any two adjacent, and we also cannot have them be
distance 2 apart, because this actually causes the same parity issue as having two odd intervals
adjacent (EX: EME|EMEM|EM|EME has 2 more E players than M players). There are 53 = 10
ways to have 4 even intervals summing to 12, and 63 = 20 ways for each of the alternating cases,
In total, this gives the number of choices for teams as 2 · (455 + 455 + 325 + 50) = 2570.
10. Suppose n is a product of three primes p1 , p2 , p3 where p1 < p2 < p3 and p1 is a two-digit integer.
If n − 1 is a perfect square, compute the smallest possible value of n.
Answer: 30277
Solution: Define k to be the positive integer such that n − 1 = k 2 . Since k 2 + 1 = p1 p2 p3 , it
follows that k 2 ≡ −1 (mod p1 ), k 2 ≡ −1 (mod p2 ), and k 2 ≡ −1 (mod p3 ). Because −1 is only
a quadratic residue of 2 and odd primes of the form 4x + 1, the congruence k 2 ≡ −1 (mod p)
has solutions if and only if prime p is equal to 2 or congruent to 1 mod 4. Therefore, it follows
that p1 , p2 , p3 are primes congruent to 1 mod 4.
Furthermore, for any prime p < p1 , it must follow that k 2 6≡ −1 (mod p). Because p1 is a
two-digit integer, the primes p < 10 ≤ p1 must be checked. Note that of these primes, only 2
and 5 must be checked as there are no solutions to the congruence when p is 3 or 7. Because
(±1)2 ≡ −1 (mod 2) and (±2)2 ≡ −1 (mod 5), it follows that k 6≡ 1 (mod 2) and k 6≡ ±2 (mod
5). By the Chinese Remainder Theorem, k must be congruent to either 0, 4, or 6 in mod 10.
To find a solution, consider the case where p1 and p2 are minimized: p1 = 13, and p2 = 17. Since
(±5)2 ≡ −1 (mod 13) and (±4)2 ≡ −1 (mod 17), it follows that k ≡ ±5 ≡ ±8 (mod 13) and
k ≡ ±4 ≡ ±13 (mod 17). By the Chinese Remainder Theorem, there are four possible values of
k mod 221.
To find these values, note that k ≡ ±13 (mod 17) implies that k must be in the form 17x ± 13.
Taking this mod 13, it follows that k = 17x ± 13 ≡ 4x ≡ ±8 (mod 13). Therefore, x must be
±2, meaning that the possible values of k (mod 221) are generated by the values of 17(±2) ± 13.
This yields 21, 47, 174, and 200 as the four possible values of k mod 221.
Since k must be congruent to either 0, 4, or 6 in mod 10, the smallest possible value of k in this
case is when k = 174. In this case, n = 1742 + 1 = (13)(17)(137) = 30277 where 137 is prime.
Therefore, n = 30277 satisfies the given conditions. To prove that this value of n is the smallest,
it suffices to show that no k < 174 yields an n that fits the given conditions.
First, consider the maximum possible value of p2 . Because p1 p22 < p1 p2 p3 < (13)(17)(137) and
p1 ≥ 13, it follows that p22 < (17)(137) = 2329. Since 412 = 1681 < 2329 < 532 = 2809, the
maximum possible value of p2 is 41. Therefore, p1 and p2 must belong to the set of primes
{13, 17, 29, 37, 41}. For each of these primes, list the possible values of k < 174 that satisfy the
SMT 2020 Discrete Math Test Solutions February 22, 2020