Board paper

Discrete Structure 2022 Board Question Paper

ITM 153 · Discrete Structure

Programme
BITM / BIM
Academic year
Semester 2
Exam year
2022 AD
Sitting
regular
Full marks
60
Duration
180 minutes

Tribhuvan University

Faculty of Management

Office of the Dean

2022 AD / Regular Examination

Course: ITM 153 · Discrete Structure

Level: Bachelor of Information Technology Management (BITM / BIM) (BITM / BIM) · Semester 2

Full Marks: 60

Time: 3 hrs.

Time: 3 hrs | Full Marks: 60 | Pass Marks: 30

Subjective Questions

  1. Brief Answer Questions: a. List any two examples of propositions. b. State Absorption law. c. Represent “not all politicians are bad” using quantifier. d. Mention the two ways to represent relation. e. Define ceiling function. For what values of x, ceiling(x) = -1. f. Define complete bipartite graph with example. g. Define pairwise relative prime with example. h. In how many ways letters of word DISCRETE can be arranged without repetition of characters? i. Differentiate between Euler path and Hamilton path. j. State Pigeon hole principle.

    [10]
    View model solution

    Step-by-Step Solutions: Brief Answer Questions

    a. Two Examples of Propositions:

    1. “Kathmandu is the capital city of Nepal.” (True proposition)
    2. 2+5=122 + 5 = 12 (False proposition)

    b. State Absorption Law:

    In Boolean algebra and propositional logic:

    p(pq)pandp(pq)pp \lor (p \land q) \equiv p \quad \text{and} \quad p \land (p \lor q) \equiv p

    c. Quantifier Representation: “Not all politicians are bad”

    Let P(x)P(x) be “xx is a politician” and B(x)B(x) be “xx is bad”:

    ¬x(P(x)B(x))x(P(x)¬B(x))\mathbf{\neg \forall x (P(x) \to B(x)) \quad \equiv \quad \exists x (P(x) \land \neg B(x))}

    d. Two Ways to Represent a Relation:

    1. Matrix Representation (Boolean / 0-1 Matrix MRM_R)
    2. Directed Graph (Digraph) Representation

    e. Ceiling Function Definition & Value for x=1\lceil x \rceil = -1:

    • The ceiling function x\lceil x \rceil assigns to real number xx the smallest integer greater than or equal to xx.
    • x=1    2<x1\lceil x \rceil = -1 \iff \mathbf{-2 < x \le -1}.

    f. Complete Bipartite Graph (Km,nK_{m,n}):

    A simple graph whose vertices can be partitioned into two disjoint subsets V1V_1 (size mm) and V2V_2 (size nn) such that every vertex in V1V_1 is connected by an edge to every vertex in V2V_2, and no edges connect vertices within the same partition.

    g. Pairwise Relatively Prime:

    A set of integers {a1,a2,,ak}\{a_1, a_2, \dots, a_k\} is pairwise relatively prime if gcd(ai,aj)=1\gcd(a_i, a_j) = 1 for all iji \neq j.

    • Example: The set {10,17,21}\{10, 17, 21\} is pairwise relatively prime since gcd(10,17)=1\gcd(10, 17) = 1, gcd(17,21)=1\gcd(17, 21) = 1, and gcd(10,21)=1\gcd(10, 21) = 1.

    h. Arrangements of the Word “DISCRETE”:

    The word has 8 letters: D, I, S, C, R, E, T, E (E occurs twice).

    Total Permutations=8!2!=40,3202=20,160 arrangements\text{Total Permutations} = \frac{8!}{2!} = \frac{40,320}{2} = \mathbf{20,160 \text{ arrangements}}

    i. Euler Path vs. Hamilton Path:

    • Euler Path: A path in a graph that visits every edge exactly once.
    • Hamilton Path: A path in a graph that visits every vertex exactly once.

    j. Pigeonhole Principle:

    If kk is a positive integer and k+1k + 1 or more objects are placed into kk boxes, then at least one box must contain two or more objects.

  2. Define proposition and predicate. Find the inverse and converse of the following implications. a. if you send me an email message then I will finish writing the program. b. if Aldo is Italian then Bob is not English.

    [5]
    View model solution

    Proposition, Predicate, Inverse, and Converse

    • Proposition: A declarative statement that is either definitively true or false, but not both.
    • Predicate: A statement containing variables that becomes a proposition when values are assigned to those variables (e.g., P(x):x>3P(x): x > 3).

    Given Implication: pqp \to q

    • Converse: qpq \to p
    • Inverse: ¬p¬q\neg p \to \neg q

    a. “If you send me an email message (pp), then I will finish writing the program (qq).”

    • Converse: “If I finish writing the program, then you sent me an email message.”
    • Inverse: “If you do not send me an email message, then I will not finish writing the program.”

    b. “If Aldo is Italian (pp), then Bob is not English (qq).”

    • Converse: “If Bob is not English, then Aldo is Italian.”
    • Inverse: “If Aldo is not Italian, then Bob is English.”
  3. What is recurrence relation? Find the first 5 terms of recurrence relation aₙ = 2aₙ₋₁ + 3aₙ₋₂ where a₀ = 1 and a₁ = 3.

    [5]
    View model solution

    Recurrence Relation: First 5 Terms

    A recurrence relation is an equation that recursively defines a sequence where each term is expressed as a function of preceding terms.

    Given:

    an=2an1+3an2with a0=1,a1=3a_n = 2a_{n-1} + 3a_{n-2} \quad \text{with } a_0 = 1, \quad a_1 = 3

    • a0=1a_0 = \mathbf{1}
    • a1=3a_1 = \mathbf{3}
    • a2=2a1+3a0=2(3)+3(1)=6+3=9a_2 = 2a_1 + 3a_0 = 2(3) + 3(1) = 6 + 3 = \mathbf{9}
    • a3=2a2+3a1=2(9)+3(3)=18+9=27a_3 = 2a_2 + 3a_1 = 2(9) + 3(3) = 18 + 9 = \mathbf{27}
    • a4=2a3+3a2=2(27)+3(9)=54+27=81a_4 = 2a_3 + 3a_2 = 2(27) + 3(9) = 54 + 27 = \mathbf{81}

    The first 5 terms are: 1, 3, 9, 27, 81 (Notice the closed form is an=3na_n = 3^n).

  4. Let (a, b) ∈ R over a set of positive integers such that |a - b| is even. Show that R is equivalence relation.

    [5]
    View model solution

    Proof: Equivalence Relation for ab|a - b| is Even

    Let R={(a,b)Z+×Z+:ab is even}R = \{(a, b) \in \mathbb{Z}^+ \times \mathbb{Z}^+ : |a - b| \text{ is even}\}.

    1. Reflexive: For any aZ+a \in \mathbb{Z}^+, aa=0=2(0)|a - a| = 0 = 2(0), which is an even integer. Thus, (a,a)R(a, a) \in R.
    2. Symmetric: Assume (a,b)R    ab=2k(a, b) \in R \implies |a - b| = 2k for some integer kk. Since ba=(ab)=ab=2k|b - a| = |-(a - b)| = |a - b| = 2k, ba|b - a| is also even. Hence, (b,a)R(b, a) \in R.
    3. Transitive: Assume (a,b)R(a, b) \in R and (b,c)R    ab=2k1(b, c) \in R \implies a - b = 2k_1 and bc=2k2b - c = 2k_2. Adding both equations:
      (ab)+(bc)=ac=2k1+2k2=2(k1+k2)(a - b) + (b - c) = a - c = 2k_1 + 2k_2 = 2(k_1 + k_2)
      Thus, ac|a - c| is even, meaning (a,c)R(a, c) \in R.

    Since RR is reflexive, symmetric, and transitive, RR is an equivalence relation.

  5. What is sorting? Sort the following data using bubble sort 30, 20, 11, 45, 10.

    [5]
    View model solution

    Bubble Sort Algorithm & Trace for: [30, 20, 11, 45, 10]

    Sorting is the algorithmic process of arranging an arbitrary collection of data elements into a specified order (ascending or descending).

    Step-by-Step Trace:

    • Initial Array: [30, 20, 11, 45, 10]
    • Pass 1:
      • Compare (30, 20) \to Swap: [20, 30, 11, 45, 10]
      • Compare (30, 11) \to Swap: [20, 11, 30, 45, 10]
      • Compare (30, 45) \to No Swap: [20, 11, 30, 45, 10]
      • Compare (45, 10) \to Swap: [20, 11, 30, 10, 45]
    • Pass 2:
      • Compare (20, 11) \to Swap: [11, 20, 30, 10, 45]
      • Compare (20, 30) \to No Swap: [11, 20, 30, 10, 45]
      • Compare (30, 10) \to Swap: [11, 20, 10, 30, 45]
    • Pass 3:
      • Compare (11, 20) \to No Swap: [11, 20, 10, 30, 45]
      • Compare (20, 10) \to Swap: [11, 10, 20, 30, 45]
    • Pass 4:
      • Compare (11, 10) \to Swap: [10, 11, 20, 30, 45]

    Final Sorted Array: [10, 11, 20, 30, 45]

  6. State Binomial theorem and binomial coefficients. Find the coefficient of x²y³ in the (x + y)⁵.

    [5]
    View model solution

    Binomial Theorem & Coefficient Calculation

    The Binomial Theorem states that for any non-negative integer nn:

    (x+y)n=k=0n(nk)xnkyk(x + y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k} y^k
    where (nk)=n!k!(nk)!\binom{n}{k} = \frac{n!}{k!(n-k)!} are the binomial coefficients.

    Coefficient of x2y3x^2 y^3 in (x+y)5(x + y)^5:

    Here n=5n = 5. We need the term where xx has power 2 and yy has power 3:

    Term=(53)x53y3=(53)x2y3\text{Term} = \binom{5}{3} x^{5-3} y^3 = \binom{5}{3} x^2 y^3
    (53)=5!3!(53)!=5×4×3!3!×2×1=202=10\binom{5}{3} = \frac{5!}{3!(5-3)!} = \frac{5 \times 4 \times 3!}{3! \times 2 \times 1} = \frac{20}{2} = \mathbf{10}
    The coefficient of x2y3x^2 y^3 is 10.

  7. Why do we need to know the growth of a function? Show that 3x² + 8x + 7 is big Oh of x².

    [5]
    View model solution

    Growth of Functions & Big-O Proof

    Analyzing the growth of functions allows computer scientists to characterize the scalability and resource efficiency of algorithms independent of machine hardware and compiler optimizations.

    Proof: f(x)=3x2+8x+7f(x) = 3x^2 + 8x + 7 is O(x2)O(x^2)

    By definition, f(x)f(x) is O(g(x))O(g(x)) if there exist positive constants CC and kk such that:

    f(x)Cg(x)for all x>k|f(x)| \le C |g(x)| \quad \text{for all } x > k

    For all x1x \ge 1:

    8x8x2and77x28x \le 8x^2 \quad \text{and} \quad 7 \le 7x^2
    Therefore:
    3x2+8x+73x2+8x2+7x2=18x23x^2 + 8x + 7 \le 3x^2 + 8x^2 + 7x^2 = 18x^2
    Choosing witnesses C=18C = 18 and k=1k = 1:
    3x2+8x+718x2x1|3x^2 + 8x + 7| \le 18 |x^2| \quad \forall x \ge 1
    Hence, 3x2+8x+7=O(x2)3x^2 + 8x + 7 = \mathbf{O(x^2)}. \blacksquare

  8. Define degree of a vertex. List the necessary invariants for isomorphic graphs.

    [5]
    View model solution

    Degree of a Vertex & Graph Invariants for Isomorphism

    • Degree of a Vertex deg(v)\deg(v): The number of edges incident with vertex vv, with self-loops counted twice.

    Necessary Invariants for Graph Isomorphism:

    Two graphs G1=(V1,E1)G_1 = (V_1, E_1) and G2=(V2,E2)G_2 = (V_2, E_2) can be isomorphic only if they preserve:

    1. Equal number of vertices (V1=V2|V_1| = |V_2|)
    2. Equal number of edges (E1=E2|E_1| = |E_2|)
    3. Identical degree sequence (multiset of vertex degrees)
    4. Preservation of subgraphs and cycles of specific length kk
    5. Equal connected components and chromatic numbers
  9. Discuss adjacency matrix and incidence matrix representation of graph with suitable example.

    [5]
    View model solution

    Adjacency Matrix vs. Incidence Matrix Representation

    Let a simple undirected graph have vertices V={v1,v2,v3}V = \{v_1, v_2, v_3\} and edges e1=(v1,v2),e2=(v2,v3)e_1 = (v_1, v_2), e_2 = (v_2, v_3):

    1. Adjacency Matrix A=[aij]A = [a_{ij}] (Size n×nn \times n):

    aij=1a_{ij} = 1 if an edge connects viv_i and vjv_j; otherwise 00:

    A=(010101010)A = \begin{pmatrix} 0 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}

    2. Incidence Matrix M=[mij]M = [m_{ij}] (Size n×mn \times m):

    mij=1m_{ij} = 1 if vertex viv_i is incident with edge eje_j; otherwise 00:

    M=(101101)M = \begin{pmatrix} 1 & 0 \\ 1 & 1 \\ 0 & 1 \end{pmatrix}

  10. Using mathematical induction prove that n³ + 2n is divisible by 3?

    [5]
    View model solution

    Mathematical Induction Proof: n3+2nn^3 + 2n is Divisible by 3

    Let P(n)P(n) be the proposition that n3+2nn^3 + 2n is divisible by 3 for all integers n1n \ge 1.

    1. Base Step (n=1n = 1):
      P(1):13+2(1)=1+2=3P(1): 1^3 + 2(1) = 1 + 2 = 3
      Since 3 is divisible by 3, P(1)P(1) is true.
    2. Inductive Hypothesis: Assume P(k)P(k) is true for some integer k1k \ge 1, so k3+2k=3mk^3 + 2k = 3m for some integer mm.
    3. Inductive Step (n=k+1n = k + 1):
      (k+1)3+2(k+1)=(k3+3k2+3k+1)+(2k+2)(k + 1)^3 + 2(k + 1) = (k^3 + 3k^2 + 3k + 1) + (2k + 2)
      =(k3+2k)+3k2+3k+3=3m+3(k2+k+1)=3(m+k2+k+1)= (k^3 + 2k) + 3k^2 + 3k + 3 = 3m + 3(k^2 + k + 1) = 3(m + k^2 + k + 1)
      Since (m+k2+k+1)(m + k^2 + k + 1) is an integer, (k+1)3+2(k+1)(k + 1)^3 + 2(k + 1) is divisible by 3.

    Therefore, by mathematical induction, n3+2nn^3 + 2n is divisible by 3 for all n1n \ge 1. \blacksquare

  11. Using indirect proof, prove that if n² is odd then n is also odd.

    [5]
    View model solution

    Indirect Proof: If n2n^2 is Odd, Then nn is Odd

    We prove the claim via proof by contraposition. The implication is PQP \to Q, where P:n2 is oddP: n^2 \text{ is odd} and Q:n is oddQ: n \text{ is odd}. The contrapositive is ¬Q¬P\neg Q \to \neg P: “If nn is even, then n2n^2 is even.”

    1. Assume nn is an even integer.
    2. By definition of an even integer, n=2kn = 2k for some integer kk.
    3. Squaring both sides:
      n2=(2k)2=4k2=2(2k2)n^2 = (2k)^2 = 4k^2 = 2(2k^2)
    4. Since 2k22k^2 is an integer (let m=2k2m = 2k^2), we have n2=2mn^2 = 2m, which is the definition of an even integer.

    Since the contrapositive ¬Q¬P\neg Q \to \neg P is true, the original statement PQP \to Q is logically equivalent and true. \blacksquare

  12. How many lowercase words are there of three characters, that can either start with “a” or end with “c”.

    [5]
    View model solution

    3-Character Lowercase Words Starting with ‘a’ or Ending with ‘c’

    The English alphabet has 26 lowercase characters. Total 3-letter words = 26326^3.

    1. Words starting with ‘a’: Form a _ _
      A=1×26×26=262=676|A| = 1 \times 26 \times 26 = 26^2 = 676
    2. Words ending with ‘c’: Form _ _ c
      B=26×26×1=262=676|B| = 26 \times 26 \times 1 = 26^2 = 676
    3. Words both starting with ‘a’ and ending with ‘c’: Form a _ c
      AB=1×26×1=26|A \cap B| = 1 \times 26 \times 1 = 26

    Using the Principle of Inclusion-Exclusion:

    AB=A+BAB=676+67626=1,326 words|A \cup B| = |A| + |B| - |A \cap B| = 676 + 676 - 26 = \mathbf{1,326 \text{ words}}

  13. What is Pascal’s triangle? Find the expansion of (2-x)⁶ using Pascal’s triangle.

    [5]
    View model solution

    Pascal’s Triangle & Expansion of (2x)6(2 - x)^6

    Pascal’s triangle row for n=6n = 6:

    1,6,15,20,15,6,1\mathbf{1, \quad 6, \quad 15, \quad 20, \quad 15, \quad 6, \quad 1}

    Using binomial expansion (a+b)6(a + b)^6 where a=2,b=xa = 2, b = -x:

    (2x)6=1(2)6+6(2)5(x)+15(2)4(x)2+20(2)3(x)3+15(2)2(x)4+6(2)(x)5+1(x)6(2 - x)^6 = 1(2)^6 + 6(2)^5(-x) + 15(2)^4(-x)^2 + 20(2)^3(-x)^3 + 15(2)^2(-x)^4 + 6(2)(-x)^5 + 1(-x)^6
    =646(32)x+15(16)x220(8)x3+15(4)x412x5+x6= 64 - 6(32)x + 15(16)x^2 - 20(8)x^3 + 15(4)x^4 - 12x^5 + x^6
    =64192x+240x2160x3+60x412x5+x6\mathbf{= 64 - 192x + 240x^2 - 160x^3 + 60x^4 - 12x^5 + x^6}

  14. Define expression tree with example.

    [5]
    View model solution

    Definition of Expression Tree with Example

    An expression tree is a binary tree representation of an algebraic, arithmetic, or logical expression where:

    • Leaf nodes correspond to operands (constants or variables, e.g., a,b,5a, b, 5).
    • Internal nodes correspond to operators (e.g., +,,×,/+ , -, \times, /).
             +
            / \
           *   c
          / \
         a   b
    

    In-order traversal yields the infix expression (a×b)+c(a \times b) + c.

  15. Show that (p ∧ q) →(p ∧q) is a tautology using truth table.

    [5]
    View model solution

    Truth Table Proof of Tautology: (pq)(pq)(p \land q) \to (p \land q)$\begin{array}{|c|c|c|c|}

    \hline p & q & p \land q & (p \land q) \to (p \land q) \ \hline T & T & T & \mathbf{T} \ T & F & F & \mathbf{T} \ F & T & F & \mathbf{T} \ F & F & F & \mathbf{T} \ \hline \end{array}$$

    Since the final truth column evaluates to True (TT) under every truth assignment, (pq)(pq)(p \land q) \to (p \land q) is a tautology.

  16. State and verify handshaking theorem.

    [5]
    View model solution

    Handshaking Theorem Statement & Verification

    Theorem: In any undirected graph G=(V,E)G = (V, E):

    vVdeg(v)=2E\sum_{v \in V} \deg(v) = 2 |E|

    • Proof/Explanation: Every edge e=(u,v)e = (u, v) has two endpoints. When calculating the sum of degrees across all vertices, each edge is counted twice—once at vertex uu and once at vertex vv. Therefore, the sum of all degrees is exactly twice the total number of edges.
    • Corollary: The sum of degrees in any graph is always an even integer, which implies that every undirected graph must have an even number of vertices of odd degree.
  17. Given a function f(x) = x² over a set of integers, find whether it is onto or one to one with reason.

    [5]
    View model solution

    Analysis of f(x)=x2f(x) = x^2 Over the Set of Integers (ZZ\mathbb{Z} \to \mathbb{Z})

    1. One-to-One (Injective):
      • A function is injective if f(a)=f(b)    a=bf(a) = f(b) \implies a = b.
      • Counterexample: For a=2a = 2 and b=2b = -2:
        f(2)=22=4andf(2)=(2)2=4f(2) = 2^2 = 4 \quad \text{and} \quad f(-2) = (-2)^2 = 4
        Since f(2)=f(2)f(2) = f(-2) but 222 \neq -2, f(x)f(x) is not one-to-one.
    2. Onto (Surjective):
      • A function is surjective if for every yZy \in \mathbb{Z}, there exists xZx \in \mathbb{Z} such that f(x)=yf(x) = y.
      • Counterexample: Consider y=3Zy = -3 \in \mathbb{Z}. There is no real integer xx such that x2=3x^2 = -3.
      • Therefore, f(x)f(x) is not onto.