3
Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 April 2020 Sets Solution Problem 1 List all subsets of {, , , , } containing {, } but not containing . Solution: All possible subsets: 2 ! = 32. Valid subsets: , , , , , , , , , , , Problem 2 Three sets have 5, 10, and 15 elements, respectively. How many elements can their union and their intersection have? Solution: = 5 = 10 = 15 = 5 10 () = 5 15 = 10 15 = 5 Similarly, = 10 15 () = 15 20 = 15 25 = 15 30 () Problem 3 Prove that for any three sets , , , (( \ ) ( \ )) = (( ) ( )) \ ( ) Solution: Step1: Draw Venn diagram of \ \ respectively coloring scheme for the relevant sides of the circles Step2: Draw Venn diagram of \ \ using coloring scheme Step3: Draw Venn diagram of \ \ = . . Step4: Draw Venn diagram of , , ( ) respectively using coloring scheme for the relevant sides Step5: Draw Venn diagrams of (( ) ( )) using coloring scheme Step5: Draw Venn diagrams of \ = . . . . = . . Numbers Problem 4 Compute the binary form of 25 and 35, using division method and compute their sum in the binary notation. Check the results against adding 25 and 35 in the usual decimal notation and then converting it to binary. Solution: 25 ( ) + 35() = 60 () (011001) ! + (100011) ! = (111100) ! Problem 5 How many bits does 10 !"" have if written in base 2? Solution:

Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 … · 2020. 4. 23. · Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 April 2020 Response 1: Use the

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 … · 2020. 4. 23. · Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 April 2020 Response 1: Use the

Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 April 2020

Sets Solution

Problem 1 List all subsets of {𝑎, 𝑏, 𝑐,𝑑, 𝑒} containing {𝑎, 𝑒} but not containing 𝑐. Solution:

All possible subsets: 2! = 32. Valid subsets: 𝑎, 𝑒 , 𝑎, 𝑏, 𝑒 , 𝑎,𝑑, 𝑒 , 𝑎, 𝑏,𝑑, 𝑒

Problem 2 Three sets have 5, 10, and 15 elements, respectively. How many elements can their union and their intersection have? Solution:

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐴 𝐴 = 5 𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐵 𝐴 = 10 𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐶 𝐴 = 15

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐴 ∩ 𝐵 𝐴 ∩ 𝐵 = 5 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑎𝑛𝑑 10 (𝑚𝑎𝑥𝑖𝑚𝑢𝑚)

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐴 ∩ 𝐶 𝐴 ∩ 𝐶 = 5 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑎𝑛𝑑 15 𝑚𝑎𝑥𝑖𝑚𝑢𝑚

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐵 ∩ 𝐶 𝐵 ∩ 𝐶 = 10 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑎𝑛𝑑 15 𝑚𝑎𝑥𝑖𝑚𝑢𝑚

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐴 ∩ 𝐵 ∩ 𝐶 𝐴 ∩ 𝐵 ∩ 𝐶 = 5 𝑚𝑖𝑛𝑖𝑚𝑢𝑚

Similarly,

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐴 ∪ 𝐵 𝐴 ∪ 𝐵 = 10 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑎𝑛𝑑 15 (𝑚𝑎𝑥𝑖𝑚𝑢𝑚)

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐴 ∪ 𝐶 𝐴 ∪ 𝐶 = 15 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑎𝑛𝑑 20 𝑚𝑎𝑥𝑖𝑚𝑢𝑚

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐵 ∪ 𝐶 𝐵 ∪ 𝐶 = 15 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑎𝑛𝑑 25 𝑚𝑎𝑥𝑖𝑚𝑢𝑚

𝑠𝑖𝑧𝑒 − 𝑜𝑓 − 𝑠𝑒𝑡 − 𝐴 ∪ 𝐵 ∪ 𝐶 𝐴 ∪ 𝐵 ∪ 𝐶 = 15 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑎𝑛𝑑 30 (𝑚𝑎𝑥𝑖𝑚𝑢𝑚)

Problem 3 Prove that for any three sets 𝐴,𝐵,𝐶,

((𝐴 \ 𝐵) ∪ (𝐵 \ 𝐴)) ∩ 𝐶 = ((𝐴 ∩ 𝐶) ∪ (𝐵 ∩ 𝐶)) \ (𝐴 ∩ 𝐵 ∩ 𝐶) Solution:

Step1: Draw Venn diagram of 𝐴\𝐵 𝑎𝑛𝑑 𝐵\𝐴 respectively coloring scheme for the relevant sides of the circles Step2: Draw Venn diagram of 𝐴 \ 𝐵 ∪ 𝐵 \ 𝐴 using coloring scheme Step3: Draw Venn diagram of 𝐴 \ 𝐵 ∪ 𝐵 \ 𝐴 ∩ 𝐶 = 𝐿.𝐻. 𝑆 Step4: Draw Venn diagram of 𝐴 ∩ 𝐶 , 𝐵 ∩ 𝐶 , 𝑎𝑛𝑑 (𝐴 ∩ 𝐵 ∩ 𝐶) respectively using coloring scheme for the relevant sides Step5: Draw Venn diagrams of ((𝐴 ∩ 𝐶) ∪ (𝐵 ∩ 𝐶)) using coloring scheme Step5: Draw Venn diagrams of 𝐴 ∩ 𝐶 ∪ 𝐵 ∩ 𝐶 \ 𝐴 ∩ 𝐵 ∩ 𝐶 = 𝑅.𝐻. 𝑆

𝐿.𝐻. 𝑆 = 𝑅.𝐻. 𝑆

Numbers Problem 4 Compute the binary form of 25 and 35, using division method and compute their sum in the binary notation. Check the results against adding 25 and 35 in the usual decimal notation and then converting it to binary. Solution:

25 (𝑖𝑛 𝑏𝑖𝑛𝑎𝑟𝑦) + 35(𝑏𝑖𝑛𝑎𝑟𝑦) = 60 (𝑏𝑖𝑛𝑎𝑟𝑦) (011001)! + (100011)! = (111100)!

Problem 5 How many bits does 10!"" have if written in base 2? Solution:

Page 2: Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 … · 2020. 4. 23. · Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 April 2020 Response 1: Use the

Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 April 2020

Response 1: Use the fact that 2!" is approximately 10! . In fact, 2!" = 1024 that makes 2!!" in the neighborhood of 10!!. Thus, the answer to your question is that 10!"" requires about 333 binary digits. Response 2: The number of digits of a number is revealed when you look at the logarithm of the number using a base equal to the number of possible digits. We can answer this question if you add one to the whole number portion of

𝑙𝑜𝑔!10!"" + 1 = 100 ∗ 𝑙𝑜𝑔! 10 + 1 = 100 ∗ 3.332 + 1 = 332.1 + 1 Thus, there are 333 digits.

Counting

Problem 6 In how many ways can you seat 12 people at two round tables with 6 places each? Think of possible ways of defining when two seatings are different, and find the answer for each. Solution: Rotations don't matter, table does. Consider seating relative to special guest. There are 11 ∗ 10 ∗ 9 ∗ 8 ∗ 7 ways to seat people around the first table. Seat the next special guest. There are 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 ways to seat the rest. The total is 11 ∗ 10 ∗ 9 ∗ 8 ∗7 + 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1. Problem 7 Starting from Washington, DC, how many ways can you visit 5 of the 50 state capitals and return to Washington? Solution: As going from one city to another city, order becomes permanent. Therefore, using permutation formula, there are P(50, 5) ways to visit 5 of the 50 state capitals.

Problem 8 Alice has 10 balls (all different). First, she splits them into two piles; then she picks one of the piles with at least two elements, and splits it into two; she repeats this until each pile has only one element.

(a) How many steps does this take? Solution: We can easily check by hand that:

o if she starts with 1 ball, 0 steps are required; o if she starts with 2 balls, 1 step is required; o if she starts with 3 balls, 2 steps are required; and o if she starts with 4 balls, 3 steps are required.

This should suggest a hypothesis for the number of steps required when she starts with n balls. Now if we have 10 balls, 9 steps.

(b) Show that the number of different ways in which she can carry out this procedure is 102 ⋅ 9

2 ⋅ 82 ⋯ 3

2 ⋅ 22

[Hint: Imagine the procedure backward.]

Solution: Suppose we have 10 balls split into 10 piles.

If we have 10 piles, then in 102 we can combine any two piles.

If we have 9 piles, then in 92 ways we can combine any two piles.

If we have 8 piles, then in 102 ways, we can combine any two piles.

Building the same method of combining piles, given equation can be solved to state total ways.

Problem 9 You want to send postcards to 12 friends. In the shop there are only 3 kinds of postcards. In how many ways can you send the postcards, if

(a) there is a large number of each kind of postcard, and you want to send one card to each friend; Solution: Suppose, we have three types of postcards as A, B, and C. As we have 3 choices for each friend, therefore, 3!" ways to send the postcard.

(b) there is a large number of each kind of postcard, and you are willing to send one or more postcards to each friend (but no one should get two identical cards); Solution:

Page 3: Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 … · 2020. 4. 23. · Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 April 2020 Response 1: Use the

Discrete Structures – Spring-2020 Assignment-02 Due Date: 07 April 2020

Suppose, we have three types of postcards as A, B, and C. We can send postcards to the first friend in three ways. One, either we can send him three cards as either A or B or C. Second, either send A and B, or A and C, or B and C. Three, we can send all three cards, A and B and C. Therefore there are total 7 choices for the first friend. Same choices are available for all friends. Total ways will be 7!"

(c) the shop has only 4 of each kind of postcard, and you want to send one card to each friend? Solution: Suppose, we have three types of postcards as A, B, and C. We have total 12 cards as each card type has four cards.

For first type of cards, we can choose 4 friends out of 12: 124 ways.

For second type of cards, we can choose 4 friends out of 8: 84 ways.

For third type of cards, we can choose 4 friends out of 4: 44 ways.

Final answer: 12484

44

Problem 10 What is the number of ways to color n objects with 3 colors if every color must be used at least once? Solution: There are 3! ways to color 𝑛 objects with at most 3 colors, but if we call the colors 𝑅𝑒𝑑,𝐺𝑟𝑒𝑒𝑛,𝐵𝑙𝑢𝑒, this does not preclude all objects being colored Red, or Red and Green, for example. There are 2! ways to color things using only Red and Green, or Green and Blue, or Red and Blue (there are 32 = 3 ways to use two colors). That is, 3 · 2! is the number or ways to use at most two colors. But each of those also includes coloring the objects with just one color. There are three ways to use exactly one color. Then the number of ways to use all three colors is

3! − 3 · 2! + 3

Problem 11 How many different “words” can you get by rearranging the letters in the word “MATHEMATICS”? Solution: We have 11 letters where few letters are repeated. E.g., M, A, T, H, E, I, C, S. If we start from M, we can place M at any of the 11 place … so we have 112 ways. Then, 2 places are fixed. We are left with 9 places so, we can place A at 92 . For T, we have 72 ways to place. Now we are left with 5 places. So all rest of the letters have choices: 51 × 4

1 × 31 × 2

1 × 11 =

5×4×⋯×1. Final Answer will be: 112 . 92 . 72 . 5!

Problem 12 20 persons are sitting around a table. How many ways can we choose 3 persons, no two of whom are neighbors? Solution: There are 20 ways to choose 3 people sitting in three consecutive seats (without any restriction). There are 20 ⋅ 16 ways to choose 3 people where 2 are sitting together with the third sitting apart from them. Thus we have 17 ⋅ 20 = 340 choices that do not qualify. Excluding these from the total, the number of ways to choose 3 with no 2 being neighbors is:

203 − 340 = 800