AMATH 301 (UW Seattle)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/57

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:30 AM on 4/11/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

58 Terms

1
New cards

Which MATLAB command yields the number of columns for matrix A?

size(A,2)

Q1

2
New cards

How do you write code for a 2 column and 3 row matrix?

A=[8, -10; 15, 0; -1,0]

Q1

3
New cards

Let A=[1 4; 5 2; 7 0]. Ho can you compute the 2nd column vector of A?

norm(A(:,2))

Q1

4
New cards

Given A an arbitrary nxn square matrix, the number of arithmetic operations for the Gaussian elimination for solving Ax=b is...

Order O(n^3)

Q1

5
New cards

Given A an arbitrary square matrix with n rows and n columns, the MATLAB command for the LU factorization is [L, U, P] = lu(A). What do L, U, and P stand for?

L= lower triangular matrix

U= upper triangular matrix

P= permutation, such that LU=PA

Q1

6
New cards

Let A=[1,2; 3,4; -6,9]. Define b=(1:1:end,end). What is b?

[2; 4; 9]

Q2

7
New cards

Which MATLAB command yields the number of rows for matrix A?

size(A,1)

Q2

8
New cards

Consider the following MATLAB program

x=0

for j= 1:1:4,

x=x+j;

end

What is the final value for x?

x=0

j=1 x=0+1 x=1

j=2 x=1+2 x=3

j=3 x=3+3 x=6

j=4 x=6+4 x=10

Q2

9
New cards

Given an arbitrary n x n square matrix, the number of arithmetic operations for the Gaussian elimination when solving Ax = b is

Order O(n^3)

Q2

10
New cards

The MATLAB statement [L, U] = lu(A) produces a square "psychologically" lower triangular matrix L and a square upper triangular matrix U from the matrix A, satisfying the equation A=L*U. Which MATLAB statement gives the solution to the system Ax=b?

x=U\(L\b)

Q2

11
New cards

An invertible square matrix ( ) is always diagonalizable.

False

Q2

12
New cards

Which MATLAB command yields the diagonal for matrix A in a column vector?

diag(A)

Q2

13
New cards

A singular (or non-invertible) square matrix is always diagonalizable.

False

Q2

14
New cards

Given x = [2, 4, 5, 8, 9, 10] and y = [2, 9, 12, 32, 40, 52], which of the following MATLAB statements fits the data with a cubic curve (cubic = polynomial of degree 3)?

p=polyfit(x,y,3)

originally p=polyfit(x,y,n)

n=degree of function

x & y= coefficients of polynomial

Q2

15
New cards

Given x = [1, 2, 3, 4, 5]' and y = [1, 1, 1, 0, 0], consider the MATLAB command: p = polyfit(x, y, 2). Is this a curve fitting or an interpolation?

Polyfit is curve fitting

Q2

16
New cards

A diagonalizable matrix is always invertible (det(A)≠0)

False

Q3

17
New cards

A diagonalizable matrix could be square or rectangle (i.e. with less columns than rows).

False

Q3

18
New cards

The MATLAB statement [L, U, P] = lu(A) produces a square lower triangular matrix L, a square upper triangular matrix U, and a permutation matrix P from the square matrix A, satisfying the relation PA=LU. Which MATLAB statement gives the solution to the system Ax=b?

x=U\(L\(P*b))

Q3

19
New cards

Given x = [1, 2, 3, 4, 5] and y = [1, 1, 1, 0, 0], which MATLAB statement yields the coefficients for a cubic polynomial fitting the data?

p = polyfit(x,y,3)

Q3

20
New cards

For a given set of data points (ti, yi) i=1,...,n. Which value of n do you need to interpolate exactly the data with a cubic polynomial? Recall that interpolation goes exactly through the data points.

always +1 of the degree of polynomial, so n=4

Q3

21
New cards

Let f(x)= -x^4 +x +1. Which statement finds the root r such that f(r)= 0 using the initial guess x=0?

fzero(@(x) -x.^4+x+1, 0)

Q3

22
New cards

What does the fzero function do?

Tries to find zero of function near X0 if X0 is a scaler.

Q3

23
New cards

A global minimum is also a local minimum

True

Q3

24
New cards

What statement yields the maximum of a function f(x) using an initial guess x=1?

Inverse of f(x) and use fmin search

25
New cards

Let f(x)=x^4+10xsin(x^2). This function has a local minima between -2 and -1. What MATLAB statement yields an approximation to this local minimum?

[x1, f1] = fminbnd(@(x) x.^4+10x.sin(x.^2), -2, -1)

26
New cards

Let A = [1, 2, 3, 4]. We have three commands:

1). norm(norm(A,1),1)

2). sum(abs(A))

3). abs(sum(A))

Which of the following statements is correct?

All are correct

Q3

27
New cards

When approximating in double precision with a central difference scheme, the time-step that minimizes the error is...

10^(-5)

Q3

28
New cards

When approximating with a finite difference scheme, the central difference formula is more accurate than the forward difference formula.

True

Q3

29
New cards

Since the midpoint quadrature rule is based on interpolation by a constant, whereas the trapezoid quadrature rule is based on linear interpolation, the trapezoid rule is

False

Q4

30
New cards

Which MATLAB statement yields an approximation for integral of exp(-x^2)dx from 0 to 2?

integral(@(x) exp(-x.^2), 0,2)

31
New cards

Which of the following time-integration method is implicit?

Backward Euler Method

Q4

32
New cards

How would you estimate the value of y at t=10 for the ODE dy/dt=-10y-2ty

[t,y]=ode45(@(t,y)-10y-2t.*y,[0,10],1); yf=y(end)

Q4

33
New cards

In the numerical solution of an ODE, the local error and the global error are identical.

False

Q4

34
New cards

In solving an ODE numerically, the roundoff error always dominates the global error.

False

Q4

35
New cards

When solving a stable differential equation numerically (such as y'=-2y ), the (implicit) backward Euler method is stable for any choice of time-step ∆t

True

Q4

36
New cards

A numerical ODE method is of the order p when

when the global error is O(h^p)

Q4

37
New cards

Which MATLAB command yields the number of rows for matrix A?

size(A,1)

38
New cards

Let matrix A be 50x50. The MATLAB command, cond(A), returns the value 10^14 . Which of the following statements is correct?

A is ill-conditioned

39
New cards

Any matrix A (square or rectangular) has a singular value decomposition.

True

40
New cards

The MATLAB statement [U,S,V]=svd(A,0) produces a reduced singular value decomposition for the square matrix A, satisfying the equation USV'=A. What is the expression for A*A'?

US^2U'

41
New cards

Let A be a square invertible matrix. The MATLAB statement [U,S,V]=svd(A, 0) produces a reduced singular value decomposition for the square matrix A, satisfying the equation USV'=A. Which MATLAB statement gives the solution to the system Ax=b?

x=V'\(S\(U\b))

42
New cards

The number of arithmetic operations for the fast Fourier transform (FFT) is

order (nlog(n))

43
New cards

The fast Fourier transform (FFT) algorithm can compute both the discrete Fourier transform and its inverse with equal efficiency.

True

44
New cards

The MATLAB statement R = chol(A) produces a square upper triangular matrix R from the symmetric matrix A, satisfying the equation R'*R=A. This decomposition is the Cholesky factorization, a specialization of the LU factorization for symmetric matrices with positive eigenvalues. Which MATLAB statement gives the solution to the system Ax=b?

x=R\(R'\b)

45
New cards

For A = [1/2, 1/2, 1/3; 1/4, 0, 1/3;1/4, 1/2, 1/3], we run the command [U, V]=eig(A), and got diag(V) = [1, 0.1371, -0.3038]'. Which of the following is equal to U(:,1)?

A*U(:,1)

46
New cards

Suppose we are using a composite trapezoid rule to integrate a (nontrivial) f(x) from 0 to 1 and we partition [0, 1] into N sub-intervals, at least how many function evaluations do we need to take?

N+1

47
New cards

Which of the following MATLAB statements will draw a blue dotted line between two points (x0, y0) = (0,2) and (x1,y1) = (4,6) ?

plot([0 4],[2 6],'b:');

48
New cards

Which of the following MATLAB statements will draw the sine function over the interval -pi to pi?

plot((-pi):0.1:pi, sin((-pi):0.1:pi)

49
New cards

Given the ODE , which of the following statements defines properly the function f"=-y'-2ty handle for solving this ODE with ode45?

f = @(t,y) [y(2);-y(2)-2t.y(1)];

50
New cards

The MATLAB command ode45 yields results that are usually more accurate than the results from ode23.

True

51
New cards

What order is DFT?

O(n^2)

52
New cards

DFT is an algorithm, not a transform

True

53
New cards

FFT can be used to calculate DFT

True

54
New cards

to solve Ax = b is the same algorithm as factoring A = LU and solving LUx = b.

Gaussian Ellimination

55
New cards

inv(A) * b is more expensive than A\b

True

56
New cards

Eigendecomposition requires....

• A has to be square matrix

• Ax = λx with x = 0

• det (A − λI) = 0

57
New cards

What does the Jacobi iteration do?

1)Solves Ax=b

2)Decompose A = L∗ + D + U∗

3) Iteration Dx(k+1) = b−(L∗ + U∗) x(k) orx(k+1) = D−1 b − (L∗ + U∗) x(k)

58
New cards

What order is forward substitution?

On^2