Sunday, October 28, 2018

Run time Huffman coding

The basic ide is to remove and add new queue elements onto the treem and slowly morph it.  To do thios, take te item to be removed or added, and descend the tree ewith it, looking to see iof the new item is more rare than the nerxt to offspring.  Also decrement or increent counts during the descent.

When the new element is more rre than the offspring, take the leasty likely of the two and pair it up with the new rentry, pair it up with the old entry removed, either way. But at that point in the tree, the algorithm recursers the sub graph and repeats the process,.

Yea, make for a great autobanker.

Here is the map for a uniform 8 bit random number. Notice it is balanced, no spectral pecularities. This method will detect imbalanced random number generators.

 

                                         161                                     
                    64                                      97                  
          32                  32                  36                  61        
     16        16        16        16        16        20        29        32   
  8    8    8    8    8    8    8    8    8    8    8    12   13   16   16   16 
 4 4  4 4  4 4  4 4  4 4  4 4  4 4  4 4  4 4  4 4  4 4  6 6  6 7  8 8  8 8  8 8 
2222 2222 2222 2222 2222 2222 2222 2222 2222 2222 2222 3333 3334 4444 4444 4444 
1111 1111 1111 1111           1111      1111 1111              2 2222 2222 2222 
                                                                      1111 1111 
                                                                                
    

Inverting, of finding the complement. If the uniform tree is balance, then take an imbalanced tree and add the minimum branches to balance he tree. The adjoining sudb graph added should generate the unused quants, quants dumped due to compression. Decode is to traverse down the tree, encode is up, if I have that right. Stocks The graph of the S&P500 will become suddenly asymmetric during a recession when the window is a full eight years. During the transition everything jams as the market resorts. When the market is stable then it changes like the run time encoder, a node at a time, adiaticaly. Not in a sudden downturn. I will encode price times volume an get the total market money moved, month;y from this data. We cn see the graph change during recession.

No comments: