3. Find the weakest precondition for the following sequence of statements and its post-condition: a-2b +...
how do you solve this? em sets: Compute the weakest precondition for the following sequence of assignment statements and their postconditions (3pts]: a = 3 * (2 * b + a); b = 2 * a - 1 {b > 5}
2. (8 points) A sequence of statements is listed below: b = (a+4)/2 c=2* b-5 d = 3*c+ 7 {d>4} calculate the weakest precondition of the sequence.
Compute the weakest precondition for each of the following assignment statements and postconditions: a = 2 * (b - 1) - 1 {a > 0} b = (c + 10) / 3 {b > 6} Prove that the following grammar is ambiguous (show 2 trees): <S> → <A> <A> → <A> + <A> | <id> <id> → a | b | c
Compute the weakest precondition for the following statements A. if (x == y) x=x*3 else x=x+1 {x < 0} B. x = 3 * (y + x); y= 3*x ; {y > 6}
2. (15 marks) Consider the following program: >> Precondition: x and y E Z. Postcondition: Return the sum x + y. add(x, y): 1. if x == 0: 2. return y 3. elif x > 0: 4. return add(x - 1, y) + 1 5. else: 6. return add(x + 1, y) - 1 Prove that this program is correct in terms of its specification.
Given the following data and information: (1) 2B + 3/2 02 (9) ---> B2O3 delta H = -1264 kJ (2) 2B + 03 (g) ---> B203 delta H = -1406 kJ Find the heat required to convert oxygen gas to ozone gas at the same temperature as the above given reactions +142 kJ 0 - 142 kJ O-1264 kJ 0-1406 kJ
4. Show that the sequence defined by a=2 An+1- 3-an satisfies () < an < 2 and is decreasing. Deduce that the sequence is convergent and find its limit.
Next Problem Previous Problem Problem List (1 point) Find the solution to the following Ihcc recurrence: an 49an 2 for n > 2 with the initial condition a -19, a, 35 Preview My Answers Submit Answers
[6] sin 2B given sec B - 3 cos 2B and & sin >0. In what quadrant does 2B terminate? 7 5 [7] Verify the identity: 2 csc A sin A 1 + cos A + 1 + cos A sin A
Exercises 4.2 ove that the sequence (1 + z/n)"; n = 1, 2, 3,..., converges uni- ly in Iz <R < , for every R. What is the limit? 1, afdos se converge? diverge?