This is implementation of "shannon oracle". shannon.c is simple C implementation with fixed depth and breadth. shannon.cpp is C++ implementation with variable parameters. Compile one of them (cc shannon.c -o shannon, or c++ shannon.cpp -o shannon), and start as $ ./shannon -h # human interaction mode In default mode (depth=5, breadth=2) shannon oracle can be used as an opponent the in "heads or tails" game---it shows its guesses and asks for real value invented by player (relying on latter's fairness, that is). It requires about 100 moves to acquire proficiency and to start winning (unless player use real coin or other source of random input). One can use it with bit-stream (http://www.geocities.com/nikitadanilov/code/bit-stream.c) to do things like wget --passive-ftp ftp://ftp.archive.org/pub/etext/etext03/gbwlc10.txt -O - | \ ./bit-stream -D '' | ./shannon -d 25 | ./bit-stream -u To convert text (The Golden Bowl, by Henry James in this case) into binary stream, feed it to the shannon oracle and encode output (binary stream again, consisting of guesses) back into ascii. I have no references for description of this algorithm; it was implemented from the memory. Nikita Danilov. (NikitaDanilov@Yahoo.COM)