Due Friday, April 22, 2016 by 6pm
Your grading will be automatically collected.
a. Write a straightforward Python function (not using anything special from numpy or Sage) to compute the standard deviation of a list of numbers.
b. Compare the speed of your program when given as input
v = range(1000),
v = range(10000) and
v = range(100000) with the speed of standard deviation on that input as implemented in: numpy, R, and stats.TimeSeries. Use %timeit.
c. Do a and b again, but for an implementation of mysd using Cython (you do not have to use any special features of Cython).
Test that their function behaves the same way as the standard deviation function built into sage.
Imagine you're an a tenure-track academic researcher. To do some key research, you need to implement code to compute a function , and use it to evaluate .
You can implement this code in two ways:
STRATEGY 1: Work fulltime for one month implementing and debugging a very fast algorithm in C, so that actually computing only takes hour on your laptop.
STRATEGY 2: Spend about 3 hours writing a non-optimized Python program (that calls some other slow code), then let your code run on a cluster for 1 month (running the program costs $2K in grant money).
Come up with a creative (but serious) argument in favor of each of the above strategies.
(How this will be graded: (a) you may lose points for mistakes in English spelling and grammar, (b) you must have put real thought into the problem.)
Award points based on their thoughtfulness.
Given a rough order of magnitude estimate for how long each of the following should take:
math software(just the time that Google reports it having taken).
Problem 4: Techniques used by projects
Track down projects that use various tools that we discussed this week.
1. Give five examples of existing open source Python projects that use Cython. What do they use Cython for? 2. Give five examples of existing open source Python projects that use Numpy. What is something they use Numpy for? 3. Give three examples of existing open source Python projects that use Numba. How do they use numba?
If their example is not found in the example solution, briefly try to find out if their example works. Do not take off points for repeats. For example if a project uses both Cython and Numpy, it may be used for part 1 and part 2.
cdef long, and compile it.
Each of these parts requires its own implementation. If each part has a similar error, only deduct points for one of them.
This is the same as parts 1-5 except as one part.
Award points identically to above.