Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

determine random bitstream compression based on 0/1 ratio
Hi

I'm looking for a way to determine how many bits a random distributed
bitstream can be compressed based on the 0/1 ratio.

For example if we have 1000.000 random bits with these 0/1 ratios:

450.000/550.000
400.000/600.000
300.000/700.000

How do i calculate the possible compression in bits. I know how to do
this by using factorials, but i'm looking for a way to do it without
them, because it doesn't work well on big numbers.

Thanks for any help with this.

Best regards,
Rick


Report this thread to moderator Post Follow-up to this message
Old Post
Rick
05-13-05 08:56 PM


Re: determine random bitstream compression based on 0/1 ratio
Rick wrote:
> Hi
>
> I'm looking for a way to determine how many bits a random distributed
> bitstream can be compressed based on the 0/1 ratio.
>
> For example if we have 1000.000 random bits with these 0/1 ratios:
>
> 450.000/550.000
> 400.000/600.000
> 300.000/700.000
>
> How do i calculate the possible compression in bits. I know how to do
> this by using factorials, but i'm looking for a way to do it without
> them, because it doesn't work well on big numbers.
>
> Thanks for any help with this.
>
> Best regards,
> Rick

H = p0 log 1/p0 + p1 log 1/p1

where p0 and p1 are the probabilities of a 0 or 1 bit (e.g. .45 and .55
in your first example), logs are base 2, and H is the number of output
bits per input bit.

-- Matt Mahoney


Report this thread to moderator Post Follow-up to this message
Old Post
Matt Mahoney
05-13-05 08:56 PM


Re: determine random bitstream compression based on 0/1 ratio
"Matt Mahoney" <matmahoney@yahoo.com> wrote in
news:1115998150.677621.162540@o13g2000cwo.googlegroups.com:

>
> Rick wrote: 
>
> H = p0 log 1/p0 + p1 log 1/p1
>
> where p0 and p1 are the probabilities of a 0 or 1 bit (e.g. .45 and .55
> in your first example), logs are base 2, and H is the number of output
> bits per input bit.
>
> -- Matt Mahoney
>
>

The formula you give is based on knowing the probabilites before
hand. And don't include the cost of learning what those probabilites
are. So if it varies from stream to stream you either have to do it
in 2 pasess and pass a table or do it adaptively.

To model the cost of adding table see

Analysis of Arithmetic Coding for Data Compression
Paul G. Howard and Jeffrey Scott Vitter
Brown University
Tech Report N0. Cs-92-17

David A. Scott
--
My Crypto code
http://bijective.dogma.net/crypto/scott19u.zip
http://www.jim.com/jamesd/Kong/scott19u.zip old version
My Compression code http://bijective.dogma.net/
**TO EMAIL ME drop the roman "five" **
Disclaimer:I am in no way responsible for any of the statements
made in the above text. For all I know I might be drugged.
As a famous person once said "any cryptograhic
system is only as strong as its weakest link"


Report this thread to moderator Post Follow-up to this message
Old Post
David A. Scott
05-14-05 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compression archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:09 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.