%% File: p4.m
%% Read text file into array A, compute table, alphabet, index array IC
p2;
%% Use arithmetic coding to arithmetically encode the sequence of indices
code=arithenco(IC,table);
compression_ratio=(8*length(A))/length(code)
