Question
Describe an algorithm (other than thresholding) which will convert a greyscale image (64 bits per pixel) to a bi-level black and white image (2 bit
Describe an algorithm (other than thresholding) which will convert a greyscale image (64 bits per pixel) to a bi-level black and white image (2 bit per pixel), with the same number of pixels, while retaining as much detail as possible. [11 marks] (i) Explain what specular and diffuse reflection are in the real world. State and explain equations for calculating approximations to both in a computer. (a) (I) Define the thought of least pre-fixed point fix(f) of a consistent endofunction f on an area and express Tarski's proper point hypothesis for it. [ (ii) State Scott's proper point acceptance guideline. [
) program to compute the value of a given position in Pascal's Triangle (See image). (c) Comment on the scope of concurrency control in relation to the discussion in (a). [5 marks] [Hint: you may assume that operations on bank account objects, such as debit, credit and add-interest are atomic.] (a) Design a full adder to find Z = X +Y in the case where n = 2. If each gate has
a delay , how quickly is the result of the addition available after the inputs
are presented? [5 marks]
(b) Estimate a rough upper bound on the number of gates required to build a full
adder in combinational logic when n = 4. [3 marks]
(c) Describe two techniques for building adders which reduce gate count.
[7 marks]
(d) Design a full multiplier to find W = X Y for the case where n = 2.
(a) Solve the following inhomogeneous difference equation:
un = 2(un1 + 3) given that u1 = 0
It may be assumed that n > 1. [5 marks]
A hardware device generates streams of ternary digits. Within a stream, each digit
is equiprobably 0, 1 or 2. A stream ends as soon as each digit has been seen at least
once. A stream may be as short as three digits (for example 201) but is usually
rather longer (for example 1110102).
(b) Clearly there are three ways in which the first k digits of a stream may all be
the same. What is the probability that the first k digits are all the same?
[1 mark]
(c) By using the difference equation above, or otherwise, determine the number of
ways in which the first k digits of a stream could comprise exactly two of the
three available digits. [5 marks]
(d) What is the probability that the first k digits comprise exactly two of the three
available digits? [1 mark]
(e) For r > 2, what is the probability that a stream is r digits long? [3 marks]
(f ) What is the expected length of a stream? [5 marks]
Hint: It may be useful to note that
X
r=1
rxr1 =
1
(1 x)
2
if 0 6 x < 1
4
CST.2001.2.5
5 Probability
Candidates for a certain first-year University Examination offer four subjects. At
their first meeting the Examiners agree that, within each subject, they will sort the
candidates into descending order of marks and those ranked in the top third will
be awarded informal Firsts for that subject.
You are asked to write Prolog program to work with binary trees. Your code should not rely on any library predicates and you should assume that the interpreter is running without occurs checking. (a) Describe a data representation scheme for such trees in Prolog and demonstrate it by encoding the tree shown above. [3 marks] (b) Implement a Prolog predicate bfs/2 which effects a breadth-first traversal of a tree passed as the first argument and unifies the resulting list with its second argument.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started