\documentclass[numbers=enddot,12pt,final,onecolumn,notitlepage]{scrartcl}%
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[all,cmtip]{xy}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{framed}
\usepackage{comment}
\usepackage{color}
\usepackage{hyperref}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{needspace}
\usepackage{tabls}
\usepackage{wasysym}
\usepackage{easytable}
\usepackage{ytableau}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Monday, November 27, 2023 21:15:08}
%TCIDATA{SuppressPackageManagement}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{Language=American English}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\usetikzlibrary{arrows.meta}
\usetikzlibrary{chains}
\newcounter{exer}
\numberwithin{exer}{subsection}
\theoremstyle{definition}
\newtheorem{theo}{Theorem}[subsection]
\newenvironment{theorem}[1][]
{\begin{theo}[#1]\begin{leftbar}}
{\end{leftbar}\end{theo}}
\newtheorem{lem}[theo]{Lemma}
\newenvironment{lemma}[1][]
{\begin{lem}[#1]\begin{leftbar}}
{\end{leftbar}\end{lem}}
\newtheorem{prop}[theo]{Proposition}
\newenvironment{proposition}[1][]
{\begin{prop}[#1]\begin{leftbar}}
{\end{leftbar}\end{prop}}
\newtheorem{defi}[theo]{Definition}
\newenvironment{definition}[1][]
{\begin{defi}[#1]\begin{leftbar}}
{\end{leftbar}\end{defi}}
\newtheorem{remk}[theo]{Remark}
\newenvironment{remark}[1][]
{\begin{remk}[#1]\begin{leftbar}}
{\end{leftbar}\end{remk}}
\newtheorem{coro}[theo]{Corollary}
\newenvironment{corollary}[1][]
{\begin{coro}[#1]\begin{leftbar}}
{\end{leftbar}\end{coro}}
\newtheorem{conv}[theo]{Convention}
\newenvironment{convention}[1][]
{\begin{conv}[#1]\begin{leftbar}}
{\end{leftbar}\end{conv}}
\newtheorem{quest}[theo]{Question}
\newenvironment{question}[1][]
{\begin{quest}[#1]\begin{leftbar}}
{\end{leftbar}\end{quest}}
\newtheorem{warn}[theo]{Warning}
\newenvironment{warning}[1][]
{\begin{warn}[#1]\begin{leftbar}}
{\end{leftbar}\end{warn}}
\newtheorem{conj}[theo]{Conjecture}
\newenvironment{conjecture}[1][]
{\begin{conj}[#1]\begin{leftbar}}
{\end{leftbar}\end{conj}}
\newtheorem{exam}[theo]{Example}
\newenvironment{example}[1][]
{\begin{exam}[#1]\begin{leftbar}}
{\end{leftbar}\end{exam}}
\newtheorem{exmp}[exer]{Exercise}
\newenvironment{exercise}[1][]
{\begin{exmp}[#1]\begin{leftbar}}
{\end{leftbar}\end{exmp}}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\medskip \begin{small}}{\end{small} \medskip}
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{warning}[1][Warning]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{teachingnote}[1][Teaching note]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\voffset=0cm
\hoffset=-0.7cm
\setlength\textheight{22.5cm}
\setlength\textwidth{15.5cm}
\newcommand\arxiv[1]{\href{http://www.arxiv.org/abs/#1}{\texttt{arXiv:#1}}}
\newenvironment{verlong}{}{}
\newenvironment{vershort}{}{}
\newenvironment{noncompile}{}{}
\newenvironment{teachingnote}{}{}
\excludecomment{verlong}
\includecomment{vershort}
\excludecomment{noncompile}
\excludecomment{teachingnote}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\id}{\operatorname{id}}
\newcommand{\lcm}{\operatorname{lcm}}
\newcommand{\rev}{\operatorname{rev}}
\newcommand{\powset}[2][]{\ifthenelse{\equal{#2}{}}{\mathcal{P}\left(#1\right)}{\mathcal{P}_{#1}\left(#2\right)}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tup}[1]{\left( #1 \right)}
\newcommand{\ive}[1]{\left[ #1 \right]}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\lf}[2]{#1^{\underline{#2}}}
\newcommand{\underbrack}[2]{\underbrace{#1}_{\substack{#2}}}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\newcommand{\are}{\ar@{-}}
\newcommand{\nnn}{\nonumber\\}
\newcommand{\sslash}{\mathbin{/\mkern-6mu/}}
\newcommand{\numboxed}[2]{\underbrace{\boxed{#1}}_{\text{box } #2}}
\newcommand{\ig}[2]{\includegraphics[scale=#1]{#2.png}}
\iffalse
\NOEXPAND{\today}{\today}
\NOEXPAND{\sslash}{\sslash}
\NOEXPAND{\numboxed}[2]{\numboxed}
\fi
\ihead{Math 235 Fall 2023, Worksheet 9, version \today}
\ohead{page \thepage}
\cfoot{Darij Grinberg}
\begin{document}
\setcounter{section}{8}

\section{Math 235 Fall 2023, Worksheet 9: Assorted problems II}

Here comes another sm\"{o}rg\aa sbord worksheet. No new theory to read up on
(although the class problems have been chosen to introduce some mildly new
ideas). Use the time to finish reading Worksheet 8 :)

Some of the problems here come from enumerative combinatorics. See
\cite[Chapter 7]{20f} for a much more comprehensive introduction to that. (On
this worksheet, however, we will need only the simplest few of its ideas,
which should be well-known.)

I am also using this as an occasion to introduce some very basic combinatorial
game theory. For more, see (e.g.) \cite[Chapter 1]{KarPer16} and
\cite{AlNoWo19}.

As before, $\mathbb{N}$ means the set $\left\{  0,1,2,\ldots\right\}  $.

\subsection{Class problems}

The following problems are to be discussed during class.

\begin{exercise}
Let $k\in\mathbb{N}$ and $n\in\mathbb{N}$. Let $\mathbf{a}=\left(  a_{1}%
,a_{2},\ldots,a_{n}\right)  $ be an $n$-tuple of elements of $\left\{
1,2,\ldots,k\right\}  $.

Prove that there are exactly $k+n\left(  k-1\right)  $ distinct $\left(
n+1\right)  $-tuples that can be obtained from $\mathbf{a}$ by inserting a
further element of $\left\{  1,2,\ldots,k\right\}  $ at some position.
\medskip

[\textbf{Example:} If $k=3$ and $n=3$ and $\mathbf{a}=\left(  1,3,1\right)  $,
then the distinct $\left(  n+1\right)  $-tuples we can obtain this way are
\begin{align*}
&  \left(  1,1,3,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  2,1,3,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  3,1,3,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
1,2,3,1\right)  ,\\
&  \left(  1,3,3,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,3,1,1\right)
,\ \ \ \ \ \ \ \ \ \ \left(  1,3,2,1\right)  ,\ \ \ \ \ \ \ \ \ \ \left(
1,3,1,2\right)  ,\ \ \ \ \ \ \ \ \ \ \left(  1,3,1,3\right)  .
\end{align*}
There are $9$ of them. Note that we said \textquotedblleft
distinct\textquotedblright, so we don't count $\left(  1,1,3,1\right)  $ twice
even though $\left(  1,1,3,1\right)  $ can be obtained from $\left(
1,3,1\right)  $ in two different ways.]
\end{exercise}

\begin{exercise}
\label{exe.9.c-game}Let $n$ be a positive integer. Two players play the
following game: Initially, $n$ candles burn on a table. The two players
alternatingly make moves, where each move consists in blowing out an arbitrary
number of candles between $1$ and $5$ inclusive (he chooses this number). The
player to blow out the last candle wins.

For what $n$ does the first player (i.e., the player making the first move)
have a winning strategy?

For what $n$ does the second player have a winning strategy?
\end{exercise}

\begin{exercise}
\label{exe.9.c.bitstring}Let $n\in\mathbb{N}$. An $n$\emph{-bitstring} shall
mean an $n$-tuple $\left(  a_{1},a_{2},\ldots,a_{n}\right)  \in\left\{
0,1\right\}  ^{n}$ (that is, an $n$-tuple of $0$'s and $1$'s). Clearly, there
are $2^{n}$ many $n$-bitstrings. (For example, $\left(  1,1,0,1\right)  $ is a
$4$-bitstring.)

\begin{enumerate}
\item[\textbf{(a)}] An $n$-bitstring $\left(  a_{1},a_{2},\ldots,a_{n}\right)
$ is said to be \emph{lacunar} if it contains no two consecutive $1$'s (that
is, there exists no $i\in\left\{  1,2,\ldots,n-1\right\}  $ such that
$a_{i}=a_{i+1}=1$). How many lacunar $n$-bitstrings are there?

\item[\textbf{(b)}] An $n$-bitstring $\left(  a_{1},a_{2},\ldots,a_{n}\right)
$ is said to be \emph{slow} if it contains no entry that differs from both its
neighbors (i.e., there exists no $i\in\left\{  2,3,\ldots,n-1\right\}  $ such
that $a_{i}$ is distinct from both $a_{i-1}$ and $a_{i+1}$). How many slow
$n$-bitstrings are there?

\item[\textbf{(c)}] What is the total number of $1$'s summed over all $n$-bitstrings?

\item[\textbf{(d)}] What is the total number of $1$'s summed over all slow $n$-bitstrings?
\end{enumerate}
\end{exercise}

\begin{exercise}
Consider a circle with center $O$. Three points on this circle are chosen
randomly (each one chosen according to the uniform distribution, independently
of the other two). What is the probability that $O$ lies inside the triangle
that these three points form?

\flushright(Simpler variant of Putnam contest 1992 problem A6)
\end{exercise}

\begin{exercise}
Let $A$ and $B$ be two $2\times2$-matrices with integer entries. Assume that
for each $k\in\left\{  1,2,3,4,5\right\}  $, the matrix $A+kB$ is invertible
and its inverse has integer entries. Prove that this holds for all
$k\in\mathbb{Z}$. \medskip

[\textbf{Hint:} If $U$ is an invertible matrix, then $\det\left(
U^{-1}\right)  =\left(  \det U\right)  ^{-1}$. What can you say about
$\det\left(  A+tB\right)  $ as a polynomial in $t$ ?]
\end{exercise}

\subsection{Homework exercises}

Solve 4 of the 10 exercises below and upload your solutions on gradescope by
December 12.

\begin{exercise}
Consider the same game as in Exercise \ref{exe.9.c-game}, but with a minor
difference: Now, each player is allowed to blow out $1$, $2$ or $4$ candles
(rather than $k\in\left\{  1,2,3,4,5\right\}  $ candles).

\begin{enumerate}
\item[\textbf{(a)}] Same question as before: Who wins (depending on $n$),
assuming optimal play?

\item[\textbf{(b)}] What if, instead, each player can blow out $2$ or $3$
candles? Blowing out the second-to-last candle also counts as winning here
(since it leaves the next player with no possible moves).

\item[\textbf{(c)}] Generalize part \textbf{(b)}: Fix an integer $m>2$. Assume
that each player can blow out an arbitrary number $k\in\left\{  2,3,\ldots
,m-1\right\}  $ of candles. Who wins?
\end{enumerate}
\end{exercise}

\begin{exercise}
Let $A$ and $B$ be two $n\times n$-matrices with complex entries such that
$AB+A+B=0$. Prove that $BA+B+A=0$ as well. \medskip

[\textbf{Hint:} One of the many facets of the infamous
\href{https://en.wikipedia.org/wiki/Invertible_matrix#The_invertible_matrix_theorem}{Invertible
Matrix Theorem} says the following: If $X$ and $Y$ are two $n\times
n$-matrices that satisfy $XY=I_{n}$ (where $I_{n}$ is the $n\times n$ identity
matrix), then $YX=I_{n}$ as well.]
\end{exercise}

\begin{exercise}
Let $n$ be a positive integer. Consider the $2^{n}$ many $n$-bitstrings (see
Exercise \ref{exe.9.c.bitstring} for their definition). Assume that $2^{n-1}$
of these $2^{n}$ bitstrings have been colored white (arbitrarily), while the
remaining $2^{n-1}$ have been colored black. Prove that there exist at least
$2^{n-1}$ pairs $\left(  w,b\right)  $, where $w$ is a white $n$-bitstring,
where $b$ is a black $n$-bitstring, and where $w$ and $b$ differ in exactly
one position. \medskip

[\textbf{Example:} The two $4$-bitstrings $\left(  0,1,0,0\right)  $ and
$\left(  0,1,1,0\right)  $ differ in exactly one position (the third one).]
\end{exercise}

\begin{exercise}
Let $a,b,c$ be three positive reals satisfying $a^{2}+b^{2}+c^{2}=1$. Show
that $\dfrac{bc}{a}+\dfrac{ca}{b}+\dfrac{ab}{c}\geq\sqrt{3}$.

\flushright(BWM Germany 2019, 2nd round, problem 2)
\end{exercise}

\begin{exercise}
Let $n$ be a positive integer such that $n\equiv-1\operatorname{mod}12$. Let
$s$ be the sum of all positive divisors of $n$. Prove that $12\mid s$.
\end{exercise}

\begin{exercise}
For each positive integer $n$, let $\operatorname*{god}\left(  n\right)  $
denote the greatest odd divisor of $n$. For instance, $\operatorname*{god}%
\left(  24\right)  =3$ and $\operatorname*{god}\left(  25\right)  =25$ and
$\operatorname*{god}\left(  30\right)  =15$.

Given two positive integers $a$ and $b$. We define a sequence $\left(
x_{1},x_{2},x_{3},\ldots\right)  $ of positive integers recursively by setting
$x_{1}=a$ and $x_{2}=b$ and%
\[
x_{n}=\operatorname*{god}\left(  x_{n-1}+x_{n-2}\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }n\geq3.
\]


Prove that all entries of this sequence from a certain point on are equal to
$\operatorname*{god}\left(  \gcd\left(  a,b\right)  \right)  $. In other
words, prove that there exists a $k\geq1$ such that $x_{k}=x_{k+1}%
=x_{k+2}=\cdots=\operatorname*{god}\left(  \gcd\left(  a,b\right)  \right)  $.

\flushright(Tournament of Towns 30.6.3, by G. Galperin)
\end{exercise}

\begin{exercise}
Let $p$ and $q$ be two coprime positive integers. Let $s=p+q$.

\begin{enumerate}
\item[\textbf{(a)}] Prove that $\left\{  \left(  ip\right)  \%s\ \mid
\ i\in\left\{  1,2,\ldots,s-1\right\}  \right\}  =\left\{  1,2,\ldots
,s-1\right\}  $. (That is, the $s-1$ remainders $\left(  1p\right)
\%s,\ \left(  2p\right)  \%s,\ \ldots,\ \left(  \left(  s-1\right)  p\right)
\%s$ are just the $s-1$ numbers $1,2,\ldots,s-1$ in some order.)

\item[\textbf{(b)}] Let $\mathbf{a}=\left(  a_{1},a_{2},\ldots,a_{s-1}\right)
$ be an $\left(  s-1\right)  $-tuple of arbitrary objects (e.g., numbers).
Given an integer $d\in\left\{  1,2,\ldots,s-1\right\}  $, we say that
$\mathbf{a}$ is $d$\emph{-periodic} if each $i\in\left\{  1,2,\ldots
,s-1-d\right\}  $ satisfies $a_{i}=a_{i+d}$.

Assume that $\mathbf{a}$ is both $p$-periodic and $q$-periodic. Prove that
$\mathbf{a}$ is $1$-periodic (i.e., we have $a_{1}=a_{2}=\cdots=a_{s-1}$).

\item[\textbf{(c)}] Generalize part \textbf{(b)}: Let $\mathbf{a}=\left(
a_{1},a_{2},\ldots,a_{k}\right)  $ be a $k$-tuple of arbitrary objects, where
$k\geq s-1$. Given an integer $d\in\left\{  1,2,\ldots,k\right\}  $, we say
that $\mathbf{a}$ is $d$\emph{-periodic} if each $i\in\left\{  1,2,\ldots
,k-d\right\}  $ satisfies $a_{i}=a_{i+d}$.

Assume that $\mathbf{a}$ is both $p$-periodic and $q$-periodic. Prove that
$\mathbf{a}$ is $1$-periodic (i.e., we have $a_{1}=a_{2}=\cdots=a_{k}$).
\end{enumerate}
\end{exercise}

\begin{exercise}
Let $a_{1},a_{2},\ldots,a_{n}$ be $n$ integers. A pair $\left(  i,j\right)  $
of integers satisfying $1\leq i<j\leq n$ will be called

\begin{itemize}
\item an \emph{odd inversion} if $a_{i}$ is odd, $a_{j}$ is even, and $j-i$ is odd;

\item an \emph{even inversion} if $a_{i}$ is odd, $a_{j}$ is even, and $j-i$
is even.
\end{itemize}

Prove that the number of odd inversions is at least as large as the number of
even inversions.

\flushright(Tournament of Towns 30.6.4, by V. Yassinski)
\end{exercise}

\begin{exercise}
We write the numbers $1,2,\ldots,n^{2}$ into the $n^{2}$ cells of an $n\times
n$-chessboard (where $n>1$). (Each number goes into exactly one cell.)

Prove that we can find two adjacent cells of this chessboard in which the two
numbers differ by more than $n$. Here, \textquotedblleft
adjacent\textquotedblright\ means \textquotedblleft have an edge or a vertex
in common\textquotedblright\ (so a cell can have up to $8$ other cells
adjacent to it).

\flushright(Tournament of Towns 12.5, by N. Sedrakyan)
\end{exercise}

\begin{exercise}
Continue with the notations of Exercise \ref{exe.9.c.bitstring}. Recall also
the Fibonacci sequence $\left(  f_{0},f_{1},f_{2},\ldots\right)  $, defined by
$f_{0}=0$ and $f_{1}=1$ and $f_{n}=f_{n-1}+f_{n-2}$ for each $n\geq2$.

Prove that the total number of $1$'s summed over all lacunar $n$-bitstrings is%
\[
\dfrac{nf_{n+1}+2\left(  n+1\right)  f_{n}}{5}.
\]

\end{exercise}

\begin{thebibliography}{99999999}                                                                                         %


\bibitem[AlNoWo19]{AlNoWo19}Michael H. Albert, Richard J. Nowakowski, David
Wolfe, \textit{Lessons in Play: An Introduction to Combinatorial Game Theory},
2nd edition 2019.

\bibitem[Grinbe20]{20f}Darij Grinberg, \textit{Math 235: Mathematical Problem
Solving}, 10 August 2021.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/t/20f/mps.pdf}

\bibitem[KarPer16]{KarPer16}Anna R. Karlin, Yuval Peres, \textit{Game Theory,
Alive}, 13 December 2016.\newline\url{https://homes.cs.washington.edu/~karlin/GameTheoryBook.pdf}
\end{thebibliography}


\end{document}