1. Home
  2. Explore
  3. Computer Science
  4. Introduction to AI

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Introduction to AI

  • 25Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Rubber Duck Debugging

What is the primary purpose of the 'rubber duck debugging' technique in programming?

25 questions

  1. 1

    What is the primary purpose of the 'rubber duck debugging' technique in programming?

    1. A

      To automatically correct syntax errors in the programmer's written code.

    2. B

      To offer pre-written solutions to common programming challenges.

    3. C

      To provide a physical object for programmers to talk to about their code.

    4. D

      To replace the need for human interaction when debugging programming errors.

    Correct answer
    C

    To provide a physical object for programmers to talk to about their code.

    Explanation

    The rubber duck debugging technique involves verbalizing one's confusion or problem to an inanimate object, such as a rubber duck. The act of explaining the problem aloud often helps the programmer identify the solution themselves, as stated in the text: 'in that process of verbalizing your own confusion and explaining yourself, quite often does that proverbial light bulb go off over your head and voila, problem is solved.'

  2. 2

    How did the initial virtual rubber duck in CS50's programming environment function for students?

    1. A

      It connected students directly with a teaching assistant for help.

    2. B

      It offered detailed, step-by-step solutions to complex problems.

    3. C

      It responded with quacks, encouraging students to verbalize issues.

    4. D

      It provided direct answers to all questions typed into the chat.

    Correct answer
    C

    It responded with quacks, encouraging students to verbalize issues.

    Explanation

    The text states that 'for multiple years, all the CS 50 duck did was respond with 1 or 2 or 3 quacks.' Anecdotal evidence suggested that this simple response was often enough for students to solve their problems by articulating them.

  3. 3

    What significant change was introduced to the CS50 duck in 2023?

    1. A

      It started providing direct, complete answers to all student inquiries.

    2. B

      It began responding to students in English, offering guided assistance.

    3. C

      It was integrated with social media platforms for wider accessibility.

    4. D

      It allowed students to submit their code for automated grading.

    Correct answer
    B

    It began responding to students in English, offering guided assistance.

    Explanation

    The content explains that 'in 2023 the same duck started responding to students in English and that now is the tool that they have available, which is in effect meant to be a less helpful version of Chat GPT, one that doesn't just spoil answers outright, but tries to guide them to solutions akin to any good teacher or tutor.'

  4. 4

    What is the primary characteristic of generative artificial intelligence (AI)?

    1. A

      It creates new content such as images, sounds, video, or text.

    2. B

      It focuses solely on classifying existing data into predefined categories.

    3. C

      It strictly follows pre-programmed rules and decision trees.

    4. D

      It analyzes past behaviors to make recommendations without human input.

    Correct answer
    A

    It creates new content such as images, sounds, video, or text.

    Explanation

    The lecture defines generative artificial intelligence as 'using this technology known as AI to generate something, whether that's images or sounds or video or text.'

  5. 5

    Which statement accurately describes prompt engineering in the context of AI?

    1. A

      It focuses on automatically generating AI system parameters.

    2. B

      It is a complex form of software development for AI models.

    3. C

      It involves carefully crafting questions and providing context to AI.

    4. D

      It requires extensive knowledge of AI's internal mathematical functions.

    Correct answer
    C

    It involves carefully crafting questions and providing context to AI.

    Explanation

    Prompt engineering is described as 'not so much a form of engineering as it is a form of asking good questions. And being detailed in your question giving context to the underlying AI so that the answer with high probability is what you want back.'

  6. 6

    What is the function of a 'system prompt' in an AI interaction, as implemented in CS50's duck?

    1. A

      It provides historical data for the AI to base its responses upon.

    2. B

      It directly modifies the core algorithms of the AI model being used.

    3. C

      It establishes the AI's persona, domain, and behavioral guidelines.

    4. D

      It is the student's specific question typed into the chat interface.

    Correct answer
    C

    It establishes the AI's persona, domain, and behavioral guidelines.

    Explanation

    The text defines a system prompt as 'instructions written by us humans, often in English, that sort of nudge the underlying AI technology to have a certain personality or a specific domain of expertise.'

  7. 7

    What happens to the 'user prompt' in CS50's duck implementation after the system prompt?

    1. A

      It is copied and pasted directly, becoming the AI's input query.

    2. B

      It is rephrased by the AI to fit its predetermined personality.

    3. C

      It is disregarded if it falls outside the AI's specified domain.

    4. D

      It is analyzed for keywords to determine the appropriate system prompt.

    Correct answer
    A

    It is copied and pasted directly, becoming the AI's input query.

    Explanation

    After the system prompt, 'we effectively copy paste whatever question a student has typed in, otherwise known as a user prompt,' which is then processed by the AI.

  8. 8

    What is GitHub Copilot, as demonstrated in the lecture?

    1. A

      A web-based platform for collaborating on open-source projects.

    2. B

      A CS50-specific tool for managing student assignments and grades.

    3. C

      An AI-powered feature in VS Code that suggests code snippets.

    4. D

      A debugger that automatically fixes errors in C programming language.

    Correct answer
    C

    An AI-powered feature in VS Code that suggests code snippets.

    Explanation

    The text describes Copilot as a feature in VS Code 'very similar in spirit to products from Google and Anthropic and other companies as well, but this is the one that comes from Microsoft and in turned GitHub here, and it too gives us me sort of a chat window here and this is just one of its features.' It is shown suggesting code for functions.

  9. 9

    Why does CS50 disable features like Copilot for students at the start of the course?

    1. A

      To ensure fairness in grading by preventing AI-generated solutions.

    2. B

      To encourage students to develop fundamental programming muscle memory.

    3. C

      To limit access to advanced features for all introductory students.

    4. D

      To prevent over-reliance on AI, which can introduce security flaws.

    Correct answer
    B

    To encourage students to develop fundamental programming muscle memory.

    Explanation

    The lecturer explains the importance of 'the muscle memory that hopefully you feel you've been developing' and that if 'you don't have an eye for what you're looking at, there's no way you're going to be able to troubleshoot an issue in here.' This implies that disabling Copilot fosters independent learning and skill development.

  10. 10

    How do AI tools like Copilot 'amplify' a programmer's capabilities?

    1. A

      They provide a virtual environment to test code without actual compilation.

    2. B

      They allow programmers to bypass the need for understanding core concepts.

    3. C

      They automatically optimize code for performance without human intervention.

    4. D

      They remove tedious coding tasks, enabling focus on higher-level problems.

    Correct answer
    D

    They remove tedious coding tasks, enabling focus on higher-level problems.

    Explanation

    The text states that AI 'amplifies your capabilities as a programmer sort of overnight. Once you have that vocabulary, that muscle memory for doing it yourself, the AI can just take it from there and get rid of all of the tedium, allow you to Focus at the whiteboard with the other humans on sort of the overarching problems that you want to solve.'

  11. 11

    Which of the following is NOT given as an early application of artificial intelligence?

    1. A

      Recommendation systems for streaming services like Netflix.

    2. B

      Handwriting recognition for converting written text to digital.

    3. C

      Spam detection in email inboxes for filtering messages.

    4. D

      Self-driving cars navigating complex road conditions.

    Correct answer
    D

    Self-driving cars navigating complex road conditions.

    Explanation

    The lecture mentions spam detection, handwriting recognition, and streaming service recommendations as applications of AI that 'have been developing for decades.' Self-driving cars are not mentioned as one of these early applications.

  12. 12

    In the context of the Breakout game, what is a 'decision tree'?

    1. A

      A step-by-step algorithmic process for making optimal moves.

    2. B

      A visual representation of the game's scoring system.

    3. C

      A historical record of all previous player actions in the game.

    4. D

      A method for randomly generating paddle movements.

    Correct answer
    A

    A step-by-step algorithmic process for making optimal moves.

    Explanation

    The text describes decision trees as 'a concept from economics, strategic thinking, computer science as well. That's one way of solving this problem in such a way that you will always play this game well if you just follow this algorithm.' It then provides an example of questions and corresponding paddle movements.

  13. 13

    According to the lecture, what is the optimal outcome for a player in Tic-Tac-Toe if playing perfectly?

    1. A

      Achieving three symbols in a row using the central square.

    2. B

      Winning the game or, at worst, forcing a tie outcome.

    3. C

      Minimizing the opponent's score while ignoring one's own.

    4. D

      Always winning the game outright against any opponent.

    Correct answer
    B

    Winning the game or, at worst, forcing a tie outcome.

    Explanation

    The lecture states: 'logically there's no reason you should ever lose a game of tic tac toe if you're playing optimally. At worst you should force a tie, but at best you should win the game.'

  14. 14

    In the MiniMax algorithm for Tic-Tac-Toe, what is player O's primary goal?

    1. A

      To always achieve a tie, regardless of the opponent's moves.

    2. B

      To minimize its score, where -1 represents a win for O.

    3. C

      To maximize its own score by getting three in a row.

    4. D

      To randomly select moves to confuse the opponent's strategy.

    Correct answer
    B

    To minimize its score, where -1 represents a win for O.

    Explanation

    The scoring system for MiniMax is defined as: O wins = -1, X wins = 1, Tie = 0. The text then states, 'X to maximize its score because one is the biggest value available and O's goal in life is to minimize its score.'

  15. 15

    Why is it difficult for humans and even modern computers to solve games like Chess or Go by trying all possibilities?

    1. A

      The rules of these games are too complex for algorithmic representation.

    2. B

      Human intuition is always superior to computational brute force in these games.

    3. C

      The number of possible moves and board configurations is astronomically large.

    4. D

      Computers lack the emotional intelligence required for strategic decisions.

    Correct answer
    C

    The number of possible moves and board configurations is astronomically large.

    Explanation

    For Chess, it's 85 billion possibilities for the first four moves, and for Go, 266 quintillion. The lecture concludes, 'I don't have this many bits of memory in my computer. I don't have this many hours in my life left to actually crunch all of those numbers.'

  16. 16

    What is the core idea behind 'machine learning' as described in the lecture?

    1. A

      Enabling machines to learn how to solve problems by training on data.

    2. B

      Creating highly complex if-else statements for every conceivable scenario.

    3. C

      Writing code that directly solves a problem with explicit instructions.

    4. D

      Developing algorithms that can try every possible solution to a problem.

    Correct answer
    A

    Enabling machines to learn how to solve problems by training on data.

    Explanation

    Machine learning is defined as 'writing code via which machines learn how to solve problems generally by being trained on massive amounts of data and then in new problems looking for patterns via which they can apply those past training data to the problem at hand.'

  17. 17

    How is 'reinforcement learning' demonstrated in the pancake-flipping robot example?

    1. A

      The robot receives rewards for successful flips and penalties for failures.

    2. B

      The human researcher directly controls the robot's arm movements.

    3. C

      The robot observes and replicates human actions without any feedback.

    4. D

      The robot is pre-programmed with every possible pancake-flipping motion.

    Correct answer
    A

    The robot receives rewards for successful flips and penalties for failures.

    Explanation

    With reinforcement learning, 'the human is probably rewarding the robot when it does a good job... or conversely, every time the robot screws up and drops the pancake on the floor, sort of a proverbial slap on the wrist, a punishment so that it does less of that behavior the next time.'

  18. 18

    What is the 'exploring versus exploiting' principle in AI problem solving?

    1. A

      Using existing knowledge to find a solution versus introducing randomness to find better solutions.

    2. B

      Focusing on speed of solution versus focusing on accuracy of solution.

    3. C

      Always choosing the known optimal path versus always choosing a random path.

    4. D

      Prioritizing short-term gains versus prioritizing long-term stability.

    Correct answer
    A

    Using existing knowledge to find a solution versus introducing randomness to find better solutions.

    Explanation

    The text explains it as 'exploiting knowledge I already have... vs. exploring just a little bit' by 'sprinkle in a little bit of randomness along the way' to potentially find 'an amazing dish out there that otherwise I wouldn't have discovered.'

  19. 19

    What is a disadvantage of an AI exclusively 'exploiting' known good paths in a maze game?

    1. A

      It might find a solution but not the most optimal or shortest one.

    2. B

      It will always choose the longest possible path to the exit.

    3. C

      It will only be able to solve mazes with a single defined exit.

    4. D

      It may get stuck in a loop and never reach the exit point.

    Correct answer
    A

    It might find a solution but not the most optimal or shortest one.

    Explanation

    A 7th grader points out that the exploited path 'could have taken a shorter path,' and the lecturer confirms, 'we're never gonna find that shorter path. We're never gonna get the highest score possible if I just keep naively following my well trodden path.'

  20. 20

    What category of machine learning is exemplified by manually tagging emails as 'spam'?

    1. A

      Unsupervised learning, as no human input is required for classification.

    2. B

      Reinforcement learning, as the system learns through rewards and penalties.

    3. C

      Deep learning, which uses complex neural networks without human oversight.

    4. D

      Supervised learning, as humans provide labeled examples for training.

    Correct answer
    D

    Supervised learning, as humans provide labeled examples for training.

    Explanation

    The text explicitly states that spam detection 'was certainly supervised. Why? Because it was you and I who was like putting the email into the spam folder... that is training Google's algorithm further.' This human labeling is characteristic of supervised learning.

  21. 21

    Why does 'supervised learning' not scale well for problems with massive amounts of data?

    1. A

      Manually labeling data for training becomes too expensive and unrealistic.

    2. B

      It requires prohibitively complex algorithms for large datasets.

    3. C

      It leads to AI models that are too slow to process information.

    4. D

      It tends to introduce too much randomness into the learning process.

    Correct answer
    A

    Manually labeling data for training becomes too expensive and unrealistic.

    Explanation

    The problem with supervised learning is that 'labeling data in that way manually just doesn't scale very well... It's expensive in terms of human power, and there's certainly problems out there with so much data. It's just not realistic for humans to label millions of pieces of data, billions of pieces of data.'

  22. 22

    What is the inspiration for 'neural networks' in deep learning?

    1. A

      Mathematical formulas used to solve linear equations and graphs.

    2. B

      The logical flow of decision trees used in early AI systems.

    3. C

      The structure of traditional computer processors and memory units.

    4. D

      The interconnectedness and function of biological neurons in the body.

    Correct answer
    D

    The interconnectedness and function of biological neurons in the body.

    Explanation

    The lecture states, 'neural networks inspired by the world of biology are sort of the inspiration for what is the state of the art.' It describes neurons as transmitting signals electrically, similar to how neural networks process information.

  23. 23

    In a simplified 3-neuron neural network predicting dot color, what do the A, B, and C parameters represent?

    1. A

      The X, Y coordinates of the input dots for training.

    2. B

      The total number of training data points used by the network.

    3. C

      The predicted color (blue or red) of the output dot.

    4. D

      Values that define the mathematical formula (line) separating colors.

    Correct answer
    D

    Values that define the mathematical formula (line) separating colors.

    Explanation

    The lecture explains that 'essentially we're trying to come up with 3 values, 3 parameters an A, a B, and a C. And what do those represent? Well, really just a solution to this formula that there line we drew can be represented if you think back to like high school math with a formula along these lines whereby it's ax x plus B times Y plus some constant C.'

  24. 24

    What is the primary role of 'attention' in Large Language Models (LLMs) like GPTs?

    1. A

      To filter out irrelevant information from the training dataset.

    2. B

      To randomly generate output words based on a broad vocabulary.

    3. C

      To identify relationships and importance between words in a sentence.

    4. D

      To assign numerical values to each word, converting them to vectors.

    Correct answer
    C

    To identify relationships and importance between words in a sentence.

    Explanation

    The text states, 'attention is calculated based on all of that data whereby in this picture the thicker lines imply more of a relationship between those two words.' This mechanism helps the AI understand the context and relevance of different words.

  25. 25

    What does it mean when an AI 'hallucinates'?

    1. A

      The AI is intentionally generating false information to mislead users.

    2. B

      The AI experiences a system error, causing it to shut down unexpectedly.

    3. C

      The AI is unable to process a complex query and returns an error message.

    4. D

      The AI produces an answer that is factually incorrect or made up.

    Correct answer
    D

    The AI produces an answer that is factually incorrect or made up.

    Explanation

    The lecture defines hallucinations as 'where the AI just makes something up perhaps because some crazy human on the internet made something up and it was interpreted as authoritative or just by bad luck because of a bit of that exploration... and spit out an answer that just in fact is not correct.'

Question 1 of 25
Question 1 of 25

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent