<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://quantsoftware.gatech.edu/index.php?action=history&amp;feed=atom&amp;title=MC1-Homework-1-2015</id>
	<title>MC1-Homework-1-2015 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://quantsoftware.gatech.edu/index.php?action=history&amp;feed=atom&amp;title=MC1-Homework-1-2015"/>
	<link rel="alternate" type="text/html" href="http://quantsoftware.gatech.edu/index.php?title=MC1-Homework-1-2015&amp;action=history"/>
	<updated>2026-05-25T01:33:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.4</generator>
	<entry>
		<id>http://quantsoftware.gatech.edu/index.php?title=MC1-Homework-1-2015&amp;diff=768&amp;oldid=prev</id>
		<title>Tucker: Created page with &quot;==Overview==  The purpose of this assignment is to get you started programming in Python.  Note that we&#039;ll be using Python 2.7 for this course (not Python 3.0).  This assignme...&quot;</title>
		<link rel="alternate" type="text/html" href="http://quantsoftware.gatech.edu/index.php?title=MC1-Homework-1-2015&amp;diff=768&amp;oldid=prev"/>
		<updated>2016-01-13T19:27:12Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Overview==  The purpose of this assignment is to get you started programming in Python.  Note that we&amp;#039;ll be using Python 2.7 for this course (not Python 3.0).  This assignme...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
The purpose of this assignment is to get you started programming in Python.  Note that we&amp;#039;ll be using Python 2.7 for this course (not Python 3.0).  This assignment is structured like many of the homeworks and projects for this course, namely that you are to create a Python function that solves a specific problem.  We will call your function and verify that it provides the correct answer.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: You will be able to write, test and submit your code for this assignment on Udacity. So you don&amp;#039;t need to have Python installed, but you&amp;#039;re welcome to work on your computer if you do (we&amp;#039;ll provide further instructions on what libraries to install as part of MC2-Homework-2).&lt;br /&gt;
&lt;br /&gt;
==Task==&lt;br /&gt;
&lt;br /&gt;
Your task for this homework is to write a Python function named &amp;lt;tt&amp;gt;nth_prime(N)&amp;lt;/tt&amp;gt; that computes and returns the Nth prime number. A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.  If we were to call your function in a Python interpreter, we&amp;#039;d expect output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; nth_prime(1)&lt;br /&gt;
2&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; nth_prime(5)&lt;br /&gt;
11&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Suggestions==&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s a template for what your code should look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
def nth_prime(N):&lt;br /&gt;
    # TODO: Write code here that computes the Nth prime&lt;br /&gt;
    result = N * 2 # e.g. this code finds the Nth even number&lt;br /&gt;
    return result&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are developing locally, you will need to save your code in a Python file, say &amp;lt;TT&amp;gt;primer.py&amp;lt;/TT&amp;gt;.  If you additionally add the following lines to your code, you can run the code as a program and test it to see that it finds the correct answer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
def test_run():&lt;br /&gt;
    print nth_prime(5)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    test_run()&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can run your program using the command: &amp;lt;tt&amp;gt;python primer.py&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources and ideas==&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.python.org/moin/BeginnersGuide/Programmers Python tutorials]&lt;br /&gt;
* [https://docs.python.org/2.7/ Python documentation]&lt;br /&gt;
&lt;br /&gt;
==What to turn in==&lt;br /&gt;
&lt;br /&gt;
You can compose and test your code via the Udacity platform (continue here: [https://www.udacity.com/course/viewer#!/c-ud501/l-4180469313/m-4236488542 MC1-Homework-1 - Instructions]), however you must submit your final code via t-square.&lt;br /&gt;
&lt;br /&gt;
* Submit your code as &amp;lt;tt&amp;gt;nth_prime.py&amp;lt;/tt&amp;gt; via t-square.  It is essential that you use exactly that name.&lt;br /&gt;
&lt;br /&gt;
==Udacity login instructions==&lt;br /&gt;
&lt;br /&gt;
If you are a GT OMSCS or on-campus student taking this course for credit, you must log in to Udacity using your Georgia Tech account:&lt;br /&gt;
[https://login.gatech.edu/cas/login?service=http%3A%2F%2Fweb.iam.gatech.edu%2Fudacity-login%2F GT-Udacity Login]&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s a [https://www.youtube.com/watch?v=pyqirZW_sT8 helpful video]. Once you&amp;#039;re in, visit the above link again, or navigate to the course from &amp;#039;&amp;#039;&amp;#039;My Courses&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: DO NOT log in using your personal Udacity account, in case you have one.&lt;br /&gt;
&lt;br /&gt;
==Required, Allowed &amp;amp; Prohibited==&lt;br /&gt;
&lt;br /&gt;
Required:&lt;br /&gt;
* Your project must be coded in Python 2.7.x.&lt;br /&gt;
* Your code must run on one of the university-provided computers (e.g. buffet02.cc.gatech.edu), or on one of the provided virtual images.&lt;br /&gt;
* Your code must run in less than 5 seconds on one of the university-provided computers.&lt;br /&gt;
&lt;br /&gt;
Allowed:&lt;br /&gt;
* You can develop your code on your personal machine, but it must also run successfully on one of the university provided machines or virtual images.&lt;br /&gt;
* Your code may use standard Python libraries.&lt;br /&gt;
* You may use the NumPy, SciPy and Pandas libraries.&lt;br /&gt;
* Small sections of code (up to 5 lines) that you collected from other students or the internet.&lt;br /&gt;
* Code provided by the instructor, or allowed by the instructor to be shared.&lt;br /&gt;
&lt;br /&gt;
Prohibited:&lt;br /&gt;
* Any libraries not listed in the &amp;quot;allowed&amp;quot; section above.&lt;br /&gt;
* Any code you did not write yourself (except for the 5 line rule in the &amp;quot;allowed&amp;quot; section).&lt;br /&gt;
* Any Classes other than Random that create their own instance variables for later use (e.g., learners like kdtree).&lt;/div&gt;</summary>
		<author><name>Tucker</name></author>
		
	</entry>
</feed>