Exercise 5.1.1As a set:Average = 2.37Average = 2.48Exercise 5.1.2As a set:Average = 218Average = 215Exercise 5.1.3aAs a bag:bore1516141615151418Exercise 5.1.3bπbore(Ships X Classes)Exercise 5.1.4aFor bags:On the left-hand side:Given bags R and S where a tuplet appearsn and m times respectively, the union of bags R and S will have tuple t appearn + m times. The further union of bag T with the tuple t appearingo times will have tuple t appearn + m + o times in the final result.On the right-hand side:Given bags S and T where a tuplet appearsm and o times respectively, the union of bags R and S will have tuple t appearm + o times. The further union of bag R with the tuplet appearingn times will have tuple t appearm + o + n times in the final result.For sets:This is a similar case when dealing with bags except the tuplet can only appear at most once in each set. The tuplet only appears in the result if all the sets have the tuplte. Otherwise, the tuple t will not appear in the result. Since we cannot have duplicates, the result only has at most one copy of the tuple t.Exercise 5.1.4bFor bags:On the left-hand side:Given bags R and S where a tuplet appearsn and m times respectively, the intersection of bags R and S will have tuplet appear min( n, m ) times. The further intersection of bag T with the tuple t appearingo times will produce tuple t min( o, min( n, m ) ) times in the final result.On the right-hand side:Given bags S and T where a tuplet appearsm and o times respectively, the intersection of bags R and S will have tuplet appear min(m, o ) times. The further intersection of bag R with the tuple t appearingn times will produce tuple t min( n, min( m, o ) ) ...