Written by Robert Hodges This Program calculates the entropy of a source S with ratio (and therefore probablilty) distribution (r1 r2 r3 r4 r5....rn) (where numerals and n are subscript!). It uses the basic formula n H(S)=- ri log2 ri (i & 2 are subscript) i=1 Just run the program, then type in all the ratios pressing EXE after each one. When all the ratios are entered, enter in 0 as a ratio. The entropy will soon follow 'ENTROPY' Defm 30 0 -> A : 0 -> C Lbl 1 Isz A "R" ? -> Z[A] Z[A]+C -> C 0<>Z => Goto 1 {<> means 'does not equal'} A-1 -> N : 0 -> A Lbl 2 Isz A Z[A]/C -> Z[A] A<>N => Goto 2 0 -> A : 0 -> @ {denotes theta} Lbl 3 Isz A -Z[A]*log Z[A] + @ ->@ {NO BRACKETS} A<>N => Goto 3 @/log 2 If there are any problems, e-mail me at casio@bayliss.demon.co.uk