Aspire Faculty ID #18922 · Topic: UGC NET Computer Science Nov 2020 (Paper II) · Just now
UGC NET Computer Science Nov 2020 (Paper II)

Consider the following recursive Java function $f$ that takes two long arguments and returns a float value:

public static float f(long m, long n) {
float result = (float)m / (float)n;
if (m < 0 || n < 0) return 0.0f;
else result -= f(m * 2, n * 3);
return result;
}

Which of the following real values best approximates the value of $f(1,3)$?

Solution


$f(1,3)=\frac{1}{3}-f(2,9)$

$=\frac{1}{3}-\frac{2}{9}+\frac{4}{27}-\frac{8}{81}+\cdots$

This is a geometric series with first term $\frac{1}{3}$ and common ratio $-\frac{2}{3}$.

Sum:

$\frac{\frac{1}{3}}{1-(-\frac{2}{3})}=\frac{\frac{1}{3}}{\frac{5}{3}}=\frac{1}{5}=0.2$

Previous 10 Questions — UGC NET Computer Science Nov 2020 (Paper II)

Nearest first
1
Suppose you are compiling on a machine with $1$-byte chars, $2$-byte shorts, $4$-byte ints, and $8$-byte doubles, and w…
Topic: UGC NET Computer Science Nov 2020 (Paper II)
2
In HTML, $&lt;map&gt;$ tag is used for
Topic: UGC NET Computer Science Nov 2020 (Paper II)
3
Consider the following pseudo-code fragment, where $a$ and $b$ are integer variables that have been initialized:Pre-con…
Topic: UGC NET Computer Science Nov 2020 (Paper II)
4
What is the radix of the numbers if the solution to the quadratic equation $x^2-10x+26=0$ is $x=4$ and $x=7$?
Topic: UGC NET Computer Science Nov 2020 (Paper II)
5
A non-pipeline system takes $50\ ns$ to process a task. The same task can be processed in six-segment pipeline with a c…
Topic: UGC NET Computer Science Nov 2020 (Paper II)
6
The following program is stored in memory unit of the basic computer. What is the content of the accumulator after the …
Topic: UGC NET Computer Science Nov 2020 (Paper II)
7
Consider a machine with a byte addressable main memory of $2^{16}$ bytes and block size of $8$ bytes. Assume that a dir…
Topic: UGC NET Computer Science Nov 2020 (Paper II)
8
Consider the following linear programming $(LP)$:Maximize $z=2x_1+3x_2$Such that$2x_1+x_2\le 4$$x_1+2x_2\le 5$$x_1,x_2\…
Topic: UGC NET Computer Science Nov 2020 (Paper II)
9
Which of the following pairs of propositions are not logically equivalent?
Topic: UGC NET Computer Science Nov 2020 (Paper II)
10
How many ways are there to pack six copies of the same book into four identical boxes, where a box contains six books?
Topic: UGC NET Computer Science Nov 2020 (Paper II)

Next 10 Questions — UGC NET Computer Science Nov 2020 (Paper II)

Ascending by ID
1
The data node and name node in HADOOP are
Topic: UGC NET Computer Science Nov 2020 (Paper II)
2
Consider a relational schema$S=(U,V,W,X,Y,Z)$on which the following functional dependencies hold:$\{U\to V,\ VW\to X,\ …
Topic: UGC NET Computer Science Nov 2020 (Paper II)
3
&nbsp;Consider a hypothetical machine with $3$ pages of physical memory, $5$ pages of virtual memory, and$\langle A,B,C…
Topic: UGC NET Computer Science Nov 2020 (Paper II)
4
Consider a disk system having $60$ cylinders. Disk requests are received for cylinders $10,22,20,2,40,6,38$ in that ord…
Topic: UGC NET Computer Science Nov 2020 (Paper II)
5
Suppose you have a Linux file system where the block size is $2K$ bytes, a disk address is $32$ bits, and an i-node con…
Topic: UGC NET Computer Science Nov 2020 (Paper II)
6
Consider a single-level page table system, with the page table stored in the memory. If the hit rate to TLB is $80\%$, …
Topic: UGC NET Computer Science Nov 2020 (Paper II)
7
Which of the following UML diagrams has a static view?
Topic: UGC NET Computer Science Nov 2020 (Paper II)
8
Modifying the software by restructuring is called
Topic: UGC NET Computer Science Nov 2020 (Paper II)
9
A company has a choice of two languages $L_1$ and $L_2$ to develop a software for their client. Number of LOC required …
Topic: UGC NET Computer Science Nov 2020 (Paper II)
10
A Software project was estimated at 864 Function Points. A six person team will be assigned to project consisting of a …
Topic: UGC NET Computer Science Nov 2020 (Paper II)
Ask Your Question or Put Your Review.

loading...