SAMPLE Quiz questions for final exam in PSCB57 (MORE THAN WILL BE ASKED IN THE EXAM) Mark each statement Y or N, disregarding any typos I may make. If there is anything wrong with the statement(s) scientifically, mark it as N, even though most of it may be correct. *** CIRCLE WRONG WORD(S) or you'll not get points for the question *** In all programming questions, we assume the use of Python 3. All functions preceded by np. are NumPy functions. All functions preceded by plt. are PyPlot functions. ________________________________________________________________________________ [Y, N] If the number density of droplets of water in the air is n = 1e9 /m**3 (i.e. billion per cubic meter), and each droplet has cross-secitional area sigma = 7e-11 m**2, then the air filling a tube of length 10 m has optical thickness tau = 7e-2 * 10 = 0.7 [Y, N] A random walker on the axis N, with two absorbing boundaries at N=0 and N=100, walks K random steps in which it changes position from N to N+-1. As K --> infinity, the so-called Gambler's ruin (N=0) awaits him/her with probability 4/5, if the gambler's initial capital is N=20. [Y, N] Between 1999 and 2019, the share of trades made in U.S. markets dropped to only 10 percent of the initial. [Y, N] Variance of randomly scattered values X is simply the mean squared deviation of X and its arithmetic average . [Y, N] Standard deviation or standard error is the square root of variance [Y, N] Coefficient of correlation always lies between -1 and 1. [Y, N] The boxcar average of width 3 of the series of numbers: 0,-1,+2,3,2,1,-1,+3,... looks like: 0.33333, 1.333333, 2.33333, 2.00000, 0.666666, 1.00000, ... [Y, N] Convolution is smearing one function using the pattern (sometimes called Point-Spread Function), given by another function. [Y, N] Numerical differentiation of function f(x) according to formula df_dx = (f(x+dx) - f(x-dx))/(2 dx) returns the curvature of f(x) at point x with accuracy of order O(dx**3) [Y, N] If roundoff error of a method is equal 2*eps/h**2, where eps=2.2e-16 is machine epsilon, while h is the step size, and the truncation error of a method is equal h**2/8, then the method will commit the smallest sum of those errors, if we choose h, for which the derivative of the sum of errors is zero, in this case h = 2 eps**0.25 = 0.00024. [Y, N] Laplacian operator stencil of a 2-dimensional, 2nd order, differentiation, looks like a cross with -4 in the middle and +1's in four neighboring cells [Y, N] Unsharp masking is a typical optical error of low-resolution cameras. [Y, N] One step of bisection zero-finding returns a ~2 times closer approximation to the position of zero. [Y, N] Newton's method of root finding is said to be quadratically convergent, because the next error is a square of the previous one, asymptotically. [Y, N] Newton's method of root finding is said to be quadratically convergent, because the error is approximately the initial error times k**2, where k = number of iterations. [Y, N] Steepest descent method of multivariate optimization of a real function E(x,y,...) slows down as the search point approaches the true minimum or maximum. [Y, N] The reason we use np.random module to generate pseudorandom numbers is that we need a sequence of numbers that we have no way to ever reproduce again, and thus truly random. [Y, N] Galton board is an accelerator (co-processor on a separate board that speeds up arithmetic operations) [Y, N] One can say that Galton board generates a large number of transient and recurrent random walks in 1-D, and makes a histogram of their superposition after a fixed number of steps. [Y, N] The main disadvantage of MteCarlo method is the slowness with which the accuracy of answers derived using pseudorandom processes improves with N, the number of pseudorandom numbers used. Namely, the error is inversely proportional to only -1 power of N, while in second and higher order methods that power is -2 or less. [Y, N] Gauss elimination method to solve N linear equations for N unknowns requires of order O(N**3) arithmetic operations. [Y, N] The task of finding the best A and B in a formula y(x) = A + exp(-B*x*x), to fit by the Least Squared method a set of observational points (x_i,y_i), 1 < i < 1000, can be reduced to the solution of 2 linear algebraic equations with 2 unknowns (A and B). [Y, N] A large amount of dark matter can be shown to exist at the outer limits of most galaxies by applying Gauss's Least Squared method to rotation curves. [Y, N] In Nelder-Mead method, a geometrical object called simplex is used. It is an n-dimensional polyhedron made of n+1 points, which is marched through an n-dimensional surface of the minimized function that needs to be minimized, primarily by reflecting the highest (worst) of simplex points w.r.t. its center of mass. [Y, N] Spline is 3rd order polynomial fit by the Least Squares procedure to a set of data (it has 4 adjustable parameters). [Y, N] If you decrease step size h in a leapfrog algorithm from h=0.01 to h = 0.004, then the truncation error in the value(s) obtained at the end of a fixed time interval will diminish about 6 times. [Y, N] RK4 and other similar methods can be made very accurate if used for a limited extent of time or space, but in long-running simulations will exhibit the undesirable property of energy drift even if energy is a conserved property of the system. [Y, N] Symplectic methods are constructed not to exhibit the drift in conserved quantity of total mechanical energy, although they are still prone to the phase errors, that progressively less accurate timing errors in cyclic motion. [Y, N] 1st order ODEs are ordinary differential equations: there are no second derivatives after time in them. [Y, N] The most famous example of 2nd order ODE is Newton's equation of motion of a particle in a given force field: m X'' = f(X), where '' means second differentiation over time. [Y, N] Given m 2nd order ODEs, we can turn the system into an equivalent system of 2m 1st order equation, by naming all first order derivatives after time as new m variables. [Y, N] Chaotic solutions can be found in a system of two 1st order, nonlinear differential equations which are strongly coupled. [Y, N] The motion of mathematical pendulum is described by linear equation and obeys the principle of conservation of mechanical energy. Not so the more complicated physical pendulum, which can exhibit very large swings or circulating motion, thus having the sum of kinetic and potential energies changing with time - which we clearly see when we simulate that system. [Y, N] Trajectories of test particles in a restricted 3 Body problem of astrodynamics are never self-intersecting. [Y, N] Schroedinger equation of physical chemistry is used to model the structure and properties of molecules in interaction with other atoms and molecules. It is a nonlinear equation, where the superposition principle does not apply. [Y, N] As computer power grows with time at an ever-accelerating pace, eventually all the problems in physical science will be solved numerically by low-order schemes. [Y, N] Antikythera mechanism sank with the trading ship near a Greek island of that name. It consists of dozens of meshing gears, was hand-powered and quite compact. The function of this first known computer was calculation of future olympiads, holidays, position of planets, and phases of the Moon. [Y. N] Willhelm Schickard in the first half of 17. century constructed a 6-digit, 4-operations calculator for astronomical calculations. He wrote abot it to astronomer Johannes Kepler. [Y, N] Charles Babbage in 19. century constructed a hand-crancked Differential Engine. It could print long tables of high-order polynomials that it computed. Like W. Schickard before him, Babbage was motivated by the computational astronomy. [Y, N] In 1956, around the time the first general-purpose programming languages started appearing, a hard disk could hold 5 MB of data, or about as much as 1 high-resolution snapshot from a modern digital camera. Today, a hard disk can store of order 1000000 such pictures. [Y, N] Single-core performance of microprocessors started stagnating in the first decade of this century. The reason was the breakdown of Moore's law, which predicts that the number of transistors per unit area of an integrated circuit is doubling roughly every 2 years. There are not enough transistors on each core to grow performance at the historic rate any more. [Y, N] Modern interconnect switches transfer 1 to 20 GB/s. In 1 second they can transfer from 100 to 2000 books with illustrations, compressed to 10 MB each, to/from each node of a computer cluster simultaneously. [Y, N] The result of expression 1/np.sin(np.pi) is a division by zero. As such, it is undefined and will generate NaN result (not a number) or Infinity. [Y, N] If z = 4+3j, then abs(z) is 5. +- inaccuracy in 15th or 16th digit [Y, N] The loop: for i in range(1,5) generates i equal to: 1, 2, 3, 4, 5. [Y, N] If A is defined as A = np.zeros((4,512),dtype=int), then savetxt("output.dat",A.T) creates a file consisting of 512 lines of 4 zeros in each line, separated by a space. [Y, N] If B is defined as B = -1 + np.zeros((10,3),dtype=int), then savetxt("io.dat",B.T) creates a file consisting of 10 lines of 3 numbers "-1" in each line, separated by a comma. [Y, N] Only series whose terms alternate in sign, converge as N--> Infinity. [Y, N] Standard deviation of the mean value, derived by averaging a set of 100 numbers, is 33 times smaller than the standard deviation of the data items in the set. [Y, N] Kepler equation can be solved by iteration, and typically requires only ten to twenty iterations to converge to 8-bit float accuracy ~10**(-16) [Y, N] Kepler's equation allows to compute momentary position [Y, N] Fractal is self-similar in the sense of looking similar on all scales. One can zoom in practically infinite times and find similar patterns in a fractal. [Y, N] Numerical methods have been involved in some proofs in mathematics [Y, N] Iterated summation of Leibniz series pi = 1 - 1/3 + 1/5 -1/7 +... converges to exact np.pi like the number of terms N to the power -1 [Y, N] numpy.random.randn(M) generates M pseudorandom numbers with normal, i.e. Gaussian, distribution with standard deviation 1. [Y, N] Y = 10*numpy.random.randn(M) generates M pseudorandom numbers with normal, i.e. Gaussian, distribution with standard deviation 100. [Y, N] After we throw 1 million random points on unit square to evaluate pi by MteCarlo, we expect the accuracy of about 5 to 6 correct digits of pi=3.1415926.. [Y, N] We frequently perform Mte Carlo computations because they are the only practical way to do certain simulations or integrations, not because the method is efficient. [Y, N] Multiple assignment a = b = c = 2.4 is legal in Python3 [Y, N] Standard delimiter of data (separating character) in a file is by default a space character in both np.savetxt() and np.loadtxt() functions. It can be changed to a comma or other symbol, however. [Y, N] If ran1 = np.random.rand(1256) and decays = ran1 < 0.145, then decays is an array of 1256 floating point numbers, each between 0 and 0.145. [Y, N] For a numpy array X holding ordered, increasing values between 0.1 and 0.9 and array Y that holds values in the range 1.0 to 10.0, instruction plt.plot(X,Y,color=(0,0,1)) will prepare a plot where (X,Y) points are drawn as small blue circles not connected by lines. [Y, N] Half-life of U-235 isotope is longer than its lambda, the constant in the expression N(U-235) = N_0 * exp(-lambda*t) [Y, N] You need to ask about 1000 randomly chosen people for their preference in the presidential pre-election poll, to estimate the outcome of election with statistical error of order 3%. [Y, N] Line i = [3,2,1]; print(A[-1*i]) will print the last 3 values in array A. [Y, N] This loop: x = np.linspace(1,8); for i in x: print(i,x) will print a column of numbers: 1 2 3 4 5 6 7 8 [Y, N] Suppose t and x are float arrays of 500 values; then plt.plot(t,x) followed some time later by plt.show() will display a graph of y(x) dependence where points are connected by solid lines. [Y, N] If you plot first using instruction plt.plot(t,x) and then plt.plot(t,x**2) followed by plt.plot(t,x**2-x), the lines plotting these three functions will automatically be given different colors by Python [Y, N] x = 34; x = (x//34 == 1); if(x or not x): print('x is True') in Python code will print the string 'x is True'. [Y, N] This loop: x = np.linspace(1,8); for i in x: print(i,x) will print a column of numbers: 0. 1. 2. 3. 4. 5. 6. 7. [Y, N] After these instructions: t = np.zeros(100,dtype=float) ; t = 256. print(t) outputs 100 values all equal to 256. [Y, N] After these instruction: x = np.array(100,dtype=float)+1; x = x-1, the print(x) instruction will output 100 zeros. [Y, Z] plt.scatter([10.,2.,8.,4.], 1./[3.,2.,1.,0.]) will plot 4 points of the same color, the first list giving the x coordinates [Y, N] Instruction print((-9)**0.5) will stop the execution and generate an error message in Python, because square root of -9 is mathematically undefined (it's either 0+3j or 0-3j). [Y, N] Lists in Python are immutable [Y, N] Instruction print(122//123*124) will print number 0 [Y, N] The smallest positive floating point number distinct from zero is called machine epsilon, and in Python is equal to about 2.22e-7 [Y, N] Array of 5000 Python integers occupies 320000 bytes of memory [Y, N] Array defined as A = np.zeros(800,dtype=float) occupies 6400 bytes in RAM [Y, N] Python evaluates expression (4e-3 + 4e+3) to be equal to 4e0. [Y, N] Python evaluates expression (4e-3 - 4e+3) to be equal -3999.996