CS50 Intro to Programming
- 84Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What does CS50 represent at Harvard University?
CS50 is Harvard University's introduction to the intellectual enterprises of computer science and the art of programming.
Or swipe the card
84 cards
What does CS50 represent at Harvard University?
CS50 is Harvard University's introduction to the intellectual enterprises of computer science and the art of programming.
Who is the lead instructor for CS50?
The lead instructor for CS50 is David Malan.
What initial academic interest did David Malan have before taking CS50?
David Malan initially gravitated toward government, thinking he would major or concentrate in that field.
What was David Malan's experience with homework after starting CS50?
David Malan found that homework was fun for the first time after enrolling in CS50.
Why does David Malan consider computer science a 'general purpose way of thinking and solving problems'?
Computer science is a general purpose way of thinking and solving problems because its principles are applicable to many other fields, including arts, humanities, social sciences, natural sciences, and STEM fields.
What analogy is used to describe the learning experience in CS50?
The learning experience in CS50 is compared to 'drinking from a fire hose,' implying there is a lot of information that cannot possibly be absorbed all at once.
What is the expected mindset for students in CS50 regarding discomfort?
Students are encouraged to get comfortable feeling uncomfortable along the way, regardless of prior computer science or programming experience.
How has the CS50 syllabus evolved regarding programming languages?
In the past, CS50 primarily taught C. Nowadays, it explores C, Python, SQL, and JavaScript, among others.
What is the primary language used for databases introduced in CS50?
SQL (S-Q-L) is the language specifically for databases introduced in CS50.
Which languages are often used with HTML and CSS for web-based software development?
JavaScript is often used with markup languages HTML and CSS for web-based software development.
What is a key goal of CS50 regarding students' ability to learn new programming languages?
Among the goals of CS50 is to equip students with enough concepts and practical skills so that they can teach themselves new languages after the course, without relying on a class for every new idea.
What core skill will students learn how to do in CS50, starting from day one?
Students will learn how to solve problems, which is really what computer science is all about.
What types of media will students learn to represent digitally in CS50 Week 0?
In Week 0, students will learn to represent numbers, letters of an alphabet (like English), colors, full-fledged images, videos, and audio files.
What is the ultimate focus of Week 0 regarding algorithms and code?
The ultimate focus of Week 0 is on how to write algorithms, specifically implementing them with code, which translates human-language instructions into 0's and 1's that computers understand.
What percentage of CS50 students have no prior computer science course experience?
Two-thirds of CS50 students have never taken a CS course before.
How does CS50's evaluation approach success for students with varying experience levels?
What ultimately matters in CS50 for evaluation is not where a student ends up relative to classmates, but where they end up relative to themselves when they began.
What social and academic events characterize the CS50 experience?
The CS50 experience is characterized by social and academic events like CS50 lunches, CS50 Puzzle Day, CS50 Hackathon, and the CS50 Fair.
What is the purpose of CS50 Puzzle Day?
CS50 Puzzle Day is an opportunity for students, even those without prior CS experience, to solve logical puzzles or riddles in teams, with pizza and prizes.
What is the CS50 Hackathon?
The CS50 Hackathon is an event where students bond with classmates and project partners, working on their final projects from around 7:00 PM until 7:00 AM the next morning.
What is the objective of the CS50 Final Project?
The final project is meant to be a capstone of the course, where students build something of their own without a handed-down specification, offboarding them so they can write code and solve problems independently.
What is the CS50 Fair?
The CS50 Fair is an exhibition of all final projects for friends, faculty, students, and staff across campus, allowing students to showcase their creations.
What is the fundamental definition of computer science?
Computer science is the study of information, and more specifically, about solving problems using certain ideas and techniques.
What is computational thinking?
Computational thinking is the application of ideas and techniques, often oversimplistically described as 'thinking like a computer,' to solve problems methodically and carefully.
How is problem-solving abstractly represented in computer science?
Problem-solving is represented as having some 'input,' a 'goal' as 'output,' and 'secret sauce' in the middle that converts inputs to outputs.
What is unary notation for counting?
Unary notation is a counting system where each digit (like a finger) literally represents one piece of information, such as counting 1, 2, 3, 4, 5 on fingers.
What is the highest number one can count to on one hand using a clever interpretation, not simple unary?
One can count as high as 31 on one human hand by taking into account the order and on/off state of each finger, utilizing a base-2 (binary) approach.
Why do computers primarily use binary (base-2) system with 0s and 1s?
Computers use binary because it maps readily to the real world: electrical devices either have electricity (on, 1) or not (off, 0), making it a simple and useful system.
What is a 'bit' in computer science?
A 'bit' is a binary digit, representing a single 0 or 1.
What are transistors, and how do they relate to binary?
Transistors are tiny switches inside hardware that turn electricity on or off, acting as the physical representation of 0s (off) and 1s (on) in computers.
How does the base-10 (decimal) system assign value to digits in a number like 123?
In the base-10 system, the rightmost digit is the ones place (100), the next is the tens place (101), and so on, with each position representing a power of 10.
How does the base-2 (binary) system assign value to digits?
In the base-2 system, the rightmost digit is the ones place (20), the next is the twos place (21), then the fours place (22), and so on, with each position representing a power of 2.
What is a 'byte' in computer science?
A 'byte' is a unit of measure consisting of eight bits, which is a power of 2 (23) and a more useful unit than individual bits.
What is the range of numbers that can be represented by a single byte?
A single byte (eight bits) can represent 256 possible values, typically from 0 to 255.
How can computers represent letters of an alphabet using bits?
Computers can represent letters by assigning a unique number to each letter (e.g., 65 for capital A) and then storing that number as a pattern of 0s and 1s.
What is ASCII, and what does the 'A' in its name signify?
ASCII (American Standard Code for Information Interchange) is a system that maps English letters and other symbols to numbers. The 'A' signifies its focus primarily on American (English) characters.
How many possible characters can typically be represented with seven or eight bits in ASCII?
With eight bits, 256 possible characters (0-255) can be represented, which is enough for English uppercase, lowercase, numbers, and punctuation.
Why is ASCII insufficient for many world languages?
ASCII is insufficient for many world languages because 256 characters are not nearly enough to represent accented characters, a wide range of Asian characters, and other symbols.
What message is represented by the ASCII codes 72, 73, 33?
The ASCII codes 72, 73, 33 represent the message "Hi!".
What is Unicode, and how does it differ from ASCII?
Unicode is a superset of ASCII that represents a much broader range of characters (including emoji and other languages) by sometimes using 16, 24, or even 32 bits per character, instead of just 8.
What is the mission of Unicode?
Unicode's mission is to represent and preserve all human languages digitally, both past, present, and future, including pictograms like emoji.
How are emoji technically classified in Unicode?
Emoji are technically just characters within the Unicode standard, represented by specific patterns of 0s and 1s, even though they appear as pictures on screen.
Why do the same emoji sometimes look different across various platforms (e.g., Apple vs. Android)?
Emoji can look different across platforms because companies like Google, Apple, and Microsoft interpret and render the same Unicode character (the 'face with tears of joy' emoji, for example) with their own distinct visual styles, similar to different fonts.
What is 'hexadecimal' (base-16) used for in representing Unicode code points?
Hexadecimal (base-16) is used to represent Unicode code points more compactly and succinctly than binary or decimal, using digits 0-9 and letters A-F.
How is skin tone typically handled for emoji from an engineering perspective?
Skin tone for emoji is handled by using the same pattern of bits for the base emoji (e.g., a thumbs up) and then adding a few more switches (a second number in memory) that the computer interprets as a modification to display a different skin tone.
What are zero-width joiners (ZWNJ characters) in Unicode?
Zero-width joiners (ZWNJ characters) are special numbers in Unicode that instruct a computer to glue together two adjacent emoji to form a single, combined emoji, such as 'heart on fire' from a heart and fire emoji.
How do computers typically represent colors?
Computers typically represent colors using RGB (Red, Green, Blue) values, where three different numbers (one for red, one for green, one for blue) indicate the intensity of each color component.
What does each number in an RGB color code typically represent, and what is its range?
Each number in an RGB code typically represents one byte (eight bits), with possible values from 0 to 255, indicating the intensity of red, green, or blue.
If 72, 73, 33 can represent 'Hi!' and also a shade of yellow, how do computers know which one to display?
Computers rely on 'context' to interpret patterns of 0s and 1s. If the data is in a text message, it's interpreted as text. If in a graphics program, it's interpreted as colors. The programmer must provide hints about the data type.
What is a 'pixel' on a computer screen?
A 'pixel' is one of the individual dots or squares on a computer or phone screen, each storing three numbers (24 bits or three bytes) for its RGB color.
Why are image and photo files often large (e.g., three megabytes for a photograph)?
Image and photo files are large because they contain many pixels (e.g., 1 million pixels for a 3MB photo), and each pixel requires three bytes (24 bits) to represent its color.
How can music be represented digitally using numbers?
Music can be represented digitally by assigning numbers to notes (pitch), duration (how long a key is held), and loudness (how hard a note is played), minimally requiring three numbers per musical event.
How are videos represented digitally?
Videos are represented digitally as a sequence of many images, or 'frames,' displayed quickly (e.g., 30 frames per second), creating the illusion of motion.
What is an 'algorithm'?
An 'algorithm' is a set of step-by-step instructions for solving some problem.
What is the relationship between an 'algorithm' and 'code'?
An algorithm is something that can be expressed in human language, while 'code' is the translation or implementation of that algorithm for computers, typically into 0s and 1s.
What are the two primary goals of writing code or implementing an algorithm?
The two primary goals of writing code or implementing an algorithm are to solve the problem 'correctly' and 'efficiently'.
Describe the 'linear search' algorithm for finding a name in a phone book.
The 'linear search' algorithm involves stepping through the phone book one page at a time, checking each page sequentially until the name is found or the end is reached.
Describe the 'jump search' (or two-page at a time) algorithm for finding a name in a phone book and its correctness implications.
The 'jump search' involves looking through the phone book two pages at a time. It is faster but risks missing the target if it's sandwiched between checked pages, requiring a backtrack to maintain correctness.
Describe the 'binary search' algorithm for finding a name in a phone book.
The 'binary search' algorithm involves opening the phone book roughly to the middle, determining if the name is in the left or right half, and then repeatedly tearing the problem in half until the name is found.
If a phone book has 1,000 pages, approximately how many times can binary search divide the problem in half to find a single page?
For a 1,000-page phone book, binary search would require approximately 10 page tears (210=1024), making it significantly faster than linear search.
In an xy plot where the x-axis is 'size of the problem' and the y-axis is 'time to solve,' how would linear search appear?
Linear search would appear as a straight line, indicating a direct, one-to-one relationship between the number of pages (problem size) and the time taken.
In an xy plot of problem size vs. time, how would binary search appear?
Binary search would appear as a curve that flattens out, rising very slowly, representing logarithmic growth (log2n). This means doubling the problem size only adds one more step.
Can an efficiency graph (xy plot) capture the 'accuracy' of an algorithm?
No, an efficiency graph only speaks to the efficiency and design of an algorithm, not its correctness. Correctness is analyzed using other mechanisms, like logic.
What is 'pseudocode'?
Pseudocode is an informal, terse, and precise description of an algorithm written in English (or another human language), using succinct but clear thoughts, not formal programming syntax.
What are 'functions' in programming, as represented in pseudocode?
In pseudocode, 'functions' are like actions or verbs that describe specific tasks or operations to be performed.
What are 'conditionals' in programming, as represented in pseudocode?
In pseudocode, 'conditionals' are like forks in the road ('if/else') that allow a program to make decisions and execute different paths based on certain conditions.
What is a 'Boolean expression' in programming?
A 'Boolean expression' is a question that yields a yes/no, true/false, or 1/0 answer, used to determine which path to take in a conditional.
What is a 'loop' in programming, as represented in pseudocode?
In pseudocode, a 'loop' represents a cycle that performs something repeatedly, like 'go back to line X' to iterate over a process.
What is the purpose of CS50's artificial intelligence tools like the CS50 duck?
CS50's AI tools, embodied by the CS50 duck, aim to constructively help students solve problems and get unblocked, acting as a 24/7 tutor that guides them without simply handing out answers.
What is a 'chatbot'?
A 'chatbot' is an interactive, text-based program that can talk to users and answer questions.
What is a 'large language model' (LLM)?
A 'large language model' (LLM) is software that takes vast amounts of language data (e.g., from the internet) as input and infers, from patterns, what a typical human might say when asked a question, often probabilistically.
Why are 'hallucinations' or mistakes possible with large language models?
Hallucinations or mistakes are possible with LLMs because their inputs are imperfect, and sometimes a bit of randomness is sprinkled into their output to make them less repetitive, which can lead to inaccuracies.
What is Visual Studio Code (VS Code)?
Visual Studio Code (VS Code) is a popular free and open-source tool used for writing code in CS50, often in a cloud-based version (cs50.dev) to simplify setup.
What is Scratch, and why is it used in CS50 Week 0?
Scratch is a graphical programming language, often used by younger students, that allows users to create animations, games, and interactive art by dragging and dropping puzzle-like blocks. It's used in CS50 Week 0 to visually represent programming ideas before moving to text-based languages.
What does the 'when green flag clicked' block do in Scratch?
The 'when green flag clicked' block in Scratch is an event trigger that starts the execution of the attached script when the green flag icon (the 'go' button) is clicked.
What is a 'sprite' in Scratch?
A 'sprite' in Scratch is a character or object in a game or graphic context, like the default cat, that can be programmed to perform actions.
What are 'parameters' or 'arguments' in the context of Scratch functions (blocks)?
Parameters or arguments are white ovals within Scratch blocks (functions) that take input (like text or numbers) to customize or modify the behavior of that function.
In Scratch, what is a 'return value' from a function?
A 'return value' from a Scratch function is a value (like the 'answer' from an 'ask' block) that is handed back conceptually so that other parts of the program can use it.
How can one combine the output of one Scratch function into the input of another?
One can combine outputs into inputs by using blocks like 'join' (from Operators) which takes multiple inputs and produces a single output that can then be fed into another function, such as 'say' or 'speak'.
What is a common programming bug related to fast execution in Scratch (or any language)?
A common bug is when a program executes so fast that a human cannot perceive intermediate steps, like a 'hello' message disappearing before a 'hello, David' message appears, because the computer processes commands too quickly.
Why is repeating code (e.g., three separate 'meow' blocks) considered bad design in programming?
Repeating code is bad design because it's inefficient and error-prone. If a change is needed (e.g., waiting two seconds instead of one), it must be modified in multiple places, increasing the chance of human error.
How can a loop improve the design of repetitive code in Scratch?
A loop (e.g., 'repeat X times') allows minimal code to accomplish more functionality by executing a block of instructions multiple times from a single point of definition, making changes easier and reducing errors.
What is 'abstraction' in programming, as illustrated by creating custom Scratch blocks?
Abstraction in programming is the process of simplifying complex details by creating a custom block (function) that encapsulates a set of operations, so users only need to care about what it does, not how it's implemented. This simplifies the main code.
What is the typical starting approach when building a complex program or game?
The typical starting approach is to take 'baby steps,' implementing small, incremental versions (e.g., version one with just a stage, version two adding basic trash behavior), rather than trying to implement the entire grand vision at once.
How can simple Scratch blocks (functions, conditionals, loops) be combined to create interactive game mechanics?
Simple blocks can be combined to create game mechanics by defining interactions between sprites using Boolean expressions (e.g., 'touching [other sprite]?'), and then using conditionals and loops to trigger actions (like bouncing or scoring points) based on those interactions.

Ask anything
We've read this whole study set, so questions about it get the best answers.