Problems to Checkout Knowledge of Python/Numpy

Just use simple output and generate your own input in these problems. More complicated input/output and more complicated NumPy manipulations like broadcasting will be covered in class as we go over neural net programs. Of course you should test all of your programs

  1. Sum the squares of the first 20 odd numbers.
  2. Make a dictionary with keys being names of people and values being their height.
    1. Make a function that returns the name of the tallest person (your function does not know the length)
    2. Make a function that returns a list of the names in the dictionary sorted by height. (use a different sort than in tutorial)
  3. You are given two vectors in an arbitrary N dimensional space (𝕦=(u1,u2,...un),𝕧=(v1,v2,...,vn)).
    1. Make a function that finds the distance between these two vectors using loops.
      1. The distance between two vectors is defined as (uk-vk)2The distance between two vectors is defined as \sqrt{∑(u_k-v_k)2}
    2. Use arrays and dot product to find the distance without using loops.
    3. Can you test which method is faster.
  4. Implement the Perceptron Algorithm on OR and XOR using dot products and as much linear algebra manipulations as possible.
    1. There will be many of these online. It is better to try to do it yourself. At least totally understand one that you find online.