CS 201 - Spring 2025. 4/18/2025.
[Home]
Welcome to CS 201!
Video of the Day
Miserere by
Gregorio Allegri, often performed in the Sistine Chapel at the Vatican
on Good Friday.
I hereby solicit suggestions for the video of the day. Please email
me your ideas with explanations. Selected entries will win 5
homework points. If your video is played at the beginning of class,
you must also briefly explain something about the video and
something about yourself - in person.
Logical Problem of the day
Flipping a coin or rolling a die generates a random number. What is a
pseudo-random number?
https://pollev.com/slade
You may also download the app to your phone. Use the "slade" poll id.
ASF poker case
The program used the built-in pseudo random number generator to shuffle the deck. However, there were issues.
- There are 52 cards in a deck, which results in 52! possible
shuffles or permutations (52! ≊ 8 * 1067)
- The random number generator permuted a machine word, which
was 32 bits. There are 232 permutations of 32 bits =
4,294,967,296.
- The seed was taken from the system clock, which was the number of
milliseconds past midnight. There are 86,400,000 milliseconds in a day.
- Moreover, the player knew the current time, and thus could
narrow down the seed to roughly 250,000 numbers (4 minutes or so).
- The shuffling algorithm was off by a factor of 1062. (I had a bang (exclamation mark) there, but then realized that it
looked like another factorial, which would have been misleading.)
- After the initial round of cards, the player would know every card remaining in the deck.
- The shuffling algorithm had other issues, including an off by one error.
- Moral: Know thy code.
Lava Lamp Randomness
Canvas Quiz of the Day (need daily password)
Most days, there will be a simple canvas quiz related to the lecture.
You need a password to activate the quiz, which I will provide in class.
These quizzes will count toward your class participation grade.
The quiz is available only during class.
Click for today's quiz.
Lecture 35: Compilers and the Running Time of Programs.
I have office hours Wednesdays from 4-6 pm, on zoom, id 459 434 2854. Since zoom was delinquent on Wednesday, I will be available immediately after
class today.
I am available for lunch on Mondays at 1 pm in Morse. Last chance next week!
ULA office hours are found at https://csofficehours.org/CS201/schedule. Sign up via the queue.
Homework assignments:
[Assignments]. hw8 is now
available.
Announcements
Those of you trying to regiser for CS 2230:
With the prerequisites to register in CPSC 2230 enforced, students
cannot enroll in 2230 until they’ve been assigned any non-fail grade
in either CPSC 200(0) or 201(0). Unfortunately, that grants them a
three-day window of opportunity between the grading deadline (5/13)
and the close of regular fall registration (5/16).
If you have an upcoming performance
or athletic event, I am happy to promote it during class. Just send
me a note.
That Whole "Yale Thing" Video compilation of references to Yale in movies. Friday April 25, 7pm, HQ L02. (list of movies)
Bulldog Days: Wednesday, April 23rd
You should plan to attend in person to be available to chat up the
prospective first years about CS, Yale, and life after high school.
You were once in their shoes.
CS 201 Jeopardy Wednesday, April 23rd
On Wednesday April 23rd, we will have an in class Jeopardy competition. Question topics
will include racket, Turing machines, UNIX, boolean functions, and digital
circuits and gates. Here is
an example in another domain.
Students may compete as individuals or teams. If you wish to compete,
send me a note indicating the members of your team.
The members of the winning team get 10 homework points each.
The runners-up get 5 homework points each.
Teams:
Team 1. The 201 Warriors. Lorenzo Chamberlin, Ignacio Montoro Piñeiro, and Gabriel Brown.
Final Exam: Monday, May 5th, 7pm, Davies
The exam will be three and a half hours long. You should have plenty of time.
Here
is a practice exam.
(solutions).
(final.rkt code for solutions)
Ignore questions 1, 6, 7(c), 7(e), and 10. We will cover box and pointer
notation.
Plus Turing Machines and UNIX, through principle 6, that is, everything.
Practice TC-201 programs.
solutions. Since TC 201 was
not on the second midterm, it will be emphasized on the final.
If your grade on the final exam is higher than your lower midterm grade,
it will replace that grade. The quality of mercy is not strained.
Review session: TBA.
SAS students at Watson Center:
Please remind your students to sign up to reserve a space with us
through their SAS Accommodate portal:
Lecture: Strings and Languages.
Strings.html (jupyter) compilers
hw7 review. dfas.
Lecture: Running Time of Programs.
Runtime.html
tc201sort.pdf experiment with TC-201 sort program. Plotted in google sheets with insert chart.
Professor Ozan Erat lectured on 11/14/22:
big-O Asymptotic Analysis
Big-O Cheat Sheet Know Thy Complexities!
- Big-O: O(n) function is bounded above. Upper bound. Worst case.
- Big-Omega: Ω(n) function is bounded below. Lower bound. Best case.
- Big-Theta: Θ(n) function is bounded both above and
below. Average case.
Closures + mutators:
Getting to know UNIX
UNIX
Introduction Principle 5.
[Home]