# How do I Wear All Combinations of my Clothes at Least Once?

I have 5 shorts and 13 t-shirts. My system is simple - I hang them sequentially on my rack and each day I pick up the front t-shirt and the front pair of shorts.

At the end of the day, I move each piece of clothing to the end of the line and the next day I pick up the "new" first in line.

I have the following questions:

1. Can I prove that I'm wearing every possible combination of shorts and t-shirts? (I can brute force this and the answer is, yes I am). Is the answer to simply ensure that the HCF of the number of t-shirts and shorts is 1?

2. I'm moving to Canada soon and will have three layers of clothing. So I will then have an additional two sets of clothing - an inner layer, and an outer jacket. If I use the same "first in first out" system, will I still run through every combination of clothing as long as the HCF is 1?

3. Is the branch of mathematics that deals with this combinatorics?

• You will wear every combination. This is due to Bezout's Lemma. This is basic number theory. Commented Dec 18, 2019 at 22:27
• If all counts of clothing are pairwise coprime, then you will eventually go through all combinations. This is essentially the Chinese Remainder Theorem, though that in turn can be derived from Bezout as well. It's basically just modular arithmetic. Commented Dec 18, 2019 at 22:31
• note that @Semiclassical said "pairwise coprime". Pairwise is key. It is not enough that the HCF (aka GCD) of all the numbers as a set is $1$, e.g. $\{2,3,5,9\}$ has GCD $=1$ but you obviously won't go through all combos among the $3$ and the $9$. Commented Dec 18, 2019 at 22:36
• My simple question is when do you wash them... Commented Dec 18, 2019 at 22:42

What you are essentially doing is looking at an action of the group $$G := C_{13} \times C_5$$ on the set consisting of all the pairs $$(\alpha,\beta)$$ where $$\alpha$$ is from the ordered set of t-shirts and $$\beta$$ is from the ordered set of shorts. Rephrased in this way, the question is whether the element $$(g,h)$$ of $$G$$ (where $$g$$ and $$h$$ are generators of $$C_{13}$$ and $$C_5$$ respectively) has an orbit of order $$13 \cdot 5$$ (because this is the number of choices of clothing) on the set of clothing.
But notice that the set of clothing itself has a natural group structure isomorphic to $$G$$ (namely, send $$(g^i,h^j) \leftrightarrow (\alpha_i,\beta_j)$$ where $$\alpha_i$$ is the $$i$$th t-shirt and $$\beta_j$$ is the $$j$$th pair of shorts). Hence the action we are interested in is the group action of $$G$$ on itself by left multiplication; and so since $$G$$ is a product of cyclic groups of coprime order, the action of $$(g,h)$$ on itself has order $$13 \cdot 5$$ as conjectured.
So to answer your first question: yes, it is because $$\gcd(5,13) = 1$$; and your reasoning for question 2 is correct as well, as long as all three numbers are pairwise coprime.