MGU Computer Science Series — Library Textbook Edition
Back Matter — Appendices A through O
Computing · Programming · Data · Systems · Networks · Security · AI
15 Appendices · Glossary · Index
MGU Computer Science Series  ·  Library Textbook Edition

Computer Science
Foundations

Back Matter — Appendices, Glossary, Selected Answers, and Index
Computing, Programming, Data, Systems, Networks, Security, and AI

■ Appendices A – O ■

■ Glossary  ·  Selected Answers  ·  Index ■

Follows Chapters 1 – 28  ·  Serves as a standalone reference for all seven parts

Contents of the Back Matter

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.

15Appendices
350+Glossary Terms
28Chapters Covered
7Parts
AMathematics and Logic for Computer Science
BBinary and Data Representation Reference
CPseudocode and Flowchart Reference
DPython-Style Code Reference
EDebugging and Testing Reference
FData Structures and Algorithms Reference
GComputer Systems Reference
HNetworks and Web Reference
ICybersecurity and Privacy Reference
JData Science and AI Reference
KComputing Ethics and Careers Reference
LComputer Science Root Words and Naming Guide
MGlossary
NSelected Answers
OIndex
Appendix A
Mathematics and Logic for Computer Science
Arithmetic · Variables · Ratios · Tables · Boolean Logic · Truth Values · Sets · Counting · Estimation

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.

A.1 Arithmetic Review

Example A.1
Powers of 2 — the scale of digital storage
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.2 Variables and Expressions

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.3 Ratios, Percentages, and Rates

A.4 Tables and Graphs

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.

A.5 Boolean Logic

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.

OperationSymbolRuleExample
ANDand / &&True only when both inputs are TrueTrue and False → False
ORor / ||True when at least one input is TrueTrue or False → True
NOTnot / !Reverses the truth valuenot True → False

A.6 Truth Tables

ABA AND BA OR BNOT A
TrueTrueTrueTrueFalse
TrueFalseFalseTrueFalse
FalseTrueFalseTrueTrue
FalseFalseFalseFalseTrue

A.7 Comparisons

SymbolMeaningCode formReturns
=Equal to (math)==Boolean
≠Not equal to!=Boolean
<Less than<Boolean
>Greater than>Boolean
≤Less than or equal<=Boolean
≥Greater than or equal>=Boolean

A.8 Basic Set Ideas

A.9 Counting and Combinations

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.

A.10 Estimation and Approximation

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.

Appendix B
Binary and Data Representation Reference
Bits · Bytes · Binary Counting · Conversion · Text · Images · Sound · Compression · Storage Units

B.1 Bits and Bytes

B.2 Binary Counting — Positional Notation

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.

2⁷
128
2⁶
64
2⁵
32
2⁴
16
2³
8
2²
4
2¹
2
2⁰
1
0
1
1
0
1
0
1
0
01101010 = 64 + 32 + 8 + 2 = 106 in decimal

B.3 Decimal-to-Binary Conversion

Division Method

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

B.4 Binary-to-Decimal Conversion

Positional Sum Method

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

B.5 Quick Reference — Decimal to Binary (0–31)

Dec
Binary
Dec
Binary
0
00000
16
10000
1
00001
17
10001
2
00010
18
10010
4
00100
20
10100
8
01000
24
11000
10
01010
28
11100
15
01111
31
11111

B.6 Representing Text

B.7 Representing Images

B.8 Representing Sound

B.9 Compression

B.10 Storage Units

UnitSymbolApproximate SizeContext
KilobyteKB2¹⁰ ≈ 1,000 bytesA short text document
MegabyteMB2²⁰ ≈ 1,000,000 bytesA high-res photo
GigabyteGB2³⁰ ≈ 10⁹ bytesA movie file
TerabyteTB2⁴⁰ ≈ 10¹² bytesA laptop hard drive
PetabytePB2⁵⁰ ≈ 10¹⁵ bytesData center storage
Common Representation Error

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.

Appendix C
Pseudocode and Flowchart Reference
Conventions · Input/Output · Assignment · Conditionals · Loops · Functions · Symbols · Tracing · Checklist

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.

C.1 Pseudocode Conventions Used in This Textbook

ConstructPseudocode formNotes
InputINPUT nameRead a value from the user into a variable
OutputOUTPUT valueDisplay a value to the user
AssignmentSET x TO 5 or x ← 5Store a value in a variable
If–thenIF condition THEN … END IFExecute only when condition is true
If–elseIF … THEN … ELSE … END IFChoose between two paths
While loopWHILE condition DO … END WHILERepeat while condition is true
For loopFOR i FROM 1 TO n DO … END FORRepeat a fixed number of times
FunctionFUNCTION name(params) … RETURN value END FUNCTIONReusable named procedure
Comment// This is a commentExplanation; not executed

C.2 Complete Pseudocode Example

Example C.1
Find the largest of three numbers
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)

C.3 Flowchart Symbols

ShapeSymbolMeaningExamples
Oval / Rounded rectangle⬭Start / End (terminal)START, END, STOP
Rectangle▭Process / ActionSET x TO 0, Compute total
Parallelogram▱Input / OutputINPUT name, OUTPUT result
Diamond◇Decisionx > 0? Yes/No branches
Arrow→Flow of controlConnects any two shapes

C.4 Tracing Tables

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.

Example C.2
Tracing a counting loop
SET total TO 0 FOR i FROM 1 TO 4 DO SET total TO total + i END FOR OUTPUT total
Stepitotal
Start—0
i = 111
i = 223
i = 336
i = 4410
Output: 10 (sum of 1 + 2 + 3 + 4)

C.5 Algorithm Design Checklist

Appendix D
Python-Style Code Reference
Variables · Types · Expressions · I/O · Conditionals · Loops · Functions · Lists · Dicts · Files · Errors · Style
Language Independence Note

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.

D.1 Variables and Assignment

# Assign a value to a variable name = "Alice" age = 17 score = 94.5 passed = True # Reassign (update a variable) score = score + 5 # score is now 99.5

D.2 Data Types

TypePython nameExamplesNotes
Integerint0, 42, -7Whole numbers; no decimal point
Floatfloat3.14, -0.5, 1.0Numbers with a decimal component
Stringstr"hello", 'CS'Text; enclosed in quotes
BooleanboolTrue, FalseExactly two values; capital T and F
Listlist[1, 2, 3]Ordered, mutable sequence
Dictionarydict{"a": 1, "b": 2}Key-value pairs

D.3 Input and Output

name = input("Enter your name: ") age = int(input("Enter your age: ")) # convert string to int print("Hello,", name) print(f"You are {age} years old.") # f-string formatting

D.4 Conditionals

if score >= 90: print("Grade: A") elif score >= 80: print("Grade: B") elif score >= 70: print("Grade: C") else: print("Grade: F")

D.5 Loops

# While loop count = 0 while count < 5: print(count) count += 1 # For loop over a range for i in range(5): # 0, 1, 2, 3, 4 print(i) # For loop over a list fruits = ["apple", "banana", "cherry"] for fruit in fruits: print(fruit)

D.6 Functions

def greet(name): return f"Hello, {name}!" def add(a, b): return a + b print(greet("Alice")) # Hello, Alice! print(add(3, 4)) # 7

D.7 Lists

scores = [85, 92, 78, 95] print(scores[0]) # 85 — first element (index 0) print(scores[-1]) # 95 — last element print(len(scores)) # 4 scores.append(88) # add to end scores.sort() # sort in place: [78, 85, 88, 92, 95]

D.8 Dictionaries

student = { "name": "Alice", "grade": 11, "gpa": 3.8 } print(student["name"]) # Alice student["gpa"] = 3.9 # update a value print(student.keys()) # dict_keys(['name', 'grade', 'gpa'])

D.9 Files

# Reading a file with open("data.txt", "r") as f: for line in f: print(line.strip()) # Writing a file with open("output.txt", "w") as f: f.write("Hello, file!\n")

D.10 Readable Code Guidelines

Appendix E
Debugging and Testing Reference
Error Types · Error Messages · Tracing · Print Debugging · Test Cases · Edge Cases · Incremental Dev · Checklist

E.1 Three Types of Errors

Error TypeWhen It OccursExampleHow to Find It
Syntax errorBefore the program runsif x > 0 (missing colon)Read the error message; find the highlighted line
Runtime errorWhile the program is runningDividing by zero; index out of rangeRead the traceback; identify the failing line
Logic errorProgram runs but produces wrong outputUsing + instead of * in a formulaTrace the program by hand; add print statements

E.2 Reading Error Messages

How to Read a Python Traceback

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.

E.3 Debugging Strategies

E.4 Test Cases

CategoryDescriptionExample (function: compute average)
Normal caseTypical, expected input[80, 90, 70] → 80.0
Edge caseBoundary values[0] → 0.0; [100, 100] → 100.0
Empty inputNo data[] → error or None
Large inputMany values1,000 numbers → verify performance
Invalid inputWrong type or out of range["a", "b"] → type error handled?

E.5 Debugging Checklist

Appendix F
Data Structures and Algorithms Reference
Lists · Arrays · Strings · Records · Dicts · Stacks · Queues · Search · Sort · Efficiency · Big-O

F.1 Core Data Structures

StructureDescriptionAccessUse When
List / ArrayOrdered sequence of elements, accessed by indexO(1) by indexYou need ordered data with indexed access
StringImmutable sequence of charactersO(1) by indexWorking with text
RecordA fixed collection of named fields describing one entityBy field nameRepresenting a single structured entity (a person, a product)
Dictionary / MapKey-value pairs; look up a value by its keyO(1) average by keyFast lookup by name, ID, or label
StackLast-in, first-out (LIFO). Push adds to top; pop removes from topTop onlyUndo history, call stack, depth-first search
QueueFirst-in, first-out (FIFO). Enqueue adds to back; dequeue removes from frontFront and backPrint queues, network buffers, breadth-first search

F.2 Linear Search

Linear 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)

F.3 Binary Search

Binary Search

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).

F.4 Sorting Overview

AlgorithmHow It WorksPerformanceNotes
Selection SortFind the smallest element; swap into position; repeat for the next positionO(n²)Simple; slow for large lists; good for teaching
Insertion SortBuild a sorted section by inserting each new element into its correct positionO(n²) worst; O(n) nearly sortedEfficient on small or nearly sorted lists
Merge SortDivide list in half; sort each half recursively; merge the sorted halvesO(n log n)Consistent performance; used in practice
Python sort()Timsort: hybrid of merge sort and insertion sortO(n log n)Built-in; use this in real code

F.5 Big-O Intuition

NotationNameExamplen = 1,000
O(1)ConstantArray index lookup, hash table lookup1 step
O(log n)LogarithmicBinary search~10 steps
O(n)LinearLinear search, single loop1,000 steps
O(n log n)LinearithmicMerge sort, Timsort~10,000 steps
O(n²)QuadraticSelection sort, nested loops1,000,000 steps
Big-O Rule of Thumb

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.

Appendix G
Computer Systems Reference
CPU · Memory · Storage · I/O · Motherboard · OS · Filesystems · Processes · Permissions · CLI · Tools

G.1 Core Hardware Components

G.2 The Fetch-Decode-Execute Cycle

How the CPU Runs a Program

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.

G.3 Operating System Functions

G.4 File System Basics

ConceptDescriptionExample
Absolute pathFull path from the root of the file system/home/alice/documents/notes.txt
Relative pathPath relative to the current working directorydocuments/notes.txt
File extensionSuffix indicating file type.txt .py .csv .html .mp3
Directory (folder)A container for files and other directories/home/alice/
Root directoryThe top-level directory of the file system/ on Unix; C:\ on Windows

G.5 Basic Command-Line Reference

Command (Unix/Mac)WindowsWhat it does
pwdcdPrint current (working) directory
lsdirList files in the current directory
cd foldernamecd foldernameChange directory
mkdir namemkdir nameCreate a new directory
cp src destcopy src destCopy a file
rm filenamedel filenameDelete a file
python file.pypython file.pyRun a Python script
Appendix H
Networks and Web Reference
Networks · Packets · Routers · IP · DNS · Protocols · Bandwidth · Clients/Servers · URLs · HTTP · HTML · CSS · JS

H.1 Network Fundamentals

H.2 IP Addresses and DNS

H.3 Web Technologies

TechnologyRoleExample
URLIdentifies a specific resource on the webhttps://www.example.com/page?id=5
HTTPProtocol for requesting and delivering web pagesGET, POST, 200 OK, 404 Not Found
HTTPSHTTP with TLS encryption. Protects data in transitPadlock icon in browser
HTMLMarkup language defining the structure of a page<h1>, <p>, <a href>, <img>
CSSStylesheet language defining the presentation of a pagecolor, font-size, margin, background
JavaScriptProgramming language adding behavior and interactivityForm validation, dynamic content
ClientThe browser that requests and displays web pagesChrome, Firefox, Safari
ServerThe computer that stores and delivers web resourcesApache, Nginx, cloud services

H.4 A Web Request Step by Step

What Happens When You Type a URL

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.

Appendix I
Cybersecurity and Privacy Reference
Threats · Vulnerabilities · Risk · Malware · Phishing · Auth · Encryption · Backups · Passwords · MFA · Privacy

I.1 Core Security Concepts

I.2 Common Threats

ThreatDescriptionDefense
MalwareMalicious software: viruses, worms, ransomware, spyware. Designed to damage systems or steal data.Antivirus, system updates, backups, least privilege
PhishingFraudulent messages impersonating trusted entities to steal credentials or install malware.Verify sender, don't click unknown links, MFA
Social engineeringManipulating people rather than exploiting software. Pretexting, impersonation, urgency tactics.Awareness training, verification procedures
Denial of serviceFlooding a system with traffic to make it unavailable.Rate limiting, filtering, redundant infrastructure
SQL injectionInserting malicious SQL code into input fields to manipulate database queries.Input validation, parameterized queries, least privilege

I.3 Authentication and Authorization

I.4 Encryption

I.5 Privacy Reference

Appendix J
Data Science and AI Reference
Datasets · Features · Labels · Cleaning · Visualization · Statistics · Correlation · ML · Models · Neural Nets · Generative AI · Bias

J.1 Data Science Vocabulary

J.2 Machine Learning Concepts

J.3 Neural Networks and Generative AI

J.4 Bias and Evaluation

Appendix K
Computing Ethics and Careers Reference
Professional Ethics · Accessibility · Privacy · Fairness · Safety · Environment · Automation · Careers · Learning

K.1 Professional Ethics in Computing

K.2 Accessibility and Inclusion

K.3 Environmental Impact

K.4 Computing Career Paths

Career AreaWhat They DoKey Skills
Software EngineeringDesign, build, test, and maintain software systemsProgramming, system design, testing, version control
Web DevelopmentBuild websites and web applicationsHTML, CSS, JavaScript, frameworks, databases
CybersecurityProtect systems, networks, and data from threatsNetworking, threat analysis, encryption, ethical hacking
Data ScienceAnalyze data to find patterns and support decisionsStatistics, Python, visualization, machine learning
AI / ML EngineeringBuild and deploy machine learning modelsMath, Python, ML frameworks, data engineering
Database AdministrationDesign and maintain databasesSQL, data modeling, performance tuning, backups
Systems / Network AdminManage hardware, OS, and network infrastructureLinux, networking, scripting, cloud platforms
UX / HCIDesign interfaces that are usable, accessible, and effectiveUser research, prototyping, accessibility, visual design
Appendix L
Computer Science Root Words and Naming Guide
Prefixes · Suffixes · Acronyms · Decoding Terms · File Naming · Variable Naming · Conventions

L.1 Common Computing Prefixes

PrefixOrigin / MeaningExamples
bi-Latin: twobinary, bidirectional, bitwise
byte-unit of 8 bitskilobyte, megabyte, gigabyte
cyber-Greek: to steercybersecurity, cyberspace, cybercrime
de-Latin: remove, reversedecode, decrypt, decompress, debug
en-Latin: make into, put intoencode, encrypt, enqueue
inter-Latin: betweeninternet, interface, interoperability
meta-Greek: about, beyondmetadata, metaclass, metaprogramming
multi-Latin: manymultitasking, multicore, multifactor
over-English: excessoverflow, overwrite, overload
proto-Greek: firstprotocol, prototype, protobuf

L.2 Common Technical Suffixes

SuffixMeaningExamples
-warea type of product or softwarehardware, software, firmware, malware, freeware
-netnetworkinternet, intranet, ethernet
-basefoundation or storagedatabase, codebase, knowledge base
-bitsingle binary digit64-bit, 8-bit, halfbit
-byteunit of 8 bitsgigabyte, kilobyte, terabyte
-castto send out to manybroadcast, podcast, multicast

L.3 Common Acronyms and Abbreviations

AcronymStands ForContext
APIApplication Programming InterfaceHow software components communicate
CPUCentral Processing UnitThe main processor of a computer
CSVComma-Separated ValuesPlain text data table format
DNSDomain Name SystemTranslates domain names to IP addresses
GUIGraphical User InterfaceVisual interface with windows and icons
HTTPHyperText Transfer ProtocolWeb communication protocol
IDEIntegrated Development EnvironmentCode editor + tools in one application
IPInternet ProtocolAddressing and routing on the internet
RAMRandom Access MemoryFast temporary computer memory
SQLStructured Query LanguageLanguage for querying relational databases
SSHSecure ShellEncrypted remote terminal access
TLSTransport Layer SecurityEncryption protocol for HTTPS
URLUniform Resource LocatorWeb address for a specific resource
VPNVirtual Private NetworkEncrypted tunnel over a public network

L.4 Naming Files and Variables

ConventionStyleUsed ForExamples
snake_caselowercase with underscoresPython variables, functions, filesstudent_count, compute_average, data_file.csv
camelCaseno spaces; each new word capitalized except firstJavaScript variables, Java methodsstudentCount, computeAverage
PascalCaseeach word capitalizedClass names in Python, Java, C#StudentRecord, ComputeAverage
kebab-caselowercase with hyphensHTML file names, CSS class names, URLsmy-page.html, header-nav
SCREAMING_SNAKEuppercase with underscoresConstantsMAX_SPEED, DEFAULT_TIMEOUT
Naming Principles

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.

Appendix M
Glossary
Alphabetical glossary of computer science terms used throughout the textbook — Chapters 1–28

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.

A
AbstractionThe process of hiding unnecessary detail while exposing only the information needed for a given purpose. A function signature is an abstraction over its implementation. (Ch. 3, 13)
AlgorithmA finite, precise, step-by-step procedure for solving a problem or accomplishing a task, with defined inputs and outputs. (Ch. 3, 5)
APIApplication Programming Interface. A defined set of rules for how software components communicate, allowing one program to use the services of another without knowing its internal implementation. (Ch. 17)
ArgumentA specific value passed to a function when it is called. Distinct from a parameter, which is the variable in the function definition. (Ch. 9)
ArrayAn ordered sequence of elements stored at contiguous memory locations, accessed by integer index. In Python, the built-in list is the standard array-like structure. (Ch. 11)
AutomationUsing a system to perform tasks with minimal or no human intervention. Programs, scripts, and robots all represent forms of automation. (Ch. 1, 24)
B
BandwidthThe maximum rate at which data can be transferred over a network connection, measured in bits per second. (Ch. 19)
BinaryThe base-2 number system using only the digits 0 and 1. The foundation of all digital data representation. (Ch. 4)
BitThe smallest unit of digital information. A single binary digit: 0 or 1. (Ch. 4)
BooleanA data type with exactly two possible values: True and False. Used in conditions, comparisons, and logic operations. Named after mathematician George Boole. (Ch. 7)
BugAn error in a program that causes incorrect or unexpected behavior. Bugs may be syntax errors, runtime errors, or logic errors. (Ch. 10)
ByteA group of 8 bits. A byte can represent 2⁸ = 256 distinct values (0–255). The standard unit of character encoding and memory measurement. (Ch. 4)
C
CachingStoring a copy of frequently accessed data in a faster or closer location to reduce retrieval time. Web browsers cache pages; CPUs cache memory contents. (Ch. 12, 15)
ClassificationA machine learning task in which a model predicts which category an input belongs to, such as spam or not-spam. (Ch. 26)
ClientA device or program that requests services from a server. A web browser is a client; the computer running the website is the server. (Ch. 19, 20)
CompilerA program that translates source code in a high-level language into machine code or another language all at once, before the program runs. (Ch. 6)
CompressionReducing the size of data by encoding it more efficiently. Lossless compression allows perfect recovery; lossy compression discards some data for greater reduction. (Ch. 4)
Computational ThinkingA problem-solving approach that uses decomposition, pattern recognition, abstraction, and algorithmic thinking to formulate solutions that can be executed by a computer or person. (Ch. 3)
Control FlowThe order in which statements in a program are executed. Control flow is altered by conditionals, loops, and function calls. (Ch. 8)
CPUCentral Processing Unit. The primary processor of a computer; executes program instructions using the fetch-decode-execute cycle. (Ch. 2, 15)
CSVComma-Separated Values. A plain-text format for storing tabular data where each row is a line and values within a row are separated by commas. (Ch. 14)
D
DataRaw facts, measurements, or observations that have been recorded but not yet interpreted. Data becomes information when organized and given context. (Ch. 1, 2)
DatabaseAn organized collection of structured data, typically managed by a Database Management System (DBMS) that supports querying, updating, and protecting the data. (Ch. 18)
DebuggingThe process of finding, understanding, and fixing errors in a program. (Ch. 10)
DecompositionBreaking a complex problem into smaller, more manageable sub-problems. A key strategy in computational thinking and software design. (Ch. 3, 9)
DictionaryA data structure that stores key-value pairs, allowing retrieval of a value by its associated key in constant average time. Called a map or hash map in other languages. (Ch. 11)
DNSDomain Name System. The distributed system that translates human-readable domain names into numeric IP addresses. (Ch. 19)
E
Edge CaseAn input or situation at the boundary of normal operation: an empty list, zero, the maximum allowed value, or an unexpected type. Edge cases often reveal bugs. (Ch. 10)
EncryptionTransforming data into an unreadable form using an algorithm and a key so that only authorized parties can recover the original. (Ch. 21)
F
FeatureIn machine learning, a measurable attribute of an input used by a model to make predictions. In data science, a column in a dataset. (Ch. 25, 26)
FirewallA network security system that monitors and filters incoming and outgoing traffic based on defined rules. (Ch. 21)
FlowchartA diagram that represents an algorithm or process using standardized shapes connected by arrows indicating flow of control. (Ch. 5)
FunctionA named, reusable block of code that performs a specific task. Functions accept parameters, execute a body of statements, and optionally return a value. (Ch. 9)
H–I
HardwareThe physical components of a computing system: CPU, memory, storage, input/output devices, and the circuits that connect them. (Ch. 2, 15)
HTTP / HTTPSHyperText Transfer Protocol (and its secure, TLS-encrypted variant). The protocol used to request and transfer web pages. (Ch. 20)
IndexAn integer that identifies the position of an element in a sequence. Most programming languages use zero-based indexing, so the first element is at index 0. (Ch. 11)
InputData or signals provided to a system or algorithm for processing. Inputs may come from a user, a file, a sensor, or another program. (Ch. 2, 5)
InternetA global network of interconnected networks using the TCP/IP protocol suite. The internet provides the infrastructure that the Web, email, and other services run on. (Ch. 19)
InterpreterA program that executes source code directly, line by line, without compiling it to machine code first. Python is typically run with an interpreter. (Ch. 6)
IP AddressA numeric label assigned to each device on a network. IPv4 addresses have the form A.B.C.D where each part is 0–255. (Ch. 19)
L–N
LatencyThe time delay between sending a request and receiving a response. A network measure distinct from bandwidth. (Ch. 19)
ListAn ordered, mutable sequence of elements in Python. Supports indexing, appending, removing, and sorting. (Ch. 11)
Logic ErrorA bug in which the program runs without crashing but produces incorrect results because the algorithm or expression is wrong. (Ch. 10)
LoopA control flow construct that repeats a block of statements. A while loop repeats while a condition is true; a for loop iterates over a sequence. (Ch. 8)
MalwareMalicious software designed to damage systems, steal data, or gain unauthorized access. Includes viruses, worms, ransomware, and spyware. (Ch. 21)
ModelIn machine learning, a mathematical function learned from data that maps inputs to predictions. In simulation, a simplified representation of a system. (Ch. 13, 26)
NetworkTwo or more connected devices that can exchange data. A local area network (LAN) connects devices in one location; a wide area network (WAN) spans larger distances. (Ch. 19)
O–P
Operating SystemSystem software that manages hardware resources and provides services to applications. Examples: Windows, macOS, Linux, Android. (Ch. 16)
OutputThe result produced by a system after processing. Output may be text on a screen, data written to a file, a signal sent to a device, or a network packet. (Ch. 2, 5)
PacketA small unit of data transmitted over a network. Large messages are split into packets, which may take different routes and are reassembled at the destination. (Ch. 19)
ParameterA variable in a function definition that receives a value (argument) when the function is called. (Ch. 9)
PhishingA social engineering attack in which a fraudulent message impersonates a trusted entity to steal credentials or install malware. (Ch. 21, 22)
ProtocolA set of agreed-upon rules governing how systems communicate. TCP/IP, HTTP, SMTP, and SSH are all protocols. (Ch. 19)
PseudocodeAn informal, language-independent description of an algorithm using human-readable text. Used to design algorithms before coding. (Ch. 5)
Q–R
QueryA request for data from a database or search system, often written in SQL. A query specifies what data is wanted and may include filters, sorts, and joins. (Ch. 18)
RAMRandom Access Memory. Fast, volatile computer memory that holds the programs and data currently in use. Contents are lost when power is removed. (Ch. 15)
Return ValueThe value a function sends back to its caller after completing its task. Functions may return one value, multiple values, or nothing (None in Python). (Ch. 9)
RouterA networking device that forwards packets between networks, choosing the best path based on routing tables and the destination IP address. (Ch. 19)
Runtime ErrorAn error that occurs while a syntactically correct program is running, such as division by zero or accessing an index beyond the end of a list. (Ch. 10)
S–T
ScopeThe region of a program where a variable is defined and accessible. Variables defined inside a function are local to that function and not accessible outside it. (Ch. 9)
ServerA computer or program that provides services, data, or resources to clients. A web server responds to HTTP requests by delivering pages. (Ch. 19, 20)
SimulationA program that models the behavior of a real or hypothetical system over time. Used in science, engineering, economics, and training. (Ch. 13)
SoftwarePrograms, data, and instructions that tell hardware what to do. Contrasted with hardware. Includes operating systems, applications, libraries, and firmware. (Ch. 2, 17)
SQLStructured Query Language. The standard language for querying and manipulating relational databases. Key statements: SELECT, INSERT, UPDATE, DELETE. (Ch. 18)
StackA last-in, first-out (LIFO) data structure. Elements are pushed onto the top and popped from the top. Used for function call management, undo operations, and parsing. (Ch. 11)
StringA sequence of characters. In Python, strings are immutable and enclosed in single or double quotes. (Ch. 7, 11)
Syntax ErrorA violation of the rules of a programming language's grammar. Syntax errors prevent the program from running. (Ch. 6, 10)
Training DataLabeled examples used to teach a machine learning model. The quality, diversity, and representativeness of training data significantly affect model performance and fairness. (Ch. 26)
U–Z
URLUniform Resource Locator. The address of a specific resource on the web. Structure: scheme://domain/path?query. Example: https://www.example.com/page?id=5. (Ch. 20)
UsabilityThe ease with which users can accomplish their goals using a system. Factors include learnability, efficiency, memorability, error recovery, and satisfaction. (Ch. 23)
VariableA named location in memory that holds a value. Variables can be reassigned. In Python, variables are created by assignment and can hold any type. (Ch. 7)
Version ControlA system for tracking changes to files over time, enabling collaboration and the ability to revert to earlier states. Git is the most widely used version control system. (Ch. 17, 27)
Appendix N
Selected Answers
Answers to representative odd-numbered and starred practice questions from Chapters 1–28

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.

Part I — What Computer Science Studies (Chapters 1–4)
  • 1.1Computer science studies computation, information, algorithms, programs, systems, and the human use of technology. It is broader than programming.
  • 1.3Input → Processing → Output. Example: A search engine takes a query (input), runs a ranking algorithm (process), and displays results (output).
  • 2.1Analog information is continuous and can take any value in a range. Digital information is discrete, encoded as bits. A vinyl record is analog; an MP3 is digital.
  • 3.3Decomposition: break the problem "plan a class schedule" into sub-problems: list required courses, find available times, check conflicts, assign rooms.
  • 4.113 in binary: 13 ÷ 2 = 6 R 1; 6 ÷ 2 = 3 R 0; 3 ÷ 2 = 1 R 1; 1 ÷ 2 = 0 R 1. Reading remainders up: 1101.
  • 4.3Binary 10110 to decimal: 1×16 + 0×8 + 1×4 + 1×2 + 0×1 = 16 + 4 + 2 = 22.
  • 4.5The letter 'A' in ASCII has the decimal value 65, which in binary is 01000001.
Part II — Programming Foundations (Chapters 5–10)
  • 5.1An algorithm must be finite (it terminates), precise (each step is unambiguous), and produce a defined output for each valid input.
  • 6.1Syntax error: the grammar of the language is violated and the program cannot run. Logic error: the program runs but produces incorrect output.
  • 7.3Predict output of x = 3; y = x * 2 + 1; print(y): y = 3×2+1 = 7.
  • 8.1Tracing 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.
  • 9.1A function called with argument 5 where def double(n): return n * 2 returns 10.
  • 10.1The bug in if score = 90: is a syntax error — should be == (comparison), not = (assignment).
Part III — Data and Algorithms (Chapters 11–14)
  • 11.1In the list ["red", "green", "blue"], the element at index 2 is "blue". (Zero-based indexing: red=0, green=1, blue=2.)
  • 12.1Linear search checks each element one by one, O(n) worst case. Binary search halves the search space each step, O(log n) worst case — but requires a sorted list.
  • 12.3Binary search on a list of 128 elements: log₂(128) = 7. At most 7 comparisons.
  • 13.1Abstraction: a function named calculate_tax(price) hides the implementation. The caller only needs to know the inputs and what it returns, not how it works internally.
Parts IV–VII — Systems, Networks, Security, AI, Ethics (Chapters 15–28)
  • 15.1RAM is volatile (loses data when power is off) and fast. Hard drive storage is non-volatile (retains data) and slower. RAM holds running programs; storage holds saved files.
  • 19.1DNS translates a domain name like example.com to an IP address like 93.184.216.34, so your browser can connect to the server.
  • 21.1Phishing: a fraudulent email impersonating a bank asks you to click a link and enter your password. Defense: verify sender address, go directly to the bank's site.
  • 22.1Metadata in a photo may include: timestamp, GPS coordinates, camera model, and settings — even if the photo itself reveals nothing sensitive.
  • 26.1A spam classifier trains on labeled emails (spam/not-spam). Features might include specific words, sender reputation, and punctuation density. It outputs a prediction for new emails.
  • 28.1One ethical concern with facial recognition: it has historically shown higher error rates for darker-skinned faces, raising fairness and discrimination concerns, especially in law enforcement use.
Appendix O
Index
Topics, concepts, terms, commands, protocols, tools, and examples across all 28 chapters — chapter numbers in bold indicate primary treatment

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.

A
Abstraction 3, 13, 17
Actuators 24
Algorithms 3, 5, 12
correctness 5
efficiency 12
tracing 5, A*
AND operator 8, A*
API 17
Application software 17
Arguments 9
Arrays 11, F*
ASCII 4, B*
Asymmetric encryption 21, I*
Authentication 21, 22
Automation 1, 24
B
Backup 21, G*
Bandwidth 19, H*
Bias in AI 25, 26, 28
Big-O notation 12, F*
Binary 4, B*
counting 4, B*
conversion 4, B*
Bit 4, B*
Bit depth 4, B*
Boolean 7, 8, A*
Browsers 20
Bugs 3, 10, E*
Byte 4, B*
C
Call stack 9, 11
Caching 12, 15
CIA Triad 21, I*
Classification (ML) 26, J*
Client-server model 19, 20
Cloud computing 19
Command line 16, 17, G*
Compiler 6
Compression 4, B*
Computation 1, 2
Computational thinking 3
Control flow 8
Correlation vs causation 25, J*
CPU 2, 15, G*
CSV 14, D*
Cybersecurity 21, I*
D
Data cleaning 14, 25, J*
Data science 25, J*
Data structures 11, F*
Databases 18
relational 18
SQL 18
Debugging 10, E*
Decomposition 3, 9
Deep learning 26, J*
Defense in depth 21
Dictionary (Python) 11, D*
DNS 19, H*
E–F
Edge cases 10, E*
Encryption 21, I*
Environmental impact 28, K*
Ethics 1, 28, K*
Feedback loops 24
Features (ML) 25, 26, J*
Files 14, 16, D*
Filesystems 16, G*
Flowcharts 5, C*
For loops 8, D*
Functions 9, D*
parameters 9
return values 9
scope 9
G–H
Generative AI 26, J*
Git / version control 17, 27
GPU 15, G*
Hardware 2, 15
HCI / Usability 23
HTTP / HTTPS 20, H*
HTML 20, H*
I–L
Images (digital) 4, B*
Index (list) 11
Input-Process-Output 2, 5
Internet 19
Interpreter 6
IP addresses 19, H*
JavaScript 20, H*
Keys (database) 18
Latency 19, H*
Least privilege 21, I*
Linear search 12, F*
Lists (Python) 11, D*
Logic errors 10, E*
Loops 8
M–N
Machine learning 26, J*
Malware 21
Metadata 22, I*
MFA 22, I*
Models 13, 26, J*
Neural networks 26, J*
Networks 19, H*
O–P
Operating systems 16, G*
Overfitting 26, J*
Packets 19, H*
Pattern recognition 3
Permissions 16, 21
Phishing 21, 22
Privacy 22, K*
Processes (OS) 16
Programs 1, 2, 6
Protocols 19, H*
Pseudocode 5, C*
Python 6, 7, 8, 9, D*
Q–R
Queries (SQL) 18
Queue 11, F*
RAM 2, 15, G*
Recursion 9
Robotics 24
Routers 19
Runtime errors 10, E*
S–Z
Scope (variables) 9
Search algorithms 12
Sensors 24
Simulation 13
Social engineering 21, 22
Software engineering 27
Sorting algorithms 12, F*
SQL 18
Stack (data structure) 11, F*
Strings 7, 11, D*
Syntax errors 6, 10, E*
Tables (data) 14, 18
Testing 10, 27, E*
TLS 20, 21, I*
Training data 26, J*
Tracing algorithms 5, C*
Unicode / UTF-8 4, B*
URL 20, H*
Usability 23
Variables 7, D*
Version control 17, 27
Visualization 25
Web (World Wide Web) 20
While loops 8, D*
MGU Library Connection — Back Matter
  • Python Programming Foundations — the next specialized course; builds directly on Appendix D and Chapters 5–10
  • Web Development Foundations — extends Appendix H (HTML, CSS, JavaScript, HTTP)
  • Data Structures and Algorithms — extends Appendix F in full mathematical depth
  • Cybersecurity Foundations — extends Appendix I with penetration testing, incident response, and governance
  • Databases and SQL Foundations — extends Appendix H (SQL, data modeling, transactions)
  • Artificial Intelligence Foundations — extends Appendix J with training mathematics, model architectures, and evaluation
  • MGU Glossary (online) — searchable, cross-referenced, and updated with each textbook edition