Prove that the grade-school multiplication algorithm (page 23), when applied to binary numbers, always gives the right
Question:
Prove that the grade-school multiplication algorithm (page 23), when applied to binary numbers,
always gives the right answer.
1.7. How long does the recursive multiplication algorithm (page 24) take to multiply an n-bit number
by an m-bit number? Justify your answer.
1.8. Justify the correctness of the recursive division algorithm given in page 25, and show that it
takes time O(n2) on n-bit inputs.
1.9. Starting from the definition of x ≡ y mod N (namely, that N divides x−y), justify the substitution
rule
x ≡ x′ mod N, y ≡ y′ mod N ⇒ x + y ≡ x′ + y′ mod N,
and also the corresponding rule for multiplication.
1.10. Show that if a ≡ b (mod N ) and if M divides N then a ≡ b (mod M ).
1.11. Is 41536 − 94824 divisible by 35?
1.12. What is 222006
(mod 3)?
1.13. Is the difference of 530,000 and 6123,456 a multiple of 31? 1.14. Suppose you want to compute the nth Fibonacci number Fn, modulo an integer p. Can you find an efficient way to do this? (Hint: Recall Exercise 0.4.)
The telephone network of today and the Resource Reservation Protocol (RSVP) and associated services proposed for the future Internet provide open loop control. Briefly explain the functions of signalling, admission control and policing in these types of networks. [3 marks each] (b) Traffic sources are described as elastic or inelastic. Outline how an inelastic traffic source can be characterised and how this relates to the type of network resource guarantees it may need. [5 marks] 2 CST.2006.7.3 3 Security (a) What is meant by Mandatory Access Control? Give an example. [5 marks] (b) How might you use mandatory access control to protect the safety-critical systems in a car (engine control unit, ABS, stability control, etc.) from userprogrammable systems (telephone, entertainment, navigation, etc.)? [5 marks] (c) What problems would you anticipate in keeping the implementation clean as these systems evolve? [5 marks] (d) What architecture might you therefore propose a car maker adopt for its nextgeneration networking? [5 marks] 4 Advanced Graphics (a) Describe, in outline, each of the implicit surface, NURBS surface, and constructive solid geometry methods for defining three-dimensional shapes. [4 marks each] (b) Compare and contrast the three methods. [8 marks] 3 (TURN OVER) CST.2006.7.4 5 Computer Systems Modelling (a) Describe the congruential methods for generating pseudo-random numbers from a Uniform (0, 1) distribution. [3 marks] (b) Let U be a Uniform (0, 1) random variable. Show that for any continuous distribution function, F(x), the random variable, X, defined by X = F ?1 (U) has the probability distribution function F(x). [3 marks] (c) Apply the method of part (b) to generate random variables with the following distributions. In each case, specify the distribution function F(x) that you use. (i) Uniform distribution on the interval (a, b), for a < b. [2 marks] (ii) Exponential distribution with parameter ?. [2 marks] (d) Define the Poisson process, N(t), (t ? 0) of rate ?. [2 marks] (e) Show that for each fixed t ? 0, N(t) is a Poisson random variable with parameter ?t. [3 marks] (f ) Show that the interarrival times of consecutive events in a Poisson process of rate ? are independent random variables each with the exponential distribution with parameter ?. Show how this leads to a method to simulate the events of a Poisson process. [5 marks] 4 CST.2006.7.5 6 Specification and Verification I (a) What is total about total correctness? [2 marks] (b) State the WHILE-Rule of Floyd-Hoare Logic. [2 marks] (c) Give a proof of {T} WHILE T DO SKIP {F}. [2 marks] (d) What does the truth of {T} WHILE T DO SKIP {F} show? [2 marks] (e) How are expressions like 1/0 handled in Floyd-Hoare Logic? [2 marks] (f ) What are verification conditions? [2 marks] (g) Must the verification conditions be true for correctness? Briefly justify your answer. [2 marks] (h) Name one method used to prove verification conditions. [2 marks] (i) What are the "hooked" variables in VDM used for? [2 marks] (j) What are weakest preconditions and weakest liberal preconditions? [2 marks] 7 Specification and Verification II (a) What are Binary Decision Diagrams and how are they used to represent statetransition functions symbolically? [4 marks] (b) What is temporal abstraction? How are models at different temporal abstraction levels related? [4 marks] (c) What is the difference between LTL and CTL? [4 marks] (d) How do the Verilog and VHDL simulation cycles differ? [4 marks] (e) What is the difference between formal verification using model checking and using theorem proving? [4 marks] 5 (TURN OVER) CST.2006.7.6 8 Information Theory and Coding (a) Give three different expressions for mutual information I(X; Y ) between two discrete random variables X and Y , in terms of their two conditional entropies H(X|Y ) and H(Y |X), their marginal entropies H(X) and H(Y ), and their joint entropy H(X, Y ). Explain in ordinary language the concept signified by each of the measures H(X|Y ), H(X), H(X, Y ), and I(X; Y ). Depict in a Venn diagram the relationships among all of the quantities mentioned here. [8 marks] (b) Suppose that women who live beyond the age of 70 outnumber men in the same age bracket by three to one. How much information, in bits, is gained by learning that a certain person who lives beyond 70 happens to be male? [2 marks] (c) What is the shortest possible code length, in bits per average symbol, that could be achieved for a six-letter alphabet whose symbols have the following probability distribution? 1 2 , 1 4 , 1 8 , 1 16 , 1 32 , 1 32 [3 marks] (d) If we wish to increase the transmission capacity of a noisy communication channel, is it more effective to increase its electronic bandwidth in Hertz, or to improve its signal-to-noise ratio? Briefly say why. [2 marks] (e) A continuous signal whose total bandwidth is 1 kHz and whose duration is 10 seconds may be perfectly represented (even at points in between the points at which it is sampled) by what minimal number of real numbers? [2 marks] (f ) Give the names of three functions (not necessarily their equations) which are self-Fourier. [3 marks]
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates