Exams › GATE › Technical
Consider the following function
double f(double x) {
if( abs(x*x - 3) < 0.01) return x;
else return f(x/2 + 1.5/x);
}
Give a value q (to 2 decimals) such that f(q) will return q.
- 1.73
- 1.74
- 1.75
- 1.76
Correct answer: 1.73
Solution
The function is designed to find a value of x such that the square of x is approximately equal to 3, which corresponds to the square root of 3. The value 1.73 is the closest approximation to the square root of 3 (approximately 1.732), making it the correct choice.
Related GATE Technical questions
- The dual of a Boolean function F(x1, x2,..., xn, +, ·, ') written as FD is the same expression as that of F with + and · swapped. F is said to be self-dual if F = FD. The number of self-dual functions with Boolean variables is
- Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?
- The three-dimensional state of stress at a point is given by σ = [[10, 0, 0],[0, 40, 0],[0, 0, 0]] MPa. The maximum shear stress at the point is
- A 2 m wide strip footing is founded at a depth of 1.5 m below the ground level in a homogeneous pure clay bed. The clay bed has unit cohesion of 40 kPa. Due to seasonal fluctuations of water table from peak summer to peak monsoon period, the net ultimate bearing capacity of the footing, as per Terzaghi’s theory, will
- Consider the statements P and Q.
P: Soil particles formed by mechanical weathering, and close to their origin are generally subrounded.
Q: A activity of the clay physically signifies its swell potential.
Which one of the following options is CORRECT?
- The number of degrees of freedom for a natural open channel flow with a mobile bed is
⚔️ Practice GATE Technical free + battle 1v1 →