You've managed to gather 6-11 socks from the depths of the washing machine. Now it's time to calculate the optimal number of pairs.
Assuming you have n socks, where n is a positive integer between 6 and 11, we need to find the maximum number of pairs possible.
Using our trusty Sock Pair Algorithm, we can calculate the number of pairs as:
n(n+1)/2
Plugging in the values, we get:
6(6+1)/2 = 18/2 = 9
Or, alternatively, you could have used the Sock Pair Algorithm 2.0, which takes into account the inherent chaos of socks:
(n-1)(n+1)/2 + (n mod 2) = 9
You now know you have 9 pairs of socks, but don't forget, you're still missing 1 sock...