Skip navigation

Monthly Archives: July 2011




Version control systems are important, and Git is one of the nicest one’s out there.  If you’re new to version control systems (VCS), or have mainly worked on small projects in the past, then it might not seem worth it to use one. However, once you start working on larger projects or need to collaborate with others, VCS’s become very important. Here’s a good explanation of Git and how it works that I wish I had found when I learned:

As Isaiah and I were hiking the Appalachian Trial this past July 4th weekend, he told me he had a fun riddle. Liking the logical nature of riddles and the thought process to solve them, I excitedly encouraged him to continue. The riddle is as follows:

There is a town with a small number (~200 but not really important) of married couples. Everyone in this town takes cheating very seriously. Once a woman cheats on her husband, everyone in the town will know except the husband. However, the day a husband catches his wife cheating he will kill her. One day, the Mayor of this town announces, “Some number of people in this town are cheating.” Note we do not know how many people are cheating, we only know that cheating is occurring. After this announcement no cheating occurs.

Seven day’s later, seven husbands kill their wives. Why did this happen?

Two hints and the answer are below spaced out by images [My photos from the Chattahoochee section of the Appalachian Trail in northern Georgia]:

Hint1: Think about the rules of the system. If cheating occurs, everyone in the town will know except the person who is being cheated on. What information does the Mayor give away? Also, It doesn’t matter if cheating or not occurs after the announcement, as long as no new cheating occurs.

Hint2: Review what happens after one day passes. The significance of the sentence “the day a husband catches his wife cheating he will kill her.” It might help to consider the other possible case of this riddle where if only one person is cheating. Then consider another case where two people are cheating: if the Mayor were to announce the cheating, and then two days later two husbands killed their wives. What happens after the first day that allows the husbands to know that their wives are cheating?

Answer: First let’s start with a single wife cheating with another husband. Say Alice cheats on Alan. If a Alice were to cheat, then upon hearing this announcement Alan would not know of any cheating going on and would be forced to kill her since he hasn’t heard of any cheating.

If we consider the case the second hint makes where if after two days two husbands kill their wives, then we can see what is learned after the first day. Consider two couples, Alice and Alan, and Bree and Bob. Say that Alice and Bree are both cheating on their husbands. If the Mayor announces the cheating, then both of their husbands will have knowledge of someone else cheating and not kill their wives after the first day. Then once this day passes, they will each realize that since no wife was killed like in the case above with one wife cheating, then there must be at least two people cheating. But they each only know of one person cheating, so the other must be their wives.

This process can be repeated up to seven days.  So the general form of this riddle would be told having N days pass and N wives killed. Pretty Sweet!
Related Riddle Links: