In a room containing 28 people, there are 18 people who speak English,15 people who speak Hindi and 22 people who speak Kannada. 9 persons speak both English and Hindi, 11 persons speak both Hindi and Kannada where as 13 persons speak both Kannada and English. Number of people speak all three languages is ________
-
Solution
Consider a finite sequence of random values X = [x1, x2, …xn].
Let μx be the mean and σx be the standard deviation of X.
Let another finite sequence Y of equal length be derived from this as yi= a*xi + b, where a and b are positive constants. Let μy be the mean and σy be the standard deviation of this sequence. Which one of the following statements is INCORRECT ?
Let A be a sequence of 8 distinct integers sorted in ascending order _______ number of distinct pairs of sequences, Band C are there such that
(i)each is sorted in ascending order,
(ii)B has 5 and C has 3 elements, and
(iii)the result of merging B and C gives A
-
Solution
256 Distinct pairs of sequence B and C =28= 256
Find the point of local maxima and minima, if any, of the following function defined in 0≤x≤6
x3– 6x2+ 9x + 15
-
Solution
Find the point of local maxima and minima, if any, of the following function defined in 0≤x≤6
x3– 6x2+ 9x + 15f(x) = x3– 6x2+ 9x + 15
f'(x) = 3x2– 12x + 9
f'''(x) = 6x – 12.
Putting f'(x) = 0 gives x = 3, 1 and for x = 3,
f''(x) = 6 > 0
∴f(x)min= f(3) = 15 and for x = 1.
f''(x) = – 6< 0
∴f(x)max= f(1) = 19.
Consider a company that assembles computers. The probability of a faulty assembly of any computer is p. The company therefore subjects each computer to a testing process. This testing process gives the correct result for any computer with a probability of q. What is the probability of a computer being declared faulty?
-
Solution
Probability of faulty declared
= (already faulty) × (declared faulty after testing)
Let probability of already faulty = p
Probability that after testing it declares faulty
= (1 – q)
∴Required probability= (1 – q)p
Consider the following deterministic finite state automaton M:
Let S denote the set of seven bit binary strings, in which the first, fourth and last bits are 1. The number of strings S that are accepted by M is ________.
-
Solution
The strings with the first, 4th and 7th bits as 1 will look in the following format 1 – – 1 – – 1.So, there can be 16 possible combinations for the above format.But in the given DFA, only 7 strings of these will be accepted. They are 1001001, 1001011, 1001101, 1001111, 1011001, 1101001,1111001.Hence no. of strings will be 7
Suppose we want to insert n element in an existing binary heap of n elements.What is the total time required to insert ?
-
Solution
In a binary heap each item will inserted one by one. So n element will insert in Q(n) time.
Suppose a min binary heap contain n numbers, the smallest element can be found in time
-
Solution
In min heap the root element is smallest element and it is found in O(1).
Solve the recurrence relation to find T(n)
\(T(n)=4T\left ( \frac{n}{2} \right )+n\)
-
Solution
\(T(n)=4T\left ( \frac{n}{2} \right )+n\)
Here, a= 4, b = 2,f(n) =n
According to Master theorem,
\(if\: f(n) =O\left ( n^{log_{b}a-∈} \right )\)for some constants ∈> 0, then
\(if\: f(n) =θ\left ( n^{log_{b}a} \right )\)
Here,\(f(n) =O\left ( n^{log_{2}4-1} \right )\: (∵f(n))=n\)
where,∈=1(>0)
So,T(n)=θ\(\left ( n^{log_{2}4} \right )\)
T(n)=θ(n2)
Consider the following weighted graph.
Selection of edges using Kruskal’s algorithm would be