Skip to main content
3 of 3
added 1460 characters in body
1001
  • 981
  • 3
  • 7

First note that any guest whose number is divisible by $3$ does not contribute to the lighting. Hence the light in room $3^kn$ will be the same as the light in room $n$ for all $k, n \in \mathbb{N}$.

Due to the cat's behaviour,

  • $n \equiv 1 \mod 3$ turns any light red
  • $n \equiv 2 \mod 3$ switches red and blue

Thus rooms with blue lights will be precisely the rooms where there are an odd number of divisors congruent to $2$ greater than its greatest divisor congruent to $1$.

To answer your first question, consider all numbers $n \equiv 2 \mod 6$. Its largest divisors are $n / 2 \equiv 1 \mod 3$ and $n \equiv 2 \mod 3$. Thus the light always ends up blue. Therefore the fraction of blue lights is bounded below by $1 / 6$.

More results can be found by considering different congruence classes of products of small primes. For example, if $n \equiv 1 \mod 3$ then the light is red; if $n \equiv 5 \mod 30$ then the light is blue. This gives some intuition for the linear behaviour. However more advanced techniques would be necessary to prove convergence.

Note that we can also say that the colour of room $n$ depends only on $n / 3^{e_3(n)} \mod 3$ and all its divisors $d_1,d_2,...,d_i \leq k$ whenever $n / (3^{e_3(n)}d_i) \equiv 1 \mod 3$ for some $i$. You then could try to prove that:

  • the fraction of $n$ such that $n / (3^{e_3(n)}d) \equiv 1 \mod 3$ for some $d \leq k$ converges to $1$ as $k \rightarrow \infty$
  • for fixed $k$ the fraction of blue light converges on the subset of $n$ with this property

Finally, neither the guests and the cat make their own decisions and rather follow a predetermined strategy. Therefore it is not really a game theory question and number theory is indeed the way to go.


Here is some code that should give some bounds. Note that is very inefficient, since it e.g. considers all congruence classes $1 \mod 3$ separately. It's probably more efficient to search the congruence classes in a tree-like fashion: first look at everything modulo 3, then only refine $2 \mod 3$ to $2, 5 \mod 6$ etc.

import math

def bounds(k):
    m = 3
    for i in range (1, k + 1):
        if i % 3:
            m = i * m // math.gcd(i, m)
    print("modulus: " + str(m))
    red, blue, unknown = 0, 0, 0
    total = 0
    for i in range (0, m):
        if i % 3 == 0:
            continue
        total += 1
        if i % 3 == 1:
            red += 1
            continue
        d = []
        for j in range (1, k + 1):
            if i % j == 0:
                if j % 3 == 2:
                    if len(d) % 2 == 0:
                        red += 1
                        break
                    else:
                        blue += 1
                        break
                d.append(j)
        else:
            unknown += 1
    print("red: {}\nblue: {}\nunknown: {}".format(red / total, blue / total, unknown / total))

Result:

>>> bounds(22)
modulus: 77597520
red: 0.5047129341246989
blue: 0.32416407122289476
unknown: 0.1711229946524064
1001
  • 981
  • 3
  • 7