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
Q

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
A

Komposittmetoder baserer seg på å splitte integrasjonsintervallet i flere
subintervaller

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

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
A

Biseksjonsmetoden baserer seg på å følge tangentlinjene til funksjonen

27
Q

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

A

Å redusere regnefeil som følge av flyttallspresisjon

28
Q
Heun's method is an example of...
An adaptive method
A first order method
An implicit method
A two-step method
A

En to-stegs metode

29
Q

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
A
  • an example of a recursive algorithm
30
Q

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
A

It is unproblematic to check for equality between two floating point numbers

31
Q

Which of these methods are used to approximate definite integrals?

  • Gaussian elimination
  • The trapezoidal rule
  • The secant method
  • Implicit Euler
A

The trapezoidal rule

32
Q

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
  • A while loop
33
Q

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
A

Give exact values of the integrals

34
Q

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.

A
  • 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
Q

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
A

Et tall mellom 1 og 2 på formen s = 1.s1s2s3s4s5… hvor hver si er en bit i s

36
Q

Gitt at alle tre metodene virker i den aktuelle situasjonen. Hvilken metode konvergerer raskest av biseksjonsmetoden, newtons metode og sekantmetoden

A

newtons metoden

37
Q

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
A

vi må kjenne den deriverte til funksjonen

38
Q

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.
A

Fungerer såframt ligningssystemet har en løsning

39
Q

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.
A
  • Eksplisitt er raskere men mindre stabil enn implisitt
40
Q

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.
A
  • Løsningen blir mer presis
41
Q

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
A
  • Lists are mutable, tuples are non-mutable
42
Q

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
A
  • no duplicate elements and no fixed ordering of the elements
43
Q
  1. 25E19 in Python is the same as
  2. 25*10**19
  3. 25math.e19
  4. 25**19
A

3.25*10**19

44
Q

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(b2 - 4ac))/(2a) and x2 = (-b + math.sqrt(b**2 -
4
ac))/(2a) ?

a = 10^8, b = 1, c = 1
a = 1, b = 10^8 , c = 1
a = 1, b = 1, c = 10^8
A

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
Q

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
A

an empty dictionary

46
Q

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

A

Composite rules are based on splitting the integration interval into several subintervals

47
Q
Arrange the methods from most to least restrictive convergence requirements.
Newton > secant > bisection
Newton > bisection > secant
secant > bisection > Newton
bisection > secant > Newton
A

Newton > secant > bisection

48
Q

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
A

The bisection method is based on following the tangent lines of the function

49
Q

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
A

To reduce computational errors due to floating point precision

50
Q

Heun’s method is an example of… (trapez)

  • An adaptive method
  • A first order method
  • An implicit method
  • A two-step method
A
  • A two-step method
51
Q

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
A

an example of a recursive algorithm

52
Q

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
A
  • It is unproblematic to check for equality between two floating point numbers
53
Q

Which of these methods are used to approximate definite integrals?

  • Gaussian elimination
  • The trapezoidal rule
  • The secant method
  • Implicit Euler
A
  • The trapezoidal rule
54
Q
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

A while loop

55
Q

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
A

Give exact values of the integrals

56
Q

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

A

Your initial guess must be close enough to the exact solution

57
Q

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
A

They use the same integration rule on smaller intervals

58
Q

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
A
  • mitigate errors due to finite-precision arithmetic
59
Q

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

A

To increase the accuracy of the solution

60
Q

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
A
  • Checking for equality between integers is a safe to do
61
Q

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.
A

Use the bisection method

62
Q

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

A

The Simpson method becomes less accurate the smaller the interval becomes

63
Q

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.
A
  • It uses an optimum time step size to solve an ODE to within a user-specified tolerance level.
64
Q

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
A
  • are represented as a long sequence of bits