In a school, every pair of students are either friends or strangers. A sequence of (not necessarily distinct) students A1,A2,…,A2023 is called mischievous if
* Total number of friends of A1 is odd. * Ai and Ai+1 are friends for i=1,2,…,2022. * Total number of friends of A2023 is even.
Prove that the total number of mischievous sequences is even.
Solutions — 3
Solution 1
We first put the problem in graph theoretic terms: Consider a finite simple graph G. A walk of length 2022 is called mischievous if the degree of its starting vertex is odd, and the degree of its ending vertex is even. Prove that the total number of mischievous walks is even. Let 2022=m. We prove the problem for all positive integers m. Denote the number of mischievous walks by S. Let V be the vertex set of the graph. For any two distinct vertices u,v let f(u,v) denote the number of walks of length m with starting vertex u and ending vertex v. Note that f(u,v)=f(v,u). Then S=deg(u) odddeg(v) even∑f(u,v) We can also write the above sum as sum over all unordered pairs {u,v} such that deg(u),deg(v) have different parities. Note that deg(u),deg(v) have different parities ⟺deg(u)+deg(v)≡1(mod2). Hence we can write the following equalities: ({u,v} denotes unordered pair, while (u,v) denotes ordered pair) S≡{u,v}∈Vu=v∑f(u,v)(deg(u)+deg(v))(mod2)=21(u,v)∈V×Vu=v∑f(u,v)(deg(u)+deg(v))=21(u,v)∈V×Vu=v∑f(v,u)deg(u)+(u,v)∈V×Vu=v∑f(u,v)deg(v)=(u,v)∈V×Vu=v∑f(u,v)deg(v) Let R denote the RHS. It is sufficient to prove that R is even. Call a walk good if the first vertex and the second-last vertex in the walk are distinct, and bad otherwise.
Claim 1R is the total number of good walks of length m+1 in G.
Proof. Fix a pair of distinct vertices (u,v). Note that we can represent any walk of length m+1 as a sequence of its m+2 vertices. We will count the number of walks w0,w1,…,wm,wm+1 with w0=u and wm=v. We can see that the walk w0,w1,…,wm has f(u,v) choices, while wm+1 has deg(v) choices. Hence number of walks of length m+1 with first vertex u and second-last vertex v=u is f(u,v)deg(v). Summing over all pairs (u,v) we get the required expression. □
Claim 2 Total number of walks of length k in G is even, for any k≥1.
Proof. We prove this statement by induction on k. Base case: k=1 is true because any walk of length 1 is just an ordered pair of adjacent vertices, so if (u,v) works so does (v,u). Now assume number of walks of length k are even for all k≤n, for some n≥1. For any walk of length n+1: w0,w1,…,wn,wn+1 we can associate a corresponding walk wn+1,wn,…,w1,w0 with it. (Basically associate any walk with its reversed counterpart). Note that these two walks are different as long as wi=wn+1−i for some i. Thus all such walks can be matched into pairs, so their total number is even. We are left with walks for which wi=wn+1−i for each i, i.e., palindromic walks. These are not possible if n is even since then, w2n=w2n+2 which is not an edge in our graph. Now, if n is odd then these walks can be uniquely determined by the first ⌈2n+1⌉ vertices in the walk, and any walk of length ⌈2n+1⌉ gives us a unique palindromic walk of length n+1. Thus the number of walks of length n+1 has the same parity as number of walks of length ⌈2n+1⌉≤n, which is even by induction hypothesis. □
Claim 3 Total number of bad walks of length m+1 in G is even.
Proof. To any bad walk of length m+1: w0,w1,…,wm,wm+1 (w0=wm) we can associate a corresponding walk wm,wm−1,…,w0,wm+1 with it. (Basically associate any walk with a walk where the cycled part is reversed). Note that these two walks are different as long as wi=wm−i for some i. Thus all such walks can be matched into pairs, so their total number is even. We are left with walks for which wi=wm−i for each i, i.e., walks where the cycled part is palindromic. These bad walks are uniquely determined by the walk wm+1,w0,w1,…,w⌈2m⌉, and any such walk of length ⌈2m⌉+1 gives us a unique bad walk of length m+1 where the cycled part is palindromic (it gives us the walk w0,w1,…,w⌈2m⌉, w⌈2m⌉−1,…,w0,wm+1). Thus the number of bad walks of length m+1 has the same parity as number of walks of length ⌈2m⌉+1, which is even by Claim 2. □
Claim 2 and Claim 3 give us that the number of good walks of length m+1 are even. Therefore by Claim 1, R is even, as required. □
Solution 2
Again we use the graph restatement. Let fk(u,v) be the number of walks of length k+1 from u to v. Again, fk(u,v)=fk(v,u). Let Sm be the set of mischievous walks of length m, and let sm=∣Sm∣. Further, let Tm denote the set of walks of length m starting from an odd degree vertex and ending at an odd degree vertex, and let tm=∣Tm∣. Then tm=(u,v)∈V×Vdeg(u),deg(v) odd∑fm(u,v) Note that sm+tm is the total number of walks starting from an odd degree vertex. We will prove by induction on k≥0 that sk and tk are both even. Base cases: k=0. Walks of length 0 are just single vertices, so s0=0 and t0 is the number of odd degree vertices, which is even since sum of degrees in a graph is even. Now assume that sk and tk are even for all k≤n. We will first prove that tn+1 is even. To any walk w0,w1,…,wn,wn+1 in Tn+1, we can associate a corresponding walk wn+1,wn,…,w1,w0 with it. (Basically associate any walk with its reversed counterpart). These two walks are different as long as wi=wn+1−i for some i. Thus all such walks can be matched into pairs, so their total number is even. We are left with walks for which wi=wn+1−i for each i, i.e., palindromic walks. These walks can be uniquely determined by the first ⌈2n+1⌉ vertices in the walk, and any walk of length ⌈2n+1⌉ starting from an odd degree vertex gives us a unique palindromic walk in Tn+1 of length n+1. Thus the number of walks in Tn+1 has the same parity as number of walks of length ⌈2n+1⌉≤n starting from an odd degree vertex, i.e. s⌈2n+1⌉+t⌈2n+1⌉ which is even by induction hypothesis. Hence tn+1 is even. To prove that sn+1 is even, it is sufficient to prove that sn+1+tn+1 is even, i.e., number of walks of length n+1 starting from an odd degree vertex is even. But this quantity is just (u,v)∈V×Vdeg(u) odd∑fn(u,v)deg(v) This is because, if we fix the first and second-last vertices of a walk as u (having odd degree) and v respectively, then there are fn(u,v) walks of length n from u to v, and the (n+1)-st edge can be chosen adjacent to v in deg(v) ways. Therefore sn+1+tn+1=(u,v)∈V×Vdeg(u) odd∑fn(u,v)deg(v)=(u,v)∈V×Vdeg(u),deg(v) odd∑fn(u,v)deg(v)+(u,v)∈V×Vdeg(u) odddeg(v) even∑fn(u,v)deg(v)≡(u,v)∈V×Vdeg(u),deg(v) odd∑fn(u,v)(mod 2)=tn which is even by induction hypothesis, as required. Hence each sn is even, and we are done.
Solution 3
Let fn(u,v) be the number of n length walks from vertex u to vertex v. We want to compute ∑(u,v)∈Vf2022(u,v)(degu)(degv+1)(mod2) across all vertices u,v∈V. Now, if Rn is the number of all walks in the graph, then by Claim 2 in Solution A, Rn is even for all n∈N. (u,v)∈V∑f2022(u,v)(degu)(degv)+f2022(degu)=R2024+R2023≡0+0(mod2) Thus, we are done. □
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.
Source: MathNet,
licensed CC-BY-4.0.
Statement reproduced verbatim; metadata (topic, difficulty) added by this project.