1. Consider the following pseudocode segment :
K:=0
for i1:= 1 to n
for i2:= 1 to i1
:
:
:
for im:= 1 to im–1
K:= K+1
The value of K after the execution of this code shall be
K:=0
for i1:= 1 to n
for i2:= 1 to i1
:
:
:
for im:= 1 to im–1
K:= K+1
The value of K after the execution of this code shall be
(A) C(n + m – 1, m)
(B) C(n – m + 1, m)
(C) C(n + m – 1, n)
(D) C(n – m + 1, n)
For answer its better to put values
Here m denotes number of for loop and n denotes number of iteration. To simplify the problem we take n=3 and m=2 so by implementing the above code in C language, we get the below code
#include<stdio.h>
void main()
{
int i,m,n=3,k=0;
for(i=1;i<=n;i++)
{
for(m=1;m<=i;m++)
{
k=k+1;
}
}
printf("the value for k is %d",k);
}
when the code is executed the value of K=6
For the given answer (A) C(n+m-1,m) = C(3+2-1,2) = C(4,2) => 4C2 => 4!/2!(4!-2!) = 6
(B) C(n – m + 1, m)
(C) C(n + m – 1, n)
(D) C(n – m + 1, n)
For answer its better to put values
Here m denotes number of for loop and n denotes number of iteration. To simplify the problem we take n=3 and m=2 so by implementing the above code in C language, we get the below code
#include<stdio.h>
void main()
{
int i,m,n=3,k=0;
for(i=1;i<=n;i++)
{
for(m=1;m<=i;m++)
{
k=k+1;
}
}
printf("the value for k is %d",k);
}
when the code is executed the value of K=6
For the given answer (A) C(n+m-1,m) = C(3+2-1,2) = C(4,2) => 4C2 => 4!/2!(4!-2!) = 6
2. In Delta Rule for error minimization
(A) weights are adjusted w.r.to change in the output
(B) weights are adjusted w.r.to difference between desired output and actual output
(C) weights are adjusted w.r.to difference between input and output
(D) none of the above
The topic comes in Artificial Neural Networks(ANN). In which it is applied as option B, so i think it is B.
(A) weights are adjusted w.r.to change in the output
(B) weights are adjusted w.r.to difference between desired output and actual output
(C) weights are adjusted w.r.to difference between input and output
(D) none of the above
The topic comes in Artificial Neural Networks(ANN). In which it is applied as option B, so i think it is B.
3. The concept of pipelining is most effective in improving performance if the tasks being performed in different stages :
(A) require different amount of time
(B) require about the same amount of time
(C) require different amount of time with time difference between any two tasks being same
(D)require different amount of time with time difference between any two tasks being different
Pipelining
(A) require different amount of time
(B) require about the same amount of time
(C) require different amount of time with time difference between any two tasks being same
(D)require different amount of time with time difference between any two tasks being different
Pipelining
build very fast processors. It allows the execution of multiple
instruction by overlapping. In an assembly unit every stage has one and
only one activity to do. In the same way in a instruction pipeline at
every clock cycle one particular step of multiple instruction will be
performed. Every instruction has multiple stages. Say at the first clock
cycle first step of instruction1 is performed. At the second clock
cycle the second step of instruction1 and 1st step of instruction2 would
be performed and so on. so if the task requires about same amount of
time then only we can arrange the pipelining better without hazards,
hence option B is right.
4. What is Granularity ?
(A) The size of database
(B) The size of data item
(C) The size of record
(D) The size of file
A data item can be tuple, relation, database anything, so Granularity will lead to size of an data item.
(A) The size of database
(B) The size of data item
(C) The size of record
(D) The size of file
A data item can be tuple, relation, database anything, so Granularity will lead to size of an data item.
5. Suppose that a given application is run on a
64-processor machine and that 70 percent of the application can be
parallelized. Then the expected performance improvement using Amdahl’ s
law is
(A) 4.22
(B) 3.22
(C) 3.32
(D) 3.52
According to Amdahl, if P is the proportion that can be made parallel, then (1-P) is the program which can not made parallel, then the maximum speedup is S = 1/(1-P)+P/N where N refers to the no of processors, and P refers to the proportion that can be parallelized. Here Processor is 64-bit so N=64, and P=74, putting
1/(1 - 0.7) + 0.7/64 = 1/0.3+0.0109375 = 1/0.310975 = 3.215 = 3.22.
(A) 4.22
(B) 3.22
(C) 3.32
(D) 3.52
According to Amdahl, if P is the proportion that can be made parallel, then (1-P) is the program which can not made parallel, then the maximum speedup is S = 1/(1-P)+P/N where N refers to the no of processors, and P refers to the proportion that can be parallelized. Here Processor is 64-bit so N=64, and P=74, putting
1/(1 - 0.7) + 0.7/64 = 1/0.3+0.0109375 = 1/0.310975 = 3.215 = 3.22.
6. If two fuzzy sets A and B are given with membership functions
μA(x) = {0.2, 0.4, 0.8, 0.5, 0.1}
μB(x) = {0.1, 0.3, 0.6, 0.3, 0.2}
Then the value of μ complement(A∩B) will be
(A) {0.9, 0.7, 0.4, 0.8, 0.9}
(B) {0.2, 0.4, 0.8, 0.5, 0.2}
(C) {0.1, 0.3, 0.6, 0.3, 0.1}
(D) {0.7, 0.3, 0.4, 0.2, 0.7}
Fuzzy intersection is (min[μA,μB]) , Here complemet asked so answer will be 1-(min[μA,μB])
μA(x) = {0.2, 0.4, 0.8, 0.5, 0.1}
μB(x) = {0.1, 0.3, 0.6, 0.3, 0.2}
Then the value of μ complement(A∩B) will be
(A) {0.9, 0.7, 0.4, 0.8, 0.9}
(B) {0.2, 0.4, 0.8, 0.5, 0.2}
(C) {0.1, 0.3, 0.6, 0.3, 0.1}
(D) {0.7, 0.3, 0.4, 0.2, 0.7}
Fuzzy intersection is (min[μA,μB]) , Here complemet asked so answer will be 1-(min[μA,μB])
so, for
Ist value = 1-(min(0.2,0.1)) = 0.9
IInd value = 1-(min(0.4,0.3)) = 0.7
IIIrd value = 1-(min(0.8,0.6)) = 0.4
IVth value = 1-(min(0.5,0.3)) = 0.7
Vth value = 1-(min(0.1,0.2)) = 0.9
So ans is {0.9,0.7,0.4,0.7,0.9} so none of the above is correct.
Ist value = 1-(min(0.2,0.1)) = 0.9
IInd value = 1-(min(0.4,0.3)) = 0.7
IIIrd value = 1-(min(0.8,0.6)) = 0.4
IVth value = 1-(min(0.5,0.3)) = 0.7
Vth value = 1-(min(0.1,0.2)) = 0.9
So ans is {0.9,0.7,0.4,0.7,0.9} so none of the above is correct.
No comments:
Post a Comment