in reply to Re: Runs and Sequences
in thread Runs and Sequences

Neat, that works to. Though of course it doesn't actually generate the data, you'd have to save the output of the code i posted to a file.txt and then read that in. I'm not sure if you could cache a spetillion chars... ?

Replies are listed 'Best First'.
Re^3: Runs and Sequences
by GrandFather (Saint) on Sep 09, 2005 at 18:36 UTC

    Hey, we don't have to give you the whole answer in one hit here :)

    Exercise for the student:

    1. Add the data generation code for some given finite number of tosses
    2. Adapt the resulting code to deal with very long series

    You should reply to this with your solution. For bonus marks you should compare the execution time for this technique with other techniques that have, or may be, posted. Have fun.


    Perl is Huffman encoded by design.