Back Matter — Appendices, Glossary, Selected Answers, and Index
Computing, Programming, Data, Systems, Networks, Security, and AI
The appendices serve two purposes. First, they provide quick reference material for students actively working through the textbook — a place to look up a binary conversion, pseudocode convention, Python syntax rule, or security term without searching through chapters. Second, they function as a self-study review resource for students who want to consolidate the entire textbook before an exam, a placement test, or a new course.
Computer science does not require calculus or advanced algebra at the foundational level, but it does require careful reasoning with numbers, symbols, tables, and logic. This appendix reviews the mathematical tools used throughout the textbook.
2¹ = 2 (2 states per bit)
2⁸ = 256 (values in one byte)
2¹⁰ = 1,024 ≈ 1 KB
2²⁰ = 1,048,576 ≈ 1 MB
2³⁰ = 1,073,741,824 ≈ 1 GB
A variable in mathematics is a symbol representing an unknown or changing value. In computing, variables are named locations in memory. Both uses share the idea of a placeholder. An expression combines values, variables, and operations into a single quantity: 2n + 3 is an expression; cost = price * quantity is an assignment statement in code.
A table organizes data in rows and columns. Rows represent records; columns represent attributes. Reading a table means identifying which column holds the value you need and which row holds the record. A graph shows the relationship between two quantities. A line graph shows how one value changes as another increases. A bar chart compares discrete values across categories.
Boolean logic operates on two values: True (1) and False (0). The three fundamental operations are AND, OR, and NOT. Boolean expressions are the foundation of conditions in programs, search queries, circuit design, and database queries.
| Operation | Symbol | Rule | Example |
|---|---|---|---|
| AND | and / && | True only when both inputs are True | True and False → False |
| OR | or / || | True when at least one input is True | True or False → True |
| NOT | not / ! | Reverses the truth value | not True → False |
| A | B | A AND B | A OR B | NOT A |
|---|---|---|---|---|
| True | True | True | True | False |
| True | False | False | True | False |
| False | True | False | True | True |
| False | False | False | False | True |
| Symbol | Meaning | Code form | Returns |
|---|---|---|---|
| = | Equal to (math) | == | Boolean |
| ≠ | Not equal to | != | Boolean |
| < | Less than | < | Boolean |
| > | Greater than | > | Boolean |
| ≤ | Less than or equal | <= | Boolean |
| ≥ | Greater than or equal | >= | Boolean |
When a choice has n options at each of k steps, the total number of distinct outcomes is nk. A single bit has 2 options (0 or 1). Eight bits (one byte) have 28 = 256 possible values. This counting principle explains why an 8-bit color channel produces 256 shades and why a 4-character PIN with digits 0–9 has 104 = 10,000 possible values.
Computer scientists frequently estimate rather than calculate exactly. "Roughly 1,000" is often close enough when comparing algorithms or capacities. Key approximations: 210 ≈ 103 (one thousand); 220 ≈ 106 (one million); 230 ≈ 109 (one billion). These bridge binary and decimal scale.
Binary is base-2 positional notation. Each position represents a power of 2. The rightmost position is 2⁰ = 1, moving left: 2¹ = 2, 2² = 4, 2³ = 8, and so on.
Divide the decimal number by 2. Record the remainder. Divide the quotient by 2 again. Repeat until the quotient is 0. Read the remainders from bottom to top.
Example: 45 ÷ 2 = 22 R 1 / 22 ÷ 2 = 11 R 0 / 11 ÷ 2 = 5 R 1 / 5 ÷ 2 = 2 R 1 / 2 ÷ 2 = 1 R 0 / 1 ÷ 2 = 0 R 1 → Read up: 101101
Write the binary number. Under each digit, write the power of 2 for that position (right to left starting at 2⁰). Multiply each digit by its power. Sum all the products where the bit is 1.
1011 → (1×8) + (0×4) + (1×2) + (1×1) = 8 + 0 + 2 + 1 = 11
| Unit | Symbol | Approximate Size | Context |
|---|---|---|---|
| Kilobyte | KB | 2¹⁰ ≈ 1,000 bytes | A short text document |
| Megabyte | MB | 2²⁰ ≈ 1,000,000 bytes | A high-res photo |
| Gigabyte | GB | 2³⁰ ≈ 10⁹ bytes | A movie file |
| Terabyte | TB | 2⁴⁰ ≈ 10¹² bytes | A laptop hard drive |
| Petabyte | PB | 2⁵⁰ ≈ 10¹⁵ bytes | Data center storage |
Confusing bits and bytes. Network speeds are typically measured in bits per second (Mbps), while file sizes are measured in bytes (MB). A 100 Mbps connection transfers 100 megabits = 12.5 megabytes per second — not 100 MB/s.
Pseudocode is an informal, language-independent way to write algorithms. It should be clear enough to translate into any programming language. Flowcharts show the same logic visually. Use both to design and communicate algorithms before writing code.
| Construct | Pseudocode form | Notes |
|---|---|---|
| Input | INPUT name | Read a value from the user into a variable |
| Output | OUTPUT value | Display a value to the user |
| Assignment | SET x TO 5 or x ← 5 | Store a value in a variable |
| If–then | IF condition THEN … END IF | Execute only when condition is true |
| If–else | IF … THEN … ELSE … END IF | Choose between two paths |
| While loop | WHILE condition DO … END WHILE | Repeat while condition is true |
| For loop | FOR i FROM 1 TO n DO … END FOR | Repeat a fixed number of times |
| Function | FUNCTION name(params) … RETURN value END FUNCTION | Reusable named procedure |
| Comment | // This is a comment | Explanation; not executed |
FUNCTION FindMax(a, b, c)
SET max TO a
IF b > max THEN
SET max TO b
END IF
IF c > max THEN
SET max TO c
END IF
RETURN max
END FUNCTION
INPUT x
INPUT y
INPUT z
OUTPUT FindMax(x, y, z)
| Shape | Symbol | Meaning | Examples |
|---|---|---|---|
| Oval / Rounded rectangle | ⬭ | Start / End (terminal) | START, END, STOP |
| Rectangle | ▭ | Process / Action | SET x TO 0, Compute total |
| Parallelogram | ▱ | Input / Output | INPUT name, OUTPUT result |
| Diamond | ◇ | Decision | x > 0? Yes/No branches |
| Arrow | → | Flow of control | Connects any two shapes |
A tracing table tracks the value of each variable at each step of algorithm execution. Create one column per variable and one row per step. Trace through the algorithm manually, filling in each cell.
SET total TO 0
FOR i FROM 1 TO 4 DO
SET total TO total + i
END FOR
OUTPUT total
| Step | i | total |
|---|---|---|
| Start | — | 0 |
| i = 1 | 1 | 1 |
| i = 2 | 2 | 3 |
| i = 3 | 3 | 6 |
| i = 4 | 4 | 10 |
The examples in this textbook use Python-style syntax because Python is readable and widely used in education and data science. The underlying ideas — variables, conditionals, loops, functions — exist in virtually every programming language. When you move to another language, the syntax changes; the concepts do not.
| Type | Python name | Examples | Notes |
|---|---|---|---|
| Integer | int | 0, 42, -7 | Whole numbers; no decimal point |
| Float | float | 3.14, -0.5, 1.0 | Numbers with a decimal component |
| String | str | "hello", 'CS' | Text; enclosed in quotes |
| Boolean | bool | True, False | Exactly two values; capital T and F |
| List | list | [1, 2, 3] | Ordered, mutable sequence |
| Dictionary | dict | {"a": 1, "b": 2} | Key-value pairs |
student_count not sc. Names should communicate purpose without a comment.# Cap score at 100 to prevent overflow is better than # Set score to 100.| Error Type | When It Occurs | Example | How to Find It |
|---|---|---|---|
| Syntax error | Before the program runs | if x > 0 (missing colon) | Read the error message; find the highlighted line |
| Runtime error | While the program is running | Dividing by zero; index out of range | Read the traceback; identify the failing line |
| Logic error | Program runs but produces wrong output | Using + instead of * in a formula | Trace the program by hand; add print statements |
1. Read from the bottom up. The last line names the error type and the specific problem.
2. The line above it shows the file name, the line number, and the code that caused the error.
3. Higher lines show the call chain — which function called which.
4. Fix the error at the bottom-most indicated line first; other errors may disappear.
print(variable) statements at key points to inspect values at runtime. Remove them when the bug is fixed.| Category | Description | Example (function: compute average) |
|---|---|---|
| Normal case | Typical, expected input | [80, 90, 70] → 80.0 |
| Edge case | Boundary values | [0] → 0.0; [100, 100] → 100.0 |
| Empty input | No data | [] → error or None |
| Large input | Many values | 1,000 numbers → verify performance |
| Invalid input | Wrong type or out of range | ["a", "b"] → type error handled? |
| Structure | Description | Access | Use When |
|---|---|---|---|
| List / Array | Ordered sequence of elements, accessed by index | O(1) by index | You need ordered data with indexed access |
| String | Immutable sequence of characters | O(1) by index | Working with text |
| Record | A fixed collection of named fields describing one entity | By field name | Representing a single structured entity (a person, a product) |
| Dictionary / Map | Key-value pairs; look up a value by its key | O(1) average by key | Fast lookup by name, ID, or label |
| Stack | Last-in, first-out (LIFO). Push adds to top; pop removes from top | Top only | Undo history, call stack, depth-first search |
| Queue | First-in, first-out (FIFO). Enqueue adds to back; dequeue removes from front | Front and back | Print queues, network buffers, breadth-first search |
Check each element one by one from the beginning. Return when you find a match; report not found when the list is exhausted. Works on any list, sorted or unsorted.
Best case: first element matches — O(1)
Worst case: last element or not present — O(n)
Average: O(n)
Requires a sorted list. Compare the target to the middle element. If equal, done. If target is smaller, search the left half. If larger, search the right half. Repeat.
Each step halves the search space.
Best case: O(1) Worst case: O(log n)
A list of 1,000,000 elements needs at most 20 comparisons (log₂ 1,000,000 ≈ 20).
| Algorithm | How It Works | Performance | Notes |
|---|---|---|---|
| Selection Sort | Find the smallest element; swap into position; repeat for the next position | O(n²) | Simple; slow for large lists; good for teaching |
| Insertion Sort | Build a sorted section by inserting each new element into its correct position | O(n²) worst; O(n) nearly sorted | Efficient on small or nearly sorted lists |
| Merge Sort | Divide list in half; sort each half recursively; merge the sorted halves | O(n log n) | Consistent performance; used in practice |
| Python sort() | Timsort: hybrid of merge sort and insertion sort | O(n log n) | Built-in; use this in real code |
| Notation | Name | Example | n = 1,000 |
|---|---|---|---|
O(1) | Constant | Array index lookup, hash table lookup | 1 step |
O(log n) | Logarithmic | Binary search | ~10 steps |
O(n) | Linear | Linear search, single loop | 1,000 steps |
O(n log n) | Linearithmic | Merge sort, Timsort | ~10,000 steps |
O(n²) | Quadratic | Selection sort, nested loops | 1,000,000 steps |
Big-O describes how an algorithm scales as input grows, not how fast it runs on one specific input. An O(n) algorithm that takes 1 second on 1,000 items will take about 10 seconds on 10,000 items. An O(n²) algorithm may be fine for 100 items but unusable for 100,000.
Fetch: The CPU reads the next instruction from memory (at the address in the program counter).
Decode: The control unit determines what the instruction means and which circuit should execute it.
Execute: The appropriate arithmetic or logic unit performs the operation. The result may be written to a register or to memory.
This cycle repeats billions of times per second.
| Concept | Description | Example |
|---|---|---|
| Absolute path | Full path from the root of the file system | /home/alice/documents/notes.txt |
| Relative path | Path relative to the current working directory | documents/notes.txt |
| File extension | Suffix indicating file type | .txt .py .csv .html .mp3 |
| Directory (folder) | A container for files and other directories | /home/alice/ |
| Root directory | The top-level directory of the file system | / on Unix; C:\ on Windows |
| Command (Unix/Mac) | Windows | What it does |
|---|---|---|
pwd | cd | Print current (working) directory |
ls | dir | List files in the current directory |
cd foldername | cd foldername | Change directory |
mkdir name | mkdir name | Create a new directory |
cp src dest | copy src dest | Copy a file |
rm filename | del filename | Delete a file |
python file.py | python file.py | Run a Python script |
| Technology | Role | Example |
|---|---|---|
| URL | Identifies a specific resource on the web | https://www.example.com/page?id=5 |
| HTTP | Protocol for requesting and delivering web pages | GET, POST, 200 OK, 404 Not Found |
| HTTPS | HTTP with TLS encryption. Protects data in transit | Padlock icon in browser |
| HTML | Markup language defining the structure of a page | <h1>, <p>, <a href>, <img> |
| CSS | Stylesheet language defining the presentation of a page | color, font-size, margin, background |
| JavaScript | Programming language adding behavior and interactivity | Form validation, dynamic content |
| Client | The browser that requests and displays web pages | Chrome, Firefox, Safari |
| Server | The computer that stores and delivers web resources | Apache, Nginx, cloud services |
1. Your browser parses the URL and extracts the domain name.
2. Your device queries a DNS resolver to find the IP address for the domain.
3. Your browser opens a TCP connection to the server at that IP address (port 443 for HTTPS).
4. A TLS handshake establishes an encrypted session.
5. Your browser sends an HTTP GET request for the specified resource.
6. The server responds with an HTTP status code and the resource (HTML, image, etc.).
7. The browser parses the HTML, requests linked CSS and JavaScript, and renders the page.
| Threat | Description | Defense |
|---|---|---|
| Malware | Malicious software: viruses, worms, ransomware, spyware. Designed to damage systems or steal data. | Antivirus, system updates, backups, least privilege |
| Phishing | Fraudulent messages impersonating trusted entities to steal credentials or install malware. | Verify sender, don't click unknown links, MFA |
| Social engineering | Manipulating people rather than exploiting software. Pretexting, impersonation, urgency tactics. | Awareness training, verification procedures |
| Denial of service | Flooding a system with traffic to make it unavailable. | Rate limiting, filtering, redundant infrastructure |
| SQL injection | Inserting malicious SQL code into input fields to manipulate database queries. | Input validation, parameterized queries, least privilege |
| Career Area | What They Do | Key Skills |
|---|---|---|
| Software Engineering | Design, build, test, and maintain software systems | Programming, system design, testing, version control |
| Web Development | Build websites and web applications | HTML, CSS, JavaScript, frameworks, databases |
| Cybersecurity | Protect systems, networks, and data from threats | Networking, threat analysis, encryption, ethical hacking |
| Data Science | Analyze data to find patterns and support decisions | Statistics, Python, visualization, machine learning |
| AI / ML Engineering | Build and deploy machine learning models | Math, Python, ML frameworks, data engineering |
| Database Administration | Design and maintain databases | SQL, data modeling, performance tuning, backups |
| Systems / Network Admin | Manage hardware, OS, and network infrastructure | Linux, networking, scripting, cloud platforms |
| UX / HCI | Design interfaces that are usable, accessible, and effective | User research, prototyping, accessibility, visual design |
| Prefix | Origin / Meaning | Examples |
|---|---|---|
| bi- | Latin: two | binary, bidirectional, bitwise |
| byte- | unit of 8 bits | kilobyte, megabyte, gigabyte |
| cyber- | Greek: to steer | cybersecurity, cyberspace, cybercrime |
| de- | Latin: remove, reverse | decode, decrypt, decompress, debug |
| en- | Latin: make into, put into | encode, encrypt, enqueue |
| inter- | Latin: between | internet, interface, interoperability |
| meta- | Greek: about, beyond | metadata, metaclass, metaprogramming |
| multi- | Latin: many | multitasking, multicore, multifactor |
| over- | English: excess | overflow, overwrite, overload |
| proto- | Greek: first | protocol, prototype, protobuf |
| Suffix | Meaning | Examples |
|---|---|---|
| -ware | a type of product or software | hardware, software, firmware, malware, freeware |
| -net | network | internet, intranet, ethernet |
| -base | foundation or storage | database, codebase, knowledge base |
| -bit | single binary digit | 64-bit, 8-bit, halfbit |
| -byte | unit of 8 bits | gigabyte, kilobyte, terabyte |
| -cast | to send out to many | broadcast, podcast, multicast |
| Acronym | Stands For | Context |
|---|---|---|
| API | Application Programming Interface | How software components communicate |
| CPU | Central Processing Unit | The main processor of a computer |
| CSV | Comma-Separated Values | Plain text data table format |
| DNS | Domain Name System | Translates domain names to IP addresses |
| GUI | Graphical User Interface | Visual interface with windows and icons |
| HTTP | HyperText Transfer Protocol | Web communication protocol |
| IDE | Integrated Development Environment | Code editor + tools in one application |
| IP | Internet Protocol | Addressing and routing on the internet |
| RAM | Random Access Memory | Fast temporary computer memory |
| SQL | Structured Query Language | Language for querying relational databases |
| SSH | Secure Shell | Encrypted remote terminal access |
| TLS | Transport Layer Security | Encryption protocol for HTTPS |
| URL | Uniform Resource Locator | Web address for a specific resource |
| VPN | Virtual Private Network | Encrypted tunnel over a public network |
| Convention | Style | Used For | Examples |
|---|---|---|---|
| snake_case | lowercase with underscores | Python variables, functions, files | student_count, compute_average, data_file.csv |
| camelCase | no spaces; each new word capitalized except first | JavaScript variables, Java methods | studentCount, computeAverage |
| PascalCase | each word capitalized | Class names in Python, Java, C# | StudentRecord, ComputeAverage |
| kebab-case | lowercase with hyphens | HTML file names, CSS class names, URLs | my-page.html, header-nav |
| SCREAMING_SNAKE | uppercase with underscores | Constants | MAX_SPEED, DEFAULT_TIMEOUT |
Names should tell a reader what a variable holds or what a function does — without requiring a comment to explain. Prefer student_count to n, is_valid to flag, and calculate_tax(price) to calc(x). Consistency within a project matters as much as following any one convention.
Chapter references in parentheses indicate where the term is introduced or used most fully. Terms appear in the glossary when they are central to understanding the textbook. For a comprehensive alphabetical index of all topics, see Appendix O.
Answers are provided for conceptual checks, binary conversion exercises, algorithm tracing, code prediction, and selected short-answer questions. For longer design, analysis, and debugging exercises, exemplar answers appear in the accompanying MGU Instructor Guide. Where multiple correct answers are possible, a representative correct answer is shown.
1101.01000001.x = 3; y = x * 2 + 1; print(y): y = 3×2+1 = 7.total = 0; for i in range(1, 5): total += i: i takes values 1, 2, 3, 4; total becomes 1, 3, 6, 10. Output: 10.def double(n): return n * 2 returns 10.if score = 90: is a syntax error — should be == (comparison), not = (assignment).["red", "green", "blue"], the element at index 2 is "blue". (Zero-based indexing: red=0, green=1, blue=2.)calculate_tax(price) hides the implementation. The caller only needs to know the inputs and what it returns, not how it works internally.example.com to an IP address like 93.184.216.34, so your browser can connect to the server.Chapter numbers follow each entry. Bold indicates the chapter in which the topic receives its most complete treatment. An asterisk (*) indicates appearance in an appendix rather than a main chapter.