Skip to content

Instantly share code, notes, and snippets.

@arcturusannamalai
Last active March 1, 2019 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arcturusannamalai/531f5e7af62fbd982952adedaa508004 to your computer and use it in GitHub Desktop.
Save arcturusannamalai/531f5e7af62fbd982952adedaa508004 to your computer and use it in GitHub Desktop.
Experiment to see 247 Tamil letters mapped into a 4x3 Telephone keypad.
# Code for blog post: https://ezhillang.blog/2019/03/01/tamil-entry-via-keypad/
# This code is in Public Domain.
from math import factorial as f
from math import log
def comb(n, k):
return (f(n) / f(k)) / f(n - k)
def nck(n,k):
return comb(float(n),float(k))
C1 = nck(19,4)*nck(13,3)
print "C1", C1
C2 = nck(13,4)*nck(19,3)
print "C2", C2
print "Total=",C1+C2
print "Logaritmic capacity for 247 letters = ",log(247.0)/log(2.0)
print "Grand total", f(3)*f(4.0)*(C1+C2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment