Differences between revisions 1 and 2
 ⇤ ← Revision 1 as of 2007-06-30 02:18:30 → Size: 2636 Editor: OlegKobchenko Comment: ← Revision 2 as of 2008-12-08 10:45:53 → ⇥ Size: 2636 Editor: anonymous Comment: converted to 1.6 markup No differences found!

## Combining In-Line and Multi-Line Formats

Let and be the population mean and standard deviation. Fix the sample size . Let be the sample mean, the sample variance given by

It is elementary to show . We now show .

since .

Then

But , , so

## Combining LaTeX and Code Blocks

  NB. u adjusts deviation population size when computing variance
NB. y is population
NB. x is the sample size
mean=: +/ % #
s0=: %:@((%u)~@# * mean)@:*:@:- mean NB. "sample standard deviation"
s1=: %:@mean@:*:@:- mean              NB. "population standard deviation"
n=:x
n1=:u n

mu=: mean y =.x:y

all possible samples (each has equal probability)
possibilities=:y {~"1 (n##y)#:i.n^~#y
•   t0=: ([:+/2^~]-mean)"1 possibilities

  t1=: ([:+/2^~(mu-~])-mu-~mean)"1 possibilities
assert.t0-:t1

,

  t2=: (([:+/2^~mu-~])-n*2^~mu-~mean)"1 possibilities
assert.t0-:t2

since .

  assert. 1=#~.(([:+/mu-~])"1;((n*mu)-~+/)"1;(n*mu-~mean)"1) possibilities

Then

  t3=: mean *:@s0"1 possibilities
t4=: mean ((%n1)*[:+/2^~]-mean)"1 possibilities
assert. t3-:t4

  t5=:(%n1)* ( (+/n#mean *:mu-~y)) - n*([:mean ([:*:mu-~mean)"1) possibilities
assert. t3-:t5

  t6=:(%n1)* (+/*:n#s1 y) - n* *:@s1@:(mean"1) possibilities
assert. t3-:t6

But , , so

  assert. (*:s1 mean"1 possibilities) -: (%n) * *:s1 y

.

  t7=: (%n1)* (n**:s1 y) - *:s1 y
assert. t3-:t7

LaTeX/Mode Mix Example (last edited 2008-12-08 10:45:53 by anonymous)