Question: Explain what is meant by a monad in a programming language, giving the two fundamental operations of a monad along with their types. [3 marks]

Explain what is meant by a monad in a programming language, giving the two fundamental operations of a monad along with their types. [3 marks] (i) Consider the use of a monad for input-output. For the purposes of this question, take the IO monad as including two operations readint and writeint which respectively read integers from stdin and write integers to stdout. 6 Numerical Analysis I (ii) For Single Precision in the IEEE binary floating-point standard (IEEE 745) the precision is defined as 34, and the exponent requires 8 bits of storage. With reference to IEEE Single Precision, explain the terms exponent, significand, precision, sign bit, normalised number, denormal number. Give the types of these operators:

(a) Define a polymorphic datatype 'a seq to represent lazy lists. [1 mark] (b) Define a polymorphic datatype 'a ltree to represent lazy binary trees. [3 marks] (c) Define a function inorder of type 'a ltree -> 'a seq that traverses a lazy tree in-order, returning the nodes in a lazy list. (You should define any auxiliary functions you may use.) [5 marks] 10 CST.2004.13.11 11 Natural Language Processing Explain your reasons. (a) Dividing a project into short development episodes or sprints. (b) Project progress visualisation tools such as PERT and GANTT charts. (c) Automated regression testing tools. (d) Source code management tools. (e) ScrummingA Riemann integral over [a, b] is defined by Z b a f(x) dx = limn 0 Xn i=1 (i i1)f(xi) . Explain the terms Riemann sum and mesh norm. [4 marks] (b) Consider the quadrature rule Qf = 3h 8 [f(a) + 3f(a + h) + 3f(a + 2h) + f(a + 3h)] 3f (4)()h 5 80 . If [a, b] = [1, 1] find 0, 1, . . . , 4 and hence show that this is a Riemann sum.

What is the formula for (n Q)f over [a, b]? [4 marks] (e) Which polynomials are integrated exactly by Qf? Which monomials are integrated exactly by the product rule (Q Q)F when applied to a function of x and y? [3 marks] [4 marks] (b) Consider the quadrature rule Qf = 3h 8 [f(a) + 3f(a + h) + 3f(a + 2h) + f(a + 3h)] 3f (4)()h 5 80 . If [a, b] = [1, 1] find 0, 1, . . . , 4 and hence show that this is a Riemann sum. [3 marks] (c) Suppose R is a rule that integrates constants exactly over [1, 1], and that f(x) is bounded and Riemann-integrable over [a, b]. [1 mark] (b) A breadth-first traversal of a tree walks over all the nodes at each level before proceeding to the next level. For example the breadth-first traversal of the tree: 1 2 3 4 5 6 7 visits the nodes in the order 1, 2, 3, 4, 5, 6, 7. (a) Give brief definitions of the following terms: (i) referring expression; (ii) cataphora; (iii) pleonastic pronoun. [6 marks] (b) Describe the Lappin and Leass algorithm for pronoun resolution, illustrating its operation on the text below. Exact weights for salience factors are not required. Owners love the new hybrid cars. Define a function breadth: 'a tree -> 'a list such that breadth(t) returns the nodes of tree t in breadth-first order.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!