You
have 50 red balls and 50 blue balls, you have to place these balls in two
containers in such a way that probability of a person picking up a red ball
from any container is maximum.
1. For container 1,
You
should have to place one red marble into 1st Container. By this when we select this Container 1 P(Red|C1) will be 1.
2. For container 2,
Rest
all marbles should have to place into 2nd container. By this when we select this Container 2 P(Red|C2) will be 49/99.
Here,
P(C1) = P(C2) = 1/2 as there is only 2 containers.
So
answer will be P(Red) = P(C1)*P(Red|C1) + P(C2)*(Red|C2)
P(Red) = (1/2)*(1) + (1/2)*(49/99)
P(Red) = 0.747474.
Proof of
above given solution using the Java code:
public class
MaximizeRedBallProbability {
/**
* This is the code which maximize the
probability.
* @param red
* @param blue
* @return probability
*/
private static double
getProbability(int red, int blue) {
double max=0;
int maxRed = 0;
int maxBlue = 0;
for (int i = 1; i < red; i++) {
for (int j = 0; j < blue; j++) {
double prb = (0.5*i)/(i+j) + (0.5*(50-i))/(100-i-j);
if (prb>max) {
max = prb;
maxRed=i;
maxBlue=j;
}
}
}
System.out.println("Container 1, Red balls: "+maxRed +" Blue balls
: "+maxBlue);
System.out.println("Container 2, Red balls: "+(red-maxRed) +" Blue balls : "+(blue-maxBlue));
return max;
}
/** Driver Method. */
public static void
main(String[] args) {
int red = 50;
int blue = 50;
double p = getProbability(red,blue);
System.out.println("Maximum probability of RED ball "+p);
}
}
Output: 7474747474747475
Welcome to Ragdoll Kittens Cattery click here to adopt a ragdoll
ReplyDeletekitten online We are a small and loving cattery . We are pleased that you have chosen to visit our Ragdoll
cats/Ragdoll kittens cattery, and hope you will notice right away from our website how beautiful and loved our
Ragdoll cats and kittens are. These beauties are easily integrated into our loving family home, first as
mothers carrying the litters, and then from the time the ragdoll kittens are born until they are adopted so we
always have Ragdoll kittens for sale|Ragdoll kittens for adoption|Ragdoll kitten price|Ragdolls|Cost of Ragdoll
kittens|. Our adult cats have tested negative for HCM and PKD1 through University of California Davis. Upon
request, we have five generations of pedigree documentation on our adults available to anyone who is
interested. Ragdoll kittens are registered with The International Cat Association (RAGDOLL KITTENS FOR SALE),and are never caged. The cats that are
in our reputable breeding program can produce mink, sepia and traditional Ragdoll kittens. Ragdolls have a
laid-back personality and enjoy being physically handled making them one of the best lap cats! We are all
family here at Ragdoll kittens cattery since we are ragdoll kitten breeders and all the love we bestow by
holding each cat and kitten daily further Teacup RAGDOLL Kittens
for sale|Hypoallergenic kittens for sale nurtures their loving personalities and temperaments,TICA/CFA REGISTERED RAGDOLL KITTENS FOR SALE thanks for adopting a
ragdoll ketten from us
Welcome to our farm where we breed Registered pomeranian puppies
for sale.As a registered pomeranian puppies breeder, we have made it possible for pomeranian puppy lovers
to
buy pomeranian puppies online,buy zwergpitz pomeranian from our family run farm. Pomeranian
dogs are small dogs with a weight of 1.36 to 3.17 kg and a withers height of 15 to 18 cm. They are compact but
robust dogs with a lush, textured coat and a tall and flat tail. The top coat forms a fur ruff on the neck, for
which poms are known, and on the hindquarters they have a margin of feathered hair.You can click HERE to view our available pomeranian puppies
Welcome to Buy Medical Buds, where you can find the best marijuana strains like buy mango haze strain, from the most trusted online marijuana dispensary.
ReplyDeletewhere to buy marijuana
buy marijuana seeds online
where can i buy marijuana
buying marijuana in colorado
how to buy marijuana
buy marijuana edibles online
buy medical marijuana
buy marijuana online usa
can you buy marijuana online
where to buy marijuana in dc
Thanks for this. I really appreciate your good work
ReplyDeleteBuy medical marijuana online at [url=https://medicanabudshop.com] The Best Bud Shop [/url]
ReplyDeleteThanks for this. I really appreciate your good work
ReplyDeletecontent so valid. keep up i love this
ReplyDeleteso much meaning. I enjoyed my self
ReplyDeleteI cant neglect. Reading such a content
ReplyDeleteEthical facts. one just cant neglect
ReplyDeleteI always appreciate. Valid content
ReplyDeleteNever a dull. moment reading online
ReplyDeleteI have learned. A new thing today
ReplyDeletenothing is so meaningful. like reading a good content
ReplyDeleteBuy Pharma Sust 300 Online
ReplyDeleteBuy Pharma Test C250 Online
Buy Pharma Test E300 Online
Buy Primobolan 300 Online
Buy Primobolan 100 Online
Buy Rexogin Alpha Online
Buy Stanozolol Injectable Online
Buy Stanozolol Injection Online
Buy Stanozolol Winstrol Online
Buy Sustanon 250 Online
ReplyDeleteBUY WEED ONLINE
BUY IBOGAINE ONLINE
BUY XANAX ONLINE
BUY DANK VAPE ONLINE
BUY COCAINE ONLINE
BUY IBOGAINE CAPSULES ONLINE
BUY LSD ONLINE
BUY BLUE DREAM DANK VAPE ONLINE
BUY MOONROCKS ONLINE
BUY CARFENTANYL ONLINE
Wow. This is truly an amazing post. Thanks for sharing.
ReplyDeleteBuy Custom Website
Hollanda yurtdışı kargo
ReplyDeleteİrlanda yurtdışı kargo
İspanya yurtdışı kargo
İtalya yurtdışı kargo
Letonya yurtdışı kargo
J2U