Numerical Methods
Data Viz
It's almost over
If this, then that
Loops and things
100

method that improves upon the Euler method

predictor corrector

100

To make a plot in Python, you probably want to import _____

matplotlib

100

What you are doing for your project?

(open-ended..)

100

What is the output of (pseudocode):

if 5 > 3: 

print(X)

else: print(Y)


X

100

Difference between a for and a while loop

a for loop iterates through a known set of values, a while iterates while a condition is true

200

Euler method – what is missing: x(i+1) = ___ + f(x)*delta_t

x(i)

200

plot(x,y,’k’) plots a line with the color ____

black

200

Where is my office

NC 2006

200

If I am taller than you, and you are shorter than Sue, who is the tallest?

(me or Sue, we’ll never know)

200

What is b here, in general?

b = 0

for a = 1:20

b = b+a

b is the sum of the values from 1 to 20

300

For a better Euler solution, make the time step _____

smaller

300

Find the code bug:

X_vector = 1:10

Y_vector = X*2

plot(X_vector, y_vector, ‘*b’)

y_vector should be Y_vector

300

What are our TAs’ names (hint M and M)

Mozhgan and Monerah

300

What is an “if statement”

a conditional statement, does some function if the condition is true

300

What is printed here:

For a = 1:5:15

print(a)

1, 6, 11

400

How do we pick initial guesses for the bisection method?

f(xa) and f(xb) must have opposite signs

400

What is missing in this plot?

plot(X,Y); hold on; plot(X,Z)

title(‘My data’); xlabel(‘X values’)

a legend (since there are two lines), and y label

400

final exam (project) time and place

12:30, next Thursday May 12, NC 2413, project presentations

400

What does the following code do?

for i =1:100

if i = = 25:

 break

end

end

loop through values of i from 1 to 100, but stop at 25 and exit the loop

400

What is printed here:

val = 10

while val > 0

print(val)

val = val – 3

10, 7, 4, 1, -2

500

Describe the Newton method to find a root

Start with initial guess, use derivative (tangent slope) to improve it, iterate

500

Define a histogram

a plot that shows a frequency distribution for a dataset

500

define Arduino

"an open-source electronics platform based on easy-to-use hardware and software"

500

What is the problem with this statement?

If Grade > 90

disp(‘you got an A’)

elseif Grade < 90

disp(‘you did not get an A’)

end

it does not account for a grade of 90

500

What is the final value of X?

X=0

for a = 1:5

for b = 1:3

       X = X+1

  X = 15, or the total number of iterations

M
e
n
u