<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nemenmanlab.org/~ilya/index.php?action=history&amp;feed=atom&amp;title=Physics_212%2C_2017%3A_Lecture_2</id>
	<title>Physics 212, 2017: Lecture 2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nemenmanlab.org/~ilya/index.php?action=history&amp;feed=atom&amp;title=Physics_212%2C_2017%3A_Lecture_2"/>
	<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2017:_Lecture_2&amp;action=history"/>
	<updated>2026-05-17T09:39:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2017:_Lecture_2&amp;diff=671&amp;oldid=prev</id>
		<title>Ilya: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2017:_Lecture_2&amp;diff=671&amp;oldid=prev"/>
		<updated>2018-07-04T16:28:44Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 16:28, 4 July 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Ilya</name></author>
		
	</entry>
	<entry>
		<id>https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2017:_Lecture_2&amp;diff=670&amp;oldid=prev</id>
		<title>nemenman&gt;Ilya: /* Introduction to Python */</title>
		<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2017:_Lecture_2&amp;diff=670&amp;oldid=prev"/>
		<updated>2017-01-18T14:50:11Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Introduction to Python&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PHYS212-2017}}&lt;br /&gt;
&lt;br /&gt;
Most important thing to note about these lectures:&lt;br /&gt;
: You won't learn Python by reading. You have to try coding. If you have a question how a certain expression works, type it in Python console, and test it!&lt;br /&gt;
&lt;br /&gt;
==Introduction to Python==&lt;br /&gt;
*Algorithmic thinking &lt;br /&gt;
**Example: opening a door&lt;br /&gt;
**Different levels of algorithms&lt;br /&gt;
*Basic parts needed to design an algorithm&lt;br /&gt;
**State (or memory)&lt;br /&gt;
**Rules for transforming states (operations, functions, procedures)&lt;br /&gt;
**Rules for making decisions&lt;br /&gt;
*Assignment operation (vs. testing for equality)&lt;br /&gt;
**Variable is a pointer to a container (object) in memory where a state is stored. (This is not quite correct; we will return to this later).&lt;br /&gt;
*Anaconda distribution / Spyder development environment&lt;br /&gt;
**How to launch it&lt;br /&gt;
**Console vs. editor plus additional tools&lt;br /&gt;
**Syntax highlighting / code analyzer&lt;br /&gt;
*Basic syntaxes&lt;br /&gt;
**Resetting the state of the system&lt;br /&gt;
**Asking for help with ? and with Google&lt;br /&gt;
**Built-in functions, like ''print'' &lt;br /&gt;
**Numbers; note that j is the imaginary unit, not i&lt;br /&gt;
***Are numbers real or integer?&lt;br /&gt;
**Arithmetic operations, +, -, *,  /, **.&lt;br /&gt;
**Parentheses&lt;br /&gt;
**Importing modules and functions from modules&lt;br /&gt;
***numpy as np and matplotlib.pyplot as plt&lt;br /&gt;
;Exercise:&lt;br /&gt;
We will solve a quadratic equation a*x**2+b*x+c=0 for a=1, b=2, c=-3. Do this by&lt;br /&gt;
#Resetting the environment&lt;br /&gt;
#Importing sqrt function from numpy&lt;br /&gt;
#Assigning values to a, b, c&lt;br /&gt;
#Evaluating both solutions using the standard formula you learned in middle school&lt;br /&gt;
#Printing both solutions&lt;br /&gt;
*More syntaxes&lt;br /&gt;
**Functions have arguments; keyword arguments&lt;br /&gt;
**Functions return values&lt;br /&gt;
**Functions can otherwise change Python state&lt;br /&gt;
;Exercise:&lt;br /&gt;
Evaluate a binary log (log base 2) of a number 42 using at least three different sets of commands. Verify your result by taking 2 to the appropriate power and seeing if you get 42 back.&lt;br /&gt;
&lt;br /&gt;
'''Don't forget to [https://docs.google.com/forms/d/e/1FAIpQLSeNvrPddCgvMfHdlSA8uYDddBFqLK81Rrr4l7jfozud6J7iww/viewform submit your work] at the end of the class.'''&lt;/div&gt;</summary>
		<author><name>nemenman&gt;Ilya</name></author>
		
	</entry>
</feed>