It's worth noting that one of the early finite groups that is taught in abstract algebra are the dihedral groups which model exactly this sort of behavior (For your phone example this would be D₄. Knowing that mattress flipping is modeled with D₂ makes it trivial to prove that that there is no combination of flip and rotate that will allow you to always do the same move to your mattress to get it into the four possible positions for optimal wear.