how to find probabity of A given B and C happens
how to find probability of A given B and C happens What is the probability of A given B and C P(AB,C)?
See also questions close to this topic

Where does the 0.5 come from or how to get the parameter is 0.5?
From the Javadoc of java.util.HashMap:
Ideally, under random hashCodes, the frequency of nodes in bins follows a Poisson distribution (http://en.wikipedia.org/wiki/Poisson_distribution) with a parameter of about 0.5 on average for the default resizing threshold of 0.75, although with a large variance because of resizing granularity. Ignoring variance, the expected occurrences of list size k are (exp(0.5) * pow(0.5, k) / factorial(k)).
Where does the 0.5 come from or how to get the parameter is 0.5? I want to konw the process.

I want to know the physical principles about Android dynamic animation
Android Developers official document:
Whenever possible, your animations should apply realworld physics so they are naturallooking. For example, they should maintain momentum when their target changes, and make smooth transitions during any changes.
To provide these behaviors, the Android Support library includes physicsbased animation APIs that rely on the laws of physics to control how your animations occur.
There are two main animation methods here. I want to know their physical principles.
FlingAnimation.java
MassState updateValueAndVelocity(float value, float velocity, long deltaT) { mMassState.mVelocity = (float) (velocity * Math.exp((deltaT / 1000f) * mFriction)); mMassState.mValue = (float) (value  velocity / mFriction + velocity / mFriction * Math.exp(mFriction * deltaT / 1000f)); if (isAtEquilibrium(mMassState.mValue, mMassState.mVelocity)) { mMassState.mVelocity = 0f; } return mMassState; }
SpringForce.java
Reference/** * Internal only call for Spring to calculate the spring position/velocity using * an analytical approach. */ DynamicAnimation.MassState updateValues(double lastDisplacement, double lastVelocity, long timeElapsed) { init(); double deltaT = timeElapsed / 1000d; // unit: seconds lastDisplacement = mFinalPosition; double displacement; double currentVelocity; if (mDampingRatio > 1) { // Overdamped double coeffA = lastDisplacement  (mGammaMinus * lastDisplacement  lastVelocity) / (mGammaMinus  mGammaPlus); double coeffB = (mGammaMinus * lastDisplacement  lastVelocity) / (mGammaMinus  mGammaPlus); displacement = coeffA * Math.pow(Math.E, mGammaMinus * deltaT) + coeffB * Math.pow(Math.E, mGammaPlus * deltaT); currentVelocity = coeffA * mGammaMinus * Math.pow(Math.E, mGammaMinus * deltaT) + coeffB * mGammaPlus * Math.pow(Math.E, mGammaPlus * deltaT); } else if (mDampingRatio == 1) { // Critically damped double coeffA = lastDisplacement; double coeffB = lastVelocity + mNaturalFreq * lastDisplacement; displacement = (coeffA + coeffB * deltaT) * Math.pow(Math.E, mNaturalFreq * deltaT); currentVelocity = (coeffA + coeffB * deltaT) * Math.pow(Math.E, mNaturalFreq * deltaT) * mNaturalFreq + coeffB * Math.pow(Math.E, mNaturalFreq * deltaT); } else { // Underdamped double cosCoeff = lastDisplacement; double sinCoeff = (1 / mDampedFreq) * (mDampingRatio * mNaturalFreq * lastDisplacement + lastVelocity); displacement = Math.pow(Math.E, mDampingRatio * mNaturalFreq * deltaT) * (cosCoeff * Math.cos(mDampedFreq * deltaT) + sinCoeff * Math.sin(mDampedFreq * deltaT)); currentVelocity = displacement * mNaturalFreq * mDampingRatio + Math.pow(Math.E, mDampingRatio * mNaturalFreq * deltaT) * (mDampedFreq * cosCoeff * Math.sin(mDampedFreq * deltaT) + mDampedFreq * sinCoeff * Math.cos(mDampedFreq * deltaT)); } mMassState.mValue = (float) (displacement + mFinalPosition); mMassState.mVelocity = (float) currentVelocity; return mMassState; }

Finding a coordinate which doesn't form a rectangle out of multiple given coordinates
We are given 4N+1 coordinate points out of which 4N coordinate points form N rectangles and one remaining point doesn't contribute to forming any rectangle. Is there a way to find this remaining last coordinate?
1<=N<=100000,
0<=X,Y<=1000000
Time limit = 2 sec

How to assign an argument to the probabilty of returning that arg?
So what i want to do it's to assign an argument(x p.e) to the probabilty of returning it. Example : if x is 0.22, i will have a 22% probabilty of return True; if x is below 0 or higher than 1, then assign x = 0.5 p.e idk what to write in return part...so i tried this solution but without sucess
def gen_true(x): for x in range(0,1): x = float(x) if x > 100 or x < 0: x = 0.5 elif 1 < x < 100: x = x / 100 return random.randrange(100) < x gen_true(0.70)
Already solved! It was the for loop(it makes no sense xD)

Expected value of hiring
I'm trying to figure out the classical problem  the hiring problem. The question description is simple. If we have n employees who come one at a time. If the person currently being interviewed is better than the previous candidates, she will be hired. What's the expected value of hiring would happen?
I've tried by thinking the probability of one person gets hired, of two persons get hired, etc. But it becomes hard to calculate as the number of persons that get hired grows larger.

Returning values weighted according to some nonzero probability
I'm trying to implement a function that returns some predefined values with a particular probability.
For people knowing Python's
NumPy
module, I suppose I'm wondering whether there is an equivalent tonumpy.random.choice()
in JavaScript?If not, how else one could go about this efficiently? Here my code:
// outcomes const max_outcome = 10; const min_outcome = 10; let x1 = Math.floor(Math.random() * (max_outcome  min_outcome + 1) + min_outcome); let y1 = Math.floor(Math.random() * (max_outcome  min_outcome + 1) + min_outcome); // probabilities const max_proba = 1; const min_proba = 0.5; let p1 = Math.random() * (max_proba  min_proba) + min_proba; p1 = Math.round(p1 * 100) / 100; let p2 = 1  p1; p2 = Math.round(p2 * 100) / 100; function return_value(x1, y1, p1, p2) { // should randomly return x1 with p1 probability or y1 or p2 probability}
Any ideas/thoughts would be gratefully received.