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.)
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?
These projects use Cython to get the functionality of Python and the speed of C (faster than pure Python)
Numpy is used for data collection of generic data that can be seamlessly utilized with many different data structures (source: http://www.numpy.org/)
cdef long, and compile it.