Applied Computational Thinking with Python

Book description

Use the computational thinking philosophy to solve complex problems by designing appropriate algorithms to produce optimal results across various domains

Key Features

  • Develop logical reasoning and problem-solving skills that will help you tackle complex problems
  • Explore core computer science concepts and important computational thinking elements using practical examples
  • Find out how to identify the best-suited algorithmic solution for your problem

Book Description

Computational thinking helps you to develop logical processing and algorithmic thinking while solving real-world problems across a wide range of domains. It's an essential skill that you should possess to keep ahead of the curve in this modern era of information technology. Developers can apply their knowledge of computational thinking to solve problems in multiple areas, including economics, mathematics, and artificial intelligence.

This book begins by helping you get to grips with decomposition, pattern recognition, pattern generalization and abstraction, and algorithm design, along with teaching you how to apply these elements practically while designing solutions for challenging problems. You'll then learn about various techniques involved in problem analysis, logical reasoning, algorithm design, clusters and classification, data analysis, and modeling, and understand how computational thinking elements can be used together with these aspects to design solutions. Toward the end, you will discover how to identify pitfalls in the solution design process and how to choose the right functionalities to create the best possible algorithmic solutions.

By the end of this algorithm book, you will have gained the confidence to successfully apply computational thinking techniques to software development.

What you will learn

  • Find out how to use decomposition to solve problems through visual representation
  • Employ pattern generalization and abstraction to design solutions
  • Build analytical skills required to assess algorithmic solutions
  • Use computational thinking with Python for statistical analysis
  • Understand the input and output needs for designing algorithmic solutions
  • Use computational thinking to solve data processing problems
  • Identify errors in logical processing to refine your solution design
  • Apply computational thinking in various domains, such as cryptography, economics, and machine learning

Who this book is for

This book is for students, developers, and professionals looking to develop problem-solving skills and tactics involved in writing or debugging software programs and applications. Familiarity with Python programming is required.

Publisher resources

Download Example Code

Table of contents

  1. Applied Computational Thinking with Python
  2. Why subscribe?
  3. Contributors
  4. About the authors
  5. About the reviewer
  6. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Reviews
  8. Section 1: Introduction to Computational Thinking
  9. Chapter 1: Fundamentals of Computer Science
    1. Technical requirements
    2. Introduction to computer science
      1. Learning about computers and the binary system
        1. Converting from binary to base-10
        2. Converting from base-10 to binary
    3. Understanding theoretical computer science
      1. Algorithms
      2. Coding theory
        1. Data compression
        2. Error correction
        3. Cryptography
      3. Computational biology
      4. Data structures
      5. Information theory
      6. Automata theory
      7. Formal language theory
      8. Symbolic computation
      9. Computational geometry
      10. Computational number theory
    4. Learning about a system's software
      1. Operating systems
      2. Application software
    5. Understanding computing
      1. Architecture
        1. Instruction Set Architecture (ISA)
      2. Programming languages
    6. Learning about data types and structures
      1. Data types
      2. Data structures
    7. Summary
  10. Chapter 2: Elements of Computational Thinking
    1. Technical requirements
    2. Understanding computational thinking
      1. Problem 1 - Conditions
    3. Decomposing problems
    4. Recognizing patterns
      1. Problem 2 - Mathematical algorithms and generalization
    5. Generalizing patterns
    6. Designing algorithms
    7. Additional problems
      1. Problem 2 - Children's soccer party
      2. Problem 3 - Savings and interest
    8. Summary
  11. Chapter 3: Understanding Algorithms and Algorithmic Thinking
    1. Technical requirements
    2. Defining algorithms in depth
      1. Algorithms should be clear and unambiguous
      2. Algorithms should have inputs and outputs that are well defined
      3. Algorithms should have finiteness
      4. Algorithms have to be feasible
      5. Algorithms are language-independent
    3. Designing algorithms
      1. Problem 1 – An office lunch
        1. Office lunch mathematical algorithm
        2. Office lunch Python algorithm
      2. Problem 2 – A catering company
    4. Analyzing algorithms
      1. Algorithm analysis 1 – States and capitals
      2. Algorithm analysis 2 – Terminating or not terminating?
    5. Summary
  12. Chapter 4: Understanding Logical Reasoning
    1. Technical requirements
    2. Understanding the importance of logical reasoning
      1. Applying inductive reasoning
        1. Solving an inductive reasoning sample problem
      2. Applying deductive reasoning
        1. Learning about conditional statements
        2. Understanding nested statements
    3. Using Boolean logic and operators
      1. The and operator
      2. The or operator
      3. The not operator
    4. Identifying logic errors
    5. Summary
  13. Chapter 5: Exploring Problem Analysis
    1. Technical requirements
    2. Understanding the problem definitions
      1. Problem 5A – Building an online store
        1. Making assumptions
        2. Things to consider
        3. Building a dictionary
    3. Learning to decompose problems
      1. Converting the flowchart into an algorithm
        1. Building a dictionary and giving inputs
        2. Making changes to the cost
        3. Adding personalization
    4. Analyzing problems
      1. Problem 5B – Analyzing a simple game problem
    5. Summary
  14. Chapter 6: Designing Solutions and Solution Processes
    1. Technical requirements
    2. Designing solutions
      1. Problem 1 - A marketing survey
    3. Diagramming solutions
    4. Creating solutions
      1. Problem 2 - Pizza order
      2. Problem 3 - Delays and Python
    5. Summary
  15. Chapter 7: Identifying Challenges within Solutions
    1. Technical requirements
    2. Identifying errors in algorithm design
      1. Syntax errors
        1. Using colons
        2. Using nested parentheses and brackets
        3. Other syntax errors
      2. Errors in logic
    3. Debugging algorithms
    4. Comparing solutions
      1. Problem 1 - Printing even numbers
        1. Algorithm solution 1 - Printing even numbers
        2. Algorithm solution 2 - Printing even numbers
    5. Refining and redefining solutions
    6. Summary
  16. Section 2:Applying Python and Computational Thinking
  17. Chapter 8: Introduction to Python
    1. Technical requirements
    2. Introducing Python
      1. Mathematical built-in functions
    3. Working with dictionaries and lists
      1. Defining and using dictionaries
      2. Defining and using lists
    4. Using variables and functions
      1. Variables in Python
        1. Combining variables
      2. Working with functions
    5. Learning about files, data, and iteration
      1. Handling files in Python
      2. Data in Python
      3. Using iteration in algorithms
    6. Using object-oriented programming
    7. Problem 1 - Creating a book library
    8. Problem 2 - Organizing information
    9. Problem 3 - Loops and math
      1. Using inheritance
    10. Summary
  18. Chapter 9: Understanding Input and Output to Design a Solution Algorithm
    1. Technical requirements
    2. Defining input and output
    3. Understanding input and output in computational thinking
      1. Problem 1 – Building a Caesar cipher
      2. Problem 2 – Finding maximums
      3. Problem 3 – Building a guessing game
    4. Summary
  19. Chapter 10: Control Flow
    1. Technical requirements
    2. Defining control flow and its tools
    3. Using if, for, and range() and other control flow statements
      1. Using nested if statements
      2. Using for loops and range
    4. Using other loops and conditionals
    5. Revisiting functions
    6. Summary
  20. Chapter 11: Using Computational Thinking and Python in Simple Challenges
    1. Technical requirements
    2. Defining the problem and Python
      1. Decomposing the problem and using Python functionalities
    3. Generalizing the problem and planning Python algorithms
    4. Designing and testing the algorithm
    5. Summary
  21. Section 3:Data Processing, Analysis, and Applications Using Computational Thinking and Python
  22. Chapter 12: Using Python in Experimental and Data Analysis Problems
    1. Technical requirements
    2. Defining experimental data
    3. Using data libraries in Python
      1. Installing libraries
      2. Using NumPy and pandas
      3. Using Matplotlib
    4. Understanding data analysis with Python
    5. Using additional libraries for plotting and analysis
      1. Using the Seaborn library
      2. Using the SciPy library
      3. Using the Scikit-Learn library
    6. Summary
  23. Chapter 13: Using Classification and Clusters
    1. Technical requirements
    2. Data training and testing
      1. Classifying data example
      2. Using the Scikit-Learn library
      3. Defining optimization models
        1. The binary cross-entropy model
        2. The Adam optimization algorithm
        3. The gradient descent model
        4. The confusion matrix model
    3. Implementing data clustering
      1. Using the BIRCH algorithm
      2. Using the K-means clustering algorithm
    4. Summary
  24. Chapter 14: Using Computational Thinking and Python in Statistical Analysis
    1. Technical requirements
    2. Defining the problem and Python data selection
      1. Defining pandas
      2. Determining when to use pandas
        1. Working with pandas series
        2. Working with pandas DataFrames
    3. Preprocessing data
      1. Data cleaning
        1. Working with missing data
        2. Working with noisy data
      2. Transforming data
      3. Reducing data
    4. Processing, analyzing, and summarizing data using visualizations
      1. Processing data
      2. Analyzing and summarizing data
      3. Using data visualization
    5. Summary
  25. Chapter 15: Applied Computational Thinking Problems
    1. Technical requirements
    2. Problem 1 – Using Python to analyze historical speeches
    3. Problem 2 – Using Python to write stories
      1. Defining, decomposing, and planning a story
    4. Problem 3 – Using Python to calculate text readability
    5. Problem 4 – Using Python to find most efficient route
      1. Defining the problem (TSP)
      2. Recognizing the pattern (TSP)
      3. Generalizing (TSP)
      4. Designing the algorithm (TSP)
    6. Problem 5 – Using Python for cryptography
      1. Defining the problem (cryptography)
      2. Recognizing the pattern (cryptography)
      3. Generalizing (cryptography)
      4. Designing the algorithm (cryptography)
    7. Problem 6 – Using Python in cybersecurity
    8. Problem 7 – Using Python to create a chatbot
    9. Summary
  26. Chapter 16: Advanced Applied Computational Thinking Problems
    1. Technical requirements
    2. Problem 1 – Using Python to create tessellations
    3. Problem 2 – Using Python in biological data analysis
    4. Problem 3 – Using Python to analyze data for specific populations
      1. Defining the specific problem to analyze and identify the population
    5. Problem 4 – Using Python to create models of housing data
      1. Defining the problem
      2. Algorithm and visual representations of data
    6. Problem 5 – Using Python to create electric field lines
    7. Problem 6 – Using Python to analyze genetic data
    8. Problem 7 – Using Python to analyze stocks
    9. Problem 8 – Using Python to create a convolutional neural network (CNN)
    10. Summary
  27. Other Books You May Enjoy

Product information

  • Title: Applied Computational Thinking with Python
  • Author(s): Sofia De Jesus, Dayrene Martinez
  • Release date: November 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781839219436