Hoare triples

Ferreira JF, Mendes A.  2014.  The Magic of Algorithm Design and Analysis: Teaching Algorithmic Skills using Magic Card Tricks. 19th Annual Conference on Innovation and Technology in Computer Science Education (ITiCSE 2014). :75-80. Abstract2014-magicalgorithmdesign.pdf

We describe our experience using magic card tricks to teach algorithmic skills to first-year Computer Science undergraduates. We illustrate our approach with a detailed discussion on a card trick that is typically presented as a test to the psychic abilities of an audience. We use the trick to discuss concepts like problem decomposition, pre- and post-conditions, and invariants. We discuss pedagogical issues and analyse feedback collected from students. The feedback has been very positive and encouraging.