If we number these words as 1, 2, 3 and 4, then "tom likes anne" is encoded as 2 x 3x3 x 7x7x7x7. The list of primes is 2,3,5,7... and they correspond to the word ordering. So 2 is the first word, and 2 occurs once (1), so the first word is "tom". the next word is represented by 3 which occurs twice (2) so is "likes" and the third word is represented by 7, which occurs 4 times so is "anne".
"anne hates tom" would be 2x2x2x2 x 3x3x3 x 5.
if you think about it, this is pretty neat. given a number you can find factors and work out what the sentence is - even though the whole thing is squashed into a single number.
|
| | | | | | |
Base prime number system possible?I read The Curious Incident of the Bear in the Night-Time and one of the bits of cleverness is using primes to number the chapters. This got me thinking, is it poss... |
|
| Preview by Yahoo |
|
|
Ali