Homework 1

  • Type your name and email in the “Student details” section below.

  • Develop the code and generate the figures you need to solve the problems using this notebook.

  • For the answers that require a mathematical proof or derivation you can either:

    • Type the answer using the built-in latex capabilities. In this case, simply export the notebook as a pdf and upload it on gradescope; or

    • You can print the notebook (after you are done with all the code), write your answers by hand, scan, turn your response to a single pdf, and upload on gradescope.

  • The total homework points are 100. Please note that the problems are not weighed equally.

Note

  • This is due before the beginning of the next lecture.

  • Please match all the pages corresponding to each of the questions when you submit on gradescope.

Student details

  • First Name:

  • Last Name:

  • Email:

Problem 1 - Python as a calculator

Use Python to evaluate the following expression: $\( \frac{\sin(\pi/3)e^{-2}}{23^2}. \)$

# Your code here

Problem 2 - Python types

Find the type of the following Python variables. You may use Python’s capabilities to find the type. You don’t have to guess it.

x = 4
y = 23.5
z = 4 / 3.1
a = (1, 2, 4)
b = [3, 4, 6]
c = x > 2
d = 'Hello there!'
e = {'Name': 'Ilias Bilionis', 
     'Phone number': 2106012119,
     'Zip code': 47906}
import numpy as np
f = np.zeros((10, 4))