'''
Generate list of key frequencies & dump to file
'''

import math

fOut = 'fk_1.2.txt'
alpha = 1.2
k = 100 #No of keys

H = 0.0
for i in range(1, k + 1):
    H += 1/math.pow(i, alpha)
fdOut = open(fOut, 'w')
fdOut.write('COMPOSITE TABLE:\nk\tf\n!================\n')
for i in range(1, k + 1):
    fdOut.write('k' + str(i) + '\t' + str(1/math.pow(i, alpha)/H) + '\n')
fdOut.close()

