430 likes | 533 Views
The Hat Game. 11/19/04 James Fiedler. References. Hendrik W. Lenstra, Jr. and Gadiel Seroussi, On Hats and Other Covers , preprint, 2002, http://www.hpl.hp.com/research/info_theory/hats_extsum.pdf . J.P. Buhler, Hat Tricks , The Mathematical Intelligencer 24 (2002), no. 4, 44 – 49.
E N D
The Hat Game 11/19/04 James Fiedler
References • Hendrik W. Lenstra, Jr. and Gadiel Seroussi, On Hats and Other Covers, preprint, 2002, http://www.hpl.hp.com/research/info_theory/hats_extsum.pdf . • J.P. Buhler, Hat Tricks, The Mathematical Intelligencer 24 (2002), no. 4, 44 – 49. • Sarah Robinson, Why Mathematicians Now Care About Their Hat Color, New York Times, Science Times, p. D5, April 10, 2001.
The Setup • A group of n players enter a room whereupon they each receive a hat. Each player can see everyone else’s hat but not his own. • The players must each simultaneously guess a hat color, or pass. • The group loses if any player guesses the wrong hat color or if every player passes. • Players are not necessarily anonymous, they can be numbered.
The Setup • Assignment of hats is assumed to be random. • The players can meet beforehand to devise a strategy, but no communication is allowed inside the room. • The goal is to devise the strategy that gives the highest probability of winning.
The 2 color, 3 player case • Of course, designating one player to guess randomly while every other player passes gives probability 50% in the binary case. • The best strategy turns out to have 75% winning probability. • The strategy: If any player sees that the other two players have the same hat color, he guesses the opposite color. Otherwise the player passes.
The 2 color, 3 player case • The group wins whenever exactly two hats have the same color, which will happen ¾ of the time. • Everyone guesses incorrectly when all three hats have the same color, which will happen ¼ of the time. • Thus 75% chance of winning.
Perfect Strategy • This is an example of what we will call a perfect strategy (for any number players and hat colors): Every winning configuration will have one person guessing correctly and the others passing, every losing configuration will have all the players guessing incorrectly.
Perfect Strategy • This is the best that can be done. • From the New York Times article:
Binary Game • Let the two hat colors be 0, 1. • For n numbered players, each player i sees n-1 hats, which can be thought of as a vector of length n-1 over F2. • The strategy will tell him whether to guess 0, 1, or pass. Think of this as a function where Vn-1 is the vector space of dimension n-1 over F2.
Binary • We assume the strategy is deterministic, that it tells each player exactly which option to take for any hat configuration. • The vector is a complete description of the strategy. We’ll call the vector a deterministic n-player strategy.
Binary • Let be all the hat configurations for which our strategy wins. • By the rules, we have . • Also, .
1-Coverings and Strategies • This means that the set of all losing strategies are a 1-covering of the linear space Vn. • Conversely every 1-covering determines a strategy for which the winning configurations are the complement of the 1-covering.
Strategy from a 1-Covering • Let C be a 1-covering of the space Vn. Let C determine a strategy as follows: if player i sees the vector (w1, …, wi-1, wi+1, …, wn) and if exactly one x=0,1 puts (w1, …, wi-1, x, wi+1, …, wn) outside of C, player i guesses x, otherwise passes. • Vn – C are winning configurations.
Strategy from a 1-Covering • Proof: Let C be a 1-covering and suppose the configuration (w1, …, wn) lies outside C. There is an i such that (w1, …, wi-1, wi+1, wi+1, …, wn) lies inside C. Then i correctly guesses his hat color and for every other player j there is at least one value (wj) that puts the vector outside of C. Thus every other player guesses correctly or passes and Vn – C {winning config.s}.
Strategy from a 1-Covering • Converse: If (c1, …, cn) is in C then for this configuration everyone will pass or someone will guess incorrectly. If there’s a choice x for i for which (c1, …, ci-1, x, ci+1, …, cn) is outside of C, player i will choose that color, incorrectly. If no such choice occurs, every player passes. Thus {winning config.s} Vn – C.
Hamming Connection • Thus (the complements of) 1-coverings are synonymous with winning configurations, and the best strategy for any n will be given by the smallest 1-covering code for that n. • Thus perfect 1-coverings give optimal solutions when they exist and since Hamming Codes are perfect 1-coverings, they give the optimal strategy for n=2r-1, any positive integer r.
Perfect = Perfect • Perfect 1-coverings C correspond to perfect strategies. • Proof: If C is a perfect 1-covering then no two codewords are within distance 1. Then if a given configuration is within C, every player will see one option for their hat color that puts the configuration outside of C and every player will guess wrong. If a given configuration is outside of C then for one player only will there be one option that puts his hat color outside of C, the rest will pass.
Perfect = Perfect • Conversely, if we have a perfect strategy, call the set of losing configurations C, let c=(c1, …, cn) be in C. We know already that C is a 1-covering so let (c1, …, ci-1, x, ci+1, …, cn) be outside of C. Given this configuration i will see (c1, …, ci-1, ci+1, …, cn) and correctly guess hat color x. Now, suppose (c1, …, ci-1, x, ci+1, …, cn) is within distance 1 of another element of C (spheres of radius 1 around elements of C are not distinct).
Perfect = Perfect • Say switching cj gets us to this other element. Then players i and j would both guess a (correct) hat color in the configuration (c1, …, ci-1, x, ci+1, …, cn). Then the strategy would not be perfect. Thus the sphere of radius 1 around the elements of the 1-covering C are distinct, which means C is a perfect 1-covering.
Hamming Again • The only perfect 1-coverings in the binary case are Hamming Codes, so all perfect strategies in the binary case occur for n=2r-1. • The n=3 case corresponds to the code (losing configurations) {000, 111}.
Probability of Losing • For Hamming Codes of length n we have |C| = 2n/(n+1), reaching the sphere packing bound. • The probability of losing with a Hamming Code strategy is then PL =|C|/2n = (2n/(n+1))/2n = 1/(n+1).
Other Hamming-based Strategies • For 2r-1 < n < 2r+1-1, we can construct a strategy based on the Hamming Code as follows. • The first 2r-1 players ignore the players 2r, …, n and play according to the 2r-1 game, the players 2r, …, n always pass. • It is known that these strategies are optimal for n=2r, but not for larger n.
Probability of Losing • Probability of losing for these strategies is . • The lower bound is from the sphere packing bound, attained when n=2r-1. • The upper bound comes from the worst case Hamming-based strategy.
Best Known Linear and Nonlinear Strategies • For n > 8 the optimal solution is unknown except when n=2r or n=2r-1. • It is known that there are nonlinear 1-coverings that approach the sphere packing bound as n goes to infinite. Thus there are strategies that approach the winning probability of 1.
The q-ary Game • Same rules, now the set of hat colors is Q={0, …, q-1}. • Valid strategies are now synonymous with strong coverings: • A strong covering C Qn is such that for all (w1, …, wn) in Qn – C there is an i such that for all x in Q – {wi} (w1, …, wi-1, x, wi+1, …, w) is in C.
Strong Covering from a Strategy • Proof: If w = (w1, …, wn) is a winning configuration then some player i guesses his hat color wi correctly from the information (w1, …, wi-1, wi+1, …, wn). Thus for x ≠ wi, the configuration (w1, …, wi-1, x, wi+1, …, wn) will cause player i to guess incorrectly and lose. Thus the losing configurations form a strong cover.
Strategy from a Strong Cover • Converse: Let C be a strong covering. Determine a strategy as follows: given the information (w1, …, wi-1, wi+1, …, wn), if there is exactly one choice x such that (w1, …, wi-1, x, wi+1, …, wn) is outside C then player i guesses hat color x, otherwise passes.
Strategy from a Strong Cover • This gives a valid strategy: If (w1, …, wn) is outside C then there is at least one player for whom there is only one choice (the correct one) for which (w1, …, wi-1, wi+1, …, wn) is outside C. Everyone else has at least one choice so guesses correctly or passes. If (c1, …, cn) is inside C then any player that sees exactly one option that puts the configuration outside C then he guesses incorrectly. Otherwise everyone passes.
Perfect Strong Covering • If C is a strong covering, then • If equality holds C is called perfect, and perfect strong coverings correspond to perfect strategies. • Unfortunately, for q > 2 and n > 1 perfect strong coverings do not exist.
Analog of Sphere-Packing Bound • For a strong covering C, • Proof: Consider ordered pairs (x,y) where x is a winning configuration, y a losing configuration and they differ in one coordinate. Let S be the set of all these ordered pairs. If we fix x then there are at least q – 1 choices for y since C is a strong covering.
Analog of Sphere-Packing Bound • Thus (q – 1)|Vn - C||S| or (q – 1)(qn - |C|) |S|. If we fix y then there are at most n choices for x, so |S| n|C| and rearranging (q – 1)(qn -|C|) |S| n|C| we get
Perfect = Perfect • Perfect strong coverings correspond to perfect strategies. • Proof: Let C be a perfect strong covering. Then we get equality (q – 1)(qn -|C|) = |S|= n|C| from last slide. If w = (w1, …, wn) is not in C then for one player i there will be exactly one hat color x=wi which puts (w1, …, wi-1, x, wi+1, …, wn) outside C. The left side of the equality above means that there are exactly q-1 ways to change w to put the configuration inside C. All of these changes are already used by the ith coordinate.
Perfect=Perfect • Thus we can change the others freely, which means any other player j will have more than one choice that puts the configuration outside of C and will pass. Let c = (c1, …, cn) lie inside C. Then there are exactly n changes we can make to c to push it outside C, based on the right side of the equality above. If any more than 1 of these changes can be made in any coordinate, C would not be a strong covering. Thus each player will see 1 hat color that puts the configuration (that he sees) outside of C and every player will guess incorrectly. Thus we have a perfect strategy.
Perfect = Perfect • Converse: Just as the above direction this is similar to the binary case. I’ll skip the converse for now.
A Strong Covering for Q-ary Case • Let n=2r-1, and let M be a check matrix for the binary Hamming Code of length n. Let v be in Qn, φ:Qn→Qr,φ(v) = MvT. In terminology from Wednesday φ finds the syndrome of v. Let • Then C is a strong covering.
A Strong Covering for Q-ary Case • Let Then C is a strong covering. • Proof: If w = (w1, …, wn) is in Qn – C, then some coordinates of φ(w) are zero. There is a column mj of M whose coordinates are 1 exactly when the coordinates of φ(w) are zero. Then for all α in Q*, φ(w) + α mj is in C, since this latter vector no longer has any zero coordinates.
Probabiltiy of Losing • This strategy loses with probability which goes to zero as n.
A More General Construction • Slightly smaller strong coverings can be achieved with the following generalization where wt is the Hamming weight, the number of nonzero coordinates.
Bounds • It is known that there are strong coverings that can do better than either of these q-ary constructions, with a losing probability of • Constructions have not been found to reach this limit.
Variations • In the full version of their paper, Lenstra and Seroussi consider the following variations. • Non-uniform distributions • Randomized playing strategies • Symmetric strategies • Zero-information strategies
References • Hendrik W. Lenstra, Jr. and Gadiel Seroussi, On Hats and Other Covers, preprint, 2002, http://www.hpl.hp.com/research/info_theory/hats_extsum.pdf . • J.P. Buhler, Hat Tricks, The Mathematical Intelligencer 24 (2002), no. 4, 44 – 49. • Sarah Robinson, Why Mathematicians Now Care About Their Hat Color, New York Times, Science Times, p. D5, April 10, 2001.