6.S095 | January IAP 2018 | Undergraduate

Programming for the Puzzled

Puzzle 3: You Can Read Minds

Prof. Devadas describes a mind reading trick that allows you to guess the fifth card that the audience thinks of, after you “fail” on the first four! With a competent assistant and a little practice, you’ll astonish everyone in attendance.

Puzzle Description

Python Code


  • Do one or more of the exercises in the You Can Read Minds puzzle.


Programming Constructs and Algorithmic Paradigms Covered in this Puzzle

  • Reading input from a user
  • Control flow for case analysis
  • Encoding and decoding information

Course Info

As Taught In
January IAP 2018
Learning Resource Types
Lecture Videos
Programming Assignments with Examples