Introduction to Computer Science
- 64Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the primary focus of CS50, according to David Malan's introduction?
What is the primary focus of CS50, according to David Malan's introduction?
64 questions
- 1
What is the primary focus of CS50, according to David Malan's introduction?
- A
It focuses on intellectual enterprises of computer science and art of programming.
- B
It focuses on historical aspects of computer technology and its inventors.
- C
It focuses on advanced theoretical computer science concepts in mathematics.
- D
It focuses on the rapid application of programming skills in industry.
Correct answer
AIt focuses on intellectual enterprises of computer science and art of programming.
Explanation
David Malan explicitly states that CS50 is "Harvard University's Introduction to the Intellectual Enterprises of Computer Science and the Art of Programming." This indicates its broad focus on both theoretical understanding and practical skill development.
- A
- 2
Which subject did David Malan initially pursue in college before discovering computer science?
- A
He initially studied biology, influenced by his high school science classes.
- B
He initially studied economics because it was a popular major choice.
- C
He initially studied government, having enjoyed a constitutional law class.
- D
He initially studied engineering, following the advice of his roommates.
Correct answer
CHe initially studied government, having enjoyed a constitutional law class.
Explanation
Malan states, "In fact, in high school, I was really enjoying history. I loved this constitutional law class that I took my senior year of high school. And so I figured, OK, if that's what I liked in high school... that's probably what I should be doing in college. And so I essentially declared as my concentration or major government for the first year, year and a half of school."
- A
- 3
Who was the professor that first hooked David Malan on CS50 during his sophomore year?
- A
The professor was an unknown instructor, but his teaching style was engaging.
- B
The professor was David J. Malan, who taught the class during his sophomore year.
- C
The professor was a guest lecturer from MIT specializing in algorithms.
- D
The professor at the time was a famous computer scientist named Brian Kernighan.
Correct answer
DThe professor at the time was a famous computer scientist named Brian Kernighan.
Explanation
Malan recalls, "Honestly, once I stepped foot in that classroom, the professor at the time was a famous computer scientist by the name of Brian Kernighan, now at Princeton. Like, I was hooked."
- A
- 4
What analogy does the speaker use to describe receiving an education from MIT?
- A
It is like trying to build a complex structure with limited tools and time.
- B
It is like solving an intricate puzzle with many pieces and no clear image.
- C
It is like trying to drink from a fire hose, implying a lot of information.
- D
It is like navigating a dense forest without a map, requiring intuition.
Correct answer
CIt is like trying to drink from a fire hose, implying a lot of information.
Explanation
Malan mentions, "And here, for instance, is a photograph of a very famous MIT hack, so to speak, from down the road, whereby it communicates that getting an education from MIT is like trying to drink from a fire hose."
- A
- 5
What is the primary goal for students by the end of the CS50 course regarding new technologies?
- A
The goal is to make students reliant on teaching fellows for all future learning.
- B
The goal is to teach students to memorize all current programming languages.
- C
The goal is to ensure students can only use technologies taught in the class.
- D
The goal is to equip students to teach themselves new technologies and ideas.
Correct answer
DThe goal is to equip students to teach themselves new technologies and ideas.
Explanation
Malan states, "But the goal by term's end is to take those and leave those training wheels off so that you're well-equipped to go teach yourself new ideas beyond the class itself."
- A
- 6
What aspect of a student's progress is most important in CS50, according to the syllabus?
- A
What ultimately matters is where a student ends up relative to themselves when they began.
- B
What ultimately matters is achieving a perfect score on all assignments and exams.
- C
What ultimately matters is how much a student knows compared to their classmates.
- D
What ultimately matters is the ability to assist other students with their problems.
Correct answer
AWhat ultimately matters is where a student ends up relative to themselves when they began.
Explanation
Malan clarifies, "And indeed, as per the syllabus, what ultimately matters in this course is not so much where you end up relative to your classmates but where you end up relative to yourself when you began."
- A
- 7
What significant event occurs at the beginning of the CS50 term, emphasizing problem-solving and collaboration?
- A
The term formally begins with a mandatory lecture on advanced data structures.
- B
The term formally begins with CS50 Puzzle Day, focused on logic puzzles and collaboration.
- C
The term formally begins with an introductory session on the history of computers.
- D
The term formally begins with a large programming competition requiring individual effort.
Correct answer
BThe term formally begins with CS50 Puzzle Day, focused on logic puzzles and collaboration.
Explanation
Malan explains, "in just a few days we'll start off the term formally with CS50 Puzzle Day, which is not only an opportunity to get together with friends, with pizza and prizes and also logic puzzles of sorts, but really to send the message that computer science itself is not about programming... but about problem solving, ever more so collaboratively."
- A
- 8
What is the capstone of the CS50 course, involving an overnight session for final projects?
- A
The capstone is the CS50 Research Paper, requiring extensive academic writing.
- B
The capstone is the CS50 Hackathon, where students develop their final projects overnight.
- C
The capstone is the CS50 Final Exam, a comprehensive test of all course material.
- D
The capstone is the CS50 Code Review, where peers evaluate each other's projects.
Correct answer
BThe capstone is the CS50 Hackathon, where students develop their final projects overnight.
Explanation
Malan describes, "And indeed, are there, toward the end of the semester, reinforcements of the same by way of a little something that we call the CS50 Hackathon, which will be an opportunity overnight to dive into your own final projects, the capstone of this course."
- A
- 9
What is the ultimate objective for students' final projects in CS50?
- A
The objective is to strictly replicate a project taught during the course lectures.
- B
The objective is to create something that was not explicitly taught in the course.
- C
The objective is to showcase only basic programming skills learned in the first week.
- D
The objective is to achieve the highest possible score from the teaching staff.
Correct answer
BThe objective is to create something that was not explicitly taught in the course.
Explanation
Malan states, "And indeed, the objective at the end of the day, truly with that final project in particular, is going to be to create for yourselves, for your classmates, for attendees, something that we didn't even teach you how to do."
- A
- 10
How does David Malan succinctly define computer science?
- A
Computer science is defined as the study of human-computer interaction and user interfaces.
- B
Computer science is defined as the study of information, its representation, and processing.
- C
Computer science is defined as the study of physical computer hardware components.
- D
Computer science is defined as the study of mathematical proofs and abstract logic systems.
Correct answer
BComputer science is defined as the study of information, its representation, and processing.
Explanation
Malan explicitly asks, "So what is computer science? Well, put simply, it's the study of information. Like, how do you represent it and how do you process it."
- A
- 11
What is computational thinking as taught in CS50?
- A
It is the application of ideas from computer science to problems of interest.
- B
It is the application of computer science ideas to academic problems only.
- C
It is the memorization of programming languages and their specific syntax.
- D
It is the ability to troubleshoot and repair physical computer systems.
Correct answer
AIt is the application of ideas from computer science to problems of interest.
Explanation
Malan defines computational thinking as, "That is to say, the application of ideas from computer science to problems of interest to us within the class and problems of interest to you after the class."
- A
- 12
In the general model of problem solving presented, what does the input represent?
- A
The input represents the problem to be solved or the initial data.
- B
The input represents the set of instructions given to the computer.
- C
The input represents the final solution produced by the system.
- D
The input represents the desired outcome or the goal of the process.
Correct answer
AThe input represents the problem to be solved or the initial data.
Explanation
Malan illustrates problem solving with a mental image: "You've got some problem to solve, thus known as the input that you want to solve."
- A
- 13
What is unary notation, as demonstrated by counting on fingers?
- A
Unary notation is mathematically known as base one, using fingers as digits.
- B
Unary notation is a complex method primarily used in advanced mathematics.
- C
Unary notation is a system for counting up to 31 on a single human hand.
- D
Unary notation is a base two system, using two distinct states for counting.
Correct answer
AUnary notation is mathematically known as base one, using fingers as digits.
Explanation
Malan explains, "That's actually known as unary notation, otherwise mathematically known as base one, because you're using your fingers literally in this model as digits."
- A
- 14
How many distinct patterns can be made with a single human hand when using a base two system, allowing for counting up to 31?
- A
A single human hand can make 31 distinct patterns for counting in base two.
- B
A single human hand can make 32 distinct patterns for counting in base two.
- C
A single human hand can make 10 distinct patterns for counting in base two.
- D
A single human hand can make 5 distinct patterns for counting in base two.
Correct answer
BA single human hand can make 32 distinct patterns for counting in base two.
Explanation
Malan states that with a single hand using base two, one can count up to 31. This implies 32 distinct patterns (0-31). He explicitly says, "this would be, in fact, 31" for the highest number, and later mentions "eight distinct patterns of light bulbs" for three bits, counting from 0 to 7 (8 possibilities). For a single hand with 5 fingers, 25=32 possibilities.
- A
- 15
What does the term 'bit' mean in the context of computer science?
- A
A bit is a graphical icon used to represent data on a screen.
- B
A bit is a binary digit, representing either a zero or a one.
- C
A bit is a binary instruction set used by central processing units.
- D
A bit is a small electrical component used in circuit boards.
Correct answer
BA bit is a binary digit, representing either a zero or a one.
Explanation
Malan clarifies, "A bit is just a binary digit, which is to say it's a zero or one."
- A
- 16
How do computers physically represent zeros and ones?
- A
They use sound waves at different frequencies to represent values.
- B
They use varying levels of liquid density to indicate numerical states.
- C
They use tiny magnets that can be oriented in two directions.
- D
They use light bulbs that are either off for zero or on for one.
Correct answer
DThey use light bulbs that are either off for zero or on for one.
Explanation
Malan explains, "So you can think of a binary digit that is a zero as really just being a light bulb that is off. By contrast, if you think of a one in the digital world... you can think of that in the human or analog world, the physical world, as being a light bulb that is on."
- A
- 17
What are the tiny little light switches inside electronic devices called?
- A
They are called diodes, allowing current to flow in one direction only.
- B
They are called resistors, controlling the flow of electric current.
- C
They are called capacitors, storing small electrical charges.
- D
They are called transistors, which can be turned on or off.
Correct answer
DThey are called transistors, which can be turned on or off.
Explanation
Malan states, "And in fact, what's inside of your Mac, your PC, your Android phone, your iPhone are millions of tiny little light switches known as transistors that just can be turned on or off, on or off."
- A
- 18
How high can one count using three bits in binary representation, starting from zero?
- A
With three bits, one can count as high as 15, representing 16 possibilities.
- B
With three bits, one can count as high as 31, representing 32 possibilities.
- C
With three bits, one can count as high as three, representing four possibilities.
- D
With three bits, one can count as high as seven, representing eight possibilities.
Correct answer
DWith three bits, one can count as high as seven, representing eight possibilities.
Explanation
Malan confirms, "So seven here is the answer. And if that, too, you're sort of wondering, how are people figuring out 31 and 7? That's the goal at hand here." He later explicitly shows that '111' in binary (three bits) equals 7 in decimal.
- A
- 19
What does 010 in binary represent in decimal, based on the weighting system explained?
- A
010 in binary represents the decimal number four.
- B
010 in binary represents the decimal number two.
- C
010 in binary represents the decimal number zero.
- D
010 in binary represents the decimal number one.
Correct answer
B010 in binary represents the decimal number two.
Explanation
Malan explains, "010 in binary is what in decimal? Two, because it's 2 times 1 and that's it." This is based on the column weights of 4, 2, 1, so (0imes4)+(1imes2)+(0imes1)=2.
- A
- 20
What is the decimal equivalent of the binary number 1000, using four bits?
- A
The decimal equivalent of 1000 binary is ten.
- B
The decimal equivalent of 1000 binary is eight.
- C
The decimal equivalent of 1000 binary is twelve.
- D
The decimal equivalent of 1000 binary is six.
Correct answer
BThe decimal equivalent of 1000 binary is eight.
Explanation
Malan states, "So in fact, if we change all of those to zero but we give ourself one more bit for a total of four, that's got to be the eighth place because there's just another power of two. So 1000 is the decimal number eight."
- A
- 21
How many bits are in a byte?
- A
A byte consists of 4 bits, a common unit of measure.
- B
A byte consists of 32 bits, primarily for advanced calculations.
- C
A byte consists of 8 bits, chosen for its usefulness.
- D
A byte consists of 16 bits, allowing for larger numbers.
Correct answer
CA byte consists of 8 bits, chosen for its usefulness.
Explanation
Malan asks and answers, "How many bits is in a byte, for those familiar? So it's just eight. Why eight? It's just more useful than one or two or three or some other number."
- A
- 22
What is the highest decimal number that can be represented with 8 bits (1 byte), starting from zero?
- A
The highest number is 127, providing 128 possibilities.
- B
The highest number is 511, providing 512 possibilities.
- C
The highest number is 255, providing 256 possibilities.
- D
The highest number is 1023, providing 1024 possibilities.
Correct answer
CThe highest number is 255, providing 256 possibilities.
Explanation
Malan explains, "How high can you count with 8 bits or 1 byte if this is zero? Yeah. So it's actually 255. So if I were to change all of these zeros to ones... would actually give me 255 total. Plus 0, which gives me 256 total possibilities."
- A
- 23
Why is it simpler for computers to use a binary (on or off) system instead of a range of voltage levels?
- A
Using a range of voltage levels would make computers much faster and more efficient.
- B
A range of voltage levels would allow for more memory storage in a smaller space.
- C
It is simpler to use extremes (on/off) in computers to avoid mistaking values.
- D
Binary systems are more complex but offer greater security for data transmission.
Correct answer
CIt is simpler to use extremes (on/off) in computers to avoid mistaking values.
Explanation
Malan explains, "It turns out it's just really easy to do extremes in computers. If you start to split that range of voltage levels... it just gets harder and harder to be exact. And if you get things a little too murky, you might mistake a zero for a one or a two or a three. So it turns out it's just simpler to use the binary system."
- A
- 24
How do computers represent letters like a capital 'A' in English?
- A
Computers represent letters by converting them to complex geometric shapes.
- B
Computers represent letters by assigning a unique pattern of zeros and ones to each.
- C
Computers utilize specific sound frequencies to denote individual letters.
- D
Computers use different magnetic polarities for each distinct alphabetical character.
Correct answer
BComputers represent letters by assigning a unique pattern of zeros and ones to each.
Explanation
Malan confirms, "So we could take the alphabet A through Z in English and we could just assign each letter A number. And honestly, that is not only the correct answer, it's really the only answer. Because at the end of the day, if all you have are zeros and ones available to you, that is the entirety of the potential solution to this problem."
- A
- 25
What decimal number is used to represent a capital 'A' in the ASCII system?
- A
The decimal number 97 is used to represent capital A.
- B
The decimal number 65 is used to represent capital A.
- C
The decimal number 1 is used to represent capital A.
- D
The decimal number 32 is used to represent capital A.
Correct answer
BThe decimal number 65 is used to represent capital A.
Explanation
Malan states, "What decimal number is used to represent apparently capital A? So 65, because that's 64 plus 1 plus 1 times 1 is 65."
- A
- 26
What is ASCII, the system used for mapping letters to numbers?
- A
ASCII is the Universal Encoding for International Text Systems.
- B
ASCII is the Advanced System for Computer Image Interpretation.
- C
ASCII is the Automated System for Character Input and Output.
- D
ASCII is the American Standard Code for Information Interchange.
Correct answer
DASCII is the American Standard Code for Information Interchange.
Explanation
Malan identifies the system: "What is this system? What is this mapping that you yourself propose? It's ASCII, the American Standard Code for Information Interchange."
- A
- 27
How many different characters can be represented with 8 bits in the ASCII system?
- A
A variable number of bits were allocated, depending on the character.
- B
A fixed 16 bits were allocated, allowing 65,536 characters.
- C
Only 8 bits were allocated, allowing 256 characters.
- D
Only 7 bits were allocated, allowing 128 characters.
Correct answer
COnly 8 bits were allocated, allowing 256 characters.
Explanation
Malan states, "Unfortunately, at the time, they only allocated 7 and eventually 8 bits total for representing letters... And so per our conversation a moment ago, if the Americans in this room, so to speak, only used 8 bits total, how many different characters can we represent with a computer in this story? So only 255, technically 256 if we, again, start counting from zero."
- A
- 28
What message does the binary pattern 01001000, 01001001, 00100001 represent in ASCII?
- A
The binary pattern represents the message 'YES!'.
- B
The binary pattern represents the message 'OK!'.
- C
The binary pattern represents the message 'HI!'.
- D
The binary pattern represents the message 'A1B!'.
Correct answer
CThe binary pattern represents the message 'HI!'.
Explanation
Malan clarifies, "Suppose what you really received was decimal 72, 73, 33. What message did you just receive? If you recall the previous chart. Hi was in fact correct. Why? Because H is 72, I is 73. And wait a minute, 33... happens to be an exclamation point. So that is literally what is going on underneath the hood, so to speak, when you get a text message today that literally says in all caps and an exclamation point, HI!"
- A
- 29
What is Unicode, and how does it relate to ASCII?
- A
Unicode is a newer standard, designed to be incompatible with ASCII.
- B
Unicode is a specialized system for representing only mathematical symbols.
- C
Unicode is a newer standard, backwards compatible with ASCII, supporting more languages.
- D
Unicode is an older standard, replaced entirely by ASCII for global use.
Correct answer
CUnicode is a newer standard, backwards compatible with ASCII, supporting more languages.
Explanation
Malan explains, "Well, the goal of this system, not just ASCII, but something known as Unicode, which is a newer standard, is to be backwards compatible with ASCII... The goal being to be able digitally to represent all human languages, past, present, and future."
- A
- 30
Why do some emojis not show up on older devices or software?
- A
Emojis don't show up due to hardware limitations of the older devices.
- B
Emojis don't show up because they require a constant internet connection to render.
- C
Emojis don't show up because the older software lacks the updated fonts or rendering instructions.
- D
Emojis don't show up because the older software automatically blocks new pictorial content.
Correct answer
CEmojis don't show up because the older software lacks the updated fonts or rendering instructions.
Explanation
Malan explains, "It depends on how recent the software is. Pretty much every year the humans behind the Unicode consortium release new emoji... And unless you update your phone, your laptop, your desktop to the very latest software and the manufacturer of that device or software also updates by hiring an artist to draw those pictures in their own fonts, in their own style, you're going to see usually just an empty black square."
- A
- 31
How do computers represent colors, such as for a single pixel on a screen?
- A
Computers represent colors using a system called RGB (Red Green Blue) with three numbers per pixel.
- B
Computers represent colors by storing a single number that maps to a predefined color palette.
- C
Computers represent colors by directly converting light wavelengths into binary data.
- D
Computers represent colors using complex mathematical equations that describe light properties.
Correct answer
AComputers represent colors using a system called RGB (Red Green Blue) with three numbers per pixel.
Explanation
Malan explains, "Well, by convention, they typically use a system that, by an acronym, is called RGB. Red green blue. And this is to say that a computer, to represent a single dot on the screen... will allocate some number of bits or some number of bytes to represent the color of just that, their dot, otherwise known as a pixel. In particular, these devices typically use three numbers in total, three bytes."
- A
- 32
What does a photograph's file size (e.g., 1 megabyte) primarily correspond to?
- A
The file size corresponds to the number of color profiles used in the image.
- B
The file size corresponds to the number of pixels in the image, with bytes for each dot.
- C
The file size corresponds to the complexity of the objects depicted in the photograph.
- D
The file size corresponds to the amount of time it took to capture the image.
Correct answer
BThe file size corresponds to the number of pixels in the image, with bytes for each dot.
Explanation
Malan clarifies, "Where are all of these bytes inside of these photographs or these images you're taking or downloading? They correspond to every one of the single pixels on the screen. There's at least three bytes being used to represent every one of those dots."
- A
- 33
How do computers represent videos?
- A
Videos are represented by mathematical formulas that describe motion paths.
- B
Videos are represented as a sequence of individual images (frames) played rapidly.
- C
Videos are represented as a continuous stream of light signals, directly recorded.
- D
Videos are represented by a single, large data file that captures the entire scene.
Correct answer
BVideos are represented as a sequence of individual images (frames) played rapidly.
Explanation
Malan explains, "That's all a video is on your screen. That's all a film is on your TV. It is not in fact, continuous motion. It's maybe 30 frames or images per second, maybe 24 frames or images per second."
- A
- 34
How can computers represent sound, such as music?
- A
Computers represent sound by converting audio directly into visual waveforms.
- B
Computers represent sound by assigning numbers to pitch, volume, and duration of notes.
- C
Computers represent sound by interpreting human brain waves during listening.
- D
Computers represent sound by storing physical recordings as raw analog data.
Correct answer
BComputers represent sound by assigning numbers to pitch, volume, and duration of notes.
Explanation
Malan suggests, "So each number that we store in the computer could correspond to a certain frequency, which has a direct relationship to the sound or the pitch of a note... Maybe we need that number, but maybe a second number for the volume... Maybe a third number for how long are you holding the key down."
- A
- 35
What determines how a computer interprets a pattern of zeros and ones (e.g., as text or color)?
- A
The interpretation depends on the context, such as the software program opening the data.
- B
The computer always interprets zeros and ones as numerical values by default.
- C
The interpretation is based on the specific type of electronic device being used.
- D
The interpretation is determined by a universal, predefined global standard for all data.
Correct answer
AThe interpretation depends on the context, such as the software program opening the data.
Explanation
Malan clarifies, "Just depends on the context. Simply put, if you're opening that pattern of zeros and ones with Excel or a calculator program, odds are the software will interpret those three bytes as numbers, of course. If, though, you open that same pattern in a text messaging program... that same pattern will be interpreted as a sequence of letters."
- A
- 36
What is an algorithm, as introduced by Professor Brian Kernighan?
- A
An algorithm is a piece of hardware designed to perform specific computations.
- B
An algorithm is a programming language used for creating interactive software.
- C
An algorithm is a complex mathematical formula for solving abstract problems.
- D
An algorithm is a very precise description of how to do something, step by step.
Correct answer
DAn algorithm is a very precise description of how to do something, step by step.
Explanation
Malan states, "What is an algorithm? It's really just step by step instructions for solving some problem. And indeed, I think back to my own first time in CS50 where we learned the same from Professor Brian Kernighan... An algorithm is a very precise description of how to do something. And the operative word there is precise."
- A
- 37
What is the primary characteristic that makes an algorithm 'precise'?
- A
It must execute at an extremely high speed to be considered precise.
- B
It must be written in a formal programming language to be precise.
- C
It has to be very, very, very, very precise, leaving no ambiguity.
- D
It must produce mathematically proven optimal results every time.
Correct answer
CIt has to be very, very, very, very precise, leaving no ambiguity.
Explanation
Malan quotes Kernighan: "An algorithm is a very precise description of how to do something. And the operative word there is precise. It has to be very, very, very, very precise."
- A
- 38
What real-world object is used to demonstrate algorithms for finding information?
- A
A dictionary is used to demonstrate algorithms for word definitions.
- B
A map is used to demonstrate algorithms for finding geographical locations.
- C
A recipe book is used to demonstrate algorithms for culinary instructions.
- D
A phone book is used to demonstrate algorithms for finding names and numbers.
Correct answer
DA phone book is used to demonstrate algorithms for finding names and numbers.
Explanation
Malan uses the example: "I do have this here other technology known once upon a time as a phone book... I could, when looking for John Harvard... I could start at the beginning of the phone book and start looking page by page by page for John Harvard."
- A
- 39
Which algorithm for finding a name in a phone book is considered the most efficient?
- A
Looking at every second page to go twice as fast.
- B
Randomly opening pages until the name is found.
- C
Starting at the beginning and looking page by page.
- D
Going to the middle, tearing the problem in half, and repeating.
Correct answer
DGoing to the middle, tearing the problem in half, and repeating.
Explanation
Malan explains the most efficient method: "But what we used to do back in the day and what your phone is doing today, albeit digitally, is going roughly to the middle of the phone book, looking down and realizing, oh, I'm accidentally in the M section... tear the problem in half, throw half of the problem away."
- A
- 40
Roughly how many steps would it take to find a name in a 1,000-page phone book using the 'divide and conquer' algorithm?
- A
It would take roughly 1,000 steps in the worst case.
- B
It would take roughly 500 steps, plus one additional step.
- C
It would take roughly 10 steps, dividing the problem in half repeatedly.
- D
It would take roughly 100 steps, based on a linear progression.
Correct answer
CIt would take roughly 10 steps, dividing the problem in half repeatedly.
Explanation
Malan states, "How many times can you divide a thousand pages in half again and again and again, roughly? AUDIENCE: I want to say nine. DAVID MALAN: So 9, 10. So typically 10 times, give or take."
- A
- 41
What mathematical function describes the efficiency of the 'divide and conquer' algorithm?
- A
The efficiency is described by an exponential function, like 2^n.
- B
The efficiency is described by a logarithmic function, like log base 2 of n.
- C
The efficiency is described by a linear function, like n.
- D
The efficiency is described by a quadratic function, like n^2.
Correct answer
BThe efficiency is described by a logarithmic function, like log base 2 of n.
Explanation
Malan shows, "It instead looks a little something like this... And for those who recall their logarithms, this would be described as log base 2 of n."
- A
- 42
What is the benefit of using better, more clever algorithms in programming?
- A
Better algorithms are harder to implement but offer no significant speed advantages.
- B
Better algorithms minimize time to solve problems, making software more competitive and usable.
- C
Better algorithms always require more memory but run faster.
- D
Better algorithms require programmers to write more lines of code to be effective.
Correct answer
BBetter algorithms minimize time to solve problems, making software more competitive and usable.
Explanation
Malan states, "The power of learning algorithms... is to be able to navigate big data... using better and better, more clever algorithms that perform faster, and therefore not only make the software more competitive, but also make it more usable and more favorable."
- A
- 43
What is 'pseudocode' in the context of implementing algorithms?
- A
Pseudocode is a precise, finite English vernacular for step-by-step instructions.
- B
Pseudocode is a graphical programming language that uses drag-and-drop blocks.
- C
Pseudocode is a debugging tool that automatically finds errors in written code.
- D
Pseudocode is a formal programming language used for advanced scientific computations.
Correct answer
APseudocode is a precise, finite English vernacular for step-by-step instructions.
Explanation
Malan describes pseudocode as, "something that's literally still English, but pseudocode. Something that is still correct, but precise and finite, as per Professor Kernighan's advice, which is to say use your own vernacular of English and just say what you mean but very succinctly."
- A
- 44
In pseudocode, what are 'functions'?
- A
Functions are conditional statements that control program flow.
- B
Functions are graphical elements that represent program output.
- C
Functions are actions or verbs, bite-sized tasks a computer can do.
- D
Functions are variables used to store numerical data.
Correct answer
CFunctions are actions or verbs, bite-sized tasks a computer can do.
Explanation
Malan identifies, "One, there are these verbs, these actions. And henceforth... we're going to start to call these by what a more and more technical audience would. These are functions. A function is an action or a verb. It's like a bite-sized task that a computer can do for you."
- A
- 45
What do 'if else if else' statements represent in pseudocode?
- A
They are examples of loops, repeating a set of instructions indefinitely.
- B
They are examples of variables, storing different types of information.
- C
They are examples of conditionals, representing forks in the road.
- D
They are examples of functions, performing specific actions.
Correct answer
CThey are examples of conditionals, representing forks in the road.
Explanation
Malan states, "If else if else if else. Those are examples of what we're going to start calling conditionals. These are sort of proverbial forks in the road where maybe you go this way, maybe you go this way, but you decide which way to go based on a question."
- A
- 46
What is a 'Boolean expression' in programming?
- A
A Boolean expression is a command that initiates a program loop.
- B
A Boolean expression is a question with a yes or no (true or false) answer.
- C
A Boolean expression is a definition of a new function or action.
- D
A Boolean expression is a statement that generates random numbers.
Correct answer
BA Boolean expression is a question with a yes or no (true or false) answer.
Explanation
Malan defines it as, "A Boolean expression is a question with a yes or no answer, a true or false answer, a black or white answer, a one or zero answer."
- A
- 47
What is the significance of indentation in pseudocode and many programming languages?
- A
Indentation only serves to make the code look visually appealing and organized.
- B
Indentation has logical significance, dictating which actions are conditional.
- C
Indentation has no technical significance and is purely for programmer preference.
- D
Indentation indicates the speed at which a particular section of code will execute.
Correct answer
BIndentation has logical significance, dictating which actions are conditional.
Explanation
Malan highlights, "Notice what's important here is that indentation mattered as a result... Indentation in pseudocode and in many programming languages has logical significance. It tells you whether to do things or not."
- A
- 48
What is a 'loop' in programming terminology?
- A
A loop is a conditional statement that branches program execution.
- B
A loop is a variable that stores a sequence of data elements.
- C
A loop is a cycle that causes instructions to repeat potentially many times.
- D
A loop is a function that performs a single, atomic operation.
Correct answer
CA loop is a cycle that causes instructions to repeat potentially many times.
Explanation
Malan defines it: "Go back to, which literally makes me go back to line three, potentially again and again and again, creating some kind of cycle or what we'll typically call a loop instead."
- A
- 49
Why would the phone book algorithm not result in an infinite loop?
- A
The algorithm detects when it has processed the same page twice and then stops.
- B
The algorithm always calls the person or quits, ensuring termination.
- C
The algorithm has a fixed number of pages to process, preventing infinite loops.
- D
The algorithm continuously divides the problem in half, guaranteeing it eventually stops.
Correct answer
DThe algorithm continuously divides the problem in half, guaranteeing it eventually stops.
Explanation
Malan explains, "But these will not induce infinite loops. Why? What is happening in this particular algorithm every time we go back to line three that guarantees eventually we will stop going back to line three? AUDIENCE: The person is on the page, you call it. DAVID MALAN: Exactly. If the person is on the page, we will call them or we will quit. But more importantly, because we keep dividing and conquering the problem, in this case, having the phone book, having the phone book, eventually we're going to run out of phone book."
- A
- 50
What is a 'bug' in programming, as exemplified by a computer freezing or rebooting?
- A
A bug is a physical defect in the computer's hardware components.
- B
A bug is a mistake in the code, often from unanticipated scenarios.
- C
A bug is a feature that optimizes the computer's performance.
- D
A bug is an intentional error introduced by the programmer for testing.
Correct answer
BA bug is a mistake in the code, often from unanticipated scenarios.
Explanation
Malan mentions, "Odds are that's because not you but some other human made a mistake. They probably wrote code... and they didn't actually anticipate that, oh, there could be a fourth scenario that could happen in the real world. But if there's no code that tells the computer what to do in that fourth and final scenario, who knows what the computer is going to do? It might, by default, reboot. It might, by default, freeze. That's just a hint of the bugs, the mistakes in software to come."
- A
- 51
How are modern AI chatbots like ChatGPT typically implemented, in contrast to a simple conditional 'if/else' approach?
- A
They are implemented through a direct connection to a human operator who types responses.
- B
They are implemented by manually crafting specific responses for every known human query.
- C
They are implemented by writing an infinite number of 'if/else' conditionals for every possible question.
- D
They are typically trained on vast amounts of data using neural networks to infer responses.
Correct answer
DThey are typically trained on vast amounts of data using neural networks to infer responses.
Explanation
Malan states, "this is not how you implement AI, but rather how you implement an AI like a chat bot is you typically train it based on lots and lots of data. You give it lots of inputs, lots of inputs, training data, and let it figure out what it should say in response to certain questions. And it boils down to a lot of probability, a lot of statistics, otherwise known now as large language models, which... are actually typically implemented with what are called neural networks."
- A
- 52
What is the purpose of 'rubber duck debugging'?
- A
It is a technique where programmers train a virtual rubber duck to debug their code automatically.
- B
It is a technique where programmers use a rubber duck as a physical tool to fix hardware issues.
- C
It is a technique where programmers throw rubber ducks at their computers when frustrated.
- D
It is a technique where programmers explain their code to an inanimate object to find errors.
Correct answer
DIt is a technique where programmers explain their code to an inanimate object to find errors.
Explanation
Malan explains, "you can talk to the duck, maybe door closed, and ask the duck your questions, or, more importantly, talk the duck through what confusion you're having. And the mere act of talking through the problem, explaining logically what you're trying to do, what you're actually doing, and what the error actually is, invariably, that sort of proverbial light bulb goes off and you realize, oh, I'm an idiot. I hear in my own words where I've gone awry."
- A
- 53
Why is CS50's own AI tool (CS50.ai) allowed and encouraged, unlike general AI tools like ChatGPT?
- A
CS50.ai is allowed because it is a simpler version of ChatGPT with fewer features.
- B
CS50.ai is allowed because it operates completely offline and doesn't connect to external data.
- C
CS50.ai is allowed because it provides direct answers without requiring student effort.
- D
CS50.ai is allowed because it is designed to guide students toward solutions, not hand them outright.
Correct answer
DCS50.ai is allowed because it is designed to guide students toward solutions, not hand them outright.
Explanation
Malan explains, "But you are allowed and encouraged to use CS50's own AI based tools, which resemble those same tools but know something about CS50 and aspire to behave akin to a good teaching fellow guiding you to solutions as opposed to handing you something outright."
- A
- 54
What is the primary pedagogical value of learning the C programming language in CS50?
- A
Learning C is valuable because it is the easiest programming language for beginners to grasp.
- B
Learning C is primarily valuable because it is the most widely used language in Silicon Valley.
- C
Learning C is valuable because it provides a conceptual foundation for other languages like Python.
- D
Learning C is valuable only for making devices operate quickly and efficiently.
Correct answer
CLearning C is valuable because it provides a conceptual foundation for other languages like Python.
Explanation
Malan states, "For us pedagogically, the value of C is not that you're probably in Silicon Valley and other such jobs going to be using C yourself that much, but because it's going to provide a conceptual foundation on top of which we introduce other languages, like Python."
- A
- 55
What graphical programming language is used in CS50 to introduce programming ideas without complex syntax?
- A
HTML is used, focusing on visual elements and web development principles.
- B
Java is used, featuring a visual environment for object-oriented concepts.
- C
Python is used to introduce programming ideas with its simplified syntax.
- D
Scratch is used, allowing programming by dragging and dropping puzzle pieces.
Correct answer
DScratch is used, allowing programming by dragging and dropping puzzle pieces.
Explanation
Malan says, "But what's wonderful about Scratch, which is this graphical programming language from down the street at MIT... is you can program not by using your keyboard per se, but by dragging and dropping puzzle pieces, otherwise known as blocks."
- A
- 56
What is the default character in the Scratch programming environment?
- A
The default character in Scratch is a cat, which serves as a sprite.
- B
The default character in Scratch is a human figure, for interactive stories.
- C
The default character in Scratch is a robot, performing various actions.
- D
The default character in Scratch is a dog, which can be customized.
Correct answer
AThe default character in Scratch is a cat, which serves as a sprite.
Explanation
Malan notes, "The default character in the world of Scratch is, in fact, a cat that looks like this."
- A
- 57
What does 'when green flag clicked' signify in Scratch?
- A
It signifies the starting point for executing a program in Scratch.
- B
It signifies that a specific sound effect should be played immediately.
- C
It signifies a conditional statement that controls program flow.
- D
It signifies the end of a program, halting all active scripts.
Correct answer
AIt signifies the starting point for executing a program in Scratch.
Explanation
Malan explains, "And probably the most common one you will use to write code in Scratch for just this first week is literally when green flag clicked. Why? Well, if we go back over to the cat's world at top right, notice that above the cat's rectangular world, there's not only a green flag for starting."
- A
- 58
What is a 'side effect' in programming, as demonstrated by the Scratch 'say hello world' block?
- A
A side effect is an input value passed to a function for processing.
- B
A side effect is a visual or audible change that a function produces.
- C
A side effect is a hidden error that occurs when a function is called.
- D
A side effect is a return value that a function hands back to the program.
Correct answer
BA side effect is a visual or audible change that a function produces.
Explanation
Malan describes, "What the cat is doing though, visually on the screen here at top right, is what's generally called a side effect. Sometimes when you call a function, it does something visually. And in this case, you're seeing literally a cartoon speech bubble, hello world. That is the side effect of this function."
- A
- 59
What is a 'return value' in the context of functions?
- A
A return value is a visual output that appears on the screen after a function runs.
- B
A return value is a predefined input that automatically gets processed by the function.
- C
A return value is an error message indicating a problem with the function.
- D
A return value is a value that a function hands back, which can be stored and reused.
Correct answer
DA return value is a value that a function hands back, which can be stored and reused.
Explanation
Malan explains, "Some functions can hand you back a value, a so-called return value, that will allow you to actually reuse whatever the human typed in. So a return value is something that gets virtually handed back to you and you can store it in something called a variable."
- A
- 60
What term is used for an input to a function, as seen with multiple inputs to a Scratch block?
- A
An input to a function is generally called a return value.
- B
An input to a function is generally called a variable.
- C
An input to a function is generally called an argument.
- D
An input to a function is generally called a parameter.
Correct answer
CAn input to a function is generally called an argument.
Explanation
Malan states, "ergo two inputs, otherwise now known as arguments to a function. An input to a function is just an argument now."
- A
- 61
Why is it considered foolish to repeatedly copy and paste the same code blocks in programming?
- A
It is foolish because repeated code can only be used a limited number of times.
- B
It is foolish because compilers cannot process programs with duplicate code blocks.
- C
It is foolish because it increases the probability of making mistakes when changes are needed.
- D
It is foolish because it makes the program run much slower due to redundancy.
Correct answer
CIt is foolish because it increases the probability of making mistakes when changes are needed.
Explanation
Malan advises, "frankly, any time you are copying and pasting something in code or dragging the same thing again and again, odds are you're doing something foolish. Why? Because you're repeating yourself unnecessarily... suppose I want to change this program later... Eventually I or a colleague I'm working with is going to screw up. They're going to change a value in one place, forget to change it in another."
- A
- 62
What is the primary benefit of creating custom blocks or functions in Scratch?
- A
Custom blocks allow programmers to invent their own reusable functions and abstract details.
- B
Custom blocks automatically generate random outputs for unpredictable behavior.
- C
Custom blocks limit the program's functionality, making it simpler to understand.
- D
Custom blocks introduce intentional bugs to make the program more challenging.
Correct answer
ACustom blocks allow programmers to invent their own reusable functions and abstract details.
Explanation
Malan states, "What's nice about Scratch and what's nice about programming languages in general is you can generally invent your own puzzle pieces, your own functions, and then use and reuse them... I now have a pink puzzle piece called meow that is a new function that will do whatever that other block of code tells the cat to do."
- A
- 63
What is an 'event' in the context of Scratch programming, as demonstrated by video sensing?
- A
An event is a variable that stores user input, such as typed text.
- B
An event is a predefined function that performs a complex mathematical calculation.
- C
An event is a specific type of error that occurs during program execution.
- D
An event is something that can happen on the screen, like a click, drag, or motion.
Correct answer
DAn event is something that can happen on the screen, like a click, drag, or motion.
Explanation
Malan explains, "This is a category of block that's constantly waiting for what we'll call an event. An event is just something that can happen on the screen, a click, a drag, a mouse movement, and so forth."
- A
- 64
What is the recommended approach for tackling complex programming problems or games, like Oscartime?
- A
Attempt to implement all features of the program at once to save time.
- B
Delegate all complex features to other programmers from the beginning.
- C
Take baby steps, implementing one tiny feature at a time to make progress.
- D
Focus solely on writing the most efficient code, regardless of correctness.
Correct answer
CTake baby steps, implementing one tiny feature at a time to make progress.
Explanation
Malan advises, "But I did not set out and write all of these programs all at once for each sprite. I pretty much took baby steps, so to speak... Implement one tiny feature so that you feel like you're making progress. Add another feature, another."
- A

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