jesus_barrios_ap_computer_science_principles_study_guide
Create Task: Tips and Resources
- General Purpose: The Create Task assesses the ability to develop functional software, focusing on practical programming skills rather than high-level theory.
- Mandatory Requirements:
* User Input and Output: The application must include mechanisms for user interaction.
* Data Storage: The implementation of a list or array to store multiple data items is required.
* Function with Parameters: Developers must create at least one function that accepts parameters and utilizes iteration (loops) and conditional checks.
- Recommended Project: A simple calculator is suggested for students seeking a straightforward path to meeting criteria.
- Essential Elements for Success:
* User Interface (UI): Clear fields for input and output to enhance usability.
* Data Management: Use of an array or list to manage application data.
* Procedural Logic: A function with parameters containing a loop (e.g., a
for loop) to iterate through data and if/else statements to handle logic based on that data. - Personal Application Example: "Jumping Game":
* Developed by: Jesus Barrios (2023-2024).
* Functionality: A dog jumps in response to arrow keys, the space bar, or mouse clicks.
* Language: Coded in JavaScript.
* Features: Visual representation of jumps, score display, and an array to store scores. A specific procedure determines and displays the highest score.
- Code Submission Tools: The Code Print Tool (
https://bakerfranke.github.io/codePrint/) is recommended for converting code to PDF.
* Benefits: Color-coding for readability, line numbering for referencing, and highlighting to mark sections meeting specific AP criteria. - Academic Integrity and Citations:
* External Attribution: Images or code snippets not created by the student require a citation including Title, Author, Source Name, Date of Access, and URL.
* Syntax Example:
/* Citation/Reference: [Title] By [Author] Accessed from [Source Name] on [Date], URL: [URL] */.
* Collaboration/AI Attribution: Interaction with peers or AI must be acknowledged in comments. Example: /* Citation/Reference: Artificial Intelligence was used to assist in optimizing this function... */. - Generative AI Guidelines:
* Allowable Use: Supplemental aid for understanding principles, developing code, and debugging.
* Responsibilities: Students must verify accuracy (AI may introduce bias or errors) and must be able to explain all co-developed code during the exam.
- Acceptable Languages: Alice, App Inventor, App Lab (Code.org), EarSketch, Greenfoot, Java, JavaScript, LEGO Mindstorms EV3, Microsoft MakeCode, Processing, Python, Quorum, Scratch, Snap!, Swift, and TI-Basic.
* Limitation: HTML alone is insufficient as it lacks programming logic; it must be paired with JavaScript.
Big Idea 1: Creative Development
- Computing Innovations: Constantly evolving tools driven by human creativity to solve societal challenges.
* Examples: Crime prevention (data mapping/biometrics), Healthcare (data analytics for insurance), Engineering/Communications, and The Arts (media blending).
- Impact on Other Fields: Computing allows for modeling real-world scenarios and outcome prediction through variable analysis.
- Hardware vs. Software:
* Hardware: Physical components (CPUs, hard drives, GPUs, motherboards, circuits, keyboards).
* Software: Instructions commanding the hardware (Operating systems, Web browsers, Database systems).
- Moore’s Law: The observation that the number of transistors on a microchip doubles approximately every two years, while the cost is halved. This allowed computers to shrink from 50-ton, 1,000-square-foot machines to pocket-sized devices.
- Collaboration in Computing:
* Value: Pools diverse perspectives to avoid personal bias. Example: Engineers collaborating with cardiologists on a heart health app to ensure medical accuracy.
* Benefits: Skill enhancement (pairing strengths/weaknesses), efficiency (faster problem-solving), and resource sharing.
* Remote Tools: Zoom, Slack, and Google Docs enable global collaboration.
- Program Functions: A program is a collection of statements. Example: Inputting the number 3, the program processes whether it is even/odd and outputs "odd."
- Code Segments: Collections of statements performing specific tasks. Example:
*
number ← 5 (Input)
* square ← number * number (Process)
* DISPLAY(square) (Output) - Abstraction: Hiding underlying complexity so users focus on functionality. Example: A smart home system adjusting lights based on sensor input without the user knowing the sensor’s code.
- The Development Process:
* Iterative: A cyclic process involving Investigating/Reflecting, Designing, Prototyping, and Testing. If testing reveals issues, developers return to previous phases.
* Incremental: Breaking a project into small, manageable parts (e.g., building a login page, then a shopping cart, then payment processing).
- Documentation Support:
* Purpose: Serves as a memory aid, supports collaboration, and facilitates maintenance.
* Methods: In-code comments (non-executable text such as
//This is a comment) and external documents (Requirement specifications, user manuals). - Programming Errors:
* Logic Error: Flaw in the algorithm causing unintended results.
* Syntax Error: Violation of the language's grammatical rules, preventing compilation.
* Runtime Error: Error during execution (e.g., division by zero, invalid array indices).
Big Idea 2: Data
- Data Representation:
* Bit: Smallest unit (0 or 1).
* Byte: 8 bits.
* Binary Sequences: Can represent colors (e.g., 24 bits total, 8 bits each for Red, Green, and Blue), Boolean logic (True/False), and lists.
- Analog vs. Digital:
* Analog: Continuous signals (pitch/volume of music, colors in a painting, sprinter's position).
* Digital: Discrete steps created by sampling analog signals at regular intervals. Higher sampling rates increase accuracy.
- Data Types:
* Integer: Whole numbers (e.g.,
let age = 30;).
* Real Numbers (Floats): Decimals (e.g., let height = 5.9;).
* Boolean: True/False (e.g., let isAdult = true;).
* List (Array): Ordered collection (e.g., ['red', 'green', 'blue']). - Math and Bit Limits:
* Fixed Bit Representation: Limits the range of integers. If a number exceeds this, an Overflow Error occurs (wrapping to negative).
* Calculations: Combinations=2n and Maximum Value=2n−1. An 8-bit system has 256 combinations and a max value of 255.
- Number System Conversions:
* Binary to Decimal: Assign powers of 2 right to left (20=1,21=2,22=4, etc.). Sum positions with a 1. Example: 11110=16+8+4+2=30.
* Decimal to Binary: Find the largest power of 2 that fits in the decimal and subtract, placing 1s in relevant positions.
- Errors in Data:
* Roundoff Errors: Discrepancies occurring when real numbers (like 1/3) are approximated because the computer cannot store infinite digits.
- Data Compression:
* Lossy: Reduces size by removing information. Used for streaming and JPEGs where file size is more important than perfect quality.
* Lossless: Reduces size without losing data. Essential for ZIP files and legal/scientific documents.
- Data Processing and Insights:
* Skills Needed: Statistics, Mathematics, Programming, and Problem Solving.
* Challenges: Misinterpreting trends (correlation is not causation), data uniformity (abbreviations/spelling differences require "Data Cleaning"), and processing massive "Big Data" sets (bias, sample representativeness).
- Strategic Usage: Credit card fraud flagging, targeted social media ads based on viewing habits, and curated entertainment recommendations.
- Visualization Types: Column/Bar charts (comparisons), Line graphs (trends), Pie charts (proportions), Radar charts (multi-variable comparison), and Histograms (numerical distribution).
- Privacy and Metadata:
* Metadata: Data about data (e.g., geolocation and timestamps on a photo). Altering metadata does not affect primary data.
* PII (Personally Identifiable Information): Names, SSNs, and biometric records used to uniquely identify individuals.
Big Idea 3: Programming and Algorithms
- Abstractions in Code:
* Procedural Abstraction: Grouping code into named procedures (like
DISPLAY(expression) or RANDOM(a, b)) to improve reusability and hide complexity.
* Data Abstraction: Using Lists to group related items as a single entity, simplifying operations like sorting or searching. - Mathematical and Relational Operators:
*
+, -, *, /: Standard arithmetic.
* MOD: Modulus (remainder). 26 MOD 2=0; 3 MOD 4=3. n MOD 0 is an error.
* Relational: =, <, >, <=, >= (Result is always a Boolean true or false).
* PEMDAS: Parentheses, Exponents, Multiplication/Division/Modulus, Addition/Subtraction. - Probability in Programming:
* Single Event: Likelihood of
a = 3 in selection (1,2,3,4) is 1/4 (25%\text{ chance}).
* Multiple Outcomes: Likelihood of a <= 3 in selection (1..10) is 3/10 (30%\text{ chance}). - List Manipulations:
* Indexing: AP lists start at index 1. Accessing a non-existent index results in an Index Out of Bounds error and terminates the program.
*
INSERT(list, i, item): Adds at index i and shifts existing elements to the right.
* APPEND(list, item): Adds to the end of the list.
* REMOVE(list, i): Deletes the element at index i and shifts subsequent elements to the left. - Control Flow (Logic and Loops):
* Conditionals:
IF/ELSE structures using logical operators like AND (&&) and OR (||).
* Loop Types:
1. REPEAT n TIMES: Fixed iteration.
2. REPEAT UNTIL(condition): Stops only when the condition is true (opposite of a standard while loop).
3. FOR EACH item IN list: Sequential traversal without manual indexing.
4. Counter-Controlled: Manually incrementing an index from 1 to LENGTH(list). - Critical Algorithms:
* Sum/Average: Initialize
sum ← 0, iterate and add item, then divide by LENGTH(list) for the average.
* Maximum/Minimum: Initialize max ← list[1]. Compare each item. If item > max, update max. (Warning: Initializing max to 0 fails for negative lists).
* Linear Search: Checks each element sequentially. Best case is 1 comparison; worst case is n comparisons.
* Binary Search: Requires a sorted list. Repeatedly divides the search interval in half. More efficient for large datasets.
* Swapping: Requires a temporary variable (temp ← A; A ← B; B ← temp). - Robot Simulation:
*
MOVE_FORWARD(), ROTATE_LEFT() (90∘ counterclockwise), CAN_MOVE(direction).
* Used to predict landing spots on a grid. In scenarios with random inputs (e.g., rotating 1-3 times), students must calculate all possible end coordinates. - Flowcharts: Oval (Start/End), Rectangle (Process/Instruction), Diamond (Decision/Condition), Parallelogram (Input/Output).
- Algorithmic Efficiency:
* Polynomial Efficiency: Constant, linear, or square; considered efficient/reasonable time.
* Exponential/Factorial Efficiency: Generally too slow for large datasets.
* Heuristics: A "good enough" solution when finding an optimal one is impractical.
- Libraries and APIs: Software libraries (like Python's
numpy) provide pre-tested code. APIs (Application Programming Interfaces) define how those library components can be used (e.g., Twitter API for tweet data).
Big Idea 4: Computer Systems and Network
- Definitions and Infrastructure:
* Computing System: Multiple devices working together.
* Network: Interconnected devices sharing data via fiber optic cables or radio transmitters.
* Bandwidth: Maximum data transfer rate.
* Path/Routing: Data follows a sequence of connected devices. The system is Fault-Tolerant; if a path breaks, routing algorithms find an alternative.
- Protocols:
* IP (Internet Protocol): Assigns unique addresses to every device.
* IPv4 vs. IPv6: IPv4 (32-bit) has 4.29 billion addresses; IPv6 (128-bit) supports 3.4×1038 addresses. IPv6 offers 296 times more addresses than IPv4.
* TCP (Transmission Control Protocol): Connection-oriented, ensures packet delivery through sequencing/retransmission. Best for accuracy (email/web).
* UDP (User Datagram Protocol): Connectionless and fast; does not guarantee delivery. Best for speed (streaming/gaming).
- WWW vs. Internet: The Internet is global hardware; the World Wide Web is a service on the internet using the HTTP protocol.
- Computing Models:
* Sequential: Tasks happen one after another. Time is the sum of all steps.
* Parallel: Tasks happen simultaneously. Time is determined by the longest sub-task.
* Speedup: Determined by the formula Sequential Run Time/Parallel Run Time.
* Distributed Computing: Problems are divided across multiple devices (nodes) in different locations to achieve scalability and flexibility.
Big Idea 5: Impact of Computing
- Digital Divide: Disparities in technology access caused by Infrastructure, Education (digital literacy), Cost, and Indifference.
- Dual Nature of Innovation: GPS improves efficiency/safety but enables unauthorized surveillance.
- Bias: Human-created algorithms reflect the biases of creators. Mitigated through diverse teams and continuous bias testing/monitoring.
- Collaboration and Openness:
* Crowdsourcing: Gathering ideas from the public (Netflix Prize, Lego Ideas).
* Citizen Science: Public participation in research using their devices (Folding@Home, Galaxy Zoo).
* Open Access: Research outputs made freely available online.
* Creative Commons: Licenses allowing authors to specify how others can share/remix their work.
* Open Source: Software that is freely modified/redistributed (Firefox, OpenOffice).
- Authentication and Security:
* MFA (Multi-Factor Authentication): Requires Knowledge (Password), Possession (Phone), or Inherence (Biometrics).
* Digital Certificates: Used to validate owner identity in encrypted communications; issued by Certificate Authorities (CAs).
- Encryption:
* Symmetric: Uses the same key for encryption/decryption (e.g., AES).
* Asymmetric (Public Key): Uses a public key to encrypt and a private key to decrypt (e.g., RSA).
- Cybersecurity Threats:
* Malware: Malicious software like viruses (replicating programs), worms, and ransomware.
* Phishing: Masquerading as a trustworthy source to trick users into providing data.
* Keylogging: Recording keystrokes to steal passwords.
* Rogue Access Points: Unauthorized wireless points used to intercept network data.