Password Pat
 
Password Pat is known for making slick passwords such
as
@hwl2rt&tk
which is derived from the sentence
At Hogwarts we love to roast tyrants and tea kettles.
by applying the following rules while reading the
sentence:
(1) On reading a no
Authorship Verification
 
Slippery Redux, the Text Private Eye, is trying to set
up a system to catch text copycats. To do this he needs
a program that will take input text and count the words
that match a pattern. The patterns he is interested
in are f
The Child's Cipher
  
As a child, I would often encrypt my journal using a
simple substitution cipher. In this cipher, vowels
(a,e,i,o,u,y) would be replaced with the next vowel, and
consonants would be replaced with the next consonant.
This way, words
Introduction to Algorithms
6.046J/18.401J/SMA5503
Lecture 12
Prof. Erik Demaine
Computational geometry
Algorithms for solving geometric problems in 2D and higher. Fundamental objects: Basic structures:
point line segment line
point set
2001 by Erik D. De
Algorithms
LECTURE 18
Shortest Paths II BellmanFord algorithm Linear programming and difference constraints VLSI layout compaction Professor Ashok Subramanian
Algorithms L18.1
Negativeweight cycles
Recall: If a graph G = (V, E) contains a negativeweight
Algorithms
LECTURE 17
Shortest Paths I Properties of shortest paths Dijkstras algorithm Correctness Analysis Breadthfirst search Professor Ashok Subramanian
Algorithms L17.1
Paths in graphs
Consider a digraph G = (V, E) with edgeweight function w : E R.
Algorithms
LECTURE 14
Competitive Analysis Selforganizing lists Movetofront heuristic Competitive analysis of MTF Professor Ashok Subramanian
Algorithms L14.1
Selforganizing lists
List Loperation ACCESS(x) costs rank (x) = of n elements The
distance o
Algorithms
LECTURE 13
Amortized Analysis Dynamic tables Aggregate method Accounting method Potential method Professor Ashok Subramanian
Algorithms L13.1
How large should a hash table be?
Goal: Make the table as small as possible, but large enough so that
Balanced Strings
 
A balanced string is a string whose parentheses all
match. Thus
balancedstring
:= emptystring
 balancedstring nonparenthesischaracter
 balancedstring ( balancedstring )
You have been asked to develop a piece of code tha
Bebumblia Communications
 
The perfectly flat planet of beebumblia is occupied by
two warrior races, the bees and the beebears. They are
fighting a war, of course.
The bees are having trouble with their communications,
and need your computational assist
Achieving Better Bias
  
The Better Bias Bureau takes M faced biased dice with
known biases and makes from them N faced biased dice
with desired biases. More specifically, if you have an
M faced biased die with probability pm[j] of throwing
face j, for
Love Log
 
Olivia, the arrow beetle, is on the ground near a log.
On the other side of the log is Oliver, the love of her
life. She wants to get to him. How far must she
travel?
Olivia and Oliver are on the ground, the log rests on
the ground, and Olivi
Huffman Coding Trees
  
Huffman Coding is a method of compressing data. It is
based on specialized binary trees, which we will call
Huffman Coding Trees.
A Huffman Coding Tree for (compressing) the string
`abaacb' is made as follows. First, make single
GSAT Tracing
 
GSAT is a `greedy local search' procedure for satisfying
propositional formulae in CNF form. You have been asked
to code the GSAT algorithm, and as a first step, you are
to code a variation of the core of this algorithm and
output a trace
Design Optimal Gear Ratios
   
As an engineer for the Bicycle Sprint Club, you are re
sponsible for choosing gear ratios for the bikes. The
rules of sprint racing say that the bicycle can have
only a single gear; that is, one chain connecting a
singl
Feature Structures
 
Information can be encoded in `feature structures',
which are rooted labeled graphs. To explain, a
feature structure is a set of graph nodes (points), a
set of directed edges between pairs of nodes (arrows),
and an assignment of lab
The 1D Drunkard
  
Some scientific algorithms require random numbers as
input. However, with modern inexpensive computers,
which do not have error detecting RAM memory, it is
also important to be able to repeat computer runs,
in order to check that the
Dice Quiz
 
You have become involved in writing software for a game
that is played with 6sided dice. A die is placed on
a board so that one of its faces is North, and the die
is then moved by rolling it to the North, East, South,
or West, so different
Convoy

The Safe and Speedy Driver Company makes robot drivers.
They have been asked to provide drivers for convoys of
trucks, but are unsure if their basic traveling algor
ithm will work. You have been asked to simulate it,
so see under what circumstan
Graph Coloring
 
The classical graph coloring problem is just the follow
ing: color the nodes of an undirected graph so that
neighbors do not have the same color, and a minimum
number of colors are used. This problem has many
applications, among which
Changing Point of View
   
TeffalHead FatBody has stayed out too late on the planet
BadTrash and is in danger of being consumed by a Larger
BageGarLectorCol. To get to safety TeffalHead must get
to base A or base B or the ZoomTube that connects them.
Repeating Binary Fractions
  
The decimal representation of rational numbers is always
either finite or involves a `repeating fraction'. For
instance, the rational number 1/3 has the decimal repre
sentation
0.33333. or 0.(3)
if we adopt the conventio
Algorithms
LECTURE 11
Augmenting Data Structures Dynamic order statistics Methodology Interval trees Professor Ashok Subramanian
Algorithms L11.1
Dynamic order statistics
OSSELECT(i, S): returns the i th smallest element in the dynamic set S. OSRANK(x,
Algorithms
LECTURE 10
Balanced Search Trees Redblack trees Height of a redblack tree Rotations Insertion
Professor Ashok Subramanian
Algorithms L7.1
Balanced search trees
Balanced search tree: A searchtree data structure for which a height of O(lg n) i
Algorithms
LECTURE 9
Randomly built binary search trees Expected node depth Analyzing height
Convexity lemma Jensens inequality Exponential height
Post mortem Professor Ashok Subramanian
Algorithms L7.1
Binarysearchtree sort
T Create an empty BST for i