{ "metadata": { "name": "", "signature": "sha256:8d72ce9b9f91ed6f96f980210b0177925f92e33982b2b89f998df6d06998c484" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\"Puzzle - you have A, A', B, B', C, C'. A, A' etc. differ in weight by 1 ounce. Separate the heavy and light using a balance only twice.\"" ] }, { "cell_type": "code", "collapsed": false, "input": [ "a = 1\n", "A = 2\n", "b = 1\n", "B = 2\n", "c = 1\n", "C = 2" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "# First weight\n", "(a + b + c) < (A + B + C)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 5, "text": [ "True" ] } ], "prompt_number": 5 }, { "cell_type": "code", "collapsed": false, "input": [ "# Second weight\n", "a < A" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 7, "text": [ "True" ] } ], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Then lower case letters are lighter." ] } ], "metadata": {} } ] }