Introduction to Computation and Python Programming

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/43

flashcard set

Earn XP

Description and Tags

Comprehensive vocabulary flashcards covering the Introduction to Computation lecture series, including computer history, Von Neumann architecture, data representation, hardware components, Python programming fundamentals, control structures, and algorithm complexity.

44 Terms

1
New cards
<p>Pascaline (Pascal's Calculator)</p>

Pascaline (Pascal's Calculator)

A mechanical calculating machine designed in 1642 by Blaise Pascal using interconnected clockwork gear mechanisms and styluses, capable of performing 6-digit addition and subtraction.

2
New cards

Leibniz Wheel (Stepped Reckoner)

A mechanical computing device developed in 1673 by Gottfried Wilhelm Leibniz that introduced stepped gear cylinders to perform all four basic arithmetic operations (addition, subtraction, multiplication, and division).

3
New cards
<p>Difference Engine</p>

Difference Engine

A mechanical calculator designed by Charles Babbage in 1823 containing over 4,000 components; it calculated polynomial tables by reducing complex expressions to simple finite additions with precision up to 6 decimal places.

4
New cards

Analytical Engine

A steam-driven general-purpose computer design conceived in 1834 by Charles Babbage and programmed by Ada Lovelace, incorporating a memory store (1,000 numbers of 50 digits), a processing mill, punched card sequence controllers (0s and 1s), and data transfer mechanisms.

5
New cards

Turing Machine

A theoretical model of computation introduced by Alan Turing in 1937 consisting of an infinite tape, a read/write head, and a finite state controller that executes actions defined by quintuples ⟨qi,sj,sk,D,qm⟩\langle q_i, s_j, s_k, D, q_m \rangle.

6
New cards

Church-Turing Thesis

The hypothesis stating that any function that can be computed by an effective procedure or algorithm can be computed by a Turing machine.

7
New cards

Shannon's Switching Theory (1938)

A master's thesis by Claude Shannon at MIT proving that Boolean algebra's two-valued logic operations could be realized using electrical relay and switching circuits, establishing the digital basis for electronic computers.

8
New cards

Von Neumann Architecture

A computer system architecture described in 1945 for the EDVAC, characterized by binary representation, the stored-program principle, and five functional units: Controller, Arithmetic Logic Unit (ALU), Memory, Input devices, and Output devices.

<p>A computer system architecture described in 1945 for the EDVAC, characterized by binary representation, the stored-program principle, and five functional units: Controller, Arithmetic Logic Unit (ALU), Memory, Input devices, and Output devices.</p>
9
New cards

Stored-Program Principle

The architectural concept where program instructions and data are stored together in the same addressable internal memory, allowing instructions to be fetched and executed automatically in sequence.

10
New cards

Byte

The fundamental unit of digital data storage consisting of 8 consecutive binary digits (bits), where 1 KB=1024 B=210 B1\,\text{KB} = 1024\,\text{B} = 2^{10}\,\text{B}, 1 MB=220 B1\,\text{MB} = 2^{20}\,\text{B}, 1 GB=230 B1\,\text{GB} = 2^{30}\,\text{B}, and 1 TB=240 B1\,\text{TB} = 2^{40}\,\text{B}.

11
New cards

Two's Complement (补码)

A binary encoding method for signed integers used by computers where positive numbers match their true sign-magnitude form, and negative numbers are formed by inverting all bits of their absolute value (one's complement) and adding 1.

12
New cards

ASCII

American Standard Code for Information Interchange; a 7-bit character encoding system representing 128 characters (including 95 printable characters such as letters, digits, and punctuation, plus 33 control characters), with extended ASCII using an 8th bit for 128 additional symbols.

13
New cards
<p>Magnetic Disk Geometry</p>

Magnetic Disk Geometry

The physical organization of a hard drive platter consisting of platters/surfaces, concentric circular tracks, and radial divisions called sectors (the fundamental unit of disk storage).

14
New cards
<p>1-Bit Full Adder</p>

1-Bit Full Adder

A digital circuit composed of AND, OR, and XOR logic gates that calculates the sum of two operand bits (AA and BB) and a lower carry-in bit (CarryIn\text{CarryIn}), outputting a sum bit (Sum\text{Sum}) and a carry-out bit (CarryOut\text{CarryOut}).

15
New cards

Operating System (OS)

Core system software that manages and schedules hardware and software resources, provides user interfaces, and performs five primary tasks: process management, memory management, storage/file management, device management, and user interface provision.

16
New cards

Compiler vs. Interpreter

A compiler translates entire high-level source code into a standalone machine-code executable before runtime, whereas an interpreter reads, translates, and executes source code line-by-line during runtime.

17
New cards

Python

An interpreted, high-level programming language created in late 1989 by Guido van Rossum, known for concise syntax, rich libraries, and glue-language capabilities.

18
New cards

Algorithm

A finite, ordered, unambiguous sequence of steps or computational procedures designed to solve a specific problem and produce a result from given inputs within a finite amount of time.

19
New cards

OpenJudge Status Verdicts

Evaluation outcomes returned by an automated testing platform, including Accepted (passed all test cases), Compile Error (syntax failure), Runtime Error (execution aborted), Presentation Error (formatting discrepancy), and Wrong Answer (logic error).

20
New cards

sep and end (in print())

Keyword parameters in Python's print() function: sep specifies the delimiter inserted between multiple outputs (default ' '), while end specifies the character appended after the last value (default '\n').

21
New cards

Banker's Rounding (round())

Python's rounding rule where numbers equidistant from two integers (ending in .5) round toward the nearest even integer, while other fractions round toward the nearest integer.

22
New cards

Floor Division (//)

An arithmetic operator that divides two operands and rounds the result downward to the nearest mathematical integer (e.g., 10//3=310 // 3 = 3, 10//−3=−410 // -3 = -4).

23
New cards

Modulo Operator (%)

An arithmetic operator that calculates the remainder of division defined mathematically as x%y=x−((x//y)×y)x \% y = x - ((x // y) \times y).

24
New cards

String Slicing ([start:stop:step])

A syntax extracting a portion of a sequence from index start up to but not including stop, incrementing indices by step without altering the original string.

25
New cards

Formatted String Literal (f-string)

A Python string literal prefixed with f or F that allows replacement fields containing expressions, variables, and format specifications (e.g., {a:8.2f}) inside curly braces {} evaluated at runtime.

26
New cards

Truthiness (Logical Values in Python)

The inherent Boolean evaluation of non-Boolean data types in conditional contexts, where values such as 0, 0.0, and empty strings "" evaluate to False, while non-zero and non-empty values evaluate to True.

27
New cards

Short-Circuit Logical Operators (and / or)

Boolean operators in Python where x and y returns x if x evaluates to false, otherwise returns y; and x or y returns x if x evaluates to true, otherwise returns y.

28
New cards

Membership Operators (in / not in)

Operators used to test whether an element exists within a sequence such as a string, list, or tuple, returning True or False.

29
New cards

Identity Operators (is / is not)

Operators determining whether two identifiers refer to the exact same memory object address (id(x) == id(y)), in contrast to == which compares value equality.

30
New cards

range(start, end, step)

A built-in Python function generating an immutable sequence of integers from start (inclusive) to end (exclusive) with interval step.

31
New cards

Infinite Loop (Dead Loop)

A loop structure whose conditional expression evaluates permanently to true (e.g., while 1:), causing instructions to repeat endlessly unless terminated by an external signal or internal break statement.

32
New cards

break vs. continue

In loop control, break immediately terminates the innermost enclosing loop, whereas continue aborts only the current iteration and jumps to the next cycle.

33
New cards

Loop else Clause

A block of code attached to a for or while loop that executes strictly when the loop completes all iterations naturally, and is skipped if the loop is aborted via a break statement.

34
New cards

Time Complexity (O(f(n)))

An asymptotic metric describing the computational runtime required by an algorithm as a function of input size nn, characterized by the order of growth T(n)=O(f(n))T(n) = O(f(n)).

35
New cards

Enumeration Algorithm (Exhaustive Search)

A problem-solving strategy that checks every possible candidate solution systematically against explicit criteria within a finite search space to guarantee finding all valid solutions.

36
New cards

Mutable vs. Immutable Types

A distinction in Python where immutable types (numbers, strings, tuples) cannot be altered in memory without creating a new object at a different address, while mutable types (lists, dictionaries, sets) allow in-place modification.

37
New cards

List (in Python)

A mutable, ordered, dynamic collection of heterogeneous elements enclosed in square brackets [] that stores references to memory locations.

38
New cards

a.sort() vs. sorted(a)

The list method a.sort() modifies the existing list a in place and returns None, whereas the built-in function sorted(a) leaves a unchanged and returns a new sorted list.

39
New cards

List Comprehension

A concise Python syntactic construct used to generate a new list by applying an expression to each item across an iterable (e.g., [x**2 for x in range(10)]).

40
New cards

Tuple (in Python)

An immutable, ordered collection of heterogeneous elements enclosed in parentheses () (or separated by commas), which provides data write-protection and faster traversal compared to lists.

41
New cards

Single-Element Tuple

A tuple containing exactly one value, which syntactically requires a trailing comma (e.g., (42,)) to distinguish it from a parenthesized expression ((42)).

42
New cards

Flag Variable Pattern

A programming design pattern where a Boolean or sentinel variable (e.g., flag = False) tracks whether a searched condition has been met during an iteration before triggering subsequent conditional blocks.

43
New cards

print(…, sep=':')

Specifying a custom delimiter string (such as a colon) to be inserted between multiple printed arguments instead of the default single space.

44
New cards

print(…, end='')

Suppressing the automatic trailing newline character so that subsequent print statements continue outputting on the exact same line.