









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Qualification Pearson BTEC Level 5 Higher National Diploma in Computing Unit number and title Unit 18: Discrete Maths Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Student ID Class Assessor name Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Grading grid P1 P2 P3 P4 M1 M2 D1 D
❒ Summative Feedback: ❒ Resubmission Feedback: Grade: Assessor Signature: Date: Internal Verifier’s Comments: Signature & Date:
2. Suppose and Determine Substituting the values a and b into the equations:
We can use the principle of inclusion an exclusion :
We also know that :
3. At a local market, there are customers. Suppose have purchased fruits, have purchased vegetables, have purchased bakery items, have purchased both fruits and vegetables, have purchased both vegetables and bakery items, have purchased both fruits and bakery items, and have purchased all three categories. How many customers have not purchased anything? Let's identify the following sets of customers: A represents the fruits that they bought, B represents the veggies that they bought, C represents the baked goods that they bought, and D as the set of all clientsSubstituting the values a and b into the article we get :
vegetables, and bread goods accordingly.
We use the principle of inclusion-exclusion:
There are 219 consumers that bought at least one sort of item. So, the number of consumers that did not buy anything is:
Therefore, 157 consumers have not bought anything. II. Part II
1. List the bag of prime factors for each of the provided numbers. a) b) a) 132 Assume bags of 132 is A 132 = 2. 2. 3. 11
b) 240 Assume bags of 240 is B 240 = 2. 2. 2. 2. 3. 5
2. Find the cardinalities of a) each of the aforementioned bags. Cardinaties of bag :
Knuth's explication gives a full grasp of binary trees, highlighting their rooted structure, the restriction of two children per node, and the difference between left and right children. These ideas constitute the groundwork for creating and optimizing algorithms and data structures related to binary trees in computer science and software engineering applications.
2. Common types of binary trees ALV trees Quantitative Analysis: AVL trees, as self-balancing binary search trees, boast a height constraint of O(log n), where 'n' denotes the node count. Critical operations such as insertion, deletion, and search exhibit time complexities of O(log n) even in the most unfavorable scenarios. Qualitative Examination: The brainchild of Adelson-Velsky and Landis, AVL trees uphold a crucial principle: the height difference between the left and right subtrees of each node, termed the balancing factor, must not exceed 1. Their intricate structure enables AVL trees to perpetually balance themselves through rotational adjustments, ensuring optimal performance during dynamic data modifications. Widely adopted in environments necessitating rapid insertions and deletions without compromising tree balance, AVL trees stand as a testament to computational elegance. In contrast to simpler binary search trees like the conventional BST, AVL trees present a sophisticated framework, incorporating elaborate balancing procedures to maintain structural integrity. Red-Black Trees: Quantitative Analysis: Red-Black trees, akin to AVL trees, maintain a height of O(log n) where n denotes the number of nodes. Operations such as insertion, deletion, and search also exhibit O(log n) time complexity in the worst-case scenario. Qualitative Analysis:
Red-Black trees serve to strike a balance between efficient insertion and deletion operations while maintaining overall tree balance. They find utility in various applications requiring balanced binary search trees, notably in associative array implementations. In contrast to AVL trees, red-black trees impose less stringent balancing criteria, potentially leading to faster insertion and deletion speeds albeit with slightly unbalanced trees. The color-coded approach of red-black trees ensures balance preservation, guaranteeing that no path from the root to any leaf exceeds twice the length of any other path. IV. Part II. Stick in mind that represents the largest digits in your ID.
1. State Dijkstra’s Algorithm in an undirected graph. 1.1. Definition Edsger Dijkstra, the renowned computer scientist, devised a method known as Dijkstra's algorithm, which efficiently determines the shortest path between nodes within a network. When applied to an undirected network, where edges between nodes lack directionality, the algorithm treats the distance between any two nodes as consistent regardless of traversal direction (Cormen et al., 1990). 1.2. Solution Algorithm Initialization: Begin by assigning an initial distance value to each node. Set the distance of the starting node to 0 and the distances of all other nodes to infinity. Designate the starting node as the current node. Evaluation Phase: Evaluate all neighboring nodes of the current node. Calculate their tentative distances based on the current node. Compare the newly computed tentative distance with the existing assigned distance and update to the smaller value. Mark the current node as visited. Selection of the Next Node:
C. Conclusion
In conclusion, the interplay between set theory, functions, and graph theory forms a foundational framework that is indispensable in software engineering and related fields. Set theory provides the basis for understanding collections of objects and their relationships, while functions offer a means to model transformations between sets. Graph theory, on the other hand, enables the depiction and analysis of connections and relationships through graphs and trees. The application of network theory, including algorithms like Dijkstra's Algorithm and concepts like Eulerian and Hamiltonian circuits, facilitates the understanding of network connectivity and optimization in software engineering. Moreover, the Five Color Theorem highlights the significance of efficient coloring strategies in map representation, which has implications for various computational tasks. The integration of set theory, functions, and graph theory offers invaluable insights for solving complex problems in software engineering. By leveraging algebraic set operations, function inverses, binary tree modeling, and algorithmic analysis, software engineers can develop efficient algorithms and solutions to optimize performance and address optimization challenges. Understanding these mathematical structures is pivotal for tackling intricate issues in software engineering and beyond. It not only enhances problem-solving abilities but also fosters innovation and creativity in developing robust and scalable software solutions. In essence, the synergy between mathematical principles and software engineering practices paves the way for advancements and breakthroughs in technology and beyond. D. References