Tutor profile: Jason H.
What's the difference between a Numpy matrix and a Numpy array?
In Numpy, matrices are a subclass of arrays such that matrices must be two dimensions and the operators for arrays are overridden in such a way that the operations no longer are no longer element-wise (instead of A*B taking each element of A and B and multiplying them it multiplies the two matrices).
Subject: Java Programming
We have a 100-story building and a collection of eggs. These eggs are quite special in that they can either be completely intact or completely broken. They cannot be half-broken. Find me an algorithm that finds the highest floor that one can drop an egg from without it breaking. Do this in the least number of tries.
Radix sort is a good way to solve this. Have your algorithm try the 10th, 20th, 30th,... until it finds a floor on which the egg breaks. Then you have narrowed down the floor to one of ten floors. Then simply binary search the remaining ten floors.
Subject: Set Theory
Find the flaw in the following proof by induction: All horses are the same color. Start with the base case with 1 horse. All of the horses here are trivially the same color. Then for n -> n+1, first assume that if there are n horses then they are all the same color. Take a set of n+1 horses. The first n horses are the same color and the last n horses are the same color. So the first horse is the same color as the 2nd to n-1th horses, and the 2nd to n-1th horses are all the same color as the nth horse. So all n+1 of these horses are the same color. By induction, any natural number of horses (1,2,3,4,...) are all the same color.
The induction fails for 1 -> 2. So the rest of the steps of induction will fail to hold. For 1 -> 2 the 2nd to n-1 set is empty, so the logic used in the inductive step fails.
needs and Jason will reply soon.