https://pollev.com/slade You may also download the app to your phone. Use the "slade" poll id.
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.
In 2022, the New Yorker ran the above cartoon. At first, I thought it referred to our exams.
The midterm will be Thursday October 9 at 7pm in DL 220. 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 211, across the street.
Here is a practice exam. (solutions). Practice UNIX script. (solutions). 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.
Also, the paper Music and Computation, discussed below, is also in scope, up to but not including Music. There will be true/false questions about binary encodings of numbers, text, images, and sound. No questions about music.
Here is the document without the music section: Binary Encoding. Try this prompt with your favorite AI bot: Using the document found at https://zoo.cs.yale.edu/classes/cs200/lectures/BinaryEncoding.pdf please generate 20 sample true or false exam questions. Note: today the bots complain that they cannot load web files. Let me know if you find a way around this. In the mean time, I sent you 100 sample T/F questions on Friday and today!
Review session: Saturday, October 4, 10am - Noon. AKW (51 Prospect Street) Room 200, Sophia Dai. Review slides (without answers) Review slides (with answers)
I have decided not to include an object-oriented programming question in the first midterm. Also, the true/false questions regarding binary encoding are taken from the 200 questions generated by Gemini. I sent you 100 sample T/F questions on Friday and another 100 on Monday.
Review hw3.