(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 79285, 1888] NotebookOptionsPosition[ 78935, 1872] NotebookOutlinePosition[ 79327, 1889] CellTagsIndexPosition[ 79284, 1886] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ "Implementation", " ", "of", " ", "algorithms", " ", "described", " ", "in", " ", "Hanany"}], ",", RowBox[{"Klibanoff", " ", "and", " ", "Marom", " ", RowBox[{"(", "2011", ")"}], " ", "\"\\"", " ", "for", " ", "dynamically", " ", "consistent", " ", "updating", " ", "of", " ", "Maxmin", " ", "Expected", " ", "Utility", " ", RowBox[{"preferences", ".", " ", "Hereafter"}], " ", "HKM", " ", "2011.", " ", "Coding", " ", "by", " ", RowBox[{"HKM", ".", " ", "\[IndentingNewLine]", RowBox[{"Instructions", ":", " ", RowBox[{ "Run", " ", "the", " ", "notebook", " ", "and", " ", "fill", " ", "in", " ", "the", " ", "input", " ", "requested", RowBox[{"(", RowBox[{ "the", " ", "default", " ", "values", " ", "in", " ", "the", " ", "dialog", " ", "boxes", " ", "may", " ", "be", " ", "edited"}], ")"}], " ", "including", " ", "the", " ", "measures", " ", "whose", " ", "convex", " ", "hull", " ", "is", " ", "the", " ", "set", " ", "of", " ", "measures"}]}]}]}], ",", " ", RowBox[{ "the", " ", "utility", " ", "acts", " ", "whose", " ", "convex", " ", "hull", " ", "is", " ", "the", " ", "set", " ", "of", " ", "feasible", " ", "utility", " ", "acts"}], ",", " ", RowBox[{ "the", " ", "initially", " ", "optimal", " ", "utility", " ", "act"}], ",", " ", RowBox[{ "the", " ", "event", " ", "to", " ", "be", " ", "updated", " ", "on", " ", "and", " ", "the", " ", "update", " ", "rule", " ", "to", " ", RowBox[{"use", "."}]}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Coding", " ", "of", " ", "functions", " ", "starts", " ", "here"}], " ", "*)"}], RowBox[{"(*", " ", RowBox[{ RowBox[{ "Exante", " ", "takes", " ", "as", " ", "arguments", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "probability", " ", "measures", " ", "Cbar", " ", "and", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "utility", " ", "acts", " ", "Bbar", " ", "and", " ", "returns", " ", "the", " ", "coefficients", " ", RowBox[{"\[Lambda]", "[", "a", "]"}], " ", "for", " ", "each", " ", "a", " ", "in", " ", "Bbar", " ", "generating", " ", "a", " ", "mixed", " ", "act", " ", "that", " ", "is", " ", "optimal", " ", "within", " ", "the", " ", "convex", " ", "hull", " ", "of", " ", "Bbar", " ", "according", " ", "to", " ", "the", " ", "min", " ", "expectation", " ", "over", " ", "the", " ", "convex", " ", "hull", " ", "of", " ", RowBox[{"Cbar", ".", " ", "It"}], " ", "also", " ", "returns", " ", "o"}], ",", " ", RowBox[{ "the", " ", "min", " ", "expectation", " ", "of", " ", "that", " ", "optimal", " ", "act"}]}], "*)"}], RowBox[{ RowBox[{ RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar_", ",", "Bbar_"}], "]"}], ":=", RowBox[{ RowBox[{"{", RowBox[{"o", ",", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"\[Lambda]", "[", "a", "]"}], "a"}], ",", RowBox[{"{", RowBox[{"a", ",", "Bbar"}], "}"}]}], "]"}]}], "}"}], "/.", RowBox[{ RowBox[{"Maximize", "[", RowBox[{ RowBox[{"{", RowBox[{"o", ",", RowBox[{ RowBox[{"And", "@@", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"\[Lambda]", "[", "a", "]"}], RowBox[{"a", ".", "q"}]}], ",", RowBox[{"{", RowBox[{"a", ",", "Bbar"}], "}"}]}], "]"}], "\[GreaterEqual]", "o"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}]}], "&&", RowBox[{"And", "@@", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"\[Lambda]", "[", "a", "]"}], "\[GreaterEqual]", "0"}], ",", RowBox[{"{", RowBox[{"a", ",", "Bbar"}], "}"}]}], "]"}]}], "&&", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"\[Lambda]", "[", "a", "]"}], ",", RowBox[{"{", RowBox[{"a", ",", "Bbar"}], "}"}]}], "]"}], "\[Equal]", "1"}]}]}], "}"}], ",", RowBox[{"Flatten", "[", RowBox[{"{", RowBox[{"o", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"\[Lambda]", "[", "a", "]"}], ",", RowBox[{"{", RowBox[{"a", ",", "Bbar"}], "}"}]}], "]"}]}], "}"}], "]"}]}], "]"}], "[", RowBox[{"[", "2", "]"}], "]"}]}]}], ";", RowBox[{"(*", " ", RowBox[{ "Bayes", " ", "takes", " ", "as", " ", "arguments", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "probability", " ", "measures", " ", "Cbar", " ", "and", " ", "an", " ", "event", " ", "EE", " ", "given", " ", "positive", " ", "weight", " ", "by", " ", "each", " ", "measure", " ", "in", " ", RowBox[{"Cbar", ".", " ", "It"}], " ", "returns", " ", "the", " ", "set", " ", "of", " ", "measures", " ", "obtained", " ", "by", " ", "updating", " ", "each", " ", "measure", " ", "in", " ", "Cbar", " ", "by", " ", "Bayes", " ", "rule"}], "*)"}], RowBox[{ RowBox[{"Bayes", "[", RowBox[{"Cbar_", ",", "EE_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"Boole", "[", RowBox[{"MemberQ", "[", RowBox[{"EE", ",", "s"}], "]"}], "]"}], RowBox[{ RowBox[{"q", "[", RowBox[{"[", "s", "]"}], "]"}], "/", RowBox[{"Sum", "[", RowBox[{ RowBox[{"q", "[", RowBox[{"[", "ss", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", "EE"}], "}"}]}], "]"}]}]}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", "q", "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}]}], "]"}]}], ";", RowBox[{"(*", " ", RowBox[{ RowBox[{ "DCmax", " ", "takes", " ", "as", " ", "arguments", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "probability", " ", "measures", " ", "Cbar"}], ",", " ", RowBox[{ "an", " ", "event", " ", "EE", " ", "given", " ", "positive", " ", "weight", " ", "by", " ", "each", " ", "measure", " ", "in", " ", "Cbar"}], ",", " ", RowBox[{ "an", " ", "initially", " ", "optimal", " ", "utility", " ", "act", " ", "b1"}], ",", " ", RowBox[{ "and", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "feasible", " ", "utility", " ", "acts", " ", RowBox[{"Bbar", ".", " ", "It"}], " ", "returns", " ", "the", " ", "extreme", " ", "points", " ", "of", " ", "the", " ", "set", " ", "of", " ", "measures", " ", "obtained", " ", "by", " ", "updating", " ", "according", " ", "to", " ", "the", " ", "DCmax", " ", "rule", " ", "defined", " ", "by", " ", "Hanany", " ", "and", " ", "Klibanoff", " ", RowBox[{ RowBox[{"(", RowBox[{ "\"\\"", ",", " ", RowBox[{"Theoretical", " ", "Economics"}], ",", " ", "2007"}], ")"}], "."}]}]}], "*)"}], RowBox[{ RowBox[{"DCmax", "[", RowBox[{"Cbar_", ",", "EE_", ",", "b1_", ",", "Bbar_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "b", ",", "Lbar", ",", "CbarE", ",", "QbarE", ",", " ", "UbarE"}], "}"}], ",", RowBox[{ RowBox[{"UbarE", "=", RowBox[{"{", "}"}]}], ";", RowBox[{"b", "=", "b1"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], "]"}], "\[NotEqual]", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{ RowBox[{"b", "=", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", RowBox[{"MessageDialog", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"Grid", "[", RowBox[{"{", RowBox[{ RowBox[{"{", "errormessage1", "}"}], ",", RowBox[{"{", "b", "}"}]}], "}"}], "]"}], "]"}], ",", RowBox[{"WindowMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "Automatic"}], "}"}], ",", RowBox[{"{", RowBox[{"Automatic", ",", "0"}], "}"}]}], "}"}]}]}], "]"}]}]}], "]"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"q", "[", RowBox[{"[", "s", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], ",", "0"}], "]"}], ",", RowBox[{"MessageDialog", "[", "errormessage2", "]"}], ",", RowBox[{ RowBox[{"Lbar", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"Bbar", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"ss", "\[Equal]", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"ss", "\[Equal]", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}]}], ",", RowBox[{"-", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"CbarE", "=", RowBox[{"Ext", "[", RowBox[{"Bayes", "[", RowBox[{"Cbar", ",", "EE"}], "]"}], "]"}]}], ";", RowBox[{"QbarE", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"CbarE", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "-", "a"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Lbar"}], "}"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"UbarE", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"CbarE", ",", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"b", "-", RowBox[{ RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "QbarE"}], "}"}]}], "]"}], "]"}], RowBox[{"Table", "[", RowBox[{"1", ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", "b", "]"}]}], "}"}]}], "]"}]}]}], ",", "0"}], "}"}], "}"}]}], "]"}], "]"}]}]}]}], "]"}]}]}], "]"}]}], ";", RowBox[{"(*", " ", RowBox[{ RowBox[{ "DCPFImax", " ", "takes", " ", "as", " ", "arguments", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "probability", " ", "measures", " ", "Cbar"}], ",", " ", RowBox[{ "an", " ", "event", " ", "EE", " ", "given", " ", "positive", " ", "weight", " ", "by", " ", "each", " ", "measure", " ", "in", " ", "Cbar"}], ",", " ", RowBox[{ "an", " ", "initially", " ", "optimal", " ", "utility", " ", "act", " ", "b1"}], ",", " ", RowBox[{ "and", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "feasible", " ", "utility", " ", "acts", " ", RowBox[{"Bbar", ".", " ", "It"}], " ", "returns", " ", "the", " ", "extreme", " ", "points", " ", "of", " ", "the", " ", "set", " ", "of", " ", "measures", " ", "obtained", " ", "by", " ", "updating", " ", "according", " ", "to", " ", "the", " ", "DCPFImax", " ", "rule", " ", "defined", " ", "by", " ", "Hanany", " ", "and", " ", "Klibanoff", " ", RowBox[{ RowBox[{"(", RowBox[{ "\"\\"", ",", " ", RowBox[{"Theoretical", " ", "Economics"}], ",", " ", "2007"}], ")"}], "."}]}]}], "*)"}], RowBox[{ RowBox[{"DCPFImax", "[", RowBox[{"Cbar_", ",", "EE_", ",", "b1_", ",", "Bbar_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "b", ",", "Lbar", ",", "CbarE", ",", "QbarE", ",", "ostar", ",", "Rbar", ",", "qg", ",", "Jbar", ",", "KbarE", ",", " ", "UbarE"}], "}"}], ",", RowBox[{ RowBox[{"UbarE", "=", RowBox[{"{", "}"}]}], ";", RowBox[{"b", "=", "b1"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], "]"}], "\[NotEqual]", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{ RowBox[{"b", "=", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", RowBox[{"MessageDialog", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"Grid", "[", RowBox[{"{", RowBox[{ RowBox[{"{", "errormessage1", "}"}], ",", RowBox[{"{", "b", "}"}]}], "}"}], "]"}], "]"}], ",", RowBox[{"WindowMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "Automatic"}], "}"}], ",", RowBox[{"{", RowBox[{"Automatic", ",", "0"}], "}"}]}], "}"}]}]}], "]"}]}]}], "]"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"q", "[", RowBox[{"[", "s", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], ",", "0"}], "]"}], ",", RowBox[{"MessageDialog", "[", "errormessage2", "]"}], ",", RowBox[{ RowBox[{"Lbar", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"Bbar", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"ss", "\[Equal]", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"ss", "\[Equal]", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}]}], ",", RowBox[{"-", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"CbarE", "=", RowBox[{"Ext", "[", RowBox[{"Bayes", "[", RowBox[{"Cbar", ",", "EE"}], "]"}], "]"}]}], ";", RowBox[{"QbarE", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"CbarE", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "-", "a"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Lbar"}], "}"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"ostar", "=", RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], "]"}]}], ";", RowBox[{"Rbar", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"Cbar", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"b", ",", "ostar"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"-", "b"}], ",", RowBox[{"-", "ostar"}]}], "}"}], "}"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "-", "a"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Lbar"}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"qg", "=", RowBox[{"Rbar", "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", " ", RowBox[{"(*", " ", RowBox[{ "Note", " ", "that", " ", "qg", " ", "can", " ", "be", " ", "any", " ", "measure", " ", "from", " ", RowBox[{"Rbar", " ", "--"}], " ", "this", " ", "algorithm", " ", "simply", " ", "picks", " ", "the", " ", "1", "st", " ", "measure", " ", "in", " ", "that", " ", "set"}], " ", "*)"}], RowBox[{"Jbar", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"Lbar", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"qg", ",", "ostar"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"-", "qg"}], ",", RowBox[{"-", "ostar"}]}], "}"}], "}"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"q", "-", "qg"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"KbarE", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"QbarE", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "-", "a"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Jbar"}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"(", RowBox[{"b", "-", "a"}], ")"}]}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Jbar"}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"UbarE", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"CbarE", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"a", "-", RowBox[{ RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "KbarE"}], "}"}]}], "]"}], "]"}], RowBox[{"Table", "[", RowBox[{"1", ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", "b", "]"}]}], "}"}]}], "]"}]}]}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Jbar"}], "}"}]}], "]"}]}], "]"}], "]"}]}]}]}], "]"}]}]}], "]"}]}], ";", RowBox[{"(*", RowBox[{ RowBox[{" ", RowBox[{ RowBox[{ "DCRAmaxspecial", " ", "takes", " ", "as", " ", "arguments", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "probability", " ", "measures", " ", "Cbar"}], ",", " ", RowBox[{ "an", " ", "event", " ", "EE", " ", "given", " ", "positive", " ", "weight", " ", "by", " ", "each", " ", "measure", " ", "in", " ", "Cbar"}], ",", " ", RowBox[{ "an", " ", "initially", " ", "optimal", " ", "utility", " ", "act", " ", "b1"}], ",", " ", RowBox[{ "and", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "feasible", " ", "utility", " ", "acts", " ", RowBox[{"Bbar", ".", " ", "Under"}], " ", "the", " ", "requirement", " ", "that", " ", "the", " ", "conditional", " ", "expectations", " ", "of", " ", "the", " ", "initially", " ", "optimal", " ", "utility", " ", "act", " ", "on", " ", "the", " ", "complement", " ", "of", " ", "the", " ", "event", " ", "E", " ", "are", " ", "all", " ", "equal", " ", "for", " ", "measures", " ", "in", " ", "Cbar", " ", "that", " ", "assign", " ", "positive", " ", "probability", " ", "to", " ", "this", " ", "event"}], ",", " ", RowBox[{ "it", " ", "returns", " ", "the", " ", "extreme", " ", "points", " ", "of", " ", "the", " ", "set", " ", "of", " ", "measures", " ", "obtained", " ", "by", " ", "updating", " ", "according", " ", "to", " ", "the", " ", "DCRAmax", " ", "rule", " ", "as", " ", "defined", " ", "by", " ", "HKM", " ", "2011"}]}], ")"}], "."}], " ", "*)"}], RowBox[{ RowBox[{"DCRAmaxspecial", "[", RowBox[{"Cbar_", ",", "EE_", ",", "b1_", ",", "Bbar_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "b", ",", "Lbar", ",", "CbarE", ",", "QbarE", ",", "ostar", ",", "Rbar", ",", "qg", ",", "alpha", ",", "expbEc", ",", "expbEc1", ",", "constant", ",", " ", "UbarE"}], "}"}], ",", RowBox[{ RowBox[{"UbarE", "=", RowBox[{"{", "}"}]}], ";", RowBox[{"b", "=", "b1"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], "]"}], "\[NotEqual]", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{ RowBox[{"b", "=", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", RowBox[{"MessageDialog", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"Grid", "[", RowBox[{"{", RowBox[{ RowBox[{"{", "errormessage1", "}"}], ",", RowBox[{"{", "b", "}"}]}], "}"}], "]"}], "]"}], ",", RowBox[{"WindowMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "Automatic"}], "}"}], ",", RowBox[{"{", RowBox[{"Automatic", ",", "0"}], "}"}]}], "}"}]}]}], "]"}]}]}], "]"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"q", "[", RowBox[{"[", "s", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], ",", "0"}], "]"}], ",", RowBox[{"MessageDialog", "[", "errormessage2", "]"}], ",", RowBox[{ RowBox[{"constant", "=", "True"}], ";", RowBox[{"expbEc", "=", "0"}], ";", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"Cbar", "[", RowBox[{"[", RowBox[{"i", ",", "s"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}], ">", "0"}], ",", RowBox[{ RowBox[{"expbEc1", "=", RowBox[{"b", ".", RowBox[{ RowBox[{"Bayes", "[", RowBox[{ RowBox[{"{", RowBox[{"Cbar", "[", RowBox[{"[", "i", "]"}], "]"}], "}"}], ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}]}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{"i", ">", "1"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"expbEc1", "\[NotEqual]", "expbEc"}], ",", RowBox[{"constant", "=", "False"}]}], "]"}]}], "]"}], ";", RowBox[{"expbEc", "=", "expbEc1"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "Cbar", "]"}]}], "}"}]}], "]"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{"!", "constant"}], ",", RowBox[{ RowBox[{"MessageDialog", "[", RowBox[{"errormessage3", ",", RowBox[{"WindowMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "Automatic"}], "}"}], ",", RowBox[{"{", RowBox[{"Automatic", ",", "0"}], "}"}]}], "}"}]}]}], "]"}], ";", RowBox[{"DCRAmaxgeneral", "[", RowBox[{"Cbar", ",", "EE", ",", "b", ",", "Bbar"}], "]"}]}], ",", " ", RowBox[{ RowBox[{"Lbar", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"Bbar", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"ss", "\[Equal]", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"ss", "\[Equal]", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}]}], ",", RowBox[{"-", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"CbarE", "=", RowBox[{"Ext", "[", RowBox[{"Bayes", "[", RowBox[{"Cbar", ",", "EE"}], "]"}], "]"}]}], ";", RowBox[{"QbarE", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"CbarE", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "-", "a"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Lbar"}], "}"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"ostar", "=", RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], "]"}]}], ";", RowBox[{"Rbar", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"Cbar", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"b", ",", "ostar"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"-", "b"}], ",", RowBox[{"-", "ostar"}]}], "}"}], "}"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "-", "a"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Lbar"}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"qg", "=", RowBox[{ RowBox[{"Select", "[", RowBox[{"Rbar", ",", RowBox[{ RowBox[{ RowBox[{"b", ".", RowBox[{ RowBox[{"Bayes", "[", RowBox[{ RowBox[{"{", "#", "}"}], ",", "EE"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], "\[Equal]", RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", RowBox[{ RowBox[{"Bayes", "[", RowBox[{ RowBox[{"{", "q", "}"}], ",", "EE"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"q", ",", "Rbar"}], "}"}]}], "]"}], "]"}]}], "&"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", RowBox[{"alpha", "=", RowBox[{"Sign", "[", RowBox[{"expbEc", "-", "ostar"}], "]"}]}], ";", RowBox[{"UbarE", "=", RowBox[{"Ext", "[", RowBox[{"Bayes", "[", RowBox[{ RowBox[{"Int", "[", RowBox[{"Cbar", ",", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"alpha", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"MemberQ", "[", RowBox[{"EE", ",", "s"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}]}], ",", RowBox[{"alpha", " ", RowBox[{"Sum", "[", RowBox[{ RowBox[{"qg", "[", RowBox[{"[", "s", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}]}]}], "}"}], "}"}]}], "]"}], ",", "EE"}], "]"}], "]"}]}]}]}], "]"}]}]}], "]"}]}]}], "]"}]}], ";", RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{ RowBox[{" ", RowBox[{ RowBox[{ "DCRAmaxgeneral", " ", "takes", " ", "as", " ", "arguments", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "probability", " ", "measures", " ", "Cbar"}], ",", " ", RowBox[{ "an", " ", "event", " ", "EE", " ", "given", " ", "positive", " ", "weight", " ", "by", " ", "each", " ", "measure", " ", "in", " ", "Cbar"}], ",", " ", RowBox[{ "an", " ", "initially", " ", "optimal", " ", "utility", " ", "act", " ", "b1"}], ",", " ", RowBox[{ "and", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "feasible", " ", "utility", " ", "acts", " ", RowBox[{"Bbar", ".", " ", "It"}], " ", "returns", " ", "the", " ", "extreme", " ", "points", " ", "of", " ", "the", " ", "set", " ", "of", " ", "measures", " ", "obtained", " ", "by", " ", "updating", " ", "according", " ", "to", " ", "the", " ", "DCRAmax", " ", "rule", " ", "as", " ", "defined", " ", "by", " ", "HKM", " ", "2011"}]}], ")"}], ".", " ", "It"}], " ", "is", " ", "more", " ", "general"}], ",", " ", RowBox[{"but", " ", "also", " ", "more", " ", "complex"}], ",", " ", RowBox[{"than", " ", "DCRAmaxspecial"}], ",", " ", RowBox[{ "as", " ", "it", " ", "does", " ", "not", " ", "require", " ", "that", " ", "the", " ", "conditional", " ", "expectations", " ", "of", " ", "the", " ", "initially", " ", "optimal", " ", "utility", " ", "act", " ", "on", " ", "the", " ", "complement", " ", "of", " ", "the", " ", "event", " ", "E", " ", "are", " ", "all", " ", "equal", " ", "for", " ", "measures", " ", "in", " ", "Cbar", " ", "that", " ", "assign", " ", "positive", " ", "probability", " ", "to", " ", "this", " ", RowBox[{"event", "."}]}]}], " ", "*)"}], RowBox[{ RowBox[{"DCRAmaxgeneral", "[", RowBox[{"Cbar_", ",", "EE_", ",", "b1_", ",", "Bbar_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "b", ",", "Lbar", ",", "CbarE", ",", "QbarE", ",", "ostar", ",", "Rbar", ",", "qg", ",", "xi", ",", "Abar", ",", "K0", ",", "beta3", ",", "const", ",", "sol", ",", "astar", ",", "alphastarq1q2", ",", " ", "UbarE"}], "}"}], ",", RowBox[{ RowBox[{"UbarE", "=", RowBox[{"{", "}"}]}], ";", RowBox[{"b", "=", "b1"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], "]"}], "\[NotEqual]", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{ RowBox[{"b", "=", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", RowBox[{"MessageDialog", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{"Grid", "[", RowBox[{"{", RowBox[{ RowBox[{"{", "errormessage1", "}"}], ",", RowBox[{"{", "b", "}"}]}], "}"}], "]"}], "]"}], ",", RowBox[{"WindowMargins", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "Automatic"}], "}"}], ",", RowBox[{"{", RowBox[{"Automatic", ",", "0"}], "}"}]}], "}"}]}]}], "]"}]}]}], "]"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"q", "[", RowBox[{"[", "s", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], ",", "0"}], "]"}], ",", RowBox[{"MessageDialog", "[", "errormessage2", "]"}], ",", RowBox[{ RowBox[{"Lbar", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"Bbar", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"ss", "\[Equal]", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{"ss", "\[Equal]", "s"}], "]"}], ",", RowBox[{"{", RowBox[{"ss", ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}]}], "}"}]}], "]"}]}], ",", RowBox[{"-", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"Length", "[", "b", "]"}], "]"}], ",", "EE"}], "]"}]}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"CbarE", "=", RowBox[{"Ext", "[", RowBox[{"Bayes", "[", RowBox[{"Cbar", ",", "EE"}], "]"}], "]"}]}], ";", RowBox[{"QbarE", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"CbarE", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "-", "a"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Lbar"}], "}"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"ostar", "=", RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", "q"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}], "]"}]}], ";", RowBox[{"Rbar", "=", RowBox[{"Ext", "[", RowBox[{"Int", "[", RowBox[{"Cbar", ",", RowBox[{"Join", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"b", ",", "ostar"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"-", "b"}], ",", RowBox[{"-", "ostar"}]}], "}"}], "}"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"b", "-", "a"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "Lbar"}], "}"}]}], "]"}]}], "]"}]}], "]"}], "]"}]}], ";", RowBox[{"qg", "=", RowBox[{ RowBox[{"Select", "[", RowBox[{"Rbar", ",", RowBox[{ RowBox[{ RowBox[{"b", ".", RowBox[{ RowBox[{"Bayes", "[", RowBox[{ RowBox[{"{", "#", "}"}], ",", "EE"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], "\[Equal]", RowBox[{"Min", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"b", ".", RowBox[{ RowBox[{"Bayes", "[", RowBox[{ RowBox[{"{", "q", "}"}], ",", "EE"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"q", ",", "Rbar"}], "}"}]}], "]"}], "]"}]}], "&"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", RowBox[{"xi", "=", RowBox[{"1", "/", "2"}]}], ";", RowBox[{"Abar", "=", RowBox[{"{", "}"}]}], ";", RowBox[{"beta3", "=", RowBox[{"b", ".", RowBox[{ RowBox[{"Bayes", "[", RowBox[{ RowBox[{"{", "qg", "}"}], ",", "EE"}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}]}], ";", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"K0", "=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"ostar", "-", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"EE", ",", "s"}], "]"}], ",", "beta3", ",", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", "b", "]"}]}], "}"}]}], "]"}], ".", RowBox[{"(", RowBox[{ RowBox[{"xi", " ", RowBox[{"c", "[", RowBox[{"[", "1", "]"}], "]"}]}], "+", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "xi"}], ")"}], RowBox[{"c", "[", RowBox[{"[", "2", "]"}], "]"}]}]}], ")"}]}]}], "\[GreaterEqual]", "0"}], ",", "1", ",", RowBox[{"-", "1"}]}], "]"}]}], ";", RowBox[{"const", "=", RowBox[{ RowBox[{"And", "@@", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"q", ".", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"EE", ",", "s"}], "]"}], ",", RowBox[{"a", "[", "s", "]"}], ",", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", "b", "]"}]}], "}"}]}], "]"}]}], "\[GreaterEqual]", "ostar"}], ",", RowBox[{"{", RowBox[{"q", ",", "Cbar"}], "}"}]}], "]"}]}], "&&", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"xi", " ", RowBox[{"c", "[", RowBox[{"[", "1", "]"}], "]"}]}], "+", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "xi"}], ")"}], RowBox[{"c", "[", RowBox[{"[", "2", "]"}], "]"}]}]}], ")"}], ".", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"EE", ",", "s"}], "]"}], ",", RowBox[{"a", "[", "s", "]"}], ",", RowBox[{"b", "[", RowBox[{"[", "s", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", "b", "]"}]}], "}"}]}], "]"}]}], "\[Equal]", " ", "ostar"}], "&&", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"a", "[", "s", "]"}], "-", "beta3"}], ")"}], RowBox[{"c", "[", RowBox[{"[", RowBox[{"1", ",", "s"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}], "\[GreaterEqual]", "0"}]}]}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"FindInstance", "[", RowBox[{"const", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"a", "[", "s", "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}]}], "]"}], "\[NotEqual]", RowBox[{"{", "}"}]}], ",", RowBox[{ RowBox[{"sol", "=", RowBox[{"Maximize", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"K0", " ", RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"a", "[", "s", "]"}], "-", "beta3"}], ")"}], RowBox[{"c", "[", RowBox[{"[", RowBox[{"2", ",", "s"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}]}], ",", "const"}], "}"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"a", "[", "s", "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}]}], "]"}]}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], "\[Equal]", "\[Infinity]"}], ",", RowBox[{"Abar", "=", RowBox[{"Union", "[", RowBox[{"Abar", ",", RowBox[{"{", RowBox[{ RowBox[{"xi", " ", RowBox[{"c", "[", RowBox[{"[", "1", "]"}], "]"}]}], "+", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "xi"}], ")"}], RowBox[{"c", "[", RowBox[{"[", "2", "]"}], "]"}]}]}], "}"}]}], "]"}]}], ",", RowBox[{ RowBox[{"astar", "=", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"a", "[", "s", "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}], "/.", RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}]}]}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"astar", "[", RowBox[{"[", "s", "]"}], "]"}], "-", "beta3"}], ")"}], RowBox[{"c", "[", RowBox[{"[", RowBox[{"2", ",", "s"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}], "\[GreaterEqual]", "0"}], ",", RowBox[{"Abar", "=", RowBox[{"Union", "[", RowBox[{"Abar", ",", "c"}], "]"}]}], ",", RowBox[{ RowBox[{"alphastarq1q2", "=", FractionBox[ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"astar", "[", RowBox[{"[", "s", "]"}], "]"}], "-", "beta3"}], ")"}], RowBox[{"c", "[", RowBox[{"[", RowBox[{"2", ",", "s"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}], RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"astar", "[", RowBox[{"[", "s", "]"}], "]"}], "-", "beta3"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"c", "[", RowBox[{"[", RowBox[{"2", ",", "s"}], "]"}], "]"}], "-", RowBox[{"c", "[", RowBox[{"[", RowBox[{"1", ",", "s"}], "]"}], "]"}]}], ")"}]}], ",", RowBox[{"{", RowBox[{"s", ",", "EE"}], "}"}]}], "]"}]]}], ";", RowBox[{"Abar", "=", RowBox[{"Union", "[", RowBox[{"Abar", ",", RowBox[{"{", RowBox[{ RowBox[{"alphastarq1q2", " ", RowBox[{"c", "[", RowBox[{"[", "1", "]"}], "]"}]}], "+", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "alphastarq1q2"}], ")"}], RowBox[{"c", "[", RowBox[{"[", "2", "]"}], "]"}]}]}], "}"}]}], "]"}]}]}]}], "]"}]}]}], "]"}]}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"c", ",", RowBox[{"Tuples", "[", RowBox[{"Cbar", ",", "2"}], "]"}]}], "}"}]}], "]"}], ";", RowBox[{"UbarE", " ", "=", " ", RowBox[{"Ext", "[", RowBox[{"Bayes", "[", RowBox[{"Abar", ",", "EE"}], "]"}], "]"}]}]}]}], "]"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ "Ext", " ", "takes", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "vectors", " ", "as", " ", "its", " ", "argument"}], ",", " ", RowBox[{ "and", " ", "returns", " ", "the", " ", "extreme", " ", "points", " ", "of", " ", "the", " ", "convex", " ", "hull", " ", "of", " ", "this", " ", RowBox[{"set", ".", " ", "See"}], " ", RowBox[{"Appendix", ":", RowBox[{ "algorithms", " ", "from", " ", "polyhedral", " ", "theory", " ", "in", " ", "HKM", " ", "2011"}]}]}]}], " ", "*)"}], RowBox[{ RowBox[{ RowBox[{"Ext", "[", "H_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "H1", "}"}], ",", RowBox[{ RowBox[{"H1", "=", RowBox[{"Union", "[", "H", "]"}]}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", "H1", "]"}], "\[LessEqual]", "2"}], ",", "H1", ",", RowBox[{"H1", "[", RowBox[{"[", RowBox[{ RowBox[{"Position", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"FindInstance", "[", RowBox[{ RowBox[{ RowBox[{"And", "@@", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{ RowBox[{"\[Alpha]", "[", "hh", "]"}], RowBox[{"hh", "[", RowBox[{"[", "s", "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"hh", ",", RowBox[{"Complement", "[", RowBox[{"H1", ",", RowBox[{"{", "h", "}"}]}], "]"}]}], "}"}]}], "]"}], "\[Equal]", RowBox[{"h", "[", RowBox[{"[", "s", "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"s", ",", RowBox[{"Length", "[", "h", "]"}]}], "}"}]}], "]"}]}], "&&", RowBox[{"And", "@@", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"\[Alpha]", "[", "hh", "]"}], "\[GreaterEqual]", "0"}], ",", RowBox[{"{", RowBox[{"hh", ",", RowBox[{"Complement", "[", RowBox[{"H1", ",", RowBox[{"{", "h", "}"}]}], "]"}]}], "}"}]}], "]"}]}], "&&", RowBox[{ RowBox[{"Sum", "[", RowBox[{ RowBox[{"\[Alpha]", "[", "hh", "]"}], ",", RowBox[{"{", RowBox[{"hh", ",", RowBox[{"Complement", "[", RowBox[{"H1", ",", RowBox[{"{", "h", "}"}]}], "]"}]}], "}"}]}], "]"}], "\[Equal]", "1"}]}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"\[Alpha]", "[", "hh", "]"}], ",", RowBox[{"{", RowBox[{"hh", ",", RowBox[{"Complement", "[", RowBox[{"H1", ",", RowBox[{"{", "h", "}"}]}], "]"}]}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"h", ",", "H1"}], "}"}]}], "]"}], ",", RowBox[{"{", "}"}]}], "]"}], "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}], "]"}], "]"}]}], "]"}]}]}], "]"}]}], ";", RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{ "Int", " ", "takes", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "vectors", " ", "and", " ", "a", " ", "finite", " ", "set", " ", "of", " ", "half"}], "-", RowBox[{"spaces", " ", "as", " ", "its", " ", "argument"}]}], ",", " ", RowBox[{ "and", " ", "returns", " ", "the", " ", "extreme", " ", "points", " ", "of", " ", "their", " ", RowBox[{"intersection", ".", " ", "See"}], " ", RowBox[{"Appendix", ":", RowBox[{ "algorithms", " ", "from", " ", "polyhedral", " ", "theory", " ", "in", " ", "HKM", " ", "2011"}]}]}]}], "*)"}], RowBox[{ RowBox[{"Int", "[", RowBox[{"A_", ",", "W_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{ RowBox[{"Dbar", "=", RowBox[{"Ext", "[", "A", "]"}]}], ";", RowBox[{"Do", "[", RowBox[{ RowBox[{"Dbar", "=", RowBox[{"Ext", "[", RowBox[{"Union", "[", RowBox[{ RowBox[{"Select", "[", RowBox[{"Dbar", ",", RowBox[{ RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"[", "1", "]"}], "]"}], ".", "#"}], "\[GreaterEqual]", RowBox[{"w", "[", RowBox[{"[", "2", "]"}], "]"}]}], "&"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ FractionBox[ RowBox[{ RowBox[{"w", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "1", "]"}], "]"}], ".", RowBox[{"cc", "[", RowBox[{"[", "2", "]"}], "]"}]}]}], RowBox[{ RowBox[{"w", "[", RowBox[{"[", "1", "]"}], "]"}], ".", RowBox[{"(", RowBox[{ RowBox[{"cc", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"cc", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}]], RowBox[{"(", RowBox[{ RowBox[{"cc", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"cc", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], "+", RowBox[{"cc", "[", RowBox[{"[", "2", "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"cc", ",", RowBox[{"Select", "[", RowBox[{ RowBox[{"Tuples", "[", RowBox[{"Dbar", ",", "2"}], "]"}], ",", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"[", "1", "]"}], "]"}], ".", RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}]}], "-", RowBox[{"w", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"[", "1", "]"}], "]"}], ".", RowBox[{"#", "[", RowBox[{"[", "2", "]"}], "]"}]}], "-", RowBox[{"w", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], "<", "0"}], "&"}]}], "]"}]}], "}"}]}], "]"}]}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"w", ",", "W"}], "}"}]}], "]"}], ";", "Dbar"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Define", " ", "various", " ", "error", " ", "messages"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ "errormessage1", "=", "\"\\""}], ";", RowBox[{ "errormessage2", "=", "\"\\""}], ";", RowBox[{ "errormessage3", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ "run", " ", "is", " ", "a", " ", "basic", " ", "user", " ", "interface", " ", "allowing", " ", "entry", " ", RowBox[{"(", RowBox[{ "or", " ", "use", " ", "of", " ", "the", " ", "default", " ", "values", " ", "it", " ", "is", " ", "called", " ", "with"}], ")"}], " ", "of", " ", "the", " ", "set", " ", "of", " ", "probability", " ", "measures"}], ",", " ", RowBox[{ "the", " ", "set", " ", "of", " ", "feasible", " ", "utility", " ", "acts"}], ",", " ", RowBox[{ "a", " ", "choice", " ", "of", " ", "initially", " ", "maxminEU", " ", "optimal", " ", "act", " ", RowBox[{"(", RowBox[{ "the", " ", "algorithm", " ", "checks", " ", "to", " ", "make", " ", "sure", " ", "it", " ", "is", " ", "indeed", " ", "an", " ", "optimum"}], ")"}]}], ",", " ", RowBox[{"the", " ", "event", " ", "to", " ", "update", " ", "on"}], ",", " ", RowBox[{ "and", " ", "the", " ", "choice", " ", "of", " ", "update", " ", "rule"}], ",", " ", "DCmax", ",", " ", RowBox[{"DCPFImax", " ", "or", " ", "DCRAmax", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ "first", " ", "tries", " ", "to", " ", "use", " ", "the", " ", "DCRAmaxspecial", " ", "algorithm"}], ",", " ", RowBox[{"and", " ", "if", " ", "that", " ", RowBox[{"can", "'"}], "t", " ", "be", " ", "used"}], ",", " ", RowBox[{ "calls", " ", "the", " ", "DCRAmaxgeneral", " ", "algorithm"}]}], ")"}], "."}]}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"run", "[", RowBox[{ "initCbar_", ",", "initEE_", ",", "initb_", ",", "initBbar_", ",", "initalg_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"Cbar", ",", "EE", ",", "b", ",", "Bbar", ",", "alg"}], "}"}], ",", RowBox[{ RowBox[{"Cbar", "=", RowBox[{"Input", "[", RowBox[{ "\"\\"", ",", "initCbar"}], "]"}]}], ";", RowBox[{"Bbar", "=", RowBox[{"Input", "[", RowBox[{ "\"\\"", ",", "initBbar"}], "]"}]}], ";", RowBox[{"b", "=", RowBox[{"If", "[", RowBox[{ RowBox[{"initb", "\[NotEqual]", RowBox[{"{", "}"}]}], ",", "initb", ",", RowBox[{ RowBox[{"Exante", "[", RowBox[{"Cbar", ",", "Bbar"}], "]"}], "[", RowBox[{"[", "2", "]"}], "]"}]}], "]"}]}], ";", RowBox[{"b", "=", RowBox[{"Input", "[", RowBox[{ "\"\\"", ",", "b"}], "]"}]}], ";", RowBox[{"EE", "=", RowBox[{"Input", "[", RowBox[{ "\"\\"", ",", "initEE"}], "]"}]}], ";", RowBox[{"alg", "=", RowBox[{"Input", "[", RowBox[{ "\"\\"", ",", "initalg"}], "]"}]}], ";", RowBox[{"result", "=", RowBox[{"Switch", "[", RowBox[{"alg", ",", "1", ",", RowBox[{"DCmax", "[", RowBox[{"Cbar", ",", "EE", ",", "b", ",", "Bbar"}], "]"}], ",", "2", ",", RowBox[{"DCPFImax", "[", RowBox[{"Cbar", ",", "EE", ",", "b", ",", "Bbar"}], "]"}], ",", "3", ",", RowBox[{"DCRAmaxspecial", "[", RowBox[{"Cbar", ",", "EE", ",", "b", ",", "Bbar"}], "]"}]}], "]"}]}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{"result", "\[NotEqual]", RowBox[{"{", "}"}]}], ",", RowBox[{"MessageDialog", "[", RowBox[{"Text", "[", RowBox[{"Grid", "[", RowBox[{"{", RowBox[{ RowBox[{ "{", "\"\\"", "}"}], ",", RowBox[{"{", "result", "}"}]}], "}"}], "]"}], "]"}], "]"}]}], "]"}]}]}], "]"}]}], ";"}]}]}]], "Input", CellChangeTimes->{{3.513609582203125*^9, 3.51360961521875*^9}, { 3.513609702421875*^9, 3.513609702703125*^9}, {3.51360977184375*^9, 3.513609843890625*^9}, {3.513609912703125*^9, 3.513610158984375*^9}, { 3.513610409328125*^9, 3.5136104378125*^9}, 3.513610471484375*^9, { 3.513610743390625*^9, 3.51361074396875*^9}, {3.5136110365*^9, 3.51361104165625*^9}, {3.51361118665625*^9, 3.513611259859375*^9}, { 3.513611386546875*^9, 3.51361138715625*^9}, {3.513662637328125*^9, 3.51366264525*^9}, {3.513694499125*^9, 3.513694499234375*^9}, { 3.513782968484375*^9, 3.5137830435625*^9}, {3.5137831920625*^9, 3.513783194125*^9}, {3.5137832588125*^9, 3.513783283515625*^9}, { 3.5137899795*^9, 3.513789994671875*^9}, {3.513790412140625*^9, 3.513790483078125*^9}, {3.51379051375*^9, 3.513790750046875*^9}, { 3.51379094521875*^9, 3.51379104028125*^9}, 3.5137916123125*^9, { 3.51379190971875*^9, 3.51379191459375*^9}, {3.5137926849375*^9, 3.51379273771875*^9}, {3.513792876296875*^9, 3.5137929074375*^9}, { 3.513794220171875*^9, 3.513794267421875*^9}, {3.5137943396875*^9, 3.513794445703125*^9}, {3.513961344471278*^9, 3.513961367938278*^9}, { 3.513961410319278*^9, 3.513961873745278*^9}, {3.513961915993278*^9, 3.513962052503278*^9}, {3.513962119935278*^9, 3.513962158831278*^9}, { 3.513962977223278*^9, 3.513963058831278*^9}, {3.5139631310822783`*^9, 3.513963168702278*^9}, {3.513963208665278*^9, 3.5139632293442783`*^9}, { 3.513963302133278*^9, 3.513963346120278*^9}, {3.513963425547278*^9, 3.5139634280162783`*^9}, {3.5139635009182777`*^9, 3.513963551868278*^9}, { 3.5139638765422783`*^9, 3.5139638781352777`*^9}, {3.513965367072278*^9, 3.513965377882278*^9}, {3.513965417975278*^9, 3.513965418242278*^9}, { 3.513965664415278*^9, 3.5139656649252777`*^9}, {3.513965712005278*^9, 3.5139658600172777`*^9}, {3.513966535384078*^9, 3.513966537131278*^9}, { 3.513967342398478*^9, 3.513967359761278*^9}, {3.513967393145278*^9, 3.513967496323678*^9}, {3.513967594151278*^9, 3.513967661964478*^9}, { 3.513967692306478*^9, 3.5139676971892776`*^9}, {3.513967886869678*^9, 3.513967899412078*^9}, {3.5139680701384783`*^9, 3.513968523770878*^9}, { 3.513968559494878*^9, 3.513968644842478*^9}, {3.513968841792478*^9, 3.5139688486408777`*^9}, {3.513968879965678*^9, 3.5139689067040777`*^9}, { 3.513968943769678*^9, 3.513968976607678*^9}, {3.513969041987278*^9, 3.513969075449278*^9}, {3.514483740671875*^9, 3.514483785015625*^9}, { 3.514483835640625*^9, 3.51448392665625*^9}, {3.51448396440625*^9, 3.514484171015625*^9}, {3.517901235578125*^9, 3.5179012620625*^9}, { 3.517901299796875*^9, 3.51790130134375*^9}, {3.517901375859375*^9, 3.517901404359375*^9}, {3.517901488796875*^9, 3.517901513515625*^9}, { 3.517901599640625*^9, 3.517901617578125*^9}, {3.5179016483125*^9, 3.517901700953125*^9}, {3.517901764421875*^9, 3.517901814921875*^9}, { 3.517901905234375*^9, 3.517901941328125*^9}, {3.5179020066875*^9, 3.517902055625*^9}, {3.51790212896875*^9, 3.517902132984375*^9}, { 3.5179021786875*^9, 3.517902182625*^9}, {3.51790232634375*^9, 3.51790234478125*^9}, {3.51790246709375*^9, 3.517902479265625*^9}, { 3.517902584546875*^9, 3.517902666578125*^9}, 3.51791149675*^9, { 3.517911855234375*^9, 3.517911857828125*^9}, 3.517911947078125*^9, { 3.517911995078125*^9, 3.517912033078125*^9}, 3.517912184265625*^9, { 3.517912302734375*^9, 3.517912351875*^9}, {3.517912415265625*^9, 3.517912416953125*^9}, {3.5179124570625*^9, 3.51791245871875*^9}, 3.517912498953125*^9, {3.51791259028125*^9, 3.5179126096875*^9}, 3.51791271459375*^9, {3.517912747921875*^9, 3.517912801484375*^9}, 3.517913132078125*^9, {3.517913429359375*^9, 3.517913435359375*^9}, { 3.517913603125*^9, 3.517913604265625*^9}, {3.5182307949124002`*^9, 3.5182308373756*^9}, {3.5182317548896*^9, 3.5182318658992*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"run", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ FractionBox["2", "5"], ",", FractionBox["2", "5"], ",", FractionBox["1", "10"], ",", FractionBox["1", "10"]}], "}"}], ",", RowBox[{"{", RowBox[{ FractionBox["1", "10"], ",", FractionBox["2", "5"], ",", FractionBox["1", "4"], ",", FractionBox["1", "4"]}], "}"}], ",", RowBox[{"{", RowBox[{ FractionBox["2", "5"], ",", FractionBox["1", "10"], ",", FractionBox["1", "4"], ",", FractionBox["1", "4"]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", RowBox[{"-", "17"}], ",", "18", ",", "18"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", RowBox[{"-", "5"}], ",", "20", ",", "20"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", RowBox[{"-", "15"}], ",", "10", ",", RowBox[{"-", "15"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", RowBox[{"-", "7"}], ",", "18", ",", "18"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"8", ",", RowBox[{"-", "17"}], ",", "8", ",", RowBox[{"-", "17"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", RowBox[{"-", "7"}], ",", "8", ",", RowBox[{"-", "17"}]}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", RowBox[{"-", "17"}], ",", "18", ",", "18"}], "}"}]}], "}"}], ",", "2"}], "]"}], ";"}]], "Input", CellChangeTimes->{ 3.513791786359375*^9, {3.513791943859375*^9, 3.5137919795625*^9}, { 3.513792753921875*^9, 3.513792768765625*^9}, 3.513794799859375*^9, 3.51790291015625*^9, 3.5179121061875*^9, 3.517912402546875*^9, { 3.51809683984375*^9, 3.51809691296875*^9}, {3.51809699425*^9, 3.51809700671875*^9}, {3.518097047390625*^9, 3.5180972126875*^9}, { 3.518097357171875*^9, 3.518097361015625*^9}, {3.518097397203125*^9, 3.518097419125*^9}, 3.518097637890625*^9}] }, AutoGeneratedPackage->Automatic, WindowSize->{1672, 925}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Magnification->2., FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (June 19, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[568, 21, 76024, 1781, 6558, "Input"], Cell[76595, 1804, 2336, 66, 173, "Input"] } ] *) (* End of internal cache information *)