Discrete-math 25

Discrete-math 25

Exam 2023(A)

Prove: for any simple acyclic graph G=(V,E)there is a coloring of vertices in 2 colors such that no adjacent vertices have the same colorProof:Base case. Let n=1We can color 1 vertex black and we are doneInduction step. Let there be such a coloring for any graph with n verticesLet G=(V,E) be a graph with n+1 verticesG is a forestAny connected component of G is a treeCase 1. All connected components each have 1 vertexAny vertex can be colored either black or white, there are no adjacent onesCase 2. At least one connected component has 2 vertices or moreAny tree with n2 vertices has at least 1 leafLet this leaf be vertexv with one neighbor uG=G{v} has n verticesthere is such a coloring for GLet us use the coloring of G and let the color of v be different from the color of uThere is such a coloring for GProved by induction

Exam 2023(B)

Let G=(V,E) be a simple graphDefine the complement G of graph GTo be G=(V,E):E={{u,v}|u,vV,{u,v}E}Prove: for any simple graph with n5 vertices either G or G has a cycleProof:|E|=n(n1)2|E|Let |E|nG has a cycleLet |E|<n|E|>n(n1)2n=n2n2n2=n(n3)2n5n3222=1n(n3)2n|E|>nG has a cycle

Exam 2024(A)

Dani has 10 different fruitsIn how many ways can he arrange them such that 3 apples (green, red, yellow)are next to each other, but banana and orange are not next to each otherSolution:There are 3! ways to arrange three applesLet us treat 3 apples as 1 itemThere are 3!8! ways to arrange all the fruitsLet us subtract the number of ways to arrange the fruits such thatapples are next to each other and banana and orange are next to each otherLet us treat banana and orange as 1 itemThere are 3!2!7! ways to do soThe final answer is: 3!8!3!2!7!Now Dani needs to plan 3 of his school lunches with these 10 different fruitsHis mom allows him to take at most 5 fruits per daySolution:Let us count the total number of options without the limit of 5:Each fruit can be taken in one of three daysthe number of such options is 310Let us now count the number of options where Dani took exactly 6k10 fruits in one dayIt is k=610(10k)210kDani can take more than 5 fruits in only one dayThe answer is: 310(31)k=610(10k)210kProve combinatorially: i=0n19i(n1i)=10n1Proof:On the right side we are making a (n1)-long string of decimal digits10n1On the left side we first choose (n1i) places for digit 0 which is (n1i)And then choose i places for 9 digits left which is 9iThe left side is i=0n19i(n1i)i=0n19i(n1i)=10n1

Exam 2024(B)

Park has 4 stations: crafting, ice skating, water fight and scienceThe day is divided into 10 hours, each visit to the station takes 1 hourAfter water-fight children are not allowed to do ice-skatingIn how many ways can the child plan his day?Solution:Case 1. There are no water-fights in the planThere are 310 optionsCase 2. There is a first water-fight in the i-th position in the planThere are 3i1 options before water-fight and 310i options after itnumber of such options is: 39There are 10 options for iThere are a total of 1039 such optionsThe final answer is: 310+1039Prove combinatorially: k=0n(2n+1k)=22nProof:Let us choose two disjoint groups of numbers from [2n+1]This is k=0n(2n+1k)Let us now take number 1 to be a first groupLet us now separate 2n elements left into two groups:Group of 1 and the other oneThere are 22n ways to do sok=0n(2n+1k)=22n