2. (20 points) Suppose you have a pizza shop and you advertise a sale for a 4-topping pizza.
Your 14 toppings are listed below:
• Pepperoni
• Black Olives
• Green Olives
• Peppers
• Onions
• Anchovies
• Mushrooms
• Sausage
• Eggplant
• Basil
• Ham
• Pineapple
• Meatball
• Pesto
(a) Count the number of possible 4-topping pizzas (from the set of 14 toppings)
(b) How many bits would you need for the most efficient encoding of a 4-topping pizza?
(c) Develop your own encoding/decoding algorithm where the code uses this number of bits.
(d) Use your encoding to encode the following 4-topping pizzas:
• {Pepperoni, Onions, Black Olives, Pesto}
1
• {Anchovies, Green Olives, Mushrooms, Basil}
(e) Use your decoding to decode the following strings: (put "non-decodable" if you can't decode the
string:)
• 0101010101
• 0011001100