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



To see the correct solution, click 'Show' button... SelectShow

« - »
  • tom

    I really like your riddles but I have a little problem with your notation. if you write:
    Rx = x

    It seams to me that you evaluate the right side but you dont evaluate the left side.
    for x=QQ
    Right side(RQQ) names QQ but left side(QQ) names Q.

    So it looks like that you evaluate only right side but you dont evaluete left side. For x=QQ is Rx=x true but x=Rx is not true. I find it strange that = is not symmetric.

    I think that the puzzle should sound more like this:

    Find statement for which is following true:

    e(Rx) = x

    where e( ) means evaluate code in brackets.

    For example:

    e(RQQ) = QQ

    e(e(RQQ)) = Q

    e(e(e(RQQ))) = e(Q) = not defined I think that sensible output would be empty string(statement)