
4. [10 marks] There are three bags one of which contains gold and the other two...
Two bags contain a number of balls. Bag A contains 4 white and 3 black balls and bag B contains 3 whit and 5 black balls. A ball is chosen at random from bag A and placed into bag B i). Given that the first ball was black, what is the probability that a second ball drawn from bag A will be white? (1 mark) Given no knowledge of the color of the first ball, what is the probability that...
Java Write an intersection method for the ResizableArrayBag class. The intersection of two bags is the overlapping content of the bags. Intersections are explained in more detail in Chapter 1, #6. An intersecion might contain duplicates. The method should not alter either bag. The current bag and the bag sent in as a parameter should be the same when the method ends. The method header is: public BagInterface<T> intersection(ResizableArrayBag <T> anotherBag) Example: bag1 contains (1, 2, 2, 3) bag2 contains...
Two bags contain colored jelly beans. Bag 1 contains five red and three black, and bag 2 contains seven red and three black. A jelly bean is selected at random from each bag. What is the probability to have one back and one red?
Problem 2 (18 pts) The lady or the tiger? There are two rooms. Each of them is occupied by either a tiger or a lady, but not both. There is also a sign on the door of each room. For Room I, if a lady is it, then the sign on the door is true, but if a tiger is in it, the sign is false. In Room II, the situation is the opposite: a lady in the room means...
) 11. Suppose you have 10 gift bags and 2 contain prizes worth $50. The other gift bags have items worth $20. (3) a. Find the probability you select two bags with one $50 prize and one $20 prize. (3) b. Find the probability that you select two bags and both contain $50 prizes. (3) c. Find the probability that you select three bags and two contain $50 prizes and one contains a $20 prize. (3) d. What is the...
Problem 4: Misere Empty and Divide. There are two boxes. Initially, one box contains m chips and the other contains n chips. Such a position is denoted by (m, n), where m > 0 and n > 0. The two players alternate moving. A move consists of emptying one of the boxes, and dividing the contents of the other between the two boxes with at least one chip in each box. There is a unique terminal position, namely (1,1). Consider...
]
Question 4 (10 marks) Suppose the spot price of gold is $1,500 per troy ounce today. The futures price of gold for delivery in 1 year is $1,530 per troy ounce. Assume that the one-year gold futures contract is correctly priced and there are no storage and insurance costs. Also assume that the risk-free rate is compounded annually and you can borrow and lend money at the risk-free rate. a). What is the theoretical parity price of a two-year...
Can you help with the merge method? This method should create and return an ArrayBagcontaining one occurrence of any item that is found in either the called object or the parameter other. For full credit, the resulting bag should not include any duplicates. Give the new ArrayBag a maximum size that is the sum of the two bag’s maximum sizes. import java.util.*; /** * An implementation of a bag data structure using an array. */ public class ArrayBag { /**...
Load to the IDEA the remaining classes from the provided Lab02.zip file. Repeat the previous project inside the ArraySetWithArray class. As shown in the UML diagram below ArraySetWithArray class does not utilize ResizableArrayBag object as its instance variable, it has setOfEntries defined as an array which should be dynamically resized if more room needed (double the size). displaySet method should check if the set is empty and display appropriate message; if the set is not empty should display the number...
A secondary phase in a composite for which one dimension largely smaller than the other two dimension is a a) filer b) particle c)falke d) whicker 2)a typical fatigue curve depecits the applied stress as function of the time it requires to fall the materials under applied stress a) True B) False 3)which material is present above the upper cructicaa temperature line in an iron carbon phase diagram? a) peralite b) ledeburite C) austenite d) Martensite