The hat guessing number of graphs

https://doi.org/10.1016/j.jctb.2020.01.003Get rights and content

Abstract

Consider the following hat guessing game: n players are placed on n vertices of a graph, each wearing a hat whose color is arbitrarily chosen from a set of q possible colors. Each player can see the hat colors of his neighbors, but not his own hat color. All of the players are asked to guess their own hat colors simultaneously, according to a predetermined guessing strategy and the hat colors they see, where no communication between them is allowed. Given a graph G, its hat guessing number HG(G) is the largest integer q such that there exists a guessing strategy guaranteeing at least one correct guess for any hat assignment of q possible colors.

In 2008, Butler et al. asked whether the hat guessing number of the complete bipartite graph Kn,n is at least some fixed positive (fractional) power of n. We answer this question affirmatively, showing that for sufficiently large n, the complete r-partite graph Kn,,n satisfies HG(Kn,,n)=Ω(nr1ro(1)). Our guessing strategy is based on a probabilistic construction and other combinatorial ideas, and can be extended to show that HG(Cn,,n)=Ω(n1ro(1)), where Cn,,n is the blow-up of a directed r-cycle, and where for directed graphs each player sees only the hat colors of his outneighbors.

Additionally, we consider related problems like the relation between the hat guessing number and other graph parameters, and the linear hat guessing number, where the players are only allowed to use affine linear guessing strategies. Several nonexistence results are obtained by using well-known combinatorial tools, including the Lovász Local Lemma and the Combinatorial Nullstellensatz. Among other results, it is shown that under certain conditions, the linear hat guessing number of Kn,n is at most 3, exhibiting a huge gap from the Ω(n12o(1)) (nonlinear) hat guessing number of this graph.

Introduction

Hat guessing problems are interesting recreational mathematical puzzles that have attracted a lot of attention throughout the years. A classical variant [17], [34] involves n2 players, each wearing a hat in q2 possible colors assigned to it by an adversary. Each player sees the hat colors of all the other players, but not his own, and based on this information he makes a guess on his own hat color. The goal of the players is to ensure that at least one player will make a correct guess, regardless of the hat assignment by the adversary. The players are allowed to communicate and pick a guessing strategy only before the hats are assigned, and no communication is allowed afterwards. Once all the players made their guesses, the adversary verifies whether there was a player who guessed correctly, and if so, we say that the players win.

With the above rules in mind, the puzzle asks what is the maximum number of hat colors q for which the players have a winning guessing strategy. Perhaps surprisingly, the answer to this question is q=n. Indeed, number the players and the hat colors with the numbers 0,1,n1, and let player i guess that his color is the unique color for which the sum of all the hat colors (including his hat color) modulo n is i. It is not hard to verify that exactly one of the players guesses correctly, regardless of the coloring assigned by the adversary. A more general statement on this problem for arbitrary n,q, observed by Feige [17], claims that the players can always ensure that at least n/q of them guess correctly, and that this is tight.

A natural generalization of the above puzzle asks the same question but assumes that each player can only see some subset of the other players' hat colors. This generalization, which is the problem considered in this paper, was first presented by Butler et al. [9] and further investigated in a line of other works [3], [19], [20], [33]. A formal definition of the problem is as follows. Let G be a simple graph on n vertices {v1,,vn}, and let Q be a finite set of q colors. The n vertices of the graph are identified with the n players, where each is assigned arbitrarily with a hat colored with one of the colors in Q. A player can only see the hat colors of his neighbors, i.e., player i sees the hat color of player j if and only if vi is connected to vj in G. After all of the players agreed on a guessing strategy, they are asked to guess their own hat colors simultaneously, and no communication of any sort is allowed at this point. The goal of the players is to ensure that at least one player guesses his hat color correctly.

The hat guessing problem is completely defined by the graph G which is called the sight graph. Therefore, for a given graph G, its hat guessing number HG(G), as defined by Farnik [16], is the largest positive integer q such that there exists a winning guessing strategy for the players. If HG(G)q, G is also called q-solvable by Gadouleau and Georgiou [20].

In general, the sight graph G may be directed; a directed edge vivj represents that player i can see the hat color of player j. In the sequel we do not distinguish between the vertices and the players. The color of a vertex and its guessing strategy refer to the hat color of the corresponding player and his guessing strategy.

This paper focuses on the graph parameter HG(G), and it provides improved upper and lower bounds on HG(G) for several graph families. In the literature there are only a few graphs whose hat guessing numbers have been determined precisely. Below we list all of them. As mentioned earlier, for the complete graph Kn we have HG(Kn)=n [17]. Butler et al. [9] showed that all trees are not 3-solvable, implying HG(T)=2 for any tree T. Lastly, Szczechla [33] recently showed that a cycle of length n is 3-solvable if and only if n=4 or is a multiple of 3, and that all cycles are not 4-solvable.

Next we state our main results, while we delay some of the needed definitions to Section 3. The various variants and models of hat guessing problems are reviewed in Section 2. Note that all asymptotics are in n and we omit all floor and ceiling signs whenever these are not crucial.

Let H be a subgraph of a graph G; it is clear that HG(H)HG(G). Furthermore, since complete graphs have large hat guessing numbers [17] it follows that graphs which contain large cliques as subgraphs also have large hat guessing numbers. It is thus an interesting question to ask whether the clique number of G, which is the number of vertices in a maximum complete subgraph in G, determines its hat guessing number. In other words, how large can HG(G) be if its clique number is bounded from above by a constant. In [9] it was shown that the complete bipartite graph Kq1,qqq1 is q-solvable, implying that for large n, HG(Kn,n)=Ω(loglogn), while the clique number is clearly 2. The value of HG(Kn,n) was further considered in [20], where it was shown that HG(Km,n)min{m+1,n+1} and HG(Kq1,(q1)q1)q, implying that Ω(logn)=HG(Kn,n)n+1. Following these results it is natural to consider the question below, which is originally posed in [9].

Question 1.1

Does there exist a constant α>0 independent of n, such that HG(Kn,n)nα for sufficiently large n?

We answer this question affirmatively in the following generalized sense.

Theorem 1.2

For integers r2,q2, let Km,,m,n be the complete r-partite graph in which there are r1 vertex parts of size m and one vertex part of size n. Then there exists a constant c not depending on q such that for m=(2qlnq)1r1 and n=cr(qlnq)rr1,HG(Km,,m,n)q, which implies that HG(Kn,,n)nr1ro(1), where Kn,,n is the complete r-partite graph of equal part size n.

In particular, by combining [20] and Theorem 1.2 we have that Ω(n12o(1))=HG(Kn,n)n+1. The determination of the exact value of HG(Kn,n) is left as an interesting open question.

In [20] the hat guessing number of directed graphs, which is somewhat less understood than that of undirected graphs, was considered. Specifically, [20] asked whether there exists an oriented graph with hat guessing number greater than 4, where an oriented graph is a directed graph such that none of its pairs of vertices {u,v} is connected by two symmetric directed edges uv and vu. Recently, Gadouleau [19] provided a positive answer to this question, where he showed that for any g3 and sufficiently large q, there exists a q-solvable oriented graph with girth g and q(1+o(1))(g1)lng vertices. In Theorem 1.3 below, we provide another construction of a q-solvable oriented graph with girth g and q(1+o(1))g vertices, which for g4 is a slight improvement over [19] on the number of vertices needed in a graph with these properties.

For r3, let Cr be the directed cycle on r vertices v1v2vrv1. The directed graph Cn1,,nr is obtained by replacing each vertex vi of Cr with a set Vi of ni vertices, such that for any uVi,wVj, uw if and only if ij and vivj. In other words, Cn1,,nr is obtained by blowing up each directed edge of Cr to a complete directed bipartite graph which preserves the direction of the original edge. We call graphs of this type complete r-partite directed cycles. With the above notation we have the following Theorem.

Theorem 1.3

For integers r3,q2 and ni=(r1)ln(2qlnq)(4lnq)riqr+1i for 1ir, it holds thatHG(Cn1,,nr)q, which implies that HG(Cn,,n)=Ω(n1ro(1)), where Cn,,n is the complete r-partite directed cycle of equal part size n.

In order to improve the understanding of HG(G), it is natural to try to relate it to other graph parameters of G, see e.g., [16], [19]. The maximum/minimum degree and the degeneracy are among the most basic parameters of a graph. Therefore, we would like to understand how these parameters affect the hat guessing number, by answering the following questions.

Problem 1.4

Do there exist functions fi:NN,1i3 such that

  • (i)

    if the maximum degree of G is Δ, then HG(G)f1(Δ);

  • (ii)

    if G is d-degenerate, then HG(G)f2(d);

  • (iii)

    if the minimum degree of G is δ, then HG(G)f3(δ), and f3(δ) tends to infinity when δ tends to infinity.

Currently, only f1 is known to exist, i.e., the hat guessing number is bounded from above by a function of the maximum degree of the graph. This result, as stated in the following theorem, is folklore [16], and is a straightforward application of the Lovász Local Lemma.

Theorem 1.5 Folklore

Let G be a graph with maximum degree Δ, then HG(G)<eΔ.

By considering the hat guessing numbers of complete graphs and cycles one might conjecture that f1 could be as small as f1(Δ)=Δ+1. Similarly, by considering the known upper bounds on the hat guessing numbers of trees and complete bipartite graphs, one may suspect that f2 could also be as small as f2(d)=d+1. However, as opposed to f1 it is not even clear whether f2 actually exists. Theorem 1.6 and Theorem 1.8 below, can be viewed as attempts toward providing an answer to Problem 1.4 (ii). Although Theorem 1.6 does not directly connect between the degeneracy and the hat guessing number, it shows that using the Lovász Local Lemma one can obtain an upper bound on the hat guessing number, provided that the graph satisfies an additional property. On the other hand, Theorem 1.8 does connect between these two graph parameters, since Corollary 1.9 which follows from it, shows that f2(1)2.

Theorem 1.6

Let k,d,q be integers and G be a graph such that

  • (i)

    the induced subgraph of G on all vertices of degree larger than k is not q-solvable;

  • (ii)

    each vertex in the induced subgraph of G on all vertices of degree at most k has at most d vertices of distance at most 2 from it.

Then HG(G)<edqk.

Observe that dk2 always holds under the assumptions of Theorem 1.6. Hence, we get the following corollary as a special case.

Corollary 1.7

Let k,q be integers and G be a graph whose induced subgraph on the vertices of degree larger than k is not q-solvable. Then HG(G)<ek2qk.

Theorem 1.8

Let G be a graph containing a vertex v of degree one. If q3 and G is q-solvable, then G{v} is also q-solvable.

As a simple corollary of Theorem 1.8 and the fact that any tree contains a degree-1 vertex, we get the following result which was originally proved in [9], see Corollary 9 there.

Corollary 1.9 [9]

Trees are not 3-solvable.

If q, the number of possible hat colors, is a prime power, then the guessing strategies of the vertices can be viewed as multivariate polynomials over the finite field Fq, where we identify Q with Fq. In such a scenario we would like to understand how the hat guessing number depends on the complexity of the multivariate polynomials being used. In particular, how it is affected if one restricts the degree of the multivariate polynomials to be bounded from above by some constant. The most simple and yet nontrivial case to be considered is when the multivariate polynomials are linear. A guessing strategy of G is called linear if the guessing function of each vertex is an affine function of the colors of its neighbors. Furthermore, the linear hat guessing number HGlin(G) is the largest prime power q for which the graph G is q-solvable by a linear guessing strategy. We say that G is linearly q-solvable if there exists a linear guessing strategy for G over Fq.

We are not aware of any paper which specifically considers linear guessing strategies for this hat guessing problem, therefore known results are scarce. It is easy to verify that HGlin(Kq)=q [17], and it is known that HGlin(C4)=3 [20], [33].

It is worth noting that if p<q are two integers, then G is q-solvable implies that G is also p-solvable. However, this does not follows automatically in the case of linear solvability, i.e., if G is linearly q-solvable it does not necessarily imply that it is also linearly p-solvable (assuming p and q are prime powers). Clearly this follows if q is a power of p, and therefore Fq contains Fp as a subfield, but this implication does not follow generally. In fact it is of interest to construct a graph which is linearly q-solvable, but is not linearly p-solvable for p<q.

Since we are concerned with algebraic aspects of the hat guessing problem, it is with no surprise that we use algebraic methods to derive our results, most notably the Combinatorial Nullstellensatz [2]. We present negative results (upper bonds) on the linear hat guessing numbers of several graph families, including cycles, complete bipartite graphs, degenerate graphs and graphs with bounded minimum rank, to be defined below. These results are proved in Section 6.

Our first result on the linear solvability of graphs provides the exact value of the linear hat guessing number of cycles. As already mentioned, it is known that HGlin(K3)=HGlin(C4)=3, and we show that longer cycles are not linearly 3-solvable.

Theorem 1.10

For any integer n5, HGlin(Cn)2.

Combined with the result of Szczechla [33], cycles are the first known examples of graphs for which non-linear guessing strategies outperform linear ones. More precisely, Cn is 3-solvable if and only if n=4 or is a multiple of 3, while for n>4 it is only linearly 2-solvable.

The cycles provide a moderate separation between linear and non-linear guessing strategies, however a much more significant separation can be shown in the case of complete bipartite graphs. Theorem 1.2 shows that for sufficiently large n, the hat guessing number of Kn,n is at least n12o(1). On the other hand, linear guessing strategies are significantly less powerful here, as described in the next theorem.

Theorem 1.11

Kn,n is not linearly q-solvable for any proper prime power q.

The proof of Theorem 1.11 relies on a result of Alon and Tarsi [6] (see Lemma 6.5 below), which is only known to hold for finite fields of a proper prime power order, but is conjectured in [6] to hold for any prime power q4. If indeed the conjecture holds, then it would imply that Theorem 1.11 holds for any prime power q4. Note that this cannot be further improved, since C4=K2,2 is linearly 3-solvable. For more details, see Subsection 6.2.

The next two results relate linear solvability to other graph parameters, namely, degeneracy and minimum rank. In Question 1.4 we ask whether the hat guessing number is bounded from above by the degeneracy of the graph. Here we resolve this question for the linear solvability. Notice that the bound below is tight for Kq since it is (q1)-degenerate and HGlin(Kq)=q.

Theorem 1.12

For any d-degenerate graph G, HGlin(G)d+1.

An n×n matrix M over Fq fits a graph G with n vertices if Mi,i0 for 1in and Mi,j=Mj,i=0 if vi and vj are not connected in G, i.e., {vi,vj}E(G). The minimum rank of a graph G denoted by mr(G), is defined to be the minimum integer r for which there exists a matrix M over some finite field which fits G and rank(M)=r. This parameter of a graph was initially introduced by Haemers [22], [23] as an upper bound for the Shannon capacity of a graph [31]. Notice that the minimum rank was originally defined over any field, not necessarily finite, however we use the above definition. The last result connects linear solvability and minimum rank, where loosely speaking, it claims that large minimum rank implies small linear solvability.

Theorem 1.13

Let G be a graph with n vertices, then HGlin(G)nmr(G)+1.

Theorem 1.13 is tight for any prime power q, as mr(Kq)=1 and HGlin(Kq)=q. Notice that in general it is not practical to apply the above bound since there is no known efficient algorithm which computes the minimum rank of a graph over a given field and in fact this problem is known to be NP-hard [28].

The rest of the paper is organized as follows. In Section 2 we briefly review other versions of hat guessing games. Necessary definitions and notations are given in Section 3. Theorem 1.2, Theorem 1.3 are proved in Section 4. In Section 5 we present the proofs of Theorem 1.5, Theorem 1.6. In Section 6 we consider linear hat guessing numbers and prove Theorem 1.10, Theorem 1.11, Theorem 1.12, Theorem 1.13.

Section snippets

Related work

In the literature, there are several versions of hat guessing games. The most famous (maybe also the earliest) version was introduced by Ebert [12] and advertised by Robinson [30] in New York Times as a recreational mathematical game. In that version the graph G is a clique, each player gets either a red or a blue hat with equal probability, and is asked to guess or just pass. The players win if at least one player guesses correctly and no one guesses wrong, otherwise they lose. The goal is to

Preliminaries

Throughout the paper G is a graph with the vertex set V(G)={v1,,vn} and the edge set E(G). For a set SV(G), the induced subgraph of G on S is the graph with vertex set S and all edges of E(G) with both endpoints in S. G is said to be d-degenerate if there exists an ordering vi1,,vin of V(G), such that for 2jn, vij is connected to at most d vertices among vi1,,vij1. For two distinct vertices u,vV(G), the distance between u,v is the length of a shortest path connecting them and ∞ if there

Complete multipartite graphs and digraphs

In this section we prove Theorem 1.2 and Theorem 1.3. We first prove the results for bipartite graphs, and then generalize them to multipartite graphs.

Hat guessing number and other graph parameters

In this section, we present the proofs of Theorem 1.5 and Theorem 1.6, whereas the proof of Theorem 1.8 is postponed to Appendix B. Although Theorem 1.5 is a folklore [16], we include its proof for completeness. Both proofs make use of the Lovász Local Lemma [15], which states the following.

Lemma 5.1

Lovász Local Lemma, Shearer's version [32]

Let A1,,An be events in an arbitrary probability space. Suppose that each event Ai is mutually independent of a set of all other events Aj but at most d, and that Pr[Ai]p for all 1in. If epd1, then Pr[

Linear hat guessing numbers

In this section we consider the case where the players restrict their guessing strategies to affine functions of the hat colors assigned to their neighbors, where we always assume that the number of possible hat colors is a prime power. In what follows we present upper bounds on the linear hat guessing number for various graph families, e.g., cycles, degenerate graphs and graphs with bounded minimum rank. In particular, in Theorem 1.10 and Theorem 1.11 we show that nonlinear guessing strategies

Acknowledgements

The research of Noga Alon was supported by NSF grant DMS-1855464, ISF grant 281/17, BSF grant 2018267 and the Simons Foundation. The research of Chong Shangguan and Itzhak Tamo was supported by ISF grant No. 1030/15 and NSF-BSF grant No. 2015814.

References (34)

  • G. Aggarwal et al.

    Derandomization of auctions

  • N. Alon

    Combinatorial Nullstellensatz

    Comb. Probab. Comput.

    (1999)
  • N. Alon et al.

    The hat guessing number of graphs

  • N. Alon et al.

    Testing equality in communication graphs

    IEEE Trans. Inf. Theory

    (2017)
  • N. Alon et al.

    The Probabilistic Method

    (2016)
  • N. Alon et al.

    A nowhere-zero point in linear mappings

    Combinatorica

    (1989)
  • Z. Bar-Yossef et al.

    Index coding with side information

  • S. Bhandari et al.

    Bounds on the zero-error list-decoding capacity of the q/(q1) channel

  • S. Butler et al.

    Hat guessing games

    SIAM J. Discrete Math.

    (2008)
  • S. Chakraborty et al.

    Zero error list-decoding capacity of the q/(q1) channel

  • O. Chervak

    Warwick combinatorics seminar

  • T. Ebert

    Applications of recursive operators to randomness and complexity

    (1998)
  • T. Ebert et al.

    On the autoreducibility of random sequences

    SIAM J. Comput.

    (2003)
  • P. Elias

    Zero error capacity under list decoding

    IEEE Trans. Inf. Theory

    (1988)
  • P. Erdős et al.

    Problems and results on 3-chromatic hypergraphs and some related questions

    Colloq. Math. Soc. János Bolyai

    (1975)
  • M. Farnik

    A hat guessing game

    (2015)
  • U. Feige

    You can leave your hat on (if you guess its color)

    (2004)
  • Cited by (24)

    • On the hat guessing number of a planar graph class

      2022, Journal of Combinatorial Theory. Series B
    • The Hats game. On maximum degree and diameter

      2022, Discrete Mathematics
      Citation Excerpt :

      The Hats game goes back to an old popular Olympiad problem. Its generalization to arbitrary graphs attracted the interests of mathematicians recently (see, e.g. [3,6,1]). In our previous works [9] and [11] (joint with V. Retinsky), we considered the version of the hats game with variable number of hats (i.e., the number of possible colors is a function on graph vertices).

    • On the hat guessing number of graphs

      2022, Discrete Mathematics
    • Hat chromatic number of graphs

      2021, Discrete Mathematics
    View all citing articles on Scopus

    Part of this paper was presented in 2019 IEEE International Symposium on Information Theory [3].

    View full text