|
|
|
How Many L's
CptS 355 - Programming Language Design
Washington State University |
|
|
|
|
How Many 'L's?
How Many 'L's?
Goal: fill a 4x4 grid with letters such that each row (read
left-to-right) and column (read top-to-bottom) is an English word
and all the words are distinct. Find such a square with the maximum
possible number of 'L's. Words formed by adding an 'S' at the end
to changed between singular and plural may not be used.
We're going to write computer programs to help us solve this problem.
Group problem-solving exercise:
- What is a word? How can a program tell whether a particular
sequence of 4 letters is a word or not?
- How many squares can be built by filling in each cell with each
possible letter?
- There are about 2500 4-letter English words. If we form squares
by taking 4 of these words and stacking them up how many different
squares can be formed? If it takes a millisecond to build and check
each square how long will this process take? (Hint: this tells you
something about how not to solve the problem.)
- There are about 500 4-letter English words containing at least
one 'L'? How many different squares can be formed by stacking 4 of
these? How long would that take? Would approaching the problem in
this way produce a solution?
- How might we obtain a list of English words? of 4-letter English
words? of 4-letter English words containing at least one 'L'?
- What are the constraints between the words? How could they be
exploited to reduce the amount of work?
- What are the symmetries in the problem? How could they be
exploited to reduce the amount of work?
|
| |
(c) 2003 Curtis Dyreson, (c) 2004, 2005 Carl H. Hauser E-mail
questions or comments to Prof. Carl Hauser |