[an error occurred while processing this directive]

Class 12 Notes

Lecture Slides, Suitable For Printing

WWII Cryptography Links

The Code Book
The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography, by Simon Singh
Highly recommended (mostly) non-technical book on the history of cryptography.
cs588: Cryptography: Principles and Applications
Dave Evans cryptography course at UVa. Lecture 4 and Lecture 5 provide some more details on Enigma and how it was broken.
Bletchley Park
Website for the Bletchley Park museum, includes a virtual tour. (You can also see my Bletchley Park pictures.)
WWII Codes and Ciphers
Tony Sale's site on WWII cryptography.
Alan Turing
Web page on Alan Turing developed by Andrew Hodges

Sorting with Binary Trees

(define (make-tree left element right)
  (cons element (cons left right)))

(define (tree-element tree)
  (car tree))

(define (tree-left tree)
  (car (cdr tree)))

(define (tree-right tree)
  (cdr (cdr tree)))

(define (insert-one-tree cf el tree)
  (if (null? tree)
      (make-tree null el null)
      (if (cf el (tree-element tree))
          (make-tree
           (insert-one-tree cf el 
                            (tree-left tree))
           (tree-element tree)
           (tree-right tree))
          (make-tree
           (tree-left tree)
           (tree-element tree)
           (insert-one-tree cf el 
                            (tree-right tree))))))

(define (extract-elements tree)
  (if (null? tree) null
      (append 
       (extract-elements (tree-left tree))
       (cons (tree-element tree)
             (extract-elements (tree-right tree))))))

(define (insert-sort-tree lst cf)
  (define (insert-sort-helper lst cf)
    (if (null? lst) null
        (insert-one-tree 
         cf (car lst) 
         (insert-sort-helper (cdr lst) cf))))
  (extract-elements 
   (insert-sort-helper lst cf)))
Sir Tony Hoare developed the QuickSort algorithm in 1960. His first assignment at a job with a small computer manufacturer was to implement a sorting routine based on the best then-known algorithm (Shell Sort, which is a Θ(n2) algorithm that is a slight improvement on the insert-sort alrogithm we saw in class). He thought he could do better, and his boss bet him sixpence that he couldn't. Quicksort was the algorithm that resulted. Since it is Θ(n log n) on average, it is clearly better than Shell Sort theoretically (that is, it is always eventually faster once n is large enough), and is also better than Shell Sort in practice for nearly all applications.

Hoare received the 1980 Turing Award for contributions to the design of programming languages. The Turing Award is the highest award given in Computer Science, it is named for Alan Turing, one of the codebreakers who worked at Bletchley Park during WWII. We will learn about one of Turing's contributions to cryptography in Friday's class (and on Exam 1). We will learn about Turing's most fundamental contributions to Computer Science after Spring Break.

In his award speech, The Emperor's Old Clothes, Tony Hoare presented principles from his experiences designing programming languages. One of his claims is,

I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.
CS150 students would be wise to follow this advice in all your programs!

[an error occurred while processing this directive]