JnU B.Sc. in CSE — 3rd Year 1st Semester, Mid Term 1 (14th Batch, Solved)
Created ৯ আগ, ২০২৬
Four questions, 2.5 marks each — modular arithmetic, linear congruences, and queueing theory (M/M/1, M/M/∞).
Question 1 — Modular Arithmetic in Z14
Construct a table for a=1 to 13 in Z14, compute gcd(a,14), and identify all invertible elements. Then find their inverses.
Concept Needed
An element a∈Zn is called invertible (a unit) if there exists b∈Zn such that
Definition of an invertible element
a⋅b≡1(modn)
Key Rule
a is invertible in Znif and only ifgcd(a,n)=1.
If gcd(a,n)=1⇒a has an inverse.
If gcd(a,n)=1⇒a has no inverse.
Here n=14=2×7. So any a that shares a factor of 2 or 7 with 14 will not be invertible.
Step 1: Build the GCD Table
GCD table and invertible elements in Z14
a
gcd(a,14)
Invertible?
Inverse (a−1)
1
1
Yes
1
2
2
No
—
3
1
Yes
5
4
2
No
—
5
1
Yes
3
6
2
No
—
7
7
No
—
8
2
No
—
9
1
Yes
11
10
2
No
—
11
1
Yes
9
12
2
No
—
13
1
Yes
13
Step 2: List of Invertible Elements
From the table, the invertible elements (units) of Z14 are:
U(14)={1,3,5,9,11,13}
Check with Euler's totient function:
ϕ(14)=ϕ(2)×ϕ(7)=1×6=6
This matches — we found exactly 6 invertible elements. This is a good way to verify your answer in the exam.
Step 3: Find Each Inverse (Sample Working)
We find b such that a⋅b≡1(mod14), by trying small values.
a=1: 1×1=1≡1⇒1−1=1
a=3: 3×5=15≡1⇒3−1=5
a=5: 5×3=15≡1⇒5−1=3
a=9: 9×11=99=7(14)+1≡1⇒9−1=11
a=11: 11×9=99≡1⇒11−1=9
a=13: 13×13=169=12(14)+1≡1⇒13−1=13 — note that 13≡−1(mod14), and (−1)×(−1)=1, so it is its own inverse, a useful shortcut.
Final Answer
Invertible elements: {1,3,5,9,11,13}
Inverses: 1−1=1,3−1=5,5−1=3,9−1=11,11−1=9,13−1=13
Exam Tip
Always compute gcd using the Euclidean algorithm if numbers are large; for small n like 14, factor-checking is faster.
Common Mistake
Students often forget that gcd(a,n)=1 is a two-way condition (invertible ⇔ gcd =1), not just one way. Also easy to forget: reduce the product modulo n when checking a×b≡1.
Quick Revision Point
If n is prime, every nonzero element of Zn is invertible (since Zn becomes a field).
Question 2 — Linear Congruence
Solve: 8x+6≡4(mod15)
Formula / Rule
Unique solution of a linear congruence
For ax≡b(modn) with gcd(a,n)=1, the solution is unique modulo n and is given by
x≡a−1b(modn)
Step 1: Simplify the Congruence
8x+6≡4(mod15)
8x≡4−6(mod15)
8x≡−2(mod15)
Since −2≡13(mod15):
8x≡13(mod15)
Step 2: Check that a Unique Solution Exists
gcd(8,15)=1
Since the gcd is 1, a unique solution modulo 15 exists.
Step 3: Find the Inverse of 8 modulo 15
Try small multiples of 8:
8×2=16≡1(mod15)
So,
8−1≡2(mod15)
Step 4: Multiply Both Sides by the Inverse
x≡2×13(mod15)
x≡26(mod15)
x≡11(mod15)
Verification
Substitute x=11 back into the original congruence:
8(11)+6=88+6=94
94=6×15+4⇒94≡4(mod15)
This matches the right-hand side, so the answer is verified correct.
Final Answer
x≡11(mod15)
Exam Tip
Always move the constant term to the other side first, exactly like in normal algebra, before finding the inverse.
Common Mistake
Writing −2 as −2(mod15) instead of converting it to the smallest positive residue (13). Also: trying to "divide" by 8 directly — division is not defined in modular arithmetic, you must multiply by the inverse instead.
Quick Revision Point
ax≡b(modn) has a solution iffd=gcd(a,n) divides b. If it does, there are exactly d solutions modulo n.
Question 3 — Queueing Theory: M/M/1 System with Service Level Requirement
A service center receives customers according to a Poisson process with mean interarrival time of 5 minutes. The service time is exponentially distributed. Management requires that:
P(number of customers in system>3)<0.1
Find the maximum allowable mean service time.
Compute the expected waiting time in the queue.
Concept Needed: The M/M/1 Queue
Arrivals follow a Poisson process with rate λ.
Service times are exponentially distributed with rate μ.
One single server, unlimited queue capacity (M/M/1 model).
Traffic intensity: ρ=λ/μ, and the system is stable only if ρ<1.
1
Arrivals (λ)
Poisson process, rate λ
2
Queue
Unlimited capacity, FIFO
3
Server (μ)
Single server, exponential service
4
Departures
Customer leaves the system
Key formula (M/M/1) — probability of more than n customers
P(N>n)=ρn+1
Given
Mean interarrival time =5 minutes ⇒λ=51=0.2 customers/min
Requirement: P(N>3)<0.1
Part (i): Setting Up the Inequality
Using P(N>n)=ρn+1 with n=3:
P(N>3)=ρ4<0.1
Part (ii): Maximum Allowable Mean Service Time
Step 1: Solve for maximum ρ
ρ4<0.1
ρ<(0.1)1/4
ρ<0.5623(taking 4 decimal places)
Step 2: Solve for minimum μ
ρ=μλ⇒μ>ρmaxλ=0.56230.2
μ>0.3557 customers/min
Step 3: Convert to Mean Service Time
Mean service time =μ1. Since μ must be greater than0.3557, the mean service time must be less than:
μ1<0.35571≈2.812 minutes
Final Answer — Part (ii)
Maximum allowable mean service time ≈2.81 minutes (equivalently μmin≈0.3557 customers/min).
Part (iii): Expected Waiting Time in Queue
M/M/1 waiting time in queue
Wq=μ(μ−λ)λ=μ−λρ
Using the boundary (maximum allowed) values from Part (ii), μ=0.3557 per min and λ=0.2 per min:
Step 1: Compute μ−λ
μ−λ=0.3557−0.2=0.1557
Step 2: Substitute into the formula
Wq=0.3557×0.15570.2=0.05540.2
Wq≈3.61 minutes
Final Answer — Part (iii)
Expected waiting time in queue Wq≈3.61 minutes (at the boundary service rate found in Part (ii)).
Exam Tip
Always convert interarrival time to a rate (λ=1/mean interarrival time) before applying formulas.
Common Mistake
Using P(N≥n) formula instead of P(N>n) — remember P(N>n)=ρn+1, while P(N≥n)=ρn. Also forgetting units — keep everything in the same time unit (minutes here) throughout the problem.
Verification Tip
Always check ρ<1 for a stable queue; here ρ≈0.5623<1, so the system is stable.
Quick Revision Point
For M/M/1: L=μ−λλ, Lq=μ(μ−λ)λ2, W=μ−λ1, Wq=μ(μ−λ)λ.
Question 4 — Queueing Theory: M/M/∞ System
A system has infinite servers (M/M/∞). Customers arrive at rate 6 per hour, and service rate per server is 3 per hour. Find the probability that there are more than 4 customers in the system.
Concept Needed: The M/M/∞ Model
Every arriving customer gets its own server immediately — there is no queue and no waiting.
Arrivals: Poisson with rate λ. Each server: exponential service with rate μ.
The number of customers in the system, N, follows a Poisson distribution with mean a=λ/μ.
In M/M/∞, always remember N is simply Poisson with mean a=λ/μ — no need for the M/M/1 traffic intensity formula here.
Common Mistake
Confusing M/M/∞ with M/M/1; in M/M/∞ there is never a queue, since a server is always free. Also, forgetting to subtract from 1 — the question asks P(N>4), not P(N≤4).
Quick Revision Point
For M/M/∞: L=a=λ/μ, W=1/μ (no waiting, since service starts immediately), and Wq=0 always.