The Nation Has Problems: Vol. 6

About Last Month

So a few of you figured out the first problem last week, but it seemed that most of you got stuck on the second. Solutions after the break.

At first glance, it seems as though the score set (4,1,0,-2,-3) would work. However, if you try to attain that solution through a series of games, you'll quickly decide it's not possible. The problem is that after an even number of games, each player's score must be even and after an odd number of games, it must be odd. Since the solution above contains a combination of even and odd scores, it is hence not possible. The solution therefore is 8, which can be obtained by doubling the score set above. In fact, it is possible to obtain any score set for the five people so long as each score has the same parity, as we'll see in the second part. A little bit of analysis shows that you can't come up with a score set satisfying the necessary conditions.

For the second problem, it is easy to get stuck on the idea of parity once you've solved the first. However, parity isn't quite the right idea, but it's close. For example, if m=2 and n=1, then after one game some players can have a score of 2 and others a score of -1 which don't have the same parity. However, these two number are the same mod 3! The key in this case is that m =-n mod (m+n) no matter what m and n are. Then it becomes clear that this is a necessary condition and it's almost sufficient as well. If GCD(m,n)=d, then d must divide each players score as well. So any combination of scores is possible, so long as d divides each score and each score is equivalent mod (m+n). This condition is both necessary and sufficient.

A famous theorem of Euclid states that it is possible to write d = sm +tn where s and t are integers. In fact, it is possible to do this such that s is positive and t is negative (I'm skipping some subtleties here). So after s+t games, each player can have a score of exactly d. Likewise, after k(s+t) games, each player can have a score of exactly kd = ksm + ktn. So if each score is kd mod (m+n), we first play k(s+t) games with each player winning m points in ks of them and losing n points in kt of them. After that, we're going to play (m+n) games at a time. If a player wins m points in n+k of these games, then he will lose n points in the other m-k of them for a net result of m(n+k)-n(m-k) = k(m+n). Note that if k=0, there will be no change in the score. In this way, our player can change their score by any multiple of (m+n) points until they get to the proper ending score, then just continue to gain 0 points until each other player gets to the proper score. This will work regardless of the number of players that are playing.

An interesting note about the second problem is that it's relatively easy to prove that these two conditions were necessary (once you figure out what the conditions are) but it takes a lot of work to show they're also sufficient. Many mathematical proofs go this way. Somebody figures out what the necessary conditions are and then spends a long time showing that they're also sufficient.

The problems

I've been slacking this month, so I've only got one problem for you. A very slight variant of this problem is showing up on my math 206 class's final today.

1. Twenty-one cards containing the integers from 1 to 21 are shuffled and placed face down on a table. Spooky then picks 11 of these cards and flips them over. Spooky loses if the sum of any combination of cards sums to 21. What is the probability that Spooky wins this game?

[Edit: Here's a second problem with a similar flavor!]

2. For what values of n can the numbers 1,2,3,...,n be partitioned into 3 sets such that the sum of the numbers in each set is the same.

29 thoughts on “The Nation Has Problems: Vol. 6”

  1. Spoiler SelectShow
  2. Spoiler SelectShow
    1. Spoiler SelectShow
      1. Spoiler SelectShow
  3. OK, I've added a second problem with a similar flavor. This is one I came across a few weeks ago. It's harder than the first, but interesting!

  4. For #2:

    Partitions don't have to be done in order, right? Like for A={1,2,3,4,5}, I can split the set A into partitions of {{1,5}, {2,4}, {3}}. It doesn't necessarily have to be {{1,2}, {3,4,5}} or anything like that. I guess what I'm saying is I can mix-and-match, right?

    1. Correct. So for n=5 it can be done as you described. For n<=4, however, some quick analysis will convince you it can't be done.

    1. Also, it has to be 3 sets. I mean, you can partition it into 2 sets, but then the third set would be empty and have a sum of 0, so that doesn't work...

  5. Here's what I have for #2 so far:

    Spoiler SelectShow
    1. Spoiler SelectShow
          1. Spoiler SelectShow
  6. Found a recursive set partitioner in Python. After some tweaking, I get a lot of sets:

    Spoiler SelectShow
      1. Spoiler SelectShow
        1. Spoiler SelectShow
    1. I count 761 solutions for n=14 and 1480 solutions for n=15. There could be some double counting. I'll try 16-19 next. Counting the 1-15 case took 9.33 minutes, so I expect this one to take at least that long.

      1. I imagine counting these things would be a beast. I'm not sure there's even a good way to do it. When I tried to come up with solutions, I tried to do it in a way that was generalizable for all of the related cases.

        Spoiler SelectShow
        1. I killed it at 130 minutes. I don't know how long it took to determine 16 wouldn't work, but it was still on n=17. I have a ton of computing resources available here at work, but I would first need to translate the code to C or Fortran and try to parallelize it.

          1. Yeah, this thing is going to grow exponentially. There are 3^n possible ways to partition into 3 sets. I have some idea of how I would try to prove the number of possible solutions, but I'm not sure how fruitful it would be.

  7. Problem 1.
    I wrote this at about 8am, but then the renewal that I thought had been put to bed last Thursday needed more work. So tomorrow, I'll finally get to the things that I thought I'd have all day last Friday to work on. Famous last words, right?

    Spoiler SelectShow

    I'm interested how to calculate this probability when Spooky has to draw fewer cards, or if the cards would be 0 to 20 or 0 to 21.

Comments are closed.