summaryrefslogtreecommitdiff
path: root/lecture_notes/advanced_python/exercises.rst
diff options
context:
space:
mode:
authorPrabhu Ramachandran2014-06-12 18:30:44 +0530
committerPrabhu Ramachandran2014-06-12 18:30:44 +0530
commit1cd20420eaf6db98f985bb4ff9840dd0641d124b (patch)
treeecde55c63af0aa72133767bd3c091e644022e651 /lecture_notes/advanced_python/exercises.rst
parent985adfa4f8a8b9cfba2b0a573dadc77283651957 (diff)
parenta6b748ea000473c4cb36ec769a64fa5c9595a59e (diff)
downloadsees-1cd20420eaf6db98f985bb4ff9840dd0641d124b.tar.gz
sees-1cd20420eaf6db98f985bb4ff9840dd0641d124b.tar.bz2
sees-1cd20420eaf6db98f985bb4ff9840dd0641d124b.zip
Merge pull request #2 from FOSSEE/restructuring-repo
Restructuring repo
Diffstat (limited to 'lecture_notes/advanced_python/exercises.rst')
-rw-r--r--lecture_notes/advanced_python/exercises.rst56
1 files changed, 56 insertions, 0 deletions
diff --git a/lecture_notes/advanced_python/exercises.rst b/lecture_notes/advanced_python/exercises.rst
new file mode 100644
index 0000000..eeaa323
--- /dev/null
+++ b/lecture_notes/advanced_python/exercises.rst
@@ -0,0 +1,56 @@
+Exercises
+=========
+
+#. Consider the iteration :math:`$x_{n+1} = f(x_n)$` where
+ :math:`$f(x) = kx(1-x)$`. Plot the successive iterates of this
+ process.
+
+#. Plot this using a cobweb plot as follows:
+
+ #. Start at :math:`$(x_0, 0)$`
+ #. Draw line to :math:`$(x_i, f(x_i))$`;
+ #. Set :math:`$x_{i+1} = f(x_i)$`
+ #. Draw line to :math:`$(x_i, x_i)$`
+ #. Repeat from 2 for as long as you want
+
+#. Plot the Koch snowflake. Write a function to generate the necessary
+ points given the two points constituting a line.
+
+ #. Split the line into 4 segments.
+ #. The first and last segments are trivial.
+ #. To rotate the point you can use complex numbers, recall that
+ :math:`$z e^{j \theta}$` rotates a point :math:`$z$` in 2D by
+ :math:`$\theta$`.
+ #. Do this for all line segments till everything is done.
+
+#. Show rate of convergence for a first and second order finite
+ difference of sin(x)
+
+#. Given, the position of a projectile in in ``pos.txt``, plot it's
+ trajectory.
+
+ - Label both the axes.
+ - What kind of motion is this?
+ - Title the graph accordingly.
+ - Annotate the position where vertical velocity is zero.
+
+#. Write a Program that plots a regular n-gon(Let n = 5).
+
+#. Create a sequence of images in which the damped oscillator
+ (:math:`$e^{-x/10}sin(x)$`) slowly evolves over time.
+
+#. Given a list of numbers, find all the indices at which 1 is present.
+ numbers = [1, 1, 3, 4, 3, 6, 7, 8, 1, 2, 4, 1]
+
+#. Given a list of numbers, find all the indices at which 1 is present.
+ numbers = [1, 1, 3, 4, 3, 6, 7, 8, 1, 2, 4, 1]. Solve the problem using a
+ functional approach.
+
+..
+ Local Variables:
+ mode: rst
+ indent-tabs-mode: nil
+ sentence-end-double-space: nil
+ fill-column: 77
+ End:
+