Unit 1 · An Introduction to Computational Thinking · Section 1
Computer science studies information processes: how problems can be represented, procedures designed, machines built, and results evaluated. It is broader than programming. Programming expresses procedures, while computer science also asks what can be computed, how efficiently, and with what consequences.
Computation is the systematic transformation of an input representation into an output representation by following rules. A computational process has an input domain, a set of valid operations, a state that changes as work is performed, and an output condition. The same idea applies to a spreadsheet formula, a database query, a sorting algorithm, or a CPU instruction sequence.
input data + rules + current state -> new state -> output
A computer is a programmable machine because its operations and data can be encoded, stored, and changed. The stored-program model keeps instructions and data in memory so a general-purpose processor can perform many tasks. This is why a computer can run a browser, compiler, game, or database without being rebuilt for each task.
Data is recorded representation: numbers, characters, measurements, events, or symbols.
Information is data interpreted in a context so that it answers a question or supports a
decision. Knowledge includes models, rules, and experience used to interpret information. A value such as
72 is data; “72% on the first assessment” is information because its meaning and context are known.
Representations affect what can be computed. Text may be encoded with Unicode, images as pixels, and numbers in binary patterns. A representation must preserve the distinctions a problem cares about. If a date is stored only as an unstructured string, ordering and validation become harder than when its year, month, and day are represented explicitly.
For example, “find a student's progress” is vague. A computable specification might accept completed tutorial IDs and a fixed course total, reject duplicate or unknown IDs, and output both a count and a percentage. The specification exposes decisions that would otherwise become hidden bugs in code.
An abstraction provides a small vocabulary of operations while hiding implementation details. A file abstraction exposes open, read, write, and close even though the operating system manages blocks and device drivers. A function exposes parameters and a return value while hiding its internal steps. Layers compose abstractions: applications use libraries, libraries use operating-system services, and the OS controls hardware.
A good abstraction has a clear interface, a representation-independent meaning, and stated invariants. If a queue promises first-in-first-out behavior, callers should not need to know whether it uses an array or linked nodes. An abstraction is poor when it leaks irrelevant representation details or permits states that its users cannot interpret.
input: completed tutorial identifiers
representation: set of valid identifiers
procedure: remove duplicates, reject unknown IDs, count valid IDs
output: count and count / total tutorials
invariant: progress is between 0% and 100%
The set representation expresses the rule that completing the same tutorial twice does not increase progress. The procedure is separate from the user interface, so it can be tested with different inputs. Evaluation includes correctness, understandable feedback, privacy of student records, and acceptable response time.
problem -> representation -> algorithm -> implementation -> evaluation
Abstraction hides irrelevant detail while preserving what a task needs. A file, function, network address, and database table are useful abstractions because they let people reason without manipulating every physical detail.
1. Which activity expresses a procedure in a language?
2. What does abstraction remove?
3. Which property says that a valid abstraction remains within its allowed states?
4. Why is 72 not automatically information?
5. Which step should identify invalid input and resource limits?
Write a one-page design review for your library system. Discuss representation, correctness, privacy, accessibility, and one performance concern. State one abstraction leak that your design avoids.
Books, members, and loans are represented as records with stable identifiers; a loan stores dates and references
the other records. The system rejects unknown members, duplicate active loans, and impossible dates. It protects
personal data with role-based access and clear retention rules, presents status without relying only on color,
and indexes identifiers for practical lookup. A client calls borrow(bookId, memberId) rather than
depending on table names or storage blocks, so the database representation can change without changing the
client.