This is not really a tutorial, but an exceedingly hard logic puzzle for you to solve. According to the late philosopher and logician George Boolos, who was a great teacher and logician at MIT, the hardest (recreational) logical puzzle is one that was invented by the logician and puzzle-master Raymond Smullyan, and modified slightly by the computer scientist John McCarthy. Here is the puzzle :
Note that you can ask the same God more than once. You can also think of Random as a god who would give either a truthful or false answer depending on the flip of a coin. This puzzle is a very difficult. If you can't solve the problem, don't feel too bad about it. You can read the solution in chapter 29 of Boolos's book Logic, Logic, and Logic, published by the Harvard University Press. [Link to Google book] You can also find a discussion of the puzzle on Wikipedia. But don't give up so easily!
There is now also a TED-Ed video on this puzzle, with a discussion of the solution: