A magazine where the digital world meets the real world.
On the web
- Home
- Browse by date
- Browse by topic
- Enter the maze
- Follow our blog
- Follow us on Twitter
- Resources for teachers
- Subscribe
In print
What is cs4fn?
- About us
- Contact us
- Partners
- Privacy and cookies
- Copyright and contributions
- Links to other fun sites
- Complete our questionnaire, give us feedback
Search:
The Computer reads your mind - and proves it!
Why is logical thinking important in computer science? What has proof got to do with it? Can a computer do card tricks? Can a computer read your mind?
This one can and can prove it! Try the following trick, then read on to find out how to do the trick yourself and find out what it has to do with computer algorithms and then with logic and proof.
You have to think of a card. The computer is going to work out which one. Make sure you think hard about the same card all the way through. If you aren't thinking hard enough, the computer will ask you questions about it. You must answer questions truthfully when asked.
Before you read on, have a go at working out how the trick works. Clearly the computer can't read your mind. It is just following instructions. The same ones every time. It also seems to never fail (as long as you keep thinking of the same card all the way through and don't lie about the column it's in of course). For me to trust your computer to do the magic, I must be pretty sure it does works.
One way you could convince yourself is by getting it to do the trick over and over. Would that ever convince you? Try it. You have to stop eventually. What about the next time? Will the rules it is following work that time too? How many tests are enough? Or is there a better way?
In fact I know it always works - I've proved it (so I can sleep easy at night now). With a little logic and proof I can be sure the rules are right.
Read on for how to do it, a proof and the link to computer science: getting programs to work.