ࡐͱͳΔΦϒδΣΫτͷநԽʹΑΔจষͷಈղ Automatically Solving Probability Problems through the Abstraction of Object Types ਆ୩ ཌྷ Tsubasa Kamiya দ Takuya Matsuzaki ౻ࠤཧ Satoshi Sato ݹେେӃ ࢠใγεςϜઐ ߈Department of Electrical Engineering and Computer Science, Graduate School of Engineering, Nagoya University A computer program that solves probability problems is presented. It solves problems by abstracting the type of the objects appearing in the problems. It converts the problem texts to an intermediate representation written in programming language. By executing the intermediate representation, our program simulates the probabilistic event described in the problem and derives the answer. 1. Ίʹ 2011 ɼࠃใڀݚॴͰɼʮϩϘοτ౦େʹೖΕΔʯ ͱϓϩδΣΫτ։ΕɽͷϓϩδΣΫτେೖ ࢼΛܭػͰղͱʹઓΔͷͰΔɽ զʑɼͷϓϩδΣΫτʹɼʮ߹ͷɾʯ ͷจষʹରΔಈղγεςϜͷ։ʹऔΓΜͰ ΔɽຊγεςϜจΛϓϩάϥϛϯάޠݴͰॻΕத දݱͱมɼͷதදݱΛߦߦࢼΛγϛϡϨʔτ ΔͱͰղΛಘΔɽɼΕ·Ͱ։γεςϜͰ ɼղͱͰΔλΠϓɼࡐͱͳΔΦϒδΣΫτ ʮۄʯͰΔʹݶΒΕɽ ΕʹରຊߘͰɼࡐͱͳΔΦϒδΣΫτΛݶఆ ʹதදݱΛੜΔख๏ʹ౼ݕΔɽͷख๏Ͱɼ ࡐͱͳΔΦϒδΣΫτΛਪఆɼΕΛͱʹจʹλά Λ༩จΛநԽΔɽΕʹΑΓɼࡐͱͳΔΦϒ δΣΫτߦࢼΛදදهͷҧʹΑΒɼதදݱΛੜ ΔͱͰΔɽ ҎԼɼຊߘͷΑʹߏΕΔɽ·ɼ2 અͰγε ςϜͷཁΛઆΔɽ3 અͰதදݱͷߏɼ4 અͰ༻Δ λάʹɼ5 અͰதදݱͷੜ๏ΛઆΔɽ6 અͰ Ռͱޙࠓͷ՝ʹड़Δɽ 2. γεςϜશମͷཁ γεςϜͷ·ͳΕΛਤ 1 ʹɽͷਤͷΕʹ ԊɼҎԼͷΛͱɼॲཧͷΕΛઆΔɽ ✓ ✏ ۄ3 ݸɼ੨ۄ4 ݸೖାΔɽାΒ 3 ݸͷۄΛಉʹऔΓग़ɽऔΓग़੨ۄͷݸΛ X ͱ ΔɽX=2 ͱͳΔɽ ✒ ✑ γεςϜͰ·จ (Δઅ) ΛɼͰఆΕ ঢ়گΛهड़Δจ (object จ)ɼߦࢼΛهड़Δจ (event จ)ɼ มΛఆΔจ (variable จ)ɼΛจ (question จ)ɼ ͷ 4 छʹΔɽͷ߹ҎԼͷΑͳʹͳΔɽ ࿈བྷઌ: ਆ୩ཌྷɼݹେେӃ ڀݚՊ ࢠใγεςϜઐ߈ɼ˟ 464-8603 Ѫݝݹࢢઍछ ෆொ IB ࢠใ౩ 159 ߸ɼ052-789-4435ɼ tubasa [email protected]ਤ 1: γεςϜͷΕ ✓ ✏ object จ: ۄ3 ݸɼ੨ۄ4 ݸೖାΔɽ event จ: ାΒ 3 ݸͷۄΛಉʹऔΓग़ɽ variable จ: औΓग़੨ۄͷݸΛ X ͱΔɽ question จ: X=2 ͱͳΔɽ ✒ ✑ ΒʹจʹλάΛ༩ΔͱҎԼͷΑʹͳΔɽ ݸʑͷλάʹઅͰઆΔɽ ۄ3 ݸ੨ ۄ4 ݸೖାΔɽ attr object num attr object num ͷାΒ 3 ݸͷ ۄΛ ಉʹ औΓग़ɽ takenum object taketype verb औΓग़ ੨ ۄͷ ݸΛ X ͱΔɽ <——————–require——————–> attr object func var X=2 ͱͳΔ ɽ require condition questiontype ʹλάใΛ༩จΒதදݱมΔɽ object จͰɼʮ ۄ3 ݸʯதදݱͰʮ’ ۄ’,{’color’=>’ ’} ,3ʯͱදΕΔɽΕλάใΛಡΈऔΔͱͰੜ ͰɼΦϒδΣΫτΛఆΔͷҾʹೖΔɽ 1 The 30th Annual Conference of the Japanese Society for Artificial Intelligence, 2016 4B1-2
4
Embed
J P q s ¦ Ò ´ £ « Ä w ¨ Å = t ¬ p · J w × r t P q s Ò ´ £ « Ä w ¨ Å = t ¬ p · J w × r t AutomaticallySolvingProbabilityProblemsthroughtheAbstractionofObjectTypes
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
題材となるオブジェクトの抽象化による確率文章題の自動解答Automatically Solving Probability Problems through the Abstraction of Object Types
神谷 翼Tsubasa Kamiya
松崎 拓也Takuya Matsuzaki
佐藤 理史Satoshi Sato
名古屋大学大学院 電子情報システム専攻Department of Electrical Engineering and Computer Science, Graduate School of Engineering, Nagoya University
A computer program that solves probability problems is presented. It solves problems by abstracting the typeof the objects appearing in the problems. It converts the problem texts to an intermediate representation writtenin programming language. By executing the intermediate representation, our program simulates the probabilisticevent described in the problem and derives the answer.
「取り出したカードに書かれている数字の和を X とする.」は,「数字」という属性に対して,「足し合わせる」操作を行うものである.pred オブジェクトが持つ属性についての条件に関する表現に付与するタグである (奇数・偶数・~の倍数・同じ・異なるなど).「カードに書かれている数字が奇数となる確率はいくつか.」では,「数字」という属性が条件を満たす確率が問われている.
func や pred タグを付与する表現には,それぞれ対応する中間表現パターンを用意しておく.上記の例のように,「<attrname> の和」という形の表現で,<attrname> の部分が「数字」であった場合,これに対応する中間表現は「elist.attr(’number’).inject(:+)」である.シミュレーションによって生成した試行結果オブジェクト (elist) から,「数字」の属性を取り出し (attr(’number’)),すべてを足し合わせる(inject(:+))ことを意味している.「<attrname> の種類の数」に対応する中間表現は,