numeric Flashcards

1
Q

How many bits of computer memory are used when storing a single

A

32

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How many bits of computer memory are used when storing a double

A

64

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How many bits of computer memory are used when storing a long double

A

80

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In a double, how are the bits distrbuted among sign, exponent and significant

A

1 sign, 11 exponent and 52 mantissa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In a single, how are the bits distrbuted among sign, exponent and significant

A

1 sign, 8 exponents and 23 mantissa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an Mantissa

A

It is the part of a logarithm after the decimal point.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are, in absolute value, the largest and smallest numbers representable as doubles?

A

E=0 and E=2047

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Find the absolute round-off error of the numbers below when represented as a double.

  1. 1415
  2. 022140857*10^23
  3. 8*10^(-10)
A
number_one = 3.1415 *2.22*10**-16
number_two = 6.022140857*10**23*2.22*10**-16
number_three = 0.8*10**-10*2.22*10**-16
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Hva kjennetegner komposittmetoder for numerisk integrasjon?

A

Korrekt svar: Komposittmetoder baserer seg på å splitte integrasjonsintervallet i flere
subintervaller

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Rangér metodene fra mest til minst restriktive konvergensbetingelser.

Newton > secant > bisection
Newton > bisection > secant
secant > bisection > Newton
bisection > secant > Newton

A

Newton > sekant > biseksjon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Hva er usant om algoritmer for å finne nullpunkt til ikke-lineære funksjoner?

A

Korrekt svar: Biseksjonsmetoden baserer seg på å følge tangentlinjene til funksjonen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Hva er hensikten med partiell pivotering i Gauss-eliminasjon?

A

Korrekt svar: Å redusere regnefeil som følge av flyttallspresisjon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Heuns metode er et eksempel på…

A

Korrekt svar: En to-stegs metode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Adaptiv Simpsons metode er…

A

Korrekt svar: Et eksempel på en rekursiv algoritme

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Hva er usant om flyttall?

A

Korrekt svar: Det er uproblematisk å sjekke likhet mellom to flyttall

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Hvilken algoritme brukes for å beregne bestemte integraler?

A

Korrekt svar: Trapesmetoden

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Hva er en rimelig kontrollstruktur å bruke når man skal implementere Newtons metode?

A

Korrekt svar: En while-løkke

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Hva kan man ikke bruke feilestimater for integrasjonsmetoder til?

A

Korrekt svar: Gi eksakte svar på integralene

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How can one deduce the secant method from Newton’s method

A

Exchange the derivative in Newton’s method for a difference approximation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Will Newton’s method always converge to a zero?

A

No, because the converge is reliant on the function and the point

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

If no derivative is available, which method should you choose - Newton’s method or the secant method?

A

The secant method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which method is the safest to use - Newton’s method, the secant method or the bisection method?

A

Bisection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which method is the slowest to use - Newton’s method, the secant method or the bisection method?

A

Bisection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is Tuple

A

Tuples are used to store multiple items in a single variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What characterises a composite method for numerical integration? - Simpsons rule cannot be generalized to a composite rule - Composite rules are based on splitting the integration interval into several subintervals - Composite rules are based on combining the midpoint and trapezoidal rules - It is impossible to make error estimates for composite rules
Komposittmetoder baserer seg på å splitte integrasjonsintervallet i flere subintervaller
26
What is false about algorithms for finding zeroes of nonlinear functions? - Newton's method can be generalized to multidimensional functions by using Jacobi matrices - The secant method does not require information about the derivative of the function - Newton's method requires that one decides upon a set of stopping conditions - The bisection method is based on following the tangent lines of the function
Biseksjonsmetoden baserer seg på å følge tangentlinjene til funksjonen
27
What is the purpose of partial pivoting in Gaussian elimination? - Making it easier to perform back substitution - To have a fixed plan for which rows to swap - Sorting the matrix - To reduce computational errors due to floating point precision
Å redusere regnefeil som følge av flyttallspresisjon
28
``` Heun's method is an example of... An adaptive method A first order method An implicit method A two-step method ```
En to-stegs metode
29
The adaptive Simpson's method is... - a version of Simpson's method which can be adapted to find the zeroes of functions - an ODE solver that can be implicit or explicit as needed - an ODE solver with adaptive step lengths - an example of a recursive algorithm
- an example of a recursive algorithm
30
What is untrue about floating point numbers? - Adding large and small floating point numbers can lead to considerable roundoff errors - It is unproblematic to check for equality between two floating point numbers - Multiplication of floating point numbers leads to minor computational errors only - A floating point number is represented by a sign, an exponent and a mantissa
It is unproblematic to check for equality between two floating point numbers
31
Which of these methods are used to approximate definite integrals? - Gaussian elimination - The trapezoidal rule - The secant method - Implicit Euler
The trapezoidal rule
32
What is a reasonable control structure to use when implementing Newton's method? - A case block - A while loop - An if-then-else structure - A for loop
- A while loop
33
What can we not use error estimates for numerical integration methods for? - Give exact values of the integrals - Give uncertainty estimates on the approximated value of an integral - Make adaptive versions of methods such as the adaptive Simpson's rule - Choose the amount of intervals so that you get a guaranteed upper error bound
Give exact values of the integrals
34
Et flyttall a representeres i datamaaskinen binært som a= (-1)^sg * 2^e-b *s, Sg står for sign og er 0 eller 1, og e er exponent. Hva er b i denne sammengen.
- bias (forskyvning), et forhåndsbestemt heltall som muliggjør negative eksponenter - Blanks, et helltatt som sier hvor mange innledende nuller det er bak komma i det opprinnelige tallet. - binary - Et tall som justerer eksponenten til binære form
35
S i formelen : a= (-1)^sg * 2^e-b *s, står for "signifikand" men hva slags tall er dette? - Et tall mellom 1 og 2 på formen s = 1.s1s2s3s4s5... hvor hver si er en bit i s - Et tall mellom 0 og 1 på formen 0.s1s2s3s4, hvor hver si er en byte - Et heltall mellom -1.s1s2s3s4 og s.s1s2s3s4
Et tall mellom 1 og 2 på formen s = 1.s1s2s3s4s5... hvor hver si er en bit i s
36
Gitt at alle tre metodene virker i den aktuelle situasjonen. Hvilken metode konvergerer raskest av biseksjonsmetoden, newtons metode og sekantmetoden
newtons metoden
37
Hva er ulempen med Newtons metode? - vi må kjenne den deriverte til funksjonen - metoden virker ikke hvis funksjonen stiger svært raskt - resultatet blir ikke like nøyaktig som med sekantmetoden
vi må kjenne den deriverte til funksjonen
38
Hva er betingelsene for at Gauss-eliminasjon skal fungere - fungerer såfremt den andrederiverte til funksjonen er ulik null i det aktuelle området. - Fungerer såframt ligningssystemet har en løsning - Fungerer såframt alle koeffisientene er heltall.
Fungerer såframt ligningssystemet har en løsning
39
Hva er forskjellen på eksplisitt og implisitt Euler - metode? - Eksplisitt virker med færre datapunkter enn implisitt metode - Eksplisitt er raskere men mindre stabil enn implisitt - eksplisitt er tregere, men gir mindre avrundingsfeil enn implisitt.
- Eksplisitt er raskere men mindre stabil enn implisitt
40
Hva er poenget med pivotering i gauss-eliminasjon? - Beregninger går raskere - Løsningen blir mer presis - Man kan håndtere spesialtilfeller der gauss-eliminasjon uten pivotering ikke gir noen løsning.
- Løsningen blir mer presis
41
What is the difference between lists and tuples in Python? - Tuples allow for direct lookup by element value, lists only by index. - Lists can have duplicate elements, tuples can not - Lists are mutable, tuples are non-mutable
- Lists are mutable, tuples are non-mutable
42
Sets in Python have... - no duplicate elements and no fixed ordering of the elements - no duplicate elements and elements in fixed order - the possibility for duplicate elements, but the elements have no fixed ordering
- no duplicate elements and no fixed ordering of the elements
43
3. 25E19 in Python is the same as 3. 25*10**19 3. 25*math.e*19 3. 25**19
3.25*10**19
44
For which combination of variable values will this formula give very bad precision if we translate it directly to Python as e.g. x1 = (-b - math.sqrt(b**2 - 4*a*c))/(2*a) and x2 = (-b + math.sqrt(b**2 - 4*a*c))/(2*a) ? ``` a = 10^8, b = 1, c = 1 a = 1, b = 10^8 , c = 1 a = 1, b = 1, c = 10^8 ```
a = 1, b = 10^8 , c = 1 (grunnen til dette er at her blir b**2 svært dominerende i kvadratrotuttrykket, slik at vi subtraherer to nesten like tall, dermed mister vi presisjon)
45
The assignment X = { } in Python initializes X as - an empty dictionary - an empty set - an empty set or dictionary, exactly which is determined once an element is added to it
an empty dictionary
46
What characterises a composite method for numerical integration? - Simpsons rule cannot be generalized to a composite rule - Composite rules are based on splitting the integration interval into several subintervals - Composite rules are based on combining the midpoint and trapezoidal rules It is impossible to make error estimates for composite rules
Composite rules are based on splitting the integration interval into several subintervals
47
``` Arrange the methods from most to least restrictive convergence requirements. Newton > secant > bisection Newton > bisection > secant secant > bisection > Newton bisection > secant > Newton ```
Newton > secant > bisection
48
What is false about algorithms for finding zeroes of nonlinear functions? - Newton's method can be generalized to multidimensional functions by using Jacobi matrices - The secant method does not require information about the derivative of the function - Newton's method requires that one decides upon a set of stopping conditions - The bisection method is based on following the tangent lines of the function
The bisection method is based on following the tangent lines of the function
49
What is the purpose of partial pivoting in Gaussian elimination? - Making it easier to perform back substitution - To have a fixed plan for which rows to swap - Sorting the matrix - To reduce computational errors due to floating point precision
To reduce computational errors due to floating point precision
50
Heun's method is an example of... (trapez) - An adaptive method - A first order method - An implicit method - A two-step method
- A two-step method
51
The adaptive Simpson's method is... - a version of Simpson's method which can be adapted to find the zeroes of functions - an ODE solver that can be implicit or explicit as needed - an ODE solver with adaptive step lengths - an example of a recursive algorithm
an example of a recursive algorithm
52
What is untrue about floating point numbers? - Adding large and small floating point numbers can lead to considerable roundoff errors - It is unproblematic to check for equality between two floating point numbers - Multiplication of floating point numbers leads to minor computational errors only - A floating point number is represented by a sign, an exponent and a mantissa
- It is unproblematic to check for equality between two floating point numbers
53
Which of these methods are used to approximate definite integrals? - Gaussian elimination - The trapezoidal rule - The secant method - Implicit Euler
- The trapezoidal rule
54
``` What is a reasonable control structure to use when implementing Newton's method? A case block A while loop An if-then-else structure A for loop ```
A while loop
55
What can we not use error estimates for numerical integration methods for? - Give exact values of the integrals - Give uncertainty estimates on the approximated value of an integral - Make adaptive versions of methods such as the adaptive Simpson's rule - Choose the amount of intervals so that you get a guaranteed upper error bound
Give exact values of the integrals
56
Select a condition that must be satisfied for Newton's method to converge when solving a scalar non-linear equation - The exact solution must be near x = 0 - The function must be differentiable for all values of x - Your initial guess must be close enough to the exact solution
Your initial guess must be close enough to the exact solution
57
Select the true statement about composite integration methods - They use the same integration rule on smaller intervals - They use different integration rules for the same function - They are less accurate than non-composite methods
They use the same integration rule on smaller intervals
58
A partial pivoting step is implemented in Gaussian elimination to... - mitigate errors due to finite-precision arithmetic - correctly sort the matrix so we can do row operations in an easier way - speed up the Gaussian elimination algorithm
- mitigate errors due to finite-precision arithmetic
59
You are solving an ordinary differential equation. Select the main reason that one would prefer to use a higher order method over a lower order method (with the same time-step)? - To increase the stability of the method - To increase the accuracy of the solution - To increase the speed of the method
To increase the accuracy of the solution
60
What is true about 32-bit integer data types: - Checking for equality between integers is a safe to do - You can represent any integer in Python using this data type - You must take into account round off errors when adding large integers to small integers
- Checking for equality between integers is a safe to do
61
converging for this particular equation. You are not interested in the speed of your code and would like to switch your algorithm. Suggest an alternative algorithm that will ensure that that your code converges to the correct solution - Use the backward Euler method - Use the bisection method - Use the secant method first, then swap back to Newton's method.
Use the bisection method
62
Select the statement that is false about the Simpson method: - The Simpson method is based on the exact integral of a quadratic polynomial approximation of - The Simpson rule will exactly integrate functions whose fourth derivative (and higher derivatives) are zero. - The Simpson method becomes less accurate the smaller the interval becomes
The Simpson method becomes less accurate the smaller the interval becomes
63
What is false about the adaptive Simpson method - It uses an optimum time step size to solve an ODE to within a user-specified tolerance level. - It is a recursive method - It uses an optimum interval size to solve an integral to within a user-specified tolerance level.
- It uses an optimum time step size to solve an ODE to within a user-specified tolerance level.
64
Floating points numbers in Python... - are not associated with the concept of round-off errors - can be arbitrary large - are represented as a long sequence of bits
- are represented as a long sequence of bits