AP CSP Crunch Sheet
AP CSP Crunch Sheet
Metadata are Cleaning data is a Bias occurs due toSequential Computing: Each task is
data about data. process that makes the type of source of the
executed one at a time
Ex. Data is an data uniform without data being collected.
Parallel Computing: Breaks a
image and changing their
program up into sequential tasks and
metadata is the meaning. More data does NOT
location and Ex. Changing all the eliminate bias. runs them at the same time.
date the picture responses in a form Speedup: sequential time divided by
was taken. asking for height into parallel time
the same units Distributed Computer: Multiple
devices are used to run a program.
Data compression algorithms are often used to maximize storage space or to transmit data over the Internet,
but sometimes at a cost to the quality of the data.
Important Terms:
Lossless data compression algorithms can usually reduce the number of bits stored or transmitted
while guaranteeing complete reconstruction of the original data.
Lossy data compression algorithms can significantly reduce the number of bits stored or transmitted
but only allow reconstruction of an approximation of the original data.
Abstraction is the process of reducing complexity by focusing on the main idea.
A bit is a binary digit, either 0 or 1.
A byte is a sequence of 8 bits.
Roundoff error results when the number of bits is not enough to represent the number with full
precision (like using 3 digits to represent pi as 3.14).
Analog data are values that change smoothly, rather than in discrete intervals, over time. For
example, the pitch and volume of a live concert.
Binary (Base 2) to Decimal (Base 10) Decimal (Base 10) to Binary (Base 2)
©Goldie's Math Emporium
101110 48
48 2 = 24 R 0 110000
5 3
2 +2 +2 +2
2 1
24 2 = 12 R 0
32 + 8 + 4 + 2 12 2 = 6 R 0
46 62=3R0
32=1R1
12=0R1
Big Idea 3: Algorithms and Programming
On the AP Exam, you will be asked to determine the result or functionality of code. You will have your
reference sheet available to you. Read over the information below and also be familiar with the contents of
that reference sheet.
Variables
A variable is an abstraction inside a program that can hold a value. Each variable has associated data
storage that represents one value at a time, but that value can be a list or other collection that in turn
contains multiple values.
Data Abstraction
A list is an ordered sequence of elements. An element is an individual value in a list that is assigned a
unique index. An index referencing the position in a list, using natural numbers (in this class, index
starts at 1).
Mathematical Expressions
The order of operations used in mathematics applies when evaluating expressions. The MOD operator
has the same precedence as the * and / operators.
13 MOD 2 = 1 23 MOD 5 = 3
Boolean Expressions
A Boolean value is either true or false. Relational operators are used to test the relationship between
two variables or expressions.
Logical operators NOT, AND, and OR compare boolean expressions.
Truth tables are NOT on the AP exam, but can help you evaluate more complex expressions and logic
gates.
Truth Table:
A B A || B A && B !A !A || (A && B) B && (!A || B)
T T T T F T T
T F T F F F F
F T T F T T T
F F F F T T F
Searching Algorithms
Linear (sequential) search algorithm checks each element of a list, in order, until the desired value
is found or all elements in the list have been checked.
Binary search algorithm starts at the middle of a sorted data set and eliminates half of the data by
checking if the desired value falls above or below the middle value; this process repeat until the
desired value is found or all elements have been eliminated.
Binary search is often more efficient than linear search when applied to sorted data.
Calling Procedures
A procedure is a named group of programming instructions that may have parameters and return
values.
Procedural abstraction allows a solution to a large problem to be based on the solutions of smaller
subproblems. This is accomplished by creating procedures to solve each of the subproblems.
Algorithmic Efficiency
An algorithm’s efficiency is determined through formal or mathematical reasoning.
Algorithms with a polynomial efficiency or slower (constant, linear, square, cube, etc.) are said to run
in a reasonable amount of time. Algorithms with exponential or factorial efficiencies are examples of
algorithms that run in an unreasonable amount of time.
A heuristic is an approach to a problem that produces a solution that is not guaranteed to be optimal
but may be used when techniques that are guaranteed to always find an optimal solution are
impractical