Computers, Programming, and Cognitive Science
Course Curriculum and Academic Grading Structure
Course Overview: Basic Programming covers the foundational intersections of computer programming, algorithm design, and cognitive science, progressing from theoretical pseudocode models to practical implementation in Python.
Instructional Team:
Bogdan Cristescu
Adian Apostu
Assessment and Grading Breakdown:
Quiz 1: of the final grade (administered after Lesson 7).
Quiz 2: of the final grade (administered after Lesson 12).
Laboratory Assignments: of the final grade.
Final Examination: of the final grade.
Fourteen-Lesson Curriculum Schedule:
Lesson 1: Computers, Programming, and Cognitive Science: From pseudocode to programming languages.
Lesson 2: Variables in Python, basic calculus, standard math library utilization, and introspective built-in functions including
type()andhelp().Lesson 3: Matrix operations and linear data handling utilizing the
numpylibrary.Lesson 4: Strings and comprehensive string manipulation techniques.
Lesson 5: Branching and decision structures: Logical operators,
ifstatements, and nested conditional logic.Lesson 6: Advanced branching and loop structures:
forandwhileiterative constructs.Lesson 7: Linear collections: Lists and tuples (concludes with Quiz 1 at ).
Lesson 8: Associative collections: Dictionaries and JSON object construction.
Lesson 9: Persistent data storage: File handling, reading, and writing workflows.
Lesson 10: Dataframe analysis and statistical visualization utilizing
pandasandmatplotlib.Lesson 11: Modular software architecture: Function definition and scope.
Lesson 12: Recursive programming paradigms (concludes with Quiz 2 at ).
Lesson 13: Object-Oriented Programming (OOP) fundamentals: Encapsulation, inheritance, and polymorphism.
Lesson 14: Advanced OOP concepts, robust error and exception handling, and industry-standard programming best practices.
Cognitive Science and the Necessity of Computation
Definition of Cognitive Science: Cognitive science represents the formal interdisciplinary study of the mind and the nature of intelligence, synthesizing theoretical frameworks across multiple traditional fields (Pleh C., Gurova L., 2013).
Computational Synthesis and Artificial Intelligence:
The central question guiding computational cognitive science asks: What mechanisms emerge when an attempt is made to recreate mental experiences and cognitive functions within synthetic machines?
This inquiry directly forms the foundation of Artificial Intelligence (AI).
Interdisciplinary Topology (Gardner's Hexagon):
The interrelationships among the constituent disciplines of cognitive science are formalized through Gardner's Hexagon, illustrating varying strengths of interdisciplinary collaboration.
Unbroken Lines: Represent strong, established interdisciplinary ties.
Broken Lines: Represent weaker or emerging interdisciplinary ties.
Constituent Disciplines:
Philosophy
Psychology
Linguistics
Anthropology
Neuroscience
Artificial Intelligence

Interdisciplinary Ties within Gardner's Hexagon:
Strong ties (solid lines): Philosophy to Psychology; Philosophy to Linguistics; Psychology to Artificial Intelligence; Psychology to Linguistics; Linguistics to Artificial Intelligence; Neuroscience to Psychology; Neuroscience to Artificial Intelligence; Neuroscience to Linguistics; Anthropology to Linguistics.
Weak ties (dashed lines): Philosophy to Neuroscience; Philosophy to Artificial Intelligence; Philosophy to Anthropology; Psychology to Anthropology; Artificial Intelligence to Anthropology; Neuroscience to Anthropology.
Applied Machine Learning and Cognitive Data Science
Electroencephalogram (EEG) Analysis via Machine Learning:
Computational tools are engineered to record, clean, process, and classify neuroelectrical signals to diagnose functional neural abnormalities, cognitive states, and neurological events.

Stages of the EEG Computational Pipeline:
Data Acquisition: Capturing multichannel continuous voltage fluctuations via scalp electrodes.
Data Pre-Processing: Amplification, frequency filtering (bandpass/notch), artifact removal (suppressing ocular, cardiac, and muscular artifacts), and analog-to-digital digitization.
EEG Montage: Spatial configuration and topographical channel mapping displayed across standard electrode distributions.
Feature Extraction: Quantitative parameter derivation across three key domains:
Spectral features: Frequency-band power distributions (delta, theta, alpha, beta, gamma).
Temporal features: Time-series waveform characteristics, latency, and amplitude changes.
Pattern features: Spatial-temporal morphology and distinct waveform synchronization.
Machine Learning Classifiers: Deployment of predictive statistical modeling algorithms, including:
Bayesian classifiers
Random Forest ensembles
Artificial Neural Networks (ANN)
Support Vector Machines (SVM)
Decision Trees
Prediction and Output: Automated data labeling, discrete cognitive event recognition, and clinical seizure detection.
Behavioral Analysis and Affective Computing:
Multimodal emotion detection: Synchronizing audio, facial micro-expressions, and biometric feeds to interpret human affective states.
Automated veracity assessment (computational lie detection).
Neural Network Modeling: Creating algorithmic architectures mirroring biological neuron dynamics to simulate cognitive tasks.
Sensory AI Paradigms:
Visual Modality: Computer Vision for visual cortex simulation, scene understanding, and object recognition.
Linguistic Modality: Natural Language Processing (NLP) and Natural Language Understanding (NLU) for syntactic and semantic modeling.
Auditory Modality: Automatic speech recognition, phoneme decoding, and general environmental sound recognition.
Olfactory Modality: Chemical sensor arrays coupled with neural pattern matchers (Artificial Olfaction / AI Nose, e.g., open-source implementations hosted at
https://github.com/kartben/artificial-nose).
Data Science Pipeline: Ingestion, wrangling, statistical exploratory analysis, and hypothesis validation across large cognitive datasets.
Algorithmic Representation: Pseudocode Foundations
Definition: Pseudocode is an informal high-level description of an algorithm that outlines the operational flow of a program while omitting system-level syntax, memory management, and compilation details.
Functional Characteristics:
Cannot be directly compiled or executed by hardware.
Written using concise, natural language statements and mathematical syntax.
Serves as an intermediate bridge between human conceptual problem-solving and machine code implementation.
Cultivates computational thinking prior to syntax-locked program development.
Standard Pseudocode Reserved Keywords:
PRINT: Prompts strings, values, or notifications to the standard output display.INPUT: Captures and ingests user-supplied input from the standard input interface.OUTPUT: Emits processed variables or final results to the user interface.WHILE: Initiates a pre-test conditional loop (iteration verified before executing the loop body).FOR: Initiates a deterministic counter-driven loop (bounded iteration).REPEAT – UNTIL: Initiates a post-test conditional loop (iteration verified at the end of the loop block, executing at least once).IF – THEN – ELSE: Implements binary or multi-way selection logic based on a boolean predicate.
Syntactic Conventions: Indentation is mandatory to define the scope and hierarchical block boundaries of nested selections or iterations.
Algorithmic Representation: Flowchart Schematics
Definition: A flowchart is a standardized, diagrammatic schema that visually maps the step-by-step sequential workflow, logic branches, and data movements of an algorithm.
Standardized Flowchart Block Standards:
Shape Name | Graphical Symbol | Operational Function |
|---|---|---|
Terminal | Rounded Rectangle / Capsule | Denotes the explicit entry point (Start) or termination point (End) of a program or modular sub-process. |
Input / Output | Parallelogram | Designates data ingestion operations ( |
Flowline | Directed Arrow () | Defines sequence, execution vector, and direction of control between functional blocks. |
Process | Standard Rectangle | Designates an internal action, arithmetic transformation, state mutation, or memory assignment. |
Decision | Diamond (Rhombus) | Represents an evaluative conditional test yielding alternate outgoing control paths (e.g., True/False, Yes/No). |
Predefined Process | Double-bordered Rectangle | Refers to an external subroutine, function, or modular procedure defined outside the current diagram. |
Comment / Annotation | Open Rectangle connected by dashed line | Houses descriptive, non-executable metadata clarifying an operational step. |
Database | Cylinder | Indicates structured persistent data store interaction. |
Single Document | Rectangle with Waved Base | Represents hard-copy or discrete printable document output. |
Multiple Documents | Stacked Rectangles with Waved Base | Represents batches of multi-page or multi-file document records. |
Practical Flowchart Application (System Fault Isolation):

Start State: Problem observed (
Lamp doesn't work).First Evaluation (Decision Diamond): Is the lamp plugged in?
If No (): Execute process ->
Plug in lamp.If Yes (): Advance to second evaluation.
Second Evaluation (Decision Diamond): Is the bulb burned out?
If Yes (): Execute process ->
Replace bulb.If No (): Execute process ->
Repair lamp.
Concrete Pseudocode and Flowchart Walkthroughs
Case 1: Body Mass Index (BMI) Computation:
Mathematical Definition: BMI calculates the ratio of individual mass in kilograms () to the square of height in meters ():
Sequential Pseudocode:
PRINT "enter your weight"
INPUT weight
PRINT "enter your height"
INPUT height
BMI = weight / (height * height)
PRINT "Your BMI is: "
OUTPUT BMI

* *Flowchart Tracing:*
* Terminal: `Start`
* Process/Output: `print "enter your weight"`
* Input (Parallelogram): `input w`
* Process/Output: `print "enter your height"`
* Input (Parallelogram): `input h`
* Process (Rectangle): `BMI = w / h^2`
* Process/Output: `print "Your BMI is: "`
* Output (Parallelogram): `output BMI`
* Terminal: `End`
Case 2: Calendar Day Mapping (Multi-Branch Selection):
Target Lookup Mapping:

Switch-Case Pseudocode Logic:
INPUT date
SWITCH (date) {
CASE 1:
OUTPUT "Mon"
BREAK
CASE 2:
OUTPUT "Tues"
BREAK
CASE 3:
OUTPUT "Wed"
BREAK
CASE 4:
OUTPUT "Thu"
BREAK
CASE 5:
OUTPUT "Fri"
BREAK
CASE 6:
OUTPUT "Sat"
BREAK
CASE 7:
OUTPUT "Sun"
BREAK
DEFAULT:
OUTPUT "invalid"
}
* *Flowchart Bug Identification:* In the procedural flowchart, the input step incorrectly models variable initialization by placing `date` inside an unassigned process box without explicitly executing an input operation; additionally, the evaluation paths from downstream conditions link directly into overlapping output lines rather than unifying through a single collector bus to the terminal `End`.
Exercise: Volume of a Sphere Algorithm:
Mathematical Formula:
Pseudocode Specification:
PRINT "Enter radius r:"
INPUT r
pi = 3.14159265
volume = (4.0 / 3.0) * pi * (r ^ 3)
PRINT "The volume of the sphere is:"
OUTPUT volume
Flowchart Flow Structure:
Terminal:
StartInput/Output: Ingest numeric value for radius .
Process: Compute intermediate cube , multiply by factor , and assign product to variable .
Input/Output: Display calculated output variable .
Terminal:
End
Language Taxonomy and System Alignment
Function of Programming Languages: Formalized symbolic linguistic systems designed to translate high-level algorithmic pseudocode into unambiguous, deterministic machine-executable sequences.
Task-Specialized Language Ecosystems:
Python: Predominant standard for Artificial Intelligence, deep learning, statistical modeling, and data science.
R: Specialized language for statistical computing, bioinformatics, and advanced graphical rendering.
Java: Enterprise-scale object-oriented systems, high-concurrency environments, and backend web architectures.
C++: High-performance, low-latency computing, systems programming, and high-fidelity real-time game development.
SQL (Structured Query Language): Declarative data definition, query retrieval, and manipulation in relational database management systems (RDBMS).
Cross-Paradigm Utility: Different languages can implement identical algorithmic pseudocode, but their runtime efficiency, memory footprints, and library support dictate contextual selection.
Python Architecture and Design Principles
Historical Origins: Created and formally launched in 1991; named as an homage to the British comedy troupe Monty Python.
Core Architectural Properties:
General-Purpose: Highly expressive, multi-paradigm language capable of handling disparate problems without architectural domain restrictions.
Prioritized Readability: Enforces clean, human-readable syntax leveraging syntactic whitespace instead of curly brackets.
Interpreted Runtime: Employs an interpretive engine permitting rapid real-time experimentation via interactive shell evaluation, without requiring manual ahead-of-time (AOT) compilation.
Modularity: Core runtime maintains a lightweight base, allowing extended features to be integrated via modular software packages ("modules").
Pivotal Scientific and Analytical Python Modules:
NumPy: Provides optimized high-performance N-dimensional array and matrix arithmetic.Pandas: Supplies heterogeneous data frame tabular structures for exploratory data analytics.Matplotlib/Seaborn: Visual plotting engines for high-resolution 2D and 3D statistical figures.SciPy(Scientific Python): Foundational computational suite containing mathematical, optimization, and signal processing routines (https://www.scipy.org/).
Community and Open-Source Infrastructure:
Extensive open-source repository sharing via GitHub facilitates collaborative reuse.
Collaborative developer resolution and debug knowledgebases provided by platforms such as Stack Overflow.
Authoritative language documentation maintained centrally via the Python Software Foundation (
https://docs.python.org/3/).
Industry Popularity Metrics and Market Share
Language Tracking Indices: Programming language popularity and industry adoption are tracked quantitatively using two primary evaluation indices: the TIOBE Index (measuring search engine frequency) and the PYPL Popularity of Programming Language Index (measuring online tutorial queries).

Comparative Analysis (August 2021 Data):
Python holds the dominant global share under the PYPL index (), showing a substantial margin over rival languages.
In the TIOBE index, traditional compiled languages like C/C++ maintain high baseline enterprise and legacy infrastructure share ( for C/C++).
TIOBE Index Detailed Rankings (September 2021):
Sep 2021 Rank | Sep 2020 Rank | YoY Change | Programming Language | Market Share Rating | Share Change |
|---|---|---|---|---|---|
1 | 1 | — | C | ||
2 | 3 | Python | |||
3 | 2 | Java | |||
4 | 4 | — | C++ | ||
5 | 5 | — | C# | ||
6 | 6 | — | Visual Basic | ||
7 | 7 | — | JavaScript | ||
8 | 14 | Assembly language | |||
9 | 8 | PHP | |||
10 | 10 | — | SQL | ||
11 | 22 | Classic Visual Basic | |||
12 | 17 | Groovy | |||
13 | 15 | Ruby | |||
14 | 11 | Go |
System Configuration and Installation Protocol
Distribution Acquisition: Python 3.9 (specifically 3.9.7 64-bit installer) is downloaded via the official release registry (
https://www.python.org/downloads/release/python-397/).

Installation Procedure:
Execute the downloaded binary setup wizard.
Critical Prerequisite Setting: Check the checkbox labeled "Add Python 3.9 to PATH" at the base of the setup prompt. Neglecting this configuration prevents operating system command line terminals from resolving binary calls to the Python interpreter.
Select "Install Now" (which installs standard libraries, IDLE development environment,
pippackage manager, and system documentation toC:\Users\<User>\AppData\Local\Programs\Python\Python39).
Installation Verification: Validate environmental system integration by opening the Command Prompt (CMD) and querying the binary version flag:
python --version
Execution Environments: Interactive Shell vs. Script Files
Interactive REPL Execution (Read-Eval-Print Loop):
Initiated by entering
pythondirectly into a shell or launching the Python IDLE (Integrated Development and Learning Environment) Shell.Evaluates statements dynamically in real-time, displaying expression results immediately without explicit
print()calls.IDLE Interactive Session Trace:
>>> print("Hello World")
Hello World
>>> first_number = 1 + 1 + 5
>>> print(first_number)
7
>>> second_number = 105 + 10
>>> print(second_number)
115
>>> total = first_number + second_number
>>> print(total)
122
>>> 115 + 7
122
>>> print(115 + 7)
122
File-Based Script Execution:
Workflow in IDLE:
Open IDLE development window.
Select
FileNew Fileto launch an unbuffered code editor buffer.Compose programmatic logic statements.
Save file to disk with the mandatory
.pysource file extension.Execute source script directly by navigating to
RunRun Module, or striking functional hotkeyF5.The resultant terminal session resets and prints outputs into the main IDLE interactive shell window.
Executable Script Content:
print("Hello World")
first_number = 1 + 1 + 5
print(first_number)
second_number = 105 + 10
print(second_number)
total = first_number + second_number
print(total)
print(115 + 7)
Command Prompt Execution: Scripts are run directly from OS shells by navigating to the working script directory and executing the file name using the registered python interpreter command:
python your_script.py
The Python Execution Model and Internal Runtime Engine
Sequential Statement Processing: The interpreter ingests source instructions in a linear top-to-bottom sequence.
Intermediate Bytecode Compilation:
The interpreter compiles human-readable source syntax into platform-independent intermediate instructions known as bytecode.
Scope of Bytecode Caching: The creation of cached bytecode files (e.g.,
.pycfiles) optimizes load and execution speed primarily for imported module packages, rather than standalone top-level execution scripts.
Python Virtual Machine (PVM):
The bytecode payload is passed directly into the Python Virtual Machine (PVM).
The PVM represents the low-level runtime engine of the Python software stack.
It functions as an execution loop that systematically iterates through the compiled bytecode instructions, executing them sequentially.
The PVM operates as the final execution stage within the integrated Python interpreter abstraction layer, converting program logic into direct machine-level computing interactions.