Lesson Date: 2024-06-23
-
PB&J
-
History of Computer Science
- Computer science has roots that are hundreds or even thousands of years old. Khan Academy: History of Computing
- Definition of a computer: something that computes. Simple Wikipedia: Computer
- Early computers include the abacus. Wikipedia: Abacus
-
Algorithms
- Definition: A series of steps or instructions to accomplish a task. Simple Wikipedia: Algorithm
- Examples of real-life algorithms:
- Maps with turn-by-turn driving directions.
- Recipes for baking cookies.
- What would happen if you followed the instructions, but out of order?
-
Modern Computers
- Emerged in the 1960s-1970s. Khan Academy: Modern Computers
- Key invention: transistor. Wikipedia: Transistor
- Transistor: An element with three wires that can allow high or low voltage to pass a signal through.
-
Early Communication
- Methods: smoke signals, Morse code. Simple Wikipedia: Smoke Signal, Simple Wikipedia: Morse Code
-
Counting and Number Systems
- Arabic numbers, decimal system (base 10). Simple Wikipedia: Decimal
- Humans have 10 fingers and toes, hence base 10.
- Digits explained.
- For example, the number 1492 can be broken down as follows:
- (1 \times 10^3 = 1000)
- (4 \times 10^2 = 400)
- (9 \times 10^1 = 90)
- (2 \times 10^0 = 2)
- Adding these together, (1000 + 400 + 90 + 2 = 1492).
- For example, the number 1492 can be broken down as follows:
-
Binary System
- Binary digits (bits): Can be 0 or 1. Simple Wikipedia: Binary
- With one hand, you can count up to 31 (32 values including 0).
- Binary example:
- The binary number
1101
can be broken down as follows:- (1 \times 2^3 = 8)
- (1 \times 2^2 = 4)
- (0 \times 2^1 = 0)
- (1 \times 2^0 = 1)
- Adding these together, (8 + 4 + 0 + 1 = 13).
- The binary number
-
Powers of Two
- Here are the powers of two from (2^1) to (2^{32}):
- (2^1 = 2)
- (2^2 = 4)
- (2^3 = 8)
- (2^4 = 16)
- (2^5 = 32)
- (2^6 = 64)
- (2^7 = 128)
- (2^8 = 256)
- (2^9 = 512)
- (2^{10} = 1024)
- (2^{11} = 2048)
- (2^{12} = 4096)
- (2^{13} = 8192)
- (2^{14} = 16384)
- (2^{15} = 32768)
- (2^{16} = 65536)
- (2^{17} = 131072)
- (2^{18} = 262144)
- (2^{19} = 524288)
- (2^{20} = 1048576)
- (2^{21} = 2097152)
- (2^{22} = 4194304)
- (2^{23} = 8388608)
- (2^{24} = 16777216)
- (2^{25} = 33554432)
- (2^{26} = 67108864)
- (2^{27} = 134217728)
- (2^{28} = 268435456)
- (2^{29} = 536870912)
- (2^{30} = 1073741824)
- (2^{31} = 2147483648)
- (2^{32} = 4294967296)
- Here are the powers of two from (2^1) to (2^{32}):
-
Story of Chess
- The inventor asked for 1 grain of rice, doubled each day for each square on a chessboard.
-
Computer Architectures
- 8-bit, 16-bit, 32-bit, 64-bit. Wikipedia: Computer Architecture
- Number of values that can be represented by 64 bits.
-
Early Gaming Systems
- Evolution from early systems to Nintendo 64. Simple Wikipedia: History of Video Game Consoles
-
Programming Languages
- High-level languages: Python, JavaScript, Java. Simple Wikipedia: Programming Language
- Low-level languages: Machine code, Assembly, C, C++. Simple Wikipedia: Machine Code, Simple Wikipedia: Assembly Language
- High-level languages are expressive and concise.
- Low-level languages are optimized for hardware.
-
Languages for This Course
- We'll learn Python and JavaScript.
- Starting with Python because it's easy.
- Later, JavaScript because it is pervasive and used on the web.
-
Introduction to Python
- Python has an interpreter (REPL - Read Eval Print Loop). Wikipedia: REPL
- How code is interpreted, compiled, assembled.
- Introduction to:
- Strings, numbers, floats.
- Variables, functions (
def greet(name=None)
). Simple Wikipedia: Variable (Computer Science), Wikipedia: Function (Programming) - Lists of numbers or strings. Simple Wikipedia: List (Computing)
- For loops:
greet
each person in a list of names. Simple Wikipedia: For Loop
-
HTML and CSS
- Brief introduction to HTML (HyperText Markup Language) and CSS (Cascading Style Sheets). We will learn more in depth later.
- Simple Wikipedia: HTML
- Simple Wikipedia: CSS
-
Data Sizes
- 8 bits in a byte; half of a byte is a nibble.
- Power prefixes and their values:
- Kilo (K) = (10^3)
- Mega (M) = (10^6)
- Giga (G) = (10^9)
- Tera (T) = (10^{12})
- Peta (P) = (10^{15})
- Exa (E) = (10^{18})
-
Set Up PC or Mac
- Download and install:
-
Create a GitHub Account
- Choose a professional-sounding username.
- Avoid using a personal picture or details if you're a minor.
- Share your GitHub profile with the course instructor.
-
Practice
- Count from 0 to 31 using one hand.
- Memorize powers of 2 up to 8192.
- Practice Python using a Python REPL. Try out all language features from Learn X in Y Minutes: Python.
-
Reading / Watching
- ASCII: Answer what is ASCII in one sentence. Simple Wikipedia: ASCII
- Assembly language: Answer what is it in one sentence. Simple Wikipedia: Assembly Language
- Machine Language: Answer what is it in one sentence. Simple Wikipedia: Machine Code
- Watch BJC Lecture 1 - Abstraction
-
Writing Programs
- Write a Python program that prints out the powers of 2 from 0 to 32.
- Implement the program using a for loop.
- Implement the program using a while loop.
- Write a Python program that prints out the powers of 2 from 0 to 32.
-
Figure out the ASCII Codes
- Find the ASCII codes for each letter in your first and last name. Use the provided ASCII table link.
- Learn X in Y Minutes: Python
- ASCII Table
- Khan Academy Computer Science Course: Khan Academy: Computer Science
- Introduction to Python (YouTube Video): Python Programming for Beginners
- Transistors Explained (YouTube Video): How Transistors Work
- Submit any questions you have in our Slack workspace.
- The invitation link for Slack is included in the email to the class.
- Use Slack primarily for communication, asking questions, and doing homework.
- Don’t forget to share your GitHub profile with the course instructor.