Discrete Math Homework
1.Two friends have 2 gallons (8 quarts) of water in a pail. They also have two (empty) jars, one holding 5 quarts and the other 3. Using just these measuring devices, how can they split the water so that 4 quarts are in the larger jar and 4 quarts remain in the pail? Produce a complete graph model for this puzzle similar to the one in the wolf, goat, and cabbage puzzle, and find all solutions to the water puzzle in terms of the properties of the graph.
2.Suppose the pail in the previous problem holds 12 quarts of water, the two jars hold 7 quarts and 5 quarts, and the goal is still to split the water evenly with 6 quarts in both the pail and the larger jar. Produce a complete graph model for this puzzle, and find all solutions to the water puzzle in terms of the properties of the graph.
4.Puzzles like the wolf, goat, and cabbage puzzle exist in many cultures. A slightly different version comes from the Kabjlie region of Algeria. This puzzle involves a man traveling with a jackal, a goat, and a bundle of hay, but in this version, the man can take up to two of these things with him on each crossing. Describe the complete graph model so that you can show all the solutions to this puzzle in terms of your graph. Is there a solution that seems to be better than others? Explain why.
Place the numbers 11, −4, 3, 2, 16, 8, 5, −1 into a binary search tree with the smallest possible height.
Give the binary tree that represents each of the following “inorder” arithmetic expressions:
For each of the following arithmetic expressions in prefix notation, write the equivalent infix expression (with parentheses) and evaluate it:
A++ Answers and Detail Explanation