Solve cryptogram - ciphertext given

There is a phrase that contains 4 words and 22 total letters (not counting the three spaces between the words). One letter appears four times, no letter appears three times, three letters appear twice, and 12 letters appear once each. What is this phrase?

======================================

@@##&&&%%%%????????????

There are 4 words and the & represents a whitespace.
@,#,\$,% represent one letter each (4 total letters).
Each ? represents one of the other 22 letter of the alphabet (12 total letters).
16 different letters used.
ciphertext also needs to be rearranged - it is 'scrambled.'

How do I approach this?
Not looking for the answer really.
I just need a tool to unscramble the phrase and decrypt the ciphertext simultaneously.
Decrypto only does the later. Thank you.

@Noldorin: This is not homework. From elsewhere. @Kenny: How are encryption/decryption methodologies not math? This is an applied math problem, whereas your preferences tend to be theoretical/ pure math?

-
"Please do my homework for me." –  Noldorin Sep 27 '10 at 16:54
I'm not sure what the solution is, but perhaps if the problem were re-worded: There is a phrase that contains 4 words and 22 total letters (not counting the three spaces between the words). One letter appears four times, no letter appears three times, three letters appear twice, and 12 letters appear once each. What is this phrase? –  cobaltduck Sep 27 '10 at 16:58
I don't think it relates to mathematics at all. –  KennyTM Sep 27 '10 at 18:02
@Shawn: (1) You can leave a comment. (2) Mathematics can only tell you there are 31144186832171212800000 possible phrases. To actually find the correct phrase you need to check up the dictionary. Finding anagram is not a math problem. –  KennyTM Sep 27 '10 at 18:35
I used a script which was written by one of my Mystery Hunt teammates. However, I just tried the search over at wordsmith.org , and it handled the search just fine. –  David Speyer Sep 27 '10 at 20:13
show 1 more comment

Captain Kirk was wondering why his journal was not more excited to hear about his exploits. He said

LOG, YOU SEEM FAINTHEARTED!

More seriously, I dumped the letters EEEETTAAOOINSHRDLUGFMY into a multiword anagrammer, and it immediately found more than 24000 answers, of which this was one of the more amusing ones. What I deduce from this experience is that, without the knowledge that you are looking for a common English phrase, this puzzle is dramatically under constrained.

I recommend you look for a file of common English phrases which you can test for this property.

This isn't math, but there is a bit of a mathematical lesson here -- it is worth doing a quick test to see whether you have enough data to answer a question before working too hard on it.

-
Answer edited because I miscounted the number of single letters the first time. –  David Speyer Sep 27 '10 at 19:37
which multiword anagrammer did you use? –  Shawn Sep 27 '10 at 20:11

As David Speyer notes, the problem is too unconstrained for a solution as it stands. You can make some guesses using frequency tables for letters in English, but that's about the only place where some math will come in.

If it were a "straight cryptogram" (the letters are placed in the correct order, whether with the correct word spacing or in blocks), then you are a little closer to a problem in which mathematics can come in. You would have frequency tables, plus also tables on digraphs or trigraphs (blocks of 2 or 3 letters, when certain letters tend to occur next to each other); the two together can give you a lot of information (though the shorter the text, the less useful information they give: you need larger cryptograms to avoid the information getting lost in the "noise").

If you want to see some of the general procedures to attack "classic" cryptographic systems like monoalphabetic ciphers (where each letter in the original is replaced by another letter, the same one throughout, and the order of the letters is not modified), and polyalphabetic ciphers (where the substitutions depend on the location of the letter; these range from simple Vigenère substitution all the way to substitutions like the Engima cipher), or transposition systems (where the order of the letters is changed, but the letters themselves are not), then I can recommend Elementary Cryptanalysis: A mathematical approach by Abraham Sinkov (Mathematical Association of America, New Mathematical Library, ISBN 0883856220). Pretty much all of them are obsolete as far as modern cryptography goes, but it can give you a taste of how (and when) mathematics comes in.

For your problem as stated, however, the role of mathematics is so limited as to become nearly useless.

-
I have not heard of the Sinkov book until now, so the +1 is a thank you of sorts. :) –  Ｊ. Ｍ. Sep 27 '10 at 20:06
The book is very dated (first published in 1966); but Sinkov actually worked at the NSA, and many examples he uses in the book are examples of actual intercepted messages (I suspect the cryptographic systems used to encode them for the book may not be the original encodings, but the text is supposed to be). To give you an idea of how dated it is, my sixth printing has an appendix with some programs to perform digraphic and trigraphic analysis (frequency of 2- and 3-letter blocks), written in BASIC. But it's a good read for the classic/basic cryptography. –  Arturo Magidin Sep 27 '10 at 20:16
Thank you for the excellent response. –  Shawn Sep 27 '10 at 20:18
Up to 3 blocks... okay, it is dated, but it still looks interesting. –  Ｊ. Ｍ. Sep 27 '10 at 20:27
@J.M.: Interesting: I would have focused on the "written in BASIC" as evidence of how dated they are... –  Arturo Magidin Sep 27 '10 at 20:56
show 1 more comment