CS 200 - Fall 2024. 10/09/2024


[Home]

Welcome to CS 200!

Video of the Day

It's a UNIX System! Jurassic Park.

Socratica Python videos:

Logical problem of the day

How do you delete a file named -f?

https://pollev.com/slade You may also download the app to your phone. Use the "slade" poll id.

In CS 202 you will write proofs like the following.

Inductive Proof of Monday's logical problem (from Francesca Slade):
For 2n - 1 dollars you'll need a minimum of n envelopes.

Base case:
21 - 1 dollars = 1 dollar needs at least 1 envelope.
22 - 1 dollars = 3 dollars needs at least 2 envelopes

Inductive step:

Assume that for 2n - 1 dollars you need a minimum of n envelopes
Prove that for 2(n+1) - 1 dollars you need a minimum of n+1 envelopes

You need to prove 2 things:

I. It's possible to use n+1 envelopes
II. n+1 envelopes is a minimum

I. By assumption you can get any number between 1 and 2n-1 with n
envelopes, put 2n dollars in your second envelope, now for any number
between 2n and 2(n+1) - 1 use your 2n dollars envelope and the
remainder will be between 1 and 2n -1 and use up to n+1 envelopes to
construct that amount.

II. With M envelopes you can make 2M distinct values (including 0
dollars, so really 2M - 1 distinct positive values), for each of the M
envelopes you either include it or don't, so you need a minimum of M
envelopes to describe 2M - 1 positive numbers.

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 12: Midterm Review.

Announcements

  • Technical Resume Workshop Office of Career Strategy, Monday October 28th, 3-4pm.

  • If you have an upcoming performance or athletic event, I am happy to promote it during class. Just send me a note.

  • The Digital Ethics Center sponsors Director's Fellows research appointments, which pay $3,000 per semester. They collaborate with lots of departments and schools at Yale. The Director is Professor Luciano Floridi. He has his own chat bot: LuFlot, created by students who trained the LLM on Floridi's extensive writings.

  • Yale Information Society Project Free lunch. See "About | Mailing Lists" See ISP email today.

    Administrivia

  • You may provide mid-semester feedback on canvas starting October 7th and ending October 14th. It is anonymous.

  • I am available for lunch on Mondays at noon at Franklin College Dining Hall.

  • I have office hours Wednesdays from 4-6 pm, on zoom, id 459 434 2854.

  • ULA office hours are found at in Ed Discussions.

  • Homework assignments: [Assignments]. hw3 is available. Fixed problem with gate == test -- compare types and used set() for inputs. You should reload hw3.py to get new ==, examples, and tests. As in the exams, you may not use echo for UNIX questions in the homework.

    Midterm Exam

    In 2022, the New Yorker ran the above cartoon. At first, I thought it referred to our exams.

    The midterm will be Thursday October 10 at 7pm in ML 211. It will be a 2 hour hand written exam. No computers. No notes. No books. No kidding. Students registered with Student Accessbility Services will take the exam in room ML 200, down the hall.

    Here is a practice exam. (solutions). Practice UNIX script. (solutions).

    Rudy held a review session. Lizzie spotted some errata in the regex slides.

    mt.py code for practice midterm

    Here is a great resource to practice regular expressions https://regex101.com/ Also, see www.regular-expressions.info which has a tutorial as well as useful examples, including HTML tags, email addresss, IP addresses, dates, credit cards, and lots more.

    Object Oriented Programming

    Oop.html (jupyter) object oriented programming.

    F String Formatting Used in hw3.

    Review hw3.

    Digital Gates and Circuits

    Getting to know UNIX

    UNIX Introduction Principle 3.
    [Home]