Programming Brain Teaser #6: Fixed-point principle

9 May 2013 by Roman Kaspar - Category: Puzzles

As promised last time, let’s do something more serious today… Let a be any expression. We will call x the fixed point of expression a if x names ax. (Reminder: lower-case letters in our programming language represent a combination of upper-case letters.) The fixed-point principle says that for each expression a there exists its fixed point x. [...]


Programming Brain Teaser #5: More curiosities

23 April 2013 by Roman Kaspar - Category: Puzzles

Next time, we’ll explore more serious aspect of our programming language, but let’s have some fun for today finding expressions (programs) with strange properties, similar to what we did last time (but a bit more difficult today). As usual, we’ll use only Q and R rules (described here). Question 1: Find expressions x so that [...]


Programming Brain Teaser #4: More Rx riddles

9 April 2013 by Roman Kaspar - Category: Puzzles

Today, we’ll do something easier for change (but you’ll need to answer two questions). Again, we’ll use only two rules R and Q described here.. Question 1: For what statement x the following is true: Rx = x Question 2: For what statement x the following is true: Rx = Qx   Solution


Programming Brain Teaser #3: Repetition riddle

26 March 2013 by Roman Kaspar - Category: Puzzles

Today, we’ll explore one interesting aspect of the repetition rule of our programming language. To solve the puzzle, we’ll use the same two rules as last time, the Q rule (quotation) and the R rule (repetition). In case you need to refresh your memory, the rules are described here. From the rules definition you know [...]


Programming Brain Teaser #2: Self-reference

12 March 2013 by Roman Kaspar - Category: Puzzles

Let’s continue where we stopped last time with our robot programming language. We’ll need only two rules today, the Q rule (quotation) and the R rule (repetition). Should you need to refresh your memory, the rules are described here. The brain-teaser of the day is: can you find statement x that names itself (i.e. “resolves [...]


Programming Brain Teaser #1: Getting Started

25 February 2013 by Roman Kaspar - Category: Puzzles

With this post we start a series of brain teasers about logical programming. The stories are taken from Raymond Smullyan’s book Satan, Cantor and Infinity (an excellent book, by the way, worth reading for sure!). The correct solution to each riddle is posted here directly, so you can verify your answer right away. The estimated [...]