CSP Lesson Notes
1. Beneficial & Harmful Effects of Computing
- Beneficial Examples
- Automated telephone trees: cuts hold times, saves businesses money
- Medical tech: MRI, DNA sequencing → faster diagnoses, vaccine development
- Access to education: online encyclopedias, e‑books, search engines
- Harmful Examples
- Cyberbullying & scams: kids exposed to grooming or fraud
- Social media: mental‑health impacts, risky “challenges” (e.g. blackout challenge)
- Autonomous systems dilemmas: trolley‑problem trade‑offs in self‑driving cars
- Neutral/Debatable
- AI: boosts productivity & data analysis vs. carbon footprint, academic dishonesty, deepfakes
- Drones/UAVs: search‑and‑rescue & agriculture vs. privacy invasion, crashes, military abuse
- Gene editing: cures genetic diseases & improves crops vs. ethical/genetic risks
2. The Digital Divide
- Why it exists: economic, geographic, societal factors
- Impacts:
- Education: online assignments vs. lower performance
- Employment: remote‑work opportunities vs. reduced job access
- Healthcare: telemedicine vs. poorer outcomes
- Civic engagement: e‑government vs. isolation
- Bridging solutions:
- Infrastructure in underserved areas
- Subsidized devices & internet
- Inclusive tech design
- Policy for digital equity
3. Computing Bias
- What is it? algorithms or data that unfairly favor/disadvantage groups
- Sources
- Data bias: unrepresentative or flawed training data
- Algorithmic bias: faulty system logic
- Cognitive bias: human prejudice in data labeling
- Types
- Explicit data (user‑provided) vs. Implicit data (inferred behavior)
- Intentional (deliberate unfairness) vs. Unintentional (oversights)
- Mitigation phases
- Pre‑processing: diversify and clean data
- In‑processing: adjust during training (e.g. synthetic samples)
- Post‑processing: monitor and correct outputs
4. Crowdsourcing & Distributed Computing
- Crowdsourcing types
- Crowdfunding (Kickstarter)
- Crowd creation (Wikipedia, Threadless)
- Crowd voting (Reddit upvotes)
- Crowd wisdom (prediction markets)
- Data crowdsourcing: Wikipedia edits, traffic reports (Waze), Mechanical Turk
- Distributed computing examples: SETI@home, Bitcoin mining, cloud services (AWS)
- Benefits & challenges: diversity & scale vs. quality control, privacy, coordination
5. Legal & Ethical Concerns in CS
- Intellectual Property
- Copyright, patents, trademarks, trade secrets
License | Permissions | Restrictions | Best Use |
---|---|---|---|
MIT | Free to use, modify, distribute (with credit) | No liability/warranty | Great for small projects, web tools |
Apache 2.0 | Same as MIT + patent protection | Must include license/notice | Corporate/open-source APIs |
GPL (General Public License) | Free use, but derivatives must stay open-source | Cannot make proprietary forks | Nonprofits, community software |
BSD 3-Clause | Use freely (even in closed-source), must not misrepresent authorship | No warranty | Academic tools, closed-source apps |
Creative Commons (CC0, CC-BY) | Mostly for non-code works (e.g., docs, images) | Some versions require attribution | Artwork, documentation |
- Ethical issues
- Plagiarism vs. proper attribution
- Commercial exploitation of open‑source
- Respecting author intent & license terms
6. Safe Computing
- PII (Personally Identifiable Information): SSNs, emails, driver’s licenses
- Cookies: session vs. persistent; first‑party vs. third‑party
- Passwords: length, case, digits, specials
- Encryption
- Symmetric (AES) vs. Asymmetric (RSA) vs. Hashing (SHA‑256)
- Phishing: email, website spoofing, smishing; always verify URLs & senders
- Verification: MFA, digital signatures, CAPTCHA
7. Binary Search Algorithm
- Binary vs. Linear Search
- Requires sorted list; cuts search space in half → O(log n)
- Linear is O(n), but works unsorted
- Steps
- Compare target to middle element
- Recurse on left or right half
- Stop when found or bounds cross
- Real‑world uses: dictionaries, databases, search indices
8. Lists & Filtering Algorithms
- Lists: ordered, mutable collections (e.g. shopping cart, email inbox)
- Common operations: append, insert, remove, pop, slice, sort, reverse, len
- Traversal:
for item in list:
→ process each element - Filtering: loop + condition → build new list of matches (e.g. even numbers)
- Applications: database query filters, search‑as‑you‑type
9. Random Number Generation
- Purpose: simulations, games, security, testing
- Function:
random(a, b)
→ uniform integer in [a, b] - Use cases: cryptography (non‑predictable), Monte Carlo methods, randomized algorithms
10. Big O & Algorithmic Efficiency
- Why Efficiency Matters
- Faster user experiences, lower resource use, and better scalability.
- Crucial on mobile or high‑load servers; every ms and MB counts.
- Big O Notation
- Describes how time/space grows with input size.
- Focuses on worst‑case, ignores constants (e.g., O(n + 5) → O(n)).
- Common classes:
- O(1): constant (e.g., array lookup)
- O(log n): logarithmic (binary search)
- O(n): linear (simple loops)
- O(n log n): linearithmic (merge sort, quicksort)
- O(n²): quadratic (bubble sort)