Download Discrete Mathematics and more Study Guides, Projects, Research Discrete Mathematics in PDF only on Docsity! Higher Nationals Internal verification of assessment decisions - BTEC (RQF) INTERNAL VERIFICATION — ASSESSMENT DECISIONS Programme title IBTEC Higher National Diploma in Computing Assessor Internal Verifier Unit(s) [Unit 18 : Discrete Mathematics Assignment title [Discrete mathematics in software engineering concepts init IS.M Nipuna Madhuranga Samarakoon List which assessment Pass Merit Distinction criteria the Assessor has awarded. INTERNAL VERIFIER CHECKLIST Do the assessment criteria awarded match amending? those shown in the assignment brief? Y/N Ts the Pass/Merit/Distinction grade awarded justified by the assessor’s comments on the YIN student work? Has the work been assessed YIN accurately? Is the feedback to the student: Give details: * Constructive? Y/N * Linked to relevant assessment criteria? YIN * Identifying opportunities for improved performance? YIN * Agreeing actions? Y/N Does the assessment decision need YIN required) Assessor signature Date Internal Verifier signature Date Programme Leader signature(if Date Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathem atics 2 Confirm action completed Remedial action taken Give details: Assessor signature Date Internal Verifier signature Date Programme Leader signature (ifrequired) Date Higher Nationals - Summative Assignment Feedback Form S.M Nipuna Madhuranga Samarakoon ‘BTEC HND Batch 29 Discrete Mathematics General Guidelines vk Yd A Cover page or title page — You should always attach a title page to your assignment. Use previous page as your cover sheet and make sure all the details are accurately filled. Attach this brief as the first section of your assignment. All the assignments should be prepared using a word processing software. All the assignments should be printed on A4 sized papers. Use single side printing. Allow 1” for top, bottom, right margins and 1.25” for the left margin of each page. Word Processing Rules RYeN 5. The font size should be 12 point, and should be in the style of Time New Roman. Use 1.5-line spacing. Left justify all paragraphs. Ensure that all the headings are consistent in terms of the font size and font style. Use footer function in the word processor to insert Your Name, Subject, Assignment No, and Page Number on each page. This is useful if individual sheets become detached for any reason. Use word processing application spell check and grammar check function to help editing your assignment. Important Points: 1. vk Yd Carefully check the hand in date and the instructions given in the assignment. Late submissions will not be accepted. Ensure that you give yourself enough time to complete the assignment by the due date. Excuses of any nature will not be accepted for failure to hand in the work on time. You must take responsibility for managing your own time effectively. If you are unable to hand in your assignment on time and have valid reasons such as illness, you may apply (in writing) for an extension. Failure to achieve at least PASS criteria will result in a REFERRAL grade. Non-submission of work without valid reasons will lead to an automatic RE FERRAL. You will then be asked to complete an alternative assignment. If you use other people’s work or ideas in your assignment, reference them properly using HARVARD referencing system to avoid plagiarism. You have to provide both in-text citation and a reference list. If you are proven to be guilty of plagiarism or any academic misconduct, your grade could be reduced to A REFERRAL or at worst you could be expelled from the course S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: Student Declaration Thereby, declare that I know what plagiarism entails, namely to use another’s work and to present it as my own without attributing the sources in the correct way. I further understand what it means to copy another’s work. I know that plagiarism is a punishable offence because it constitutes theft. 2. Lunderstand the plagiarism and copying policy of the Edexcel UK. 3. I know what the consequences will be if I plagiaries or copy another’s work in any of the assignments for this program. 4. I declare therefore that all work presented by me for every aspect of my program, will be my own, and where I have made use of another’s work, I will attribute the source in the correct way. 5. Iacknowledge that the attachment of this document signed or not, constitutes a binding agreement between myself and Edexcel UK. 6. Iunderstand that my assignment will not be considered as submitted if this document is not attached to the attached. Nipuna2255@ gmail.com Student’s Signature: Date: (Provide E-mail ID) (Provide Submission Date) S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: Assignment Brief Student Name /ID Number S.M Nipuna Madhuranga Samarakoon Unit Number and Title Unit 18: Discrete Mathematics Academic Year Unit Tutor Assignment Title Discrete mathematics in Computing Issue Date Submission Date IV Name & Date Submission Format: This assignment should be submitted at the end of the module, on the week stated at the front of this brief. The assignment can either be word-processed or completed in legible handwriting. If the tasks are completed over multiple pages, ensure that your name and student number are present on each page. Unit Learning Outcomes: S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 10 Part 4 1. Formulate corresponding proof principles to prove the following properties about defined sets. i= =60A=BOSACBand BCA ii. De Morgan’s Law by mathematical induction iii. | Distributive Laws for three non-empty finite sets A, B, and C Activity 02 Part 1 1. Discuss two examples on binary trees both quantitatively and qualitatively. Part 2 1. State the Dijkstra’s algorithm for a directed weighted graph with all non-negative edge weights. 2. Find the shortest path spanning tree for the weighted directed graph with vertices A, B, C, D, and E given using Dijkstra’s algorithm. Part 3 1. Check whether the following graphs have a Eulerian and/or Hamiltonian circuit. L S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 11 IL. Ill. Part 4 1. Construct a proof for the five color theorem for every planar graph. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 12 2. Discuss how efficiently Graph Theory can be used in a route planning project for a vacation trip from Colombo to Trincomalee by considering most of the practical situations (such as mileage of the vehicle, etc.) as much as you can. Essentially consider the two fold, - Routes with the shortest distance (Quick route travelling by own vehicle) - Route with the lowest cost 3. Determine the minimum number of separate racks needed to store the chemicals given in the table (1* column) by considering their incompatibility using graph coloring technique. Clearly state you steps and graphs used. Chemical Incompatible with Ammonia Mercury, chlorine, calcium hypochlorite, (anhydrous) iodine, bromine, hydrofluoric acid (anhydrous) Chlorine Ammonia, acetylene, butadiene, butane, methane, propane , hydrogen, sodium carbide, benzene, finely divided metals, turpentine lodine Acetylene, ammonia (aqueous or anhydrous), hydrogen Silver Acetylene, oxalic acid, tartaric acid, ammonium compounds, pulmonic acid lodine Acetylene, ammonia (aqueous or anhydrous), hydrogen Mercury Acetylene, pulmonic acid, ammonia Fluorine All other chemicals S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 15 Activity 04 Part 1 1. Describe the characteristics of different binary operations that are performed on the same set. 2. Justify whether the given operations on relevant sets are binary operations or not. i. Multiplication and Division on se of Natural numbers ii. Subtraction and Addition on Set of Natural numbers iii. Exponential operation: (x, y) > x” on Set of Natural numbers and set of Integers Part 2 1. Build up the operation tables for group G with orders 1, 2, 3 and 4 using the elements a, b, c, and e as the identity element in an appropriate way. 2. i. State the Lagrange’s theorem of group theory. ii. For a subgroup H of a group G, prove the Lagrange’s theorem. iii. Discuss whether a group H with order 6 can be a subgroup of a group with order 13 or not. Clearly state the reasons. Part 3 1. Check whether the set § =SR—{—]}is a group under the binary operation ‘*’defined as a*b=a+b+ abfor any two elementsa,beE S . 2. i. State the relation between the order of a group and the number of binary operations that can be defined on that set. Il. How many binary operations can be defined on a set with 4 elements? 3. Discuss the group theory concept behind the Rubik’s cube. Part 4 1. Prepare a ten minutes presentation that explains an application of group theory in computer sciences. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: Grading Rubric 16 Grading Criteria Achieved | Feedback LO1 : Examine set theory and functions applicable to software engineering P1 Perform algebraic set operations in a formulated mathematical problem. P2 Determine the cardinality of a given bag (multiset). M1 Determine the inverse of a function using appropriate mathematical technique. D1 Formulate corresponding proof principles to prove properties about defined sets. LO2 Analyse mathematical structures of objects using graph theory. P3 Model contextualized problems using trees, both quantitatively and qualitatively. P4 Use Dijkstra’s algorithm to find a shortest path spanning tree in a graph. M2 Assess whether an Eularian and Hamiltonian circuit exists in an undirected graph. D2 Construct a proof of the Five colour theorem. LO3 Investigate solutions to problem situations using the application of Boolean algebra. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: Higher Nationals Internal verification of assessment decisions - BTEC (RQF) INTERNAL VERIFICATION — ASSESSMENT DECISIONS Programme title IBTEC Higher National Diploma in Computing Assessor Internal Verifier Unit(s) [Unit 18 : Discrete Mathematics Assignment title [Discrete mathematics in software engineering concepts init IS.M Nipuna Madhuranga Samarakoon List which assessment Pass Merit Distinction criteria the Assessor has awarded. INTERNAL VERIFIER CHECKLIST Do the assessment criteria awarded match amending? those shown in the assignment brief? Y/N Ts the Pass/Merit/Distinction grade awarded justified by the assessor’s comments on the YIN student work? Has the work been assessed YIN accurately? Is the feedback to the student: Give details: * Constructive? Y/N * Linked to relevant assessment criteria? YIN * Identifying opportunities for improved performance? YIN * Agreeing actions? Y/N Does the assessment decision need YIN required) Assessor signature Date Internal Verifier signature Date Programme Leader signature(if Date Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathem atics 2 Confirm action completed Remedial action taken Give details: Assessor signature Date Internal Verifier signature Date Programme Leader signature (ifrequired) Date Higher Nationals - Summative Assignment Feedback Form S.M Nipuna Madhuranga Samarakoon ‘BTEC HND Batch 29 Discrete Mathematics General Guidelines vk Yd A Cover page or title page — You should always attach a title page to your assignment. Use previous page as your cover sheet and make sure all the details are accurately filled. Attach this brief as the first section of your assignment. All the assignments should be prepared using a word processing software. All the assignments should be printed on A4 sized papers. Use single side printing. Allow 1” for top, bottom, right margins and 1.25” for the left margin of each page. Word Processing Rules RYeN 5. The font size should be 12 point, and should be in the style of Time New Roman. Use 1.5-line spacing. Left justify all paragraphs. Ensure that all the headings are consistent in terms of the font size and font style. Use footer function in the word processor to insert Your Name, Subject, Assignment No, and Page Number on each page. This is useful if individual sheets become detached for any reason. Use word processing application spell check and grammar check function to help editing your assignment. Important Points: 1. vk Yd Carefully check the hand in date and the instructions given in the assignment. Late submissions will not be accepted. Ensure that you give yourself enough time to complete the assignment by the due date. Excuses of any nature will not be accepted for failure to hand in the work on time. You must take responsibility for managing your own time effectively. If you are unable to hand in your assignment on time and have valid reasons such as illness, you may apply (in writing) for an extension. Failure to achieve at least PASS criteria will result in a REFERRAL grade. Non-submission of work without valid reasons will lead to an automatic RE FERRAL. You will then be asked to complete an alternative assignment. If you use other people’s work or ideas in your assignment, reference them properly using HARVARD referencing system to avoid plagiarism. You have to provide both in-text citation and a reference list. If you are proven to be guilty of plagiarism or any academic misconduct, your grade could be reduced to A REFERRAL or at worst you could be expelled from the course S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: Student Declaration Thereby, declare that I know what plagiarism entails, namely to use another’s work and to present it as my own without attributing the sources in the correct way. I further understand what it means to copy another’s work. I know that plagiarism is a punishable offence because it constitutes theft. 2. Lunderstand the plagiarism and copying policy of the Edexcel UK. 3. I know what the consequences will be if I plagiaries or copy another’s work in any of the assignments for this program. 4. I declare therefore that all work presented by me for every aspect of my program, will be my own, and where I have made use of another’s work, I will attribute the source in the correct way. 5. Iacknowledge that the attachment of this document signed or not, constitutes a binding agreement between myself and Edexcel UK. 6. Iunderstand that my assignment will not be considered as submitted if this document is not attached to the attached. Nipuna2255@ gmail.com Student’s Signature: Date: (Provide E-mail ID) (Provide Submission Date) S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: Assignment Brief Student Name /ID Number S.M Nipuna Madhuranga Samarakoon Unit Number and Title Unit 18: Discrete Mathematics Academic Year Unit Tutor Assignment Title Discrete mathematics in Computing Issue Date Submission Date IV Name & Date Submission Format: This assignment should be submitted at the end of the module, on the week stated at the front of this brief. The assignment can either be word-processed or completed in legible handwriting. If the tasks are completed over multiple pages, ensure that your name and student number are present on each page. Unit Learning Outcomes: S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 10 Part 4 1. Formulate corresponding proof principles to prove the following properties about defined sets. i= =60A=BOSACBand BCA ii. De Morgan’s Law by mathematical induction iii. | Distributive Laws for three non-empty finite sets A, B, and C Activity 02 Part 1 1. Discuss two examples on binary trees both quantitatively and qualitatively. Part 2 1. State the Dijkstra’s algorithm for a directed weighted graph with all non-negative edge weights. 2. Find the shortest path spanning tree for the weighted directed graph with vertices A, B, C, D, and E given using Dijkstra’s algorithm. Part 3 1. Check whether the following graphs have a Eulerian and/or Hamiltonian circuit. L S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 11 IL. Ill. Part 4 1. Construct a proof for the five color theorem for every planar graph. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 12 2. Discuss how efficiently Graph Theory can be used in a route planning project for a vacation trip from Colombo to Trincomalee by considering most of the practical situations (such as mileage of the vehicle, etc.) as much as you can. Essentially consider the two fold, - Routes with the shortest distance (Quick route travelling by own vehicle) - Route with the lowest cost 3. Determine the minimum number of separate racks needed to store the chemicals given in the table (1* column) by considering their incompatibility using graph coloring technique. Clearly state you steps and graphs used. Chemical Incompatible with Ammonia Mercury, chlorine, calcium hypochlorite, (anhydrous) iodine, bromine, hydrofluoric acid (anhydrous) Chlorine Ammonia, acetylene, butadiene, butane, methane, propane , hydrogen, sodium carbide, benzene, finely divided metals, turpentine lodine Acetylene, ammonia (aqueous or anhydrous), hydrogen Silver Acetylene, oxalic acid, tartaric acid, ammonium compounds, pulmonic acid lodine Acetylene, ammonia (aqueous or anhydrous), hydrogen Mercury Acetylene, pulmonic acid, ammonia Fluorine All other chemicals S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 15 Activity 04 Part 1 1. Describe the characteristics of different binary operations that are performed on the same set. 2. Justify whether the given operations on relevant sets are binary operations or not. i. Multiplication and Division on se of Natural numbers ii. Subtraction and Addition on Set of Natural numbers iii. Exponential operation: (x, y) > x” on Set of Natural numbers and set of Integers Part 2 1. Build up the operation tables for group G with orders 1, 2, 3 and 4 using the elements a, b, c, and e as the identity element in an appropriate way. 2. i. State the Lagrange’s theorem of group theory. ii. For a subgroup H of a group G, prove the Lagrange’s theorem. iii. Discuss whether a group H with order 6 can be a subgroup of a group with order 13 or not. Clearly state the reasons. Part 3 1. Check whether the set § =SR—{—]}is a group under the binary operation ‘*’defined as a*b=a+b+ abfor any two elementsa,beE S . 2. i. State the relation between the order of a group and the number of binary operations that can be defined on that set. Il. How many binary operations can be defined on a set with 4 elements? 3. Discuss the group theory concept behind the Rubik’s cube. Part 4 1. Prepare a ten minutes presentation that explains an application of group theory in computer sciences. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: Grading Rubric 16 Grading Criteria Achieved | Feedback LO1 : Examine set theory and functions applicable to software engineering P1 Perform algebraic set operations in a formulated mathematical problem. P2 Determine the cardinality of a given bag (multiset). M1 Determine the inverse of a function using appropriate mathematical technique. D1 Formulate corresponding proof principles to prove properties about defined sets. LO2 Analyse mathematical structures of objects using graph theory. P3 Model contextualized problems using trees, both quantitatively and qualitatively. P4 Use Dijkstra’s algorithm to find a shortest path spanning tree in a graph. M2 Assess whether an Eularian and Hamiltonian circuit exists in an undirected graph. D2 Construct a proof of the Five colour theorem. LO3 Investigate solutions to problem situations using the application of Boolean algebra. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: 17 P5 Diagram a binary problem in the application of Boolean Algebra. P6 Produce a truth table and its corresponding Boolean equation from an applicable scenario. M3 Simplify a Boolean equation using algebraic methods. D3 Design a complex system using logic gates. LO4 Explore applicable concepts within abstract algebra. P7 Describe the distinguishing characteristi operations that are performed on the same set. of different binary P8 Determine the order of a group and the order of a subgroup in given examples. M4 Validate whether a given set with a binary operation is indeed a group. D4 Prepare a presentation that explains an application of group theory relevant to your course of study. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematic: 20 P(A)= 33 P(B)= 36 P(C)= 28 P(AUB UC)=P(A)+ P(B)+ P(C) - CAMB) - P(AAC)-P( BAC) P(A)= 10+ a + 5+b = 33 15+a+b = 33 a+b=18 ——+l1 15+a+5+c¢ = 36 20+ at c =36 a+c=16—>2 13+ 5+b+c = 28 b+c= 28-18 b+c = 10————» 3 a+b=18 —~ 1 b+c= 160 ———» 2 b+c = 16——_>3 1+3 a+b-bc=8 a-c=8 —— >» 4 c=4 P(AUBUC) = 33+ 36+28- 17-11-9 =97-37 S.M Nipuna Madhuranga SamarakoonHND Batch 29 Discrete Mathematics 21 " 8 iS Part 2 4. Write the multisets of prime factors for the given numbers. Iv. 160 Vv. 120 VI. 250 1. 160: - 1,2,4,5,8,10,16,20,32,40,80,160 2. 120: - 1,2,3,4,5,6,8,10,12,15,20,24,30,40,60,120 3. 250: - 1,2,5,10,25,50, 125,250 separately. i. 160 = (2,2, 2, 2, 2, 5} Multiplicity of 2=5 Multiplicity of 5 = 1 ii, 120 = {2,2,2, 2, 3, 5} Multiplicity of 2 = 3 Multiplicity of 3 = 1 Multiplicity of 5 = 5=1 ii, 250={2,5,5,5} Multiplicity of 2 = 2 Multiplicity of 5 = 3 6. Find the cardinalities of each multiset in part 2-1. i. Cardinality of multi set = 5 +1=6 ii. Cardinality of multi set =3+1+1=5 iii. Cardinality of multi set = 2 +3 =5 S.M Nipuna Madhuranga SamarakoonHND Batch 29 Discrete Mathematics 22 Part 3 4. Determine whether the following functions are invertible or not. If it is invertible, then find the rule of the inverse (F-'(x)) i f:R>R* ii, f:R* Rt f@=x f=) iii, f:R7 SR iv. pbZ)]obul fax f(x) =sinx v. f:[0,7]>[ 2,2] f(x) = 2cosx N= {1,2,3,4,5,} Z={....-3,-2,-1,0,1,2,3,4, 5....} Z= (1,234, 5....} Z=(...3,-2,-1} L f(o=ax* f(x) = 2x f (-3) =2*(-3) = (-6) sh * (-6) = (-12) f (-2) =2*(-2) = (4) sh * (-4) =(-8) f£(-1) = 24-1) = (2) wh * (-2) =(4) £0) =2*(0) =(0) >h * 0) = 0) £0) =2*(1) =) oh * 2) = (4) £2) =2*(2) =@) oh * (4) = (8) £3) =2*(3) =) oh * (6) = (12) nh f@=l\ f= Y= S.M Nipuna Madhuranga SamarakoonHND Batch 29 Discrete Mathematics 25 1 = sin( > eB = -sin > =“ FQ = sin D) =sin cy -& S.M Nipuna Madhuranga SamarakoonHND Batch 29 Discrete Mathematics 26 Sin 0 = 0 onto function Xi, X2 be two different numbers f (x1) = sin (x1) ->@ f (x2) = sin (x2) >@) O=-@ sin (X1) = sin (x2) | q D> m/) f (x) = sin (x) y=f@) y = sin (x) sin “(y) =x x7y&y>x y =sin (x) f'(x) =sin “09 Vv. f(x) =sin x rhA~A EI 1 es mT _ a. MS? = sin( =z £G) = sin( > =-sin O =(-1) =sin ) =1 sin (-x) =- sin (x) I = sin( > = sin cy -- 4, 0 . 00 FG)= sin) =sin ea = & S.M Nipuna Madhuranga SamarakoonHND Batch 29 Discrete Mathematics 27 Sin 0 = 0 onto function Xi, X2 be two different numbers f (x1) = sin (x1) ->@ f (x2) = sin (x2) >@) O=@ sin (x1) = sin (x2) | q 2° m/) f (x) = sin (x) y=foo y = sin (x) sin “(y) =x x7y&y>x y =sin (x) f'(x) =sin “09 Part 4 2. Formulate corresponding proof principles to prove the following properties about defined sets. iv. A=BoSAcCBand BCA vy. De Morgan’s Law by mathematical induction vi. Distributive Laws for three non-empty finite sets A, B, and C Activity 02 Part 1 1. Discuss two examples on binary trees both quantitatively and qualitatively. Binary Tree Data Structure S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 30 Complete Binary Tree: - A Binary Tree is complete Binary Tree if all levels are completely filled except possibly the last level and the last level has all keys as left as possible Following are examples of Complete Binary Trees 18 / \ i> 30 7X / N 40 50 100 40 18 i \ i> 30 / NX / X\ 40 50 100 40 / NX / 8 Vino) Practical example of Complete Binary Tree is Binary Heap. Perfect Binary Tree: - A Binary tree is Perfect Binary Tree in which all internal nodes have two children and all leaves are at the same level. Following are examples of Perfect Binary Trees. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 31 18 / \ lS 30 ¢ S i. 40 50 100 40 18 / \ tS 30 A Perfect Binary Tree of height h (where height is the number of nodes on the path from the root to leaf) has 2h — 1 node. Example of a Perfect binary tree is ancestors in the family. Keep a person at root, parents as children, parents of parents as their children. Balanced Binary Tree A binary tree is balanced if the height of the tree is O(Log n) where n is the number of nodes. For Example, AVL tree maintains O(Log n) height by making sure that the difference between heights of left and right subtrees is 1. Red-Black trees maintain O(Log n) height by making sure that the number of Black nodes on every root to leaf paths are same and there are no adjacent red nodes. Balanced Binary Search trees are performance wise good as they provide O(log n) time for search, insert and delete. A degenerate (or pathological) tree A Tree where every internal node has one child. Such trees are performance-wise same as linked list. 10 / 20 N 30 \ 40 S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 32 Part 2 1. State the Dijkstra’ s algorithm for a directed weighted graph with all non-negative edge weights. 2. Find the shortest path spanning tree for the weighted directed graph with vertices A, B, C, D, and E given using Dijkstra’s algorithm. 1. Dijkstra’s algorithm, published in 1959 and named after its creator Dutch computer scientist “Edsger Dijkstra”, can be applied on a weighted graph. The graph can either be directed or undirected. One stipulation to using the algorithm is that the graph needs to have a nonnegative weight on every edge. ¢ Create a set sptSet that keeps track of vertices included in shortest path tree. Example: whose minimum distance from source is calculated and finalized. Initially, this set is empty. e Assign a distance value to all vertices in the input graph. Initialize all distance values as INFINITE. Assign distance value as 0 for the source vertex so that it is picked first. e While sptSet doesn’t include all vertices i. Pick a vertex u which is not there in sptSet and has minimum distance value. ii. Include u to sptSet. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 35 Chlorine Ammonia, acetylene, butadiene, butane, methane, propane , hydrogen, sodium carbide, benzene, finely divided metals, turpentine Iodine Acetylene, ammonia (aqueous or anhydrous), hydrogen Silver Acetylene, oxalic acid, tartaric acid, ammonium compounds, pulmonic acid Iodine Acetylene, ammonia (aqueous or anhydrous), hydrogen Mercury Acetylene, pulmonic acid, ammonia Fluorine All other chemicals Activity 03 Part 1 1. Discuss two real world binary problems in two different fields using applications of Boolean Algebra. Each segment of a calculator's display is switched on and off by a series of logic gates that are connected together. Consider just the bottom lower right segment .need to turn this segment on if we're showing the numbers 0 (binary 00), 1 (01), 3 (11), 4 (100), 5 (101), 6 (110), 7 (111), 8 (1000), and 9 (1001) But not if show the number 2 (10). Can make the segment switch on and off correctly for the numbers 1— 10 by rigging up three OR gates and one NOT gate like this. If feed the patterns of binary numbers into the four inputs on the left, the segment will turn on and off correctly for each one. (Woodford, 2007) Representing numbers in binary; For the last century or so, computers and calculators have been built from a variety of switching devices that can either be in one position or another. It has only “one (1)” or “zero (0)”. For that reason, computers and calculators store and process numbers using what's called binary code, which uses just two symbols (0 and 1) to represent any number. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 36 So in binary code, the number 18 is written 10010, Which means; (1 x 16) + (0 x 8) + (0x4) + (1 x 2)+(1 x 0) =16+2 =18 Using logic gates with binary Someone want to do the sum 3 + 2 = 5. A calculator tackles a problem like this by turning the two numbers into binary, giving 11 (which is 3 in binary = 1 x 2+ 1 x 1) plus 10 (2 in binary = 1 x 2+ 0 x 1) makes 101 (5 in binary = 1 x4+0x2+1x 1).So how does the calculator do the actual sum, It uses logic gates to compare the pattern of switches that are active and come up with a new pattern of switches instead. A logic gate is really just a simple electrical circuit that compares two numbers and produces a third number depending on the values of the original numbers. There are 4 very common types of logic gates. - OR - AND - NOT - XOR An OR gate has two inputs and it produces an output of | if either of the inputs is 1; it produces a zero otherwise. An AND gate also has two inputs, but it produces an output of 1 only if both inputs are 1. A NOT gate has a single input and reverses it to make an output. So if feed it a zero, it produces a 1. An XOR gate gives the same output as an OR gate, but switches off if both its inputs are one. Part 2 1. Develop truth tables and its corresponding Boolean equation for the following scenarios. i. "If the driver is present AND the driver has NOT buckled up AND the ignition switch is on, then the warning light should turn ON." ii. Ifit rains and you don't open your umbrella, then you will get wet. i. "If the driver is present AND the driver has NOT buckled up AND the ignition switch is on, then the warning light should turn ON." P: - The driver is present S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 37 Q: -The driver has buckled up R: - The ignition switch is on S: - The warning light should turn ON Pa~QaR=S Boolean equalization = P.O.R v © n 2 © Pa 2 © Pa~QaR=S a m}q| xq] 4} 4}4]4 a} m]4a}a]m]}a]a a] 4}n]4]n}4}q]4 3)4]}n]a]a}n]a vay} ay] fs] a] fs] vas] ryfeng | xg] oy] a] os] ii. If it rains and you don't open your umbrella, then you will get wet. P: - It rains Q: - you open your umbrella R: - you will get wet @a~Q—oR PJQ [R [~Q]Pa~Q ]Pa~Q>R T/T/TI[F F T T/T/|FI[F F T T/F[T[T T T T/F[FI[T T F F[T|T|F F T F[T|F|F F T F[F[T|T F T F[F[F|T F T 2. Produce truth tables for given Boolean expressions. j. ABC+ABC + ABC+ ABC ii. (A+B+C)(A+B+C)(A+B+C) S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 40 ii. A-Rain B - Umbrella open Table 2: truth table 2 A B Out 0 0 0 0 1 0 1 1 0 A.B Part 3 1. Find the simplest form of given Boolean expressions using algebraic methods. i. A(A+B)+B(BtC)+C(C+A, ii, (A+B)(B+C)+(A+B)(C+A) iii, (A+ B)(AC + AC)+ AB+B iv. A(A+B)+(B+A)(A+B) Part 4 2. Consider the K-Maps given. For each K- Map i. Write the appropriate standard form (SOP/POS) of Boolean expression. ii. Draw the circuit using AND, NOT and OR gates. iii. Draw the circuit only by using i. NAND gates if the standard form obtained in part (i) is SOP. ii. NOR gates if the standard form obtained in pat (i) is POS. (b) AB/C 0 1 00 0 0 S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics ol 10 1 (b) ABIC | 00 OL 10 1 ol 0 10 1 1 1 (©) AB/C 00 ol 10 1 S.M Nipuna Madhuranga Samarakoon HND Batch 29 41 Discrete Mathematics 42 Activity 04 Part 1 1 Describe the characteristics of different binary operations that are performed on the same set. Binary Operation Just as we get a number when two numbers are either added or subtracted or multiplied or are divided. The binary operations associate any two elements of a set. The resultant of the two are in the same set. Binary operations on a set are calculations that combine two elements of the set (called operands) to produce another element of the same set. The binary operations * on a non-empty set A are functions from A x A to A. The binary operation, *: A x A— A. Itis an operation of two elements of the set whose domains and co-domain are in the same set. (toppr, n.d.) >I Binary operation (*) - Figure 1: Binary operations (toppr, n.d) Addition, subtraction, multiplication, division, exponential is some of the binary operations. (toppr, n.d.) Types of Binary Operations Commutative A binary operation * on a set A is commutative if a * b = b * a, for all (a, b) € A (non-empty set). Let addition be the operating binary operation for a = 8 and b=9,a+b=17=b+a. Associative The associative property of binary operations hold if, for a non-empty set A, we can write (a * b) *c = a**(b * c). Suppose N be the set of natural numbers and multiplication be the binary operation. Let a = 4, b =5c=6. Wecan write (a x b) x c = 120 =a x (b xc). S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 45 2. Lagrange's theorem is a statement in group theory which can be viewed as an extension of the number theoretical result of Euler's theorem. It is an important lemma for proving more complicated results in group theory. Lagrange's Theorem. If Gis a finite group and H is a subgroup of G, then |H] divides |G]. As an immediate corollary, we get that if G is a finite group and g € G, then o0(g) divides |G]. In particular, |G-e for all g € G. ii. Before proving Lagrange’s Theorem, state and prove three lemmas. Lemma 1. If G is a group with subgroup H, then there is a one to one correspondence between H and any coset of H. Proof. Let C be a left coset of H in G. Then there is a g € G such that C = g * H. 1 Define f: H > C by f(x)=g*x. ¢ fis one to one. If x1 6= x2, then as G has cancellation, g * x1 6= g * x2. Hence, f(x1) 6= f(x2). e fis onto. If y EC, then since C = g * H, there is an h € H such that y = g * h. It follows that f(h) = y and as y was arbitrary, f is onto. This completes the proof of Lemma 1. Lemma 2. If G is a group with subgroup H, then the left coset relation, g1 ~ g2 if and only if gl * H= g2 * H is an equivalence relation. Proof. The essence of this proof is that ~ is an equivalence relation because it is defined in terms of set equality and equality for sets is an equivalence relation. The details are below. + ~ is reflexive. Let g € G be given. Then, g *H = {g *h : h € H} and as this set is well defined, g +H = g * H. 1We use “*” to represent the binary operation in G. «~ is symmetric. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 46 Let gl, g2 € G with gl ~ g2. Then by the definition of ~, g1 *H = g2 *H. That is, {g1 +h: h € H} = {g2 *h:h € H} and as set equality is symmetric, {g2 *h:h € H} = {gl * hh: h € H}. Hence, g2 ~ gl andas gl and g2 were arbitrary, ~ is symmetric. ¢ ~ is transitive. Let g1, g2, g3 € G with gl ~ g2 and g2 ~ g3. Then, gl *H = {g] *h: hE H} ={g2 *h:he H}=g2 * H And g2*H={g2*h:heH}={g3*h:heEH} =g3*H. As set equality is transitive, it follows that gl *H={gl *h:heH}={g3 *h:h€H} =g3 * H, or gl * H= g3 * H. That is, gl ~ g3, andas gl, g2, g3 € Gare arbitrary, ~ is transitive. This complete the proof of the lemma. Lemma 3. Let S be a set and ~ be an equivalence relation on S. If A and B are two equivalence classes with A B 6=9@, then A=B. Proof. To prove the lemma, we show that A C B and B C A. As A and B are arbitrarily labeled, it suffices to show the former. Leta € A. AsA 1 B 6= 9, there isac € AB. As A is an equivalence class of ~ and both a and ac are in A, it follows that a ~ c. But as a ~ c, c € B and B is an equivalence class of ~, it follows that a € B. Armed with these three lemmas we proceed to the main result. Theorem 1. [Lagrange’s Theorem] If G is a finite group of order n and H is a subgroup of G of order k, then k|n and n k is the number of distinct cosets of H in G. Proof. Let ~ be the left coset equivalence relation defined in Lemma 2. It follows from Lemma 2 that ~ is an equivalence relation and by Lemma 3 any two distinct cosets of ~ are disjoint. Hence, we can write G=(gl *H)U (g2* H)U-- U(g¢ *H) Where the gi * H,i= 1, 2,...,° are the disjoint left cosets of H guaranteed by Lemma 3. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics 47 By Lemma 1, the cardinality of each of these cosets is the same as the order of H, and so IG] = |g # Al +|g2* H|+---+ |ge* A = |A|+\A| +--+ [4] —ennNWn =. |H| =€-k. This completes the proof. iii. A consequence of Lagrange's Theorem would be, Group H with order 6 can be a subgroup of a group with order 13 or not, That a group with Oder 13 elements couldn't have a subgroup of 6 elements since 6 does not divide 13. It could have subgroups with 13 elements since only this number is divisors of 13. Part 3 1 Check whether the set S = ‘SR —{—1}is a group under the binary operation “* defined asa * b = a+ b+ abfor any two elementsa,be S. 2 i. State the relation between the order of a group and the number of binary operations that can be defined on that set. How many binary operations can be defined on a set with 4 elements? 3 Discuss the group theory concept behind the Rubik’s cube. Part 4 Prepare a ten minutes presentation that explains an application of group theory in computer sciences. S.M Nipuna Madhuranga Samarakoon HND Batch 29 Discrete Mathematics