Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations

UGC NET Computer Science Previous Year Questions (PYQs)

UGC NET Computer Science Discrete Mathematics PYQ


UGC NET Computer Science PYQ

For the given two machines which of the following is correct?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

From the diagrams:


• Both machines are deterministic (each state has exactly one transition for each input symbol).

• The first machine has states A and B with transitions on a and b.

• The second machine has states A, B, C, but the accepted language behavior matches the first machine.


Both machines accept the same language, even though the number of states differs.


Thus they are equivalent machines.


UGC NET Computer Science PYQ
If $f(x)=$ $x$ is my friend, and $p(x)=$ $x$ is perfect, then the correct logical translation of the statement “some of my friends are not perfect” is:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

“Some” means there exists at least one person.

“my friends” means $f(x)$.

“not perfect” means $\neg p(x)$.

So, the statement becomes:

$\exists x(f(x)\land \neg p(x))$

UGC NET Computer Science PYQ
What kind of clauses are available in conjunctive normal form?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

In CNF, formula is written as conjunction of clauses.

Each clause is a disjunction of literals.

Example:

$(p\vee \neg q)\wedge(r\vee s)$

Here, $(p\vee \neg q)$ and $(r\vee s)$ are clauses.

So, clauses in CNF are disjunction of literals.

UGC NET Computer Science PYQ
Consider the following properties:

A. Reflexive
B. Antisymmetric
C. Symmetric

Let $A=\{a,b,c,d,e,f,g\}$ and

$R=\{(a,a),(b,b),(c,d),(c,g),(d,g),(e,e),(f,f),(g,g)\}$

be a relation on $A$. Which of the following property/properties is/are satisfied by the relation $R$?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

For reflexive relation, every element must have pair $(x,x)$.

But $(c,c)$ and $(d,d)$ are missing.

So, relation is not reflexive.

For antisymmetric relation, if $(x,y)$ and $(y,x)$ both exist, then $x=y$.

Here, no reverse pair exists for $(c,d),(c,g),(d,g)$.

So, relation is antisymmetric.

For symmetric relation, if $(x,y)$ exists, then $(y,x)$ must also exist.

But $(c,d)$ exists and $(d,c)$ does not exist.

So, relation is not symmetric.

Therefore, relation satisfies B and not A.

UGC NET Computer Science PYQ
Arrange the following simple graphs based on number of spanning trees they have:
A. $K_3$ (Complete graph with 3 nodes)
B. $K_4$ (Complete graph with 4 nodes)
C. $K_{2,2}$ (Complete bipartite graph with 2 nodes in each partition)
D. $C_5$ (Cycle graph with 5 nodes)





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Number of spanning trees:


For complete graph:

$\tau(K_n)=n^{n-2}$


A: $K_3 = 3^{1} = 3$


B: $K_4 = 4^{2} = 16$


For complete bipartite graph:

$\tau(K_{m,n}) = m^{n-1} n^{m-1}$


C: $K_{2,2} = 2^{1} \times 2^{1} = 4$


For cycle graph:

$\tau(C_n)=n$


D: $C_5 = 5$


Thus:


A = 3

C = 4

D = 5

B = 16


Increasing order:


A, C, D, B


UGC NET Computer Science PYQ
Consider the following argument with premise $\forall x(P(x)\vee Q(x))$ and conclusion $(\forall xP(x))\wedge(\forall xQ(x))$
(A) $\forall x(P(x)\vee Q(x))$Premise
(B) $P(c)\vee Q(c)$Universal instantiation from (A)
(C) $P(c)$Simplification from (B)
(D) $\forall xP(x)$Universal generalization of (C)
(E) $Q(c)$Simplification from (B)
(F) $\forall xQ(x)$Universal generalization of (E)
(G) $(\forall xP(x))\wedge(\forall xQ(x))$Conjunction of (D) and (F)





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

From $\forall x(P(x)\vee Q(x))$, we can get:

$P(c)\vee Q(c)$

So, step (B) is correct.

But from $P(c)\vee Q(c)$, we cannot conclude $P(c)$ alone.

Also, we cannot conclude $Q(c)$ alone.

So, steps (C) and (E) are not correct inferences.

Step (G) would be correct only if (D) and (F) were validly obtained.

Hence, the main error is in steps (C) and (E).

UGC NET Computer Science PYQ

Four persons: P, Q, R and S are in police custody and one of them has committed a crime. They confess as follows:

A. Person P: Q did it.
B. Person Q: S did it.
C. Person R: I did not do it.
D. Person S: Q lied.

If exactly one of the statements is false, which of the following is the guilty person.






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

Check each case one by one.

Case 1: Suppose P is guilty.

P says: Q did it → False
Q says: S did it → False
R says: I did not do it → True
S says: Q lied → True

Here, two statements are false. So, P is not guilty.

Case 2: Suppose Q is guilty.

P says: Q did it → True
Q says: S did it → False
R says: I did not do it → True
S says: Q lied → True

Here, exactly one statement is false.

So, Q can be guilty.

Case 3: Suppose R is guilty.

P says: Q did it → False
Q says: S did it → False
R says: I did not do it → False
S says: Q lied → True

Here, three statements are false. So, R is not guilty.

Case 4: Suppose S is guilty.

P says: Q did it → False
Q says: S did it → True
R says: I did not do it → True
S says: Q lied → False

Here, two statements are false. So, S is not guilty.

Therefore, the guilty person is Q.


UGC NET Computer Science PYQ
If A = {4n + 2 | n is a natural number} and B = {3n | n is a natural number}. Which of the following is correct for A ∩ B?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

A contains numbers of the form:


$4n + 2$


So, numbers in A are:


$6, 10, 14, 18, 22, 26, 30, ...$


B contains multiples of 3:


$3, 6, 9, 12, 15, 18, 21, 24, 27, 30, ...$


Common elements are:


$6, 18, 30, 42, ...$


These can be written as:


$12n - 6$


UGC NET Computer Science PYQ

Statement 1:
Given a graph $G=(V,E)$ in which each vertex $v \in V$ has an associated positive weight $w(v)$, we can use linear programming to find the lower bound on the weight of the minimum-weight vertex cover.

Statement 2:
The lower bound can be found by maximizing the following

$ \sum_{v \in V} w(v)x(v) $

subject to

$ x(u)+x(v) \ge 1 $ for each $(u,v) \in E$

$ x(v) \le 1 $ for each $v \in V$

$ x(v) \ge 0 $ for each $v \in V$

In the light of the above statements, choose the most appropriate answer from the options given below:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

For minimum-weight vertex cover, we can write an integer linear programming formulation.

Its LP relaxation can be used to find a lower bound.

So, Statement 1 is correct.

But for minimum-weight vertex cover, the objective should be minimized, not maximized.

Correct objective should be:

$ \text{Minimize } \sum_{v \in V} w(v)x(v) $

Statement 2 says maximizing the objective, so Statement 2 is incorrect.


UGC NET Computer Science PYQ
Which of the following are tautology?

A. $(p \lor r) \rightarrow p$
B. $p \rightarrow (p \land r)$
C. $\sim p \rightarrow (p \rightarrow r)$
D. $(p \land r) \rightarrow (p \rightarrow r)$
E. $\sim(p \rightarrow r) \rightarrow p$





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

A: False when $r=1, p=0$ → Not tautology

B: False when $p=1, r=0$ → Not tautology


C:

$\sim p \rightarrow (p \rightarrow r)$

Always true → Tautology


D:

$(p \land r) \rightarrow (p \rightarrow r)$

Always true → Tautology


E:

$\sim(p \rightarrow r) \rightarrow p$

Always true → Tautology


Thus tautologies:


C, D, E


UGC NET Computer Science PYQ
Match List-I with List-II:
 List-I
 List-II
A. Back Tracking  I. Automata
 B. Infinite languages with matching numbers
 II. Undecidable Problem
 C. Canonical LR Parser
 III. Predictive Parser
 D. Post Correspondence Problem

 IV. Large number of states






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Backtracking → Predictive parsing may require backtracking → III

Infinite languages with matching numbers → handled using Automata → I

Canonical LR parser → requires large number of states → IV

Post Correspondence Problem → Undecidable problem → II


Matching:


A → III

B → I

C → IV

D → II


UGC NET Computer Science PYQ
Consider the following statements:

(A) Any tree is 2-colorable

(B) A graph G has no cycles of even length if it is bipartite.

(C) A graph G is 2-colorable if it is bipartite.

(D) A graph G can be colored with d+1 colors if d is the maximum degree of any vertex in the graph G.

(E) A graph G can be colored with O(log|V|) colors if it has O(|V|) edges.

Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

(A) True, because every tree is bipartite, so it is 2-colorable.

(B) False, because a bipartite graph has no odd cycle, but it can have even cycles.

(C) True, because every bipartite graph is 2-colorable.

(D) True, by greedy coloring, any graph with maximum degree $d$ can be colored using at most $d+1$ colors.

(E) False, because having $O(|V|)$ edges does not guarantee coloring with only $O(\log |V|)$ colors.

So, incorrect statements are (B) and (E).

UGC NET Computer Science PYQ

Consider the poset $\left({3,5,9,15,24,45}, \mid\right)$.

Which of the following is correct for the given poset?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

In divisibility poset, least element means an element which divides every element.

Here, $3$ does not divide $5$, so $3$ is not the least element.

Similarly, no other element divides all elements of the set.

So, least element does not exist.

Greatest element means an element which is divisible by every element.

Here, $45$ is not divisible by $24$.

Also, no other element is divisible by all elements of the set.

So, greatest element does not exist.

Therefore, there does not exist a greatest element and a least element.


UGC NET Computer Science PYQ

How many ways are there to place $8$ indistinguishable balls into four distinguishable bins?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Let the number of balls in four distinguishable bins be $x_1,x_2,x_3,x_4$.

Then,

$x_1+x_2+x_3+x_4=8$

Here, balls are indistinguishable and bins are distinguishable.

So, the number of non-negative integral solutions is

${}^{n+r-1}C_{r-1}$

Here, $n=8$ and $r=4$.

So,

${}^{8+4-1}C_{4-1}={}^{11}C_{3}$

$=\dfrac{11 \times 10 \times 9}{3 \times 2 \times 1}$

$=165$


UGC NET Computer Science PYQ
A bit string of length four is generated at random. What is probability that it contains at least two consecutive 0’s given that first bit is 0 ?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

First bit is fixed as 0, so remaining 3 bits are free.


Possible strings:


0000

0001

0010

0011

0100

0101

0110

0111


Total outcomes $=8$


Strings with at least two consecutive 0's:


0000

0001

0010

0011

0100


Favourable outcomes $=5$


Probability


$=\frac{5}{8}$


UGC NET Computer Science PYQ

How many bit strings of length ten either start with a $1$ bit or end with two bits $00$?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Total length of bit string is $10$.

Let $A$ be the set of bit strings starting with $1$.

So, first bit is fixed and remaining $9$ bits are free.

$n(A)=2^9=512$

Let $B$ be the set of bit strings ending with $00$.

So, last two bits are fixed and remaining $8$ bits are free.

$n(B)=2^8=256$

Now, strings which start with $1$ and end with $00$:

First bit is fixed as $1$ and last two bits are fixed as $00$.

Remaining $7$ bits are free.

$n(A \cap B)=2^7=128$

Therefore,

$n(A \cup B)=n(A)+n(B)-n(A \cap B)$

$=512+256-128$

$=640$


UGC NET Computer Science PYQ
Suppose that a connected planar graph has six vertices, each of degree four. Into how many regions is the plane divided by a planar representation of this graph?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Given,

$V=6$

Each vertex has degree $4$.

So, sum of degrees is

$6 \times 4=24$

By handshaking theorem,

$2E=24$

$E=12$

For a connected planar graph, Euler’s formula is

$V-E+R=2$

Substitute $V=6$ and $E=12$.

$6-12+R=2$

$R=8$


UGC NET Computer Science PYQ
For which values of $m$ and $n$ does the complete bipartite graph $K_{m,n}$ have a Hamilton circuit?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

In a complete bipartite graph $K_{m,n}$, vertices are divided into two parts.

A Hamilton circuit must visit every vertex exactly once and return to the starting vertex.

In a bipartite graph, every cycle alternates between the two parts.

So, for a Hamilton circuit to include all vertices, both parts must have the same number of vertices.

Therefore,

$m=n$

Also, a cycle needs at least $2$ vertices in each part.

So,

$m,n \ge 2$

Hence, $K_{m,n}$ has a Hamilton circuit when

$m=n,\ m,n \ge 2$


UGC NET Computer Science PYQ
There are three boxes. First box has $2$ white, $3$ black and $4$ red balls. Second box has $3$ white, $2$ black and $2$ red balls. Third box has $4$ white, $1$ black and $3$ red balls. A box is chosen at random and $2$ balls are drawn out of which $1$ is white, and $1$ is red. What is the probability that the balls came from first box?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ

Solution

Let the boxes be $B_1, B_2, B_3$ and event $E$ be drawing $1$ white and $1$ red ball.

Since one box is chosen randomly,

$P(B_1)=P(B_2)=P(B_3)=\frac{1}{3}$

For first box,

$P(E|B_1)=\frac{\binom{2}{1}\binom{4}{1}}{\binom{9}{2}}=\frac{8}{36}=\frac{2}{9}$

For second box,

$P(E|B_2)=\frac{\binom{3}{1}\binom{2}{1}}{\binom{7}{2}}=\frac{6}{21}=\frac{2}{7}$

For third box,

$P(E|B_3)=\frac{\binom{4}{1}\binom{3}{1}}{\binom{8}{2}}=\frac{12}{28}=\frac{3}{7}$

Using Bayes theorem,

$P(B_1|E)=\frac{P(B_1)P(E|B_1)}{P(B_1)P(E|B_1)+P(B_2)P(E|B_2)+P(B_3)P(E|B_3)}$

$P(B_1|E)=\frac{\frac{1}{3}\times\frac{2}{9}}{\frac{1}{3}\times\frac{2}{9}+\frac{1}{3}\times\frac{2}{7}+\frac{1}{3}\times\frac{3}{7}}$

$P(B_1|E)=\frac{\frac{2}{9}}{\frac{2}{9}+\frac{2}{7}+\frac{3}{7}}$

$P(B_1|E)=\frac{\frac{2}{9}}{\frac{59}{63}}=\frac{14}{59}=0.237$


UGC NET Computer Science PYQ
Which of the following is principal conjunctive normal form for $[(p \vee q)\wedge[p \to q]]$?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Given statement is

$[(p \vee q)\wedge[p \to q]]$

We know that

$p \to q \equiv \neg p \vee q$

So,

$[(p \vee q)\wedge[p \to q]]=(p \vee q)\wedge(\neg p \vee q)$

Now truth table se false cases:

When $p=0,\ q=0$, expression false hoti hai.
Corresponding maxterm is

$p \vee q$

When $p=1,\ q=0$, expression false hoti hai.
Corresponding maxterm is

$\neg p \vee q$

Therefore, PCNF is

$(p \vee q)\wedge(\neg p \vee q)$

Hence, correct PCNF is $(p \vee q)\wedge(\neg p \vee q)$.


UGC NET Computer Science PYQ
How many cards must be selected from a standard deck of $52$ cards to guarantee that at least three hearts are present among them?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

A standard deck has

$13$ hearts

and

$52-13=39$ non-heart cards.

To guarantee at least $3$ hearts, consider the worst case.

First, we may select all $39$ non-heart cards.

Then, we may select only $2$ hearts.

So, cards selected without guaranteeing $3$ hearts:

$39+2=41$

Now, the next card must be a heart.

So, required number of cards is

$41+1=42$


UGC NET Computer Science PYQ
For the regular languages and context free languages which is not correct?

A. both are closed under union operation
B. both are closed under concatenation operation
C. both are closed under intersection operation
D. both are closed under complementation operation
E. both are closed under kleene star operation





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Regular languages:


Closed under union, concatenation, intersection, complement, kleene star.


Context-free languages:


Closed under union, concatenation, kleene star.

Not closed under intersection and complement.


Thus incorrect statements:


C and D


UGC NET Computer Science PYQ
List-I List-II
(a) $p \to q$ (i) $\neg(q \to \neg p)$
(b) $p \vee q$ (ii) $p \wedge \neg q$
(c) $p \wedge q$ (iii) $\neg p \to q$
(d) $\neg(p \to q)$ (iv) $\neg p \vee q$
Choose the correct option from those given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

First,

$p \to q \equiv \neg p \vee q$

So,

$(a) \rightarrow (iv)$

Now,

$\neg p \to q \equiv p \vee q$

So,

$(b) \rightarrow (iii)$

Now,

$q \to \neg p \equiv \neg q \vee \neg p$

Therefore,

$\neg(q \to \neg p)=\neg(\neg q \vee \neg p)$

Using De Morgan’s law,

$\neg(\neg q \vee \neg p)=q \wedge p$

$=p \wedge q$

So,

$(c) \rightarrow (i)$

Now,

$\neg(p \to q)=\neg(\neg p \vee q)$

Using De Morgan’s law,

$\neg(\neg p \vee q)=p \wedge \neg q$

So,

$(d) \rightarrow (ii)$

Therefore, the correct matching is

$(a)-(iv);\ (b)-(iii);\ (c)-(i);\ (d)-(ii)$


UGC NET Computer Science PYQ
Consider the statement below.

A person who is radical $(R)$ is electable $(E)$ if he or she is conservative $(C)$, but otherwise is not electable.

Few probable logical assertions of the above sentence are given below.

(A) $(R\land E)\Leftrightarrow C$

(B) $R\Rightarrow(E\Leftrightarrow C)$

(C) $R\Rightarrow((C\Rightarrow E)\lor \neg E)$

(D) $(\neg R\lor \neg E\lor C)\land(\neg R\lor \neg C\lor E)$

Which of the above logical assertions are true?

Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

Given statement says that a radical person is electable if he or she is conservative, otherwise not electable.

This means, for a radical person, electability depends exactly on conservativeness.

So, the correct logical form is:

$R\Rightarrow(E\Leftrightarrow C)$

Therefore, statement (B) is true.

Now,

$E\Leftrightarrow C$

can be written as:

$(E\Rightarrow C)\land(C\Rightarrow E)$

So,

$R\Rightarrow[(E\Rightarrow C)\land(C\Rightarrow E)]$

Now convert implications:

$E\Rightarrow C\equiv \neg E\lor C$

$C\Rightarrow E\equiv \neg C\lor E$

Therefore,

$R\Rightarrow[(\neg E\lor C)\land(\neg C\lor E)]$

This is equivalent to:

$(\neg R\lor \neg E\lor C)\land(\neg R\lor \neg C\lor E)$

So, statement (D) is also true.

Statement (A) is not correct because it says that a person is conservative if and only if the person is radical and electable, which is not the meaning of the given sentence.

Statement (C) is not the exact logical assertion of the given sentence.

Therefore, correct statements are (B) and (D).

UGC NET Computer Science PYQ
Find the zero-one matrix of the transitive closure of the relation given by the matrix $A$:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Given matrix is

$A=\left[\begin{array}{ccc}1 & 0 & 1\\0 & 1 & 0\\1 & 1 & 0\end{array}\right]$

From the matrix, the relation contains:

$1 \to 1,\ 1 \to 3,\ 2 \to 2,\ 3 \to 1,\ 3 \to 2$

Now, since $1 \to 3$ and $3 \to 2$, therefore $1 \to 2$ must be added.

Also, since $3 \to 1$ and $1 \to 3$, therefore $3 \to 3$ must be added.

So, the transitive closure matrix is

$\left[\begin{array}{ccc}1 & 1 & 1\\0 & 1 & 0\\1 & 1 & 1\end{array}\right]$

Hence, the correct answer is Option 1.


UGC NET Computer Science PYQ

Consider an LPP given as:

$\text{Max } Z=2x_1-x_2+2x_3$

subject to the constraints:

$2x_1+x_2\le 10$

$x_1+2x_2-2x_3\le 20$

$x_1+2x_3\le 5$

$x_1,x_2,x_3\ge 0$

What shall be the solution of the LPP after applying first iteration of the Simplex Method?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Given objective function is

$\text{Max } Z=2x_1-x_2+2x_3$

In the objective function, the positive coefficient of $x_3$ is $2$.

Taking $x_3$ as the entering variable, we apply the minimum ratio test.

From the constraints:

$2x_1+x_2\le 10$

$x_1+2x_2-2x_3\le 20$

$x_1+2x_3\le 5$

Only the third constraint has positive coefficient of $x_3$.

So,

$2x_3=5$

$x_3=\dfrac{5}{2}$

At the first iteration,

$x_1=0,\ x_2=0,\ x_3=\dfrac{5}{2}$

Now,

$Z=2x_1-x_2+2x_3$

$Z=2(0)-0+2\left(\dfrac{5}{2}\right)$

$Z=5$


UGC NET Computer Science PYQ
Arrange the following sets in increasing order, on the basis of their cardinality :

A. $A_1 = {{1,2},{3}}$
B. $A_2 = {{1},{2},{3},{4}}$
C. $A_3 = {{1,2,3,4,5,6}}$
D. $A_4 = {{1,2},{2,3,4},{5}}$
E. $A_5 = {{1},{2},{3},{4},{5}}$

Choose the correct answer from the options given below :





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Cardinality means number of elements in the set.


$|A_1| = 2$

$|A_2| = 4$

$|A_3| = 1$

$|A_4| = 3$

$|A_5| = 5$


Increasing order:


$1 < 2 < 3 < 4 < 5$


So order becomes:


$A_3, A_1, A_4, A_2, A_5$


UGC NET Computer Science PYQ
Which of the following have truth values if universe of discourse consists of all integers?

A. $\forall n \exists m (n^2 < m)$
B. $\exists m \forall n (n < m^2)$
C. $\exists n \exists m (n^2 + m^2 = 5)$
D. $\exists n \exists m (n^2 + m^2 = 6)$
E. $\exists n \exists m (n+m=4 \land n-m=1)$

Choose the correct answer from the options given below :





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

A:

For every integer $n$, choose $m=n^2+1$

Then $n^2<m$ → True


B:

$\exists m$ such that $n<m^2$ for all integers $n$.

But integers are unbounded → False


C:

$n^2+m^2=5$


Example: $1^2+2^2=5$ → True


D:

$n^2+m^2=6$


No integer solution → False


E:

$n+m=4$

$n-m=1$


Add equations:


$2n=5$ → $n=2.5$ (not integer) → False


True statements: A and C


UGC NET Computer Science PYQ
Match List I with List II.Let $R_1=\{(1,1),(2,2),(3,3)\}$ and$R_2=\{(1,1),(1,2),(1,3),(1,4)\}$
List I List II
(A) $R_1\cup R_2$ I. $\{(1,1),(1,2),(1,3),(1,4),(2,2),(3,3)\}$
(B) $R_1-R_2$ II. $\{(1,1)\}$
(C) $R_1\cap R_2$ III. $\{(1,2),(1,3),(1,4)\}$
(D) $R_2-R_1$ IV. $\{(2,2),(3,3)\}$
Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

Given,

$R_1=\{(1,1),(2,2),(3,3)\}$

$R_2=\{(1,1),(1,2),(1,3),(1,4)\}$

Now,

$R_1\cup R_2$

means all elements of $R_1$ and $R_2$.

So,

$R_1\cup R_2=\{(1,1),(1,2),(1,3),(1,4),(2,2),(3,3)\}$

Therefore, (A) matches with I.

Now,

$R_1-R_2$

means elements that are in $R_1$ but not in $R_2$.

Common element is $(1,1)$.

So,

$R_1-R_2=\{(2,2),(3,3)\}$

Therefore, (B) matches with IV.

Now,

$R_1\cap R_2$

means common elements of $R_1$ and $R_2$.

So,

$R_1\cap R_2=\{(1,1)\}$

Therefore, (C) matches with II.

Now,

$R_2-R_1$

means elements that are in $R_2$ but not in $R_1$.

So,

$R_2-R_1=\{(1,2),(1,3),(1,4)\}$

Therefore, (D) matches with III.

Final matching is:

A-I, B-IV, C-II, D-III

UGC NET Computer Science PYQ
Maximize $z=5x_1+12x_2+4x_3$

Subject to $x_1+2x_2+x_3=10$

$2x_1-x_2+3x_3=8$

$x_1,x_2,x_3\ge 0$

its dual problem is

Minimize $w=10y_1+8y_2$

Subject to $y_1+2y_2\ge 5$

$2y_1-y_2\ge 12$

$y_1+3y_2\ge 4$

Which of the following is correct?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ

Solution

In primal maximization problem,

If the constraint is equality type, then the corresponding dual variable is unrestricted.

Here, first constraint is equality type, so

$y_1$ is unrestricted.

The expected condition for second dual variable is

$y_2\ge 0$

UGC NET Computer Science PYQ
There are M points on one straight line AB and n points on another straight line AC none of them being A. How many triangles can be formed with these points as vertices?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

To form a triangle, we can choose:


2 points from line AB and 1 point from line AC


or


2 points from line AC and 1 point from line AB


Number of triangles:


$ {m \choose 2}n + {n \choose 2}m $


$ = \frac{m(m-1)}{2}n + \frac{n(n-1)}{2}m $


$ = \frac{mn}{2}[(m-1)+(n-1)] $


$ = \frac{1}{2}mn(m+n-2) $


UGC NET Computer Science PYQ
How much time does an algorithm using $2^{50}$ bit operations need if each bit operation takes $2^{-38}$ second?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

$2^{50} \times 2^{-38} = 2^{12}$ seconds

$2^{12} = 4096$ seconds

Convert to minutes:

$4096/60 \approx 68.27$ minutes

$\approx 1.14$ hours


UGC NET Computer Science PYQ
Consider the following statements:

A. If some NP-complete problem P is in P that P = NP

B. TSP is in NP

C. SAT is in NP

D. Hamilton circuit problem is not NP-complete

Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

A is true because if any NP-complete problem is solved in polynomial time, then $P = NP$.

B is true because TSP decision problem is in NP.

C is true because SAT is in NP.

D is false because Hamilton circuit problem is NP-complete.

UGC NET Computer Science PYQ
The chairs of an auditorium are to be labelled with a letter followed by a positive two digits integer where labelling is starting with A01. How many maximum possible chairs could be labelled in this way?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Letters: 26 (A to Z)


Two digit positive integers:

01 to 99 → 99 numbers


Total combinations:


$26 \times 99 = 2574$


UGC NET Computer Science PYQ
In lexicographic ordering, comparison is done from left to right.

Given order is:

$0<1$

Now compare the given strings:

$0001$ comes before $001$ because at the third position, $0<1$.

So,

$0001<001$

Now,

$001<010$ because at the second position, $0<1$.

Also,

$010<0101$ because $010$ is a prefix of $0101$.

Now compare $0101$ and $011$:

First digit is same.

Second digit is same.

Third digit gives:

$0<1$

So,

$0101<011$

Therefore, the correct lexicographic order is:

$0001<001<010<0101<011$





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

Greedy Best-First Search selects the node that appears closest to the goal according to heuristic value.

It may get trapped and can be incomplete even if the search space is finite.

So, (A) matches with II.

$A^*$ search is optimal and complete under proper conditions, but its computation and space complexity are very high because it stores many generated nodes.

So, (B) matches with IV.

Recursive Best-First Search uses limited memory and its space complexity is linear in depth.

So, (C) matches with I.

$SMA^*$ means Simplified Memory-Bounded $A^*$.

It is optimal if the optimal solution is reachable within available memory; otherwise, it returns the best reachable solution.

So, (D) matches with III.

Final matching is:

A-II, B-IV, C-I, D-III

UGC NET Computer Science PYQ
Arrange the steps of Mathematical Modeling:

A. Solution fitting with data
B. Formulation mathematically
C. Solve mathematically
D. Repeat formulation if it fits worst with data
E. Interpretation results





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Typical modeling steps:


Formulate model mathematically → B


Solve mathematically → C


Fit solution with data → A


If poor fit, reformulate → D


Interpret results → E


Correct sequence:


B → C → A → D → E


UGC NET Computer Science PYQ
Arrange in appropriate order, the construction of a finite automata:

A. Minimum State DFA
B. Regular Expression
C. NFA-ε
D. Problem Statement
E. DFA





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Typical construction steps:


Problem statement → D


Convert to regular expression → B


Convert to NFA-ε → C


Convert to DFA → E


Minimize DFA → A


Order:


D → B → C → E → A


UGC NET Computer Science PYQ
Given below are two statements:

Statement I: $5$ divides $n^5-n$ whenever $n$ is a nonnegative integer.

Statement II: $6$ divides $n^3-n$ whenever $n$ is a nonnegative integer.

In the light of the above statements, choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

Statement I:

We need to check whether $5$ divides $n^5-n$.

By Fermat's theorem,

$n^5\equiv n\pmod 5$

So,

$n^5-n\equiv 0\pmod 5$

Therefore, $5$ divides $n^5-n$.

So, Statement I is correct.

Statement II:

$n^3-n=n(n-1)(n+1)$

This is the product of three consecutive integers.

In any three consecutive integers, one number is divisible by $3$ and at least one number is divisible by $2$.

So, the product is divisible by $6$.

Therefore, $6$ divides $n^3-n$.

So, Statement II is also correct.

UGC NET Computer Science PYQ
How many integral solutions are there to $x+y+z+w=29$, where $x \ge 1$, $y \ge 2$, $z \ge 3$ and $w \ge 0$?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

Let

$x'=x-1,\ y'=y-2,\ z'=z-3,\ w'=w$

Then,

$x'+y'+z'+w'=29-1-2-3=23$

Number of non-negative integral solutions:

${23+4-1 \choose 4-1}={26 \choose 3}$

$= \frac{26 \times 25 \times 24}{3 \times 2 \times 1}$

$=2600$

UGC NET Computer Science PYQ
Let $(Z,+)$ denote the group of all integers under addition. Then the number of all automorphisms of $(Z,+)$ is





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

An automorphism of $(Z,+)$ is completely determined by the image of $1$.

The image of $1$ must be a generator of $Z$.

The generators of $Z$ are:

$1$ and $-1$

So, there are only two automorphisms:

$f(n)=n$

$f(n)=-n$

UGC NET Computer Science PYQ
$Z$ is set of integers. $(Z,)$ forms group if * is:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

$a*b=a+b+2$


Associativity


$(a*b)*c=(a+b+2)+c+2=a+b+c+4$


$a*(b*c)=a+(b+c+2)+2=a+b+c+4$


Identity element:


$a*e=a$


$a+e+2=a$


$e=-2$


Inverse:


$a*b=-2$


$a+b+2=-2$


$b=-a-4$


UGC NET Computer Science PYQ
Which of the following sequence ${a_n}$ are solution of recurrence relation

$a_n=8a_{n-1}-16a_{n-2}$

A. $a_n=1$
B. $a_n=2^n$
C. $a_n=4^n$
D. $a_n=n4^n$
E. $a_n=(-4)^n$





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Characteristic equation


$r^2-8r+16=0$


$(r-4)^2=0$


$r=4$


General solution


$a_n=(c_1+c_2n)4^n$


Thus valid sequences:


$4^n$


$n4^n$


UGC NET Computer Science PYQ
Consider universe positive integer $X = {1 \le n \le 8}$, proposition P = "n is an even integers", Q = "$(3 \le n \le 7) \land (n \ne 6)$". Then truth set of $P \leftrightarrow Q$ is






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

Universe:

$X = {1,2,3,4,5,6,7,8}$

P is true for even integers:

$P = {2,4,6,8}$

Q is true for:

$Q = {3,4,5,7}$

$P \leftrightarrow Q$ is true when both P and Q have same truth value.

Both true:

$P \cap Q = {4}$

Both false:

Elements not in $P \cup Q = {1}$

Therefore,

Truth set = ${1,4}$

UGC NET Computer Science PYQ
If $f(n) = 5f(n/2) + 3$ and $f(1) = 7$ is a recurrence relation where $k$ is a positive integer, then $f(2^k) =$





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Let


$f(2^k) = g(k)$


Then recurrence becomes


$g(k) = 5g(k-1) + 3$


with


$g(0) = f(1) = 7$


Solve recurrence.


Homogeneous solution:


$g_h(k) = C5^k$


Particular solution:


Assume constant $A$


$A = 5A + 3$


$-4A = 3$


$A = -\frac{3}{4}$


General solution:


$g(k) = C5^k - \frac{3}{4}$


Use initial condition


$g(0) = 7$


$C - \frac{3}{4} = 7$


$C = \frac{31}{4}$


Thus


$f(2^k) = \frac{31}{4}5^k - \frac{3}{4}$


UGC NET Computer Science PYQ
A basic feasible solution of an $m \times n$ transportation problem is said to be non-degenerate, if basic feasible solution contains exactly $...............$ number of individual allocation in $...............$ positions.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

In an $m \times n$ transportation problem, a basic feasible solution is called non-degenerate when it has exactly $m+n-1$ occupied cells or allocations.

These allocations should be in independent positions, means they should not form a closed loop.

So, the required blanks are $m+n-1$ and independent.


UGC NET Computer Science PYQ

Consider the following Linear Programming Problem $($LPP$)$:

Maximize $z=x_1+x_2$

Subject to the constraints:

$x_1+2x_2\le 2000$

$x_1+x_2\le 1500$

$x_2\le 600$

and $x_1,x_2\ge 0$

The solution of the above LPP is:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

$x_1=1000,\ x_2=500$

Now,

$x_1+2x_2=1000+2(500)=2000\le 2000$

$x_1+x_2=1000+500=1500\le 1500$

$x_2=500\le 600$

Also,

$z=x_1+x_2=1000+500=1500$

So, all constraints are satisfied.


UGC NET Computer Science PYQ
Which of the following is NOT logically equivalent to $P \to Q$?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

We know, $P \to Q \equiv \sim P \vee Q$ Also, contrapositive of $P \to Q$ is $\sim Q \to \sim P$ So, $P \to Q \equiv \sim Q \to \sim P$ Also, $P \to Q \equiv \sim(P \wedge \sim Q)$ Now, $\sim Q \to P \equiv Q \vee P$ This is not equivalent to $P \to Q$.

UGC NET Computer Science PYQ
Seven people enter a lift. The lift stops only at three floors which are unspecified. At each of the three floors, no one enters the lift, but at least one person leaves the lift. After the three floor stops, the lift is empty. In how many ways this can happen?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

Each of the $7$ people can leave at any one of the $3$ stops. Total ways without restriction: $3^7=2187$ But each stop must have at least one person leaving. Using inclusion-exclusion: Required ways $=3^7-\binom{3}{1}2^7+\binom{3}{2}1^7$ $=2187-3(128)+3(1)$ $=2187-384+3$ $=1806$

UGC NET Computer Science PYQ
What are the greatest lower bound $($GLB$)$ and the least upper bound $($LUB$)$ of the sets $A={3,9,12}$ and $B={1,2,4,5,10}$ if they exist in poset $(Z^+,/)$?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

In the poset $(Z^+,/)$, the relation is based on divisibility.

Here,

$GLB=$ greatest common divisor $($GCD$)$

$LUB=$ least common multiple $($LCM$)$

For set $A={3,9,12}$:

$GLB(A)=GCD(3,9,12)=3$

$LUB(A)=LCM(3,9,12)=36$

For set $B={1,2,4,5,10}$:

$GLB(B)=GCD(1,2,4,5,10)=1$

$LUB(B)=LCM(1,2,4,5,10)=20$

So,

$A(GLB-3,\ LUB-36)$

and

$B(GLB-1,\ LUB-20)$


UGC NET Computer Science PYQ
The coefficient of $x^2y^3z^2$ in the expansion of $(x+y+z)^7$ is





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

In $(x+y+z)^7$, the general coefficient of $x^ay^bz^c$ is $\frac{7!}{a!b!c!}$ Here, $a=2,\ b=3,\ c=2$ So, coefficient is $\frac{7!}{2!3!2!}$ $=C(7,2)\times C(5,3)$

UGC NET Computer Science PYQ
Let $P$ be the set of all people. Let $R$ be a binary relation on $P$ such that $(a,b)\in R$ if $a$ is a brother of $b$. Is $R$ symmetric, transitive, an equivalence relation, a partial order relation?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

Relation $R$ is defined as:

$(a,b)\in R$ if $a$ is a brother of $b$.

Symmetric:

If $a$ is brother of $b$, then it is not necessary that $b$ is brother of $a$.

For example, $b$ can be female. So, $b$ will not be brother of $a$.

Therefore, $R$ is not symmetric.

Transitive:

If $a$ is brother of $b$ and $b$ is brother of $c$, then $a$ is also brother of $c$.

Therefore, $R$ is transitive.

Equivalence relation:

For equivalence relation, relation must be reflexive, symmetric and transitive.

Here, $R$ is not symmetric and not reflexive.

So, $R$ is not an equivalence relation.

Partial order relation:

For partial order relation, relation must be reflexive, antisymmetric and transitive.

Here, $R$ is not reflexive.

So, $R$ is not a partial order relation.


UGC NET Computer Science PYQ
What is the minimum number of students in a discrete mathematics class to be sure that at least six will receive the same grade, if there are seven possible grades: S, A, B, C, D, P and F?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

There are $7$ possible grades. To avoid getting $6$ students in the same grade, maximum $5$ students can receive each grade. So, maximum students without guarantee: $7\times 5=35$ Now, one more student will surely make at least $6$ students in one grade. Required number of students: $35+1=36$

UGC NET Computer Science PYQ
A tree has $2n$ vertices of degree $1$, $3n$ vertices of degree $2$, $n$ vertices of degree $3$. Determine the number of vertices and edges in tree.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

Total number of vertices:

$V=2n+3n+n=6n$

For a tree,

$E=V-1=6n-1$

Sum of degrees:

$2n(1)+3n(2)+n(3)$

$=2n+6n+3n=11n$

By handshaking theorem,

$2E=\text{sum of degrees}$

$2(6n-1)=11n$

$12n-2=11n$

$n=2$

So,

$V=6n=6(2)=12$

$E=V-1=12-1=11$


UGC NET Computer Science PYQ
How many reflexive relations are there on a set with $4$ elements?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

For a set with $n$ elements, total ordered pairs are:

$n^2$

Here,

$n=4$

So, total ordered pairs:

$4^2=16$

For a reflexive relation, all diagonal pairs must be present.

Number of compulsory diagonal pairs:

$4$

Remaining pairs:

$16-4=12$

Each remaining pair can be either selected or not selected.

So, number of reflexive relations:

$2^{12}$


UGC NET Computer Science PYQ

Consider the Euler's phi function given by

$\phi(n)=n\prod\left(1-\dfrac{1}{p}\right)$

where $p$ runs over all the primes dividing $n$. What is the value of $\phi(45)$?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

We have,

$45=3^2\times 5$

So, prime divisors of $45$ are $3$ and $5$.

Using Euler's phi function,

$\phi(45)=45\left(1-\dfrac{1}{3}\right)\left(1-\dfrac{1}{5}\right)$

$=45\times \dfrac{2}{3}\times \dfrac{4}{5}$

$=24$


UGC NET Computer Science PYQ

Consider the complexity class $CO-NP$ as the set of languages $L$ such that $\overline{L}\in NP$, and the following two statements:

$S_1: P\subseteq CO-NP$

$S_2:$ If $NP\ne CO-NP$, then $P\ne NP$

Which of the following is/are correct?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Statement $S_1$ is true.

Class $P$ is closed under complement. Also, $P\subseteq NP$.

So,

$P\subseteq CO-NP$

Statement $S_2$ is also true.

If $P=NP$, then since $P$ is closed under complement, we would get

$NP=CO-NP$

But the statement says $NP\ne CO-NP$.

Therefore, $P\ne NP$.

Hence, both $S_1$ and $S_2$ are correct.


UGC NET Computer Science PYQ

Consider the following statements:

$S_1$: For any integer $n>1$, $a^{\phi(n)}\equiv 1\ (\text{mod }n)$ for all $a\in Z_n^*$, where $\phi(n)$ is Euler's phi function.

$S_2$: If $p$ is prime, then $a^p\equiv 1\ (\text{mod }p)$ for all $a\in Z_p^*$.

Which one of the following is/are correct?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Statement $S_1$ is true by Euler's theorem.

If $a\in Z_n^*$, then $a$ and $n$ are relatively prime.

So,

$a^{\phi(n)}\equiv 1\ (\text{mod }n)$

Now consider $S_2$.

For prime $p$, Fermat's theorem gives

$a^{p-1}\equiv 1\ (\text{mod }p)$

for $a\in Z_p^*$.

But $S_2$ says

$a^p\equiv 1\ (\text{mod }p)$

This is not generally true.

Actually,

$a^p\equiv a\ (\text{mod }p)$

So, $S_2$ is false.


UGC NET Computer Science PYQ
A graph $G$ with number of vertices greater and equal than three i.e. $(n \ge 3)$ is a Hamiltonian graph, if the degree of each vertex is greater and equal to …





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Dirac’s theorem states that if a simple graph with $n \ge 3$ vertices satisfies


$deg(v) \ge \frac{n}{2}$


for every vertex $v$, then the graph is Hamiltonian.


Thus the degree of each vertex must be at least half of the number of vertices.


UGC NET Computer Science PYQ
Consider $\alpha,\beta,\gamma$ as logical variables. Identify which of the following represents correct logical equivalence:

(A) $(\alpha\land(\beta\lor\gamma))\equiv((\alpha\land\beta)\lor(\alpha\land\gamma))$
(B) $(\alpha\lor\beta)\equiv\neg\alpha\lor\beta$
(C) $(\alpha\Rightarrow\beta)\equiv(\neg\beta\Rightarrow\neg\alpha)$
(D) $(\neg(\alpha\lor\beta))\equiv(\neg\alpha\Rightarrow\neg\beta)$
Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ

Solution

Check statement (A):

$(\alpha\land(\beta\lor\gamma))\equiv((\alpha\land\beta)\lor(\alpha\land\gamma))$

This is distributive law of logic.

So, statement (A) is true.

Check statement (B):

$(\alpha\lor\beta)\equiv\neg\alpha\lor\beta$

This is not always true.

For example, let $\alpha=True$ and $\beta=False$.

Then,

$\alpha\lor\beta=True\lor False=True$

But,

$\neg\alpha\lor\beta=False\lor False=False$

Both values are different.

So, statement (B) is false.

Check statement (C):

$(\alpha\Rightarrow\beta)\equiv(\neg\beta\Rightarrow\neg\alpha)$

This is contrapositive law.

Also,

$\alpha\Rightarrow\beta\equiv\neg\alpha\lor\beta$

And,

$\neg\beta\Rightarrow\neg\alpha\equiv\beta\lor\neg\alpha$

Since,

$\neg\alpha\lor\beta\equiv\beta\lor\neg\alpha$

So, statement (C) is true.

Check statement (D):

$(\neg(\alpha\lor\beta))\equiv(\neg\alpha\Rightarrow\neg\beta)$

Using De Morgan's law,

$\neg(\alpha\lor\beta)\equiv\neg\alpha\land\neg\beta$

Now,

$\neg\alpha\Rightarrow\neg\beta\equiv\alpha\lor\neg\beta$

These two are not equivalent.

So, statement (D) is false.

Therefore, only (A) and (C) are correct.

UGC NET Computer Science PYQ
Let $(\{a,b\},*)$ be a semigroup, where $a*a=b$.

(A) $a*b=b*a$

(B) $b*b=b$

Choose the most appropriate answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ

Solution

Given,

$(\{a,b\},*)$ is a semigroup.

So, the operation $*$ is associative.

That means,

$(x*y)*z=x*(y*z)$

Also given,

$a*a=b$

Now check statement (A):

Using associativity,

$(a*a)*a=a*(a*a)$

Since $a*a=b$, we get:

$b*a=a*b$

So,

$a*b=b*a$

Therefore, statement (A) is true.

Now check statement (B):

We need to prove $b*b=b$.

Since $b=a*a$, we can write:

$b*b=(a*a)*b$

Using associativity,

$(a*a)*b=a*(a*b)$

Now, $a*b$ must be either $a$ or $b$ because the set is $\{a,b\}$.

Case 1:

If $a*b=a$, then

$a*(a*b)=a*a=b$

Case 2:

If $a*b=b$, then

$a*(a*b)=a*b=b$

In both cases,

$b*b=b$

Therefore, statement (B) is also true.

Hence, both (A) and (B) are true.

UGC NET Computer Science PYQ
Let $\epsilon=0.0005$ and Let $R_e$ be the relation $\{(x,y)\in R^2:|x-y|<\epsilon\}$, $R_e$ could be interpreted as the relation approximately equal. $R_e$ is
(A) Reflexive
(B) Symmetric
(C) transitive
Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ

Solution


Solution:

Given relation is:

$R_e=\{(x,y)\in R^2:|x-y|<\epsilon\}$

where,

$\epsilon=0.0005$

Now check each property.

Check reflexive:

A relation is reflexive if every element is related to itself.

For any real number $x$,

$|x-x|=0$

Since,

$0<\epsilon$

So,

$|x-x|<\epsilon$

Therefore, $(x,x)\in R_e$.

Hence, $R_e$ is reflexive.

So, statement (A) is true.

Check symmetric:

A relation is symmetric if $(x,y)\in R_e$ implies $(y,x)\in R_e$.

If,

$(x,y)\in R_e$

then,

$|x-y|<\epsilon$

But,

$|x-y|=|y-x|$

So,

$|y-x|<\epsilon$

Therefore, $(y,x)\in R_e$.

Hence, $R_e$ is symmetric.

So, statement (B) is true.

Check transitive:

A relation is transitive if $(x,y)\in R_e$ and $(y,z)\in R_e$ imply $(x,z)\in R_e$.

Let,

$x=0,\ y=0.0004,\ z=0.0008$

Now,

$|x-y|=|0-0.0004|=0.0004<0.0005$

So, $(x,y)\in R_e$.

Also,

$|y-z|=|0.0004-0.0008|=0.0004<0.0005$

So, $(y,z)\in R_e$.

But,

$|x-z|=|0-0.0008|=0.0008$

Since,

$0.0008>0.0005$

So, $(x,z)\notin R_e$.

Therefore, $R_e$ is not transitive.

So, statement (C) is false.

Hence, only (A) and (B) are true.


UGC NET Computer Science PYQ

Which of the following problems is/are decidable problem(s) on Turing machine $M$?

$(a)$ $G$ is a CFG with $L(G)=\phi$

$(b)$ There exist two TMs $M_1$ and $M_2$ such that $L(M)\subseteq L(M_1)\cup L(M_2)$

$(c)$ $M$ is a TM that accepts $\omega$ using at most $2^{|\omega|}$ cells of tape






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

Statement $(a)$ is decidable because emptiness of a context-free grammar is decidable.

Statement $(b)$ is also decidable in this form, because recursively enumerable languages are closed under union, and the condition can be satisfied by suitable Turing machines.

Statement $(c)$ is decidable because the tape usage is bounded by $2^{|\omega|}$. With bounded tape, the number of configurations becomes finite, so we can decide whether $M$ accepts $\omega$ within this bound.

Therefore, all three statements are decidable.


UGC NET Computer Science PYQ

for a statement, a language $L\subseteq \Sigma^*$ is recursive if there exists some Turing machine $M$.

Which of the following conditions is satisfied for any string $\omega$?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2019 (Paper II) PYQ

Solution

A recursive language is decided by a Turing machine that halts on every input.

If $\omega\in L$, then the machine halts and accepts $\omega$.

If $\omega\notin L$, then the machine halts and rejects $\omega$.

Rejecting means it halts without reaching an acceptable state.

Therefore, the correct condition is:

If $\omega\notin L$, then $M$ halts without reaching an acceptable state.


UGC NET Computer Science PYQ
Let $a^{2c}\bmod n=(a^c)^2\bmod n$ and $a^{2c+1}\bmod n=a\cdot(a^c)^2\bmod n$. For $a=7,\ b=17$ and $n=561$, what is the value of $a^b\bmod n$?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

We have to find:

$7^{17}\bmod 561$

Now,

$7^2=49$

$7^4=49^2=2401$

$2401\bmod 561=157$

So,

$7^4\bmod 561=157$

Now,

$7^8\bmod 561=157^2\bmod 561$

$157^2=24649$

$24649\bmod 561=526$

So,

$7^8\bmod 561=526$

Now,

$7^{16}\bmod 561=526^2\bmod 561$

$526^2=276676$

$276676\bmod 561=103$

So,

$7^{16}\bmod 561=103$

Now,

$7^{17}\bmod 561=7^{16}\times 7\bmod 561$

$=103\times 7\bmod 561$

$=721\bmod 561$

$=160$


UGC NET Computer Science PYQ
A clique in an undirected graph $G=\langle V,E\rangle$ is a subset $V'\subseteq V$ of vertices, such that





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

A clique in an undirected graph is a subset of vertices in which every pair of distinct vertices is connected by an edge.

That means if we take any two vertices from $V'$, there must be an edge between them.

So, a clique forms a complete subgraph.


UGC NET Computer Science PYQ
Translate $\forall x \exists y (x < y)$ in English. Consider domain as a real number for both the variables.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Expression

$\forall x \exists y (x<y)$

Meaning

"For every $x$, there exists some $y$ such that $x<y$"

UGC NET Computer Science PYQ
Consider the following statements:

A. A group can have zero elements.

B. A group cannot have any element which is idempotent except the identity element.

C. An isomorphism from a group $\langle G,\rangle$ to $\langle G,\rangle$ is called an automorphism.

D. If every element in a group is its own inverse, then the group must be abelian.

Choose the correct answer about the four statements given above.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

Statement A is false.

A group cannot have zero elements because every group must contain an identity element.

Statement B is true.

If $a$ is idempotent, then

$a*a=a$

Multiplying by $a^{-1}$,

$a=e$

So, only identity element is idempotent.

Statement C is true.

An isomorphism from a group to itself is called an automorphism.

Statement D is true.

If every element is its own inverse, then

$a^{-1}=a$ and $b^{-1}=b$

Now,

$(ab)^{-1}=b^{-1}a^{-1}=ba$

But every element is its own inverse, so

$(ab)^{-1}=ab$

Therefore,

$ab=ba$

Hence, the group is abelian.

So, correct option is:

$\boxed{(a)\ \text{B, C and D are correct}}$

UGC NET Computer Science PYQ

 Consider the following statements:

A. The number of labelled binary trees possible with $n$ nodes is $\frac{(2n)!}{(n+1)!}$

B. The number of binary search trees possible with $n$ nodes is $\frac{(2n)!}{(n+1)!n!}$

C. The number of unlabeled binary trees possible with $n$ nodes is $\frac{C(2n,n)}{(n+1)!}$

D. The number of simple, undirected and labelled graphs possible with $n$ vertices is $2^{\frac{n(n-1)}{2}}$






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

A is correct.

Number of labelled binary trees with $n$ nodes:

$=C_n\times n!$

$=\frac{(2n)!}{(n+1)!n!}\times n!$

$=\frac{(2n)!}{(n+1)!}$

B is correct.

Number of binary search trees with $n$ nodes:

$=C_n=\frac{(2n)!}{(n+1)!n!}$

C is incorrect.

Correct formula for unlabeled binary trees is:

$C_n=\frac{1}{n+1}C(2n,n)$

D is correct.

Number of simple undirected labelled graphs:

$=2^{\frac{n(n-1)}{2}}$

So, correct option is:

$\boxed{(b)\ \text{A, B and D are only correct}}$

UGC NET Computer Science PYQ

The relation


$R={(1,3),(1,1),(3,1),(1,2),(3,3),(4,4)}$


defined in ${1,2,3,4}$ is ____






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

For reflexive relation, $(1,1),(2,2),(3,3),(4,4)$ must be present.

But $(2,2)$ is missing.

So, relation is not reflexive.

For symmetric relation, if $(1,2)$ is present, then $(2,1)$ must also be present.

But $(2,1)$ is missing.

So, relation is not symmetric.

For transitive relation, since $(3,1)$ and $(1,2)$ are present, then $(3,2)$ must be present.

But $(3,2)$ is missing.

So, relation is not transitive.

UGC NET Computer Science PYQ

Let P denote “She is intelligent” and Q denote “She is happy.”
Given statements:
(a) If she is intelligent, then she is unhappy.
(b) She is neither intelligent nor happy.
(c) It is necessary to be not intelligent in order to be happy.
(d) To be not intelligent is to be unhappy.

Which option gives the correct propositional expressions?

  1. (a) P→¬Q; (b) P ∧ ¬Q; (c) Q→¬P; (d) P→¬Q
  2. (a) P→Q; (b) ¬P ∧ ¬Q; (c) ¬Q→P; (d) ¬P→¬Q
  3. (a) P→¬Q; (b) ¬P ∧ ¬Q; (c) Q→¬P; (d) ¬P→¬Q
  4. (a) P→¬Q; (b) P ∧ ¬Q; (c) Q↔P; (d) ¬P→¬Q





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ

Solution

Translate each statement:
(a) “If intelligent then unhappy” ⇒ P → ¬Q.
(b) “Neither intelligent nor happy” ⇒ ¬P ∧ ¬Q.
(c) “Being not intelligent is necessary for being happy” ⇒ Q → ¬P.
(d) “Not intelligent implies unhappy” ⇒ ¬P → ¬Q.

Only Option 3 matches all four translations.

Answer: 3


UGC NET Computer Science PYQ
Given below are two statements: one is labelled as Assertion (A) and the other is labelled as Reason (R):

Assertion (A): $\bar{p}$

Reason (R): $(r\to \bar{q},\ r\lor s,\ s\to \bar{q},\ p\to q)$

In the light of the above statements, choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Sep 2022 (Paper II) PYQ

Solution


Given Reason statements are:

$r\to \bar{q}$

$r\lor s$

$s\to \bar{q}$

$p\to q$

From $r\lor s$, either $r$ is true or $s$ is true.

Case 1:

If $r$ is true, then using $r\to \bar{q}$, we get:

$\bar{q}$

Case 2:

If $s$ is true, then using $s\to \bar{q}$, we get:

$\bar{q}$

So, in both cases:

$\bar{q}$ is true.

Now we also have:

$p\to q$

Using modus tollens:

$p\to q$ and $\bar{q}$ imply $\bar{p}$.

Therefore, Assertion (A), that is $\bar{p}$, is true.

Also, Reason (R) correctly explains how $\bar{p}$ is obtained.

Hence, both (A) and (R) are true and (R) is the correct explanation of (A).

UGC NET Computer Science PYQ

In mathematical logic, which of the following are statements?

$(i)$ There will be snow in January.
$(ii)$ What is the time now?
$(iii)$ Today is Sunday.
$(iv)$ You must study Discrete Mathematics.

Choose the correct answer from the code given below:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

A statement in mathematical logic is a declarative sentence which has a definite truth value, either true or false.

$(i)$ There will be snow in January.
This is a declarative sentence. So, it is a statement.

$(ii)$ What is the time now?
This is a question. So, it is not a statement.

$(iii)$ Today is Sunday.
This is a declarative sentence. So, it is a statement.

$(iv)$ You must study Discrete Mathematics.
This is a command or advice. So, it is not a statement.

Therefore, only $(i)$ and $(iii)$ are statements.


UGC NET Computer Science PYQ
Match List I with List II and choose the correct answer from the code given below.
List I List II
$(a)$ Equivalence $(i)\ p\Rightarrow q$
$(b)$ Contrapositive $(ii)\ p\Rightarrow q : q\Rightarrow p$
$(c)$ Converse $(iii)\ p\Rightarrow q : \sim q\Rightarrow \sim p$
$(d)$ Implication $(iv)\ p\Leftrightarrow q$





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

Equivalence is represented by

$p\Leftrightarrow q$

So,

$(a)\rightarrow(iv)$

Contrapositive of $p\Rightarrow q$ is

$\sim q\Rightarrow \sim p$

So,

$(b)\rightarrow(iii)$

Converse of $p\Rightarrow q$ is

$q\Rightarrow p$

So,

$(c)\rightarrow(ii)$

Implication is represented by

$p\Rightarrow q$

So,

$(d)\rightarrow(i)$

Therefore, correct matching is

$(a)-(iv),\ (b)-(iii),\ (c)-(ii),\ (d)-(i)$


UGC NET Computer Science PYQ
A box contains six red balls and four green balls. Four balls are selected at random from the box. What is the probability that two of the selected balls will be red and two will be green?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

Total balls are

$6+4=10$

Number of ways to select $4$ balls from $10$ balls is

${}^{10}C_4$

We need exactly $2$ red balls and $2$ green balls.

Number of ways to select $2$ red balls from $6$ red balls is

${}^{6}C_2$

Number of ways to select $2$ green balls from $4$ green balls is

${}^{4}C_2$

So, required probability is

$\dfrac{{}^{6}C_2 \times {}^{4}C_2}{{}^{10}C_4}$

$=\dfrac{15 \times 6}{210}$

$=\dfrac{90}{210}$

$=\dfrac{3}{7}$


UGC NET Computer Science PYQ

Which of the following rotations are correctly explained in the context of an AVL tree?

A. LL rotation: The new node is inserted in the left sub-tree of the left sub-tree of the critical node.

B. RR rotation: The new node is inserted in the right sub-tree of the right sub-tree of the critical node.

C. LR rotation: The new node is inserted in the right sub-tree of the left sub-tree of the critical node.

D. RL rotation: The new node is inserted in the left sub-tree of the right sub-tree of the critical node.

Choose the correct answer from the options given below:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

All four AVL rotation cases are correctly explained:

LL case: left of left

RR case: right of right

LR case: right of left

RL case: left of right

So, correct option is:

$\boxed{(c)\ \text{A, B, C and D}}$


UGC NET Computer Science PYQ

A survey has been conducted on methods of commuter travel. Each respondent was asked to check Bus, Train or Automobile as a major method of travelling to work. More than one answer was permitted. The results reported were as follows:

Bus $30$ people; Train $35$ people; Automobile $100$ people; Bus and Train $15$ people; Bus and Automobile $15$ people, Train and Automobile $20$ people; and all the three methods $5$ people. How many people completed the survey form?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

Let Bus, Train and Automobile be represented by $B,T,A$ respectively.

Given,

$n(B)=30$

$n(T)=35$

$n(A)=100$

$n(B\cap T)=15$

$n(B\cap A)=15$

$n(T\cap A)=20$

$n(B\cap T\cap A)=5$

Using the formula,

$n(B\cup T\cup A)=n(B)+n(T)+n(A)-n(B\cap T)-n(B\cap A)-n(T\cap A)+n(B\cap T\cap A)$

Now,

$n(B\cup T\cup A)=30+35+100-15-15-20+5$

$=165-50+5$

$=120$

Therefore, $120$ people completed the survey form.


UGC NET Computer Science PYQ

For matrix multiplication, if we use divide and conquer algorithm, then ______

A. the running time is $T(n)=\Theta(n^3)$

B. the running time is $T(n)=\Theta(n^2\log n)$

C. The recurrence can be defined as $T(n)=8T(n/2)+\Theta(n^2)$

D. the recurrence relation is $T(n)=8T(2n)+\Theta(n^2\log n)$

E. Masters theorem, one of the cases is applicable

Choose the most appropriate answer from the options given below:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

In divide and conquer matrix multiplication, matrix is divided into smaller submatrices.

There are $8$ recursive multiplications of size $n/2$.

So, recurrence is:

$T(n)=8T(n/2)+\Theta(n^2)$

Using Master Theorem:

$a=8,\ b=2$

$n^{\log_b a}=n^{\log_2 8}=n^3$

So,

$T(n)=\Theta(n^3)$

Therefore, A, C and E are correct.

Correct option is:

$\boxed{(a)\ \text{A, C, E only}}$


UGC NET Computer Science PYQ

Consider the following statements:

$S_1:\forall xP(x)\vee \forall xQ(x)$ and $\forall x(P(x)\vee Q(x))$ are not logically equivalent.

$S_2:\exists xP(x)\wedge \exists xQ(x)$ and $\exists x(P(x)\wedge Q(x))$ are not logically equivalent.

Which of the following statements is/are correct?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

For $S_1$:

$\forall xP(x)\vee \forall xQ(x)$ means either $P(x)$ is true for all $x$, or $Q(x)$ is true for all $x$.

But $\forall x(P(x)\vee Q(x))$ means for every $x$, at least one of $P(x)$ or $Q(x)$ is true.

These two statements are not logically equivalent.

So, $S_1$ is true.

For $S_2$:

$\exists xP(x)\wedge \exists xQ(x)$ means there exists some $x$ for $P(x)$ and there exists some $x$ for $Q(x)$. These may be different values.

But $\exists x(P(x)\wedge Q(x))$ means there exists the same $x$ for which both $P(x)$ and $Q(x)$ are true.

These two statements are also not logically equivalent.

So, $S_2$ is true.


UGC NET Computer Science PYQ
In PERT/CPM, the merge event represents _____ of two or more events.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

In PERT/CPM network, a merge event is an event where two or more activities come together.

It represents the joining of two or more events or activities.

Therefore, the merge event represents joining.


UGC NET Computer Science PYQ

Use Dual Simplex Method to solve the following problem:

Maximize

$z=-2x_1-3x_2$

subject to:

$x_1+x_2\geq 2$

$2x_1+x_2\leq 10$

$x_1+x_2\leq 8$

$x_1,x_2\geq 0$






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

Given objective function is

$z=-2x_1-3x_2$

To maximize $z=-2x_1-3x_2$, we need to minimize the negative loss.

The main lower constraint is

$x_1+x_2\geq 2$

Now check the feasible corner points on $x_1+x_2=2$:

If $x_2=0$, then

$x_1=2$

So, point is $(2,0)$.

At $(2,0)$,

$z=-2(2)-3(0)$

$z=-4$

If $x_1=0$, then

$x_2=2$

So, point is $(0,2)$.

At $(0,2)$,

$z=-2(0)-3(2)$

$z=-6$

Since $-4>-6$, maximum value is $-4$.

Also, $(2,0)$ satisfies the other constraints:

$2x_1+x_2=2(2)+0=4\leq 10$

$x_1+x_2=2+0=2\leq 8$

Therefore, optimal solution is

$x_1=2,\ x_2=0,\ z=-4$


UGC NET Computer Science PYQ
Consider the graph shown below : 
Use Kruskal's algorithm to find the minimum spanning tree of the graph. The weight of this minimum spanning tree is





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

Using Kruskal's algorithm, we select edges in increasing order of weights, without forming a cycle.

From the graph, the selected edge weights are:

$1,1,1,2,2,2,3,4$

Since the graph has $9$ vertices, the minimum spanning tree must have

$9-1=8$ edges.

Now, total weight of MST is

$1+1+1+2+2+2+3+4$

$=16$

Therefore, the weight of the minimum spanning tree is

$16$


UGC NET Computer Science PYQ
Consider the following statements: $S_1:$ If a group $(G,*)$ is of order $n$, and $a\in G$ is such that $a^m=e$ for some integer $m\le n$, then $m$ must divide $n$. $S_2:$ If a group $(G,)$ is of even order, then there must be an element $a\in G$ such that $a\ne e$ and $aa=e$. Which of the statements is/are correct?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

For $S_1$:

By Lagrange theorem, the order of every element of a finite group divides the order of the group.

So, if $m$ is the order of element $a$, then $m$ divides $n$.

Hence, $S_1$ is true.

For $S_2$:

If a finite group has even order, then there exists at least one non-identity element of order $2$.

So, there exists $a\ne e$ such that:

$a*a=e$

Hence, $S_2$ is also true.


UGC NET Computer Science PYQ

Consider the following statements with respect to duality in LPP:

(a) The final simplex table giving optimal solution of the primal also contains optimal solution of its dual in itself.

(b) If either the primal or the dual problem has a finite optimal solution, then the other problem also has a finite optimal solution.

(c) If either problem has an unbounded optimum solution, then the other problem has no feasible solution at all.

Which of the statements is/are correct?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2019 (Paper II) PYQ

Solution

The final simplex table of the primal problem also gives information about the optimal solution of the dual problem.

Statement (b) is correct.

By strong duality theorem, if one problem has a finite optimal solution, then the other also has a finite optimal solution.

Statement (c) is correct.

If one problem is unbounded, then the other problem is infeasible.

So, all three statements are correct.


UGC NET Computer Science PYQ
Let $P$ be “It is hot day” and $q$ be “The temperature is $48^\circ C$”.
Write in simple sentences the meaning of $\neg P \land \neg q$.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Given:


$P$ : It is hot day


$q$ : Temperature is $48^\circ C$


Expression:


$\neg P \land \neg q$


Meaning:


$\neg P$ → It is not a hot day


$\neg q$ → Temperature is not $48^\circ C$


Combined with AND:


Neither $P$ nor $q$


Thus sentence:


"It is neither a hot day nor temperature is $48^\circ C$"


UGC NET Computer Science PYQ
Let $L(x,y)$ be the statement “$x$ loves $y$” where the domain for both $x$ and $y$ consists of all people in the world.
Use quantifiers to express “Joy is loved by everyone.”





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Statement:


“Joy is loved by everyone”


Meaning:


Every person $x$ loves Joy.


Mathematically:


$\forall x; L(x,;Joy)$


UGC NET Computer Science PYQ

Fifth normal form is concerned with :






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Database normal forms:


1NF → atomic values


2NF → remove partial dependency


3NF → remove transitive dependency


BCNF → stronger FD rules


4NF → multivalued dependency


5NF → join dependency


UGC NET Computer Science PYQ

A coin is tossed successively three times. Find the Probability $(P)$, Event $(E)$, Sample space $(S)$ of getting exactly one head or two heads, where $n$ is number of occurrence.

(A) $n(S)=8$ and $n(E)=4$

(B) $n(E)=6$ and $n(S)=8$

(C) $P(E)=\frac{3}{4}$

(D) $P(E)=\frac{1}{2}$

Choose the correct answer from the options given below :






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Sample space for 3 tosses:

$S={HHH,HHT,HTH,HTT,THH,THT,TTH,TTT}$

Thus

$n(S)=8$

Event: exactly 1 head or 2 heads

1 head → ${HTT,THT,TTH}$

2 heads → ${HHT,HTH,THH}$

So

$n(E)=6$

Probability

$P(E)=\frac{6}{8}=\frac{3}{4}$

Thus correct statements:

(B) and (C)


UGC NET Computer Science PYQ
Match List I with List II
 List I

 List II

A. 8-Queens problems

I. Divide and conquer

B. Closest Pair of points

II. Dynamic Programming

C. String Edit problem

III. Greedy Method

D. Knapsack problem

IV. Backtracking

Choose the correct answer from the options given below:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

8-Queens problem → Backtracking

Closest Pair of points → Divide and conquer

String Edit problem → Dynamic Programming

Knapsack problem → Greedy Method

So,

A → IV
B → I
C → II
D → III

Correct option is:

$\boxed{(c)\ A-IV,\ B-I,\ C-II,\ D-III}$


UGC NET Computer Science PYQ

If a graph $G$ has no loops or parallel edges, and if the number of vertices $n$ in the graph is $n\geq 3$, then graph $G$ is Hamiltonian if:

$(i)$ $\deg(v)\geq \dfrac{n}{3}$ for each vertex $v$

$(ii)$ $\deg(v)+\deg(w)\geq n$ whenever $v$ and $w$ are not connected by an edge.

$(iii)$ $E(G)\geq \dfrac{1}{3}(n-1)(n-2)+2$

Choose the correct answer from the code given below:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

Statement $(i)$ is not a standard sufficient condition for Hamiltonian graph.

By Dirac's theorem, the sufficient condition is

$\deg(v)\geq \dfrac{n}{2}$

for every vertex $v$.

So, statement $(i)$ is false.

Statement $(ii)$ is true by Ore's theorem.

Ore's theorem says that if for every pair of non-adjacent vertices $v$ and $w$,

$\deg(v)+\deg(w)\geq n$

then the graph is Hamiltonian.

Statement $(iii)$ is not the standard sufficient condition here.

Therefore, only statement $(ii)$ is correct.


UGC NET Computer Science PYQ

The solution of recurrence relation

$T(n)=2T(\sqrt{n})+\lg(n)$

is:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2018 (Paper II) PYQ

Solution

Given,

$T(n)=2T(\sqrt{n})+\lg n$

Let

$n=2^m$

So,

$\lg n=m$

and

$\sqrt{n}=2^{m/2}$

Let

$S(m)=T(2^m)$

Then,

$S(m)=2S\left(\dfrac{m}{2}\right)+m$

Using Master theorem,

$a=2,\ b=2$

So,

$m^{\log_b a}=m^{\log_2 2}=m$

Therefore,

$S(m)=O(m\lg m)$

Now put back $m=\lg n$.

So,

$T(n)=O(\lg n\lg(\lg n))$


UGC NET Computer Science PYQ
Let $G(V,E)$ be an undirected graph with $|E|$ edges. Then the sum of degree of all vertices is equal to ______.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution


UGC NET Computer Science PYQ
Let $G$ be a simple, undirected graph with $n$ vertices and $k$ connected components. What is the minimum possible number of edges of $G$?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

For a connected component with $m$ vertices, minimum edges required:

$m-1$

If graph has $k$ connected components, then minimum total edges:

$=(n_1-1)+(n_2-1)+...+(n_k-1)$

$=(n_1+n_2+...+n_k)-k$

$=n-k$

Correct option is:

$\boxed{(d)\ n-k}$


UGC NET Computer Science PYQ
Which of the following are logically equivalent?

A. $\neg p\to(q\to r)$ and $q\to(p\lor r)$

B. $(p\to q)\to r$ and $p\to(q\to r)$

C. $(p\to q)\to(r\to s)$ and $(p\to r)\to(q\to s)$

Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

Check A:

$\neg p\to(q\to r)\equiv p\lor(\neg q\lor r)$

$=p\lor\neg q\lor r$

Also,

$q\to(p\lor r)\equiv\neg q\lor p\lor r$

Both are same, so A is true.

Check B:

$(p\to q)\to r\equiv(p\land\neg q)\lor r$

$p\to(q\to r)\equiv\neg p\lor\neg q\lor r$

Both are not always same, so B is false.

Check C:

Both expressions are not always logically equivalent.

So, C is false.

Therefore, only A is correct.

UGC NET Computer Science PYQ
 Which of these statements about the floor and ceiling functions are correct?

Statement I: $\lfloor 2x\rfloor=\lfloor x\rfloor+\left\lfloor x+\frac{1}{2}\right\rfloor$ for all real number $x$

Statement II: $\lceil x+y\rceil=\lceil x\rceil+\lceil y\rceil$ for all real numbers $x$ and $y$





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

Statement I is a standard identity of floor function:

$\lfloor 2x\rfloor=\lfloor x\rfloor+\left\lfloor x+\frac{1}{2}\right\rfloor$

So, Statement I is true.

Statement II is not always true.

Take $x=0.2$ and $y=0.2$.

$\lceil x+y\rceil=\lceil 0.4\rceil=1$

But,

$\lceil x\rceil+\lceil y\rceil=\lceil 0.2\rceil+\lceil 0.2\rceil=1+1=2$

So, Statement II is false.

UGC NET Computer Science PYQ
How many ways are there to assign $5$ different jobs to $4$ different employees if every employee is assigned at least $1$ job?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

We need to assign $5$ different jobs to $4$ different employees such that every employee gets at least one job.

This is an onto function problem.

Total ways without restriction:

$4^5=1024$

Subtract cases where at least one employee gets no job:

$\binom{4}{1}3^5=4\times243=972$

Add cases where two employees get no job:

$\binom{4}{2}2^5=6\times32=192$

Subtract cases where three employees get no job:

$\binom{4}{3}1^5=4$

Required ways:

$4^5-\binom{4}{1}3^5+\binom{4}{2}2^5-\binom{4}{3}1^5$

$=1024-972+192-4=240$

UGC NET Computer Science PYQ
A company stores products in a warehouse. Storage bins in this warehouse are specified by their aisle, location in the aisle, and shelf. There are $50$ aisles, $85$ horizontal locations in each aisle, and $5$ shelves throughout the warehouse. What is the least number of products the company can have so that at least two products must be stored in the same bin?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

Total number of storage bins:

$50\times85\times5=21250$

By pigeonhole principle, if $21250$ products are stored, each product can be placed in a different bin.

To guarantee that at least two products are stored in the same bin, we need one more product.

So, least number of products:

$21250+1=21251$

UGC NET Computer Science PYQ
Let us assume a person climbing the stairs can take one stair or two stairs at a time. How many ways can this person climb a flight of eight stairs?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

Let number of ways to climb $n$ stairs be $f(n)$.

A person can reach the $n^{th}$ stair either from $(n-1)^{th}$ stair or from $(n-2)^{th}$ stair.

So,

$f(n)=f(n-1)+f(n-2)$

Base values:

$f(1)=1$

$f(2)=2$

Now,

$f(3)=3$

$f(4)=5$

$f(5)=8$

$f(6)=13$

$f(7)=21$

$f(8)=34$

UGC NET Computer Science PYQ
For which value of $n$ is Wheel graph $W_n$ regular?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

A wheel graph $W_n$ has one central vertex connected to all vertices of a cycle.

In $W_n$, the central vertex has degree $n-1$.

Each outer vertex has degree $3$, because it is connected to two cycle vertices and one central vertex.

For the graph to be regular:

$n-1=3$

$n=4$

So, $W_4$ is regular.

UGC NET Computer Science PYQ
Which of the following Graphs is(are) planar?








Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

A planar graph is a graph that can be drawn on a plane without any two edges crossing each other.

Graph A can be redrawn without edge crossing, so Graph A is planar.

Graph B is similar to $K_{3,3}$ structure. Since $K_{3,3}$ is non-planar, Graph B is not planar.

Graph C also contains a non-planar subdivision structure, so Graph C is not planar.

Therefore, only Graph A is planar.

UGC NET Computer Science PYQ
Let $(X,*)$ be a semigroup. Furthermore, for every $a$ and $b$ in $X$, if $a\ne b$, then $a*b\ne b*a$.

Based on the defined semigroup, choose the correct equalities from the options given below.

A. For every $a$ in $X,\ a*a=a$

B. For every $a,b$ in $X,\ a*b*a=a$

C. For every $a,b,c$ in $X,\ a*b*c=a*c$





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

Given condition means if two elements commute, then they must be equal.

For A:

$a*(a*a)=(a*a)*a$ by associativity.

So, $a$ and $a*a$ commute.

Hence, $a=a*a$.

So, A is true.

For B:

$a*(a*b*a)=(a*a)*b*a=a*b*a$

$(a*b*a)*a=a*b*(a*a)=a*b*a$

So, $a$ and $a*b*a$ commute.

Hence, $a*b*a=a$.

So, B is true.

For C:

Using B, $c*a*c=c$ and $a*c*a=a$.

Now,

$(a*b*c)(a*c)=a*b*(c*a*c)=a*b*c$

$(a*c)(a*b*c)=(a*c*a)*b*c=a*b*c$

So, $a*b*c$ and $a*c$ commute.

Hence, $a*b*c=a*c$.

So, C is also true.

UGC NET Computer Science PYQ
Consider the following linear optimization problem:

Maximize $Z=6x+5y$

Subject to $2x-3y\le 5$

$x+3y\le 11$

$4x+y\le 15$

and $x\ge 0,\ y\ge 0$.

The optimal solution of the problem is:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

Check corner points of feasible region.

Intersection of $x+3y=11$ and $4x+y=15$:

From $4x+y=15$,

$y=15-4x$

Put in $x+3y=11$:

$x+3(15-4x)=11$

$x+45-12x=11$

$-11x=-34$

$x=\frac{34}{11}$

Now,

$y=15-4\cdot\frac{34}{11}=\frac{29}{11}$

Objective value:

$Z=6x+5y$

$Z=6\cdot\frac{34}{11}+5\cdot\frac{29}{11}$

$Z=\frac{204+145}{11}=\frac{349}{11}=31.72$

Other corner values are smaller.

UGC NET Computer Science PYQ

Consider the following if $p$ and $q$ are two statements.


(A) $\sim (p \land q) = \sim p \lor \sim q$


(B) $\sim (p \lor q) = \sim p \land \sim q$


(C) $p \land \sim p = T$


(D) $\sim (p \Rightarrow q) = p \land \sim q$


(E) $p \lor q = \sim p \lor \sim q$


Choose the correct answer from the options given below :






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution



UGC NET Computer Science PYQ
In a group of 120 people:
65 eat Rice, 45 eat Bread, 42 eat Curd,
20 eat both Rice and Bread, 25 eat both Rice and Curd, 15 eat both Bread and Curd,
and 8 eat all three items.
Which of the following is the number of people who eat at least one of the three items?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ

Solution

Using the formula for union of three sets:
n(R ∪ B ∪ C) = n(R) + n(B) + n(C) − n(R ∩ B) − n(R ∩ C) − n(B ∩ C) + n(R ∩ B ∩ C)
Substitute:
= 65 + 45 + 42 − 20 − 25 − 15 + 8
= 152 − 60 + 8
= 100
Hence, 100 people eat at least one of the three items.

UGC NET Computer Science PYQ
List I (Statements) List II (Logic Type)
A. If the Indian team wins, then it is raining IV. Conditional
B. If the Indian team does not win, then it is not raining I. Inverse
C. If it is raining, then the Indian team wins II. Converse
D. If it is not raining, then the Indian team does not win III. Contrapositive





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ

Solution

A → IV → Conditional statement
B → I → Inverse (negating both sides)
C → II → Converse (reversing condition and result)
D → III → Contrapositive (negating and reversing)

UGC NET Computer Science PYQ
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:

$P={9,5,2,7,6,16,9}$

$W={2,5,6,11,1,9,3}$
Find the optimal solution for fractional knapsack problem when its maximum capacity is $15$.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

$P={9,5,2,7,6,16,9}$

$W={2,5,6,11,1,9,3}$

Find profit by weight ratio:

Item 5: $\frac{6}{1}=6$

Item 1: $\frac{9}{2}=4.5$

Item 7: $\frac{9}{3}=3$

Item 6: $\frac{16}{9}=1.77$

Now take items in decreasing ratio:

Total weight $=1+2+3+9=15$

Total profit $=6+9+9+16=40$

Correct option is:

$\boxed{(b)\ 40}$


UGC NET Computer Science PYQ
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:

$P={9,5,2,7,6,16,9}$

$W={2,5,6,11,1,9,3}$


What is the maximum value of items you can carry if maximum weight allowed is $25$ with a fractional knapsack?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

Take items in decreasing profit by weight ratio:

Item 5: weight $1$, profit $6$

Item 1: weight $2$, profit $9$

Item 7: weight $3$, profit $9$

Item 6: weight $9$, profit $16$

Item 2: weight $5$, profit $5$

Total weight used:

$1+2+3+9+5=20$

Total profit:

$6+9+9+16+5=45$

Remaining capacity:

$25-20=5$

Next best item is item 4 with profit $7$ and weight $11$.

Fractional profit:

$5\times \frac{7}{11}=\frac{35}{11}=3.18$

Maximum profit:

$45+3.18=48.18\approx 48.1$

Correct option is:

$\boxed{(a)\ 48.1}$


UGC NET Computer Science PYQ
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:

$P={9,5,2,7,6,16,9}$

$W={2,5,6,11,1,9,3}$

 If new item $(P=5,W=2)$ is added to the list, total items is $8$ and capacity is $25$, then the best-case time of fractional knapsack for this case is ______





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

For fractional knapsack, if items are already arranged according to profit by weight ratio, then best-case selection can be done in linear time.

Here, total items are:

$n=8$

So, best-case time complexity is:

$O(n)=O(8)$

Correct option is:

$\boxed{(a)\ O(8)}$


UGC NET Computer Science PYQ
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:

$P={9,5,2,7,6,16,9}$

$W={2,5,6,11,1,9,3}$

The most efficient solution for the fractional knapsack problem with maximum capacity $15$ can be obtained by using ______





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

Fractional knapsack allows taking fractions of items.

So, we choose items according to highest profit by weight ratio.

This is a greedy approach.

Correct option is:

$\boxed{(c)\ \text{Greedy Algorithm}}$


UGC NET Computer Science PYQ
For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:

$P={9,5,2,7,6,16,9}$

$W={2,5,6,11,1,9,3}$

Which of the following statements is correct for a knapsack?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift I (Paper II) PYQ

Solution

In $0/1$ knapsack, an item is either selected completely or rejected completely.

In fractional knapsack, an item can be divided into smaller parts according to required weight.

So, correct option is:

$\boxed{(d)\ \text{In }0/1\text{ knapsack problem, items cannot be divided into smaller portions and in fractional knapsack we can divide the item into required proportions of weight}}$


UGC NET Computer Science PYQ
The tight asymptotic bound for the recurrence: $T(n) = 2T(n/4) + \sqrt{n}$





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ

Solution

We use the Master Theorem for $T(n) = aT(n/b) + f(n)$ Here, $a = 2$, $b = 4$, so $n^{\log_b a} = n^{\log_4 2} = n^{1/2} = \sqrt{n}$ Thus, $f(n) = \sqrt{n}$ is of the same order as $n^{\log_b a}$. Therefore, by Case 2 of Master Theorem, $T(n) = \Theta(n^{\log_b a} \log n) = \Theta(\sqrt{n} \log n)$ ✅ But wait! Let’s check growth dominance carefully: Actually, when $f(n) = \Theta(n^{\log_b a})$, we multiply by $\log n$, hence the correct bound is $\boxed{T(n) = \Theta(\sqrt{n} \log n)}$

UGC NET Computer Science PYQ
A positive integer is selected at random from the set of positive integers not exceeding 200. What is the probability that the selected number is divisible by either 2 or 5?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ

Solution

Let total numbers = 200 Divisible by 2 → 200/2 = 100 Divisible by 5 → 200/5 = 40 Divisible by both (LCM 10) → 200/10 = 20 Using inclusion–exclusion: n(2 ∪ 5) = 100 + 40 − 20 = 120 Probability = 120 / 200 = 3/5

UGC NET Computer Science PYQ
The negation of "Some students like hockey" is:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

"Some students like hockey" means
$ \exists x , [S(x) \land L(x)] $

Its negation is
$ \neg \exists x , [S(x) \land L(x)] $

Using logical rule,
$ \neg \exists x , P(x) \equiv \forall x , \neg P(x) $

So,
$ \forall x , [S(x) \rightarrow \neg L(x)] $

Hence, every student dislikes hockey.

UGC NET Computer Science PYQ

40 software professionals were interviewed for a job.

25 knew PYTHON, 20 knew JAVA and 7 knew neither language.

How many knew both languages?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science August 2024 (Paper II) PYQ

Solution

Total people = 40
People who know neither = 7

So people who know at least one language:

40 − 7 = 33

Use formula:

n(P ∪ J) = n(P) + n(J) − n(P ∩ J)

33 = 25 + 20 − x

33 = 45 − x

x = 12

UGC NET Computer Science PYQ
A relation $R$ is defined on ordered pairs of integers as $(x, y) R(u, v)$ if $x < u$ and $y > v$. Then $R$ is





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

For reflexive relation, we need
$ (x, y) R(x, y) $

But according to the definition,
$ x < x $ and $ y > y $

Both are false.

So, $R$ is not reflexive.

A partial order relation must be reflexive, antisymmetric, and transitive.
Since $R$ is not reflexive, it is not a partial order.

An equivalence relation must be reflexive, symmetric, and transitive.
Since $R$ is not reflexive, it is not an equivalence relation.

Hence, $R$ is neither a partial order nor an equivalence relation.

UGC NET Computer Science PYQ
Given below are two statements

Statement I: In an undirected graph, number of odd degree vertices is even.

Statement II: In an undirected graph, sum of degrees of all vertices is even.

In light of the above statements, choose the correct answer from the options given below.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2021 (Paper II) PYQ

Solution

By Handshaking Theorem, sum of degrees of all vertices in an undirected graph is equal to twice the number of edges.

So,

$\sum deg(v)=2|E|$

This is always even. Hence, Statement II is true.

Also, in any undirected graph, the number of vertices having odd degree is always even.

Hence, Statement I is also true.

Therefore, both statements are true.

UGC NET Computer Science PYQ
Suppose you are married and you and your partner attend a party with three other married couples. Several handshakes took place. No one shook hands with himself or herself or with their partner, and no one shook hands with the same person more than once. After all handshaking was completed, suppose you asked each person, including your partner, how many hands they had shaken. Each person gave a different answer. How many hands did your spouse shake?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

There are $4$ married couples, so total persons are $8$.

You asked $7$ persons, and all gave different answers.

Maximum possible handshakes by one person are $6$ because a person cannot shake hands with himself or herself and cannot shake hands with spouse.

So the $7$ different answers must be:

$0,1,2,3,4,5,6$

Now, the person who shook $6$ hands must be paired with the person who shook $0$ hands.

Similarly,

$5$ is paired with $1$

$4$ is paired with $2$

The only remaining number is $3$.

So your spouse shook $3$ hands.

Final Answer: $ \boxed{(c)} $


UGC NET Computer Science PYQ
Let m and n be positive integers.
(A) If n ≠ 1, then m < mn.
(B) If k is composite, then k = mn where 1 < m, n > k.
(C) If mn = 1, then m = 1 and n = 1.
(D) If k is composite, then k = mn where 1 < m, n < k.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ

Solution

(B) is false (for composite k, both factors are < k). (A), (C), (D) are true for positive integers.

UGC NET Computer Science PYQ
Choose the correct statement for a group G:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science 26 June 2025 (Paper II) PYQ

Solution

Reason: From (xy)² = xyxy = x²y² = xxyy. Left-multiply by x⁻¹ and right-multiply by y⁻¹ to get yx = xy, hence G is abelian. (2) and (3) are false (there exist non-abelian groups where every element has order 3 or 5, e.g., unitriangular 3×3 matrices over ℤ₃/ℤ₅). (4) is false because every subgroup of an abelian (commutative) group is abelian.

UGC NET Computer Science PYQ
Consider the Graph below: 

How many spanning trees can be found? 





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

The given graph has $4$ vertices.

Let the vertices be:

$A, B, C, D$

Edges are:

$AB, BC, AD, BD, CD$

So, total edges are $5$.

This graph is like complete graph $K_4$ with one edge missing.

Number of spanning trees in $K_4$ is given by Cayley’s formula:

$4^{4-2}=4^2=16$

In $K_4$, each edge appears in equal number of spanning trees.

Total edge appearances in all spanning trees:

$16 \times 3 = 48$

Because each spanning tree of $4$ vertices has $3$ edges.

Since $K_4$ has $6$ edges, each edge appears in:

$\frac{48}{6}=8$

Now, one edge is missing in the given graph.

So, spanning trees containing that missing edge are removed.

Number of spanning trees:

$16-8=8$


UGC NET Computer Science PYQ

Consider the following statements:

P: There exists no simple, undirected and connected graph with $80$ vertices and $77$ edges.

Q: All vertices of Euler graph are of even degree.

R: Every simple, undirected, connected and acyclic graph with $50$ vertices has at least two vertices of degree one.

S: There exits a bipartite graph with more than ten vertices which are $2$-colorable.

What is the number of correct statements among the above statements?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

Statement P:

For a connected graph with $n$ vertices, minimum number of edges must be:

$n-1$

Here,

$n=80$

Minimum edges required:

$80-1=79$

But given edges are only $77$.

So, such a connected graph cannot exist.

Therefore, P is true.

Statement Q:

In an Euler graph, every vertex must have even degree.

So, Q is true.

Statement R:

A simple, undirected, connected and acyclic graph is a tree.

Every tree with more than one vertex has at least two vertices of degree $1$.

Here, vertices are $50$.

So, R is true.

Statement S:

Every bipartite graph is $2$-colorable.

A bipartite graph with more than ten vertices can exist.

So, S is true.

Therefore, all four statements are correct.

Number of correct statements:

$4$


UGC NET Computer Science PYQ

Consider the following statements:

P: There exists no simple, undirected and connected graph with $80$ vertices and $77$ edges.

Q: All vertices of Euler graph are of even degree.

R: Every simple, undirected, connected and acyclic graph with $50$ vertices has at least two vertices of degree one.

S: There exits a bipartite graph with more than ten vertices which are $2$-colorable.

What is the number of correct statements among the above statements?






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

Statement P:

For a connected graph with $n$ vertices, minimum number of edges must be:

$n-1$

Here,

$n=80$

Minimum edges required:

$80-1=79$

But given edges are only $77$.

So, such a connected graph cannot exist.

Therefore, P is true.

Statement Q:

In an Euler graph, every vertex must have even degree.

So, Q is true.

Statement R:

A simple, undirected, connected and acyclic graph is a tree.

Every tree with more than one vertex has at least two vertices of degree $1$.

Here, vertices are $50$.

So, R is true.

Statement S:

Every bipartite graph is $2$-colorable.

A bipartite graph with more than ten vertices can exist.

So, S is true.

Therefore, all four statements are correct.

Number of correct statements:

$4$


UGC NET Computer Science PYQ

Circuit satisfiability problem: Given a Boolean combinatorial circuit composed of AND, OR, and NOT gates, is it satisfiable? A one-output Boolean combinatorial circuit is satisfiable means for the given inputs the output will be $1$.

  1. The circuit satisfiability problem belongs to class NP
  2. The circuit satisfiability problem is at least as hard as any language in NP
  3. The circuit satisfiability is NP-Complete
  4. The size of the circuit is $\theta(K^2+1)$
  5. If $P \ne NP$, this situation would contradict the NP-Completeness of the problem.

Choose the correct answer from the options given below:






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

Statement $1$:

Circuit satisfiability belongs to NP because if an input assignment is given, we can verify in polynomial time whether the circuit output is $1$.

So, statement $1$ is true.

Statement $2$:

Circuit satisfiability is at least as hard as any problem in NP.

So, it is NP-hard.

Therefore, statement $2$ is true.

Statement $3$:

A problem is NP-Complete if it is both in NP and NP-hard.

Circuit satisfiability is a standard NP-Complete problem.

So, statement $3$ is true.

Statement $4$:

The size $\theta(K^2+1)$ is not a general property of the circuit satisfiability problem.

So, statement $4$ is false.

Statement $5$:

This statement is not a basic defining property needed here for Circuit SAT classification.

So, statement $5$ is not selected.

Therefore, correct statements are:

$1,2,3$


UGC NET Computer Science PYQ
The number of positive integers not exceeding $100$ that are either odd or the square of an integer is _____





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

Positive odd integers not exceeding $100$ are:

$1,3,5,\ldots,99$

Number of odd integers $=50$

Perfect squares not exceeding $100$ are:

$1^2,2^2,3^2,\ldots,10^2$

Number of perfect squares $=10$

Odd perfect squares are:

$1^2,3^2,5^2,7^2,9^2$

Number of odd perfect squares $=5$

Required number:

$50+10-5=55$

UGC NET Computer Science PYQ
Match List I with List II
 LIST I LIST II 
 A Δ B (A - B) ∪ (A - C)
 A - (B ∪ C) (A - B) ∩ (A - C)
 A - (B ∩ C) (A - B) ∪ (B - A)
 A ∩ (B - C) (A ∩ B) - (A ∩ C)
Choose the correct answer from the options given below: 





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

• A Δ B:
○ This represents the symmetric difference between sets A and B. It includes all those elements which are in A and B but not in their intersection. Mathematically, it can be represented as (A - B) ∪ (B - A). So, A matches with III.

• A - (B ∪ C):
○ This represents all elements in A not in (B or C). Another way to represent it would be (A - B) ∩ (A - C) because it is the intersection of elements that are only in A and not in B or C. So, B matches with II.

• A - (B ∩ C):
○ This represents all elements in A that are not common to both B and C, or equivalently, the elements just in A and not in the intersection of B and C. So, C matches with I.

• A ∩ (B - C):
○ This represents the intersection of A and the elements in B not in C. It is equivalent to (A ∩ B) - (A ∩ C) because you're taking all elements in both A and B, then removing any elements that are also in C. So, D matches with IV.

Therefore, the correct option is A - III, B - II, C - I, D - IV. So, the correct option is 1).

UGC NET Computer Science PYQ
How many ways are there to pack six copies of the same book into four identical boxes, where a box contains six books?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

Books are identical and boxes are also identical.

So, we need to find the number of partitions of $6$ into at most $4$ parts.

Possible distributions are:

$6$

$5+1$

$4+2$

$4+1+1$

$3+3$

$3+2+1$

$3+1+1+1$

$2+2+2$

$2+2+1+1$

Total ways $=9$

UGC NET Computer Science PYQ
Which of the following pairs of propositions are not logically equivalent?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

Check option (a):

$(p\to r)\land(q\to r)$

$=(\neg p\lor r)\land(\neg q\lor r)$

$=(\neg p\land\neg q)\lor r$

$=\neg(p\lor q)\lor r$

$=(p\lor q)\to r$

So, option (a) is logically equivalent.

Option (b) is also equivalent because if $p$ and $q$ have same truth value, then $\neg p$ and $\neg q$ also have same truth value.

Option (c) is the standard form of biconditional:

$p\leftrightarrow q\equiv(p\land q)\lor(\neg p\land\neg q)$

So, option (c) is logically equivalent.

Now check option (d):

$((p\land q)\to r)=\neg(p\land q)\lor r=\neg p\lor\neg q\lor r$

But,

$(p\to r)\land(q\to r)=(\neg p\lor r)\land(\neg q\lor r)$

Both are not always same.

UGC NET Computer Science PYQ
Let R = {x : x ∈ N, x is multiple of 3 and x ≤ 100} and S = {x : x ∈ N, x is multiple of 5 and x < 100}. What is the number of elements in (R ∩ S) × (S ∩ R)?





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

Solution: $R=\{x:x\in N,\ x\text{ is multiple of }3,\ x\le 100\}$ $S=\{x:x\in N,\ x\text{ is multiple of }5,\ x<100\}$ $R\cap S$ contains numbers which are multiples of both $3$ and $5$. So, $R\cap S$ contains multiples of $15$. Multiples of $15$ less than $100$ are: $15,30,45,60,75,90$ So, $|R\cap S|=6$ Also, $S\cap R=R\cap S$ Therefore, $|(R\cap S)\times(S\cap R)|=6\times6=36$ So, the correct answer is $36$.

UGC NET Computer Science PYQ
Match the List-I and List-II
 List-I

List-II 

 a. Planar Graph
I. Probabilistic Model
 
 b. Bipartite Graph
 II. Deterministic Model
 c. PERT
 III. 4-Colorable
 d. CPM

 IV. 2-Colorable
Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

Planar Graph:

According to the four color theorem, every planar graph is $4$-colorable.

So,

a → III

Bipartite Graph:

A bipartite graph can be colored using $2$ colors.

So,

b → IV

PERT:

PERT is used when activity time is uncertain. Hence, it is a probabilistic model.

So,

c → I

CPM:

CPM is used when activity time is fixed and known. Hence, it is a deterministic model.

So,

d → II

Correct matching:

a-III; b-IV; c-I; d-II


UGC NET Computer Science PYQ
Find the sum of all four digit numbers formed using the digits 1, 2, 4 and 6.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

Digits are 1, 2, 4 and 6.

Sum of digits:

1 + 2 + 4 + 6 = 13

Total four digit numbers formed using all four digits:

4! = 24

Each digit appears 6 times at each place.

So, required sum:

6 × 13 × 1111 = 86658


UGC NET Computer Science PYQ
Let N denote the set of all natural numbers and R be the relation on N X N defined by (a, b) R(c, d), if ad(b + c) = bc(a + d). Then R is





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

$ad(b+c)=bc(a+d)$


Dividing both sides by $abcd$,


$\frac{b+c}{bc}=\frac{a+d}{ad}$


$\frac{1}{b}+\frac{1}{c}=\frac{1}{a}+\frac{1}{d}$


Rearranging,


$\frac{1}{a}-\frac{1}{b}=\frac{1}{c}-\frac{1}{d}$


So, relation R is based on equality of the same expression.


Therefore, R is reflexive, symmetric and transitive.


UGC NET Computer Science PYQ

Consider the statements:

I. There does not exist a polynomial time algorithm to solve integer linear programming problems.
II. Main focus of PERT is 'minimizing time'.

Choose the correct option about statements I and II.






Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Dec 2022 Shift II (Paper II) PYQ

Solution

Statement I:

Integer Linear Programming is a hard problem because variables are restricted to integer values.

General Integer Linear Programming is considered NP-hard.

So, it is not solved by a general polynomial time algorithm.

Therefore, statement I is true.

Statement II:

PERT stands for Program Evaluation and Review Technique.

PERT is mainly used for project scheduling when activity times are uncertain.

Its main focus is time estimation and completing the project in minimum possible time.

Therefore, statement II is true.

So,

I is True and II is True.


UGC NET Computer Science PYQ
Let $G = \frac{R}{{0}}$ and $H = {-1, 1}$ be groups under the multiplication. Then, the map $\phi : G \to H$ defined by $\phi(x) = \frac{x}{|x|}$ is





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

$\phi(x) = \frac{x}{|x|}$ gives the sign of $x$.

If $x > 0$, then $\phi(x) = 1$

If $x < 0$, then $\phi(x) = -1$

Also,

$\phi(xy) = \phi(x)\phi(y)$

So, it is a homomorphism.

It is onto because both $1$ and $-1$ are obtained.

It is not one-one because many positive numbers map to $1$, and many negative numbers map to $-1$.

UGC NET Computer Science PYQ
Let G be a directed graph whose vertex set is the set of numbers from 1 to 100. There is an edge from a vertex i to a vertex j if and only if either j = i + 1 or j = 3i. The minimum number of edges in a path in G from vertex 1 to vertex 100 is _____





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science Nov 2020 (Paper II) PYQ

Solution

We need shortest path from 1 to 100 using operations:

$i \to i+1$ or $i \to 3i$

A shortest path is:

$1 \to 3 \to 9 \to 10 \to 11 \to 33 \to 99 \to 100$

Number of edges $=7$

UGC NET Computer Science PYQ
Consider the following statements.

A. The identity is unique in any monoid.

B. A monoid is a group if there exists inverse of each element of monoid.

C. Semi group has closure, associative and identity properties.

D. Quasi group has closure property.

Choose the correct answer from the options given below:





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2023 (Paper II) PYQ

Solution

A is correct because identity element is always unique in a monoid.

B is correct because a monoid becomes a group if every element has an inverse.

C is incorrect because a semigroup has closure and associative property, but identity is not necessary.

D is correct because a quasigroup has closure property.

UGC NET Computer Science PYQ
The language of the following PDA would be: $\delta(q_0,a,z_0)=(q_0,aaaz_0)$ $\delta(q_0,a,a)=(q_0,aaa)$ $\delta(q_0,b,a)=(q_1,\lambda)$ $\delta(q_1,b,a)=(q_1,\lambda)$ $\delta(q_1,\epsilon,z_0)=(q_f,z_0)$ where $q_f$ is a final state.





Go to Discussion

UGC NET Computer Science UGC NET PYQ UGC NET Computer Science UGC NET Computer Science June 2024 (Paper II) PYQ

Solution

Each time an a is read:


$a \rightarrow$ push 3 a's onto the stack.


Each b pops one a from the stack.


Thus:


1 input a produces 3 stack symbols, so we need 3 b's to remove them.


Therefore the relation is:


$b = 3a$


Language:


${a^n b^{3n} \mid n>0}$



UGC NET Computer Science


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

UGC NET Computer Science


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Limited Seats
× Aspire MCA Promotion

Game Changer NIMCET Test Series 2026

Boost your preparation with mock tests, analysis and rank-focused practice.

JOIN NOW
Ask Your Question or Put Your Review.

loading...