Foundations of Computing
Foundations of Computing
An Accessible Introduction to Formal Languages
About the Book
A textbook for upper-division Computer Science majors covering formal languages and automata with an introduction to computability. Intended to give CS majors a solid foundation in the Theory of Computation without being overly formal mathematically, while retaining the rigor of the material. It has been classroom tested since 2016 with good success.
Table of Contents
- Foreword
- Preface
- 1.Introduction
- 1.1Formal Languages
- 1.2Finite State Machines
- 1.2.1Exercises
- 1.2.2Chapter Summary
- 2.Finite Automata
- 2.0.1Where Are We?
- 2.0.2Chapter Objectives
- 2.1Deterministic Finite Automata
- 2.1.1Exercises
- 2.2Non-Deterministic Finite Automata
- 2.2.1Equivalence of NFAs and DFAs
- 2.2.2NFAs and Complements
- 2.2.3Exercises
- 2.3Minimal Automata
- 2.3.1Exercises
- 2.4Machines with Output
- 2.4.1Computer Arithmetic
- 2.4.2Lexical Analysis
- 2.4.3Minimal Mealy Machines
- 2.4.4Exercises
- 2.4.5Chapter Summary
- 3.Regular Expressions and Grammars
- 3.0.1Where Are We?
- 3.0.2Chapter Objectives
- 3.1Regular Expressions
- 3.1.1Exercises
- 3.2Equivalence of Regular Expressions and Regular Languages
- 3.2.1From Regular Expression to NFA
- 3.2.2From NFA to Regular Expression
- 3.2.3Exercises
- 3.3Regular Grammars
- 3.3.1Left-Linear Grammars
- 3.3.2Exercises
- 3.3.3Chapter Summary
- 4.Properties of Regular Languages
- 4.0.1Where Are We?
- 4.0.2Chapter Objectives
- 4.1Closure Properties
- 4.1.1Computing Set Operations
- 4.1.2Exercises
- 4.2Decision Algorithms
- 4.2.1Exercises
- 4.3Infinite Regular Languages and a “Pumping Theorem”
- 4.3.1Exercises
- 4.3.2Chapter Summary
- 5.Pushdown Automata
- 5.0.1Where Are We?
- 5.0.2Chapter Objectives
- 5.1Adding a Stack to Finite Automata
- 5.1.1Exercises
- 5.2Pushdown Automata and Determinism
- 5.2.1Exercise
- 5.2.2Chapter Summary
- 6.Context-Free Grammars
- 6.0.1Where Are We?
- 6.0.2Chapter Objectives
- 6.1Context-Free Grammars and Derivations
- 6.1.1Simplifying Grammars
- 6.1.2Exercises
- 6.2Derivation Trees and Ambiguous Grammars
- 6.2.1Operator Precedence
- 6.2.2Operator Associativity
- 6.2.3Expression Trees
- 6.2.4Exercises
- 6.3Equivalence of PDAs and CFGs
- 6.3.1From CFG to PDA
- 6.3.2From PDA to CFG (Special Case)
- 6.3.3From PDA to CFG (General Case)
- 6.3.4Exercises
- 6.3.5Chapter Summary
- 7.Properties of Context-Free Languages
- 7.0.1Where Are We?
- 7.0.2Chapter Objectives
- 7.1Chomsky Normal Form
- 7.1.1Removing Lambda
- 7.1.2Removing Unit Productions
- 7.1.3Chomsky Normal Form Rules
- 7.1.4Exercises
- 7.2Closure Properties
- 7.2.1Closure Properties of DCFLs
- 7.2.2Exercises
- 7.3Decision Algorithms
- 7.3.1Is a CFL Empty or Infinite?
- 7.3.2Exercises
- 7.4Infinite CFLs and Another Pumping Theorem
- 7.4.1Exercises
- 7.4.2Chapter Summary
- 8.Turing Machines
- 8.0.1Where Are We?
- 8.0.2Chapter Objectives
- 8.1Prelude
- 8.1.1Queue Machines
- 8.1.2Exercise
- 8.2The Standard Turing Machine
- 8.2.1Subroutines
- 8.2.2Halting
- 8.2.3Exercises
- 8.2.4Programming Exercise
- 8.3Variations on Turing Machines
- 8.3.1The Universal Turing Machine
- 8.3.2Non-Deterministic TM = Deterministic TM
- 8.3.3Programming Exercise
- 8.3.4Chapter Summary
- 9.The Landscape of Formal Languages
- 9.0.1Where Are We?
- 9.0.2Chapter Objectives
- 9.1Recursively Enumerable Languages
- 9.1.1A Non-Recursive, RE Language
- 9.1.2Context-Sensitive Languages
- 9.1.3Properties of Recursively Enumerable Languages
- 9.1.4Exercises
- 9.2Unrestricted Grammars
- 9.2.1Context-Sensitive Grammars
- 9.2.2Equivalence of Unrestricted Grammars and Turing Machines
- 9.2.3Exercises
- 9.3The Chomsky Hierarchy
- 9.3.1Countable Sets
- 9.3.2Uncountable Sets
- 9.3.3Chapter Summary
- 10.Computability
- 10.0.1Chapter Objectives
- 10.1The Halting Problem
- 10.2Reductions and Undecidability
- 10.2.1Exercises
- 10.2.2Chapter Summary
- Glossary
- Bibliography
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them