% sample solutions to assignment 01
% Author: Michael Goldwasser

% Problem A)
answerA = (28.5 * 3^3 - sqrt(1500)) / (11^2 + 37.3)

% Problem B)
answerB = (7/3)^2 * 4^3 * 18 - 6^7 / (9^3 - 652)

% Problem C)
x = 9.75;
answerC =  4*x^3 - 14*x^2 - 6.32*x + 7.3

% Problem D)
n = 12; r = 5;
answerD = factorial(n) / (factorial(r) * (factorial(n-r)))

% Problem E)
bigQuake = 10^(4.4 + 3 * 7.1 / 2);
smallQuake = 10^(4.4 + 3 * 6.9 / 2);
answerE = bigQuake / smallQuake

% Problem F)
R = 95; h = 20;
answerF = R * exp(-h/173)

% Problem G)
x0 = 3; y0 = -4;
A = 2; B = -7; C = -10;
answerG = abs(A*x0 + B*y0 + C) / sqrt(A^2 + B^2)
