0% found this document useful (0 votes)
20 views6 pages

C6-DMA-19-Assignment by Hlaoli

This document outlines an assignment for the Discrete Mathematics module, including instructions for submission and assessment details. It consists of multiple questions covering topics such as graph theory, probability, binary trees, and formal languages. The assignment is due on April 25, 2025, and is worth a total of 100 marks.

Uploaded by

satsorantsoaki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views6 pages

C6-DMA-19-Assignment by Hlaoli

This document outlines an assignment for the Discrete Mathematics module, including instructions for submission and assessment details. It consists of multiple questions covering topics such as graph theory, probability, binary trees, and formal languages. The assignment is due on April 25, 2025, and is worth a total of 100 marks.

Uploaded by

satsorantsoaki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Faculty Faculty of Engineering & Technology

Assignment Paper Code


Assessment Name

Discrete Mathematics
Module Name Module Code C6-DMA-19
& Applications

Jan-Jun 2025 Hard Copy


Semester Submission Mode

Total Marks 5 Days


100 Duration

Assessment Type Written Submission Date 25/04/2025

Instructions
Eff Date: 09-08-2023

1. Write your answers in black or blue ink. Use pencil for drawing diagrams.
2. Answers should be written clearly following the order in the question paper.
3. All group members Student ID’s must be written on the answer sheet. Failure to do so will mean
that your work cannot be marked.
4. Answer ALL questions and read questions carefully.
5. For All true and false questions provide a justification for your response.
6. Answers should be clear and readable.
7. No Late Submissions allowed.
QP-ASR-001|Rev 001

8. Calculators and Phones are not allowed.

Page 1 of 6
Question 1 [20 marks]

Define the following terms:

1. Directed Graph

2. Leaf Node

3. Rooted Tree

4. Joint Probability

5. Discrete Random Variable

6. Subgraph

7. Closed Walk

8. Weighted Graph
Eff Date: 09-08-2023

9. Sample Space

10. Height of Node

11. Forest

12. Free Tree

13. Isomorphic Graph

14. Travelling Salesman Problem

15. Minimum Spanning Tree


QP-ASR-001|Rev 001

16. Finite Sate Machine

17. Deterministic Finite Automaton

18. Language

19. Grammar

20. Transition Function

Page 2 of 6
Question 2 [10 marks]

Determine the following from the graph below:

a. Adjacency matrix (3)


b. Adjacency list (2)
c. Incidence Matrix (3)
d. The number of edges needed to make a complete graph (2)
Eff Date: 09-08-2023

Question 3 [15 marks]

a. Suppose 36% of families own a dog, 30% of families own a cat, and 22% of the families that have a
dog also have a cat. A family is chosen at random and found to have a cat. What is the probability
they also own a dog? (5)

b. Suppose 30% of the women in a class received an A on the test and 25% of the men received an A.
The class is 60% women. Given that a person chosen at random received an A, what is the
probability this person is a man? (5)
QP-ASR-001|Rev 001

c. A bag contains 3 red balls, 5 blue balls, and 2 green balls. If one ball is drawn at random, calculate
the following:

i. The probability of drawing a blue or green ball. (2)

ii. If a red ball is drawn and not replaced, what is the probability of drawing another red ball? (3)

Page 3 of 6
Question 4 [10 marks]
Eff Date: 09-08-2023

Given the Binary tree above perform the following operations

a. In-order traversal. (2)


b. Pre-order traversal. (2)
c. Post-order traversal. (2)
d. Explain how Pre-order was achieved. (1)
e. Explain how Post-order was achieved. (1)
f. Explain how to search for an element in a binary search tree. (2)

Question 5 [15 marks]


QP-ASR-001|Rev 001

Consider the graphs given below:

a. Solve the Travelling Salesman Problem using Brute Force (Graph A). (5)
b. Solve the Travelling Salesman Problem using Nearest Neighbor and state the steps (Graph B). (5)
c. Implement Dijkstra’s algorithm to find the Shortest Path from A to D (Graph B). (3)
d. Use Prim’s algorithm to find the weight of the minimum spanning tree (Graph A). (2)

Page 4 of 6
GRAPH A GRAPH B

Question 6 [20 marks]

a. Determine whether the string/word ‘cbabbaa’ belongs to the language generated by the grammar
Eff Date: 09-08-2023

G = (Σ, T, S, P), where Σ = {a, b, c, A, B, C, S}, T = {a, b, c}, S is the starting symbol, and the production
rules are:
S → AB
A → Ca
B → Ba
B → Cb
B→b
C → cb
C → b. (4)

b. Briefly explain and Illustrate Chomsky’s Hierarchy. (4)

c. Let Σ = {x, y} and let L = {w ∈ Σ* | the third-from-last character of w is y}. Design an NFA for L. (5)
QP-ASR-001|Rev 001

d. Let Σ = {a, b} and let L = {baa}. Design a DFA for L. And draw the transition table.
(7)

Question 7 [10 marks]

a. What is the domain and range of the function g(n) = 3n2 – 2, for n = 0, 1, 2, 3? (4)

b. Let , what is the domain and range of this function br ? (4)

c. Find a7 for the recursive function generated from a sequence: 6, 15, 28, 45, … (2)

Page 5 of 6
QP-ASR-001|Rev 001 Eff Date: 09-08-2023

Page 6 of 6

You might also like