Step 5 of 15
Interactive Notebook 1: Beginner's Guide to Jupyter & AI Search
A zero-knowledge step-by-step introduction to interactive code cells, plus Python problem-solving algorithms.
Welcome to Step 5! This page uses an interactive Jupyter notebook. If you have never opened a Jupyter notebook or written a line of code in your life, do not worry at all. We assume you have zero prior programming experience. Before diving into machine learning, we take our first gentle steps here with code cells and problem solving.
What a Jupyter Notebook Is (and How to Run It)
A Jupyter notebook is an interactive document made up of building blocks called cells. There are two main types of cells:
You can run any code cell directly in your browser. When you run a cell, the computer executes your instructions instantly and displays the output right below the box.
- Text Cells (Markdown): Like this text you are reading right now, these cells contain explanations, notes, and background concepts.
- Code Cells (Python): Gray boxes containing small, readable lines of Python code for the computer to run. For example, typing
print("Ram Ram")will make the computer greet you! - No Fear of Mistakes: You cannot break your computer, your phone, or this website by running code or changing numbers! If you ever make a mistake or want to start fresh, simply refresh the web page.
What Notebook 1 Contains: AI Problem Solving & Heuristics
In Chapter 2, we studied how AI solves complex real-world challenges by searching through a State Space step-by-step from a starting position to a goal state. In Notebook 1, we write plain Python code to simulate a traditional Marwar herdsman (Guval) navigating a village map to find a path from Home to the Oran pasture.
You will also experiment with Heuristics, estimating distances on a grid to help the AI pick the most promising shortcut without checking wrong turns.
How to Open and Run Notebook 1
There are two easy ways to run the notebook: on your own computer if Jupyter is installed, or free in the browser with Google Colab, where nothing needs to be installed. The steps for Google Colab:
- Download the notebook file with the button below.
- Open colab.research.google.com in your browser and sign in with a Google account.
- Click File, then Upload notebook, and choose the downloaded file loktech-notebook-1.ipynb.
- Read each text cell, and run each code cell by pressing the play button on its left (or Shift+Enter).
- Run the cells from top to bottom. Change the examples and run them again; nothing can break.
Download Notebook 1 - Problem Solving (.ipynb) Download Notebook 1 - Hindi (.ipynb) Open Google Colab ↗