GATE 2025 (Session 2)
65 questions
MCQ 32 · MSQ 18 · NAT 151-mark 30 · 2-mark 35
Questions 61–65 of 65
An application executes number of instructions in 6.3 seconds. There are four types of instructions, the details of which are given in the table. The duration of a clock cycle in nanoseconds is _________. (rounded off to one decimal place)
Answer: 3
Find the total number of clock cycles :
cycles.
The duration of one clock cycle ns.
Answer: 3
cycles.
The duration of one clock cycle ns.
Answer: 3
Consider the following C program:
#include <stdio.h>
int main(){
int a;
int arr[5] = {30,50,10};
int *ptr;
ptr = &arr[0] + 1;
a = *ptr;
(*ptr)++;
ptr++;
printf("%d", a + (*ptr) + arr[1]);
return 0;
}
The output of the above program is ___________. (Answer in integer)Answer: 111
(remaining elements zero-initialized, since at least one initializer was given).
→ points to .
→ .
→ increments from to .
→ now points to (unaffected).
computes (using 's updated value , since the increment already happened).
Answer: 111
→ points to .
→ .
→ increments from to .
→ now points to (unaffected).
computes (using 's updated value , since the increment already happened).
Answer: 111
Consider the following C program:
#include <stdio.h>
int g(int n) {
return (n+10);
}
int f(int n) {
return g(n*2);
}
int main() {
int sum, n;
sum=0;
for (n=1; n<3; n++)
sum += g(f(n));
printf ("%d", sum);
return 0;
}
The output of the given C program is ________. (Answer in integer)Answer: 46
Functions: and .
Loop runs from up to :
First pass : ; ;
Second pass : ; ;
Answer: 46
Loop runs from up to :
First pass : ; ;
Second pass : ; ;
Answer: 46
A quadratic polynomial over complex numbers is said to be square invariant if . Suppose from the set of all square invariant quadratic polynomials we choose one at random.
The probability that the roots of the chosen polynomial are equal is ______. (rounded off to one decimal place)
The probability that the roots of the chosen polynomial are equal is ______. (rounded off to one decimal place)
Answer: 0.5
The condition must hold for all . So the root sets and must be the same (as unordered pairs). There are two cases.
Case 1 (squaring leaves each root unchanged): . So each of must be in , since these are the only solutions of . The root-pairs are . This gives different polynomials. Of these, have a repeated root: and .
Case 2 (squaring swaps the two roots): . This gives . The solutions were already counted. The only new pair is the primitive cube roots of unity , which are distinct, not repeated.
So the total number of different square-invariant polynomials is : . Exactly of them, and , have equal (repeated) roots.
Probability
Answer: 0.5
Case 1 (squaring leaves each root unchanged): . So each of must be in , since these are the only solutions of . The root-pairs are . This gives different polynomials. Of these, have a repeated root: and .
Case 2 (squaring swaps the two roots): . This gives . The solutions were already counted. The only new pair is the primitive cube roots of unity , which are distinct, not repeated.
So the total number of different square-invariant polynomials is : . Exactly of them, and , have equal (repeated) roots.
Probability
Answer: 0.5
The unit interval is divided at a point chosen uniformly distributed over in into two disjoint subintervals.
The expected length of the subinterval that contains 0.4 is ___________. (rounded off to two decimal places)
The expected length of the subinterval that contains 0.4 is ___________. (rounded off to two decimal places)
Answer: 0.7 to 0.8
Take the split point as . Case 1: when , the piece that has in it is , and its length is . Case 2: when , the piece that has in it is , and its length is .
Expected length:
Evaluate:
Answer: 0.74
Expected length:
Evaluate:
Answer: 0.74