Essential Computational Thinking

Essential Computational Thinking: Computer Science from Scratch (Preliminary Edition) is published and distributed by Cognella, Inc. Please feel free to download the first three chapters here.


Essential Computational Thinking
Computer Science from Scratch
by Ricky J. Sethi



Video Series to Complement Part I

Video series to complement Ch. 0 - 2 of Essential Computational Thinking:

This excellent video series is created by Brit Cruise and Art of the Problem.



Auto-Graded Problem Sets to Complement Part II

Auto-graded problem sets for Ch. 3 - 7 of Essential Computational Thinking can be found on Snakify's Lessons 1 - 11. In particular, please use the following guide:



Book's Table of Contents

Part I: Theory: What is Computer Science?

  1. On The Road to Computation
    1. What is Knowledge?
    2. Declarative vs Imperative Knowledge
    3. The Key to Science
    4. Computer Science: The Study of Computation
    5. A Review of Functions
    6. Computable Functions
    7. Talking in Tongues: Programming Languages
  2. Computational Thinking and Information Theory
    1. What is Thinking?
    2. Deductive vs Inductive Thinking
    3. Thinking About Probabilities
    4. Logical Thinking
    5. Computational Thinking and Computational Solutions
    6. Two Fundamental Models of Programming
    7. Pseudocode
    8. Functional and Imperative Models of Computation
    9. Information Theory
    10. Shannon's Information Entropy
  3. Computational Problem Solving
    1. What is a Model?
    2. Data Representations
    3. Number Representations
    4. Digital Representations
    5. Boolean Algebra
    6. What is Information Processing?
    7. What is Computer Information Systems (CIS)?
    8. Programming Languages
    9. Computational Thinking
    10. Problem Space and System State
    11. Computational Thinking in Action
  4. Part II: Basics: Algorithmic Expression

  5. Computational Thinking and Structured Programming
    1. Review of Computation
    2. Computational Thinking Basics
    3. Minimal Instruction Set
    4. Getting Started with Python
    5. Syntax, Semantic, or Logic Errors
    6. State of a Computational System
    7. Natural vs Formal Languages
    8. Translating your programs
    9. Playing with Python
    10. An example using Computational Thinking
  6. Data Types and Variables
    1. Data = Values + Operations
    2. Different Types of Data
    3. Variables and Expressions
    4. Input/Output
    5. An Example Using Computational Thinking
  7. Control Structures
    1. Algorithms and Control Structures
    2. Sequence
    3. Selection
    4. Repetition
    5. An Example Using Computational Thinking
  8. Data Structures
    1. Abstract Data Types
    2. A Non-Technical Abstract Type
    3. Advantages of ADTs
    4. Data Structures
    5. Strings
    6. Lists and Tuples
    7. An Example Using Computational Thinking
  9. Procedural Programming
    1. Functions Redux
    2. Functions in Python
    3. Sub-routines with parameters and values
    4. Namespaces and Variable Scope
    5. Exception Handling
    6. File I/O
    7. An Example Using Computational Thinking
  10. Part III: Advanced: Data and Computation (not in Preliminary Edition)

  11. Object-Oriented Programming
    1. OOPs!... A History Again
    2. Objects and Object-Oriented Programming
    3. Introduction to Java
    4. Data Abstraction and Information Hiding
    5. Encapsulation and Composition
    6. Inheritance
    7. Polymorphism
    8. Data Structures in Java
    9. File I/O and Exception Handling in Java
    10. An Example Using Computational Thinking
  12. Computational Complexity
    1. Big O Notation
    2. Searching and Sorting Algorithms
    3. P vs NP
  13. Databases and MDM
    1. Master Data Management
    2. Data Modeling and SQL
    3. Relational Database Components and Normalization
  14. Data Science
    1. Business Informatics and Data Analysis
    2. Data Science
    3. Machine Learning


Some Key Images

Essential Ideas in Computation

Caption: Some essential ideas in the theory of computation: an effective procedure is a finite set of instructions for carrying out some unambiguous symbolic manipulation or transformation. If an effective procedure can calculate all the values of a function, it is called an algorithm for that function and that function is then considered a computable function. A Turing Machine is a mathematical description of any algorithm in terms of a hypothetical machine with a simple read-write head and a tape of paper; a Turing Machine is one formalization of the general idea of an algorithm. In fact, computation itself can then be thought of as the study of algorithms or such formal models of algorithms.

Computational Thinking Steps

Caption: Computational Thinking Approach for Solving Problems: the skills involved in each step of the Computational Thinking Approach are:

  1. Problem Specification, which involves Abstraction, Decomposition, and Pattern Recognition
  2. Algorithmic Expression, which involves Algorithm Design
  3. Solution Implementation & Evaluation, which involves testing and Generalization

Syntax, Semantic, and Logical Errors

Caption: An Informal Model of Fundamental Program Elements: most programs consist of elements like literals, variables, functions, objects, and classes. Program statements are made up of expressions which contain elements. In addition, programs utilize control structures to determine the flow of execution, the order in which statements are executed. Three fundamental control structures, sequence, selection, and repetition, are sufficient to specify any programmatic solution. These control structures are implemented as statements; e.g., the selection control structure is implemented using the if statement in most programming languages.

Syntax, Semantic, and Logical Errors

Caption: Different Kinds of Errors: Syntax, Semantic, and Logical errors occur at either compile-time (syntax and static semantic) or run-time (dynamic semantic and logical). Semantic and logical errors are also sometimes referred to as exceptions and we can use exception handling to take care of such exceptional situations. Most languages use exceptions for both compile-time and run-time errors. In languages like Java, exceptions that occur at compile-time are called checked exceptions whereas run-time exceptions are called unchecked exceptions. In languages like Python, C++, and C#, the compiler does not force the programmer to deal with exceptions so all exceptions are unchecked.

Computational Thinking Steps

Caption: General Machine Learning approach:

  1. Start by picking a learning algorithm that's appropriate for the task at hand
  2. Use the Training Dataset to learn the algorithm's parameter values
  3. Use the Validation Dataset to tune the algorithm's hyperparameters and architecture — the resulting algorithm is the tentative model
  4. Use the Testing Dataset to gauge the tentative model's performance and, if no changes are needed, this is the final model
  5. Now you can apply the final model to unseen data to make your final prediction for that task


Ricky J. Sethi

    • Nota Bene: This picture is from my wedding many years (and even more pounds) ago. I don't look like this anymore but I've learned in life that, once you find a good picture, you hang on to it forever!

Ricky J. Sethi is currently an Associate Professor of Computer Science at Fitchburg State University, Director of Research for The Madsci Network, and Team Lead for SNHU Online.


Please feel free to download my Curriculum Vitae (PDF).

Profile Summary

  • Affiliations:
    • Fitchburg State University
    • The Madsci Network
    • Southern New Hampshire University
  • Education:
    • University of California, Berkeley
    • University of Southern California
    • University of California, Riverside
  • Field of Research:
    • Computer Vision/Multimedia
      Group analysis in video using physics-based, machine learning models
    • Social Computing
      Virtual communities & group collaboration for science learning
    • Data Science
      Multimedia analysis and reproducibility via semantic workflows