Talk:Arithmetic coding/As a generalized change of radix: Difference between revisions

m
Line 15:
:: The J implementation does not use <code>cumulative frequency</code> for this task. The wikipedia clearly specifies that <code>frequency</code> and not <code>cumulative frequency</code> should be used for this task. Instead, it introduces <code>cumulative frequency</code> for the decoding operation.
:: So why are people using <code>cumulative frequency</code> for this task? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 16:24, 28 January 2016 (UTC)
 
::: I'm not sure if I understood your point correctly, but maybe this will clarify something. As Wikipedia describes it, in the encoding process, the formula to calculate the lower bound <math>L</math>, is:
::::<math> \mathrm{L} = \sum_{i=1}^n n^{n-i} C_i { \prod_{k=1}^{i-1} f_k } </math> where <math>\scriptstyle C_i</math> are the cumulative frequencies and <math>\scriptstyle f_k</math> are the frequencies of occurrences.
:::: After that, we compute the upper bound as follows:
:::::<math> \mathrm{U} = \mathrm{L} + \prod_{k=1}^{n} f_k </math>
:::: After this point, it doesn't matter which number <math>N</math> we return, as long as <math>L <= N < U</math>. --[[User:Trizen|Trizen]] ([[User talk:Trizen|talk]]) 17:28, 28 January 2016 (UTC)
2,747

edits