This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import math | |
import unittest | |
import sys | |
import matplotlib.pyplot as plt | |
import heapq | |
# k neighbours for oranges and grapefruits. tested function calls before running. | |
def knn(k, datastore, fruit): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Last updated: July 31 2017 | |
# Author: Caroline Lin | |
# Written for Maple 2016, on Ubuntu Linux 16.04 LTS. | |
# | |
# Typical usage | |
# | |
# Comments | |
# * for approximate case, inequalities must be specified in terms of the approximated functions | |
# e.g. f(u) <> 3 should be replaced by f(v[0][0]) <> 3 | |
# otherwise rifsimp will error later on. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Last updated: July 31 2017 | |
# Author: Caroline Lin | |
# Written for Maple 2016, on Ubuntu Linux 16.04 LTS. | |
# | |
# Typical usage | |
# | |
# Comments | |
# * for approximate case, inequalities must be specified in terms of the approximated functions | |
# e.g. f(u) <> 3 should be replaced by f(v[0][0]) <> 3 | |
# otherwise rifsimp will error later on. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Two libraries: | |
* GLUT | |
* GLUI | |
* Mesa-utils | |
**ASIDE** | |
do | |
sudo apt-cache search "your search here" | |
to do a search of the ubuntu repo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
math riddle of the day: Recall that orthogonal matrices are defined to be the (n by n) matrices over R^n for which (A^T A = A A^T = Identity), or equivalently, dotprod(x,y) = dotprod(Ax,Ay) for all x,y in R^n (inner-product preserving). | |
If A is an orthogonal matrix, we can show that its determinant must be either +-1. | |
Is the converse true? e.g. do all matrices with det 1 preserve inner products? | |
if so, prove it, if not, provide a counterexample. | |
i. Proof. First note that det A = det A^T by a handy theorem in Ch. 4 of FIS. Also det A det B = det AB by the same book. | |
So that A A^T = I implies (det A)^2 = 1 implies det A = +- 1. | |
ii. The converse is not true: let A be the matrix [1 1][1 0]. The basis vectors e_1, e_2 are sent to e_1, (1, 1) by this transformation | |
respectively. The dot product of the former is 0 (yay orthogonality) but the dot product of the latter is 1. |