Skip to content

Instantly share code, notes, and snippets.

@kimdwkimdw
Last active August 29, 2015 14:01
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 kimdwkimdw/acbcf7e3e1997597b22c to your computer and use it in GitHub Desktop.
Save kimdwkimdw/acbcf7e3e1997597b22c to your computer and use it in GitHub Desktop.
MBTI population
# coding: utf-8
# https://groups.google.com/d/topic/jaylang/ziJKc6DhZNU/discussion
# population: http://books.google.co.kr/books?id=p_lo1_tL_YIC&lpg=PA147&ots=mfTqm8Sl_a&pg=PA147#v=onepage&q&f=false
# couple: http://www.google.com/url?q=http%3A%2F%2Fmindwatching.kr%2Fentry%2F%25EB%258B%25B9%25EC%258B%25A0%25EC%259D%2598-%25EC%2597%25B0%25EC%2595%25A0%25EA%25B0%2580-%25EC%2598%25A4%25EB%259E%2598%25EA%25B0%2580%25EC%25A7%2580-%25EB%25AA%25BB%25ED%2595%2598%25EB%258A%2594-%25EC%259D%25B4%25EC%259C%25A0-1&sa=D&sntz=1&usg=AFQjCNHlNOMK_BajlBKXFhTxF7KoLVN2aA
ratio = [11.6,13.8,1.5,2.1,5.4,8.8,4.4,3.3,4.3,8.5,8.1,3.2,8.7,12.3,2.5,1.8]
type = ['ISTJ','ISFJ','INFJ','INTJ','ISTP','ISFP','INFP','INTP','ESTP','ESFP','ENFP','ENTP','ESTJ','ESFJ','ENFJ','ENTJ']
probs = [ (r1*r2/(100**2),
len([type[i1][i] for i in range(4)
if type[i1][i] == type[i2][i] ]) )
for i1, r1 in enumerate(ratio)
for i2, r2 in enumerate(ratio)]
v = [ sum( [ prob for prob, cnt in probs if cnt==i ])
for i in range(5) ]
print "\t population, couple"
for match, p1, p2 in zip(range(5), v, [0.04, 0.19, 0.33, 0.35, 0.09]):
print "match %d: %9.1f%%, %5.1f%%" % (match, p1*100, p2*100)
@kimdwkimdw
Copy link
Author

by population, couple
match 0: 5.4%, 4.0%
match 1: 21.9%, 19.0%
match 2: 36.2%, 33.0%
match 3: 28.4%, 35.0%
match 4: 8.7%, 9.0%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment