OFFSET
1,1
COMMENTS
Interpretation: Start with a portfolio of stocks A and B each worth $1, and flip a pair of coins. Stock A doubles if the first coin is heads and otherwise stays constant. Stock B doubles if the second coin is heads and otherwise stays constant. This sequence gives your median portfolio value after n pairs of coin flips.
Although a median of integers can be a half-integer, as an empirical observation only integers appear in this sequence.
The mean of 2^X + 2^Y is 2(3/2)^n.
LINKS
Robert Israel, Table of n, a(n) for n = 1..5299
MAPLE
f:= proc(n)
local PX, i, pt, j;
for i from 0 to n do PX[i]:= binomial(n, i)/2^n od:
pt:= 0:
for j from 0 while pt^2 < 1/2 do pt:= pt + PX[j] od:
j:= j-1:
pt:= (pt-PX[j])^2:
for i from 0 do
pt:= pt + 2*PX[j]*PX[i];
if pt = 1/2 then error("Probability 1/2 for i=%1 j=%2", i, j) fi;
if pt > 1/2 then return(2^i + 2^j) fi
od:
end proc:
map(f, [$1..60]); # Robert Israel, Jun 21 2017
MATHEMATICA
TwoToThe[x_] := 2^x;
WeightsMatrix[n_] := Table[Binomial[n, i] Binomial[n, j], {i, 0, n}, {j, 0, n}]/2^(2 n);
ValuesMatrix[n_, f_] := Table[f[i] + f[j], {i, 0, n}, {j, 0, n}];
Distribution[n_, f_] := EmpiricalDistribution[Flatten[WeightsMatrix[n]] -> Flatten[ValuesMatrix[n, f]]];
NewMedian[n_, f_] := Mean[Quantile[Distribution[n, f], {1/2, 1/2 + 1/2^(2 n)}]];
Table[NewMedian[n, TwoToThe], {n, 42}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Matt Frank, Jun 08 2017
STATUS
approved