Last active
March 24, 2022 10:04
-
-
Save kurubushi--rm/a5e005e228db1d3cb4cef16e7ba7eb43 to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Pythonでブール代数アプローチをやってみた " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Pythonで書かれた、fsQCAもできる、ちゃんとしたライブラリ\n", | |
"http://grundrisse.org/qca/\n", | |
"もあるらしいけど、お手製で" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## ブール代数アプローチって何なのさ?\n", | |
"\n", | |
"ブール代数アプローチは、 Ragin(1989)によって、真理表とブール代数に依拠した比較分析の手法として、質的比較分析(Qualitative Comparative Analysis 略称:QCA)という名称で提起されたものである。\n", | |
"\n", | |
"※Ragin, C. C. (1989). The Comparative Method: Moving Beyond Qualitative and Quantitative Strategies. Univ of California Press.\n", | |
"\n", | |
"定式化/標準化されたアルゴリズムをもちいて論理式を縮約する手法は、従来、主に論理回路分析の簡単化(minimization)等に用いられてきたが、Raginは、この手法を社会現象の生起条件の分析に適用した。すなわち、質的比較分析では、複数の原因条件の組み合わせを比較を通じて体系的に絞り込んでいくために、分析対象の社会現象を生起させる条件を論理式の形で表現し、論理式の縮約によって簡潔な表現に変換することで、結果現象に対する原因条件の十分性/必要性を検討していく。こうした分析を通じて、社会現象が類似した結果へと至る場合に、それがどのような原因条件の組み合わせによって生じ得るかを体系的かつ実証的に明示できる。\n", | |
"\n", | |
"このアプローチは、Ragin(1987)の副題にあるように、計量的研究と質的研究、変数指向アプローチと事例指向アプローチを相補的に統合することを企図している。\n", | |
"鹿又・野宮・長谷川(2001)によれば、その特徴は、\n", | |
"\n", | |
"1. 社会現象の多様性と同時に因果関係の複雑性を分析可能であること\n", | |
"2. 論理的・体系的な比較ができること\n", | |
"3. 分析手続きが客観的であること\n", | |
"4. 数多くの事例が処理できること\n", | |
"5. より節約的で冗長ではないモデルを選択できること\n", | |
"\n", | |
"※鹿又伸夫,野宮大志郎,長谷川計二(2001)『質的比較分析』\tミネルヴァ書房" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## とりあえず数式をいじれるsympyを使ってみる" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"IPython console for SymPy 1.0 (Python 3.4.3-64-bit) (ground types: python)\n", | |
"\n", | |
"These commands were executed:\n", | |
">>> from __future__ import division\n", | |
">>> from sympy import *\n", | |
">>> x, y, z, t = symbols('x y z t')\n", | |
">>> k, m, n = symbols('k m n', integer=True)\n", | |
">>> f, g, h = symbols('f g h', cls=Function)\n", | |
">>> init_printing()\n", | |
"\n", | |
"Documentation can be found at http://docs.sympy.org/1.0/\n" | |
] | |
} | |
], | |
"source": [ | |
"from sympy import *\n", | |
"init_session()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## クワイン・マクラスキー法\n", | |
"を使って、真理表から縮約した論理式をつくってくれる関数\n", | |
"SOPform\n", | |
"があるのでそれを使う。" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The SOPform function uses simplified_pairs and a redundant group- eliminating algorithm to convert the list of all input combos that generate ‘1’ (the minterms) into the smallest Sum of Products form.\n", | |
"\n", | |
"http://docs.sympy.org/latest/modules/logic.html?highlight=sopform#sympy.logic.boolalg.SOPform\n", | |
"\n", | |
"(参考)\n", | |
"https://ja.wikipedia.org/wiki/クワイン・マクラスキー法" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## SOPformの使い方" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"minterms = [[0, 0, 0, 1], [0, 0, 1, 1],[0, 1, 1, 1], [1, 0, 1, 1], [1, 1, 1, 1]] \n", | |
"dontcares = [[0, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 1]]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAALoAAAAWCAYAAAB30IZkAAAABHNCSVQICAgIfAhkiAAABZJJREFU\neJzt2nuMXVUVx/FPW+hISkHoDKkFaS2BVgEDUp5WXqb6RwHBRjvWCiQEgkJRRAiv6MRXKTaAWtDy\nCAjYGsBHokLBFoGhEP/gJYaAlIKPRKSWACGEARH/WPd4z5w5594zM3funcbzTSZzz9777PO7e++z\n1tprXyoq/g+Y1GkB2yAz8Db+3WkhFbl0owtvpgsntlHARsxp4/PS/BY7lWh3K3ZvUL8TFskM4ijp\n5Li0gvGmfyu+gu3KNP4APtTCh8/H8/hBC/ucgE+XbHs+zmnSZg/0N2nzDexY8pllGItxaSfjVf9s\nfLVZoz1xUYsf/DMcgT9p7UJZiC+VaLcrHhUvRxHfxtIG9T1YXl5aKcZqXNrFeNZ/vSZW/Ta8p4UP\nfJ9wb3CJcgtzOHwfB5ZodwMWFNRNxpO1/0UsxfHDk9aQsR6XsWa86z8XRxVVfgYXZspm4Ycizl2S\nqTsL65s8sA+n1D734JFyOv/H6dgiFuL+tbLl2Lf2eU/8pkQ/B+BXBXVL8Z0m91+DmSPUmEef0Y3L\ncJmLq8VY9Wbq7lCf993wgqHrIEuf9uqHg4RhuwK/EJ76IqwQ+6u9Um2PESFrLuvx/kzZNcLSfRl/\nzNT9QbivIrYXk5/2EDfj2Ab3pDkaD4jY+DKswYOGTkK/2Fc04z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LRJ4qN5wZcJb5PkXY6p79baP6eWH9TRBJhtTBWH0+17VHCoyw3\nOLOSx0SxSS3r8seayXhMe3+gVrGNswt+nSlba/ABw0liI/DBdolqwpn4QqdFVGx7LBEHAglbhEsj\nUjabRZpqPNAj8taNfqxVUVHIyeoZhkXiFGylWFSHFt3UZiaIeK0oU1RRUVFRUVFRUVGxLfJfPu8/\nbwHgCokAAAAASUVORK5CYII=\n", | |
"text/latex": [ | |
"$$\\left(y \\wedge z\\right) \\vee \\left(z \\wedge \\neg w \\wedge \\neg x\\right)$$" | |
], | |
"text/plain": [ | |
"(y ∧ z) ∨ (z ∧ ¬w ∧ ¬x)" | |
] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"w, x, y, z = symbols('w x y z')\n", | |
"SOPform([w, x, y, z], minterms)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAI0AAAAWCAYAAAD9/x8lAAAABHNCSVQICAgIfAhkiAAABMxJREFU\naIHt2WeIXUUUwPFfiokQE1tWYhIrllhRSUwMsYLmQ1SMYltjAQv2BoqSDwZbVPxgWcWIEnuJooK9\nl1XEDyoWgqLY0VgiUfzgGqN+OO+58+7e+97dfS+7St4fln0zZ+7MuWdmzpwzlzZt+smIoVbgf8hE\nrMSfQ63IIDAeo/F7Wjl8EBV4A9sO4ngpT2JciXb3YFId+TgcJmPEJhlKuzRiOc7FyDKNt8D2LRx8\nFj7HDS3scxgOLdn2ApzdoM1kdDdocwnWKTlmGVaHXVrNlji/UaNNcXGLB34AM/Gh1hp9Dk4v0W4D\nvCMWWhGXY14deQcWlletFKvLLq3mNg28zRKs3cIBNxYuGOYrN8n94XrsWqLd7di/QDYKH1T+FzEP\nB/VPtbqsbru0kvOwd5HwcFyUqdscN4q4oDMjOwMvNBh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8XiUvQQEfS+iOvE+6S6dyjh9RaqzZDyGC4C5GZ3QqsYhXcN7sfXNgnr\n4/FM3f1qL4Pm4g9sN1hKNeBUHDvUSqzpdIrLpyo/CrdFpF6fibPwv0CHiE3qfYhsM0gcpzdTOEwE\nvteKCZo+VEplGCbiq6KMr02bNm3atGmz5vAPO/kH8xC0qGcAAAAASUVORK5CYII=\n", | |
"text/latex": [ | |
"$$\\left(y \\wedge z\\right) \\vee \\left(z \\wedge \\neg w\\right)$$" | |
], | |
"text/plain": [ | |
"(y ∧ z) ∨ (z ∧ ¬w)" | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"#dontcares項を考慮した場合\n", | |
"SOPform([w, x, y, z], minterms, dontcares)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# ブール代数アプローチを実演してみる" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## 1.一揆の条件を探る\n", | |
"\n", | |
"野宮大志郎「民衆の反乱と社会変動:歴史データへの応用」 (in 鹿又伸夫,野宮大志郎,長谷川計二(2001)『質的比較分析』 ミネルヴァ書房、第5章)\n", | |
"の一部を「再演」してみる" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### データの読み込み\n", | |
"\n", | |
"以下のデータは、江戸時代の一揆が起こった事例について、「コレラが発生していたか」「政治的大事件があったか」「(飢饉や米価高騰などで)経済的不安が生じていたか」の条件のセットごとに集計したものである。" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"import pandas as pd" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>コレラ</th>\n", | |
" <th>政治</th>\n", | |
" <th>経済</th>\n", | |
" <th>暴動あり</th>\n", | |
" <th>暴動なし</th>\n", | |
" <th>暴動の有無</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>6</td>\n", | |
" <td>57</td>\n", | |
" <td>?</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>2</td>\n", | |
" <td>?</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>4</td>\n", | |
" <td>3</td>\n", | |
" <td>?</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>6</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" コレラ 政治 経済 暴動あり 暴動なし 暴動の有無\n", | |
"0 0 0 0 6 57 ?\n", | |
"1 0 0 1 1 2 ?\n", | |
"2 0 1 0 1 0 1\n", | |
"3 0 1 1 4 3 ?\n", | |
"4 1 0 0 0 1 0\n", | |
"5 1 0 1 1 0 1\n", | |
"6 1 1 0 0 1 0\n", | |
"7 1 1 1 1 0 1" | |
] | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df = pd.read_csv('一揆の条件.csv')\n", | |
"df" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### 暴動が起きたパターンだけを抜き出してみる" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>コレラ</th>\n", | |
" <th>政治</th>\n", | |
" <th>経済</th>\n", | |
" <th>暴動あり</th>\n", | |
" <th>暴動なし</th>\n", | |
" <th>暴動の有無</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" コレラ 政治 経済 暴動あり 暴動なし 暴動の有無\n", | |
"2 0 1 0 1 0 1\n", | |
"5 1 0 1 1 0 1\n", | |
"7 1 1 1 1 0 1" | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"true_condition = df[df['暴動の有無'] == '1']\n", | |
"true_condition" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### 条件だけを抜き出す" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>コレラ</th>\n", | |
" <th>政治</th>\n", | |
" <th>経済</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" コレラ 政治 経済\n", | |
"2 0 1 0\n", | |
"5 1 0 1\n", | |
"7 1 1 1" | |
] | |
}, | |
"execution_count": 8, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"true_condition = true_condition[['コレラ','政治','経済']]\n", | |
"true_condition" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"#### SOPform用にpythonのリスト形式に変換する" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAVcAAAAWCAYAAAB0Qt9lAAAABHNCSVQICAgIfAhkiAAAAzNJREFU\neJztnL1rFEEYhx8NfpBgVBA7sVAJWoggIpZa+Q9YaWcpiiBaWG1naSUKWhzYKIiNBAyCbilYKCoi\nNqKIENKIEhCJxGL2ZJ3M3u7czu68c74PhGVm7nYefu9mMrdhDxRFUZTgrLPaj4GfwBPghqMNMAdc\nAz4Bq8AO4DKw2INvHdPAc+BgbBHqc7oAnAA2AydjCOKu75CUsoxFVUYSagvp1HeINCef+tbWPK9p\nbwW+AGdKfVeBt8BGL+3wHAFeYH75YuOTU96Tk4uquVPNsk+aZJT3o+I9v6T6DpHmNG59//at95zw\nCuaCvlfqu4XZWZz1PFco9gPzwDngdyQHG4k5NUGzrEdiRk2R6C7NqTOfvKb9AXjkeN8b4GlIkTEZ\nIOMvn09Oeec21Yyae0B6WfbNgDR3riCnvmUGyHIa0NPOdQuwD/jsGPsKHPY41ySjOYVDs1SSxWdx\n3V0cvzvGloFZYFNro/TRnMKhWSrJ4rO4zhbHX46x5eK4rZ3ORKA5hUOzVJLFZ3Ed3tx13YPYUByn\n2ulMBJpTODRLJVl8FtelEWMzxfFHC5dJQXMKh2apJIvP4rqI2UFsd4zNAN/QCx00p5Bolkqy+Cyu\ny8BLYJdjbC/wKohR+mhO4dAslWTxfYhgHjjKv4/N7sFc/A+s185hHgWTRF9OPjm5kJidjcQsNbdw\nSPSU6FSJ7+J6E/NxrPwo4nngHXC71HcceA/cbWXnzzD4acdYn05Nc3IRKzub1LKMkduojFxIqS3I\nqW8ZaU6+9R1JXtMGOITZTVwH7gAPWfux7QDmnxEfQ0jVsBNYwDxrvlr8LAHPgNORnKBZTrA24z49\n7blTzrIvp6YZQdzauuaXWF9pTm3qW9XnHKh8YUOylu/vgiy2gEVe0Z9FnLspWQCH0GSxBUrkFf1Z\n5PmbkgVwCE0WW6BEPqrP97aAL7G/KcuFRCcXKXhKdJToZJOCI8j0lOjkpMvF9RjwusPzj4NEJxcp\neEp0lOhkk4IjyPSU6FSJvbiuYL5g92JFuylTwCngfiu7sEhzuoTJdsXq79NT69sNEmoLWt+ucNW3\nquaKoiiKoiiKoiiKovx//AHFziZGOZkZEgAAAABJRU5ErkJggg==\n", | |
"text/latex": [ | |
"$$\\left [ \\left [ 0, \\quad 1, \\quad 0\\right ], \\quad \\left [ 1, \\quad 0, \\quad 1\\right ], \\quad \\left [ 1, \\quad 1, \\quad 1\\right ]\\right ]$$" | |
], | |
"text/plain": [ | |
"[[0, 1, 0], [1, 0, 1], [1, 1, 1]]" | |
] | |
}, | |
"execution_count": 9, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"minterms1 = true_condition.values.tolist() #データフレームから.valuesでnumpy配列に、.tolist()でnumpy配列からリストへ\n", | |
"minterms1" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### 条件のセットを真理表としてクワイン・マクラスキー法で縮約する" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAMkAAAASCAYAAADxP/rpAAAABHNCSVQICAgIfAhkiAAABRxJREFU\naIHt2nmIHEUUx/FPslkVb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VBBLK\niUa8IH+VXqh8lU7pwjJ9tW3K0Tgser8TNoner6v8ZIqw4r2l/wbvDuxXYWye/2KWGhjAqtThuzJm\n6dus1hl32q8/pZZ8GRkZFgvHnDHLhDq5jJE4u4F9F3yPT3NsM4Sj0SrsLJzbZxP+NeEEI2Uqvore\nb6zaOf6feFBfjb22cG/j2Qpj8/yXMjZ5PF9hnix1+a4Z6oo7w6M/pZZ8iX8kj2LvzGQvCZusVUrE\nTBU2nkWciZsKbPficP1X7yLSMmVBpv1jYfWDLYQgx6XPROH7VWEmTk1eTxFOvaqQ57+UVPdzFeeK\nqct3zVBX3Bke/SlDki9zhJIjZW/8rfGNtgNxcQN7D95Ufg/ixAb2lLnCfYaic/sRwqlEtt68R3OB\n6BVORRZp7jw/67+UW4XNY6ONfR51+q6MWfrKlTrizvDpTxmSfNkDJ2fazhHq0xP0v/KMFo7VphXK\nDpyv2t3sbN2YZRS+w7sF9vWF/UN2s3kwji2ZO8tEfKT5O8N5/pPM9U2Tc1Gf76qwm/6b1VbjzvDq\nH9J8OQjbZtomCJfG1/E47hP+jJftl8cjqv0v6i75Nf04oX5cIqzGyxINjyWPZ/E+/krsR0VjNxSO\nXgfDYP9jlPpvQzwp/K3jX+Fy/rxqyZXSqu9apZW4Mzz6hytfOnTo0KFDhw4dOgyO/wBxEX80muTx\nCwAAAABJRU5ErkJggg==\n", | |
"text/latex": [ | |
"$$\\left(C \\wedge E\\right) \\vee \\left(P \\wedge \\neg C \\wedge \\neg E\\right)$$" | |
], | |
"text/plain": [ | |
"(C ∧ E) ∨ (P ∧ ¬C ∧ ¬E)" | |
] | |
}, | |
"execution_count": 10, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"C, P, E = symbols('C P E') #コレラ、政治的要因、経済的要因にそれぞれC、P、Eのラベルをつけておく\n", | |
"SOPform([C, P, E], minterms1)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"縮約の結果、暴動が起こるのは\n", | |
"+ コレラが発生(C)し、かつ経済不安(E)がある場合\n", | |
"\n", | |
"あるいは\n", | |
"+ 政治的事件(P)が発生するが、コレラの流行(C)も経済不安(E)もない場合\n", | |
"\n", | |
"のいずれかである、ことが分かる。" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### どっちもある条件を再考する" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"暴動が起こりうる条件を得るために、条件を緩めるべく、「暴動あり」「暴動なし」の両方が起こった条件のうち、「暴動なし」が大勢を占めるケース0以外を含める。" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>コレラ</th>\n", | |
" <th>政治</th>\n", | |
" <th>経済</th>\n", | |
" <th>暴動あり</th>\n", | |
" <th>暴動なし</th>\n", | |
" <th>暴動の有無</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>2</td>\n", | |
" <td>?</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>4</td>\n", | |
" <td>3</td>\n", | |
" <td>?</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" コレラ 政治 経済 暴動あり 暴動なし 暴動の有無\n", | |
"1 0 0 1 1 2 ?\n", | |
"3 0 1 1 4 3 ?" | |
] | |
}, | |
"execution_count": 11, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"plus_true_condition = df.query(\"index == [1,3]\")\n", | |
"plus_true_condition" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAN8AAAAWCAYAAABAHklQAAAABHNCSVQICAgIfAhkiAAAArFJREFU\neJztmzuLFEEQgD+988EdnnqIICIGKocIBj4QMzXyD5jpDzARQUyMNhFTEzODBREUzUQQBJlQMFB8\nJGYnoqwaiLIgeqJBz8Js0zO7tTPTUw31JU1X70x/VG0ts7d9YBhGJ6zz5k+AX8BT4FZgDrAC3ABW\ngX/ADuAqMIjgW4ZGpxELwHPgsBe/BJwBNgNnY0vlpFLfEWW57ApJbSfWO5sw3wp8BM4XYteAt8BG\nkXZzaHQacRx4gXsTl5HFUZlq79RzGZNZaxuKBRf8+XXgCzBfiC0Df4CLFRJtotHpIPAY6OM+GVNp\nvtRzGYO6tQ3Fggv+/D3wKHDdG+BZhUSbaHQq0ied5ks9l7HpU6P51gs22gIcAD4E1j4BRwX3agqN\nTqliuYyMpPn25uOPwNoQWAI21TaSodEpVSyXkZE031I+/g6sDfNxWz0dMRqdUsVyGRlJ8/3Nx9Az\n7oZ8nKunI0ajU6pYLiMjab6vFWuL+fizhsssaHRKFctlZCTNN8B9Km4PrC0C34lfHI1OqWK5jIyk\n+YbAS2BPYG0/8KoRIxkanVLFchkZSfOB+3HxBOPH0vbhCvbQe+0K7ihN22h0qktXnqnnUqPT1GQT\n5rtwjx8XCrGbwDvGjx+dxj3CPGhWL4hGpyL38n0XStYzbx7T09875Vx24SSt7VhsPrBYxWfgFO4Y\n0hHcD7PLuIOixT9RD4BvwDHh/WdBo9NO4A6wGziUx1ZxZyRvA3crro3p6ZNyLmM51altJdmEuZRe\nzevboNe1gEdWEu91uPe09BpwaJpe1wIFsqqY9DuflK5PwofQ6BQiBU+NjhqdgrTZfCeB1y3efxY0\nOoVIwVOjo0anUvzmW8P9g+Xlkvm0zAHngPu17JpFm9MVXG7XvHhMT6tvO4RqW1ZvwzAMwzAMw2iT\n/xgS6lSjMRRGAAAAAElFTkSuQmCC\n", | |
"text/latex": [ | |
"$$\\left [ \\left [ 0, \\quad 0, \\quad 1\\right ], \\quad \\left [ 0, \\quad 1, \\quad 1\\right ]\\right ]$$" | |
], | |
"text/plain": [ | |
"[[0, 0, 1], [0, 1, 1]]" | |
] | |
}, | |
"execution_count": 12, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"plus_minterms = plus_true_condition[['コレラ','政治','経済']].values.tolist()\n", | |
"plus_minterms" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAGsAAAASCAYAAABckiAFAAAABHNCSVQICAgIfAhkiAAABCNJREFU\nWIXt2HmIV1UUwPGPM05FLtXYoqbZZom2GJmlaLbgH61QiFZYQmFktEHZihW0EPVHIRZKRRqWFmUW\nWLa7RosWZYshlhVEexqllpX9cd4wv/n57u+9WYKC+cIwv3fOufeed9+955x76eR/Q5ccWR2excEY\nhN/wBv7O9PXojSFZ+2Ow6l/yrwH7YkOVfF42/uHYjJWZf/XYB1twX2b3X2QIJmEEfsfP2Ig7xbvO\nxs34JdMVcgK247aE/ggxUX2q5IvQs0T/c8WHSNEVt2DXhP6wzL97cnQTMt1lBT6sxKEFNh1JTzyI\nLzERO1fo9sICPIK1YtPche5lOp4mXnhMDZvn7Lg7p+KKgr77YXmBzdViQaSYkvl3WkL/g5iUFKPw\nOaYX+NFRHICPRZTqlbAZJN5pRvbcB/eW6fwVEU4qv36Dll96hh1pxLvyQ2wTt4uVlaIHni7wb74I\nfbvn6OrErt9Y0H4kPlRy9baDRnyKddijwHYtzqp4noX9azVoELnq1Sr5uRhb8TxWPg/X0O2ENdn/\nFGfjmloO4mt8kNAdJ1boooS+jwiBcBMuLRirvczL/Dm5hO1yLRfgeFxbq8GIrPNpFbJGvKPcKhyK\nhQndRNxR0H662uF3YObfAwn9fJGchyT0t4oET+SK1QX+tIdjha/LStpPqHo+UBR8Sa7LBngLi/E2\n/sj+l2UJBuTIV6B/QdsF0hMNF2X+nVcl74G7RSg5OtG2QezsXSpkj+KkAp/ayizh66QiwwS7CX91\nTRiMER9nDLZmssk4pBWDzMQluKFCNgzf4KuCtt1ESZuiadedjuOz3/XifV4SoW1bou04ER63Vshm\n4Hq8VuDX42oXPU10x3B8p3kRVKeUsmxWI2XUY5PmmN7EeJxR8Xwk9qsxSAPe17JAmYMTSzg4V5zf\nUmwQE9EWlsnf8SsV7/iyzNZcFGzBryXbDcyR7S2rnOtylEPFeaC6tF4lKsQmpuDbGgNvwzOaY/Ce\n4mz0eqHLEcb6JXQDsr+lJfqp5ij8hC9ydDPFO3U0m0T+LKIOV+bI+4v5yP1YTWFlRZX8M7FK4KDM\niVqhiojXF2e/J4sqsQwvYHRC1+TfkpJ9VXI57k/onsSZWkaCjuBNUcR0K7CbIgqjakaJ+chloTi/\npM4DXUR1UjZ/zRfV5RqtO8/ME6G0modEwq5VgOTRiPcUn/8uaGW/eczWHAZH4y+1LwrG4saE7gmJ\nBdQVP+KjRMPeIu+0JlmOwnqtvykYjgtz5OvxfSv7Is4qZW5WqnN1WximZVFwlchb52sZzXqJ49HU\nRD+n4pxq4SCRj9aJVbsJL4qyfbHIM5/gz0w/rpXOt/UO7hQMRl+8LK5rtovwu1T6JfN4Xrk7y8ek\n82V7GClC7Woxt0+Jy+bBCfu+4ojSSSeddNJJ8A8bQtSFdwZM3wAAAABJRU5ErkJggg==\n", | |
"text/latex": [ | |
"$$E \\vee \\left(P \\wedge \\neg C\\right)$$" | |
], | |
"text/plain": [ | |
"E ∨ (P ∧ ¬C)" | |
] | |
}, | |
"execution_count": 13, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"SOPform([C, P, E], minterms1 + plus_minterms)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"縮約の結果、暴動が起こるのは\n", | |
"+ 経済不安(E)がある場合\n", | |
"\n", | |
"あるいは\n", | |
"+ 政治的事件(P)が発生するが、コレラの流行がない(¬C)場合\n", | |
"\n", | |
"のいずれかである、ことが分かる。" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## 2.退学の理由を探る\n", | |
"\n", | |
"片瀬 一男(2005)「退学者動向・調査報告(1)教養学部の場合 意欲があって大学を去る者、意欲を失ってやめる者--二つの不幸な退学理由へのブール代数アプローチ」 東北学院大学教育研究所報告集,5,pp.43-69\n", | |
"\n", | |
"の再演" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### 1~2年次の退学理由について,真理表を作成した(表2.1)から" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>入試類型</th>\n", | |
" <th>学業不振</th>\n", | |
" <th>継続意志</th>\n", | |
" <th>経済的条件</th>\n", | |
" <th>事例数</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>10</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>6</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>6</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>8</th>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>9</th>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>10</th>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>5</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>11</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>12</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>13</th>\n", | |
" <td>0</td>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>10</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>14</th>\n", | |
" <td>1</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>4</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>15</th>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>0</td>\n", | |
" <td>11</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" 入試類型 学業不振 継続意志 経済的条件 事例数\n", | |
"0 1 1 1 1 1\n", | |
"1 1 1 1 0 10\n", | |
"2 1 1 0 1 1\n", | |
"3 1 0 1 1 0\n", | |
"4 0 1 1 1 2\n", | |
"5 0 0 1 1 0\n", | |
"6 0 1 0 1 1\n", | |
"7 0 1 1 0 6\n", | |
"8 1 0 0 1 1\n", | |
"9 1 0 1 0 1\n", | |
"10 1 1 0 0 5\n", | |
"11 0 0 0 1 1\n", | |
"12 0 0 1 0 2\n", | |
"13 0 1 0 0 10\n", | |
"14 1 0 0 0 4\n", | |
"15 0 0 0 0 11" | |
] | |
}, | |
"execution_count": 14, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df = pd.read_csv('退学の理由1.csv')\n", | |
"df" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"** 入試類型 **\n", | |
"1:指定校推薦・スポーツ推薦・キリスト教者推薦・AO入試 /\n", | |
"0:学業推薦・一般入試\n", | |
"\n", | |
"** 学業不振 **\n", | |
"1:在学期間の単位取得率(取得単位数/履修単位数) 27%未満 /\n", | |
"0:同27%以上 ※\n", | |
"\n", | |
"※1999年以降の教養学部の退学者88名の単位取得数の中央値は26.92であった。そこで,履修率27%以下を 学業不振者と操作的に定義した。\n", | |
"\n", | |
"** 学業継続意志 **\n", | |
"1:なし /\n", | |
"0:あり\n", | |
"\n", | |
"** 経済的理由 **\n", | |
"1:あり /\n", | |
"0:なし" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"「退学の生起という現象の判定にどのようなカッティング・ポイント(退学事例がいくつある場合に、退学現象の生起と判定するか)によって,結果は異なる」ので、カッティング・ポイントを引数にして縮約結果を返す関数minimizeをつくってみる。" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"def minimize(cutpoint):\n", | |
" label_list = ['Exam','Achieve','Intention ','Finance']\n", | |
" true_case_df = df[df['事例数'] >= cutpoint]\n", | |
" minterms = true_case_df[['入試類型','学業不振','継続意志','経済的条件']].values.tolist()\n", | |
" return SOPform(label_list, minterms )" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### 2事例以上存在する条件" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA5kAAAASCAYAAADRyRqgAAAABHNCSVQICAgIfAhkiAAADiJJREFU\neJztnXu0FVUdxz/3wsEMTUR8oKYGGj65GUgiiOADsocuU0HNlNQyqVQwNV2YrV6WjyhLE0tFF75f\n+UJQyKtJvkvRVpmVWhZlVuIrHyj98Z3h7DNn9jzOzJwzd9zfte669+7Zs397fr/9/c1vfrP3HnBw\ncHBwcHBwcHBwcHBwKBA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D3olfhnwM7SQ+FwancMDwKGB9gaigXUejRePJ/tutBg5\nGLz2R9M2rvZk/RA5iuCam42BG4GfeO2ErTVI2paJBSRbAH459R3UsmIzlLn/PdL/SmSvRTTuQBaE\nTY/7IBsHH2Knoeubi8aFjw+iTMUcZNut0PbXvWgu9pAMbceNHYi308be/61gKbqJpoHPm1axNcqm\nPYXsuQLZ0l/jchda57LSO36Ace4QlAk8C90oBiLnNBfpbo+ArDxs14u2JTfRDzmkC5Cz6yIcVeAL\nFMeZdwNfIBtnnD37xn1qNHpweBLZ6XWk/9MD9dLqqAeNu7PRjqPmdSfRTZ7ywD6uBiHffBH6ZuUV\n1INAE2n600muuriwPXwrK2/ylhllvyK4E0QnfGKVY70svsnBwcHBwcHBwcHBwcHBwcHBwcHBwcHB\nwcHBwcHBwcHBwcHBwcHBwcHBwaGv4f8DgDddUk6B9QAAAABJRU5ErkJggg==\n", | |
"text/latex": [ | |
"$$\\left(Achieve \\wedge \\neg Finance\\right) \\vee \\left(\\neg Exam \\wedge \\neg Finance\\right) \\vee \\left(\\neg Finance \\wedge \\neg Intention\\right) \\vee \\left(Achieve \\wedge Intention \\wedge \\neg Exam\\right)$$" | |
], | |
"text/plain": [ | |
"(Achieve ∧ ¬Finance) ∨ (¬Exam ∧ ¬Finance) ∨ (¬Finance ∧ ¬Intention) ∨ (Achieve\n", | |
" ∧ Intention ∧ ¬Exam)" | |
] | |
}, | |
"execution_count": 21, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"minimize(2)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"\n", | |
"+ 学業不振であり、経済的な理由はない\n", | |
"+ 学業推薦・一般入試であり、経済的な理由はない\n", | |
"+ 学業継続意志はないけど、経済的な理由もない\n", | |
"+ 学業不振であり、学業継続意志はあるけど、学業推薦・一般入試\n", | |
"\n", | |
"のいずれかの場合に退学する、ということになる。" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"しかし、上の3つの項目は、まだまとめられそうだ。" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 23, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm0AAAAWCAYAAACScauVAAAABHNCSVQICAgIfAhkiAAADEFJREFU\neJztnXu0VUUdxz+Xe49mpBFCCZqPi4pPbiqaiCIoD1uVZBpmKxHRMslUMF8tTFettHxEWZpYKrrw\nFWqpibxUckmlWCnZKjM1S7PSUnwliNIf39nsOfvsffbjnHvPvrffZ627OGf27Jk5v9/8Zv9m5jcb\nMAzDMAzDMHot2wBH58g/B/haA/WNAX4BrAfuyJB/c+DPwJcbqLMvsgB4BMnxTWApsMj93QM87q69\n7vKbHMtDP+BO4A9IR68BSwj1txT4HfCOuz6yNc3s1Zh99G5Mf+WnP3A3GqvWA28BDwC3trJRTaYn\n+lU7cBbQliXzAGA+UMlY+EjgbeDqQk0LqSBDPD1D3i2B3wITGqyzu1kBDO/hOvdCxnJ5wvWTgWfc\n594ix/8nxiL9fT3h+gjgDWBITzWoGzH7MPJi+stPK+xsX6SnOU0oaxjwd7SY1FPUq7On+tUY4MIs\nGa8A9sxYaD80w1kPLCzWrg3s58rZp8FyysL+wNPApT1c70wkx08nXK8gIzbKyTlIfwfWyXMHGWdg\nJcbswyiC6S8frbKz05GePtqEsk5FCzrvakJZZa4zju8BB9fLMBw5YVn5AnAisBb4TfF2AfAV4FWg\no8FyysJNyBF9DHhPD9b7E2Qs9WYl83uoLUZ+lgH/BTb20ipU96Hv92iLugezD6MIpr98tMrOfoZ2\n4N7bhLJuBX7ehHLKXmccnSh0bAP9IhlOBq7LWNhg4FPAXOBfwBYNNm6sa9y6BsspA0OAD6LfcyMw\ntYfqbQMOAJ4n3CIA2IFwO20j4OUeao+RjwowCvWbNV76ES494PaebFQ3YPZhFMH0l49W2Vk/YDSw\nCljdh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wm7htOGEe9\n0nuRlz4Mw+hbRGc3hmFUYzZiGOXiJLSSGBe7uYHt0NJp0jaHYfQ2RqHYL8Mw4jEbMYxysSM6J5DJ\nFxtFbeyKYfRG2tGpS5uEGEY8ZiOGUS7aUUx/2V+EbRiGYRiGYRiGYRiGYRiGYRiGYRiG0V38D6dI\nQ1Dra5DiAAAAAElFTkSuQmCC\n", | |
"text/latex": [ | |
"$$\\left ( Achieve \\wedge \\neg Finance, \\quad \\neg Exam \\wedge \\neg Finance, \\quad \\neg Finance \\wedge \\neg Intention\\right )$$" | |
], | |
"text/plain": [ | |
"(Achieve ∧ ¬Finance, ¬Exam ∧ ¬Finance, ¬Finance ∧ ¬Intention)" | |
] | |
}, | |
"execution_count": 23, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"minimize(2).args[0:3]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"で、前の3つを取り出して、Orで繋ぎ直せばいいのだが、Orはどうやら2つの引数しか取れないのでreduceで強引に" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 32, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnMAAAASCAYAAAAwh1jYAAAABHNCSVQICAgIfAhkiAAADJ1JREFU\neJztnXu0VUUdxz/3cg9G+EAEFDC1iwa+uBlIIojgA7KHLFNBrZDUMqlEIDVclK1elmKUpYmlXl0o\nIEr5Qnnl1STfpWSrzB5aFmVW4itQlP74zl57zn7vc/Y593Cc71p33XNmz/7N7N9vvrPnN/ObOeDg\n4ODg4ODg4NBUKAF75ci/APhqhWWNA34BbAVuy3jPLsAfgC9UWGazYhnwONLlJmA1cLf5Wws8Za69\navI3ux53BXauY3l5eZOEVuB24LfIZq8Aq/DtuRr4NfCWuT6yoHLfTnB8KUe9+QLFcsbZs/HRG7gL\n9V1bgTeA+4FburNSBaMe7S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QnbdFFWeh6h2FWfLicgZPhv185XU\nB1K4OopwoN5Q1GB3CGcHNFLcikaONlYRPll6IopPK+H/1qSNj6IYhBY063eKdW02Ot8IFLtnnx5+\nMWog9kGW49BUb28rbSnlh0aeTjjGI6ssG+eR7VT0ak8fH0l4qasFbYnfEM4eiTg9ekt7QY95PWq4\nbWizS8mU+QT+y7qEBhYbUSPuh369wEMe2ZDediCbnT5I/GnwcRiLPKY8p6JH8SYrgjZtQ47Tb2Ly\n74Zik9Zaacfjn3w/DO1wsmf15gHvN5+Lst0ywu35fSbvjqjjjtvRWi++QFi/RfEFaseZZucLVM4Z\nZ0+hkd9TEN2vbUC/OBGFvDq6GfVBoFU+e8NVFt0UWR7Et6uVlNuyHbXXzwXuz1ufTFw9BnkAQ9CU\n3xumkCdR3JyNW03FtqLlny5zP2ga8nrgxygQ8TLKB2cPET4lvDd6+Mspf6Fgyr4XBTMGXxJtaBl4\nqSnre2igFoyJGIROCf+hkRMVt5FVlo0VZAs8vQF/N1K12AN5or9D+t+C7LWS8p1CQcTp8Vhk4+Bg\ncSp6voWoXXh4D/IKFiDb7oO2g3ehdfx+VchOazuQbqdB5nslWEf+3yv0eFMphiGP+Wlkz43Ill5s\n6j0oPnWLuX6CdW8/5BFegjqy3mjAtxDp7shAWUXYrgtt1bfRA3V4V6IBZNyvBDQDX6B2nHk78AWq\n44yz57bxnhqJBqdPITttQvq/MJAvr446ULubj06+sJ87i26KLA/i21Uf1Ddfjc5nvBHfsbaRpz7V\ncNXBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBQfg/zOGJ7+bMRyoAAAAASUVORK5CYII=\n", | |
"text/latex": [ | |
"$$\\left(Achieve \\wedge \\neg Finance\\right) \\vee \\left(\\neg Exam \\wedge \\neg Finance\\right) \\vee \\left(\\neg Finance \\wedge \\neg Intention\\right)$$" | |
], | |
"text/plain": [ | |
"(Achieve ∧ ¬Finance) ∨ (¬Exam ∧ ¬Finance) ∨ (¬Finance ∧ ¬Intention)" | |
] | |
}, | |
"execution_count": 32, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"#from functools import reduce #Python3ではreduce関数はfunctoolsというモジュールに移動しました\n", | |
"reduce(Or,minimize(2).args[0:3])" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"これを連言標準形(Conjunctive normal form, CNF)に直してから、simplifyで整理し直す" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAASCAYAAABFPJmKAAAABHNCSVQICAgIfAhkiAAACx9JREFU\neJztnHuUV1UVxz8zw48iTBEHlUc6DRL4YjJHkiAEQcgeunwEYoWEFUklr9AwCpeVlECUJYGFYgsF\nQ6l88DYnglLRUrLVw55GkYbZGBYgSn98z1333PO79/e79/7uzG9mrftdi8Xc8z777L3PPnuf84Mc\nOXLkyJGjnbAWeBI4DOwHtgAbzb+HgN+avJdN+WOA3wOfbveRdn4UgIaEdZYAN6TsbwTwU7R+98Ws\nk69vMWqB+4FfI1ruAzbjy8kW4JfAaya/uTrD7LToDmxANDwMvAJsB+6t5qAyRHvJ1HHA0W3ZwZlo\ngZZG5F8N/MX83Rf4BXBeWw6oE2AHMDBB+S7AfOANCeo0A68CtyWo46KADIA5Mct3tPV9EDgyRrlV\naOxtiZFITr4QkT8Y+C/Qu43HkSU6En3PRvRdUmE7/YG/AydWPKJs+mwvmaoFvgwc0VYdzEQLdFlE\nfgEpxhzCcOBPwM0J6sxGiiQuatGJ7jCwPkE9F+8wbQypoI1qYg4yVEqhH/CTdhjL5xAtzylR5j6g\nph3GkhU6En3nIPq+p8J2ZiDj6PUVj6hj9xmG3lS+0Ubi+2iBSu3Aq9qq806INUgBP0283fuNJD9G\nfxy4CjgI/DxhXRvXAf9BJ5rOiJ5o/qWU7xeBD7bDWLYC/wN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AAABJRU5ErkJggg==\n", | |
"text/latex": [ | |
"$$\\neg Finance \\wedge \\left(Achieve \\vee \\neg Exam \\vee \\neg Intention\\right)$$" | |
], | |
"text/plain": [ | |
"¬Finance ∧ (Achieve ∨ ¬Exam ∨ ¬Intention)" | |
] | |
}, | |
"execution_count": 20, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"simplify(to_cnf(_))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"つまり、いずれも経済的困難がないけれど、一般入試・学業推薦か/学業不振か/学業継続意志がある、いずれかの場合" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### 5事例以上存在する条件" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 34, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAf8AAAASCAYAAABVXNdWAAAABHNCSVQICAgIfAhkiAAADCFJREFU\neJztnXu0VUUdxz/3cg9m+EDEB2BqFw18cTOQRBBBBbKHLFNBrZDUMqlEMDVdlK1elkqUpYmlogsF\nn+ULRSGvpvkuJVs9rNSyKLMSX4Gi9Md39tpzZu/Zj3P2Oede3N+1zrrnzMz+zezfb36//Zvf/PZc\nKFGiRIkSJUq87VEBds7RfgHw1Rr7Gg/8AtgA3Jzxmq2BPwJfqLHPjRXXAY8jXq4F7gLuMJ+VwO9N\n3aum/cbOx+2ArZrYX169SUI7cAvwWySzV4A7CeV5F/Br4C1TP6qgft9OKPWl56MfcDua6xuAN4D7\ngBtaOagC0aw5lckWdgBnA+/MSHQU8CZwWe3jooKU77SM7YcAvwIm1dFnM3A/MKzJfY5ESnKRp/5k\n4FnzvbfwsVa0A98CNktpdxuwRQZ6ixHP4pBXb7JiApLn1zz1I4DXgEEF99sKlPrSO9AKOe2L5LSg\nAFpDgb8DOxVAq97+mjWnMtnCU5F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EJ9UNRxm9dtRgHvB+870o2V1HdD6/z7TdAhluX8Z/s/QFovwtSl+g\ncTrTKn1x0Uq71oFk9LTnmrw8uh7NWVDU2U5IzcKbIvtLmlPLqZZlJ5qvn3P6zTueTLbwEOQxDkUh\nhTdMJ0+ifX8bN5mBbUDhyG5zPSjMcSXwY5RIcQHVD/OHiJ6a1g/d/IVUGyBM3/egZAzXqHSgbYlr\nTF/fQw92d49uMDrV64eGTtxebVZaNpaRLXHmKsLs23qxI1q5/A7xfz2S13KqM2Nd+Ph4KJKxq4TT\n0f0tRPMiwHuQF7kAyXZX9LpMN9pXGlgH7bS5A+lyGmx+14Jazi8P9KZWDEcrrKeQPNcgWQa5NXej\n/Jr1pv4I69qBaBVxHjJk/ZCDsBDx7iCnryJk141eZbLRBxm8i5HD4Ts1cWPQF2iczrRCX+LQCjmN\nQs5M8I+V1iL+n+20y8ujLqTX56M3yez7zsKbIvtLmlP9kS5fis4fuZrQcbeRZzz12MISJUqUKFGi\nRIkSJUqUKFGiRIkSJUqUKFGiRM/H/wHzHojwlZatSwAAAABJRU5ErkJggg==\n", | |
"text/latex": [ | |
"$$\\left(Achieve \\wedge \\neg Finance\\right) \\vee \\left(\\neg Exam \\wedge \\neg Finance \\wedge \\neg Intention\\right)$$" | |
], | |
"text/plain": [ | |
"(Achieve ∧ ¬Finance) ∨ (¬Exam ∧ ¬Finance ∧ ¬Intention)" | |
] | |
}, | |
"execution_count": 34, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"minimize(5)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"+ 経済的理由がないけど、学業不振\n", | |
"+ 経済的理由がないし、学業継続意志はある\n", | |
"\n", | |
"のいずれかの場合に退学する。" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### 8事例以上存在する条件" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 35, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArMAAAASCAYAAABIOFZ5AAAABHNCSVQICAgIfAhkiAAADRZJREFU\neJztnXu0VUUdxz/3cg9l+EDEB2hqFw1fSSaSiOLFB2SlLlNBrZTUMqlUMDVdlC4rKZEoSxNLvbbw\n/ShfIAp5MymfZWSrzMwsizIrMU1QlP74zl579j77feacc8H5rnXXPXtm9m9m/+Y3v++e5wYPDw8P\nDw8PDw+PdQg1YFsHcjqBO4DfAmuAl4F7gLvN373Ar4E3TfxoB3m+1XAT8DjS30qk00C/S4AnTdwr\nJv0mwB+Az7e8pG9dDAIWIltfA7wOPADc0s5COUSrbGpzYOMm52Gjih+cC5xfMb/xwM+Qjdxe8J51\nuT17/igO72PWbXiej6IQF3QB5wLvcJhxD1L0l1PidwX+BwxzmGe7sBQY2eI8d0f6vTQl/hTgWfN7\nS+CXwIEtKFd/RjvqaU9UT3MdyBoB/A3YxoGsRvNrlU11Al8D1s9JdxewYQF581HZk1DFD44G3gCu\nLHFPHDVEVmcUTL82tOdG21oPnj+KwvuY1sDzfHtRiAtOR87BJb6IKmHfjDS3Ax2O82019gaeAS5u\ncb7TkX6PSomvocbnIbSrns5A9fQhB7JOQy89b3cgqz/ml4Zh5BP1GcixZ2Er4KcZ8WX9YCcaIVkD\nLChxXxx7GRljGpDRn+CirXn+KA7vY5oPz/P9A5lcsAHNmZZYDLwKvM0KqxF9q/5OE/JtNa5HZPQE\n+aNHLvFDZORZPej5LSrL2oB21dOdaORuIweybgF+4kBOf80vC/PInv4fAvyC7JebrwAfS4mr4gc/\nDZwMvGbyropzgP+ikeF1AS7amueP4vA+pvnwPN9/EOGCTiviQODnjjOrAWPRWrBVVvgRJjzAbY7z\nbTWGAe9Ez3kdcGyL8u0A9gGWE04xAGxPOO02EHixReXp72hXPXUC44BlwAoH8vYG7ncgp7/ml4Ul\nwOSM+H+jKbYDUuIHAocCN6bEl/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j6UPH\ngtgYgBrXZcgBdpCMBRTbeHQN4S69RrE16qH9DulvNRreX0R0F2scw9EU1FzqnWuabqagZ5xH1B6K\n6r2s3MFo5Oz7yAYuJkrgoIYxBxHxbOBbiIST1gEHaEc9jUaN9klUTyuR/s+NpSuro1HIaV6Edrjb\nz11ENy7zy7KpwagtX4HOfL2W8EXCRpnyDDfPUwVLKf8tddsPjkDt7HVUn0+Y8ti4DRHPGjQN3mdk\nQL5tP0T9F8kGoXZ9CVHygGzdF20jw9FXhb5r5CStEy7b3hpta54/6pGmK+9j3PuYJKwLPN8sjq8i\n2wXPN8IFHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/B0+fP4NmiBXxAAAAAElFTkSu\nQmCC\n", | |
"text/latex": [ | |
"$$\\left(\\neg Exam \\wedge \\neg Finance \\wedge \\neg Intention\\right) \\vee \\left(Achieve \\wedge Exam \\wedge Intention \\wedge \\neg Finance\\right)$$" | |
], | |
"text/plain": [ | |
"(¬Exam ∧ ¬Finance ∧ ¬Intention) ∨ (Achieve ∧ Exam ∧ Intention ∧ ¬Finance)" | |
] | |
}, | |
"execution_count": 35, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"minimize(8)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"+ 経済的理由がなく、一般入試・学業推薦で入学し、学業継続意志がある\n", | |
"+ 経済的理由がなく、指定校推薦・スポーツ推薦・キリスト教者推薦・AO入試で入学し、学業不振で学業継続意志がない\n", | |
"\n", | |
"のいずれかの場合に退学する。" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### ipywidgetsを使ってカッティング・ポイントを変えられるようにした\n", | |
"\n", | |
"せっかくコンピュータの上で、しかもJupyterの上でやっているので、スライドバーでインタラクティブにカッティング・ポイントを変えられるようにしてみた。" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 37, | |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upJTnoROxdv1d29hkmXnyG4RmKZeg+66uIuqsqtQljjoyqort0ArAb5Fs1yGd\nWkb0xFMcebwqy4d3oRnZfKSDO6Lj6qtQrMOQinSL9BuK+9nW5nsVrKba7w0G9q0KdkIrFY8iea5F\nsgzice9AMbnrTP4h1rtDUB8/FzmbgWgQtxDxbt+U8urKbhW6QsBGf+SQLkKDwqxfZ/D6ks/zKrSL\ndKa3fU9VeJ/VvM+qYws9PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8+gL+D69+g8ggmLoPAAAA\nAElFTkSuQmCC\n", | |
"text/latex": [ | |
"$$\\left(Achieve \\wedge Intention \\wedge \\neg Finance\\right) \\vee \\left(\\neg Exam \\wedge \\neg Finance \\wedge \\neg Intention\\right)$$" | |
], | |
"text/plain": [ | |
"(Achieve ∧ Intention ∧ ¬Finance) ∨ (¬Exam ∧ ¬Finance ∧ ¬Intention)" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"<function __main__.minimize>" | |
] | |
}, | |
"execution_count": 37, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"from ipywidgets import * \n", | |
"interact(minimize, cutpoint =(1,11,1))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.4.3" | |
}, | |
"widgets": { | |
"state": { | |
"3de204f300604e07a5b04bf3f2671134": { | |
"views": [] | |
}, | |
"562facba658e43229d91f3b56f9d3a9c": { | |
"views": [] | |
}, | |
"683e415b934143c98e2df25eeebfb94a": { | |
"views": [] | |
}, | |
"8b0b001faa9d44729e74e169e0c8ec47": { | |
"views": [ | |
{ | |
"cell_index": 54 | |
} | |
] | |
}, | |
"9120edcfbeb54088b95d3b20f4ddedbf": { | |
"views": [] | |
}, | |
"c0b8ab164f024237a53d8b8e7869111c": { | |
"views": [] | |
}, | |
"d2c9a40edede48efbfbb9f0b9b6ab399": { | |
"views": [] | |
}, | |
"e3645c3b62ef469ca01edc1d27083623": { | |
"views": [] | |
} | |
}, | |
"version": "1.1.1" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment