Mathematics explains the correct and incorrect ways to tie shoelaces, leading to either a strong reef knot or a weak granny knot.