Introduction to Artificial Intelligence: Orientation Homework

Welcome to the orientation homework for Introduction to Artificial Intelligence! This notebook will guide you through some of the basic functionalities of Jupyter Notebooks, which we will be using extensively throughout this course.

Table of Contents

  1. Introduction to Jupyter Notebooks
  2. Markdown Cells
  3. Code Cells
  4. Running Cells
  5. Your First AI Task

Introduction to Jupyter Notebooks

Jupyter Notebooks are an open-source web application that allows you to create and share documents that contain live code, equations, visualizations, and narrative text. They are widely used in data science, machine learning, and artificial intelligence for data cleaning and transformation, numerical simulation, statistical modeling, data visualization, and much more.

In this course, we will use Jupyter Notebooks to explore various AI concepts and implement algorithms in Python.

Let's start by understanding the two main types of cells in a Jupyter Notebook: Markdown cells and Code cells.

Markdown Cells

Markdown cells are used to write and format text. You can use Markdown to add headings, lists, links, images, and even LaTeX equations to your notebook.

Here's an example of a Markdown list:

  • Bold text: **Bold text**
  • Italic text: *Italic text*
  • Link: [Link](https://www.example.com)

You can also add images using Markdown:

![Image description](https://www.example.com/image.png)

Try editing this cell and adding some of your own Markdown elements!

Code Cells

Code cells are where you'll write and run your Python code. Below is an example of a simple Python code snippet.

print('Hello, CSE 30124!')

You can run the code by clicking the cell and pressing Shift + Enter, or by clicking the 'Run' button at the top of the notebook.

Let's try running a code cell in the next section.

In [1]:
print('Hello, CSE 30124!')
Hello, CSE 30124!

Running Cells

To run a cell, simply click on it to select it, and then press Shift + Enter. Try running the code cell above to see the output.

Running a cell will execute any Python code it contains and display the output directly below the cell.

If you run into any errors, don't worry! Debugging is a key part of coding, and we'll cover it in more detail later in the course.

Questions

Now that you know the basics of Markdown and Code cells, it's time for you to create your own pieces of a notebook

  1. Create a new Markdown cell below this one. In that cell, write a brief paragraph about what you have used AI for in the past and a mistake you found that it made.
  2. Create a new Code cell below your Markdown cell. In that cell, write a Python function that takes a number as input and returns the square of that number.
  3. Run your code cell to make sure your function works correctly.

Good luck, and welcome to CSE 30124!