AP Exam Review Notes

AP Exam Review

AP Exam Structure

  • Section I:
    • Multiple-choice questions: 70 questions, 70% weighting, 120 minutes.
      • Single-select: 57 questions.
      • Single-select with reading passage about a computing innovation: 5 questions.
      • Multi-select: 8 questions.
  • Section II:
    • Create Performance Task: 30% weighting.
      • Program code, video, and Personalized Project Reference.
      • Written response questions related to the Create performance task: 2 questions.
      • At least 9 hours in class.
      • 60 minutes End-of-course AP Exam.

Topics and Big Ideas

The AP Multiple Choice end-of-year exam covers 5 Big Ideas:

  • Big Idea 1: Creative Development: 10-13% Exam Weighting
  • Big Idea 2: Data: 17-22% Exam Weighting
  • Big Idea 3: Algorithms and Programming: 30-35% Exam Weighting
  • Big Idea 4: Computer Systems and Networks: 11-15% Exam Weighting
  • Big Idea 5: Impact of Computing: 21-26% Exam Weighting

Big Idea 1: Creative Development

  • 1.1 Collaboration
    • 1. C Explain how collaboration affects the development of a solution.
    • 2. A Collaborate in the development of solutions (not assessed).
  • 1.2 Program Function and Purpose
    • 1. A Investigate the situation, context, or task.
    • 2. A Generalize data sources through variables.
    • 3. A Explain how a code segment or program functions.
  • 1.3 Program Design and Development
    • 1. B Determine and design an appropriate method or approach to achieve the purpose.
    • 2. C Explain how collaboration affects the development of a solution.
    • 3. A Explain how a code segment or program functions.
    • 4. C Acknowledge the intellectual property of others (not assessed).
  • 1.4 Identifying and Correcting Errors
    • 1. B Determine and design an appropriate method or approach to achieve the purpose.
    • 2. C Identify and correct errors in algorithms and programs, including error discovery through testing.

Big Idea 1: Computing Innovation

  • A computing innovation includes a program as an integral part of its function.
  • A computing innovation can be physical (e.g., self-driving car), nonphysical computing software (e.g., picture editing software), or a nonphysical computing concept (e.g., e-commerce).
  • Hardware is the physical components of a computing device, while software is the instructions in a programming language to the computing device.
  • A computing innovation can have hardware components; however, the computing innovation is about the software, not the hardware.

Big Idea 1: Computing Hardware and Moore's Law

  • Computing hardware has gotten smaller and more powerful over the years.
  • Moore’s law predicts that the size of transistors halves every two years while the cost also halves every two years.
  • Computers went from taking up 1,800 square feet and weighing almost 50 tons to being able to fit in your pocket.

Big Idea 1: Program Function and Purpose

  • The function of a program is how a program behaves during execution and is usually described by how the user interacts with it.
  • The purpose of a program is the goal or the motivation for writing a program.
    • One purpose is to solve problems or to pursue interests through creative expression or to provide entertainment (e.g., write a game).
  • An understanding of the purpose of a computing innovation provides developers with an improved ability to develop that program or computing innovation.
  • A program’s specification defines the requirements for the program.
  • Program requirements describe how a program functions and may include a description of user interactions that a program must provide.

Big Idea 1: Collaboration

  • Collaboration helps people learn from each other.
  • Collaboration that includes diverse perspectives helps to avoid bias in the development of computing innovations.
    • For example, if females play video games at the same percentage as males, a game company might not avoid bias if it employed males to write the code for the games. Bringing in female coders could bring additional perspectives that might not have been achieved otherwise.
  • Programming companies often hire people who not only are good programmers but also have interpersonal skills needed to collaborate effectively.
  • Effective collaboration can help one gain insight and knowledge by applying multiple perspectives, experiences, and skill sets.

Big Idea 1: Collaboration Skills

  • Collaboration is a learned skill that includes but is not limited to:
    • Communication
    • Consensus building
    • Conflict resolution
    • Negotiation
  • Collaboration with others can make the programmer more self-aware.
  • Group programming can match up your weaknesses with someone else’s strengths, which results in a better product and leads to insight and knowledge not obtainable when working alone.

Big Idea 1: Online Collaboration and Programs

  • Collaboration is not limited by location.
  • Current computing tools allow people in different physical locations to share data.
  • Online collaboration tools, such as Google Docs, Zoom, Slack, Yammer, and dozens of other tools, allow programmers to collaborate from home or from anywhere that has internet access.
  • A program is a collection of program statements that performs a specific task when run by a computer. A program is often referred to as software.
  • A code segment refers to a collection of program statements that are part of a program.

Big Idea 1: Development Processes

  • A development process can be ordered and intentional or exploratory in nature.
  • A development process that is incremental is one that breaks the problem into smaller pieces and makes sure each piece works before adding it to the whole.
  • A development process that is iterative requires refinement and revision based on feedback, testing, or reflection throughout the process. This may require revisiting earlier phases of the process.

Big Idea 1: Program Design

  • The design of a program incorporates investigations to determine its requirements.
  • Most programs are designed to be used by people other than the programmers.
  • To meet the needs of the users, the investigation must identify the program constraints as well as the concerns and interests of people who will use the program.
  • Some ways investigations can be performed are as follows:
    • Collecting data through surveys
    • User testing
    • Interviews
    • Direct observations

Big Idea 1: Design Phase and Documentation

  • The design phase of a program may include:
    • Brainstorming
    • Planning and storyboarding
    • Organizing the program into modules and functional components
    • Creating diagrams that represent the layouts of the user interface
    • Developing a testing strategy for the program
  • Program documentation is a written description of the function of a code segment, event, procedure, or program and how it was developed.
  • Program documentation helps in developing and maintaining correct programs when working individually or in collaborative programming environments.

Big Idea 1: Program Documentation and Comments

  • Programmers should document a program throughout its development.
  • Documentation helps the programmer remember what he or she was thinking or the collaborative partners were thinking at the time they were programming.
  • Comments are a form of program documentation written into the program that do not affect how the program runs. Comments do not affect the run speed of a program. Python, for example, uses # for comments.

Big Idea 1: Types of Program Errors

Three types of program errors can occur:

  • Logic error—This is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly (incorrect implementation of algorithm)
  • Syntax error—This is a mistake in the program where the rules of the programming language are not followed (missing parenthesis, incorrect indentation, misspelling name of function calls)
  • Runtime error—This is a mistake in the program that occurs during the execution of a program. Programming languages define their own runtime errors (divide by 0, accessing out-of-bounds index of a list)

Big Idea 1: Finding and Correcting Errors

The following are effective ways to find and correct errors:

  • test cases
  • hand tracing
  • visualizations
  • debuggers
  • adding extra output statement(s)

Big Idea 1: Program Input and Events

  • Program input is data sent to a computer for processing by a program.
  • Input can come in a variety of forms, such as tactile, audio, visual, or text.
    • For example, a cell phone can convert voice (audio) to text to send a message.
  • This triggering is called an event. The event is the action that supplies input data to a program.
  • Events can be generated when a key is pressed, a mouse is clicked, a program is started, or by any other defined action that affects the flow of execution.

Big Idea 1: Program Output

  • Program outputs are any data sent from a program to a device.
  • Program output can come in a variety of forms, such as tactile, audio, visual, or text.
  • Program output is usually based on a program’s input or prior state (e.g., internal values).

Big Idea 1: Logic Error Example

  • Read the code below. Assume that myList is a nonempty list of numbers. Identify the error. What kind of error is it?
  • Logic Error. The code adds the first number twice in the sum.

Big Idea 2: Data

  • 2.1 Binary Numbers
    • 1. D Evaluate solution options.
    • 2. B Implement and apply an algorithm.
    • 3. C Explain how abstraction manages complexity.
  • 2.2 Data Compression
    • 1. D Evaluate solution options.
  • 2.3 Extracting Information from Data
    • 1. B Explain how knowledge can be generated from data.
    • 2. D Describe the impact of gathering data.
  • 2.4 Using Programs with Data
    • 1. B Implement and apply an algorithm.
    • 2. B Explain how knowledge can be generated from data.

Big Idea 2: Data Representation

  • Data values can be stored in variables, lists of items, or standalone constants and can be passed as input to (or output from) procedures.
  • Computing devices represent data digitally, meaning that the lowest-level components of any value are bits.
  • A bit is shorthand for a single binary digit and is either 0 or 1. A byte is 8 bits.
  • For example, the binary sequence 01101111 contains 8 bits or 1 byte.
  • Binary sequences can be used to represent all digital data.
  • Binary sequences can represent colors, Boolean logic, lists, and so on. Anything that can be stored on a computer can be represented by binary sequences.

Big Idea 2: Data Abstraction

  • Abstraction is the process of reducing complexity by focusing on the main idea.
  • By hiding details irrelevant to the question at hand and bringing together related and useful details, abstraction reduces complexity and allows one to focus on the idea.
  • Bits are grouped to represent abstractions. These abstractions include, but are not limited to, numbers, characters, and color.
  • Some data take many bits to represent it. For example, a single 10 MP (1 MP is one million pixels) picture uses 10,000,000 pixels.
  • Each pixel (24-bit mode RGB) contains 243=7224 * 3 = 72 bits = 9 bytes. That means there are 72<br/>bits10,000,000=720,000,00072 <br />\newline bits * 10,000,000 = 720,000,000 bits in a single 10 MP (24-bit mode) picture.

Big Idea 2: Digital vs. Analog

  • Many physical phenomena can be modeled by analog signal(sound, colors, temperature).
  • Analog signals are continuous signals.
  • Computers can only understand digital signals (discrete or finite signal(0s and 1s).)
  • analog signals are continuous and can take on an infinite possible values(the real numbers)
  • digital signals are finite.
  • For example, 8 bit colors can take on one of 256 discrete, finite possibilities. But actual colors can take on any of an infinite possible values or shades.
  • Sampling allow computers to approximate analog signals such as sound.
  • The number of samples is the sampling rate, the higher the rate the better the quality.

Big Idea 2: Integer Representation and Limits

  • In many programming languages, integers are represented by a fixed number of bits, which limit the range of integer values and mathematical operations on those values.
  • For example in JAVA, the range of the value of an integer is from 2,147,483,648-2,147,483,648 to +2,147,483,647+2,147,483,647.
    *Trying to store a number bigger than the limits will result in an overflow error.
  • Some languages like Python, integers do not have limits on number size but, instead, expand to the limit of the available memory.

Big Idea 2: Integer Overflow Examples

  • Example 1: With 4 bits, the largest integer that can be stored is 241=152^4-1 = 15.
  • Example 2: A 4-bit integer can any value in {0,1,2,..,15}. Thus storing the value of 10+6=1610 + 6 = 16 would cause an overflow error since the 16=1000016 = 10000 requires at least 5 bits.
  • Example 3: If x is a 3-bit integer, then x=111+111x = 111 + 111 will cause an overflow error since the sum is 1110 which requires at least 4 bits.

Big Idea 2: Roundoff Error with Decimals

  • 1/31/3 does not always equal 1/31/3.
  • A roundoff error occurs when decimals (real numbers) are rounded.
  • One computer might calculate 1/31/3 as 0.333333. Another computer might calculate 1/31/3 as 0.3333333333. In this case, 1/31/3 on one computer is not equal to 1/31/3 on a second computer.

Big Idea 2: Number Bases

  • Number bases, including binary, decimal, and hexadecimal, are used to represent and investigate digital data.
  • On your AP exam, you will be expected to convert binary to decimal and decimal to binary only.

Big Idea 2: Example Base Conversions

  • There is one 16 in 30.
  • What is left is 3016=1430 – 16 = 14.
  • There is one 8 in 14 so:
  • 148=614 – 8 = 6
  • There is one 4 in 6 so: 64=26 – 4 = 2.
  • And there is a 2 in 2 so: 22=02 – 2 = 0.

Big Idea 2: Information Extracted from Data

  • People generate significant amounts of digital data daily.
  • Some always-on devices are collecting geographic location data constantly, while social media sites are collecting premium data based on your usage.
  • People can use computer programs to process information as well as to gain insight and knowledge.
  • Information is the collection of facts and patterns extracted from data.
  • Gaining insight from this valuable data involves a combination of statistics, mathematics, programming, and problem-solving.

Big Idea 2: Large Data Sets and Trends

  • Large data sets may be analyzed computationally to reveal patterns, trends, and associations.
  • These trends are powerful predictors of future behaviors. Investors are constantly reviewing trends in past pricing to influence their future investment decisions.
  • However, sometimes trends can be misinterpreted and result in business disasters.
  • Digitally processed data may show correlation between variables.
  • A correlation found in data does not necessarily indicate that a causal relationship exists. Additional research is needed to understand the exact nature of the relationship.

Big Idea 2: Non-Uniform Data and Cleaning

  • Depending on how the data were collected, the information may not be uniform.
  • For example, if users entered data into an open field, the way they chose to abbreviate, spell, or capitalize something may vary from user to user.
  • Data sets pose challenges regardless of size, such as:
    • The need to clean data
    • Incomplete data
    • Invalid data
    • The need to combine data sources
  • Cleaning data is a process that makes the data uniform without changing their meaning.
  • One example is replacing all equivalent abbreviations with the same word. This can also be done with various spellings and with different capitalizations.

Big Idea 2: Big Data Challenges

  • Data can get too large for traditional data-processing applications.
  • The ability to process data depends on the capabilities of the users and their tools. Social media activity generates an enormous amount of data.
  • Some data sets are difficult to process using a single computer and may require parallel systems.
  • Problems of bias are often created by the types and sources of data being collected. Bias is not eliminated by simply collecting more data. A large amount of data is generated by humans. Algorithms that use this data will reflect this bias.
  • Despite the advantages of big data, a large sample size can magnify the bias associated with the data being used. Data can have little value if the sample is not representative of the population to which the results will be generalized.

Big Idea 2: Predictive Algorithms and Big Data

Predicting algorithms use information collected from big data to influence our daily lives. For example:

  • A credit card company can use purchasing patterns to identify when to extend credit or flag a purchase for possible fraud.
  • Social media sites can use patterns to target advertising based on viewing habits.
  • An online store analyzing customers’ past purchases can suggest new products the customer may be interested in buying.
  • An entertainment application may recommend an additional movie to watch based on the viewer’s interests.

Big Idea 2: Data Visualization

  • Using appropriate visualizations when presenting digitally processed data can help one gain insight and knowledge.
  • Although big data is a powerful tool, the data will lose their value if they cannot be presented in a way that can be interpreted.
  • Visualization tools can communicate information about data.
  • Column charts, line graphs, pie charts, bar charts, XY charts, radar charts, histograms, and waterfall charts can make complex data easier to interpret.
  • Python's pandas library can be used to explore, process and visualize data. See the optional lecture slides "pandas for Tabular data". Python's pandas library is a powerful alternative to Excel.

Big Idea 2: Privacy Concerns

  • Privacy concerns arise through the mass collection of data.
  • The content of the data may contain personal information and can affect the choice in storage and transmitting.
  • Anything done online is likely to lead to sharing of private data.
  • Using Gmail to order a pair of shoes from Clarks could result in ads for shoes showing up in your search engine.

Big Idea 2: Metadata

  • Metadata are data that describe your data—for example, a picture of you standing in front of a waterfall is data. The location and time the picture was taken are metadata.
  • Metadata are used for finding, organizing, and managing information.
  • Metadata can increase the effective use of data or data sets by providing additional information about various aspects of that data.
  • Changes and deletions made to metadata do not change the primary data.

Big Idea 3: Programming and Algorithms

  • The AP exam will use a language-agnostic syntax for programming and algorithm questions.
  • Please see the following reference sheet(also available during the actual exam) for more details about the syntax. https://apcentral.collegeboard.org/pdf/ap-computer-science-principles-exam-reference-sheet.pdf

Big Idea 3: Abstraction in Computer Science

  • In computer science, an abstraction is a way to represent essential features without including the background details or explanations.
  • Abstractions reduce complexity and allow for efficient design and implementation of complex software systems.
  • Abstractions become a necessity as systems become more complex. For example, anytime you check your stories on Instagram, you are using a bunch of processes in the background that you have no control over.
  • Without these abstractions, it would be difficult to send a message to a friend. With the use of abstractions, you can focus on content, not the technical details of how the application works.

Big Idea 3: Abstraction for Programmers

  • Programmers also use abstractions. The purpose of abstraction is to hide coding details so the programmer can focus on the current problem.
  • Computers can understand only binary machine code. Machine code is a strictly numerical language that runs fast but is hard to use.
  • The code on the right is written in machine code to outputs "Hello World" to the screen. In Python it can be done using the print() procedural(functional) abstraction: `print(