A Puzzle About Socks

Here’s a puzzle to help practice your computational thinking skills. Don’t forget to take it slowly and think through your answer carefully before committing.

A sock drawer contains ten pairs of black socks and ten pairs of white socks. If you are only allowed to take one sock from the drawer at a time and you can’t see what colour sock you are taking until you have taken it, how many socks do you have to take before you are guaranteed to have at least one matching pair?

If you want a fun programming challenge, why not write some code in your favourite language to simulate this problem?

Sharing is caring!

Leave a Reply

Your email address will not be published. Required fields are marked *