Updated: Mar 2026
First Chapter - 100% FREE

GATE CS Chapter Practice

Practice GATE CS questions chapter-wise. 1000+ practice questions across 60 topics with detailed solutions. First chapter FREE!

1000+
Questions
60
Chapters
~34h
Total Time
72%
Avg Score
Start Free Test →

Question Type Distribution

407
MCQ
Single Choice
193
MSQ
Multiple Select
400
NAT
Numerical

All Chapters

Combinatorics

FREE

Engineering Mathematics

36
Questions
72m
Est. Time
Start Free

Graph Theory

Engineering Mathematics

27
Questions
54m
Est. Time
Unlock

Propositional and First-Order Logic

Engineering Mathematics

23
Questions
46m
Est. Time
Unlock

Algebraic Structures

Engineering Mathematics

15
Questions
30m
Est. Time
Unlock

Set Theory, Relations, and Functions

Engineering Mathematics

19
Questions
38m
Est. Time
Unlock

LU Decomposition

Engineering Mathematics

10
Questions
20m
Est. Time
Unlock

Matrices and Determinants

Engineering Mathematics

21
Questions
42m
Est. Time
Unlock

System of Linear Equations

Engineering Mathematics

13
Questions
26m
Est. Time
Unlock

Eigenvalues and Eigenvectors

Engineering Mathematics

10
Questions
20m
Est. Time
Unlock

Limits, Continuity, and Differentiability

Engineering Mathematics

12
Questions
24m
Est. Time
Unlock

Integration

Engineering Mathematics

4
Questions
8m
Est. Time
Unlock

Applications of Differentiation

Engineering Mathematics

5
Questions
10m
Est. Time
Unlock

Boolean Algebra and Minimization

Digital Logic

25
Questions
50m
Est. Time
Unlock

Sequential Circuits

Digital Logic

17
Questions
34m
Est. Time
Unlock

Combinational Circuits

Digital Logic

12
Questions
24m
Est. Time
Unlock

Computer Arithmetic

Digital Logic

5
Questions
10m
Est. Time
Unlock

Number Representations

Digital Logic

31
Questions
62m
Est. Time
Unlock

CPU Components

Computer Organization and Architecture

11
Questions
22m
Est. Time
Unlock

Instruction Set Architecture (ISA)

Computer Organization and Architecture

25
Questions
50m
Est. Time
Unlock

Memory Hierarchy

Computer Organization and Architecture

33
Questions
66m
Est. Time
Unlock

Combinatorics - Practice

Free sample questions from Engineering Mathematics

100% FREE
1 Numerical
Let ana_n be the number of ways to distribute nn identical candies to three distinct children, Child 1, Child 2, and Child 3, subject to the following conditions: 1. Child 1 receives an even number of candies (possibly zero). 2. Child 2 receives at least one candy. 3. Child 3 receives at most two candies. The value of a5a_5 is _________.
Correct Answer: 7
View Solution
**Step 1: Formulate the generating function.** Let c1,c2,c3c_1, c_2, c_3 be the number of candies received by Child 1, Child 2, and Child 3, respectively. We are looking for the number of integer solutions to c1+c2+c3=nc_1 + c_2 + c_3 = n subject to the given conditions. The generating function for the number of candies for Child 1 (even number) is:
G1(x)=1+x2+x4+=11x2G_1(x) = 1 + x^2 + x^4 + \dots = \frac{1}{1-x^2}
The generating function for the number of candies for Child 2 (at least one) is:
G2(x)=x+x2+x3+=x1xG_2(x) = x + x^2 + x^3 + \dots = \frac{x}{1-x}
The generating function for the number of candies for Child 3 (at most two) is:
G3(x)=1+x+x2G_3(x) = 1 + x + x^2
The combined generating function G(x)G(x) for ana_n is the product of these individual generating functions:
G(x)=G1(x)G2(x)G3(x)=11x2x1x(1+x+x2)G(x) = G_1(x) \cdot G_2(x) \cdot G_3(x) = \frac{1}{1-x^2} \cdot \frac{x}{1-x} \cdot (1+x+x^2)
**Step 2: Simplify the generating function.** We can rewrite 1x21-x^2 as (1x)(1+x)(1-x)(1+x).
G(x)=1(1x)(1+x)x1x(1+x+x2)G(x) = \frac{1}{(1-x)(1+x)} \cdot \frac{x}{1-x} \cdot (1+x+x^2)
G(x)=x(1+x+x2)(1x)2(1+x)G(x) = \frac{x(1+x+x^2)}{(1-x)^2(1+x)}
We need to find a5a_5, which is the coefficient of x5x^5 in G(x)G(x), i.e., [x5]G(x)[x^5]G(x).
[x5]G(x)=[x5]x(1+x+x2)(1x)2(1+x)[x^5]G(x) = [x^5] \frac{x(1+x+x^2)}{(1-x)^2(1+x)}
[x5]G(x)=[x4]1+x+x2(1x)2(1+x)[x^5]G(x) = [x^4] \frac{1+x+x^2}{(1-x)^2(1+x)}
Let F(x)=1+x+x2(1x)2(1+x)F(x) = \frac{1+x+x^2}{(1-x)^2(1+x)}. We will use partial fraction decomposition for F(x)F(x). **Step 3: Perform partial fraction decomposition.** Let
F(x)=A1x+B(1x)2+C1+xF(x) = \frac{A}{1-x} + \frac{B}{(1-x)^2} + \frac{C}{1+x}
Multiplying by (1x)2(1+x)(1-x)^2(1+x), we get:
1+x+x2=A(1x)(1+x)+B(1+x)+C(1x)21+x+x^2 = A(1-x)(1+x) + B(1+x) + C(1-x)^2
1+x+x2=A(1x2)+B(1+x)+C(12x+x2)1+x+x^2 = A(1-x^2) + B(1+x) + C(1-2x+x^2)
To find BB, set x=1x=1:
1+1+1=A(0)+B(1+1)+C(0)1+1+1 = A(0) + B(1+1) + C(0)
3=2B3 = 2B
B=32B = \frac{3}{2}
To find CC, set x=1x=-1:
11+1=A(0)+B(0)+C(1(1))21-1+1 = A(0) + B(0) + C(1-(-1))^2
1=C(22)1 = C(2^2)
1=4C1 = 4C
C=14C = \frac{1}{4}
To find AA, equate coefficients of x2x^2:
1=A+C1 = -A + C
1=A+141 = -A + \frac{1}{4}
A=141=34A = \frac{1}{4} - 1 = -\frac{3}{4}
So,
F(x)=3411x+321(1x)2+1411+xF(x) = -\frac{3}{4} \frac{1}{1-x} + \frac{3}{2} \frac{1}{(1-x)^2} + \frac{1}{4} \frac{1}{1+x}
**Step 4: Extract the coefficient of x4x^4.** We use the following standard series expansions:
11x=n=0xn\frac{1}{1-x} = \sum_{n=0}^{\infty} x^n
1(1x)2=n=0(n+1)xn\frac{1}{(1-x)^2} = \sum_{n=0}^{\infty} (n+1)x^n
(using generalized binomial theorem (n+k1k1)\binom{n+k-1}{k-1} with k=2k=2)
11+x=n=0(1)nxn\frac{1}{1+x} = \sum_{n=0}^{\infty} (-1)^n x^n
Now, we find [x4]F(x)[x^4]F(x):
[x4]F(x)=34[x4]11x+32[x4]1(1x)2+14[x4]11+x[x^4]F(x) = -\frac{3}{4} [x^4]\frac{1}{1-x} + \frac{3}{2} [x^4]\frac{1}{(1-x)^2} + \frac{1}{4} [x^4]\frac{1}{1+x}
[x4]F(x)=34(1)+32(4+1)+14(1)4[x^4]F(x) = -\frac{3}{4} (1) + \frac{3}{2} (4+1) + \frac{1}{4} (-1)^4
[x4]F(x)=34+32(5)+14(1)[x^4]F(x) = -\frac{3}{4} + \frac{3}{2} (5) + \frac{1}{4} (1)
[x4]F(x)=34+152+14[x^4]F(x) = -\frac{3}{4} + \frac{15}{2} + \frac{1}{4}
[x4]F(x)=3+30+14[x^4]F(x) = \frac{-3 + 30 + 1}{4}
[x4]F(x)=284=7[x^4]F(x) = \frac{28}{4} = 7
Thus, a5=7a_5 = 7. Answer: 7\boxed{7}
2 Numerical
Consider the recurrence relation an=5an18an2+4an3a_n = 5a_{n-1} - 8a_{n-2} + 4a_{n-3} for n3n \ge 3. Given initial conditions a0=1a_0 = 1, a1=3a_1 = 3, and a2=9a_2 = 9. The value of a5a_5 is _________.
Correct Answer: 161
View Solution
**Step 1: Formulate the characteristic equation.** The given linear homogeneous recurrence relation with constant coefficients is
an=5an18an2+4an3a_n = 5a_{n-1} - 8a_{n-2} + 4a_{n-3}
To find the characteristic equation, we assume a solution of the form an=rna_n = r^n. Substituting this into the recurrence relation yields:
rn=5rn18rn2+4rn3r^n = 5r^{n-1} - 8r^{n-2} + 4r^{n-3}
Dividing by rn3r^{n-3} (since r0r \neq 0), we get:
r3=5r28r+4r^3 = 5r^2 - 8r + 4
Rearranging, the characteristic equation is:
r35r2+8r4=0r^3 - 5r^2 + 8r - 4 = 0
**Step 2: Find the roots of the characteristic equation.** We can test for integer roots by checking divisors of the constant term (4), i.e., ±1\pm 1, ±2\pm 2, ±4\pm 4. For r=1r=1:
135(1)2+8(1)4=15+84=01^3 - 5(1)^2 + 8(1) - 4 = 1 - 5 + 8 - 4 = 0
So, r=1r=1 is a root. This implies (r1)(r-1) is a factor of the characteristic polynomial. We can perform polynomial division or synthetic division to find the remaining factors. Using synthetic division with r=1r=1: ```text 1 | 1 -5 8 -4 | 1 -4 4 ---------------- 1 -4 4 0 ``` The resulting quadratic equation is
r24r+4=0r^2 - 4r + 4 = 0
This quadratic equation is a perfect square:
(r2)2=0(r-2)^2 = 0
So, the roots of the characteristic equation are r1=1r_1=1 (with multiplicity 1) and r2=2r_2=2 (with multiplicity 2). **Step 3: Write the general solution.** For a distinct root r1r_1, the term in the general solution is α1r1n\alpha_1 r_1^n. For a root r2r_2 with multiplicity mm, the term is (α2+α3n++αmnm1)r2n(\alpha_2 + \alpha_3 n + \dots + \alpha_m n^{m-1}) r_2^n. In this case, with r1=1r_1=1 (multiplicity 1) and r2=2r_2=2 (multiplicity 2), the general solution is:
an=α1(1)n+(α2+α3n)2na_n = \alpha_1 (1)^n + (\alpha_2 + \alpha_3 n) 2^n
an=α1+(α2+α3n)2na_n = \alpha_1 + (\alpha_2 + \alpha_3 n) 2^n
**Step 4: Use the initial conditions to determine the constants α1,α2,α3\alpha_1, \alpha_2, \alpha_3.** Given a0=1a_0 = 1, a1=3a_1 = 3, a2=9a_2 = 9. For n=0n=0:
a0=α1+(α2+α30)201=α1+α2(Equation 1)\begin{aligned} a_0 & = \alpha_1 + (\alpha_2 + \alpha_3 \cdot 0) 2^0 \\ 1 & = \alpha_1 + \alpha_2 \quad \text{(Equation 1)} \end{aligned}
For n=1n=1:
a1=α1+(α2+α31)213=α1+2α2+2α3(Equation 2)\begin{aligned} a_1 & = \alpha_1 + (\alpha_2 + \alpha_3 \cdot 1) 2^1 \\ 3 & = \alpha_1 + 2\alpha_2 + 2\alpha_3 \quad \text{(Equation 2)} \end{aligned}
For n=2n=2:
a2=α1+(α2+α32)229=α1+4α2+8α3(Equation 3)\begin{aligned} a_2 & = \alpha_1 + (\alpha_2 + \alpha_3 \cdot 2) 2^2 \\ 9 & = \alpha_1 + 4\alpha_2 + 8\alpha_3 \quad \text{(Equation 3)} \end{aligned}
From Equation 1, α1=1α2\alpha_1 = 1 - \alpha_2. Substitute α1\alpha_1 into Equation 2:
3=(1α2)+2α2+2α33=1+α2+2α32=α2+2α3(Equation 4)\begin{aligned} 3 & = (1 - \alpha_2) + 2\alpha_2 + 2\alpha_3 \\ 3 & = 1 + \alpha_2 + 2\alpha_3 \\ 2 & = \alpha_2 + 2\alpha_3 \quad \text{(Equation 4)} \end{aligned}
Substitute α1\alpha_1 into Equation 3:
9=(1α2)+4α2+8α39=1+3α2+8α38=3α2+8α3(Equation 5)\begin{aligned} 9 & = (1 - \alpha_2) + 4\alpha_2 + 8\alpha_3 \\ 9 & = 1 + 3\alpha_2 + 8\alpha_3 \\ 8 & = 3\alpha_2 + 8\alpha_3 \quad \text{(Equation 5)} \end{aligned}
Now solve the system of equations (Equation 4 and Equation 5) for α2\alpha_2 and α3\alpha_3. From Equation 4, α2=22α3\alpha_2 = 2 - 2\alpha_3. Substitute this into Equation 5:
8=3(22α3)+8α38=66α3+8α38=6+2α32=2α3α3=1\begin{aligned} 8 & = 3(2 - 2\alpha_3) + 8\alpha_3 \\ 8 & = 6 - 6\alpha_3 + 8\alpha_3 \\ 8 & = 6 + 2\alpha_3 \\ 2 & = 2\alpha_3 \\ \alpha_3 & = 1 \end{aligned}
Substitute α3=1\alpha_3 = 1 back into α2=22α3\alpha_2 = 2 - 2\alpha_3:
α2=22(1)=0\alpha_2 = 2 - 2(1) = 0
Substitute α2=0\alpha_2 = 0 back into α1=1α2\alpha_1 = 1 - \alpha_2:
α1=10=1\alpha_1 = 1 - 0 = 1
So the constants are α1=1\alpha_1 = 1, α2=0\alpha_2 = 0, and α3=1\alpha_3 = 1. **Step 5: Write the closed-form solution and calculate a5a_5.** Substitute the constants back into the general solution:
an=1+(0+1n)2na_n = 1 + (0 + 1 \cdot n) 2^n
an=1+n2na_n = 1 + n 2^n
Now, calculate a5a_5 by setting n=5n=5:
a5=1+525a5=1+532a5=1+160a5=161\begin{aligned} a_5 & = 1 + 5 \cdot 2^5 \\ a_5 & = 1 + 5 \cdot 32 \\ a_5 & = 1 + 160 \\ a_5 & = 161 \end{aligned}
The final answer is 161\boxed{161}.
3 Numerical
A sequence {an}\{a_n\} is defined by the recurrence relation an=4an14an2a_n = 4a_{n-1} - 4a_{n-2} for n2n \ge 2. Given the initial conditions a0=1a_0 = 1 and a1=6a_1 = 6, the value of a4a_4 is __________.
Correct Answer: 144
View Solution
**Step 1: Formulate the characteristic equation.** The given recurrence relation is an=4an14an2a_n = 4a_{n-1} - 4a_{n-2}. Rearranging the terms, we get an4an1+4an2=0a_n - 4a_{n-1} + 4a_{n-2} = 0. Assuming a solution of the form an=rna_n = r^n, the characteristic equation is:
r24r+4=0r^2 - 4r + 4 = 0
**Step 2: Find the roots of the characteristic equation.** The characteristic equation can be factored as (r2)2=0(r-2)^2 = 0. This equation has a single root r=2r=2 with multiplicity 2. **Step 3: Write the general solution.** For a linear homogeneous recurrence relation with constant coefficients and a repeated root rr of multiplicity 2, the general solution takes the form:
an=α1rn+α2nrna_n = \alpha_1 r^n + \alpha_2 n r^n
Substituting r=2r=2 into this form:
an=α1(2n)+α2n(2n)a_n = \alpha_1 (2^n) + \alpha_2 n (2^n)
**Step 4: Use initial conditions to find the constants α1\alpha_1 and α2\alpha_2.** Using the initial condition a0=1a_0 = 1:
a0=α1(20)+α2(0)(20)=1a_0 = \alpha_1 (2^0) + \alpha_2 (0) (2^0) = 1
α11+0=1α1=1\alpha_1 \cdot 1 + 0 = 1 \Rightarrow \alpha_1 = 1
Using the initial condition a1=6a_1 = 6:
a1=α1(21)+α2(1)(21)=6a_1 = \alpha_1 (2^1) + \alpha_2 (1) (2^1) = 6
2α1+2α2=62\alpha_1 + 2\alpha_2 = 6
Substitute the value of α1=1\alpha_1 = 1 into this equation:
2(1)+2α2=62(1) + 2\alpha_2 = 6
2+2α2=62 + 2\alpha_2 = 6
2α2=4α2=22\alpha_2 = 4 \Rightarrow \alpha_2 = 2
Thus, the closed-form solution for the recurrence relation is:
an=12n+2n2n=2n+n2n+1a_n = 1 \cdot 2^n + 2 \cdot n \cdot 2^n = 2^n + n \cdot 2^{n+1}
**Step 5: Calculate a4a_4.** Substitute n=4n=4 into the closed-form solution:
a4=24+424+1a_4 = 2^4 + 4 \cdot 2^{4+1}
a4=16+425a_4 = 16 + 4 \cdot 2^5
a4=16+432a_4 = 16 + 4 \cdot 32
a4=16+128a_4 = 16 + 128
a4=144a_4 = 144
**Answer:** \boxed{144}
4 Numerical
A security system requires a password of length 7. The characters available are uppercase English letters from {A,B,C,D,E}\{A, B, C, D, E\} and digits from {0,1,2,3,4,5,6,7,8,9}\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\}. The password must satisfy the following conditions: 1. It must contain exactly 3 distinct uppercase English letters. 2. It must contain exactly 4 distinct digits. 3. No character can be repeated in the password. The total number of distinct passwords that can be formed is __________.
Correct Answer: 10584000
View Solution
**Step 1: Determine the number of available characters for each type.** There are 5 distinct uppercase English letters available: {A,B,C,D,E}\{A, B, C, D, E\}. There are 10 distinct digits available: {0,1,2,3,4,5,6,7,8,9}\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\}. **Step 2: Choose the 3 distinct uppercase English letters.** From the 5 available letters, we need to choose 3. Since the order of selection does not matter at this stage (we will arrange them later), we use combinations:
(53)=5!3!(53)!=5×4×3!3!×2!=5×42×1=10 ways\binom{5}{3} = \frac{5!}{3!(5-3)!} = \frac{5 \times 4 \times 3!}{3! \times 2!} = \frac{5 \times 4}{2 \times 1} = 10 \text{ ways}
**Step 3: Choose the 4 distinct digits.** From the 10 available digits, we need to choose 4. Similar to the letters, the order of selection does not matter here:
(104)=10!4!(104)!=10×9×8×7×6!4×3×2×1×6!=10×3×7=210 ways\binom{10}{4} = \frac{10!}{4!(10-4)!} = \frac{10 \times 9 \times 8 \times 7 \times 6!}{4 \times 3 \times 2 \times 1 \times 6!} = 10 \times 3 \times 7 = 210 \text{ ways}
**Step 4: Arrange the chosen characters.** After choosing 3 distinct letters and 4 distinct digits, we have a total of 3+4=73 + 4 = 7 distinct characters. These 77 distinct characters must be arranged to form a password of length 77. The number of ways to arrange 77 distinct items is given by 7!7! (7 factorial):
7!=7×6×5×4×3×2×1=5040 ways7! = 7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1 = 5040 \text{ ways}
**Step 5: Calculate the total number of distinct passwords.** By the Rule of Product, the total number of distinct passwords is the product of the number of ways to perform each independent step:
Total Passwords=(Ways to choose letters)×(Ways to choose digits)×(Ways to arrange characters)\text{Total Passwords} = (\text{Ways to choose letters}) \times (\text{Ways to choose digits}) \times (\text{Ways to arrange characters})
Total Passwords=(53)×(104)×7!\text{Total Passwords} = \binom{5}{3} \times \binom{10}{4} \times 7!
Total Passwords=10×210×5040\text{Total Passwords} = 10 \times 210 \times 5040
Total Passwords=2100×5040\text{Total Passwords} = 2100 \times 5040
Total Passwords=10,584,000\text{Total Passwords} = 10,584,000
Answer: \boxed{10,584,000}
5 Single Choice
A password of length 6 is to be formed using characters selected from the set of 26 uppercase English letters and the set of 10 digits (0-9). The password must contain exactly 3 distinct uppercase letters and exactly 3 distinct digits. Additionally, no two uppercase letters can be adjacent in the password. How many such distinct passwords can be formed?
A
44,928,000
B
224,640,000
C
7,488,000
D
1,248,000
View Solution
**Step 1: Choose the 3 distinct uppercase letters.** We need to select 3 distinct uppercase letters from the 26 available uppercase English letters. The number of ways to do this is given by the combination formula:
(263)=26!3!(263)!=26×25×243×2×1=26×25×4=2600\binom{26}{3} = \frac{26!}{3!(26-3)!} = \frac{26 \times 25 \times 24}{3 \times 2 \times 1} = 26 \times 25 \times 4 = 2600
**Step 2: Choose the 3 distinct digits.** We need to select 3 distinct digits from the 10 available digits (0-9). The number of ways to do this is:
(103)=10!3!(103)!=10×9×83×2×1=10×3×4=120\binom{10}{3} = \frac{10!}{3!(10-3)!} = \frac{10 \times 9 \times 8}{3 \times 2 \times 1} = 10 \times 3 \times 4 = 120
**Step 3: Arrange the chosen 3 letters and 3 digits such that no two letters are adjacent.** Let the 3 chosen distinct letters be L1,L2,L3L_1, L_2, L_3 and the 3 chosen distinct digits be D1,D2,D3D_1, D_2, D_3. To ensure no two letters are adjacent, we first arrange the digits and then place the letters in the spaces created by the digits. First, arrange the 3 distinct digits. The number of ways to arrange 3 distinct items is 3!3!:
3!=3×2×1=63! = 3 \times 2 \times 1 = 6
When the 3 digits are arranged, they create 4 possible slots where the letters can be placed (before the first digit, between any two digits, and after the last digit). For example, if the digits are arranged as D1D2D3D_1 D_2 D_3, the slots are represented by underscores:
_D1_D2_D3_\_ D_1 \_ D_2 \_ D_3 \_
We need to place the 3 distinct letters into these 4 slots such that each slot gets at most one letter. This is equivalent to choosing 3 of the 4 available slots and then arranging the 3 distinct letters in those chosen slots. The number of ways to do this is given by the permutation formula P(n,k)P(n, k):
P(4,3)=4!(43)!=4×3×2=24P(4,3) = \frac{4!}{(4-3)!} = 4 \times 3 \times 2 = 24
Therefore, the total number of ways to arrange the 6 chosen characters (3 letters and 3 digits) such that no two letters are adjacent is the product of the ways to arrange the digits and the ways to place the letters:
6×24=1446 \times 24 = 144
**Step 4: Calculate the total number of distinct passwords.** Multiply the results from Step 1, Step 2, and Step 3:
Total Passwords=2600×120×144=44,928,000\text{Total Passwords} = 2600 \times 120 \times 144 = 44,928,000
Thus, there are 44,928,000 such distinct passwords that can be formed. Answer: 44,928,000\boxed{44,928,000}
6 Multiple Select
Consider the linear homogeneous recurrence relation an=4an14an2a_n = 4a_{n-1} - 4a_{n-2} for n2n \ge 2, with initial conditions a0=1a_0 = 1 and a1=6a_1 = 6. Which of the following statements is/are true?
A
The characteristic equation of the recurrence relation has two distinct real roots.
B
The closed-form solution for ana_n is an=(1+2n)2na_n = (1+2n)2^n.
C
The value of a3a_3 is 5656.
D
The asymptotic complexity of ana_n is Θ(n2n)\Theta(n 2^n).
View Solution
**Step 1: Find the characteristic equation and its roots.** The given recurrence relation is:
an=4an14an2a_n = 4a_{n-1} - 4a_{n-2}
Assuming a solution of the form:
an=rna_n = r^n
we substitute it into the recurrence relation:
rn=4rn14rn2r^n = 4r^{n-1} - 4r^{n-2}
Dividing by rn2r^{n-2} (since r0r \neq 0), we get the characteristic equation:
r24r+4=0r^2 - 4r + 4 = 0
Factoring the quadratic equation:
(r2)2=0(r-2)^2 = 0
This equation has a single repeated root r1=r2=2r_1 = r_2 = 2. **Step 2: Determine the general solution.** For a linear homogeneous recurrence relation with constant coefficients and a repeated root rr of multiplicity kk, the general solution is of the form:
an=(α1+α2n++αknk1)rna_n = (\alpha_1 + \alpha_2 n + \dots + \alpha_k n^{k-1})r^n
In this case, the root r=2r=2 has a multiplicity of 2. So, the general solution is:
an=(α1+α2n)2na_n = (\alpha_1 + \alpha_2 n)2^n
**Step 3: Use initial conditions to find constants α1\alpha_1 and α2\alpha_2.** Given initial conditions: a0=1a_0 = 1 and a1=6a_1 = 6. For n=0n=0:
a0=(α1+α20)20=α11=α1a_0 = (\alpha_1 + \alpha_2 \cdot 0)2^0 = \alpha_1 \cdot 1 = \alpha_1
Since a0=1a_0 = 1, we have α1=1\alpha_1 = 1. For n=1n=1:
a1=(α1+α21)21=(α1+α2)2a_1 = (\alpha_1 + \alpha_2 \cdot 1)2^1 = (\alpha_1 + \alpha_2)2
Since a1=6a_1 = 6, we have:
6=(α1+α2)26 = (\alpha_1 + \alpha_2)2
Substitute α1=1\alpha_1 = 1:
6=(1+α2)26 = (1 + \alpha_2)2
3=1+α23 = 1 + \alpha_2
α2=2\alpha_2 = 2
**Step 4: Write the closed-form solution and evaluate options.** The closed-form solution is:
an=(1+2n)2na_n = (1+2n)2^n
* **Option 1: The characteristic equation of the recurrence relation has two distinct real roots.** The characteristic equation is (r2)2=0(r-2)^2 = 0, which has a single repeated root r=2r=2. Thus, this statement is **false**. * **Option 2: The closed-form solution for ana_n is an=(1+2n)2na_n = (1+2n)2^n.** As derived in Step 3, this statement is **true**. * **Option 3: The value of a3a_3 is 5656.** Using the closed-form solution an=(1+2n)2na_n = (1+2n)2^n, for n=3n=3:
a3=(1+23)23=(1+6)8=78=56a_3 = (1+2 \cdot 3)2^3 = (1+6) \cdot 8 = 7 \cdot 8 = 56
This statement is **true**. * **Option 4: The asymptotic complexity of ana_n is Θ(n2n)\Theta(n 2^n).** The closed-form solution is:
an=(1+2n)2n=2n+n2n+1a_n = (1+2n)2^n = 2^n + n2^{n+1}
As nn \to \infty, the term n2n+1n2^{n+1} dominates 2n2^n. Therefore, ana_n grows proportionally to n2nn2^n. More formally, an=(1+2n)2na_n = (1+2n)2^n. For n1n \ge 1:
2n(1+2n)2n(2n+2n)2n=4n2n2^n \le (1+2n)2^n \le (2n+2n)2^n = 4n2^n
So, c1n2nanc2n2nc_1 n 2^n \le a_n \le c_2 n 2^n for appropriate constants c1=1/2c_1 = 1/2 (for n1n \ge 1, 1+2nn1+2n \ge n) and c2=4c_2 = 4. Thus:
an=Θ(n2n)a_n = \Theta(n 2^n)
This statement is **true**. The correct statements are Option 2, Option 3, and Option 4. Answer: \boxed{\text{The closed-form solution for } ana_n \text{ is } an=(1+2n)2na_n = (1+2n)2^n, \text{ The value of } a3a_3 \text{ is } 5656, \text{ The asymptotic complexity of } ana_n \text{ is } Θ(n2n)\Theta(n 2^n)}
7 Single Choice
A 4-digit number is to be formed using the digits from the set S={1,2,3,4,5}S = \{1, 2, 3, 4, 5\} without repetition of digits. How many such numbers are there that are divisible by 4?
A
12
B
18
C
24
D
36
View Solution
The solution involves applying the fundamental counting principles combined with a number theory property. **Step 1: Identify the condition for divisibility.** A number is divisible by 44 if and only if the number formed by its last two digits is divisible by 44. **Step 2: Find all possible valid endings for the 4-digit number.** We need to find pairs of distinct digits from the set S={1,2,3,4,5}S = \{1, 2, 3, 4, 5\} that form a two-digit number divisible by 44. Let the 44-digit number be d1d2d3d4d_1 d_2 d_3 d_4. We are looking for the possible values of the number 10d3+d410d_3 + d_4. The valid pairs for the last two digits (d3,d4)(d_3, d_4) are: - 1212 (since 12÷4=312 \div 4 = 3) - 2424 (since 24÷4=624 \div 4 = 6) - 3232 (since 32÷4=832 \div 4 = 8) - 5252 (since 52÷4=1352 \div 4 = 13) There are 44 possible cases for the ending of the number. These cases are mutually exclusive. **Step 3: Calculate the number of ways to form the first two digits for each case.** For any chosen pair of last two digits, two distinct digits from SS are used. Since there are 55 digits in total, 52=35 - 2 = 3 digits remain available for the first two positions (d1,d2d_1, d_2).
52=35 - 2 = 3
- The first digit (d1d_1) can be chosen in any of the 33 remaining ways. - After choosing d1d_1, the second digit (d2d_2) can be chosen in any of the 22 remaining ways. By the Rule of Product, the number of ways to fill the first two positions is 3×2=63 \times 2 = 6. This is constant for each of the 44 valid endings.
3×2=63 \times 2 = 6
**Step 4: Calculate the total count using the Rule of Sum.** We sum the possibilities for each mutually exclusive case. Since the number of ways to form the first part of the number is the same (66) for each of the 44 valid endings, we can multiply. Total number of such integers = (Number of valid endings) ×\times (Number of ways to form the first two digits for each ending)
Total=4×6=24\text{Total} = 4 \times 6 = 24
Thus, there are 2424 such numbers. Answer: 24\boxed{24}
8 Single Choice
There are 7 distinct books: 3 Mathematics books, 2 Physics books, and 2 Chemistry books. These books are to be arranged on a shelf. How many distinct arrangements are possible if all Mathematics books must be kept together, and the two Physics books must not be kept together?
A
360
B
432
C
504
D
720
View Solution
**Step 1: Treat the Mathematics books as a single block.** Since the 3 distinct Mathematics books (M1M_1, M2M_2, M3M_3) must be kept together, we consider them as one unit, let's call it MblockM_{block}. The number of ways to arrange the books within this MblockM_{block} is:
3!=3×2×1=63! = 3 \times 2 \times 1 = 6
**Step 2: Calculate total arrangements where Mathematics books are together, without considering the Physics books constraint.** Now, we are arranging the following 5 distinct entities: 1. The MblockM_{block} 2. Physics book P1P_1 3. Physics book P2P_2 4. Chemistry book C1C_1 5. Chemistry book C2C_2 These 5 distinct entities can be arranged in 5!5! ways.
5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120
Considering the internal arrangements of the Mathematics books, the total arrangements where all Mathematics books are together (and no other constraint) is:
5!×3!=120×6=7205! \times 3! = 120 \times 6 = 720
**Step 3: Calculate arrangements where Mathematics books are together AND Physics books are also together.** If the two distinct Physics books (P1P_1, P2P_2) must also be together, we treat them as a single unit, PblockP_{block}. The number of ways to arrange the books within this PblockP_{block} is:
2!=2×1=22! = 2 \times 1 = 2
Now, we are arranging the following 4 distinct entities: 1. The MblockM_{block} 2. The PblockP_{block} 3. Chemistry book C1C_1 4. Chemistry book C2C_2 These 4 distinct entities can be arranged in 4!4! ways.
4!=4×3×2×1=244! = 4 \times 3 \times 2 \times 1 = 24
Combining this with the internal arrangements of the Mathematics books and Physics books, the total arrangements where Mathematics books are together AND Physics books are together is:
4!×3!×2!=24×6×2=2884! \times 3! \times 2! = 24 \times 6 \times 2 = 288
**Step 4: Apply the complement principle to find arrangements where Mathematics books are together, but Physics books are NOT together.** The number of arrangements where Mathematics books are together, but Physics books are not together, is the total arrangements where Mathematics books are together (from Step 2) minus the arrangements where both Mathematics and Physics books are together (from Step 3).
720288=432720 - 288 = 432
Answer: 432\boxed{432}

Practice Features

📚 Topic-wise

Organized by chapters

⏱️ Timed Mode

Build exam speed

📝 Solutions

Detailed explanations

🔖 Bookmarks

Save for revision

Frequently Asked Questions

How many practice questions are available?

We have 1000+ practice questions across 60 chapters for GATE CS, all with detailed solutions.

Is the first chapter free?

Yes! The first chapter is completely FREE. Practice all questions with solutions to evaluate before upgrading.

What types of questions are included?

Practice includes MCQ (407), MSQ (193), and NAT (400) questions - same as the actual GATE exam format.

How long does it take to complete all chapters?

At ~2 minutes per question, completing all 1000+ questions takes approximately 34 hours of focused practice.

More GATECS Resources

Why Choose MastersUp?

🎯

AI-Powered Plans

Personalized study schedules based on your exam date and learning pace

📚

15,000+ Questions

Verified questions with detailed solutions from past papers

📊

Smart Analytics

Track your progress with subject-wise performance insights

🔖

Bookmark & Revise

Save important questions for quick revision before exams

Start Your Free Preparation →

No credit card required • Free forever for basic features