<s>
Truncated	B-Algorithm
binary	I-Algorithm
encoding	I-Algorithm
is	O
an	O
entropy	B-Algorithm
encoding	I-Algorithm
typically	O
used	O
for	O
uniform	O
probability	O
distributions	O
with	O
a	O
finite	O
alphabet	O
.	O
</s>
<s>
Truncated	B-Algorithm
binary	I-Algorithm
encoding	I-Algorithm
assigns	O
the	O
first	O
u	O
symbols	O
codewords	O
of	O
length	O
k	O
and	O
then	O
assigns	O
the	O
remaining	O
n	O
−	O
u	O
symbols	O
the	O
last	O
n	O
−	O
u	O
codewords	O
of	O
length	O
k	O
+	O
1	O
.	O
</s>
<s>
Because	O
all	O
the	O
codewords	O
of	O
length	O
k	O
+	O
1	O
consist	O
of	O
an	O
unassigned	O
codeword	O
of	O
length	O
k	O
with	O
a	O
"	O
0	O
"	O
or	O
"	O
1	O
"	O
appended	O
,	O
the	O
resulting	O
code	O
is	O
a	O
prefix	B-Algorithm
code	I-Algorithm
.	O
</s>
<s>
are	O
also	O
known	O
as	O
truncated	B-Algorithm
binary	I-Algorithm
encoding	I-Algorithm
.	O
</s>
<s>
Truncated	B-Algorithm
binary	I-Algorithm
encoding	I-Algorithm
assigns	O
the	O
first	O
u	O
symbols	O
the	O
codewords	O
00	O
,	O
01	O
,	O
and	O
10	O
,	O
all	O
of	O
length	O
2	O
,	O
then	O
assigns	O
the	O
last	O
n	O
−	O
u	O
symbols	O
the	O
codewords	O
110	O
and	O
111	O
,	O
the	O
last	O
two	O
codewords	O
of	O
length	O
3	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
n	O
is	O
5	O
,	O
plain	O
binary	O
encoding	O
and	O
truncated	B-Algorithm
binary	I-Algorithm
encoding	I-Algorithm
allocates	O
the	O
following	O
codewords	O
.	O
</s>
<s>
Generate	O
the	O
truncated	B-Algorithm
binary	I-Algorithm
encoding	I-Algorithm
for	O
a	O
value	O
x	O
,	O
0	O
≤	O
x	O
< n, where n >	O
0	O
is	O
the	O
size	O
of	O
the	O
alphabet	O
containing	O
x	O
.	O
n	O
need	O
not	O
be	O
a	O
power	O
of	O
two	O
.	O
</s>
<s>
This	O
indicates	O
that	O
relative	O
efficiency	O
of	O
truncated	B-Algorithm
binary	I-Algorithm
encoding	I-Algorithm
increases	O
as	O
probability	O
p	O
of	O
k-bit	O
symbols	O
increases	O
,	O
and	O
the	O
raw-encoding	O
symbol	O
bit-length	O
decreases	O
.	O
</s>
