LoginSignup
2
0

More than 3 years have passed since last update.

ビッグバンの定理を検証してみた【そろそろ帰着にかかるか】

Last updated at Posted at 2020-09-10

ビッグバンの定理とは…

どんな言葉でも「ビッグバン」に帰着するという説

引用

どの言葉も辞書で意味を遡るとビッグバンに辿り着く説を検証してみた。
https://www.youtube.com/watch?v=CN7q1thA7mU

実装

今回は「MediaWiki API」を使用し、記事へリンクしている記事の一覧を取得し
どれくらいの記事がビッグバンの記事にリンクされるか検証する

ソース

python
url = "http://ja.wikipedia.org/w/api.php"
payload = {"format":"json", "action":"query", "list":"backlinks", "blnamespace":"0"}
payload['bltitle'] = word
r = requests.get(url, params=payload)

# json整形
json_load = r.json()
json_load = json.dumps(json_load)
json_load = json.loads(json_load)

# 一部切り出し
json_load = json_load['query']['backlinks']

theList = []
# 記事分をループ
for value in json_load:

    theDict = {}
    theDict['id'] = value['pageid']
    theDict['title'] = value['title']

    theDict['blTitle'] = word

    theDict['url'] = 'https://ja.wikipedia.org/wiki/' + value['title']
    theDict['floor'] = floor
    theDict['ns'] = value['ns']

    theList.append(theDict)

dataFrame = pd.io.json.json_normalize(theList)

参考

検証結果

https://ja.wikipedia.org/wiki/Wikipedia:日本語版の統計
より記事総数を「1227198」件とする
※2020年9月現在

image.png

n=ビッグバンに帰着するまでの回数

代表値

n=0
・ビッグバン

n=1
・物理学
・年表
・宇宙論

n=2
・地理学
・生物
・生物学

出力結果CSV

全取得結果(記事の重複あり)
https://github.com/Syogo-Suganoya/bigBanete/blob/master/downloads/record.csv

全取得結果(記事の重複なし)
https://github.com/Syogo-Suganoya/bigBanete/blob/master/downloads/uniqueRecord.csv

結論

試行回数10回目で記事リンクのループが発生し、記事網羅率が天井に達した。
ビッグバンの日本語記事における網羅率(ビッグバネイト率)は0.0993%で、
命題「どんな言葉でも「ビッグバン」に帰着する」というのは間違いである。


github

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0