Numerical Methods: Jacobi, Gauss, Dolittle, and Newton

Jacobi Method

The Jacobi method is an iterative algorithm for determining the solutions of a strictly diagonally dominant system of linear equations. Each diagonal element is solved for, and an approximate value is plugged in. The process is then iterated until it converges.

Function [x, iter] = jacobi(A, b, x0, tol, maxiter)

n = size(A)(1);
dim, dim = size(A);
x = x0;
xnext = zeros(dim, 1);
r = norm(A * x - b);
normb = norm(b);
iter = 0;
while (r > tol * normb) && (iter < maxiter)
 
Read More

4P61 Cheat Sheet: Automata and Formal Languages

4P61 Cheat Sheet

Assignment 1

1) Function f: N→N has a fixed point at i such that f(i) = i. Show that the set is not countable.

Answer: If countable, f1, f2,… define function f; f(i) = fi(i) + i for i = 1, 2, 3,…

Therefore, (1) f does not have a fixed point since f(i) > i and (2) ffi since f(i) ≠ fi(i); i.e., not countable.

2) k≥1, A: N→(1, 2,… k), B: (1, 2,… k)→N. Is A or B countable?

Answer: k=1, only 1 function. If A is finite, then yes, it is countable. k>1, similar to

Read More