CS 2223 May 12 2020
Lecture Path: 28
Back
Musical Selection:
Best Song Ever (1987)
Visual Selection: Statue of Liberty, Frederic Auguste Bartholdi (1886)
1 Commencement Today
There are a few seniors graduating today, so I wanted to give them a shout-out today, on their last day at WPI. I wish you all well in your future endeavors (please come to the zoom lecture with a web cam, so we can all see you and cheer you on.
Program begins at 10:00 AM
Procession – Pomp and Circumstance (Elgar)
Address – You can’t always get what you want (Rolling Stones)
Graduates – Call out by name
Closing – Freedom! ’90 (George Michael)
1.1 Why does an audio CD contain 74 minutes of music
Sufficient evidence points to the desire (by record company executives as well as designers) to fit the complete Beethoven 9th symphony on a single CD disk.
1.2 Word Ladders
Note that in the english.words.txt file there are 5,875 four-letter words. From this set, there are a total of (5875*5874)/2 = 1,725,4875 possible pairs from which to form word ladders.
Wherever you go, there you are
adze akov ankh awfu awol ceyx degu ebbs ecru efik ejoo ekoi elhi enif enki envy epee epha eruc esox etym evil expo hexa hoju hymn iglu ijma imam isba itys ivin jeux jism juju llyn lwei ngai niog ocht odso ogpu ohms olpe omao opsy pfft pfui sybo tsia ubii ughs ulmo upby upon vlei vuln wrox ycie zyga
The word which tied for most number of word ladders is "aals" with 5,805 possible word ladders deriving from it alone.
But this is much faster if you create a graph and check for vertices that have degree of zero.
1.3 Project Themes
Union Find – Fundamental operation of "merge" is key driver. How do you maintain structures to support efficient merging?
One of the first places where I saw interesting application of heap varations.
Substring – Searching for a string appears to be such a basic operation, why would one expect to find something better?
Algorithm designers have tackled this problem by considering how to pre-process the pattern and text.
You could also classify by matching strategyMatch the prefix first (Knuth-Morris-Pratt, Shift-And, Aho-Corasick)
Match the suffix first (Boyer-Moore and variants, Commentz-Walter)
Match the best factor first (BNDM, BOM, Set-BOM)
Other strategy (Naive, Rabin-Karp)
QuickSort Variations – Decades of research have uncovered countless variations to quicksort.
Median-of-three is a quite popular one, with the theory that you should look at three elements to find a good pivot (however, the more elements you inspect, the slower the whole algorithm gets!)
David Musser in Worst case for median-of-three found an arrangement of data that forces median-of-three to perform in O(N2) time.
To overcome these limitations, Blum, Floyd, Pratt, Rivest and Tarjan (BFPRT 1973) invented a median-of-medians partioning scheme whose worst case performance is O(n). This implementation is quite challenging, but rewarding once completed. Despite its theoretical bounds, it is not typically used in practice. This is a theme in algorithm design.
Hashing with open addressing – One of the variations of hashing is known as "perfect hashing." If you know the keys in advance, you can generate a hash function such that hash(k1) != hash(k2) and you can then guarantee constant time exact performance. This preprocessing phase is arbitrarily complicated (especially as the number of keys grows) but this is a useful trick to know.
Hash tables of unusual size can offer good performance as well:
K-D tree & Quadtree spatial structures – Instances of Binary Space Partitioning methods which recursively subdivide a space into convex sets using hyperplanes as partitioining.
In 1993, Doom was the first video game to use BSPs for rendering.
1.4 Closing Thoughts
Only 37% participation in class climate course report system. Please complete these in next day!
1.5 Version : 2020/05/11
(c) 2020, George Heineman