Day 2 pre-class assignment

Goals for today's pre-class assignment

  • Make sure that you can get a Jupyter notebook up and running!
  • Learn about algorithms, computer programs, and their relationship
  • To devise and think about the components of an algorithm for a simple task
  • Learn about Python, IPython, and IPython notebooks and understand why we're using it in class.
  • Install NetLogo and verify that it works (we need it for class)

Assignment instructions

Pre-class assignments will be composed of a combination of videos, text to read, and small assignments. The goal of these assignments is to prepare you for class the following day. You should watch the videos and read the text, and then do the assigned work. You also need to provide feedback in the Google Form at the bottom of the notebook. You will be graded on making a good-faith effort, not on correctness!

To make notebook cells that have Python code in them do something, hold down the 'shift' key and then press the 'enter' or 'return' key (you'll have to do this to get movies to run). To edit a cell (to add answers, for example) you double-click, add your text, and then enter it by holding down 'shift' and pressing 'enter'.

This assignment is due by 11:59 p.m. the day before class, and should be uploaded into the "Pre-class assignments" dropbox folder for Day 2. Submission instructions can be found at the end of the notebook.


In [ ]:
# The command below this comment imports the functionality that we need to display 
# YouTube videos in a Jupyter Notebook.  You need to run this cell before you
# run ANY of the YouTube videos.

from IPython.display import YouTubeVideo

Algorithms


In [ ]:
# the command below this comment actually displays a specific YouTube video,  
# with a given width and height.  You can watch the video in full-screen (much higher
# resolution) mode by clicking the little box in the bottom-right corner of the video.

YouTubeVideo("jT0KZ849fak",width=640,height=360)

Further reading on algorithms and computer programs

note: This isn't mandatory, but might be helpful!

Wikipedia page on algorithms

Wikipedia page on computer programs

Assignment: Algorithms and computer programs

Question 1: Come up with an algorithm for a simple task that you do every day (i.e., putting on your shoes). What are the steps of this algorithm?

Put your answer to Question 1 here! (double-click on this text to edit this cell, and hit shift+enter to save the text)

Question 2: Think about the algorithm you devised in the previous question and the video you just watched. Identify the various parts of your algorithm, as defined by the video.

Put your answer to question 2 here! (double-click on this text to edit this cell, and hit shift+enter to save the text)

Python, IPython, and IPython notebooks


In [ ]:
YouTubeVideo("L03BzGmLUUE",width=640,height=360)

Question 3: Given the video you watched, why do you think we're using IPython notebooks in class instead of a command-line version of Python?

Put your answer here! (double-click on this text to edit this cell, and hit shift+enter to save the text)

Question 4: This isn't a question so much as a to-do. You need to install the program NetLogo on your computer for tomorrow's class. (You may first need to install Java on your computer to make this work!) To do this, go to the link above, download the appropriate version for your computer, and then follow the installation instructions. To test that it works, do the following:

  1. Start up NetLogo. It may be in the start menu/Dock on your computer, or in the Applications folder.
  2. Go to the "File" menu, then click on "Models Library".
  3. Click on any of the directories and pick a directory and a model.
  4. Click the "setup" button, and then "go". The model should start.
  5. Click "go" again to stop the model.

Congratulations! You've installed NetLogo.

Change the text here to say that you have installed and tested NetLogo. (double-click on this text to edit this cell, and hit shift+enter to save the text)

Assignment wrapup

Please fill out the form that appears when you run the code below. You must completely fill this out in order to receive credit for the assignment!


In [ ]:
from IPython.display import HTML

HTML("""
<iframe 
	src="https://docs.google.com/forms/d/e/1FAIpQLSedVfvn-6kn3oTiyl2IeJglS7twoa8CdkcyLopqv-XWOtnUYQ/viewform" 
	width="80%" 
	height="1200px" 
	frameborder="0" 
	marginheight="0" 
	marginwidth="0">
	Loading...
</iframe>
""")

Congratulations, you're done with your first pre-class assignment!

Now, you just need to submit this assignment by uploading it to the course Desire2Learn web page. Go to the "Pre-class assignments" folder, find the dropbox link for Day 2, and upload it there.

See you in class!