The Best Card Trick?

Time for a little mathemagic! Choose any five cards from a pack and show four of them to your partner. How can they work out the fifth?

Substitution Cipher

Find the frequency distribution for ordinary English, and use it to help you crack the code.

Secret Transmissions

How can Agent X transmit data on a faulty line and be sure that her message will get through?

Transposition Cipher

Stage: 3 and 4 Challenge Level:

Thanks to everyone for all the great answers! The original message was:

The rabbit hole went straight on, like a tunnel, for some way and then dipped suddenly down, so suddenly that Alice had not a moment to think about stopping herself before she found herself falling down what seemed to be a very deep well.

We removed all punctuation and capital letters from this message, so before it was encoded, it looked like this:

the rabbit hole went straight on like a tunnel for some way and then dipped suddenly down so suddenly that alice had not a moment to think about stopping herself before she found herself falling down what seemed to be a very deep well x

What's going on? Grace, from Saint Cecilia's, has an idea:

The message is 192 letters long. The factors of 192 are 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96 and 192. I believe the original text had 191 letters and an x was used for padding to make it 192.

Yes, that's right - 192 has lots of factors, so it's harder to decode! Jack, from the Beacon School, had a quick way of spotting where to start:

I knew that the T at the start of the passage was most probably going to be followed with an H. So, on my piece of paper, I took the first H in the passage and moved it down a line so that the top of my passage was 8 letters across. Then I carried on to get an 8x24 block.

He later remarked:

I thought this must be a quote from a book, so I searched "The rabbit hole went straight on like a tunnel for some way and then dipped suddenly down" on Google. In a description of a website it had the quote and it also mentioned "Alice in Wonderland", so I went onto www.gutenberg.org (a website I knew from a previous challenge) and searched "Alice in Wonderland" in the Book Search. This text was in the 5th paragraph.

Martha, from Kings Norton Girls' School, tried a lot of blocks, and after finding the 24 by 8 arrangement made the rather sharp comment:

I chose not to continue with the grids as the chance that this was in fact not the intended message is so minute and the idea that this quote has in fact turned up by chance sounds verging on crazy!

Here is the secret message written in a 24 by 8 grid:

t t a n o p n s
h o n s t p d e
e n d o a i h e
r l t s m n e m
a i h u o g r e
b k e d m h s d
b e n d e e e t
i a d e n r l o
t t i n t s f b
h u p l t e f e
o n p y o l a a
l n e t t f l v
e e d h h b l e
w l s a i e i r
e f u t n f n y
n o d a k o g d
t r d l a r d e
s s e i b e o e
t o n c o s w p
r m l e u h n w
a e y h t e w e
i w d a s f h l
g a o d t o a l
h y w n o u t x


and then transposing (i.e. reading down the columns) gives:

therabbitholewentstraigh

tonlikeatunnelforsomeway
andthendippedsuddenlydow