Content deleted Content added
→Further reading: repair e.l. |
→Construction of codes: try to fix the math; see talk page |
||
Line 19:
Golomb–Rice codes can be thought of as codes that indicate a number by the position of the ''bin'' (''q''), and the ''offset'' within the bin (''r''). The above figure shows the position ''q'' and offset ''r'' for the encoding of integer ''N'' using Golomb–Rice parameter ''M''.
Formally, the two parts are given by the following expression, where <math>x</math> is the
:<math>q = \left \lfloor \frac{
and
:<math>r = x -
[[Image:GolombCodeRedundancy.svg|300px|This image shows the redundancy of the Golomb code, when M is chosen optimally for ''p'' ≥ 1/2.|thumb|right]]
The best choice of parameter ''M'' is a function of the corresponding [[Bernoulli process]], which is parameterized by <math>p=P(X=0)</math> the probability of success in a given [[Bernoulli trial]]. <math>M</math> is either the median of the distribution or the median +/− 1. It can be determined by these inequalities:
: <math>(1-p)^M + (1-p)^{M+1} \leq 1 < (1-p)^{M-1} + (1-p)^M,</math>
|