Answer:
class Example:
def __init__(self, val):
self.val = val
def __gt__(self, other):
return self.val > other.val
def __sub__(self,other):
return abs(len(self.val) - len(other.val))
def main():
obj1 = Example('this is a string')
obj2 = Example('this is another one')
print(obj1 > obj2)
print(obj1 - obj2)
main()
\color{red}\underline{Output:}
Answer:
Below is code written in a free CAS (WxMaxima):
The above code creates the probability of 19 or more brown in the sample of 48 for population sizes from 5*19 to 10000 in steps of 5.
Here’s a plot of that data:
The horizontal blue line is the probability for an infinite population size (or, choosing each of the 48 M&Ms with replacement, which I infer is not what you meant). It is calculated using the binomial cdf:
The red curve approaches the blue line asymptotically as the population gets larger.
At population 10000, the red curve is
.