Lecture Materials

Learning Goals

By the end of class you should know the fundamentals of counting, especially the step rule (aka product rule) and the "or" rule (aka inclussion/exclusion).


Syllabus, Counting

Concept Check


Questions & Answers

Q: what language(s) will we be using mainly?

A1:  We’re using Python!

Q: what language are we using in this class?

A1:  We’re using Python!

A2:  Python

Q: are the concept checks graded on completion or correctness?

A1:  Based on the syllabus I believe you get unlimited resubmissions to get the questions correct until the deadline

A2:  Anyone please correct me if I’m wrong

A3:  They’re graded on correctness, but as you’ll see, you’re permitted to resubmit over and over until you’re told the answers are correct.

Q: Are lectures going to be 50 minutes or 80 minutes? (There was a conflict on the course website)

A1:  Lectures are going to be 80 minutes, though we’ll often take short breaks so it doesn’t feel like one incredibly long, passive Zoom session for students.

Q: Are concept checks posted on canvas or gradescope?

A1:  They’re on Gradescope, and I’ve already added all students to the CS109 space for this quarter. They’re identified as assignments, and Chris will share a link later in the slide deck. :)

Q: Apologies if I missed this, who should we contact about OAE accommodations?

A1:  Hey! You can contact either me or Chris!

A2:  (CA) - You can find the accommodations information on the syllabus! http://web.stanford.edu/class/cs109/handouts/syllabus.html Feel free to email the teaching team (cs109@cs.stanford.edu) if you have a more specific question about your case

Q: Does the course reader cover topics that aren’t covered in lecture?

A1:  The course reader is something Chris has constructed, and it’s an elaborate concatenation of CS109 handout from past quarters! There will be examples that aren’t specifically covered in lecture, but everything will be on point.

Q: when can we apply to CS109A?

A1:  There’s an online application, and I’ll post the link to the course website after lecture.

Q: Will the questions in this Q&A be posted later?

A1:  I think so, though this is the first time I’ve ever used Q&A. :). I’ll find out for sure before I close the Zoom at the end of lecture.

A2:  (CA) - I don't think there are any plans to do so at the moment (or if there's an easy way on Zoom for us to save these), but there is our CS 109 Ed platform that works similarly to a Q&A/Piazza forum for question asking, so feel free to ask more questions there! https://edstem.org/us/courses/3305

Q: can we take 109 and 110 concurrently (since they fall at the same times)? is live attendance required for 109?

A1:  You can certainly take them at the same time. We don’t require lecture attendance at all in CS109.

Q: Is there any advice for people who are taking CS106B and 109 concurrently?

A1:  Fortunately, the very first topic in CS106B, which is recursion, is taught before we really need to rely on it in CS109. We’ll also rely on a few data structures taught in CS106B, but you don’t need to know how to implement them in CS109. You just need to understand what they look like.

Q: Is taking CS107 and 109 concurrently a bad idea? In terms of time commitment…

A1:  You’re welcome to reach out to me over email so we can chat about what other classes you’re taking.

A2:  (CA) - It's doable, but you should consider how much time you can input to each and juggle sections, psets, etc. Worth shopping for the first two weeks though!

A3:  The two classes are demanding (and, in my opinion, CS107 is more time consuming), but I think they’re very good classes to take together. But I’m not exaggerating when I say that hundreds of students *have* taken them concurrently in prior quarter.

Q: Do we cover any stats in this course like p-values?

A1:  Yep, that comes around Week 7 or 8 of the course when we discuss sampling and null hypotheses!

Q: Are following lectures going to be 80 minutes or 50?

A1:  80

Q: Are there going to be pre-recorded lectures with their own quizzes (like in CS 107) or will live sessions be the only lecture content?

A1:  This quarter we’re subscribing to the live lecture model with post-lecture concept checks.

Q: How often will each of Jerry/Chris do lectures?

A1:  The original plan has us splitting lectures 50/50, though I expect to cover a few more, as Chris and his wife are expecting a baby in the next few weeks.

Q: How long after each lecture will the recording be posted?

A1:  We’ll post it within a few hours—and I’ll guarantee it by 5:00pm—so that you can watch ahead of the concept check.

Q: Does 17 million come from 256^3?

A1:  Yes! :)

Q: is the 17M rounded, because there are 256 codes for each of the R, G, and B primaries, making 16,777,216 possible colors. Is that correct?

A1:  Yep, I’m sure that’s what he meant, just as a matter of simplication.

Q: what are the typical number of pixels in an image thats reasonable?

A1:  The most recent Iphone camera is 12 megapixels. High end photography cameras go even higher. A 3 mexapixel image is somewhere between HD and 4K.

A2:  I didn’t know ahead of time, but I just googled for a few minutes and familiar buzzwords came up… looks like a good estimate is a small number of millions (i.e. 3 megapixels)

Q: why is it 2^4 doesnt it have to be “01” for it to be valid?

A1:  Since there are six bits and the final two bits are constrained to be 01, each of the other four bits are free to assume 0 or 1 independently of one another. That’s why we get 2^4.

Q: How did we know to subtract 4 from 32 for bit strings? I see it’s clear if you write it out, but what’s the more mathematical approach? I might’ve missed something.

A1:  You’d probably have to work it out mathematically. How many strings both start with 01 and end with 10?

A2:  Oh, sorry I don’t think I was clear enough. I meant to ask if there is a way to find that number of intersections (4) without writing out all the possibilities, like for a much larger data set?

A3:  great question. The inclusion/exclusion rule is general. it states that if outcomes come from A or B, total outcomes is |A| + |B| - |A and B|. 4 is |A and B|

Q: Is there a concept check for today’s lecture?

A1:  There is indeed. It should linked to from Chris’s slides.

Q: Do we have a concept check after this lecture?

A1:  Looks like we do!

A2:  Yep. Chris is mentioning it right this second.

Q: Is the concept check not avaailable yet? I can’t open the gradescope link.

A1:  should be live now.

A2:  It formally goes live at 2:20pm, but I’ll open it up now.

Q: Have you picked a name?

A1:  😱

A2:  yes! But its so secret not even my parents know

Q: would you mind restating the rule of counting and the main topics we learned today?

A1:  live answered

Q: Would the probability that your wife has her baby on a given day change for each additional day that passes?

A1:  I see, thank you!

A2:  yes! Each day that passes means that the next day is more likely. We have learned new information

Q: Asked in the chat but will duplicate here: are we going to be learning about fat tails in this class?

A1:  yes!

Q: awesome, thank you - now did we talk about the sum rule of counting just because we use it within the OR rule of counting?

A1:  they are synonyms