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
Navigate to Supplementary Material Below
 Supplementary Materials
Complementary Video Series for Part I
Video series to complement Ch. 0  2 of Essential Computational Thinking:
 Ch. 0: On The Road to Computation
 Ch. 1: Computational Thinking and Information Theory
 Ch. 2: Computational Problem Solving
This excellent video series is created by Brit Cruise and Art of the Problem.
Top
Complementary Problem Sets for Part II
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:
 Ch. 3: Computational Thinking and Structured Programming
 Lesson 1: Input, print and numbers
 Ch. 4: Data Types and Variables
 Lesson 2: Integer and float numbers
 Ch. 5: Control Structures
 Lesson 3: Conditions: if, then, else
 Lesson 4: For loop with range
 Lesson 6: While loop
 Ch. 6: Data Structures
 Lesson 5: Strings
 Lesson 7: Lists
 Lesson 9: Twodimensional lists (arrays)
 Lesson 10: Sets
 Lesson 11: Dictionaries
 Ch. 7: Procedural Programming
 Lesson 8: Functions and recursion
Top
Book's Preface
Why a book on CS0 from scratch?
Most of us write the books that we would have wanted to read and this is no different. As such, it follows a normal CS0 breadthfirst approach but lays particular emphasis on computational thinking and related topics in data science.
My hope is this book will help build a theoretical and practical foundation for learning computer science from the ground up. It's not quite from first principles as this is not a rigorous text. But, following William of Occam's Razor, it is placed on a firm mathematical footing that starts with the fewest assumptions.
And so we delve into defining elementary ideas like data and information; along the way, we quantify these ideas and eke out some of their links to fundamental physics in an effort to show the connection between computer science and the universe itself. In fact, all the laws of physics can be represented as computable functions, and we can, in a very real sense, think of computer science as the most basic representation of the physical universe.
The eminent physicist John A. Wheeler went so far as to say, ". . . the universe is made of information; matter and energy are only incidental." I view the role of this book, at its theoretical core, to be to help explore, elucidate, and communicate this deep and perhaps surprising relationship between physics, information, and computation.
Target Audience
This book would be most appropriate for highlymotivated undergraduates who have a significant technical bent and a genuine interest in computer science. It is also appropriate for nonCS graduate students or nonCS professionals who are interested in learning more about computer science and programming for either professional or personal development.
So what kind of a background do you need to appreciate these various connections and learn some of this advanced material? Although you should be quantitatively inclined, you don't need any specific background in mathematics. Whatever math we need, we'll derive or explain along the way. Things might look heinous at times but all the tools you need should be in here.
Book Organization
Computer science is a diverse field and, in Part 1, we explore some of its theoretical bases in a connected but wideranging manner with an emphasis on breadth, not depth. Some chapters might still pack quite a punch but, if students are interested in computer science, they should get an overview of the field in large measure, not necessarily in its entirety. Not only is computer science an enormously broad area but this book, to paraphrase Thoreau, is limited by the narrowness of my experience and vision to those areas that caught my eye.
For that matter, this book is not a comprehensive introduction to a particular programming language, either. By necessity, we are constrained to only meeting those parts of Python or Java that support our understanding of fundamental computational ideas. In general, computer scientists tend to be a language agnostic bunch who pick the most appropriate language for a particular problem and that's the approach in this book, as well. But we should still get a sense of the large variety of topics that underly our study of computer science, from the abstract mathematical bases to the physical underpinnings.
Once the theoretical foundation is laid in Part 1, we shift gears to a purely pragmatic exploration of computing principles. Computer science is an inherently empirical science; in computer science, we have the unique opportunity to be able to explore highly theoretical content grounded in a pragmatic framework. By allowing students to actually implement and execute theoretical ideas, we can give them an opportunity few sciences can offer: the immediate testing of ideas they have learned or developed from a textbook or from their own research.
So, in Part 2, we learn the basics of computation and how to actually use our greatest tool: programming. These chapters should be short and approachable; students will hopefully find these digestible in short sittings so they can immediately apply all the ideas they've learned to start writing substantial programs, or computational solutions, in short order.
In Part 3, we'll explore some relatively sophisticated computational ideas. We'll both meet powerful programming concepts as well as investigate the limits of computational problem solving including examination of P vs. NP and Big O notation. We'll also increase the tools in our toolkit by learning about ObjectOriented Programming, GUI development, machine learning, data science, and some of the underlying principles of software engineering used in industry.
How to use this book
Depending on student or instructor interests, Part 1 can be considered completely optional and skipped in its entirety. The most important aspects of Part 1 are summarized in Ch. 3 and, if you don't want to emphasize the theoretical underpinnings, you can safely choose to start directly with Part 2. Similarly, in Part 3, you can pick and choose any chapters that interest you as each chapter in Part 3 is independent of the other chapters. For a typical semesterlength course, I spend about 12 weeks on Part 1, cover all of Part 2, and pick topics of interest from Part 3 depending on the interests of the class.
Nota Bene: This book uses standard bibliographical notation as is common in computer science literature so references are indicated by a number in brackets, like [XX]. It also uses bold and italics to define phrases and emphasize concepts inline. Finally, it contains call out boxes like IDEA boxes, NOTE boxes, etc., which are important points that should be highlighted separately or extend a concept without breaking the main narrative.^{1}
Okay, that's enough buildup... strap yourself in and let's get started on our adventure!
^{1}The same applies to footnotes, of course.
Top
Book's Table of Contents
Part I: Theory: What is Computer Science?

On The Road to Computation
 What is Knowledge?
 Declarative vs Imperative Knowledge
 The Key to Science
 Computer Science: The Study of Computation
 A Review of Functions
 Computable Functions
 Talking in Tongues: Programming Languages

Computational Thinking and Information Theory
 What is Thinking?
 Deductive vs Inductive Thinking
 Thinking About Probabilities
 Logical Thinking
 Thinking about Computational Solutions
 Two Fundamental Models of Programming
 Pseudocode
 Functional and Imperative Models of Computation
 Information Theory
 Shannon's Information Entropy

Computational Problem Solving
 What is a Model?
 Data Representations
 Number Representations
 Digital Representations
 Boolean Algebra
 What is Information Processing?
 What is Computer Information Systems (CIS)?
 Programming Languages
 Computational Thinking
 Problem Space and System State
 Computational Thinking in Action

Computational Thinking and Structured Programming
 Review of Computation
 Computational Thinking Basics
 Minimal Instruction Set
 Getting Started with Python
 Syntax, Semantic, or Logic Errors
 State of a Computational System
 Natural vs Formal Languages
 Translating your programs
 Playing with Python
 An example using Computational Thinking

Data Types and Variables
 Data = Values + Operations
 Different Types of Data
 Variables and Expressions
 Input/Output
 An Example Using Computational Thinking

Control Structures
 Algorithms and Control Structures
 Sequence
 Selection
 Repetition
 An Example Using Computational Thinking

Data Structures
 Abstract Data Types
 A NonTechnical Abstract Type
 Advantages of ADTs
 Data Structures
 Strings
 Lists and Tuples
 An Example Using Computational Thinking

Procedural Programming
 Functions Redux
 Functions in Python
 Subroutines with parameters and values
 Namespaces and Variable Scope
 Exception Handling
 File I/O
 An Example Using Computational Thinking

ObjectOriented Programming
 OOPs!... A History Again
 Objects and ObjectOriented Programming
 Introduction to Java
 Data Abstraction and Information Hiding
 Encapsulation and Composition
 Inheritance
 Polymorphism
 Data Structures in Java
 File I/O and Exception Handling in Java
 An Example Using Computational Thinking

Computational Complexity
 Big O Notation
 Searching and Sorting Algorithms
 P vs NP

Databases and MDM
 Master Data Management
 Data Modeling and SQL
 Relational Database Components and Normalization

Data Science
 Business Informatics and Data Analysis
 Data Science
 Machine Learning
Part II: Basics: Imperative Programming
Part III: Advanced: Data and Computation (not in Preliminary Edition)
Bibliography
Index
Text Preview
Please feel free to download the first three chapters here.
TopProfile

 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.
CV
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 physicsbased, machine learning models  Social Computing
Virtual communities & group collaboration for science learning  Data Science
Multimedia analysis and reproducibility via semantic workflows
 Computer Vision/Multimedia