SAMPLE Quiz questions for midterm in PSCB57 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. 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] Archimedes is the likely source of the design of the first computer called Antikythera mechanism, found in a shipwreck near a Greek island. [Y, N] Antikythera mechanism is a mixed analog-digital computing device, able to compute future astronomical events including planet positions and eclipses. [Y, N] Charles Babbage created his Universal Calculator using steam power in the 19th century. It was the first device based on binary digit representation of numbers. [Y, N] Zuse Z3 computer is considered the first implementation of Boolean or binary arithmetic to computers. It used 10000 vacuum tubes. [Y, N] ENIGMA was German coding machine. Its decoding by cryptologists and builders of increasingly sophisticated machines called "Bombe" influenced the outcome of World War II. First such specialized computer based on electromagnetic relays was build in Poland before the war. [Y, N] The main technological difference between the ENIAC and UNIVAC computers and the PDP-series computers of Digital Corporation was the use of vacuum tubes in the former, and transistors and other electronic elements in the latter. [Y, N] We measure the arithmetic speed of a computer in TFLOPS. 1 TFLOP is 1e9 floating point operations per second. [Y, N] Moore's law is the empirical observation that the number of FLOPS a computer is capable of is steadily increasing with time, as time to the power approximately 2. [Y, N] The currently slower than previously rate of increase of computational computational power of computers boils down to physically unavoidable effects of finite speed o light, quantum uncertainty, and power consumption of integrated circuits. [Y, N] Motorola 68000 was a 68000-bit CPU from 1979 [Y, N] Floating point representation has separate mantissa and exponent parts [Y, N] Currently, CPUs consist of billions of transistors and other microscopic units inside a microprocessor. [Y, N] GPU is an abbreviation of Graphics Processing Unit [Y, N] Between 2005 and 2010, the clock frequency of CPUs stagnated at about 2000-4000 MHz. [Y, N] Python2 and Python3 are not fundamentally compatible, for instance a code in Python 2 may not correctly compute if you have a Python3 installation. [Y, N] Bandwidth of transmission lines in computers is measured in nanometers. [Y, N] 1 Terabyte is 8e12 bits, or equivalently 1 million MB. [Y, N] Data flow inside the modern processor much exceeds 1 GB/s. [Y, N] Dynamical typing languages tolerate re-definitions of a variable from one type to another, for instance from a single integer to an array of floats, in one section, even in adjacent lines. [Y, N] A 64-bit integer can have one of 2**64 different values [Y, N] In the middle 20th century, COLOSSUS machines had punched paper tape readers able to read a few thousand characters per second. [Y, N] The switch from mainframes to interactive minicomputers in the 1970s became possible thanks to innovations by DEC (Digital Corp.). [Y, N] One byte can store one of 1024 (or 1K) different values. [Y, N] The fastest supercomputer, Summit, has thousands of nodes and tens of thousands GPUs. Most computational power is from graphics cards, not CPUs. [Y, N] Current microprocessor technology is named 10 nanometer technology. The name derives from the distance light travels in one clock cycle of the processor. [Y, N] Ada Lovelace, assistant of Charles Babbage, created programming language Fortran in late 1950s. The name is shortenig of Formula Translator. [Y, N] The first electronic microcomputer was names Apple Macintosh I. [Y, N] The currently fastest supercomputers reach 200 TFLOP performance. [Y, N] Iteration can be done in Python using three different types of loops: 'for' loop, 'while' loop, and 'break' loop [Y, N] Von Neumann computer with a larger CPU (=Computational Precision Unit) will have a larger accuracy than a smaller CPU. [Y, N] Von Neumann computer has central arithmetic-logic unit which is physically separate from its operational memory [Y, N] Alan Turing, working at IBM, invented the punched card storage [Y, N] Python was first defined as programming language in late 1980s. [Y, N] The first microcomputer was invented by IBM company in 1986. Since then, the name of 64-bit CPU architecture is denoted as x86_64 [Y, N] If instruction x = 3.1415926535 is followed by instruction x = x/2, variable x obtains integer value 1 [Y, N] If instruction x = 3.1415926535 is followed by instruction x = float(x//2), variable x acquires a floating point value 1.570... [Y, N] The result of expression 1/np.sin(np.pi) is undefined and will generate a NaN result (not a number) or Infinity result. [Y, N] If z = 1+1j, the absolute value of z is a square root of 2 [Y, N] If z = 1+0j, and x = 3, then Boolean value of expression x*z == 3+0j is False [Y, N] The loop: for i in range(3) generates values of i equal to 0, 1, 2, and 3. [Y, N] If tab is defined as tab = np.zeros((3,10),dtype=int), then savetxt("some_io.dat",tab.T) creates a file consisting of three lines of 10 zeros in each line, separated by a space. [Y, N] If tab is defined as tab = 2 + np.zeros((3,10),dtype=int), then savetxt("some_io.dat",tab.T) creates a file consisting of 10 lines of 3 numbers "2" 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] Monte Carlo is a fictitious Mediterranean town from Bond 007 movies. [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 -3. [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] Monte Carlo methods converge to precise results as N**(-1/2) only, that is very slowly compared with most alternative numerical methods. [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) is by default a space in np.savetxt() and np.loadtxt() functions of Numpy. It can be changed to a comma or other symbol, however. [Y, N] If ran = np.random.rand(1256) and decay = ran < 0.145, then decay 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] 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] The for loop: x = np.linspace(1,8,60); for i in x: print(i,x) will stop and print an error message, because x contains floats, not int's. [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] The logical value of expression (0.4/x/x*2.5 == 1/(x*x)) is True, for any int or float x. [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] Instruction print((-4)**0.5) will print two values, 0+2j and 0-2j. [Y, N] Instruction print((-1)**0.5) will print a value very close to 0+1j, it could look for instance like 6.12323399e-17+1j or similar. [Y, N] The smallest positive floating point number distinct from zero is called machine epsilon, and in Python is equal to about 2.2e-16 [Y, N] Python uses 8 bytes to represent floating point numbers [Y, N] Python uses 64 bits to represent floating point numbers [Y, N] Python evaluates expression (4e-3 == -3+4e) as True [Y, N]