Created
February 19, 2023 20:03
-
-
Save harukaeru/1d57cb055701f699c79201f8f4f15235 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
matplotlib.rcParams['font.family'] = 'Hiragino Maru Gothic Pro' | |
import matplotlib.pyplot as plt | |
import numpy as np | |
data = [{ | |
"name": "東京の殺人発生率(認知件数をもとに計算)", | |
"rate": "8.89/1000000", | |
"src": "http://grading.jpn.org/Divy2502002.html" | |
}, { | |
"name": "宝くじで5等(1万円)以上が当たる確率", | |
"rate": "41165/10000000", | |
"src": "https://www.takarakuji-official.jp/brand/jumbo/product/product.html" | |
}, { | |
"name": "宝くじで3等(100万円)以上が当たる確率", | |
"rate": "165/10000000", | |
"src": "https://www.takarakuji-official.jp/brand/jumbo/product/product.html" | |
}, { | |
"name": "偏差値60(正規分布)", | |
"rate": "0.1586552539", | |
"src": "計算による" | |
}, { | |
"name": "偏差値70(正規分布)", | |
"rate": "0.02275013195", | |
"src": "計算による" | |
}, { | |
"name": "偏差値80(正規分布)", | |
"rate": "0.001349898032", | |
"src": "計算による" | |
}, { | |
"name": "偏差値90(正規分布)", | |
"rate": "0.00003167124183", | |
"src": "計算による" | |
}, { | |
"name": "偏差値100(正規分布)", | |
"rate": "0.0000002866515719", | |
"src": "計算による" | |
}, { | |
"name": "偏差値110(正規分布)", | |
"rate": "0.0000000009865877004", | |
"src": "計算による" | |
}, { | |
"name": "景表法による景品の確率下限(2%)", | |
"rate": "2/100", | |
"src": "https://www.caa.go.jp/policies/policy/representation/fair_labeling/faq/premium/" | |
}, { | |
"name": "ポケモンが色違いである確率(再試行禁止)", | |
"rate": "1/4096", | |
"src": "" | |
}, { | |
"name": "40人クラスで同じ誕生日の人がいる確率", | |
"rate": "89/100", | |
"src": "" | |
}, { | |
"name": "人生で雷に打たれる確率", | |
"rate": "1/10000", | |
"src": "https://wired.jp/2013/02/18/asteroid-odds/" | |
}, { | |
"name": "ガンになる確率(男性)", | |
"rate": "63/100", | |
"src": "https://www.hmp.or.jp/whatsnew/column/2020/00129" | |
}, { | |
"name": "ガンになる確率(女性)", | |
"rate": "48/100", | |
"src": "https://www.hmp.or.jp/whatsnew/column/2020/00129" | |
}, { | |
"name": "東進ハイスクール生/日本人口", | |
"rate": "1200000/120000000", | |
"src": "https://shingaku.jdnet.jp/column/202012-ranking-number-of-students.html" | |
}, { | |
"name": "ワクチン未摂取者の割合", | |
"rate": "18.6/100", | |
"src": "(2023/02/16時点) https://vdata.nikkei.com/newsgraphics/coronavirus-japan-vaccine-status/" | |
}, { | |
"name": "ワクチン4回接種済みの人の割合", | |
"rate": "57675556/120000000", | |
"src": "(2023/02/16時点) https://vdata.nikkei.com/newsgraphics/coronavirus-japan-vaccine-status/" | |
}, { | |
"name": "日本人口に対するタレントの割合(日本タレント名鑑)", | |
"rate": "30000/120000000", | |
"src": "https://prtimes.jp/main/html/rd/p/000000011.000006657.html" | |
}, { | |
"name": "世界のうち日本人が占める割合", | |
"rate": "120000000/8000000000", | |
"src": "" | |
}, { | |
"name": "交通事故で死ぬ確率(1年)", | |
"rate": "3500/120000000", | |
"src": "https://www.jili.or.jp/lifeplan/lifesecurity/1224.html" | |
}, { | |
"name": "1/日本人口", | |
"rate": "1/120000000", | |
"src": "" | |
}, { | |
"name": "交通事故で死ぬ確率(60年)", | |
"rate": "0.00174849511", | |
"src": "https://www.jili.or.jp/lifeplan/lifesecurity/1224.html" | |
}, { | |
"name": "航空機事故に遭遇する確率", | |
"rate": "0.00009/100", | |
"src": "https://www.itmedia.co.jp/makoto/articles/1503/25/news012.html" | |
}, { | |
"name": "1/世界人口", | |
"rate": "1/8000000000", | |
"src": "" | |
}, { | |
"name": "オスの三毛猫が生まれる確率", | |
"rate": "1/30000", | |
"src": "https://chojabaru.com/news/%E4%B8%89%E6%AF%9B%E7%8C%AB%E3%81%AF%E3%81%BB%E3%81%A8%E3%82%93%E3%81%A9%E3%81%8C%E3%83%A1%E3%82%B9%EF%BC%9F/" | |
}, { | |
"name": "サイコロで1が出る確率", | |
"rate": "1/6", | |
"src": "" | |
}, { | |
"name": "既婚率(男女の調和平均)", | |
"rate": "0.5883870967741935", | |
"src": "https://www.stat.go.jp/data/kokusei/2005/kihon1/00/03.html" | |
}, { | |
"name": "離婚率", | |
"rate": "35/100", | |
"src": "https://ricon-pro.com/columns/81/" | |
}, { | |
"name": "1日のうちの1秒", | |
"rate": "1/86400", | |
"src": "" | |
}, { | |
"name": "相貌失認の割合", | |
"rate": "2/100", | |
"src": "https://www.hospita.jp/disease/1953" | |
}, { | |
"name": "天和が出る確率", | |
"rate": "1/20000", | |
"src": "https://mj-news.net/column/report/2017120883348" | |
}, { | |
"name": "宝くじで1等が当たる確率", | |
"rate": "1/10000000", | |
"src": "https://www.takarakuji-official.jp/brand/jumbo/product/product.html" | |
}, { | |
"name": "消費税", | |
"rate": "10/100", | |
"src": "" | |
}, { | |
"name": "有意水準(5%)", | |
"rate": "5/100", | |
"src": "" | |
}, { | |
"name": "三つ子が生まれる確率", | |
"rate": "1.16/10000", | |
"src": "https://jamba.or.jp/to_family/futago-knowledge/stats_and_facts_general1/" | |
}, { | |
"name": "四つ子が生まれる確率", | |
"rate": "1.5/1000000", | |
"src": "https://jamba.or.jp/to_family/futago-knowledge/stats_and_facts_general1/" | |
}, { | |
"name": "野球部員全体に対して、プロ野球選手になる人の割合", | |
"rate": "0.16/100", | |
"src": "https://www.gtasu.com/special/centerline/019.html" | |
}, { | |
"name": "プロ棋士/将棋人口", | |
"rate": "230/5000000", | |
"src": "https://news.yahoo.co.jp/byline/kosakunoboru/20221111-00323461 https://www.shogi.or.jp/knowledge/world/01.html" | |
}, { | |
"name": "買った卵が汚染されている確率(サルモネラ食中毒)", | |
"rate": "0.0029/100", | |
"src": "https://www.toholab.co.jp/info/archive/2321/" | |
}, { | |
"name": "裁判員に選ばれる確率(1年)", | |
"rate": "1/8700", | |
"src": "https://www.moj.go.jp/k/saibanin/08.html" | |
}, { | |
"name": "先天色覚異常の発生割合(日本人男性)", | |
"rate": "5/100", | |
"src": "https://www.santen.co.jp/ja/healthcare/eye/library/color_deficiency" | |
}, { | |
"name": "先天色覚異常の発生割合(日本人女性)", | |
"rate": "0.2/100", | |
"src": "https://www.santen.co.jp/ja/healthcare/eye/library/color_deficiency" | |
}, { | |
"name": "食物アレルギー保有率", | |
"rate": "1/3", | |
"src": "https://www.mhlw.go.jp/new-info/kobetu/kenkou/ryumachi/dl/jouhou01-08.pdf" | |
}, { | |
"name": "全TOEIC受験者に対して990点を取った人の割合", | |
"rate": "0.3/100", | |
"src": "https://minchalle.com/blog/toeic-perfect-score" | |
}, { | |
"name": "APEX プレデター帯", | |
"rate": "0.2/100", | |
"src": "https://youtubemtm.com/%E3%80%90apex-legends%E3%80%91%E3%83%A9%E3%83%B3%E3%82%AF%E5%89%B2%E5%90%88%E5%88%86%E5%B8%83%E3%81%BE%E3%81%A8%E3%82%81-2%E6%9C%88%E3%80%90%E3%82%B7%E3%83%BC%E3%82%BA%E3%83%B316%E3%80%91%E3%80%90/" | |
}] | |
def adjust(name): | |
if name == '買った卵が汚染されている確率(サルモネラ食中毒)': | |
return -0.02 | |
return 0 | |
# 確率または割合を数値に変換する関数 | |
def convert_rate(rate): | |
if '/' in rate: | |
parts = rate.split('/') | |
return float(parts[0]) / float(parts[1]) | |
else: | |
return float(rate) | |
# データを1次元散布図にplot | |
names_rates = [(convert_rate(d['rate']), d['name']) for d in data] | |
names_rates.sort() | |
names = [nr[1] for nr in names_rates] | |
rates = [nr[0] for nr in names_rates] | |
fig, ax = plt.subplots(figsize=(6, 10)) | |
scatter = ax.scatter(np.zeros_like(rates), rates, zorder=2) | |
ax.set_yscale('log') | |
ax.set_ylim([10**(-10), 10**0]) | |
ax.set_ylabel('確率or割合(10^(+1)違うと10倍起こりやすい)') | |
ax.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False) | |
ax.set_yticks([10**(i/2) for i in range(-20, 1)]) | |
ax.set_axisbelow(True) | |
FONTSIZE = 8 | |
for y, i in [(10**(i/2), i) for i in range(-20, 1)]: | |
if i % 2 == 0: | |
ax.axhline(y=y, color='lightgray', linewidth=0.6, zorder=1) | |
else: | |
ax.axhline(y=y, color='lightgray', linewidth=0.3, zorder=1) | |
for i, name in enumerate(names): | |
v = adjust(name) | |
if i % 2 == 0: | |
ax.text(0.002, rates[i] * (10 ** v), name, va='center', fontsize=FONTSIZE) | |
else: | |
ax.text(-0.002, rates[i] * (10 ** v), name, va='center', ha='right', fontsize=FONTSIZE) | |
# fig.canvas.mpl_connect("motion_notify_event") | |
plt.show() |
Author
harukaeru
commented
Feb 19, 2023
さまざまな確率の分布表です。
確率や割合というと、 0.1%
、1%
、0.005%
、3/78
、36人に1人
、などいろいろありますが、ぶっちゃけ数が小さくなってくるとよくわからなくなってしまうので、対数グラフにしてみました。
どれがどのぐらい発生するのか、どのぐらいレアなのかを、視覚で見ておけて、肌感覚で「思っていたよりもレアじゃなかった」「わりと起こりうる」「自分には起こらないけど、世界のどこかでは起こりうる」というのがわかるので、結構便利そうな気がします。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment