Question
(a) Formalize every one of the accompanying English assertions and decipher each of the following formulae into colloquial English (normal English sentences). (I) x ,
(a) Formalize every one of the accompanying English assertions and decipher each of the
following formulae into colloquial English (normal English sentences).
(I) ∀x , y, a.T(x , y, a) ⇒ T(y, x , a)
(ii) Nobody converses with themselves about anything.
(iii) There's all things considered one society including battling.
(iv) All social orders have no less than two individuals.
(v) ∀a.(∃x , y.(M (x , a) ∧ M (y, a) ∧ x 6= y)) ⇒
∃x , y, b.M (x , a) ∧ M (y, a) ∧ x 6= y ∧ T(x , y, b) ∧ F(b)
(vi) ∀x , y, a.T(x , y, a) ⇒ M (x , a)
[12 marks]
(b) Is it conceivable to fulfill (I)- (vi) at the same time? Either give a substantial
meaning of two sets I and S and relations M , F, and T for which (I)- (vi)
are generally evident or demonstrate that you can get a logical inconsistency from (I)- (vi).
[4 marks]
(c) Here are a few endeavors to formalize "Someone discusses everything".
Make sense of what they really mean, examining if each is a
sensible formalization.
(I) ∃x .∀a.∃y.T(x , y, a)
(ii) ∃x .∃y.∀a.T(x , y, a)
(iii) ∀x .∀a.∃y.T(x , y, a)
(iv) ∃y.∀a.∀x .T(x , y, a)
(a) Describe the essential rule of the mergesort calculation. Outline your response
by showing the means engaged with arranging the exhibit { 9, 3, 6, 2, 4, 1, 5 }.
[6 marks]
(b) Insertion sort can be considered as a mergesort where each progression separates an
cluster of size n into two exhibits: one of size 1 (the component to be embedded) and
one of size (n − 1) for exhibit length n. By settling a proper repeat
connection, show that this recursive rendition of addition sort has a period intricacy
of O(n
2
). Accept the time intricacy for consolidating two clusters is O(n).
[5 marks]
(c) A software engineer is entrusted with arranging the two exhibits and connected records. For both
information structures, he expects to utilize the mergesort calculation.
(I) Show that the time intricacy of a connected rundown mergesort is O(n log n).
Show likewise that the space intricacy is O(1), taking more time to illustrate
how this can be accomplished. [6 marks]
(ii) The software engineer just knows how to combine two exhibits in O(n) space and
connected records in O(1) space, so proposes changing the clusters over to connected records
prior to applying the mergesort calculation to save money on space. Remark on
this technique. [3 marks]
5 (TURN OVER)
CST.2010.1.6
6 Algorithms I
The result of two n × n grids, An and B, is a third n × n lattice, Z, where
Zij =
Xn
k=1
AikBkj
(a) A software engineer straightforwardly executes this recipe while composing a capacity to
duplicate two grids. Figure out the asymptotic opportunity intricacy of such an
calculation, taking more time to legitimize your response. [3 marks]
(b) An elective system to figure Z is to separate An and B into four n
2
×
n
2
networks. Processing Z then includes eight n
2
×
n
2 network increases
followed by a progression of network increments. This approach is then applied
recursively.
(I) Identify the algorithmic system being used. [1 mark]
(ii) Show that the run season of this elective system is given by the
repeat connection
tn = Ktdf(n)e + O(g(n))
where tn is an ideal opportunity to figure the result of two n × n grids, K is
a steady you ought to decide, and f(n) and g(n) are capacities that
It would be ideal for you to distinguish. [6 marks]
(iii) Solve the repeat connection to track down an asymptotic intricacy for tn.
[5 marks]
(c) An enhancement of the calculation introduced to a limited extent (b) implies that main seven
lattice duplications are required instead of the eight recently proposed.
Express the new repeat connection and settle it to show that this calculation is
O(n
log2
7
). [5 marks]
6
CST.2010.1.7
Segment D
7 Object-Oriented Programming with Java
(a) Give three contrasts between a point of interaction and a theoretical class in Java.
[3 marks]
(b) A beginner developer composes the accompanying code to have the option to
totally clone an object of type Car.
public class Tire {
private int treadRemaining;
public void SetTread(int t) { treadRemaining=t; }
public int GetTread() { return treadRemaining; }
}
public class Car expands Vehicle carries out Cloneable {
private Tire tyres[] = new Tyre[4];
public Car() {
for (int i=0; i<4; i++) tyres[i] = new Tire();
}
public Object clone() tosses CloneNotSupportedException {
Vehicle c = new Car();
c.tyres = this.tyres;
bring c back;
}
}
4. Assume a cache with 8 one-word blocks. (DIY) Cache configuration: 1. Direct Mapped 2. Cache configuration: Two-way set-associative 3, Cache configuration: Fully associative 1 4.1. Assume a direct-mapped cache with 8-one word blocks. Given the following sequence of block addresses, indicate if each request results in a cache hit or miss: 1, 9, 6, 5, 1, 6. Cache block mapping: Block address 1 maps to cache block Block address 5 maps to cache block, Block address 6 maps to cache block Block address 9 maps to cache block Memory block 1-(Hit or Miss)? Memory block 9- (Hit or Miss)? Memory block 6-(Hit or Miss) ? Memory block 5-(Hit or Miss)? Memory block 1-(Hit or Miss)?. Memory block 6-(Hit or Miss)?_ . 4.2. Assume a two-way set-associative cache with 8-one word blocks. Given the following sequence of block addresses, indicate if each request results in a cache hit or miss: 1, 9, 6, 5, 1, 6. Cache set mapping: Block address 1 maps to cache set Block address 5 maps to cache set_ Block address 6 maps to cache set Block address 9 maps to cache set Memory block 1-(Hit or Miss)?, Memory block 9- (Hit or Miss)? Memory block 6-(Hit or Miss)? Memory block 5-(Hit or Miss)? Memory block 1-(Hit or Miss)? Memory block 6-(Hit or Miss)? . . . 4.3 Assume a fully associative cache with 8-one-word blocks. Given the following sequence of block addresses, indicate if each request results in a cache hit or miss: 1, 9, 6, 5, 1, 6. Memory block 1-(Hit or Miss)? Memory block 9- (Hit or Miss)?. Memory block 6-(Hit or Miss)? Memory block 5- (Hit or Miss)? Memory block 1-(Hit or Miss)? Memory block 6-(Hit or Miss)?
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