James Scott-Brown home about projects

Using perl to find words in the periodic table

I’ve just come back from a ‘Lower Sixth Chemistry Olympiad Event’ that the RSC hosted at St. Catherine’s College, Cambridge. Over dinner on the first night, one of the organisers asked us for the longest word we could write using just the symbols of the elements. After a few people suggested a few, fairly short, words, I said that the only sensible way to solve the problem was with a perl script. But Bryant Tan proved me wrong with a C++ program. After I provided a dictionary file (2of12.txt from 12dicts) and list of elemental symbols, we concluded that the longest were probably OVErSUPErSTiTiOUSNeSS (at 21 letters) and CONSUBSTaNTiAtION (at 17).

On the second day, Bryant commented that it was surprising that the word ‘chemistry’, nine letters long, contained no repeated letters. By writing a perl script, I found one such word 14 letters long (ambidextrously).

blog comments powered by Disqus