George R. R. Martin announces that Feast For Crows is finished - through the magic of splitting his current effort into two books.
Of course, David Gerrold announced that he was going to use that device on his next book; which still hasn't been published.
The book isn't over until they start killing trees.
It is common in continuous distributions that the average result is more probable than the extreme results. The triangle distribution satisfies this condition.
As in the case of the uniform distribution, we'll consider that only the probabilities between M-a and M+a exist in our population. The probability of x = M-a is itself zero, but climbs linearly from there until it reaches x = M. Then the trend is reversed, and the probability falls until it reaches zero at x = M+a.
First we figure out the height of the triangle. As the base is 2a in length, and the area is 1, the height must be 1/a.
The definition of the triangle distribution is really two distinct pieces, and in working through the calculations we'll be handling each piece independently, combining the results in the final step.
The left side of the triangle intersects the x axis at M-a, and has a slope of 1/a^2 (rise = 1/a, run = a ). So the linear equation there is
P(x) = 1/a^2 (x-(M-a))
on the otherside
P(x) = -1/a^2 (x-(M+a))
Now, a quick preview of what is to come. In our previous example we saw that the M-a and M+a substitutions would cancel out half of the terms of our answer, and that the normalization constant A would cancel the a out of the leading term.
With A ~ a^2, we have a hint that M+a and M-a will cancel out the odd terms, and that A will step down the even terms. However, if that were all that were to happen, the leading term would look like f(M)/a^2, which can't be right. So we can expect that the integral itself will somehow manage to cancel that leading term.
With that hint in mind, the probability of a coin chosen from the triangle distribution will land tails in each of four tosses is.
∫ (1/a^2)(x - (M-a))x^4 dx + ∫ (-1/a^2)(x-(M+a))x^4 dx
= (1/a^2)[ ∫ (x - (M-a))x^4 dx - ∫ (x - (M+a))x^4 dx ]
= (1/a^2)[ ∫ x^5 - (M-a)x^4 dx - ∫ x^5 - (M+a)x^4 dx ]
The integrals are on different domains, so it may be clearer to calculate them seperately
∫ x^5 - (M-a)x^4 dx
= x^6/6 - (M-a)x^5/5 [M-a,M]
= M^6/6 - (M-a)M^5/5 - (M-a)^6/6 + (M-a)^6/5
= M^6/6 - M^6/5 + aM^5/5 - (M-a)^6/6 + (M-a)^6/5
= M^6/6 - M^5/5 + aM^5/5 + (M-a)^6/5 - (M-a)^6/6
= M^6(1/6 - 1/5) + aM^5/5 + (M-a)^6(1/5 - 1/6)
= ((M-a)^6)-M^6)(1/5 - 1/6) + aM^5/5
= ((M-a)^6)-M^6)(1/30) + aM^5/5
= (1/2)(1/15)((M-a)^6)-M^6) + aM^5/5
The second half has the same indefinite integral, but we are substracting that integral evaluated on the range [M,M+a]. This is equivalent to adding the evaluation on [M+a,M]. In other words, it is exactly the same expression, with the sign of a reversed. This saves a bunch of calculation, so we cut to the chase....
= (1/a^2)[(1/2)(1/15)((M-a)^6)-M^6) + aM^5/5 + (1/2)(1/15)((M+a)^6)-M^6) - aM^5/5]
= (1/a^2)[(1/2)(1/15)((M-a)^6)-M^6) + (1/2)(1/15)((M+a)^6)-M^6) ]
= (1/a^2)(1/15)(1/2)[((M-a)^6)-M^6) + ((M+a)^6)-M^6) ]
= (1/a^2)(1/15)(1/2)[((M-a)^6 + (M+a)^6)- 2 * M^6 ]
= (1/a^2)(1/15)[ M^6 + 15 M^4a^2 + 15 M^2 a^4 + a^6 - M^6 ]
= (1/a^2)(1/15)[ 15 M^4a^2 + 15 M^2 a^4 + a^6 ]
= M^4 + M^2 a^2 + (a^4)/15
And the usual test holds true.
Everything is exactly the same when calculating the average probability of those coins which land heads, except that the 6s and 5s become 7s and 6s.
∫ x^6 - (M-a)x^5 dx
= x^7/7 - (M-a)x^6/6 [M-a,M]
= (1/2)(1/21)((M-a)^7)-M^7) + aM^6/6
(1/a^2)[(1/2)(1/21)((M-a)^7)-M^7) + aM^6/6 + (1/2)(1/21)((M+a)^7)-M^7) - aM^6/6]
= (1/a^2)(1/21)[ M^7 + 21 M^5a^2 + 35 M^3 a^4 + 7Ma^6 - M^7 ]
= M^5 + (5/3) M^3 a^2 + (1/3)Ma^4
= M [ M^4 + (5/3) M^2 a^2 + (1/3)a^4 ]
= M [ M^4 + (5/3) M^2 a^2 + (1/3)a^4 ] / [ M^4 + M^2 a^2 + (a^4)/15 ]
The checks on the equations of the uniform distributions aren't particularly satisfactory, insofar as they really only confirm that the leading term is correct. For a more detailed test, we calculate a continuous form of our earlier discrete two class problem, to see if we get the same answer.
What we do here is consider a uniform distribution that appears in two distinct pieces. The probability is zero everywhere except when M-a Now, we can go through the bother of calculating two integrals (one from M-a to M-b, and the other from M+b to M+a), but there's a shortcut available. These two integrals together are equivalent to the integral on [M-a,M+a] minus the integral on [M-b,M+b], and we've already calculated that, which allows us to jump ahead several steps. 1/(a-b) [ M^4a + 2M^2a^3 + (a^5)/5 ] - [ M^4b + 2M^2b^3 + (b^5)/5 ] Our discrete case is really just the limit of this problem, in the limit b->a. = M^4 + 2M^2(a^2+aa+a^2) + (1/5)(a^4+a^3a+a^2a^2+aa^3+a^4) which checks with our previous result. We find the same is true when we look at the calculation of the average probability as well... 1/(a-b) [ M(M^4a+(10/3)M^2a^3+a^5) - M(M^4b+(10/3)M^2b^3+b^5) ] once again taking the limit b->a. With consistent results, we can feel confident that the analysis is sound.
= 1/(a-b) [ M^4(a-b) + 2M^2(a^3-b^3) + (1/5)(a^5-b^5) ]
= 1/(a-b) [ M^4(a-b) + 2M^2(a-b)(a^2+ab+b^2) + (1/5)(a-b)(a^4+a^3b+a^2b^2+ab^3+b^4) ]
= M^4 + 2M^2(a^2+ab+b^2) + (1/5)(a^4+a^3b+a^2b^2+ab^3+b^4)
= M^4 + 2M^2(3 a^2) + (1/5)(5 a^4)
= M^4 + 6M^2a^2 + a^4
= 1/(a-b) M [ M^4(a-b)+(10/3)M^2(a^3-b^3)+(a^5-b^5) ]
= 1/(a-b) M [ M^4(a-b)+(10/3)M^2(a-b)(a^2+ab+b^2)+(a-b)(a^4+a^3b+a^2b^2+ab^3+b^4) ]
= M [ M^4+(10/3)M^2(a^2+ab+b^2)+(a^4+a^3b+a^2b^2+ab^3+b^4) ]
= M [ M^4 + 10M^2a^2 + 5a^4 ]
The first distribution to be considered is the Uniform distribution. In a uniform distribution, there is a continuous set of possible values, each of which are equally likely.
In the general case, we suppose that all values in the range [M-a,M+A] are equally likely, and that outside that range the probability is zero. P(x) is going to be some constant value A, which must satisfy the equation
∫ A dx = 1
The calculation is pretty trivial to work through, but not so trivial as recognizing that we have a rectangle, A units high and 2a units wide, with area 1. Therefore
A = 1/2a.
Now the probability of the coin landing tails four times in a row is
∫ A x^4 dx
= A [ (M+a)^5 - (M-a)^5 ] / 5
= [ (M+a)^5 - (M-a)^5 ] / (2 * 5 * a)
Because we are subtracting, the even powers of a cancel out, and the odd powers remain, cancelling out the 2 in the denominator.
= [ 5M^4a + 10 M^2a^3 + a^5 ]/ (5 * a)
= M^4 + 2 M^2a^2 + (a^4)/5
Quick inspection shows that in the limit a->0, this looks exactly like our discrete case when all coins have probability M of landing tails, so the general form is certainly correct.
To determine the average probability of the coins that landed tails in all four trials, we do a similar integral
∫ A x^5 dx
= A [ (M+a)^6 - (M-a)^6 ] / 6
= [ (M+A)^6 - (M-a)^6 ] / ( 2 * 6 * a )
= [ 6 M^5a + 20 M^3a^3 + 6 Ma^5 ] / ( 6 * a )
= M [ M^4 + (10/3)M^2a^2 + a^4 ]
but that needs to be normalized in turn...
= M [ M^4 + (10/3)M^2a^2 + a^4 ] / [ M^4 + 2 M^2a^2 + (a^4)/5 ]
And this also checks in the case that a = 0.
There's no particular reason to assume that the distribution of probabilities must come in discrete lumps. So we now analyze continuous distributions - those in which the probability distribution is smeared over a number of possible values.
Before jumping into the three distributions which will be covered, it is worth taking a moment to preview the work that is to come.
There are a number of different possible distributions to consider. In each case, the analysis is much the same. First, the distribution is defined on some interval [M-a, M+a].
The definition will feature an arbitrary multiplicative constant in front. So the second step is to calculate the value of this constant - which is determined by recognizing that the integral satisfies the property
∫ P(x) dx = 1
In the distributions we'll be looking at, these constants will be trivial to calculate.
Having done this, the exercise is parallel to the discrete case. We first calculate ∫ x^4 P(x)dx, determining how many times we should expect that four flips all land tails. We then calculate ∫ x^5 P(x)dx, which combined with the previous result determines the expected probability of landing tails of those coins that did so in all four trials.
Because we are using integrals, rather than sums, the cancellation of terms differs slightly. Taking the integral promotes the exponent - we'll be looking at (M+a)^5, where we had previously seen (M+a)^4 terms; also, we'll be subtracting, rather than adding, the (M-a)^5 term. As in the previous case, this eliminates the odd power terms; the familiar factor of 1/2 keeps the even terms simple.
There will typically be two additional cancellations. The process of taking the integral will produce a number in the denominator which cancels the coefficient of the leading power of the expansion. The normalization constant will cancel part of the factor of the leading term, so the equations will reduce to those already seen in the limiting case.
The next exercise is to generalize our previous result. We continue to maintain the overall average, and examine what happens when we vary the magnitude of the bias.
In other words, instead of bags of coins that land tails with probability .5 + .25 and .5 - .25, we work through the same exercise with bags of coins that land tails with probability .5 + x and .5 - x. For my own sanity, let us define the median value M = .5.
P(A)
= (M+x)^4 * .5 + (M-x)^4 * .5
= [ (M+x)^4 + (M-x)^4 ] /2
At this point, we expand the expression in the brackets. Notice that the odd powers of x vanish, and the even powers of x get a contribution from each term which will cancel out the denominator.
P(A)
= [ (M+x)^4 + (M-x)^4 ] /2
= M^4 + 6 M^2x^2 + x^4
It's a good idea at this point to do a spot check - what happens when x is 0? In this case we find p(A) = M^4 = .5^4 which we know is right from flipping true coins. This is a test will be generally useful for checking that we've done the our math correctly, so file the idea away.
So what is the average probability of those coins that landed tails every time?
= ∑ fP
= f(B)P(B|A) + f(!B)P(!B|A)
= 1/2 [ (M+x)(M+x)^4 +(M-x)(M-x)^4 ] / ( M^4 + 6 M^2x^2 + x^4 )
= 1/2 [ (M+x)^5 + (M-x)^5 ] / ( M^4 + 6 M^2x^2 + x^4 )
= ( M^5 + 10 M^3x^2 + 5 Mx^4 ) / ( M^4 + 6 M^2x^2 + x^4 )
= M ( M^4 + 10 M^2^2 + 5 x^4 ) / ( M^4 + 6 M^2x^2 + x^4 )
We continue with our bags of biased coins, this time considering two different questions. Having flipped the coins, and collected 82 that all landed tails each time, we ask
What is the probability that a randomly chosen coin in this group is biased against tails?
What is the average probability of tossing tails again with each of these coins?
The first of these is pretty straightforward: we had 82 coins, one of which was actually biased against tails, so the probability is 1/82 = .0122.
Flipping 81 of the coins will produce tails again 75% of the time, so we should expect 60.75 more tails from that group. The other coin lands tails 25% of the time, so in total we expect 61 tails. We are flipping 82 coins to achieve that, so the probability of flipping tails on these coins is 74.39%
As it happens, there is a more direct way to calculate these, thanks to Bayes Theorem. Bayes theorem allows you to work a probability problem backwards - instead of asking "given a biased coin, what is the probability that it lands tails" you ask "given that a coin landed tails, what is the probability that it is biased".
We begin by defining the following symbol P(A|B) to represent the probability of event A, given that B occurred. Mathmatically, this is defined by the expression
P( A&B ) = P(A|B)P(B)
In our problem A might represent the event "flip tails four times in a row" and B the event "pick a coin biased toward tails". Of course, there's no particular reason to take the events in this order. One might instead write
P( A&B ) = P(B|A)P(A)
If we set these two equal to each other, we discover
P(B|A) = P(A|B)P(B)/P(A)
Reasonably, B or !B must be true, so we can write
P(A)
= P(A&B) + P(A& !B)
= P(A|B)P(B) + P(A|!B)P(!B)
So what is the probability that we flipped a biased coin (B), given that the coin we did flip landed tails four times in a row (A)? P(A|B) we determined
to be 81/256, P(A|!B) is 1 / 256, P(B) = P(!B) = 1/2.
P(B|A)
= P(A|B)P(B) / P(A)
= P(A|B)P(B) / [ P(A|B)P(B) + P(A|!B)P(!B) ]
= 81/256 * 1/2 / [ 81/256 * 1/2 + 1/256 * 1/2 ]
= 81/82
Hooray, it works.
What about the average probability? The expectation of a function f is
and the expectation of a function f, given A is
So the average probability of the coin landing tails is
In this next part, we begin examining what sorts of outcomes we might
expect from a population that do not all have the same probability of
failure.
Suppose we have 512 true coins, and we flip each of them four times.
How many times do we expect the coin to land tails?
How many of the coins should we expect to land tails in all four trials?
The probability that a true coin lands tails is 1/2. We are flipping
512 coins 4 times each, so we ought to expect that half of those (1024) land tails.
Each flip of a true coin is independent of the previous outcomes, so the probability of a single coin landing tails four times in a row is
(1/2)^4 = 1/16. With 512 coins, we would expect 32 of them to land tails every time.
Let us repeat this experiment, except this time we shall used biased coins. We'll have coins that land tails 75% of the time, and coins that land tails 25% of the time; an equal number of each. Let us then ask the same two questions again.
How many times do we expect the coin to land tails?
We are flipping 256 biased coins 4 times each. So the coins that land tails 25% of the time should produce tails 256 times. The coins biased the other way should land tails 768 times. So we get the same answer as before.
How many of the coins should we expect to land tails in all four trials?
IF the probability of landing tails once is 1/4, then the probability of landing tails four times in succession is 1/256. If the probability is 3/4, then the probability of 4 in a row is 81/256. Since we have 256 coins of each type (a fortuitous coincidence, that), we expect 82 coins to land tails four times in a row.
In other words, even though the big picture looks like that of a population of true coins, the clumping of the runs of tails tells a truer story.
In the initial stages of this analysis, we model a team's chances of advancing in the playoffs as being an independent trial - not dependent on the outcome of the playoffs in previous years.
We will also assume, for the moment, that the probability of advancing is constant.
We don't actually expect this to be true. As players age, they get better, or worse; the makeup of the team will change, the makeup of their opponents will change. But we can justify this simplification in the following way.
Let us suppose that the probability of failing to advance in each of four years is A,B,C, and D respectively. From this, it follows that the probability of failing in all four cases is the product of the probabilities = A * B * C * D.
Now, we define P = ( A + B + C + D ) /4. In other words, P is the average probability of failure. Can we legitimately substitute P for these other four values?
Support we define four more values (a,b,c,d) such that
A = P - a
B = P - b
C = P - c
D = P - d
it follows that the sum of these four values is zero.
0
= (A+B+C+D) - (A+B+C+D)
= 4P - ( P - a + P - b + P - c + P - d )
= 4P - 4P + (a+b+c+d)
= a + b + c + d
And from this, it follows that
A*B*C*D
= (P-a)(P-b)(P-c)(P-d)
= P ^ 4 - (a+b+c+d) P^3 + (ab+ac+ad+bc+bd+cd)P^2 - (abc+abd+acd+bcd)P + abcd
From the observation above, the second term vanishes. If the largest of a,b,c,d is small, relative to P, then multiplying two or more of them togather is going to be very small, relative to P. And so the variation can be excused in rough analysis.
For example, suppose that A,B,C,D are .43,.39,.39,.39. This approximation uses the average probability (.4), and concludes that the probability of losing four in a row is 0.0256; the correct answer is 0.02550717. The error is 0.364%. We can live with that for now.
"My shit doesnt't work in the playoffs."
The lament of Billy Beane, oft quoted by his supporters, and held against him by his detractors. The notion that once teams reach the playoffs, the outcome is effectively a crapshoot.
If a team had a 50-50 chance of advancing past the first round of the playoffs, then we ought to expect that a team reaching the playoffs four times will advance twice.
So when a team loses in the fourth round of the playoffs for the fourth consecutive year, is it fair to assume that the team has had some fundamental flaw, that it has failed to advance?
This series will explore this question in some detail.