The Mathematics of Tying Shoes

By Daniel K. Allen

On April 27th, 2018, I sat on my Ikea stool in my closet, putting on my shoes and socks for
something like the 20,000th time, and I stopped to ponder how many different ways it could be done.

This is the result after working on the problem on and off since then.

What is a general equation?

  The multinomial function is:
  
    multinomial(x,y) = (x+y)! / (x! * y!)
  
  This equation can be applied to things that must happen
  in a specific order.  It determines the permutations of these collections
  that arise because they can be interleaved.  It is this:
  
    s = a + b + c + ... = the total number of steps across the collections
    a, b, c,... = the number of items for each independent set
  
  then
  
    s! / ( a! * b! * c!...) = the total number of possibilities
  
  The a, b, c... terms are for those sets of items that must be done in order.
  If an item can be interleaved independently, it contributes to s, but
  does not need to be in the denominator.  Examples follow.
  We shall apply this multinomial coefficient method where possible.

Socks & Shoes

This is for slip-on shoes, without any knots involved.
Each foot is an independent set, and each must do two things in order.
So there are two independent sets of two things, for a total of four steps.
Here are all six possible ways to put on socks and slip-on shoes:
4! / (2! * 2!) = 6
Left sock, left shoe, right sock, right shoe.
Left sock, right sock, left shoe, right shoe.
Left sock, right sock, right shoe, left shoe.
Right sock, left sock, left shoe, right shoe.
Right sock, left sock, right shoe, left shoe.
Right sock, right shoe, left sock, left shoe.

Socks, Shoes, Shoes Tied

In this case there are two independent sets of three things,
and within each set (foot) 3 things must happen in order.
Here are all 20 ways you can put on socks and shoes and tie them:
6! / (3! * 3!) = 20
Left sock, left shoe, left tied, right sock, right shoe, right tied.
Left sock, left shoe, right sock, left tied, right shoe, right tied.
Left sock, left shoe, right sock, right shoe, left tied, right tied.
Left sock, left shoe, right sock, right shoe, right tied, left tied.
Left sock, right sock, left shoe, left tied, right shoe, right tied.
Left sock, right sock, left shoe, right shoe, left tied, right tied.
Left sock, right sock, left shoe, right shoe, right tied, left tied.
Left sock, right sock, right shoe, left shoe, left tied, right tied.
Left sock, right sock, right shoe, left shoe, right tied, left tied.
Left sock, right sock, right shoe, right tied, left shoe, left tied.
Right sock, left sock, left shoe, left tied, right shoe, right tied.
Right sock, left sock, left shoe, right shoe, left tied, right tied.
Right sock, left sock, left shoe, right shoe, right tied, left tied.
Right sock, left sock, right shoe, left shoe, left tied, right tied.
Right sock, left sock, right shoe, left shoe, right tied, left tied.
Right sock, left sock, right shoe, right tied, left shoe, left tied.
Right sock, right shoe, left sock, left shoe, left tied, right tied.
Right sock, right shoe, left sock, left shoe, right tied, left tied.
Right sock, right shoe, left sock, right tied, left shoe, left tied.
Right sock, right shoe, right tied, left sock, left shoe, left tied.

Pants, Socks, and Shoes

If pants must go on before socks and shoes, then we can add each pants leg
as a step to be done for each foot. If it is for slip-on shoes, we have the
same formula as above (pant leg -> then sock -> then shoe = 3 steps) twice, or:
6! / (3! * 3!) = 20

Pants, Socks, Shoes, Shoes Tied

Pants can go on anytime before shoes, so they do not fit our formula.
There are 20 ways with pants as the first step, 20 ways as the second step,
but only 12 ways left once both sox are on, so there are 52 different ways:
20 + 20 + 12 = 52
Pants, Left sock, left shoe, left tied, right sock, right shoe, right tied.
Pants, Left sock, left shoe, right sock, left tied, right shoe, right tied.
Pants, Left sock, left shoe, right sock, right shoe, left tied, right tied.
Pants, Left sock, left shoe, right sock, right shoe, right tied, left tied.
Pants, Left sock, right sock, left shoe, left tied, right shoe, right tied.
Pants, Left sock, right sock, left shoe, right shoe, left tied, right tied.
Pants, Left sock, right sock, left shoe, right shoe, right tied, left tied.
Pants, Left sock, right sock, right shoe, left shoe, left tied, right tied.
Pants, Left sock, right sock, right shoe, left shoe, right tied, left tied.
Pants, Left sock, right sock, right shoe, right tied, left shoe, left tied.
Pants, Right sock, left sock, left shoe, left tied, right shoe, right tied.
Pants, Right sock, left sock, left shoe, right shoe, left tied, right tied.
Pants, Right sock, left sock, left shoe, right shoe, right tied, left tied.
Pants, Right sock, left sock, right shoe, left shoe, left tied, right tied.
Pants, Right sock, left sock, right shoe, left shoe, right tied, left tied.
Pants, Right sock, left sock, right shoe, right tied, left shoe, left tied.
Pants, Right sock, right shoe, left sock, left shoe, left tied, right tied.
Pants, Right sock, right shoe, left sock, left shoe, right tied, left tied.
Pants, Right sock, right shoe, left sock, right tied, left shoe, left tied.
Pants, Right sock, right shoe, right tied, left sock, left shoe, left tied.
Left sock, pants, left shoe, left tied, right sock, right shoe, right tied.
Left sock, pants, left shoe, right sock, left tied, right shoe, right tied.
Left sock, pants, left shoe, right sock, right shoe, left tied, right tied.
Left sock, pants, left shoe, right sock, right shoe, right tied, left tied.
Left sock, pants, right sock, left shoe, left tied, right shoe, right tied.
Left sock, pants, right sock, left shoe, right shoe, left tied, right tied.
Left sock, pants, right sock, left shoe, right shoe, right tied, left tied.
Left sock, pants, right sock, right shoe, left shoe, left tied, right tied.
Left sock, pants, right sock, right shoe, left shoe, right tied, left tied.
Left sock, pants, right sock, right shoe, right tied, left shoe, left tied.
Right sock, pants, left sock, left shoe, left tied, right shoe, right tied.
Right sock, pants, left sock, left shoe, right shoe, left tied, right tied.
Right sock, pants, left sock, left shoe, right shoe, right tied, left tied.
Right sock, pants, left sock, right shoe, left shoe, left tied, right tied.
Right sock, pants, left sock, right shoe, left shoe, right tied, left tied.
Right sock, pants, left sock, right shoe, right tied, left shoe, left tied.
Right sock, pants, right shoe, left sock, left shoe, left tied, right tied.
Right sock, pants, right shoe, left sock, left shoe, right tied, left tied.
Right sock, pants, right shoe, left sock, right tied, left shoe, left tied.
Right sock, pants, right shoe, right tied, left sock, left shoe, left tied.
Left sock, right sock, pants, left shoe, left tied, right shoe, right tied.
Left sock, right sock, pants, left shoe, right shoe, left tied, right tied.
Left sock, right sock, pants, left shoe, right shoe, right tied, left tied.
Left sock, right sock, pants, right shoe, left shoe, left tied, right tied.
Left sock, right sock, pants, right shoe, left shoe, right tied, left tied.
Left sock, right sock, pants, right shoe, right tied, left shoe, left tied.
Right sock, left sock, pants, left shoe, left tied, right shoe, right tied.
Right sock, left sock, pants, left shoe, right shoe, left tied, right tied.
Right sock, left sock, pants, left shoe, right shoe, right tied, left tied.
Right sock, left sock, pants, right shoe, left shoe, left tied, right tied.
Right sock, left sock, pants, right shoe, left shoe, right tied, left tied.
Right sock, left sock, pants, right shoe, right tied, left shoe, left tied.
I would like to find a formula for this. This is a brute force solution at present.

Pants Anytime

A variation of this would be, what if your shoes were small and pants could fit
over your shoes? Then pants could be put on anytime in the process. If this was
the case, it would be a 7th step but because you could do it anytime, resulting in:
7! / (3! * 3!) = 140

Pant Legs, Socks, Shoes, Shoes Tied

If each pant leg is to always be put on before socks,
we now have added a new prerequisite step for each foot, to wit:

1) pant leg
2) sock
3) shoe
4) tie shoe

If this is the case, we now have 4 steps to perform per foot, so:

8! / (3! * 3!) = 1120

Pant Legs Before Shoes

This variation is that the pant leg and the sock both need to be put on before the shoes,
but they can be done in either order. There is no formula for this, but there are 280 ways of doing this.

Pant Legs, Socks, Untie, Shoe, Knot

If shoes need to be untied before putting them on, we add yet another step and complication.

1) pant leg
2) sock
3) untie shoe
4) shoe
5) tie shoe

If we do these 10 steps in order, we then have:

10! / (5! * 5!) = 252
In reality, the first three steps can be done in any order, so that really complicates things.
The formula is not known at present for this, but there are 9072 different ways to accomplish this!

To see how these results were numerically simulated and modeled, check out my awk program to do this:

  shoes.awk


Created:  27 Apr 2018
Modified: 23 Jul 2026
Back to the home page.