diff --git "a/all/amps_counting_and_stats.json" "b/all/amps_counting_and_stats.json" deleted file mode 100644--- "a/all/amps_counting_and_stats.json" +++ /dev/null @@ -1,100014 +0,0 @@ -{ - "Source": [ - "AMPS.algebra.mathematica/counting_and_statistics/kl_divergence" - ], - "Categories": [ - { - "Math complexity": 4, - "Language complexity": 1, - "Domain knowledge complexity": 3 - } - ], - "Instances": [ - { - "Input": "Problem:\n\nCompute the range of ${-4, -6, 5, 8, 10, \\frac{23}{3}, \\frac{9}{\\sqrt{\\pi }}, 0, 9, 8, \\frac{11}{2}, 3 \\pi, -9, -\\frac{3}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -6, 5, 8, 10, (23/3), (9/(math.sqrt(math.pi))), 0, 9, 8, (11/2), 3*math.pi, -9, -(3/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{7}, \\frac{1}{4}, \\frac{19}{2}, \\frac{2}{\\sqrt{\\pi }}, -e, 4 \\sqrt{3}, \\frac{13}{\\sqrt{2}}, -\\frac{2}{\\sqrt{5}}, 3, -5, 6, 0, 2, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{29}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (11/7), (1/4), (19/2), (2/(math.sqrt(math.pi))), -math.e, 4*math.sqrt(3), (13/(math.sqrt(2))), -(2/(math.sqrt(5))), 3, -5, 6, 0, 2, -2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, -6, -8}$.\n", - "Output Answer": [ - "$\\frac{67}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -6, -8\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5 \\sqrt{3}, 5.013, -2.95, \\sqrt{2}, -\\frac{13}{\\sqrt{3}}, -6, 9}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -\\frac{13}{\\sqrt{3}}, -6, -2.95, \\sqrt{2}, 5.013, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(3), 5.013, -2.95, math.sqrt(2), -(13/(math.sqrt(3))), -6, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -3.881, -7.42, -9, -2 \\sqrt{5}, -7, 7.8, 2.07} \\setminus {-2 \\sqrt{5}, \\frac{5}{\\sqrt{3}}, \\frac{3}{\\sqrt{2}}, -5, -3, 7.67}$.\n", - "Output Answer": [ - "${-9, -7.42, -7, -3.881, 2.07, 7.8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -3.881, -7.42, -9, -2*math.sqrt(5), -7, 7.8, 2.07,))\nsnd = set((-2*math.sqrt(5), (5/(math.sqrt(3))), (3/(math.sqrt(2))), -5, -3, 7.67,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 1, 3}$.\n", - "Output Answer": [ - "$\\frac{13}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 1, 3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.098,0.107,0.126,0.127,0.251,0.046\\}$ and $\\{0.098,0.694,0.066,0.047,0.019,0.033\\}$.", - "Output Answer": [ - "$1.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.098, 0.107, 0.126, 0.127, 0.251, 0.046\ndistribution2 = 0.098, 0.694, 0.066, 0.047, 0.019, 0.033\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x-0.9$ where $x \\sim $ \\text{BetaDistribution}[0.9,1.4]\n", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.9, 1.4)\nprint(E(2.6*x-0.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{7}{2}, \\frac{9}{\\sqrt{2}}, 12 \\log (2), -3} \\setminus {-4, 2, \\frac{9}{\\sqrt{2}}, 9, \\frac{7}{2}}$.\n", - "Output Answer": [ - "${-3, 12 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/2), (9/(math.sqrt(2))), 12*math.log(2), -3,))\nsnd = set((-4, 2, (9/(math.sqrt(2))), 9, (7/2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{34}{7}, -2, -7, -4, -8, -3 \\sqrt{5}, -9}$.\n", - "Output Answer": [ - "$\\frac{97}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = (34/7), -2, -7, -4, -8, -3*math.sqrt(5), -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 9, 3, 25, 625, -216}$.\n", - "Output Answer": [ - "$30 \\sqrt[6]{-2} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 9, 3, 25, 625, -216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${4, \\frac{39}{5}, -\\frac{31}{5}, 2, \\frac{28}{5}, -6, -\\frac{41}{5}, -\\frac{33}{5}, \\frac{46}{5}, -\\frac{8}{5}, -\\frac{47}{5}, \\frac{34}{5}, \\frac{24}{5}, \\frac{3}{5}} \\cap {-10, \\frac{4}{5}, \\frac{31}{5}, \\frac{43}{5}, -\\frac{16}{5}, -\\frac{41}{5}, \\frac{39}{5}, 1, \\frac{26}{5}, -6, -\\frac{22}{5}, -\\frac{39}{5}, -\\frac{17}{5}}$.\n", - "Output Answer": [ - "${-\\frac{41}{5}, -6, \\frac{39}{5}}$" - ], - "Output Program": [ - "fst = set((4, (39/5), -(31/5), 2, (28/5), -6, -(41/5), -(33/5), (46/5), -(8/5), -(47/5), (34/5), (24/5), (3/5),))\nsnd = set((-10, (4/5), (31/5), (43/5), -(16/5), -(41/5), (39/5), 1, (26/5), -6, -(22/5), -(39/5), -(17/5),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.178,0.21,0.348,0.045,0.015,0.015,0.022,0.002,0.123\\}$ and $\\{0.155,0.037,0.078,0.056,0.058,0.118,0.147,0.142,0.101\\}$.", - "Output Answer": [ - "$0.79$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.178, 0.21, 0.348, 0.045, 0.015, 0.015, 0.022, 0.002, 0.123\ndistribution2 = 0.155, 0.037, 0.078, 0.056, 0.058, 0.118, 0.147, 0.142, 0.101\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 2, -7, -2, -15}$.\n", - "Output Answer": [ - "$\\frac{443}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 2, -7, -2, -15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{14}{\\sqrt{5}}, 5, 4, -\\frac{10}{\\pi }, 7, -\\frac{9}{\\pi }, -6, -3, 3, 0}$.", - "Output Answer": [ - "$-\\frac{9}{2 \\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(14/(math.sqrt(5))), 5, 4, -(10/math.pi), 7, -(9/math.pi), -6, -3, 3, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{3}, -1, 6, 8, -8, -7, 7} \\cup {7, 6, \\sqrt{3}, 8, 5 \\sqrt{3}, -1, 0}$.\n", - "Output Answer": [ - "${-8, -7, -1, 0, \\sqrt{3}, 6, 7, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), -1, 6, 8, -8, -7, 7,))\nsnd = set((7, 6, math.sqrt(3), 8, 5*math.sqrt(3), -1, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 8, -2 \\sqrt{5}, 6, 0, \\frac{17}{\\sqrt{\\pi }}, -\\log (2), -6 \\sqrt{2}, -\\frac{7}{\\pi }}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 8, -2*math.sqrt(5), 6, 0, (17/(math.sqrt(math.pi))), -math.log(2), -6*math.sqrt(2), -(7/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3 \\sqrt{5}, -5 \\sqrt{3}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -3 \\sqrt{5}, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), -5*math.sqrt(3), 5*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.124,0.098,0.118,0.312,0.32\\}$ and $\\{0.216,0.17,0.093,0.106,0.228\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.124, 0.098, 0.118, 0.312, 0.32\ndistribution2 = 0.216, 0.17, 0.093, 0.106, 0.228\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{12}{7}, -5 \\log (2), 7, -1} \\cup {\\frac{1}{7}, 5, 7, -5 \\log (2), 9}$.\n", - "Output Answer": [ - "${-5 \\log (2), -\\frac{12}{7}, -1, \\frac{1}{7}, 5, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(12/7), -5*math.log(2), 7, -1,))\nsnd = set(((1/7), 5, 7, -5*math.log(2), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\sqrt{3}, -4, 3, -\\frac{4}{e}, -7, \\frac{25}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{3}-\\frac{4}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.sqrt(3), -4, 3, -(4/math.e), -7, (25/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x-4.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7]\n", - "Output Answer": [ - "$-4.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(E(4.6*x-4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3 \\sqrt{5}, -4 \\sqrt{5}, 7, -9, 2, \\sqrt{5}, -3 e, 2}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{5}, -3 e, -3 \\sqrt{5}, 2, 2, \\sqrt{5}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), -4*math.sqrt(5), 7, -9, 2, math.sqrt(5), -3*math.e, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 4, -4, 7, -4, -8, 3, 3, 0, 7, 0, -8, 4, -8, -8, -4, 4, 4, 7, -4, -8, -4, 0, 7, 4, 4, 3, -8}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 4, -4, 7, -4, -8, 3, 3, 0, 7, 0, -8, 4, -8, -8, -4, 4, 4, 7, -4, -8, -4, 0, 7, 4, 4, 3, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-10, 1, 9, -4, -1.865} \\setminus {1, 9, -1, -5, 2}$.\n", - "Output Answer": [ - "${-10, -4, -1.865}$" - ], - "Output Program": [ - "fst = set((-10, 1, 9, -4, -1.865,))\nsnd = set((1, 9, -1, -5, 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2.5, -10, 5, -\\frac{9}{4}, 4 \\log (2), \\frac{3}{\\sqrt{2}}, \\frac{53}{7}, 0} \\cup {-7, 0, \\frac{16}{7}, 4 \\log (2), 4, -6, 5, \\sqrt{2}, -\\frac{9}{4}}$.\n", - "Output Answer": [ - "${-10, -7, -6, -\\frac{9}{4}, 0, \\sqrt{2}, \\frac{3}{\\sqrt{2}}, \\frac{16}{7}, 2.5, 4 \\log (2), 4, 5, \\frac{53}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2.5, -10, 5, -(9/4), 4*math.log(2), (3/(math.sqrt(2))), (53/7), 0,))\nsnd = set((-7, 0, (16/7), 4*math.log(2), 4, -6, 5, math.sqrt(2), -(9/4),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\log (2), 12 \\log (2), 9 \\log (2), -9 \\log (2), 7 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{21 \\log (2)}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.log(2), 12*math.log(2), 9*math.log(2), -9*math.log(2), 7*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 8, 3, 3, 5, 5, 3, 3, 5, 3, 1, 5, 1, 3, 3, 8, 3, 5, 1, 5, 8, 1, 8, 1}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 8, 3, 3, 5, 5, 3, 3, 5, 3, 1, 5, 1, 3, 3, 8, 3, 5, 1, 5, 8, 1, 8, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x^2+0.7 x-2.9$ where $x \\sim $ \\text{ExponentialDistribution}[0.7]\n", - "Output Answer": [ - "$8.71$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.7)\nprint(E(2.6*x**2+0.7*x-2.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\log (2), -\\frac{59}{7}, 10, -8 \\log (2), 7, 3 e, -\\sqrt{5}} \\setminus {8, -\\frac{59}{7}, 3, -9 \\log (2), \\frac{3}{e}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-8 \\log (2), -4 \\log (2), 7, 3 e, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.log(2), -(59/7), 10, -8*math.log(2), 7, 3*math.e, -math.sqrt(5),))\nsnd = set((8, -(59/7), 3, -9*math.log(2), (3/math.e), -math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${2, 3, -3, 8, 0, -9, 1, -6, 9} \\cap {-10, 3, 5, -6, -9, -3, 10, 1, 8}$.\n", - "Output Answer": [ - "${-9, -6, -3, 1, 3, 8}$" - ], - "Output Program": [ - "fst = set((2, 3, -3, 8, 0, -9, 1, -6, 9,))\nsnd = set((-10, 3, 5, -6, -9, -3, 10, 1, 8,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 6, \\frac{5}{\\sqrt{2}}, -6, 6, \\frac{68}{7}, \\frac{5}{3}, -\\frac{22}{\\pi }, 8, -2 \\sqrt{2}, -8, 4 \\sqrt{5}, -9, -4}$.\n", - "Output Answer": [ - "$\\frac{131}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 6, (5/(math.sqrt(2))), -6, 6, (68/7), (5/3), -(22/math.pi), 8, -2*math.sqrt(2), -8, 4*math.sqrt(5), -9, -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -4, 1, -2, -2, -4, 8, 3, 8, 1, 3, 1, 3, 1, 1, -4, -2, 3, -2, -4, 1, 1, 8, -4, 3, -4}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -4, 1, -2, -2, -4, 8, 3, 8, 1, 3, 1, 3, 1, 1, -4, -2, 3, -2, -4, 1, 1, 8, -4, 3, -4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2, 1, -9, 0, \\frac{9}{2}, -5} \\cup {-9, 1, 0, \\frac{9}{2}, 6, -2}$.\n", - "Output Answer": [ - "${-9, -5, -2, 0, 1, 2, \\frac{9}{2}, 6}$" - ], - "Output Program": [ - "fst = set((2, 1, -9, 0, (9/2), -5,))\nsnd = set((-9, 1, 0, (9/2), 6, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.06 < 0.2 x+4.7 < 3.95$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(P((-2.06 < 0.2*x+4.7) & (0.2*x+4.7 < 3.95)))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, -9, 6, 2 \\sqrt{2}, -\\frac{28}{3}, \\frac{19}{e}, 4, -1, \\frac{10}{\\pi }} \\cup {-\\frac{28}{3}, -9, 2, -\\frac{21}{e}, 6, -1, \\frac{24}{\\pi }, -\\frac{7}{\\sqrt{2}}, 9.658, -2}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -9, -\\frac{21}{e}, -\\frac{7}{\\sqrt{2}}, -2, -1, 2, 2 \\sqrt{2}, \\frac{10}{\\pi }, 4, 6, \\frac{19}{e}, \\frac{24}{\\pi }, 9.658}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -9, 6, 2*math.sqrt(2), -(28/3), (19/math.e), 4, -1, (10/math.pi),))\nsnd = set((-(28/3), -9, 2, -(21/math.e), 6, -1, (24/math.pi), -(7/(math.sqrt(2))), 9.658, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, -\\sqrt{5}, 5 \\sqrt{2}, -8, \\frac{32}{7}} \\setminus {-8, 2 \\sqrt{2}, -\\sqrt{5}, -\\frac{66}{7}, -5}$.\n", - "Output Answer": [ - "${\\frac{32}{7}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -math.sqrt(5), 5*math.sqrt(2), -8, (32/7),))\nsnd = set((-8, 2*math.sqrt(2), -math.sqrt(5), -(66/7), -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.147,0.097,0.05,0.116\\}$ and $\\{0.03,0.019,0.09,0.23\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.147, 0.097, 0.05, 0.116\ndistribution2 = 0.03, 0.019, 0.09, 0.23\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, 5, -11}$.\n", - "Output Answer": [ - "$\\frac{313}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 5, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -8, -\\sqrt{5}, \\frac{68}{7}, 2 \\pi, -6, \\frac{5}{\\sqrt{3}}, \\frac{11}{4}, 7, -\\frac{31}{\\pi }, 3}$.\n", - "Output Answer": [ - "$\\frac{68}{7}+\\frac{31}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -8, -math.sqrt(5), (68/7), 2*math.pi, -6, (5/(math.sqrt(3))), (11/4), 7, -(31/math.pi), 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.186,0.049,0.091,0.013,0.091,0.279,0.17,0.073\\}$ and $\\{0.267,0.031,0.055,0.177,0.052,0.067,0.099,0.079\\}$.", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.186, 0.049, 0.091, 0.013, 0.091, 0.279, 0.17, 0.073\ndistribution2 = 0.267, 0.031, 0.055, 0.177, 0.052, 0.067, 0.099, 0.079\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{20}{e}, -\\frac{25}{e}, -\\frac{24}{e}, \\frac{26}{e}, -\\frac{1}{e}, -\\frac{26}{e}, -\\frac{19}{e}, -\\frac{14}{e}} \\cap {-\\frac{21}{e}, -\\frac{22}{e}, -\\frac{1}{e}, -\\frac{13}{e}, -\\frac{4}{e}, \\frac{6}{e}, -\\frac{7}{e}, -\\frac{5}{e}, \\frac{10}{e}}$.\n", - "Output Answer": [ - "${-\\frac{1}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(20/math.e), -(25/math.e), -(24/math.e), (26/math.e), -(1/math.e), -(26/math.e), -(19/math.e), -(14/math.e),))\nsnd = set((-(21/math.e), -(22/math.e), -(1/math.e), -(13/math.e), -(4/math.e), (6/math.e), -(7/math.e), -(5/math.e), (10/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x-3.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$-3.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(0.9*x-3.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 10, 19}$.\n", - "Output Answer": [ - "$\\frac{6270}{509}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 10, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${2, 5, 10, -9, -3, 8, 0, 7, -5, -4} \\cap {2, 4, 3, -3, 6, -4, 8, -7, -9}$.\n", - "Output Answer": [ - "${-9, -4, -3, 2, 8}$" - ], - "Output Program": [ - "fst = set((2, 5, 10, -9, -3, 8, 0, 7, -5, -4,))\nsnd = set((2, 4, 3, -3, 6, -4, 8, -7, -9,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 4, 14, 0}$.\n", - "Output Answer": [ - "$\\frac{1283}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 4, 14, 0\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -4, 1, -7}$.\n", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -4, 1, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, \\frac{12}{\\pi }, -\\frac{6}{7}, 7, -7} \\setminus {\\frac{21}{4}, -6, -\\frac{20}{\\pi }, 3, -\\frac{6}{7}, -5}$.\n", - "Output Answer": [ - "${-7, \\frac{12}{\\pi }, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, (12/math.pi), -(6/7), 7, -7,))\nsnd = set(((21/4), -6, -(20/math.pi), 3, -(6/7), -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.122,0.127,0.059,0.065,0.131,0.103,0.12,0.103,0.038\\}$ and $\\{0.056,0.214,0.071,0.129,0.028,0.071,0.059,0.2,0.034\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.122, 0.127, 0.059, 0.065, 0.131, 0.103, 0.12, 0.103, 0.038\ndistribution2 = 0.056, 0.214, 0.071, 0.129, 0.028, 0.071, 0.059, 0.2, 0.034\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{13}{7}, -\\frac{61}{7}, -\\frac{52}{7}, -\\frac{55}{7}, -7, -\\frac{36}{7}}$.\n", - "Output Answer": [ - "$-\\frac{19}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(13/7), -(61/7), -(52/7), -(55/7), -7, -(36/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, \\frac{5}{4}, -4}$.\n", - "Output Answer": [ - "${-8, -4, \\frac{5}{4}}$" - ], - "Output Program": [ - "values = -8, (5/4), -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 15, -11, -4, -5, 4}$.\n", - "Output Answer": [ - "$\\frac{1123}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 15, -11, -4, -5, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, -14, 15, 14, 4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{287}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -14, 15, 14, 4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{22}{\\pi }, -7, 3 \\pi, -1}$.\n", - "Output Answer": [ - "${-\\frac{22}{\\pi }, -7, -1, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -(22/math.pi), -7, 3*math.pi, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, 10, -15, -15}$.\n", - "Output Answer": [ - "$150$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 10, -15, -15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.21,0.069,0.089,0.45\\}$ and $\\{0.262,0.182,0.214,0.089\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.21, 0.069, 0.089, 0.45\ndistribution2 = 0.262, 0.182, 0.214, 0.089\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 4, -4, \\frac{4}{e}, -\\pi, -\\frac{17}{e}}$.\n", - "Output Answer": [ - "$4+\\frac{17}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 4, -4, (4/math.e), -math.pi, -(17/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7.31, -\\frac{43}{7}, 7, \\frac{17}{\\sqrt{3}}, 2, 1} \\cup {4 \\sqrt{3}, -5, 7.31, -\\frac{43}{7}, 2}$.\n", - "Output Answer": [ - "${-\\frac{43}{7}, -5, 1, 2, 4 \\sqrt{3}, 7, 7.31, \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.31, -(43/7), 7, (17/(math.sqrt(3))), 2, 1,))\nsnd = set((4*math.sqrt(3), -5, 7.31, -(43/7), 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4.4, 5, -3, 6, 3, 1, -2} \\setminus {-4, 6, -2, -1, 10, 5, 3, 4}$.\n", - "Output Answer": [ - "${-4.4, -3, 1}$" - ], - "Output Program": [ - "fst = set((-4.4, 5, -3, 6, 3, 1, -2,))\nsnd = set((-4, 6, -2, -1, 10, 5, 3, 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.3 x^2+4.8 x+0.4$ where $x \\sim $ \\text{BetaDistribution}[1.9,1.8]\n", - "Output Answer": [ - "$1.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 1.8)\nprint(E(-3.3*x**2+4.8*x+0.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -6, -4, -9, -4, -4, -9, -6, -9, -4, -4, -6, -9, -4, -9, -4, -4, 3, -4, 0, -6, -4, -6, 0, -6, -6, -6, 0, -4}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -6, -4, -9, -4, -4, -9, -6, -9, -4, -4, -6, -9, -4, -9, -4, -4, 3, -4, 0, -6, -4, -6, 0, -6, -6, -6, 0, -4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, 2, 6, -1, 5}$.\n", - "Output Answer": [ - "$\\frac{413}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 2, 6, -1, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, 10, 0, -1, 7, -8, -4} \\cup {\\frac{65}{7}, 1, -1, 10, 7, 0}$.\n", - "Output Answer": [ - "${-8, -7, -4, -1, 0, 1, 7, \\frac{65}{7}, 10}$" - ], - "Output Program": [ - "fst = set((-7, 10, 0, -1, 7, -8, -4,))\nsnd = set(((65/7), 1, -1, 10, 7, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, 8, -7, -2 e, 4, -\\frac{10}{e}, -5, -6, \\frac{19}{2}, 5, -\\frac{11}{7}, -\\frac{16}{\\sqrt{3}}, 0}$.", - "Output Answer": [ - "$-\\frac{10}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, 8, -7, -2*math.e, 4, -(10/math.e), -5, -6, (19/2), 5, -(11/7), -(16/(math.sqrt(3))), 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{23}{e}, \\frac{27}{e}, \\frac{23}{e}, \\frac{8}{e}, \\frac{23}{e}, \\frac{23}{e}, \\frac{24}{e}, \\frac{8}{e}, \\frac{23}{e}, \\frac{23}{e}, \\frac{24}{e}, \\frac{23}{e}, \\frac{27}{e}, \\frac{8}{e}, \\frac{26}{e}, \\frac{27}{e}, \\frac{26}{e}, \\frac{27}{e}, \\frac{23}{e}, \\frac{27}{e}, \\frac{26}{e}, \\frac{8}{e}, \\frac{23}{e}, \\frac{26}{e}, \\frac{26}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{23}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (23/math.e), (27/math.e), (23/math.e), (8/math.e), (23/math.e), (23/math.e), (24/math.e), (8/math.e), (23/math.e), (23/math.e), (24/math.e), (23/math.e), (27/math.e), (8/math.e), (26/math.e), (27/math.e), (26/math.e), (27/math.e), (23/math.e), (27/math.e), (26/math.e), (8/math.e), (23/math.e), (26/math.e), (26/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, \\frac{27}{e}, 4 \\sqrt{5}, \\frac{17}{\\sqrt{3}}, -6, 5 \\sqrt{2}, 1, -7, 3, 8, \\pi, 0, -2 e}$.\n", - "Output Answer": [ - "$7+\\frac{27}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, (27/math.e), 4*math.sqrt(5), (17/(math.sqrt(3))), -6, 5*math.sqrt(2), 1, -7, 3, 8, math.pi, 0, -2*math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, -3 \\pi, 4.72}$.\n", - "Output Answer": [ - "${-3 \\pi, 0, 4.72}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -3*math.pi, 4.72\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.001,0.333,0.112,0.331,0.168,0.003,0.019\\}$ and $\\{0.022,0.121,0.297,0.084,0.035,0.318,0.091\\}$.", - "Output Answer": [ - "$0.93$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.001, 0.333, 0.112, 0.331, 0.168, 0.003, 0.019\ndistribution2 = 0.022, 0.121, 0.297, 0.084, 0.035, 0.318, 0.091\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 8, -8, 8, -1, -8, -9, 8, -9, 8, -1, 8, -10, -1, -8, -9, -1, -9, -8, -8, -10, -1, -1, -8, -8, -8, 8, 8, -1, -1}$.\n", - "Output Answer": [ - "$\\{-8,-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 8, -8, 8, -1, -8, -9, 8, -9, 8, -1, 8, -10, -1, -8, -9, -1, -9, -8, -8, -10, -1, -1, -8, -8, -8, 8, 8, -1, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.9 x^2+1.6 x+0.$ where $x \\sim $ \\text{BetaDistribution}[0.4,0.2]\n", - "Output Answer": [ - "$-1.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.4, 0.2)\nprint(E(-4.9*x**2+1.6*x+0.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, 0, \\frac{4}{\\sqrt{3}}, 9, \\frac{5}{2}, -4}$.\n", - "Output Answer": [ - "${-4, 0, \\frac{4}{\\sqrt{3}}, \\frac{5}{2}, 3, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 0, (4/(math.sqrt(3))), 9, (5/2), -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -1, -3, -3, 1, -3}$.\n", - "Output Answer": [ - "${-3, -3, -3, -1, 1, 1}$" - ], - "Output Program": [ - "values = 1, -1, -3, -3, 1, -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{7}{3}, 0, 9, -4 \\sqrt{3}, -\\frac{9}{e}, -10, \\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-10, -4 \\sqrt{3}, -\\frac{9}{e}, 0, \\frac{7}{3}, \\frac{7}{\\sqrt{2}}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/3), 0, 9, -4*math.sqrt(3), -(9/math.e), -10, (7/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, 0, -6, 4, 10, 4, 10, -6, -6, 4, -6, 0, -6, 10, 0, 10, 4, 0, 4, 4, 4, 4, 10, 10, -6, 10, 0}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 0, 0, -6, 4, 10, 4, 10, -6, -6, 4, -6, 0, -6, 10, 0, 10, 4, 0, 4, 4, 4, 4, 10, 10, -6, 10, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.87 < 1.7 x-0.3 < 2.79$ where $x \\sim $ \\text{NormalDistribution}[0.,1.3].", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0., 1.3)\nprint(P((-2.87 < 1.7*x-0.3) & (1.7*x-0.3 < 2.79)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, 1, 4, 4}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 1, 4, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 81, 1000, -10}$.\n", - "Output Answer": [ - "$90 \\sqrt[4]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 81, 1000, -10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{13}{\\sqrt{3}}, -\\sqrt{3}, \\frac{16}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\frac{38}{\\sqrt{3}}-\\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(13/(math.sqrt(3))), -math.sqrt(3), (16/(math.sqrt(3))), (17/(math.sqrt(3))), (7/(math.sqrt(3))), (11/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, -\\frac{13}{\\sqrt{3}}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{21}{\\sqrt{5}}} \\setminus {0, \\frac{39}{5}, -\\frac{13}{\\sqrt{3}}, -9, -6, 4, \\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-\\frac{21}{\\sqrt{5}}, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -(13/(math.sqrt(3))), (4/(math.sqrt(math.pi))), -(21/(math.sqrt(5))),))\nsnd = set((0, (39/5), -(13/(math.sqrt(3))), -9, -6, 4, (4/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\pi, -4, -3 \\sqrt{5}, 6, 0, -\\frac{27}{e}} \\setminus {6, 8.8, -\\frac{27}{e}, \\pi}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -4, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, -4, -3*math.sqrt(5), 6, 0, -(27/math.e),))\nsnd = set((6, 8.8, -(27/math.e), math.pi,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 6.104, -2 \\sqrt{5}, \\frac{9}{7}, 8.01, 2, 6} \\cup {2, -5, 6.104, -2 \\sqrt{5}, 8.01, \\frac{9}{7}}$.\n", - "Output Answer": [ - "${-5, -2 \\sqrt{5}, -2, \\frac{9}{7}, 2, 6, 6.104, 8.01}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 6.104, -2*math.sqrt(5), (9/7), 8.01, 2, 6,))\nsnd = set((2, -5, 6.104, -2*math.sqrt(5), 8.01, (9/7),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, -9, 2 \\pi, 5, -\\sqrt{2}, 3 \\sqrt{3}, 10, 7, -6} \\cup {-\\pi, -4, -6, 0, 2 \\sqrt{3}, 4.32, 10, \\frac{13}{7}, -\\sqrt{2}, 5}$.\n", - "Output Answer": [ - "${-9, -6, -4, -\\pi, -\\sqrt{2}, 0, \\frac{13}{7}, 2 \\sqrt{3}, 4.32, 5, 3 \\sqrt{3}, 2 \\pi, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -9, 2*math.pi, 5, -math.sqrt(2), 3*math.sqrt(3), 10, 7, -6,))\nsnd = set((-math.pi, -4, -6, 0, 2*math.sqrt(3), 4.32, 10, (13/7), -math.sqrt(2), 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7 \\sqrt{2}, -\\frac{19}{2}, 10}$.\n", - "Output Answer": [ - "$\\frac{39}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 7*math.sqrt(2), -(19/2), 10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.3 x^2+2.8 x+3.4$ where $x \\sim $ \\text{NormalDistribution}[0.3,1.8]\n", - "Output Answer": [ - "$3.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.3, 1.8)\nprint(E(-0.3*x**2+2.8*x+3.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-10, 729, 36}$.\n", - "Output Answer": [ - "$18 \\sqrt[3]{-5} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, 729, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -1, -2, 4, \\frac{38}{7}, \\frac{11}{\\pi }} \\cup {4, 6, -1, \\frac{38}{7}, -6, \\frac{7}{\\pi }}$.\n", - "Output Answer": [ - "${-7, -6, -2, -1, \\frac{7}{\\pi }, \\frac{11}{\\pi }, 4, \\frac{38}{7}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -1, -2, 4, (38/7), (11/math.pi),))\nsnd = set((4, 6, -1, (38/7), -6, (7/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, 3, -\\frac{25}{e}, -2 \\pi, -3, -1}$.\n", - "Output Answer": [ - "${-\\frac{25}{e}, -2 \\pi, -3, -1, 3, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 3, -(25/math.e), -2*math.pi, -3, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -7, 1, 1, -3, -5, -7, -1, -3, -7, -7, -1, 2, -7, 2, -3, 2, -3, -5, -1, -3, 1, 2, 2, -1, -1, -5, 2, -5}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -7, 1, 1, -3, -5, -7, -1, -3, -7, -7, -1, 2, -7, 2, -3, 2, -3, -5, -1, -3, 1, 2, 2, -1, -1, -5, 2, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 4, 2, 18}$.\n", - "Output Answer": [ - "$\\frac{2448}{529}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 4, 2, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 0, -6, 5, -4, 2, 0, 2, 0, 2, 2, 2, 2, -2, 2, 2, 5, -6, 0, 2, 5, 2, 5, 5}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 0, -6, 5, -4, 2, 0, 2, 0, 2, 2, 2, 2, -2, 2, 2, 5, -6, 0, 2, 5, 2, 5, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6, 7 \\sqrt{2}, 7, -\\frac{16}{\\sqrt{3}}, 2, -\\frac{6}{e}, -8.69}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -8.69, -6, -\\frac{6}{e}, 2, 7, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 7*math.sqrt(2), 7, -(16/(math.sqrt(3))), 2, -(6/math.e), -8.69\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 16, -1, 256, 81}$.\n", - "Output Answer": [ - "$12 \\sqrt[5]{-3} 2^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 16, -1, 256, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4096, 4, 3125, 1, 256, -64}$.\n", - "Output Answer": [ - "$16 \\sqrt[6]{-1} 2^{2/3} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4096, 4, 3125, 1, 256, -64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{6}{\\sqrt{\\pi }}, -\\frac{17}{2}, 4, 6, 7, 0, 3}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, 0, 3, \\frac{6}{\\sqrt{\\pi }}, 4, 6, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = (6/(math.sqrt(math.pi))), -(17/2), 4, 6, 7, 0, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, \\frac{31}{4}, \\frac{23}{e}, -1, \\sqrt{5}, -\\log (2), 9, -10, 7, \\pi, -4 \\sqrt{2}, -\\frac{8}{\\sqrt{\\pi }}, 6, 4 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{6+\\pi }{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, (31/4), (23/math.e), -1, math.sqrt(5), -math.log(2), 9, -10, 7, math.pi, -4*math.sqrt(2), -(8/(math.sqrt(math.pi))), 6, 4*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{5}{\\sqrt{2}}, -7, -1}$.", - "Output Answer": [ - "$-\\frac{5}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(5/(math.sqrt(2))), -7, -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.295,0.372,0.167,0.107\\}$ and $\\{0.34,0.126,0.142,0.213\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.295, 0.372, 0.167, 0.107\ndistribution2 = 0.34, 0.126, 0.142, 0.213\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -1, 8, 9, 0, -1, 6, -5}$.\n", - "Output Answer": [ - "$\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -1, 8, 9, 0, -1, 6, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6 \\sqrt{2}, -\\frac{32}{5}, -4.849, -1, -9.07, 2, -\\frac{12}{e}, 4} \\cup {-\\frac{32}{5}, 2, -4.83, 0, -2.28, -6 \\sqrt{2}, -3, 8, -1, -\\frac{12}{e}}$.\n", - "Output Answer": [ - "${-9.07, -6 \\sqrt{2}, -\\frac{32}{5}, -4.849, -4.83, -\\frac{12}{e}, -3, -2.28, -1, 0, 2, 4, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.sqrt(2), -(32/5), -4.849, -1, -9.07, 2, -(12/math.e), 4,))\nsnd = set((-(32/5), 2, -4.83, 0, -2.28, -6*math.sqrt(2), -3, 8, -1, -(12/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.7 x^3+3.9 x^2-1.5 x-4.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$8.88$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(-1.7*x**3+3.9*x**2-1.5*x-4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 9, 4, 4, 4, 4, -6, -6, -6, 4, 4, 9, 4, -6, 9, -6, 4, 4, -6, 9, -6, 9, 9, 9, 4, 9, 4, 9}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 9, 4, 4, 4, 4, -6, -6, -6, 4, 4, 9, 4, -6, 9, -6, 4, 4, -6, 9, -6, 9, 9, 9, 4, 9, 4, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -\\frac{17}{\\sqrt{5}}, 5, -\\frac{13}{3}, \\frac{1}{\\sqrt{5}}, -\\frac{17}{\\sqrt{5}}, 2, 1, 0, -\\frac{11}{\\sqrt{3}}, 9, -2, -3 \\sqrt{5}, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -(17/(math.sqrt(5))), 5, -(13/3), (1/(math.sqrt(5))), -(17/(math.sqrt(5))), 2, 1, 0, -(11/(math.sqrt(3))), 9, -2, -3*math.sqrt(5), 4*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9.2, -7 \\sqrt{2}, 5, -7, 0, -0.6, -2}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -7, -2, -0.6, 0, 5, 9.2}$" - ], - "Output Program": [ - "import math\n\nvalues = 9.2, -7*math.sqrt(2), 5, -7, 0, -0.6, -2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -10, 8}$.\n", - "Output Answer": [ - "$\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -10, 8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, 7, -5, 3, -1} \\setminus {4, -8, -\\frac{13}{\\sqrt{\\pi }}, 10, -7}$.\n", - "Output Answer": [ - "${-5, -1, 3, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 7, -5, 3, -1,))\nsnd = set((4, -8, -(13/(math.sqrt(math.pi))), 10, -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x^3-1.1 x^2+4.6 x-2.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$-8.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(2.8*x**3-1.1*x**2+4.6*x-2.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, -14, 4, 1, -2, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{158}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -14, 4, 1, -2, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.6 x-1.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.]\n", - "Output Answer": [ - "$-1.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(E(-1.6*x-1.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, -\\sqrt{2}, 5, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{26}{e}, 6, 4 e, 7, 1, -\\frac{24}{7}}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, -math.sqrt(2), 5, -(3/(math.sqrt(math.pi))), -(26/math.e), 6, 4*math.e, 7, 1, -(24/7)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-5, 10, 6, -14}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{473}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 10, 6, -14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-13, 15}$.\n", - "Output Answer": [ - "$14 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{68}{7}, \\frac{4}{7}, -9, -\\frac{39}{7}, \\frac{55}{7}, \\frac{68}{7}}$.\n", - "Output Answer": [ - "$\\frac{31}{14}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (68/7), (4/7), -9, -(39/7), (55/7), (68/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x-4.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$-1.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(3.7*x-4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, 1, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$9+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 1, 6*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -5, 4, 1, 2 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}} \\cup {6, -3, -\\frac{7}{\\sqrt{2}}, -\\sqrt{5}, -5, 4, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5, -\\frac{7}{\\sqrt{2}}, -3, -\\sqrt{5}, 0, 1, 2 \\sqrt{2}, 4, 6, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -5, 4, 1, 2*math.sqrt(2), -(7/(math.sqrt(2))),))\nsnd = set((6, -3, -(7/(math.sqrt(2))), -math.sqrt(5), -5, 4, 6*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.052,0.262,0.055,0.368\\}$ and $\\{0.322,0.146,0.044,0.339\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.052, 0.262, 0.055, 0.368\ndistribution2 = 0.322, 0.146, 0.044, 0.339\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8 \\log (2), -5 \\log (2), \\log (2), 0, 6 \\log (2)}$.\n", - "Output Answer": [ - "$2 \\log (2)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 8*math.log(2), -5*math.log(2), math.log(2), 0, 6*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.432,0.293,0.188\\}$ and $\\{0.265,0.004,0.526\\}$.", - "Output Answer": [ - "$1.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.432, 0.293, 0.188\ndistribution2 = 0.265, 0.004, 0.526\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{11}{\\pi }, -7} \\setminus {-6, -\\frac{25}{3}, \\frac{27}{\\pi }, -1}$.\n", - "Output Answer": [ - "${-7, \\frac{11}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((11/math.pi), -7,))\nsnd = set((-6, -(25/3), (27/math.pi), -1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 7, -4, 7, 4, 8, 5 \\sqrt{2}, -\\frac{1}{5}, -\\frac{3}{\\sqrt{5}}, \\frac{15}{7}}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 7, -4, 7, 4, 8, 5*math.sqrt(2), -(1/5), -(3/(math.sqrt(5))), (15/7)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$7+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -6*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.034,0.114,0.069,0.023,0.112,0.049,0.077,0.361\\}$ and $\\{0.095,0.016,0.135,0.086,0.342,0.088,0.053,0.056\\}$.", - "Output Answer": [ - "$0.82$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.034, 0.114, 0.069, 0.023, 0.112, 0.049, 0.077, 0.361\ndistribution2 = 0.095, 0.016, 0.135, 0.086, 0.342, 0.088, 0.053, 0.056\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{5}, -e, -8, -2 \\pi, -6, 4, 1, 3, \\frac{9}{4}, e, 0, 6, -\\frac{31}{7}, \\frac{13}{\\sqrt{3}}, 2 e}$.", - "Output Answer": [ - "$\\frac{9}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(5), -math.e, -8, -2*math.pi, -6, 4, 1, 3, (9/4), math.e, 0, 6, -(31/7), (13/(math.sqrt(3))), 2*math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, 4 \\sqrt{3}, -5, 6}$.\n", - "Output Answer": [ - "${-5, 6, 6, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 4*math.sqrt(3), -5, 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 7, -2}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 7, -2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 e, \\frac{1}{\\sqrt{3}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{1}{\\sqrt{3}}-2 e\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.e, (1/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.16,0.144,0.226,0.087,0.149,0.081\\}$ and $\\{0.254,0.133,0.042,0.301,0.121,0.05\\}$.", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.16, 0.144, 0.226, 0.087, 0.149, 0.081\ndistribution2 = 0.254, 0.133, 0.042, 0.301, 0.121, 0.05\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${10, 6 \\sqrt{2}, -1, -2, -\\frac{18}{\\sqrt{5}}, \\frac{3}{\\sqrt{2}}, \\frac{5}{4}, 6, -5, -\\frac{21}{5}, -\\frac{11}{e}, 5 \\sqrt{3}, 8, 12 \\log (2), -9}$.", - "Output Answer": [ - "$\\frac{5}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 10, 6*math.sqrt(2), -1, -2, -(18/(math.sqrt(5))), (3/(math.sqrt(2))), (5/4), 6, -5, -(21/5), -(11/math.e), 5*math.sqrt(3), 8, 12*math.log(2), -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.4 x-4.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$-4.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(-2.4*x-4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x^3+4.2 x^2+4.1 x+9.9$ where $x \\sim $ \\text{BetaDistribution}[1.3,1.5]\n", - "Output Answer": [ - "$13.41$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 1.5)\nprint(E(2.2*x**3+4.2*x**2+4.1*x+9.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\sqrt{2}, 1, 8} \\setminus {-9, 8, 10}$.\n", - "Output Answer": [ - "${-\\sqrt{2}, 1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(2), 1, 8,))\nsnd = set((-9, 8, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${13 \\log (2), -5 \\log (2), -11 \\log (2), -6 \\log (2), -7 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{16 \\log (2)}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 13*math.log(2), -5*math.log(2), -11*math.log(2), -6*math.log(2), -7*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^3+2.5 x^2-3.7 x-4.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.3]\n", - "Output Answer": [ - "$7.73$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(E(4.4*x**3+2.5*x**2-3.7*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{5}{e}, 2, -\\frac{4}{\\sqrt{3}}} \\setminus {-\\frac{4}{\\sqrt{3}}, 6, 3, 8.73, -\\sqrt{5}, -\\frac{5}{e}}$.\n", - "Output Answer": [ - "${2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(5/math.e), 2, -(4/(math.sqrt(3))),))\nsnd = set((-(4/(math.sqrt(3))), 6, 3, 8.73, -math.sqrt(5), -(5/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -2 \\sqrt{3}, \\sqrt{5}, 2, -4 \\sqrt{2}, 4, 3 \\sqrt{3}, 7, \\frac{17}{3}, 9, -1, -6, -\\frac{10}{3}}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -2*math.sqrt(3), math.sqrt(5), 2, -4*math.sqrt(2), 4, 3*math.sqrt(3), 7, (17/3), 9, -1, -6, -(10/3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\frac{19}{3}, 6, -\\sqrt{5}, -4 \\log (2), -7} \\setminus {4, -7, 3 \\log (2), \\frac{4}{\\pi }, -\\frac{17}{3}, -\\frac{10}{3}}$.\n", - "Output Answer": [ - "${-4 \\log (2), -\\sqrt{5}, 0, 6, \\frac{19}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (19/3), 6, -math.sqrt(5), -4*math.log(2), -7,))\nsnd = set((4, -7, 3*math.log(2), (4/math.pi), -(17/3), -(10/3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 10, 12, 11}$.\n", - "Output Answer": [ - "$\\frac{1320}{107}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 10, 12, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, -3, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{259}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -3, 14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 9, 10}$.\n", - "Output Answer": [ - "$\\frac{540}{47}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 9, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8 \\log (2), -2 \\log (2), -4 \\log (2), -8 \\log (2), 2 \\log (2)}$.\n", - "Output Answer": [ - "$-4 \\log (2)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -8*math.log(2), -2*math.log(2), -4*math.log(2), -8*math.log(2), 2*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -7, 3, -9, 3, 3, 3, -9, 3, 0, 0, 3, -9, 3, 3, 3, 0, -9, 3, -9, 0, 3, 0, -9, -9, -7, 0, 0, -7, 0}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -7, 3, -9, 3, 3, 3, -9, 3, 0, 0, 3, -9, 3, 3, 3, 0, -9, 3, -9, 0, 3, 0, -9, -9, -7, 0, 0, -7, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, -8, -3 \\pi, \\frac{10}{e}, 6, 9, -3 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{10}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -8, -3*math.pi, (10/math.e), 6, 9, -3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, 1, -216, 8}$.\n", - "Output Answer": [ - "$2 \\sqrt[4]{-1} 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 1, -216, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{9}{e}, 2 \\sqrt{2}, 4, -6, -\\frac{24}{\\pi }} \\setminus {8, -\\frac{24}{\\pi }, -\\frac{27}{e}, 7, -7}$.\n", - "Output Answer": [ - "${-6, 2 \\sqrt{2}, \\frac{9}{e}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set(((9/math.e), 2*math.sqrt(2), 4, -6, -(24/math.pi),))\nsnd = set((8, -(24/math.pi), -(27/math.e), 7, -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, 5, 2, 2}$.\n", - "Output Answer": [ - "$\\frac{320}{101}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, 5, 2, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x^2+2.5 x-8.9$ where $x \\sim $ \\text{NormalDistribution}[0.5,1.9]\n", - "Output Answer": [ - "$6.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.5, 1.9)\nprint(E(3.7*x**2+2.5*x-8.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4, -6, 5, 3, -9} \\cap {3, 5, -8, 1}$.\n", - "Output Answer": [ - "${3, 5}$" - ], - "Output Program": [ - "fst = set((-4, -6, 5, 3, -9,))\nsnd = set((3, 5, -8, 1,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-0.665, -6, -2 \\pi, 3, 8, -3} \\setminus {-2, 1, -2 \\pi, -6, -1, -\\frac{14}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-3, -0.665, 3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.665, -6, -2*math.pi, 3, 8, -3,))\nsnd = set((-2, 1, -2*math.pi, -6, -1, -(14/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{5}, -2 \\sqrt{5}, 4 \\sqrt{5}, -2 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, 3 \\sqrt{5}, -2 \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, -2 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 3 \\sqrt{5}, -2 \\sqrt{5}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-2 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(5), -2*math.sqrt(5), 4*math.sqrt(5), -2*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), 3*math.sqrt(5), -2*math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), -2*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 3*math.sqrt(5), -2*math.sqrt(5), 3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.1,0.147,0.29,0.039,0.188,0.024,0.169,0.038\\}$ and $\\{0.122,0.051,0.055,0.246,0.119,0.051,0.157,0.099\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.1, 0.147, 0.29, 0.039, 0.188, 0.024, 0.169, 0.038\ndistribution2 = 0.122, 0.051, 0.055, 0.246, 0.119, 0.051, 0.157, 0.099\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.3 x^2-3.4 x+4.7$ where $x \\sim $ \\text{BetaDistribution}[0.3,0.7]\n", - "Output Answer": [ - "$3.74$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 0.7)\nprint(E(0.3*x**2-3.4*x+4.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\pi, 6, 5 \\sqrt{3}, 4, -6, -3 \\sqrt{5}, 9, -\\frac{9}{e}, -5, 6 \\sqrt{2}, -6, 6 \\sqrt{2}, \\frac{4}{\\sqrt{\\pi }}, 7, 6}$.", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.pi, 6, 5*math.sqrt(3), 4, -6, -3*math.sqrt(5), 9, -(9/math.e), -5, 6*math.sqrt(2), -6, 6*math.sqrt(2), (4/(math.sqrt(math.pi))), 7, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3 e, -\\sqrt{2}, -7, -10, -4 \\sqrt{5}, -6}$.", - "Output Answer": [ - "$\\frac{1}{2} (-7-3 e)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.e, -math.sqrt(2), -7, -10, -4*math.sqrt(5), -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\sqrt{5}, 9, -5} \\setminus {-\\frac{13}{\\sqrt{2}}, 9, 5, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), 9, -5,))\nsnd = set((-(13/(math.sqrt(2))), 9, 5, -4*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -1, 9, -1, 7, 5, -1, 7, -1, -1, 7, 7, 5, 5, 5, 7, 5, 7, -1, 9, 9, 9}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -1, 9, -1, 7, 5, -1, 7, -1, -1, 7, 7, 5, 5, 5, 7, 5, 7, -1, 9, 9, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, 0, -12, -13, -5, -13}$.\n", - "Output Answer": [ - "$\\frac{1372}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 0, -12, -13, -5, -13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x^2+1.5 x+3.$ where $x \\sim $ \\text{BetaDistribution}[0.2,0.7]\n", - "Output Answer": [ - "$2.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.2, 0.7)\nprint(E(-4.1*x**2+1.5*x+3.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.151,0.227,0.11,0.292\\}$ and $\\{0.228,0.336,0.109,0.053\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.151, 0.227, 0.11, 0.292\ndistribution2 = 0.228, 0.336, 0.109, 0.053\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\pi, -\\pi, -\\pi, 0, \\pi, 3 \\pi, -\\pi, 3 \\pi, -\\pi, 3 \\pi, 0, -\\pi, \\pi, 3 \\pi, 0, -\\pi, -\\pi, 3 \\pi, -\\pi, -\\pi, 3 \\pi, -\\pi, 2 \\pi, 3 \\pi, -\\pi, -\\pi, -\\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$\\{-\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.pi, -math.pi, -math.pi, 0, math.pi, 3*math.pi, -math.pi, 3*math.pi, -math.pi, 3*math.pi, 0, -math.pi, math.pi, 3*math.pi, 0, -math.pi, -math.pi, 3*math.pi, -math.pi, -math.pi, 3*math.pi, -math.pi, 2*math.pi, 3*math.pi, -math.pi, -math.pi, -math.pi, 2*math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{30}{\\pi }, -\\frac{25}{\\pi }, \\frac{6}{\\pi }, -\\frac{16}{\\pi }, \\frac{12}{\\pi }, -\\frac{31}{\\pi }, \\frac{17}{\\pi }, -\\frac{15}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{11}{4 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (30/math.pi), -(25/math.pi), (6/math.pi), -(16/math.pi), (12/math.pi), -(31/math.pi), (17/math.pi), -(15/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x-7.2$ where $x \\sim $ \\text{BetaDistribution}[1.1,0.3]\n", - "Output Answer": [ - "$-6.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.1, 0.3)\nprint(E(1.2*x-7.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.143,0.151,0.132,0.119,0.103,0.036,0.026,0.116,0.024,0.111\\}$ and $\\{0.087,0.038,0.155,0.071,0.135,0.036,0.139,0.012,0.063,0.182\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.143, 0.151, 0.132, 0.119, 0.103, 0.036, 0.026, 0.116, 0.024, 0.111\ndistribution2 = 0.087, 0.038, 0.155, 0.071, 0.135, 0.036, 0.139, 0.012, 0.063, 0.182\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x+2.$ where $x \\sim $ \\text{ExponentialDistribution}[1.3]\n", - "Output Answer": [ - "$3.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(E(2.2*x+2.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, -8, 10, -7, 10, 4, -7, 7, -8, 10, 10, 10, 4, 7, 2, 7, 4, 7, 7, 10, -8, -7, 7, -7, 7, 10, 10, 7, -8, -7}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, -8, 10, -7, 10, 4, -7, 7, -8, 10, 10, 10, 4, 7, 2, 7, 4, 7, 7, 10, -8, -7, 7, -7, 7, 10, 10, 7, -8, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-11 \\log (2), 10, -9, 2 e, -\\frac{15}{2}, 3 e, \\frac{1}{\\sqrt{3}}} \\setminus {\\frac{20}{3}, -4, -2, -3 e}$.\n", - "Output Answer": [ - "${-9, -11 \\log (2), -\\frac{15}{2}, \\frac{1}{\\sqrt{3}}, 2 e, 3 e, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-11*math.log(2), 10, -9, 2*math.e, -(15/2), 3*math.e, (1/(math.sqrt(3))),))\nsnd = set(((20/3), -4, -2, -3*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -8, 6, 4 e, -3 e, -5.1} \\cup {e, -7, 6, 3.8, -2 e, -8}$.\n", - "Output Answer": [ - "${-3 e, -8, -7, -2 e, -5.1, e, 3.8, 6, 4 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -8, 6, 4*math.e, -3*math.e, -5.1,))\nsnd = set((math.e, -7, 6, 3.8, -2*math.e, -8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, -6, -\\frac{2}{3}, -2, -10}$.\n", - "Output Answer": [ - "$-\\frac{32}{15}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, -6, -(2/3), -2, -10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, -4, 5, 1, 4, -2, -1}$.\n", - "Output Answer": [ - "$\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, -4, 5, 1, 4, -2, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{7 \\sqrt{2}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(1/(math.sqrt(2))), -(9/(math.sqrt(2))), -(9/(math.sqrt(2))), (9/(math.sqrt(2))), -2*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{17}{e}, -8, -10, 1, \\frac{4}{3}, 4, -6, 6, 8, -\\sqrt{2}, \\sqrt{2}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -(17/math.e), -8, -10, 1, (4/3), 4, -6, 6, 8, -math.sqrt(2), math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7.15, \\frac{9}{4}, -8, -3, 7, 1}$.\n", - "Output Answer": [ - "${-8, -7.15, -3, 1, \\frac{9}{4}, 7}$" - ], - "Output Program": [ - "values = -7.15, (9/4), -8, -3, 7, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -8, -1000, 3125, 1}$.\n", - "Output Answer": [ - "$10 \\sqrt[5]{2} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -8, -1000, 3125, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x+0.5$ where $x \\sim $ \\text{BetaDistribution}[0.9,0.6]\n", - "Output Answer": [ - "$2.78$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.9, 0.6)\nprint(E(3.8*x+0.5))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{5}, 5, 0, -\\frac{17}{3}, 7, -2, -5 \\sqrt{3}} \\setminus {2 \\sqrt{5}, 9.3, 3}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -\\frac{17}{3}, -2, 0, 5, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(5), 5, 0, -(17/3), 7, -2, -5*math.sqrt(3),))\nsnd = set((2*math.sqrt(5), 9.3, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4 \\sqrt{5}, -6.7, 0, 7, -2 \\pi, 6, 6.3, -1} \\cup {4 \\sqrt{5}, -1, 6.3, -3, 0, \\frac{3}{e}, -6.7}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -6.7, -2 \\pi, -3, -1, 0, \\frac{3}{e}, 6, 6.3, 7, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), -6.7, 0, 7, -2*math.pi, 6, 6.3, -1,))\nsnd = set((4*math.sqrt(5), -1, 6.3, -3, 0, (3/math.e), -6.7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, -\\frac{13}{2}, 6, -1, -5.597} \\setminus {-7 \\sqrt{2}, 6, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{13}{2}, -5.597, -1, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -(13/2), 6, -1, -5.597,))\nsnd = set((-7*math.sqrt(2), 6, 4*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${27, 1, 36}$.\n", - "Output Answer": [ - "$3\\ 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 27, 1, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, -6 \\sqrt{2}, -2, 3 \\sqrt{2}, \\frac{4}{\\sqrt{3}}, -7} \\cup {7, 4, 3 \\sqrt{2}, -2 \\sqrt{2}, -4, \\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -7, -4, -2 \\sqrt{2}, -2, \\frac{4}{\\sqrt{3}}, 4, 3 \\sqrt{2}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -6*math.sqrt(2), -2, 3*math.sqrt(2), (4/(math.sqrt(3))), -7,))\nsnd = set((7, 4, 3*math.sqrt(2), -2*math.sqrt(2), -4, (4/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{26}{e}, -1, -7, -5, 10, -\\sqrt{5}} \\setminus {-\\sqrt{5}, -1, -4, 10, -\\frac{16}{e}, -3, -5, 1.608}$.\n", - "Output Answer": [ - "${-7, \\frac{26}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((26/math.e), -1, -7, -5, 10, -math.sqrt(5),))\nsnd = set((-math.sqrt(5), -1, -4, 10, -(16/math.e), -3, -5, 1.608,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, -\\frac{19}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{19}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{16}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{19}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\sqrt{5}, -\\sqrt{5}, \\frac{7}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(16/(math.sqrt(5))), (7/(math.sqrt(5))), -(19/(math.sqrt(5))), (7/(math.sqrt(5))), -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), -math.sqrt(5), -math.sqrt(5), -math.sqrt(5), -math.sqrt(5), -(19/(math.sqrt(5))), -math.sqrt(5), -(19/(math.sqrt(5))), -(16/(math.sqrt(5))), (7/(math.sqrt(5))), -math.sqrt(5), -(16/(math.sqrt(5))), -(19/(math.sqrt(5))), (7/(math.sqrt(5))), -math.sqrt(5), -(19/(math.sqrt(5))), -(19/(math.sqrt(5))), -math.sqrt(5), -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), -math.sqrt(5), -math.sqrt(5), (7/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{1}{e}, -\\frac{26}{e}, \\frac{1}{e}, \\frac{27}{e}, \\frac{20}{e}, \\frac{5}{e}, \\frac{18}{e}, \\frac{9}{e}} \\cap {\\frac{1}{e}, -\\frac{21}{e}, \\frac{18}{e}, -\\frac{13}{e}, \\frac{25}{e}, \\frac{12}{e}, -\\frac{2}{e}, \\frac{14}{e}, \\frac{26}{e}}$.\n", - "Output Answer": [ - "${\\frac{1}{e}, \\frac{18}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(1/math.e), -(26/math.e), (1/math.e), (27/math.e), (20/math.e), (5/math.e), (18/math.e), (9/math.e),))\nsnd = set(((1/math.e), -(21/math.e), (18/math.e), -(13/math.e), (25/math.e), (12/math.e), -(2/math.e), (14/math.e), (26/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 9, 0, -7, -6, 1, 0, 5, 0, -7, -7, 9, -7, 0, 9, 1, 0, 1, -6, -7, -7, -6, 0, 1, 9, 1, 1, -7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 9, 0, -7, -6, 1, 0, 5, 0, -7, -7, 9, -7, 0, 9, 1, 0, 1, -6, -7, -7, -6, 0, 1, 9, 1, 1, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{2}, -2 \\sqrt{2}, \\frac{6}{e}, 0}$.\n", - "Output Answer": [ - "$\\frac{13}{2}+2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/2), -2*math.sqrt(2), (6/math.e), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${3, 100, 8}$.\n", - "Output Answer": [ - "$2 \\sqrt[3]{3} 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 100, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, 5, 2}$.\n", - "Output Answer": [ - "$8 \\sqrt[3]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, 5, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x-3.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$-3.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(2.*x-3.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{8}{e}, -2, 2 \\log (2), e, -9, -8.46} \\cup {-\\frac{2}{e}, 9, -9, 2 \\log (2), e, -2}$.\n", - "Output Answer": [ - "${-9, -8.46, -2, -\\frac{2}{e}, 2 \\log (2), e, \\frac{8}{e}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set(((8/math.e), -2, 2*math.log(2), math.e, -9, -8.46,))\nsnd = set((-(2/math.e), 9, -9, 2*math.log(2), math.e, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{23}{e}, -5 \\sqrt{2}, \\frac{6}{\\pi }, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{23}{e}, -5 \\sqrt{2}, \\frac{6}{\\pi }, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(23/math.e), -5*math.sqrt(2), (6/math.pi), 2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.9 x^2-4.8 x+0.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$8.54$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(4.9*x**2-4.8*x+0.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, -6, -11, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{454}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -6, -11, 12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -4, 6, -1, 6}$.\n", - "Output Answer": [ - "$\\frac{7}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -4, 6, -1, 6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, \\frac{33}{5}, \\frac{7}{5}, 1, 2 \\sqrt{5}, -\\pi, -2 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, -2 \\pi, \\sqrt{5}, \\frac{39}{7}, 8, -\\frac{1}{3}, -4}$.", - "Output Answer": [ - "$\\frac{6}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, (33/5), (7/5), 1, 2*math.sqrt(5), -math.pi, -2*math.sqrt(5), (14/(math.sqrt(5))), -2*math.pi, math.sqrt(5), (39/7), 8, -(1/3), -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.1 x+6.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$9.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(4.1*x+6.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-13, 4, -5, -14, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{653}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 4, -5, -14, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -7, 3}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -7, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -6, 3, -10, 2 \\pi, -\\frac{6}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$-\\frac{3}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -6, 3, -10, 2*math.pi, -(6/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 1000, 4, 2}$.\n", - "Output Answer": [ - "$20 \\sqrt{2} 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 1000, 4, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${1, 2, 7, -4, -2, -8} \\cap {-1, -3, -2, 2, 9, -4, -7, -6}$.\n", - "Output Answer": [ - "${-4, -2, 2}$" - ], - "Output Program": [ - "fst = set((1, 2, 7, -4, -2, -8,))\nsnd = set((-1, -3, -2, 2, 9, -4, -7, -6,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, 3 e, 4, -2, -\\frac{2}{\\sqrt{3}}, -\\sqrt{2}, -\\frac{6}{\\sqrt{\\pi }}, -3, \\frac{3}{\\sqrt{\\pi }}, \\frac{13}{e}, -\\pi, 3, \\frac{12}{\\sqrt{5}}, \\frac{7}{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{3}{\\sqrt{\\pi }}-\\frac{2}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, 3*math.e, 4, -2, -(2/(math.sqrt(3))), -math.sqrt(2), -(6/(math.sqrt(math.pi))), -3, (3/(math.sqrt(math.pi))), (13/math.e), -math.pi, 3, (12/(math.sqrt(5))), (7/3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -\\frac{17}{2}, 3, 2 e, -9, \\frac{22}{\\sqrt{5}}, -\\frac{14}{\\sqrt{\\pi }}, 6, \\frac{13}{\\sqrt{3}}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{1}{2}, \\frac{8}{3}}$.", - "Output Answer": [ - "$\\frac{8}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -(17/2), 3, 2*math.e, -9, (22/(math.sqrt(5))), -(14/(math.sqrt(math.pi))), 6, (13/(math.sqrt(3))), -(4/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (1/2), (8/3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, -6, 3 e, 10 \\log (2), 0}$.\n", - "Output Answer": [ - "${-6, 0, 5, 10 \\log (2), 3 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -6, 3*math.e, 10*math.log(2), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 8, 17, 5}$.\n", - "Output Answer": [ - "$\\frac{24480}{3029}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 8, 17, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, \\frac{12}{\\sqrt{\\pi }}, -2 e}$.\n", - "Output Answer": [ - "$2 e+\\frac{12}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, (12/(math.sqrt(math.pi))), -2*math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, \\frac{4}{3}, \\frac{56}{3}, 11}$.\n", - "Output Answer": [ - "$\\frac{2464}{639}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, (4/3), (56/3), 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{1}{3}, \\frac{16}{3}, -\\frac{2}{3}, -3, \\frac{1}{3}, -\\frac{26}{3}, -\\frac{23}{3}, \\frac{19}{3}}$.\n", - "Output Answer": [ - "$-\\frac{23}{24}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (1/3), (16/3), -(2/3), -3, (1/3), -(26/3), -(23/3), (19/3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, 15, 1}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{43}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, 15, 1\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{4}{5}, \\frac{7}{\\sqrt{2}}, 7, 6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(6+\\frac{7}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(4/5), (7/(math.sqrt(2))), 7, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{11}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -\\frac{5}{\\sqrt{3}}, 0, -6, \\sqrt{5}, -\\frac{13}{e}, \\frac{14}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, 0, -4, -3 \\sqrt{3}, -\\frac{7}{\\sqrt{3}}, \\frac{7}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{11}{\\sqrt{2}}+\\frac{14}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/(math.sqrt(2))), -(3/(math.sqrt(2))), -(5/(math.sqrt(3))), 0, -6, math.sqrt(5), -(13/math.e), (14/(math.sqrt(5))), (12/(math.sqrt(5))), (2/(math.sqrt(5))), 0, -4, -3*math.sqrt(3), -(7/(math.sqrt(3))), (7/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -3 e, \\frac{15}{\\pi }, -2, 9, -10, -5, -\\frac{6}{5}, 8, -6, 5, -7, -2, 9, 4}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -3*math.e, (15/math.pi), -2, 9, -10, -5, -(6/5), 8, -6, 5, -7, -2, 9, 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2.26, -2 \\sqrt{3}, 5, 2, -5 \\sqrt{2}, -9, -\\frac{14}{\\sqrt{3}}, -4} \\cup {-4 \\sqrt{3}, -5 \\sqrt{2}, 7, -1, -5, -9, 2, 3}$.\n", - "Output Answer": [ - "${-9, -\\frac{14}{\\sqrt{3}}, -5 \\sqrt{2}, -4 \\sqrt{3}, -5, -4, -2 \\sqrt{3}, -1, 2, 2.26, 3, 5, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((2.26, -2*math.sqrt(3), 5, 2, -5*math.sqrt(2), -9, -(14/(math.sqrt(3))), -4,))\nsnd = set((-4*math.sqrt(3), -5*math.sqrt(2), 7, -1, -5, -9, 2, 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{19}{5}, \\pi, 7, -\\frac{13}{\\sqrt{\\pi }}, 4, \\frac{22}{\\sqrt{5}}, 6 \\log (2), -3, \\frac{3}{\\sqrt{5}}, \\frac{26}{\\pi }, -\\frac{7}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{19}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (19/5), math.pi, 7, -(13/(math.sqrt(math.pi))), 4, (22/(math.sqrt(5))), 6*math.log(2), -3, (3/(math.sqrt(5))), (26/math.pi), -(7/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 9, -512, -9}$.\n", - "Output Answer": [ - "$36 \\sqrt[4]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 9, -512, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{4}{\\sqrt{\\pi }}, -6, \\frac{25}{7}, \\frac{14}{5}, e, 7, -\\frac{9}{2}, 5, -5, \\frac{13}{\\sqrt{\\pi }}, -\\frac{24}{5}}$.\n", - "Output Answer": [ - "$6+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(4/(math.sqrt(math.pi))), -6, (25/7), (14/5), math.e, 7, -(9/2), 5, -5, (13/(math.sqrt(math.pi))), -(24/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 5 \\sqrt{3}, -7, -5, \\frac{11}{2}, -4, -\\frac{4}{\\sqrt{3}}, -5, 13 \\log (2)}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 5*math.sqrt(3), -7, -5, (11/2), -4, -(4/(math.sqrt(3))), -5, 13*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, \\pi, \\pi}$.\n", - "Output Answer": [ - "$\\frac{2 \\pi }{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, math.pi, math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{7}{3}, \\frac{46}{3}}$.\n", - "Output Answer": [ - "$\\frac{644}{159}$" - ], - "Output Program": [ - "import statistics\nvalues = (7/3), (46/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, -e, 2, -\\frac{17}{\\pi }, -\\frac{9}{\\sqrt{2}}, -10, -2 e} \\cup {-5, -10, 7, -\\frac{9}{\\sqrt{2}}, -2 e, -\\frac{17}{\\pi }}$.\n", - "Output Answer": [ - "${-10, -\\frac{9}{\\sqrt{2}}, -2 e, -\\frac{17}{\\pi }, -5, -e, 2, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -math.e, 2, -(17/math.pi), -(9/(math.sqrt(2))), -10, -2*math.e,))\nsnd = set((-5, -10, 7, -(9/(math.sqrt(2))), -2*math.e, -(17/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.8 x+3.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5]\n", - "Output Answer": [ - "$3.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(E(0.8*x+3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, -\\frac{12}{e}, -\\frac{9}{e}, -1.9, -2 \\pi}$.\n", - "Output Answer": [ - "${-2 \\pi, -\\frac{12}{e}, -\\frac{9}{e}, -1.9, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -(12/math.e), -(9/math.e), -1.9, -2*math.pi\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, -6, \\frac{29}{\\pi }, 3 \\sqrt{5}, -\\frac{19}{5}, \\frac{11}{\\sqrt{5}}, 8, -7 \\log (2), -7, \\frac{14}{e}, \\frac{13}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, 1, 2, -\\frac{22}{\\pi }}$.", - "Output Answer": [ - "$\\frac{11}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -6, (29/math.pi), 3*math.sqrt(5), -(19/5), (11/(math.sqrt(5))), 8, -7*math.log(2), -7, (14/math.e), (13/(math.sqrt(3))), (11/(math.sqrt(3))), 1, 2, -(22/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{3}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (3/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -7, 2 \\pi} \\setminus {-8, -4, 2 \\pi, 0, 4, -2 e, -5}$.\n", - "Output Answer": [ - "${-7}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -7, 2*math.pi,))\nsnd = set((-8, -4, 2*math.pi, 0, 4, -2*math.e, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{37}{4}, 2, 10, 5, \\frac{28}{5}}$.\n", - "Output Answer": [ - "${-\\frac{37}{4}, 2, 5, \\frac{28}{5}, 10}$" - ], - "Output Program": [ - "values = -(37/4), 2, 10, 5, (28/5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{15}{2}, -4, 8, 2, -3, -1, \\frac{17}{\\sqrt{\\pi }}, 2 e}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(15/2), -4, 8, 2, -3, -1, (17/(math.sqrt(math.pi))), 2*math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, 10, 20, \\frac{21}{2}}$.\n", - "Output Answer": [ - "$\\frac{6720}{517}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, 10, 20, (21/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, -14, -4, -7, -2}$.\n", - "Output Answer": [ - "$\\frac{57}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, -14, -4, -7, -2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 14, 7, 13}$.\n", - "Output Answer": [ - "$\\frac{91}{18}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 14, 7, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -8, -1, -8, -8, 10, -3, 10, -3, -8, 0, 10, 10, -3, -8, 10, -3, 10, -3, -8, 10, 10}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -8, -1, -8, -8, 10, -3, 10, -3, -8, 0, 10, 10, -3, -8, 10, -3, 10, -3, -8, 10, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{31}{7}, -\\frac{13}{7}, -\\frac{25}{7}, -\\frac{25}{7}, -\\frac{38}{7}, -\\frac{25}{7}, -\\frac{13}{7}, -\\frac{25}{7}, -\\frac{38}{7}, -\\frac{31}{7}, -\\frac{25}{7}, \\frac{2}{7}, -\\frac{25}{7}, \\frac{2}{7}, \\frac{2}{7}, -\\frac{38}{7}, -\\frac{13}{7}, -\\frac{13}{7}, -\\frac{13}{7}, -\\frac{31}{7}, -\\frac{31}{7}, -\\frac{38}{7}, -\\frac{13}{7}, -\\frac{25}{7}, -\\frac{31}{7}, \\frac{2}{7}, -\\frac{13}{7}, -\\frac{38}{7}, \\frac{2}{7}, -\\frac{31}{7}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{7},-\\frac{25}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(31/7), -(13/7), -(25/7), -(25/7), -(38/7), -(25/7), -(13/7), -(25/7), -(38/7), -(31/7), -(25/7), (2/7), -(25/7), (2/7), (2/7), -(38/7), -(13/7), -(13/7), -(13/7), -(31/7), -(31/7), -(38/7), -(13/7), -(25/7), -(31/7), (2/7), -(13/7), -(38/7), (2/7), -(31/7)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -1, -8, -5, -3 \\sqrt{5}}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -1, -8, -5, -3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{5}, 9}$.\n", - "Output Answer": [ - "$9-4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(5), 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{17}{2}, \\frac{13}{2}, -6, 2, -\\frac{13}{2}, \\frac{11}{2}}$.\n", - "Output Answer": [ - "$\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (17/2), (13/2), -6, 2, -(13/2), (11/2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, \\frac{16}{3}}$.\n", - "Output Answer": [ - "$\\frac{32}{11}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, (16/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\pi, 5, -1}$.\n", - "Output Answer": [ - "${-1, \\pi, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = math.pi, 5, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{33}{4}, 4 \\sqrt{2}, 5 \\sqrt{2}, 1, 0, 5, -3, -\\frac{16}{e}, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(33/4), 4*math.sqrt(2), 5*math.sqrt(2), 1, 0, 5, -3, -(16/math.e), 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -2, -4, \\frac{11}{\\pi }, -6, -\\frac{15}{2}, -3, -\\frac{27}{5}, -4, -\\frac{15}{2}, -1, -3}$.", - "Output Answer": [ - "$-\\frac{7}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -2, -4, (11/math.pi), -6, -(15/2), -3, -(27/5), -4, -(15/2), -1, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10 \\log (2), -3 \\sqrt{5}, -6} \\setminus {6, 3, -\\frac{9}{2}, -6, 1}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((10*math.log(2), -3*math.sqrt(5), -6,))\nsnd = set((6, 3, -(9/2), -6, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 6, 17}$.\n", - "Output Answer": [ - "$\\frac{765}{83}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 6, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.414,0.272,0.059,0.246\\}$ and $\\{0.411,0.162,0.156,0.175\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.414, 0.272, 0.059, 0.246\ndistribution2 = 0.411, 0.162, 0.156, 0.175\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, 9, -5, 3 \\sqrt{5}, 7, -2} \\setminus {3 \\sqrt{5}, 2, -10, -2, \\frac{5}{\\pi }, 7, -5}$.\n", - "Output Answer": [ - "${8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 9, -5, 3*math.sqrt(5), 7, -2,))\nsnd = set((3*math.sqrt(5), 2, -10, -2, (5/math.pi), 7, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, 9, \\frac{19}{3}, -1, -11 \\log (2), -3, -4} \\setminus {-4, -3, \\frac{17}{\\pi }, -9, -5}$.\n", - "Output Answer": [ - "${-11 \\log (2), -1, 2, \\frac{19}{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 9, (19/3), -1, -11*math.log(2), -3, -4,))\nsnd = set((-4, -3, (17/math.pi), -9, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, \\frac{11}{\\sqrt{\\pi }}, -1, 2.3, 4 \\sqrt{3}, \\frac{1}{\\sqrt{\\pi }}, 5} \\setminus {2 \\sqrt{5}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{3}}, 5, -1, \\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-6, 2.3, \\frac{11}{\\sqrt{\\pi }}, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, (11/(math.sqrt(math.pi))), -1, 2.3, 4*math.sqrt(3), (1/(math.sqrt(math.pi))), 5,))\nsnd = set((2*math.sqrt(5), -(5/(math.sqrt(math.pi))), -(7/(math.sqrt(3))), 5, -1, (1/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\sqrt{5}, \\frac{16}{\\sqrt{5}}, 2 \\sqrt{5}, -\\frac{16}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{7}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{7}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{7}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.sqrt(5), (16/(math.sqrt(5))), 2*math.sqrt(5), -(16/(math.sqrt(5))), 2*math.sqrt(5), (7/(math.sqrt(5))), (16/(math.sqrt(5))), (7/(math.sqrt(5))), -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), (7/(math.sqrt(5))), (7/(math.sqrt(5))), 2*math.sqrt(5), (7/(math.sqrt(5))), (16/(math.sqrt(5))), (7/(math.sqrt(5))), (16/(math.sqrt(5))), 2*math.sqrt(5), (7/(math.sqrt(5))), (7/(math.sqrt(5))), (7/(math.sqrt(5))), -(16/(math.sqrt(5))), (16/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 7, -\\frac{16}{\\pi }, 1, \\frac{19}{5}, 4, \\frac{10}{\\sqrt{3}}, 2 \\pi, -2, -2, -4 \\sqrt{3}, 9, -\\frac{14}{\\sqrt{3}}, -4, -\\frac{15}{e}}$.\n", - "Output Answer": [ - "$9+\\frac{14}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 7, -(16/math.pi), 1, (19/5), 4, (10/(math.sqrt(3))), 2*math.pi, -2, -2, -4*math.sqrt(3), 9, -(14/(math.sqrt(3))), -4, -(15/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 1, 81}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{21}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 1, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x^2+1.1 x+4.$ where $x \\sim $ \\text{NormalDistribution}[-0.3,1.1]\n", - "Output Answer": [ - "$6.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.3, 1.1)\nprint(E(2.4*x**2+1.1*x+4.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -3, -1, 5, -3, -14}$.\n", - "Output Answer": [ - "$\\frac{1469}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -3, -1, 5, -3, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.041,0.113,0.168,0.037,0.016,0.019,0.113,0.06,0.397\\}$ and $\\{0.097,0.064,0.052,0.033,0.289,0.069,0.049,0.069,0.118\\}$.", - "Output Answer": [ - "$0.62$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.041, 0.113, 0.168, 0.037, 0.016, 0.019, 0.113, 0.06, 0.397\ndistribution2 = 0.097, 0.064, 0.052, 0.033, 0.289, 0.069, 0.049, 0.069, 0.118\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 12, 10, 0, -9}$.\n", - "Output Answer": [ - "$86$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 12, 10, 0, -9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -\\sqrt{2}, -1, 0, -9, -9, 10, 14 \\log (2), -\\frac{7}{5}, 1, -9, -7 \\sqrt{2}, -7}$.\n", - "Output Answer": [ - "$10+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -math.sqrt(2), -1, 0, -9, -9, 10, 14*math.log(2), -(7/5), 1, -9, -7*math.sqrt(2), -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, 5, 2, -\\frac{13}{5}, -4, -3, -\\frac{26}{7}, \\frac{16}{\\sqrt{3}}} \\setminus {4, -6, \\frac{16}{\\sqrt{3}}, 8}$.\n", - "Output Answer": [ - "${-4, -\\frac{26}{7}, -3, -\\frac{13}{5}, 2, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 5, 2, -(13/5), -4, -3, -(26/7), (16/(math.sqrt(3))),))\nsnd = set((4, -6, (16/(math.sqrt(3))), 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{4}{5}, -2 e, 5, -6, \\frac{7}{2}, -5, 10} \\cup {-\\frac{27}{5}, -2 e, \\frac{7}{2}, -6 \\sqrt{2}, -7, 5, -6}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -7, -6, -2 e, -\\frac{27}{5}, -5, -\\frac{4}{5}, \\frac{7}{2}, 5, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/5), -2*math.e, 5, -6, (7/2), -5, 10,))\nsnd = set((-(27/5), -2*math.e, (7/2), -6*math.sqrt(2), -7, 5, -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, -6, -12}$.\n", - "Output Answer": [ - "$21$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -6, -12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, -\\frac{16}{7}, -8, 2 \\sqrt{2}, 3, 6 \\sqrt{2}, 8, -3, -\\frac{36}{5}, -3, -\\frac{8}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$-\\frac{16}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, -(16/7), -8, 2*math.sqrt(2), 3, 6*math.sqrt(2), 8, -3, -(36/5), -3, -(8/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\pi, 5 \\sqrt{3}, \\sqrt{3}, 1, -\\frac{26}{5}, 0, 4 \\sqrt{5}, -3} \\setminus {-3, -7, -\\frac{12}{5}, 0, 5 \\sqrt{3}, -\\pi}$.\n", - "Output Answer": [ - "${-2 \\pi, -\\frac{26}{5}, 1, \\sqrt{3}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, 5*math.sqrt(3), math.sqrt(3), 1, -(26/5), 0, 4*math.sqrt(5), -3,))\nsnd = set((-3, -7, -(12/5), 0, 5*math.sqrt(3), -math.pi,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7 \\sqrt{2}, 4, -2, 8, \\frac{9}{2}, -4 \\sqrt{5}} \\cup {7 \\sqrt{2}, 4, -2, \\frac{9}{2}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -2, 4, \\frac{9}{2}, 8, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7*math.sqrt(2), 4, -2, 8, (9/2), -4*math.sqrt(5),))\nsnd = set((7*math.sqrt(2), 4, -2, (9/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -2, -9, -\\frac{17}{\\sqrt{5}}, 0, -5}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -2, -9, -(17/(math.sqrt(5))), 0, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{13}{2}, 2, \\frac{29}{2}, \\frac{29}{2}}$.\n", - "Output Answer": [ - "$\\frac{3016}{597}$" - ], - "Output Program": [ - "import statistics\nvalues = (13/2), 2, (29/2), (29/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, 3125, 243, 64, 9}$.\n", - "Output Answer": [ - "$30\\ 6^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 3125, 243, 64, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{2}{\\pi }, -\\frac{4}{\\pi }, -\\frac{17}{\\pi }, \\frac{2}{\\pi }, \\frac{2}{\\pi }, \\frac{26}{\\pi }, \\frac{2}{\\pi }, -\\frac{20}{\\pi }, -\\frac{30}{\\pi }, -\\frac{20}{\\pi }, -\\frac{4}{\\pi }, -\\frac{4}{\\pi }, \\frac{26}{\\pi }, -\\frac{17}{\\pi }, \\frac{2}{\\pi }, \\frac{26}{\\pi }, \\frac{2}{\\pi }, -\\frac{4}{\\pi }, -\\frac{3}{\\pi }, -\\frac{30}{\\pi }, -\\frac{30}{\\pi }, \\frac{26}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{2}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (2/math.pi), -(4/math.pi), -(17/math.pi), (2/math.pi), (2/math.pi), (26/math.pi), (2/math.pi), -(20/math.pi), -(30/math.pi), -(20/math.pi), -(4/math.pi), -(4/math.pi), (26/math.pi), -(17/math.pi), (2/math.pi), (26/math.pi), (2/math.pi), -(4/math.pi), -(3/math.pi), -(30/math.pi), -(30/math.pi), (26/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, 4, 3}$.\n", - "Output Answer": [ - "$2^{2/3} \\sqrt[3]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 4, 3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.1 x-0.6$ where $x \\sim $ \\text{BetaDistribution}[1.7,0.3]\n", - "Output Answer": [ - "$-2.39$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 0.3)\nprint(E(-2.1*x-0.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.41,0.169,0.044,0.024,0.107,0.19\\}$ and $\\{0.096,0.393,0.135,0.052,0.178,0.092\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.41, 0.169, 0.044, 0.024, 0.107, 0.19\ndistribution2 = 0.096, 0.393, 0.135, 0.052, 0.178, 0.092\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, 5, 0, \\frac{13}{\\sqrt{5}}, -7 \\sqrt{2}, \\frac{6}{e}, -3 \\sqrt{3}, 10}$.\n", - "Output Answer": [ - "$10+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 5, 0, (13/(math.sqrt(5))), -7*math.sqrt(2), (6/math.e), -3*math.sqrt(3), 10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.4 x-4.8$ where $x \\sim $ \\text{BetaDistribution}[1.1,0.6]\n", - "Output Answer": [ - "$-5.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.1, 0.6)\nprint(E(-0.4*x-4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 2, -7, 2, 6, 6, 1, 0, -5, 6, -5, 6, 6, -7, 2, -8, -8, 2, 6, -8, 1}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 2, -7, 2, 6, 6, 1, 0, -5, 6, -5, 6, 6, -7, 2, -8, -8, 2, 6, -8, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{3}, \\frac{17}{3}, \\frac{50}{3}}$.\n", - "Output Answer": [ - "$\\frac{19550}{2391}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/3), (17/3), (50/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -2, 9 \\log (2)}$.\n", - "Output Answer": [ - "$2+9 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -2, 9*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -6, 8, 531441, 531441, -1}$.\n", - "Output Answer": [ - "$81 \\sqrt[6]{-3} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -6, 8, 531441, 531441, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 81, -5, 625}$.\n", - "Output Answer": [ - "$15 \\sqrt[4]{-5} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 81, -5, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, \\frac{13}{\\sqrt{2}}, -4, -\\frac{6}{\\sqrt{\\pi }}, 4} \\setminus {-\\frac{6}{\\sqrt{\\pi }}, -4, 3 \\sqrt{2}, 0}$.\n", - "Output Answer": [ - "${-1, 4, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, (13/(math.sqrt(2))), -4, -(6/(math.sqrt(math.pi))), 4,))\nsnd = set((-(6/(math.sqrt(math.pi))), -4, 3*math.sqrt(2), 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\sqrt{3}, 0, -\\frac{7}{4}, -1, -\\frac{22}{e}, -\\pi, \\frac{5}{3}, -\\frac{11}{\\sqrt{2}}, 4} \\setminus {-1, 4, -\\frac{11}{\\sqrt{2}}, \\frac{11}{3}, -4, -\\frac{22}{e}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{3}, -\\pi, -\\frac{7}{4}, 0, \\frac{5}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(3), 0, -(7/4), -1, -(22/math.e), -math.pi, (5/3), -(11/(math.sqrt(2))), 4,))\nsnd = set((-1, 4, -(11/(math.sqrt(2))), (11/3), -4, -(22/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.2 x^2+4.5 x-4.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$-3.16$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(-2.2*x**2+4.5*x-4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.037,0.186,0.075,0.156,0.041,0.073,0.065,0.261,0.038\\}$ and $\\{0.075,0.074,0.025,0.084,0.076,0.131,0.092,0.06,0.106\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.037, 0.186, 0.075, 0.156, 0.041, 0.073, 0.065, 0.261, 0.038\ndistribution2 = 0.075, 0.074, 0.025, 0.084, 0.076, 0.131, 0.092, 0.06, 0.106\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 7, -2, -4 \\sqrt{5}} \\cup {-2, -4 \\sqrt{5}, 1, -1, -8}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -8, -2, -1, 1, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 7, -2, -4*math.sqrt(5),))\nsnd = set((-2, -4*math.sqrt(5), 1, -1, -8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, -5, 0, -7, -3 e}$.\n", - "Output Answer": [ - "$3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -5, 0, -7, -3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.149,0.075,0.09,0.061,0.16,0.256\\}$ and $\\{0.373,0.067,0.143,0.193,0.144,0.066\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.149, 0.075, 0.09, 0.061, 0.16, 0.256\ndistribution2 = 0.373, 0.067, 0.143, 0.193, 0.144, 0.066\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{2}, -2 \\sqrt{5}, \\frac{2}{e}, 3 e, -7, -2, 9, 0, -4} \\cup {-7, -4, -2, \\frac{2}{e}, 2 \\sqrt{2}, -2 \\pi, 0, 3 \\sqrt{5}, 9}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, -2 \\sqrt{5}, -4, -2, 0, \\frac{2}{e}, \\sqrt{2}, 2 \\sqrt{2}, 3 \\sqrt{5}, 3 e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(2), -2*math.sqrt(5), (2/math.e), 3*math.e, -7, -2, 9, 0, -4,))\nsnd = set((-7, -4, -2, (2/math.e), 2*math.sqrt(2), -2*math.pi, 0, 3*math.sqrt(5), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 64, 100, 16}$.\n", - "Output Answer": [ - "$8 \\sqrt{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 64, 100, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.212,0.068,0.064,0.031,0.112,0.049,0.193,0.175\\}$ and $\\{0.232,0.262,0.027,0.028,0.068,0.127,0.031,0.074\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.212, 0.068, 0.064, 0.031, 0.112, 0.049, 0.193, 0.175\ndistribution2 = 0.232, 0.262, 0.027, 0.028, 0.068, 0.127, 0.031, 0.074\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x+1.3$ where $x \\sim $ \\text{ExponentialDistribution}[0.6]\n", - "Output Answer": [ - "$5.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.6)\nprint(E(2.6*x+1.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{31}{\\pi }, 5, 3, 4, -12 \\log (2), 8}$.\n", - "Output Answer": [ - "${-12 \\log (2), 3, 4, 5, 8, \\frac{31}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (31/math.pi), 5, 3, 4, -12*math.log(2), 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -\\frac{11}{2}, -9, -\\frac{11}{2}, 6, 6, -9, -9, -9, -\\frac{3}{2}, -9, 6, -\\frac{3}{2}, 6, -9, 6, -\\frac{11}{2}, -9, 6, -\\frac{11}{2}, -9, -\\frac{3}{2}, -\\frac{3}{2}, -9, 6, 6, -\\frac{3}{2}, -9}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -(11/2), -9, -(11/2), 6, 6, -9, -9, -9, -(3/2), -9, 6, -(3/2), 6, -9, 6, -(11/2), -9, 6, -(11/2), -9, -(3/2), -(3/2), -9, 6, 6, -(3/2), -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 1, -1, 9, -125, 1000000}$.\n", - "Output Answer": [ - "$10 \\sqrt{5} \\sqrt[3]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 1, -1, 9, -125, 1000000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\pi, 3, -8, -2 \\pi, 7, -8, -3, 4 \\sqrt{2}, 0, 7, -7, -5 \\sqrt{2}, 10, -5, \\frac{20}{\\pi }}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.pi, 3, -8, -2*math.pi, 7, -8, -3, 4*math.sqrt(2), 0, 7, -7, -5*math.sqrt(2), 10, -5, (20/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{5}, \\frac{19}{\\sqrt{5}}, 7, -\\frac{28}{3}, -\\frac{14}{5}, 5 \\sqrt{3}, -6, \\frac{19}{e}, 3 \\sqrt{3}} \\setminus {\\frac{19}{\\sqrt{5}}, \\frac{19}{3}, -6, -8, 7, 3 \\sqrt{3}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -\\frac{14}{5}, \\frac{19}{e}, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(5), (19/(math.sqrt(5))), 7, -(28/3), -(14/5), 5*math.sqrt(3), -6, (19/math.e), 3*math.sqrt(3),))\nsnd = set(((19/(math.sqrt(5))), (19/3), -6, -8, 7, 3*math.sqrt(3), 3*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, \\frac{3}{4}, 5 \\sqrt{2}, -\\frac{29}{3}, -6, 0.87, \\frac{5}{\\sqrt{3}}, -3} \\setminus {\\frac{5}{\\sqrt{3}}, 0.87, 5 \\sqrt{2}, -8, -3}$.\n", - "Output Answer": [ - "${-\\frac{29}{3}, -6, \\frac{3}{4}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, (3/4), 5*math.sqrt(2), -(29/3), -6, 0.87, (5/(math.sqrt(3))), -3,))\nsnd = set(((5/(math.sqrt(3))), 0.87, 5*math.sqrt(2), -8, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, 3, -2.12, \\frac{11}{\\sqrt{2}}, 4 \\sqrt{3}, -8.829, -0.66}$.\n", - "Output Answer": [ - "${-8.829, -5, -2.12, -0.66, 3, 4 \\sqrt{3}, \\frac{11}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 3, -2.12, (11/(math.sqrt(2))), 4*math.sqrt(3), -8.829, -0.66\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.227,0.411,0.051,0.134,0.048,0.065\\}$ and $\\{0.209,0.139,0.101,0.089,0.141,0.106\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.227, 0.411, 0.051, 0.134, 0.048, 0.065\ndistribution2 = 0.209, 0.139, 0.101, 0.089, 0.141, 0.106\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.118,0.098,0.039,0.036,0.179,0.103,0.328\\}$ and $\\{0.243,0.043,0.134,0.297,0.124,0.001,0.016\\}$.", - "Output Answer": [ - "$1.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.118, 0.098, 0.039, 0.036, 0.179, 0.103, 0.328\ndistribution2 = 0.243, 0.043, 0.134, 0.297, 0.124, 0.001, 0.016\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, 3 \\sqrt{5}, 0, -3 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{6 \\sqrt{5}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), 3*math.sqrt(5), 0, -3*math.sqrt(5), 2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{33}{4}, 3, \\frac{42}{5}, 4, -6 \\sqrt{2}, -2, -2, 0, -6 \\sqrt{2}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(33/4), 3, (42/5), 4, -6*math.sqrt(2), -2, -2, 0, -6*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x-9.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$-9.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(1.4*x-9.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, 5, 10, -4, -\\frac{23}{e}, 6, -9, 0, -e, -3 \\sqrt{2}, 4 \\sqrt{3}, -\\frac{16}{\\sqrt{3}}, -8, -9, -\\frac{9}{2}}$.", - "Output Answer": [ - "$-3 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, 5, 10, -4, -(23/math.e), 6, -9, 0, -math.e, -3*math.sqrt(2), 4*math.sqrt(3), -(16/(math.sqrt(3))), -8, -9, -(9/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, \\frac{8}{\\sqrt{\\pi }}, -1, 7, -3.2, -e, -4, -\\frac{2}{e}}$.\n", - "Output Answer": [ - "${-4, -3.2, -e, -1, -1, -\\frac{2}{e}, \\frac{8}{\\sqrt{\\pi }}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, (8/(math.sqrt(math.pi))), -1, 7, -3.2, -math.e, -4, -(2/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-216, -125, 8}$.\n", - "Output Answer": [ - "$60$" - ], - "Output Program": [ - "import math\n\nvalues = -216, -125, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, \\frac{28}{3}, -\\sqrt{2}, -\\frac{1}{e}, -9, -3, -3 \\sqrt{2}, 4, 0, -2, \\frac{9}{\\pi }, \\frac{7}{5}, -11 \\log (2), \\log (2)}$.", - "Output Answer": [ - "$-\\frac{1}{2 e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, (28/3), -math.sqrt(2), -(1/math.e), -9, -3, -3*math.sqrt(2), 4, 0, -2, (9/math.pi), (7/5), -11*math.log(2), math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, \\frac{19}{2}, -4, 2, -4, 3, \\frac{17}{4}, 2 e, 2, 8, \\sqrt{5}, -\\frac{5}{e}}$.\n", - "Output Answer": [ - "$\\frac{27}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (19/2), -4, 2, -4, 3, (17/4), 2*math.e, 2, 8, math.sqrt(5), -(5/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1.137, -3 \\sqrt{3}, -9, 3, -5 \\log (2), -8, -1} \\setminus {-2, -3, 3, 8, 2, -5 \\log (2)}$.\n", - "Output Answer": [ - "${-9, -8, -3 \\sqrt{3}, -1.137, -1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1.137, -3*math.sqrt(3), -9, 3, -5*math.log(2), -8, -1,))\nsnd = set((-2, -3, 3, 8, 2, -5*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 e, -2 e}$.\n", - "Output Answer": [ - "$\\frac{e}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.e, -2*math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.835,0.019,0.122,0.006\\}$ and $\\{0.112,0.276,0.098,0.312\\}$.", - "Output Answer": [ - "$1.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.835, 0.019, 0.122, 0.006\ndistribution2 = 0.112, 0.276, 0.098, 0.312\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, \\frac{11}{2}, \\frac{1}{\\sqrt{5}}, 10, -9.6, -\\frac{11}{2}} \\setminus {-\\frac{7}{2}, 7, -5, -9.6, \\frac{11}{2}, \\frac{1}{\\sqrt{5}}, 1}$.\n", - "Output Answer": [ - "${-\\frac{11}{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, (11/2), (1/(math.sqrt(5))), 10, -9.6, -(11/2),))\nsnd = set((-(7/2), 7, -5, -9.6, (11/2), (1/(math.sqrt(5))), 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -10, 2, 0, 7}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "values = -5, -10, 2, 0, 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, 1, -12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{217}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 1, -12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.3 x-7.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7]\n", - "Output Answer": [ - "$-7.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(E(-4.3*x-7.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\sqrt{3}, 9, 2.6, 3, -2.245, 5, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -2.245, -\\sqrt{3}, 2.6, 3, 5, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(3), 9, 2.6, 3, -2.245, 5, -3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 2 \\sqrt{3}, -8} \\cup {4, -8, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-8, -1, 2 \\sqrt{3}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 2*math.sqrt(3), -8,))\nsnd = set((4, -8, 2*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${e, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$5 \\sqrt{2}-e$" - ], - "Output Program": [ - "import math\n\nvalues = math.e, 5*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{1}{3}, 5, -\\log (2), 10, 4, \\frac{15}{4}, 2 \\sqrt{3}, -5, -6, 1, -\\frac{7}{2}}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (1/3), 5, -math.log(2), 10, 4, (15/4), 2*math.sqrt(3), -5, -6, 1, -(7/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1, 2.3, \\frac{7}{\\sqrt{2}}, 3, -2, -6} \\cup {2.3, -2, 3, -4 \\sqrt{2}, -6, \\frac{3}{5}, 9}$.\n", - "Output Answer": [ - "${-6, -4 \\sqrt{2}, -2, \\frac{3}{5}, 1, 2.3, 3, \\frac{7}{\\sqrt{2}}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 2.3, (7/(math.sqrt(2))), 3, -2, -6,))\nsnd = set((2.3, -2, 3, -4*math.sqrt(2), -6, (3/5), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\pi, \\sqrt{3}, 2 \\pi, 5, 4, 3, 5 \\sqrt{2}, \\sqrt{5}} \\cup {\\pi, \\sqrt{5}, 3, 5 \\sqrt{2}, 8}$.\n", - "Output Answer": [ - "${\\sqrt{3}, \\sqrt{5}, 3, \\pi, 4, 5, 2 \\pi, 5 \\sqrt{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, math.sqrt(3), 2*math.pi, 5, 4, 3, 5*math.sqrt(2), math.sqrt(5),))\nsnd = set((math.pi, math.sqrt(5), 3, 5*math.sqrt(2), 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.8 x^2+2.3 x+6.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7]\n", - "Output Answer": [ - "$3.46$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(E(-2.8*x**2+2.3*x+6.2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, 5, -1, 9.044, 9.9, 1, 6 \\sqrt{2}, 6, -3} \\cup {-3, 8.6, -1, 1, -5.347, 7, 0, 6}$.\n", - "Output Answer": [ - "${-5.347, -3, -1, 0, 1, 5, 6, 7, 6 \\sqrt{2}, 8.6, 9.044, 9.9}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 5, -1, 9.044, 9.9, 1, 6*math.sqrt(2), 6, -3,))\nsnd = set((-3, 8.6, -1, 1, -5.347, 7, 0, 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, 6 \\sqrt{2}, \\frac{19}{\\pi }, 3, 5, -7.761} \\setminus {5, 6 \\sqrt{2}, 2, \\pi, -6, \\frac{5}{3}}$.\n", - "Output Answer": [ - "${-7.761, 0, 3, \\frac{19}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 6*math.sqrt(2), (19/math.pi), 3, 5, -7.761,))\nsnd = set((5, 6*math.sqrt(2), 2, math.pi, -6, (5/3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, 5, 3, -5, 4, 0, \\frac{2}{\\pi }, \\frac{14}{\\sqrt{5}}, -7}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 5, 3, -5, 4, 0, (2/math.pi), (14/(math.sqrt(5))), -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{3}, 10, -\\frac{58}{7}, e, -2 \\sqrt{5}, 5, -5, 0, -2}$.\n", - "Output Answer": [ - "$\\frac{128}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/3), 10, -(58/7), math.e, -2*math.sqrt(5), 5, -5, 0, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{5}{e}, \\frac{15}{e}, \\frac{7}{e}, \\frac{12}{e}, \\frac{22}{e}}$.\n", - "Output Answer": [ - "$\\frac{51}{5 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(5/math.e), (15/math.e), (7/math.e), (12/math.e), (22/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, \\frac{8}{\\sqrt{3}}, \\frac{16}{3}, -7, -2, \\sqrt{3}, 9, \\frac{20}{3}, 5} \\cup {-\\sqrt{3}, 9, 2, -7, 5, -9, 7, 6, \\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-9, -7, -2, -\\sqrt{3}, \\sqrt{3}, 2, \\frac{8}{\\sqrt{3}}, 5, \\frac{16}{3}, 6, \\frac{20}{3}, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, (8/(math.sqrt(3))), (16/3), -7, -2, math.sqrt(3), 9, (20/3), 5,))\nsnd = set((-math.sqrt(3), 9, 2, -7, 5, -9, 7, 6, (8/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -\\pi, 3, 5.87, -\\frac{50}{7}, \\frac{7}{3}, -2.36} \\cup {\\frac{2}{7}, \\frac{29}{3}, -7, -\\pi, 1.02, 5.87, 3}$.\n", - "Output Answer": [ - "${-\\frac{50}{7}, -7, -\\pi, -2.36, \\frac{2}{7}, 1.02, \\frac{7}{3}, 3, 5.87, \\frac{29}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -math.pi, 3, 5.87, -(50/7), (7/3), -2.36,))\nsnd = set(((2/7), (29/3), -7, -math.pi, 1.02, 5.87, 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.108,0.25,0.098,0.172,0.14,0.132\\}$ and $\\{0.115,0.167,0.225,0.144,0.076,0.137\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.108, 0.25, 0.098, 0.172, 0.14, 0.132\ndistribution2 = 0.115, 0.167, 0.225, 0.144, 0.076, 0.137\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3 e, -8, -1.538, -\\frac{65}{7}, 1, 5 \\sqrt{2}, -10, 0, \\frac{1}{5}} \\cup {4, 1, \\frac{1}{5}, -8, -6, -1.538, 3 e, -\\frac{65}{7}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-10, -\\frac{65}{7}, -8, -6, -1.538, 0, \\frac{1}{5}, 1, 4, 5 \\sqrt{2}, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.e, -8, -1.538, -(65/7), 1, 5*math.sqrt(2), -10, 0, (1/5),))\nsnd = set((4, 1, (1/5), -8, -6, -1.538, 3*math.e, -(65/7), 5*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -8, -\\frac{30}{\\pi }, -2 \\pi, \\sqrt{2}, -2 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} (-5-2 \\pi )$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, -8, -(30/math.pi), -2*math.pi, math.sqrt(2), -2*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -6, 7, -6, -6, 1, -4, -4, 1, 1, 7, -6, 1, 7, -6, 7, -4, -4, -4, -6}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -6, 7, -6, -6, 1, -4, -4, 1, 1, 7, -6, 1, 7, -6, 7, -4, -4, -4, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -7, 9}$.\n", - "Output Answer": [ - "$\\frac{208}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -7, 9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{49}{3}}$.\n", - "Output Answer": [ - "$\\frac{1176}{85}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (49/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 5, -4}$.\n", - "Output Answer": [ - "$\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 5, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\pi, \\frac{13}{7}, 0, 6, 7, 3 \\sqrt{5}, -3, -8, -9} \\cup {-\\frac{9}{e}, 2 \\sqrt{5}, \\frac{13}{7}, 6, -2, 7, 2, 0, \\frac{46}{5}}$.\n", - "Output Answer": [ - "${-9, -8, -2 \\pi, -\\frac{9}{e}, -3, -2, 0, \\frac{13}{7}, 2, 2 \\sqrt{5}, 6, 3 \\sqrt{5}, 7, \\frac{46}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, (13/7), 0, 6, 7, 3*math.sqrt(5), -3, -8, -9,))\nsnd = set((-(9/math.e), 2*math.sqrt(5), (13/7), 6, -2, 7, 2, 0, (46/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{16}{3}, 7 \\log (2), 3 e, 4 \\sqrt{2}} \\setminus {-\\frac{10}{3}, -6, 7 \\log (2), 0, \\frac{5}{\\sqrt{2}}, 4, \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{16}{3}, 4 \\sqrt{2}, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(16/3), 7*math.log(2), 3*math.e, 4*math.sqrt(2),))\nsnd = set((-(10/3), -6, 7*math.log(2), 0, (5/(math.sqrt(2))), 4, math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6 \\sqrt{2}, -\\frac{26}{\\pi }, -5 \\sqrt{3}, -6, \\frac{15}{\\pi }, 3 e, -\\frac{6}{\\sqrt{5}}, 3}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-6-\\frac{6}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6*math.sqrt(2), -(26/math.pi), -5*math.sqrt(3), -6, (15/math.pi), 3*math.e, -(6/(math.sqrt(5))), 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.244,0.17,0.133,0.139,0.139\\}$ and $\\{0.216,0.211,0.105,0.068,0.159\\}$.", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.244, 0.17, 0.133, 0.139, 0.139\ndistribution2 = 0.216, 0.211, 0.105, 0.068, 0.159\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{2}, -5 \\sqrt{2}, \\sqrt{2}, 7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{5}{2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(2), -5*math.sqrt(2), math.sqrt(2), 7*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 5, -3, -3, 5, -3, -3, 1, -3, -9, 1, -9, 5, -9, 1, 5, 1, 5, -3, 5, 1, 1, -9, -9, 1, 1, -3, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 5, -3, -3, 5, -3, -3, 1, -3, -9, 1, -9, 5, -9, 1, 5, 1, 5, -3, 5, 1, 1, -9, -9, 1, 1, -3, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{1}{\\sqrt{3}}, 10, -\\pi, -4 \\sqrt{5}, 5, 0, 1} \\cup {-\\pi, -9, -4 \\sqrt{5}, -\\frac{16}{\\sqrt{3}}, 5, -7, 1}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -9, -4 \\sqrt{5}, -7, -\\pi, 0, \\frac{1}{\\sqrt{3}}, 1, 5, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/(math.sqrt(3))), 10, -math.pi, -4*math.sqrt(5), 5, 0, 1,))\nsnd = set((-math.pi, -9, -4*math.sqrt(5), -(16/(math.sqrt(3))), 5, -7, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, 11, 15, 12, -4}$.\n", - "Output Answer": [ - "$\\frac{1087}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 11, 15, 12, -4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 0, 3, 9, 0, 3, 9, 0, 0, 0, 3, 9, 9, 0, 3, 9, 9, 3, 3, 3, 9, 9, 0, 0, 3, 9, 9, 9, 0}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 0, 3, 9, 0, 3, 9, 0, 0, 0, 3, 9, 9, 0, 3, 9, 9, 3, 3, 3, 9, 9, 0, 0, 3, 9, 9, 9, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5.1, -6, -4 \\sqrt{5}, -0.998, -2.7, 10} \\cup {-2.7, -3 \\sqrt{5}, 4.173, 5.1, 10, 0, 8.39, 1}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -3 \\sqrt{5}, -6, -2.7, -0.998, 0, 1, 4.173, 5.1, 8.39, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.1, -6, -4*math.sqrt(5), -0.998, -2.7, 10,))\nsnd = set((-2.7, -3*math.sqrt(5), 4.173, 5.1, 10, 0, 8.39, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 e, 3 e, -4 e, 2 e, 3 e, -4 e, -4 e, 3 e, -4 e, -4 e, -4 e, -4 e, 2 e, -4 e, -4 e, -4 e, 2 e, -4 e, 2 e, 2 e, -4 e, -4 e, -4 e, 3 e}$.\n", - "Output Answer": [ - "$\\{-4 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.e, 3*math.e, -4*math.e, 2*math.e, 3*math.e, -4*math.e, -4*math.e, 3*math.e, -4*math.e, -4*math.e, -4*math.e, -4*math.e, 2*math.e, -4*math.e, -4*math.e, -4*math.e, 2*math.e, -4*math.e, 2*math.e, 2*math.e, -4*math.e, -4*math.e, -4*math.e, 3*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.679,0.038,0.052,0.081\\}$ and $\\{0.135,0.198,0.132,0.227\\}$.", - "Output Answer": [ - "$0.86$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.679, 0.038, 0.052, 0.081\ndistribution2 = 0.135, 0.198, 0.132, 0.227\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, -5, 512}$.\n", - "Output Answer": [ - "$8 \\sqrt[3]{-5} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -5, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.025,0.235,0.066,0.015,0.37,0.197\\}$ and $\\{0.212,0.112,0.095,0.205,0.081,0.018,0.197\\}$.", - "Output Answer": [ - "$1.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.025, 0.235, 0.066, 0.015, 0.37, 0.197\ndistribution2 = 0.212, 0.112, 0.095, 0.205, 0.081, 0.018, 0.197\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{3}, 5, -2, 3, -2, -8, -3 e, -9, -5, 7}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(3), 5, -2, 3, -2, -8, -3*math.e, -9, -5, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{9}{e}, -9, -\\frac{69}{7}, 1, 4, 5.601} \\setminus {4, -\\frac{69}{7}, -4, 5, \\frac{9}{e}}$.\n", - "Output Answer": [ - "${-9, 1, 5.601}$" - ], - "Output Program": [ - "import math\n\nfst = set(((9/math.e), -9, -(69/7), 1, 4, 5.601,))\nsnd = set((4, -(69/7), -4, 5, (9/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, -9, \\sqrt{3}, -9, \\log (2)}$.", - "Output Answer": [ - "$\\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -9, math.sqrt(3), -9, math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 18, 9}$.\n", - "Output Answer": [ - "$\\frac{63}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 18, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, -5, 5, 0, 5, 8, -5, -4, -\\frac{5}{\\sqrt{\\pi }}, 10, 2 \\sqrt{5}, 3 \\pi, 6, 10}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(5+2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -5, 5, 0, 5, 8, -5, -4, -(5/(math.sqrt(math.pi))), 10, 2*math.sqrt(5), 3*math.pi, 6, 10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 6, 2, 5}$.\n", - "Output Answer": [ - "$\\frac{1043}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 6, 2, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -3, -1, 7, -3, 2}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -3, -1, 7, -3, 2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x^3-0.1 x^2+8.7$ where $x \\sim $ \\text{BetaDistribution}[1.2,1.3]\n", - "Output Answer": [ - "$9.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.2, 1.3)\nprint(E(4.*x**3-0.1*x**2+8.7))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -4, -9.4, -2, \\frac{13}{\\sqrt{5}}} \\setminus {\\frac{48}{5}, 7, -9.4, -8, -3}$.\n", - "Output Answer": [ - "${-4, -2, \\frac{13}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -4, -9.4, -2, (13/(math.sqrt(5))),))\nsnd = set(((48/5), 7, -9.4, -8, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{14}{3}, -e, \\frac{48}{5}, \\frac{28}{5}, \\frac{26}{\\pi }, \\frac{16}{5}, -4} \\cup {-e, -\\frac{46}{5}, \\frac{5}{3}, -4, \\frac{48}{5}, -2, \\frac{44}{5}, \\frac{3}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{46}{5}, -4, -e, -2, \\frac{3}{\\pi }, \\frac{5}{3}, \\frac{16}{5}, \\frac{14}{3}, \\frac{28}{5}, \\frac{26}{\\pi }, \\frac{44}{5}, \\frac{48}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((14/3), -math.e, (48/5), (28/5), (26/math.pi), (16/5), -4,))\nsnd = set((-math.e, -(46/5), (5/3), -4, (48/5), -2, (44/5), (3/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, \\pi, \\frac{64}{7}, \\frac{19}{2}, \\frac{62}{7}} \\cup {-\\frac{13}{7}, 0, \\frac{34}{7}, \\frac{9}{2}, -\\frac{2}{\\sqrt{3}}, \\pi}$.\n", - "Output Answer": [ - "${-\\frac{13}{7}, -\\frac{2}{\\sqrt{3}}, 0, \\pi, \\frac{9}{2}, \\frac{34}{7}, \\frac{62}{7}, \\frac{64}{7}, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, math.pi, (64/7), (19/2), (62/7),))\nsnd = set((-(13/7), 0, (34/7), (9/2), -(2/(math.sqrt(3))), math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{21}{e}, -1, 0, -\\frac{21}{4}, 4} \\setminus {3, -\\frac{7}{\\pi }, -10, \\frac{21}{e}, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "${-\\frac{21}{4}, -1, 0, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set(((21/math.e), -1, 0, -(21/4), 4,))\nsnd = set((3, -(7/math.pi), -10, (21/math.e), -(15/2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -2 \\sqrt{3}} \\setminus {7, -2 \\sqrt{3}, -\\frac{22}{\\sqrt{5}}, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -2*math.sqrt(3),))\nsnd = set((7, -2*math.sqrt(3), -(22/(math.sqrt(5))), 4*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -10, 729, 8, 49}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-15} 2^{3/5} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -10, 729, 8, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, \\frac{30}{\\pi }, -\\frac{29}{3}, 4 \\sqrt{3}, 6, \\frac{21}{e}, -4, -\\frac{2}{\\sqrt{5}}, 8 \\log (2), \\frac{25}{e}, 3 e, -1, \\frac{22}{\\pi }, -\\frac{43}{5}}$.\n", - "Output Answer": [ - "$\\frac{29}{3}+\\frac{30}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (30/math.pi), -(29/3), 4*math.sqrt(3), 6, (21/math.e), -4, -(2/(math.sqrt(5))), 8*math.log(2), (25/math.e), 3*math.e, -1, (22/math.pi), -(43/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^2+3.5 x+3.$ where $x \\sim $ \\text{NormalDistribution}[0.1,2.8]\n", - "Output Answer": [ - "$13.56$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.1, 2.8)\nprint(E(1.3*x**2+3.5*x+3.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{39}{4}, -3 \\sqrt{2}, -8, -7, -10}$.\n", - "Output Answer": [ - "${-10, -\\frac{39}{4}, -8, -7, -3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(39/4), -3*math.sqrt(2), -8, -7, -10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, \\frac{7}{\\sqrt{2}}, -\\frac{4}{5}, -4, -e}$.\n", - "Output Answer": [ - "$9+\\frac{7}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, (7/(math.sqrt(2))), -(4/5), -4, -math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, 9, -8}$.\n", - "Output Answer": [ - "${-8, -3, 9}$" - ], - "Output Program": [ - "values = -3, 9, -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.085,0.201,0.13,0.061,0.062,0.08,0.066,0.136\\}$ and $\\{0.011,0.003,0.214,0.299,0.155,0.068,0.025,0.185\\}$.", - "Output Answer": [ - "$1.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.085, 0.201, 0.13, 0.061, 0.062, 0.08, 0.066, 0.136\ndistribution2 = 0.011, 0.003, 0.214, 0.299, 0.155, 0.068, 0.025, 0.185\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 8, -3, 8, 4, 8, -3, 8, -3, 8, -2, -2, -3, 8, 4, 4, -3, 8, -2, 4, -2, 4, 8, 8, -3, -2, 8}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 8, -3, 8, 4, 8, -3, 8, -3, 8, -2, -2, -3, 8, 4, 4, -3, 8, -2, 4, -2, 4, 8, 8, -3, -2, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.8 x^2+4. x-4.4$ where $x \\sim $ \\text{BetaDistribution}[0.3,1.5]\n", - "Output Answer": [ - "$-3.87$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 1.5)\nprint(E(-1.8*x**2+4.*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{5}{e}, -\\frac{5}{e}, -\\frac{19}{e}, -\\frac{9}{e}, -\\frac{9}{e}, \\frac{13}{e}, -\\frac{9}{e}, \\frac{13}{e}, -\\frac{5}{e}, \\frac{13}{e}, -\\frac{9}{e}, -\\frac{19}{e}, -\\frac{1}{e}, -\\frac{9}{e}, -\\frac{1}{e}, -\\frac{1}{e}, -\\frac{5}{e}, -\\frac{9}{e}, -\\frac{5}{e}, -\\frac{1}{e}, \\frac{13}{e}, \\frac{13}{e}, -\\frac{5}{e}, -\\frac{9}{e}, -\\frac{19}{e}, -\\frac{9}{e}, -\\frac{5}{e}, -\\frac{19}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{9}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(5/math.e), -(5/math.e), -(19/math.e), -(9/math.e), -(9/math.e), (13/math.e), -(9/math.e), (13/math.e), -(5/math.e), (13/math.e), -(9/math.e), -(19/math.e), -(1/math.e), -(9/math.e), -(1/math.e), -(1/math.e), -(5/math.e), -(9/math.e), -(5/math.e), -(1/math.e), (13/math.e), (13/math.e), -(5/math.e), -(9/math.e), -(19/math.e), -(9/math.e), -(5/math.e), -(19/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, 3, 1, -3.568, -2} \\setminus {-3.568, 3, 10, -9.16}$.\n", - "Output Answer": [ - "${-2, 1, 7}$" - ], - "Output Program": [ - "fst = set((7, 3, 1, -3.568, -2,))\nsnd = set((-3.568, 3, 10, -9.16,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, -32, 262144, 7, 512, 512}$.\n", - "Output Answer": [ - "$64 \\sqrt[6]{-7} 2^{5/6} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, -32, 262144, 7, 512, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{3}{2}, -6, -\\frac{19}{7}, -6.78} \\cup {9.56, -\\frac{15}{2}, -\\frac{19}{7}, -6}$.\n", - "Output Answer": [ - "${-\\frac{15}{2}, -6.78, -6, -\\frac{19}{7}, -\\frac{3}{2}, 9.56}$" - ], - "Output Program": [ - "fst = set((-(3/2), -6, -(19/7), -6.78,))\nsnd = set((9.56, -(15/2), -(19/7), -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6 \\sqrt{2}, 5, -5}$.\n", - "Output Answer": [ - "$5+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.sqrt(2), 5, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, -\\frac{7}{5}, 0, \\frac{16}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{3}{\\sqrt{\\pi }}, -6, -7}$.", - "Output Answer": [ - "$-\\frac{7}{10}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, -(7/5), 0, (16/(math.sqrt(5))), (7/(math.sqrt(5))), (3/(math.sqrt(math.pi))), -6, -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${10, 10, 6, 4}$.", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 10, 6, 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, 1, \\frac{60}{7}, \\sqrt{3}, \\frac{7}{2}}$.", - "Output Answer": [ - "$\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, 1, (60/7), math.sqrt(3), (7/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, -2, \\sqrt{5}, -3, 8, \\frac{15}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-3, -2, \\sqrt{5}, 6, 8, \\frac{15}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -2, math.sqrt(5), -3, 8, (15/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-1.4 x^2+0.3 x-0.3 < -1.9 x-0.8$ where $x \\sim $ \\text{NormalDistribution}[-0.8,1.4].", - "Output Answer": [ - "$0.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 1.4)\nprint(P((-1.4*x**2+0.3*x-0.3 < -1.9*x-0.8)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x^2+4.4 x+3.4$ where $x \\sim $ \\text{PoissonDistribution}[2.8]\n", - "Output Answer": [ - "$56.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.8)\nprint(E(3.8*x**2+4.4*x+3.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{5}, 3 \\sqrt{5}, -2 \\sqrt{5}, 3 \\sqrt{5}, 0, 4 \\sqrt{5}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(5), 3*math.sqrt(5), -2*math.sqrt(5), 3*math.sqrt(5), 0, 4*math.sqrt(5), 4*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2-4. x-4.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$195.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(4.4*x**2-4.*x-4.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -4, 6, 3 e, \\frac{16}{\\sqrt{5}}, 1, 3, 2 \\sqrt{2}, -7, 3, -\\frac{15}{\\sqrt{\\pi }}, -1, 8, 2 \\sqrt{3}, -8}$.\n", - "Output Answer": [ - "$3 e+\\frac{15}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -4, 6, 3*math.e, (16/(math.sqrt(5))), 1, 3, 2*math.sqrt(2), -7, 3, -(15/(math.sqrt(math.pi))), -1, 8, 2*math.sqrt(3), -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.085,0.083,0.101,0.191,0.121,0.109,0.072,0.071,0.097\\}$ and $\\{0.024,0.092,0.045,0.094,0.118,0.192,0.231,0.081,0.052\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.085, 0.083, 0.101, 0.191, 0.121, 0.109, 0.072, 0.071, 0.097\ndistribution2 = 0.024, 0.092, 0.045, 0.094, 0.118, 0.192, 0.231, 0.081, 0.052\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, 9, -9}$.\n", - "Output Answer": [ - "$-\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, 9, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 1, -2}$.\n", - "Output Answer": [ - "$\\sqrt[3]{-2} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 1, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.033,0.177,0.208,0.103,0.103,0.08,0.038,0.128\\}$ and $\\{0.032,0.17,0.035,0.203,0.024,0.038,0.451,0.013\\}$.", - "Output Answer": [ - "$0.93$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.033, 0.177, 0.208, 0.103, 0.103, 0.08, 0.038, 0.128\ndistribution2 = 0.032, 0.17, 0.035, 0.203, 0.024, 0.038, 0.451, 0.013\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5.4, -9, -1, -4 \\sqrt{3}, -4, -\\frac{24}{\\pi }, -\\sqrt{2}, 6}$.\n", - "Output Answer": [ - "${-9, -\\frac{24}{\\pi }, -4 \\sqrt{3}, -4, -\\sqrt{2}, -1, 5.4, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 5.4, -9, -1, -4*math.sqrt(3), -4, -(24/math.pi), -math.sqrt(2), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, \\sqrt{5}, \\frac{14}{3}, -9.48, -4.5, 5, 6.7, 13 \\log (2)}$.\n", - "Output Answer": [ - "${-9.48, -4.5, -4, \\sqrt{5}, \\frac{14}{3}, 5, 6.7, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, math.sqrt(5), (14/3), -9.48, -4.5, 5, 6.7, 13*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, -1, -15, 9, 11, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{362}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -1, -15, 9, 11, 15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.4 x^2-1.1 x+2.1$ where $x \\sim $ \\text{PoissonDistribution}[2.5]\n", - "Output Answer": [ - "$-4.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.5)\nprint(E(-0.4*x**2-1.1*x+2.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{15}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -\\frac{27}{\\pi }, 8, \\frac{17}{\\sqrt{\\pi }}, 3 \\pi, -7, \\frac{10}{\\sqrt{\\pi }}, -3 \\sqrt{3}, \\frac{10}{3}, \\frac{5}{2}}$.", - "Output Answer": [ - "$\\frac{10}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(15/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -(27/math.pi), 8, (17/(math.sqrt(math.pi))), 3*math.pi, -7, (10/(math.sqrt(math.pi))), -3*math.sqrt(3), (10/3), (5/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.01,0.104,0.301,0.181,0.142,0.2\\}$ and $\\{0.137,0.138,0.212,0.216,0.098,0.147\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.01, 0.104, 0.301, 0.181, 0.142, 0.2\ndistribution2 = 0.137, 0.138, 0.212, 0.216, 0.098, 0.147\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.1,0.152,0.158,0.159,0.042,0.109,0.176\\}$ and $\\{0.066,0.205,0.016,0.065,0.108,0.13,0.254\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.1, 0.152, 0.158, 0.159, 0.042, 0.109, 0.176\ndistribution2 = 0.066, 0.205, 0.016, 0.065, 0.108, 0.13, 0.254\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{3}{2}, -5, 3, 3, -4, -5}$.", - "Output Answer": [ - "$-\\frac{11}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -(3/2), -5, 3, 3, -4, -5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{17}{4}, -\\frac{9}{2}, -2, 2, -\\frac{1}{2}, 2, \\frac{17}{4}, \\frac{19}{4}, \\frac{19}{4}, -\\frac{1}{2}, -2, -\\frac{1}{2}, -\\frac{9}{2}, \\frac{19}{4}, \\frac{17}{4}, -\\frac{9}{2}, \\frac{19}{4}, -\\frac{1}{2}, -\\frac{9}{2}, \\frac{19}{4}, -2, 2, \\frac{17}{4}, -\\frac{9}{2}, -2, -\\frac{9}{2}, -\\frac{9}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{9}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (17/4), -(9/2), -2, 2, -(1/2), 2, (17/4), (19/4), (19/4), -(1/2), -2, -(1/2), -(9/2), (19/4), (17/4), -(9/2), (19/4), -(1/2), -(9/2), (19/4), -2, 2, (17/4), -(9/2), -2, -(9/2), -(9/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7 \\log (2), -3 \\sqrt{2}, \\sqrt{5}, -2 e}$.\n", - "Output Answer": [ - "${-2 e, -3 \\sqrt{2}, \\sqrt{5}, 7 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 7*math.log(2), -3*math.sqrt(2), math.sqrt(5), -2*math.e\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\pi, -9.984, 4, 7, 2, -9, -\\frac{13}{\\sqrt{3}}, 8} \\setminus {7, -9, 3 \\pi, -\\frac{13}{\\sqrt{3}}, 4, 2}$.\n", - "Output Answer": [ - "${-9.984, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, -9.984, 4, 7, 2, -9, -(13/(math.sqrt(3))), 8,))\nsnd = set((7, -9, 3*math.pi, -(13/(math.sqrt(3))), 4, 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.109,0.139,0.078,0.089,0.083,0.066,0.097,0.113,0.065,0.049\\}$ and $\\{0.049,0.215,0.021,0.265,0.073,0.004,0.163,0.066,0.077,0.038\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.109, 0.139, 0.078, 0.089, 0.083, 0.066, 0.097, 0.113, 0.065, 0.049\ndistribution2 = 0.049, 0.215, 0.021, 0.265, 0.073, 0.004, 0.163, 0.066, 0.077, 0.038\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{19}{e}, -4, 1, -5, -\\frac{4}{\\sqrt{3}}, 7, 4}$.\n", - "Output Answer": [ - "${-\\frac{19}{e}, -5, -4, -\\frac{4}{\\sqrt{3}}, 1, 4, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/math.e), -4, 1, -5, -(4/(math.sqrt(3))), 7, 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, -8, 25, 3, 15625, 81}$.\n", - "Output Answer": [ - "$5 \\sqrt[6]{-1} \\sqrt[3]{5} 6^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -8, 25, 3, 15625, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -1, -\\frac{26}{\\pi }, -6, 6, -6, \\frac{11}{\\sqrt{3}}, 5}$.\n", - "Output Answer": [ - "$\\frac{11}{\\sqrt{3}}+\\frac{26}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -1, -(26/math.pi), -6, 6, -6, (11/(math.sqrt(3))), 5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -9, -\\frac{16}{e}, 4, -2, 2 \\pi} \\cup {\\frac{14}{3}, -\\frac{16}{e}, -6, -2, 8}$.\n", - "Output Answer": [ - "${-9, -6, -\\frac{16}{e}, -2, 4, \\frac{14}{3}, 2 \\pi, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -9, -(16/math.e), 4, -2, 2*math.pi,))\nsnd = set(((14/3), -(16/math.e), -6, -2, 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -32, 64, 16807, 8, 256}$.\n", - "Output Answer": [ - "$16 \\sqrt[6]{-1} \\sqrt[3]{2} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -32, 64, 16807, 8, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{2}, -2, 6, -2 \\pi, 7, -\\frac{16}{5}, 9, -5, 2, -\\frac{11}{2}, \\frac{13}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(2), -2, 6, -2*math.pi, 7, -(16/5), 9, -5, 2, -(11/2), (13/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.128,0.084,0.035,0.067,0.064,0.029,0.148,0.091,0.13,0.12\\}$ and $\\{0.151,0.31,0.152,0.036,0.063,0.076,0.05,0.009,0.065,0.022\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.128, 0.084, 0.035, 0.067, 0.064, 0.029, 0.148, 0.091, 0.13, 0.12\ndistribution2 = 0.151, 0.31, 0.152, 0.036, 0.063, 0.076, 0.05, 0.009, 0.065, 0.022\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{7}{5}, 0, 9, -9, 2 \\sqrt{3}, 6}$.\n", - "Output Answer": [ - "${-9, -\\frac{7}{5}, 0, 2 \\sqrt{3}, 6, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/5), 0, 9, -9, 2*math.sqrt(3), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -5, \\frac{17}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{5}}, \\frac{7}{e}, 13 \\log (2), -\\frac{27}{4}, -5 \\sqrt{3}, 0, -8, -6, -1, 5, -7}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -5, (17/(math.sqrt(math.pi))), -(13/(math.sqrt(5))), (7/math.e), 13*math.log(2), -(27/4), -5*math.sqrt(3), 0, -8, -6, -1, 5, -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -4 \\sqrt{5}, \\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$10+\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -4*math.sqrt(5), (3/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9, \\frac{50}{7}, 9., -3} \\setminus {-4 \\sqrt{3}, 10, \\frac{29}{7}, 3, -3, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${\\frac{50}{7}, 9., 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, (50/7), 9., -3,))\nsnd = set((-4*math.sqrt(3), 10, (29/7), 3, -3, 2*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -5 \\sqrt{3}, -3, -\\pi, 7, -5} \\cup {-\\pi, -3, \\sqrt{3}, 6, 7, -5, 5}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -5, -\\pi, -3, \\sqrt{3}, 5, 6, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -5*math.sqrt(3), -3, -math.pi, 7, -5,))\nsnd = set((-math.pi, -3, math.sqrt(3), 6, 7, -5, 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{10}{e}, 5, 4, 3, 5, -7, 1, 0}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+\\frac{10}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (10/math.e), 5, 4, 3, 5, -7, 1, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, 3, 9, 8, -8, -\\frac{29}{\\pi }, 2, 0} \\cup {\\frac{4}{\\pi }, 3, 5, 8, 2, -10, -9}$.\n", - "Output Answer": [ - "${-10, -\\frac{29}{\\pi }, -9, -8, 0, \\frac{4}{\\pi }, 2, 3, 5, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 3, 9, 8, -8, -(29/math.pi), 2, 0,))\nsnd = set(((4/math.pi), 3, 5, 8, 2, -10, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, -1, -3, 1, -4, -7, -3}$.\n", - "Output Answer": [ - "$-\\frac{9}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, -1, -3, 1, -4, -7, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.3 x-3.4$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$-6.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(-1.3*x-3.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 64, -8, 81}$.\n", - "Output Answer": [ - "$(12+12 i) \\sqrt[4]{2} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 64, -8, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.154,0.299,0.161,0.086\\}$ and $\\{0.181,0.234,0.214,0.214\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.154, 0.299, 0.161, 0.086\ndistribution2 = 0.181, 0.234, 0.214, 0.214\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{2}{3}, 4, 5, \\frac{4}{3}}$.\n", - "Output Answer": [ - "$\\frac{40}{27}$" - ], - "Output Program": [ - "import statistics\nvalues = (2/3), 4, 5, (4/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\sqrt{5}, 3 \\sqrt{3}, -\\frac{29}{4}, 3, 2, 4 \\sqrt{3}, \\frac{13}{5}, -\\frac{24}{e}, -5, -4, -\\frac{9}{e}} \\cup {3, -\\frac{21}{4}, -4, -\\sqrt{3}, -5, 9, \\frac{10}{e}, 3 \\sqrt{3}, -\\frac{13}{e}, 2}$.\n", - "Output Answer": [ - "${-\\frac{24}{e}, -\\frac{29}{4}, -\\frac{21}{4}, -5, -\\frac{13}{e}, -4, -\\frac{9}{e}, -\\sqrt{5}, -\\sqrt{3}, 2, \\frac{13}{5}, 3, \\frac{10}{e}, 3 \\sqrt{3}, 4 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(5), 3*math.sqrt(3), -(29/4), 3, 2, 4*math.sqrt(3), (13/5), -(24/math.e), -5, -4, -(9/math.e),))\nsnd = set((3, -(21/4), -4, -math.sqrt(3), -5, 9, (10/math.e), 3*math.sqrt(3), -(13/math.e), 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${10, 1, -6, 3 e, -6.6, 4 \\sqrt{3}, \\frac{13}{5}} \\cup {0, 4 \\sqrt{3}, -6.6, \\frac{49}{5}, -8, -2 e}$.\n", - "Output Answer": [ - "${-8, -6.6, -6, -2 e, 0, 1, \\frac{13}{5}, 4 \\sqrt{3}, 3 e, \\frac{49}{5}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 1, -6, 3*math.e, -6.6, 4*math.sqrt(3), (13/5),))\nsnd = set((0, 4*math.sqrt(3), -6.6, (49/5), -8, -2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{2}, -6 \\sqrt{2}, 5 \\sqrt{2}, -5 \\sqrt{2}, -3 \\sqrt{2}, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{\\sqrt{2}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(2), -6*math.sqrt(2), 5*math.sqrt(2), -5*math.sqrt(2), -3*math.sqrt(2), 3*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2.23, \\frac{5}{e}, -7., -\\frac{5}{e}} \\setminus {-5.66, \\frac{11}{\\sqrt{\\pi }}, \\frac{5}{e}, -\\frac{5}{e}, -4 \\sqrt{2}, -7.}$.\n", - "Output Answer": [ - "${-2.23}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2.23, (5/math.e), -7., -(5/math.e),))\nsnd = set((-5.66, (11/(math.sqrt(math.pi))), (5/math.e), -(5/math.e), -4*math.sqrt(2), -7.,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 1, -3, -3, 4, -9, 4, 8}$.\n", - "Output Answer": [ - "$\\frac{5}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 1, -3, -3, 4, -9, 4, 8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 6, 13, 4}$.\n", - "Output Answer": [ - "$\\frac{11856}{1619}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 6, 13, 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{\\sqrt{3}}, 8, -\\frac{7}{e}, 8, 3, 4 \\sqrt{2}, 9}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{3}}, -\\frac{7}{e}, 3, 4 \\sqrt{2}, 8, 8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/(math.sqrt(3))), 8, -(7/math.e), 8, 3, 4*math.sqrt(2), 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.08,0.023,0.037,0.004,0.203,0.1,0.05,0.391,0.093,0.012\\}$ and $\\{0.064,0.135,0.105,0.025,0.087,0.238,0.074,0.028,0.087,0.076\\}$.", - "Output Answer": [ - "$0.94$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.08, 0.023, 0.037, 0.004, 0.203, 0.1, 0.05, 0.391, 0.093, 0.012\ndistribution2 = 0.064, 0.135, 0.105, 0.025, 0.087, 0.238, 0.074, 0.028, 0.087, 0.076\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.174,0.058,0.13,0.201,0.14,0.073,0.032\\}$ and $\\{0.234,0.06,0.105,0.012,0.217,0.004,0.07\\}$.", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.174, 0.058, 0.13, 0.201, 0.14, 0.073, 0.032\ndistribution2 = 0.234, 0.06, 0.105, 0.012, 0.217, 0.004, 0.07\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{5}, \\frac{4}{e}, 5, 2 \\sqrt{5}, -\\frac{1}{3}, 3 \\sqrt{2}, -\\frac{17}{e}, -6, -5 \\sqrt{3}, -5, 7, -9}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), (4/math.e), 5, 2*math.sqrt(5), -(1/3), 3*math.sqrt(2), -(17/math.e), -6, -5*math.sqrt(3), -5, 7, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 2, 9, 3, 4, 0, 9, 5}$.\n", - "Output Answer": [ - "$\\frac{15}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 2, 9, 3, 4, 0, 9, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{16}{\\sqrt{\\pi }}, -2, -6 \\sqrt{2}, 3, 4} \\setminus {-2, 0, \\frac{5}{\\sqrt{\\pi }}, -6 \\sqrt{2}, 3, -\\frac{4}{\\sqrt{\\pi }}, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${4, \\frac{16}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((16/(math.sqrt(math.pi))), -2, -6*math.sqrt(2), 3, 4,))\nsnd = set((-2, 0, (5/(math.sqrt(math.pi))), -6*math.sqrt(2), 3, -(4/(math.sqrt(math.pi))), -3*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{8}{5}, -9}$.", - "Output Answer": [ - "$-\\frac{37}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = (8/5), -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2.62, 1, -3, 6, \\frac{1}{\\pi }, -10, 4, -5} \\setminus {5, -10, \\frac{10}{\\pi }, \\frac{26}{e}, 4}$.\n", - "Output Answer": [ - "${-5, -3, \\frac{1}{\\pi }, 1, 2.62, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((2.62, 1, -3, 6, (1/math.pi), -10, 4, -5,))\nsnd = set((5, -10, (10/math.pi), (26/math.e), 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, -\\frac{8}{\\sqrt{3}}, -2 \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, 3, -\\frac{15}{2}, 5}$.\n", - "Output Answer": [ - "${-\\frac{15}{2}, -7, -\\frac{8}{\\sqrt{3}}, -2 \\sqrt{5}, \\sqrt{5}, 3, 5, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -(8/(math.sqrt(3))), -2*math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), 3, -(15/2), 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-3.94 < 2.1 x-4. < -0.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5].", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(P((-3.94 < 2.1*x-4.) & (2.1*x-4. < -0.9)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^2-0.5 x-2.3$ where $x \\sim $ \\text{PoissonDistribution}[0.6]\n", - "Output Answer": [ - "$-2.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.6)\nprint(E(0.4*x**2-0.5*x-2.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.311,0.081,0.142,0.058,0.017,0.076,0.062,0.115,0.114,0.02\\}$ and $\\{0.043,0.001,0.23,0.146,0.012,0.006,0.319,0.032,0.206,0.003\\}$.", - "Output Answer": [ - "$1.07$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.311, 0.081, 0.142, 0.058, 0.017, 0.076, 0.062, 0.115, 0.114, 0.02\ndistribution2 = 0.043, 0.001, 0.23, 0.146, 0.012, 0.006, 0.319, 0.032, 0.206, 0.003\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.159,0.137,0.206,0.145,0.149,0.109\\}$ and $\\{0.267,0.021,0.069,0.119,0.21,0.151\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.159, 0.137, 0.206, 0.145, 0.149, 0.109\ndistribution2 = 0.267, 0.021, 0.069, 0.119, 0.21, 0.151\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{16}{5}, \\frac{12}{5}, -\\frac{18}{5}, \\frac{31}{5}, \\frac{31}{5}, \\frac{31}{5}, \\frac{31}{5}, \\frac{31}{5}, \\frac{31}{5}, \\frac{31}{5}, \\frac{48}{5}, 4, \\frac{12}{5}, 4, 4, 4, \\frac{12}{5}, \\frac{31}{5}, 4, \\frac{31}{5}, \\frac{31}{5}, \\frac{12}{5}, -\\frac{18}{5}, \\frac{48}{5}, -\\frac{18}{5}, 4, -\\frac{18}{5}, \\frac{12}{5}, \\frac{31}{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{31}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (16/5), (12/5), -(18/5), (31/5), (31/5), (31/5), (31/5), (31/5), (31/5), (31/5), (48/5), 4, (12/5), 4, 4, 4, (12/5), (31/5), 4, (31/5), (31/5), (12/5), -(18/5), (48/5), -(18/5), 4, -(18/5), (12/5), (31/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10, -2, -5, -4} \\setminus {-7, -5, 1, -4, -2, 10}$.\n", - "Output Answer": [ - "${}$" - ], - "Output Program": [ - "fst = set((10, -2, -5, -4,))\nsnd = set((-7, -5, 1, -4, -2, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 11, 7, -7, -3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{434}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 11, 7, -7, -3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x-3.4$ where $x \\sim $ \\text{BetaDistribution}[1.2,1.6]\n", - "Output Answer": [ - "$-4.21$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.2, 1.6)\nprint(E(-1.9*x-3.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 6 \\sqrt{2}, 5, \\frac{7}{\\sqrt{2}}, -10 \\log (2), -\\frac{13}{\\sqrt{\\pi }}, -\\frac{4}{3}, 7, -4 \\sqrt{2}, \\frac{12}{\\pi }, -2 e, 4, 2, \\frac{5}{\\sqrt{2}}, -2 \\pi}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 6*math.sqrt(2), 5, (7/(math.sqrt(2))), -10*math.log(2), -(13/(math.sqrt(math.pi))), -(4/3), 7, -4*math.sqrt(2), (12/math.pi), -2*math.e, 4, 2, (5/(math.sqrt(2))), -2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, \\frac{3}{2}, 9., -\\frac{13}{\\sqrt{2}}, 3 \\pi, 7} \\setminus {2, -3, -\\frac{13}{\\sqrt{2}}, 3 \\pi, -4, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${\\frac{3}{2}, 7, 8, 9.}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, (3/2), 9., -(13/(math.sqrt(2))), 3*math.pi, 7,))\nsnd = set((2, -3, -(13/(math.sqrt(2))), 3*math.pi, -4, -4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.5 x^2-4.4 x+1.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$46.75$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(4.5*x**2-4.4*x+1.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, 1, -8, 3 e, 4, 7}$.\n", - "Output Answer": [ - "${-8, 1, 4, 7, 7, 3 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 1, -8, 3*math.e, 4, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{42}{5}, 3.26, -4, 7, 2 \\sqrt{3}, -2, -3 \\sqrt{5}, -\\frac{11}{\\sqrt{2}}, 2.28} \\cup {-10, 0.31, 3, 2.28, -\\sqrt{5}, 2 \\sqrt{3}, 5 \\sqrt{2}, 7, -\\frac{42}{5}}$.\n", - "Output Answer": [ - "${-10, -\\frac{42}{5}, -\\frac{11}{\\sqrt{2}}, -3 \\sqrt{5}, -4, -\\sqrt{5}, -2, 0.31, 2.28, 3, 3.26, 2 \\sqrt{3}, 7, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(42/5), 3.26, -4, 7, 2*math.sqrt(3), -2, -3*math.sqrt(5), -(11/(math.sqrt(2))), 2.28,))\nsnd = set((-10, 0.31, 3, 2.28, -math.sqrt(5), 2*math.sqrt(3), 5*math.sqrt(2), 7, -(42/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-10, -2, -6, 3, \\frac{7}{2}, 4, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-10, -6, -2, 3, \\frac{7}{2}, 4, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -2, -6, 3, (7/2), 4, 6*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.168,0.079,0.106,0.057,0.141,0.058,0.125,0.146\\}$ and $\\{0.172,0.119,0.013,0.057,0.068,0.167,0.024,0.114\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.168, 0.079, 0.106, 0.057, 0.141, 0.058, 0.125, 0.146\ndistribution2 = 0.172, 0.119, 0.013, 0.057, 0.068, 0.167, 0.024, 0.114\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 6 \\sqrt{2}, -10, \\frac{7}{4}, 10, 1, -\\frac{9}{e}, \\frac{7}{\\sqrt{3}}, 8, -4 \\sqrt{2}, 9, -4, -4}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 6*math.sqrt(2), -10, (7/4), 10, 1, -(9/math.e), (7/(math.sqrt(3))), 8, -4*math.sqrt(2), 9, -4, -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{13}{e}, \\frac{13}{e}, \\frac{13}{e}, \\frac{11}{e}, -\\frac{10}{e}, \\frac{13}{e}, \\frac{13}{e}, \\frac{11}{e}, \\frac{14}{e}, -\\frac{10}{e}, \\frac{20}{e}, \\frac{11}{e}, -\\frac{10}{e}, \\frac{11}{e}, \\frac{13}{e}, \\frac{9}{e}, \\frac{9}{e}, \\frac{20}{e}, \\frac{20}{e}, -\\frac{23}{e}, \\frac{13}{e}, \\frac{20}{e}, \\frac{11}{e}, \\frac{14}{e}, \\frac{13}{e}, \\frac{9}{e}, -\\frac{10}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{13}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (13/math.e), (13/math.e), (13/math.e), (11/math.e), -(10/math.e), (13/math.e), (13/math.e), (11/math.e), (14/math.e), -(10/math.e), (20/math.e), (11/math.e), -(10/math.e), (11/math.e), (13/math.e), (9/math.e), (9/math.e), (20/math.e), (20/math.e), -(23/math.e), (13/math.e), (20/math.e), (11/math.e), (14/math.e), (13/math.e), (9/math.e), -(10/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, \\frac{11}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$2+\\frac{11}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, (11/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7.9, \\sqrt{3}, \\frac{6}{\\pi }, -5, -1, 9, \\frac{7}{\\pi }} \\cup {-1, -9.6, -2 \\sqrt{3}, -\\frac{12}{\\pi }, -5, 9, \\frac{7}{\\pi }}$.\n", - "Output Answer": [ - "${-9.6, -5, -\\frac{12}{\\pi }, -2 \\sqrt{3}, -1, \\sqrt{3}, \\frac{6}{\\pi }, \\frac{7}{\\pi }, 7.9, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.9, math.sqrt(3), (6/math.pi), -5, -1, 9, (7/math.pi),))\nsnd = set((-1, -9.6, -2*math.sqrt(3), -(12/math.pi), -5, 9, (7/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, -11, 10, -12, -15}$.\n", - "Output Answer": [ - "$3 \\sqrt{\\frac{23}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -11, 10, -12, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{e}, -\\frac{2}{\\sqrt{\\pi }}, 8 \\log (2), -9} \\setminus {\\frac{4}{\\sqrt{\\pi }}, -9, 8 \\log (2), 7, \\frac{2}{\\pi }, \\frac{13}{e}, \\frac{24}{e}, 8}$.\n", - "Output Answer": [ - "${-\\frac{2}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/math.e), -(2/(math.sqrt(math.pi))), 8*math.log(2), -9,))\nsnd = set(((4/(math.sqrt(math.pi))), -9, 8*math.log(2), 7, (2/math.pi), (13/math.e), (24/math.e), 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 5, 3, 0, -5, 0, -5, 5, 0, 5, 6, 5, 0, 0, 3, 5, 3, 5, 3, 5, 0, 5, 5, 0, 0}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 5, 3, 0, -5, 0, -5, 5, 0, 5, 6, 5, 0, 0, 3, 5, 3, 5, 3, 5, 0, 5, 5, 0, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 5, \\frac{16}{\\sqrt{\\pi }}, -2, \\frac{5}{e}, 0, 1, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{33}{4}, -2 \\sqrt{3}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, 5, (16/(math.sqrt(math.pi))), -2, (5/math.e), 0, 1, -(4/(math.sqrt(math.pi))), -(33/4), -2*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{5}{3}, -2 \\pi, -2, 10, -\\frac{13}{\\sqrt{3}}, -9, 2} \\cup {-9, -2 \\pi, 2, -\\sqrt{5}, 0, \\frac{5}{3}, -2}$.\n", - "Output Answer": [ - "${-9, -\\frac{13}{\\sqrt{3}}, -2 \\pi, -\\sqrt{5}, -2, 0, \\frac{5}{3}, 2, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((5/3), -2*math.pi, -2, 10, -(13/(math.sqrt(3))), -9, 2,))\nsnd = set((-9, -2*math.pi, 2, -math.sqrt(5), 0, (5/3), -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -3, -4, 10}$.\n", - "Output Answer": [ - "$-\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -3, -4, 10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, 3 \\sqrt{5}, \\sqrt{2}, -1, 4 \\sqrt{3}, -\\frac{11}{7}, -3 \\pi}$.\n", - "Output Answer": [ - "$10+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 3*math.sqrt(5), math.sqrt(2), -1, 4*math.sqrt(3), -(11/7), -3*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -9, 8, -5, 2 \\pi, 0, -\\frac{25}{7}, 1, -8, 7.941, \\frac{26}{e}} \\cup {-\\frac{29}{3}, 8, 9, 7.941, -\\frac{15}{e}, 1, 5, -2 \\pi, -\\frac{25}{7}, -9, 3.361}$.\n", - "Output Answer": [ - "${-\\frac{29}{3}, -9, -8, -2 \\pi, -\\frac{15}{e}, -5, -\\frac{25}{7}, 0, 1, 3.361, 5, 2 \\pi, 7.941, 8, 9, \\frac{26}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -9, 8, -5, 2*math.pi, 0, -(25/7), 1, -8, 7.941, (26/math.e),))\nsnd = set((-(29/3), 8, 9, 7.941, -(15/math.e), 1, 5, -2*math.pi, -(25/7), -9, 3.361,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-14 \\log (2), -6}$.\n", - "Output Answer": [ - "${-14 \\log (2), -6}$" - ], - "Output Program": [ - "import math\n\nvalues = -14*math.log(2), -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{19}{2}, 5.043, 0, 10} \\setminus {1, -6, 5.043, 2 \\log (2), 0, -1}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(19/2), 5.043, 0, 10,))\nsnd = set((1, -6, 5.043, 2*math.log(2), 0, -1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${343, 7, 81}$.\n", - "Output Answer": [ - "$21 \\sqrt[3]{21}$" - ], - "Output Program": [ - "import math\n\nvalues = 343, 7, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{5}{e}, \\frac{9}{e}, \\frac{9}{e}, -\\frac{24}{e}, -\\frac{1}{e}, -\\frac{1}{e}, -\\frac{5}{e}, \\frac{9}{e}, \\frac{9}{e}, -\\frac{24}{e}, -\\frac{24}{e}, \\frac{26}{e}, \\frac{26}{e}, -\\frac{24}{e}, -\\frac{24}{e}, -\\frac{1}{e}, \\frac{9}{e}, -\\frac{24}{e}, \\frac{26}{e}, \\frac{9}{e}, \\frac{26}{e}, -\\frac{24}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{24}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(5/math.e), (9/math.e), (9/math.e), -(24/math.e), -(1/math.e), -(1/math.e), -(5/math.e), (9/math.e), (9/math.e), -(24/math.e), -(24/math.e), (26/math.e), (26/math.e), -(24/math.e), -(24/math.e), -(1/math.e), (9/math.e), -(24/math.e), (26/math.e), (9/math.e), (26/math.e), -(24/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{11}{2}, 3, 0, -8, -\\frac{19}{\\pi }, 5, -\\frac{5}{\\sqrt{3}}, 4}$.", - "Output Answer": [ - "$-\\frac{5}{2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(11/2), 3, 0, -8, -(19/math.pi), 5, -(5/(math.sqrt(3))), 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${46656, 64, 1, -216, 4, -7}$.\n", - "Output Answer": [ - "$12\\ 2^{5/6} \\sqrt{3} \\sqrt[6]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 46656, 64, 1, -216, 4, -7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, -5, 3, 7, 15, -15}$.\n", - "Output Answer": [ - "$\\frac{1594}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -5, 3, 7, 15, -15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{11}{3}, 8, 6, 2, -6 \\log (2), 5, 14 \\log (2), 3 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, \\frac{14}{\\sqrt{\\pi }}, -9}$.\n", - "Output Answer": [ - "$9+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/3), 8, 6, 2, -6*math.log(2), 5, 14*math.log(2), 3*math.sqrt(2), -(7/(math.sqrt(2))), (14/(math.sqrt(math.pi))), -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -6, \\frac{14}{\\sqrt{3}}, -1, 6 \\sqrt{2}, 10, 4, -4, -2 \\sqrt{2}, -4, -\\frac{17}{2}, -2 \\pi, -2 \\pi, 7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-4-2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -6, (14/(math.sqrt(3))), -1, 6*math.sqrt(2), 10, 4, -4, -2*math.sqrt(2), -4, -(17/2), -2*math.pi, -2*math.pi, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -3, -6, -\\frac{1}{\\pi }, 7, 3, -3 e, -\\frac{9}{2}, -1, -8, \\frac{13}{e}, -2 \\sqrt{2}, -7}$.\n", - "Output Answer": [ - "$7+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -3, -6, -(1/math.pi), 7, 3, -3*math.e, -(9/2), -1, -8, (13/math.e), -2*math.sqrt(2), -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, 1, -\\frac{18}{5}, -8, 7, -1, -3 \\pi, -\\frac{8}{e}, 1, 1, \\frac{14}{\\sqrt{3}}, \\frac{22}{5}, 4, \\frac{6}{5}, 2}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, 1, -(18/5), -8, 7, -1, -3*math.pi, -(8/math.e), 1, 1, (14/(math.sqrt(3))), (22/5), 4, (6/5), 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, \\sqrt{5}, -5, \\frac{13}{e}, 3, 4, 0} \\setminus {3, \\frac{13}{e}, -\\frac{1}{2}, 9, 0}$.\n", - "Output Answer": [ - "${-5, -1, \\sqrt{5}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, math.sqrt(5), -5, (13/math.e), 3, 4, 0,))\nsnd = set((3, (13/math.e), -(1/2), 9, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, 13, 12, 13, 6, 7}$.\n", - "Output Answer": [ - "$\\frac{267}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 13, 12, 13, 6, 7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{26}{3}, -e, -1, \\frac{36}{5}, 7, -4 e, -5, 0}$.\n", - "Output Answer": [ - "$\\frac{36}{5}+4 e$" - ], - "Output Program": [ - "import math\n\nvalues = -(26/3), -math.e, -1, (36/5), 7, -4*math.e, -5, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 7, -3 e, 0, -6, 1, 2, 9, e, \\frac{12}{5}, -e, 7, \\frac{3}{2}, -\\pi, 0}$.\n", - "Output Answer": [ - "$9+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 7, -3*math.e, 0, -6, 1, 2, 9, math.e, (12/5), -math.e, 7, (3/2), -math.pi, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{44}{5}, -\\frac{12}{5}, -10, -\\frac{21}{5}, -\\frac{36}{5}}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (44/5), -(12/5), -10, -(21/5), -(36/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4 \\sqrt{2}, 9.4, -\\frac{4}{\\sqrt{5}}, -e, 7}$.\n", - "Output Answer": [ - "${-e, -\\frac{4}{\\sqrt{5}}, 4 \\sqrt{2}, 7, 9.4}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(2), 9.4, -(4/(math.sqrt(5))), -math.e, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-5, 625, 32768, -1, 16, 262144}$.\n", - "Output Answer": [ - "$64 \\sqrt[6]{2} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 625, 32768, -1, 16, 262144\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\sqrt{3}, 0, -3 \\sqrt{3}, 0, -3 \\sqrt{3}, 0, 5 \\sqrt{3}, -4 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, 5 \\sqrt{3}, -\\sqrt{3}, -3 \\sqrt{3}, -\\sqrt{3}, 0, -3 \\sqrt{3}, 0, -3 \\sqrt{3}, 0, 2 \\sqrt{3}, -4 \\sqrt{3}, 5 \\sqrt{3}, -4 \\sqrt{3}, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{3},0\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.sqrt(3), 0, -3*math.sqrt(3), 0, -3*math.sqrt(3), 0, 5*math.sqrt(3), -4*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), 5*math.sqrt(3), -math.sqrt(3), -3*math.sqrt(3), -math.sqrt(3), 0, -3*math.sqrt(3), 0, -3*math.sqrt(3), 0, 2*math.sqrt(3), -4*math.sqrt(3), 5*math.sqrt(3), -4*math.sqrt(3), 2*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{15}{\\pi }, \\frac{25}{\\pi }, -\\frac{31}{\\pi }, \\frac{27}{\\pi }, \\frac{31}{\\pi }, -\\frac{31}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{6}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (15/math.pi), (25/math.pi), -(31/math.pi), (27/math.pi), (31/math.pi), -(31/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{9}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{7}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(1/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), -(9/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{13}{\\sqrt{3}}, -\\sqrt{2}, -1, 6, 10, 5 \\sqrt{3}, -6}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(13/(math.sqrt(3))), -math.sqrt(2), -1, 6, 10, 5*math.sqrt(3), -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, \\frac{33}{5}, -3, \\frac{36}{5}, -\\frac{6}{5}, -2, -\\frac{6}{5}, -2, -2, -2, -\\frac{6}{5}, -2, -2, \\frac{36}{5}, -2, \\frac{36}{5}, -\\frac{6}{5}, -2, -\\frac{6}{5}, -2, -3, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, (33/5), -3, (36/5), -(6/5), -2, -(6/5), -2, -2, -2, -(6/5), -2, -2, (36/5), -2, (36/5), -(6/5), -2, -(6/5), -2, -3, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${6, 1, -9, 1}$.\n", - "Output Answer": [ - "$\\frac{475}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 1, -9, 1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.215,0.135,0.037,0.089,0.08,0.08,0.106,0.181\\}$ and $\\{0.138,0.086,0.115,0.254,0.065,0.146,0.06,0.041\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.215, 0.135, 0.037, 0.089, 0.08, 0.08, 0.106, 0.181\ndistribution2 = 0.138, 0.086, 0.115, 0.254, 0.065, 0.146, 0.06, 0.041\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, -9.915, 7, \\sqrt{3}, 7, 0, -5 \\sqrt{2}, \\frac{9}{\\pi }}$.\n", - "Output Answer": [ - "${-9.915, -5 \\sqrt{2}, -5, 0, \\sqrt{3}, \\frac{9}{\\pi }, 7, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -9.915, 7, math.sqrt(3), 7, 0, -5*math.sqrt(2), (9/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, 10, -12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{367}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 10, -12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{50}{3}, 3}$.\n", - "Output Answer": [ - "$\\frac{300}{59}$" - ], - "Output Program": [ - "import statistics\nvalues = (50/3), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, 10, -7, 10, -10, 10, -6, -7, 9, 10, -6, -7, -10, 9, -10, -7, 9, -6, -5, -6, 10, -6, -6, -7, -5, -10, 10}$.\n", - "Output Answer": [ - "$\\{10,-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, 10, -7, 10, -10, 10, -6, -7, 9, 10, -6, -7, -10, 9, -10, -7, 9, -6, -5, -6, 10, -6, -6, -7, -5, -10, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -3, 1, 3, 1, 0, -3, -6, -6, -6, 1, 0, -3, -3, 4, 3, -3, -6, 3, 4, -3}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -3, 1, 3, 1, 0, -3, -6, -6, -6, 1, 0, -3, -3, 4, 3, -3, -6, 3, 4, -3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x^3-1.3 x^2+1.8 x-1.4$ where $x \\sim $ \\text{NormalDistribution}[-0.2,1.7]\n", - "Output Answer": [ - "$-7.31$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.2, 1.7)\nprint(E(1.*x**3-1.3*x**2+1.8*x-1.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, 8, -9, -8}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 8, -9, -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^2+2.2 x+2.4$ where $x \\sim $ \\text{PoissonDistribution}[3.9]\n", - "Output Answer": [ - "$35.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.9)\nprint(E(1.3*x**2+2.2*x+2.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 7, 2, 5, 7, 7, -1, 6, 5, 7, 2, 5, -1, 7, 6, 2, -1, -1, 6, 5, 5, 5, 6}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 7, 2, 5, 7, 7, -1, 6, 5, 7, 2, 5, -1, 7, 6, 2, -1, -1, 6, 5, 5, 5, 6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{7}{\\sqrt{3}}, -10, -2 \\sqrt{5}, -14 \\log (2), -6, 10, 3, -5 \\log (2), -1.66} \\cup {-2 \\sqrt{5}, -10, -14 \\log (2), 6, -1, 10, -5 \\log (2), -\\frac{14}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-10, -14 \\log (2), -\\frac{14}{\\sqrt{3}}, -6, -2 \\sqrt{5}, -5 \\log (2), -1.66, -1, 3, \\frac{7}{\\sqrt{3}}, 6, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/(math.sqrt(3))), -10, -2*math.sqrt(5), -14*math.log(2), -6, 10, 3, -5*math.log(2), -1.66,))\nsnd = set((-2*math.sqrt(5), -10, -14*math.log(2), 6, -1, 10, -5*math.log(2), -(14/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7 \\sqrt{2}, -6 \\sqrt{2}, 3 \\sqrt{2}, -7 \\sqrt{2}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{11 \\sqrt{2}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -7*math.sqrt(2), -6*math.sqrt(2), 3*math.sqrt(2), -7*math.sqrt(2), 6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, 3, -\\frac{40}{7}, -1, -0.299, 3, \\frac{46}{7}, -\\frac{17}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{\\pi }}, -\\frac{40}{7}, -1, -0.299, 3, 3, 3, \\frac{46}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 3, -(40/7), -1, -0.299, 3, (46/7), -(17/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, \\frac{26}{\\pi }, -10, -4, -9, 3, 8, 6, -7} \\cup {2, 1, -10, 8, 3, -9, \\frac{4}{\\sqrt{3}}, \\frac{24}{\\pi }}$.\n", - "Output Answer": [ - "${-10, -9, -7, -4, -1, 1, 2, \\frac{4}{\\sqrt{3}}, 3, 6, \\frac{24}{\\pi }, 8, \\frac{26}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, (26/math.pi), -10, -4, -9, 3, 8, 6, -7,))\nsnd = set((2, 1, -10, 8, 3, -9, (4/(math.sqrt(3))), (24/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{9}{\\sqrt{2}}, -\\sqrt{2}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{1}{3} \\left(-\\frac{9}{\\sqrt{2}}-7 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(9/(math.sqrt(2))), -math.sqrt(2), -6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 6, 10, -8, \\frac{20}{3}, 3 e, \\frac{18}{e}, -4, -3, -5, -7, \\sqrt{5}, 1}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 6, 10, -8, (20/3), 3*math.e, (18/math.e), -4, -3, -5, -7, math.sqrt(5), 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.586,0.131,0.199\\}$ and $\\{0.317,0.273,0.039\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.586, 0.131, 0.199\ndistribution2 = 0.317, 0.273, 0.039\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, \\frac{37}{3}, 9}$.\n", - "Output Answer": [ - "$\\frac{18981}{1549}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, (37/3), 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.6 x^2+1.4 x+4.$ where $x \\sim $ \\text{NormalDistribution}[0.1,1.1]\n", - "Output Answer": [ - "$2.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.1, 1.1)\nprint(E(-1.6*x**2+1.4*x+4.))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9.3, 0, 4, -10, -2 \\sqrt{5}, -3} \\setminus {-3 \\sqrt{3}, 0, 7, -6, -10, 9.3, -5, -2}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, -3, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((9.3, 0, 4, -10, -2*math.sqrt(5), -3,))\nsnd = set((-3*math.sqrt(3), 0, 7, -6, -10, 9.3, -5, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -7, 0, -6, -2, 6, -\\frac{7}{\\sqrt{3}}, 5, \\frac{16}{\\pi }}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, -7, 0, -6, -2, 6, -(7/(math.sqrt(3))), 5, (16/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -5 \\sqrt{2}, -7, 6} \\setminus {-6, -1, 2, -5 \\sqrt{2}, -9, -\\frac{29}{\\pi }}$.\n", - "Output Answer": [ - "${-7, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -5*math.sqrt(2), -7, 6,))\nsnd = set((-6, -1, 2, -5*math.sqrt(2), -9, -(29/math.pi),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, \\frac{16}{\\sqrt{3}}, -6, 0, -\\frac{3}{2}, -7} \\cup {-4.269, -7, -\\frac{3}{2}, 0}$.\n", - "Output Answer": [ - "${-7, -6, -4.269, -4, -\\frac{3}{2}, 0, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, (16/(math.sqrt(3))), -6, 0, -(3/2), -7,))\nsnd = set((-4.269, -7, -(3/2), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{2}, \\frac{37}{2}, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{9435}{1798}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/2), (37/2), (17/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${6 \\log (2), -13 \\log (2), 4 \\log (2), -2 \\log (2)} \\cap {-2 \\log (2), -13 \\log (2), -6 \\log (2), 8 \\log (2)}$.\n", - "Output Answer": [ - "${-13 \\log (2), -2 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((6*math.log(2), -13*math.log(2), 4*math.log(2), -2*math.log(2),))\nsnd = set((-2*math.log(2), -13*math.log(2), -6*math.log(2), 8*math.log(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 8, -9, -5, 0, -9, -\\frac{42}{5}, 5, -8, 2, 0}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "values = 0, 8, -9, -5, 0, -9, -(42/5), 5, -8, 2, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{\\pi }, 4, 0, -2, 0, 6, 8, \\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\pi }, -2, 0, 0, \\frac{5}{\\sqrt{2}}, 4, 6, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/math.pi), 4, 0, -2, 0, 6, 8, (5/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.178,0.027,0.061,0.108,0.164,0.025,0.229,0.041\\}$ and $\\{0.203,0.088,0.207,0.04,0.095,0.034,0.08,0.149\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.178, 0.027, 0.061, 0.108, 0.164, 0.025, 0.229, 0.041\ndistribution2 = 0.203, 0.088, 0.207, 0.04, 0.095, 0.034, 0.08, 0.149\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{7}{2}, -3, -\\frac{7}{2}, -\\frac{1}{2}, -\\frac{7}{2}, -3, \\frac{13}{2}, -\\frac{7}{2}, \\frac{7}{2}, \\frac{15}{2}, \\frac{15}{2}, -\\frac{7}{2}, -\\frac{7}{2}, \\frac{7}{2}, \\frac{7}{2}, -3, -\\frac{7}{2}, \\frac{13}{2}, \\frac{15}{2}, -3, -\\frac{7}{2}, -\\frac{1}{2}, \\frac{13}{2}, -3, \\frac{13}{2}, \\frac{13}{2}, \\frac{7}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{7}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(7/2), -3, -(7/2), -(1/2), -(7/2), -3, (13/2), -(7/2), (7/2), (15/2), (15/2), -(7/2), -(7/2), (7/2), (7/2), -3, -(7/2), (13/2), (15/2), -3, -(7/2), -(1/2), (13/2), -3, (13/2), (13/2), (7/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, \\frac{8}{5}, 5}$.\n", - "Output Answer": [ - "${0, \\frac{8}{5}, 5}$" - ], - "Output Program": [ - "values = 0, (8/5), 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 256, 100, 243, 49}$.\n", - "Output Answer": [ - "$12\\ 3^{4/5} 35^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 256, 100, 243, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{38}{5}, \\frac{11}{5}, \\frac{18}{5}, -6, \\frac{29}{5}, \\frac{47}{5}, \\frac{23}{5}}$.\n", - "Output Answer": [ - "$\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(38/5), (11/5), (18/5), -6, (29/5), (47/5), (23/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.183,0.027,0.31,0.062,0.032,0.048,0.184,0.082,0.005\\}$ and $\\{0.029,0.087,0.225,0.182,0.149,0.04,0.093,0.089,0.014\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.183, 0.027, 0.31, 0.062, 0.032, 0.048, 0.184, 0.082, 0.005\ndistribution2 = 0.029, 0.087, 0.225, 0.182, 0.149, 0.04, 0.093, 0.089, 0.014\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2.01, 0.168, 8.4, 4, -3, -\\frac{1}{\\sqrt{2}}, 6, -\\sqrt{2}, -2 \\sqrt{5}, -9} \\cup {8.4, 5, -2 \\sqrt{5}, 0.168, -\\frac{13}{\\sqrt{2}}, 4, 6, -6, \\frac{20}{7}, 4 \\sqrt{2}, -2.01}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -9, -6, -2 \\sqrt{5}, -3, -2.01, -\\sqrt{2}, -\\frac{1}{\\sqrt{2}}, 0.168, \\frac{20}{7}, 4, 5, 4 \\sqrt{2}, 6, 8.4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2.01, 0.168, 8.4, 4, -3, -(1/(math.sqrt(2))), 6, -math.sqrt(2), -2*math.sqrt(5), -9,))\nsnd = set((8.4, 5, -2*math.sqrt(5), 0.168, -(13/(math.sqrt(2))), 4, 6, -6, (20/7), 4*math.sqrt(2), -2.01,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.032,0.221,0.142,0.133,0.046,0.096,0.214\\}$ and $\\{0.127,0.202,0.073,0.106,0.049,0.3,0.023\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.032, 0.221, 0.142, 0.133, 0.046, 0.096, 0.214\ndistribution2 = 0.127, 0.202, 0.073, 0.106, 0.049, 0.3, 0.023\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{3}, 11, 18, 12}$.\n", - "Output Answer": [ - "$\\frac{36432}{3281}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/3), 11, 18, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, -243, 10, 343, -6}$.\n", - "Output Answer": [ - "$3 \\sqrt[5]{-5} 2^{2/5} 21^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -243, 10, 343, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{17}{\\sqrt{\\pi }}, \\frac{22}{\\pi }, 2 \\sqrt{3}, -\\frac{7}{\\sqrt{5}}, -4 \\sqrt{2}, -\\frac{7}{\\pi }, 0}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -\\frac{7}{\\sqrt{5}}, -\\frac{7}{\\pi }, 0, 2 \\sqrt{3}, \\frac{22}{\\pi }, \\frac{17}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (17/(math.sqrt(math.pi))), (22/math.pi), 2*math.sqrt(3), -(7/(math.sqrt(5))), -4*math.sqrt(2), -(7/math.pi), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.231,0.573,0.004\\}$ and $\\{0.116,0.156,0.418\\}$.", - "Output Answer": [ - "$0.94$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.231, 0.573, 0.004\ndistribution2 = 0.116, 0.156, 0.418\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, 9, -\\frac{21}{\\pi }, 5, 0, 0}$.\n", - "Output Answer": [ - "$9+\\frac{21}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 9, -(21/math.pi), 5, 0, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-e, -1, 9, 0, -\\frac{13}{3}, \\frac{3}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, 2 \\sqrt{5}, 1} \\cup {4, 5, \\frac{13}{\\sqrt{2}}, -8, 0, \\frac{3}{\\sqrt{2}}, 2}$.\n", - "Output Answer": [ - "${-8, -\\frac{13}{3}, -e, -1, 0, 1, 2, \\frac{3}{\\sqrt{2}}, 4, 2 \\sqrt{5}, 5, \\frac{11}{\\sqrt{2}}, 9, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.e, -1, 9, 0, -(13/3), (3/(math.sqrt(2))), (11/(math.sqrt(2))), 2*math.sqrt(5), 1,))\nsnd = set((4, 5, (13/(math.sqrt(2))), -8, 0, (3/(math.sqrt(2))), 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 256, 49, 1}$.\n", - "Output Answer": [ - "$36 \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 256, 49, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${256, -1, -243, 100, -2}$.\n", - "Output Answer": [ - "$12 \\sqrt[5]{-2} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 256, -1, -243, 100, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{3}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{\\pi }}, -\\frac{6}{\\sqrt{\\pi }}, -\\frac{6}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{14}{3 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(3/(math.sqrt(math.pi))), (11/(math.sqrt(math.pi))), -(6/(math.sqrt(math.pi))), -(6/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.5 x^2+2.5 x+0.2$ where $x \\sim $ \\text{BetaDistribution}[1.8,0.2]\n", - "Output Answer": [ - "$6.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.8, 0.2)\nprint(E(4.5*x**2+2.5*x+0.2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${0, 2 \\pi, 3 \\pi, \\pi, -3 \\pi, -\\pi} \\cap {-\\pi, -2 \\pi, -3 \\pi, \\pi, 3 \\pi, 0}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\pi, 0, \\pi, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 2*math.pi, 3*math.pi, math.pi, -3*math.pi, -math.pi,))\nsnd = set((-math.pi, -2*math.pi, -3*math.pi, math.pi, 3*math.pi, 0,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.8 x-1.2$ where $x \\sim $ \\text{BetaDistribution}[1.7,0.7]\n", - "Output Answer": [ - "$-3.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 0.7)\nprint(E(-2.8*x-1.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{7}{\\sqrt{3}}, \\frac{13}{7}, -3 \\sqrt{3}, 6, -2, -2 \\sqrt{5}, 9, 6, -2, 6, -\\frac{50}{7}, -1, -8, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$9+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/(math.sqrt(3))), (13/7), -3*math.sqrt(3), 6, -2, -2*math.sqrt(5), 9, 6, -2, 6, -(50/7), -1, -8, -4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 1, 256, 81, -1}$.\n", - "Output Answer": [ - "$2\\ 2^{3/5} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 1, 256, 81, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{5}, -\\frac{37}{5}, -\\frac{2}{\\sqrt{5}}, 14 \\log (2), 9}$.", - "Output Answer": [ - "$3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(5), -(37/5), -(2/(math.sqrt(5))), 14*math.log(2), 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 6, 14, 16}$.\n", - "Output Answer": [ - "$\\frac{4032}{415}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 6, 14, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6.5, -\\frac{15}{2}, -5, -3, -3 \\sqrt{3}, -7.2} \\cup {-\\frac{15}{2}, -9.5, 6.5, -5, -\\frac{7}{2}, 8, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9.5, -\\frac{15}{2}, -7.2, -3 \\sqrt{3}, -5, -\\frac{7}{2}, -3, 6.5, 4 \\sqrt{3}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.5, -(15/2), -5, -3, -3*math.sqrt(3), -7.2,))\nsnd = set((-(15/2), -9.5, 6.5, -5, -(7/2), 8, 4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3 \\sqrt{3}, -\\frac{10}{3}, \\frac{8}{e}, -9, \\sqrt{5}, 7, -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-9, -\\frac{10}{3}, -\\frac{3}{\\sqrt{2}}, \\sqrt{5}, \\frac{8}{e}, 3 \\sqrt{3}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(3), -(10/3), (8/math.e), -9, math.sqrt(5), 7, -(3/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.017,0.043,0.05,0.068,0.167,0.02,0.227,0.236\\}$ and $\\{0.201,0.091,0.098,0.177,0.105,0.083,0.161,0.074\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.017, 0.043, 0.05, 0.068, 0.167, 0.02, 0.227, 0.236\ndistribution2 = 0.201, 0.091, 0.098, 0.177, 0.105, 0.083, 0.161, 0.074\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.08,0.239,0.091,0.026,0.193,0.034,0.125,0.174,0.019\\}$ and $\\{0.101,0.11,0.121,0.041,0.016,0.201,0.135,0.198,0.019\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.08, 0.239, 0.091, 0.026, 0.193, 0.034, 0.125, 0.174, 0.019\ndistribution2 = 0.101, 0.11, 0.121, 0.041, 0.016, 0.201, 0.135, 0.198, 0.019\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-343, 81, 7}$.\n", - "Output Answer": [ - "$21 \\sqrt[3]{-21}$" - ], - "Output Program": [ - "import math\n\nvalues = -343, 81, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $1.6 x^2+3. x-2.4 < 1.5 x+0.1$ where $x \\sim $ \\text{PoissonDistribution}[0.8].", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.8)\nprint(P((1.6*x**2+3.*x-2.4 < 1.5*x+0.1)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.265,0.204,0.101,0.119\\}$ and $\\{0.102,0.137,0.255,0.155\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.265, 0.204, 0.101, 0.119\ndistribution2 = 0.102, 0.137, 0.255, 0.155\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -10, -5 \\sqrt{3}, -8, -5, -6} \\setminus {-10, -5 \\sqrt{3}, -4, -5}$.\n", - "Output Answer": [ - "${-9, -8, -6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -10, -5*math.sqrt(3), -8, -5, -6,))\nsnd = set((-10, -5*math.sqrt(3), -4, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x+0.8$ where $x \\sim $ \\text{NormalDistribution}[-1.9,2.9]\n", - "Output Answer": [ - "$-4.33$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.9, 2.9)\nprint(E(2.7*x+0.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\pi, \\frac{17}{e}, -1, -7.23, -4} \\setminus {-1, -7.23, -7, -\\pi, -4, -13 \\log (2)}$.\n", - "Output Answer": [ - "${\\pi, \\frac{17}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, (17/math.e), -1, -7.23, -4,))\nsnd = set((-1, -7.23, -7, -math.pi, -4, -13*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, 8.68, 4, 1, -0.145, 0} \\setminus {0, 1, -0.145, 8.68, 10}$.\n", - "Output Answer": [ - "${3, 4}$" - ], - "Output Program": [ - "fst = set((3, 8.68, 4, 1, -0.145, 0,))\nsnd = set((0, 1, -0.145, 8.68, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x^3-4.5 x^2-3.7 x+2.$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$158.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(2.6*x**3-4.5*x**2-3.7*x+2.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -3, -3, -3, -2, -2, 8, 3, 8, 8, -3, -3, 3, -3, -2, 3, -3, -2, 3, 3, 3, 3, 8, -3, -2, -3, 8}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -3, -3, -3, -2, -2, 8, 3, 8, 8, -3, -3, 3, -3, -2, 3, -3, -2, 3, 3, 3, 3, 8, -3, -2, -3, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -\\frac{18}{\\sqrt{\\pi }}, 0, -9, -\\frac{17}{e}, \\frac{9}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-7-\\frac{17}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, -(18/(math.sqrt(math.pi))), 0, -9, -(17/math.e), (9/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{3}, -\\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, 2 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -2 \\sqrt{3}, 2 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, 2 \\sqrt{3}, -2 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, 2 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(3), -math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), 2*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -2*math.sqrt(3), 2*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), 2*math.sqrt(3), -2*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), 2*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), -5*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.15 < -3. x^2+3.2 x+1.2 < 1.31$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9].", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(P((-0.15 < -3.*x**2+3.2*x+1.2) & (-3.*x**2+3.2*x+1.2 < 1.31)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, 9, 625, 2401}$.\n", - "Output Answer": [ - "$35 \\sqrt[4]{-1} \\sqrt{3} 10^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, 9, 625, 2401\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, \\frac{12}{\\sqrt{5}}, -4}$.\n", - "Output Answer": [ - "${-9, -4, \\frac{12}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, (12/(math.sqrt(5))), -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, -10, 8, -13}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{633}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -10, 8, -13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, 8, 4, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{67}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 8, 4, -2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 16807, -1, 4096, 117649, -243}$.\n", - "Output Answer": [ - "$84 \\sqrt{3} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 16807, -1, 4096, 117649, -243\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 1, -6}$.\n", - "Output Answer": [ - "$\\sqrt[3]{-6} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 1, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.5 x-1.1$ where $x \\sim $ \\text{BetaDistribution}[1.2,1.7]\n", - "Output Answer": [ - "$0.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.2, 1.7)\nprint(E(4.5*x-1.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{19}{2}, 9}$.\n", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "values = (19/2), 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{\\sqrt{\\pi }}, -4, 9, 2 \\sqrt{2}, \\frac{5}{3}, 0, 8 \\log (2)}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/(math.sqrt(math.pi))), -4, 9, 2*math.sqrt(2), (5/3), 0, 8*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.6 x-0.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$-0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(-2.6*x-0.1))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9.04, 5, -3 \\sqrt{5}, -7, 9, 1, e} \\cup {9.04, 3 \\sqrt{5}, 9, -2, 1, 5}$.\n", - "Output Answer": [ - "${-7, -3 \\sqrt{5}, -2, 1, e, 5, 3 \\sqrt{5}, 9, 9.04}$" - ], - "Output Program": [ - "import math\n\nfst = set((9.04, 5, -3*math.sqrt(5), -7, 9, 1, math.e,))\nsnd = set((9.04, 3*math.sqrt(5), 9, -2, 1, 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 \\sqrt{3}, 5 \\sqrt{3}, 2 \\sqrt{3}, 5 \\sqrt{3}, 2 \\sqrt{3}, -3 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, 5 \\sqrt{3}, -3 \\sqrt{3}, 4 \\sqrt{3}, -3 \\sqrt{3}, -3 \\sqrt{3}, -4 \\sqrt{3}, 4 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, -4 \\sqrt{3}, 4 \\sqrt{3}, -3 \\sqrt{3}, 2 \\sqrt{3}, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{5 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.sqrt(3), 5*math.sqrt(3), 2*math.sqrt(3), 5*math.sqrt(3), 2*math.sqrt(3), -3*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), 5*math.sqrt(3), -3*math.sqrt(3), 4*math.sqrt(3), -3*math.sqrt(3), -3*math.sqrt(3), -4*math.sqrt(3), 4*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), -4*math.sqrt(3), 4*math.sqrt(3), -3*math.sqrt(3), 2*math.sqrt(3), -3*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, 2, 2 \\pi, 0, -7, -3, -\\frac{1}{\\sqrt{\\pi }}, -2 \\pi}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, -3, -\\frac{1}{\\sqrt{\\pi }}, 0, 2, 4, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 2, 2*math.pi, 0, -7, -3, -(1/(math.sqrt(math.pi))), -2*math.pi\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.4 x^2+4.5 x+4.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.3]\n", - "Output Answer": [ - "$-77.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.3)\nprint(E(-4.4*x**2+4.5*x+4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${625, 531441, -1000, 117649, -343, 5}$.\n", - "Output Answer": [ - "$315 \\sqrt[3]{5} \\sqrt{14}$" - ], - "Output Program": [ - "import math\n\nvalues = 625, 531441, -1000, 117649, -343, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -\\frac{26}{3}, \\frac{18}{\\pi }, -\\frac{14}{\\sqrt{5}}, \\frac{7}{\\sqrt{3}}, 1}$.\n", - "Output Answer": [ - "$10+\\frac{18}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -(26/3), (18/math.pi), -(14/(math.sqrt(5))), (7/(math.sqrt(3))), 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, 8, 5, 15}$.\n", - "Output Answer": [ - "$\\frac{278}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 8, 5, 15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\log (2), -8, -\\pi, -7, \\pi, 9.73, -3} \\setminus {-2 \\log (2), 9.73, -7, 0, -8}$.\n", - "Output Answer": [ - "${-\\pi, -3, \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.log(2), -8, -math.pi, -7, math.pi, 9.73, -3,))\nsnd = set((-2*math.log(2), 9.73, -7, 0, -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, -5, -7}$.\n", - "Output Answer": [ - "$\\frac{7}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -5, -7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.4 x^2-0.7 x+2.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$-0.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(-4.4*x**2-0.7*x+2.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${8, 6, -2, \\frac{31}{7}, -\\frac{9}{e}, 9, \\frac{11}{e}, -5, -9}$.", - "Output Answer": [ - "$\\frac{11}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 6, -2, (31/7), -(9/math.e), 9, (11/math.e), -5, -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{e}, \\sqrt{5}, \\frac{4}{e}, -1, -6, 3, -4 \\sqrt{3}, \\frac{14}{\\sqrt{5}}, -\\frac{5}{\\sqrt{3}}, 4, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}+\\frac{14}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/math.e), math.sqrt(5), (4/math.e), -1, -6, 3, -4*math.sqrt(3), (14/(math.sqrt(5))), -(5/(math.sqrt(3))), 4, -math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 11, 19}$.\n", - "Output Answer": [ - "$\\frac{7524}{569}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 11, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{3}{\\sqrt{2}}, -\\sqrt{2}, \\sqrt{2}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, 4 \\sqrt{2}, 4 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, 4 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, \\sqrt{2}, -\\sqrt{2}, \\frac{7}{\\sqrt{2}}, 4 \\sqrt{2}, \\sqrt{2}, 4 \\sqrt{2}, \\sqrt{2}, -\\sqrt{2}, \\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{7}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(3/(math.sqrt(2))), -math.sqrt(2), math.sqrt(2), (7/(math.sqrt(2))), (7/(math.sqrt(2))), -(3/(math.sqrt(2))), 4*math.sqrt(2), 4*math.sqrt(2), (7/(math.sqrt(2))), (7/(math.sqrt(2))), 4*math.sqrt(2), (7/(math.sqrt(2))), (7/(math.sqrt(2))), math.sqrt(2), -(3/(math.sqrt(2))), math.sqrt(2), -math.sqrt(2), (7/(math.sqrt(2))), 4*math.sqrt(2), math.sqrt(2), 4*math.sqrt(2), math.sqrt(2), -math.sqrt(2), (7/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, \\frac{7}{2}, 5, -\\frac{7}{2}, 5, 4, -\\frac{7}{2}, 4, 8, 4, 8, \\frac{9}{2}, 4, -\\frac{7}{2}, -\\frac{7}{2}, 5, -\\frac{7}{2}, 4, -\\frac{7}{2}, 4, 4, \\frac{7}{2}, 5, 4, \\frac{7}{2}, \\frac{7}{2}}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, (7/2), 5, -(7/2), 5, 4, -(7/2), 4, 8, 4, 8, (9/2), 4, -(7/2), -(7/2), 5, -(7/2), 4, -(7/2), 4, 4, (7/2), 5, 4, (7/2), (7/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\pi, e}$.", - "Output Answer": [ - "$\\frac{1}{2} (e-2 \\pi )$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.pi, math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 7, 5}$.\n", - "Output Answer": [ - "$\\sqrt[3]{5} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 7, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{24}{e}, -9, 7} \\setminus {-\\frac{24}{e}, -7, -1, 7, \\frac{16}{\\sqrt{3}}, 5}$.\n", - "Output Answer": [ - "${-9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(24/math.e), -9, 7,))\nsnd = set((-(24/math.e), -7, -1, 7, (16/(math.sqrt(3))), 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, 4, -10, -13, -5}$.\n", - "Output Answer": [ - "$\\frac{513}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 4, -10, -13, -5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, -10, 10, -e, -\\frac{2}{\\sqrt{\\pi }}, 3, 2, -\\frac{13}{\\sqrt{5}}, -3, -7, -10, -\\frac{51}{7}, -10}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, -10, 10, -math.e, -(2/(math.sqrt(math.pi))), 3, 2, -(13/(math.sqrt(5))), -3, -7, -10, -(51/7), -10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.012,0.055,0.463,0.082,0.138,0.002,0.074,0.072,0.027\\}$ and $\\{0.053,0.086,0.047,0.043,0.14,0.25,0.055,0.057,0.187\\}$.", - "Output Answer": [ - "$1.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.012, 0.055, 0.463, 0.082, 0.138, 0.002, 0.074, 0.072, 0.027\ndistribution2 = 0.053, 0.086, 0.047, 0.043, 0.14, 0.25, 0.055, 0.057, 0.187\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, 1, 6 \\sqrt{2}, -\\frac{16}{\\sqrt{\\pi }}, -9}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -9, -3, 1, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 1, 6*math.sqrt(2), -(16/(math.sqrt(math.pi))), -9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${e, \\sqrt{2}, -7, -\\frac{20}{e}} \\cup {\\sqrt{2}, 4 e, -\\frac{20}{e}}$.\n", - "Output Answer": [ - "${-\\frac{20}{e}, -7, \\sqrt{2}, e, 4 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.e, math.sqrt(2), -7, -(20/math.e),))\nsnd = set((math.sqrt(2), 4*math.e, -(20/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, -\\frac{8}{5}, -\\frac{8}{5}, -\\frac{8}{5}, 7, 7, -\\frac{47}{5}, \\frac{3}{5}, 7, -\\frac{47}{5}, \\frac{3}{5}, -\\frac{8}{5}, -\\frac{8}{5}, 7, -\\frac{8}{5}, -\\frac{47}{5}, -\\frac{8}{5}, -\\frac{47}{5}, \\frac{3}{5}, 7}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{8}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, -(8/5), -(8/5), -(8/5), 7, 7, -(47/5), (3/5), 7, -(47/5), (3/5), -(8/5), -(8/5), 7, -(8/5), -(47/5), -(8/5), -(47/5), (3/5), 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${e, -e, -e, 2 e, -3 e}$.\n", - "Output Answer": [ - "$-\\frac{2 e}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.e, -math.e, -math.e, 2*math.e, -3*math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{25}{3}, 15, \\frac{5}{3}}$.\n", - "Output Answer": [ - "$\\frac{225}{59}$" - ], - "Output Program": [ - "import statistics\nvalues = (25/3), 15, (5/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{7}{\\sqrt{5}}, -3 \\sqrt{5}, -3 \\sqrt{5}, 4 \\sqrt{5}, \\frac{9}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, 4 \\sqrt{5}, -3 \\sqrt{5}, \\frac{11}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -3 \\sqrt{5}, -3 \\sqrt{5}, \\frac{4}{\\sqrt{5}}, 4 \\sqrt{5}, -3 \\sqrt{5}, 4 \\sqrt{5}, \\frac{4}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{5},\\frac{4}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (7/(math.sqrt(5))), -3*math.sqrt(5), -3*math.sqrt(5), 4*math.sqrt(5), (9/(math.sqrt(5))), (4/(math.sqrt(5))), 4*math.sqrt(5), -3*math.sqrt(5), (11/(math.sqrt(5))), (4/(math.sqrt(5))), (11/(math.sqrt(5))), (11/(math.sqrt(5))), -3*math.sqrt(5), -3*math.sqrt(5), (4/(math.sqrt(5))), 4*math.sqrt(5), -3*math.sqrt(5), 4*math.sqrt(5), (4/(math.sqrt(5))), (4/(math.sqrt(5))), (4/(math.sqrt(5))), (9/(math.sqrt(5))), (7/(math.sqrt(5))), 4*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 11, -9, -13, -3, 15}$.\n", - "Output Answer": [ - "$9 \\sqrt{\\frac{3}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 11, -9, -13, -3, 15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, 5, 10, -\\frac{5}{2}, 4, -\\frac{3}{2}, -\\frac{11}{2}, -1, \\frac{19}{2}, 7, \\frac{5}{2}} \\cap {-8, -\\frac{11}{2}, -6, -3, \\frac{5}{2}, -4, \\frac{9}{2}, 7, 5, -1, -\\frac{1}{2}, -\\frac{19}{2}, -\\frac{17}{2}, 1}$.\n", - "Output Answer": [ - "${-8, -\\frac{11}{2}, -1, \\frac{5}{2}, 5, 7}$" - ], - "Output Program": [ - "fst = set((-8, 5, 10, -(5/2), 4, -(3/2), -(11/2), -1, (19/2), 7, (5/2),))\nsnd = set((-8, -(11/2), -6, -3, (5/2), -4, (9/2), 7, 5, -1, -(1/2), -(19/2), -(17/2), 1,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-1.12 < 1.6 x+2.2 < 0.51$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.5].", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.5)\nprint(P((-1.12 < 1.6*x+2.2) & (1.6*x+2.2 < 0.51)))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${9, -\\frac{7}{2}, \\frac{19}{2}, -\\frac{1}{2}, -\\frac{11}{2}, \\frac{31}{4}} \\cap {-8, 9, \\frac{31}{4}, \\frac{7}{4}, \\frac{15}{2}}$.\n", - "Output Answer": [ - "${\\frac{31}{4}, 9}$" - ], - "Output Program": [ - "fst = set((9, -(7/2), (19/2), -(1/2), -(11/2), (31/4),))\nsnd = set((-8, 9, (31/4), (7/4), (15/2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, 7, -8, -10, \\frac{13}{\\sqrt{\\pi }}, 4 \\sqrt{3}, 7, \\frac{26}{5}, \\frac{10}{\\sqrt{\\pi }}, 6 \\log (2), 7}$.\n", - "Output Answer": [ - "$10+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 7, -8, -10, (13/(math.sqrt(math.pi))), 4*math.sqrt(3), 7, (26/5), (10/(math.sqrt(math.pi))), 6*math.log(2), 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, \\frac{7}{\\pi }, \\frac{7}{\\pi }, 3, -4 \\sqrt{5}, -5, -4 \\sqrt{5}, -10, -1}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 9, (7/math.pi), (7/math.pi), 3, -4*math.sqrt(5), -5, -4*math.sqrt(5), -10, -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{3}{4}, 1, \\frac{19}{2}}$.\n", - "Output Answer": [ - "${-\\frac{3}{4}, 1, \\frac{19}{2}}$" - ], - "Output Program": [ - "values = -(3/4), 1, (19/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 6, 4}$.\n", - "Output Answer": [ - "$\\frac{11}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 6, 4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, e, -2 e}$.\n", - "Output Answer": [ - "$-\\frac{e}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, math.e, -2*math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{2}, -3 \\sqrt{2}, -6 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, 4 \\sqrt{2}, -6 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, 4 \\sqrt{2}, -6 \\sqrt{2}, 3 \\sqrt{2}, -3 \\sqrt{2}, -6 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, 3 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(2), -3*math.sqrt(2), -6*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), 4*math.sqrt(2), -6*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), 4*math.sqrt(2), -6*math.sqrt(2), 3*math.sqrt(2), -3*math.sqrt(2), -6*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), 3*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, -1, -10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{133}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -1, -10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, 8, -\\frac{9}{e}, 8, -9, 4 \\sqrt{5}, -\\frac{20}{\\pi }, 6}$.\n", - "Output Answer": [ - "${-9, -\\frac{20}{\\pi }, -\\frac{9}{e}, 0, 6, 8, 8, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 8, -(9/math.e), 8, -9, 4*math.sqrt(5), -(20/math.pi), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -3, \\frac{9}{e}, -6, 0, 2, 9, -10 \\log (2), 2, -1, -\\frac{4}{7}, 1, -e}$.", - "Output Answer": [ - "$-\\frac{4}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -3, (9/math.e), -6, 0, 2, 9, -10*math.log(2), 2, -1, -(4/7), 1, -math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{6}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, 3 \\sqrt{5}, \\frac{6}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{12}{\\sqrt{5}}, 3 \\sqrt{5}, 3 \\sqrt{5}, -\\frac{8}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, 3 \\sqrt{5}, \\frac{17}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, 3 \\sqrt{5}, \\frac{6}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{6}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (6/(math.sqrt(5))), (22/(math.sqrt(5))), 3*math.sqrt(5), (6/(math.sqrt(5))), (22/(math.sqrt(5))), -(8/(math.sqrt(5))), -(8/(math.sqrt(5))), (6/(math.sqrt(5))), (22/(math.sqrt(5))), (17/(math.sqrt(5))), (6/(math.sqrt(5))), (6/(math.sqrt(5))), 3*math.sqrt(5), -(12/(math.sqrt(5))), 3*math.sqrt(5), 3*math.sqrt(5), -(8/(math.sqrt(5))), (17/(math.sqrt(5))), -(12/(math.sqrt(5))), 3*math.sqrt(5), (17/(math.sqrt(5))), (17/(math.sqrt(5))), (22/(math.sqrt(5))), (6/(math.sqrt(5))), 3*math.sqrt(5), (6/(math.sqrt(5))), (17/(math.sqrt(5))), -(12/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${10, 6.2, 5, 1, 8}$.\n", - "Output Answer": [ - "${1, 5, 6.2, 8, 10}$" - ], - "Output Program": [ - "values = 10, 6.2, 5, 1, 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{5}{2}, 0, \\frac{18}{7}, -2, 8, -4, 0, -9, \\frac{10}{\\sqrt{3}}, 10, 0, 0, 4 \\log (2), 12 \\log (2)}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/2), 0, (18/7), -2, 8, -4, 0, -9, (10/(math.sqrt(3))), 10, 0, 0, 4*math.log(2), 12*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, 6 \\log (2), -6, -\\frac{19}{2}, -\\frac{21}{4}, -\\sqrt{5}, 4, -2, -8, -5}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-5-\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, 6*math.log(2), -6, -(19/2), -(21/4), -math.sqrt(5), 4, -2, -8, -5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0.709, \\frac{9}{\\sqrt{2}}, -\\frac{20}{3}}$.\n", - "Output Answer": [ - "${-\\frac{20}{3}, 0.709, \\frac{9}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0.709, (9/(math.sqrt(2))), -(20/3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 1000, 1024, 6, 1000000, 1024}$.\n", - "Output Answer": [ - "$160 \\sqrt[6]{-3} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 1000, 1024, 6, 1000000, 1024\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{7}{4}, -2 e, 2, -9, 6, -3, -\\frac{17}{\\sqrt{3}}, 0}$.", - "Output Answer": [ - "$-\\frac{19}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(7/4), -2*math.e, 2, -9, 6, -3, -(17/(math.sqrt(3))), 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -2, 4, -\\frac{11}{5}, \\frac{13}{\\sqrt{2}}, -0.5, 6} \\cup {\\frac{13}{\\sqrt{2}}, 4, -7.4, -8, 6, 0}$.\n", - "Output Answer": [ - "${-8, -7.4, -\\frac{11}{5}, -2, -0.5, 0, 4, 6, 9, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -2, 4, -(11/5), (13/(math.sqrt(2))), -0.5, 6,))\nsnd = set(((13/(math.sqrt(2))), 4, -7.4, -8, 6, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -\\log (2), 0} \\setminus {-5, 8.37, 0, -2 \\sqrt{5}, -8, -\\frac{18}{5}}$.\n", - "Output Answer": [ - "${-\\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -math.log(2), 0,))\nsnd = set((-5, 8.37, 0, -2*math.sqrt(5), -8, -(18/5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -4, -10, -2}$.\n", - "Output Answer": [ - "$-\\frac{21}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -4, -10, -2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{3}{2}, 2, 8, 5} \\setminus {4, \\frac{8}{\\sqrt{3}}, -9, \\frac{18}{7}}$.\n", - "Output Answer": [ - "${-\\frac{3}{2}, 2, 5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(3/2), 2, 8, 5,))\nsnd = set((4, (8/(math.sqrt(3))), -9, (18/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, 0, -\\sqrt{5}, -2 \\sqrt{5}, 4 \\sqrt{5}, -2 \\sqrt{5}, 0, 0, -2 \\sqrt{5}, 0, -2 \\sqrt{5}, 0, -4 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-2 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), 0, -math.sqrt(5), -2*math.sqrt(5), 4*math.sqrt(5), -2*math.sqrt(5), 0, 0, -2*math.sqrt(5), 0, -2*math.sqrt(5), 0, -4*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{2}, 3 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, -3 \\sqrt{2}, 2 \\sqrt{2}, -3 \\sqrt{2}, 2 \\sqrt{2}, 3 \\sqrt{2}, -3 \\sqrt{2}, \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, 3 \\sqrt{2}, 2 \\sqrt{2}, \\sqrt{2}, -3 \\sqrt{2}, \\sqrt{2}, -3 \\sqrt{2}, 3 \\sqrt{2}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(2), 3*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), math.sqrt(2), math.sqrt(2), -3*math.sqrt(2), 2*math.sqrt(2), -3*math.sqrt(2), 2*math.sqrt(2), 3*math.sqrt(2), -3*math.sqrt(2), math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), 3*math.sqrt(2), 2*math.sqrt(2), math.sqrt(2), -3*math.sqrt(2), math.sqrt(2), -3*math.sqrt(2), 3*math.sqrt(2), -3*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -13, 1, -8, 12, -4}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{442}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -13, 1, -8, 12, -4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.5 x^2+4. x+2.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.]\n", - "Output Answer": [ - "$30.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(E(3.5*x**2+4.*x+2.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x^2-1.1 x+3.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$18.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(2.2*x**2-1.1*x+3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.2 x^2+4.7 x+1.7$ where $x \\sim $ \\text{NormalDistribution}[-0.4,1.6]\n", - "Output Answer": [ - "$-11.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.4, 1.6)\nprint(E(-4.2*x**2+4.7*x+1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, 13 \\log (2), \\frac{22}{\\pi }, 5, -\\frac{3}{\\sqrt{2}}, \\frac{33}{4}, 4 \\sqrt{5}, -\\frac{11}{4}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(5+\\frac{22}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 13*math.log(2), (22/math.pi), 5, -(3/(math.sqrt(2))), (33/4), 4*math.sqrt(5), -(11/4)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3.5, -7, 4, 5, -\\frac{3}{\\sqrt{2}}, 5 \\sqrt{3}, 3 \\sqrt{2}, -6.6, 2} \\cup {5 \\sqrt{3}, 4, -3.5, 0, 3 \\sqrt{2}, 1}$.\n", - "Output Answer": [ - "${-7, -6.6, -3.5, -\\frac{3}{\\sqrt{2}}, 0, 1, 2, 4, 3 \\sqrt{2}, 5, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3.5, -7, 4, 5, -(3/(math.sqrt(2))), 5*math.sqrt(3), 3*math.sqrt(2), -6.6, 2,))\nsnd = set((5*math.sqrt(3), 4, -3.5, 0, 3*math.sqrt(2), 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, -9, -\\pi, 10, -\\frac{14}{\\pi }, 2, \\frac{8}{\\sqrt{\\pi }}, -\\frac{7}{5}}$.", - "Output Answer": [ - "$\\frac{3}{10}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -9, -math.pi, 10, -(14/math.pi), 2, (8/(math.sqrt(math.pi))), -(7/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6, 2, -3, 5.52, -\\frac{1}{e}, -\\frac{4}{\\pi }, 8, 5 \\log (2)} \\cup {-4, -6, \\frac{4}{\\sqrt{3}}, 2, -\\frac{4}{\\pi }, 8, -3, 5 \\log (2)}$.\n", - "Output Answer": [ - "${-6, -4, -3, -\\frac{4}{\\pi }, -\\frac{1}{e}, 2, \\frac{4}{\\sqrt{3}}, 5 \\log (2), 5.52, 6, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 2, -3, 5.52, -(1/math.e), -(4/math.pi), 8, 5*math.log(2),))\nsnd = set((-4, -6, (4/(math.sqrt(3))), 2, -(4/math.pi), 8, -3, 5*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.2,0.139,0.074,0.052,0.121,0.169,0.177\\}$ and $\\{0.243,0.195,0.134,0.118,0.071,0.053,0.102\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.2, 0.139, 0.074, 0.052, 0.121, 0.169, 0.177\ndistribution2 = 0.243, 0.195, 0.134, 0.118, 0.071, 0.053, 0.102\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, 81, -2, 7}$.\n", - "Output Answer": [ - "$6\\ 2^{3/4} \\sqrt[4]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, 81, -2, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, \\frac{29}{4}, -2 \\sqrt{3}, \\frac{46}{5}, 3}$.\n", - "Output Answer": [ - "${-2 \\sqrt{3}, 3, 5, \\frac{29}{4}, \\frac{46}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, (29/4), -2*math.sqrt(3), (46/5), 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, 10, 4}$.\n", - "Output Answer": [ - "$20 \\sqrt[3]{-5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, 10, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -3, -7}$.\n", - "Output Answer": [ - "$-\\frac{14}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -3, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.342,0.173,0.312\\}$ and $\\{0.291,0.336,0.163\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.342, 0.173, 0.312\ndistribution2 = 0.291, 0.336, 0.163\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x+1.$ where $x \\sim $ \\text{BetaDistribution}[0.8,0.3]\n", - "Output Answer": [ - "$4.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 0.3)\nprint(E(4.4*x+1.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{58}{3}, \\frac{41}{3}, 19}$.\n", - "Output Answer": [ - "$\\frac{135546}{8021}$" - ], - "Output Program": [ - "import statistics\nvalues = (58/3), (41/3), 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.7 x-1.9$ where $x \\sim $ \\text{PoissonDistribution}[3.]\n", - "Output Answer": [ - "$-16.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.)\nprint(E(-4.7*x-1.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4.562, -\\sqrt{3}, -5 \\sqrt{3}, 10, \\frac{16}{3}, -3, -6, 8, -3 \\sqrt{3}, 9} \\cup {-\\frac{17}{2}, -3, -5 \\sqrt{3}, 9, -4.562, 0.78, -9, -4, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -\\frac{17}{2}, -6, -3 \\sqrt{3}, -4.562, -4, -2 \\sqrt{3}, -3, -\\sqrt{3}, 0.78, \\frac{16}{3}, 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4.562, -math.sqrt(3), -5*math.sqrt(3), 10, (16/3), -3, -6, 8, -3*math.sqrt(3), 9,))\nsnd = set((-(17/2), -3, -5*math.sqrt(3), 9, -4.562, 0.78, -9, -4, -2*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 81, 1, 27}$.\n", - "Output Answer": [ - "$3\\ 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 81, 1, 27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -9, 5, 10}$.\n", - "Output Answer": [ - "$-\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -9, 5, 10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5.04, \\frac{18}{e}, -1} \\cup {-4, -5.04, 6, \\frac{18}{e}}$.\n", - "Output Answer": [ - "${-5.04, -4, -1, 6, \\frac{18}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.04, (18/math.e), -1,))\nsnd = set((-4, -5.04, 6, (18/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\sqrt{2}, -\\frac{16}{e}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$4 \\sqrt{5}+\\frac{16}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(2), -(16/math.e), 4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -3, -12 \\log (2), -7, -\\frac{13}{e}, -e, \\frac{10}{\\sqrt{\\pi }}, -5 \\sqrt{3}, \\frac{31}{7}, -e}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-3-\\frac{13}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, -3, -12*math.log(2), -7, -(13/math.e), -math.e, (10/(math.sqrt(math.pi))), -5*math.sqrt(3), (31/7), -math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{44}{7}, 2, 4 \\sqrt{2}, -\\sqrt{3}, \\frac{18}{e}, 3, -\\frac{1}{5}} \\setminus {\\frac{44}{7}, 4 \\sqrt{2}, -\\sqrt{3}, 2, -2}$.\n", - "Output Answer": [ - "${-\\frac{1}{5}, 3, \\frac{18}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((44/7), 2, 4*math.sqrt(2), -math.sqrt(3), (18/math.e), 3, -(1/5),))\nsnd = set(((44/7), 4*math.sqrt(2), -math.sqrt(3), 2, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -3 \\sqrt{5}, 5, \\frac{6}{e}, 4 \\sqrt{3}, \\frac{17}{7}} \\setminus {3, 2 \\sqrt{5}, 0, \\frac{17}{7}, 4 \\sqrt{3}, -\\frac{19}{e}, -5}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, \\frac{6}{e}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -3*math.sqrt(5), 5, (6/math.e), 4*math.sqrt(3), (17/7),))\nsnd = set((3, 2*math.sqrt(5), 0, (17/7), 4*math.sqrt(3), -(19/math.e), -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\sqrt{5}, \\frac{10}{e}, -9, -6, 8, 6} \\setminus {6, -\\sqrt{5}, \\frac{10}{e}, 1, -\\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-9, -6, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(5), (10/math.e), -9, -6, 8, 6,))\nsnd = set((6, -math.sqrt(5), (10/math.e), 1, -(7/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $1.93 < -0.8 x^2+3.5 x+3.6 < 6.95$ where $x \\sim $ \\text{PoissonDistribution}[2.9].", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.9)\nprint(P((1.93 < -0.8*x**2+3.5*x+3.6) & (-0.8*x**2+3.5*x+3.6 < 6.95)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{22}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{18}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{18}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{18}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, 3 \\sqrt{5}, 3 \\sqrt{5}, -\\frac{18}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{18}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(22/(math.sqrt(5))), (3/(math.sqrt(5))), -(18/(math.sqrt(5))), (3/(math.sqrt(5))), -(22/(math.sqrt(5))), -(18/(math.sqrt(5))), -(18/(math.sqrt(5))), 3*math.sqrt(5), -(18/(math.sqrt(5))), -(22/(math.sqrt(5))), 3*math.sqrt(5), -(18/(math.sqrt(5))), -(18/(math.sqrt(5))), (3/(math.sqrt(5))), -(18/(math.sqrt(5))), (3/(math.sqrt(5))), 3*math.sqrt(5), -(18/(math.sqrt(5))), (3/(math.sqrt(5))), -(18/(math.sqrt(5))), (3/(math.sqrt(5))), 3*math.sqrt(5), 3*math.sqrt(5), -(18/(math.sqrt(5))), -(13/(math.sqrt(5))), -(22/(math.sqrt(5))), (3/(math.sqrt(5))), -(22/(math.sqrt(5))), (3/(math.sqrt(5))), -(13/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, 0, \\sqrt{5}, \\sqrt{5}, 0, -2 \\sqrt{5}, 0, -2 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, 0, \\sqrt{5}, -2 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, -2 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), 0, math.sqrt(5), math.sqrt(5), 0, -2*math.sqrt(5), 0, -2*math.sqrt(5), math.sqrt(5), math.sqrt(5), 0, math.sqrt(5), -2*math.sqrt(5), math.sqrt(5), math.sqrt(5), math.sqrt(5), -2*math.sqrt(5), math.sqrt(5), math.sqrt(5), math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, 0, -11, 0, -4}$.\n", - "Output Answer": [ - "$\\frac{223}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, 0, -11, 0, -4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-343, 64, -7, -8}$.\n", - "Output Answer": [ - "$28 \\sqrt[4]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = -343, 64, -7, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 13, 2, 19}$.\n", - "Output Answer": [ - "$\\frac{5928}{1427}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 13, 2, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 0, 8, 1, 8, -4, -8, 3}$.\n", - "Output Answer": [ - "$\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 0, 8, 1, 8, -4, -8, 3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{\\sqrt{5}}, 4, -10, 9, -6, -3, -\\frac{7}{e}, 6, -8, -5}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = (11/(math.sqrt(5))), 4, -10, 9, -6, -3, -(7/math.e), 6, -8, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 9, 1, 6, 2}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 9, 1, 6, 2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{19}{2}, 6, -\\sqrt{3}, -7, \\frac{11}{2}, 6, 9}$.\n", - "Output Answer": [ - "${-7, -\\sqrt{3}, \\frac{11}{2}, 6, 6, 9, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = (19/2), 6, -math.sqrt(3), -7, (11/2), 6, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 14, \\frac{3}{2}, 17}$.\n", - "Output Answer": [ - "$\\frac{357}{86}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 14, (3/2), 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{14}{e}, -\\frac{9}{\\pi }, 1, \\frac{22}{e}, -8, -\\frac{1}{4}, -3, 4, -5, -4 \\sqrt{5}, -\\frac{24}{\\pi }, -1, 0}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (14/math.e), -(9/math.pi), 1, (22/math.e), -8, -(1/4), -3, 4, -5, -4*math.sqrt(5), -(24/math.pi), -1, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -10, -\\pi, \\frac{2}{5}, \\frac{4}{\\sqrt{3}}, 8, -3 \\sqrt{2}, -1} \\cup {\\frac{2}{\\sqrt{3}}, 0, -3 \\sqrt{2}, -5, -2 \\pi, -6, -1, \\frac{2}{5}, 8}$.\n", - "Output Answer": [ - "${-10, -2 \\pi, -6, -5, -3 \\sqrt{2}, -\\pi, -1, 0, \\frac{2}{5}, \\frac{2}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -10, -math.pi, (2/5), (4/(math.sqrt(3))), 8, -3*math.sqrt(2), -1,))\nsnd = set(((2/(math.sqrt(3))), 0, -3*math.sqrt(2), -5, -2*math.pi, -6, -1, (2/5), 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, -1, 7, -5, 9}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{46}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -1, 7, -5, 9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.139,0.057,0.172,0.253,0.048\\}$ and $\\{0.245,0.313,0.146,0.139,0.071\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.139, 0.057, 0.172, 0.253, 0.048\ndistribution2 = 0.245, 0.313, 0.146, 0.139, 0.071\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, -\\frac{17}{\\sqrt{\\pi }}, -2, 9, -2 e, -6, -3, 2} \\setminus {5, -6, -3, -2 e}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{\\pi }}, -2, 2, 3, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -(17/(math.sqrt(math.pi))), -2, 9, -2*math.e, -6, -3, 2,))\nsnd = set((5, -6, -3, -2*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{19}{3}, 7.342}$.\n", - "Output Answer": [ - "${\\frac{19}{3}, 7.342}$" - ], - "Output Program": [ - "values = (19/3), 7.342\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3.85, 4 \\sqrt{3}, 7} \\cup {-\\frac{11}{\\sqrt{3}}, -3.85, 7}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{3}}, -3.85, 4 \\sqrt{3}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3.85, 4*math.sqrt(3), 7,))\nsnd = set((-(11/(math.sqrt(3))), -3.85, 7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.344,0.046,0.024,0.064,0.09,0.087,0.059,0.238\\}$ and $\\{0.137,0.124,0.046,0.151,0.172,0.133,0.088,0.086\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.344, 0.046, 0.024, 0.064, 0.09, 0.087, 0.059, 0.238\ndistribution2 = 0.137, 0.124, 0.046, 0.151, 0.172, 0.133, 0.088, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{e}, -\\frac{4}{e}, -\\frac{4}{e}, -\\frac{16}{e}, \\frac{12}{e}, -\\frac{26}{e}, -\\frac{26}{e}, -\\frac{8}{e}, \\frac{10}{e}, -\\frac{8}{e}, \\frac{10}{e}, \\frac{12}{e}, \\frac{10}{e}, -\\frac{26}{e}, -\\frac{26}{e}, -\\frac{4}{e}, -\\frac{4}{e}, \\frac{23}{e}, \\frac{23}{e}, -\\frac{26}{e}, -\\frac{8}{e}, \\frac{23}{e}, -\\frac{26}{e}, -\\frac{16}{e}, -\\frac{16}{e}, \\frac{10}{e}, -\\frac{16}{e}, \\frac{23}{e}, -\\frac{8}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{26}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(16/math.e), -(4/math.e), -(4/math.e), -(16/math.e), (12/math.e), -(26/math.e), -(26/math.e), -(8/math.e), (10/math.e), -(8/math.e), (10/math.e), (12/math.e), (10/math.e), -(26/math.e), -(26/math.e), -(4/math.e), -(4/math.e), (23/math.e), (23/math.e), -(26/math.e), -(8/math.e), (23/math.e), -(26/math.e), -(16/math.e), -(16/math.e), (10/math.e), -(16/math.e), (23/math.e), -(8/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 0, 3, -6, 8, 6, 8, -6}$.\n", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 0, 3, -6, 8, 6, 8, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x-3.2$ where $x \\sim $ \\text{NormalDistribution}[-1.8,1.3]\n", - "Output Answer": [ - "$-9.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 1.3)\nprint(E(3.3*x-3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, -4, 0, -14, 8, -8}$.\n", - "Output Answer": [ - "$\\frac{599}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -4, 0, -14, 8, -8\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{12}{5}, 7, 7, 5, -8, -3 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{13}{10}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(12/5), 7, 7, 5, -8, -3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5.04, \\frac{3}{\\sqrt{2}}, 0, -5 \\sqrt{3}, -3 \\sqrt{3}, 6, 2}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -3 \\sqrt{3}, 0, 2, \\frac{3}{\\sqrt{2}}, 5.04, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 5.04, (3/(math.sqrt(2))), 0, -5*math.sqrt(3), -3*math.sqrt(3), 6, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 10, \\frac{31}{2}, \\frac{35}{2}}$.\n", - "Output Answer": [ - "$\\frac{164920}{11309}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 10, (31/2), (35/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.108,0.191,0.017,0.074,0.01,0.088,0.106,0.257\\}$ and $\\{0.093,0.117,0.004,0.128,0.142,0.067,0.151,0.052,0.084\\}$.", - "Output Answer": [ - "$0.88$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.108, 0.191, 0.017, 0.074, 0.01, 0.088, 0.106, 0.257\ndistribution2 = 0.093, 0.117, 0.004, 0.128, 0.142, 0.067, 0.151, 0.052, 0.084\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6, 6 \\log (2), -\\frac{27}{7}, -\\frac{20}{3}, -9, 5, -3 e}$.\n", - "Output Answer": [ - "${-9, -3 e, -\\frac{20}{3}, -6, -\\frac{27}{7}, 6 \\log (2), 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 6*math.log(2), -(27/7), -(20/3), -9, 5, -3*math.e\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 5, 0, \\frac{14}{e}, 2} \\setminus {2, \\frac{14}{e}, -1, -\\frac{37}{5}, 0, -2}$.\n", - "Output Answer": [ - "${5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 5, 0, (14/math.e), 2,))\nsnd = set((2, (14/math.e), -1, -(37/5), 0, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x-0.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5]\n", - "Output Answer": [ - "$-0.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(E(0.2*x-0.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{54}{7}, \\frac{48}{7}, \\frac{50}{7}}$.\n", - "Output Answer": [ - "$\\frac{152}{21}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (54/7), (48/7), (50/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{17}{e}, -8, 8, -7, \\frac{11}{3}, 0, -9 \\log (2)} \\setminus {-8, \\frac{11}{3}, 2, \\frac{23}{e}, 5}$.\n", - "Output Answer": [ - "${-7, -9 \\log (2), 0, \\frac{17}{e}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set(((17/math.e), -8, 8, -7, (11/3), 0, -9*math.log(2),))\nsnd = set((-8, (11/3), 2, (23/math.e), 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 81, 625, 256, 343, 625}$.\n", - "Output Answer": [ - "$20\\ 3^{2/3} \\sqrt{7} \\sqrt[3]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 81, 625, 256, 343, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 2, -4, 8, 5, -4}$.\n", - "Output Answer": [ - "$-\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 2, -4, 8, 5, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -2, -8, -3, -2, -2, 1, -3, -3, -2, 5, 5, -3, -3, 5, 5, -2, -8, -3, 5, -8, -2, 4, -8, 1, 1, 4, 1, 5}$.\n", - "Output Answer": [ - "$\\{-2,-3,5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -2, -8, -3, -2, -2, 1, -3, -3, -2, 5, 5, -3, -3, 5, 5, -2, -8, -3, 5, -8, -2, 4, -8, 1, 1, 4, 1, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 0, 5, 10, 5, 10, 10, 0, 9, -7, 10, 5, 5, 10, 5, -7, 0, 9, 5, 0, 0, -7, 10, 10}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 0, 5, 10, 5, 10, 10, 0, 9, -7, 10, 5, 5, 10, 5, -7, 0, 9, 5, 0, 0, -7, 10, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x+2.5$ where $x \\sim $ \\text{PoissonDistribution}[3.4]\n", - "Output Answer": [ - "$10.32$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.4)\nprint(E(2.3*x+2.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 0, e, 2 e, 4 e, 0, 2 e}$.\n", - "Output Answer": [ - "$\\frac{9 e}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, 0, math.e, 2*math.e, 4*math.e, 0, 2*math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.089,0.069,0.132,0.075,0.055,0.087,0.038,0.24,0.056\\}$ and $\\{0.066,0.094,0.078,0.096,0.106,0.018,0.155,0.151,0.167\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.089, 0.069, 0.132, 0.075, 0.055, 0.087, 0.038, 0.24, 0.056\ndistribution2 = 0.066, 0.094, 0.078, 0.096, 0.106, 0.018, 0.155, 0.151, 0.167\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.23,0.027,0.191,0.065,0.146,0.081,0.011,0.132,0.099\\}$ and $\\{0.023,0.139,0.043,0.068,0.076,0.098,0.274,0.065,0.189\\}$.", - "Output Answer": [ - "$0.85$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.23, 0.027, 0.191, 0.065, 0.146, 0.081, 0.011, 0.132, 0.099\ndistribution2 = 0.023, 0.139, 0.043, 0.068, 0.076, 0.098, 0.274, 0.065, 0.189\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${27, -6, 64, 1000}$.\n", - "Output Answer": [ - "$(12+12 i) 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 27, -6, 64, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{5}, \\frac{14}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{14}{\\sqrt{5}}-\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(5), (14/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.305,0.047,0.417\\}$ and $\\{0.196,0.218,0.503\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.305, 0.047, 0.417\ndistribution2 = 0.196, 0.218, 0.503\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, -4, -7, -7, 11}$.\n", - "Output Answer": [ - "$\\frac{286}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -4, -7, -7, 11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, -13, 10}$.\n", - "Output Answer": [ - "$\\frac{23}{\\sqrt{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -13, 10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{54}{7}, \\frac{2}{7}}$.\n", - "Output Answer": [ - "$-\\frac{26}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(54/7), (2/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.121,0.088,0.19,0.198,0.013,0.078,0.043,0.087,0.082,0.061\\}$ and $\\{0.014,0.105,0.014,0.088,0.106,0.106,0.184,0.095,0.171,0.069\\}$.", - "Output Answer": [ - "$0.73$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.121, 0.088, 0.19, 0.198, 0.013, 0.078, 0.043, 0.087, 0.082, 0.061\ndistribution2 = 0.014, 0.105, 0.014, 0.088, 0.106, 0.106, 0.184, 0.095, 0.171, 0.069\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, 1000, 64}$.\n", - "Output Answer": [ - "$40 \\sqrt[3]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 1000, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{19}{4}, \\frac{17}{\\sqrt{3}}, 8, 4 \\sqrt{5}, \\frac{5}{7}, -3, -\\frac{19}{\\sqrt{5}}, -5 \\sqrt{3}, -\\frac{4}{3}, 6, -3 e}$.", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(19/4), (17/(math.sqrt(3))), 8, 4*math.sqrt(5), (5/7), -3, -(19/(math.sqrt(5))), -5*math.sqrt(3), -(4/3), 6, -3*math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, -4, 6, 4 \\sqrt{5}, 1, \\frac{18}{\\sqrt{5}}, -7, \\sqrt{5}} \\setminus {-2 e, 9, 2 \\sqrt{5}, -2}$.\n", - "Output Answer": [ - "${-7, -4, 1, \\sqrt{5}, 5, 6, \\frac{18}{\\sqrt{5}}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -4, 6, 4*math.sqrt(5), 1, (18/(math.sqrt(5))), -7, math.sqrt(5),))\nsnd = set((-2*math.e, 9, 2*math.sqrt(5), -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 0, 5} \\cup {5, -1, 6}$.\n", - "Output Answer": [ - "${-1, 0, 5, 6}$" - ], - "Output Program": [ - "fst = set((-1, 0, 5,))\nsnd = set((5, -1, 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -\\frac{17}{\\sqrt{\\pi }}, 4, 8, -1, -3 \\sqrt{2}, 5, -1, \\frac{6}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$8+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -(17/(math.sqrt(math.pi))), 4, 8, -1, -3*math.sqrt(2), 5, -1, (6/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.206,0.342,0.135,0.212\\}$ and $\\{0.165,0.247,0.252,0.18\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.206, 0.342, 0.135, 0.212\ndistribution2 = 0.165, 0.247, 0.252, 0.18\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, 5 \\sqrt{2}, -9, 3, 0, 1} \\setminus {-1, -\\frac{13}{\\sqrt{3}}, 3, -3, -7, -2}$.\n", - "Output Answer": [ - "${-9, 0, 1, 7, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 5*math.sqrt(2), -9, 3, 0, 1,))\nsnd = set((-1, -(13/(math.sqrt(3))), 3, -3, -7, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{20}{e}, 6}$.\n", - "Output Answer": [ - "${6, \\frac{20}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = (20/math.e), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{27}{e}, -1, -10, 1, \\frac{16}{7}, 0, 8.6} \\cup {-\\frac{27}{e}, 1, -3, 8.6, -10}$.\n", - "Output Answer": [ - "${-10, -\\frac{27}{e}, -3, -1, 0, 1, \\frac{16}{7}, 8.6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(27/math.e), -1, -10, 1, (16/7), 0, 8.6,))\nsnd = set((-(27/math.e), 1, -3, 8.6, -10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.7 x-4.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-4.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-3.7*x-4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 4, 6, 3, 1, 1, 6, 3, 6, 1, 4, 6, 4, 1, 4, 4, 3, 1, 4, 6, 1, 4, 4, 6, 3}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 4, 6, 3, 1, 1, 6, 3, 6, 1, 4, 6, 4, 1, 4, 4, 3, 1, 4, 6, 1, 4, 4, 6, 3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, 8, 7, 9.454, -\\frac{5}{2}, \\frac{17}{3}} \\cup {-\\frac{5}{2}, 4, 8, \\frac{17}{3}, 10, 9.454, 7}$.\n", - "Output Answer": [ - "${-\\frac{5}{2}, 4, \\frac{17}{3}, 7, 8, 9.454, 10}$" - ], - "Output Program": [ - "fst = set((4, 8, 7, 9.454, -(5/2), (17/3),))\nsnd = set((-(5/2), 4, 8, (17/3), 10, 9.454, 7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\pi, \\pi, 0, 2 \\pi, 2 \\pi, \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$\\frac{2 \\pi }{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.pi, math.pi, 0, 2*math.pi, 2*math.pi, math.pi, -2*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, -15, 3}$.\n", - "Output Answer": [ - "$\\frac{307}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -15, 3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x+0.1$ where $x \\sim $ \\text{PoissonDistribution}[1.4]\n", - "Output Answer": [ - "$3.74$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.4)\nprint(E(2.6*x+0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{5}, \\sqrt{2}, 3 \\sqrt{3}, 5, \\frac{38}{7}, -9, -3 \\log (2)}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(5), math.sqrt(2), 3*math.sqrt(3), 5, (38/7), -9, -3*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -3, -1, 5, -2, 9, 8}$.\n", - "Output Answer": [ - "$\\frac{6}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -3, -1, 5, -2, 9, 8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, 3 e, -8, \\frac{13}{\\pi }, -5, 1, -6 \\log (2), -\\frac{7}{3}, e, -13 \\log (2)} \\cup {3 e, \\frac{18}{\\pi }, -e, -13 \\log (2), -8, 4, 1, 8, -\\frac{7}{3}, 9, -6 \\log (2)}$.\n", - "Output Answer": [ - "${-13 \\log (2), -8, -5, -6 \\log (2), -e, -\\frac{7}{3}, 1, e, 4, \\frac{13}{\\pi }, 5, \\frac{18}{\\pi }, 8, 3 e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 3*math.e, -8, (13/math.pi), -5, 1, -6*math.log(2), -(7/3), math.e, -13*math.log(2),))\nsnd = set((3*math.e, (18/math.pi), -math.e, -13*math.log(2), -8, 4, 1, 8, -(7/3), 9, -6*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5.17, 0, -7 \\log (2), 0.1, 6, -8, 7}$.\n", - "Output Answer": [ - "${-8, -5.17, -7 \\log (2), 0, 0.1, 6, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -5.17, 0, -7*math.log(2), 0.1, 6, -8, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{\\sqrt{2}}, 6, -6, \\frac{23}{e}, -5, 0}$.\n", - "Output Answer": [ - "$6+\\frac{23}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/(math.sqrt(2))), 6, -6, (23/math.e), -5, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{27}{\\pi }, -\\frac{19}{\\pi }, -\\frac{27}{\\pi }, \\frac{10}{\\pi }, \\frac{6}{\\pi }, -\\frac{19}{\\pi }, \\frac{6}{\\pi }, -\\frac{18}{\\pi }, -\\frac{22}{\\pi }, \\frac{10}{\\pi }, -\\frac{22}{\\pi }, -\\frac{15}{\\pi }, -\\frac{1}{\\pi }, -\\frac{18}{\\pi }, -\\frac{27}{\\pi }, -\\frac{1}{\\pi }, -\\frac{15}{\\pi }, \\frac{6}{\\pi }, -\\frac{1}{\\pi }, -\\frac{19}{\\pi }, -\\frac{27}{\\pi }, \\frac{6}{\\pi }, -\\frac{1}{\\pi }, -\\frac{22}{\\pi }, -\\frac{19}{\\pi }, -\\frac{27}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{27}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(27/math.pi), -(19/math.pi), -(27/math.pi), (10/math.pi), (6/math.pi), -(19/math.pi), (6/math.pi), -(18/math.pi), -(22/math.pi), (10/math.pi), -(22/math.pi), -(15/math.pi), -(1/math.pi), -(18/math.pi), -(27/math.pi), -(1/math.pi), -(15/math.pi), (6/math.pi), -(1/math.pi), -(19/math.pi), -(27/math.pi), (6/math.pi), -(1/math.pi), -(22/math.pi), -(19/math.pi), -(27/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, 7, 9, -10}$.\n", - "Output Answer": [ - "$\\frac{1019}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 7, 9, -10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 2, \\frac{35}{3}, 19}$.\n", - "Output Answer": [ - "$\\frac{15960}{3877}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 2, (35/3), 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x^3+3.6 x^2-2.8 x+0.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$-9.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(-2.3*x**3+3.6*x**2-2.8*x+0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{3}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{3}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (3/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, -9, 7, \\frac{28}{5}, 3, -9, -3 e}$.\n", - "Output Answer": [ - "${-9, -9, -3 e, -5, 3, \\frac{28}{5}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -9, 7, (28/5), 3, -9, -3*math.e\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, 7, \\frac{8}{\\pi }} \\setminus {0, -6.87, 7, -2}$.\n", - "Output Answer": [ - "${\\frac{8}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 7, (8/math.pi),))\nsnd = set((0, -6.87, 7, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 6, 5, -10, 12, 11}$.\n", - "Output Answer": [ - "$\\frac{2033}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 6, 5, -10, 12, 11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{18}{7}, 1, -6, 3 e, 0, -3 e, -\\sqrt{2}, e, -\\frac{16}{\\sqrt{3}}, 3}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{3}}+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -(18/7), 1, -6, 3*math.e, 0, -3*math.e, -math.sqrt(2), math.e, -(16/(math.sqrt(3))), 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, \\sqrt{5}, 5, -6, 2 \\sqrt{2}, 2}$.\n", - "Output Answer": [ - "${-6, 2, \\sqrt{5}, 2 \\sqrt{2}, 5, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, math.sqrt(5), 5, -6, 2*math.sqrt(2), 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.033,0.09,0.043,0.007,0.2,0.013,0.064,0.12,0.063,0.036\\}$ and $\\{0.154,0.051,0.07,0.163,0.071,0.055,0.074,0.007,0.144,0.14\\}$.", - "Output Answer": [ - "$0.89$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.033, 0.09, 0.043, 0.007, 0.2, 0.013, 0.064, 0.12, 0.063, 0.036\ndistribution2 = 0.154, 0.051, 0.07, 0.163, 0.071, 0.055, 0.074, 0.007, 0.144, 0.14\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{55}{7}, -\\frac{20}{e}, -2, -1, -1, 2, 0, -5, -\\sqrt{3}, -5, 5 \\sqrt{2}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (55/7), -(20/math.e), -2, -1, -1, 2, 0, -5, -math.sqrt(3), -5, 5*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, 2, -7}$.\n", - "Output Answer": [ - "$57$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 2, -7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 6, -4, 6, -4}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "values = 7, 6, -4, 6, -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\sqrt{2}, 6 \\sqrt{2}, 1, 3} \\setminus {0, 5 \\sqrt{2}, 6 \\sqrt{2}, 4 \\sqrt{2}, 3, -4 \\sqrt{2}, 7}$.\n", - "Output Answer": [ - "${1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(2), 6*math.sqrt(2), 1, 3,))\nsnd = set((0, 5*math.sqrt(2), 6*math.sqrt(2), 4*math.sqrt(2), 3, -4*math.sqrt(2), 7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.125,0.272,0.103,0.309,0.045,0.077\\}$ and $\\{0.033,0.327,0.013,0.064,0.117,0.061\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.125, 0.272, 0.103, 0.309, 0.045, 0.077\ndistribution2 = 0.033, 0.327, 0.013, 0.064, 0.117, 0.061\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.8 x^2+0.4 x-6.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$-30.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(-3.8*x**2+0.4*x-6.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{5}{\\sqrt{2}}, -6, 1, 0}$.\n", - "Output Answer": [ - "$6+\\frac{5}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/(math.sqrt(2))), -6, 1, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.348,0.185,0.242,0.157\\}$ and $\\{0.161,0.081,0.206,0.001\\}$.", - "Output Answer": [ - "$0.62$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.348, 0.185, 0.242, 0.157\ndistribution2 = 0.161, 0.081, 0.206, 0.001\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -6, -\\frac{3}{\\sqrt{5}}, \\frac{13}{\\sqrt{5}}, 8, 5, 5, 7}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -6, -(3/(math.sqrt(5))), (13/(math.sqrt(5))), 8, 5, 5, 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${10, 10, 9, -8, -3}$.\n", - "Output Answer": [ - "$\\frac{18}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 10, 10, 9, -8, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\sqrt{3}, -7, 6, 6, -\\frac{11}{2}, \\frac{16}{5}, -\\frac{5}{\\sqrt{3}}, -8, 9, -6, -5, -\\pi, 3 \\sqrt{2}, 3}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(3), -7, 6, 6, -(11/2), (16/5), -(5/(math.sqrt(3))), -8, 9, -6, -5, -math.pi, 3*math.sqrt(2), 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1024, 1000000, 2401, -216, 1, 1}$.\n", - "Output Answer": [ - "$40 \\sqrt[6]{-2} \\sqrt{3} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1024, 1000000, 2401, -216, 1, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{22}{7}, 5.13, 4, -2, -2 \\pi, -3 \\sqrt{3}} \\setminus {-9, -2, 5.13, -\\frac{45}{7}}$.\n", - "Output Answer": [ - "${-2 \\pi, -3 \\sqrt{3}, \\frac{22}{7}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set(((22/7), 5.13, 4, -2, -2*math.pi, -3*math.sqrt(3),))\nsnd = set((-9, -2, 5.13, -(45/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{33}{4}, 2 \\sqrt{2}, 6 \\sqrt{2}, 7} \\cup {6 \\sqrt{2}, 2 \\sqrt{2}, -8, -4}$.\n", - "Output Answer": [ - "${-\\frac{33}{4}, -8, -4, 2 \\sqrt{2}, 7, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(33/4), 2*math.sqrt(2), 6*math.sqrt(2), 7,))\nsnd = set((6*math.sqrt(2), 2*math.sqrt(2), -8, -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, -8, 3}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -8, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{19}{2}, -5}$.\n", - "Output Answer": [ - "$\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (19/2), -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{13}{\\sqrt{2}}, 5 \\sqrt{2}, -3 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, 5 \\sqrt{2}, \\frac{9}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, -3 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, -3 \\sqrt{2}, \\frac{9}{\\sqrt{2}}, 5 \\sqrt{2}, \\frac{9}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, 5 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{9}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (13/(math.sqrt(2))), 5*math.sqrt(2), -3*math.sqrt(2), (5/(math.sqrt(2))), (9/(math.sqrt(2))), (9/(math.sqrt(2))), (7/(math.sqrt(2))), 5*math.sqrt(2), (9/(math.sqrt(2))), (9/(math.sqrt(2))), (5/(math.sqrt(2))), (7/(math.sqrt(2))), (9/(math.sqrt(2))), (5/(math.sqrt(2))), -3*math.sqrt(2), (7/(math.sqrt(2))), -3*math.sqrt(2), (9/(math.sqrt(2))), 5*math.sqrt(2), (9/(math.sqrt(2))), (7/(math.sqrt(2))), (7/(math.sqrt(2))), 5*math.sqrt(2), (7/(math.sqrt(2))), (5/(math.sqrt(2))), 5*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x-2.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$-3.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(-1.1*x-2.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x^2+1.1 x-3.2$ where $x \\sim $ \\text{NormalDistribution}[0.1,1.5]\n", - "Output Answer": [ - "$3.46$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.1, 1.5)\nprint(E(2.9*x**2+1.1*x-3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 19}$.\n", - "Output Answer": [ - "$\\frac{684}{37}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{44}{3}, 3}$.\n", - "Output Answer": [ - "$\\frac{264}{53}$" - ], - "Output Program": [ - "import statistics\nvalues = (44/3), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 243, 64, 4096, 15625, 9}$.\n", - "Output Answer": [ - "$120 \\sqrt[6]{3} 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 243, 64, 4096, 15625, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.232,0.27,0.107,0.065,0.056,0.093,0.044,0.122,0.01\\}$ and $\\{0.13,0.102,0.171,0.043,0.148,0.094,0.05,0.143,0.063\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.232, 0.27, 0.107, 0.065, 0.056, 0.093, 0.044, 0.122, 0.01\ndistribution2 = 0.13, 0.102, 0.171, 0.043, 0.148, 0.094, 0.05, 0.143, 0.063\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{56}{3}, 13, \\frac{25}{3}}$.\n", - "Output Answer": [ - "$\\frac{54600}{4559}$" - ], - "Output Program": [ - "import statistics\nvalues = (56/3), 13, (25/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 0, -3}$.\n", - "Output Answer": [ - "$-\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 0, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{27}{7}, \\frac{19}{e}, 0}$.", - "Output Answer": [ - "$\\frac{27}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (27/7), (19/math.e), 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{19}{3}, -3, -7, -9, 8, \\frac{7}{2}, 5 \\sqrt{3}, -\\frac{3}{\\sqrt{2}}} \\setminus {-\\frac{1}{2}, 5 \\sqrt{3}, -7, -\\frac{3}{\\sqrt{2}}, 9}$.\n", - "Output Answer": [ - "${-9, -\\frac{19}{3}, -3, \\frac{7}{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(19/3), -3, -7, -9, 8, (7/2), 5*math.sqrt(3), -(3/(math.sqrt(2))),))\nsnd = set((-(1/2), 5*math.sqrt(3), -7, -(3/(math.sqrt(2))), 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 81, 243, 256, 243, -32}$.\n", - "Output Answer": [ - "$36 \\sqrt[6]{-1} 2^{5/6} \\sqrt[3]{3} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 81, 243, 256, 243, -32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{32}{7}, \\frac{41}{5}, 2, 2.1, 4, -5, -4}$.\n", - "Output Answer": [ - "${-5, -\\frac{32}{7}, -4, 2, 2.1, 4, \\frac{41}{5}}$" - ], - "Output Program": [ - "values = -(32/7), (41/5), 2, 2.1, 4, -5, -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.8 x^2-0.4 x+4.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$-3.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(-4.8*x**2-0.4*x+4.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 6, -\\sqrt{5}, \\frac{26}{3}, 4, -7}$.\n", - "Output Answer": [ - "$\\frac{47}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 6, -math.sqrt(5), (26/3), 4, -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, \\frac{26}{\\pi }, -\\frac{18}{\\pi }, \\frac{21}{\\pi }, \\frac{24}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{53}{5 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, (26/math.pi), -(18/math.pi), (21/math.pi), (24/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 2 \\sqrt{5}, 0, \\frac{26}{\\pi }, -8, 5, -8}$.\n", - "Output Answer": [ - "$8+\\frac{26}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 2*math.sqrt(5), 0, (26/math.pi), -8, 5, -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 4, 9, 3, -5, 3, -5, -5, 7, 9, 9, 1, -2, 4, -5, -8, 1, -2, 1, -5}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 4, 9, 3, -5, 3, -5, -5, 7, 9, 9, 1, -2, 4, -5, -8, 1, -2, 1, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5 \\sqrt{3}, 9, \\frac{19}{2}, \\frac{4}{\\sqrt{3}}, -9.995, \\frac{2}{\\sqrt{\\pi }}, 10, -8} \\setminus {9, 10, \\frac{3}{\\sqrt{\\pi }}, -9.995, \\frac{19}{2}, \\frac{4}{\\sqrt{3}}, \\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -8, \\frac{2}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(3), 9, (19/2), (4/(math.sqrt(3))), -9.995, (2/(math.sqrt(math.pi))), 10, -8,))\nsnd = set((9, 10, (3/(math.sqrt(math.pi))), -9.995, (19/2), (4/(math.sqrt(3))), (13/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{3}{\\sqrt{2}}, 0, 8, 2, -10} \\cup {-10, -\\frac{13}{\\sqrt{2}}, 8, 2, 5}$.\n", - "Output Answer": [ - "${-10, -\\frac{13}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, 0, 2, 5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(3/(math.sqrt(2))), 0, 8, 2, -10,))\nsnd = set((-10, -(13/(math.sqrt(2))), 8, 2, 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\sqrt{3}, -8, -7}$.\n", - "Output Answer": [ - "$8-\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(3), -8, -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{30}{7}, 7, 5, 0, 3 \\sqrt{5}, 0, 1, -8}$.", - "Output Answer": [ - "$\\frac{37}{14}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (30/7), 7, 5, 0, 3*math.sqrt(5), 0, 1, -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{2}{e}, 4, \\frac{23}{3}, 2 \\sqrt{5}, 7, \\frac{18}{5}, \\frac{65}{7}, \\frac{6}{7}} \\cup {7, 2 \\sqrt{5}, \\frac{18}{5}, -3, \\frac{6}{e}, \\frac{23}{3}}$.\n", - "Output Answer": [ - "${-3, \\frac{2}{e}, \\frac{6}{7}, \\frac{6}{e}, \\frac{18}{5}, 4, 2 \\sqrt{5}, 7, \\frac{23}{3}, \\frac{65}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((2/math.e), 4, (23/3), 2*math.sqrt(5), 7, (18/5), (65/7), (6/7),))\nsnd = set((7, 2*math.sqrt(5), (18/5), -3, (6/math.e), (23/3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{14}{\\pi }, \\frac{17}{\\pi }, \\frac{17}{\\pi }, -\\frac{11}{\\pi }, \\frac{17}{\\pi }, -\\frac{2}{\\pi }, -\\frac{11}{\\pi }, -\\frac{2}{\\pi }, -\\frac{2}{\\pi }, \\frac{17}{\\pi }, -\\frac{6}{\\pi }, -\\frac{22}{\\pi }, -\\frac{14}{\\pi }, -\\frac{11}{\\pi }, -\\frac{14}{\\pi }, -\\frac{6}{\\pi }, -\\frac{2}{\\pi }, -\\frac{22}{\\pi }, -\\frac{6}{\\pi }, -\\frac{6}{\\pi }, -\\frac{14}{\\pi }, -\\frac{22}{\\pi }, -\\frac{6}{\\pi }, -\\frac{11}{\\pi }, \\frac{17}{\\pi }, \\frac{17}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{17}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(14/math.pi), (17/math.pi), (17/math.pi), -(11/math.pi), (17/math.pi), -(2/math.pi), -(11/math.pi), -(2/math.pi), -(2/math.pi), (17/math.pi), -(6/math.pi), -(22/math.pi), -(14/math.pi), -(11/math.pi), -(14/math.pi), -(6/math.pi), -(2/math.pi), -(22/math.pi), -(6/math.pi), -(6/math.pi), -(14/math.pi), -(22/math.pi), -(6/math.pi), -(11/math.pi), (17/math.pi), (17/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, -10, -7, -14}$.\n", - "Output Answer": [ - "$\\frac{33}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -10, -7, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{37}{4}, \\frac{9}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{3}{\\pi }, -\\frac{5}{\\pi }, 9, 5 \\sqrt{2}}$.", - "Output Answer": [ - "$5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (37/4), (9/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), -(3/math.pi), -(5/math.pi), 9, 5*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-9, -2, -15, 1, 4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{597}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -2, -15, 1, 4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{35}{2}, \\frac{1}{2}, \\frac{35}{2}, 14}$.\n", - "Output Answer": [ - "$\\frac{280}{153}$" - ], - "Output Program": [ - "import statistics\nvalues = (35/2), (1/2), (35/2), 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{9}{\\sqrt{\\pi }}, 1, -5} \\setminus {-5, 2, -7, 0, -4}$.\n", - "Output Answer": [ - "${-\\frac{9}{\\sqrt{\\pi }}, 1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(9/(math.sqrt(math.pi))), 1, -5,))\nsnd = set((-5, 2, -7, 0, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 64, 27, 9}$.\n", - "Output Answer": [ - "$6 \\sqrt{2} 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 64, 27, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -8, -2}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "values = -7, -8, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.118,0.018,0.278,0.1,0.024,0.008,0.087,0.021\\}$ and $\\{0.143,0.158,0.058,0.122,0.088,0.235,0.114,0.068\\}$.", - "Output Answer": [ - "$0.79$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.118, 0.018, 0.278, 0.1, 0.024, 0.008, 0.087, 0.021\ndistribution2 = 0.143, 0.158, 0.058, 0.122, 0.088, 0.235, 0.114, 0.068\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -3, 5, 5, -9, -3, -10, 5, -3, -8, 5, -8, 5, -9, 1, -8, 5, -8, -10, -9, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -3, 5, 5, -9, -3, -10, 5, -3, -8, 5, -8, 5, -9, 1, -8, 5, -8, -10, -9, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 6561, -5, 10, -343}$.\n", - "Output Answer": [ - "$6\\ 5^{2/5} 21^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 6561, -5, 10, -343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\log (2), 8, -8.81, -3} \\setminus {-7, -1.454, \\log (2), -4}$.\n", - "Output Answer": [ - "${-8.81, -3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.log(2), 8, -8.81, -3,))\nsnd = set((-7, -1.454, math.log(2), -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.259,0.086,0.097,0.086,0.044,0.243\\}$ and $\\{0.327,0.038,0.079,0.124,0.107,0.046\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.259, 0.086, 0.097, 0.086, 0.044, 0.243\ndistribution2 = 0.327, 0.038, 0.079, 0.124, 0.107, 0.046\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\sqrt{3}, -3, -5, -5, 4, 4, 1, -2, 3 \\pi, -\\frac{10}{e}, 5}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.sqrt(3), -3, -5, -5, 4, 4, 1, -2, 3*math.pi, -(10/math.e), 5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, 3, -1, 4, -6, 11}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{37}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 3, -1, 4, -6, 11\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.318,0.188,0.044,0.01,0.051,0.198,0.041,0.011\\}$ and $\\{0.011,0.467,0.005,0.102,0.019,0.03,0.271,0.026\\}$.", - "Output Answer": [ - "$1.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.318, 0.188, 0.044, 0.01, 0.051, 0.198, 0.041, 0.011\ndistribution2 = 0.011, 0.467, 0.005, 0.102, 0.019, 0.03, 0.271, 0.026\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, 7 \\sqrt{2}, -\\sqrt{2}, -\\sqrt{2}, \\frac{13}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, 7 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, -\\sqrt{2}, \\frac{11}{\\sqrt{2}}, -\\sqrt{2}, \\frac{11}{\\sqrt{2}}, 7 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, 7 \\sqrt{2}, \\frac{11}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, 5 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{11}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (11/(math.sqrt(2))), (13/(math.sqrt(2))), (11/(math.sqrt(2))), 7*math.sqrt(2), -math.sqrt(2), -math.sqrt(2), (13/(math.sqrt(2))), (11/(math.sqrt(2))), -(13/(math.sqrt(2))), (13/(math.sqrt(2))), (13/(math.sqrt(2))), (11/(math.sqrt(2))), 7*math.sqrt(2), (3/(math.sqrt(2))), -math.sqrt(2), (11/(math.sqrt(2))), -math.sqrt(2), (11/(math.sqrt(2))), 7*math.sqrt(2), -(13/(math.sqrt(2))), (3/(math.sqrt(2))), -(13/(math.sqrt(2))), (11/(math.sqrt(2))), 7*math.sqrt(2), (11/(math.sqrt(2))), (3/(math.sqrt(2))), 5*math.sqrt(2), (3/(math.sqrt(2))), 5*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{2}, -1, -\\sqrt{5}, -3., 8} \\setminus {\\sqrt{5}, -4, 3 \\sqrt{2}, -7, -5, 0}$.\n", - "Output Answer": [ - "${-3., -\\sqrt{5}, -1, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(2), -1, -math.sqrt(5), -3., 8,))\nsnd = set((math.sqrt(5), -4, 3*math.sqrt(2), -7, -5, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 1.326, \\frac{17}{e}, 2.88, 1, \\frac{2}{e}, 7} \\cup {\\frac{17}{e}, -4.806, -3 \\pi, -5.44, \\frac{2}{e}, 1}$.\n", - "Output Answer": [ - "${-3 \\pi, -5.44, -4.806, 0, \\frac{2}{e}, 1, 1.326, 2.88, \\frac{17}{e}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 1.326, (17/math.e), 2.88, 1, (2/math.e), 7,))\nsnd = set(((17/math.e), -4.806, -3*math.pi, -5.44, (2/math.e), 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 5, 2, 3, -15}$.\n", - "Output Answer": [ - "$\\frac{321}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 5, 2, 3, -15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.02,0.085,0.28,0.092,0.057,0.025,0.136,0.148,0.108,0.023\\}$ and $\\{0.107,0.052,0.072,0.118,0.095,0.012,0.038,0.04,0.115,0.179\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.02, 0.085, 0.28, 0.092, 0.057, 0.025, 0.136, 0.148, 0.108, 0.023\ndistribution2 = 0.107, 0.052, 0.072, 0.118, 0.095, 0.012, 0.038, 0.04, 0.115, 0.179\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, 256, 9, 1, 16}$.\n", - "Output Answer": [ - "$4 \\sqrt[5]{5} 6^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 256, 9, 1, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 6, 0, 6 \\sqrt{2}, -4, -\\frac{19}{2}, -\\sqrt{2}, -3, -3 \\sqrt{3}, -2}$.\n", - "Output Answer": [ - "$\\frac{19}{2}+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 6, 0, 6*math.sqrt(2), -4, -(19/2), -math.sqrt(2), -3, -3*math.sqrt(3), -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -\\frac{2}{\\sqrt{\\pi }}, -7, -1, \\frac{18}{e}, 10}$.\n", - "Output Answer": [ - "${-7, -\\frac{2}{\\sqrt{\\pi }}, -1, 1, \\frac{18}{e}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -(2/(math.sqrt(math.pi))), -7, -1, (18/math.e), 10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, 5.41, -\\frac{17}{7}, 6 \\sqrt{2}, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{17}{7}, 5.41, 10 \\log (2), 8, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 5.41, -(17/7), 6*math.sqrt(2), 10*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{29}{3}, \\frac{17}{3}, \\frac{49}{3}}$.\n", - "Output Answer": [ - "$\\frac{24157}{2747}$" - ], - "Output Program": [ - "import statistics\nvalues = (29/3), (17/3), (49/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.151,0.161,0.124,0.065,0.108,0.064,0.062,0.036,0.07,0.069\\}$ and $\\{0.095,0.087,0.064,0.07,0.084,0.14,0.045,0.055,0.292,0.022\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.151, 0.161, 0.124, 0.065, 0.108, 0.064, 0.062, 0.036, 0.07, 0.069\ndistribution2 = 0.095, 0.087, 0.064, 0.07, 0.084, 0.14, 0.045, 0.055, 0.292, 0.022\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 5, 13 \\log (2), 2, 1, 6} \\setminus {-2, 2, -14 \\log (2), -3, -\\frac{9}{\\sqrt{5}}, 5, 1}$.\n", - "Output Answer": [ - "${-1, 6, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 5, 13*math.log(2), 2, 1, 6,))\nsnd = set((-2, 2, -14*math.log(2), -3, -(9/(math.sqrt(5))), 5, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, \\frac{40}{3}, \\frac{34}{3}}$.\n", - "Output Answer": [ - "$\\frac{6120}{469}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, (40/3), (34/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, 3 \\sqrt{2}, -7, -3 \\sqrt{3}, -\\frac{25}{3}, -\\frac{4}{\\sqrt{5}}, -1}$.", - "Output Answer": [ - "$-\\frac{4}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 3*math.sqrt(2), -7, -3*math.sqrt(3), -(25/3), -(4/(math.sqrt(5))), -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, \\frac{50}{3}, \\frac{53}{3}}$.\n", - "Output Answer": [ - "$\\frac{55650}{4813}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, (50/3), (53/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x-1.3$ where $x \\sim $ \\text{BetaDistribution}[1.3,1.8]\n", - "Output Answer": [ - "$-0.46$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 1.8)\nprint(E(2.*x-1.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{16}{\\pi }, 6, \\frac{4}{\\sqrt{3}}, -1.68, \\pi} \\cup {3 \\pi, \\frac{14}{3}, -10, \\frac{4}{\\sqrt{3}}, -\\frac{17}{\\pi }, 6, 8.48}$.\n", - "Output Answer": [ - "${-10, -\\frac{17}{\\pi }, -1.68, \\frac{4}{\\sqrt{3}}, \\pi, \\frac{14}{3}, \\frac{16}{\\pi }, 6, 8.48, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set(((16/math.pi), 6, (4/(math.sqrt(3))), -1.68, math.pi,))\nsnd = set((3*math.pi, (14/3), -10, (4/(math.sqrt(3))), -(17/math.pi), 6, 8.48,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${5, -11, 4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{241}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -11, 4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 8, -2, 10, \\frac{9}{\\sqrt{\\pi }}, \\sqrt{2}, 3, -4 \\sqrt{3}, -2, -\\frac{13}{5}, \\pi}$.\n", - "Output Answer": [ - "$10+4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 8, -2, 10, (9/(math.sqrt(math.pi))), math.sqrt(2), 3, -4*math.sqrt(3), -2, -(13/5), math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{\\sqrt{\\pi }}, -4, -\\frac{1}{\\sqrt{2}}, -6, 4, 9}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{\\pi }}, -6, -4, -\\frac{1}{\\sqrt{2}}, 4, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(math.pi))), -4, -(1/(math.sqrt(2))), -6, 4, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, 2, -\\frac{7}{e}, -2, 3} \\cup {-\\frac{7}{e}, 10, 7, -7, 6, -2, 2}$.\n", - "Output Answer": [ - "${-7, -\\frac{7}{e}, -2, 2, 3, 6, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 2, -(7/math.e), -2, 3,))\nsnd = set((-(7/math.e), 10, 7, -7, 6, -2, 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -4, 7, 7, 7, -4, 7, -7, 7, 6, 6, -7, -4, 7, 3, -4, 6, 7, 7, 3, -7}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -4, 7, 7, 7, -4, 7, -7, 7, 6, 6, -7, -4, 7, 3, -4, 6, 7, 7, 3, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-27, 10000, 1, 9}$.\n", - "Output Answer": [ - "$30 \\sqrt[4]{-3}$" - ], - "Output Program": [ - "import math\n\nvalues = -27, 10000, 1, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-10, -4, -3, 3, 4 \\sqrt{3}, \\frac{43}{5}, 10, 8 \\log (2), 11 \\log (2), -\\frac{11}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{1}{2} (3+8 \\log (2))$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, -4, -3, 3, 4*math.sqrt(3), (43/5), 10, 8*math.log(2), 11*math.log(2), -(11/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -2, 0, 2.844, -2 \\pi, -8} \\setminus {6 \\sqrt{2}, -2, 0, \\sqrt{3}, -3.793, -9, 6}$.\n", - "Output Answer": [ - "${-8, -7, -2 \\pi, 2.844}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -2, 0, 2.844, -2*math.pi, -8,))\nsnd = set((6*math.sqrt(2), -2, 0, math.sqrt(3), -3.793, -9, 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${11 \\log (2), -3 e, \\frac{22}{3}, -3 \\sqrt{5}, \\sqrt{2}, 5, -6, 10}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(5+\\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 11*math.log(2), -3*math.e, (22/3), -3*math.sqrt(5), math.sqrt(2), 5, -6, 10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 8, -8, -3, -\\frac{27}{e}, -9, 6 \\sqrt{2}, -7, -9, 7, -\\frac{9}{2}, -7, -1, 7, \\frac{3}{4}}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+\\frac{27}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 8, -8, -3, -(27/math.e), -9, 6*math.sqrt(2), -7, -9, 7, -(9/2), -7, -1, 7, (3/4)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.29 < 2.8 x-2.8 < 3.43$ where $x \\sim $ \\text{ExponentialDistribution}[1.1].", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.1)\nprint(P((0.29 < 2.8*x-2.8) & (2.8*x-2.8 < 3.43)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{3}, -1, -10, -7 \\log (2), \\sqrt{3}, -\\sqrt{5}, -9, 4 \\sqrt{2}, \\frac{48}{5}, 3 \\pi, 6, 6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4 \\sqrt{2}+\\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(3), -1, -10, -7*math.log(2), math.sqrt(3), -math.sqrt(5), -9, 4*math.sqrt(2), (48/5), 3*math.pi, 6, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, 2, -9, \\frac{26}{3}, -\\frac{22}{e}, -8, -3, \\frac{14}{\\sqrt{3}}}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 2, -9, (26/3), -(22/math.e), -8, -3, (14/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -10, -\\frac{26}{e}, -3, \\frac{5}{\\sqrt{2}}, 3, 9, -3, -10, -\\frac{16}{\\sqrt{3}}, \\frac{17}{2}, 0, -3, -3}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -10, -(26/math.e), -3, (5/(math.sqrt(2))), 3, 9, -3, -10, -(16/(math.sqrt(3))), (17/2), 0, -3, -3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{22}{5}, -2, -\\frac{32}{5}, \\frac{6}{5}, -\\frac{26}{5}, \\frac{43}{5}, \\frac{24}{5}, -\\frac{6}{5}} \\cap {\\frac{22}{5}, -\\frac{41}{5}, \\frac{24}{5}, \\frac{17}{5}, -\\frac{28}{5}, -\\frac{32}{5}, -2, \\frac{32}{5}}$.\n", - "Output Answer": [ - "${-\\frac{32}{5}, -2, \\frac{22}{5}, \\frac{24}{5}}$" - ], - "Output Program": [ - "fst = set(((22/5), -2, -(32/5), (6/5), -(26/5), (43/5), (24/5), -(6/5),))\nsnd = set(((22/5), -(41/5), (24/5), (17/5), -(28/5), -(32/5), -2, (32/5),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, \\frac{53}{3}, \\frac{5}{3}}$.\n", - "Output Answer": [ - "$\\frac{3180}{749}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, (53/3), (5/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.6 x^3+1.6 x^2+1.8 x+2.$ where $x \\sim $ \\text{NormalDistribution}[-1.4,0.6]\n", - "Output Answer": [ - "$14.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.4, 0.6)\nprint(E(-2.6*x**3+1.6*x**2+1.8*x+2.))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, -1, \\frac{16}{3}, 10, -6, 0} \\cup {9, -6, 0, 3, -1, \\frac{16}{3}}$.\n", - "Output Answer": [ - "${-6, -1, 0, 3, \\frac{16}{3}, 7, 9, 10}$" - ], - "Output Program": [ - "fst = set((7, -1, (16/3), 10, -6, 0,))\nsnd = set((9, -6, 0, 3, -1, (16/3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 1, 1, -512}$.\n", - "Output Answer": [ - "$4 \\sqrt[4]{-2} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 1, 1, -512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.148,0.217,0.174,0.111,0.077,0.159\\}$ and $\\{0.097,0.223,0.046,0.097,0.11,0.163\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.148, 0.217, 0.174, 0.111, 0.077, 0.159\ndistribution2 = 0.097, 0.223, 0.046, 0.097, 0.11, 0.163\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\sqrt{5}, \\frac{11}{\\sqrt{\\pi }}, 0, -6, 2} \\setminus {-6, 2.83, \\frac{13}{\\sqrt{\\pi }}, -3 \\sqrt{5}, 0, -2.19}$.\n", - "Output Answer": [ - "${-\\sqrt{5}, 2, \\frac{11}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(5), (11/(math.sqrt(math.pi))), 0, -6, 2,))\nsnd = set((-6, 2.83, (13/(math.sqrt(math.pi))), -3*math.sqrt(5), 0, -2.19,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.065,0.161,0.133,0.046,0.092,0.185,0.204,0.064\\}$ and $\\{0.103,0.102,0.058,0.088,0.061,0.056,0.285,0.028\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.065, 0.161, 0.133, 0.046, 0.092, 0.185, 0.204, 0.064\ndistribution2 = 0.103, 0.102, 0.058, 0.088, 0.061, 0.056, 0.285, 0.028\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, 7, 13, -1}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{395}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 7, 13, -1\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{3}, 4 \\sqrt{5}, -\\frac{3}{e}, -4, \\frac{11}{\\sqrt{\\pi }}, 8, -\\frac{11}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{11}{\\sqrt{5}}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(3), 4*math.sqrt(5), -(3/math.e), -4, (11/(math.sqrt(math.pi))), 8, -(11/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -5, -\\frac{15}{4}, -9, 5, 4, -5 \\sqrt{3}} \\cup {5, -5, -2, -\\frac{15}{4}, -9}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -5, -\\frac{15}{4}, -2, 4, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -5, -(15/4), -9, 5, 4, -5*math.sqrt(3),))\nsnd = set((5, -5, -2, -(15/4), -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, -6, -6, 5}$.\n", - "Output Answer": [ - "$\\frac{201}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -6, -6, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -\\log (2), 4, -3, 2, -\\sqrt{5}} \\setminus {9, -\\log (2), -\\sqrt{5}, -5, 3}$.\n", - "Output Answer": [ - "${-3, 0, 2, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -math.log(2), 4, -3, 2, -math.sqrt(5),))\nsnd = set((9, -math.log(2), -math.sqrt(5), -5, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{2}{\\sqrt{3}}, 2, -\\frac{5}{e}, 0}$.\n", - "Output Answer": [ - "${-\\frac{5}{e}, -\\frac{2}{\\sqrt{3}}, 0, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(2/(math.sqrt(3))), 2, -(5/math.e), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, \\frac{46}{7}, \\frac{68}{7}, \\frac{68}{7}, \\frac{66}{7}, -\\frac{44}{7}, \\frac{1}{7}}$.\n", - "Output Answer": [ - "$\\frac{212}{49}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, (46/7), (68/7), (68/7), (66/7), -(44/7), (1/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, -\\frac{4}{\\sqrt{5}}, 8.136, 4}$.\n", - "Output Answer": [ - "${-8, -\\frac{4}{\\sqrt{5}}, 4, 8.136}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -(4/(math.sqrt(5))), 8.136, 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{38}{3}, \\frac{22}{3}, \\frac{47}{3}}$.\n", - "Output Answer": [ - "$\\frac{9823}{914}$" - ], - "Output Program": [ - "import statistics\nvalues = (38/3), (22/3), (47/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -2, -7, -3, 2, -2, -3, -3, 5, 2, -2, -7, -3, -3, -7, -7, 5, -2, -3, -3, 2, -2}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -2, -7, -3, 2, -2, -3, -3, 5, 2, -2, -7, -3, -3, -7, -7, 5, -2, -3, -3, 2, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\sqrt{3}, -1, 4}$.\n", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(3), -1, 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, -9, 6, 8, 0, -5, -6, 5, 7, 2, -8, \\frac{4}{\\sqrt{3}}, 8, -\\frac{13}{4}, \\frac{7}{2}}$.", - "Output Answer": [ - "$\\frac{4}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -9, 6, 8, 0, -5, -6, 5, 7, 2, -8, (4/(math.sqrt(3))), 8, -(13/4), (7/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${7, -3, 8, -3}$.\n", - "Output Answer": [ - "$\\frac{443}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -3, 8, -3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{9}{2}, \\frac{16}{\\sqrt{\\pi }}, -4 \\sqrt{2}, -3 \\pi, 4 \\sqrt{2}, -1, -\\frac{12}{\\pi }, -\\sqrt{3}, -12 \\log (2), \\frac{10}{\\pi }, \\frac{13}{\\sqrt{\\pi }}, -\\frac{14}{3}, 3, -2, -\\frac{19}{e}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(9/2), (16/(math.sqrt(math.pi))), -4*math.sqrt(2), -3*math.pi, 4*math.sqrt(2), -1, -(12/math.pi), -math.sqrt(3), -12*math.log(2), (10/math.pi), (13/(math.sqrt(math.pi))), -(14/3), 3, -2, -(19/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{37}{5}, -4 \\sqrt{3}, 7 \\sqrt{2}, -2, 7, -\\frac{9}{2}, \\frac{1}{2}, 5, \\sqrt{3}}$.", - "Output Answer": [ - "$\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (37/5), -4*math.sqrt(3), 7*math.sqrt(2), -2, 7, -(9/2), (1/2), 5, math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -\\pi, -9, -2, -\\frac{12}{e}, 9, -8, 10, -10, \\frac{11}{\\sqrt{2}}, -\\frac{23}{5}, \\sqrt{3}, -1, -\\frac{13}{\\sqrt{2}}, 4}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -math.pi, -9, -2, -(12/math.e), 9, -8, 10, -10, (11/(math.sqrt(2))), -(23/5), math.sqrt(3), -1, -(13/(math.sqrt(2))), 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, 4, -13, 1, -2, 12}$.\n", - "Output Answer": [ - "$\\frac{2561}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 4, -13, 1, -2, 12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x^2-2.1 x-2.5$ where $x \\sim $ \\text{NormalDistribution}[-1.,1.2]\n", - "Output Answer": [ - "$7.16$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1., 1.2)\nprint(E(3.1*x**2-2.1*x-2.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.3 x^2-3. x-3.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$-2.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(0.3*x**2-3.*x-3.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, \\frac{16}{\\sqrt{3}}, -7.2}$.\n", - "Output Answer": [ - "${-7.2, 7, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, (16/(math.sqrt(3))), -7.2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, -\\frac{11}{e}}$.\n", - "Output Answer": [ - "${-\\frac{11}{e}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -(11/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, 4, \\frac{7}{5}, -3 \\pi, 6, \\frac{16}{\\sqrt{3}}, 7}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{3}}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 4, (7/5), -3*math.pi, 6, (16/(math.sqrt(3))), 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{\\sqrt{2}}, -6, e, -9, \\frac{22}{\\sqrt{5}}} \\setminus {e, -6, -9, 1}$.\n", - "Output Answer": [ - "${\\frac{13}{\\sqrt{2}}, \\frac{22}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/(math.sqrt(2))), -6, math.e, -9, (22/(math.sqrt(5))),))\nsnd = set((math.e, -6, -9, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{22}{7}, -2, -2 \\sqrt{3}, 0, 2 e, -3 \\sqrt{3}, 8, 5, 2}$.\n", - "Output Answer": [ - "$8+3 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -(22/7), -2, -2*math.sqrt(3), 0, 2*math.e, -3*math.sqrt(3), 8, 5, 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.118,0.172,0.279,0.235,0.001\\}$ and $\\{0.024,0.028,0.361,0.101,0.332\\}$.", - "Output Answer": [ - "$0.82$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.118, 0.172, 0.279, 0.235, 0.001\ndistribution2 = 0.024, 0.028, 0.361, 0.101, 0.332\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -9, -9, -4, -9, -6, -4, -1, -6, -9, -9, 7, -1, -6, -9, 7, -9, -7, -6, -9, -9}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -9, -9, -4, -9, -6, -4, -1, -6, -9, -9, 7, -1, -6, -9, 7, -9, -7, -6, -9, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -3, 6}$.\n", - "Output Answer": [ - "$\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -3, 6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.088,0.069,0.167,0.081,0.05,0.181,0.084,0.137\\}$ and $\\{0.16,0.038,0.06,0.198,0.108,0.132,0.104,0.086\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.088, 0.069, 0.167, 0.081, 0.05, 0.181, 0.084, 0.137\ndistribution2 = 0.16, 0.038, 0.06, 0.198, 0.108, 0.132, 0.104, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, \\frac{59}{3}, \\frac{4}{3}}$.\n", - "Output Answer": [ - "$\\frac{12036}{3449}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, (59/3), (4/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, 7, 15, 14}$.\n", - "Output Answer": [ - "$\\frac{6720}{577}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, 7, 15, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.27,0.082,0.066,0.126,0.149,0.137\\}$ and $\\{0.062,0.151,0.063,0.097,0.351,0.053,0.152\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.27, 0.082, 0.066, 0.126, 0.149, 0.137\ndistribution2 = 0.062, 0.151, 0.063, 0.097, 0.351, 0.053, 0.152\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.8 x^2-1.8 x-4.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$-11.58$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(-2.8*x**2-1.8*x-4.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{17}{2}, \\frac{10}{\\sqrt{3}}, \\sqrt{5}, -e, -3 e, 6 \\log (2)} \\cup {-e, -4 e, \\sqrt{5}, 7, 6 \\log (2), \\frac{10}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-4 e, -3 e, -e, \\sqrt{5}, 6 \\log (2), \\frac{10}{\\sqrt{3}}, 7, \\frac{17}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((17/2), (10/(math.sqrt(3))), math.sqrt(5), -math.e, -3*math.e, 6*math.log(2),))\nsnd = set((-math.e, -4*math.e, math.sqrt(5), 7, 6*math.log(2), (10/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -7, 5, 6, 8}$.\n", - "Output Answer": [ - "$\\frac{3}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -7, 5, 6, 8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{24}{\\pi }, 0}$.\n", - "Output Answer": [ - "${0, \\frac{24}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (24/math.pi), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 5, -7, 7, 6, -9, 0}$.\n", - "Output Answer": [ - "$\\frac{2}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 5, -7, 7, 6, -9, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{22}{3}, -\\frac{8}{3}}$.\n", - "Output Answer": [ - "$\\frac{7}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (22/3), -(8/3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{40}{3}, \\frac{50}{3}}$.\n", - "Output Answer": [ - "$\\frac{7800}{551}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (40/3), (50/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, 1, -8, 6, 3 \\pi, 2 \\sqrt{3}, 1}$.", - "Output Answer": [ - "$2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 1, -8, 6, 3*math.pi, 2*math.sqrt(3), 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -343, -1, -1, 59049, 262144}$.\n", - "Output Answer": [ - "$24\\ 3^{2/3} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -343, -1, -1, 59049, 262144\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.304,0.208,0.215\\}$ and $\\{0.435,0.182,0.118\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.304, 0.208, 0.215\ndistribution2 = 0.435, 0.182, 0.118\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, 6, 1, -\\frac{5}{\\sqrt{3}}, 3, \\frac{15}{7}, -2, \\sqrt{3}, -10, 6, -\\frac{16}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 6, 1, -(5/(math.sqrt(3))), 3, (15/7), -2, math.sqrt(3), -10, 6, -(16/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, 1, 3, 10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{46}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 1, 3, 10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.27,0.185,0.045,0.029,0.084,0.083,0.051,0.034,0.103,0.093\\}$ and $\\{0.158,0.074,0.114,0.073,0.022,0.025,0.133,0.11,0.047,0.119\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.27, 0.185, 0.045, 0.029, 0.084, 0.083, 0.051, 0.034, 0.103, 0.093\ndistribution2 = 0.158, 0.074, 0.114, 0.073, 0.022, 0.025, 0.133, 0.11, 0.047, 0.119\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 0, -8, -3, -8, -1, -9, 5}$.\n", - "Output Answer": [ - "$-\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 0, -8, -3, -8, -1, -9, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 0, 13, 11, -11, -7}$.\n", - "Output Answer": [ - "$110$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 0, 13, 11, -11, -7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6, \\frac{7}{e}, -\\sqrt{2}, \\frac{16}{5}, -3, -6, 4 \\log (2)} \\cup {-6, -\\sqrt{2}, 9 \\log (2), 7, 10, \\frac{7}{e}}$.\n", - "Output Answer": [ - "${-6, -3, -\\sqrt{2}, \\frac{7}{e}, 4 \\log (2), \\frac{16}{5}, 6, 9 \\log (2), 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, (7/math.e), -math.sqrt(2), (16/5), -3, -6, 4*math.log(2),))\nsnd = set((-6, -math.sqrt(2), 9*math.log(2), 7, 10, (7/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7.7, 4 \\sqrt{2}, -\\sqrt{3}, 5, 8.6} \\setminus {7.7, 6, -2, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\sqrt{3}, 5, 8.6}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.7, 4*math.sqrt(2), -math.sqrt(3), 5, 8.6,))\nsnd = set((7.7, 6, -2, 4*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -5, \\frac{15}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$5+\\frac{15}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -5, (15/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.173,0.159,0.145,0.352\\}$ and $\\{0.083,0.157,0.355,0.171\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.173, 0.159, 0.145, 0.352\ndistribution2 = 0.083, 0.157, 0.355, 0.171\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1.137, -2.8, -4, 3, -1, -2.478, \\frac{28}{\\pi }, -3 e, \\frac{15}{\\pi }, 7} \\cup {-2 e, \\frac{21}{\\pi }, -2.478, -7.52, 3, -4, -2.8, 0, -\\frac{20}{\\pi }}$.\n", - "Output Answer": [ - "${-3 e, -7.52, -\\frac{20}{\\pi }, -2 e, -4, -2.8, -2.478, -1, 0, 1.137, 3, \\frac{15}{\\pi }, \\frac{21}{\\pi }, 7, \\frac{28}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((1.137, -2.8, -4, 3, -1, -2.478, (28/math.pi), -3*math.e, (15/math.pi), 7,))\nsnd = set((-2*math.e, (21/math.pi), -2.478, -7.52, 3, -4, -2.8, 0, -(20/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, 512, 25, 36, 8}$.\n", - "Output Answer": [ - "$8\\ 15^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 512, 25, 36, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-e, 0, 0, -2 e, e, -2 e, -e, -e, -3 e, -e, -2 e, 0, -2 e, -3 e, -2 e, -2 e, 0, -2 e, -2 e, -2 e}$.\n", - "Output Answer": [ - "$\\{-2 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.e, 0, 0, -2*math.e, math.e, -2*math.e, -math.e, -math.e, -3*math.e, -math.e, -2*math.e, 0, -2*math.e, -3*math.e, -2*math.e, -2*math.e, 0, -2*math.e, -2*math.e, -2*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.068,0.105,0.571\\}$ and $\\{0.292,0.213,0.38\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.068, 0.105, 0.571\ndistribution2 = 0.292, 0.213, 0.38\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6 \\sqrt{2}, 2 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, 6 \\sqrt{2}, 0, 6 \\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{23}{4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 6*math.sqrt(2), 2*math.sqrt(2), -(7/(math.sqrt(2))), (3/(math.sqrt(2))), 6*math.sqrt(2), 0, 6*math.sqrt(2), 5*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.035,0.149,0.217,0.073,0.087,0.019,0.134,0.093\\}$ and $\\{0.092,0.105,0.121,0.164,0.11,0.018,0.112,0.217\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.035, 0.149, 0.217, 0.073, 0.087, 0.019, 0.134, 0.093\ndistribution2 = 0.092, 0.105, 0.121, 0.164, 0.11, 0.018, 0.112, 0.217\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.122,0.331,0.062,0.029,0.083,0.049,0.2,0.031,0.006,0.056\\}$ and $\\{0.117,0.118,0.041,0.085,0.069,0.096,0.131,0.066,0.096,0.136\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.122, 0.331, 0.062, 0.029, 0.083, 0.049, 0.2, 0.031, 0.006, 0.056\ndistribution2 = 0.117, 0.118, 0.041, 0.085, 0.069, 0.096, 0.131, 0.066, 0.096, 0.136\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, \\frac{28}{3}, \\frac{53}{3}}$.\n", - "Output Answer": [ - "$\\frac{48972}{4157}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, (28/3), (53/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, 9, 10, -7, -\\frac{20}{3}}$.\n", - "Output Answer": [ - "${-7, -\\frac{20}{3}, 7, 9, 10}$" - ], - "Output Program": [ - "values = 7, 9, 10, -7, -(20/3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -2, -\\frac{14}{\\sqrt{3}}, 6}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -2, -(14/(math.sqrt(3))), 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, -7}$.\n", - "Output Answer": [ - "${-7, 7}$" - ], - "Output Program": [ - "values = 7, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{7}{e}, 3, -4, 7, -1, -\\frac{27}{5}}$.\n", - "Output Answer": [ - "${-\\frac{27}{5}, -4, -\\frac{7}{e}, -1, 3, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/math.e), 3, -4, 7, -1, -(27/5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9.585, -6, 1, \\frac{15}{\\pi }, -5, -\\frac{30}{\\pi }} \\cup {\\frac{15}{\\pi }, -5, -1, 5, 8.074, \\frac{7}{\\pi }}$.\n", - "Output Answer": [ - "${-9.585, -\\frac{30}{\\pi }, -6, -5, -1, 1, \\frac{7}{\\pi }, \\frac{15}{\\pi }, 5, 8.074}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9.585, -6, 1, (15/math.pi), -5, -(30/math.pi),))\nsnd = set(((15/math.pi), -5, -1, 5, 8.074, (7/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\pi, -3 \\pi, 2 \\pi, -3 \\pi, 2 \\pi, 3 \\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$\\frac{\\pi }{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.pi, -3*math.pi, 2*math.pi, -3*math.pi, 2*math.pi, 3*math.pi, 2*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.051,0.065,0.288,0.044,0.101,0.04,0.091,0.112\\}$ and $\\{0.108,0.001,0.084,0.012,0.009,0.016,0.36,0.021\\}$.", - "Output Answer": [ - "$0.99$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.051, 0.065, 0.288, 0.044, 0.101, 0.04, 0.091, 0.112\ndistribution2 = 0.108, 0.001, 0.084, 0.012, 0.009, 0.016, 0.36, 0.021\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.063,0.363,0.038,0.129,0.125,0.103\\}$ and $\\{0.178,0.16,0.195,0.241,0.046,0.137\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.063, 0.363, 0.038, 0.129, 0.125, 0.103\ndistribution2 = 0.178, 0.16, 0.195, 0.241, 0.046, 0.137\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{2}, -\\frac{11}{\\sqrt{2}}, 1, 6 \\sqrt{2}, 8., 5} \\cup {6 \\sqrt{2}, -2.6, -3 \\sqrt{2}, 5, -7 \\sqrt{2}, -7}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -\\frac{11}{\\sqrt{2}}, -7, -3 \\sqrt{2}, -2.6, 1, 5, 8., 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(2), -(11/(math.sqrt(2))), 1, 6*math.sqrt(2), 8., 5,))\nsnd = set((6*math.sqrt(2), -2.6, -3*math.sqrt(2), 5, -7*math.sqrt(2), -7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 15, 18, 8}$.\n", - "Output Answer": [ - "$\\frac{288}{25}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 15, 18, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{4}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{22}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (4/(math.sqrt(5))), -(7/(math.sqrt(5))), (4/(math.sqrt(5))), -(7/(math.sqrt(5))), -(7/(math.sqrt(5))), (3/(math.sqrt(5))), -(22/(math.sqrt(5))), (3/(math.sqrt(5))), -(22/(math.sqrt(5))), -(7/(math.sqrt(5))), (3/(math.sqrt(5))), -(22/(math.sqrt(5))), -(22/(math.sqrt(5))), (1/(math.sqrt(5))), (9/(math.sqrt(5))), -(22/(math.sqrt(5))), (4/(math.sqrt(5))), -(22/(math.sqrt(5))), (9/(math.sqrt(5))), (1/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{5}, 3 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, 0, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{5}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(5), 3*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), 0, -3*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, -6, 0}$.\n", - "Output Answer": [ - "${-6, -3, 0}$" - ], - "Output Program": [ - "values = -3, -6, 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{17}{3}, \\frac{10}{\\pi }, -9, 3 \\sqrt{2}, -1, -5 \\sqrt{3}, -6, -9}$.", - "Output Answer": [ - "$-\\frac{7}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (17/3), (10/math.pi), -9, 3*math.sqrt(2), -1, -5*math.sqrt(3), -6, -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{7}{2}, -\\frac{1}{2}, \\frac{19}{2}, 1}$.\n", - "Output Answer": [ - "$\\frac{27}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (7/2), -(1/2), (19/2), 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 4096, 2401, -9, -343}$.\n", - "Output Answer": [ - "$28\\ 6^{4/5} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 4096, 2401, -9, -343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3 e, 8, -4 \\sqrt{2}, -\\frac{13}{2}, -\\frac{10}{\\sqrt{3}}, 9, -3 e} \\cup {-\\frac{10}{\\sqrt{3}}, 3 e, -e, -6 \\sqrt{2}, 9}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -3 e, -\\frac{13}{2}, -\\frac{10}{\\sqrt{3}}, -4 \\sqrt{2}, -e, 8, 3 e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.e, 8, -4*math.sqrt(2), -(13/2), -(10/(math.sqrt(3))), 9, -3*math.e,))\nsnd = set((-(10/(math.sqrt(3))), 3*math.e, -math.e, -6*math.sqrt(2), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 8, 7, 3}$.\n", - "Output Answer": [ - "$\\frac{672}{157}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 8, 7, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6.318, 8}$.\n", - "Output Answer": [ - "${6.318, 8}$" - ], - "Output Program": [ - "values = 6.318, 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.8 x^2+2.6 x-1.3$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$-22.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(-1.8*x**2+2.6*x-1.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 10, 4}$.\n", - "Output Answer": [ - "$156$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 10, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3, -8, 3 e, -\\frac{17}{4}} \\cup {-10, -8, e, -\\frac{17}{4}}$.\n", - "Output Answer": [ - "${-10, -8, -\\frac{17}{4}, e, 3, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -8, 3*math.e, -(17/4),))\nsnd = set((-10, -8, math.e, -(17/4),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4 \\sqrt{5}, -\\frac{17}{7}, 5 \\sqrt{3}, \\frac{1}{2}, 0, -6, 6 \\log (2)} \\cup {\\frac{16}{3}, -\\frac{48}{7}, -3 \\sqrt{5}, 2 \\sqrt{3}, 6 \\log (2), -6, \\frac{1}{2}}$.\n", - "Output Answer": [ - "${-\\frac{48}{7}, -3 \\sqrt{5}, -6, -\\frac{17}{7}, 0, \\frac{1}{2}, 2 \\sqrt{3}, 6 \\log (2), \\frac{16}{3}, 5 \\sqrt{3}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), -(17/7), 5*math.sqrt(3), (1/2), 0, -6, 6*math.log(2),))\nsnd = set(((16/3), -(48/7), -3*math.sqrt(5), 2*math.sqrt(3), 6*math.log(2), -6, (1/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.215,0.094,0.198,0.116,0.138,0.079,0.105\\}$ and $\\{0.216,0.199,0.054,0.06,0.023,0.099,0.241\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.215, 0.094, 0.198, 0.116, 0.138, 0.079, 0.105\ndistribution2 = 0.216, 0.199, 0.054, 0.06, 0.023, 0.099, 0.241\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{5}{3}, 14}$.\n", - "Output Answer": [ - "$\\frac{1260}{317}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (5/3), 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{13}{\\sqrt{2}}, -9, 4, 8, 7} \\cup {7, 4, 9, 2 \\sqrt{2}, 0, -1}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -9, -1, 0, 2 \\sqrt{2}, 4, 7, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/(math.sqrt(2))), -9, 4, 8, 7,))\nsnd = set((7, 4, 9, 2*math.sqrt(2), 0, -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, \\frac{55}{3}}$.\n", - "Output Answer": [ - "$\\frac{165}{32}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, (55/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -3, -6}$.\n", - "Output Answer": [ - "$-\\frac{17}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -3, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x-1.4$ where $x \\sim $ \\text{NormalDistribution}[-1.9,2.7]\n", - "Output Answer": [ - "$2.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.9, 2.7)\nprint(E(-2.*x-1.4))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-10, 9, -8, \\frac{21}{5}, 1, 4, -7} \\cup {9, 3, -9, -10, -8, \\frac{13}{5}, 4, 1}$.\n", - "Output Answer": [ - "${-10, -9, -8, -7, 1, \\frac{13}{5}, 3, 4, \\frac{21}{5}, 9}$" - ], - "Output Program": [ - "fst = set((-10, 9, -8, (21/5), 1, 4, -7,))\nsnd = set((9, 3, -9, -10, -8, (13/5), 4, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -7, \\pi, 4 \\sqrt{2}, -6} \\cup {-7, 4 \\sqrt{2}, -1, 8, 2 \\pi}$.\n", - "Output Answer": [ - "${-7, -6, -1, \\pi, 4 \\sqrt{2}, 2 \\pi, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -7, math.pi, 4*math.sqrt(2), -6,))\nsnd = set((-7, 4*math.sqrt(2), -1, 8, 2*math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -10, 4.204} \\cup {-5, -6.413, -10, 0}$.\n", - "Output Answer": [ - "${-10, -6.413, -5, 0, 4.204}$" - ], - "Output Program": [ - "fst = set((0, -10, 4.204,))\nsnd = set((-5, -6.413, -10, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 13, -15, 5, 3}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{131}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 13, -15, 5, 3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.6 x^2-2.6 x+2.9$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$-140.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(-2.6*x**2-2.6*x+2.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\frac{7}{e}, -9, -\\frac{34}{5}, -5, 3 \\pi, 5 \\sqrt{3}} \\setminus {-9, -4, -4 \\sqrt{5}, -\\frac{37}{5}, -\\frac{34}{5}, \\frac{7}{e}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5, 0, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (7/math.e), -9, -(34/5), -5, 3*math.pi, 5*math.sqrt(3),))\nsnd = set((-9, -4, -4*math.sqrt(5), -(37/5), -(34/5), (7/math.e), 5*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, 4, -3, \\frac{2}{\\pi }, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{16}{3}, 8, \\frac{14}{\\sqrt{\\pi }}, 2, 7, 9}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 4, -3, (2/math.pi), -(13/(math.sqrt(math.pi))), -(16/3), 8, (14/(math.sqrt(math.pi))), 2, 7, 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.077,0.21,0.037,0.122,0.308,0.126,0.055\\}$ and $\\{0.27,0.149,0.128,0.049,0.012,0.046,0.197\\}$.", - "Output Answer": [ - "$1.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.077, 0.21, 0.037, 0.122, 0.308, 0.126, 0.055\ndistribution2 = 0.27, 0.149, 0.128, 0.049, 0.012, 0.046, 0.197\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -7, 0, -4, -6, 7}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -7, 0, -4, -6, 7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5 \\sqrt{2}, -2, -4, -7, 1}$.\n", - "Output Answer": [ - "$1+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(2), -2, -4, -7, 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{4}{\\sqrt{5}}, -6, -2, \\frac{13}{\\sqrt{\\pi }}, -8, -3 e, -4 \\sqrt{3}, \\frac{7}{\\sqrt{3}}, 1, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$3 e+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (4/(math.sqrt(5))), -6, -2, (13/(math.sqrt(math.pi))), -8, -3*math.e, -4*math.sqrt(3), (7/(math.sqrt(3))), 1, -3*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, 8 \\log (2), 3, -3 \\log (2)}$.", - "Output Answer": [ - "$\\frac{1}{2} (3-3 \\log (2))$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, 8*math.log(2), 3, -3*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, \\frac{13}{\\pi }, -6, -3, 8.11} \\setminus {9, 2, -3, -4.44}$.\n", - "Output Answer": [ - "${-6, \\frac{13}{\\pi }, 8.11}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, (13/math.pi), -6, -3, 8.11,))\nsnd = set((9, 2, -3, -4.44,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, -15, -3, 3, -9}$.\n", - "Output Answer": [ - "$3 \\sqrt{\\frac{41}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -15, -3, 3, -9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -3., 4, -\\frac{2}{e}} \\setminus {\\sqrt{2}, -5, \\frac{26}{e}, -9., -2, 4}$.\n", - "Output Answer": [ - "${-9, -3., -\\frac{2}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -3., 4, -(2/math.e),))\nsnd = set((math.sqrt(2), -5, (26/math.e), -9., -2, 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2, 0.791, -4, -1, 6, 2}$.\n", - "Output Answer": [ - "${-4, -1, 0.791, 2, 2, 6}$" - ], - "Output Program": [ - "values = 2, 0.791, -4, -1, 6, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, -512, 64, 16807, 25, 64}$.\n", - "Output Answer": [ - "$16 \\sqrt[6]{-1} \\sqrt{2} \\sqrt[3]{5} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, -512, 64, 16807, 25, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 8, 9, -4, -\\frac{8}{7}, \\log (2), -7, -6 \\sqrt{2}, -6 \\sqrt{3}, 2 \\sqrt{5}} \\cup {\\log (2), -\\frac{11}{\\sqrt{2}}, -2, 1, 2 \\sqrt{5}, \\frac{48}{7}, 5, -6 \\sqrt{3}, -4}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -6 \\sqrt{2}, -\\frac{11}{\\sqrt{2}}, -7, -4, -2, -\\frac{8}{7}, \\log (2), 1, 2 \\sqrt{5}, 5, \\frac{48}{7}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 8, 9, -4, -(8/7), math.log(2), -7, -6*math.sqrt(2), -6*math.sqrt(3), 2*math.sqrt(5),))\nsnd = set((math.log(2), -(11/(math.sqrt(2))), -2, 1, 2*math.sqrt(5), (48/7), 5, -6*math.sqrt(3), -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, -8, 8, -5, 7, 0, -\\sqrt{2}, \\frac{6}{\\sqrt{5}}}$.", - "Output Answer": [ - "$\\frac{3}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -8, 8, -5, 7, 0, -math.sqrt(2), (6/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4 \\sqrt{2}, -8, -9, 8, -\\frac{16}{7}, 3, 2, 4}$.\n", - "Output Answer": [ - "${-9, -8, -4 \\sqrt{2}, -\\frac{16}{7}, 2, 3, 4, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(2), -8, -9, 8, -(16/7), 3, 2, 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 3, 6, -5}$.\n", - "Output Answer": [ - "$\\frac{13}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 3, 6, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 5, 5, 1, -5, -9, -5, -9, 0, -5, 1, 1, 1, 0, -5, 1, 1, 8, 5, 5, 7}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 5, 5, 1, -5, -9, -5, -9, 0, -5, 1, 1, 1, 0, -5, 1, 1, 8, 5, 5, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{22}{3}, \\frac{56}{3}, 18}$.\n", - "Output Answer": [ - "$\\frac{16632}{1361}$" - ], - "Output Program": [ - "import statistics\nvalues = (22/3), (56/3), 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, 15, -12, -9, 15, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1527}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 15, -12, -9, 15, -9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-11 \\log (2), 9, -7, -\\frac{11}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} (-7-11 \\log (2))$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -11*math.log(2), 9, -7, -(11/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{\\sqrt{\\pi }}, \\pi, -\\frac{41}{5}, -4 \\log (2), -13 \\log (2)}$.\n", - "Output Answer": [ - "$\\pi +13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/(math.sqrt(math.pi))), math.pi, -(41/5), -4*math.log(2), -13*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${10, -9, -2, 4, \\sqrt{3}, 6, \\frac{33}{4}}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 10, -9, -2, 4, math.sqrt(3), 6, (33/4)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, 0, 3, 2 \\sqrt{5}, \\frac{59}{7}, 5}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, 0, 3, 2*math.sqrt(5), (59/7), 5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${216, 100, 16}$.\n", - "Output Answer": [ - "$24\\ 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 216, 100, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3, 4.2, -8, 3 \\pi, -\\frac{9}{\\sqrt{2}}} \\cup {-2 \\pi, -\\frac{9}{\\sqrt{2}}, 4.2, -2}$.\n", - "Output Answer": [ - "${-8, -\\frac{9}{\\sqrt{2}}, -2 \\pi, -2, 3, 4.2, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 4.2, -8, 3*math.pi, -(9/(math.sqrt(2))),))\nsnd = set((-2*math.pi, -(9/(math.sqrt(2))), 4.2, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, -6, 6, 5, -\\frac{9}{\\sqrt{2}}} \\setminus {6, -6, 5}$.\n", - "Output Answer": [ - "${-\\frac{9}{\\sqrt{2}}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -6, 6, 5, -(9/(math.sqrt(2))),))\nsnd = set((6, -6, 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 7, 1, -1}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 7, 1, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 4, -7, \\frac{16}{\\sqrt{\\pi }}, -2 \\sqrt{5}, -\\pi, 8, -e, -4, -8, -1}$.\n", - "Output Answer": [ - "$8+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 4, -7, (16/(math.sqrt(math.pi))), -2*math.sqrt(5), -math.pi, 8, -math.e, -4, -8, -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6 \\log (2), 4, \\frac{6}{7}, -7, 7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$7+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 6*math.log(2), 4, (6/7), -7, 7*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 e, -e, -9, \\frac{11}{\\sqrt{3}}, -e, -10, \\frac{5}{\\pi }, -13 \\log (2), 2, -4, \\frac{7}{\\sqrt{2}}, -\\frac{66}{7}, 7 \\log (2)}$.", - "Output Answer": [ - "$-e$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.e, -math.e, -9, (11/(math.sqrt(3))), -math.e, -10, (5/math.pi), -13*math.log(2), 2, -4, (7/(math.sqrt(2))), -(66/7), 7*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6 \\sqrt{2}, -\\frac{16}{5}, -3, 0, 2 \\pi, -9, -4, 5, -5, -2}$.", - "Output Answer": [ - "$-\\frac{31}{10}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6*math.sqrt(2), -(16/5), -3, 0, 2*math.pi, -9, -4, 5, -5, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.1 x^3-4.8 x^2-0.7 x+3.8$ where $x \\sim $ \\text{PoissonDistribution}[2.6]\n", - "Output Answer": [ - "$-38.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.6)\nprint(E(0.1*x**3-4.8*x**2-0.7*x+3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 10000, 1, -1, 49}$.\n", - "Output Answer": [ - "$2 \\sqrt[5]{-2} 5^{4/5} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 10000, 1, -1, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{12}{\\sqrt{\\pi }}, -8, 4, -\\frac{10}{3}, -3 \\sqrt{5}} \\setminus {-8, -13 \\log (2), -\\frac{6}{\\sqrt{\\pi }}, -3 \\sqrt{5}, 1, -9}$.\n", - "Output Answer": [ - "${-\\frac{12}{\\sqrt{\\pi }}, -\\frac{10}{3}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(12/(math.sqrt(math.pi))), -8, 4, -(10/3), -3*math.sqrt(5),))\nsnd = set((-8, -13*math.log(2), -(6/(math.sqrt(math.pi))), -3*math.sqrt(5), 1, -9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6 \\sqrt{2}, -0.11, 6.73, \\frac{18}{\\sqrt{5}}, -8, -9 \\log (2), -\\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -8, -9 \\log (2), -\\frac{7}{\\sqrt{3}}, -0.11, 6.73, \\frac{18}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.sqrt(2), -0.11, 6.73, (18/(math.sqrt(5))), -8, -9*math.log(2), -(7/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{2}, 0, 0}$.\n", - "Output Answer": [ - "$\\frac{11}{2}$" - ], - "Output Program": [ - "values = (11/2), 0, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{11}{\\sqrt{3}}, \\frac{1}{\\sqrt{5}}, -10, 0}$.", - "Output Answer": [ - "$-\\frac{11}{2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(11/(math.sqrt(3))), (1/(math.sqrt(5))), -10, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.9 x^3+4.9 x^2+3.5 x+3.7$ where $x \\sim $ \\text{BetaDistribution}[1.6,1.]\n", - "Output Answer": [ - "$7.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 1.)\nprint(E(-0.9*x**3+4.9*x**2+3.5*x+3.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 4, -10}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 4, -10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -9, 3 e, -\\frac{17}{7}, -\\frac{17}{\\sqrt{5}}, 4, -7, -4, -3 \\sqrt{5}, 10}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -9, 3*math.e, -(17/7), -(17/(math.sqrt(5))), 4, -7, -4, -3*math.sqrt(5), 10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, -\\frac{11}{\\pi }, 3, \\frac{11}{2}}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\pi }, 3, \\frac{11}{2}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -(11/math.pi), 3, (11/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.084,0.017,0.089,0.034,0.035,0.085,0.138,0.157,0.152,0.088\\}$ and $\\{0.042,0.086,0.13,0.295,0.086,0.007,0.012,0.034,0.011,0.007\\}$.", - "Output Answer": [ - "$1.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.084, 0.017, 0.089, 0.034, 0.035, 0.085, 0.138, 0.157, 0.152, 0.088\ndistribution2 = 0.042, 0.086, 0.13, 0.295, 0.086, 0.007, 0.012, 0.034, 0.011, 0.007\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{17}{\\sqrt{3}}, \\frac{9}{e}}$.\n", - "Output Answer": [ - "$\\frac{17}{\\sqrt{3}}-\\frac{9}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = (17/(math.sqrt(3))), (9/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6 \\sqrt{2}, -\\frac{12}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+\\frac{12}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6*math.sqrt(2), -(12/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, 5 \\sqrt{3}, -\\frac{13}{3}, -9, \\frac{6}{7}, -4, -\\frac{13}{2}} \\cup {5 \\sqrt{3}, -\\frac{19}{4}, -\\frac{13}{2}, -2 \\pi, -\\frac{37}{7}, -9, -7, -\\frac{13}{3}, -3}$.\n", - "Output Answer": [ - "${-9, -7, -\\frac{13}{2}, -2 \\pi, -\\frac{37}{7}, -\\frac{19}{4}, -\\frac{13}{3}, -4, -3, \\frac{6}{7}, 7, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 5*math.sqrt(3), -(13/3), -9, (6/7), -4, -(13/2),))\nsnd = set((5*math.sqrt(3), -(19/4), -(13/2), -2*math.pi, -(37/7), -9, -7, -(13/3), -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, -10, 4}$.\n", - "Output Answer": [ - "$2 \\sqrt[3]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -10, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 16, \\frac{49}{3}}$.\n", - "Output Answer": [ - "$\\frac{7056}{1075}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 16, (49/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, 8, \\frac{3}{4}, 6, -7, 4, -6, -5} \\setminus {-3, \\frac{3}{4}, 8, -5, 5, -6, 6}$.\n", - "Output Answer": [ - "${-7, 4}$" - ], - "Output Program": [ - "fst = set((5, 8, (3/4), 6, -7, 4, -6, -5,))\nsnd = set((-3, (3/4), 8, -5, 5, -6, 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, -2 \\sqrt{5}, 3 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, 3 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), -2*math.sqrt(5), 3*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), 3*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.041,0.233,0.002,0.256,0.116,0.243\\}$ and $\\{0.13,0.147,0.115,0.206,0.164,0.065\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.041, 0.233, 0.002, 0.256, 0.116, 0.243\ndistribution2 = 0.13, 0.147, 0.115, 0.206, 0.164, 0.065\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${512, -216, 1}$.\n", - "Output Answer": [ - "$48 \\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = 512, -216, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${10, 2, 0, -2, 1}$.\n", - "Output Answer": [ - "${-2, 0, 1, 2, 10}$" - ], - "Output Program": [ - "values = 10, 2, 0, -2, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -4.8, -7, \\frac{2}{e}, 3} \\cup {3, -4.8, -\\frac{21}{e}, -4, 2, 7, -6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -\\frac{21}{e}, -7, -6, -4.8, -4, \\frac{2}{e}, 2, 3, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -4.8, -7, (2/math.e), 3,))\nsnd = set((3, -4.8, -(21/math.e), -4, 2, 7, -6*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, -5 \\sqrt{2}, 2, 4 \\sqrt{3}, 1, \\frac{6}{e}, 8.839, 3}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -2, 1, 2, \\frac{6}{e}, 3, 4 \\sqrt{3}, 8.839}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -5*math.sqrt(2), 2, 4*math.sqrt(3), 1, (6/math.e), 8.839, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.041,0.104,0.016,0.133,0.216,0.135,0.07,0.101\\}$ and $\\{0.041,0.25,0.171,0.025,0.109,0.043,0.042,0.188\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.041, 0.104, 0.016, 0.133, 0.216, 0.135, 0.07, 0.101\ndistribution2 = 0.041, 0.25, 0.171, 0.025, 0.109, 0.043, 0.042, 0.188\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 14, 13}$.\n", - "Output Answer": [ - "$\\frac{546}{209}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 14, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${10, 2, -8, 0, -1, -6, -6}$.\n", - "Output Answer": [ - "$-\\frac{9}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 10, 2, -8, 0, -1, -6, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{26}{\\pi }, -5, \\frac{47}{7}, 5 \\sqrt{2}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$5+\\frac{26}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (26/math.pi), -5, (47/7), 5*math.sqrt(2), math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.219,0.182,0.135,0.126,0.131,0.123\\}$ and $\\{0.201,0.098,0.001,0.301,0.238,0.101\\}$.", - "Output Answer": [ - "$0.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.219, 0.182, 0.135, 0.126, 0.131, 0.123\ndistribution2 = 0.201, 0.098, 0.001, 0.301, 0.238, 0.101\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${14 \\log (2), -7 \\log (2), 14 \\log (2), 14 \\log (2), 14 \\log (2), -7 \\log (2), -2 \\log (2), 14 \\log (2), -7 \\log (2), -7 \\log (2), 14 \\log (2), 14 \\log (2), -11 \\log (2), -7 \\log (2), -11 \\log (2), -11 \\log (2), -2 \\log (2), -11 \\log (2), -7 \\log (2), -11 \\log (2)}$.\n", - "Output Answer": [ - "$\\{14 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 14*math.log(2), -7*math.log(2), 14*math.log(2), 14*math.log(2), 14*math.log(2), -7*math.log(2), -2*math.log(2), 14*math.log(2), -7*math.log(2), -7*math.log(2), 14*math.log(2), 14*math.log(2), -11*math.log(2), -7*math.log(2), -11*math.log(2), -11*math.log(2), -2*math.log(2), -11*math.log(2), -7*math.log(2), -11*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{42}{5}, -\\frac{33}{5}, \\frac{3}{5}, -\\frac{44}{5}}$.\n", - "Output Answer": [ - "$-\\frac{29}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(42/5), -(33/5), (3/5), -(44/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, \\frac{4}{\\pi }, -7, 10, 4 \\sqrt{2}, \\frac{26}{\\pi }, -\\frac{15}{\\pi }, 7, -\\frac{13}{\\sqrt{2}}, -6, 8}$.", - "Output Answer": [ - "$\\frac{4}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, (4/math.pi), -7, 10, 4*math.sqrt(2), (26/math.pi), -(15/math.pi), 7, -(13/(math.sqrt(2))), -6, 8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -\\frac{11}{\\sqrt{\\pi }}, -3, 4, -7, 7, \\frac{13}{3}, 2 \\sqrt{5}, -10, -6, 5, -9}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(11/(math.sqrt(math.pi))), -3, 4, -7, 7, (13/3), 2*math.sqrt(5), -10, -6, 5, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, 3 \\sqrt{2}, 4.959, 0, -3, \\frac{5}{\\sqrt{2}}, 6.496}$.\n", - "Output Answer": [ - "${-4, -3, 0, \\frac{5}{\\sqrt{2}}, 3 \\sqrt{2}, 4.959, 6.496}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 3*math.sqrt(2), 4.959, 0, -3, (5/(math.sqrt(2))), 6.496\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 e, 2 e, 2 e, e, e, 0, -2 e, e}$.\n", - "Output Answer": [ - "$e$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.e, 2*math.e, 2*math.e, math.e, math.e, 0, -2*math.e, math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{14}{5}, \\frac{14}{5}, \\frac{26}{5}, -\\frac{37}{5}, -\\frac{29}{5}, \\frac{14}{5}, \\frac{26}{5}, \\frac{26}{5}, -\\frac{29}{5}, \\frac{26}{5}, \\frac{14}{5}, \\frac{14}{5}, -\\frac{29}{5}, \\frac{14}{5}, -\\frac{29}{5}, -\\frac{29}{5}, -\\frac{37}{5}, 1, \\frac{26}{5}, -\\frac{29}{5}, -\\frac{29}{5}, -\\frac{37}{5}, -\\frac{37}{5}, \\frac{26}{5}, -\\frac{29}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{29}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (14/5), (14/5), (26/5), -(37/5), -(29/5), (14/5), (26/5), (26/5), -(29/5), (26/5), (14/5), (14/5), -(29/5), (14/5), -(29/5), -(29/5), -(37/5), 1, (26/5), -(29/5), -(29/5), -(37/5), -(37/5), (26/5), -(29/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{8}{e}, 6, 8 \\log (2), \\frac{11}{\\sqrt{3}}, 6, 9, -3, -4 \\sqrt{2}, -\\frac{31}{7}, 8, 3 \\log (2), 7}$.\n", - "Output Answer": [ - "$9+4 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(8/math.e), 6, 8*math.log(2), (11/(math.sqrt(3))), 6, 9, -3, -4*math.sqrt(2), -(31/7), 8, 3*math.log(2), 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{36}{5}, -\\frac{42}{5}, \\frac{9}{5}, \\frac{36}{5}, -\\frac{42}{5}, \\frac{9}{5}, \\frac{9}{5}, -\\frac{42}{5}, -\\frac{49}{5}, -8, -\\frac{42}{5}, \\frac{9}{5}, -\\frac{8}{5}, -\\frac{42}{5}, -\\frac{8}{5}, \\frac{36}{5}, -\\frac{42}{5}, \\frac{36}{5}, \\frac{36}{5}, -\\frac{49}{5}, -\\frac{42}{5}, \\frac{36}{5}, \\frac{36}{5}, \\frac{36}{5}, -\\frac{42}{5}, -\\frac{42}{5}, \\frac{9}{5}, -8, -8}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{42}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (36/5), -(42/5), (9/5), (36/5), -(42/5), (9/5), (9/5), -(42/5), -(49/5), -8, -(42/5), (9/5), -(8/5), -(42/5), -(8/5), (36/5), -(42/5), (36/5), (36/5), -(49/5), -(42/5), (36/5), (36/5), (36/5), -(42/5), -(42/5), (9/5), -8, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2-2.6 x-4.9$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$62.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(4.4*x**2-2.6*x-4.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$-\\frac{3 \\sqrt{3}}{4}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -5*math.sqrt(3), (13/(math.sqrt(3))), -(2/(math.sqrt(3))), -(5/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.26 < 1.3 x-2.3 < -1.66$ where $x \\sim $ \\text{NormalDistribution}[-0.3,1.].", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.3, 1.)\nprint(P((-2.26 < 1.3*x-2.3) & (1.3*x-2.3 < -1.66)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{9}{\\sqrt{5}}, 0, 13 \\log (2), -\\frac{17}{\\sqrt{5}}, -4, 1, \\sqrt{5}, 0, 2, \\frac{4}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(9/(math.sqrt(5))), 0, 13*math.log(2), -(17/(math.sqrt(5))), -4, 1, math.sqrt(5), 0, 2, (4/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, -1, -125, 16}$.\n", - "Output Answer": [ - "$10 \\sqrt{2} \\sqrt[4]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, -1, -125, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{28}{\\pi }, -\\frac{31}{\\pi }, \\frac{5}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{18}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(28/math.pi), -(31/math.pi), (5/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 5, -2 \\sqrt{3}, 8} \\setminus {-4 \\sqrt{3}, 2.5, -2 \\sqrt{3}, \\frac{22}{\\sqrt{5}}, -6, 8}$.\n", - "Output Answer": [ - "${5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 5, -2*math.sqrt(3), 8,))\nsnd = set((-4*math.sqrt(3), 2.5, -2*math.sqrt(3), (22/(math.sqrt(5))), -6, 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, \\frac{13}{2}, -\\frac{29}{5}, -\\frac{2}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{29}{5}, -\\frac{2}{\\sqrt{3}}, 1, \\frac{13}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, (13/2), -(29/5), -(2/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{21}{4}, \\frac{9}{4}}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(21/4), (9/4)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.084,0.076,0.204,0.19,0.119,0.016,0.15,0.078\\}$ and $\\{0.067,0.125,0.101,0.065,0.08,0.171,0.155,0.105\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.084, 0.076, 0.204, 0.19, 0.119, 0.016, 0.15, 0.078\ndistribution2 = 0.067, 0.125, 0.101, 0.065, 0.08, 0.171, 0.155, 0.105\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-59049, 16, -1024, 1, 3125}$.\n", - "Output Answer": [ - "$180\\ 2^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -59049, 16, -1024, 1, 3125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-3.46 < -3.4 x^2-0.2 x+0.8 < -2.02$ where $x \\sim $ \\text{NormalDistribution}[-0.6,1.3].", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.6, 1.3)\nprint(P((-3.46 < -3.4*x**2-0.2*x+0.8) & (-3.4*x**2-0.2*x+0.8 < -2.02)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{3}, 7, -\\frac{51}{7}, 7, -5, -3, -\\frac{10}{\\pi }, 2, \\frac{4}{\\sqrt{\\pi }}, 2 \\sqrt{3}, -7, 12 \\log (2), 2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(3), 7, -(51/7), 7, -5, -3, -(10/math.pi), 2, (4/(math.sqrt(math.pi))), 2*math.sqrt(3), -7, 12*math.log(2), 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{3}, -6, \\frac{25}{7}, -9, 10, -9., 0, \\sqrt{3}, \\frac{9}{\\sqrt{2}}} \\cup {-2 \\sqrt{3}, 10, -9., 4 \\sqrt{3}, 5, -6, \\frac{9}{\\sqrt{2}}, \\frac{2}{7}, 2, -9}$.\n", - "Output Answer": [ - "${-9., -9, -6, -3 \\sqrt{3}, -2 \\sqrt{3}, 0, \\frac{2}{7}, \\sqrt{3}, 2, \\frac{25}{7}, 5, \\frac{9}{\\sqrt{2}}, 4 \\sqrt{3}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(3), -6, (25/7), -9, 10, -9., 0, math.sqrt(3), (9/(math.sqrt(2))),))\nsnd = set((-2*math.sqrt(3), 10, -9., 4*math.sqrt(3), 5, -6, (9/(math.sqrt(2))), (2/7), 2, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${10, 10, -14}$.\n", - "Output Answer": [ - "$192$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 10, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, 1, 7}$.\n", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, 1, 7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 5, 6, 8, 6, 6, 6, 8, 6, 5, 0, 5, 5, -5, -5, 5, -5, 5, 6, 6, 5, 6, -5, -5, 8, 8, -5, -5, 6, 6}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 5, 6, 8, 6, 6, 6, 8, 6, 5, 0, 5, 5, -5, -5, 5, -5, 5, 6, 6, 5, 6, -5, -5, 8, 8, -5, -5, 6, 6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -6, -3 \\sqrt{5}, 0, -\\frac{24}{7}} \\setminus {-\\frac{19}{2}, -7, -\\frac{24}{7}, -6, -3 \\sqrt{5}, 0}$.\n", - "Output Answer": [ - "${-4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -6, -3*math.sqrt(5), 0, -(24/7),))\nsnd = set((-(19/2), -7, -(24/7), -6, -3*math.sqrt(5), 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 1, 1, 27}$.\n", - "Output Answer": [ - "$7\\ 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 1, 1, 27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, -3 \\pi, 9, 3, \\frac{7}{\\sqrt{2}}, -2 e, 7, -3}$.\n", - "Output Answer": [ - "${-3 \\pi, -2 e, -3, 0, 3, \\frac{7}{\\sqrt{2}}, 7, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -3*math.pi, 9, 3, (7/(math.sqrt(2))), -2*math.e, 7, -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3 e, -5 \\log (2)}$.\n", - "Output Answer": [ - "${-5 \\log (2), 3 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.e, -5*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.006,0.079,0.076,0.015,0.34\\}$ and $\\{0.233,0.062,0.031,0.464,0.109\\}$.", - "Output Answer": [ - "$1.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.006, 0.079, 0.076, 0.015, 0.34\ndistribution2 = 0.233, 0.062, 0.031, 0.464, 0.109\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\pi, \\frac{68}{7}, 3 e, \\frac{10}{\\pi }, -\\frac{29}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{68}{7}+\\frac{29}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.pi, (68/7), 3*math.e, (10/math.pi), -(29/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -8, \\frac{7}{\\sqrt{\\pi }}, 3, -9, 0, 8} \\setminus {-2, 3, -6, \\frac{7}{\\sqrt{\\pi }}, -7, 10}$.\n", - "Output Answer": [ - "${-9, -8, 0, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -8, (7/(math.sqrt(math.pi))), 3, -9, 0, 8,))\nsnd = set((-2, 3, -6, (7/(math.sqrt(math.pi))), -7, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, 4 \\sqrt{2}, 5, 2, 1} \\cup {1, 0, 4, 5, -9}$.\n", - "Output Answer": [ - "${-9, 0, 1, 2, 4, 5, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 4*math.sqrt(2), 5, 2, 1,))\nsnd = set((1, 0, 4, 5, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 6, -4}$.\n", - "Output Answer": [ - "$\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 6, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{22}{\\pi }, \\frac{12}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{5}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(22/math.pi), (12/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{67}{7}, -\\frac{66}{7}, \\frac{52}{7}, \\frac{24}{7}, -\\frac{64}{7}}$.\n", - "Output Answer": [ - "$-\\frac{121}{35}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(67/7), -(66/7), (52/7), (24/7), -(64/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1.5, -10, -2}$.\n", - "Output Answer": [ - "${-10, -2, -1.5}$" - ], - "Output Program": [ - "values = -1.5, -10, -2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.174,0.093,0.153,0.135,0.116,0.1,0.081\\}$ and $\\{0.057,0.139,0.11,0.148,0.121,0.141,0.058,0.114\\}$.", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.174, 0.093, 0.153, 0.135, 0.116, 0.1, 0.081\ndistribution2 = 0.057, 0.139, 0.11, 0.148, 0.121, 0.141, 0.058, 0.114\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{35}{2}, \\frac{19}{2}, 16}$.\n", - "Output Answer": [ - "$\\frac{31920}{2393}$" - ], - "Output Program": [ - "import statistics\nvalues = (35/2), (19/2), 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -3, -5, 7, -7}$.\n", - "Output Answer": [ - "$-\\frac{3}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -3, -5, 7, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5 \\sqrt{2}, 4, \\frac{8}{\\sqrt{3}}, -\\frac{7}{\\sqrt{2}}, -4, 5} \\cup {8, -4, 5 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -\\frac{13}{\\sqrt{3}}, 9}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{3}}, -\\frac{7}{\\sqrt{2}}, -4, 4, \\frac{8}{\\sqrt{3}}, 5, 5 \\sqrt{2}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), 4, (8/(math.sqrt(3))), -(7/(math.sqrt(2))), -4, 5,))\nsnd = set((8, -4, 5*math.sqrt(2), -(7/(math.sqrt(2))), -(13/(math.sqrt(3))), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, 7, -8}$.\n", - "Output Answer": [ - "${-8, -1, 7}$" - ], - "Output Program": [ - "values = -1, 7, -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.092,0.187,0.19,0.341\\}$ and $\\{0.087,0.291,0.307,0.206\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.092, 0.187, 0.19, 0.341\ndistribution2 = 0.087, 0.291, 0.307, 0.206\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.071,0.22,0.049,0.208,0.146,0.104,0.08,0.081\\}$ and $\\{0.083,0.057,0.059,0.265,0.126,0.099,0.12,0.077\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.071, 0.22, 0.049, 0.208, 0.146, 0.104, 0.08, 0.081\ndistribution2 = 0.083, 0.057, 0.059, 0.265, 0.126, 0.099, 0.12, 0.077\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x^2+4.2 x-2.2$ where $x \\sim $ \\text{NormalDistribution}[-1.8,2.6]\n", - "Output Answer": [ - "$30.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 2.6)\nprint(E(4.*x**2+4.2*x-2.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, 2, -14, 5}$.\n", - "Output Answer": [ - "$\\frac{329}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 2, -14, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{13}{\\sqrt{2}}, 2 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, 5 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{7} \\left(\\frac{13}{\\sqrt{2}}+7 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (13/(math.sqrt(2))), 2*math.sqrt(2), (3/(math.sqrt(2))), 5*math.sqrt(2), -(13/(math.sqrt(2))), (13/(math.sqrt(2))), -(3/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -\\frac{1}{4}, -7 \\log (2), 8, 4}$.\n", - "Output Answer": [ - "$8+7 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -(1/4), -7*math.log(2), 8, 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${5 \\sqrt{3}, \\frac{10}{\\sqrt{3}}, -3 \\sqrt{3}, 4 \\sqrt{3}} \\cap {-\\sqrt{3}, -\\frac{8}{\\sqrt{3}}, 4 \\sqrt{3}, \\frac{16}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(3), (10/(math.sqrt(3))), -3*math.sqrt(3), 4*math.sqrt(3),))\nsnd = set((-math.sqrt(3), -(8/(math.sqrt(3))), 4*math.sqrt(3), (16/(math.sqrt(3))), (13/(math.sqrt(3))),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 7, 5, 12}$.\n", - "Output Answer": [ - "$\\frac{3360}{463}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 7, 5, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{13}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, -\\frac{30}{\\pi }, 2 \\sqrt{3}, 5, -9} \\setminus {-5 \\sqrt{3}, \\frac{18}{\\sqrt{5}}, 6, 5, \\frac{32}{7}, -\\frac{30}{\\pi }, -9}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{5}}, 2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/(math.sqrt(5))), (18/(math.sqrt(5))), -(30/math.pi), 2*math.sqrt(3), 5, -9,))\nsnd = set((-5*math.sqrt(3), (18/(math.sqrt(5))), 6, 5, (32/7), -(30/math.pi), -9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x-0.1$ where $x \\sim $ \\text{BetaDistribution}[1.5,0.4]\n", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 0.4)\nprint(E(0.4*x-0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{49}{3}, 3, 6, 8}$.\n", - "Output Answer": [ - "$\\frac{1568}{269}$" - ], - "Output Program": [ - "import statistics\nvalues = (49/3), 3, 6, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -5, -3, 2} \\cup {-5, -7, 1, -3, -1}$.\n", - "Output Answer": [ - "${-7, -5, -3, -1, 1, 2}$" - ], - "Output Program": [ - "fst = set((-1, -5, -3, 2,))\nsnd = set((-5, -7, 1, -3, -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, -14, -1, -7, -4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{993}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -14, -1, -7, -4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -6, 8, -6, 0, 1, 0, 7, -9, \\frac{13}{2}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "values = -1, -6, 8, -6, 0, 1, 0, 7, -9, (13/2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8, \\frac{7}{e}, -9, 5, 4, 4 \\sqrt{3}, 8, -2, -4} \\cup {2, -9, -4 \\sqrt{3}, 0, 4, -5, 8}$.\n", - "Output Answer": [ - "${-9, -8, -4 \\sqrt{3}, -5, -4, -2, 0, 2, \\frac{7}{e}, 4, 5, 4 \\sqrt{3}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, (7/math.e), -9, 5, 4, 4*math.sqrt(3), 8, -2, -4,))\nsnd = set((2, -9, -4*math.sqrt(3), 0, 4, -5, 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 1, -5, 15, -12}$.\n", - "Output Answer": [ - "$\\frac{501}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 1, -5, 15, -12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{17}{2}, -4, \\frac{7}{2}}$.\n", - "Output Answer": [ - "$\\frac{8}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (17/2), -4, (7/2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{19}{2}, 2 \\pi, -\\frac{22}{3}, 0, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (19/2), 2*math.pi, -(22/3), 0, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{43}{5}, -\\frac{15}{2}, 2, -10, 8, 3, -8, -2 e, 7}$.", - "Output Answer": [ - "$-2 e$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(43/5), -(15/2), 2, -10, 8, 3, -8, -2*math.e, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{11}{\\sqrt{5}}, -4 \\sqrt{5}, -\\sqrt{5}, -\\frac{19}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{5} \\left(-\\frac{22}{\\sqrt{5}}-5 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(11/(math.sqrt(5))), -4*math.sqrt(5), -math.sqrt(5), -(19/(math.sqrt(5))), (8/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{29}{7}, 4 \\sqrt{5}, 9, -2, 8, -2, -7, \\sqrt{3}, -4, 0, \\frac{15}{\\sqrt{\\pi }}, -2 \\sqrt{3}, -8, 0, 2}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (29/7), 4*math.sqrt(5), 9, -2, 8, -2, -7, math.sqrt(3), -4, 0, (15/(math.sqrt(math.pi))), -2*math.sqrt(3), -8, 0, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{13}{4}, \\frac{12}{5}, -\\frac{11}{\\sqrt{3}}, \\frac{7}{2}, -7, -3} \\cup {-\\frac{11}{\\sqrt{3}}, -1, 0, -2, \\frac{13}{4}, -\\frac{3}{4}}$.\n", - "Output Answer": [ - "${-7, -\\frac{11}{\\sqrt{3}}, -3, -2, -1, -\\frac{3}{4}, 0, \\frac{12}{5}, \\frac{13}{4}, \\frac{7}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/4), (12/5), -(11/(math.sqrt(3))), (7/2), -7, -3,))\nsnd = set((-(11/(math.sqrt(3))), -1, 0, -2, (13/4), -(3/4),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{3}, -4 \\sqrt{3}, -2 \\sqrt{3}, \\sqrt{3}, -4 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -4 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, \\sqrt{3}, \\sqrt{3}, -4 \\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}, 0, 0, -4 \\sqrt{3}, \\sqrt{3}, -2 \\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-2 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(3), -4*math.sqrt(3), -2*math.sqrt(3), math.sqrt(3), -4*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -4*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), math.sqrt(3), math.sqrt(3), -4*math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3), 0, 0, -4*math.sqrt(3), math.sqrt(3), -2*math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, \\frac{20}{e}, -2 \\pi, -\\frac{18}{e}, -4}$.\n", - "Output Answer": [ - "${-\\frac{18}{e}, -2 \\pi, -4, -2, \\frac{20}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, (20/math.e), -2*math.pi, -(18/math.e), -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{9}{2}, \\frac{13}{2}, -2, 8, -2, \\frac{13}{2}, \\frac{9}{2}, -4, 8, -2, -2, -2, 8, -2, \\frac{13}{2}, \\frac{13}{2}, \\frac{9}{2}, \\frac{13}{2}, -2, -4, -4, -2, -2, -4, 8}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (9/2), (13/2), -2, 8, -2, (13/2), (9/2), -4, 8, -2, -2, -2, 8, -2, (13/2), (13/2), (9/2), (13/2), -2, -4, -4, -2, -2, -4, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -\\frac{17}{2}, -\\frac{17}{2}, -\\frac{17}{2}, 3, \\frac{13}{2}, -2, 3, -2, \\frac{13}{2}, \\frac{13}{2}, 3, -\\frac{17}{2}, -\\frac{17}{2}, \\frac{13}{2}, -2, \\frac{13}{2}, \\frac{13}{2}, \\frac{13}{2}, \\frac{1}{2}, \\frac{13}{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{13}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -(17/2), -(17/2), -(17/2), 3, (13/2), -2, 3, -2, (13/2), (13/2), 3, -(17/2), -(17/2), (13/2), -2, (13/2), (13/2), (13/2), (1/2), (13/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.117,0.132,0.066,0.195,0.197,0.196\\}$ and $\\{0.076,0.012,0.301,0.176,0.038,0.15\\}$.", - "Output Answer": [ - "$0.55$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.117, 0.132, 0.066, 0.195, 0.197, 0.196\ndistribution2 = 0.076, 0.012, 0.301, 0.176, 0.038, 0.15\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.8 x+4.4$ where $x \\sim $ \\text{NormalDistribution}[1.6,2.7]\n", - "Output Answer": [ - "$12.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.6, 2.7)\nprint(E(4.8*x+4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{7}{\\sqrt{2}}, -\\frac{12}{\\pi }, -\\frac{17}{2}, -\\frac{8}{3}, -\\log (2), 3, -6, -2, -2, -\\frac{39}{4}, \\frac{15}{4}, \\frac{7}{\\sqrt{5}}, -\\frac{11}{3}, 9}$.\n", - "Output Answer": [ - "$\\frac{75}{4}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/(math.sqrt(2))), -(12/math.pi), -(17/2), -(8/3), -math.log(2), 3, -6, -2, -2, -(39/4), (15/4), (7/(math.sqrt(5))), -(11/3), 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{3}{\\sqrt{2}}, 8, \\frac{3}{\\sqrt{2}}, \\frac{30}{\\pi }, -\\frac{31}{4}, -6, 9} \\cup {-6, -\\frac{3}{\\sqrt{2}}, 3, 8, 4 \\sqrt{2}, \\frac{30}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{31}{4}, -6, -\\frac{3}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, 3, 4 \\sqrt{2}, 8, 9, \\frac{30}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(3/(math.sqrt(2))), 8, (3/(math.sqrt(2))), (30/math.pi), -(31/4), -6, 9,))\nsnd = set((-6, -(3/(math.sqrt(2))), 3, 8, 4*math.sqrt(2), (30/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${0, 10, 11, -3, -5, -7}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{298}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 10, 11, -3, -5, -7\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 17, 19, 6}$.\n", - "Output Answer": [ - "$\\frac{2584}{395}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 17, 19, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-2, 25, -343, 4}$.\n", - "Output Answer": [ - "$\\sqrt{5} 14^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 25, -343, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.8 x^3+2.9 x^2-3.5 x+2.1$ where $x \\sim $ \\text{BetaDistribution}[0.8,1.5]\n", - "Output Answer": [ - "$0.96$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 1.5)\nprint(E(-3.8*x**3+2.9*x**2-3.5*x+2.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{3}, -1, -\\frac{5}{\\sqrt{2}}, -\\frac{31}{4}, 5, -4, 3 \\sqrt{5}, 3, -3, -7, -9, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(3), -1, -(5/(math.sqrt(2))), -(31/4), 5, -4, 3*math.sqrt(5), 3, -3, -7, -9, -7*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, 5, 9}$.\n", - "Output Answer": [ - "$\\sqrt{79}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 5, 9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{2}, -4, 5, \\frac{46}{5}, 8} \\cup {8, 2 \\sqrt{2}, 5, \\frac{32}{5}, -5}$.\n", - "Output Answer": [ - "${-5, -4, \\sqrt{2}, 2 \\sqrt{2}, 5, \\frac{32}{5}, 8, \\frac{46}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(2), -4, 5, (46/5), 8,))\nsnd = set((8, 2*math.sqrt(2), 5, (32/5), -5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x-8.4$ where $x \\sim $ \\text{PoissonDistribution}[3.5]\n", - "Output Answer": [ - "$-2.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(E(1.6*x-8.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 4096, 16807, 4, 1, 6}$.\n", - "Output Answer": [ - "$4 \\sqrt[6]{3} 14^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 4096, 16807, 4, 1, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 3, 0, 3, 0, 3, 2, 3, 0, -7, 0, 3, 2, 0, 3, -7, 0, -7, -7, 2, -7, 2, 3, 0, 3, 0, 0, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 3, 0, 3, 0, 3, 2, 3, 0, -7, 0, 3, 2, 0, 3, -7, 0, -7, -7, 2, -7, 2, 3, 0, 3, 0, 0, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, 9, 2 \\sqrt{2}, -7 \\log (2), 1, -2 \\sqrt{3}, \\frac{4}{\\sqrt{\\pi }}, 2 \\pi, -\\frac{26}{5}, -\\frac{26}{\\pi }, 2 \\sqrt{5}, 6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2 \\sqrt{2}+\\frac{4}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 9, 2*math.sqrt(2), -7*math.log(2), 1, -2*math.sqrt(3), (4/(math.sqrt(math.pi))), 2*math.pi, -(26/5), -(26/math.pi), 2*math.sqrt(5), 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{23}{5}, 0, 0, -6.55}$.\n", - "Output Answer": [ - "${-6.55, 0, 0, \\frac{23}{5}}$" - ], - "Output Program": [ - "values = (23/5), 0, 0, -6.55\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.099,0.053,0.132,0.124,0.068,0.15,0.146,0.119\\}$ and $\\{0.028,0.102,0.072,0.045,0.11,0.275,0.072,0.166\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.099, 0.053, 0.132, 0.124, 0.068, 0.15, 0.146, 0.119\ndistribution2 = 0.028, 0.102, 0.072, 0.045, 0.11, 0.275, 0.072, 0.166\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6 \\sqrt{2}, -\\frac{20}{7}, -4, 8, -7.89} \\cup {9.12, -\\frac{20}{7}, -4, -4 \\sqrt{2}, -7, 8}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -7.89, -7, -4 \\sqrt{2}, -4, -\\frac{20}{7}, 8, 9.12}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.sqrt(2), -(20/7), -4, 8, -7.89,))\nsnd = set((9.12, -(20/7), -4, -4*math.sqrt(2), -7, 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, 7} \\setminus {5, -4, -7, -12 \\log (2), -14 \\log (2), 1}$.\n", - "Output Answer": [ - "${7}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 7,))\nsnd = set((5, -4, -7, -12*math.log(2), -14*math.log(2), 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-10, 1, 100}$.\n", - "Output Answer": [ - "$10 \\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, 1, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.039,0.124,0.183,0.256\\}$ and $\\{0.016,0.165,0.249,0.116\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.039, 0.124, 0.183, 0.256\ndistribution2 = 0.016, 0.165, 0.249, 0.116\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 10, -1, 10, 5, -8, -8, -7, 5, -8, -8, -8, 5, -1, -7, 10, -7, -7, 5, -1, -7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 10, -1, 10, 5, -8, -8, -7, 5, -8, -8, -8, 5, -1, -7, 10, -7, -7, 5, -1, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 10, 5, 2}$.\n", - "Output Answer": [ - "$\\frac{40}{9}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 10, 5, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 216, 16}$.\n", - "Output Answer": [ - "$12 \\sqrt[3]{2} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 216, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.061,0.41,0.042,0.057,0.108,0.131\\}$ and $\\{0.083,0.017,0.093,0.149,0.191,0.401\\}$.", - "Output Answer": [ - "$1.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.061, 0.41, 0.042, 0.057, 0.108, 0.131\ndistribution2 = 0.083, 0.017, 0.093, 0.149, 0.191, 0.401\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 5, -9, 14}$.\n", - "Output Answer": [ - "$\\frac{494}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 5, -9, 14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.077,0.138,0.066,0.068,0.095,0.069,0.109,0.105,0.186\\}$ and $\\{0.161,0.136,0.072,0.045,0.078,0.156,0.012,0.13,0.004\\}$.", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.077, 0.138, 0.066, 0.068, 0.095, 0.069, 0.109, 0.105, 0.186\ndistribution2 = 0.161, 0.136, 0.072, 0.045, 0.078, 0.156, 0.012, 0.13, 0.004\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.4 x-0.7$ where $x \\sim $ \\text{PoissonDistribution}[2.1]\n", - "Output Answer": [ - "$-3.64$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.1)\nprint(E(-1.4*x-0.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 1, 1, -4, 5, 4, -8, -8}$.\n", - "Output Answer": [ - "$-\\frac{7}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 1, 1, -4, 5, 4, -8, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, 2, -12}$.\n", - "Output Answer": [ - "$\\frac{196}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 2, -12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, -4, -1}$.\n", - "Output Answer": [ - "$\\frac{139}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -4, -1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 3, 0.15, -\\frac{10}{\\sqrt{\\pi }}, \\frac{3}{2}, -8, 0} \\setminus {4, 1, -6, 4.82, 0.15, 3, 0}$.\n", - "Output Answer": [ - "${-8, -\\frac{10}{\\sqrt{\\pi }}, -3, \\frac{3}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 3, 0.15, -(10/(math.sqrt(math.pi))), (3/2), -8, 0,))\nsnd = set((4, 1, -6, 4.82, 0.15, 3, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 5, 3, -1}$.\n", - "Output Answer": [ - "$\\frac{15}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 5, 3, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x-4.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$-5.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(-2.*x-4.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, -14, -14}$.\n", - "Output Answer": [ - "$9 \\sqrt{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -14, -14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.003,0.049,0.006,0.724,0.037,0.003,0.018,0.158\\}$ and $\\{0.189,0.099,0.201,0.11,0.129,0.037,0.019,0.031\\}$.", - "Output Answer": [ - "$1.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.003, 0.049, 0.006, 0.724, 0.037, 0.003, 0.018, 0.158\ndistribution2 = 0.189, 0.099, 0.201, 0.11, 0.129, 0.037, 0.019, 0.031\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, 8, 3 e, -4, -3 \\sqrt{5}, 4, -4, 1, -4, -\\frac{10}{\\sqrt{\\pi }}, 8, -\\frac{26}{e}, 2 e, -\\frac{3}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$10+\\frac{26}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 8, 3*math.e, -4, -3*math.sqrt(5), 4, -4, 1, -4, -(10/(math.sqrt(math.pi))), 8, -(26/math.e), 2*math.e, -(3/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 9, 1296, 4}$.\n", - "Output Answer": [ - "$6 \\sqrt{30}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 9, 1296, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x+4.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$4.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(1.2*x+4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x-0.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$1.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(2.8*x-0.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 14, 18, 17}$.\n", - "Output Answer": [ - "$\\frac{714}{53}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 14, 18, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, -512, 25, -3}$.\n", - "Output Answer": [ - "$8 \\sqrt[4]{3} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -512, 25, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 e, -e, -2 e, 2 e, -3 e, 0, 0}$.\n", - "Output Answer": [ - "$-e$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.e, -math.e, -2*math.e, 2*math.e, -3*math.e, 0, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 5 \\sqrt{2}, -\\frac{15}{\\pi }, 8, 4, 5, 5}$.\n", - "Output Answer": [ - "$8+\\frac{15}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 5*math.sqrt(2), -(15/math.pi), 8, 4, 5, 5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 2, -3 \\pi, -e, -5, -3, -4, 6, -\\frac{11}{\\sqrt{3}}, -1, 8 \\log (2)} \\cup {-5 \\sqrt{3}, -5, -4, -9, 8 \\log (2), 4, -6, \\frac{11}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -5 \\sqrt{3}, -\\frac{11}{\\sqrt{3}}, -6, -5, -4, -3, -e, -1, 2, 4, 8 \\log (2), 6, \\frac{11}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 2, -3*math.pi, -math.e, -5, -3, -4, 6, -(11/(math.sqrt(3))), -1, 8*math.log(2),))\nsnd = set((-5*math.sqrt(3), -5, -4, -9, 8*math.log(2), 4, -6, (11/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, e, -4, -\\frac{19}{7}, 12 \\log (2)} \\cup {-4, -7 \\log (2), e, 12 \\log (2), -\\frac{2}{7}, \\frac{27}{5}}$.\n", - "Output Answer": [ - "${-7 \\log (2), -4, -3, -\\frac{19}{7}, -\\frac{2}{7}, e, \\frac{27}{5}, 12 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, math.e, -4, -(19/7), 12*math.log(2),))\nsnd = set((-4, -7*math.log(2), math.e, 12*math.log(2), -(2/7), (27/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{19}{5}, -\\frac{6}{5}, -\\frac{11}{5}}$.\n", - "Output Answer": [ - "$\\frac{2}{15}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (19/5), -(6/5), -(11/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{13}{\\pi }, -\\frac{3}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }, -\\frac{3}{\\pi }, \\frac{21}{\\pi }, \\frac{22}{\\pi }, \\frac{30}{\\pi }, \\frac{13}{\\pi }, \\frac{13}{\\pi }, \\frac{13}{\\pi }, \\frac{13}{\\pi }, \\frac{22}{\\pi }, \\frac{21}{\\pi }, \\frac{22}{\\pi }, \\frac{25}{\\pi }, \\frac{13}{\\pi }, \\frac{25}{\\pi }, \\frac{13}{\\pi }, \\frac{25}{\\pi }, \\frac{30}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }, \\frac{30}{\\pi }, \\frac{25}{\\pi }, \\frac{13}{\\pi }, \\frac{21}{\\pi }, \\frac{30}{\\pi }, \\frac{21}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{13}{\\pi },\\frac{22}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (13/math.pi), -(3/math.pi), (22/math.pi), (22/math.pi), -(3/math.pi), (21/math.pi), (22/math.pi), (30/math.pi), (13/math.pi), (13/math.pi), (13/math.pi), (13/math.pi), (22/math.pi), (21/math.pi), (22/math.pi), (25/math.pi), (13/math.pi), (25/math.pi), (13/math.pi), (25/math.pi), (30/math.pi), (22/math.pi), (22/math.pi), (22/math.pi), (30/math.pi), (25/math.pi), (13/math.pi), (21/math.pi), (30/math.pi), (21/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{2}, 9.617, -9, -4.4, 5, \\frac{24}{e}} \\setminus {\\frac{24}{e}, 7 \\sqrt{2}, 0, 5, 9.617, -9}$.\n", - "Output Answer": [ - "${-4.4, 3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(2), 9.617, -9, -4.4, 5, (24/math.e),))\nsnd = set(((24/math.e), 7*math.sqrt(2), 0, 5, 9.617, -9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{17}{2}, 18, \\frac{7}{2}, 12}$.\n", - "Output Answer": [ - "$\\frac{17136}{2323}$" - ], - "Output Program": [ - "import statistics\nvalues = (17/2), 18, (7/2), 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, 7, 8, 5, 7, 8, 8, 8, 7, 6, -5, 5, 8, 6, 7, 6, 6, 6, 5, 7, 8, 8, 5, 6, -5, -5}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, 7, 8, 5, 7, 8, 8, 8, 7, 6, -5, 5, 8, 6, 7, 6, 6, 6, 5, 7, 8, 8, 5, 6, -5, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.067,0.01,0.267,0.18,0.237\\}$ and $\\{0.152,0.05,0.032,0.064,0.004\\}$.", - "Output Answer": [ - "$1.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.067, 0.01, 0.267, 0.18, 0.237\ndistribution2 = 0.152, 0.05, 0.032, 0.064, 0.004\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{2}{3}, 9, 19, \\frac{4}{3}}$.\n", - "Output Answer": [ - "$\\frac{2736}{1651}$" - ], - "Output Program": [ - "import statistics\nvalues = (2/3), 9, 19, (4/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{13}{\\sqrt{3}}, -9, 9, -5, -2, -4} \\setminus {9, -4 \\sqrt{3}, -9, -4 \\sqrt{5}, -5, 10}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{3}}, -4, -2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/(math.sqrt(3))), -9, 9, -5, -2, -4,))\nsnd = set((9, -4*math.sqrt(3), -9, -4*math.sqrt(5), -5, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -\\sqrt{2}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{\\sqrt{2}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(1/(math.sqrt(2))), (9/(math.sqrt(2))), -(7/(math.sqrt(2))), (3/(math.sqrt(2))), -math.sqrt(2), -3*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -\\frac{16}{5}, -2 \\log (2), -9, 5, -\\frac{7}{3}, -7, -\\frac{1}{3}}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -(16/5), -2*math.log(2), -9, 5, -(7/3), -7, -(1/3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{31}{5}, 7, -e, -8, 8.37, -7}$.\n", - "Output Answer": [ - "${-8, -7, -e, \\frac{31}{5}, 7, 8.37}$" - ], - "Output Program": [ - "import math\n\nvalues = (31/5), 7, -math.e, -8, 8.37, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.134,0.086,0.102,0.177,0.113,0.093,0.189,0.079\\}$ and $\\{0.143,0.147,0.085,0.131,0.043,0.083,0.046,0.13\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.134, 0.086, 0.102, 0.177, 0.113, 0.093, 0.189, 0.079\ndistribution2 = 0.143, 0.147, 0.085, 0.131, 0.043, 0.083, 0.046, 0.13\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.442,0.084,0.352\\}$ and $\\{0.171,0.385,0.157\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.442, 0.084, 0.352\ndistribution2 = 0.171, 0.385, 0.157\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, 11, -13}$.\n", - "Output Answer": [ - "$192$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 11, -13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{5}, 0, 9, -3, 10 \\log (2), 3 e} \\cup {-3, 0, 2 \\log (2), 6, 3 e}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -3, 0, 2 \\log (2), 6, 10 \\log (2), 3 e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(5), 0, 9, -3, 10*math.log(2), 3*math.e,))\nsnd = set((-3, 0, 2*math.log(2), 6, 3*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, 14, -10, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{521}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 14, -10, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -9, 8, \\frac{9}{\\pi }, -9, 3 e, -10, -8, -9 \\log (2), e, -4, 1, 9}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -9, 8, (9/math.pi), -9, 3*math.e, -10, -8, -9*math.log(2), math.e, -4, 1, 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{1}{2}, \\frac{35}{2}, \\frac{39}{2}, 13}$.\n", - "Output Answer": [ - "$\\frac{5460}{2983}$" - ], - "Output Program": [ - "import statistics\nvalues = (1/2), (35/2), (39/2), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -27, -1}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -27, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -\\log (2), -5} \\setminus {0, -8, -10 \\log (2), -9, 3 \\sqrt{5}, 0.5, 7.156, 8.74, -5}$.\n", - "Output Answer": [ - "${-\\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -math.log(2), -5,))\nsnd = set((0, -8, -10*math.log(2), -9, 3*math.sqrt(5), 0.5, 7.156, 8.74, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{8}{\\sqrt{3}}, 0, -\\frac{19}{\\pi }, -5, 4 \\sqrt{2}, 2} \\setminus {2, 4 \\sqrt{2}, -6}$.\n", - "Output Answer": [ - "${-\\frac{19}{\\pi }, -5, 0, \\frac{8}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((8/(math.sqrt(3))), 0, -(19/math.pi), -5, 4*math.sqrt(2), 2,))\nsnd = set((2, 4*math.sqrt(2), -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, \\frac{4}{\\sqrt{3}}, -\\frac{4}{\\sqrt{\\pi }}, 1, -\\frac{14}{5}, 0.5}$.\n", - "Output Answer": [ - "${-\\frac{14}{5}, -\\frac{4}{\\sqrt{\\pi }}, 0.5, 1, \\frac{4}{\\sqrt{3}}, 3}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, (4/(math.sqrt(3))), -(4/(math.sqrt(math.pi))), 1, -(14/5), 0.5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\sqrt{3}, 0, 0, 6 \\sqrt{3}, 6 \\sqrt{3}, 0, 0, 0, 6 \\sqrt{3}, 2 \\sqrt{3}, -\\sqrt{3}, 6 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, 6 \\sqrt{3}, 0, 2 \\sqrt{3}, 6 \\sqrt{3}, 6 \\sqrt{3}, 0, 0, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.sqrt(3), 0, 0, 6*math.sqrt(3), 6*math.sqrt(3), 0, 0, 0, 6*math.sqrt(3), 2*math.sqrt(3), -math.sqrt(3), 6*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), 6*math.sqrt(3), 0, 2*math.sqrt(3), 6*math.sqrt(3), 6*math.sqrt(3), 0, 0, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x^3+4.4 x^2-4.1 x+1.7$ where $x \\sim $ \\text{PoissonDistribution}[2.5]\n", - "Output Answer": [ - "$74.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.5)\nprint(E(1.2*x**3+4.4*x**2-4.1*x+1.7))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{24}{\\pi }, -5 \\log (2), 1, -8, 7, 7.1} \\setminus {9, -5 \\log (2), -3.3}$.\n", - "Output Answer": [ - "${-8, -\\frac{24}{\\pi }, 1, 7, 7.1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(24/math.pi), -5*math.log(2), 1, -8, 7, 7.1,))\nsnd = set((9, -5*math.log(2), -3.3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, 1, -0.89, 0, -2 \\sqrt{3}, 5 \\sqrt{2}, -\\frac{2}{\\pi }, -\\frac{39}{4}, -8, -7, 2} \\cup {-5, 0, -\\frac{2}{\\pi }, -8, 7, 5 \\sqrt{2}, 2, 3 \\sqrt{3}, -7, 8.85, 1}$.\n", - "Output Answer": [ - "${-\\frac{39}{4}, -8, -7, -5, -2 \\sqrt{3}, -0.89, -\\frac{2}{\\pi }, 0, 1, 2, 3 \\sqrt{3}, 7, 5 \\sqrt{2}, 8.85}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 1, -0.89, 0, -2*math.sqrt(3), 5*math.sqrt(2), -(2/math.pi), -(39/4), -8, -7, 2,))\nsnd = set((-5, 0, -(2/math.pi), -8, 7, 5*math.sqrt(2), 2, 3*math.sqrt(3), -7, 8.85, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\log (2), 3 \\sqrt{2}, -7, 3, -\\pi, -\\frac{30}{7}} \\cup {0, -9, 1, \\frac{44}{7}, -\\pi, -\\log (2)}$.\n", - "Output Answer": [ - "${-9, -7, -\\frac{30}{7}, -\\pi, -\\log (2), 0, 1, 3, 3 \\sqrt{2}, \\frac{44}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.log(2), 3*math.sqrt(2), -7, 3, -math.pi, -(30/7),))\nsnd = set((0, -9, 1, (44/7), -math.pi, -math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 5}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{18}{\\sqrt{5}}, 5}$.\n", - "Output Answer": [ - "$\\frac{18}{\\sqrt{5}}-5$" - ], - "Output Program": [ - "import math\n\nvalues = (18/(math.sqrt(5))), 5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, 1, -2}$.\n", - "Output Answer": [ - "$\\frac{19}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 1, -2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, 15, 14}$.\n", - "Output Answer": [ - "$\\frac{601}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 15, 14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 2401, 4, 81}$.\n", - "Output Answer": [ - "$21 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 2401, 4, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 0, -2 e, 1, -7, 3} \\setminus {-7, 1, 2 \\sqrt{5}, 3, -2 e, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 0, -2*math.e, 1, -7, 3,))\nsnd = set((-7, 1, 2*math.sqrt(5), 3, -2*math.e, 3*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{5}{\\pi }, 1, -5, \\sqrt{5}, 10, \\frac{64}{7}}$.\n", - "Output Answer": [ - "${-5, 1, \\frac{5}{\\pi }, \\sqrt{5}, \\frac{64}{7}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/math.pi), 1, -5, math.sqrt(5), 10, (64/7)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, -7, 9, -7, 9}$.\n", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, -7, 9, -7, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x^2+0.6 x-7.3$ where $x \\sim $ \\text{PoissonDistribution}[3.5]\n", - "Output Answer": [ - "$53.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(E(3.7*x**2+0.6*x-7.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, -729, 100, 9}$.\n", - "Output Answer": [ - "$(81+81 i) \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, -729, 100, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${10, 10 \\log (2), -6, \\log (2), -7, -3, -4, -3, -3 \\pi, 7, -7}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 10, 10*math.log(2), -6, math.log(2), -7, -3, -4, -3, -3*math.pi, 7, -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-0.9, \\frac{18}{\\pi }, -\\frac{12}{5}, -3 \\sqrt{5}, -9, 1, -7, 4 \\log (2)} \\setminus {4 \\log (2), -3 \\sqrt{5}, -9, \\frac{18}{\\pi }, -\\frac{12}{5}, -\\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, -0.9, 1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.9, (18/math.pi), -(12/5), -3*math.sqrt(5), -9, 1, -7, 4*math.log(2),))\nsnd = set((4*math.log(2), -3*math.sqrt(5), -9, (18/math.pi), -(12/5), -math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -8, 7, -8, 4, 7, -4, -1}$.\n", - "Output Answer": [ - "$-\\frac{7}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -8, 7, -8, 4, 7, -4, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.39,0.258,0.279\\}$ and $\\{0.142,0.019,0.601\\}$.", - "Output Answer": [ - "$0.72$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.39, 0.258, 0.279\ndistribution2 = 0.142, 0.019, 0.601\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, \\frac{1}{\\sqrt{2}}, -7, -\\frac{67}{7}}$.\n", - "Output Answer": [ - "${-\\frac{67}{7}, -7, -7, \\frac{1}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, (1/(math.sqrt(2))), -7, -(67/7)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, -2, -\\frac{13}{\\sqrt{5}}, 1, 1, -12 \\log (2)}$.\n", - "Output Answer": [ - "${-12 \\log (2), -\\frac{13}{\\sqrt{5}}, -2, 0, 1, 1}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -2, -(13/(math.sqrt(5))), 1, 1, -12*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 e, 3 e, 3 e, -4 e, 3 e, 3 e, 3 e, 3 e, -4 e, 2 e, 3 e, -4 e, 3 e, 0, e, e, 0, 0, -4 e, 0}$.\n", - "Output Answer": [ - "$\\{3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.e, 3*math.e, 3*math.e, -4*math.e, 3*math.e, 3*math.e, 3*math.e, 3*math.e, -4*math.e, 2*math.e, 3*math.e, -4*math.e, 3*math.e, 0, math.e, math.e, 0, 0, -4*math.e, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{2}, \\frac{7}{2}, -\\frac{18}{\\sqrt{5}}, 5, -7} \\setminus {\\frac{7}{2}, 4 \\sqrt{2}, \\frac{7}{\\sqrt{5}}, -7, 5}$.\n", - "Output Answer": [ - "${-\\frac{18}{\\sqrt{5}}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), (7/2), -(18/(math.sqrt(5))), 5, -7,))\nsnd = set(((7/2), 4*math.sqrt(2), (7/(math.sqrt(5))), -7, 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x^2+4.8 x+4.6$ where $x \\sim $ \\text{NormalDistribution}[-1.6,1.6]\n", - "Output Answer": [ - "$-16.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 1.6)\nprint(E(-2.7*x**2+4.8*x+4.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{26}{3}, -5, -3, \\frac{28}{5}, 2 \\pi, \\pi, \\frac{30}{7}, \\sqrt{5}, 4, -5}$.\n", - "Output Answer": [ - "$\\frac{41}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = (26/3), -5, -3, (28/5), 2*math.pi, math.pi, (30/7), math.sqrt(5), 4, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-7 \\sqrt{2}, 7 \\sqrt{2}, 3 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, -4 \\sqrt{2}, 2 \\sqrt{2}} \\cap {\\frac{9}{\\sqrt{2}}, 7 \\sqrt{2}, 2 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, \\sqrt{2}, -4 \\sqrt{2}, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, 2 \\sqrt{2}, 3 \\sqrt{2}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7*math.sqrt(2), 7*math.sqrt(2), 3*math.sqrt(2), -(1/(math.sqrt(2))), -4*math.sqrt(2), 2*math.sqrt(2),))\nsnd = set(((9/(math.sqrt(2))), 7*math.sqrt(2), 2*math.sqrt(2), -(5/(math.sqrt(2))), math.sqrt(2), -4*math.sqrt(2), 3*math.sqrt(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, -8, 11, 3}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{755}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -8, 11, 3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.09,0.1,0.305,0.101,0.082,0.103,0.159\\}$ and $\\{0.111,0.048,0.095,0.039,0.223,0.132,0.234\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.09, 0.1, 0.305, 0.101, 0.082, 0.103, 0.159\ndistribution2 = 0.111, 0.048, 0.095, 0.039, 0.223, 0.132, 0.234\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 2, -6, 7 \\sqrt{2}, -8, \\frac{15}{2}} \\cup {-8, 2, -7, \\frac{15}{2}, -3, 7 \\sqrt{2}, -9.074, -9}$.\n", - "Output Answer": [ - "${-9.074, -9, -8, -7, -6, -3, 2, \\frac{15}{2}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 2, -6, 7*math.sqrt(2), -8, (15/2),))\nsnd = set((-8, 2, -7, (15/2), -3, 7*math.sqrt(2), -9.074, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{4}{3}, \\frac{25}{3}, \\frac{49}{3}, 3}$.\n", - "Output Answer": [ - "$\\frac{58800}{18589}$" - ], - "Output Program": [ - "import statistics\nvalues = (4/3), (25/3), (49/3), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -3, \\frac{13}{e}, \\frac{9}{\\sqrt{\\pi }}, -5, -\\frac{13}{e}, -4, \\frac{25}{e}, 3 \\sqrt{5}, -3 e, -4, -5, -\\frac{4}{7}}$.\n", - "Output Answer": [ - "$10+\\frac{25}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -3, (13/math.e), (9/(math.sqrt(math.pi))), -5, -(13/math.e), -4, (25/math.e), 3*math.sqrt(5), -3*math.e, -4, -5, -(4/7)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, -6, 3, 3, 13, -4}$.\n", - "Output Answer": [ - "$\\frac{2033}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -6, 3, 3, 13, -4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.555,0.092,0.075,0.199,0.004,0.01\\}$ and $\\{0.271,0.15,0.308,0.125,0.042,0.038\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.555, 0.092, 0.075, 0.199, 0.004, 0.01\ndistribution2 = 0.271, 0.15, 0.308, 0.125, 0.042, 0.038\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, -4, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, -4, 3}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -4, -3*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, 8, -5, -4, -5, 8, -10, 8, -4, -5, -10, 1, -4, 8, 1, -5, 8, 8, -10, 8, -10, -10, 1, 1, 1, 1, -5, 8}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, 8, -5, -4, -5, 8, -10, 8, -4, -5, -10, 1, -4, 8, 1, -5, 8, 8, -10, 8, -10, -10, 1, 1, 1, 1, -5, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{17}{\\sqrt{\\pi }}, \\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{4}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (17/(math.sqrt(math.pi))), (13/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, -\\frac{5}{2}, 7 \\sqrt{2}, -\\frac{13}{4}, -7, \\frac{1}{\\sqrt{\\pi }}} \\setminus {0.35, -7, \\frac{11}{4}, -\\frac{13}{4}}$.\n", - "Output Answer": [ - "${-\\frac{5}{2}, \\frac{1}{\\sqrt{\\pi }}, 2, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -(5/2), 7*math.sqrt(2), -(13/4), -7, (1/(math.sqrt(math.pi))),))\nsnd = set((0.35, -7, (11/4), -(13/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.153,0.18,0.107,0.046,0.253\\}$ and $\\{0.114,0.178,0.172,0.082,0.18\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.153, 0.18, 0.107, 0.046, 0.253\ndistribution2 = 0.114, 0.178, 0.172, 0.082, 0.18\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, 4 \\sqrt{2}, -8, 2 \\sqrt{3}, -1, -7, 4, -1, -5, 2, -2 \\sqrt{5}, -3, 1, -4}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, 4*math.sqrt(2), -8, 2*math.sqrt(3), -1, -7, 4, -1, -5, 2, -2*math.sqrt(5), -3, 1, -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -3, \\frac{21}{4}}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "values = 8, -3, (21/4)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, -1, 9, 2, 4} \\cap {8, -1, -7, 3, -4}$.\n", - "Output Answer": [ - "${-1, 3}$" - ], - "Output Program": [ - "fst = set((3, -1, 9, 2, 4,))\nsnd = set((8, -1, -7, 3, -4,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -5, 1, 4, 6 \\sqrt{3}, 2, 6 \\log (2), 0} \\cup {2, -12 \\log (2), -1, -2, 4, -3.37, -5}$.\n", - "Output Answer": [ - "${-12 \\log (2), -5, -3.37, -2, -1, 0, 1, 2, 4, 6 \\log (2), 6 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -5, 1, 4, 6*math.sqrt(3), 2, 6*math.log(2), 0,))\nsnd = set((2, -12*math.log(2), -1, -2, 4, -3.37, -5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{3}, 2}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2-2 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(3), 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x^2-1.3 x-0.8$ where $x \\sim $ \\text{NormalDistribution}[-0.6,2.]\n", - "Output Answer": [ - "$11.32$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.6, 2.)\nprint(E(2.6*x**2-1.3*x-0.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{2}, 8, 10, 12}$.\n", - "Output Answer": [ - "$\\frac{5280}{647}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/2), 8, 10, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -1, -1, 8, -1, 4, 8, -8, 8, 4, 8, -1, -2, -2, -8, 0, 4, -2, 4, 0}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -1, -1, 8, -1, 4, 8, -8, 8, 4, 8, -1, -2, -2, -8, 0, 4, -2, 4, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, 2401, -125, -32, -1}$.\n", - "Output Answer": [ - "$4 \\sqrt[5]{2} 5^{3/5} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, 2401, -125, -32, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, 3 \\pi, 3 \\pi, 0, 0, -\\pi, 3 \\pi, -\\pi, -\\pi, \\pi, \\pi, \\pi, -\\pi, 3 \\pi, 0, 0, \\pi, 0, \\pi}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 0, 3*math.pi, 3*math.pi, 0, 0, -math.pi, 3*math.pi, -math.pi, -math.pi, math.pi, math.pi, math.pi, -math.pi, 3*math.pi, 0, 0, math.pi, 0, math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -10, -3, -3 e}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -10, -3, -3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-3.65 < -4.5 x^2+4.4 x+1.2 < -1.46$ where $x \\sim $ \\text{NormalDistribution}[-2.,0.8].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -2., 0.8)\nprint(P((-3.65 < -4.5*x**2+4.4*x+1.2) & (-4.5*x**2+4.4*x+1.2 < -1.46)))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 3 e, -\\frac{7}{\\sqrt{3}}, -10} \\cup {-7 \\log (2), -10, -4, 1, 3 e, -\\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-10, -9, -7 \\log (2), -\\frac{7}{\\sqrt{3}}, -4, 1, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 3*math.e, -(7/(math.sqrt(3))), -10,))\nsnd = set((-7*math.log(2), -10, -4, 1, 3*math.e, -(7/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{2}, -4.857, -5, 7, 5}$.\n", - "Output Answer": [ - "${-\\frac{11}{2}, -5, -4.857, 5, 7}$" - ], - "Output Program": [ - "values = -(11/2), -4.857, -5, 7, 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, \\sqrt{3}, -4 \\sqrt{3}, -4 \\sqrt{3}, 0, -4 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -4 \\sqrt{3}, -\\sqrt{3}, \\sqrt{3}, -\\sqrt{3}, -4 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -4 \\sqrt{3}, 0, -4 \\sqrt{3}, -4 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 0, math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), math.sqrt(3), -4*math.sqrt(3), -4*math.sqrt(3), 0, -4*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -4*math.sqrt(3), -math.sqrt(3), math.sqrt(3), -math.sqrt(3), -4*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -4*math.sqrt(3), 0, -4*math.sqrt(3), -4*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, 5.845, 6, 3.3, -\\frac{1}{2}, 11 \\log (2), -2} \\setminus {-\\frac{1}{2}, 11 \\log (2), 5.845, -2, 0.5, 8, -\\frac{10}{e}}$.\n", - "Output Answer": [ - "${-4, 3.3, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 5.845, 6, 3.3, -(1/2), 11*math.log(2), -2,))\nsnd = set((-(1/2), 11*math.log(2), 5.845, -2, 0.5, 8, -(10/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, 4, -\\frac{5}{\\sqrt{3}}, -3, \\frac{14}{\\sqrt{\\pi }}, -2 \\sqrt{5}, 0, \\frac{22}{\\sqrt{5}}, 3 \\sqrt{5}, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{22}{\\sqrt{5}}+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 4, -(5/(math.sqrt(3))), -3, (14/(math.sqrt(math.pi))), -2*math.sqrt(5), 0, (22/(math.sqrt(5))), 3*math.sqrt(5), 3*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 3, 11, 12}$.\n", - "Output Answer": [ - "$\\frac{528}{79}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 3, 11, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, \\frac{31}{7}, -\\frac{17}{5}, 4, -3 \\sqrt{2}, 5, 7} \\cup {0, -9, 2 \\sqrt{2}, -\\frac{1}{5}, -10, 5, -\\frac{13}{\\sqrt{2}}, \\frac{31}{7}, -6}$.\n", - "Output Answer": [ - "${-10, -\\frac{13}{\\sqrt{2}}, -9, -6, -3 \\sqrt{2}, -\\frac{17}{5}, -\\frac{1}{5}, 0, 2 \\sqrt{2}, 4, \\frac{31}{7}, 5, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (31/7), -(17/5), 4, -3*math.sqrt(2), 5, 7,))\nsnd = set((0, -9, 2*math.sqrt(2), -(1/5), -10, 5, -(13/(math.sqrt(2))), (31/7), -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.8 x-1.4$ where $x \\sim $ \\text{NormalDistribution}[0.6,1.8]\n", - "Output Answer": [ - "$-0.32$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.6, 1.8)\nprint(E(1.8*x-1.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{5}{\\sqrt{2}}, 5 \\sqrt{2}, -\\frac{9}{\\sqrt{2}}, -\\sqrt{2}, -3 \\sqrt{2}, \\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\sqrt{2}-\\frac{1}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (5/(math.sqrt(2))), 5*math.sqrt(2), -(9/(math.sqrt(2))), -math.sqrt(2), -3*math.sqrt(2), (3/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8 \\log (2), 5, 5, -5, 7 \\sqrt{2}, -8, -1, 6, 0, 2}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8*math.log(2), 5, 5, -5, 7*math.sqrt(2), -8, -1, 6, 0, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 6, 0, -1, 6, 6, -1, 0, 0, 0, 6, 0, -1, 0, 6}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 6, 0, -1, 6, 6, -1, 0, 0, 0, 6, 0, -1, 0, 6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, 2, 3, -6, 5, 5}$.\n", - "Output Answer": [ - "$\\frac{364}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 2, 3, -6, 5, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x^2+0.8 x-3.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$-2.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(0.2*x**2+0.8*x-3.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, \\frac{45}{7}, 4, \\frac{10}{\\pi }, 5}$.\n", - "Output Answer": [ - "${-3, \\frac{10}{\\pi }, 4, 5, \\frac{45}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, (45/7), 4, (10/math.pi), 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-13 \\log (2), -\\frac{2}{\\sqrt{5}}, 6 \\log (2), 8, \\frac{7}{\\sqrt{3}}, \\frac{7}{\\sqrt{2}}, \\frac{12}{e}, -6 \\sqrt{3}, 7} \\setminus {\\frac{7}{\\sqrt{2}}, -6 \\sqrt{3}, -\\frac{31}{\\pi }, -\\frac{2}{\\sqrt{5}}, 7}$.\n", - "Output Answer": [ - "${-13 \\log (2), \\frac{7}{\\sqrt{3}}, 6 \\log (2), \\frac{12}{e}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-13*math.log(2), -(2/(math.sqrt(5))), 6*math.log(2), 8, (7/(math.sqrt(3))), (7/(math.sqrt(2))), (12/math.e), -6*math.sqrt(3), 7,))\nsnd = set(((7/(math.sqrt(2))), -6*math.sqrt(3), -(31/math.pi), -(2/(math.sqrt(5))), 7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\pi, 2 \\sqrt{5}, -6, -e, 6, 1, -\\frac{14}{e}, -4} \\cup {6, -e, -3 \\sqrt{5}, -4, -6, -\\frac{14}{e}, 0}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -2 \\pi, -6, -\\frac{14}{e}, -4, -e, 0, 1, 2 \\sqrt{5}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, 2*math.sqrt(5), -6, -math.e, 6, 1, -(14/math.e), -4,))\nsnd = set((6, -math.e, -3*math.sqrt(5), -4, -6, -(14/math.e), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${12 \\log (2), \\frac{15}{e}, -4, 7, 6, -9, -1, -5 \\log (2), 10 \\log (2), 2}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2+\\frac{15}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 12*math.log(2), (15/math.e), -4, 7, 6, -9, -1, -5*math.log(2), 10*math.log(2), 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.4 x^2-3.1 x+1.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$-22.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(-3.4*x**2-3.1*x+1.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.51 < -1.5 x-2.2 < 0.66$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6].", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(P((-0.51 < -1.5*x-2.2) & (-1.5*x-2.2 < 0.66)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, \\frac{56}{3}}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import statistics\nvalues = 14, (56/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{5}, 3 \\sqrt{5}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{2 \\sqrt{5}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(5), 3*math.sqrt(5), -3*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{16}{\\sqrt{3}}, 2 \\sqrt{5}, \\frac{18}{\\sqrt{5}}, 4.8, 3, 7 \\sqrt{2}, -11 \\log (2)} \\setminus {7 \\sqrt{2}, 5 \\log (2), 2 \\sqrt{5}, \\frac{18}{\\sqrt{5}}, -\\frac{16}{\\sqrt{3}}, 3, 4.8}$.\n", - "Output Answer": [ - "${-11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(16/(math.sqrt(3))), 2*math.sqrt(5), (18/(math.sqrt(5))), 4.8, 3, 7*math.sqrt(2), -11*math.log(2),))\nsnd = set((7*math.sqrt(2), 5*math.log(2), 2*math.sqrt(5), (18/(math.sqrt(5))), -(16/(math.sqrt(3))), 3, 4.8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.355,0.177,0.114,0.045,0.226,0.057\\}$ and $\\{0.061,0.094,0.199,0.152,0.079,0.276\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.355, 0.177, 0.114, 0.045, 0.226, 0.057\ndistribution2 = 0.061, 0.094, 0.199, 0.152, 0.079, 0.276\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${3, 729, 216, -3}$.\n", - "Output Answer": [ - "$9 \\sqrt[4]{-1} 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 729, 216, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, 1, -15}$.\n", - "Output Answer": [ - "$\\sqrt{139}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 1, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 4, -6, 7, 7, 4, 7, 7, 4, 7, 7, 7, 7, 7, 4, 3, 4, 7, 4, -6, -6, 4}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 4, -6, 7, 7, 4, 7, 7, 4, 7, 7, 7, 7, 7, 4, 3, 4, 7, 4, -6, -6, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.8 x^3-4.6 x^2-2.3 x+1.7$ where $x \\sim $ \\text{NormalDistribution}[1.8,1.5]\n", - "Output Answer": [ - "$58.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.8, 1.5)\nprint(E(4.8*x**3-4.6*x**2-2.3*x+1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.063,0.041,0.234,0.054,0.013,0.183,0.181,0.169\\}$ and $\\{0.052,0.131,0.201,0.079,0.045,0.009,0.265,0.158\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.063, 0.041, 0.234, 0.054, 0.013, 0.183, 0.181, 0.169\ndistribution2 = 0.052, 0.131, 0.201, 0.079, 0.045, 0.009, 0.265, 0.158\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.128,0.218,0.355,0.125\\}$ and $\\{0.26,0.239,0.217,0.085\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.128, 0.218, 0.355, 0.125\ndistribution2 = 0.26, 0.239, 0.217, 0.085\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 5}$.\n", - "Output Answer": [ - "$\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, -9, 7, 2}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{683}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -9, 7, 2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.051,0.085,0.206,0.025,0.116,0.123,0.09,0.124,0.072\\}$ and $\\{0.065,0.219,0.051,0.123,0.141,0.062,0.157,0.062,0.029\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.051, 0.085, 0.206, 0.025, 0.116, 0.123, 0.09, 0.124, 0.072\ndistribution2 = 0.065, 0.219, 0.051, 0.123, 0.141, 0.062, 0.157, 0.062, 0.029\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -4 \\sqrt{3}, -5 \\sqrt{2}, -\\frac{5}{\\sqrt{3}}, 0, -2.77, -3 \\sqrt{3}, -6, 3 \\sqrt{5}} \\cup {4 \\sqrt{2}, -6, 0, -5 \\sqrt{3}, -2.77, -3, 3 \\sqrt{5}, \\frac{16}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -5 \\sqrt{2}, -4 \\sqrt{3}, -6, -3 \\sqrt{3}, -\\frac{7}{\\sqrt{3}}, -3, -\\frac{5}{\\sqrt{3}}, -2.77, 0, 4 \\sqrt{2}, 3 \\sqrt{5}, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -4*math.sqrt(3), -5*math.sqrt(2), -(5/(math.sqrt(3))), 0, -2.77, -3*math.sqrt(3), -6, 3*math.sqrt(5),))\nsnd = set((4*math.sqrt(2), -6, 0, -5*math.sqrt(3), -2.77, -3, 3*math.sqrt(5), (16/(math.sqrt(3))), -(7/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{37}{4}, 0, -5 \\sqrt{2}, -\\frac{11}{4}, 8}$.\n", - "Output Answer": [ - "$\\frac{37}{4}+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (37/4), 0, -5*math.sqrt(2), -(11/4), 8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, \\frac{4}{\\sqrt{5}}, 6}$.\n", - "Output Answer": [ - "${\\frac{4}{\\sqrt{5}}, 4, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (4/(math.sqrt(5))), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{2}{\\sqrt{5}}, -2 \\sqrt{5}, -\\frac{19}{\\sqrt{5}}, -2 \\sqrt{5}, \\frac{2}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, -2 \\sqrt{5}, \\frac{6}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}, -2 \\sqrt{5}, -\\frac{19}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{6}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (2/(math.sqrt(5))), -2*math.sqrt(5), -(19/(math.sqrt(5))), -2*math.sqrt(5), (2/(math.sqrt(5))), (2/(math.sqrt(5))), (6/(math.sqrt(5))), -(21/(math.sqrt(5))), (6/(math.sqrt(5))), (2/(math.sqrt(5))), -2*math.sqrt(5), (6/(math.sqrt(5))), -(19/(math.sqrt(5))), (6/(math.sqrt(5))), (6/(math.sqrt(5))), -(19/(math.sqrt(5))), (6/(math.sqrt(5))), -(21/(math.sqrt(5))), -(21/(math.sqrt(5))), (2/(math.sqrt(5))), -(21/(math.sqrt(5))), -2*math.sqrt(5), -(19/(math.sqrt(5))), (6/(math.sqrt(5))), (6/(math.sqrt(5))), -(21/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.233,0.271,0.093,0.168,0.138,0.081\\}$ and $\\{0.28,0.029,0.263,0.095,0.111,0.099\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.233, 0.271, 0.093, 0.168, 0.138, 0.081\ndistribution2 = 0.28, 0.029, 0.263, 0.095, 0.111, 0.099\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.2 x^3+2.6 x^2-3.2 x-3.8$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$-27.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(-4.2*x**3+2.6*x**2-3.2*x-3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -6, 9, -6, -6, -2, -6, -2, -2, 9, -6, -6, -6, -2, -2, -6, -2, -2, 9, -6, -2, -6, -6, 9, -6, -6}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -6, 9, -6, -6, -2, -6, -2, -2, 9, -6, -6, -6, -2, -2, -6, -2, -2, 9, -6, -2, -6, -6, 9, -6, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x^2+0.4 x-4.2$ where $x \\sim $ \\text{BetaDistribution}[1.3,0.6]\n", - "Output Answer": [ - "$-2.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 0.6)\nprint(E(3.4*x**2+0.4*x-4.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 5, 13}$.\n", - "Output Answer": [ - "$\\frac{390}{101}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 5, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\sqrt{2}, 4, 0.8, \\frac{5}{\\sqrt{2}}, 7} \\cup {-8, 0.8, 3 \\sqrt{2}, -7, 0, 7}$.\n", - "Output Answer": [ - "${-8, -7, 0, 0.8, \\frac{5}{\\sqrt{2}}, 4, 3 \\sqrt{2}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(2), 4, 0.8, (5/(math.sqrt(2))), 7,))\nsnd = set((-8, 0.8, 3*math.sqrt(2), -7, 0, 7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{22}{e}, 2 \\log (2), \\frac{15}{\\sqrt{\\pi }}} \\setminus {\\frac{22}{e}, 7, \\frac{18}{5}, 3 e, -6, -\\frac{1}{\\sqrt{\\pi }}, 2 \\log (2)}$.\n", - "Output Answer": [ - "${\\frac{15}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((22/math.e), 2*math.log(2), (15/(math.sqrt(math.pi))),))\nsnd = set(((22/math.e), 7, (18/5), 3*math.e, -6, -(1/(math.sqrt(math.pi))), 2*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\sqrt{3}, \\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{2}-5 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.sqrt(3), math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9 \\log (2), 3 \\log (2), -11 \\log (2), 9 \\log (2), -11 \\log (2), -5 \\log (2), 10 \\log (2), -5 \\log (2), 10 \\log (2), 10 \\log (2), -10 \\log (2), -5 \\log (2), 3 \\log (2), -5 \\log (2), 3 \\log (2), -10 \\log (2), -11 \\log (2), 9 \\log (2), -11 \\log (2), 10 \\log (2), -5 \\log (2), -11 \\log (2), 3 \\log (2), 3 \\log (2), 9 \\log (2)}$.\n", - "Output Answer": [ - "$\\{3 \\log (2),-11 \\log (2),-5 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 9*math.log(2), 3*math.log(2), -11*math.log(2), 9*math.log(2), -11*math.log(2), -5*math.log(2), 10*math.log(2), -5*math.log(2), 10*math.log(2), 10*math.log(2), -10*math.log(2), -5*math.log(2), 3*math.log(2), -5*math.log(2), 3*math.log(2), -10*math.log(2), -11*math.log(2), 9*math.log(2), -11*math.log(2), 10*math.log(2), -5*math.log(2), -11*math.log(2), 3*math.log(2), 3*math.log(2), 9*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.4 x-3.9$ where $x \\sim $ \\text{BetaDistribution}[1.5,1.9]\n", - "Output Answer": [ - "$-4.96$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 1.9)\nprint(E(-2.4*x-3.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -10, -3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{457}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -10, -3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -\\frac{27}{4}, -3, -5, -\\frac{8}{\\sqrt{3}}, 5, -9, 3}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -(27/4), -3, -5, -(8/(math.sqrt(3))), 5, -9, 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, -8, -8}$.\n", - "Output Answer": [ - "$4\\ 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, -8, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 27, -729, 16, -3}$.\n", - "Output Answer": [ - "$18\\ 2^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 27, -729, 16, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -\\frac{16}{\\sqrt{\\pi }}, 8, -5, -2, 6}$.\n", - "Output Answer": [ - "$8+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -(16/(math.sqrt(math.pi))), 8, -5, -2, 6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.8 x-4.3$ where $x \\sim $ \\text{ExponentialDistribution}[0.6]\n", - "Output Answer": [ - "$-5.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.6)\nprint(E(-0.8*x-4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.103,0.08,0.03,0.09,0.036,0.049,0.098,0.161,0.235\\}$ and $\\{0.084,0.057,0.054,0.079,0.02,0.157,0.133,0.203,0.12\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.103, 0.08, 0.03, 0.09, 0.036, 0.049, 0.098, 0.161, 0.235\ndistribution2 = 0.084, 0.057, 0.054, 0.079, 0.02, 0.157, 0.133, 0.203, 0.12\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, \\frac{22}{3}, \\frac{35}{3}, \\frac{22}{3}}$.\n", - "Output Answer": [ - "$\\frac{4620}{491}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, (22/3), (35/3), (22/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x+0.1$ where $x \\sim $ \\text{PoissonDistribution}[1.]\n", - "Output Answer": [ - "$3.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.)\nprint(E(3.8*x+0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{43}{3}, \\frac{59}{3}, \\frac{19}{3}}$.\n", - "Output Answer": [ - "$\\frac{48203}{4475}$" - ], - "Output Program": [ - "import statistics\nvalues = (43/3), (59/3), (19/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1296, 6, 1, 1}$.\n", - "Output Answer": [ - "$6 \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1296, 6, 1, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{6}{\\sqrt{\\pi }}, -8, -10, e, -5, -1, -\\frac{3}{4}, -4 \\sqrt{2}, -3 \\pi, -2, 9, -\\frac{18}{5}}$.", - "Output Answer": [ - "$-\\frac{14}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (6/(math.sqrt(math.pi))), -8, -10, math.e, -5, -1, -(3/4), -4*math.sqrt(2), -3*math.pi, -2, 9, -(18/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4 \\sqrt{5}, -3 \\sqrt{5}, -1, -6, \\frac{14}{3}, -4, -\\frac{3}{\\sqrt{2}}, -\\sqrt{2}, -\\frac{11}{3}, 4, -3 \\pi, -2, -9}$.\n", - "Output Answer": [ - "$\\frac{14}{3}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(5), -3*math.sqrt(5), -1, -6, (14/3), -4, -(3/(math.sqrt(2))), -math.sqrt(2), -(11/3), 4, -3*math.pi, -2, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, \\frac{15}{2}, 1, 1, -\\frac{17}{2}}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, (15/2), 1, 1, -(17/2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{15}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{15}{\\sqrt{\\pi }},\\frac{2}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(15/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), (11/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), (11/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, 1, -9, -8, -9, -10}$.\n", - "Output Answer": [ - "$-7$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, 1, -9, -8, -9, -10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{59}{3}, 3, 18}$.\n", - "Output Answer": [ - "$\\frac{3186}{467}$" - ], - "Output Program": [ - "import statistics\nvalues = (59/3), 3, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2.56, -9}$.\n", - "Output Answer": [ - "${-9, -2.56}$" - ], - "Output Program": [ - "values = -2.56, -9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\pi, 7, -8, -\\frac{7}{4}, 0, 4} \\cup {-6, 4, 0, -\\frac{7}{4}, 2 \\pi, -8}$.\n", - "Output Answer": [ - "${-8, -6, -\\frac{7}{4}, 0, 4, 2 \\pi, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.pi, 7, -8, -(7/4), 0, 4,))\nsnd = set((-6, 4, 0, -(7/4), 2*math.pi, -8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -5, -5, 4, 4, 4, 4, -5, -6, 8, 8, -6, -5, -6, -6, -5, 8, -6, 4, -6, 8}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -5, -5, 4, 4, 4, 4, -5, -6, 8, 8, -6, -5, -6, -6, -5, 8, -6, 4, -6, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -6, -7, \\frac{16}{e}, 3 \\sqrt{5}, 4 \\sqrt{2}, -\\frac{2}{\\pi }}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -6, -7, (16/math.e), 3*math.sqrt(5), 4*math.sqrt(2), -(2/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2, 8, \\frac{8}{\\sqrt{3}}, 9} \\setminus {9, 7 \\sqrt{2}, 5}$.\n", - "Output Answer": [ - "${-2, \\frac{8}{\\sqrt{3}}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 8, (8/(math.sqrt(3))), 9,))\nsnd = set((9, 7*math.sqrt(2), 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -6}$.\n", - "Output Answer": [ - "$98$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -6\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 16, 15, 16}$.\n", - "Output Answer": [ - "$\\frac{96}{7}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 16, 15, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6, 3, -5, -\\frac{23}{5}, 8 \\log (2), 0, 4 \\sqrt{2}, -\\frac{29}{\\pi }} \\setminus {8 \\log (2), \\sqrt{3}, -\\frac{23}{5}, -6, 6, 3}$.\n", - "Output Answer": [ - "${-\\frac{29}{\\pi }, -5, 0, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 3, -5, -(23/5), 8*math.log(2), 0, 4*math.sqrt(2), -(29/math.pi),))\nsnd = set((8*math.log(2), math.sqrt(3), -(23/5), -6, 6, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, -10, 2, 9} \\setminus {-\\frac{10}{\\sqrt{\\pi }}, 5, 2}$.\n", - "Output Answer": [ - "${-10, 3, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -10, 2, 9,))\nsnd = set((-(10/(math.sqrt(math.pi))), 5, 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{22}{e}, 4, -8, -4, 7, -4}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (22/math.e), 4, -8, -4, 7, -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{5}, -4, 1, -6, -2 \\sqrt{2}, 3, 0, \\frac{17}{\\sqrt{\\pi }}, -4 \\log (2), -\\frac{8}{\\sqrt{3}}, \\frac{10}{3}, 0}$.", - "Output Answer": [ - "$-2 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(5), -4, 1, -6, -2*math.sqrt(2), 3, 0, (17/(math.sqrt(math.pi))), -4*math.log(2), -(8/(math.sqrt(3))), (10/3), 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{3}{2}, -7, -9}$.\n", - "Output Answer": [ - "$-\\frac{35}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(3/2), -7, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -3, -10, 15}$.\n", - "Output Answer": [ - "$\\frac{373}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -3, -10, 15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 5, 9, 8, -2, 9, -6}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 5, 9, 8, -2, 9, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, 3, 7, -3} \\setminus {10, \\frac{7}{\\sqrt{5}}, 3 \\pi, 3, -2}$.\n", - "Output Answer": [ - "${-3, 0, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 3, 7, -3,))\nsnd = set((10, (7/(math.sqrt(5))), 3*math.pi, 3, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{2}, -\\frac{27}{e}, -9.8, 7, 7, -9, 0}$.\n", - "Output Answer": [ - "${-\\frac{27}{e}, -9.8, -9, 0, 2 \\sqrt{2}, 7, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(2), -(27/math.e), -9.8, 7, 7, -9, 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 4, -7, 0, 5, 0, -3, -3, 5, 1, 0, 1, 4, 1, 0, 1, 0, -3, 0, 0, 0, 1, 5, 0, 5, -3, 6, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 4, -7, 0, 5, 0, -3, -3, 5, 1, 0, 1, 4, 1, 0, 1, 0, -3, 0, 0, 0, 1, 5, 0, 5, -3, 6, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, -\\pi, 0, 8, 2} \\setminus {3, 0, 7, -4, 5, 8, -\\pi, -3}$.\n", - "Output Answer": [ - "${2}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -math.pi, 0, 8, 2,))\nsnd = set((3, 0, 7, -4, 5, 8, -math.pi, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, -3, -7, -7, -15, -4}$.\n", - "Output Answer": [ - "$3 \\sqrt{\\frac{39}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -3, -7, -7, -15, -4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\sqrt{3}, 5, -\\frac{7}{\\sqrt{2}}, -2 \\sqrt{2}, 6, 0, -5, -7, 2 \\sqrt{2}, -\\frac{11}{\\sqrt{3}}, -4} \\cup {0.8, -\\sqrt{3}, -7, -3 \\sqrt{2}, -2 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -6, 6, -9}$.\n", - "Output Answer": [ - "${-9, -7, -\\frac{11}{\\sqrt{3}}, -6, -5, -\\frac{7}{\\sqrt{2}}, -3 \\sqrt{2}, -4, -2 \\sqrt{3}, -2 \\sqrt{2}, -\\sqrt{3}, 0, 0.8, 2 \\sqrt{2}, 5, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(3), 5, -(7/(math.sqrt(2))), -2*math.sqrt(2), 6, 0, -5, -7, 2*math.sqrt(2), -(11/(math.sqrt(3))), -4,))\nsnd = set((0.8, -math.sqrt(3), -7, -3*math.sqrt(2), -2*math.sqrt(2), -(7/(math.sqrt(2))), -6, 6, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{16}{3}, -2 \\pi, \\frac{17}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{5}}, 1, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{17}{\\sqrt{5}}+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(16/3), -2*math.pi, (17/(math.sqrt(math.pi))), -(17/(math.sqrt(5))), 1, -math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${9, 4, -8, -7, -6, 6, 10, 8, -5} \\cap {7, -3, -5, 4, 5, -4, 8, -7, -8}$.\n", - "Output Answer": [ - "${-8, -7, -5, 4, 8}$" - ], - "Output Program": [ - "fst = set((9, 4, -8, -7, -6, 6, 10, 8, -5,))\nsnd = set((7, -3, -5, 4, 5, -4, 8, -7, -8,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -\\frac{4}{5}}$.\n", - "Output Answer": [ - "$-\\frac{17}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -(4/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 8, -6, -2, 2, 1, -2}$.\n", - "Output Answer": [ - "$\\frac{10}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 8, -6, -2, 2, 1, -2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -\\pi, \\pi, -\\pi, 0}$.\n", - "Output Answer": [ - "$-\\frac{\\pi }{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, -math.pi, math.pi, -math.pi, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 0, e, 2, 10, -9, 1, 8, -6 \\sqrt{2}} \\cup {-9, e, -4, 0, 5, 8}$.\n", - "Output Answer": [ - "${-9, -6 \\sqrt{2}, -4, -2, 0, 1, 2, e, 5, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 0, math.e, 2, 10, -9, 1, 8, -6*math.sqrt(2),))\nsnd = set((-9, math.e, -4, 0, 5, 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -4, -3 e, -\\pi, 2 \\sqrt{5}, -10} \\cup {-6, 8, -3 e, -\\sqrt{5}, 0, 9}$.\n", - "Output Answer": [ - "${-10, -3 e, -6, -4, -\\pi, -\\sqrt{5}, 0, 2 \\sqrt{5}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -4, -3*math.e, -math.pi, 2*math.sqrt(5), -10,))\nsnd = set((-6, 8, -3*math.e, -math.sqrt(5), 0, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, 3 e, 3, -4 \\sqrt{2}, -1, \\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -1, 3, \\frac{7}{\\sqrt{2}}, 8, 3 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 3*math.e, 3, -4*math.sqrt(2), -1, (7/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, \\frac{17}{\\pi }, 0, \\frac{10}{\\pi }, \\sqrt{2}, -4, 6, -2}$.\n", - "Output Answer": [ - "$10$" - ], - "Output Program": [ - "import math\n\nvalues = -2, (17/math.pi), 0, (10/math.pi), math.sqrt(2), -4, 6, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{2}{\\pi }, -7, -12 \\log (2), 7, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$7+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (2/math.pi), -7, -12*math.log(2), 7, -7*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 9, 3 \\sqrt{5}, 4 \\sqrt{2}, 8, -5, 9, 4}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 9, 3*math.sqrt(5), 4*math.sqrt(2), 8, -5, 9, 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 \\log (2), -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\sqrt{5}, 2 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.log(2), -math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.258,0.099,0.548\\}$ and $\\{0.199,0.212,0.273\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.258, 0.099, 0.548\ndistribution2 = 0.199, 0.212, 0.273\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -8, -4, \\frac{44}{7}, 10}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "values = -1, -8, -4, (44/7), 10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 7, 2, 16}$.\n", - "Output Answer": [ - "$\\frac{2240}{451}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 7, 2, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 6, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{241}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 6, -9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{3}, -2 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, 4 \\sqrt{3}, -\\sqrt{3}, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{3 \\sqrt{3}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(3), -2*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), 4*math.sqrt(3), -math.sqrt(3), -3*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -7, -\\pi, -\\frac{25}{e}}$.", - "Output Answer": [ - "$\\frac{1}{2} (-7-\\pi )$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -7, -math.pi, -(25/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^3+0.1 x^2-2.3 x+3.6$ where $x \\sim $ \\text{NormalDistribution}[1.5,0.7]\n", - "Output Answer": [ - "$7.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.5, 0.7)\nprint(E(1.3*x**3+0.1*x**2-2.3*x+3.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -3, 0, -3}$.\n", - "Output Answer": [ - "${-3, -3, 0, 1}$" - ], - "Output Program": [ - "values = 1, -3, 0, -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{3}, -\\frac{8}{\\sqrt{\\pi }}, \\frac{2}{\\pi }, \\frac{7}{\\pi }, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -\\frac{8}{\\sqrt{\\pi }}, \\frac{2}{\\pi }, \\frac{7}{\\pi }, 2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(3), -(8/(math.sqrt(math.pi))), (2/math.pi), (7/math.pi), -3*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, \\frac{4}{3}, \\frac{59}{3}}$.\n", - "Output Answer": [ - "$\\frac{708}{307}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, (4/3), (59/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -3 e, -e, 3 e, -3 e, -e, -e, 0, e, e, 0, e, e, e, e, -3 e, 3 e, 3 e, e, e, e, e, 3 e, -e, 0, e, -3 e, 3 e}$.\n", - "Output Answer": [ - "$\\{e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, -3*math.e, -math.e, 3*math.e, -3*math.e, -math.e, -math.e, 0, math.e, math.e, 0, math.e, math.e, math.e, math.e, -3*math.e, 3*math.e, 3*math.e, math.e, math.e, math.e, math.e, 3*math.e, -math.e, 0, math.e, -3*math.e, 3*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 2 e, -8, -8.45, -\\frac{28}{3}, 4, -4} \\setminus {-7, 6.21, 4, -\\frac{28}{3}, 2 e, -2, \\frac{15}{4}}$.\n", - "Output Answer": [ - "${-8.45, -8, -4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 2*math.e, -8, -8.45, -(28/3), 4, -4,))\nsnd = set((-7, 6.21, 4, -(28/3), 2*math.e, -2, (15/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -2, 0, -4, 5, -2 \\sqrt{2}, 7, 6, \\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -2, 0, -4, 5, -2*math.sqrt(2), 7, 6, (1/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.8 x^2+4.4 x+4.$ where $x \\sim $ \\text{NormalDistribution}[-0.8,1.]\n", - "Output Answer": [ - "$-0.83$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 1.)\nprint(E(-0.8*x**2+4.4*x+4.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, 12, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{487}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 12, -9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-100000, 16807, 10000, -243, 2}$.\n", - "Output Answer": [ - "$420\\ 5^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -100000, 16807, 10000, -243, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\log (2), -2.041, -1.9} \\setminus {-\\frac{2}{3}, -7.8, -\\frac{5}{2}}$.\n", - "Output Answer": [ - "${-2.041, -1.9, 5 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.log(2), -2.041, -1.9,))\nsnd = set((-(2/3), -7.8, -(5/2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6, -7, 2 e, \\frac{38}{5}} \\cup {-9, -1, 2 e, \\frac{38}{5}}$.\n", - "Output Answer": [ - "${-9, -7, -1, 2 e, 6, \\frac{38}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -7, 2*math.e, (38/5),))\nsnd = set((-9, -1, 2*math.e, (38/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.128,0.018,0.161,0.184,0.223,0.071,0.108\\}$ and $\\{0.165,0.16,0.081,0.071,0.043,0.159,0.169\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.128, 0.018, 0.161, 0.184, 0.223, 0.071, 0.108\ndistribution2 = 0.165, 0.16, 0.081, 0.071, 0.043, 0.159, 0.169\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{7}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -7 \\sqrt{2}, \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{1}{7} \\left(\\frac{17}{\\sqrt{2}}-6 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (7/(math.sqrt(2))), -(13/(math.sqrt(2))), (13/(math.sqrt(2))), (7/(math.sqrt(2))), (3/(math.sqrt(2))), -7*math.sqrt(2), math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, 5 \\sqrt{3}, 0.478}$.\n", - "Output Answer": [ - "${-9, 0.478, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 5*math.sqrt(3), 0.478\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -3 \\log (2), -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$5+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -3*math.log(2), -4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.055,0.102,0.04,0.059,0.119,0.064,0.072,0.095,0.172,0.176\\}$ and $\\{0.081,0.097,0.045,0.068,0.105,0.106,0.148,0.129,0.092,0.05\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.055, 0.102, 0.04, 0.059, 0.119, 0.064, 0.072, 0.095, 0.172, 0.176\ndistribution2 = 0.081, 0.097, 0.045, 0.068, 0.105, 0.106, 0.148, 0.129, 0.092, 0.05\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 256, 1, 64}$.\n", - "Output Answer": [ - "$8 \\sqrt{2} \\sqrt[4]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 256, 1, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, \\frac{4}{\\sqrt{\\pi }}, 3, 1, -\\frac{6}{\\pi }, \\frac{7}{\\sqrt{5}}, 5 \\sqrt{3}, -11 \\log (2), 9 \\log (2), \\frac{1}{\\sqrt{3}}, -\\frac{8}{3}, 5, 9, -2 \\sqrt{5}, 4}$.", - "Output Answer": [ - "$\\frac{4}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, (4/(math.sqrt(math.pi))), 3, 1, -(6/math.pi), (7/(math.sqrt(5))), 5*math.sqrt(3), -11*math.log(2), 9*math.log(2), (1/(math.sqrt(3))), -(8/3), 5, 9, -2*math.sqrt(5), 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\pi, -\\pi, \\pi, 0, \\pi, \\pi, 0, -\\pi, -\\pi, \\pi, -\\pi, -\\pi, \\pi, -\\pi, 3 \\pi, \\pi, -\\pi, 3 \\pi, \\pi, \\pi, -\\pi, 3 \\pi}$.\n", - "Output Answer": [ - "$\\{-\\pi ,\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.pi, -math.pi, math.pi, 0, math.pi, math.pi, 0, -math.pi, -math.pi, math.pi, -math.pi, -math.pi, math.pi, -math.pi, 3*math.pi, math.pi, -math.pi, 3*math.pi, math.pi, math.pi, -math.pi, 3*math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{17}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -2, -\\frac{14}{\\sqrt{3}}, 6, 1, -3, -5, -\\frac{51}{7}, -1, -3, -6, 2}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (17/(math.sqrt(5))), -(2/(math.sqrt(5))), -2, -(14/(math.sqrt(3))), 6, 1, -3, -5, -(51/7), -1, -3, -6, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, -\\frac{9}{2}, -\\frac{5}{2}, \\frac{9}{2}, \\frac{9}{2}, 1, -\\frac{9}{2}, \\frac{9}{2}, 9, 1, -\\frac{9}{2}, -\\frac{9}{2}, -\\frac{5}{2}, -\\frac{9}{2}, -\\frac{5}{2}, \\frac{9}{2}, \\frac{9}{2}, -\\frac{9}{2}, \\frac{9}{2}, 9, \\frac{9}{2}, -\\frac{9}{2}, 9}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{9}{2},\\frac{9}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, -(9/2), -(5/2), (9/2), (9/2), 1, -(9/2), (9/2), 9, 1, -(9/2), -(9/2), -(5/2), -(9/2), -(5/2), (9/2), (9/2), -(9/2), (9/2), 9, (9/2), -(9/2), 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{7}{\\pi }, \\frac{19}{5}, 10, -4 \\sqrt{5}, 8, -2} \\setminus {-\\frac{7}{\\pi }, 0, 10, -2, -\\frac{1}{5}, -9, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, \\frac{19}{5}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(7/math.pi), (19/5), 10, -4*math.sqrt(5), 8, -2,))\nsnd = set((-(7/math.pi), 0, 10, -2, -(1/5), -9, 3*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{32}{5}, -3, \\frac{5}{3}, -8, -10, 8, -9, 7} \\cup {\\frac{5}{3}, \\frac{32}{5}, -7, 2, -5, -3, 3, -8, 5 \\sqrt{3}, \\sqrt{3}}$.\n", - "Output Answer": [ - "${-10, -9, -8, -7, -5, -3, \\frac{5}{3}, \\sqrt{3}, 2, 3, \\frac{32}{5}, 7, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((32/5), -3, (5/3), -8, -10, 8, -9, 7,))\nsnd = set(((5/3), (32/5), -7, 2, -5, -3, 3, -8, 5*math.sqrt(3), math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, -15, -6, 10, -2}$.\n", - "Output Answer": [ - "$\\frac{1213}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -15, -6, 10, -2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-e, -2 e, -e, -2 e, -2 e, -2 e, e, -e, 2 e, 2 e, 4 e, 2 e, -e, e, -e, -e, 4 e, -e, -e, e, -e, -e, -e, -e, -2 e, 2 e, -e}$.\n", - "Output Answer": [ - "$\\{-e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.e, -2*math.e, -math.e, -2*math.e, -2*math.e, -2*math.e, math.e, -math.e, 2*math.e, 2*math.e, 4*math.e, 2*math.e, -math.e, math.e, -math.e, -math.e, 4*math.e, -math.e, -math.e, math.e, -math.e, -math.e, -math.e, -math.e, -2*math.e, 2*math.e, -math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 e, -10, -4, -5 \\sqrt{3}, -2, 9, 3, -2, -\\frac{18}{e}}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, -10, -4, -5*math.sqrt(3), -2, 9, 3, -2, -(18/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, -3, 0, -\\pi, 7.1, 4, 5 \\log (2), \\frac{15}{e}}$.\n", - "Output Answer": [ - "${-\\pi, -3, 0, 0, 5 \\log (2), 4, \\frac{15}{e}, 7.1}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -3, 0, -math.pi, 7.1, 4, 5*math.log(2), (15/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -6, \\frac{1}{2}, -\\frac{3}{2}, 9, \\frac{5}{2}}$.\n", - "Output Answer": [ - "$\\frac{13}{12}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -6, (1/2), -(3/2), 9, (5/2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, 9, 2 \\pi, 8, 1, \\frac{16}{\\sqrt{3}}, 3, 9}$.\n", - "Output Answer": [ - "${1, 1, 3, 2 \\pi, 8, 9, 9, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 9, 2*math.pi, 8, 1, (16/(math.sqrt(3))), 3, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 19, 1}$.\n", - "Output Answer": [ - "$\\frac{1026}{379}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 19, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, -12 \\log (2), \\frac{36}{5}, 7, -7 \\sqrt{2}, -2 e, \\frac{49}{5}, -5}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -12*math.log(2), (36/5), 7, -7*math.sqrt(2), -2*math.e, (49/5), -5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{29}{5}, -3, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{29}{5}+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (29/5), -3, -7*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{8}{e}, \\frac{17}{e}, \\frac{15}{e}, \\frac{17}{e}, -\\frac{8}{e}, \\frac{15}{e}, \\frac{15}{e}, -\\frac{25}{e}, -\\frac{25}{e}, \\frac{17}{e}, \\frac{15}{e}, \\frac{15}{e}, \\frac{17}{e}, -\\frac{25}{e}, \\frac{15}{e}, \\frac{17}{e}, -\\frac{25}{e}, \\frac{15}{e}, \\frac{17}{e}, -\\frac{8}{e}, \\frac{15}{e}, \\frac{15}{e}, -\\frac{25}{e}, \\frac{17}{e}, \\frac{15}{e}, \\frac{17}{e}, \\frac{15}{e}, \\frac{15}{e}, \\frac{17}{e}, -\\frac{25}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{15}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(8/math.e), (17/math.e), (15/math.e), (17/math.e), -(8/math.e), (15/math.e), (15/math.e), -(25/math.e), -(25/math.e), (17/math.e), (15/math.e), (15/math.e), (17/math.e), -(25/math.e), (15/math.e), (17/math.e), -(25/math.e), (15/math.e), (17/math.e), -(8/math.e), (15/math.e), (15/math.e), -(25/math.e), (17/math.e), (15/math.e), (17/math.e), (15/math.e), (15/math.e), (17/math.e), -(25/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 9, 4, 4, 9, 9, 9, -7, -4, -4, -6, -4, -6, -4, -7, -6, -7, 9, -4, -7, -6, 4, 4, 9, -4, 4}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 9, 4, 4, 9, 9, 9, -7, -4, -4, -6, -4, -6, -4, -7, -6, -7, 9, -4, -7, -6, 4, 4, 9, -4, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -1, 4, -7, -4, -3, -1, -4, -4, 4, -3, -4, -4, -7, -4, -3, -7, -4, -4, -7}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -1, 4, -7, -4, -3, -1, -4, -4, 4, -3, -4, -4, -7, -4, -3, -7, -4, -4, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -2, \\frac{47}{5}, \\frac{7}{\\sqrt{2}}, -4, 1, -\\frac{7}{3}, 7} \\cup {-1, 3, -5, -9, \\frac{47}{5}, \\frac{13}{\\sqrt{2}}, -\\frac{7}{3}, -2, 0}$.\n", - "Output Answer": [ - "${-9, -5, -4, -\\frac{7}{3}, -2, -1, 0, 1, 3, \\frac{7}{\\sqrt{2}}, 7, \\frac{13}{\\sqrt{2}}, \\frac{47}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -2, (47/5), (7/(math.sqrt(2))), -4, 1, -(7/3), 7,))\nsnd = set((-1, 3, -5, -9, (47/5), (13/(math.sqrt(2))), -(7/3), -2, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -3, -10, 0, -4, -8}$.\n", - "Output Answer": [ - "$-\\frac{13}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -3, -10, 0, -4, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.494,0.226,0.027,0.162,0.06\\}$ and $\\{0.157,0.076,0.095,0.223,0.27\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.494, 0.226, 0.027, 0.162, 0.06\ndistribution2 = 0.157, 0.076, 0.095, 0.223, 0.27\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, 9.84, -7, -8.6, -10}$.\n", - "Output Answer": [ - "${-10, -8.6, -7, 7, 9.84}$" - ], - "Output Program": [ - "values = 7, 9.84, -7, -8.6, -10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 9, 7, -5, -1, 10}$.\n", - "Output Answer": [ - "$\\frac{11}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 9, 7, -5, -1, 10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3 e, 3, 4} \\cup {4, 3, e}$.\n", - "Output Answer": [ - "${e, 3, 4, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.e, 3, 4,))\nsnd = set((4, 3, math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -\\frac{17}{4}, 7.8, -\\frac{20}{\\pi }, 8} \\setminus {\\frac{29}{4}, -5, -\\frac{20}{\\pi }, -8, -6}$.\n", - "Output Answer": [ - "${-\\frac{17}{4}, -2, 7.8, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -(17/4), 7.8, -(20/math.pi), 8,))\nsnd = set(((29/4), -5, -(20/math.pi), -8, -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 19, 9}$.\n", - "Output Answer": [ - "$\\frac{6669}{535}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 19, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.4 x^3-1.1 x^2+2.6 x+3.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-0.4*x**3-1.1*x**2+2.6*x+3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, -\\frac{4}{\\sqrt{3}}, 11 \\log (2), 7, -4 \\sqrt{3}, 3, 0, -1, -10, 2 \\sqrt{2}, -2 \\pi}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, -(4/(math.sqrt(3))), 11*math.log(2), 7, -4*math.sqrt(3), 3, 0, -1, -10, 2*math.sqrt(2), -2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, 1, 25, 4, -4, 625}$.\n", - "Output Answer": [ - "$5\\ 2^{2/3} \\sqrt[3]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 1, 25, 4, -4, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${5, -1, 12, -11, 13, 5}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2381}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -1, 12, -11, 13, 5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{30}{7}, 2, 7, -1, -3 \\pi, -4 \\sqrt{2}} \\setminus {-3 \\pi, -1, -4 \\sqrt{2}, -\\frac{30}{7}, \\frac{3}{5}, 2}$.\n", - "Output Answer": [ - "${7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(30/7), 2, 7, -1, -3*math.pi, -4*math.sqrt(2),))\nsnd = set((-3*math.pi, -1, -4*math.sqrt(2), -(30/7), (3/5), 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -8, -\\frac{68}{7}, 2, 3} \\setminus {-\\frac{25}{7}, 3, -8, 2, 9, \\frac{9}{7}}$.\n", - "Output Answer": [ - "${-\\frac{68}{7}, -6}$" - ], - "Output Program": [ - "fst = set((-6, -8, -(68/7), 2, 3,))\nsnd = set((-(25/7), 3, -8, 2, 9, (9/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, 36, -1000}$.\n", - "Output Answer": [ - "$30\\ 2^{2/3} \\sqrt[3]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 36, -1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6, -4 \\sqrt{2}, 3, -3.49, 2, 1} \\setminus {10, 2, 6}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -3.49, 1, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -4*math.sqrt(2), 3, -3.49, 2, 1,))\nsnd = set((10, 2, 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\sqrt{3}, 4 \\sqrt{3}, 6 \\sqrt{3}, 4 \\sqrt{3}, 0, 5 \\sqrt{3}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{27 \\sqrt{3}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.sqrt(3), 4*math.sqrt(3), 6*math.sqrt(3), 4*math.sqrt(3), 0, 5*math.sqrt(3), 5*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{7}, -\\frac{66}{7}, 9, -\\frac{13}{7}, \\frac{17}{7}}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(1/7), -(66/7), 9, -(13/7), (17/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\log (2), 2 \\sqrt{2}, 14 \\log (2), 3 \\pi, 8.702, 6 \\log (2)} \\setminus {-\\frac{8}{\\sqrt{5}}, 0, 2 \\sqrt{2}, -10 \\log (2), -\\log (2)}$.\n", - "Output Answer": [ - "${4 \\log (2), 6 \\log (2), 8.702, 3 \\pi, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.log(2), 2*math.sqrt(2), 14*math.log(2), 3*math.pi, 8.702, 6*math.log(2),))\nsnd = set((-(8/(math.sqrt(5))), 0, 2*math.sqrt(2), -10*math.log(2), -math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{1}{e}, \\frac{8}{7}, -6, 0} \\cup {-3, \\frac{8}{7}, -6, -8, \\frac{19}{e}, 0}$.\n", - "Output Answer": [ - "${-8, -6, -3, 0, \\frac{1}{e}, \\frac{8}{7}, \\frac{19}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/math.e), (8/7), -6, 0,))\nsnd = set((-3, (8/7), -6, -8, (19/math.e), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.059,0.127,0.18,0.111,0.203,0.185,0.098,0.034\\}$ and $\\{0.227,0.062,0.066,0.071,0.137,0.197,0.103,0.12\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.059, 0.127, 0.18, 0.111, 0.203, 0.185, 0.098, 0.034\ndistribution2 = 0.227, 0.062, 0.066, 0.071, 0.137, 0.197, 0.103, 0.12\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -5.33, -8, 5, -7, 6.112, -5 \\sqrt{2}, -0.966, 1.8} \\cup {0, 5, -5 \\sqrt{2}, -5.33, 6, -0.966, 7, -3.798, -2., 2}$.\n", - "Output Answer": [ - "${-8, -5 \\sqrt{2}, -7, -5.33, -3.798, -2., -0.966, 0, 1.8, 2, 5, 6, 6.112, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -5.33, -8, 5, -7, 6.112, -5*math.sqrt(2), -0.966, 1.8,))\nsnd = set((0, 5, -5*math.sqrt(2), -5.33, 6, -0.966, 7, -3.798, -2., 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 16, 5}$.\n", - "Output Answer": [ - "$2 \\sqrt[3]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 16, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{39}{4}, \\frac{7}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{39}{4}+\\frac{7}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(39/4), (7/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, 9, -9, 0, -8, 3 \\sqrt{2}, 0, -\\pi, -6}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 9, -9, 0, -8, 3*math.sqrt(2), 0, -math.pi, -6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{24}{5}, \\frac{21}{\\pi }, -\\frac{7}{\\pi }}$.", - "Output Answer": [ - "$-\\frac{7}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(24/5), (21/math.pi), -(7/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{2}, 19, 5}$.\n", - "Output Answer": [ - "$\\frac{3135}{454}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/2), 19, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x^2-2.6 x-1.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-0.12$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(2.2*x**2-2.6*x-1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x-1.5$ where $x \\sim $ \\text{PoissonDistribution}[1.7]\n", - "Output Answer": [ - "$3.43$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.7)\nprint(E(2.9*x-1.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.8 x+0.4$ where $x \\sim $ \\text{ExponentialDistribution}[0.7]\n", - "Output Answer": [ - "$7.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.7)\nprint(E(4.8*x+0.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-5, 10000, -7, 10}$.\n", - "Output Answer": [ - "$10 \\sqrt{5} \\sqrt[4]{14}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 10000, -7, 10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 2, -7, -4, 8, 5}$.\n", - "Output Answer": [ - "$\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 2, -7, -4, 8, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\sqrt{3}, -4 \\sqrt{3}, -3 \\sqrt{3}, -2 \\sqrt{3}} \\cap {5 \\sqrt{3}, 0, -3 \\sqrt{3}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), -4*math.sqrt(3), -3*math.sqrt(3), -2*math.sqrt(3),))\nsnd = set((5*math.sqrt(3), 0, -3*math.sqrt(3), -2*math.sqrt(3),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{5}, -\\sqrt{5}, 0, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$-\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(5), -math.sqrt(5), 0, -2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.036,0.399,0.095,0.252,0.04,0.018\\}$ and $\\{0.151,0.136,0.08,0.236,0.08,0.048\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.036, 0.399, 0.095, 0.252, 0.04, 0.018\ndistribution2 = 0.151, 0.136, 0.08, 0.236, 0.08, 0.048\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.159,0.052,0.268,0.037,0.196,0.078,0.016,0.047\\}$ and $\\{0.215,0.058,0.056,0.128,0.146,0.056,0.162,0.142\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.159, 0.052, 0.268, 0.037, 0.196, 0.078, 0.016, 0.047\ndistribution2 = 0.215, 0.058, 0.056, 0.128, 0.146, 0.056, 0.162, 0.142\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 10, 0, -3, 6, -15}$.\n", - "Output Answer": [ - "$\\frac{739}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 10, 0, -3, 6, -15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${1, 1, 6, -3, 8, 10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{737}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 1, 6, -3, 8, 10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2, 2 e, 6, 3 \\sqrt{3}, -4, -9, 0.65, -3 \\sqrt{2}, -2} \\cup {8, -4, 2 e, 2, -\\sqrt{5}, 5 \\sqrt{2}, -2, -4 \\sqrt{3}, 7.34, 6, -9}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{3}, -3 \\sqrt{2}, -4, -\\sqrt{5}, -2, 0.65, 2, 3 \\sqrt{3}, 2 e, 6, 5 \\sqrt{2}, 7.34, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 2*math.e, 6, 3*math.sqrt(3), -4, -9, 0.65, -3*math.sqrt(2), -2,))\nsnd = set((8, -4, 2*math.e, 2, -math.sqrt(5), 5*math.sqrt(2), -2, -4*math.sqrt(3), 7.34, 6, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.2 x^2+2.7 x-3.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$3.84$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(3.2*x**2+2.7*x-3.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${11 \\log (2), 0, -4, -\\frac{13}{\\pi }, -3 \\sqrt{5}} \\cup {4, 0, -\\frac{13}{\\pi }, 11 \\log (2), -3 \\sqrt{5}, -4.18}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -4.18, -\\frac{13}{\\pi }, -4, 0, 4, 11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((11*math.log(2), 0, -4, -(13/math.pi), -3*math.sqrt(5),))\nsnd = set((4, 0, -(13/math.pi), 11*math.log(2), -3*math.sqrt(5), -4.18,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -9, 8, -4, 2, 2}$.\n", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -9, 8, -4, 2, 2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{3}, 10, 0, 3, \\frac{11}{\\sqrt{2}}} \\cup {0, 3, \\frac{7}{\\sqrt{2}}, \\sqrt{3}}$.\n", - "Output Answer": [ - "${0, \\sqrt{3}, 3, \\frac{7}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), 10, 0, 3, (11/(math.sqrt(2))),))\nsnd = set((0, 3, (7/(math.sqrt(2))), math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.2 x-3.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-3.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(-0.2*x-3.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 32768, 81, 1296, 81}$.\n", - "Output Answer": [ - "$288\\ 3^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 32768, 81, 1296, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, 3, -9, 1, -9, \\sqrt{3}, \\frac{3}{\\sqrt{\\pi }}, -\\sqrt{3}, 3, 0}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(1+\\frac{3}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 3, -9, 1, -9, math.sqrt(3), (3/(math.sqrt(math.pi))), -math.sqrt(3), 3, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, 0, -\\frac{18}{e}, \\frac{9}{\\sqrt{\\pi }}, 8, -6, 9, -7, 1, \\frac{21}{5}}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 0, -(18/math.e), (9/(math.sqrt(math.pi))), 8, -6, 9, -7, 1, (21/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.062,0.274,0.483\\}$ and $\\{0.373,0.122,0.095\\}$.", - "Output Answer": [ - "$0.77$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.062, 0.274, 0.483\ndistribution2 = 0.373, 0.122, 0.095\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5, 3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 3*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.111,0.253,0.253,0.053,0.147,0.074,0.036\\}$ and $\\{0.073,0.05,0.116,0.152,0.016,0.225,0.159\\}$.", - "Output Answer": [ - "$0.69$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.111, 0.253, 0.253, 0.053, 0.147, 0.074, 0.036\ndistribution2 = 0.073, 0.05, 0.116, 0.152, 0.016, 0.225, 0.159\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -4, -3, -4, -8, 8, 8, 10}$.\n", - "Output Answer": [ - "$\\frac{7}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -4, -3, -4, -8, 8, 8, 10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, 2, -8, \\frac{27}{4}, -4, -4 \\sqrt{2}, -\\frac{13}{\\sqrt{5}}, -8 \\log (2), -2, 3, 8, \\frac{12}{\\sqrt{5}}, 6}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, 2, -8, (27/4), -4, -4*math.sqrt(2), -(13/(math.sqrt(5))), -8*math.log(2), -2, 3, 8, (12/(math.sqrt(5))), 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 5.95, -1, \\sqrt{3}} \\setminus {8, 9, -7, -2 \\sqrt{3}, 5, 5.95}$.\n", - "Output Answer": [ - "${-1, \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 5.95, -1, math.sqrt(3),))\nsnd = set((8, 9, -7, -2*math.sqrt(3), 5, 5.95,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, 6, 0, 10, 5, 2 \\sqrt{5}} \\cup {8, -2, 0, 10, -\\sqrt{5}, 6}$.\n", - "Output Answer": [ - "${-\\sqrt{5}, -2, 0, 2 \\sqrt{5}, 5, 6, 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 6, 0, 10, 5, 2*math.sqrt(5),))\nsnd = set((8, -2, 0, 10, -math.sqrt(5), 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{\\sqrt{\\pi }}, 6 \\sqrt{2}, 3 \\sqrt{3}, 7, 7, -10 \\log (2), -3, -\\frac{22}{3}, 7 \\sqrt{2}, -8, -1, \\frac{1}{\\sqrt{2}}, 4}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (13/(math.sqrt(math.pi))), 6*math.sqrt(2), 3*math.sqrt(3), 7, 7, -10*math.log(2), -3, -(22/3), 7*math.sqrt(2), -8, -1, (1/(math.sqrt(2))), 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 13, -4, 15, 15, 7}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1589}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 13, -4, 15, 15, 7\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.5 x^2+3.1 x-0.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$9.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(3.5*x**2+3.1*x-0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{3}, -4}$.\n", - "Output Answer": [ - "${-\\frac{13}{3}, -4}$" - ], - "Output Program": [ - "values = -(13/3), -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, 1, 0, -15, -11, 10}$.\n", - "Output Answer": [ - "$\\frac{1696}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 1, 0, -15, -11, 10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.13,0.101,0.105,0.016,0.123,0.208,0.053,0.123\\}$ and $\\{0.114,0.149,0.192,0.117,0.125,0.023,0.16,0.059\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.13, 0.101, 0.105, 0.016, 0.123, 0.208, 0.053, 0.123\ndistribution2 = 0.114, 0.149, 0.192, 0.117, 0.125, 0.023, 0.16, 0.059\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 12, -13}$.\n", - "Output Answer": [ - "$217$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 12, -13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, e, -\\frac{19}{\\sqrt{5}}, -3 \\pi, \\frac{16}{\\sqrt{\\pi }}, -\\sqrt{5}, -\\frac{13}{3}, -7 \\sqrt{2}, 5 \\sqrt{3}, -\\frac{5}{\\pi }, -\\frac{8}{\\pi }, 5 \\sqrt{3}, -\\sqrt{2}}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, math.e, -(19/(math.sqrt(5))), -3*math.pi, (16/(math.sqrt(math.pi))), -math.sqrt(5), -(13/3), -7*math.sqrt(2), 5*math.sqrt(3), -(5/math.pi), -(8/math.pi), 5*math.sqrt(3), -math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.052,0.252,0.041,0.066,0.084,0.104,0.054,0.189\\}$ and $\\{0.152,0.136,0.06,0.188,0.088,0.091,0.06,0.181\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.052, 0.252, 0.041, 0.066, 0.084, 0.104, 0.054, 0.189\ndistribution2 = 0.152, 0.136, 0.06, 0.188, 0.088, 0.091, 0.06, 0.181\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${10, 15, 14, -10}$.\n", - "Output Answer": [ - "$\\frac{1643}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 15, 14, -10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{3}, \\sqrt{3}, -\\sqrt{3}, -4 \\sqrt{3}, -3 \\sqrt{3}, -4 \\sqrt{3}, \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{6 \\sqrt{3}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(3), math.sqrt(3), -math.sqrt(3), -4*math.sqrt(3), -3*math.sqrt(3), -4*math.sqrt(3), math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -1, 4, -\\sqrt{5}, \\frac{29}{5}}$.\n", - "Output Answer": [ - "$8+\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -1, 4, -math.sqrt(5), (29/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2 \\pi, -8, -7}$.\n", - "Output Answer": [ - "${-8, -7, -2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.pi, -8, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, 16, -9}$.\n", - "Output Answer": [ - "$8 \\sqrt[3]{2} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, 16, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x^3+0.2 x^2+1.4 x+3.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$8.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(3.4*x**3+0.2*x**2+1.4*x+3.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x^2-1.6 x-0.2$ where $x \\sim $ \\text{PoissonDistribution}[0.8]\n", - "Output Answer": [ - "$-4.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.8)\nprint(E(-2.3*x**2-1.6*x-0.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -7, 4, -7, -2, -4}$.\n", - "Output Answer": [ - "$-\\frac{11}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -7, 4, -7, -2, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 5, 0, -10, 11}$.\n", - "Output Answer": [ - "$\\frac{593}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 5, 0, -10, 11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6., -8, 1.4, 8, -5, 0, -4 \\sqrt{3}} \\cup {-6., 1.4, -1, 3, 5 \\sqrt{3}, 8, -2}$.\n", - "Output Answer": [ - "${-8, -4 \\sqrt{3}, -6., -5, -2, -1, 0, 1.4, 3, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6., -8, 1.4, 8, -5, 0, -4*math.sqrt(3),))\nsnd = set((-6., 1.4, -1, 3, 5*math.sqrt(3), 8, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.142,0.063,0.084,0.255,0.097,0.079,0.055,0.168\\}$ and $\\{0.011,0.058,0.008,0.54,0.09,0.049,0.075,0.084\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.142, 0.063, 0.084, 0.255, 0.097, 0.079, 0.055, 0.168\ndistribution2 = 0.011, 0.058, 0.008, 0.54, 0.09, 0.049, 0.075, 0.084\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 4, 6, 3}$.\n", - "Output Answer": [ - "$\\frac{16}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 4, 6, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6 \\log (2), 2 \\sqrt{2}, -\\frac{3}{\\pi }}$.\n", - "Output Answer": [ - "${-6 \\log (2), -\\frac{3}{\\pi }, 2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.log(2), 2*math.sqrt(2), -(3/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${625, 36, 729, -729}$.\n", - "Output Answer": [ - "$(135+135 i) \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 625, 36, 729, -729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 11, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{217}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 11, -2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.046,0.044,0.011,0.086,0.094,0.112,0.04,0.142,0.054,0.251\\}$ and $\\{0.131,0.036,0.248,0.175,0.101,0.029,0.029,0.1,0.051,0.027\\}$.", - "Output Answer": [ - "$0.77$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.046, 0.044, 0.011, 0.086, 0.094, 0.112, 0.04, 0.142, 0.054, 0.251\ndistribution2 = 0.131, 0.036, 0.248, 0.175, 0.101, 0.029, 0.029, 0.1, 0.051, 0.027\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 8, 0, 0, 9, 4, 8, 8, 9, 4, 0, 9, 4, 4, 0, 9, 8, 8, 4, 8, 0, 0, 8, 9, 8, 8, 4, 9, 4, 9}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 8, 0, 0, 9, 4, 8, 8, 9, 4, 0, 9, 4, 4, 0, 9, 8, 8, 4, 8, 0, 0, 8, 9, 8, 8, 4, 9, 4, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, \\frac{36}{5}, -9, \\frac{9}{7}, -7, 3 \\sqrt{3}, -\\sqrt{2}, 0, 8} \\cup {-1, 4, -\\frac{19}{e}, -\\sqrt{2}, 3 \\sqrt{3}, -9, -7, -6, \\frac{36}{5}}$.\n", - "Output Answer": [ - "${-9, -7, -\\frac{19}{e}, -6, -\\sqrt{2}, -1, 0, \\frac{9}{7}, 4, 3 \\sqrt{3}, \\frac{36}{5}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, (36/5), -9, (9/7), -7, 3*math.sqrt(3), -math.sqrt(2), 0, 8,))\nsnd = set((-1, 4, -(19/math.e), -math.sqrt(2), 3*math.sqrt(3), -9, -7, -6, (36/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${2, -7, 6, -4} \\cap {2, 9, 6, -9, -6, -3}$.\n", - "Output Answer": [ - "${2, 6}$" - ], - "Output Program": [ - "fst = set((2, -7, 6, -4,))\nsnd = set((2, 9, 6, -9, -6, -3,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9.5, 2 \\pi, -\\frac{13}{\\pi }, -\\frac{13}{\\sqrt{\\pi }}, 3 \\pi, 2 \\sqrt{5}, 2} \\setminus {0.2, -\\frac{13}{\\sqrt{\\pi }}, 2 \\pi, 3 \\pi, -\\frac{1}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-9.5, -\\frac{13}{\\pi }, 2, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9.5, 2*math.pi, -(13/math.pi), -(13/(math.sqrt(math.pi))), 3*math.pi, 2*math.sqrt(5), 2,))\nsnd = set((0.2, -(13/(math.sqrt(math.pi))), 2*math.pi, 3*math.pi, -(1/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x-3.6$ where $x \\sim $ \\text{PoissonDistribution}[0.5]\n", - "Output Answer": [ - "$-1.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.5)\nprint(E(3.9*x-3.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, \\sqrt{5}, \\frac{5}{2}, -7, 8, -5 \\sqrt{2}, -8.468, 7}$.\n", - "Output Answer": [ - "${-8.468, -5 \\sqrt{2}, -7, \\sqrt{5}, \\frac{5}{2}, 5, 7, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, math.sqrt(5), (5/2), -7, 8, -5*math.sqrt(2), -8.468, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.062,0.113,0.077,0.086,0.092,0.013,0.33,0.055,0.048,0.055\\}$ and $\\{0.103,0.195,0.093,0.101,0.147,0.092,0.072,0.065,0.024,0.075\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.062, 0.113, 0.077, 0.086, 0.092, 0.013, 0.33, 0.055, 0.048, 0.055\ndistribution2 = 0.103, 0.195, 0.093, 0.101, 0.147, 0.092, 0.072, 0.065, 0.024, 0.075\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\sqrt{5}, -\\frac{5}{e}, -4, 3 \\sqrt{5}, -6, -\\frac{1}{\\sqrt{5}}} \\setminus {-5, -\\frac{5}{e}, -\\frac{22}{3}, 0}$.\n", - "Output Answer": [ - "${-6, -4, -\\frac{1}{\\sqrt{5}}, \\sqrt{5}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(5), -(5/math.e), -4, 3*math.sqrt(5), -6, -(1/(math.sqrt(5))),))\nsnd = set((-5, -(5/math.e), -(22/3), 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x+0.$ where $x \\sim $ \\text{BetaDistribution}[1.5,0.6]\n", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 0.6)\nprint(E(0.2*x+0.))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2, 1, -4, 0, -5, -8, -7, 2, -6, 5, 7, 3, -9} \\cap {6, -7, -9, 5, 0, 3, -2, -5, 10, 7, 8}$.\n", - "Output Answer": [ - "${-9, -7, -5, -2, 0, 3, 5, 7}$" - ], - "Output Program": [ - "fst = set((-2, 1, -4, 0, -5, -8, -7, 2, -6, 5, 7, 3, -9,))\nsnd = set((6, -7, -9, 5, 0, 3, -2, -5, 10, 7, 8,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-e, 0, -3 e, -e, 0}$.\n", - "Output Answer": [ - "$-e$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.e, 0, -3*math.e, -math.e, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${7, 3, -6, 2, 8, 3}$.\n", - "Output Answer": [ - "$\\frac{737}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 3, -6, 2, 8, 3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 9, 3}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 9, 3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -6, -3 \\sqrt{2}, 2 \\sqrt{5}, -4, -10}$.\n", - "Output Answer": [ - "$10+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -6, -3*math.sqrt(2), 2*math.sqrt(5), -4, -10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -3, 3, 4, -4, -10, 0}$.\n", - "Output Answer": [ - "$-\\frac{10}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -3, 3, 4, -4, -10, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\pi, 0, -e, -7, -1} \\setminus {-1, -2 \\pi, -7, \\frac{12}{e}, -e}$.\n", - "Output Answer": [ - "${-\\pi, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, 0, -math.e, -7, -1,))\nsnd = set((-1, -2*math.pi, -7, (12/math.e), -math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9.5, -\\frac{17}{2}, 0, -4 \\log (2), 6} \\setminus {-\\frac{3}{\\sqrt{2}}, -4 \\log (2), 10, -9.5, -\\frac{17}{2}, 0}$.\n", - "Output Answer": [ - "${6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9.5, -(17/2), 0, -4*math.log(2), 6,))\nsnd = set((-(3/(math.sqrt(2))), -4*math.log(2), 10, -9.5, -(17/2), 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x+2.2$ where $x \\sim $ \\text{NormalDistribution}[0.5,1.4]\n", - "Output Answer": [ - "$2.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.5, 1.4)\nprint(E(0.2*x+2.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, \\frac{21}{2}}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "import statistics\nvalues = 14, (21/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{7}{e}, -\\frac{2}{\\pi }, -\\sqrt{5}, 1, 3} \\setminus {-6, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{7}{e}, -\\frac{2}{\\pi }, 1, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(7/math.e), -(2/math.pi), -math.sqrt(5), 1, 3,))\nsnd = set((-6, -math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, 8, 9, 10, 0, 2}$.\n", - "Output Answer": [ - "${-3, 0, 2, 8, 9, 10}$" - ], - "Output Program": [ - "values = -3, 8, 9, 10, 0, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 4 \\sqrt{3}, 9.6, -\\log (2), -\\frac{30}{7}, 7} \\cup {7, 6, 4 \\sqrt{3}, 9.6, 3, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{30}{7}, -1, -\\log (2), 3, 6, 4 \\sqrt{3}, 10 \\log (2), 7, 9.6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 4*math.sqrt(3), 9.6, -math.log(2), -(30/7), 7,))\nsnd = set((7, 6, 4*math.sqrt(3), 9.6, 3, 10*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 5, 5, 5, -5, -6, -6, 6, -6, 7, 6, -5, -6, 6, -6, 7, 6, -6, 5, 5, 7, 7, 6, 7, 5, -6, 7, 5, 7}$.\n", - "Output Answer": [ - "$\\{5,-6,7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 5, 5, 5, -5, -6, -6, 6, -6, 7, 6, -5, -6, 6, -6, 7, 6, -6, 5, 5, 7, 7, 6, 7, 5, -6, 7, 5, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.073,0.124,0.045,0.071,0.12,0.059,0.134,0.213\\}$ and $\\{0.134,0.044,0.11,0.041,0.011,0.104,0.371,0.107\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.073, 0.124, 0.045, 0.071, 0.12, 0.059, 0.134, 0.213\ndistribution2 = 0.134, 0.044, 0.11, 0.041, 0.011, 0.104, 0.371, 0.107\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{18}{e}, 8}$.\n", - "Output Answer": [ - "${-\\frac{18}{e}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(18/math.e), 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, -6, -3, 256, -1}$.\n", - "Output Answer": [ - "$2 \\sqrt[5]{-1} 2^{4/5} 21^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, -6, -3, 256, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{3}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}, 3 \\sqrt{2}, \\frac{11}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{4} \\left(3 \\sqrt{2}-\\frac{3}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(3/(math.sqrt(2))), -(11/(math.sqrt(2))), 3*math.sqrt(2), (11/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 5, -1, -7, \\frac{15}{2}, 2 \\sqrt{3}, 3 \\sqrt{2}, 3 e, \\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$7+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 5, -1, -7, (15/2), 2*math.sqrt(3), 3*math.sqrt(2), 3*math.e, (7/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -e, -3, 5, 2 \\pi, 7} \\cup {-5, 7, -8 \\log (2), \\frac{11}{e}, -e}$.\n", - "Output Answer": [ - "${-8 \\log (2), -5, -3, -e, \\frac{11}{e}, 5, 2 \\pi, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -math.e, -3, 5, 2*math.pi, 7,))\nsnd = set((-5, 7, -8*math.log(2), (11/math.e), -math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${32768, 4096, 729, -1000, 25, 64}$.\n", - "Output Answer": [ - "$192 \\sqrt[6]{-1} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 32768, 4096, 729, -1000, 25, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 9, 10, 13}$.\n", - "Output Answer": [ - "$\\frac{4095}{368}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 9, 10, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -4 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, 5 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, 5 \\sqrt{3}, -\\sqrt{3}, 5 \\sqrt{3}, -4 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-5 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -4*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), 5*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), 5*math.sqrt(3), -math.sqrt(3), 5*math.sqrt(3), -4*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5 \\sqrt{2}, 4, 0}$.\n", - "Output Answer": [ - "$5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(2), 4, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10, 0, 6, 8, 8, -7, 0, 8, 10, -4, 10, 10, 10, 6, -7, -4, 10, 10, -7, 0, 6, 6, -7, 0, 6, 8, -7, -4, -7, 6}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 10, 0, 6, 8, 8, -7, 0, 8, 10, -4, 10, 10, 10, 6, -7, -4, 10, 10, -7, 0, 6, 6, -7, 0, 6, 8, -7, -4, -7, 6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 1, 16}$.\n", - "Output Answer": [ - "$\\frac{720}{271}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 1, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -3, -10, -2, 3, 3, -2, -10, -10, -10, 8, -10, 3, -2, 8, -10, -10, -3, -10, 8, 8}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -3, -10, -2, 3, 3, -2, -10, -10, -10, 8, -10, 3, -2, 8, -10, -10, -3, -10, 8, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\sqrt{3}, -6, 4, -3} \\setminus {-6, \\frac{36}{7}, 2 \\sqrt{3}, 1, 9, -3}$.\n", - "Output Answer": [ - "${\\sqrt{3}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), -6, 4, -3,))\nsnd = set((-6, (36/7), 2*math.sqrt(3), 1, 9, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{11}{4}, -\\frac{37}{4}, -\\frac{33}{4}}$.\n", - "Output Answer": [ - "$-\\frac{27}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(11/4), -(37/4), -(33/4)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, -3, 12, -6, 9, 6}$.\n", - "Output Answer": [ - "$\\frac{868}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -3, 12, -6, 9, 6\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, \\frac{48}{5}, \\frac{15}{\\sqrt{\\pi }}, 6, 2, -\\frac{9}{\\pi }, 1}$.", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, (48/5), (15/(math.sqrt(math.pi))), 6, 2, -(9/math.pi), 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\pi, 2 \\pi, -3 \\pi, -\\pi, -\\pi, 3 \\pi, 2 \\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$\\frac{3 \\pi }{8}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.pi, 2*math.pi, -3*math.pi, -math.pi, -math.pi, 3*math.pi, 2*math.pi, 2*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.329,0.138,0.106\\}$ and $\\{0.333,0.139,0.185\\}$.", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.329, 0.138, 0.106\ndistribution2 = 0.333, 0.139, 0.185\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 10, 5}$.\n", - "Output Answer": [ - "$\\frac{210}{31}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 10, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -4, -5, 4, -5 \\sqrt{3}, -7, 6} \\cup {4, -1, -5, -7, -5 \\sqrt{3}, -3}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -7, -5, -4, -3, -1, 4, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -4, -5, 4, -5*math.sqrt(3), -7, 6,))\nsnd = set((4, -1, -5, -7, -5*math.sqrt(3), -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 4, \\frac{13}{2}}$.\n", - "Output Answer": [ - "$\\frac{1092}{199}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 4, (13/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, 3, -2}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 3, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, 4, 0} \\setminus {-5, 2, 0, -3}$.\n", - "Output Answer": [ - "${4}$" - ], - "Output Program": [ - "fst = set((2, 4, 0,))\nsnd = set((-5, 2, 0, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, -\\frac{37}{4}, 3 e, \\frac{9}{\\pi }, \\frac{24}{\\pi }, 2 \\sqrt{5}, -\\sqrt{5}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{77}{4}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -(37/4), 3*math.e, (9/math.pi), (24/math.pi), 2*math.sqrt(5), -math.sqrt(5), -3*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.2 x^3+3.3 x^2+0.5 x+4.4$ where $x \\sim $ \\text{NormalDistribution}[-1.6,0.9]\n", - "Output Answer": [ - "$-10.83$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 0.9)\nprint(E(3.2*x**3+3.3*x**2+0.5*x+4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 9, -4, -7, 7 \\log (2), -2, \\frac{1}{4}, 2 \\sqrt{3}, 0, 2, 3, 0, \\pi, -1, -7}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 9, -4, -7, 7*math.log(2), -2, (1/4), 2*math.sqrt(3), 0, 2, 3, 0, math.pi, -1, -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, 4, \\frac{16}{5}, -\\frac{14}{e}, 2, 4 \\sqrt{2}, 4, 2, -3, \\frac{9}{2}, -4, -\\frac{7}{e}, -6, 7}$.", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 4, (16/5), -(14/math.e), 2, 4*math.sqrt(2), 4, 2, -3, (9/2), -4, -(7/math.e), -6, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, -\\frac{10}{\\sqrt{3}}, 7 \\log (2), 6, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{10}{\\sqrt{3}}, -1, 7 \\log (2), 6, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -(10/(math.sqrt(3))), 7*math.log(2), 6, 3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.133,0.055,0.062,0.257\\}$ and $\\{0.074,0.234,0.542,0.141\\}$.", - "Output Answer": [ - "$0.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.133, 0.055, 0.062, 0.257\ndistribution2 = 0.074, 0.234, 0.542, 0.141\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 9, -e, \\sqrt{3}, -\\frac{54}{7}, 5, 8, -6, 3 e, -4 \\sqrt{3}} \\cup {3 e, -4 \\sqrt{3}, -e, -8, -2, 5, -4, -\\frac{54}{7}}$.\n", - "Output Answer": [ - "${-8, -\\frac{54}{7}, -4 \\sqrt{3}, -6, -4, -e, -2, \\sqrt{3}, 5, 8, 3 e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 9, -math.e, math.sqrt(3), -(54/7), 5, 8, -6, 3*math.e, -4*math.sqrt(3),))\nsnd = set((3*math.e, -4*math.sqrt(3), -math.e, -8, -2, 5, -4, -(54/7),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9.3, -5, 1, -5.98, -\\frac{1}{2}, -5, -2 \\sqrt{3}, -\\frac{20}{e}}$.\n", - "Output Answer": [ - "${-9.3, -\\frac{20}{e}, -5.98, -5, -5, -2 \\sqrt{3}, -\\frac{1}{2}, 1}$" - ], - "Output Program": [ - "import math\n\nvalues = -9.3, -5, 1, -5.98, -(1/2), -5, -2*math.sqrt(3), -(20/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-14 \\log (2), 5, \\frac{31}{5}, 9, -6, 6, -\\frac{14}{3}}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -14*math.log(2), 5, (31/5), 9, -6, 6, -(14/3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6 \\sqrt{2}, -8, 4.98, \\sqrt{5}, -5, 2, -9, -7} \\cup {-6 \\sqrt{2}, -8, -5, -9, 4 \\sqrt{5}, 9}$.\n", - "Output Answer": [ - "${-9, -6 \\sqrt{2}, -8, -7, -5, 2, \\sqrt{5}, 4.98, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.sqrt(2), -8, 4.98, math.sqrt(5), -5, 2, -9, -7,))\nsnd = set((-6*math.sqrt(2), -8, -5, -9, 4*math.sqrt(5), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10, 7, \\sqrt{2}, -4, 9} \\setminus {2 \\sqrt{2}, 2, 9, 3, 7}$.\n", - "Output Answer": [ - "${-4, \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 7, math.sqrt(2), -4, 9,))\nsnd = set((2*math.sqrt(2), 2, 9, 3, 7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, \\frac{7}{\\pi }, -6 \\sqrt{2}, -7, 3 \\pi, -6.49}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -7, -6.49, \\frac{7}{\\pi }, 7, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, (7/math.pi), -6*math.sqrt(2), -7, 3*math.pi, -6.49\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{2}, \\frac{3}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\frac{7}{\\sqrt{2}}+\\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(2), (3/(math.sqrt(2))), -(7/(math.sqrt(2))), (9/(math.sqrt(2))), -(7/(math.sqrt(2))), (9/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{52}{3}, \\frac{26}{3}, 17}$.\n", - "Output Answer": [ - "$\\frac{2652}{205}$" - ], - "Output Program": [ - "import statistics\nvalues = (52/3), (26/3), 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2 \\pi, -3 \\pi, -\\pi, 0, 2 \\pi, \\pi, 3 \\pi} \\cap {-3 \\pi, 3 \\pi, 0, \\pi, -\\pi, -2 \\pi}$.\n", - "Output Answer": [ - "${-3 \\pi, -2 \\pi, -\\pi, 0, \\pi, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, -3*math.pi, -math.pi, 0, 2*math.pi, math.pi, 3*math.pi,))\nsnd = set((-3*math.pi, 3*math.pi, 0, math.pi, -math.pi, -2*math.pi,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -1, 5, -8, -\\frac{36}{7}, -4, 6, 1, -\\frac{16}{\\sqrt{5}}, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -1, 5, -8, -(36/7), -4, 6, 1, -(16/(math.sqrt(5))), -(15/2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.067,0.136,0.034,0.078,0.14,0.18,0.091,0.043,0.113,0.012\\}$ and $\\{0.198,0.109,0.198,0.039,0.035,0.088,0.032,0.032,0.051,0.18\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.067, 0.136, 0.034, 0.078, 0.14, 0.18, 0.091, 0.043, 0.113, 0.012\ndistribution2 = 0.198, 0.109, 0.198, 0.039, 0.035, 0.088, 0.032, 0.032, 0.051, 0.18\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{68}{7}, \\frac{3}{7}, \\frac{5}{7}, \\frac{3}{7}, \\frac{5}{7}, -\\frac{20}{7}, \\frac{3}{7}, -\\frac{68}{7}, \\frac{3}{7}, \\frac{5}{7}, \\frac{5}{7}, -\\frac{20}{7}, \\frac{5}{7}, -\\frac{20}{7}, \\frac{3}{7}, -\\frac{68}{7}, \\frac{5}{7}, \\frac{5}{7}, -\\frac{68}{7}, -\\frac{68}{7}, \\frac{5}{7}, -\\frac{68}{7}, \\frac{5}{7}, \\frac{3}{7}, -\\frac{20}{7}, \\frac{5}{7}, \\frac{5}{7}, -\\frac{20}{7}, -\\frac{68}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{5}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(68/7), (3/7), (5/7), (3/7), (5/7), -(20/7), (3/7), -(68/7), (3/7), (5/7), (5/7), -(20/7), (5/7), -(20/7), (3/7), -(68/7), (5/7), (5/7), -(68/7), -(68/7), (5/7), -(68/7), (5/7), (3/7), -(20/7), (5/7), (5/7), -(20/7), -(68/7)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3, -9, -\\pi, -2, 2 \\sqrt{5}, -\\frac{9}{\\pi }} \\cup {3, 2 \\sqrt{5}, -2, -\\frac{9}{\\pi }, -\\pi}$.\n", - "Output Answer": [ - "${-9, -\\pi, -\\frac{9}{\\pi }, -2, 3, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -9, -math.pi, -2, 2*math.sqrt(5), -(9/math.pi),))\nsnd = set((3, 2*math.sqrt(5), -2, -(9/math.pi), -math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -13, 9, -4, -4}$.\n", - "Output Answer": [ - "$\\frac{633}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -13, 9, -4, -4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, -7, 3, -6, 2 \\pi} \\setminus {3, 2, -10, \\frac{9}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-7, -6, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -7, 3, -6, 2*math.pi,))\nsnd = set((3, 2, -10, (9/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.176,0.173,0.019,0.046,0.12,0.122,0.252\\}$ and $\\{0.14,0.071,0.005,0.13,0.028,0.087,0.175\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.176, 0.173, 0.019, 0.046, 0.12, 0.122, 0.252\ndistribution2 = 0.14, 0.071, 0.005, 0.13, 0.028, 0.087, 0.175\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 10, 4, -1}$.\n", - "Output Answer": [ - "$2 \\sqrt[4]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 10, 4, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{12}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -\\frac{7}{\\sqrt{3}}} \\setminus {\\sqrt{2}, \\frac{16}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -5, 0}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{3}}, \\frac{12}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((12/(math.sqrt(5))), (8/(math.sqrt(5))), -(7/(math.sqrt(3))),))\nsnd = set((math.sqrt(2), (16/(math.sqrt(5))), (8/(math.sqrt(5))), -5, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, 9, 4, 1000}$.\n", - "Output Answer": [ - "$2\\ 5^{3/4} \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 9, 4, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{46}{7}, \\frac{15}{\\pi }, \\pi, 6, -\\frac{39}{4}, -\\frac{12}{e}, \\frac{37}{5}} \\setminus {\\frac{15}{\\pi }, -\\frac{14}{5}, -\\frac{39}{4}, -\\frac{12}{e}, -\\frac{9}{5}, \\frac{45}{7}}$.\n", - "Output Answer": [ - "${\\pi, 6, \\frac{46}{7}, \\frac{37}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((46/7), (15/math.pi), math.pi, 6, -(39/4), -(12/math.e), (37/5),))\nsnd = set(((15/math.pi), -(14/5), -(39/4), -(12/math.e), -(9/5), (45/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -4, -6, -\\frac{16}{5}, -\\frac{14}{\\sqrt{3}}, 7, 8, 2 \\pi, 13 \\log (2), -\\frac{33}{4}, -5 \\sqrt{2}, 5, \\sqrt{3}, -10}$.\n", - "Output Answer": [ - "$10+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -4, -6, -(16/5), -(14/(math.sqrt(3))), 7, 8, 2*math.pi, 13*math.log(2), -(33/4), -5*math.sqrt(2), 5, math.sqrt(3), -10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, -4, 0, -4 \\sqrt{3}, 1, -9, 5, -8, 10, -5, 5, 7, -8}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, -4, 0, -4*math.sqrt(3), 1, -9, 5, -8, 10, -5, 5, 7, -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6, \\frac{8}{\\pi }, -\\frac{5}{\\pi }, 6}$.\n", - "Output Answer": [ - "${-6, -\\frac{5}{\\pi }, \\frac{8}{\\pi }, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, (8/math.pi), -(5/math.pi), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 3, 4, 1, -7, 14 \\log (2), 7} \\cup {-7, -1, 1, 7, 9, 14 \\log (2), 3 e}$.\n", - "Output Answer": [ - "${-7, -1, 0, 1, 3, 4, 7, 3 e, 9, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 3, 4, 1, -7, 14*math.log(2), 7,))\nsnd = set((-7, -1, 1, 7, 9, 14*math.log(2), 3*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, -6, -3 \\sqrt{5}, 8, 0, -\\frac{18}{\\pi }, -4, -4}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -6, -\\frac{18}{\\pi }, -4, -4, 0, 4, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -6, -3*math.sqrt(5), 8, 0, -(18/math.pi), -4, -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -2 \\sqrt{3}, 8, -1, 11 \\log (2), \\frac{8}{e}} \\setminus {\\frac{8}{e}, -9, -3 \\log (2), 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{3}, -1, 4, 11 \\log (2), 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -2*math.sqrt(3), 8, -1, 11*math.log(2), (8/math.e),))\nsnd = set(((8/math.e), -9, -3*math.log(2), 6*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -6, 10, -2}$.\n", - "Output Answer": [ - "$\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -6, 10, -2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 4, 1, 1, 1}$.\n", - "Output Answer": [ - "$\\sqrt[5]{-1} 2^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 4, 1, 1, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 3, 11, 0}$.\n", - "Output Answer": [ - "$\\frac{70}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 3, 11, 0\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -3, -1, -3, -2, -6, -8}$.\n", - "Output Answer": [ - "$-\\frac{24}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -3, -1, -3, -2, -6, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6 \\log (2), -4 \\log (2), 6 \\log (2), -3 \\log (2), -3 \\log (2), 9 \\log (2), 10 \\log (2), \\log (2), 12 \\log (2), 9 \\log (2), 14 \\log (2), 12 \\log (2), \\log (2), 6 \\log (2), 12 \\log (2), 6 \\log (2), -4 \\log (2), 12 \\log (2), 10 \\log (2), 12 \\log (2), 9 \\log (2), -4 \\log (2), 6 \\log (2), 6 \\log (2), 6 \\log (2), \\log (2), \\log (2), 14 \\log (2), -4 \\log (2)}$.\n", - "Output Answer": [ - "$\\{6 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 6*math.log(2), -4*math.log(2), 6*math.log(2), -3*math.log(2), -3*math.log(2), 9*math.log(2), 10*math.log(2), math.log(2), 12*math.log(2), 9*math.log(2), 14*math.log(2), 12*math.log(2), math.log(2), 6*math.log(2), 12*math.log(2), 6*math.log(2), -4*math.log(2), 12*math.log(2), 10*math.log(2), 12*math.log(2), 9*math.log(2), -4*math.log(2), 6*math.log(2), 6*math.log(2), 6*math.log(2), math.log(2), math.log(2), 14*math.log(2), -4*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, -10, 13, -11, -2}$.\n", - "Output Answer": [ - "$\\frac{1007}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -10, 13, -11, -2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-5, -8, -1}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{37}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -8, -1\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{27}{4}, \\frac{4}{\\sqrt{\\pi }}, -9, -\\frac{22}{e}, -6, -5, -2} \\setminus {10, -6, -2, \\frac{11}{4}}$.\n", - "Output Answer": [ - "${-9, -\\frac{22}{e}, -5, \\frac{4}{\\sqrt{\\pi }}, \\frac{27}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((27/4), (4/(math.sqrt(math.pi))), -9, -(22/math.e), -6, -5, -2,))\nsnd = set((10, -6, -2, (11/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -1, 5, -1, -9, 2, -1, -1, 8, -9, 8, 9, 8, 2, 5, 9, 5, 5, -9, 9, -1, 9, -1, 8, -9}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -1, 5, -1, -9, 2, -1, -1, 8, -9, 8, 9, 8, 2, 5, 9, 5, 5, -9, 9, -1, 9, -1, 8, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, 8, \\frac{13}{e}, 5, -3 \\sqrt{3}, -2 \\sqrt{5}, \\frac{2}{\\pi }}$.", - "Output Answer": [ - "$\\frac{13}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 8, (13/math.e), 5, -3*math.sqrt(3), -2*math.sqrt(5), (2/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\log (2), \\frac{7}{e}, -\\frac{17}{2}, -1, -2}$.\n", - "Output Answer": [ - "$\\frac{17}{2}+\\frac{7}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.log(2), (7/math.e), -(17/2), -1, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 6, -10, -5, -7, 4, -5}$.\n", - "Output Answer": [ - "$-\\frac{8}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 6, -10, -5, -7, 4, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.001,0.164,0.239,0.083,0.205,0.027,0.03,0.161\\}$ and $\\{0.076,0.117,0.153,0.087,0.113,0.098,0.207,0.056\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.001, 0.164, 0.239, 0.083, 0.205, 0.027, 0.03, 0.161\ndistribution2 = 0.076, 0.117, 0.153, 0.087, 0.113, 0.098, 0.207, 0.056\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5.18, -13 \\log (2), -5 \\sqrt{2}, -8, 5}$.\n", - "Output Answer": [ - "${-13 \\log (2), -8, -5 \\sqrt{2}, 5, 5.18}$" - ], - "Output Program": [ - "import math\n\nvalues = 5.18, -13*math.log(2), -5*math.sqrt(2), -8, 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{13}{2}, \\frac{7}{2}, 13}$.\n", - "Output Answer": [ - "$\\frac{273}{47}$" - ], - "Output Program": [ - "import statistics\nvalues = (13/2), (7/2), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 8, 6, -6, -2, -9}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "values = -3, 8, 6, -6, -2, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 100, 36, 64, -2, 2}$.\n", - "Output Answer": [ - "$4 \\sqrt[6]{-1} 2^{2/3} \\sqrt[3]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 100, 36, 64, -2, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, 1, 3, -\\frac{7}{2}, -5, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$8+4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 1, 3, -(7/2), -5, 4*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, 625, 9, 16, -4, 2401}$.\n", - "Output Answer": [ - "$2 \\sqrt[6]{-2} \\sqrt[3]{3} 5^{5/6} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 625, 9, 16, -4, 2401\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{18}{7}, -\\frac{44}{5}, -8, 0, 3 \\sqrt{5}, 1, 6, -4, 4, -\\frac{68}{7}, -\\frac{8}{\\sqrt{3}}, -2 \\sqrt{2}, -2}$.\n", - "Output Answer": [ - "$\\frac{68}{7}+3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (18/7), -(44/5), -8, 0, 3*math.sqrt(5), 1, 6, -4, 4, -(68/7), -(8/(math.sqrt(3))), -2*math.sqrt(2), -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, 8, 4, 7, 8, -11}$.\n", - "Output Answer": [ - "$\\frac{306}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 8, 4, 7, 8, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, -7, \\frac{18}{\\sqrt{\\pi }}, \\frac{6}{e}, \\frac{27}{5}, 7}$.\n", - "Output Answer": [ - "$7+\\frac{18}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -7, (18/(math.sqrt(math.pi))), (6/math.e), (27/5), 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, 4, 5, -\\frac{59}{7}, 4, -4, \\frac{1}{\\sqrt{3}}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -\\frac{59}{7}, -4, \\frac{1}{\\sqrt{3}}, 4, 4, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 4, 5, -(59/7), 4, -4, (1/(math.sqrt(3))), -5*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -9, -7, \\frac{13}{\\pi }, -0.211, \\frac{3}{\\pi }, -\\frac{11}{\\sqrt{2}}, 8, -6.25} \\cup {\\frac{26}{\\pi }, 4, 8.27, 8, \\frac{13}{\\pi }, -\\frac{11}{\\sqrt{2}}, -7, -0.211}$.\n", - "Output Answer": [ - "${-9, -\\frac{11}{\\sqrt{2}}, -7, -6.25, -0.211, 0, \\frac{3}{\\pi }, 4, \\frac{13}{\\pi }, 8, 8.27, \\frac{26}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -9, -7, (13/math.pi), -0.211, (3/math.pi), -(11/(math.sqrt(2))), 8, -6.25,))\nsnd = set(((26/math.pi), 4, 8.27, 8, (13/math.pi), -(11/(math.sqrt(2))), -7, -0.211,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, 3, -6, -5}$.\n", - "Output Answer": [ - "$-\\frac{15}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, 3, -6, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{3}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, -4 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, 3 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}} \\cap {0, -7 \\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}, -\\frac{9}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, 2 \\sqrt{2}, \\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((3/(math.sqrt(2))), (13/(math.sqrt(2))), -4*math.sqrt(2), -(7/(math.sqrt(2))), 3*math.sqrt(2), (7/(math.sqrt(2))), -(5/(math.sqrt(2))), -(11/(math.sqrt(2))), (1/(math.sqrt(2))), -(9/(math.sqrt(2))),))\nsnd = set((0, -7*math.sqrt(2), math.sqrt(2), -5*math.sqrt(2), -(9/(math.sqrt(2))), -(13/(math.sqrt(2))), -(11/(math.sqrt(2))), (13/(math.sqrt(2))), 2*math.sqrt(2), (3/(math.sqrt(2))),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, 7.5}$.\n", - "Output Answer": [ - "${-1, 7.5}$" - ], - "Output Program": [ - "values = -1, 7.5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, 9, -5, 2, -4, -1, 2}$.\n", - "Output Answer": [ - "${-5, -4, -1, 2, 2, 9, 9}$" - ], - "Output Program": [ - "values = 9, 9, -5, 2, -4, -1, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 0, -9} \\setminus {-3 \\pi, -3, 8, 1, -7, 0, -5}$.\n", - "Output Answer": [ - "${-9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 0, -9,))\nsnd = set((-3*math.pi, -3, 8, 1, -7, 0, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 e, -2, \\frac{13}{\\sqrt{2}}, 9, 2 \\sqrt{2}, 1} \\setminus {1, -6, \\frac{13}{\\sqrt{2}}, -2 e, 9, -\\frac{19}{5}, -\\frac{15}{4}, -2 \\log (2)}$.\n", - "Output Answer": [ - "${-2, 2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, -2, (13/(math.sqrt(2))), 9, 2*math.sqrt(2), 1,))\nsnd = set((1, -6, (13/(math.sqrt(2))), -2*math.e, 9, -(19/5), -(15/4), -2*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{2}, -3 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, -5 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$-\\frac{12 \\sqrt{2}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(2), -3*math.sqrt(2), -(7/(math.sqrt(2))), (13/(math.sqrt(2))), -5*math.sqrt(2), -(1/(math.sqrt(2))), -(5/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -6, -6, 0, -6, -\\frac{2}{\\sqrt{\\pi }}, \\frac{17}{2}, 9, 1, 3, 8, \\sqrt{3}, -5, -e}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, -6, -6, 0, -6, -(2/(math.sqrt(math.pi))), (17/2), 9, 1, 3, 8, math.sqrt(3), -5, -math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -\\frac{27}{\\pi }, -9} \\setminus {-3 e, -\\frac{21}{5}, 11 \\log (2), 2 e, -2, -\\frac{1}{2}, 3 \\sqrt{2}, 5}$.\n", - "Output Answer": [ - "${-9, -\\frac{27}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -(27/math.pi), -9,))\nsnd = set((-3*math.e, -(21/5), 11*math.log(2), 2*math.e, -2, -(1/2), 3*math.sqrt(2), 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-2, 1, 2}$.\n", - "Output Answer": [ - "$\\sqrt[3]{-1} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 1, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, -\\frac{11}{2}, 0, 6 \\sqrt{2}} \\cup {0, 6 \\sqrt{2}, -7, -\\frac{9}{2}}$.\n", - "Output Answer": [ - "${-7, -\\frac{11}{2}, -\\frac{9}{2}, 0, 7, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -(11/2), 0, 6*math.sqrt(2),))\nsnd = set((0, 6*math.sqrt(2), -7, -(9/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.206,0.121,0.041,0.178,0.079,0.057,0.057,0.106\\}$ and $\\{0.062,0.144,0.1,0.143,0.059,0.101,0.232,0.069\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.206, 0.121, 0.041, 0.178, 0.079, 0.057, 0.057, 0.106\ndistribution2 = 0.062, 0.144, 0.1, 0.143, 0.059, 0.101, 0.232, 0.069\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, 9}$.\n", - "Output Answer": [ - "$30$" - ], - "Output Program": [ - "import math\n\nvalues = 100, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8, -7, \\frac{17}{3}, 4, 4 \\sqrt{3}, 0.8, 3, -\\frac{1}{2}, \\frac{32}{5}, \\sqrt{3}} \\cup {-7, 7, -6, 0.8, 1, \\frac{17}{3}, \\frac{3}{2}, \\sqrt{3}, \\frac{32}{5}, 5, -\\frac{21}{4}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-7, -6, -\\frac{21}{4}, -\\frac{1}{2}, 0.8, 1, \\frac{3}{2}, \\sqrt{3}, 3, 4, 5, \\frac{17}{3}, \\frac{32}{5}, 4 \\sqrt{3}, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -7, (17/3), 4, 4*math.sqrt(3), 0.8, 3, -(1/2), (32/5), math.sqrt(3),))\nsnd = set((-7, 7, -6, 0.8, 1, (17/3), (3/2), math.sqrt(3), (32/5), 5, -(21/4), 4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${e, 3, -5, -2, -3 e, 0, -3, -4} \\setminus {3 \\sqrt{5}, \\frac{28}{3}, e, 8}$.\n", - "Output Answer": [ - "${-3 e, -5, -4, -3, -2, 0, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.e, 3, -5, -2, -3*math.e, 0, -3, -4,))\nsnd = set((3*math.sqrt(5), (28/3), math.e, 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{13}{2}, 11, \\frac{11}{2}}$.\n", - "Output Answer": [ - "$\\frac{429}{61}$" - ], - "Output Program": [ - "import statistics\nvalues = (13/2), 11, (11/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, 3 \\sqrt{2}, 5, -\\frac{18}{\\sqrt{5}}} \\setminus {\\frac{13}{\\sqrt{5}}, 3 \\sqrt{5}, -9, -10, 10}$.\n", - "Output Answer": [ - "${-\\frac{18}{\\sqrt{5}}, 1, 3 \\sqrt{2}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 3*math.sqrt(2), 5, -(18/(math.sqrt(5))),))\nsnd = set(((13/(math.sqrt(5))), 3*math.sqrt(5), -9, -10, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 2 \\sqrt{2}, -8.849, \\frac{17}{\\sqrt{3}}, 9, 3, \\frac{1}{\\pi }} \\setminus {-1, \\frac{1}{\\pi }, \\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-8.849, -3, 2 \\sqrt{2}, 3, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 2*math.sqrt(2), -8.849, (17/(math.sqrt(3))), 9, 3, (1/math.pi),))\nsnd = set((-1, (1/math.pi), (17/(math.sqrt(3))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.356,0.113,0.332,0.061,0.029\\}$ and $\\{0.074,0.166,0.046,0.11,0.383\\}$.", - "Output Answer": [ - "$1.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.356, 0.113, 0.332, 0.061, 0.029\ndistribution2 = 0.074, 0.166, 0.046, 0.11, 0.383\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{42}{5}, 0, 5, 6, -\\sqrt{2}, -8, 5 \\sqrt{3}} \\cup {\\sqrt{2}, 0, 5 \\sqrt{3}, 9, 6, -8, -\\frac{12}{5}}$.\n", - "Output Answer": [ - "${-8, -\\frac{12}{5}, -\\sqrt{2}, 0, \\sqrt{2}, 5, 6, \\frac{42}{5}, 5 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set(((42/5), 0, 5, 6, -math.sqrt(2), -8, 5*math.sqrt(3),))\nsnd = set((math.sqrt(2), 0, 5*math.sqrt(3), 9, 6, -8, -(12/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x^2+3.1 x-1.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.3]\n", - "Output Answer": [ - "$110.86$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.3)\nprint(E(4.6*x**2+3.1*x-1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0.49, -10, \\frac{4}{5}, -9, 5 \\sqrt{2}, -8, -\\frac{41}{7}, 0}$.\n", - "Output Answer": [ - "${-10, -9, -8, -\\frac{41}{7}, 0, 0.49, \\frac{4}{5}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0.49, -10, (4/5), -9, 5*math.sqrt(2), -8, -(41/7), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, -10, -6, -6, 9, -\\pi, -1, -9, 5, 0, 1, -2}$.", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -10, -6, -6, 9, -math.pi, -1, -9, 5, 0, 1, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.155,0.047,0.034,0.129,0.067,0.124,0.088,0.071,0.073,0.175\\}$ and $\\{0.048,0.115,0.094,0.063,0.13,0.056,0.1,0.13,0.091,0.009\\}$.", - "Output Answer": [ - "$0.59$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.155, 0.047, 0.034, 0.129, 0.067, 0.124, 0.088, 0.071, 0.073, 0.175\ndistribution2 = 0.048, 0.115, 0.094, 0.063, 0.13, 0.056, 0.1, 0.13, 0.091, 0.009\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{5}{7}, 5 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, -\\frac{49}{5}, -4, \\frac{36}{7}} \\setminus {\\frac{5}{7}, -\\frac{48}{7}, -4, 2}$.\n", - "Output Answer": [ - "${-\\frac{49}{5}, \\frac{36}{7}, 5 \\sqrt{2}, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((5/7), 5*math.sqrt(2), (13/(math.sqrt(2))), -(49/5), -4, (36/7),))\nsnd = set(((5/7), -(48/7), -4, 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.3 x^2+0.2 x-1.9$ where $x \\sim $ \\text{PoissonDistribution}[2.4]\n", - "Output Answer": [ - "$-28.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.4)\nprint(E(-3.3*x**2+0.2*x-1.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.077,0.154,0.096,0.034,0.075,0.229,0.054,0.162,0.085\\}$ and $\\{0.076,0.084,0.016,0.054,0.08,0.193,0.039,0.077,0.121\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.077, 0.154, 0.096, 0.034, 0.075, 0.229, 0.054, 0.162, 0.085\ndistribution2 = 0.076, 0.084, 0.016, 0.054, 0.08, 0.193, 0.039, 0.077, 0.121\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{17}{e}, -\\frac{8}{3}, -5, -\\sqrt{2}, -7, \\frac{13}{\\pi }, 9, -4, \\frac{12}{\\sqrt{5}}, 1, \\frac{23}{4}}$.", - "Output Answer": [ - "$-\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(17/math.e), -(8/3), -5, -math.sqrt(2), -7, (13/math.pi), 9, -4, (12/(math.sqrt(5))), 1, (23/4)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1.923, -3 \\sqrt{5}, -10, -7} \\cup {-3 \\sqrt{5}, 2.635, -3, -10}$.\n", - "Output Answer": [ - "${-10, -7, -3 \\sqrt{5}, -3, -1.923, 2.635}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1.923, -3*math.sqrt(5), -10, -7,))\nsnd = set((-3*math.sqrt(5), 2.635, -3, -10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{2}, -\\frac{19}{2}, -6.5}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -6.5, \\frac{1}{2}}$" - ], - "Output Program": [ - "values = (1/2), -(19/2), -6.5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6, \\frac{38}{7}, -9, -3 \\sqrt{3}} \\setminus {-10, \\frac{24}{7}, -9}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, \\frac{38}{7}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, (38/7), -9, -3*math.sqrt(3),))\nsnd = set((-10, (24/7), -9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 0, 0, 4, 4, 4, 0, -9, 0, 0, -5, 0, 0, 0, 4, -9, 0, 0, -5, 4, 0, -9, 4, -5, 4, -9, -9}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 0, 0, 4, 4, 4, 0, -9, 0, 0, -5, 0, 0, 0, 4, -9, 0, 0, -5, 4, 0, -9, 4, -5, 4, -9, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, -7, -\\frac{9}{\\sqrt{\\pi }}, 13 \\log (2), -3, 1, 9, 7, e, 7, 0, 4}$.", - "Output Answer": [ - "$\\frac{4+e}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, -7, -(9/(math.sqrt(math.pi))), 13*math.log(2), -3, 1, 9, 7, math.e, 7, 0, 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.112,0.087,0.063,0.201,0.206,0.068,0.194\\}$ and $\\{0.028,0.051,0.494,0.121,0.143,0.028,0.067\\}$.", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.112, 0.087, 0.063, 0.201, 0.206, 0.068, 0.194\ndistribution2 = 0.028, 0.051, 0.494, 0.121, 0.143, 0.028, 0.067\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, 8, -5, 0}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{587}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 8, -5, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -4, -4, -1, -9, -1, -8, -1, -4, -1, -9, -8, -8, -1, -8, -8, -1, -4, -4, -4, -4, -1}$.\n", - "Output Answer": [ - "$\\{-4,-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -4, -4, -1, -9, -1, -8, -1, -4, -1, -9, -8, -8, -1, -8, -8, -1, -4, -4, -4, -4, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{2}, -9, 2, 6, -3 \\sqrt{2}, -7, -1, -1}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(2), -9, 2, 6, -3*math.sqrt(2), -7, -1, -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -2, -8, -7, -1, -9, -10}$.\n", - "Output Answer": [ - "$-\\frac{31}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -2, -8, -7, -1, -9, -10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.022,0.193,0.089,0.175,0.107,0.058,0.144,0.03\\}$ and $\\{0.028,0.14,0.244,0.036,0.133,0.065,0.178,0.026\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.022, 0.193, 0.089, 0.175, 0.107, 0.058, 0.144, 0.03\ndistribution2 = 0.028, 0.14, 0.244, 0.036, 0.133, 0.065, 0.178, 0.026\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 4, 0, -2, -9, 0, 4, 4, 4, 0, 0, -1, -1, 4, -1, -2, 4, -1, -2, 4, -10}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 4, 0, -2, -9, 0, 4, 4, 4, 0, 0, -1, -1, 4, -1, -2, 4, -1, -2, 4, -10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{22}{\\pi }, \\frac{18}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }, \\frac{18}{\\pi }, \\frac{31}{\\pi }, -\\frac{20}{\\pi }, \\frac{31}{\\pi }, \\frac{22}{\\pi }, \\frac{31}{\\pi }, -\\frac{20}{\\pi }, -\\frac{20}{\\pi }, -\\frac{20}{\\pi }, -\\frac{20}{\\pi }, -\\frac{9}{\\pi }, \\frac{18}{\\pi }, -\\frac{9}{\\pi }, \\frac{22}{\\pi }, \\frac{18}{\\pi }, -\\frac{9}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{22}{\\pi },-\\frac{20}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (22/math.pi), (18/math.pi), (22/math.pi), (22/math.pi), (18/math.pi), (31/math.pi), -(20/math.pi), (31/math.pi), (22/math.pi), (31/math.pi), -(20/math.pi), -(20/math.pi), -(20/math.pi), -(20/math.pi), -(9/math.pi), (18/math.pi), -(9/math.pi), (22/math.pi), (18/math.pi), -(9/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 1, 10, 18}$.\n", - "Output Answer": [ - "$\\frac{360}{113}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 1, 10, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{\\sqrt{\\pi }}, 7 \\sqrt{2}, \\frac{3}{2}, -1.25, -\\frac{4}{5}, 9, -4} \\setminus {4 \\sqrt{2}, -4, -1.25, \\frac{14}{\\sqrt{\\pi }}, -1, \\frac{3}{2}, 9, -8, 8.091}$.\n", - "Output Answer": [ - "${-\\frac{4}{5}, \\frac{13}{\\sqrt{\\pi }}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/(math.sqrt(math.pi))), 7*math.sqrt(2), (3/2), -1.25, -(4/5), 9, -4,))\nsnd = set((4*math.sqrt(2), -4, -1.25, (14/(math.sqrt(math.pi))), -1, (3/2), 9, -8, 8.091,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x^2-4.6 x+1.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$5.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(2.3*x**2-4.6*x+1.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 1, -7, -8, 8, -4, -2, -10}$.\n", - "Output Answer": [ - "$-\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 1, -7, -8, 8, -4, -2, -10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x^2-1.4 x-2.5$ where $x \\sim $ \\text{PoissonDistribution}[3.3]\n", - "Output Answer": [ - "$21.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.3)\nprint(E(2.*x**2-1.4*x-2.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.192,0.003,0.461,0.186\\}$ and $\\{0.219,0.138,0.25,0.081\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.192, 0.003, 0.461, 0.186\ndistribution2 = 0.219, 0.138, 0.25, 0.081\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, \\frac{11}{2}, \\frac{5}{2}, 6}$.\n", - "Output Answer": [ - "$\\frac{4620}{947}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, (11/2), (5/2), 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{1}{2}, e, -3 e, -9 \\log (2), 3} \\setminus {-3 e, 0, -9 \\log (2), 10, 3 e, -2}$.\n", - "Output Answer": [ - "${-\\frac{1}{2}, e, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(1/2), math.e, -3*math.e, -9*math.log(2), 3,))\nsnd = set((-3*math.e, 0, -9*math.log(2), 10, 3*math.e, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, 2401, 16807, -16807, 1}$.\n", - "Output Answer": [ - "$98 \\sqrt[5]{2} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, 2401, 16807, -16807, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, -6, -512, 1, 8, 49}$.\n", - "Output Answer": [ - "$4 \\sqrt{2} \\sqrt[6]{3} \\sqrt[3]{35}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, -6, -512, 1, 8, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, 4, -10, 9, -7, -2 \\sqrt{5}, 5, \\frac{26}{3}, -\\frac{67}{7}, 5, -6 \\sqrt{2}, 0}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 4, -10, 9, -7, -2*math.sqrt(5), 5, (26/3), -(67/7), 5, -6*math.sqrt(2), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -3, 8, -3, 7, 7, -8, 4, 8, 7, 4, 8, -3, 7, 4, 4, 4, 4, 4, 7, 4, 7, 4, -3, 7, 4, 4, 8, 4, 7}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -3, 8, -3, 7, 7, -8, 4, 8, 7, 4, 8, -3, 7, 4, 4, 4, 4, 4, 7, 4, 7, 4, -3, 7, 4, 4, 8, 4, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{6}{\\sqrt{\\pi }}, 4 \\sqrt{5}, 5 \\sqrt{2}, \\frac{29}{\\pi }, -\\frac{6}{5}}$.\n", - "Output Answer": [ - "$\\frac{29}{\\pi }+\\frac{6}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(6/(math.sqrt(math.pi))), 4*math.sqrt(5), 5*math.sqrt(2), (29/math.pi), -(6/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -8, 7, 9, 8, 3, 6, -5}$.\n", - "Output Answer": [ - "$\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -8, 7, 9, 8, 3, 6, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -9, 6, 9, -9, -5, -9, -5, 6, -9, -5, -9, 5, 6, 6, 6, -9, 6, 5, 5, -5, -9}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -9, 6, 9, -9, -5, -9, -5, 6, -9, -5, -9, 5, 6, 6, 6, -9, 6, 5, 5, -5, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-11 \\log (2), -10 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{21 \\log (2)}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -11*math.log(2), -10*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${8, -8, -\\frac{1}{7}, -\\frac{39}{7}, \\frac{11}{7}, -\\frac{4}{7}, \\frac{13}{7}, \\frac{34}{7}} \\cap {-\\frac{39}{7}, \\frac{34}{7}, \\frac{8}{7}, -\\frac{1}{7}, -\\frac{41}{7}, -4, \\frac{2}{7}, \\frac{43}{7}}$.\n", - "Output Answer": [ - "${-\\frac{39}{7}, -\\frac{1}{7}, \\frac{34}{7}}$" - ], - "Output Program": [ - "fst = set((8, -8, -(1/7), -(39/7), (11/7), -(4/7), (13/7), (34/7),))\nsnd = set((-(39/7), (34/7), (8/7), -(1/7), -(41/7), -4, (2/7), (43/7),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, 5, 9, 0}$.\n", - "Output Answer": [ - "$\\frac{7}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, 5, 9, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -9, 3 e, 7, \\frac{16}{e}} \\setminus {-8, -9, \\frac{16}{e}, 3 e, -5 \\log (2)}$.\n", - "Output Answer": [ - "${-7, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -9, 3*math.e, 7, (16/math.e),))\nsnd = set((-8, -9, (16/math.e), 3*math.e, -5*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4 \\sqrt{5}, -8, 4 \\sqrt{5}, -\\frac{55}{7}, 0, 3, 9, 8} \\cup {4 \\sqrt{5}, 1, \\frac{18}{7}, -8, 8 \\log (2), 7, -5, 8, 9}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -8, -\\frac{55}{7}, -5, 0, 1, \\frac{18}{7}, 3, 8 \\log (2), 7, 8, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), -8, 4*math.sqrt(5), -(55/7), 0, 3, 9, 8,))\nsnd = set((4*math.sqrt(5), 1, (18/7), -8, 8*math.log(2), 7, -5, 8, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-10, \\frac{29}{5}, -6, -11 \\log (2), 4, 1, 6, 10} \\cup {10, -8, 1, -11 \\log (2), -10, -\\frac{17}{2}, 8, -6, \\frac{29}{5}}$.\n", - "Output Answer": [ - "${-10, -\\frac{17}{2}, -8, -11 \\log (2), -6, 1, 4, \\frac{29}{5}, 6, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, (29/5), -6, -11*math.log(2), 4, 1, 6, 10,))\nsnd = set((10, -8, 1, -11*math.log(2), -10, -(17/2), 8, -6, (29/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{3}, -8, -9, 9 \\log (2)}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-8-2 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(3), -8, -9, 9*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.031,0.131,0.215,0.143,0.196,0.107,0.119\\}$ and $\\{0.168,0.062,0.233,0.106,0.081,0.111,0.126\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.031, 0.131, 0.215, 0.143, 0.196, 0.107, 0.119\ndistribution2 = 0.168, 0.062, 0.233, 0.106, 0.081, 0.111, 0.126\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{14}{\\pi }, 3, 0, 3 \\pi, \\frac{20}{\\pi }} \\setminus {\\frac{12}{\\pi }, 0, 3 \\pi, -0.376}$.\n", - "Output Answer": [ - "${3, \\frac{14}{\\pi }, \\frac{20}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((14/math.pi), 3, 0, 3*math.pi, (20/math.pi),))\nsnd = set(((12/math.pi), 0, 3*math.pi, -0.376,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${10, -7, -8, e}$.\n", - "Output Answer": [ - "${-8, -7, e, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -7, -8, math.e\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.032,0.323,0.056,0.192,0.05,0.062,0.048,0.063\\}$ and $\\{0.147,0.09,0.075,0.127,0.153,0.113,0.143,0.061\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.032, 0.323, 0.056, 0.192, 0.05, 0.062, 0.048, 0.063\ndistribution2 = 0.147, 0.09, 0.075, 0.127, 0.153, 0.113, 0.143, 0.061\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{4}{\\pi }, 1, -7, -2 \\sqrt{3}, -1, 0, 8, -2, -6, \\sqrt{3}, -\\frac{31}{5}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (4/math.pi), 1, -7, -2*math.sqrt(3), -1, 0, 8, -2, -6, math.sqrt(3), -(31/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, 3, 9, \\frac{19}{2}, -1}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 3, 9, (19/2), -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9 \\log (2), \\frac{12}{e}, 5, 9, 8, 3 e, -4, -2, 6, -\\frac{24}{e}, 10, -\\frac{55}{7}, -2 e, e, 2 \\pi}$.", - "Output Answer": [ - "$\\frac{12}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9*math.log(2), (12/math.e), 5, 9, 8, 3*math.e, -4, -2, 6, -(24/math.e), 10, -(55/7), -2*math.e, math.e, 2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4 \\log (2), -10, -8, 5.1, -7}$.\n", - "Output Answer": [ - "${-10, -8, -7, -4 \\log (2), 5.1}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.log(2), -10, -8, 5.1, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x+1.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$1.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(4.*x+1.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 11, 17, 9}$.\n", - "Output Answer": [ - "$\\frac{16830}{1939}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 11, 17, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, 8, \\frac{17}{3}, -2, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-2, \\frac{17}{3}, 5 \\sqrt{2}, 8, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 8, (17/3), -2, 5*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1296, 2, 4, 1}$.\n", - "Output Answer": [ - "$6\\ 2^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1296, 2, 4, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, \\frac{10}{\\sqrt{3}}, 9, 2, 10, 1, -6, \\frac{66}{7}, 6 \\sqrt{2}} \\cup {4, 9, 5, \\frac{10}{\\sqrt{3}}, 10, 7, -9}$.\n", - "Output Answer": [ - "${-9, -6, 1, 2, 4, 5, \\frac{10}{\\sqrt{3}}, 7, 6 \\sqrt{2}, 9, \\frac{66}{7}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, (10/(math.sqrt(3))), 9, 2, 10, 1, -6, (66/7), 6*math.sqrt(2),))\nsnd = set((4, 9, 5, (10/(math.sqrt(3))), 10, 7, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{4}, 0} \\setminus {3, -3, 5, \\frac{13}{4}}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "fst = set(((13/4), 0,))\nsnd = set((3, -3, 5, (13/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{6}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{20}{3 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (6/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4 \\sqrt{2}, -\\frac{14}{e}, 3 e, 1, 7.79, -4} \\cup {\\frac{10}{e}, 3 e, -4, 7.79, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{14}{e}, -4, 1, 2 \\sqrt{2}, \\frac{10}{e}, 4 \\sqrt{2}, 7.79, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(2), -(14/math.e), 3*math.e, 1, 7.79, -4,))\nsnd = set(((10/math.e), 3*math.e, -4, 7.79, 2*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{19}{3}, -\\frac{16}{e}, -2, -2 e, -6, \\frac{22}{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{16}{e}-2 e\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(19/3), -(16/math.e), -2, -2*math.e, -6, (22/3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, -13, 10, 1, 14, 4}$.\n", - "Output Answer": [ - "$\\frac{474}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -13, 10, 1, 14, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 81, 16}$.\n", - "Output Answer": [ - "$36$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 81, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, -10, -3.525, -9} \\setminus {\\frac{26}{\\pi }, -3 \\pi, -3.004, 0, -9, 1, \\frac{14}{\\sqrt{3}}, -10}$.\n", - "Output Answer": [ - "${-3.525}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -10, -3.525, -9,))\nsnd = set(((26/math.pi), -3*math.pi, -3.004, 0, -9, 1, (14/(math.sqrt(3))), -10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, -5, -3, -5, -3, -5, 9, 5, 5, -5, -5, -7, -7, -8, -7, 5, -7, -5, 5, -7, -8, 5, -5, -3, -8, 9, -3, 9, -7, -8}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, -5, -3, -5, -3, -5, 9, 5, 5, -5, -5, -7, -7, -8, -7, 5, -7, -5, 5, -7, -8, 5, -5, -3, -8, 9, -3, 9, -7, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -8, -13, 1}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{157}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -8, -13, 1\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -6, 2, -12, 8}$.\n", - "Output Answer": [ - "$\\frac{339}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -6, 2, -12, 8\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, 1, \\frac{4}{\\sqrt{\\pi }}, -6 \\log (2), -1, -\\frac{23}{3}, -5}$.\n", - "Output Answer": [ - "$9+\\frac{4}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 1, (4/(math.sqrt(math.pi))), -6*math.log(2), -1, -(23/3), -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{\\sqrt{2}}, 12 \\log (2), \\frac{3}{\\pi }, -\\frac{2}{\\sqrt{5}}, 5 \\log (2), 5, -8, 6 \\sqrt{2}, -8}$.", - "Output Answer": [ - "$5 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (13/(math.sqrt(2))), 12*math.log(2), (3/math.pi), -(2/(math.sqrt(5))), 5*math.log(2), 5, -8, 6*math.sqrt(2), -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, 4 \\sqrt{5}, 0, -7, 7, -\\frac{19}{5}, -\\frac{18}{e}, -1, 0, 0, -4}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, 4*math.sqrt(5), 0, -7, 7, -(19/5), -(18/math.e), -1, 0, 0, -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.009,0.067,0.062,0.111,0.02,0.294,0.089,0.087\\}$ and $\\{0.092,0.052,0.086,0.189,0.074,0.169,0.154,0.119\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.009, 0.067, 0.062, 0.111, 0.02, 0.294, 0.089, 0.087\ndistribution2 = 0.092, 0.052, 0.086, 0.189, 0.074, 0.169, 0.154, 0.119\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.027,0.142,0.217,0.051,0.168\\}$ and $\\{0.094,0.108,0.201,0.169,0.223\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.027, 0.142, 0.217, 0.051, 0.168\ndistribution2 = 0.094, 0.108, 0.201, 0.169, 0.223\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4 \\sqrt{5}, 2 \\sqrt{3}, 4 \\sqrt{2}, -1, 0, -5 \\sqrt{3}} \\cup {5, -2 \\sqrt{2}, -1, -5 \\sqrt{3}, 0, -4 \\sqrt{5}, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -5 \\sqrt{3}, -2 \\sqrt{2}, -1, 0, 2 \\sqrt{3}, 5, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), 2*math.sqrt(3), 4*math.sqrt(2), -1, 0, -5*math.sqrt(3),))\nsnd = set((5, -2*math.sqrt(2), -1, -5*math.sqrt(3), 0, -4*math.sqrt(5), 2*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, -3 \\sqrt{5}, 4 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, 0, 4 \\sqrt{5}, 4 \\sqrt{5}, 3 \\sqrt{5}, -3 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, 0, 0, \\sqrt{5}, -3 \\sqrt{5}, 0, -3 \\sqrt{5}, 4 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), math.sqrt(5), -3*math.sqrt(5), 4*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), 0, 4*math.sqrt(5), 4*math.sqrt(5), 3*math.sqrt(5), -3*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), 0, 0, math.sqrt(5), -3*math.sqrt(5), 0, -3*math.sqrt(5), 4*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, 7, -1, 8, -7} \\cap {-9, 7, 4, -3, -1}$.\n", - "Output Answer": [ - "${-9, -1, 7}$" - ], - "Output Program": [ - "fst = set((-9, 7, -1, 8, -7,))\nsnd = set((-9, 7, 4, -3, -1,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, -6 \\sqrt{3}, -9 \\log (2), 4, -\\frac{11}{3}, 0, -1, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -3 \\sqrt{5}, -9 \\log (2), -\\frac{11}{3}, -1, 0, 4, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -6*math.sqrt(3), -9*math.log(2), 4, -(11/3), 0, -1, -3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, 0, -3 \\sqrt{5}, 4 \\sqrt{5}, 0, -3 \\sqrt{5}, 4 \\sqrt{5}, 0, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, 0, 0, 4 \\sqrt{5}, 0, 0, -4 \\sqrt{5}, -4 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), 0, -3*math.sqrt(5), 4*math.sqrt(5), 0, -3*math.sqrt(5), 4*math.sqrt(5), 0, -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), 0, 0, 4*math.sqrt(5), 0, 0, -4*math.sqrt(5), -4*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{8}{5}, -1, \\frac{19}{2}, -2 \\pi}$.\n", - "Output Answer": [ - "$\\frac{19}{2}+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -(8/5), -1, (19/2), -2*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 9, -8, -\\frac{53}{7}, -4, \\frac{19}{5}, -10, 4, -6 \\log (2), 0, -\\sqrt{5}, -5, 1, -5, 3}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 9, -8, -(53/7), -4, (19/5), -10, 4, -6*math.log(2), 0, -math.sqrt(5), -5, 1, -5, 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, 3, 10}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 3, 10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.83 < 1.9 x+0. < 3.2$ where $x \\sim $ \\text{ExponentialDistribution}[1.3].", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(P((0.83 < 1.9*x+0.) & (1.9*x+0. < 3.2)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, 6 \\sqrt{3}, 7 \\sqrt{2}}$.", - "Output Answer": [ - "$7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 6*math.sqrt(3), 7*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5 \\sqrt{2}, -7, 1}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5*math.sqrt(2), -7, 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{3}, -\\frac{1}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{1}{5} \\left(-\\frac{26}{\\sqrt{3}}-\\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(3), -(1/(math.sqrt(3))), -(2/(math.sqrt(3))), -(7/(math.sqrt(3))), -(16/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 8, 3, 7}$.\n", - "Output Answer": [ - "$\\frac{13}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 8, 3, 7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, \\frac{16}{\\sqrt{3}}, -\\frac{1}{4}, 2 \\sqrt{5}, 6, 0}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(6+2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, (16/(math.sqrt(3))), -(1/4), 2*math.sqrt(5), 6, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, -3, -2, -5, 13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{406}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -3, -2, -5, 13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, -2, -e}$.\n", - "Output Answer": [ - "${-e, -2, -1}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -2, -math.e\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9 \\log (2), 11 \\log (2)}$.\n", - "Output Answer": [ - "$\\log (2)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -9*math.log(2), 11*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.157,0.092,0.051,0.032,0.233,0.059,0.072,0.092,0.075,0.087\\}$ and $\\{0.088,0.07,0.053,0.114,0.056,0.125,0.234,0.089,0.11,0.032\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.157, 0.092, 0.051, 0.032, 0.233, 0.059, 0.072, 0.092, 0.075, 0.087\ndistribution2 = 0.088, 0.07, 0.053, 0.114, 0.056, 0.125, 0.234, 0.089, 0.11, 0.032\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2-2.3 x-4.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$27.67$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(4.4*x**2-2.3*x-4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{5}, -9, \\frac{12}{\\sqrt{\\pi }}, -2, -9, \\frac{13}{\\sqrt{2}}, -\\frac{22}{3}, -\\pi, -\\frac{26}{e}, -2, 0, 5, 7, -2 e}$.\n", - "Output Answer": [ - "$\\frac{13}{\\sqrt{2}}+\\frac{26}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), -9, (12/(math.sqrt(math.pi))), -2, -9, (13/(math.sqrt(2))), -(22/3), -math.pi, -(26/math.e), -2, 0, 5, 7, -2*math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{17}{e}, 2 \\sqrt{3}, 6, 2, -10, 9, -7, -\\frac{2}{3}} \\setminus {-2, -5, \\frac{3}{2}, 6, -\\frac{2}{3}, -\\frac{17}{e}, 2 \\sqrt{3}, -7}$.\n", - "Output Answer": [ - "${-10, 2, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(17/math.e), 2*math.sqrt(3), 6, 2, -10, 9, -7, -(2/3),))\nsnd = set((-2, -5, (3/2), 6, -(2/3), -(17/math.e), 2*math.sqrt(3), -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 9, -1, 6, -1}$.\n", - "Output Answer": [ - "$\\frac{13}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 9, -1, 6, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 9, 8}$.\n", - "Output Answer": [ - "$\\frac{1080}{103}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 9, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 7, -\\frac{3}{4}, 2, 9, 10, \\frac{19}{4}}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "values = -5, 7, -(3/4), 2, 9, 10, (19/4)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{16}{e}, -\\frac{60}{7}, 0, -5 \\sqrt{2}, \\frac{17}{2}, \\frac{5}{2}, 7} \\setminus {\\frac{5}{2}, -5 \\sqrt{2}, 3, -\\frac{60}{7}, \\frac{17}{2}, 7, \\frac{24}{e}}$.\n", - "Output Answer": [ - "${0, \\frac{16}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((16/math.e), -(60/7), 0, -5*math.sqrt(2), (17/2), (5/2), 7,))\nsnd = set(((5/2), -5*math.sqrt(2), 3, -(60/7), (17/2), 7, (24/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -\\frac{23}{5}, -9, 3, \\frac{19}{7}, -\\sqrt{3}, \\frac{11}{\\sqrt{2}}, -3, -6}$.\n", - "Output Answer": [ - "$9+\\frac{11}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -(23/5), -9, 3, (19/7), -math.sqrt(3), (11/(math.sqrt(2))), -3, -6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -\\sqrt{3}, 9, -8, -4} \\setminus {-6, -3, -\\sqrt{3}, -8, -1}$.\n", - "Output Answer": [ - "${-4, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -math.sqrt(3), 9, -8, -4,))\nsnd = set((-6, -3, -math.sqrt(3), -8, -1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.108,0.074,0.125,0.152,0.046,0.092,0.054,0.077,0.104,0.035\\}$ and $\\{0.039,0.084,0.045,0.019,0.08,0.185,0.055,0.166,0.236,0.005\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.108, 0.074, 0.125, 0.152, 0.046, 0.092, 0.054, 0.077, 0.104, 0.035\ndistribution2 = 0.039, 0.084, 0.045, 0.019, 0.08, 0.185, 0.055, 0.166, 0.236, 0.005\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 2 \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} (2 \\pi -8)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, 5, 0, \\frac{64}{7}, 4, -\\frac{8}{\\sqrt{3}}, -5 \\sqrt{2}} \\setminus {4, \\frac{64}{7}, 8, -\\sqrt{3}, -1, \\frac{9}{\\sqrt{2}}, -\\frac{11}{2}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -\\frac{8}{\\sqrt{3}}, 0, 1, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 5, 0, (64/7), 4, -(8/(math.sqrt(3))), -5*math.sqrt(2),))\nsnd = set((4, (64/7), 8, -math.sqrt(3), -1, (9/(math.sqrt(2))), -(11/2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -3, 6, 1, 8, -3, 8, 8, 8, 8, 7, 7, -3, 1, -3, 8, 8, 8, 7, -3, 8, 6, 7, 6}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -3, 6, 1, 8, -3, 8, 8, 8, 8, 7, 7, -3, 1, -3, 8, 8, 8, 7, -3, 8, 6, 7, 6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 \\sqrt{5}, 9, -3 \\sqrt{3}, -10, -5, \\frac{3}{2}, \\frac{57}{7}, 3, 7, -4, \\frac{1}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(5), 9, -3*math.sqrt(3), -10, -5, (3/2), (57/7), 3, 7, -4, (1/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{7}{\\sqrt{2}}, 0, -\\log (2), 6 \\sqrt{2}, -\\frac{8}{5}, \\pi, e, -\\frac{11}{2}, 1, 7, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/(math.sqrt(2))), 0, -math.log(2), 6*math.sqrt(2), -(8/5), math.pi, math.e, -(11/2), 1, 7, -4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{3}{2}, 4, -3.56, 2, 5.01, 8, 0}$.\n", - "Output Answer": [ - "${-3.56, -\\frac{3}{2}, 0, 2, 4, 5.01, 8}$" - ], - "Output Program": [ - "values = -(3/2), 4, -3.56, 2, 5.01, 8, 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{12}{5}, -\\frac{7}{\\sqrt{2}}, 2, 7, 5 \\sqrt{3}, -8, -3, 9, 8, \\frac{13}{3}, \\frac{25}{\\pi }, 6 \\sqrt{2}, -8, 6}$.", - "Output Answer": [ - "$\\frac{31}{6}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(12/5), -(7/(math.sqrt(2))), 2, 7, 5*math.sqrt(3), -8, -3, 9, 8, (13/3), (25/math.pi), 6*math.sqrt(2), -8, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, -1, -1, 0, -1, 0, -1, 2, 2, -9, -7, 2, -1, 0, -7, 2, -7, -1, 2}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 0, -1, -1, 0, -1, 0, -1, 2, 2, -9, -7, 2, -1, 0, -7, 2, -7, -1, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.2 x^2-5. x-2.1$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$-12.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(-0.2*x**2-5.*x-2.1))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -2 \\sqrt{2}, e, -3, -\\log (2)} \\setminus {7, 2 e, \\frac{43}{7}, -6, 4 \\sqrt{2}, e, -6 \\log (2), -3}$.\n", - "Output Answer": [ - "${-2 \\sqrt{2}, -\\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -2*math.sqrt(2), math.e, -3, -math.log(2),))\nsnd = set((7, 2*math.e, (43/7), -6, 4*math.sqrt(2), math.e, -6*math.log(2), -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\frac{37}{5}, -\\frac{16}{\\sqrt{\\pi }}, -1, e, 9} \\setminus {-5, -1, -3 e, \\frac{37}{5}, 8}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, 0, e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (37/5), -(16/(math.sqrt(math.pi))), -1, math.e, 9,))\nsnd = set((-5, -1, -3*math.e, (37/5), 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4.884, -6, -\\frac{23}{4}, 7, \\frac{16}{\\sqrt{3}}, -\\frac{23}{e}} \\cup {7, -\\frac{10}{e}, -1, 4.884, -\\frac{4}{\\sqrt{3}}, -6}$.\n", - "Output Answer": [ - "${-\\frac{23}{e}, -6, -\\frac{23}{4}, -\\frac{10}{e}, -\\frac{4}{\\sqrt{3}}, -1, 4.884, 7, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4.884, -6, -(23/4), 7, (16/(math.sqrt(3))), -(23/math.e),))\nsnd = set((7, -(10/math.e), -1, 4.884, -(4/(math.sqrt(3))), -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7 \\log (2), 10, -7}$.", - "Output Answer": [ - "$7 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7*math.log(2), 10, -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -5, 3, 0, -7}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -5, 3, 0, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{1}{3}, -\\frac{11}{\\pi }, -10, -\\frac{10}{e}} \\setminus {4, -\\frac{10}{e}, \\frac{13}{3}, -10, -\\frac{20}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\pi }, \\frac{1}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/3), -(11/math.pi), -10, -(10/math.e),))\nsnd = set((4, -(10/math.e), (13/3), -10, -(20/math.pi),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 1, -6, -6, 9, 9, 5, -6, 1, 5, 1, -6, 1, 1, 9, 1, 1, -6, 1, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 1, -6, -6, 9, 9, 5, -6, 1, 5, 1, -6, 1, 1, 9, 1, 1, -6, 1, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4.864, 9, -\\frac{13}{\\sqrt{3}}, -6, -7, \\frac{2}{e}, 3 \\sqrt{5}, -\\frac{9}{e}} \\cup {-\\frac{9}{e}, -\\frac{13}{\\sqrt{3}}, -3 \\sqrt{5}, -7, \\frac{2}{e}, 9}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{3}}, -7, -3 \\sqrt{5}, -6, -\\frac{9}{e}, \\frac{2}{e}, 4.864, 3 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((4.864, 9, -(13/(math.sqrt(3))), -6, -7, (2/math.e), 3*math.sqrt(5), -(9/math.e),))\nsnd = set((-(9/math.e), -(13/(math.sqrt(3))), -3*math.sqrt(5), -7, (2/math.e), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{6}{e}, \\frac{18}{e}, -\\frac{25}{e}, \\frac{18}{e}, -\\frac{25}{e}, -\\frac{3}{e}, -\\frac{25}{e}, \\frac{25}{e}, -\\frac{25}{e}, \\frac{18}{e}, -\\frac{3}{e}, \\frac{25}{e}, \\frac{18}{e}, -\\frac{25}{e}, \\frac{25}{e}, \\frac{25}{e}, -\\frac{3}{e}, \\frac{25}{e}, -\\frac{25}{e}, \\frac{25}{e}, -\\frac{6}{e}, -\\frac{3}{e}, -\\frac{6}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{25}{e},\\frac{25}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(6/math.e), (18/math.e), -(25/math.e), (18/math.e), -(25/math.e), -(3/math.e), -(25/math.e), (25/math.e), -(25/math.e), (18/math.e), -(3/math.e), (25/math.e), (18/math.e), -(25/math.e), (25/math.e), (25/math.e), -(3/math.e), (25/math.e), -(25/math.e), (25/math.e), -(6/math.e), -(3/math.e), -(6/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, 3.4, -3} \\setminus {-3, -6, 1, 5.4, 8}$.\n", - "Output Answer": [ - "${3.4}$" - ], - "Output Program": [ - "fst = set((8, 3.4, -3,))\nsnd = set((-3, -6, 1, 5.4, 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 6, 3, 8, 3, 8, 8, -1, 6, 6, 8, -6, 6, 6, 3, 6, 3, -6, -6, 3, -1, -1, -1, -6}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 6, 3, 8, 3, 8, 8, -1, 6, 6, 8, -6, 6, 6, 3, 6, 3, -6, -6, 3, -1, -1, -1, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.273,0.341,0.204\\}$ and $\\{0.157,0.211,0.424\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.273, 0.341, 0.204\ndistribution2 = 0.157, 0.211, 0.424\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, 7, -\\frac{3}{\\sqrt{\\pi }}, -9}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 7, -(3/(math.sqrt(math.pi))), -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{38}{7}, -2, -7, -\\frac{9}{e}, 4, -5 \\log (2)}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-\\frac{9}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (38/7), -2, -7, -(9/math.e), 4, -5*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{19}{2}, 2, 15, 3}$.\n", - "Output Answer": [ - "$\\frac{760}{191}$" - ], - "Output Program": [ - "import statistics\nvalues = (19/2), 2, 15, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -\\frac{33}{5}, -\\frac{1}{5}, \\frac{9}{5}}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -(33/5), -(1/5), (9/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, 4, 4, -\\frac{33}{5}, 7, 5 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{33}{5}, 5 \\log (2), 4, 4, 6, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 4, 4, -(33/5), 7, 5*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 0.01, -\\sqrt{5}} \\setminus {-5, 3 \\sqrt{3}, 0, 2 \\sqrt{5}, 6}$.\n", - "Output Answer": [ - "${-7, -\\sqrt{5}, 0.01}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 0.01, -math.sqrt(5),))\nsnd = set((-5, 3*math.sqrt(3), 0, 2*math.sqrt(5), 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.407,0.347,0.135\\}$ and $\\{0.323,0.054,0.219\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.407, 0.347, 0.135\ndistribution2 = 0.323, 0.054, 0.219\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 6 \\log (2), 2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 6*math.log(2), 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, \\frac{33}{5}, -\\frac{43}{5}, 8, \\frac{33}{5}, \\frac{33}{5}, \\frac{22}{5}, \\frac{22}{5}, -\\frac{43}{5}, 8, -\\frac{43}{5}, -\\frac{39}{5}, -\\frac{39}{5}, -\\frac{39}{5}, -\\frac{43}{5}, -\\frac{43}{5}, \\frac{22}{5}, -\\frac{39}{5}, -\\frac{39}{5}, -\\frac{39}{5}, -\\frac{43}{5}, -\\frac{39}{5}, -\\frac{43}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{43}{5},-\\frac{39}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, (33/5), -(43/5), 8, (33/5), (33/5), (22/5), (22/5), -(43/5), 8, -(43/5), -(39/5), -(39/5), -(39/5), -(43/5), -(43/5), (22/5), -(39/5), -(39/5), -(39/5), -(43/5), -(39/5), -(43/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{23}{3}, 4, \\frac{3}{\\sqrt{5}}, 0, 2, -\\frac{13}{4}, 3 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -1, \\sqrt{5}, 2, -10}$.\n", - "Output Answer": [ - "$\\frac{53}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = (23/3), 4, (3/(math.sqrt(5))), 0, 2, -(13/4), 3*math.sqrt(2), -(5/(math.sqrt(2))), -1, math.sqrt(5), 2, -10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-5. x^2+4.8 x-1.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$-34.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(-5.*x**2+4.8*x-1.6))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{17}{3}, \\frac{11}{\\pi }, -9, \\frac{43}{5}} \\setminus {-\\frac{8}{\\sqrt{3}}, -\\frac{26}{\\pi }, \\frac{43}{5}}$.\n", - "Output Answer": [ - "${-9, \\frac{11}{\\pi }, \\frac{17}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((17/3), (11/math.pi), -9, (43/5),))\nsnd = set((-(8/(math.sqrt(3))), -(26/math.pi), (43/5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, -8, -\\frac{1}{2}, -7, 2 \\sqrt{3}, \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\pi -\\frac{1}{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -8, -(1/2), -7, 2*math.sqrt(3), math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.264,0.05,0.103,0.094,0.046,0.081,0.022,0.146,0.083,0.022\\}$ and $\\{0.16,0.117,0.15,0.07,0.029,0.101,0.009,0.051,0.114,0.017\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.264, 0.05, 0.103, 0.094, 0.046, 0.081, 0.022, 0.146, 0.083, 0.022\ndistribution2 = 0.16, 0.117, 0.15, 0.07, 0.029, 0.101, 0.009, 0.051, 0.114, 0.017\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, -2 \\pi, 6, 1}$.\n", - "Output Answer": [ - "${-2 \\pi, 1, 6, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -2*math.pi, 6, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{e}, -3 \\sqrt{2}, -\\sqrt{5}, -6, \\frac{5}{\\sqrt{2}}, \\frac{23}{e}, -1, -\\frac{69}{7}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/math.e), -3*math.sqrt(2), -math.sqrt(5), -6, (5/(math.sqrt(2))), (23/math.e), -1, -(69/7)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x-0.5$ where $x \\sim $ \\text{PoissonDistribution}[2.9]\n", - "Output Answer": [ - "$12.84$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.9)\nprint(E(4.6*x-0.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.014,0.114,0.021,0.047,0.202,0.082,0.174,0.126\\}$ and $\\{0.097,0.138,0.126,0.157,0.215,0.021,0.059,0.043\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.014, 0.114, 0.021, 0.047, 0.202, 0.082, 0.174, 0.126\ndistribution2 = 0.097, 0.138, 0.126, 0.157, 0.215, 0.021, 0.059, 0.043\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{18}{\\sqrt{\\pi }}, 3, 4, 2, -4 e, 9, \\frac{26}{5}} \\setminus {7, \\frac{44}{5}, -4 e, -\\frac{18}{\\sqrt{\\pi }}, 4}$.\n", - "Output Answer": [ - "${2, 3, \\frac{26}{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(18/(math.sqrt(math.pi))), 3, 4, 2, -4*math.e, 9, (26/5),))\nsnd = set((7, (44/5), -4*math.e, -(18/(math.sqrt(math.pi))), 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x^2-0.6 x+6.5$ where $x \\sim $ \\text{BetaDistribution}[1.9,1.]\n", - "Output Answer": [ - "$7.32$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 1.)\nprint(E(2.5*x**2-0.6*x+6.5))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\log (2), -3, -\\frac{8}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, 2 e, -2, 4, -\\frac{11}{2}, -8, -6} \\cup {-2, 8, -\\frac{8}{\\sqrt{3}}, -8, -6, -\\frac{1}{4}, 2 e, -3 \\log (2), \\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-8, -6, -\\frac{11}{2}, -\\frac{8}{\\sqrt{3}}, -3, -3 \\log (2), -2, -\\frac{1}{4}, \\frac{4}{\\sqrt{3}}, 4, 2 e, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.log(2), -3, -(8/(math.sqrt(3))), (4/(math.sqrt(3))), 2*math.e, -2, 4, -(11/2), -8, -6,))\nsnd = set((-2, 8, -(8/(math.sqrt(3))), -8, -6, -(1/4), 2*math.e, -3*math.log(2), (4/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 1, 6561, -100000, 243}$.\n", - "Output Answer": [ - "$90 \\sqrt[5]{-1} 3^{3/5} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 1, 6561, -100000, 243\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5.52, 1, -5, -\\sqrt{5}, -3.707, 6, -5 \\sqrt{2}} \\setminus {-\\frac{1}{e}, -3.707, -8, -5 \\sqrt{2}, 5.52, -\\sqrt{5}, 1}$.\n", - "Output Answer": [ - "${-5, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.52, 1, -5, -math.sqrt(5), -3.707, 6, -5*math.sqrt(2),))\nsnd = set((-(1/math.e), -3.707, -8, -5*math.sqrt(2), 5.52, -math.sqrt(5), 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, -1, -512, 49, -8}$.\n", - "Output Answer": [ - "$4 \\sqrt[5]{-1} 2^{4/5} 35^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, -1, -512, 49, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -1.63, -9, -10} \\cup {-10, 5, -1.63}$.\n", - "Output Answer": [ - "${-10, -9, -1.63, 5}$" - ], - "Output Program": [ - "fst = set((5, -1.63, -9, -10,))\nsnd = set((-10, 5, -1.63,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -3, 7, 8, -3, 5, 5, 5, -3, -7, 5, 8, 7, 5, 5, 8, -3, 5, 8, 8, 5, -3, 5, 8, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -3, 7, 8, -3, 5, 5, 5, -3, -7, 5, 8, 7, 5, 5, 8, -3, 5, 8, 8, 5, -3, 5, 8, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7 \\sqrt{2}, 1.8, -4 \\sqrt{5}, -8, 5 \\sqrt{2}} \\setminus {-4 \\sqrt{5}, 10, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-8, 1.8, 5 \\sqrt{2}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7*math.sqrt(2), 1.8, -4*math.sqrt(5), -8, 5*math.sqrt(2),))\nsnd = set((-4*math.sqrt(5), 10, 4*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, -6 \\sqrt{3}, 4, \\frac{9}{5}, -3.62, -6 \\log (2), 5} \\setminus {2 \\sqrt{3}, -3.914, 1, -6 \\log (2)}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -3.62, \\frac{9}{5}, 2, 4, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -6*math.sqrt(3), 4, (9/5), -3.62, -6*math.log(2), 5,))\nsnd = set((2*math.sqrt(3), -3.914, 1, -6*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{8}{7}, 2, 9, \\frac{7}{5}, -6, 5.1} \\cup {-8, -1, \\frac{7}{5}, 5.1, -\\frac{47}{7}, 9}$.\n", - "Output Answer": [ - "${-8, -\\frac{47}{7}, -6, -1, \\frac{8}{7}, \\frac{7}{5}, 2, 5.1, 9}$" - ], - "Output Program": [ - "fst = set(((8/7), 2, 9, (7/5), -6, 5.1,))\nsnd = set((-8, -1, (7/5), 5.1, -(47/7), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 e, -2 e, e, e, e, 3 e, 3 e, e, 2 e, -2 e, 2 e, 0, 3 e, 3 e, e, 3 e, -2 e, 3 e, e, 0, 3 e, 2 e, 3 e, e}$.\n", - "Output Answer": [ - "$\\{3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.e, -2*math.e, math.e, math.e, math.e, 3*math.e, 3*math.e, math.e, 2*math.e, -2*math.e, 2*math.e, 0, 3*math.e, 3*math.e, math.e, 3*math.e, -2*math.e, 3*math.e, math.e, 0, 3*math.e, 2*math.e, 3*math.e, math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.7 x^3-3.2 x^2+4. x+0.8$ where $x \\sim $ \\text{PoissonDistribution}[3.1]\n", - "Output Answer": [ - "$-70.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.1)\nprint(E(-0.7*x**3-3.2*x**2+4.*x+0.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, -59049, 1296, 36, 1, 4}$.\n", - "Output Answer": [ - "$18\\ 2^{5/6} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -59049, 1296, 36, 1, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 11, 9, 5}$.\n", - "Output Answer": [ - "$\\frac{495}{91}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 11, 9, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, -6, 1, -1000}$.\n", - "Output Answer": [ - "$(2+2 i) 5^{3/4} \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -6, 1, -1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.097,0.032,0.317,0.113,0.114\\}$ and $\\{0.247,0.083,0.055,0.511,0.061\\}$.", - "Output Answer": [ - "$0.85$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.097, 0.032, 0.317, 0.113, 0.114\ndistribution2 = 0.247, 0.083, 0.055, 0.511, 0.061\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.255,0.108,0.081,0.187,0.179\\}$ and $\\{0.11,0.057,0.261,0.234,0.263\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.255, 0.108, 0.081, 0.187, 0.179\ndistribution2 = 0.11, 0.057, 0.261, 0.234, 0.263\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{2}, -6 \\sqrt{2}, \\frac{2}{3}, \\frac{12}{\\sqrt{5}}, -8.6, 5, 0, -4}$.\n", - "Output Answer": [ - "${-8.6, -6 \\sqrt{2}, -4, 0, \\frac{1}{2}, \\frac{2}{3}, 5, \\frac{12}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (1/2), -6*math.sqrt(2), (2/3), (12/(math.sqrt(5))), -8.6, 5, 0, -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 9, -\\frac{19}{\\sqrt{5}}, 6 \\log (2), -3, \\frac{16}{5}, -5, 8, -7, -3 \\pi, 1}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 9, -(19/(math.sqrt(5))), 6*math.log(2), -3, (16/5), -5, 8, -7, -3*math.pi, 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3, -3 \\pi, -3, 10, -7, 5, 5.9, -8} \\cup {-3, -7, -8.55, 10 \\log (2), 0, -3 \\pi, 2, -5, -9}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -8.55, -8, -7, -5, -3, 0, 2, 3, 5, 5.9, 10 \\log (2), 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -3*math.pi, -3, 10, -7, 5, 5.9, -8,))\nsnd = set((-3, -7, -8.55, 10*math.log(2), 0, -3*math.pi, 2, -5, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, -\\frac{17}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{5}}, -3}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -(17/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${32, 2401, 1, 36, 1, 1}$.\n", - "Output Answer": [ - "$2 \\sqrt[6]{2} \\sqrt[3]{3} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 32, 2401, 1, 36, 1, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{55}{7}, \\frac{24}{7}, -\\frac{51}{7}, -\\frac{12}{7}, \\frac{45}{7}, -\\frac{23}{7}}$.\n", - "Output Answer": [ - "$\\frac{19}{21}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (55/7), (24/7), -(51/7), -(12/7), (45/7), -(23/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-10, 0, \\frac{68}{7}, -4} \\cup {-10, \\frac{68}{7}, -7, 0}$.\n", - "Output Answer": [ - "${-10, -7, -4, 0, \\frac{68}{7}}$" - ], - "Output Program": [ - "fst = set((-10, 0, (68/7), -4,))\nsnd = set((-10, (68/7), -7, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9, -2.41, 7, -\\frac{7}{\\sqrt{3}}, -1, 3.6, -4} \\setminus {7, 0, -2.41, 9, 3.6, 3}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{3}}, -4, -1}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -2.41, 7, -(7/(math.sqrt(3))), -1, 3.6, -4,))\nsnd = set((7, 0, -2.41, 9, 3.6, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{5}, -2, -4 \\log (2), -3, -\\frac{11}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{11}{\\sqrt{2}}-2$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), -2, -4*math.log(2), -3, -(11/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\pi, 5, -7} \\setminus {2 \\pi, \\pi, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-7, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.pi, 5, -7,))\nsnd = set((2*math.pi, math.pi, 10*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1.82, 4, 5.02, \\frac{28}{5}, \\frac{44}{5}} \\cup {5.02, -\\frac{41}{5}, \\frac{28}{5}, 7.35, \\frac{11}{4}, 9}$.\n", - "Output Answer": [ - "${-\\frac{41}{5}, -1.82, \\frac{11}{4}, 4, 5.02, \\frac{28}{5}, 7.35, \\frac{44}{5}, 9}$" - ], - "Output Program": [ - "fst = set((-1.82, 4, 5.02, (28/5), (44/5),))\nsnd = set((5.02, -(41/5), (28/5), 7.35, (11/4), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.083,0.129,0.13,0.138,0.082,0.085,0.187,0.021\\}$ and $\\{0.088,0.075,0.05,0.137,0.1,0.071,0.139,0.151\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.083, 0.129, 0.13, 0.138, 0.082, 0.085, 0.187, 0.021\ndistribution2 = 0.088, 0.075, 0.05, 0.137, 0.1, 0.071, 0.139, 0.151\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.28 < -2.8 x^2-4.8 x+2.6 < 6.5$ where $x \\sim $ \\text{NormalDistribution}[0.8,2.6].", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.8, 2.6)\nprint(P((-2.28 < -2.8*x**2-4.8*x+2.6) & (-2.8*x**2-4.8*x+2.6 < 6.5)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${8, 2, 11 \\log (2), \\frac{4}{\\sqrt{3}}, -2, 9, -3 \\sqrt{3}, 4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+\\frac{4}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 2, 11*math.log(2), (4/(math.sqrt(3))), -2, 9, -3*math.sqrt(3), 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${12 \\log (2), \\frac{60}{7}, -1, -3, -4, -\\frac{6}{e}, \\frac{24}{e}, -2, -2, 10, -5 \\sqrt{2}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$10+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 12*math.log(2), (60/7), -1, -3, -4, -(6/math.e), (24/math.e), -2, -2, 10, -5*math.sqrt(2), 6*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, 1, \\frac{33}{7}, \\frac{10}{\\sqrt{3}}, \\frac{28}{\\pi }}$.\n", - "Output Answer": [ - "${-8, 1, \\frac{33}{7}, \\frac{10}{\\sqrt{3}}, \\frac{28}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 1, (33/7), (10/(math.sqrt(3))), (28/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, \\frac{22}{\\pi }, -\\frac{8}{e}, 9, \\frac{4}{\\sqrt{\\pi }}, 9 \\log (2), 10}$.\n", - "Output Answer": [ - "${-\\frac{8}{e}, \\frac{4}{\\sqrt{\\pi }}, 9 \\log (2), \\frac{22}{\\pi }, 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, (22/math.pi), -(8/math.e), 9, (4/(math.sqrt(math.pi))), 9*math.log(2), 10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -4, 8, \\frac{7}{4}, -1.8, -\\frac{14}{\\sqrt{3}}, -\\frac{3}{\\sqrt{2}}} \\cup {8.5, 0.4, 5, \\sqrt{3}, \\frac{27}{e}, -8, \\frac{5}{\\sqrt{2}}, 8, \\frac{7}{4}, -2}$.\n", - "Output Answer": [ - "${-\\frac{14}{\\sqrt{3}}, -8, -4, -\\frac{3}{\\sqrt{2}}, -2, -1.8, 0.4, \\sqrt{3}, \\frac{7}{4}, \\frac{5}{\\sqrt{2}}, 5, 8, 8.5, \\frac{27}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -4, 8, (7/4), -1.8, -(14/(math.sqrt(3))), -(3/(math.sqrt(2))),))\nsnd = set((8.5, 0.4, 5, math.sqrt(3), (27/math.e), -8, (5/(math.sqrt(2))), 8, (7/4), -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, -6, -e, \\frac{3}{\\sqrt{\\pi }}, -\\frac{6}{\\sqrt{5}}} \\setminus {-e, \\frac{1}{\\sqrt{\\pi }}, -5, -6}$.\n", - "Output Answer": [ - "${-\\frac{6}{\\sqrt{5}}, \\frac{3}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -6, -math.e, (3/(math.sqrt(math.pi))), -(6/(math.sqrt(5))),))\nsnd = set((-math.e, (1/(math.sqrt(math.pi))), -5, -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{2}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, -\\frac{2}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, \\frac{13}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{13}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{2}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{2}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (2/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), -(2/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), (13/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (13/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(2/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.113,0.213,0.245\\}$ and $\\{0.138,0.437,0.206\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.113, 0.213, 0.245\ndistribution2 = 0.138, 0.437, 0.206\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -6 \\sqrt{3}, \\frac{8}{\\sqrt{\\pi }}, -\\frac{30}{7}, 4, 5, 6, -8}$.\n", - "Output Answer": [ - "$9+6 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -6*math.sqrt(3), (8/(math.sqrt(math.pi))), -(30/7), 4, 5, 6, -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, -\\frac{16}{e}, -6, -\\sqrt{3}}$.\n", - "Output Answer": [ - "${-8, -6, -\\frac{16}{e}, -\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -(16/math.e), -6, -math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -6, 7, 2, -8, -\\pi} \\cup {2, -4, 7, -8, -6, 2 \\pi}$.\n", - "Output Answer": [ - "${-8, -7, -6, -4, -\\pi, 2, 2 \\pi, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -6, 7, 2, -8, -math.pi,))\nsnd = set((2, -4, 7, -8, -6, 2*math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.196,0.106,0.167,0.214,0.205\\}$ and $\\{0.19,0.282,0.1,0.199,0.123\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.196, 0.106, 0.167, 0.214, 0.205\ndistribution2 = 0.19, 0.282, 0.1, 0.199, 0.123\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x^3+1.6 x^2-0.2 x+4.8$ where $x \\sim $ \\text{PoissonDistribution}[1.]\n", - "Output Answer": [ - "$-9.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.)\nprint(E(-3.5*x**3+1.6*x**2-0.2*x+4.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -3, e, 8, -\\frac{53}{7}, -5} \\cup {2, e, -3, 9, 8, -\\frac{11}{7}, -7}$.\n", - "Output Answer": [ - "${-\\frac{53}{7}, -7, -5, -3, -\\frac{11}{7}, 2, e, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -3, math.e, 8, -(53/7), -5,))\nsnd = set((2, math.e, -3, 9, 8, -(11/7), -7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2-3.3 x+2.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$3.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(4.4*x**2-3.3*x+2.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${32, 7776, 25, 36, 6}$.\n", - "Output Answer": [ - "$12\\ 5^{2/5} 6^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 32, 7776, 25, 36, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -8, 9, 2, -9}$.\n", - "Output Answer": [ - "$-\\frac{6}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -8, 9, 2, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.419,0.002,0.469,0.078\\}$ and $\\{0.119,0.156,0.388,0.042\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.419, 0.002, 0.469, 0.078\ndistribution2 = 0.119, 0.156, 0.388, 0.042\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{29}{\\pi }, 4, -1, 2 \\pi, -9, -1, -4, 10}$.\n", - "Output Answer": [ - "$10+\\frac{29}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -(29/math.pi), 4, -1, 2*math.pi, -9, -1, -4, 10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{13}{\\sqrt{\\pi }}, 8 \\log (2), -\\frac{14}{\\sqrt{5}}, \\frac{1}{e}, \\frac{17}{4}, -2 e}$.\n", - "Output Answer": [ - "${-\\frac{14}{\\sqrt{5}}, -2 e, \\frac{1}{e}, \\frac{17}{4}, 8 \\log (2), \\frac{13}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(math.pi))), 8*math.log(2), -(14/(math.sqrt(5))), (1/math.e), (17/4), -2*math.e\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 25, -729, -343}$.\n", - "Output Answer": [ - "$9 \\sqrt{5} 7^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 25, -729, -343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, -3, -9, 3, 0}$.\n", - "Output Answer": [ - "$-\\frac{8}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, -3, -9, 3, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{3}, 4 \\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}, 5 \\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-2 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(3), 4*math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3), 5*math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{6}{5}, \\frac{5}{3}, e, -4 \\sqrt{2}, -\\pi, -3 \\sqrt{3}, -2 \\log (2), -6, 2}$.\n", - "Output Answer": [ - "$6+e$" - ], - "Output Program": [ - "import math\n\nvalues = (6/5), (5/3), math.e, -4*math.sqrt(2), -math.pi, -3*math.sqrt(3), -2*math.log(2), -6, 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -8, 9, -\\frac{8}{\\pi }, -9, 7 \\sqrt{2}} \\setminus {6, -6 \\sqrt{2}, -2, -9}$.\n", - "Output Answer": [ - "${-8, -\\frac{8}{\\pi }, 4, 9, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -8, 9, -(8/math.pi), -9, 7*math.sqrt(2),))\nsnd = set((6, -6*math.sqrt(2), -2, -9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8, -1.906, -2, \\frac{23}{\\pi }, -\\frac{45}{7}, 6} \\cup {6, -1.906, -8, \\frac{23}{\\pi }, -\\frac{40}{7}, -2}$.\n", - "Output Answer": [ - "${-8, -\\frac{45}{7}, -\\frac{40}{7}, -2, -1.906, 6, \\frac{23}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -1.906, -2, (23/math.pi), -(45/7), 6,))\nsnd = set((6, -1.906, -8, (23/math.pi), -(40/7), -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.053,0.066,0.152,0.177,0.035,0.07,0.108,0.209\\}$ and $\\{0.05,0.157,0.281,0.038,0.067,0.053,0.176,0.115\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.053, 0.066, 0.152, 0.177, 0.035, 0.07, 0.108, 0.209\ndistribution2 = 0.05, 0.157, 0.281, 0.038, 0.067, 0.053, 0.176, 0.115\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x+3.2$ where $x \\sim $ \\text{NormalDistribution}[0.1,1.2]\n", - "Output Answer": [ - "$3.33$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.1, 1.2)\nprint(E(1.3*x+3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, \\frac{17}{\\sqrt{3}}, -\\frac{1}{4}}$.\n", - "Output Answer": [ - "${-9, -\\frac{1}{4}, \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, (17/(math.sqrt(3))), -(1/4)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, -\\frac{8}{\\sqrt{5}}, -7}$.", - "Output Answer": [ - "$-\\frac{8}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -(8/(math.sqrt(5))), -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -3, -5, -5, -5, -5, -5, -3, -5, -5, -1, -3, -5, -3, 6, 6, 2, -3, -1, -5, -5, 6, -5, 2}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -3, -5, -5, -5, -5, -5, -3, -5, -5, -1, -3, -5, -3, 6, 6, 2, -3, -1, -5, -5, 6, -5, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{16}{\\sqrt{\\pi }}, -4, 5, -6}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(16/(math.sqrt(math.pi))), -4, 5, -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.9 x-0.8 < -0.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9].", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(P((-2.9*x-0.8 < -0.8)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.8 x^3-3. x^2+2.1 x-0.1$ where $x \\sim $ \\text{PoissonDistribution}[1.1]\n", - "Output Answer": [ - "$-21.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.1)\nprint(E(-2.8*x**3-3.*x**2+2.1*x-0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, 5 \\sqrt{2}, \\frac{16}{e}, -5 \\sqrt{2}, -4, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$10 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 5*math.sqrt(2), (16/math.e), -5*math.sqrt(2), -4, -4*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, 10, 3 \\sqrt{3}, -10, -3, -7 \\sqrt{2}, -1, \\frac{16}{\\pi }, -2 \\sqrt{2}, -\\frac{3}{\\sqrt{\\pi }}, -4}$.", - "Output Answer": [ - "$-\\frac{3}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 10, 3*math.sqrt(3), -10, -3, -7*math.sqrt(2), -1, (16/math.pi), -2*math.sqrt(2), -(3/(math.sqrt(math.pi))), -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 2, 2, 7, 7, -6, 4, -6, 7, 2, -6, 7, 2, 2, 2, 7, 2, -6, -6, -6}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 2, 2, 7, 7, -6, 4, -6, 7, 2, -6, 7, 2, 2, 2, 7, 2, -6, -6, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{29}{\\pi }, -2 \\pi, -7, 6, 4} \\setminus {-\\sqrt{5}, -\\frac{29}{\\pi }, 8, 6, -9, \\frac{30}{\\pi }}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(29/math.pi), -2*math.pi, -7, 6, 4,))\nsnd = set((-math.sqrt(5), -(29/math.pi), 8, 6, -9, (30/math.pi),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 6, 10, 1}$.\n", - "Output Answer": [ - "$\\frac{360}{119}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 6, 10, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{8}{\\sqrt{3}}, 4, \\frac{44}{5}, 0, 4, -\\frac{30}{\\pi }, 8}$.\n", - "Output Answer": [ - "${-\\frac{30}{\\pi }, 0, 4, 4, \\frac{8}{\\sqrt{3}}, 8, \\frac{44}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = (8/(math.sqrt(3))), 4, (44/5), 0, 4, -(30/math.pi), 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\pi, 2 \\pi, -\\pi, -3 \\pi}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.pi, 2*math.pi, -math.pi, -3*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.43,0.218,0.055\\}$ and $\\{0.113,0.253,0.341\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.43, 0.218, 0.055\ndistribution2 = 0.113, 0.253, 0.341\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 18, 5, 15}$.\n", - "Output Answer": [ - "$\\frac{180}{37}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 18, 5, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{59}{3}, \\frac{25}{3}, \\frac{2}{3}, 12}$.\n", - "Output Answer": [ - "$\\frac{70800}{31049}$" - ], - "Output Program": [ - "import statistics\nvalues = (59/3), (25/3), (2/3), 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5 \\sqrt{3}, 9 \\log (2), 4 \\log (2), 8.548, -\\frac{10}{\\pi }, \\frac{21}{e}}$.\n", - "Output Answer": [ - "${-\\frac{10}{\\pi }, 4 \\log (2), 9 \\log (2), \\frac{21}{e}, 8.548, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(3), 9*math.log(2), 4*math.log(2), 8.548, -(10/math.pi), (21/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x^3-4.6 x^2-0.7 x-3.9$ where $x \\sim $ \\text{BetaDistribution}[1.9,1.6]\n", - "Output Answer": [ - "$-5.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 1.6)\nprint(E(2.2*x**3-4.6*x**2-0.7*x-3.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x^3+2.7 x^2-2.4 x+1.$ where $x \\sim $ \\text{NormalDistribution}[-1.2,0.7]\n", - "Output Answer": [ - "$21.31$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.2, 0.7)\nprint(E(-3.5*x**3+2.7*x**2-2.4*x+1.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, 2, -12, -12, -8, 3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{131}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 2, -12, -12, -8, 3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -9, 0, 8, 2, -9, 4, 0, 4, 2, 0, 9, 4, 0, -9, 8, -7, 4, 4, 4, 4}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -9, 0, 8, 2, -9, 4, 0, 4, 2, 0, 9, 4, 0, -9, 8, -7, 4, 4, 4, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-5, 3, 6, 0, -15, -14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2321}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 3, 6, 0, -15, -14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.6 x^2-2.1 x+1.7$ where $x \\sim $ \\text{NormalDistribution}[1.8,2.9]\n", - "Output Answer": [ - "$-9.07$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.8, 2.9)\nprint(E(-0.6*x**2-2.1*x+1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -9, 3, -9, \\frac{7}{\\sqrt{3}}, -\\sqrt{2}, -2 \\sqrt{2}, -10}$.\n", - "Output Answer": [ - "$10+\\frac{7}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -9, 3, -9, (7/(math.sqrt(3))), -math.sqrt(2), -2*math.sqrt(2), -10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, 9, 4, -2, 1}$.\n", - "Output Answer": [ - "${-2, -1, 1, 4, 9}$" - ], - "Output Program": [ - "values = -1, 9, 4, -2, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x^2+4.3 x+4.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$9.81$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(3.4*x**2+4.3*x+4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, 6, 3, -1, -\\frac{7}{5}, -\\frac{19}{5}}$.\n", - "Output Answer": [ - "$-\\frac{11}{30}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, 6, 3, -1, -(7/5), -(19/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 9, 12, 6}$.\n", - "Output Answer": [ - "$\\frac{1008}{127}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 9, 12, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -4, \\frac{26}{\\pi }, -\\frac{6}{5}, -7, \\frac{3}{\\sqrt{\\pi }}, 7 \\log (2), 3 \\sqrt{2}, 7, 0, -8, -7 \\sqrt{2}, -\\frac{11}{\\pi }}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{26}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -4, (26/math.pi), -(6/5), -7, (3/(math.sqrt(math.pi))), 7*math.log(2), 3*math.sqrt(2), 7, 0, -8, -7*math.sqrt(2), -(11/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 10, 13, 3}$.\n", - "Output Answer": [ - "$\\frac{1560}{229}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 10, 13, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-11 \\log (2), -e, 10 \\log (2), -5}$.\n", - "Output Answer": [ - "$21 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -11*math.log(2), -math.e, 10*math.log(2), -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, \\frac{13}{2}, 3 \\sqrt{5}, \\frac{18}{\\pi }, -\\frac{11}{7}, -\\frac{23}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{18}{\\pi }-\\frac{11}{7}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, (13/2), 3*math.sqrt(5), (18/math.pi), -(11/7), -(23/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, -7, -1, 7, 5, 9, 1, -\\frac{29}{4}, -\\frac{2}{\\pi }, -3, 3, -3, 6}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, -7, -1, 7, 5, 9, 1, -(29/4), -(2/math.pi), -3, 3, -3, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, -1, 2, \\frac{24}{\\pi }, -6, \\frac{7}{3}} \\setminus {3, \\frac{7}{3}, \\frac{27}{\\pi }}$.\n", - "Output Answer": [ - "${-6, -1, 2, \\frac{24}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -1, 2, (24/math.pi), -6, (7/3),))\nsnd = set((3, (7/3), (27/math.pi),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.037,0.088,0.038,0.088,0.094,0.086,0.093,0.092,0.199,0.096\\}$ and $\\{0.103,0.059,0.005,0.032,0.018,0.048,0.014,0.262,0.234,0.182\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.037, 0.088, 0.038, 0.088, 0.094, 0.086, 0.093, 0.092, 0.199, 0.096\ndistribution2 = 0.103, 0.059, 0.005, 0.032, 0.018, 0.048, 0.014, 0.262, 0.234, 0.182\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -4, \\frac{23}{\\pi }, 2 \\sqrt{3}, -\\frac{15}{2}, -2.84} \\cup {5, -0.37, 2 \\sqrt{3}, -4, \\frac{5}{\\pi }, 9}$.\n", - "Output Answer": [ - "${-\\frac{15}{2}, -4, -2.84, -0.37, \\frac{5}{\\pi }, 2 \\sqrt{3}, 5, \\frac{23}{\\pi }, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -4, (23/math.pi), 2*math.sqrt(3), -(15/2), -2.84,))\nsnd = set((5, -0.37, 2*math.sqrt(3), -4, (5/math.pi), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.5 x-2.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.3]\n", - "Output Answer": [ - "$-11.13$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.3)\nprint(E(-2.5*x-2.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{16}{\\pi }, -\\frac{20}{\\pi }, \\frac{8}{\\pi }, \\frac{25}{\\pi }, \\frac{23}{\\pi }, \\frac{9}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{29}{6 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(16/math.pi), -(20/math.pi), (8/math.pi), (25/math.pi), (23/math.pi), (9/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${10, -3 \\sqrt{3}, -\\frac{7}{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -\\frac{7}{2}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -3*math.sqrt(3), -(7/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, \\frac{23}{3}, -9.935, 5, 9, \\frac{21}{\\sqrt{5}}, -1} \\setminus {5, 4, \\frac{23}{3}, \\frac{21}{\\sqrt{5}}, 9, -1, -4}$.\n", - "Output Answer": [ - "${-9.935}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, (23/3), -9.935, 5, 9, (21/(math.sqrt(5))), -1,))\nsnd = set((5, 4, (23/3), (21/(math.sqrt(5))), 9, -1, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -3, 3, 5, -9, -7, -8}$.\n", - "Output Answer": [ - "$-\\frac{16}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -3, 3, 5, -9, -7, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{22}{3}, -\\frac{4}{3}, \\frac{29}{3}, 1, -\\frac{4}{3}, -\\frac{22}{3}, -\\frac{22}{3}, -\\frac{23}{3}, -\\frac{4}{3}, 1, \\frac{29}{3}, -\\frac{22}{3}, 1, -\\frac{23}{3}, -\\frac{23}{3}, -5, -\\frac{22}{3}, -\\frac{23}{3}, -5, -\\frac{4}{3}, \\frac{29}{3}, -\\frac{23}{3}, 1, -\\frac{4}{3}, \\frac{29}{3}, -\\frac{22}{3}, -\\frac{22}{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{22}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(22/3), -(4/3), (29/3), 1, -(4/3), -(22/3), -(22/3), -(23/3), -(4/3), 1, (29/3), -(22/3), 1, -(23/3), -(23/3), -5, -(22/3), -(23/3), -5, -(4/3), (29/3), -(23/3), 1, -(4/3), (29/3), -(22/3), -(22/3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, -2, 2, -\\frac{14}{\\sqrt{3}}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -2, 2, -(14/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\pi, 6, -2 \\sqrt{5}, 8.3, 9.315, \\frac{24}{7}, -4, -e, -8, -3.56} \\cup {8.3, -3, 6, 4, -3.56, 9.315, 9, -2 \\sqrt{5}, -3 \\pi, 3 e, \\frac{24}{7}}$.\n", - "Output Answer": [ - "${-3 \\pi, -8, -2 \\sqrt{5}, -4, -3.56, -3, -e, \\frac{24}{7}, 4, 6, 3 e, 8.3, 9, 9.315, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, 6, -2*math.sqrt(5), 8.3, 9.315, (24/7), -4, -math.e, -8, -3.56,))\nsnd = set((8.3, -3, 6, 4, -3.56, 9.315, 9, -2*math.sqrt(5), -3*math.pi, 3*math.e, (24/7),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.048,0.033,0.134,0.128,0.112,0.012,0.159,0.047,0.132,0.16\\}$ and $\\{0.164,0.013,0.03,0.013,0.139,0.161,0.029,0.244,0.021,0.067\\}$.", - "Output Answer": [ - "$0.93$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.048, 0.033, 0.134, 0.128, 0.112, 0.012, 0.159, 0.047, 0.132, 0.16\ndistribution2 = 0.164, 0.013, 0.03, 0.013, 0.139, 0.161, 0.029, 0.244, 0.021, 0.067\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.6 x^2-1.2 x-4.8$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$-10.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(-4.6*x**2-1.2*x-4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{2}, -5, -\\frac{7}{\\sqrt{3}}}$.", - "Output Answer": [ - "$-\\frac{7}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(2), -5, -(7/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4, -7, -6, -9} \\cap {-9, -1, 6, -2}$.\n", - "Output Answer": [ - "${-9}$" - ], - "Output Program": [ - "fst = set((-4, -7, -6, -9,))\nsnd = set((-9, -1, 6, -2,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -14, 8, -7, 8, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{4061}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -14, 8, -7, 8, 14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, \\frac{16}{\\sqrt{\\pi }}, 0, \\sqrt{5}, \\sqrt{5}, \\frac{12}{\\sqrt{\\pi }}, 4 \\sqrt{2}, -\\frac{11}{\\sqrt{\\pi }}, -1, 0, -3 \\pi}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, (16/(math.sqrt(math.pi))), 0, math.sqrt(5), math.sqrt(5), (12/(math.sqrt(math.pi))), 4*math.sqrt(2), -(11/(math.sqrt(math.pi))), -1, 0, -3*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, 8, 8, -2, -4, -2, -2, 8, 8, 8, -4, 8, -2, -2, 8, -2, 8, 8, -4, 8, 8, -2}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, 8, 8, -2, -4, -2, -2, 8, 8, 8, -4, 8, -2, -2, 8, -2, 8, 8, -4, 8, 8, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6 \\log (2), 11 \\log (2), -\\log (2), -\\log (2), 14 \\log (2), -8 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{3 \\log (2)}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -6*math.log(2), 11*math.log(2), -math.log(2), -math.log(2), 14*math.log(2), -8*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\pi, 3, 3 \\sqrt{2}} \\cup {3, 3 \\sqrt{2}, \\pi}$.\n", - "Output Answer": [ - "${3, \\pi, 3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, 3, 3*math.sqrt(2),))\nsnd = set((3, 3*math.sqrt(2), math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.189,0.033,0.306\\}$ and $\\{0.017,0.405,0.052\\}$.", - "Output Answer": [ - "$1.62$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.189, 0.033, 0.306\ndistribution2 = 0.017, 0.405, 0.052\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\sqrt{3}, 2, 7, 3, -4 \\sqrt{2}, -\\frac{29}{4}, 3, 2 \\sqrt{5}, \\frac{21}{e}, 7, \\frac{11}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.sqrt(3), 2, 7, 3, -4*math.sqrt(2), -(29/4), 3, 2*math.sqrt(5), (21/math.e), 7, (11/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, -3, 4, 4, 4, 4, 3, -3, 5, 4, 0, 3, -3, 5, 5, 5, 3, 5, 5, -3, 4, 3, 3, -3, 4}$.\n", - "Output Answer": [ - "$\\{5,4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, -3, 4, 4, 4, 4, 3, -3, 5, 4, 0, 3, -3, 5, 5, 5, 3, 5, 5, -3, 4, 3, 3, -3, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -2 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, 5 \\sqrt{3}, -2 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -2 \\sqrt{3}, 3 \\sqrt{3}, -2 \\sqrt{3}, -5 \\sqrt{3}, -2 \\sqrt{3}, \\sqrt{3}, -2 \\sqrt{3}, 3 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, \\sqrt{3}, -5 \\sqrt{3}, -2 \\sqrt{3}, \\sqrt{3}, 5 \\sqrt{3}, 3 \\sqrt{3}, -2 \\sqrt{3}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-2 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -2*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), 5*math.sqrt(3), -2*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -2*math.sqrt(3), 3*math.sqrt(3), -2*math.sqrt(3), -5*math.sqrt(3), -2*math.sqrt(3), math.sqrt(3), -2*math.sqrt(3), 3*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), math.sqrt(3), -5*math.sqrt(3), -2*math.sqrt(3), math.sqrt(3), 5*math.sqrt(3), 3*math.sqrt(3), -2*math.sqrt(3), 5*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 e, \\frac{17}{\\sqrt{\\pi }}, 8, -\\frac{19}{\\pi }, -\\pi, \\frac{7}{\\sqrt{3}}, -\\frac{11}{2}, -4, -3, 2}$.\n", - "Output Answer": [ - "$\\frac{19}{\\pi }+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.e, (17/(math.sqrt(math.pi))), 8, -(19/math.pi), -math.pi, (7/(math.sqrt(3))), -(11/2), -4, -3, 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x-0.3$ where $x \\sim $ \\text{PoissonDistribution}[3.6]\n", - "Output Answer": [ - "$-12.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.6)\nprint(E(-3.5*x-0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, 9, -\\frac{17}{2}, -1, -\\frac{4}{\\sqrt{5}}, 3, 2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 9, -(17/2), -1, -(4/(math.sqrt(5))), 3, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${11 \\log (2), 3 \\sqrt{2}, 3 \\log (2), -\\frac{20}{7}, -\\pi, 2}$.\n", - "Output Answer": [ - "$\\pi +11 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 11*math.log(2), 3*math.sqrt(2), 3*math.log(2), -(20/7), -math.pi, 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 8, 7, 5}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{19}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 8, 7, 5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^2+4. x+2.2$ where $x \\sim $ \\text{PoissonDistribution}[1.6]\n", - "Output Answer": [ - "$-7.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.6)\nprint(E(-3.9*x**2+4.*x+2.2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6, 1, 5, -2 \\sqrt{3}} \\setminus {-9, 4, -1, 3.17, 5, \\frac{1}{\\sqrt{5}}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{3}, 1, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 1, 5, -2*math.sqrt(3),))\nsnd = set((-9, 4, -1, 3.17, 5, (1/(math.sqrt(5))), 4*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -\\frac{2}{3}, -\\frac{14}{3}, 6}$.\n", - "Output Answer": [ - "$\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -(2/3), -(14/3), 6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, \\frac{15}{2}, 9, 8, -9, \\frac{49}{5}, -3 \\pi, \\sqrt{5}} \\cup {-9, \\sqrt{5}, \\frac{49}{5}, 9, 5, 6, 3, -6, \\pi, -10 \\log (2)}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -10 \\log (2), -6, \\sqrt{5}, 3, \\pi, 5, 6, \\frac{15}{2}, 8, 9, \\frac{49}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, (15/2), 9, 8, -9, (49/5), -3*math.pi, math.sqrt(5),))\nsnd = set((-9, math.sqrt(5), (49/5), 9, 5, 6, 3, -6, math.pi, -10*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -\\frac{5}{\\sqrt{3}}, 7, 0, -5, -\\pi, -4, -6, 9, -3 \\sqrt{2}, 0, -\\frac{13}{\\sqrt{2}}, 6, -6, -\\frac{3}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$9+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -(5/(math.sqrt(3))), 7, 0, -5, -math.pi, -4, -6, 9, -3*math.sqrt(2), 0, -(13/(math.sqrt(2))), 6, -6, -(3/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{9}{\\pi }, -8, -6, \\log (2), -5 \\sqrt{2}, -\\frac{12}{\\pi }, \\frac{6}{\\sqrt{5}}, -5, -\\frac{11}{e}}$.\n", - "Output Answer": [ - "$8+\\frac{6}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(9/math.pi), -8, -6, math.log(2), -5*math.sqrt(2), -(12/math.pi), (6/(math.sqrt(5))), -5, -(11/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{20}{3}, -\\frac{14}{\\sqrt{3}}, \\frac{19}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-\\frac{14}{\\sqrt{3}}, \\frac{20}{3}, \\frac{19}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (20/3), -(14/(math.sqrt(3))), (19/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 5, 5, 6, -7, -1, 6}$.\n", - "Output Answer": [ - "$\\frac{22}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 5, 5, 6, -7, -1, 6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, 0, 2, \\frac{13}{2}, -\\frac{25}{4}, -8, -\\frac{21}{\\pi }, -2, -2 \\pi, -\\frac{18}{e}, \\frac{3}{5}, e, \\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{29}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 0, 2, (13/2), -(25/4), -8, -(21/math.pi), -2, -2*math.pi, -(18/math.e), (3/5), math.e, (3/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -1, 1, 9, -6, -\\frac{7}{2}, -3 \\log (2), 4} \\cup {4, -\\sqrt{5}, 9, -4, 7, -\\frac{15}{4}, 2}$.\n", - "Output Answer": [ - "${-6, -4, -\\frac{15}{4}, -\\frac{7}{2}, -\\sqrt{5}, -3 \\log (2), -1, 1, 2, 4, 5, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -1, 1, 9, -6, -(7/2), -3*math.log(2), 4,))\nsnd = set((4, -math.sqrt(5), 9, -4, 7, -(15/4), 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{5}{\\sqrt{\\pi }}, 2, 1, 4 \\sqrt{2}} \\setminus {\\frac{14}{\\sqrt{\\pi }}, -3, \\frac{9}{\\sqrt{\\pi }}, 2, 1}$.\n", - "Output Answer": [ - "${-\\frac{5}{\\sqrt{\\pi }}, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(5/(math.sqrt(math.pi))), 2, 1, 4*math.sqrt(2),))\nsnd = set(((14/(math.sqrt(math.pi))), -3, (9/(math.sqrt(math.pi))), 2, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, -6, -1, -10}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{1099}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -6, -1, -10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, 0, \\frac{13}{\\sqrt{5}}} \\setminus {-2 \\pi, 5, 8, -9, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${0, \\frac{13}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 0, (13/(math.sqrt(5))),))\nsnd = set((-2*math.pi, 5, 8, -9, -3*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1. x^2+0.7 x+1.9$ where $x \\sim $ \\text{PoissonDistribution}[3.5]\n", - "Output Answer": [ - "$-11.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(E(-1.*x**2+0.7*x+1.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{27}{\\pi }, -\\frac{8}{\\pi }, -\\frac{17}{\\pi }, -\\frac{8}{\\pi }, -\\frac{8}{\\pi }, -\\frac{17}{\\pi }, -\\frac{8}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{27}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{27}{\\pi }, -\\frac{27}{\\pi }, -\\frac{27}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{8}{\\pi }, -\\frac{27}{\\pi }, -\\frac{17}{\\pi }, -\\frac{27}{\\pi }, -\\frac{17}{\\pi }, -\\frac{27}{\\pi }, -\\frac{17}{\\pi }, -\\frac{27}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{17}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(27/math.pi), -(8/math.pi), -(17/math.pi), -(8/math.pi), -(8/math.pi), -(17/math.pi), -(8/math.pi), -(17/math.pi), -(17/math.pi), -(17/math.pi), -(27/math.pi), -(17/math.pi), -(17/math.pi), -(17/math.pi), -(27/math.pi), -(27/math.pi), -(27/math.pi), -(17/math.pi), -(17/math.pi), -(17/math.pi), -(8/math.pi), -(27/math.pi), -(17/math.pi), -(27/math.pi), -(17/math.pi), -(27/math.pi), -(17/math.pi), -(27/math.pi), -(17/math.pi), -(17/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $3.88 < 3. x-3.5 < 15.1$ where $x \\sim $ \\text{ExponentialDistribution}[0.3].", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.3)\nprint(P((3.88 < 3.*x-3.5) & (3.*x-3.5 < 15.1)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, 6.4, 5 \\sqrt{2}, -\\frac{17}{3}, \\frac{15}{2}, -2, -8, 5}$.\n", - "Output Answer": [ - "${-8, -8, -\\frac{17}{3}, -2, 5, 6.4, 5 \\sqrt{2}, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 6.4, 5*math.sqrt(2), -(17/3), (15/2), -2, -8, 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{52}{3}, 11}$.\n", - "Output Answer": [ - "$\\frac{1144}{85}$" - ], - "Output Program": [ - "import statistics\nvalues = (52/3), 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 0, \\frac{8}{7}} \\setminus {\\frac{1}{7}, -5.1, 9, \\frac{18}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-7, 0, \\frac{8}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 0, (8/7),))\nsnd = set(((1/7), -5.1, 9, (18/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3, -4, -10, -5, -9, \\pi, -6} \\cup {-4, 3, -6, 8, -10, \\pi}$.\n", - "Output Answer": [ - "${-10, -9, -6, -5, -4, 3, \\pi, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -4, -10, -5, -9, math.pi, -6,))\nsnd = set((-4, 3, -6, 8, -10, math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 4, -\\frac{1}{2}, 2 \\sqrt{2}, 2, -8, 10, -7} \\cup {-8, 5 \\sqrt{2}, 2, -\\frac{1}{2}, -7, -5}$.\n", - "Output Answer": [ - "${-8, -7, -5, -\\frac{1}{2}, 0, 2, 2 \\sqrt{2}, 4, 5 \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 4, -(1/2), 2*math.sqrt(2), 2, -8, 10, -7,))\nsnd = set((-8, 5*math.sqrt(2), 2, -(1/2), -7, -5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2-3.6 x-2.2$ where $x \\sim $ \\text{NormalDistribution}[0.2,1.3]\n", - "Output Answer": [ - "$4.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.2, 1.3)\nprint(E(4.4*x**2-3.6*x-2.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${256, 1, -216, -5}$.\n", - "Output Answer": [ - "$4 \\sqrt[4]{5} 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 256, 1, -216, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -7, -8, 3, -7}$.\n", - "Output Answer": [ - "$\\frac{527}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -7, -8, 3, -7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, 100, -6, -8, 1, 8}$.\n", - "Output Answer": [ - "$2 \\sqrt{2} \\sqrt[6]{3} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, 100, -6, -8, 1, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, -9, \\frac{8}{\\sqrt{\\pi }}, -5, \\frac{1}{3}, -\\frac{32}{5}, -6, -8}$.\n", - "Output Answer": [ - "${-9, -8, -\\frac{32}{5}, -6, -5, \\frac{1}{3}, \\frac{8}{\\sqrt{\\pi }}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -9, (8/(math.sqrt(math.pi))), -5, (1/3), -(32/5), -6, -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 1296, -343, -32, 10000}$.\n", - "Output Answer": [ - "$36\\ 3^{2/5} 5^{4/5} 14^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 1296, -343, -32, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 64, 1296, 9}$.\n", - "Output Answer": [ - "$36 \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 64, 1296, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-5.57 < -0.9 x^2+4.7 x-2.5 < -2.35$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9].", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(P((-5.57 < -0.9*x**2+4.7*x-2.5) & (-0.9*x**2+4.7*x-2.5 < -2.35)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.153,0.044,0.022,0.154,0.057,0.106,0.14,0.041,0.049,0.041\\}$ and $\\{0.126,0.033,0.08,0.077,0.168,0.079,0.062,0.115,0.023,0.171\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.153, 0.044, 0.022, 0.154, 0.057, 0.106, 0.14, 0.041, 0.049, 0.041\ndistribution2 = 0.126, 0.033, 0.08, 0.077, 0.168, 0.079, 0.062, 0.115, 0.023, 0.171\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{14}{\\sqrt{\\pi }}, -2 \\sqrt{2}, -4, -7, -4, -12 \\log (2), -4, -\\frac{27}{\\pi }, -7, 5 \\sqrt{2}, 9, 4, -\\frac{9}{\\sqrt{2}}, 3, \\frac{12}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (14/(math.sqrt(math.pi))), -2*math.sqrt(2), -4, -7, -4, -12*math.log(2), -4, -(27/math.pi), -7, 5*math.sqrt(2), 9, 4, -(9/(math.sqrt(2))), 3, (12/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{7}{e}, \\frac{19}{e}, \\frac{12}{e}, \\frac{20}{e}, \\frac{4}{e}, -\\frac{17}{e}, -\\frac{17}{e}, 0}$.\n", - "Output Answer": [ - "$\\frac{7}{4 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(7/math.e), (19/math.e), (12/math.e), (20/math.e), (4/math.e), -(17/math.e), -(17/math.e), 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -2 e, -4 \\sqrt{5}, -\\frac{17}{\\sqrt{5}}, -4.55, -7} \\setminus {-4 \\sqrt{5}, -\\frac{19}{\\sqrt{5}}, -1, 5, \\frac{1}{\\sqrt{5}}, -4, -\\frac{17}{\\sqrt{5}}, 10, e}$.\n", - "Output Answer": [ - "${-7, -2 e, -4.55}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -2*math.e, -4*math.sqrt(5), -(17/(math.sqrt(5))), -4.55, -7,))\nsnd = set((-4*math.sqrt(5), -(19/(math.sqrt(5))), -1, 5, (1/(math.sqrt(5))), -4, -(17/(math.sqrt(5))), 10, math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 17, 3}$.\n", - "Output Answer": [ - "$\\frac{1071}{191}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 17, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, 7, \\frac{5}{e}, 9, -4, -\\frac{12}{\\pi }, -5, -8, -9, -7, 5, -\\frac{22}{3}, -3 \\sqrt{5}, -9}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 7, (5/math.e), 9, -4, -(12/math.pi), -5, -8, -9, -7, 5, -(22/3), -3*math.sqrt(5), -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{17}{e}, -\\frac{4}{e}, -\\frac{13}{e}, -\\frac{4}{e}, \\frac{17}{e}, -\\frac{4}{e}, -\\frac{24}{e}, -\\frac{4}{e}, -\\frac{4}{e}, \\frac{17}{e}, -\\frac{4}{e}, -\\frac{10}{e}, -\\frac{4}{e}, -\\frac{22}{e}, -\\frac{4}{e}, -\\frac{13}{e}, \\frac{17}{e}, -\\frac{10}{e}, -\\frac{13}{e}, -\\frac{10}{e}, -\\frac{22}{e}, -\\frac{24}{e}, \\frac{17}{e}, -\\frac{24}{e}, -\\frac{22}{e}, -\\frac{10}{e}, -\\frac{13}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{4}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (17/math.e), -(4/math.e), -(13/math.e), -(4/math.e), (17/math.e), -(4/math.e), -(24/math.e), -(4/math.e), -(4/math.e), (17/math.e), -(4/math.e), -(10/math.e), -(4/math.e), -(22/math.e), -(4/math.e), -(13/math.e), (17/math.e), -(10/math.e), -(13/math.e), -(10/math.e), -(22/math.e), -(24/math.e), (17/math.e), -(24/math.e), -(22/math.e), -(10/math.e), -(13/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.113,0.159,0.056,0.264,0.113,0.166\\}$ and $\\{0.078,0.107,0.205,0.135,0.201,0.145\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.113, 0.159, 0.056, 0.264, 0.113, 0.166\ndistribution2 = 0.078, 0.107, 0.205, 0.135, 0.201, 0.145\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -4, 9, 1, -1}$.\n", - "Output Answer": [ - "$-\\frac{2}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -4, 9, 1, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{17}{\\sqrt{3}}, -\\frac{15}{\\sqrt{\\pi }}, 5, -9, \\frac{8}{\\sqrt{5}}, \\frac{23}{e}, -\\frac{16}{\\sqrt{5}}, -3, \\frac{28}{3}, 0, 2}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(17/(math.sqrt(3))), -(15/(math.sqrt(math.pi))), 5, -9, (8/(math.sqrt(5))), (23/math.e), -(16/(math.sqrt(5))), -3, (28/3), 0, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, 11, 7, 3, 12, 6}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{763}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 11, 7, 3, 12, 6\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -\\frac{28}{5}, -6, -1}$.", - "Output Answer": [ - "$-\\frac{53}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -(28/5), -6, -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -10, -8, -1} \\setminus {-8, \\frac{3}{4}, -2, 7, -4}$.\n", - "Output Answer": [ - "${-10, -1}$" - ], - "Output Program": [ - "fst = set((-4, -10, -8, -1,))\nsnd = set((-8, (3/4), -2, 7, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.147,0.089,0.079,0.156,0.022,0.223,0.057,0.107,0.043\\}$ and $\\{0.062,0.094,0.057,0.102,0.07,0.183,0.078,0.189,0.074\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.147, 0.089, 0.079, 0.156, 0.022, 0.223, 0.057, 0.107, 0.043\ndistribution2 = 0.062, 0.094, 0.057, 0.102, 0.07, 0.183, 0.078, 0.189, 0.074\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.216,0.289,0.151,0.056,0.176,0.069\\}$ and $\\{0.135,0.155,0.052,0.106,0.236,0.123\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.216, 0.289, 0.151, 0.056, 0.176, 0.069\ndistribution2 = 0.135, 0.155, 0.052, 0.106, 0.236, 0.123\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-11 \\log (2), -5, -4, \\frac{37}{4}, \\frac{4}{e}, -\\frac{20}{e}, 0, -5, -10}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -11*math.log(2), -5, -4, (37/4), (4/math.e), -(20/math.e), 0, -5, -10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, -\\pi, \\frac{1}{2}}$.\n", - "Output Answer": [ - "${-7, -\\pi, \\frac{1}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -math.pi, (1/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 4, \\frac{64}{7}, -6, 2 \\pi, 8, -9, 5, 0}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 4, (64/7), -6, 2*math.pi, 8, -9, 5, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, 0, -\\frac{5}{\\pi }, \\frac{17}{2}, -10, -8, \\pi, 0, \\frac{31}{5}, -9, 8, 0, -3}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 0, -(5/math.pi), (17/2), -10, -8, math.pi, 0, (31/5), -9, 8, 0, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x^2-1.2 x-4.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$21.39$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(3.6*x**2-1.2*x-4.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x+10.6$ where $x \\sim $ \\text{BetaDistribution}[1.8,0.7]\n", - "Output Answer": [ - "$12.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.8, 0.7)\nprint(E(2.1*x+10.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.2,0.202,0.059,0.151,0.219\\}$ and $\\{0.172,0.154,0.315,0.073,0.265\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.2, 0.202, 0.059, 0.151, 0.219\ndistribution2 = 0.172, 0.154, 0.315, 0.073, 0.265\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.35,0.224,0.222\\}$ and $\\{0.224,0.121,0.219\\}$.", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.35, 0.224, 0.222\ndistribution2 = 0.224, 0.121, 0.219\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 9, 9.14, -\\frac{1}{3}, 4 \\sqrt{2}, \\frac{6}{\\pi }, 10, -\\frac{7}{2}, -\\frac{28}{\\pi }} \\cup {0, -\\frac{28}{\\pi }, 9.14, -4, \\frac{13}{2}, 9, 10, -\\frac{1}{3}}$.\n", - "Output Answer": [ - "${-\\frac{28}{\\pi }, -4, -\\frac{7}{2}, -\\frac{1}{3}, 0, \\frac{6}{\\pi }, 4 \\sqrt{2}, \\frac{13}{2}, 9, 9.14, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 9, 9.14, -(1/3), 4*math.sqrt(2), (6/math.pi), 10, -(7/2), -(28/math.pi),))\nsnd = set((0, -(28/math.pi), 9.14, -4, (13/2), 9, 10, -(1/3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, 2 e, 2, \\frac{23}{e}, \\frac{3}{\\sqrt{2}}, -3, -\\frac{13}{2}, -6, 4, 2}$.\n", - "Output Answer": [ - "$\\frac{13}{2}+\\frac{23}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 2*math.e, 2, (23/math.e), (3/(math.sqrt(2))), -3, -(13/2), -6, 4, 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 e, 2 \\sqrt{5}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}-2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, 2*math.sqrt(5), 4*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{\\pi }, -\\frac{16}{\\pi }, \\frac{16}{\\pi }, \\frac{4}{\\pi }, \\frac{16}{\\pi }, \\frac{20}{\\pi }, -\\frac{16}{\\pi }, \\frac{3}{\\pi }, \\frac{16}{\\pi }, -\\frac{16}{\\pi }, \\frac{20}{\\pi }, \\frac{3}{\\pi }, \\frac{16}{\\pi }, -\\frac{16}{\\pi }, \\frac{3}{\\pi }, \\frac{16}{\\pi }, \\frac{16}{\\pi }, -\\frac{16}{\\pi }, \\frac{4}{\\pi }, \\frac{20}{\\pi }, \\frac{3}{\\pi }, \\frac{20}{\\pi }, \\frac{4}{\\pi }, \\frac{16}{\\pi }, -\\frac{16}{\\pi }, \\frac{16}{\\pi }, -\\frac{16}{\\pi }, \\frac{4}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{\\pi },\\frac{16}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(16/math.pi), -(16/math.pi), (16/math.pi), (4/math.pi), (16/math.pi), (20/math.pi), -(16/math.pi), (3/math.pi), (16/math.pi), -(16/math.pi), (20/math.pi), (3/math.pi), (16/math.pi), -(16/math.pi), (3/math.pi), (16/math.pi), (16/math.pi), -(16/math.pi), (4/math.pi), (20/math.pi), (3/math.pi), (20/math.pi), (4/math.pi), (16/math.pi), -(16/math.pi), (16/math.pi), -(16/math.pi), (4/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2 \\sqrt{2}, 7 \\sqrt{2}, -4 \\sqrt{2}, 3 \\sqrt{2}, 0, -6 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}} \\cap {-5 \\sqrt{2}, -6 \\sqrt{2}, 6 \\sqrt{2}, 0, -4 \\sqrt{2}, 7 \\sqrt{2}, 3 \\sqrt{2}, 4 \\sqrt{2}, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -4 \\sqrt{2}, 0, 3 \\sqrt{2}, 4 \\sqrt{2}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(2), 7*math.sqrt(2), -4*math.sqrt(2), 3*math.sqrt(2), 0, -6*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2),))\nsnd = set((-5*math.sqrt(2), -6*math.sqrt(2), 6*math.sqrt(2), 0, -4*math.sqrt(2), 7*math.sqrt(2), 3*math.sqrt(2), 4*math.sqrt(2), 2*math.sqrt(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 4, 125}$.\n", - "Output Answer": [ - "$5\\ 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 4, 125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 256, -216, 9, 64, 4096}$.\n", - "Output Answer": [ - "$32 \\sqrt[6]{-1} 6^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 256, -216, 9, 64, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 1, 14, 12}$.\n", - "Output Answer": [ - "$\\frac{6384}{1927}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 1, 14, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.128,0.108,0.039,0.271,0.198,0.074,0.024,0.113\\}$ and $\\{0.096,0.08,0.083,0.159,0.027,0.09,0.133,0.105\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.128, 0.108, 0.039, 0.271, 0.198, 0.074, 0.024, 0.113\ndistribution2 = 0.096, 0.08, 0.083, 0.159, 0.027, 0.09, 0.133, 0.105\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 9, 0, 0}$.\n", - "Output Answer": [ - "$\\frac{73}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 9, 0, 0\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, \\frac{5}{2}, -7}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "values = 6, (5/2), -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, 15, -2, 10, -3}$.\n", - "Output Answer": [ - "$\\frac{627}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 15, -2, 10, -3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 5, 9}$.\n", - "Output Answer": [ - "$\\frac{20}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 5, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\sqrt{5}, 2 \\sqrt{5}, 0, -\\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 0, 2 \\sqrt{5}, 2 \\sqrt{5}, 0, -4 \\sqrt{5}, -4 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.sqrt(5), 2*math.sqrt(5), 0, -math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 0, 2*math.sqrt(5), 2*math.sqrt(5), 0, -4*math.sqrt(5), -4*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{20}{\\pi }, 1, 4, -\\frac{12}{\\pi }, 6, 8, 0, \\frac{12}{\\pi }, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\frac{31}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(20/math.pi), 1, 4, -(12/math.pi), 6, 8, 0, (12/math.pi), -(15/2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{11}{2}, -2 \\pi, -2 \\pi, 5, 3, -4 \\log (2), -4, 6, -\\frac{13}{\\sqrt{\\pi }}, 5, -4, 4 \\sqrt{2}, -\\sqrt{2}, \\frac{11}{\\sqrt{2}}, -3}$.\n", - "Output Answer": [ - "$\\frac{11}{\\sqrt{2}}+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/2), -2*math.pi, -2*math.pi, 5, 3, -4*math.log(2), -4, 6, -(13/(math.sqrt(math.pi))), 5, -4, 4*math.sqrt(2), -math.sqrt(2), (11/(math.sqrt(2))), -3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -729, -8, 7, -7}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-3} 14^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -729, -8, 7, -7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 3, \\frac{22}{\\pi }, 4, 8, 1, 6, -2, -9, 10, -\\frac{30}{\\pi }, \\frac{10}{e}, 7, -9}$.\n", - "Output Answer": [ - "$10+\\frac{30}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 3, (22/math.pi), 4, 8, 1, 6, -2, -9, 10, -(30/math.pi), (10/math.e), 7, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, -1, 8, 10, 14, 12}$.\n", - "Output Answer": [ - "$\\frac{2189}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -1, 8, 10, 14, 12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, 5 \\sqrt{3}, -5 \\sqrt{3}, 2 \\sqrt{3}, -\\sqrt{3}, 5 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, 5 \\sqrt{3}, -5 \\sqrt{3}, 2 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, 6 \\sqrt{3}, 6 \\sqrt{3}, -5 \\sqrt{3}, 5 \\sqrt{3}, -\\sqrt{3}, 6 \\sqrt{3}, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-5 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), 5*math.sqrt(3), -5*math.sqrt(3), 2*math.sqrt(3), -math.sqrt(3), 5*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), 5*math.sqrt(3), -5*math.sqrt(3), 2*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), 6*math.sqrt(3), 6*math.sqrt(3), -5*math.sqrt(3), 5*math.sqrt(3), -math.sqrt(3), 6*math.sqrt(3), 2*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, -2}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2.536, \\frac{14}{5}, -7., -2, \\frac{22}{e}, 2 \\sqrt{3}, 0.786} \\cup {-\\frac{7}{\\sqrt{2}}, 9.389, 2 \\sqrt{3}, -0.425, 9, \\frac{14}{5}, 6.2, -2, \\frac{22}{e}}$.\n", - "Output Answer": [ - "${-7., -\\frac{7}{\\sqrt{2}}, -2, -0.425, 0.786, 2.536, \\frac{14}{5}, 2 \\sqrt{3}, 6.2, \\frac{22}{e}, 9, 9.389}$" - ], - "Output Program": [ - "import math\n\nfst = set((2.536, (14/5), -7., -2, (22/math.e), 2*math.sqrt(3), 0.786,))\nsnd = set((-(7/(math.sqrt(2))), 9.389, 2*math.sqrt(3), -0.425, 9, (14/5), 6.2, -2, (22/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, -2, -\\frac{10}{7}, 3, 6, -8, -0.539, -\\frac{5}{\\pi }, \\frac{17}{3}, 3 \\pi, \\frac{4}{3}} \\cup {9, 3, -\\frac{5}{\\pi }, \\frac{22}{3}, \\frac{19}{3}, -\\frac{10}{7}, -8, -10, 6}$.\n", - "Output Answer": [ - "${-10, -8, -4, -2, -\\frac{5}{\\pi }, -\\frac{10}{7}, -0.539, \\frac{4}{3}, 3, \\frac{17}{3}, 6, \\frac{19}{3}, \\frac{22}{3}, 9, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -2, -(10/7), 3, 6, -8, -0.539, -(5/math.pi), (17/3), 3*math.pi, (4/3),))\nsnd = set((9, 3, -(5/math.pi), (22/3), (19/3), -(10/7), -8, -10, 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.04,0.13,0.039,0.045,0.021,0.218,0.189,0.167\\}$ and $\\{0.103,0.042,0.331,0.073,0.002,0.005,0.072,0.01\\}$.", - "Output Answer": [ - "$1.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.04, 0.13, 0.039, 0.045, 0.021, 0.218, 0.189, 0.167\ndistribution2 = 0.103, 0.042, 0.331, 0.073, 0.002, 0.005, 0.072, 0.01\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${6, -2, -4, 9, -5, 4, 10, 0, -8, 5, 3} \\cap {-4, 2, 10, 0, 9, -6, 3}$.\n", - "Output Answer": [ - "${-4, 0, 3, 9, 10}$" - ], - "Output Program": [ - "fst = set((6, -2, -4, 9, -5, 4, 10, 0, -8, 5, 3,))\nsnd = set((-4, 2, 10, 0, 9, -6, 3,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.157,0.07,0.107,0.005,0.081,0.144,0.02,0.011,0.028,0.003\\}$ and $\\{0.088,0.159,0.034,0.082,0.055,0.108,0.018,0.201,0.059,0.082\\}$.", - "Output Answer": [ - "$0.59$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.157, 0.07, 0.107, 0.005, 0.081, 0.144, 0.02, 0.011, 0.028, 0.003\ndistribution2 = 0.088, 0.159, 0.034, 0.082, 0.055, 0.108, 0.018, 0.201, 0.059, 0.082\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, 7, -1, -4, -5, 7}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, 7, -1, -4, -5, 7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1.38, -\\frac{27}{5}, -3, 3, 5} \\cup {-1, -1.38, 3, 8, -3}$.\n", - "Output Answer": [ - "${-\\frac{27}{5}, -3, -1.38, -1, 3, 5, 8}$" - ], - "Output Program": [ - "fst = set((-1.38, -(27/5), -3, 3, 5,))\nsnd = set((-1, -1.38, 3, 8, -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{8}{3}, -\\frac{18}{7}, -6, -4}$.", - "Output Answer": [ - "$-\\frac{10}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -(8/3), -(18/7), -6, -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{13}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{13}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, 4 \\sqrt{3}, -\\frac{13}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, 2 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, 4 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, 4 \\sqrt{3}, 4 \\sqrt{3}, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{\\sqrt{3}},\\frac{5}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(13/(math.sqrt(3))), 2*math.sqrt(3), -(13/(math.sqrt(3))), -(13/(math.sqrt(3))), 2*math.sqrt(3), -(13/(math.sqrt(3))), (5/(math.sqrt(3))), (5/(math.sqrt(3))), (5/(math.sqrt(3))), 4*math.sqrt(3), -(13/(math.sqrt(3))), (5/(math.sqrt(3))), 2*math.sqrt(3), (4/(math.sqrt(3))), (5/(math.sqrt(3))), 4*math.sqrt(3), (8/(math.sqrt(3))), 4*math.sqrt(3), 4*math.sqrt(3), 2*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 5 \\sqrt{2}, 6 \\sqrt{2}, -2, 6, 5, \\frac{12}{\\sqrt{\\pi }}, 0, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$2+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 5*math.sqrt(2), 6*math.sqrt(2), -2, 6, 5, (12/(math.sqrt(math.pi))), 0, 3*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{32}{3}, \\frac{16}{3}, \\frac{38}{3}}$.\n", - "Output Answer": [ - "$\\frac{608}{73}$" - ], - "Output Program": [ - "import statistics\nvalues = (32/3), (16/3), (38/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2 e, 5 \\sqrt{3}, -1} \\setminus {-2, 9, 5 \\sqrt{3}, -7}$.\n", - "Output Answer": [ - "${-1, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.e, 5*math.sqrt(3), -1,))\nsnd = set((-2, 9, 5*math.sqrt(3), -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x+2.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$2.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(3.7*x+2.4))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, -\\frac{9}{\\sqrt{5}}, 2, -\\frac{10}{\\sqrt{3}}} \\setminus {-\\frac{9}{\\sqrt{5}}, 10, 3, -\\frac{10}{\\sqrt{3}}, 2, 4, -\\frac{2}{\\sqrt{3}}, -2}$.\n", - "Output Answer": [ - "${}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -(9/(math.sqrt(5))), 2, -(10/(math.sqrt(3))),))\nsnd = set((-(9/(math.sqrt(5))), 10, 3, -(10/(math.sqrt(3))), 2, 4, -(2/(math.sqrt(3))), -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{18}{\\sqrt{5}}, 8, -8, 4, -6.65}$.\n", - "Output Answer": [ - "${-\\frac{18}{\\sqrt{5}}, -8, -6.65, 4, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(18/(math.sqrt(5))), 8, -8, 4, -6.65\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.178,0.241,0.073,0.037,0.091,0.237,0.038\\}$ and $\\{0.111,0.094,0.06,0.346,0.071,0.163,0.086\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.178, 0.241, 0.073, 0.037, 0.091, 0.237, 0.038\ndistribution2 = 0.111, 0.094, 0.06, 0.346, 0.071, 0.163, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -\\frac{22}{5}, 10, 9, -7, 5 \\sqrt{2}} \\setminus {-2, -7, 7, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-8, -\\frac{22}{5}, 5 \\sqrt{2}, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -(22/5), 10, 9, -7, 5*math.sqrt(2),))\nsnd = set((-2, -7, 7, 4*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 4, -\\frac{3}{\\sqrt{2}}, -\\frac{9}{2}, 9, \\frac{12}{e}, 9, -\\frac{6}{\\sqrt{\\pi }}, -4 \\sqrt{3}, 8}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4-\\frac{3}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 4, -(3/(math.sqrt(2))), -(9/2), 9, (12/math.e), 9, -(6/(math.sqrt(math.pi))), -4*math.sqrt(3), 8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{12}{e}, \\frac{15}{2}, -\\frac{7}{\\sqrt{5}}, -3, -\\frac{22}{3}, 1, -\\frac{11}{4}, 2}$.\n", - "Output Answer": [ - "$\\frac{89}{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -(12/math.e), (15/2), -(7/(math.sqrt(5))), -3, -(22/3), 1, -(11/4), 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${6, 6, 12, -6, 4}$.\n", - "Output Answer": [ - "$\\frac{214}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 6, 12, -6, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{7}{3}, -8, \\frac{23}{5}, 3, -1, 9, \\frac{48}{7}} \\cup {-\\frac{43}{7}, -1, -4, -\\frac{19}{5}, -\\frac{31}{5}, \\frac{23}{3}, 9, 2}$.\n", - "Output Answer": [ - "${-8, -\\frac{31}{5}, -\\frac{43}{7}, -4, -\\frac{19}{5}, -\\frac{7}{3}, -1, 2, 3, \\frac{23}{5}, \\frac{48}{7}, \\frac{23}{3}, 9}$" - ], - "Output Program": [ - "fst = set((-(7/3), -8, (23/5), 3, -1, 9, (48/7),))\nsnd = set((-(43/7), -1, -4, -(19/5), -(31/5), (23/3), 9, 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, -7, 11, -15}$.\n", - "Output Answer": [ - "$\\frac{5 \\sqrt{\\frac{59}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -7, 11, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 125, 7, -125}$.\n", - "Output Answer": [ - "$50 \\sqrt[4]{-7} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 125, 7, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.8 x^2-3.2 x+2.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$-3.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(-1.8*x**2-3.2*x+2.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 5, -14, -13, -2, -7}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{469}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 5, -14, -13, -2, -7\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4096, 1000, 100, 531441, 81, 100}$.\n", - "Output Answer": [ - "$360\\ 3^{2/3} \\sqrt[6]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 4096, 1000, 100, 531441, 81, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x-7.1$ where $x \\sim $ \\text{PoissonDistribution}[0.7]\n", - "Output Answer": [ - "$-6.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.7)\nprint(E(1.3*x-7.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{3}, \\frac{34}{3}, \\frac{37}{3}, \\frac{26}{3}}$.\n", - "Output Answer": [ - "$\\frac{32708}{2991}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/3), (34/3), (37/3), (26/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.107,0.371,0.327\\}$ and $\\{0.418,0.222,0.013\\}$.", - "Output Answer": [ - "$1.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.107, 0.371, 0.327\ndistribution2 = 0.418, 0.222, 0.013\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -3, 2 e, 2, 7 \\sqrt{2}, -3, 9 \\log (2), -1, -10, -2 \\log (2), 9, 1}$.\n", - "Output Answer": [ - "$10+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -3, 2*math.e, 2, 7*math.sqrt(2), -3, 9*math.log(2), -1, -10, -2*math.log(2), 9, 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -1, 6}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -1, 6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.066,0.193,0.117,0.117,0.262,0.068,0.017,0.025,0.084\\}$ and $\\{0.098,0.033,0.078,0.024,0.141,0.141,0.201,0.14,0.068\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.066, 0.193, 0.117, 0.117, 0.262, 0.068, 0.017, 0.025, 0.084\ndistribution2 = 0.098, 0.033, 0.078, 0.024, 0.141, 0.141, 0.201, 0.14, 0.068\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{16}{\\sqrt{3}}, -\\frac{31}{4}, -\\frac{12}{e}}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{3}}-\\frac{12}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -(16/(math.sqrt(3))), -(31/4), -(12/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{17}{3}, \\frac{8}{3}, \\frac{5}{3}, -\\frac{7}{3}, -\\frac{1}{3}}$.\n", - "Output Answer": [ - "$\\frac{22}{15}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (17/3), (8/3), (5/3), -(7/3), -(1/3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.2 x-0.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$-0.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(4.2*x-0.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 10, 1, \\frac{8}{\\pi }, -\\frac{21}{\\sqrt{5}}, 6, -3 \\sqrt{5}} \\setminus {-2 \\sqrt{5}, 10, \\frac{8}{\\pi }, -9.3, -\\frac{19}{\\sqrt{5}}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{21}{\\sqrt{5}}, -3 \\sqrt{5}, -5, 1, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 10, 1, (8/math.pi), -(21/(math.sqrt(5))), 6, -3*math.sqrt(5),))\nsnd = set((-2*math.sqrt(5), 10, (8/math.pi), -9.3, -(19/(math.sqrt(5))), -math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -3, \\frac{19}{\\sqrt{5}}, -4 \\sqrt{3}, -5, -2 \\sqrt{3}, -\\frac{11}{\\pi }, \\frac{43}{7}, -7, -1, -2}$.", - "Output Answer": [ - "$-2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -3, (19/(math.sqrt(5))), -4*math.sqrt(3), -5, -2*math.sqrt(3), -(11/math.pi), (43/7), -7, -1, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 4, 4, 4, 4, 4, -3, -3, -3, 6, -3, -3, -3, 4, -3, -3, 4, -3, 6, 6, 4, 6, 6, -3, 4, -3}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 4, 4, 4, 4, 4, -3, -3, -3, 6, -3, -3, -3, 4, -3, -3, 4, -3, 6, 6, 4, 6, 6, -3, 4, -3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, 81, 1000, -64, 3125}$.\n", - "Output Answer": [ - "$100\\ 2^{2/5} 3^{4/5} \\sqrt[5]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, 81, 1000, -64, 3125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 11, 4, -13, -1}$.\n", - "Output Answer": [ - "$\\frac{1043}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 11, 4, -13, -1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, 13, -1, 7, 9, -5}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{439}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 13, -1, 7, 9, -5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -4, 3 \\sqrt{5}, -2 \\sqrt{3}, 8, -\\pi} \\setminus {\\frac{42}{5}, 8, 3, -4, 0, -2 \\pi, 3 \\sqrt{5}, -6}$.\n", - "Output Answer": [ - "${-2 \\sqrt{3}, -\\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -4, 3*math.sqrt(5), -2*math.sqrt(3), 8, -math.pi,))\nsnd = set(((42/5), 8, 3, -4, 0, -2*math.pi, 3*math.sqrt(5), -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6.783, 7.34, 8.07, -3, 6, -8} \\cup {7.34, 8.21, 6, -8, -3, 6.783}$.\n", - "Output Answer": [ - "${-8, -3, 6, 6.783, 7.34, 8.07, 8.21}$" - ], - "Output Program": [ - "fst = set((6.783, 7.34, 8.07, -3, 6, -8,))\nsnd = set((7.34, 8.21, 6, -8, -3, 6.783,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{27}{2}, \\frac{17}{2}, 20}$.\n", - "Output Answer": [ - "$\\frac{27540}{2219}$" - ], - "Output Program": [ - "import statistics\nvalues = (27/2), (17/2), 20\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{2}, -\\frac{9}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, -9, 1, -\\frac{9}{7}, \\frac{8}{\\sqrt{\\pi }}, -\\sqrt{3}, -\\frac{6}{\\pi }, 4, -4 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\sqrt{3}-\\frac{6}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(2), -(9/(math.sqrt(math.pi))), -(5/(math.sqrt(3))), (16/(math.sqrt(3))), -9, 1, -(9/7), (8/(math.sqrt(math.pi))), -math.sqrt(3), -(6/math.pi), 4, -4*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{5}, \\frac{24}{5}, -\\frac{58}{7}, -9, -5, 6 \\sqrt{2}, \\frac{39}{4}} \\setminus {-9, \\frac{24}{5}, -5, 0, -6, \\frac{37}{4}}$.\n", - "Output Answer": [ - "${-\\frac{58}{7}, 6 \\sqrt{2}, 4 \\sqrt{5}, \\frac{39}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), (24/5), -(58/7), -9, -5, 6*math.sqrt(2), (39/4),))\nsnd = set((-9, (24/5), -5, 0, -6, (37/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{1}{e}, 2 \\pi, \\pi, 0, 2 e} \\setminus {2 e, -\\frac{2}{\\sqrt{\\pi }}, 2 \\pi, \\frac{1}{e}, \\pi}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/math.e), 2*math.pi, math.pi, 0, 2*math.e,))\nsnd = set((2*math.e, -(2/(math.sqrt(math.pi))), 2*math.pi, (1/math.e), math.pi,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, \\frac{13}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{13}{\\sqrt{2}}-8$" - ], - "Output Program": [ - "import math\n\nvalues = 8, (13/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 7, -8, 7, 6, 6, 5, -8, 6, 6, -10, 9, 6, -9, -9, -9, 9, -9, 4, -9, 7, -10, -10, -10, -10, 5}$.\n", - "Output Answer": [ - "$\\{6,-10,-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 7, -8, 7, 6, 6, 5, -8, 6, 6, -10, 9, 6, -9, -9, -9, 9, -9, 4, -9, 7, -10, -10, -10, -10, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -3, 0, -4, -1, 7, 10}$.\n", - "Output Answer": [ - "$\\frac{8}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -3, 0, -4, -1, 7, 10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0.821, 1, -9, -4, -\\frac{2}{\\sqrt{3}}, 8} \\setminus {7, 8, -2, -10, \\frac{3}{\\sqrt{\\pi }}, 1}$.\n", - "Output Answer": [ - "${-9, -4, -\\frac{2}{\\sqrt{3}}, 0.821}$" - ], - "Output Program": [ - "import math\n\nfst = set((0.821, 1, -9, -4, -(2/(math.sqrt(3))), 8,))\nsnd = set((7, 8, -2, -10, (3/(math.sqrt(math.pi))), 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, 1, -3} \\setminus {-8, 5 \\sqrt{3}, 3, 10, -9, -3}$.\n", - "Output Answer": [ - "${1, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 1, -3,))\nsnd = set((-8, 5*math.sqrt(3), 3, 10, -9, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{6}{\\sqrt{\\pi }}, 0, -\\frac{1}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{9}{7 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(6/(math.sqrt(math.pi))), 0, -(1/(math.sqrt(math.pi))), (11/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, -2 \\sqrt{5}, \\frac{35}{4}, 0.651, 2} \\setminus {-7, 5, -\\frac{27}{4}, 0.651}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, 2, \\frac{35}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -2*math.sqrt(5), (35/4), 0.651, 2,))\nsnd = set((-7, 5, -(27/4), 0.651,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 5, -\\pi, 8, \\pi, -3}$.\n", - "Output Answer": [ - "$8+\\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 5, -math.pi, 8, math.pi, -3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.054,0.034,0.073,0.153,0.076,0.206,0.078,0.167,0.071\\}$ and $\\{0.222,0.098,0.121,0.072,0.088,0.085,0.099,0.113,0.034\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.054, 0.034, 0.073, 0.153, 0.076, 0.206, 0.078, 0.167, 0.071\ndistribution2 = 0.222, 0.098, 0.121, 0.072, 0.088, 0.085, 0.099, 0.113, 0.034\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, -10, -6, 4}$.\n", - "Output Answer": [ - "$\\frac{923}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -10, -6, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, 4, -1, 1, 13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{587}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 4, -1, 1, 13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${8, -7}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 2, -512}$.\n", - "Output Answer": [ - "$16 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 2, -512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-10, \\frac{22}{\\sqrt{5}}, 1, 2 \\pi} \\setminus {-6 \\sqrt{2}, \\frac{11}{\\sqrt{5}}, 2 \\pi, 1, -11 \\log (2)}$.\n", - "Output Answer": [ - "${-10, \\frac{22}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, (22/(math.sqrt(5))), 1, 2*math.pi,))\nsnd = set((-6*math.sqrt(2), (11/(math.sqrt(5))), 2*math.pi, 1, -11*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{48}{5}, -9, 0, 3 \\sqrt{5}, -5, -\\log (2), -4 \\sqrt{3}, 0, -3}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(48/5), -9, 0, 3*math.sqrt(5), -5, -math.log(2), -4*math.sqrt(3), 0, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, -8, \\frac{19}{5}, 8, 5, -\\sqrt{2}, 3 \\sqrt{3}, -2, -\\sqrt{5}} \\cup {-\\sqrt{5}, -4, 8, 5 \\sqrt{3}, 0, -\\sqrt{2}, -7, 5}$.\n", - "Output Answer": [ - "${-8, -7, -4, -\\sqrt{5}, -2, -\\sqrt{2}, 0, \\frac{19}{5}, 5, 3 \\sqrt{3}, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -8, (19/5), 8, 5, -math.sqrt(2), 3*math.sqrt(3), -2, -math.sqrt(5),))\nsnd = set((-math.sqrt(5), -4, 8, 5*math.sqrt(3), 0, -math.sqrt(2), -7, 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.035,0.599,0.081,0.036,0.026,0.032\\}$ and $\\{0.049,0.08,0.167,0.208,0.165,0.125\\}$.", - "Output Answer": [ - "$1.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.035, 0.599, 0.081, 0.036, 0.026, 0.032\ndistribution2 = 0.049, 0.08, 0.167, 0.208, 0.165, 0.125\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${7, 1, -3, -1, 8, 9, 3} \\cap {-3, 3, 9, -9, -1, -5, 4, -7, 1}$.\n", - "Output Answer": [ - "${-3, -1, 1, 3, 9}$" - ], - "Output Program": [ - "fst = set((7, 1, -3, -1, 8, 9, 3,))\nsnd = set((-3, 3, 9, -9, -1, -5, 4, -7, 1,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3125, -1, 81, -7776, 4096}$.\n", - "Output Answer": [ - "$120 \\sqrt[5]{-1} 2^{2/5} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3125, -1, 81, -7776, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -15, 11}$.\n", - "Output Answer": [ - "$\\frac{523}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -15, 11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.086,0.099,0.417,0.014,0.054,0.055,0.143\\}$ and $\\{0.09,0.258,0.002,0.099,0.051,0.032,0.086\\}$.", - "Output Answer": [ - "$2.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.086, 0.099, 0.417, 0.014, 0.054, 0.055, 0.143\ndistribution2 = 0.09, 0.258, 0.002, 0.099, 0.051, 0.032, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 20, 5, 3}$.\n", - "Output Answer": [ - "$\\frac{48}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 20, 5, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{3}{4}, -\\frac{9}{4}, -\\frac{3}{4}, -\\frac{3}{4}, -\\frac{9}{4}, \\frac{33}{4}, \\frac{17}{2}, -\\frac{3}{4}, -\\frac{3}{4}, -\\frac{15}{2}, -\\frac{15}{2}, -\\frac{9}{4}, -3, -\\frac{15}{2}, -3, -\\frac{3}{4}, -\\frac{3}{4}, -3, -\\frac{9}{4}, -\\frac{15}{2}, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{3}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(3/4), -(9/4), -(3/4), -(3/4), -(9/4), (33/4), (17/2), -(3/4), -(3/4), -(15/2), -(15/2), -(9/4), -3, -(15/2), -3, -(3/4), -(3/4), -3, -(9/4), -(15/2), (17/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, -9, 5, 7, -5, -1, -6} \\cap {-7, -4, -9, -1, 10, -2}$.\n", - "Output Answer": [ - "${-9, -1}$" - ], - "Output Program": [ - "fst = set((-8, -9, 5, 7, -5, -1, -6,))\nsnd = set((-7, -4, -9, -1, 10, -2,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 e, -2, 3, -4.7}$.\n", - "Output Answer": [ - "${-4.7, -2, 3, 2 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, -2, 3, -4.7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, 9, 4, \\frac{8}{\\sqrt{5}}, 6, -7} \\setminus {6, -3, 9, \\frac{8}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -7, 7}$.\n", - "Output Answer": [ - "${3, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 9, 4, (8/(math.sqrt(5))), 6, -7,))\nsnd = set((6, -3, 9, (8/(math.sqrt(5))), (6/(math.sqrt(5))), -7, 7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.6 x^3-2.5 x^2+3.4 x+0.6$ where $x \\sim $ \\text{PoissonDistribution}[1.8]\n", - "Output Answer": [ - "$-16.29$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.8)\nprint(E(-0.6*x**3-2.5*x**2+3.4*x+0.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, 7, -\\frac{19}{2}, -3}$.\n", - "Output Answer": [ - "$-\\frac{31}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, 7, -(19/2), -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -10, 6, -5, -1, 1, -6}$.\n", - "Output Answer": [ - "$-\\frac{22}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -10, 6, -5, -1, 1, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 4, 4, 10, 4, -8, -5, 10, 10, 10, 5, 4, 4, -5, -8, 4, -5, -5, 2, 10, 4, -8, 4, 10, 10, -5, -5, 5, 4, 5}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 4, 4, 10, 4, -8, -5, 10, 10, 10, 5, 4, 4, -5, -8, 4, -5, -5, 2, 10, 4, -8, 4, 10, 10, -5, -5, 5, 4, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, 2, 5, 0, -2} \\cup {0, -2, -3 \\sqrt{5}, -4.08, 9, 5, 2}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -4.08, -2, 0, 2, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 2, 5, 0, -2,))\nsnd = set((0, -2, -3*math.sqrt(5), -4.08, 9, 5, 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, 2, 5 \\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${2, 5, 5 \\sqrt{2}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 2, 5*math.sqrt(2), 5*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9.62, 2, 5, -\\frac{19}{2}, -\\frac{6}{7}, \\frac{16}{3}} \\cup {\\frac{4}{\\sqrt{3}}, \\frac{1}{2}, \\frac{21}{e}, 9.62, -1, 4, \\frac{16}{3}, 2}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -1, -\\frac{6}{7}, \\frac{1}{2}, 2, \\frac{4}{\\sqrt{3}}, 4, 5, \\frac{16}{3}, \\frac{21}{e}, 9.62}$" - ], - "Output Program": [ - "import math\n\nfst = set((9.62, 2, 5, -(19/2), -(6/7), (16/3),))\nsnd = set(((4/(math.sqrt(3))), (1/2), (21/math.e), 9.62, -1, 4, (16/3), 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{1}{3}, -3, 5, \\frac{7}{3}, \\frac{8}{3}, -\\frac{25}{3}, -\\frac{11}{3}, -7, \\frac{29}{3}} \\cap {-\\frac{1}{3}, \\frac{26}{3}, 7, \\frac{28}{3}, -\\frac{25}{3}, \\frac{7}{3}, -\\frac{11}{3}, -7, \\frac{4}{3}, -\\frac{17}{3}}$.\n", - "Output Answer": [ - "${-\\frac{25}{3}, -7, -\\frac{11}{3}, -\\frac{1}{3}, \\frac{7}{3}}$" - ], - "Output Program": [ - "fst = set((-(1/3), -3, 5, (7/3), (8/3), -(25/3), -(11/3), -7, (29/3),))\nsnd = set((-(1/3), (26/3), 7, (28/3), -(25/3), (7/3), -(11/3), -7, (4/3), -(17/3),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, 1, 2 \\sqrt{2}, -9, -3, 2, 7 \\log (2), -1}$.\n", - "Output Answer": [ - "${-9, -3, -1, 1, 2, 2 \\sqrt{2}, 7 \\log (2), 5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 1, 2*math.sqrt(2), -9, -3, 2, 7*math.log(2), -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10, -\\frac{14}{5}, -2, 9} \\setminus {-7, \\frac{18}{5}, 9, -3}$.\n", - "Output Answer": [ - "${-\\frac{14}{5}, -2, 10}$" - ], - "Output Program": [ - "fst = set((10, -(14/5), -2, 9,))\nsnd = set((-7, (18/5), 9, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 e, 2, 5, 8.119, -9} \\cup {-9, 0, 9, 8.749, 5}$.\n", - "Output Answer": [ - "${-9, -3 e, 0, 2, 5, 8.119, 8.749, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.e, 2, 5, 8.119, -9,))\nsnd = set((-9, 0, 9, 8.749, 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -\\frac{2}{5}, 4, 6}$.\n", - "Output Answer": [ - "$\\frac{32}{5}$" - ], - "Output Program": [ - "values = 0, -(2/5), 4, 6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, 13, 0, 5, -13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{209}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 13, 0, 5, -13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6 \\sqrt{2}, -10, 2, 0, -8, 3, 7, -7}$.\n", - "Output Answer": [ - "${-10, -6 \\sqrt{2}, -8, -7, 0, 2, 3, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.sqrt(2), -10, 2, 0, -8, 3, 7, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -9, -6, 2, -6, -6, 3, -6, -9, 2, 3, 3, -6, 2, -9, -6, 2, 3, 3, 3, 3, 2, 2}$.\n", - "Output Answer": [ - "$\\{2,3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -9, -6, 2, -6, -6, 3, -6, -9, 2, 3, 3, -6, 2, -9, -6, 2, 3, 3, 3, 3, 2, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-1.2 < 1.9 x+3.6 < 1.46$ where $x \\sim $ \\text{NormalDistribution}[0.8,1.].", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.8, 1.)\nprint(P((-1.2 < 1.9*x+3.6) & (1.9*x+3.6 < 1.46)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\pi, 0, -\\pi, 0, -3 \\pi, 3 \\pi}$.\n", - "Output Answer": [ - "$-\\frac{\\pi }{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.pi, 0, -math.pi, 0, -3*math.pi, 3*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${343, -2, 3}$.\n", - "Output Answer": [ - "$7 \\sqrt[3]{-6}$" - ], - "Output Program": [ - "import math\n\nvalues = 343, -2, 3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, -7, -\\frac{9}{\\sqrt{5}}, 8, -\\frac{9}{\\sqrt{\\pi }}, 2, \\frac{23}{3}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-8, -7, -\\frac{9}{\\sqrt{\\pi }}, -3 \\sqrt{2}, -\\frac{9}{\\sqrt{5}}, 2, \\frac{23}{3}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -7, -(9/(math.sqrt(5))), 8, -(9/(math.sqrt(math.pi))), 2, (23/3), -3*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, -9, -9, -9, 2, 2, -10, 2, 2, 2, -9, -1, -10, 2, -8, -9, -9, -9, -9, -10, -9, -1, -1, -9, -10}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, -9, -9, -9, 2, 2, -10, 2, 2, 2, -9, -1, -10, 2, -8, -9, -9, -9, -9, -10, -9, -1, -1, -9, -10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, -8, 9, -3}$.\n", - "Output Answer": [ - "$83$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -8, 9, -3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{5}{\\sqrt{3}}, -1, \\frac{23}{\\pi }, -2, -\\frac{1}{\\sqrt{\\pi }}} \\setminus {5, \\frac{23}{\\pi }, -\\frac{1}{\\sqrt{\\pi }}, 3, -8, -2}$.\n", - "Output Answer": [ - "${-\\frac{5}{\\sqrt{3}}, -1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(5/(math.sqrt(3))), -1, (23/math.pi), -2, -(1/(math.sqrt(math.pi))),))\nsnd = set((5, (23/math.pi), -(1/(math.sqrt(math.pi))), 3, -8, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 4, \\frac{19}{2}, 9, \\sqrt{2}, 7, 8} \\cup {-4, 0, \\frac{19}{2}, 9, -4 e, \\sqrt{2}, 4}$.\n", - "Output Answer": [ - "${-4 e, -4, 0, \\sqrt{2}, 4, 7, 8, 9, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 4, (19/2), 9, math.sqrt(2), 7, 8,))\nsnd = set((-4, 0, (19/2), 9, -4*math.e, math.sqrt(2), 4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 2, 9, 2 \\sqrt{2}, 6, -4, \\frac{6}{\\pi }} \\cup {-2, 4, -10, -4, 1, 9, -9, \\frac{6}{\\pi }, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-10, -9, -4, -2, 1, \\frac{6}{\\pi }, 2, 2 \\sqrt{2}, 4, 6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 2, 9, 2*math.sqrt(2), 6, -4, (6/math.pi),))\nsnd = set((-2, 4, -10, -4, 1, 9, -9, (6/math.pi), 2*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, -3 \\sqrt{3}, -4 \\sqrt{3}, -3 \\sqrt{3}, 3 \\sqrt{3}, -\\sqrt{3}, 3 \\sqrt{3}, -\\sqrt{3}, -4 \\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, -\\sqrt{3}, -3 \\sqrt{3}, -3 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, -4 \\sqrt{3}, -3 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{3 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), -3*math.sqrt(3), -4*math.sqrt(3), -3*math.sqrt(3), 3*math.sqrt(3), -math.sqrt(3), 3*math.sqrt(3), -math.sqrt(3), -4*math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), -math.sqrt(3), -3*math.sqrt(3), -3*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), -4*math.sqrt(3), -3*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), 3*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -6, 9, \\frac{18}{5}, 4.2, -4 \\sqrt{5}, -4 e, 4} \\cup {\\frac{18}{5}, 0, 9, 2, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 e, -4 \\sqrt{5}, -6, 0, 2, \\frac{18}{5}, 4, 4.2, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -6, 9, (18/5), 4.2, -4*math.sqrt(5), -4*math.e, 4,))\nsnd = set(((18/5), 0, 9, 2, -4*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{3}, 1, 2, 5, -4, 9, 2, -3, -\\frac{14}{3}, -2}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(3), 1, 2, 5, -4, 9, 2, -3, -(14/3), -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{3}, -5 \\sqrt{3}, 0, -3 \\sqrt{3}, \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{8 \\sqrt{3}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(3), -5*math.sqrt(3), 0, -3*math.sqrt(3), math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, 2.52, 2, -2}$.\n", - "Output Answer": [ - "${-9, -2, 2, 2.52}$" - ], - "Output Program": [ - "values = -9, 2.52, 2, -2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-10, -3 \\log (2), \\frac{3}{7}, -3, \\frac{7}{\\sqrt{5}}, -3 \\sqrt{3}, 5, 1, 3, -9, 3 \\sqrt{5}, \\frac{3}{2}, -6}$.", - "Output Answer": [ - "$\\frac{3}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, -3*math.log(2), (3/7), -3, (7/(math.sqrt(5))), -3*math.sqrt(3), 5, 1, 3, -9, 3*math.sqrt(5), (3/2), -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{49}{5}, 5, -1} \\setminus {2, 0, -\\frac{49}{5}, 2 \\sqrt{5}, 8}$.\n", - "Output Answer": [ - "${-1, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(49/5), 5, -1,))\nsnd = set((2, 0, -(49/5), 2*math.sqrt(5), 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -1, -1, -1, 9, 9, -6, -1, -6, 9, 9, 7, -7, -1, -6, -7, -6, -6, 7, 7, -6, 9, -1}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -1, -1, -1, 9, 9, -6, -1, -6, 9, 9, 7, -7, -1, -6, -7, -6, -6, 7, 7, -6, 9, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.149,0.001,0.022,0.203,0.001,0.152,0.048,0.035,0.018,0.061\\}$ and $\\{0.006,0.002,0.177,0.048,0.1,0.018,0.006,0.203,0.141,0.166\\}$.", - "Output Answer": [ - "$1.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.149, 0.001, 0.022, 0.203, 0.001, 0.152, 0.048, 0.035, 0.018, 0.061\ndistribution2 = 0.006, 0.002, 0.177, 0.048, 0.1, 0.018, 0.006, 0.203, 0.141, 0.166\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${1, \\frac{5}{7}, \\frac{38}{7}, -\\frac{51}{7}, \\frac{23}{7}, -\\frac{22}{7}, -\\frac{37}{7}, -\\frac{29}{7}, \\frac{32}{7}, \\frac{36}{7}, \\frac{22}{7}, -8, \\frac{68}{7}, \\frac{29}{7}, -\\frac{55}{7}} \\cap {\\frac{41}{7}, -\\frac{53}{7}, -\\frac{12}{7}, 2, \\frac{68}{7}, -\\frac{11}{7}, \\frac{36}{7}, -8, \\frac{29}{7}, 1, \\frac{3}{7}, -\\frac{62}{7}, 7, 0, -\\frac{9}{7}, -\\frac{39}{7}}$.\n", - "Output Answer": [ - "${-8, 1, \\frac{29}{7}, \\frac{36}{7}, \\frac{68}{7}}$" - ], - "Output Program": [ - "fst = set((1, (5/7), (38/7), -(51/7), (23/7), -(22/7), -(37/7), -(29/7), (32/7), (36/7), (22/7), -8, (68/7), (29/7), -(55/7),))\nsnd = set(((41/7), -(53/7), -(12/7), 2, (68/7), -(11/7), (36/7), -8, (29/7), 1, (3/7), -(62/7), 7, 0, -(9/7), -(39/7),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, -8, 9, 1, -6, -10}$.\n", - "Output Answer": [ - "$\\frac{188}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -8, 9, 1, -6, -10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{5}, \\sqrt{5}, -3 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(5), math.sqrt(5), -3*math.sqrt(5), 2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, 3, -2, 4, -3, 5, -2.124, 0}$.\n", - "Output Answer": [ - "${-3, -2.124, -2, 0, 1, 3, 4, 5}$" - ], - "Output Program": [ - "values = 1, 3, -2, 4, -3, 5, -2.124, 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, -2 \\sqrt{2}, 4, 1, -3} \\cup {7, -2, -2 \\sqrt{2}, 1}$.\n", - "Output Answer": [ - "${-3, -2 \\sqrt{2}, -2, 1, 4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -2*math.sqrt(2), 4, 1, -3,))\nsnd = set((7, -2, -2*math.sqrt(2), 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 17, \\frac{17}{3}}$.\n", - "Output Answer": [ - "$\\frac{51}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 17, (17/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.224,0.002,0.037,0.068,0.362,0.062,0.192\\}$ and $\\{0.081,0.099,0.12,0.177,0.107,0.189,0.082\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.224, 0.002, 0.037, 0.068, 0.362, 0.062, 0.192\ndistribution2 = 0.081, 0.099, 0.12, 0.177, 0.107, 0.189, 0.082\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\pi, -2 \\pi, 3 \\pi, \\pi, 3 \\pi, 3 \\pi, 0, 0, 3 \\pi, 0, 3 \\pi, 0, \\pi, 0, -2 \\pi, 0, 2 \\pi, \\pi, 3 \\pi, 0, -2 \\pi, 2 \\pi, 2 \\pi, \\pi, \\pi, 0, -3 \\pi, \\pi}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.pi, -2*math.pi, 3*math.pi, math.pi, 3*math.pi, 3*math.pi, 0, 0, 3*math.pi, 0, 3*math.pi, 0, math.pi, 0, -2*math.pi, 0, 2*math.pi, math.pi, 3*math.pi, 0, -2*math.pi, 2*math.pi, 2*math.pi, math.pi, math.pi, 0, -3*math.pi, math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 e, 7, -\\frac{10}{e}, -12 \\log (2), 1, 3 \\pi, -5 \\sqrt{2}, -2, -4, -12 \\log (2), 3, \\frac{13}{e}, -4, \\frac{10}{\\pi }}$.\n", - "Output Answer": [ - "$3 \\pi +12 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, 7, -(10/math.e), -12*math.log(2), 1, 3*math.pi, -5*math.sqrt(2), -2, -4, -12*math.log(2), 3, (13/math.e), -4, (10/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, -729, 25, -512, -3125}$.\n", - "Output Answer": [ - "$60 \\sqrt[5]{-2} 3^{3/5} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, -729, 25, -512, -3125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, -8, -5}$.\n", - "Output Answer": [ - "$18 \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, -8, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9.525, -3, 2.886, 1, 0}$.\n", - "Output Answer": [ - "${-9.525, -3, 0, 1, 2.886}$" - ], - "Output Program": [ - "values = -9.525, -3, 2.886, 1, 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -10, -\\frac{6}{e}, \\frac{17}{\\sqrt{3}}, -10, \\frac{16}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$10+\\frac{17}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -10, -(6/math.e), (17/(math.sqrt(3))), -10, (16/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{33}{7}, 6, 3, \\frac{29}{\\pi }, -3, 5, -6} \\setminus {-\\frac{11}{\\pi }, -6, 10, \\frac{33}{7}}$.\n", - "Output Answer": [ - "${-3, 3, 5, 6, \\frac{29}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((33/7), 6, 3, (29/math.pi), -3, 5, -6,))\nsnd = set((-(11/math.pi), -6, 10, (33/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, 8, 8, -9}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, 8, 8, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{30}{\\pi }, \\frac{29}{\\pi }, -\\frac{20}{\\pi }, \\frac{26}{\\pi }, -\\frac{5}{\\pi }, \\frac{13}{\\pi }, -\\frac{29}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{44}{7 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (30/math.pi), (29/math.pi), -(20/math.pi), (26/math.pi), -(5/math.pi), (13/math.pi), -(29/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{16}{\\sqrt{3}}, -2 \\pi, -\\frac{5}{\\sqrt{2}}, 7, \\pi}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{3}}+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = (16/(math.sqrt(3))), -2*math.pi, -(5/(math.sqrt(2))), 7, math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\log (2), -3 \\log (2), -3 \\log (2), -3 \\log (2), -4 \\log (2), -4 \\log (2), -9 \\log (2), -9 \\log (2), -3 \\log (2), -9 \\log (2), -4 \\log (2), -3 \\log (2), -4 \\log (2), -3 \\log (2), -9 \\log (2), -3 \\log (2), -3 \\log (2), -4 \\log (2), -3 \\log (2), -4 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-3 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.log(2), -3*math.log(2), -3*math.log(2), -3*math.log(2), -4*math.log(2), -4*math.log(2), -9*math.log(2), -9*math.log(2), -3*math.log(2), -9*math.log(2), -4*math.log(2), -3*math.log(2), -4*math.log(2), -3*math.log(2), -9*math.log(2), -3*math.log(2), -3*math.log(2), -4*math.log(2), -3*math.log(2), -4*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.257,0.105,0.257,0.018,0.026,0.147\\}$ and $\\{0.075,0.104,0.028,0.182,0.154,0.116,0.056\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.257, 0.105, 0.257, 0.018, 0.026, 0.147\ndistribution2 = 0.075, 0.104, 0.028, 0.182, 0.154, 0.116, 0.056\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -3, -2, 7, -2, 7, 7, -7, -7, -3, 7, 7, 8, 8, -2, -7, -2, 7, 7, -7, -2, 8, -3}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -3, -2, 7, -2, 7, 7, -7, -7, -3, 7, 7, 8, 8, -2, -7, -2, 7, 7, -7, -2, 8, -3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7 \\sqrt{2}, 0, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{2 \\sqrt{2}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -7*math.sqrt(2), 0, 5*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10 \\log (2), 1}$.\n", - "Output Answer": [ - "$1+10 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -10*math.log(2), 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x^2-1.9 x+5.8$ where $x \\sim $ \\text{BetaDistribution}[1.3,1.9]\n", - "Output Answer": [ - "$5.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 1.9)\nprint(E(3.1*x**2-1.9*x+5.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.129,0.066,0.002,0.006,0.054,0.29,0.059,0.12,0.184,0.025\\}$ and $\\{0.316,0.007,0.108,0.11,0.057,0.03,0.059,0.047,0.157,0.095\\}$.", - "Output Answer": [ - "$0.88$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.129, 0.066, 0.002, 0.006, 0.054, 0.29, 0.059, 0.12, 0.184, 0.025\ndistribution2 = 0.316, 0.007, 0.108, 0.11, 0.057, 0.03, 0.059, 0.047, 0.157, 0.095\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-3, 3, 10, -9, -5, 1, -2, 2, -6} \\cap {3, 7, -1, -6, -5, -8, 10, 2}$.\n", - "Output Answer": [ - "${-6, -5, 2, 3, 10}$" - ], - "Output Program": [ - "fst = set((-3, 3, 10, -9, -5, 1, -2, 2, -6,))\nsnd = set((3, 7, -1, -6, -5, -8, 10, 2,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x+0.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5]\n", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(E(3.7*x+0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.071,0.074,0.121,0.209,0.217,0.039,0.193\\}$ and $\\{0.112,0.108,0.066,0.115,0.112,0.148,0.04\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.071, 0.074, 0.121, 0.209, 0.217, 0.039, 0.193\ndistribution2 = 0.112, 0.108, 0.066, 0.115, 0.112, 0.148, 0.04\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{4}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{57}{7}, 0, -\\frac{19}{\\pi }, 0, 6, 1, -8, -e, \\frac{8}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$8+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = (4/(math.sqrt(3))), 5*math.sqrt(3), (57/7), 0, -(19/math.pi), 0, 6, 1, -8, -math.e, (8/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3, -3, -10} \\cup {-3, -10}$.\n", - "Output Answer": [ - "${-10, -3, 3}$" - ], - "Output Program": [ - "fst = set((3, -3, -10,))\nsnd = set((-3, -10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.035,0.069,0.658,0.198,0.035\\}$ and $\\{0.301,0.092,0.126,0.057,0.312\\}$.", - "Output Answer": [ - "$1.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.035, 0.069, 0.658, 0.198, 0.035\ndistribution2 = 0.301, 0.092, 0.126, 0.057, 0.312\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{10}{\\sqrt{3}}, 2 \\pi, -\\sqrt{3}, -4 \\sqrt{5}, -4} \\setminus {-4 \\sqrt{5}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4, -\\sqrt{3}, \\frac{10}{\\sqrt{3}}, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set(((10/(math.sqrt(3))), 2*math.pi, -math.sqrt(3), -4*math.sqrt(5), -4,))\nsnd = set((-4*math.sqrt(5), -4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 \\sqrt{5}, -2, -\\sqrt{2}, 5, -\\frac{7}{\\sqrt{2}}, 5, -8, 8, \\frac{11}{\\sqrt{5}}, 0}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(5), -2, -math.sqrt(2), 5, -(7/(math.sqrt(2))), 5, -8, 8, (11/(math.sqrt(5))), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, -8, 4, -1, 16}$.\n", - "Output Answer": [ - "$4\\ 2^{2/5} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, -8, 4, -1, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, -3, 5, -9, 6, -3, -3, 3, 3, 6, -9, 5, 3, 7, 5, 7, 3, 6, -3, 5, 7}$.\n", - "Output Answer": [ - "$\\{-3,5,3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, -3, 5, -9, 6, -3, -3, 3, 3, 6, -9, 5, 3, 7, 5, 7, 3, 6, -3, 5, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 2, 14, 7}$.\n", - "Output Answer": [ - "$\\frac{154}{31}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 2, 14, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, \\frac{66}{7}, \\frac{1}{\\sqrt{3}}, 1, 5, 3}$.\n", - "Output Answer": [ - "${\\frac{1}{\\sqrt{3}}, 1, 3, 4, 5, \\frac{66}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (66/7), (1/(math.sqrt(3))), 1, 5, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.098,0.122,0.592\\}$ and $\\{0.37,0.239,0.23\\}$.", - "Output Answer": [ - "$0.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.098, 0.122, 0.592\ndistribution2 = 0.37, 0.239, 0.23\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x^2+4.8 x-5.1$ where $x \\sim $ \\text{NormalDistribution}[0.1,2.5]\n", - "Output Answer": [ - "$12.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.1, 2.5)\nprint(E(2.7*x**2+4.8*x-5.1))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, -3 \\log (2), \\frac{27}{\\pi }, -\\frac{9}{4}, \\sqrt{2}, 4, \\frac{46}{7}, -9} \\cup {-9, \\frac{1}{4}, 4, \\frac{27}{\\pi }, -\\frac{31}{7}, 9, -3 \\log (2), 7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-9, -\\frac{31}{7}, -\\frac{9}{4}, -3 \\log (2), \\frac{1}{4}, \\sqrt{2}, 4, \\frac{46}{7}, 7, \\frac{27}{\\pi }, 9, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -3*math.log(2), (27/math.pi), -(9/4), math.sqrt(2), 4, (46/7), -9,))\nsnd = set((-9, (1/4), 4, (27/math.pi), -(31/7), 9, -3*math.log(2), 7*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x^2+3.8 x-4.2$ where $x \\sim $ \\text{ExponentialDistribution}[0.7]\n", - "Output Answer": [ - "$10.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.7)\nprint(E(2.3*x**2+3.8*x-4.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${15, -12, -13, -11, -9, -14}$.\n", - "Output Answer": [ - "$\\frac{368}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -12, -13, -11, -9, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, 2, -5}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{109}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 2, -5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{23}{3}, \\frac{16}{e}, 4 \\sqrt{2}}$.", - "Output Answer": [ - "$4 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(23/3), (16/math.e), 4*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, -4, -6, -6 \\sqrt{2}, -3, 9, 5} \\cup {-4, -10, -6, 8, 7, -8, 7 \\sqrt{2}, 0}$.\n", - "Output Answer": [ - "${-10, -6 \\sqrt{2}, -8, -6, -4, -3, 0, 5, 7, 8, 9, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -4, -6, -6*math.sqrt(2), -3, 9, 5,))\nsnd = set((-4, -10, -6, 8, 7, -8, 7*math.sqrt(2), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 6, 10, -5, 10, -5, 6, -10, -6, 6, -5, 10, -4, -5, -10, -4, -5, 10, -5, -6, -5, 10, 6, -6, 10, -5}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 6, 10, -5, 10, -5, 6, -10, -6, 6, -5, 10, -4, -5, -10, -4, -5, 10, -5, -6, -5, 10, 6, -6, 10, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, e, 3, 0, -1, -2, 6, 4, 0}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "import math\n\nvalues = 9, math.e, 3, 0, -1, -2, 6, 4, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.144,0.111,0.057,0.057,0.133,0.104,0.067,0.11,0.17\\}$ and $\\{0.002,0.542,0.039,0.021,0.021,0.03,0.132,0.039,0.051\\}$.", - "Output Answer": [ - "$1.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.144, 0.111, 0.057, 0.057, 0.133, 0.104, 0.067, 0.11, 0.17\ndistribution2 = 0.002, 0.542, 0.039, 0.021, 0.021, 0.03, 0.132, 0.039, 0.051\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 9, 6.1, 5, 1, 4 \\sqrt{5}, -5} \\cup {-\\frac{11}{\\sqrt{2}}, -6, 9, 6.1, 1, 5, 0, -4, 8}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{2}}, -6, -5, -4, 0, 1, 5, 6.1, 8, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 9, 6.1, 5, 1, 4*math.sqrt(5), -5,))\nsnd = set((-(11/(math.sqrt(2))), -6, 9, 6.1, 1, 5, 0, -4, 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x^2+0.7 x+0.1$ where $x \\sim $ \\text{PoissonDistribution}[3.1]\n", - "Output Answer": [ - "$-26.96$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.1)\nprint(E(-2.3*x**2+0.7*x+0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.9 x^2-2.9 x-4.$ where $x \\sim $ \\text{NormalDistribution}[-0.9,2.9]\n", - "Output Answer": [ - "$-9.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.9, 2.9)\nprint(E(-0.9*x**2-2.9*x-4.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 7, 2, 2, -8, -8, 0, -1, 2, -9, 2, 7, -8, 2, 2, 7, -8, 9, 2, -8, 9, -8, -1, -8, -1, 2, 7, 10}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 7, 2, 2, -8, -8, 0, -1, 2, -9, 2, 7, -8, 2, 2, 7, -8, 9, 2, -8, 9, -8, -1, -8, -1, 2, 7, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{12}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -2 \\sqrt{5}, \\frac{8}{\\sqrt{5}}, 2 \\sqrt{5}, 2 \\sqrt{5}, -\\frac{12}{\\sqrt{5}}, -2 \\sqrt{5}, -\\frac{12}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, -2 \\sqrt{5}, -\\frac{12}{\\sqrt{5}}, 2 \\sqrt{5}, 2 \\sqrt{5}, -\\frac{12}{\\sqrt{5}}, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{12}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(12/(math.sqrt(5))), -(12/(math.sqrt(5))), (8/(math.sqrt(5))), (8/(math.sqrt(5))), -2*math.sqrt(5), (8/(math.sqrt(5))), 2*math.sqrt(5), 2*math.sqrt(5), -(12/(math.sqrt(5))), -2*math.sqrt(5), -(12/(math.sqrt(5))), -(12/(math.sqrt(5))), (8/(math.sqrt(5))), -(12/(math.sqrt(5))), -2*math.sqrt(5), -(12/(math.sqrt(5))), 2*math.sqrt(5), 2*math.sqrt(5), -(12/(math.sqrt(5))), 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, \\frac{47}{7}, 0}$.\n", - "Output Answer": [ - "${0, 3, \\frac{47}{7}}$" - ], - "Output Program": [ - "values = 3, (47/7), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -12 \\log (2), -2, 0, -9, \\frac{7}{2}} \\cup {-9, 9, 0, 4, -13 \\log (2), \\frac{7}{2}, -2}$.\n", - "Output Answer": [ - "${-13 \\log (2), -9, -12 \\log (2), -2, 0, \\frac{7}{2}, 4, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -12*math.log(2), -2, 0, -9, (7/2),))\nsnd = set((-9, 9, 0, 4, -13*math.log(2), (7/2), -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}, -6 \\sqrt{2}, 6 \\sqrt{2}, \\sqrt{2}, \\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{11}{4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 5*math.sqrt(2), (13/(math.sqrt(2))), -(3/(math.sqrt(2))), -(1/(math.sqrt(2))), -6*math.sqrt(2), 6*math.sqrt(2), math.sqrt(2), (1/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -8, -5, -4 \\sqrt{5}, 5, 6, 0, 4, -2 \\sqrt{3}, 5, \\frac{37}{5}, \\frac{26}{5}, 6 \\sqrt{2}, 0, -2}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -8, -5, -4*math.sqrt(5), 5, 6, 0, 4, -2*math.sqrt(3), 5, (37/5), (26/5), 6*math.sqrt(2), 0, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -2, 9, 2 \\sqrt{3}, -\\sqrt{3}, 2 \\sqrt{5}, 2 e, 4, -7, 9, 7 \\log (2)}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -2, 9, 2*math.sqrt(3), -math.sqrt(3), 2*math.sqrt(5), 2*math.e, 4, -7, 9, 7*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5 \\sqrt{2}, 2 \\sqrt{2}, \\frac{25}{3}, -3}$.", - "Output Answer": [ - "$\\frac{7}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5*math.sqrt(2), 2*math.sqrt(2), (25/3), -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x^2+1.3 x+4.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$6.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(3.4*x**2+1.3*x+4.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{3}{2}, 9}$.\n", - "Output Answer": [ - "$\\frac{18}{7}$" - ], - "Output Program": [ - "import statistics\nvalues = (3/2), 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 e, -3 e, 3 e, 2 e}$.\n", - "Output Answer": [ - "$\\frac{3 e}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.e, -3*math.e, 3*math.e, 2*math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, \\frac{2}{\\sqrt{\\pi }}, \\frac{44}{5}, -e, 8, 4, -5, 3 \\sqrt{3}} \\setminus {\\frac{2}{\\sqrt{\\pi }}, 2 e, \\frac{44}{5}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-8, -5, -e, 4, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, (2/(math.sqrt(math.pi))), (44/5), -math.e, 8, 4, -5, 3*math.sqrt(3),))\nsnd = set(((2/(math.sqrt(math.pi))), 2*math.e, (44/5), 3*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $2.8 x-0.5 < -2.4 x-0.3$ where $x \\sim $ \\text{ExponentialDistribution}[0.8].", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.8)\nprint(P((2.8*x-0.5 < -2.4*x-0.3)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^2+4.4 x-4.3$ where $x \\sim $ \\text{BetaDistribution}[1.,0.5]\n", - "Output Answer": [ - "$-3.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 0.5)\nprint(E(-3.9*x**2+4.4*x-4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{5}{2}, -\\frac{16}{\\sqrt{\\pi }}, -1, -\\frac{13}{\\sqrt{3}}, 0, 1, 4 \\sqrt{3}, -8}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -8, -\\frac{13}{\\sqrt{3}}, -\\frac{5}{2}, -1, 0, 1, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/2), -(16/(math.sqrt(math.pi))), -1, -(13/(math.sqrt(3))), 0, 1, 4*math.sqrt(3), -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\sqrt{2}, 8, -6, -\\frac{7}{2}, -7.64, \\frac{5}{2}, \\frac{36}{5}} \\cup {8, -7.64, \\frac{5}{2}, 10}$.\n", - "Output Answer": [ - "${-7.64, -6, -\\frac{7}{2}, -\\sqrt{2}, \\frac{5}{2}, \\frac{36}{5}, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(2), 8, -6, -(7/2), -7.64, (5/2), (36/5),))\nsnd = set((8, -7.64, (5/2), 10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 3, 0, -5, 5, -\\pi, -9, 2, -4 \\sqrt{2}, -4, \\frac{17}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, -8}$.\n", - "Output Answer": [ - "$9+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 3, 0, -5, 5, -math.pi, -9, 2, -4*math.sqrt(2), -4, (17/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, 1, 2, \\sqrt{2}, -2, \\frac{27}{7}, -4 \\sqrt{5}, -\\frac{4}{\\sqrt{\\pi }}, -4, -13 \\log (2), -5, 2, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{27}{7}+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 1, 2, math.sqrt(2), -2, (27/7), -4*math.sqrt(5), -(4/(math.sqrt(math.pi))), -4, -13*math.log(2), -5, 2, 2*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{19}{2}, 0, 8, 1, -7, 2 \\sqrt{5}, -10, -1}$.\n", - "Output Answer": [ - "${-10, -\\frac{19}{2}, -7, -1, 0, 1, 2 \\sqrt{5}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/2), 0, 8, 1, -7, 2*math.sqrt(5), -10, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 2, -7, -5, -8, -5, -7, -7, -8, -7, -7, 2, -7, -8, 7, 1, 2, -8, -3, 2, -8, -3, 7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 2, -7, -5, -8, -5, -7, -7, -8, -7, -7, 2, -7, -8, 7, 1, 2, -8, -3, 2, -8, -3, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 5, 9, 4, -5, 2, -10, -7}$.\n", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 5, 9, 4, -5, 2, -10, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 5, \\frac{2}{\\sqrt{\\pi }}, 2, \\frac{20}{\\pi }, 3, -\\frac{7}{\\sqrt{2}}, 1, -1, 0, 0, 0, -2}$.\n", - "Output Answer": [ - "$\\frac{7}{\\sqrt{2}}+\\frac{20}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 5, (2/(math.sqrt(math.pi))), 2, (20/math.pi), 3, -(7/(math.sqrt(2))), 1, -1, 0, 0, 0, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -6, 8, \\frac{5}{2}, 0, -\\frac{22}{e}, -2, \\frac{2}{\\sqrt{5}}, 7 \\sqrt{2}, -5, \\frac{14}{3}, 5 \\sqrt{2}, -10}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -6, 8, (5/2), 0, -(22/math.e), -2, (2/(math.sqrt(5))), 7*math.sqrt(2), -5, (14/3), 5*math.sqrt(2), -10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.155,0.064,0.026,0.156,0.067,0.159,0.151,0.042,0.119\\}$ and $\\{0.022,0.085,0.113,0.016,0.087,0.222,0.079,0.088,0.065\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.155, 0.064, 0.026, 0.156, 0.067, 0.159, 0.151, 0.042, 0.119\ndistribution2 = 0.022, 0.085, 0.113, 0.016, 0.087, 0.222, 0.079, 0.088, 0.065\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{27}{5}, 0, 9, 2.08, 2, 5, -9, 7} \\cup {-9, 2, 2.08, 3, 0, -6}$.\n", - "Output Answer": [ - "${-9, -6, -\\frac{27}{5}, 0, 2, 2.08, 3, 5, 7, 9}$" - ], - "Output Program": [ - "fst = set((-(27/5), 0, 9, 2.08, 2, 5, -9, 7,))\nsnd = set((-9, 2, 2.08, 3, 0, -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{4}{7}, 4, 8.577, 2 \\sqrt{2}} \\setminus {0.078, 0, 2 \\sqrt{2}, -\\frac{46}{7}, 1.364, 4}$.\n", - "Output Answer": [ - "${-\\frac{4}{7}, 8.577}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/7), 4, 8.577, 2*math.sqrt(2),))\nsnd = set((0.078, 0, 2*math.sqrt(2), -(46/7), 1.364, 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{13}{\\pi }, 2, \\frac{21}{\\pi }, 7, 8, -1, 1, -\\frac{3}{\\sqrt{\\pi }}, -10, 2 e}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(13/math.pi), 2, (21/math.pi), 7, 8, -1, 1, -(3/(math.sqrt(math.pi))), -10, 2*math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{3}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(3), -(10/(math.sqrt(3))), (8/(math.sqrt(3))), -(4/(math.sqrt(3))), math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{12}{e}, 9, -12 \\log (2), -\\frac{1}{2}, -5, 0, -\\frac{4}{\\pi }, -\\frac{12}{\\pi }}$.", - "Output Answer": [ - "$-\\frac{8}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(12/math.e), 9, -12*math.log(2), -(1/2), -5, 0, -(4/math.pi), -(12/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\pi, -3, -\\frac{51}{7}, -8 \\log (2), -\\frac{13}{3}, 1}$.\n", - "Output Answer": [ - "${-\\frac{51}{7}, -8 \\log (2), -\\frac{13}{3}, -3, 1, \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = math.pi, -3, -(51/7), -8*math.log(2), -(13/3), 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.5 x^3+3.9 x^2+0.5 x-3.1$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$48.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(1.5*x**3+3.9*x**2+0.5*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${14, 11, 1, 11}$.\n", - "Output Answer": [ - "$\\frac{129}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 11, 1, 11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -9, -3, 8, 0, 9, 0, 0, -5, 9, -5, 10, -3, -9, -5, -5, -7, 10, -9, 10, 0, -5, 0}$.\n", - "Output Answer": [ - "$\\{0,-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -9, -3, 8, 0, 9, 0, 0, -5, 9, -5, 10, -3, -9, -5, -5, -7, 10, -9, 10, 0, -5, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, 1, 1, 2, 14, -13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2801}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 1, 1, 2, 14, -13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\log (2), 7 \\log (2), -11 \\log (2), -5 \\log (2), -5 \\log (2), -5 \\log (2), 12 \\log (2), 7 \\log (2), -5 \\log (2), 8 \\log (2), -5 \\log (2), -5 \\log (2), 12 \\log (2), 12 \\log (2), -11 \\log (2), 8 \\log (2), 0, -5 \\log (2), 8 \\log (2), -5 \\log (2), -5 \\log (2), -5 \\log (2), -11 \\log (2), -5 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-5 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.log(2), 7*math.log(2), -11*math.log(2), -5*math.log(2), -5*math.log(2), -5*math.log(2), 12*math.log(2), 7*math.log(2), -5*math.log(2), 8*math.log(2), -5*math.log(2), -5*math.log(2), 12*math.log(2), 12*math.log(2), -11*math.log(2), 8*math.log(2), 0, -5*math.log(2), 8*math.log(2), -5*math.log(2), -5*math.log(2), -5*math.log(2), -11*math.log(2), -5*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{7}{5}, -1.289, \\frac{51}{7}, -7, 3, \\pi, -9, -\\frac{8}{5}} \\cup {-6.09, \\frac{37}{5}, -\\frac{12}{5}, \\pi, 2, -7, -\\frac{4}{7}, 3}$.\n", - "Output Answer": [ - "${-9, -7, -6.09, -\\frac{12}{5}, -\\frac{8}{5}, -\\frac{7}{5}, -1.289, -\\frac{4}{7}, 2, 3, \\pi, \\frac{51}{7}, \\frac{37}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(7/5), -1.289, (51/7), -7, 3, math.pi, -9, -(8/5),))\nsnd = set((-6.09, (37/5), -(12/5), math.pi, 2, -7, -(4/7), 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.054,0.026,0.27,0.083,0.088,0.23,0.127\\}$ and $\\{0.008,0.336,0.06,0.121,0.087,0.103,0.186\\}$.", - "Output Answer": [ - "$0.65$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.054, 0.026, 0.27, 0.083, 0.088, 0.23, 0.127\ndistribution2 = 0.008, 0.336, 0.06, 0.121, 0.087, 0.103, 0.186\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, -3, -9, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{2}, -7, -3}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -3, -9, -5*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{3}, \\frac{5}{3}, \\frac{49}{3}, 13}$.\n", - "Output Answer": [ - "$\\frac{235690}{48271}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/3), (5/3), (49/3), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 13, 3, 1, 5, 1}$.\n", - "Output Answer": [ - "$\\frac{869}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 13, 3, 1, 5, 1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7 \\sqrt{2}, 2, -6, 2, 5, -\\frac{9}{\\sqrt{2}}, -9, 4, 3, -7 \\sqrt{2}, -8, -\\frac{27}{e}, -\\frac{9}{\\sqrt{\\pi }}, 11 \\log (2)}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{27}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 7*math.sqrt(2), 2, -6, 2, 5, -(9/(math.sqrt(2))), -9, 4, 3, -7*math.sqrt(2), -8, -(27/math.e), -(9/(math.sqrt(math.pi))), 11*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x^2-3.9 x-0.6$ where $x \\sim $ \\text{ExponentialDistribution}[0.8]\n", - "Output Answer": [ - "$3.59$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.8)\nprint(E(2.9*x**2-3.9*x-0.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, 0, -9, 2}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, 0, -9, 2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-3.35 < -3.4 x-3.4 < -3.23$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6].", - "Output Answer": [ - "$0.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(P((-3.35 < -3.4*x-3.4) & (-3.4*x-3.4 < -3.23)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 18, \\frac{25}{2}}$.\n", - "Output Answer": [ - "$\\frac{1350}{511}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 18, (25/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6, \\frac{11}{4}, 8, 0}$.\n", - "Output Answer": [ - "${-6, 0, \\frac{11}{4}, 8}$" - ], - "Output Program": [ - "values = -6, (11/4), 8, 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7 \\log (2), 3, 5, 5, 5, -9, -3 \\pi, -5, -3 \\sqrt{2}, -4}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7*math.log(2), 3, 5, 5, 5, -9, -3*math.pi, -5, -3*math.sqrt(2), -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.044,0.081,0.408,0.291\\}$ and $\\{0.437,0.24,0.314,0.006\\}$.", - "Output Answer": [ - "$1.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.044, 0.081, 0.408, 0.291\ndistribution2 = 0.437, 0.24, 0.314, 0.006\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 4, \\frac{2}{\\sqrt{3}}, 1, 0} \\setminus {-3, 0}$.\n", - "Output Answer": [ - "${-6, 1, \\frac{2}{\\sqrt{3}}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 4, (2/(math.sqrt(3))), 1, 0,))\nsnd = set((-3, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, \\frac{13}{e}, 2, 8, 5 \\log (2), -1, -8} \\cup {-13 \\log (2), 2, -1, -2, -7, \\frac{9}{e}, 4}$.\n", - "Output Answer": [ - "${-13 \\log (2), -8, -7, -2, -1, 2, \\frac{9}{e}, 5 \\log (2), 4, \\frac{13}{e}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, (13/math.e), 2, 8, 5*math.log(2), -1, -8,))\nsnd = set((-13*math.log(2), 2, -1, -2, -7, (9/math.e), 4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, \\frac{25}{2}, 6, \\frac{33}{2}}$.\n", - "Output Answer": [ - "$\\frac{7700}{729}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, (25/2), 6, (33/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.194,0.044,0.173,0.036,0.139,0.13\\}$ and $\\{0.089,0.176,0.148,0.088,0.025,0.264,0.032\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.194, 0.044, 0.173, 0.036, 0.139, 0.13\ndistribution2 = 0.089, 0.176, 0.148, 0.088, 0.025, 0.264, 0.032\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 4 \\sqrt{2}, -\\frac{15}{\\pi }, 4, -2, -\\frac{3}{\\pi }, -3, -5, -10, -\\frac{6}{\\sqrt{\\pi }}, -\\pi, -4, 1}$.\n", - "Output Answer": [ - "$10+4 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 4*math.sqrt(2), -(15/math.pi), 4, -2, -(3/math.pi), -3, -5, -10, -(6/(math.sqrt(math.pi))), -math.pi, -4, 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.12,0.084,0.042,0.11,0.081,0.082,0.055,0.052,0.095,0.175\\}$ and $\\{0.105,0.11,0.165,0.066,0.037,0.067,0.155,0.114,0.042,0.088\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.12, 0.084, 0.042, 0.11, 0.081, 0.082, 0.055, 0.052, 0.095, 0.175\ndistribution2 = 0.105, 0.11, 0.165, 0.066, 0.037, 0.067, 0.155, 0.114, 0.042, 0.088\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -\\frac{37}{4}, -4, \\frac{9}{2}, -\\frac{15}{2}, \\frac{37}{4}, -\\frac{7}{2}, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$-\\frac{11}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -(37/4), -4, (9/2), -(15/2), (37/4), -(7/2), (17/2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, -2, 0, \\frac{11}{4}, 6, -3, -3}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -2, 0, (11/4), 6, -3, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.124,0.127,0.094,0.068,0.059,0.032,0.085,0.086,0.048,0.208\\}$ and $\\{0.211,0.044,0.105,0.076,0.13,0.063,0.053,0.044,0.126,0.026\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.124, 0.127, 0.094, 0.068, 0.059, 0.032, 0.085, 0.086, 0.048, 0.208\ndistribution2 = 0.211, 0.044, 0.105, 0.076, 0.13, 0.063, 0.053, 0.044, 0.126, 0.026\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{39}{7}, \\frac{41}{7}, -\\frac{39}{7}, 1, 4, 4, -\\frac{39}{7}, \\frac{41}{7}, -\\frac{22}{7}, 4, -\\frac{39}{7}, 1, \\frac{41}{7}, -\\frac{22}{7}, 1, \\frac{41}{7}, \\frac{41}{7}, 4, -\\frac{39}{7}, 4, 1, -\\frac{39}{7}, -\\frac{39}{7}, 4, -\\frac{39}{7}, -\\frac{22}{7}, -\\frac{39}{7}, 1, -\\frac{39}{7}, 1}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{39}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(39/7), (41/7), -(39/7), 1, 4, 4, -(39/7), (41/7), -(22/7), 4, -(39/7), 1, (41/7), -(22/7), 1, (41/7), (41/7), 4, -(39/7), 4, 1, -(39/7), -(39/7), 4, -(39/7), -(22/7), -(39/7), 1, -(39/7), 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\pi, 8, -5, -8, -\\frac{33}{5}} \\setminus {8, -8.213, -8, 3, -\\frac{33}{5}, 2 \\pi}$.\n", - "Output Answer": [ - "${-5}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.pi, 8, -5, -8, -(33/5),))\nsnd = set((8, -8.213, -8, 3, -(33/5), 2*math.pi,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 14}$.\n", - "Output Answer": [ - "$\\frac{308}{25}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2.1, -2, -10, -1.33, -3, \\frac{11}{5}, 1, \\frac{25}{4}} \\cup {-1.33, \\frac{11}{5}, 0.7, -10, -6, -7, -2, -3}$.\n", - "Output Answer": [ - "${-10, -7, -6, -3, -2.1, -2, -1.33, 0.7, 1, \\frac{11}{5}, \\frac{25}{4}}$" - ], - "Output Program": [ - "fst = set((-2.1, -2, -10, -1.33, -3, (11/5), 1, (25/4),))\nsnd = set((-1.33, (11/5), 0.7, -10, -6, -7, -2, -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-10, \\frac{4}{\\sqrt{3}}, -1, 8, \\frac{29}{5}, 9, -7, 8, 10, -\\frac{20}{\\pi }, -2 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{4}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, (4/(math.sqrt(3))), -1, 8, (29/5), 9, -7, 8, 10, -(20/math.pi), -2*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, -1024, 256, -243, 16}$.\n", - "Output Answer": [ - "$48\\ 2^{2/5} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, -1024, 256, -243, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{17}{3}, \\frac{4}{3}, 13, 11}$.\n", - "Output Answer": [ - "$\\frac{38896}{10641}$" - ], - "Output Program": [ - "import statistics\nvalues = (17/3), (4/3), 13, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.13,0.08,0.123,0.106,0.114,0.077,0.025,0.046,0.082,0.076\\}$ and $\\{0.098,0.013,0.106,0.064,0.107,0.067,0.035,0.133,0.246,0.126\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.13, 0.08, 0.123, 0.106, 0.114, 0.077, 0.025, 0.046, 0.082, 0.076\ndistribution2 = 0.098, 0.013, 0.106, 0.064, 0.107, 0.067, 0.035, 0.133, 0.246, 0.126\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 16, 1, -125, 216, 6}$.\n", - "Output Answer": [ - "$2 \\sqrt[6]{-1} \\sqrt[3]{2} \\sqrt{5} 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 16, 1, -125, 216, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.5 x^3-1.1 x^2+3.9 x-0.2$ where $x \\sim $ \\text{BetaDistribution}[0.5,1.1]\n", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.5, 1.1)\nprint(E(-1.5*x**3-1.1*x**2+3.9*x-0.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{3}, -\\sqrt{3}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{4}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(3), -math.sqrt(3), -4*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{8}{\\sqrt{3}}, 4, -\\frac{1}{\\sqrt{\\pi }}, 0} \\setminus {2 \\sqrt{5}, 5, -\\frac{1}{\\sqrt{\\pi }}, -\\frac{2}{\\pi }, -4, -8, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${0, 4, \\frac{8}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((8/(math.sqrt(3))), 4, -(1/(math.sqrt(math.pi))), 0,))\nsnd = set((2*math.sqrt(5), 5, -(1/(math.sqrt(math.pi))), -(2/math.pi), -4, -8, -math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, -16807, 216, 16, -243}$.\n", - "Output Answer": [ - "$84\\ 3^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -16807, 216, 16, -243\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10, -2.189, -8, -2 \\log (2), -3.75, -1} \\setminus {-2 \\log (2), 3.519, -8, -3.75, 10}$.\n", - "Output Answer": [ - "${-2.189, -1}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, -2.189, -8, -2*math.log(2), -3.75, -1,))\nsnd = set((-2*math.log(2), 3.519, -8, -3.75, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${10, 8.796, -3, 3 \\sqrt{5}, 2, -\\frac{3}{e}}$.\n", - "Output Answer": [ - "${-3, -\\frac{3}{e}, 2, 3 \\sqrt{5}, 8.796, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 8.796, -3, 3*math.sqrt(5), 2, -(3/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, -4, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -4, 3}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -4, -3*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.016,0.111,0.002,0.173,0.428,0.26\\}$ and $\\{0.225,0.015,0.102,0.162,0.047,0.138\\}$.", - "Output Answer": [ - "$0.94$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.016, 0.111, 0.002, 0.173, 0.428, 0.26\ndistribution2 = 0.225, 0.015, 0.102, 0.162, 0.047, 0.138\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{22}{e}, \\frac{6}{e}, \\frac{25}{e}, -\\frac{7}{e}, -\\frac{22}{e}, \\frac{6}{e}, \\frac{25}{e}, \\frac{25}{e}, \\frac{6}{e}, \\frac{25}{e}, -\\frac{22}{e}, -\\frac{16}{e}, \\frac{25}{e}, -\\frac{22}{e}, -\\frac{22}{e}, \\frac{25}{e}, \\frac{6}{e}, -\\frac{16}{e}, \\frac{25}{e}, \\frac{21}{e}, -\\frac{7}{e}, \\frac{21}{e}, -\\frac{22}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{25}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(22/math.e), (6/math.e), (25/math.e), -(7/math.e), -(22/math.e), (6/math.e), (25/math.e), (25/math.e), (6/math.e), (25/math.e), -(22/math.e), -(16/math.e), (25/math.e), -(22/math.e), -(22/math.e), (25/math.e), (6/math.e), -(16/math.e), (25/math.e), (21/math.e), -(7/math.e), (21/math.e), -(22/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{15}{4}, \\frac{25}{4}, \\frac{33}{4}, \\frac{7}{4}, 8, -\\frac{35}{4}, \\frac{7}{4}, 1}$.\n", - "Output Answer": [ - "$\\frac{29}{16}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(15/4), (25/4), (33/4), (7/4), 8, -(35/4), (7/4), 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.048,0.313,0.043,0.045,0.064,0.158,0.144,0.044,0.055\\}$ and $\\{0.167,0.093,0.113,0.146,0.086,0.105,0.115,0.068,0.065\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.048, 0.313, 0.043, 0.045, 0.064, 0.158, 0.144, 0.044, 0.055\ndistribution2 = 0.167, 0.093, 0.113, 0.146, 0.086, 0.105, 0.115, 0.068, 0.065\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -7, -4, -3, -2, 6, 3, -10}$.\n", - "Output Answer": [ - "$-\\frac{21}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -7, -4, -3, -2, 6, 3, -10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -7, -2, -2, 4, -3, 4, -7, -3, -3, -2, -3, 4, -3, -3, -3, -3, -3, -3, -3, -2, -3, -3, 4, -7, 4, -3, -7}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -7, -2, -2, 4, -3, 4, -7, -3, -3, -2, -3, 4, -3, -3, -3, -3, -3, -3, -3, -2, -3, -3, 4, -7, 4, -3, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x-1.6$ where $x \\sim $ \\text{NormalDistribution}[-1.6,2.9]\n", - "Output Answer": [ - "$-3.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 2.9)\nprint(E(1.*x-1.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1.17, -1, 2, 4, 2, 3, 8}$.\n", - "Output Answer": [ - "${-1.17, -1, 2, 2, 3, 4, 8}$" - ], - "Output Program": [ - "values = -1.17, -1, 2, 4, 2, 3, 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{10}{\\sqrt{3}}, -6, 5 \\sqrt{3}, -\\frac{4}{\\sqrt{3}}, 2 \\sqrt{2}, 4 \\sqrt{3}, -7, -9, 3}$.", - "Output Answer": [ - "$2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (10/(math.sqrt(3))), -6, 5*math.sqrt(3), -(4/(math.sqrt(3))), 2*math.sqrt(2), 4*math.sqrt(3), -7, -9, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x-3.2$ where $x \\sim $ \\text{BetaDistribution}[1.5,1.9]\n", - "Output Answer": [ - "$-2.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 1.9)\nprint(E(2.2*x-3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x+0.3$ where $x \\sim $ \\text{PoissonDistribution}[2.6]\n", - "Output Answer": [ - "$5.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.6)\nprint(E(2.1*x+0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 117649, 27, -1, 81, 7776}$.\n", - "Output Answer": [ - "$126 \\sqrt[6]{-1} \\sqrt[3]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 117649, 27, -1, 81, 7776\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 16, 10}$.\n", - "Output Answer": [ - "$\\frac{240}{23}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 16, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.5 x+3.2$ where $x \\sim $ \\text{NormalDistribution}[-0.8,0.8]\n", - "Output Answer": [ - "$2.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 0.8)\nprint(E(1.5*x+3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{2}, \\frac{13}{\\sqrt{2}}, -5 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$-\\frac{3}{2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(2), (13/(math.sqrt(2))), -5*math.sqrt(2), -(7/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 0, -\\frac{19}{7}, e, -8}$.\n", - "Output Answer": [ - "$8+e$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 0, -(19/7), math.e, -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{6}{\\sqrt{\\pi }}, -9, -\\frac{4}{\\sqrt{5}}, 8, -\\frac{37}{7}, -\\frac{19}{e}, 9, -5, -\\sqrt{5}, -2 \\sqrt{2}, -3 e, -3 \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-5-2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (6/(math.sqrt(math.pi))), -9, -(4/(math.sqrt(5))), 8, -(37/7), -(19/math.e), 9, -5, -math.sqrt(5), -2*math.sqrt(2), -3*math.e, -3*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, -2.466, 5.48, -\\frac{14}{5}, 4.02}$.\n", - "Output Answer": [ - "${-\\frac{14}{5}, -2.466, 4.02, 5.48, 7}$" - ], - "Output Program": [ - "values = 7, -2.466, 5.48, -(14/5), 4.02\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 13, 11}$.\n", - "Output Answer": [ - "$76$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 13, 11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 19, 9}$.\n", - "Output Answer": [ - "$\\frac{4104}{395}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 19, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, 5, -7, \\frac{8}{5}}$.\n", - "Output Answer": [ - "${-7, \\frac{8}{5}, 5, 5}$" - ], - "Output Program": [ - "values = 5, 5, -7, (8/5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, 6, -\\frac{7}{2}, 4} \\setminus {1, -3.2, -\\frac{7}{2}, -8, -\\sqrt{2}}$.\n", - "Output Answer": [ - "${0, 4, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 6, -(7/2), 4,))\nsnd = set((1, -3.2, -(7/2), -8, -math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 9, -9 \\log (2), -4, \\frac{17}{5}, 2, \\frac{11}{\\sqrt{2}}, 0, 4, -e, -2 \\sqrt{5}, 2 \\sqrt{3}, \\sqrt{5}, \\frac{2}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$9+9 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 9, -9*math.log(2), -4, (17/5), 2, (11/(math.sqrt(2))), 0, 4, -math.e, -2*math.sqrt(5), 2*math.sqrt(3), math.sqrt(5), (2/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{20}{3}, \\frac{26}{3}, \\frac{23}{3}, 2}$.\n", - "Output Answer": [ - "$\\frac{23920}{5357}$" - ], - "Output Program": [ - "import statistics\nvalues = (20/3), (26/3), (23/3), 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, -5, -\\frac{1}{\\pi }, \\frac{1}{\\sqrt{\\pi }}, 9, 8, 0, -4, -\\frac{1}{\\sqrt{2}}, 8}$.", - "Output Answer": [ - "$\\frac{1}{2 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -5, -(1/math.pi), (1/(math.sqrt(math.pi))), 9, 8, 0, -4, -(1/(math.sqrt(2))), 8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{3}, 4 \\sqrt{3}, -6 \\sqrt{3}, 5 \\sqrt{3}, -6 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, -2 \\sqrt{3}, -6 \\sqrt{3}, 4 \\sqrt{3}, -6 \\sqrt{3}, 4 \\sqrt{3}, 4 \\sqrt{3}, 2 \\sqrt{3}, -2 \\sqrt{3}, 4 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(3), 4*math.sqrt(3), -6*math.sqrt(3), 5*math.sqrt(3), -6*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), -2*math.sqrt(3), -6*math.sqrt(3), 4*math.sqrt(3), -6*math.sqrt(3), 4*math.sqrt(3), 4*math.sqrt(3), 2*math.sqrt(3), -2*math.sqrt(3), 4*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 4*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, -3, 9, \\frac{1}{2}, -8, 7}$.\n", - "Output Answer": [ - "${-8, -3, \\frac{1}{2}, 5, 7, 9}$" - ], - "Output Program": [ - "values = 5, -3, 9, (1/2), -8, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 2, 16}$.\n", - "Output Answer": [ - "$\\frac{432}{89}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 2, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{14}{\\sqrt{\\pi }}, 8, 1, 2 e, -\\pi, -3 \\pi, -\\frac{41}{7}, -9, -\\frac{11}{e}, 6, -\\frac{11}{2}, \\frac{47}{5}}$.", - "Output Answer": [ - "$\\frac{1-\\pi }{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (14/(math.sqrt(math.pi))), 8, 1, 2*math.e, -math.pi, -3*math.pi, -(41/7), -9, -(11/math.e), 6, -(11/2), (47/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{8}{3}, 6, -\\sqrt{5}} \\setminus {8.8, -5, \\frac{19}{\\sqrt{5}}, -\\pi, -4, -\\frac{8}{3}}$.\n", - "Output Answer": [ - "${-\\sqrt{5}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(8/3), 6, -math.sqrt(5),))\nsnd = set((8.8, -5, (19/(math.sqrt(5))), -math.pi, -4, -(8/3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -6, 0, 6, -3} \\cup {8, -3, 0, -6, -1}$.\n", - "Output Answer": [ - "${-6, -3, -1, 0, 6, 8}$" - ], - "Output Program": [ - "fst = set((-1, -6, 0, 6, -3,))\nsnd = set((8, -3, 0, -6, -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 16, 10, 16}$.\n", - "Output Answer": [ - "$\\frac{480}{67}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 16, 10, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.9 x^2-4.4 x-3.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.2]\n", - "Output Answer": [ - "$-8.42$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(E(-0.9*x**2-4.4*x-3.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{8}{\\sqrt{\\pi }}, -4 \\sqrt{2}, \\frac{11}{2}}$.", - "Output Answer": [ - "$-\\frac{8}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(8/(math.sqrt(math.pi))), -4*math.sqrt(2), (11/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{27}{2}, \\frac{17}{2}, \\frac{11}{2}, \\frac{29}{2}}$.\n", - "Output Answer": [ - "$\\frac{146421}{16198}$" - ], - "Output Program": [ - "import statistics\nvalues = (27/2), (17/2), (11/2), (29/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, 0, 6}$.\n", - "Output Answer": [ - "$\\frac{52}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 0, 6\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, 3 \\sqrt{3}, -3, 5, 0, \\frac{31}{\\pi }, \\frac{13}{\\pi }, 3}$.\n", - "Output Answer": [ - "${-3, 0, 1, 3, \\frac{13}{\\pi }, 5, 3 \\sqrt{3}, \\frac{31}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 3*math.sqrt(3), -3, 5, 0, (31/math.pi), (13/math.pi), 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x^2+4.6 x+1.3$ where $x \\sim $ \\text{BetaDistribution}[0.3,0.5]\n", - "Output Answer": [ - "$3.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 0.5)\nprint(E(2.3*x**2+4.6*x+1.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.094,0.283,0.019,0.038\\}$ and $\\{0.194,0.1,0.3,0.364\\}$.", - "Output Answer": [ - "$0.99$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.094, 0.283, 0.019, 0.038\ndistribution2 = 0.194, 0.1, 0.3, 0.364\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\sqrt{5}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{14}{3}, -3, -\\frac{7}{\\sqrt{2}}, \\frac{23}{\\pi }} \\setminus {-2, \\frac{23}{\\pi }, -\\frac{6}{\\sqrt{\\pi }}, 3, -\\frac{14}{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -\\frac{7}{\\sqrt{2}}, -3, \\frac{14}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), (14/(math.sqrt(math.pi))), -(14/3), -3, -(7/(math.sqrt(2))), (23/math.pi),))\nsnd = set((-2, (23/math.pi), -(6/(math.sqrt(math.pi))), 3, -(14/3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.047,0.04,0.14,0.137,0.481\\}$ and $\\{0.255,0.162,0.079,0.121,0.195,0.053\\}$.", - "Output Answer": [ - "$0.75$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.047, 0.04, 0.14, 0.137, 0.481\ndistribution2 = 0.255, 0.162, 0.079, 0.121, 0.195, 0.053\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 3, 1, -1, 7, 3, -5}$.\n", - "Output Answer": [ - "$\\frac{5}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 3, 1, -1, 7, 3, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, 9, -8, \\frac{20}{3}, -\\frac{66}{7}, 9 \\log (2), -2} \\cup {-8, -2, -5, \\frac{20}{3}, \\frac{15}{7}, 9 \\log (2), 9}$.\n", - "Output Answer": [ - "${-\\frac{66}{7}, -8, -5, -2, \\frac{15}{7}, 9 \\log (2), \\frac{20}{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 9, -8, (20/3), -(66/7), 9*math.log(2), -2,))\nsnd = set((-8, -2, -5, (20/3), (15/7), 9*math.log(2), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{15}{2}, -1, \\frac{11}{2}, \\frac{11}{2}, -9, \\frac{11}{2}, \\frac{11}{2}, \\frac{15}{2}, -1, \\frac{11}{2}, -\\frac{11}{2}, -9, -1, -9, -1, \\frac{11}{2}, \\frac{11}{2}, -\\frac{11}{2}, -\\frac{11}{2}, -9, \\frac{15}{2}, \\frac{11}{2}, \\frac{15}{2}, \\frac{11}{2}, -3, -\\frac{11}{2}, \\frac{15}{2}, \\frac{11}{2}, -9, -1}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{11}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (15/2), -1, (11/2), (11/2), -9, (11/2), (11/2), (15/2), -1, (11/2), -(11/2), -9, -1, -9, -1, (11/2), (11/2), -(11/2), -(11/2), -9, (15/2), (11/2), (15/2), (11/2), -3, -(11/2), (15/2), (11/2), -9, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 2, 9}$.\n", - "Output Answer": [ - "$\\frac{9}{2}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 2, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{39}{2}, 14, 8, 15}$.\n", - "Output Answer": [ - "$\\frac{43680}{3433}$" - ], - "Output Program": [ - "import statistics\nvalues = (39/2), 14, 8, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, \\frac{15}{2}, 16}$.\n", - "Output Answer": [ - "$\\frac{720}{107}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, (15/2), 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -3, 1, 8, 1, -5, -3, 3, 1, 3, 1, 8, -4, -3, 1, 8, -3, -5, 8, 8, 8, 1, 8, -4, 8, 8, -3, -4, 8}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -3, 1, 8, 1, -5, -3, 3, 1, 3, 1, 8, -4, -3, 1, 8, -3, -5, 8, 8, 8, 1, 8, -4, 8, 8, -3, -4, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 9, 8, 1}$.\n", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 9, 8, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 7}$.\n", - "Output Answer": [ - "$\\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-5. x^2-1.9 x+4.3$ where $x \\sim $ \\text{PoissonDistribution}[3.3]\n", - "Output Answer": [ - "$-72.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.3)\nprint(E(-5.*x**2-1.9*x+4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, \\frac{1}{2}, 4 \\sqrt{5}, -9, -9 \\log (2), -1, 4, 0, -3, -9, -1}$.\n", - "Output Answer": [ - "$9+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, (1/2), 4*math.sqrt(5), -9, -9*math.log(2), -1, 4, 0, -3, -9, -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 e, -3.3, -\\frac{12}{\\sqrt{\\pi }}, -5, 9, -\\frac{17}{4}} \\setminus {\\frac{39}{4}, 2 e, 9, -\\frac{12}{\\sqrt{\\pi }}, -3.3}$.\n", - "Output Answer": [ - "${-5, -\\frac{17}{4}, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.e, -3.3, -(12/(math.sqrt(math.pi))), -5, 9, -(17/4),))\nsnd = set(((39/4), 2*math.e, 9, -(12/(math.sqrt(math.pi))), -3.3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, -\\frac{21}{\\sqrt{5}}, -8} \\setminus {6, 2, \\frac{3}{\\sqrt{5}}, -8, -2, -6, -\\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${8}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -(21/(math.sqrt(5))), -8,))\nsnd = set((6, 2, (3/(math.sqrt(5))), -8, -2, -6, -(21/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{19}{3}, -2 \\sqrt{2}, 2, \\frac{7}{\\sqrt{2}}, 0, 6 \\sqrt{3}} \\setminus {-9, 6 \\sqrt{3}, 1, \\frac{19}{3}, 2, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{2}, 0, \\frac{7}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((19/3), -2*math.sqrt(2), 2, (7/(math.sqrt(2))), 0, 6*math.sqrt(3),))\nsnd = set((-9, 6*math.sqrt(3), 1, (19/3), 2, 5*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2 \\sqrt{3}, \\frac{11}{\\sqrt{\\pi }}, -e, -\\frac{16}{\\sqrt{\\pi }}, \\frac{37}{4}, -\\frac{2}{\\sqrt{5}}, 9, \\frac{14}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -2 \\sqrt{3}, -e, -\\frac{2}{\\sqrt{5}}, \\frac{14}{\\pi }, \\frac{11}{\\sqrt{\\pi }}, 9, \\frac{37}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(3), (11/(math.sqrt(math.pi))), -math.e, -(16/(math.sqrt(math.pi))), (37/4), -(2/(math.sqrt(5))), 9, (14/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.153,0.182,0.137,0.31,0.133\\}$ and $\\{0.078,0.169,0.161,0.227,0.059\\}$.", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.153, 0.182, 0.137, 0.31, 0.133\ndistribution2 = 0.078, 0.169, 0.161, 0.227, 0.059\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 2, 1}$.\n", - "Output Answer": [ - "$\\frac{90}{47}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 2, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{18}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{21}{2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (18/(math.sqrt(5))), (3/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -3, 4, -4, 9, -7}$.\n", - "Output Answer": [ - "$-\\frac{5}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -3, 4, -4, 9, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, \\frac{1}{2}, \\frac{9}{\\pi }, -3, \\frac{3}{7}, \\frac{4}{\\pi }, 3, -8, -5 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{3}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, (1/2), (9/math.pi), -3, (3/7), (4/math.pi), 3, -8, -5*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 5, 9, -7, 8, -1, -7, -7, 8, -1, 8, 5, -1, 5, 5, 8, -1, 8, -1, 8, 9}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 5, 9, -7, 8, -1, -7, -7, 8, -1, 8, 5, -1, 5, 5, 8, -1, 8, -1, 8, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x+1.3$ where $x \\sim $ \\text{PoissonDistribution}[3.]\n", - "Output Answer": [ - "$8.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.)\nprint(E(2.4*x+1.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, -8, -7, \\frac{10}{\\pi }, -\\frac{8}{e}, 3, 2, 2 \\sqrt{5}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -8, -7, (10/math.pi), -(8/math.e), 3, 2, 2*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{6}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(13/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 14, 4}$.\n", - "Output Answer": [ - "$\\frac{420}{59}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 14, 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x-3.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.1]\n", - "Output Answer": [ - "$-23.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.1)\nprint(E(-2.*x-3.5))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{18}{\\pi }, -1, 3, 3 e, 7, -3} \\setminus {-1, -3, 5, 0, 3 e, 3}$.\n", - "Output Answer": [ - "${-\\frac{18}{\\pi }, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(18/math.pi), -1, 3, 3*math.e, 7, -3,))\nsnd = set((-1, -3, 5, 0, 3*math.e, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6 \\sqrt{2}, 1, -6, 2}$.", - "Output Answer": [ - "$-\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6*math.sqrt(2), 1, -6, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.056,0.095,0.798,0.027\\}$ and $\\{0.19,0.025,0.285,0.083\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.056, 0.095, 0.798, 0.027\ndistribution2 = 0.19, 0.025, 0.285, 0.083\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{5}, 0, -\\sqrt{5}, 2 \\sqrt{5}, -2 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 0, 2 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, 0, -2 \\sqrt{5}, 0, -4 \\sqrt{5}, 0, -2 \\sqrt{5}, 0, -4 \\sqrt{5}, 0, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(5), 0, -math.sqrt(5), 2*math.sqrt(5), -2*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 0, 2*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), 0, -2*math.sqrt(5), 0, -4*math.sqrt(5), 0, -2*math.sqrt(5), 0, -4*math.sqrt(5), 0, 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 e, 3 e, 3 e, 4 e, e}$.\n", - "Output Answer": [ - "$3 e$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.e, 3*math.e, 3*math.e, 4*math.e, math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{16}{3}, 8}$.\n", - "Output Answer": [ - "${-\\frac{16}{3}, 8}$" - ], - "Output Program": [ - "values = -(16/3), 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -3, -7, -5, -\\frac{5}{2}, 6, -3 \\sqrt{2}, 8} \\setminus {5, 2 \\pi, -3 \\sqrt{2}, -3, 8, -7, 6}$.\n", - "Output Answer": [ - "${-5, -\\frac{5}{2}, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -3, -7, -5, -(5/2), 6, -3*math.sqrt(2), 8,))\nsnd = set((5, 2*math.pi, -3*math.sqrt(2), -3, 8, -7, 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, -1, -5, -3 e, 8, -2 \\sqrt{2}} \\setminus {-5, \\sqrt{2}, 7, 8}$.\n", - "Output Answer": [ - "${-3 e, -2 \\sqrt{2}, -1}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -1, -5, -3*math.e, 8, -2*math.sqrt(2),))\nsnd = set((-5, math.sqrt(2), 7, 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{2}, \\frac{9}{2}, 8, 0, \\frac{9}{2}}$.\n", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(2), (9/2), 8, 0, (9/2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.8 x^3+4.7 x^2+0.5 x-1.$ where $x \\sim $ \\text{PoissonDistribution}[1.3]\n", - "Output Answer": [ - "$-18.85$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.3)\nprint(E(-3.8*x**3+4.7*x**2+0.5*x-1.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x^2-1.1 x+0.3$ where $x \\sim $ \\text{ExponentialDistribution}[0.9]\n", - "Output Answer": [ - "$2.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.9)\nprint(E(1.4*x**2-1.1*x+0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, 8, -4}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, 8, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, -8, \\frac{4}{\\pi }, 7.85} \\setminus {\\frac{4}{\\pi }, 5, \\sqrt{3}, 4 \\sqrt{5}, -3}$.\n", - "Output Answer": [ - "${-8, 7.85}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -8, (4/math.pi), 7.85,))\nsnd = set(((4/math.pi), 5, math.sqrt(3), 4*math.sqrt(5), -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6, -2, -\\frac{17}{2}, -5, -7, 6.4, 5} \\cup {-5, -\\frac{17}{2}, 6, -6, -7, 7.1}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, -7, -6, -5, -2, 5, 6, 6.4, 7.1}$" - ], - "Output Program": [ - "fst = set((6, -2, -(17/2), -5, -7, 6.4, 5,))\nsnd = set((-5, -(17/2), 6, -6, -7, 7.1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{17}{2}, 1, \\frac{21}{e}, -10, 3}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(17/2), 1, (21/math.e), -10, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -7, 10, 10, 1, 0, 0, -7, -7, 1, 1, -7, -7, -7, 3, 10, 10, 10, 10, 3, 1, 10, 10, 3, 10, -7}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -7, 10, 10, 1, 0, 0, -7, -7, 1, 1, -7, -7, -7, 3, 10, 10, 10, 10, 3, 1, 10, 10, 3, 10, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{17}{2}, -\\frac{5}{4}, \\frac{23}{4}, \\frac{9}{4}, \\frac{39}{4}, \\frac{13}{2}, \\frac{9}{2}, -9}$.\n", - "Output Answer": [ - "$\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(17/2), -(5/4), (23/4), (9/4), (39/4), (13/2), (9/2), -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, 11 \\log (2), 0, 1.64}$.\n", - "Output Answer": [ - "${-4, 0, 1.64, 11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 11*math.log(2), 0, 1.64\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, 5, 3, \\frac{5}{\\sqrt{\\pi }}, -6, 6, -2}$.", - "Output Answer": [ - "$\\frac{5}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, 5, 3, (5/(math.sqrt(math.pi))), -6, 6, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.092,0.113,0.157,0.058,0.238,0.111,0.044,0.035,0.085\\}$ and $\\{0.082,0.133,0.11,0.04,0.172,0.068,0.071,0.127,0.12\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.092, 0.113, 0.157, 0.058, 0.238, 0.111, 0.044, 0.035, 0.085\ndistribution2 = 0.082, 0.133, 0.11, 0.04, 0.172, 0.068, 0.071, 0.127, 0.12\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, \\frac{13}{\\sqrt{3}}, 9}$.", - "Output Answer": [ - "$\\frac{13}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, (13/(math.sqrt(3))), 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -5 \\sqrt{3}, -\\frac{39}{7}, 2 \\log (2), 3.4, 2 \\sqrt{2}, \\frac{16}{\\sqrt{3}}, 6} \\cup {-\\frac{39}{7}, -8 \\log (2), -1, 5 \\sqrt{2}, -\\sqrt{3}, 3.4, 6}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -6, -\\frac{39}{7}, -8 \\log (2), -\\sqrt{3}, -1, 2 \\log (2), 2 \\sqrt{2}, 3.4, 6, 5 \\sqrt{2}, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -5*math.sqrt(3), -(39/7), 2*math.log(2), 3.4, 2*math.sqrt(2), (16/(math.sqrt(3))), 6,))\nsnd = set((-(39/7), -8*math.log(2), -1, 5*math.sqrt(2), -math.sqrt(3), 3.4, 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -2, -9, -2, 0, 10, -9, 0, 10, 6, 0, -9, -9, 3, 6, 3, -9, 0, 3, 10, -9, 0, 10, -9, 3, -2, -9}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -2, -9, -2, 0, 10, -9, 0, 10, 6, 0, -9, -9, 3, 6, 3, -9, 0, 3, 10, -9, 0, 10, -9, 3, -2, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{40}{7}, -\\frac{1}{\\sqrt{3}}, \\sqrt{5}, 6, 3 \\sqrt{5}, 3, -4}$.", - "Output Answer": [ - "$\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(40/7), -(1/(math.sqrt(3))), math.sqrt(5), 6, 3*math.sqrt(5), 3, -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, 5, -7, -10, \\frac{29}{4}, -1.4, 6.47} \\cup {-4, \\frac{9}{4}, -2, 6.47, 6.4, 4, -7}$.\n", - "Output Answer": [ - "${-10, -7, -4, -2, -1.4, \\frac{9}{4}, 4, 5, 6.4, 6.47, \\frac{29}{4}}$" - ], - "Output Program": [ - "fst = set((4, 5, -7, -10, (29/4), -1.4, 6.47,))\nsnd = set((-4, (9/4), -2, 6.47, 6.4, 4, -7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -\\frac{2}{\\sqrt{5}}, 3 \\sqrt{5}, -6} \\setminus {-2 \\sqrt{5}, 4, 3, -6}$.\n", - "Output Answer": [ - "${-\\frac{2}{\\sqrt{5}}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -(2/(math.sqrt(5))), 3*math.sqrt(5), -6,))\nsnd = set((-2*math.sqrt(5), 4, 3, -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.387,0.045,0.19\\}$ and $\\{0.387,0.434,0.145\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.387, 0.045, 0.19\ndistribution2 = 0.387, 0.434, 0.145\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, -9, -14, 13, 4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1133}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -9, -14, 13, 4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.5 x-1.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-1.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(-2.5*x-1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\pi, 0, 2}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.pi, 0, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.314,0.101,0.081\\}$ and $\\{0.116,0.149,0.611\\}$.", - "Output Answer": [ - "$0.79$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.314, 0.101, 0.081\ndistribution2 = 0.116, 0.149, 0.611\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4 e, -\\frac{23}{\\pi }, 0, -7, -9, -1} \\setminus {9, -\\frac{23}{\\pi }, -7, -9, 6 \\sqrt{2}, 4 e, -1, -8}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.e, -(23/math.pi), 0, -7, -9, -1,))\nsnd = set((9, -(23/math.pi), -7, -9, 6*math.sqrt(2), 4*math.e, -1, -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, -6, 7.265, 4, -4.8, -\\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-7, -\\frac{9}{\\sqrt{2}}, -6, -4.8, 4, 7.265}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -6, 7.265, 4, -4.8, -(9/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.1,0.139,0.071,0.132,0.047,0.254,0.096\\}$ and $\\{0.304,0.184,0.066,0.038,0.042,0.029,0.201\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.1, 0.139, 0.071, 0.132, 0.047, 0.254, 0.096\ndistribution2 = 0.304, 0.184, 0.066, 0.038, 0.042, 0.029, 0.201\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\log (2), 10, 7} \\setminus {7, 4, -\\log (2)}$.\n", - "Output Answer": [ - "${10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.log(2), 10, 7,))\nsnd = set((7, 4, -math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.3 x^2-0.3 x-1.6$ where $x \\sim $ \\text{NormalDistribution}[-0.2,2.4]\n", - "Output Answer": [ - "$-9.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.2, 2.4)\nprint(E(-1.3*x**2-0.3*x-1.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\frac{31}{\\pi }, -9, -\\frac{17}{2}, 4, -10, -\\frac{15}{2}, 2, 0, -10, -3 \\sqrt{3}, -\\pi}$.\n", - "Output Answer": [ - "$10+\\frac{31}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 5, (31/math.pi), -9, -(17/2), 4, -10, -(15/2), 2, 0, -10, -3*math.sqrt(3), -math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -3, -3, 5, 4, 5, 4, 4, 2, 5, -3, 4, 2, -3, -3, 4, 2, 5, 4, 5, 2}$.\n", - "Output Answer": [ - "$\\{-3,4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -3, -3, 5, 4, 5, 4, 4, 2, 5, -3, 4, 2, -3, -3, 4, 2, 5, 4, 5, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.09,0.209,0.056,0.101,0.084,0.112,0.11,0.087,0.039\\}$ and $\\{0.097,0.143,0.111,0.062,0.074,0.151,0.114,0.083,0.087\\}$.", - "Output Answer": [ - "$0.07$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.09, 0.209, 0.056, 0.101, 0.084, 0.112, 0.11, 0.087, 0.039\ndistribution2 = 0.097, 0.143, 0.111, 0.062, 0.074, 0.151, 0.114, 0.083, 0.087\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 3, 12, 17}$.\n", - "Output Answer": [ - "$\\frac{15504}{2047}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 3, 12, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -4, \\sqrt{3}, 2 \\sqrt{5}, 10, -8, -1, -e, \\frac{27}{\\pi }} \\cup {-4, -3, -7, 3 e, -1, -\\frac{6}{\\pi }, -3 \\sqrt{3}, 9, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-8, -7, -3 \\sqrt{3}, -4, -3, -e, -\\frac{6}{\\pi }, -1, \\sqrt{3}, 2 \\sqrt{5}, 3 e, \\frac{27}{\\pi }, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -4, math.sqrt(3), 2*math.sqrt(5), 10, -8, -1, -math.e, (27/math.pi),))\nsnd = set((-4, -3, -7, 3*math.e, -1, -(6/math.pi), -3*math.sqrt(3), 9, 2*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x^2+2. x-4.4$ where $x \\sim $ \\text{NormalDistribution}[1.3,1.1]\n", - "Output Answer": [ - "$9.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.3, 1.1)\nprint(E(3.8*x**2+2.*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.009,0.207,0.064\\}$ and $\\{0.637,0.083,0.006\\}$.", - "Output Answer": [ - "$2.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.009, 0.207, 0.064\ndistribution2 = 0.637, 0.083, 0.006\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x^2+2.9 x+4.5$ where $x \\sim $ \\text{NormalDistribution}[-1.8,1.]\n", - "Output Answer": [ - "$5.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 1.)\nprint(E(1.4*x**2+2.9*x+4.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 5, -9, -2, 2}$.\n", - "Output Answer": [ - "$\\frac{2}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 5, -9, -2, 2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -7, 6, 6.489, 7, 0, -8, 3, 2 \\sqrt{3}} \\cup {-8, 7, -5, 3, 2 \\sqrt{3}, 6, 6.489, 0, -1}$.\n", - "Output Answer": [ - "${-8, -7, -6, -5, -1, 0, 3, 2 \\sqrt{3}, 6, 6.489, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -7, 6, 6.489, 7, 0, -8, 3, 2*math.sqrt(3),))\nsnd = set((-8, 7, -5, 3, 2*math.sqrt(3), 6, 6.489, 0, -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.1 x^2-4.1 x+2.3$ where $x \\sim $ \\text{PoissonDistribution}[1.3]\n", - "Output Answer": [ - "$9.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.3)\nprint(E(4.1*x**2-4.1*x+2.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.064,0.141,0.113,0.051,0.016,0.075,0.05,0.194,0.102\\}$ and $\\{0.047,0.048,0.11,0.163,0.071,0.132,0.124,0.059,0.196\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.064, 0.141, 0.113, 0.051, 0.016, 0.075, 0.05, 0.194, 0.102\ndistribution2 = 0.047, 0.048, 0.11, 0.163, 0.071, 0.132, 0.124, 0.059, 0.196\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.3 x^2-0.5 x+3.2$ where $x \\sim $ \\text{ExponentialDistribution}[0.9]\n", - "Output Answer": [ - "$-0.57$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.9)\nprint(E(-1.3*x**2-0.5*x+3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^2+0.1 x+3.4$ where $x \\sim $ \\text{BetaDistribution}[1.6,0.3]\n", - "Output Answer": [ - "$4.47$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 0.3)\nprint(E(1.3*x**2+0.1*x+3.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{18}{5}, 3 \\pi, \\frac{4}{5}, -2, -\\frac{24}{\\pi }}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(18/5), 3*math.pi, (4/5), -2, -(24/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x^2+3.9 x-5.$ where $x \\sim $ \\text{NormalDistribution}[1.3,1.9]\n", - "Output Answer": [ - "$7.49$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.3, 1.9)\nprint(E(1.4*x**2+3.9*x-5.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{7}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -3 \\sqrt{3}, 3 \\sqrt{3}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(4 \\sqrt{3}-\\frac{37}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(7/(math.sqrt(3))), -(13/(math.sqrt(3))), -(17/(math.sqrt(3))), -3*math.sqrt(3), 3*math.sqrt(3), 4*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 3, -6, 3., 4 \\sqrt{3}, -1, 4} \\cup {-\\sqrt{3}, -6, -1, \\frac{21}{e}, 3, 5, 3.}$.\n", - "Output Answer": [ - "${-6, -4, -\\sqrt{3}, -1, 3., 3, 4, 5, 4 \\sqrt{3}, \\frac{21}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 3, -6, 3., 4*math.sqrt(3), -1, 4,))\nsnd = set((-math.sqrt(3), -6, -1, (21/math.e), 3, 5, 3.,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 2, 8, -7, 1, 1, 2, 2, 3, 2, 8, -7, 1, 2, 5, 3, 1, 2, 3, 8, 5, 1, 1, 5, 5, 5, 5, -7, -7, 8}$.\n", - "Output Answer": [ - "$\\{2,1,5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 2, 8, -7, 1, 1, 2, 2, 3, 2, 8, -7, 1, 2, 5, 3, 1, 2, 3, 8, 5, 1, 1, 5, 5, 5, 5, -7, -7, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -\\frac{13}{2}, -6, 7, 8, 0} \\cup {8, 9, -6, -\\frac{13}{2}, 0}$.\n", - "Output Answer": [ - "${-\\frac{13}{2}, -6, 0, 7, 8, 9}$" - ], - "Output Program": [ - "fst = set((9, -(13/2), -6, 7, 8, 0,))\nsnd = set((8, 9, -6, -(13/2), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{\\sqrt{\\pi }}, -\\frac{12}{e}, 3 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{12}{e}+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(math.pi))), -(12/math.e), 3*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{21}{2}, 1, \\frac{9}{2}}$.\n", - "Output Answer": [ - "$\\frac{189}{83}$" - ], - "Output Program": [ - "import statistics\nvalues = (21/2), 1, (9/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{11}{\\sqrt{3}}, -4 \\sqrt{2}, -2, -2.03, -3, 9} \\setminus {-2, \\sqrt{3}, 9, -4}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{3}}, -4 \\sqrt{2}, -3, -2.03}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(11/(math.sqrt(3))), -4*math.sqrt(2), -2, -2.03, -3, 9,))\nsnd = set((-2, math.sqrt(3), 9, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\sqrt{5}, 1, 4, -1, 0, -4, 7} \\cup {7, -4, -1, 4, 0, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-4, -\\sqrt{5}, -1, 0, 1, 4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(5), 1, 4, -1, 0, -4, 7,))\nsnd = set((7, -4, -1, 4, 0, -math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\pi, -4 \\sqrt{2}, 4, 0} \\setminus {-4 \\sqrt{2}, -\\pi, 1.506, 3}$.\n", - "Output Answer": [ - "${0, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, -4*math.sqrt(2), 4, 0,))\nsnd = set((-4*math.sqrt(2), -math.pi, 1.506, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 1, 16, 10}$.\n", - "Output Answer": [ - "$\\frac{320}{101}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 1, 16, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, -1, -6, -1, -6, 2, -9, -1, -9, -6, 2, -9, -7, -7, -7, -6, -1, 2, -1, -7, -7, -9, -1, -6, -1, -6, -9, -6, -9}$.\n", - "Output Answer": [ - "$\\{-1,-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, -1, -6, -1, -6, 2, -9, -1, -9, -6, 2, -9, -7, -7, -7, -6, -1, 2, -1, -7, -7, -9, -1, -6, -1, -6, -9, -6, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, -216, 16}$.\n", - "Output Answer": [ - "$12 \\sqrt[3]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -216, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6, 1, 512}$.\n", - "Output Answer": [ - "$8 \\sqrt[3]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 1, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.2 x-3.2$ where $x \\sim $ \\text{BetaDistribution}[0.4,1.3]\n", - "Output Answer": [ - "$-4.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.4, 1.3)\nprint(E(-4.2*x-3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x+2.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$2.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(4.4*x+2.9))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{4}{e}, -1, \\frac{25}{7}, -\\frac{47}{5}, 5, \\frac{31}{4}} \\cup {-\\frac{47}{5}, -10, -1, -\\frac{4}{e}, -\\frac{25}{7}}$.\n", - "Output Answer": [ - "${-10, -\\frac{47}{5}, -\\frac{25}{7}, -\\frac{4}{e}, -1, \\frac{25}{7}, 5, \\frac{31}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/math.e), -1, (25/7), -(47/5), 5, (31/4),))\nsnd = set((-(47/5), -10, -1, -(4/math.e), -(25/7),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, -729, 9}$.\n", - "Output Answer": [ - "$9 \\sqrt[3]{-1} 30^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, -729, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.402,0.244,0.146,0.176\\}$ and $\\{0.203,0.15,0.141,0.293\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.402, 0.244, 0.146, 0.176\ndistribution2 = 0.203, 0.15, 0.141, 0.293\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.035,0.092,0.233,0.128,0.058,0.062,0.085,0.022,0.042,0.069\\}$ and $\\{0.218,0.117,0.055,0.04,0.009,0.082,0.083,0.058,0.165,0.103\\}$.", - "Output Answer": [ - "$0.59$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.035, 0.092, 0.233, 0.128, 0.058, 0.062, 0.085, 0.022, 0.042, 0.069\ndistribution2 = 0.218, 0.117, 0.055, 0.04, 0.009, 0.082, 0.083, 0.058, 0.165, 0.103\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, \\frac{3}{5}, 4, 2 e, 5, \\frac{11}{3}, 2 \\pi, -3, 3 \\sqrt{3}} \\cup {5, 2 e, 3 \\sqrt{3}, -1, \\frac{3}{5}, 2 \\pi, \\frac{11}{3}, 4, 9}$.\n", - "Output Answer": [ - "${-3, -1, \\frac{3}{5}, \\frac{11}{3}, 4, 5, 3 \\sqrt{3}, 2 e, 2 \\pi, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, (3/5), 4, 2*math.e, 5, (11/3), 2*math.pi, -3, 3*math.sqrt(3),))\nsnd = set((5, 2*math.e, 3*math.sqrt(3), -1, (3/5), 2*math.pi, (11/3), 4, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x+3.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7]\n", - "Output Answer": [ - "$3.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(E(3.8*x+3.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 1, 2, 81}$.\n", - "Output Answer": [ - "$21 \\sqrt[4]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 1, 2, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.202,0.174,0.316\\}$ and $\\{0.309,0.187,0.144\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.202, 0.174, 0.316\ndistribution2 = 0.309, 0.187, 0.144\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, -1, -6, -2 \\pi, -9}$.", - "Output Answer": [ - "$-2 \\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, -1, -6, -2*math.pi, -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, 1, 3, 3, 8, 8, -2, 4, -2, -2, 2, -4, 4, 8, 4, 4, -2, -2, -4, -2, 3, 8, 1}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, 1, 3, 3, 8, 8, -2, 4, -2, -2, 2, -4, 4, 8, 4, 4, -2, -2, -4, -2, 3, 8, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{14}{\\pi }, 8, 4 \\sqrt{5}, 0, -\\frac{22}{e}}$.\n", - "Output Answer": [ - "${-\\frac{22}{e}, 0, \\frac{14}{\\pi }, 8, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = (14/math.pi), 8, 4*math.sqrt(5), 0, -(22/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -6.895, -8, \\frac{14}{3}, -2 e, 2, -10} \\cup {2, 0, -8, 7.183, \\frac{14}{3}, -\\frac{21}{e}, 3, -2 e, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-10, -8, -\\frac{21}{e}, -6.895, -2 e, 0, 2, 2 \\sqrt{2}, 3, \\frac{14}{3}, 7.183}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -6.895, -8, (14/3), -2*math.e, 2, -10,))\nsnd = set((2, 0, -8, 7.183, (14/3), -(21/math.e), 3, -2*math.e, 2*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -13, -3, 3, -8, 2}$.\n", - "Output Answer": [ - "$\\frac{1793}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -13, -3, 3, -8, 2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6.21, 1, \\frac{10}{3}, -3.73, -\\pi, 8, \\frac{20}{e}} \\setminus {1, 8, \\frac{10}{3}, 0, -3.73}$.\n", - "Output Answer": [ - "${-\\pi, 6.21, \\frac{20}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.21, 1, (10/3), -3.73, -math.pi, 8, (20/math.e),))\nsnd = set((1, 8, (10/3), 0, -3.73,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{19}{2}, \\pi, -9 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{19}{2}+\\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/2), math.pi, -9*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{5}{3}, -2, -8, 4, -3, -10, -2 \\pi, -1, -\\log (2), 0, 4}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/3), -2, -8, 4, -3, -10, -2*math.pi, -1, -math.log(2), 0, 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, 8, 4 \\sqrt{5}} \\setminus {\\frac{8}{\\pi }, 8, 4, \\frac{16}{\\sqrt{3}}, -7, -2 \\sqrt{5}, -8}$.\n", - "Output Answer": [ - "${4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 8, 4*math.sqrt(5),))\nsnd = set(((8/math.pi), 8, 4, (16/(math.sqrt(3))), -7, -2*math.sqrt(5), -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, 9, -9, 2, 5}$.\n", - "Output Answer": [ - "$\\frac{276}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 9, -9, 2, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 3}$.\n", - "Output Answer": [ - "$\\frac{36}{7}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3. x^2-0.4 x+1.7$ where $x \\sim $ \\text{BetaDistribution}[1.9,0.8]\n", - "Output Answer": [ - "$-0.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 0.8)\nprint(E(-3.*x**2-0.4*x+1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -\\frac{2}{\\sqrt{3}}, -9, 5, 0, 2 \\sqrt{2}, -10, -6, 2, 7, -2}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -(2/(math.sqrt(3))), -9, 5, 0, 2*math.sqrt(2), -10, -6, 2, 7, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -4, 9, \\frac{31}{\\pi }} \\cup {-3, -8, 8, \\frac{7}{\\pi }, 9}$.\n", - "Output Answer": [ - "${-8, -4, -3, \\frac{7}{\\pi }, 8, 9, \\frac{31}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -4, 9, (31/math.pi),))\nsnd = set((-3, -8, 8, (7/math.pi), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -9.72, -4 \\sqrt{3}, -9} \\cup {-9.72, -9, -3, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9.72, -9, -4 \\sqrt{3}, -6, -3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -9.72, -4*math.sqrt(3), -9,))\nsnd = set((-9.72, -9, -3, -4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 2401, 81, 27, -6}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-1} 3^{3/5} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 2401, 81, 27, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, -125, -729}$.\n", - "Output Answer": [ - "$180 \\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, -125, -729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{15}{\\pi }, \\frac{32}{7}, -\\frac{7}{\\sqrt{5}}, \\frac{7}{2}, -8, -9, 6, 1}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/math.pi), (32/7), -(7/(math.sqrt(5))), (7/2), -8, -9, 6, 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{28}{3}, \\frac{1}{\\sqrt{\\pi }}, 3, \\pi} \\setminus {-\\frac{17}{3}, -\\frac{10}{\\sqrt{\\pi }}, \\pi, -6}$.\n", - "Output Answer": [ - "${\\frac{1}{\\sqrt{\\pi }}, 3, \\frac{28}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((28/3), (1/(math.sqrt(math.pi))), 3, math.pi,))\nsnd = set((-(17/3), -(10/(math.sqrt(math.pi))), math.pi, -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{4}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\sqrt{3}, \\sqrt{3}, -\\frac{7}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\sqrt{3}, \\sqrt{3}, -\\frac{7}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{\\sqrt{3}},\\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (4/(math.sqrt(3))), (16/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), -(7/(math.sqrt(3))), -(7/(math.sqrt(3))), (4/(math.sqrt(3))), math.sqrt(3), (4/(math.sqrt(3))), (16/(math.sqrt(3))), (16/(math.sqrt(3))), -(7/(math.sqrt(3))), math.sqrt(3), (4/(math.sqrt(3))), math.sqrt(3), (4/(math.sqrt(3))), (4/(math.sqrt(3))), -(7/(math.sqrt(3))), math.sqrt(3), (4/(math.sqrt(3))), math.sqrt(3), math.sqrt(3), -(7/(math.sqrt(3))), -(7/(math.sqrt(3))), (16/(math.sqrt(3))), math.sqrt(3), math.sqrt(3), -(7/(math.sqrt(3))), -(7/(math.sqrt(3))), math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{20}{\\pi }, \\frac{28}{\\pi }, -\\frac{27}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{7}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (20/math.pi), (28/math.pi), -(27/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, -\\frac{1}{3}, 9, -4, \\frac{16}{7}, -1}$.\n", - "Output Answer": [ - "${-4, -2, -1, -\\frac{1}{3}, \\frac{16}{7}, 9}$" - ], - "Output Program": [ - "values = -2, -(1/3), 9, -4, (16/7), -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -3 \\pi, 8, 7, -\\frac{8}{\\sqrt{3}}, 9, 9, \\frac{17}{e}, 3, -\\frac{7}{\\sqrt{3}}, 7, -10}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+\\frac{17}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -3*math.pi, 8, 7, -(8/(math.sqrt(3))), 9, 9, (17/math.e), 3, -(7/(math.sqrt(3))), 7, -10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5 \\sqrt{2}, -\\frac{2}{e}, -\\frac{1}{2}, -4, -8, -3, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-8, -5 \\sqrt{2}, -4, -3, -2 \\sqrt{2}, -\\frac{2}{e}, -\\frac{1}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(2), -(2/math.e), -(1/2), -4, -8, -3, -2*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{\\sqrt{3}}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{3}}, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(3))), 2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 16, -729, 5}$.\n", - "Output Answer": [ - "$6 \\sqrt[4]{-5} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 16, -729, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 25, 1000000, 16807, -512, 531441}$.\n", - "Output Answer": [ - "$1260 \\sqrt[6]{-7} \\sqrt{2} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 25, 1000000, 16807, -512, 531441\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, -5.095, -2, \\frac{43}{5}, -\\frac{25}{\\pi }, -\\frac{49}{5}, 6}$.\n", - "Output Answer": [ - "${-\\frac{49}{5}, -9, -\\frac{25}{\\pi }, -5.095, -2, 6, \\frac{43}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -5.095, -2, (43/5), -(25/math.pi), -(49/5), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{22}{e}, \\frac{11}{e}, -\\frac{21}{e}, -\\frac{22}{e}, -\\frac{21}{e}, -\\frac{21}{e}, \\frac{11}{e}, \\frac{11}{e}, \\frac{11}{e}, -\\frac{21}{e}, \\frac{11}{e}, -\\frac{21}{e}, -\\frac{22}{e}, -\\frac{17}{e}, -\\frac{21}{e}, -\\frac{17}{e}, 0, 0, 0, 0, 0, -\\frac{22}{e}, -\\frac{22}{e}, \\frac{11}{e}, -\\frac{5}{e}, -\\frac{5}{e}, 0}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{11}{e},-\\frac{21}{e},0\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(22/math.e), (11/math.e), -(21/math.e), -(22/math.e), -(21/math.e), -(21/math.e), (11/math.e), (11/math.e), (11/math.e), -(21/math.e), (11/math.e), -(21/math.e), -(22/math.e), -(17/math.e), -(21/math.e), -(17/math.e), 0, 0, 0, 0, 0, -(22/math.e), -(22/math.e), (11/math.e), -(5/math.e), -(5/math.e), 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 7 \\sqrt{2}, -4 \\sqrt{5}, -2, -\\frac{2}{7}, 0, -5, 9}$.", - "Output Answer": [ - "$-\\frac{8}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 7*math.sqrt(2), -4*math.sqrt(5), -2, -(2/7), 0, -5, 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{1}{2}, -3 \\sqrt{3}, 5, 9, -2, 2}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -2, -\\frac{1}{2}, 2, 5, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(1/2), -3*math.sqrt(3), 5, 9, -2, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, -1}$.\n", - "Output Answer": [ - "$\\frac{7}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -1\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\sqrt{3}, 5, -9, -6 \\sqrt{2}, -8, \\frac{11}{e}, -4, 9, -5, -7, 0, 7, 8, 4, -7}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.sqrt(3), 5, -9, -6*math.sqrt(2), -8, (11/math.e), -4, 9, -5, -7, 0, 7, 8, 4, -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.036,0.056,0.133,0.09,0.112,0.159,0.055,0.19\\}$ and $\\{0.06,0.045,0.078,0.02,0.597,0.023,0.011,0.154\\}$.", - "Output Answer": [ - "$0.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.036, 0.056, 0.133, 0.09, 0.112, 0.159, 0.055, 0.19\ndistribution2 = 0.06, 0.045, 0.078, 0.02, 0.597, 0.023, 0.011, 0.154\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, -7, -2 \\pi, 7, 7, 0, 7, -3}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, -3, 0, 5, 7, 7, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -7, -2*math.pi, 7, 7, 0, 7, -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 125, 16, 7, 64}$.\n", - "Output Answer": [ - "$20 \\sqrt[5]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 125, 16, 7, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.19,0.155,0.074,0.082,0.157,0.108\\}$ and $\\{0.148,0.085,0.342,0.109,0.118,0.028\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.19, 0.155, 0.074, 0.082, 0.157, 0.108\ndistribution2 = 0.148, 0.085, 0.342, 0.109, 0.118, 0.028\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, -2 \\sqrt{3}, -5, \\frac{16}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-5, -2 \\sqrt{3}, 5, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -2*math.sqrt(3), -5, (16/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{31}{3}, 14, \\frac{38}{3}}$.\n", - "Output Answer": [ - "$\\frac{197904}{16351}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (31/3), 14, (38/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{3}, -\\frac{5}{3}, -4, 9, \\pi, \\frac{33}{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\pi -\\frac{5}{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(3), -(5/3), -4, 9, math.pi, (33/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, 0, 1}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, 0, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{2}, -3 e, -4, -\\frac{17}{2}}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, -3 e, -4, \\frac{1}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = (1/2), -3*math.e, -4, -(17/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{41}{3}, \\frac{37}{3}, 5, 2}$.\n", - "Output Answer": [ - "$\\frac{60680}{12959}$" - ], - "Output Program": [ - "import statistics\nvalues = (41/3), (37/3), 5, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{15}{e}, \\frac{21}{e}, \\frac{27}{e}, -\\frac{24}{e}, \\frac{27}{e}, \\frac{27}{e}, \\frac{27}{e}, \\frac{23}{e}, \\frac{21}{e}, -\\frac{24}{e}, \\frac{27}{e}, \\frac{27}{e}, -\\frac{24}{e}, \\frac{23}{e}, -\\frac{15}{e}, -\\frac{15}{e}, \\frac{21}{e}, \\frac{27}{e}, \\frac{21}{e}, -\\frac{24}{e}, \\frac{23}{e}, \\frac{27}{e}, -\\frac{1}{e}, \\frac{27}{e}, -\\frac{15}{e}, \\frac{23}{e}, \\frac{23}{e}, \\frac{27}{e}, -\\frac{1}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{27}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(15/math.e), (21/math.e), (27/math.e), -(24/math.e), (27/math.e), (27/math.e), (27/math.e), (23/math.e), (21/math.e), -(24/math.e), (27/math.e), (27/math.e), -(24/math.e), (23/math.e), -(15/math.e), -(15/math.e), (21/math.e), (27/math.e), (21/math.e), -(24/math.e), (23/math.e), (27/math.e), -(1/math.e), (27/math.e), -(15/math.e), (23/math.e), (23/math.e), (27/math.e), -(1/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 4, -9, -4} \\setminus {-9, 6 \\sqrt{2}, 9, -3}$.\n", - "Output Answer": [ - "${-4, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 4, -9, -4,))\nsnd = set((-9, 6*math.sqrt(2), 9, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${6, -6, 3, -7, -8} \\cap {0, 5, 6, -7, -5}$.\n", - "Output Answer": [ - "${-7, 6}$" - ], - "Output Program": [ - "fst = set((6, -6, 3, -7, -8,))\nsnd = set((0, 5, 6, -7, -5,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{54}{7}, -3, 3.63, 8, -\\frac{9}{\\sqrt{2}}, 13 \\log (2)} \\setminus {-\\frac{9}{\\sqrt{2}}, 5, \\frac{1}{\\sqrt{\\pi }}, -3, 8, -\\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${3.63, \\frac{54}{7}, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set(((54/7), -3, 3.63, 8, -(9/(math.sqrt(2))), 13*math.log(2),))\nsnd = set((-(9/(math.sqrt(2))), 5, (1/(math.sqrt(math.pi))), -3, 8, -(13/(math.sqrt(3))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.236,0.08,0.048,0.214,0.098,0.196\\}$ and $\\{0.518,0.054,0.128,0.128,0.106,0.031\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.236, 0.08, 0.048, 0.214, 0.098, 0.196\ndistribution2 = 0.518, 0.054, 0.128, 0.128, 0.106, 0.031\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{28}{3}, \\frac{53}{3}}$.\n", - "Output Answer": [ - "$\\frac{2968}{243}$" - ], - "Output Program": [ - "import statistics\nvalues = (28/3), (53/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, -1, -2 \\sqrt{5}, -\\frac{25}{\\pi }, \\frac{3}{\\sqrt{\\pi }}, 2, 6 \\sqrt{2}} \\setminus {-9, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{25}{\\pi }, -1, 1, \\frac{3}{\\sqrt{\\pi }}, 2, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -1, -2*math.sqrt(5), -(25/math.pi), (3/(math.sqrt(math.pi))), 2, 6*math.sqrt(2),))\nsnd = set((-9, -2*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8 \\log (2), 8, 6, -8, -2., 2, -\\frac{1}{2}} \\cup {2, -6, -8, -\\frac{1}{2}, -7, -2., -3 \\log (2)}$.\n", - "Output Answer": [ - "${-8, -7, -6, -3 \\log (2), -2., -\\frac{1}{2}, 2, 8 \\log (2), 6, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((8*math.log(2), 8, 6, -8, -2., 2, -(1/2),))\nsnd = set((2, -6, -8, -(1/2), -7, -2., -3*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.08,0.027,0.113,0.042,0.251,0.054,0.142,0.031,0.138\\}$ and $\\{0.064,0.037,0.192,0.05,0.129,0.435,0.023,0.035,0.002\\}$.", - "Output Answer": [ - "$1.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.08, 0.027, 0.113, 0.042, 0.251, 0.054, 0.142, 0.031, 0.138\ndistribution2 = 0.064, 0.037, 0.192, 0.05, 0.129, 0.435, 0.023, 0.035, 0.002\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 13, -5, -9}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{1115}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 13, -5, -9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.008,0.062,0.142,0.043,0.095,0.058,0.117,0.106,0.057,0.257\\}$ and $\\{0.211,0.073,0.037,0.082,0.144,0.122,0.172,0.007,0.028,0.059\\}$.", - "Output Answer": [ - "$0.74$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.008, 0.062, 0.142, 0.043, 0.095, 0.058, 0.117, 0.106, 0.057, 0.257\ndistribution2 = 0.211, 0.073, 0.037, 0.082, 0.144, 0.122, 0.172, 0.007, 0.028, 0.059\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 1, -6, 1, 512, 729}$.\n", - "Output Answer": [ - "$6 \\sqrt[6]{-3} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 1, -6, 1, 512, 729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, \\frac{8}{\\sqrt{3}}, -9, -\\frac{19}{e}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3-\\frac{19}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, (8/(math.sqrt(3))), -9, -(19/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{25}{7}, -\\frac{3}{7}, -\\frac{3}{7}, -\\frac{25}{7}, -\\frac{24}{7}, -\\frac{25}{7}, -\\frac{3}{7}, -\\frac{24}{7}, \\frac{36}{7}, -4, -\\frac{3}{7}, -\\frac{24}{7}, -\\frac{24}{7}, -\\frac{25}{7}, -\\frac{65}{7}, -4, \\frac{36}{7}, -\\frac{65}{7}, -\\frac{25}{7}, \\frac{37}{7}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{25}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(25/7), -(3/7), -(3/7), -(25/7), -(24/7), -(25/7), -(3/7), -(24/7), (36/7), -4, -(3/7), -(24/7), -(24/7), -(25/7), -(65/7), -4, (36/7), -(65/7), -(25/7), (37/7)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.236,0.162,0.04,0.037,0.083,0.053,0.149,0.075,0.114\\}$ and $\\{0.074,0.158,0.061,0.078,0.04,0.102,0.267,0.104,0.074\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.236, 0.162, 0.04, 0.037, 0.083, 0.053, 0.149, 0.075, 0.114\ndistribution2 = 0.074, 0.158, 0.061, 0.078, 0.04, 0.102, 0.267, 0.104, 0.074\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6 \\sqrt{2}, -5, 10, 8, -6, 5, -10, -3, \\frac{25}{e}, 3, -\\frac{28}{3}, -10, -9, 3, 3}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6*math.sqrt(2), -5, 10, 8, -6, 5, -10, -3, (25/math.e), 3, -(28/3), -10, -9, 3, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, -15, -11, 13}$.\n", - "Output Answer": [ - "$\\frac{475}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -15, -11, 13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, -6, 8, 5, 12, 6}$.\n", - "Output Answer": [ - "$42$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -6, 8, 5, 12, 6\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 1, 0, -6, 7, -5}$.\n", - "Output Answer": [ - "$\\frac{483}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 1, 0, -6, 7, -5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{5}{2}, -4, 2, \\frac{7}{\\pi }, -7, -9, 3, 4, 4 \\log (2), -\\frac{11}{\\sqrt{5}}} \\setminus {3, -7, -\\frac{15}{2}, 4}$.\n", - "Output Answer": [ - "${-9, -\\frac{11}{\\sqrt{5}}, -4, -\\frac{5}{2}, 2, \\frac{7}{\\pi }, 4 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(5/2), -4, 2, (7/math.pi), -7, -9, 3, 4, 4*math.log(2), -(11/(math.sqrt(5))),))\nsnd = set((3, -7, -(15/2), 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 14, 4, 19}$.\n", - "Output Answer": [ - "$\\frac{19152}{2323}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 14, 4, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, 4, -1, 6}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{251}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 4, -1, 6\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.183,0.303,0.12,0.194\\}$ and $\\{0.347,0.061,0.395,0.151\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.183, 0.303, 0.12, 0.194\ndistribution2 = 0.347, 0.061, 0.395, 0.151\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\sqrt{2}, -4, -\\frac{8}{5}, 7, -5, 6, -\\frac{61}{7}, -\\frac{11}{e}, -8, 1} \\cup {-6 \\sqrt{2}, 5, -\\frac{9}{e}, -\\frac{61}{7}, -1, -5, -\\frac{46}{5}, -8, -4, 7}$.\n", - "Output Answer": [ - "${-\\frac{46}{5}, -\\frac{61}{7}, -6 \\sqrt{2}, -8, -5, -\\frac{11}{e}, -4, -\\frac{9}{e}, -2 \\sqrt{2}, -\\frac{8}{5}, -1, 1, 5, 6, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(2), -4, -(8/5), 7, -5, 6, -(61/7), -(11/math.e), -8, 1,))\nsnd = set((-6*math.sqrt(2), 5, -(9/math.e), -(61/7), -1, -5, -(46/5), -8, -4, 7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{39}{4}, \\frac{13}{4}}$.\n", - "Output Answer": [ - "$\\frac{13}{2}$" - ], - "Output Program": [ - "values = (39/4), (13/4)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6, 5, -\\frac{54}{7}, -\\frac{3}{\\sqrt{2}}} \\cup {-\\frac{3}{\\sqrt{2}}, 5, 1, -\\frac{54}{7}}$.\n", - "Output Answer": [ - "${-\\frac{54}{7}, -\\frac{3}{\\sqrt{2}}, 1, 5, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 5, -(54/7), -(3/(math.sqrt(2))),))\nsnd = set((-(3/(math.sqrt(2))), 5, 1, -(54/7),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{16}{e}, 6, 7, -8.75, \\frac{24}{e}, -2 \\sqrt{3}, 8, 4, -4, 0, -\\frac{12}{e}} \\cup {8, -1, -6.42, 0, 6, -2 \\sqrt{3}, \\frac{16}{e}, 3}$.\n", - "Output Answer": [ - "${-8.75, -6.42, -\\frac{12}{e}, -4, -2 \\sqrt{3}, -1, 0, 3, 4, \\frac{16}{e}, 6, 7, 8, \\frac{24}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((16/math.e), 6, 7, -8.75, (24/math.e), -2*math.sqrt(3), 8, 4, -4, 0, -(12/math.e),))\nsnd = set((8, -1, -6.42, 0, 6, -2*math.sqrt(3), (16/math.e), 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 18, 13, 12}$.\n", - "Output Answer": [ - "$\\frac{1872}{335}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 18, 13, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, 2, 5, 15, -10, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1267}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 2, 5, 15, -10, 14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, -7, 1, 6, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{463}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -7, 1, 6, 8\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, 10, 2, -2, 2, 2, 2, -2, 2, 10, 10, 2, 2, 10, 2, 2, 2, 10, 2, -2, -2, 2, 2, -2, 2, 2, 2, 2, -2}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, 10, 2, -2, 2, 2, 2, -2, 2, 10, 10, 2, 2, 10, 2, 2, 2, 10, 2, -2, -2, 2, 2, -2, 2, 2, 2, 2, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.093,0.073,0.103,0.174,0.355,0.049,0.048\\}$ and $\\{0.3,0.175,0.083,0.067,0.133,0.054,0.025\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.093, 0.073, 0.103, 0.174, 0.355, 0.049, 0.048\ndistribution2 = 0.3, 0.175, 0.083, 0.067, 0.133, 0.054, 0.025\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{8}{\\sqrt{5}}, 0, -\\frac{13}{4}, 8, 3, -\\frac{39}{5}, 9, -3, -11 \\log (2), -4 \\sqrt{3}, 9, -4 \\sqrt{5}, 1}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (8/(math.sqrt(5))), 0, -(13/4), 8, 3, -(39/5), 9, -3, -11*math.log(2), -4*math.sqrt(3), 9, -4*math.sqrt(5), 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10 \\log (2), 10 \\log (2), -14 \\log (2), 10 \\log (2), 10 \\log (2), 12 \\log (2), 10 \\log (2), -13 \\log (2), 4 \\log (2), 10 \\log (2), 9 \\log (2), 10 \\log (2), 14 \\log (2), -13 \\log (2), -13 \\log (2), -14 \\log (2), 12 \\log (2), 4 \\log (2), -13 \\log (2), 12 \\log (2), 12 \\log (2), 12 \\log (2), -13 \\log (2), -14 \\log (2), 9 \\log (2), 10 \\log (2), -13 \\log (2), -14 \\log (2), 4 \\log (2), -14 \\log (2)}$.\n", - "Output Answer": [ - "$\\{10 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 10*math.log(2), 10*math.log(2), -14*math.log(2), 10*math.log(2), 10*math.log(2), 12*math.log(2), 10*math.log(2), -13*math.log(2), 4*math.log(2), 10*math.log(2), 9*math.log(2), 10*math.log(2), 14*math.log(2), -13*math.log(2), -13*math.log(2), -14*math.log(2), 12*math.log(2), 4*math.log(2), -13*math.log(2), 12*math.log(2), 12*math.log(2), 12*math.log(2), -13*math.log(2), -14*math.log(2), 9*math.log(2), 10*math.log(2), -13*math.log(2), -14*math.log(2), 4*math.log(2), -14*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x-3.1$ where $x \\sim $ \\text{NormalDistribution}[-0.3,2.7]\n", - "Output Answer": [ - "$-2.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.3, 2.7)\nprint(E(-3.5*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, \\frac{23}{2}, 17, \\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\frac{2346}{281}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, (23/2), 17, (15/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 4 \\log (2), 1, -2 \\sqrt{2}, 2, -\\frac{7}{4}, 8, -2, -5} \\setminus {\\frac{1}{\\sqrt{\\pi }}, 4 \\log (2), -5, 2, -4, -5 \\sqrt{2}, -\\frac{7}{4}, -2}$.\n", - "Output Answer": [ - "${-9, -2 \\sqrt{2}, 1, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 4*math.log(2), 1, -2*math.sqrt(2), 2, -(7/4), 8, -2, -5,))\nsnd = set(((1/(math.sqrt(math.pi))), 4*math.log(2), -5, 2, -4, -5*math.sqrt(2), -(7/4), -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.141,0.217,0.234,0.192,0.131\\}$ and $\\{0.203,0.054,0.044,0.228,0.41\\}$.", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.141, 0.217, 0.234, 0.192, 0.131\ndistribution2 = 0.203, 0.054, 0.044, 0.228, 0.41\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 2 e, -8, -9, -\\frac{11}{2}, -4, \\frac{20}{\\pi }, 3 \\pi, -4, -1, -1, \\sqrt{3}, -2 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, 4}$.\n", - "Output Answer": [ - "$9+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 2*math.e, -8, -9, -(11/2), -4, (20/math.pi), 3*math.pi, -4, -1, -1, math.sqrt(3), -2*math.sqrt(2), -(3/(math.sqrt(2))), 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, -6, -2}$.\n", - "Output Answer": [ - "$5\\ 2^{2/3} \\sqrt[3]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, -6, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -7, -3, -6, 10, 1, -5, -5}$.\n", - "Output Answer": [ - "$-\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -7, -3, -6, 10, 1, -5, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -8, -6, 0, -5, 1, -6, -6, -5, -4, -4, -6, -6, -4, -8, 0, 0, 1, -5, -6, -5, -6, -5, -6, -4, -6, -6, -4, -6}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -8, -6, 0, -5, 1, -6, -6, -5, -4, -4, -6, -6, -4, -8, 0, 0, 1, -5, -6, -5, -6, -5, -6, -4, -6, -6, -4, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10, 2 \\pi, 8, -\\frac{11}{\\sqrt{\\pi }}} \\setminus {10, 3 \\pi, -\\frac{13}{\\sqrt{\\pi }}, 0, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{\\pi }}, 2 \\pi, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 2*math.pi, 8, -(11/(math.sqrt(math.pi))),))\nsnd = set((10, 3*math.pi, -(13/(math.sqrt(math.pi))), 0, -3*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.242,0.086,0.238\\}$ and $\\{0.676,0.044,0.263\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.242, 0.086, 0.238\ndistribution2 = 0.676, 0.044, 0.263\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, -\\frac{10}{\\sqrt{3}}, 10, 7, 0, -2 \\sqrt{5}, 5, 0, -9, -\\frac{21}{\\pi }, -1, -5 \\sqrt{2}, \\frac{14}{\\sqrt{3}}, -3 \\sqrt{2}, -8}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -(10/(math.sqrt(3))), 10, 7, 0, -2*math.sqrt(5), 5, 0, -9, -(21/math.pi), -1, -5*math.sqrt(2), (14/(math.sqrt(3))), -3*math.sqrt(2), -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $1.74 < 1.4 x^2+2.8 x-1.3 < 3.91$ where $x \\sim $ \\text{ExponentialDistribution}[1.1].", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.1)\nprint(P((1.74 < 1.4*x**2+2.8*x-1.3) & (1.4*x**2+2.8*x-1.3 < 3.91)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{\\sqrt{2}}, -7, 4, 4, -\\frac{4}{\\sqrt{3}}, -\\pi, 3 \\sqrt{3}, -2 \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{5}{\\sqrt{2}}-\\frac{4}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/(math.sqrt(2))), -7, 4, 4, -(4/(math.sqrt(3))), -math.pi, 3*math.sqrt(3), -2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{5}, -\\frac{24}{\\pi }, 3 \\sqrt{2}, \\frac{1}{\\sqrt{5}}, -7, \\frac{12}{\\sqrt{5}}, -\\pi, -13 \\log (2), -9, -8, 3}$.\n", - "Output Answer": [ - "$\\frac{12}{\\sqrt{5}}+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = (13/5), -(24/math.pi), 3*math.sqrt(2), (1/(math.sqrt(5))), -7, (12/(math.sqrt(5))), -math.pi, -13*math.log(2), -9, -8, 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{1}{2}, -6, -6, 6, -6, -6, 6, 6, \\frac{1}{2}, -\\frac{17}{2}, \\frac{1}{2}, 6, -6, 6, -\\frac{17}{2}, -6, \\frac{1}{2}, 6, \\frac{1}{2}, -\\frac{17}{2}, 6, \\frac{1}{2}, -6, 6, 6, \\frac{1}{2}}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (1/2), -6, -6, 6, -6, -6, 6, 6, (1/2), -(17/2), (1/2), 6, -6, 6, -(17/2), -6, (1/2), 6, (1/2), -(17/2), 6, (1/2), -6, 6, 6, (1/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.107,0.464,0.069\\}$ and $\\{0.379,0.232,0.148\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.107, 0.464, 0.069\ndistribution2 = 0.379, 0.232, 0.148\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 3, 3, -11, 1, 15}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 3, 3, -11, 1, 15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -\\frac{5}{\\pi }}$.\n", - "Output Answer": [ - "$7+\\frac{5}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -(5/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 4.85, -6 \\sqrt{3}, -\\frac{13}{\\sqrt{3}}, 0} \\setminus {-5, \\frac{13}{\\pi }, 0, 9, -6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, -\\frac{13}{\\sqrt{3}}, 4.85}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 4.85, -6*math.sqrt(3), -(13/(math.sqrt(3))), 0,))\nsnd = set((-5, (13/math.pi), 0, 9, -6*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 5, -9, -9, -9, 5, -3, -9, -3, 5, 5, 5, -3, -9, -9, 5, 5, 5, 5, -9, 5, 5, 5, -3, 5, -9, -9, 5, -9, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 5, -9, -9, -9, 5, -3, -9, -3, 5, 5, 5, -3, -9, -9, 5, 5, 5, 5, -9, 5, 5, 5, -3, 5, -9, -9, 5, -9, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, -3, 8, 8, 9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1003}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -3, 8, 8, 9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, 9, 3}$.\n", - "Output Answer": [ - "$\\frac{17}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, 9, 3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7.2, -\\frac{11}{\\sqrt{\\pi }}, 4 \\sqrt{5}, 3, 0}$.\n", - "Output Answer": [ - "${-7.2, -\\frac{11}{\\sqrt{\\pi }}, 0, 3, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7.2, -(11/(math.sqrt(math.pi))), 4*math.sqrt(5), 3, 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6, -9, -4, -3 \\sqrt{5}, -7}$.\n", - "Output Answer": [ - "${-9, -7, -3 \\sqrt{5}, -6, -4}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -9, -4, -3*math.sqrt(5), -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6, 3, 7 \\log (2), \\frac{17}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, \\frac{31}{\\pi }, -5, -3.5}$.\n", - "Output Answer": [ - "${-6, -5, -\\frac{7}{\\sqrt{3}}, -3.5, 3, 7 \\log (2), \\frac{17}{\\sqrt{3}}, \\frac{31}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 3, 7*math.log(2), (17/(math.sqrt(3))), -(7/(math.sqrt(3))), (31/math.pi), -5, -3.5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.8 x^2-2.9 x-0.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.5]\n", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.5)\nprint(E(0.8*x**2-2.9*x-0.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 1, 17}$.\n", - "Output Answer": [ - "$\\frac{204}{89}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 1, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{51}{7}, -3, \\frac{3}{\\pi }, -\\frac{5}{2}, \\frac{13}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, 2, -6, 3, 6, -3 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{3}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(51/7), -3, (3/math.pi), -(5/2), (13/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), 2, -6, 3, 6, -3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.175,0.06,0.238,0.435\\}$ and $\\{0.166,0.257,0.075,0.383\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.175, 0.06, 0.238, 0.435\ndistribution2 = 0.166, 0.257, 0.075, 0.383\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, 0, -\\frac{7}{\\sqrt{2}}} \\setminus {1, 5, -\\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 0, -(7/(math.sqrt(2))),))\nsnd = set((1, 5, -(7/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.264,0.118,0.177,0.192,0.143\\}$ and $\\{0.569,0.016,0.043,0.027,0.085\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.264, 0.118, 0.177, 0.192, 0.143\ndistribution2 = 0.569, 0.016, 0.043, 0.027, 0.085\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x^2+1.2 x+2.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$9.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(3.8*x**2+1.2*x+2.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.3 x+7.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$7.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(0.3*x+7.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, -\\frac{14}{3}, \\frac{11}{\\sqrt{2}}, 8.11, -\\sqrt{3}, -1}$.\n", - "Output Answer": [ - "${-8, -\\frac{14}{3}, -\\sqrt{3}, -1, \\frac{11}{\\sqrt{2}}, 8.11}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -(14/3), (11/(math.sqrt(2))), 8.11, -math.sqrt(3), -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, 10, 12, 8, -10, 4}$.\n", - "Output Answer": [ - "$\\frac{1853}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, 10, 12, 8, -10, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{9}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{2}}, -6, -\\frac{17}{e}, 5, 0, -5, 9, -\\frac{10}{e}, \\frac{15}{2}, -\\frac{13}{\\sqrt{2}}, -8}$.\n", - "Output Answer": [ - "$9+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/(math.sqrt(math.pi))), -(1/(math.sqrt(2))), -6, -(17/math.e), 5, 0, -5, 9, -(10/math.e), (15/2), -(13/(math.sqrt(2))), -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{31}{2}, \\frac{3}{2}, \\frac{27}{2}, 10}$.\n", - "Output Answer": [ - "$\\frac{33480}{7577}$" - ], - "Output Program": [ - "import statistics\nvalues = (31/2), (3/2), (27/2), 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, \\frac{9}{2}, \\frac{7}{2}, -4, \\frac{11}{2}, 1}$.\n", - "Output Answer": [ - "$\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, (9/2), (7/2), -4, (11/2), 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -6 \\sqrt{2}, \\frac{24}{5}, 6} \\setminus {-3 e, \\frac{24}{5}, -6 \\sqrt{2}, 6, -9, -5}$.\n", - "Output Answer": [ - "${-8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -6*math.sqrt(2), (24/5), 6,))\nsnd = set((-3*math.e, (24/5), -6*math.sqrt(2), 6, -9, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -\\sqrt{3}, 4, -10, -7.66, 6}$.\n", - "Output Answer": [ - "${-10, -7.66, -\\sqrt{3}, 1, 4, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -math.sqrt(3), 4, -10, -7.66, 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, 3, \\frac{21}{4}, -5, 9.8}$.\n", - "Output Answer": [ - "${-7, -5, 3, \\frac{21}{4}, 9.8}$" - ], - "Output Program": [ - "values = -7, 3, (21/4), -5, 9.8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 0, -3 e, 2 e, 3.5} \\cup {3.5, 2 e, -3 e, -2, 0}$.\n", - "Output Answer": [ - "${-3 e, -2, 0, 3.5, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 0, -3*math.e, 2*math.e, 3.5,))\nsnd = set((3.5, 2*math.e, -3*math.e, -2, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, -13, -3, -3}$.\n", - "Output Answer": [ - "$44$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -13, -3, -3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4 \\sqrt{2}, -2, -6}$.\n", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(2), -2, -6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.086,0.113,0.19,0.373,0.111\\}$ and $\\{0.062,0.261,0.283,0.049,0.099\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.086, 0.113, 0.19, 0.373, 0.111\ndistribution2 = 0.062, 0.261, 0.283, 0.049, 0.099\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, -5 \\sqrt{3}, 3, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{2}}, \\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -4, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{2}}, 3, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -5*math.sqrt(3), 3, -(4/(math.sqrt(math.pi))), -(3/(math.sqrt(2))), (13/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, -\\frac{23}{3}, -7, 1, -3 \\pi, 0}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\frac{23}{3}, -7, 0, 0, 1}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(23/3), -7, 1, -3*math.pi, 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, -59049, 81, 100, -3, 8}$.\n", - "Output Answer": [ - "$9\\ 2^{5/6} \\sqrt{3} \\sqrt[3]{35}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, -59049, 81, 100, -3, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -1, -6, -4, -1, 2, -6, 2, -6, 7, 2, -6, -6, 2, 2, -1, -1, 2, -4, 2, 7, -4, 7, -6, 2, -4, 2}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -1, -6, -4, -1, 2, -6, 2, -6, 7, 2, -6, -6, 2, 2, -1, -1, 2, -4, 2, 7, -4, 7, -6, 2, -4, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.3 x-3.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.6]\n", - "Output Answer": [ - "$-4.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.6)\nprint(E(-0.3*x-3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, \\sqrt{2}, 9, \\frac{18}{\\sqrt{5}}, -10, 2, \\frac{34}{7}, 6, 0, 3, -\\frac{14}{\\pi }, -\\frac{25}{4}, 1, -6 \\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2+\\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, math.sqrt(2), 9, (18/(math.sqrt(5))), -10, 2, (34/7), 6, 0, 3, -(14/math.pi), -(25/4), 1, -6*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{3}, \\frac{58}{3}, 19, \\frac{19}{3}}$.\n", - "Output Answer": [ - "$\\frac{48488}{6485}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/3), (58/3), 19, (19/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, -243, -3125, 36, -64, 125}$.\n", - "Output Answer": [ - "$30 \\sqrt[6]{-21} \\sqrt[3]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -243, -3125, 36, -64, 125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{21}{2}, \\frac{3}{2}, \\frac{5}{2}, \\frac{27}{2}}$.\n", - "Output Answer": [ - "$\\frac{945}{292}$" - ], - "Output Program": [ - "import statistics\nvalues = (21/2), (3/2), (5/2), (27/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-11 \\log (2), e, -3, -6, 0, -1, 7} \\cup {-3, -6, -\\frac{9}{e}, 0, -1, 8.605, 12 \\log (2)}$.\n", - "Output Answer": [ - "${-11 \\log (2), -6, -\\frac{9}{e}, -3, -1, 0, e, 7, 12 \\log (2), 8.605}$" - ], - "Output Program": [ - "import math\n\nfst = set((-11*math.log(2), math.e, -3, -6, 0, -1, 7,))\nsnd = set((-3, -6, -(9/math.e), 0, -1, 8.605, 12*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 1, 6561, 6}$.\n", - "Output Answer": [ - "$9\\ 2^{3/4} \\sqrt[4]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 1, 6561, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, -11, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{433}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -11, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 1, 13}$.\n", - "Output Answer": [ - "$\\frac{585}{223}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 1, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, \\frac{2}{\\sqrt{3}}, -\\frac{23}{\\pi }, 9, 4 \\log (2), -8, -5 \\sqrt{3}, -6 \\log (2), -\\frac{14}{\\sqrt{\\pi }}, 2, -\\frac{1}{2}, -1, -3 \\pi, -5}$.\n", - "Output Answer": [ - "$9+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -5, (2/(math.sqrt(3))), -(23/math.pi), 9, 4*math.log(2), -8, -5*math.sqrt(3), -6*math.log(2), -(14/(math.sqrt(math.pi))), 2, -(1/2), -1, -3*math.pi, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, -9, 100, 243, -100000}$.\n", - "Output Answer": [ - "$30\\ 3^{4/5} 10^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -9, 100, 243, -100000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{3}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{3}{\\sqrt{\\pi }},\\frac{18}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(3/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3 \\pi, 2, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, 2, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.pi, 2, -3*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, 9, -3, -5}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, 9, -3, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -\\frac{29}{3}, -8, -2 \\sqrt{5}, -\\frac{26}{\\pi }, -\\frac{22}{3}, -3, 10, \\frac{3}{\\sqrt{2}}, -\\frac{21}{4}, -5, \\frac{27}{e}, -\\frac{7}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{59}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -(29/3), -8, -2*math.sqrt(5), -(26/math.pi), -(22/3), -3, 10, (3/(math.sqrt(2))), -(21/4), -5, (27/math.e), -(7/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -6, 0, -2, 9, -6, -7}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -6, 0, -2, 9, -6, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10, -9, 8, 7, 3, 2, 7, 3, 0, 8, -9, 3, 10, 7, -9, 2, 3, 2, 0, -9, 2, 10, 10, 10}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 10, -9, 8, 7, 3, 2, 7, 3, 0, 8, -9, 3, 10, 7, -9, 2, 3, 2, 0, -9, 2, 10, 10, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, -8, 7, -8, -8, 4, 0, -7, -5, 0, -7, 7, -7, -5, 0, 6, -8, 4, -7, -7, 4, 7, -5}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, -8, 7, -8, -8, 4, 0, -7, -5, 0, -7, 7, -7, -5, 0, 6, -8, 4, -7, -7, 4, 7, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, -2 \\sqrt{5}, -4, \\frac{33}{5}, -3 \\sqrt{3}, \\frac{3}{4}, -\\frac{16}{e}, 10, -4 \\sqrt{5}, -3}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, -2*math.sqrt(5), -4, (33/5), -3*math.sqrt(3), (3/4), -(16/math.e), 10, -4*math.sqrt(5), -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{17}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{8}{\\sqrt{3}}, 2 \\sqrt{3}, 2 \\sqrt{3}, \\frac{17}{\\sqrt{3}}, 2 \\sqrt{3}, \\frac{5}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{8}{\\sqrt{3}}, 2 \\sqrt{3}, \\frac{5}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{8}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (17/(math.sqrt(3))), -(8/(math.sqrt(3))), -(8/(math.sqrt(3))), -(8/(math.sqrt(3))), -(8/(math.sqrt(3))), 2*math.sqrt(3), -(8/(math.sqrt(3))), 2*math.sqrt(3), 2*math.sqrt(3), (17/(math.sqrt(3))), 2*math.sqrt(3), (5/(math.sqrt(3))), -(8/(math.sqrt(3))), (5/(math.sqrt(3))), -(8/(math.sqrt(3))), (17/(math.sqrt(3))), -(8/(math.sqrt(3))), (5/(math.sqrt(3))), 2*math.sqrt(3), -(8/(math.sqrt(3))), 2*math.sqrt(3), (5/(math.sqrt(3))), (5/(math.sqrt(3))), (5/(math.sqrt(3))), -(8/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.96 < 1.1 x-2.8 < 3.57$ where $x \\sim $ \\text{ExponentialDistribution}[1.1].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.1)\nprint(P((0.96 < 1.1*x-2.8) & (1.1*x-2.8 < 3.57)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 13, 5, 8, -3, 6}$.\n", - "Output Answer": [ - "$\\frac{923}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 13, 5, 8, -3, 6\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, 2 \\sqrt{5}, -\\frac{23}{e}, 5, \\frac{15}{\\sqrt{\\pi }}, -11 \\log (2), 4}$.\n", - "Output Answer": [ - "${-\\frac{23}{e}, -11 \\log (2), 4, 2 \\sqrt{5}, 5, 7, \\frac{15}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 2*math.sqrt(5), -(23/math.e), 5, (15/(math.sqrt(math.pi))), -11*math.log(2), 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x^2-3. x-3.1$ where $x \\sim $ \\text{NormalDistribution}[-1.6,2.4]\n", - "Output Answer": [ - "$6.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 2.4)\nprint(E(0.6*x**2-3.*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.248,0.344,0.087,0.131\\}$ and $\\{0.17,0.097,0.131,0.299\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.248, 0.344, 0.087, 0.131\ndistribution2 = 0.17, 0.097, 0.131, 0.299\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8, 1, \\frac{13}{\\pi }, \\frac{23}{e}, 7, -7 \\sqrt{2}, \\frac{19}{\\pi }, 8, -\\frac{1}{2}} \\cup {3, 7, 0, -\\frac{1}{\\pi }, \\frac{13}{\\pi }, -7 \\sqrt{2}, -\\frac{3}{2}, 1, -\\frac{20}{e}, -\\frac{25}{\\pi }, 8}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -8, -\\frac{25}{\\pi }, -\\frac{20}{e}, -\\frac{3}{2}, -\\frac{1}{2}, -\\frac{1}{\\pi }, 0, 1, 3, \\frac{13}{\\pi }, \\frac{19}{\\pi }, 7, 8, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 1, (13/math.pi), (23/math.e), 7, -7*math.sqrt(2), (19/math.pi), 8, -(1/2),))\nsnd = set((3, 7, 0, -(1/math.pi), (13/math.pi), -7*math.sqrt(2), -(3/2), 1, -(20/math.e), -(25/math.pi), 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 6, -6, 1}$.\n", - "Output Answer": [ - "$-\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 6, -6, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5 \\sqrt{2}, -\\frac{19}{\\sqrt{5}}, \\frac{33}{4}, -\\frac{14}{\\sqrt{5}}, 9, \\frac{16}{\\sqrt{5}}, \\frac{11}{\\sqrt{3}}, \\frac{36}{7}, 4, 0, 10, 2}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{36}{7}+\\frac{11}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5*math.sqrt(2), -(19/(math.sqrt(5))), (33/4), -(14/(math.sqrt(5))), 9, (16/(math.sqrt(5))), (11/(math.sqrt(3))), (36/7), 4, 0, 10, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{10}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\sqrt{3}, -\\frac{4}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\sqrt{3}, -\\frac{4}{\\sqrt{3}}, \\sqrt{3}, -\\frac{1}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, \\sqrt{3}, -\\frac{4}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{4}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(10/(math.sqrt(3))), (5/(math.sqrt(3))), math.sqrt(3), -(4/(math.sqrt(3))), (5/(math.sqrt(3))), math.sqrt(3), -(4/(math.sqrt(3))), math.sqrt(3), -(1/(math.sqrt(3))), -(13/(math.sqrt(3))), (5/(math.sqrt(3))), -(10/(math.sqrt(3))), (5/(math.sqrt(3))), -(2/(math.sqrt(3))), (5/(math.sqrt(3))), -(4/(math.sqrt(3))), -(13/(math.sqrt(3))), -(4/(math.sqrt(3))), -(2/(math.sqrt(3))), math.sqrt(3), -(4/(math.sqrt(3))), -(1/(math.sqrt(3))), -(4/(math.sqrt(3))), -(1/(math.sqrt(3))), -(4/(math.sqrt(3))), -(10/(math.sqrt(3))), (5/(math.sqrt(3))), -(4/(math.sqrt(3))), -(2/(math.sqrt(3))), -(13/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 7, -\\frac{8}{\\sqrt{3}}, 4, \\frac{48}{5}, 0}$.\n", - "Output Answer": [ - "$\\frac{48}{5}+\\frac{8}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 7, -(8/(math.sqrt(3))), 4, (48/5), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{26}{3}, \\frac{20}{3}}$.\n", - "Output Answer": [ - "$\\frac{520}{69}$" - ], - "Output Program": [ - "import statistics\nvalues = (26/3), (20/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.227,0.05,0.001,0.485\\}$ and $\\{0.142,0.104,0.054,0.463\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.227, 0.05, 0.001, 0.485\ndistribution2 = 0.142, 0.104, 0.054, 0.463\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -3, -1, -5, -1}$.\n", - "Output Answer": [ - "$-\\frac{13}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -3, -1, -5, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -10, 1, 1, -10, 0, 1, -8, 1, 8, 1, 8, 0, 1, 1, -8, 1, -8, 1, 1, -10, 1, 0, 1, 8, 1, 8, 1, -10}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -10, 1, 1, -10, 0, 1, -8, 1, 8, 1, 8, 0, 1, 1, -8, 1, -8, 1, 1, -10, 1, 0, 1, 8, 1, 8, 1, -10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -9, -8, 2, \\frac{7}{\\sqrt{\\pi }}, \\frac{9}{\\pi }, -1, 5 \\sqrt{3}, \\frac{16}{\\sqrt{\\pi }}, -6, \\frac{11}{2}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -9, -8, 2, (7/(math.sqrt(math.pi))), (9/math.pi), -1, 5*math.sqrt(3), (16/(math.sqrt(math.pi))), -6, (11/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 4, -4, -10, 10}$.\n", - "Output Answer": [ - "$\\frac{1}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 4, -4, -10, 10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -5, 4, 0, -7, 2}$.\n", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -5, 4, 0, -7, 2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6 \\sqrt{2}, 8, 8, -e, 10.}$.\n", - "Output Answer": [ - "${-e, 8, 8, 6 \\sqrt{2}, 10.}$" - ], - "Output Program": [ - "import math\n\nvalues = 6*math.sqrt(2), 8, 8, -math.e, 10.\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\sqrt{5}, 4, -2, 3, -10 \\log (2)} \\setminus {-2, 6, 3, 5}$.\n", - "Output Answer": [ - "${-10 \\log (2), -2 \\sqrt{5}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(5), 4, -2, 3, -10*math.log(2),))\nsnd = set((-2, 6, 3, 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.057,0.201,0.078,0.035,0.09,0.061,0.275,0.045,0.066,0.04\\}$ and $\\{0.094,0.037,0.186,0.119,0.053,0.085,0.099,0.037,0.039,0.116\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.057, 0.201, 0.078, 0.035, 0.09, 0.061, 0.275, 0.045, 0.066, 0.04\ndistribution2 = 0.094, 0.037, 0.186, 0.119, 0.053, 0.085, 0.099, 0.037, 0.039, 0.116\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 11, 19, 13}$.\n", - "Output Answer": [ - "$\\frac{2717}{202}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 11, 19, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 2, 17}$.\n", - "Output Answer": [ - "$\\frac{119}{25}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 2, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -2 \\sqrt{2}, -9, \\frac{32}{5}, -8, 2, -\\frac{18}{\\sqrt{5}}, -2 \\pi, 6 \\sqrt{2}, \\frac{21}{e}, 0, 0, \\frac{17}{\\pi }}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -2*math.sqrt(2), -9, (32/5), -8, 2, -(18/(math.sqrt(5))), -2*math.pi, 6*math.sqrt(2), (21/math.e), 0, 0, (17/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 6, 6, 9, 9, 9, 7, 7, 9, -3, -3, 7, 9, 7, 9, 6, 7, -3, 6, 7, -3, 7, 6, 9, 7, 7, 6, 9}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 6, 6, 9, 9, 9, 7, 7, 9, -3, -3, 7, 9, 7, 9, 6, 7, -3, 6, 7, -3, 7, 6, 9, 7, 7, 6, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, -\\frac{58}{7}, \\frac{10}{7}, -\\frac{18}{7}, 3, \\frac{15}{7}} \\cap {-\\frac{45}{7}, -\\frac{58}{7}, 3, -\\frac{57}{7}, \\frac{61}{7}, -8, -\\frac{60}{7}, -\\frac{18}{7}}$.\n", - "Output Answer": [ - "${-\\frac{58}{7}, -8, -\\frac{18}{7}, 3}$" - ], - "Output Program": [ - "fst = set((-8, -(58/7), (10/7), -(18/7), 3, (15/7),))\nsnd = set((-(45/7), -(58/7), 3, -(57/7), (61/7), -8, -(60/7), -(18/7),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{14}{\\pi }, 2 \\sqrt{5}, 6, -4} \\cup {-4, -\\frac{28}{\\pi }, \\sqrt{5}, 6}$.\n", - "Output Answer": [ - "${-\\frac{28}{\\pi }, -4, \\sqrt{5}, \\frac{14}{\\pi }, 2 \\sqrt{5}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set(((14/math.pi), 2*math.sqrt(5), 6, -4,))\nsnd = set((-4, -(28/math.pi), math.sqrt(5), 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 8, 1, 7, -4, -13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1474}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 8, 1, 7, -4, -13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 2, -10, 6, -11}$.\n", - "Output Answer": [ - "$\\frac{583}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 2, -10, 6, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6 \\sqrt{2}, 5 \\sqrt{2}, 6 \\sqrt{2}, -7 \\sqrt{2}, -3 \\sqrt{2}, 6 \\sqrt{2}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -6*math.sqrt(2), 5*math.sqrt(2), 6*math.sqrt(2), -7*math.sqrt(2), -3*math.sqrt(2), 6*math.sqrt(2), 6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, 1, -9}$.\n", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, 1, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4 \\sqrt{3}, 9, 2}$.\n", - "Output Answer": [ - "$9+4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(3), 9, 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 5, 6, -3, 1, 3, 0, 3, 5, 5, 3, 6, 6, 5, 5, 9, -3, 6, 6, 0, 6, 1, 5, 1, 0, 3, 1, -3, 5, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 5, 6, -3, 1, 3, 0, 3, 5, 5, 3, 6, 6, 5, 5, 9, -3, 6, 6, 0, 6, 1, 5, 1, 0, 3, 1, -3, 5, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-59049, 1, 81, -3, 64, -4}$.\n", - "Output Answer": [ - "$18 \\sqrt[6]{-1} \\sqrt[3]{2} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -59049, 1, 81, -3, 64, -4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 e, 2 e, 2 e, 2 e, 2 e, 2 e, 0, -e, -e, 2 e, 2 e, 2 e, 0, 0, 2 e, 2 e, -e, 2 e, 0, 2 e, 2 e, 2 e, -e, 2 e, 0, -e, 2 e}$.\n", - "Output Answer": [ - "$\\{2 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.e, 2*math.e, 2*math.e, 2*math.e, 2*math.e, 2*math.e, 0, -math.e, -math.e, 2*math.e, 2*math.e, 2*math.e, 0, 0, 2*math.e, 2*math.e, -math.e, 2*math.e, 0, 2*math.e, 2*math.e, 2*math.e, -math.e, 2*math.e, 0, -math.e, 2*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-9, 5}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, -5, 14, 6, -2, -4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{994}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -5, 14, 6, -2, -4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, \\frac{2}{\\sqrt{5}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{2}{\\sqrt{5}}-7\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, (2/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.094,0.273,0.168,0.047,0.158,0.024,0.02\\}$ and $\\{0.225,0.031,0.087,0.046,0.059,0.325,0.191\\}$.", - "Output Answer": [ - "$1.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.094, 0.273, 0.168, 0.047, 0.158, 0.024, 0.02\ndistribution2 = 0.225, 0.031, 0.087, 0.046, 0.059, 0.325, 0.191\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, \\frac{43}{7}, -5 \\sqrt{3}, 2, 2, -7, -1, -7}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, (43/7), -5*math.sqrt(3), 2, 2, -7, -1, -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, 2 \\sqrt{3}, 5, 8, 0, -\\frac{27}{\\pi }, -2 \\sqrt{5}, -\\frac{11}{e}, -7, -4}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, 2*math.sqrt(3), 5, 8, 0, -(27/math.pi), -2*math.sqrt(5), -(11/math.e), -7, -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 11, 9, -14, 2}$.\n", - "Output Answer": [ - "$\\frac{1303}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 11, 9, -14, 2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\sqrt{5}, -\\frac{39}{5}, \\frac{49}{5}, 10, -\\frac{32}{7}, -5, 2.51} \\cup {2.51, -5, 6, -2 \\sqrt{5}, 7, -\\frac{32}{7}, -7}$.\n", - "Output Answer": [ - "${-\\frac{39}{5}, -7, -5, -\\frac{32}{7}, -2 \\sqrt{5}, 2.51, 6, 7, \\frac{49}{5}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(5), -(39/5), (49/5), 10, -(32/7), -5, 2.51,))\nsnd = set((2.51, -5, 6, -2*math.sqrt(5), 7, -(32/7), -7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.99 < -1.3 x^2-2.5 x+3. < 1.64$ where $x \\sim $ \\text{NormalDistribution}[0.9,1.].", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.9, 1.)\nprint(P((-0.99 < -1.3*x**2-2.5*x+3.) & (-1.3*x**2-2.5*x+3. < 1.64)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 10000, 10, -6}$.\n", - "Output Answer": [ - "$(100+100 i) \\sqrt[4]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 10000, 10, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, 12, -8, 8, 10, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{3077}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 12, -8, 8, 10, -9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, \\frac{29}{4}, 6, 6, 6, -2, \\frac{37}{4}, \\frac{37}{4}, -2, \\frac{29}{4}, \\frac{29}{4}, -2, \\frac{29}{4}, 6, -2, 6, -2, \\frac{29}{4}, 6, -2, \\frac{37}{4}, \\frac{29}{4}}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, (29/4), 6, 6, 6, -2, (37/4), (37/4), -2, (29/4), (29/4), -2, (29/4), 6, -2, 6, -2, (29/4), 6, -2, (37/4), (29/4)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, -3, -6, 6.7, -\\frac{31}{\\pi }, -\\frac{13}{e}, \\frac{20}{\\pi }, 9} \\cup {\\frac{20}{\\pi }, 9, -9, -3, 10, 6.7, -\\frac{13}{e}, 4, -\\frac{13}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{31}{\\pi }, -9, -6, -\\frac{13}{e}, -\\frac{13}{\\pi }, -3, -2, 4, \\frac{20}{\\pi }, 6.7, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -3, -6, 6.7, -(31/math.pi), -(13/math.e), (20/math.pi), 9,))\nsnd = set(((20/math.pi), 9, -9, -3, 10, 6.7, -(13/math.e), 4, -(13/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 7, \\frac{11}{7}, 8, -2 \\sqrt{2}, 2 \\sqrt{5}, -2 \\sqrt{5}, -\\frac{4}{3}, -4, 8, -\\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$8+\\frac{13}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 7, (11/7), 8, -2*math.sqrt(2), 2*math.sqrt(5), -2*math.sqrt(5), -(4/3), -4, 8, -(13/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x^2+0.5 x-1.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.7]\n", - "Output Answer": [ - "$8.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.7)\nprint(E(2.3*x**2+0.5*x-1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.844,0.137,0.019\\}$ and $\\{0.082,0.318,0.251\\}$.", - "Output Answer": [ - "$1.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.844, 0.137, 0.019\ndistribution2 = 0.082, 0.318, 0.251\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.416,0.057,0.006,0.012\\}$ and $\\{0.459,0.151,0.113,0.204\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.416, 0.057, 0.006, 0.012\ndistribution2 = 0.459, 0.151, 0.113, 0.204\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 13, -14, -13, 8, 0}$.\n", - "Output Answer": [ - "$\\frac{1187}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 13, -14, -13, 8, 0\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, -6, 3, -6, 2, -6}$.\n", - "Output Answer": [ - "$-\\frac{5}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, -6, 3, -6, 2, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -\\frac{11}{\\sqrt{2}}, 0, -\\frac{11}{\\sqrt{2}}, 0, \\frac{5}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, 0, \\frac{5}{\\sqrt{2}}, 0, \\frac{5}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}, 0, \\frac{5}{\\sqrt{2}}, 0, 0, -\\frac{11}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, -(11/(math.sqrt(2))), 0, -(11/(math.sqrt(2))), 0, (5/(math.sqrt(2))), -(11/(math.sqrt(2))), (3/(math.sqrt(2))), 0, (5/(math.sqrt(2))), 0, (5/(math.sqrt(2))), (5/(math.sqrt(2))), -(11/(math.sqrt(2))), 0, (5/(math.sqrt(2))), 0, 0, -(11/(math.sqrt(2))), -(11/(math.sqrt(2))), (5/(math.sqrt(2))), (5/(math.sqrt(2))), 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, 0, 9.3, -3 \\sqrt{2}, \\frac{11}{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, 0, 0, \\frac{11}{2}, 9.3}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 0, 9.3, -3*math.sqrt(2), (11/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, -8, -1, 5, 7}$.\n", - "Output Answer": [ - "$\\frac{4}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, -8, -1, 5, 7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{7}{\\sqrt{3}}, 5.1, \\frac{52}{7}, \\frac{10}{\\sqrt{\\pi }}, 8.6, 8, 0} \\setminus {-9, \\frac{10}{\\sqrt{\\pi }}, -5 \\sqrt{2}, \\frac{7}{\\sqrt{3}}, -6, 1, -9.6, 8}$.\n", - "Output Answer": [ - "${0, 5.1, \\frac{52}{7}, 8.6}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/(math.sqrt(3))), 5.1, (52/7), (10/(math.sqrt(math.pi))), 8.6, 8, 0,))\nsnd = set((-9, (10/(math.sqrt(math.pi))), -5*math.sqrt(2), (7/(math.sqrt(3))), -6, 1, -9.6, 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{3}{4}, \\frac{19}{2}, \\frac{19}{4}, \\frac{19}{2}, \\frac{19}{4}, -\\frac{3}{4}, \\frac{19}{2}, \\frac{19}{2}, -4, -\\frac{23}{4}, -\\frac{3}{4}, -4, -\\frac{23}{4}, -\\frac{3}{4}, -\\frac{3}{4}, -\\frac{3}{4}, -4, -\\frac{23}{4}, -4, \\frac{19}{4}, -\\frac{23}{4}, -\\frac{3}{4}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{3}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(3/4), (19/2), (19/4), (19/2), (19/4), -(3/4), (19/2), (19/2), -4, -(23/4), -(3/4), -4, -(23/4), -(3/4), -(3/4), -(3/4), -4, -(23/4), -4, (19/4), -(23/4), -(3/4)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7.872, -1.2, -\\frac{19}{2}, -\\frac{21}{e}, 4, 6} \\cup {-\\frac{21}{e}, 4, 7.872, -1.2, 6, -\\frac{19}{2}}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -\\frac{21}{e}, -1.2, 4, 6, 7.872}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.872, -1.2, -(19/2), -(21/math.e), 4, 6,))\nsnd = set((-(21/math.e), 4, 7.872, -1.2, 6, -(19/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.9 x^2-0.4 x+1.8$ where $x \\sim $ \\text{NormalDistribution}[1.1,2.4]\n", - "Output Answer": [ - "$-32.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.1, 2.4)\nprint(E(-4.9*x**2-0.4*x+1.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{6}{\\sqrt{\\pi }}, 0, -8, 5, \\frac{31}{4}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{63}{4}$" - ], - "Output Program": [ - "import math\n\nvalues = (6/(math.sqrt(math.pi))), 0, -8, 5, (31/4), -3*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{1}{\\pi }, 0, 3, -\\frac{13}{2}, \\frac{40}{7}, 3 e, \\frac{27}{e}, 2 \\sqrt{5}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}+\\frac{27}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = (1/math.pi), 0, 3, -(13/2), (40/7), 3*math.e, (27/math.e), 2*math.sqrt(5), -4*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -1, 10, -4, -1, -6}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -1, 10, -4, -1, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, 4, 0, \\frac{54}{7}, -4, 5 \\sqrt{2}, -7}$.\n", - "Output Answer": [ - "${-7, -4, 0, 4, 5, 5 \\sqrt{2}, \\frac{54}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 4, 0, (54/7), -4, 5*math.sqrt(2), -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.7 x-2.3$ where $x \\sim $ \\text{BetaDistribution}[1.5,2.]\n", - "Output Answer": [ - "$-2.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 2.)\nprint(E(0.7*x-2.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{\\sqrt{2}}, -\\frac{50}{7}, 9, -\\frac{27}{4}, -\\frac{23}{3}, 2} \\setminus {-\\frac{23}{3}, \\frac{3}{\\sqrt{2}}, -\\frac{50}{7}, 2, -\\frac{37}{7}, -5}$.\n", - "Output Answer": [ - "${-\\frac{27}{4}, 9, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/(math.sqrt(2))), -(50/7), 9, -(27/4), -(23/3), 2,))\nsnd = set((-(23/3), (3/(math.sqrt(2))), -(50/7), 2, -(37/7), -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{7}{4}, 8, -9, 7} \\setminus {-\\frac{24}{e}, -\\frac{39}{4}, 8, 0, 3 \\pi, 10}$.\n", - "Output Answer": [ - "${-9, \\frac{7}{4}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/4), 8, -9, 7,))\nsnd = set((-(24/math.e), -(39/4), 8, 0, 3*math.pi, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 2, -7}$.\n", - "Output Answer": [ - "$-\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 2, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -7 \\sqrt{2}, 0, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -7*math.sqrt(2), 0, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 5, -6, 5 \\sqrt{3}, 1, \\frac{13}{2}}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 5, -6, 5*math.sqrt(3), 1, (13/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 1, -9, -9, 1, 8, -3, -3, -7, 8, 1, -9, -7, 8, 5, 1, -9, -7, 1, 1, -9}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 1, -9, -9, 1, 8, -3, -3, -7, 8, 1, -9, -7, 8, 5, 1, -9, -7, 1, 1, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.6 x^3+2.1 x^2+3. x+4.3$ where $x \\sim $ \\text{BetaDistribution}[0.9,1.9]\n", - "Output Answer": [ - "$5.16$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.9, 1.9)\nprint(E(-4.6*x**3+2.1*x**2+3.*x+4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -1, -6, -3}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "values = 1, -1, -6, -3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, \\frac{38}{7}, 7, \\frac{10}{\\pi }, -4, -4 \\sqrt{3}, -2, -\\sqrt{2}, -\\frac{26}{3}, -8, -\\frac{11}{2}}$.\n", - "Output Answer": [ - "$\\frac{47}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (38/7), 7, (10/math.pi), -4, -4*math.sqrt(3), -2, -math.sqrt(2), -(26/3), -8, -(11/2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, \\frac{16}{e}, 1, -\\frac{24}{\\pi }, 5, \\frac{21}{e}, 4} \\cup {-\\frac{8}{e}, 5, \\frac{25}{e}, \\frac{6}{\\pi }, -2, 4, 1}$.\n", - "Output Answer": [ - "${-\\frac{24}{\\pi }, -5, -\\frac{8}{e}, -2, 1, \\frac{6}{\\pi }, 4, 5, \\frac{16}{e}, \\frac{21}{e}, \\frac{25}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, (16/math.e), 1, -(24/math.pi), 5, (21/math.e), 4,))\nsnd = set((-(8/math.e), 5, (25/math.e), (6/math.pi), -2, 4, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{37}{5}, \\frac{1}{5}, \\frac{22}{5}}$.\n", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (37/5), (1/5), (22/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\sqrt{2}, 0, -3 \\sqrt{2}, -5 \\sqrt{2}, 4 \\sqrt{2}, 0, 0, 2 \\sqrt{2}, -3 \\sqrt{2}, 4 \\sqrt{2}, -5 \\sqrt{2}, \\sqrt{2}, -4 \\sqrt{2}, -3 \\sqrt{2}, 2 \\sqrt{2}, -3 \\sqrt{2}, 4 \\sqrt{2}, -4 \\sqrt{2}, -4 \\sqrt{2}, 2 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, 2 \\sqrt{2}, -3 \\sqrt{2}, 2 \\sqrt{2}, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.sqrt(2), 0, -3*math.sqrt(2), -5*math.sqrt(2), 4*math.sqrt(2), 0, 0, 2*math.sqrt(2), -3*math.sqrt(2), 4*math.sqrt(2), -5*math.sqrt(2), math.sqrt(2), -4*math.sqrt(2), -3*math.sqrt(2), 2*math.sqrt(2), -3*math.sqrt(2), 4*math.sqrt(2), -4*math.sqrt(2), -4*math.sqrt(2), 2*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), 2*math.sqrt(2), -3*math.sqrt(2), 2*math.sqrt(2), 2*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, 7, -10, 4, -9, 9, 3 \\sqrt{5}} \\cup {-2, 4, -7, 2, -\\frac{30}{7}, 7, 3 \\sqrt{5}, \\frac{13}{2}}$.\n", - "Output Answer": [ - "${-10, -9, -7, -\\frac{30}{7}, -2, 2, 4, \\frac{13}{2}, 3 \\sqrt{5}, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 7, -10, 4, -9, 9, 3*math.sqrt(5),))\nsnd = set((-2, 4, -7, 2, -(30/7), 7, 3*math.sqrt(5), (13/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{38}{7}, 2 \\pi, \\frac{12}{\\sqrt{\\pi }}, 5, 3, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}+\\frac{12}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (38/7), 2*math.pi, (12/(math.sqrt(math.pi))), 5, 3, -4*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8.838, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${3 \\sqrt{5}, 8.838}$" - ], - "Output Program": [ - "import math\n\nvalues = 8.838, 3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -6, -14}$.\n", - "Output Answer": [ - "$64$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -6, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{4}, 0, -2 \\pi, -6, \\frac{6}{\\sqrt{\\pi }}, 2, \\pi, -\\frac{13}{\\sqrt{2}}, -9, 5, 10}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (13/4), 0, -2*math.pi, -6, (6/(math.sqrt(math.pi))), 2, math.pi, -(13/(math.sqrt(2))), -9, 5, 10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, -6, \\pi, 0, 4.528, -2 \\sqrt{3}, 7, 5} \\setminus {-3, 3, 9, 0, 4.528, 7, -2 \\sqrt{3}, 2 \\pi, -6}$.\n", - "Output Answer": [ - "${\\pi, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -6, math.pi, 0, 4.528, -2*math.sqrt(3), 7, 5,))\nsnd = set((-3, 3, 9, 0, 4.528, 7, -2*math.sqrt(3), 2*math.pi, -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.133,0.115,0.082\\}$ and $\\{0.088,0.128,0.329\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.133, 0.115, 0.082\ndistribution2 = 0.088, 0.128, 0.329\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{27}{\\pi }, 3, 8, 9.05} \\setminus {8, 5, \\frac{16}{3}, 9.68, -6, 4 \\sqrt{2}, -3}$.\n", - "Output Answer": [ - "${-\\frac{27}{\\pi }, 3, 9.05}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(27/math.pi), 3, 8, 9.05,))\nsnd = set((8, 5, (16/3), 9.68, -6, 4*math.sqrt(2), -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{3}, -\\frac{8}{\\sqrt{5}}, -8, -9, -8, -\\frac{10}{3}, -8, -9, 2 e, -\\frac{11}{\\sqrt{3}}, 3, 10, 0, 0, 7}$.", - "Output Answer": [ - "$-\\frac{10}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/3), -(8/(math.sqrt(5))), -8, -9, -8, -(10/3), -8, -9, 2*math.e, -(11/(math.sqrt(3))), 3, 10, 0, 0, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.7 x+0.5$ where $x \\sim $ \\text{BetaDistribution}[1.1,0.5]\n", - "Output Answer": [ - "$0.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.1, 0.5)\nprint(E(0.7*x+0.5))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, 9, -7, -2, 4, -9, 1, 5, 7} \\cap {-4, -8, -9, 6, -7, -2, 10, 9, -3}$.\n", - "Output Answer": [ - "${-9, -7, -2, 9}$" - ], - "Output Program": [ - "fst = set((3, 9, -7, -2, 4, -9, 1, 5, 7,))\nsnd = set((-4, -8, -9, 6, -7, -2, 10, 9, -3,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 19, 14}$.\n", - "Output Answer": [ - "$\\frac{3591}{215}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 19, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, 0, 9, -2, -4, \\frac{22}{\\pi }, -\\sqrt{2}} \\setminus {-\\sqrt{2}, -4, 9, -4.4, 5, -3}$.\n", - "Output Answer": [ - "${-2, 0, \\frac{22}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 0, 9, -2, -4, (22/math.pi), -math.sqrt(2),))\nsnd = set((-math.sqrt(2), -4, 9, -4.4, 5, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -6, 5 \\sqrt{2}}$.", - "Output Answer": [ - "$-6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -6, 5*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, -\\frac{20}{3}, 0, -3 \\sqrt{2}, 10, 9.035, 3 \\pi, -5} \\cup {9.035, 3 \\pi, -8, 2, 10, -\\sqrt{2}, -2, -6, 0}$.\n", - "Output Answer": [ - "${-8, -\\frac{20}{3}, -6, -5, -3 \\sqrt{2}, -2, -\\sqrt{2}, 0, 2, 9.035, 3 \\pi, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -(20/3), 0, -3*math.sqrt(2), 10, 9.035, 3*math.pi, -5,))\nsnd = set((9.035, 3*math.pi, -8, 2, 10, -math.sqrt(2), -2, -6, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, -\\frac{5}{\\sqrt{2}}, 5, 10}$.\n", - "Output Answer": [ - "${-8, -\\frac{5}{\\sqrt{2}}, 5, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -(5/(math.sqrt(2))), 5, 10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -9, -7, -7, 7, 7, -1, -1, -9, -1, -1, -7, -2, -2, -2, 7, -2, -2, -9, 7, -1}$.\n", - "Output Answer": [ - "$\\{-1,-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -9, -7, -7, 7, 7, -1, -1, -9, -1, -1, -7, -2, -2, -2, 7, -2, -2, -9, 7, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, \\frac{13}{\\pi }, -\\frac{13}{4}, -3, -2, 0} \\cup {-6, -\\frac{13}{4}, \\frac{13}{\\pi }, 3 \\pi, 0, 3}$.\n", - "Output Answer": [ - "${-6, -\\frac{13}{4}, -3, -2, 0, 3, \\frac{13}{\\pi }, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, (13/math.pi), -(13/4), -3, -2, 0,))\nsnd = set((-6, -(13/4), (13/math.pi), 3*math.pi, 0, 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -3, 531441, 729, 1, 16}$.\n", - "Output Answer": [ - "$27 \\sqrt[6]{-3} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -3, 531441, 729, 1, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.158,0.076,0.193,0.112,0.09,0.289\\}$ and $\\{0.011,0.066,0.143,0.57,0.033,0.116\\}$.", - "Output Answer": [ - "$0.74$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.158, 0.076, 0.193, 0.112, 0.09, 0.289\ndistribution2 = 0.011, 0.066, 0.143, 0.57, 0.033, 0.116\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -4, 3, 4}$.\n", - "Output Answer": [ - "$\\frac{155}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -4, 3, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{19}{3}, -6}$.", - "Output Answer": [ - "$-\\frac{37}{6}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -(19/3), -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, -1000, 16, 25}$.\n", - "Output Answer": [ - "$80 \\sqrt[4]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, -1000, 16, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{5}, -4 \\log (2), -4.89, 3, -3 \\pi, -8, 7 \\log (2), -5, -6 \\sqrt{2}} \\cup {7 \\log (2), -3 \\pi, -3 \\sqrt{5}, -5, -11 \\log (2), -6 \\sqrt{2}, 5.901, 9, 7}$.\n", - "Output Answer": [ - "${-3 \\pi, -6 \\sqrt{2}, -8, -11 \\log (2), -3 \\sqrt{5}, -5, -4.89, -4 \\log (2), 3, 7 \\log (2), 5.901, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(5), -4*math.log(2), -4.89, 3, -3*math.pi, -8, 7*math.log(2), -5, -6*math.sqrt(2),))\nsnd = set((7*math.log(2), -3*math.pi, -3*math.sqrt(5), -5, -11*math.log(2), -6*math.sqrt(2), 5.901, 9, 7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, \\frac{55}{7}, -3 \\sqrt{5}, -5, -7, \\frac{11}{\\sqrt{5}}, \\pi, \\sqrt{2}, \\frac{25}{\\pi }, \\log (2), 7, -3, -1, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$10+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, (55/7), -3*math.sqrt(5), -5, -7, (11/(math.sqrt(5))), math.pi, math.sqrt(2), (25/math.pi), math.log(2), 7, -3, -1, -4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x^3+5. x^2+3. x+1.7$ where $x \\sim $ \\text{BetaDistribution}[2.,1.]\n", - "Output Answer": [ - "$7.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 2., 1.)\nprint(E(3.9*x**3+5.*x**2+3.*x+1.7))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, -9, 10, -7, 3, -6} \\cap {-7, -2, -8, 0, -6, 7, -3, 10}$.\n", - "Output Answer": [ - "${-8, -7, -6, 10}$" - ], - "Output Program": [ - "fst = set((-8, -9, 10, -7, 3, -6,))\nsnd = set((-7, -2, -8, 0, -6, 7, -3, 10,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8.876, 10, -7.729, \\frac{31}{\\pi }, -\\frac{38}{7}, \\frac{1}{\\sqrt{\\pi }}, -3} \\setminus {-\\frac{38}{7}, 7, \\frac{27}{\\pi }, -7.729, 8.876, -5}$.\n", - "Output Answer": [ - "${-3, \\frac{1}{\\sqrt{\\pi }}, \\frac{31}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.876, 10, -7.729, (31/math.pi), -(38/7), (1/(math.sqrt(math.pi))), -3,))\nsnd = set((-(38/7), 7, (27/math.pi), -7.729, 8.876, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{2}, -3, 9, -9, 9}$.\n", - "Output Answer": [ - "${-9, -3, 2 \\sqrt{2}, 9, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(2), -3, 9, -9, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{50}{7}, \\frac{10}{7}, \\frac{59}{7}, 8, \\frac{18}{7}, -\\frac{48}{7}, -7, \\frac{8}{7}}$.\n", - "Output Answer": [ - "$\\frac{13}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (50/7), (10/7), (59/7), 8, (18/7), -(48/7), -7, (8/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, -2, -8, -6, 10} \\cup {-4, 3, 7, -5, -6}$.\n", - "Output Answer": [ - "${-8, -6, -5, -4, -2, 3, 7, 10}$" - ], - "Output Program": [ - "fst = set((7, -2, -8, -6, 10,))\nsnd = set((-4, 3, 7, -5, -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{13}{e}, \\frac{13}{e}, 6., -4, 5, -\\frac{5}{2}, 7 \\sqrt{2}, -\\frac{22}{3}, -2 e, 6 \\sqrt{2}} \\cup {-\\frac{7}{2}, 6., -3 e, -4, 6 \\sqrt{2}, 7 \\sqrt{2}, -e}$.\n", - "Output Answer": [ - "${-3 e, -\\frac{22}{3}, -2 e, -\\frac{13}{e}, -4, -\\frac{7}{2}, -e, -\\frac{5}{2}, \\frac{13}{e}, 5, 6., 6 \\sqrt{2}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/math.e), (13/math.e), 6., -4, 5, -(5/2), 7*math.sqrt(2), -(22/3), -2*math.e, 6*math.sqrt(2),))\nsnd = set((-(7/2), 6., -3*math.e, -4, 6*math.sqrt(2), 7*math.sqrt(2), -math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 10000, 216, 6561}$.\n", - "Output Answer": [ - "$810\\ 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 10000, 216, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^2-1.6 x+4.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.2]\n", - "Output Answer": [ - "$3.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(E(0.4*x**2-1.6*x+4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 0, -3 \\sqrt{3}, -\\frac{3}{\\sqrt{2}}, 8, 2, -6}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 0, -3*math.sqrt(3), -(3/(math.sqrt(2))), 8, 2, -6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 3, 8, \\frac{10}{\\sqrt{\\pi }}, 0, -3 \\pi, -1, -\\frac{66}{7}, 6, 2, \\sqrt{3}, -3}$.\n", - "Output Answer": [ - "$\\frac{122}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 3, 8, (10/(math.sqrt(math.pi))), 0, -3*math.pi, -1, -(66/7), 6, 2, math.sqrt(3), -3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x-4.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$-4.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(1.9*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, \\frac{26}{7}, 4.3, 3, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, 3, \\frac{26}{7}, 4.3, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, (26/7), 4.3, 3, -2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.005,0.062,0.019,0.054,0.086,0.022,0.031,0.515\\}$ and $\\{0.047,0.049,0.496,0.058,0.113,0.036,0.082,0.107\\}$.", - "Output Answer": [ - "$1.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.005, 0.062, 0.019, 0.054, 0.086, 0.022, 0.031, 0.515\ndistribution2 = 0.047, 0.049, 0.496, 0.058, 0.113, 0.036, 0.082, 0.107\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, \\frac{17}{\\sqrt{\\pi }}, 4 \\sqrt{5}, \\pi, -9} \\setminus {-2 \\sqrt{5}, \\frac{14}{\\sqrt{\\pi }}, 7, -9, \\pi}$.\n", - "Output Answer": [ - "${4 \\sqrt{5}, \\frac{17}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, (17/(math.sqrt(math.pi))), 4*math.sqrt(5), math.pi, -9,))\nsnd = set((-2*math.sqrt(5), (14/(math.sqrt(math.pi))), 7, -9, math.pi,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\sqrt{2}, \\frac{1}{\\pi }, \\frac{20}{\\pi }, \\frac{7}{\\sqrt{3}}, 6 \\sqrt{2}, 2, -3, -\\frac{2}{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2+\\frac{1}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.sqrt(2), (1/math.pi), (20/math.pi), (7/(math.sqrt(3))), 6*math.sqrt(2), 2, -3, -(2/3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{2}, \\frac{17}{3}, 8, 10, -6, \\sqrt{5}} \\setminus {\\sqrt{5}, -6, 10, \\frac{17}{3}, -3, -\\frac{27}{4}}$.\n", - "Output Answer": [ - "${\\frac{13}{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/2), (17/3), 8, 10, -6, math.sqrt(5),))\nsnd = set((math.sqrt(5), -6, 10, (17/3), -3, -(27/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2 e, 6, -6 \\sqrt{2}, -\\frac{11}{\\pi }, -1, 5, 5., -5.96} \\cup {2 e, 5, -5.96, -\\frac{3}{\\pi }, -1, -1.214}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -5.96, -\\frac{11}{\\pi }, -1.214, -1, -\\frac{3}{\\pi }, 5., 5, 2 e, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.e, 6, -6*math.sqrt(2), -(11/math.pi), -1, 5, 5., -5.96,))\nsnd = set((2*math.e, 5, -5.96, -(3/math.pi), -1, -1.214,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, -9, -14}$.\n", - "Output Answer": [ - "$\\frac{7}{\\sqrt{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -9, -14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -1, -1, -8, -8, -8, -5, 6, 6, 6, -1, -1, 6, 6, -8, -1, 6, 7, -5, -1, -8, -8, 6, -1, 6, -9}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -1, -1, -8, -8, -8, -5, 6, 6, 6, -1, -1, 6, 6, -8, -1, 6, 7, -5, -1, -8, -8, 6, -1, 6, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.125,0.15,0.177,0.05,0.114,0.052\\}$ and $\\{0.074,0.39,0.035,0.13,0.207,0.027\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.125, 0.15, 0.177, 0.05, 0.114, 0.052\ndistribution2 = 0.074, 0.39, 0.035, 0.13, 0.207, 0.027\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.192,0.416,0.036\\}$ and $\\{0.007,0.101,0.002\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.192, 0.416, 0.036\ndistribution2 = 0.007, 0.101, 0.002\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -3, -9, 2, -7, 2, -5}$.\n", - "Output Answer": [ - "$-\\frac{25}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -3, -9, 2, -7, 2, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{58}{3}, \\frac{56}{3}, \\frac{47}{3}}$.\n", - "Output Answer": [ - "$\\frac{76328}{4303}$" - ], - "Output Program": [ - "import statistics\nvalues = (58/3), (56/3), (47/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, 2 \\pi, -3, -\\frac{18}{e}, -4, 7, -6}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, 2*math.pi, -3, -(18/math.e), -4, 7, -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.153,0.019,0.159,0.247,0.108,0.108,0.106\\}$ and $\\{0.01,0.009,0.07,0.496,0.101,0.043,0.254\\}$.", - "Output Answer": [ - "$0.54$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.153, 0.019, 0.159, 0.247, 0.108, 0.108, 0.106\ndistribution2 = 0.01, 0.009, 0.07, 0.496, 0.101, 0.043, 0.254\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x-1.6$ where $x \\sim $ \\text{ExponentialDistribution}[0.7]\n", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.7)\nprint(E(1.4*x-1.6))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -2, -3 e, 14 \\log (2), -2 \\sqrt{3}} \\setminus {-5, 2 \\sqrt{3}, 4, 14 \\log (2), \\frac{21}{\\pi }}$.\n", - "Output Answer": [ - "${-3 e, -2 \\sqrt{3}, -2, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -2, -3*math.e, 14*math.log(2), -2*math.sqrt(3),))\nsnd = set((-5, 2*math.sqrt(3), 4, 14*math.log(2), (21/math.pi),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, -6, 0, 3, 5, 6, 2} \\cap {1, 4, 8, 3, -8, 0}$.\n", - "Output Answer": [ - "${0, 3}$" - ], - "Output Program": [ - "fst = set((-9, -6, 0, 3, 5, 6, 2,))\nsnd = set((1, 4, 8, 3, -8, 0,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 17, 19}$.\n", - "Output Answer": [ - "$\\frac{13566}{827}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 17, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x-2.7$ where $x \\sim $ \\text{NormalDistribution}[-2.,2.]\n", - "Output Answer": [ - "$-5.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -2., 2.)\nprint(E(1.3*x-2.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -6, \\frac{17}{2}, 8, \\frac{1}{2}, -\\frac{1}{\\sqrt{2}}, 3, 8, -2 \\sqrt{2}, -9, -1, -2 e, -9}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -6, (17/2), 8, (1/2), -(1/(math.sqrt(2))), 3, 8, -2*math.sqrt(2), -9, -1, -2*math.e, -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 3, 4}$.\n", - "Output Answer": [ - "$\\frac{7}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 3, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, -4 \\sqrt{3}, -\\frac{39}{5}, 6, -8, -4 \\sqrt{2}, 4, 10}$.\n", - "Output Answer": [ - "${-8, -\\frac{39}{5}, -4 \\sqrt{3}, -4 \\sqrt{2}, 3, 4, 6, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -4*math.sqrt(3), -(39/5), 6, -8, -4*math.sqrt(2), 4, 10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\pi, 7, 8, -3 \\sqrt{2}, -8, \\pi, 9, 5, 4, -3, 4, 0, -\\frac{21}{\\sqrt{5}}}$.", - "Output Answer": [ - "$\\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.pi, 7, 8, -3*math.sqrt(2), -8, math.pi, 9, 5, 4, -3, 4, 0, -(21/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x^3+0.9 x^2-3.6 x+1.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.3]\n", - "Output Answer": [ - "$5.36$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(E(2.*x**3+0.9*x**2-3.6*x+1.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, 8, \\frac{6}{7}, 5, 1, -\\frac{9}{e}, -\\frac{18}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$8+\\frac{18}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 8, (6/7), 5, 1, -(9/math.e), -(18/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x^3-3. x^2+2.6 x-2.$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5]\n", - "Output Answer": [ - "$-15.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(E(-1.1*x**3-3.*x**2+2.6*x-2.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -1, -4, 4, -7, -2, -7}$.\n", - "Output Answer": [ - "$-\\frac{13}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -1, -4, 4, -7, -2, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{2}, 4 \\sqrt{2}, -4, 8}$.", - "Output Answer": [ - "$\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(2), 4*math.sqrt(2), -4, 8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{26}{e}, -8.25, -2, -\\frac{7}{2}, -4, -\\frac{16}{\\pi }, 5, -4 e} \\cup {-4, 9, 8.26, 0, -\\frac{7}{2}, -4 e, \\frac{13}{e}}$.\n", - "Output Answer": [ - "${-4 e, -\\frac{26}{e}, -8.25, -\\frac{16}{\\pi }, -4, -\\frac{7}{2}, -2, 0, \\frac{13}{e}, 5, 8.26, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(26/math.e), -8.25, -2, -(7/2), -4, -(16/math.pi), 5, -4*math.e,))\nsnd = set((-4, 9, 8.26, 0, -(7/2), -4*math.e, (13/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{69}{7}, 8, 0, -4 \\sqrt{3}, -5, 1, -8, -5, 3, \\frac{26}{e}}$.\n", - "Output Answer": [ - "$\\frac{125}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = (69/7), 8, 0, -4*math.sqrt(3), -5, 1, -8, -5, 3, (26/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.133,0.198,0.096,0.076,0.144,0.146,0.008\\}$ and $\\{0.059,0.223,0.111,0.007,0.282,0.071,0.089\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.133, 0.198, 0.096, 0.076, 0.144, 0.146, 0.008\ndistribution2 = 0.059, 0.223, 0.111, 0.007, 0.282, 0.071, 0.089\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 5, -14}$.\n", - "Output Answer": [ - "$181$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 5, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.198,0.376,0.132,0.088\\}$ and $\\{0.076,0.1,0.062,0.039\\}$.", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.198, 0.376, 0.132, 0.088\ndistribution2 = 0.076, 0.1, 0.062, 0.039\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, 1, 0, 1, 9}$.\n", - "Output Answer": [ - "${0, 1, 1, 5, 9}$" - ], - "Output Program": [ - "values = 5, 1, 0, 1, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, \\frac{27}{\\pi }, 10, 8, 8.6, 0} \\setminus {6.616, 6.1, 0, 10, -2, \\frac{27}{\\pi }, -9, 8.6, -7}$.\n", - "Output Answer": [ - "${3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, (27/math.pi), 10, 8, 8.6, 0,))\nsnd = set((6.616, 6.1, 0, 10, -2, (27/math.pi), -9, 8.6, -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.176,0.182,0.068,0.089,0.208,0.165,0.084\\}$ and $\\{0.077,0.502,0.028,0.146,0.082,0.086,0.011\\}$.", - "Output Answer": [ - "$0.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.176, 0.182, 0.068, 0.089, 0.208, 0.165, 0.084\ndistribution2 = 0.077, 0.502, 0.028, 0.146, 0.082, 0.086, 0.011\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, -2 e, \\frac{7}{3}, -9, 5} \\setminus {-9, -5, 7, -8, -2 e}$.\n", - "Output Answer": [ - "${\\frac{7}{3}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -2*math.e, (7/3), -9, 5,))\nsnd = set((-9, -5, 7, -8, -2*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{1}{2}, 7, 5, -4 \\sqrt{3}, -4 \\sqrt{2}, 0} \\setminus {-\\pi, 0, 5, 8, \\frac{1}{2}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/2), 7, 5, -4*math.sqrt(3), -4*math.sqrt(2), 0,))\nsnd = set((-math.pi, 0, 5, 8, (1/2), -4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 6, 7, -6}$.\n", - "Output Answer": [ - "$\\frac{15}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 6, 7, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x+2.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$2.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(2.7*x+2.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, -3, \\frac{3}{e}, -8, \\frac{6}{e}, 0, \\frac{29}{4}}$.\n", - "Output Answer": [ - "${-8, -3, 0, \\frac{3}{e}, \\frac{6}{e}, 4, \\frac{29}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -3, (3/math.e), -8, (6/math.e), 0, (29/4)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, -8, \\frac{25}{3}, -1, \\pi, 4, 3, -\\frac{20}{3}, -9, -\\frac{8}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -8, (25/3), -1, math.pi, 4, 3, -(20/3), -9, -(8/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{5}, -\\sqrt{5}, -\\frac{12}{e}, -4, -\\frac{39}{4}, \\frac{6}{\\sqrt{\\pi }}, \\sqrt{2}, 11 \\log (2), -\\frac{2}{3}, 10, -\\frac{16}{\\sqrt{3}}}$.", - "Output Answer": [ - "$-\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(5), -math.sqrt(5), -(12/math.e), -4, -(39/4), (6/(math.sqrt(math.pi))), math.sqrt(2), 11*math.log(2), -(2/3), 10, -(16/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 6 \\log (2), -8, -\\frac{1}{2}, -\\frac{20}{e}}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, 6*math.log(2), -8, -(1/2), -(20/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5 \\sqrt{3}, 3 \\pi, -1, 10, 1.554} \\cup {10, -5 \\sqrt{3}, -2 \\pi, 1.554, 9}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -2 \\pi, -1, 1.554, 9, 3 \\pi, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(3), 3*math.pi, -1, 10, 1.554,))\nsnd = set((10, -5*math.sqrt(3), -2*math.pi, 1.554, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-125, 16, -32768, -512, 8}$.\n", - "Output Answer": [ - "$64 \\sqrt[5]{-2} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -125, 16, -32768, -512, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8.69, 4 \\sqrt{5}, -\\frac{7}{\\pi }, 6.297, -3, -5, 3., -4, 1, 1.} \\cup {-3 \\sqrt{5}, 1, 1.7, -8, 2.86, 6.297, -\\frac{7}{\\pi }, -3}$.\n", - "Output Answer": [ - "${-8, -3 \\sqrt{5}, -5, -4, -3, -\\frac{7}{\\pi }, 1., 1, 1.7, 2.86, 3., 6.297, 8.69, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.69, 4*math.sqrt(5), -(7/math.pi), 6.297, -3, -5, 3., -4, 1, 1.,))\nsnd = set((-3*math.sqrt(5), 1, 1.7, -8, 2.86, 6.297, -(7/math.pi), -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{11}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -5*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-5, 27, -729}$.\n", - "Output Answer": [ - "$27 \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 27, -729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{3}{e}, -\\frac{3}{e}, -\\frac{12}{e}, -\\frac{25}{e}, \\frac{5}{e}, -\\frac{25}{e}, -\\frac{12}{e}, -\\frac{3}{e}, -\\frac{12}{e}, -\\frac{18}{e}, -\\frac{18}{e}, \\frac{5}{e}, -\\frac{25}{e}, -\\frac{12}{e}, -\\frac{3}{e}, -\\frac{18}{e}, -\\frac{12}{e}, -\\frac{18}{e}, \\frac{5}{e}, -\\frac{12}{e}, -\\frac{12}{e}, -\\frac{12}{e}, -\\frac{18}{e}, -\\frac{12}{e}, \\frac{5}{e}, -\\frac{3}{e}, -\\frac{3}{e}, -\\frac{12}{e}, -\\frac{25}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{12}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(3/math.e), -(3/math.e), -(12/math.e), -(25/math.e), (5/math.e), -(25/math.e), -(12/math.e), -(3/math.e), -(12/math.e), -(18/math.e), -(18/math.e), (5/math.e), -(25/math.e), -(12/math.e), -(3/math.e), -(18/math.e), -(12/math.e), -(18/math.e), (5/math.e), -(12/math.e), -(12/math.e), -(12/math.e), -(18/math.e), -(12/math.e), (5/math.e), -(3/math.e), -(3/math.e), -(12/math.e), -(25/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x^2+1.8 x-0.1$ where $x \\sim $ \\text{ExponentialDistribution}[0.1]\n", - "Output Answer": [ - "$257.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.1)\nprint(E(1.2*x**2+1.8*x-0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x+2.$ where $x \\sim $ \\text{PoissonDistribution}[3.4]\n", - "Output Answer": [ - "$6.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.4)\nprint(E(1.2*x+2.))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -3, 9, -3 \\pi} \\setminus {8, -3 e, 6 \\log (2), -1, 0, 9}$.\n", - "Output Answer": [ - "${-3 \\pi, -3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -3, 9, -3*math.pi,))\nsnd = set((8, -3*math.e, 6*math.log(2), -1, 0, 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{2}, -\\frac{9}{2}, -\\frac{9}{2}, -\\frac{11}{4}, -\\frac{9}{2}, -\\frac{13}{2}, -\\frac{11}{4}, -\\frac{7}{2}, \\frac{3}{4}, 10, -\\frac{7}{2}, -\\frac{13}{2}, \\frac{3}{4}, -\\frac{11}{4}, -\\frac{13}{2}, -\\frac{7}{2}, -\\frac{13}{2}, 10, -\\frac{7}{2}, -\\frac{9}{2}, 10, -\\frac{11}{4}, 10, \\frac{3}{4}, -\\frac{13}{2}, -\\frac{9}{2}, -\\frac{13}{2}, -\\frac{13}{2}, \\frac{3}{4}, -\\frac{9}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(13/2), -(9/2), -(9/2), -(11/4), -(9/2), -(13/2), -(11/4), -(7/2), (3/4), 10, -(7/2), -(13/2), (3/4), -(11/4), -(13/2), -(7/2), -(13/2), 10, -(7/2), -(9/2), 10, -(11/4), 10, (3/4), -(13/2), -(9/2), -(13/2), -(13/2), (3/4), -(9/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{3}, 0, \\frac{15}{e}, -8, -\\frac{20}{3}, \\frac{14}{e}}$.", - "Output Answer": [ - "$\\frac{13}{6}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (13/3), 0, (15/math.e), -8, -(20/3), (14/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -7, -9, 9, -7, 9, -9, -7, -7, -6, -6, 9, 9, -6, -7, -7, 9, -9, -6, 9, 9, -7, -9, 9, -6}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -7, -9, 9, -7, 9, -9, -7, -7, -6, -6, 9, 9, -6, -7, -7, 9, -9, -6, 9, 9, -7, -9, 9, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 0, 8.853, 3} \\setminus {0, 8, -\\sqrt{2}}$.\n", - "Output Answer": [ - "${-9, 3, 8.853}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 0, 8.853, 3,))\nsnd = set((0, 8, -math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{50}{7}, 4, \\frac{14}{\\sqrt{5}}, -3 e, \\frac{7}{4}, -7} \\setminus {-2, -3 e, \\frac{17}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, -\\frac{50}{7}, -7}$.\n", - "Output Answer": [ - "${\\frac{7}{4}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(50/7), 4, (14/(math.sqrt(5))), -3*math.e, (7/4), -7,))\nsnd = set((-2, -3*math.e, (17/(math.sqrt(5))), (14/(math.sqrt(5))), -(50/7), -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{4}{3}, 2, 10, -\\frac{4}{3}}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (4/3), 2, 10, -(4/3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, \\frac{3}{\\pi }, -\\frac{8}{\\sqrt{5}}, 8} \\setminus {\\frac{3}{\\pi }, 5.112, \\frac{44}{7}, 10, -5}$.\n", - "Output Answer": [ - "${-\\frac{8}{\\sqrt{5}}, 1, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, (3/math.pi), -(8/(math.sqrt(5))), 8,))\nsnd = set(((3/math.pi), 5.112, (44/7), 10, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, -3, -7}$.\n", - "Output Answer": [ - "${-7, -7, -3}$" - ], - "Output Program": [ - "values = -7, -3, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -125, -6}$.\n", - "Output Answer": [ - "$10\\ 2^{2/3} \\sqrt[3]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -125, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, -2, 6, -4 \\sqrt{5}, -2, \\frac{13}{\\sqrt{2}}, \\frac{16}{3}, 5, 1, -1, 9, -8, -6, -\\frac{1}{e}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\frac{1}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, -2, 6, -4*math.sqrt(5), -2, (13/(math.sqrt(2))), (16/3), 5, 1, -1, 9, -8, -6, -(1/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -9, 9, -7, -8, -3, 3, 9}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -9, 9, -7, -8, -3, 3, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\pi, 9, -4, -\\frac{16}{\\pi }, 0, \\frac{13}{\\sqrt{2}}, -3 e, -5, \\frac{12}{\\pi }}$.", - "Output Answer": [ - "$-\\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.pi, 9, -4, -(16/math.pi), 0, (13/(math.sqrt(2))), -3*math.e, -5, (12/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, 14, 10, 5, -15, -10}$.\n", - "Output Answer": [ - "$\\frac{2338}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 14, 10, 5, -15, -10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -6}$.\n", - "Output Answer": [ - "$\\frac{121}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -6\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, -6, 3, -7}$.\n", - "Output Answer": [ - "${-9, -7, -6, 3}$" - ], - "Output Program": [ - "values = -9, -6, 3, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, \\frac{13}{\\sqrt{5}}, 7, -\\frac{8}{\\sqrt{\\pi }}, 3, 10}$.\n", - "Output Answer": [ - "${-\\frac{8}{\\sqrt{\\pi }}, -2, 3, \\frac{13}{\\sqrt{5}}, 7, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, (13/(math.sqrt(5))), 7, -(8/(math.sqrt(math.pi))), 3, 10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -11}$.\n", - "Output Answer": [ - "$128$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{9}{e}, -\\frac{8}{e}}$.\n", - "Output Answer": [ - "$-\\frac{17}{2 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(9/math.e), -(8/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{5}, 7, -\\frac{7}{4}, -1, -\\frac{7}{\\sqrt{2}}, -\\frac{2}{\\sqrt{3}}, 2 e, -3, 0}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(5), 7, -(7/4), -1, -(7/(math.sqrt(2))), -(2/(math.sqrt(3))), 2*math.e, -3, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.261,0.009,0.137,0.005,0.123,0.066,0.09,0.058,0.11\\}$ and $\\{0.022,0.158,0.055,0.041,0.096,0.144,0.287,0.043,0.055\\}$.", - "Output Answer": [ - "$0.87$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.261, 0.009, 0.137, 0.005, 0.123, 0.066, 0.09, 0.058, 0.11\ndistribution2 = 0.022, 0.158, 0.055, 0.041, 0.096, 0.144, 0.287, 0.043, 0.055\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, -6 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -6 \\sqrt{2}, \\frac{11}{\\sqrt{2}}, -4 \\sqrt{2}, -6 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, -4 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, -4 \\sqrt{2}, \\frac{11}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, -6 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, -4 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, -4 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, -4 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{11}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (11/(math.sqrt(2))), (7/(math.sqrt(2))), (11/(math.sqrt(2))), -6*math.sqrt(2), (1/(math.sqrt(2))), -6*math.sqrt(2), (11/(math.sqrt(2))), -4*math.sqrt(2), -6*math.sqrt(2), (7/(math.sqrt(2))), -4*math.sqrt(2), (7/(math.sqrt(2))), -4*math.sqrt(2), (11/(math.sqrt(2))), (11/(math.sqrt(2))), -6*math.sqrt(2), (1/(math.sqrt(2))), (11/(math.sqrt(2))), (7/(math.sqrt(2))), -4*math.sqrt(2), (1/(math.sqrt(2))), (1/(math.sqrt(2))), -4*math.sqrt(2), (7/(math.sqrt(2))), (7/(math.sqrt(2))), (11/(math.sqrt(2))), (1/(math.sqrt(2))), -4*math.sqrt(2), (7/(math.sqrt(2))), (11/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x-4.2$ where $x \\sim $ \\text{BetaDistribution}[1.,1.9]\n", - "Output Answer": [ - "$-2.58$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 1.9)\nprint(E(4.7*x-4.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.409,0.131,0.054,0.041,0.125,0.212\\}$ and $\\{0.049,0.062,0.103,0.433,0.035,0.076\\}$.", - "Output Answer": [ - "$1.$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.409, 0.131, 0.054, 0.041, 0.125, 0.212\ndistribution2 = 0.049, 0.062, 0.103, 0.433, 0.035, 0.076\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 15, 2}$.\n", - "Output Answer": [ - "$\\frac{60}{13}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 15, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{15}{\\sqrt{\\pi }}, 4, -1, -1, 4 \\sqrt{3}, -9, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-9, -1, -1, 4, 3 \\sqrt{5}, 4 \\sqrt{3}, \\frac{15}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (15/(math.sqrt(math.pi))), 4, -1, -1, 4*math.sqrt(3), -9, 3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 8, 9, 5, -4}$.\n", - "Output Answer": [ - "$\\frac{26}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 8, 9, 5, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, -125, 7776, 4096, -7776, 4096}$.\n", - "Output Answer": [ - "$96 \\sqrt[6]{-1} \\sqrt{5} 6^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -125, 7776, 4096, -7776, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{19}{2}, -8, 2, \\frac{39}{4}, \\frac{19}{2}, -\\frac{11}{2}, 2, -8, -\\frac{11}{2}, \\frac{19}{2}, 2, \\frac{19}{2}, 2, 2, \\frac{39}{4}, -\\frac{11}{2}, \\frac{19}{2}, \\frac{19}{2}, -\\frac{11}{2}, 2, 2, \\frac{39}{4}, \\frac{13}{2}, \\frac{19}{2}, 2, 2, 2, 2, -\\frac{11}{2}}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (19/2), -8, 2, (39/4), (19/2), -(11/2), 2, -8, -(11/2), (19/2), 2, (19/2), 2, 2, (39/4), -(11/2), (19/2), (19/2), -(11/2), 2, 2, (39/4), (13/2), (19/2), 2, 2, 2, 2, -(11/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{18}{\\pi }, \\frac{10}{\\pi }, \\frac{10}{\\pi }, \\frac{10}{\\pi }, -\\frac{27}{\\pi }, -\\frac{18}{\\pi }, \\frac{10}{\\pi }, -\\frac{5}{\\pi }, -\\frac{5}{\\pi }, \\frac{10}{\\pi }, -\\frac{27}{\\pi }, -\\frac{27}{\\pi }, -\\frac{29}{\\pi }, -\\frac{5}{\\pi }, \\frac{5}{\\pi }, -\\frac{29}{\\pi }, -\\frac{27}{\\pi }, -\\frac{27}{\\pi }, -\\frac{30}{\\pi }, -\\frac{27}{\\pi }, -\\frac{30}{\\pi }, -\\frac{5}{\\pi }, -\\frac{18}{\\pi }, \\frac{31}{\\pi }, \\frac{5}{\\pi }, \\frac{10}{\\pi }, \\frac{10}{\\pi }, -\\frac{27}{\\pi }, -\\frac{18}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{10}{\\pi },-\\frac{27}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(18/math.pi), (10/math.pi), (10/math.pi), (10/math.pi), -(27/math.pi), -(18/math.pi), (10/math.pi), -(5/math.pi), -(5/math.pi), (10/math.pi), -(27/math.pi), -(27/math.pi), -(29/math.pi), -(5/math.pi), (5/math.pi), -(29/math.pi), -(27/math.pi), -(27/math.pi), -(30/math.pi), -(27/math.pi), -(30/math.pi), -(5/math.pi), -(18/math.pi), (31/math.pi), (5/math.pi), (10/math.pi), (10/math.pi), -(27/math.pi), -(18/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{5}, \\pi, -\\frac{11}{\\sqrt{2}}, 3, -8, -3 e, -9, 6, 6, 5 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(5), math.pi, -(11/(math.sqrt(2))), 3, -8, -3*math.e, -9, 6, 6, 5*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, -6, 49}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{-2} 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, -6, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x-0.2$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$10.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(2.9*x-0.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.065,0.119,0.027,0.099,0.065,0.202,0.109,0.064,0.098,0.073\\}$ and $\\{0.101,0.034,0.082,0.116,0.03,0.047,0.07,0.115,0.125,0.24\\}$.", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.065, 0.119, 0.027, 0.099, 0.065, 0.202, 0.109, 0.064, 0.098, 0.073\ndistribution2 = 0.101, 0.034, 0.082, 0.116, 0.03, 0.047, 0.07, 0.115, 0.125, 0.24\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, \\pi, 6, -\\frac{9}{2}, -\\frac{11}{\\sqrt{5}}, -6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\pi -\\frac{9}{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, math.pi, 6, -(9/2), -(11/(math.sqrt(5))), -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\sqrt{5}, \\frac{12}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\frac{27}{\\sqrt{5}}-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.sqrt(5), (12/(math.sqrt(5))), (21/(math.sqrt(5))), -(2/(math.sqrt(5))), (17/(math.sqrt(5))), -(21/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2 \\log (2), 5 \\log (2), -7 \\log (2), 9 \\log (2), 8 \\log (2), 14 \\log (2), 11 \\log (2), -\\log (2)} \\cap {9 \\log (2), 5 \\log (2), -7 \\log (2), -11 \\log (2), \\log (2), 8 \\log (2), -\\log (2), 0, -10 \\log (2), -2 \\log (2)}$.\n", - "Output Answer": [ - "${-7 \\log (2), -2 \\log (2), -\\log (2), 5 \\log (2), 8 \\log (2), 9 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.log(2), 5*math.log(2), -7*math.log(2), 9*math.log(2), 8*math.log(2), 14*math.log(2), 11*math.log(2), -math.log(2),))\nsnd = set((9*math.log(2), 5*math.log(2), -7*math.log(2), -11*math.log(2), math.log(2), 8*math.log(2), -math.log(2), 0, -10*math.log(2), -2*math.log(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.211,0.021,0.114,0.151,0.027,0.079,0.053,0.071,0.078,0.101\\}$ and $\\{0.179,0.166,0.137,0.044,0.141,0.016,0.088,0.023,0.066,0.135\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.211, 0.021, 0.114, 0.151, 0.027, 0.079, 0.053, 0.071, 0.078, 0.101\ndistribution2 = 0.179, 0.166, 0.137, 0.044, 0.141, 0.016, 0.088, 0.023, 0.066, 0.135\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x^3+3.5 x^2+3. x-1.1$ where $x \\sim $ \\text{BetaDistribution}[1.6,1.1]\n", - "Output Answer": [ - "$2.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 1.1)\nprint(E(2.4*x**3+3.5*x**2+3.*x-1.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 3, 343, 64}$.\n", - "Output Answer": [ - "$6 \\sqrt{2} \\sqrt[4]{3} 7^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 3, 343, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 11, 7, 10}$.\n", - "Output Answer": [ - "$\\frac{1540}{321}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 11, 7, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 0, -2} \\setminus {-\\frac{17}{\\sqrt{\\pi }}, 0, -1, -7, 3, -7 \\log (2), -8}$.\n", - "Output Answer": [ - "${-2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 0, -2,))\nsnd = set((-(17/(math.sqrt(math.pi))), 0, -1, -7, 3, -7*math.log(2), -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.017,0.047,0.041,0.097,0.241,0.099,0.243,0.055,0.015,0.096\\}$ and $\\{0.03,0.29,0.034,0.112,0.051,0.089,0.048,0.047,0.091,0.118\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.017, 0.047, 0.041, 0.097, 0.241, 0.099, 0.243, 0.055, 0.015, 0.096\ndistribution2 = 0.03, 0.29, 0.034, 0.112, 0.051, 0.089, 0.048, 0.047, 0.091, 0.118\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\sqrt{5}, 7, -10, 2 \\sqrt{5}, 3 \\pi, -6, \\frac{51}{7}, -2 \\sqrt{5}, -7, -\\frac{14}{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{5}-\\frac{14}{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.sqrt(5), 7, -10, 2*math.sqrt(5), 3*math.pi, -6, (51/7), -2*math.sqrt(5), -7, -(14/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-16807, 10000, 625, -4, 1}$.\n", - "Output Answer": [ - "$70 \\sqrt[5]{2} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -16807, 10000, 625, -4, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 6, 4, 64}$.\n", - "Output Answer": [ - "$8 \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 6, 4, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, 7}$.\n", - "Output Answer": [ - "${-3, 7}$" - ], - "Output Program": [ - "values = -3, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.098,0.08,0.165,0.063,0.183,0.126,0.151\\}$ and $\\{0.024,0.033,0.371,0.043,0.199,0.102,0.173\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.098, 0.08, 0.165, 0.063, 0.183, 0.126, 0.151\ndistribution2 = 0.024, 0.033, 0.371, 0.043, 0.199, 0.102, 0.173\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x-2.4$ where $x \\sim $ \\text{PoissonDistribution}[1.1]\n", - "Output Answer": [ - "$-0.86$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.1)\nprint(E(1.4*x-2.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{50}{3}, 13, \\frac{35}{3}}$.\n", - "Output Answer": [ - "$\\frac{13650}{1013}$" - ], - "Output Program": [ - "import statistics\nvalues = (50/3), 13, (35/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, 0, -5, 2 \\sqrt{3}, -8, 1, -3.28}$.\n", - "Output Answer": [ - "${-8, -5, -3.28, -3, 0, 1, 2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 0, -5, 2*math.sqrt(3), -8, 1, -3.28\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{5}, 2, -3, 0, -\\frac{16}{\\sqrt{3}}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{3}}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(5), 2, -3, 0, -(16/(math.sqrt(3))), math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, \\frac{1}{\\sqrt{2}}, 5, -8, -6} \\cup {-6, -8, 5, -\\frac{5}{\\sqrt{2}}, 4, 3}$.\n", - "Output Answer": [ - "${-8, -6, -\\frac{5}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, 3, 4, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, (1/(math.sqrt(2))), 5, -8, -6,))\nsnd = set((-6, -8, 5, -(5/(math.sqrt(2))), 4, 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.104,0.039,0.072,0.093,0.101,0.053,0.076,0.097,0.104,0.143\\}$ and $\\{0.184,0.027,0.14,0.04,0.087,0.133,0.082,0.05,0.105,0.008\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.104, 0.039, 0.072, 0.093, 0.101, 0.053, 0.076, 0.097, 0.104, 0.143\ndistribution2 = 0.184, 0.027, 0.14, 0.04, 0.087, 0.133, 0.082, 0.05, 0.105, 0.008\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.046,0.235,0.104,0.177,0.045,0.121,0.028,0.041,0.155\\}$ and $\\{0.163,0.07,0.149,0.037,0.085,0.092,0.127,0.098,0.059\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.046, 0.235, 0.104, 0.177, 0.045, 0.121, 0.028, 0.041, 0.155\ndistribution2 = 0.163, 0.07, 0.149, 0.037, 0.085, 0.092, 0.127, 0.098, 0.059\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1024, -64, -10, 36, -64, 64}$.\n", - "Output Answer": [ - "$32 \\sqrt[6]{-10} \\sqrt[3]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1024, -64, -10, 36, -64, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 25, 1000000, 64, 125, 10000}$.\n", - "Output Answer": [ - "$200 \\sqrt[6]{2} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 25, 1000000, 64, 125, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{22}{3}, \\frac{47}{3}, 14}$.\n", - "Output Answer": [ - "$\\frac{10857}{983}$" - ], - "Output Program": [ - "import statistics\nvalues = (22/3), (47/3), 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, -3, 8}$.\n", - "Output Answer": [ - "${-3, 8, 8}$" - ], - "Output Program": [ - "values = 8, -3, 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.318,0.324,0.264,0.018,0.022\\}$ and $\\{0.012,0.352,0.283,0.294,0.006\\}$.", - "Output Answer": [ - "$1.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.318, 0.324, 0.264, 0.018, 0.022\ndistribution2 = 0.012, 0.352, 0.283, 0.294, 0.006\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -4, 8.1, 0} \\setminus {-1, 10, 5, 8.1, 3, -2}$.\n", - "Output Answer": [ - "${-6, -4, 0}$" - ], - "Output Program": [ - "fst = set((-6, -4, 8.1, 0,))\nsnd = set((-1, 10, 5, 8.1, 3, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 10, 6, 19}$.\n", - "Output Answer": [ - "$\\frac{285}{94}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 10, 6, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\pi, -\\frac{13}{2}, -7, 9, 4 \\sqrt{5}, 6.692, -3 \\sqrt{5}} \\cup {8, 3 \\sqrt{5}, -3 \\sqrt{5}, 9, 0, -9, 5, 6.692, -\\frac{13}{5}}$.\n", - "Output Answer": [ - "${-9, -7, -3 \\sqrt{5}, -\\frac{13}{2}, -\\frac{13}{5}, 0, \\pi, 5, 6.692, 3 \\sqrt{5}, 8, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, -(13/2), -7, 9, 4*math.sqrt(5), 6.692, -3*math.sqrt(5),))\nsnd = set((8, 3*math.sqrt(5), -3*math.sqrt(5), 9, 0, -9, 5, 6.692, -(13/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -6 \\sqrt{3}, \\frac{2}{\\sqrt{5}}, 9, -2} \\setminus {-2, \\frac{2}{\\sqrt{5}}, 9, 0}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -6*math.sqrt(3), (2/(math.sqrt(5))), 9, -2,))\nsnd = set((-2, (2/(math.sqrt(5))), 9, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.118,0.082,0.055,0.095,0.138,0.098,0.018,0.172,0.061,0.055\\}$ and $\\{0.064,0.084,0.046,0.066,0.068,0.115,0.102,0.136,0.12,0.139\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.118, 0.082, 0.055, 0.095, 0.138, 0.098, 0.018, 0.172, 0.061, 0.055\ndistribution2 = 0.064, 0.084, 0.046, 0.066, 0.068, 0.115, 0.102, 0.136, 0.12, 0.139\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -1, 9, 8, 5}$.\n", - "Output Answer": [ - "$\\frac{24}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -1, 9, 8, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.2 x-5.$ where $x \\sim $ \\text{NormalDistribution}[-1.1,1.4]\n", - "Output Answer": [ - "$-0.38$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.1, 1.4)\nprint(E(-4.2*x-5.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 17, 11, 17}$.\n", - "Output Answer": [ - "$\\frac{14960}{967}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 17, 11, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, 2, 0, 0, -6, 0, 0, 2, 2, 2, -4, 2, 0, 0, 0, 2, -4, -6, 2, 2, -4}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, 2, 0, 0, -6, 0, 0, 2, 2, 2, -4, 2, 0, 0, 0, 2, -4, -6, 2, 2, -4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{12}{\\sqrt{\\pi }}, -3, -4 \\sqrt{3}, 10, 8, -e, 7}$.\n", - "Output Answer": [ - "$10+4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -(12/(math.sqrt(math.pi))), -3, -4*math.sqrt(3), 10, 8, -math.e, 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 16, 64, 2401, 8}$.\n", - "Output Answer": [ - "$4\\ 2^{3/5} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 16, 64, 2401, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^3+2.2 x-7.3$ where $x \\sim $ \\text{PoissonDistribution}[1.7]\n", - "Output Answer": [ - "$-32.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.7)\nprint(E(-1.9*x**3+2.2*x-7.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, 0, -3 \\pi, -8, -2 \\pi, \\frac{30}{\\pi }, \\frac{1}{\\sqrt{3}}, -2} \\cup {-\\frac{25}{\\pi }, 7, -3 \\pi, 3 \\pi, \\frac{1}{\\sqrt{3}}, 0, \\frac{15}{e}, 6}$.\n", - "Output Answer": [ - "${-3 \\pi, -8, -\\frac{25}{\\pi }, -2 \\pi, -2, 0, \\frac{1}{\\sqrt{3}}, 5, \\frac{15}{e}, 6, 7, 3 \\pi, \\frac{30}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 0, -3*math.pi, -8, -2*math.pi, (30/math.pi), (1/(math.sqrt(3))), -2,))\nsnd = set((-(25/math.pi), 7, -3*math.pi, 3*math.pi, (1/(math.sqrt(3))), 0, (15/math.e), 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.04,0.113,0.076,0.109,0.053,0.136,0.113,0.105,0.125\\}$ and $\\{0.098,0.194,0.098,0.131,0.099,0.121,0.041,0.168,0.036\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.04, 0.113, 0.076, 0.109, 0.053, 0.136, 0.113, 0.105, 0.125\ndistribution2 = 0.098, 0.194, 0.098, 0.131, 0.099, 0.121, 0.041, 0.168, 0.036\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{2}, \\sqrt{2}}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(2), math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x^2-1.2 x-3.5$ where $x \\sim $ \\text{PoissonDistribution}[0.6]\n", - "Output Answer": [ - "$-4.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.6)\nprint(E(0.2*x**2-1.2*x-3.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, 9}$.", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, 8, 2, 4, 1, 1}$.\n", - "Output Answer": [ - "$\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, 8, 2, 4, 1, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.185,0.141,0.098,0.105,0.173\\}$ and $\\{0.097,0.557,0.016,0.075,0.046,0.171\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.185, 0.141, 0.098, 0.105, 0.173\ndistribution2 = 0.097, 0.557, 0.016, 0.075, 0.046, 0.171\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, 6, 100}$.\n", - "Output Answer": [ - "$2 \\sqrt[3]{-3} 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 6, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -4, -3, 7, 1, -3, -5}$.\n", - "Output Answer": [ - "$-\\frac{13}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -4, -3, 7, 1, -3, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, -6.14, \\pi, 4, -\\frac{39}{4}, -4} \\setminus {\\pi, -9, -10, -\\frac{39}{4}, -6.14}$.\n", - "Output Answer": [ - "${-4, 2, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -6.14, math.pi, 4, -(39/4), -4,))\nsnd = set((math.pi, -9, -10, -(39/4), -6.14,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.166,0.109,0.151,0.08,0.068,0.086,0.033,0.159\\}$ and $\\{0.211,0.122,0.07,0.044,0.045,0.08,0.153,0.133\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.166, 0.109, 0.151, 0.08, 0.068, 0.086, 0.033, 0.159\ndistribution2 = 0.211, 0.122, 0.07, 0.044, 0.045, 0.08, 0.153, 0.133\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{10}{\\sqrt{\\pi }}, -5, -\\frac{9}{\\sqrt{\\pi }}, -7, \\frac{5}{\\sqrt{2}}, 3 e, 5 \\sqrt{3}, 2, 9, \\frac{2}{\\sqrt{5}}, 6, 1}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -(10/(math.sqrt(math.pi))), -5, -(9/(math.sqrt(math.pi))), -7, (5/(math.sqrt(2))), 3*math.e, 5*math.sqrt(3), 2, 9, (2/(math.sqrt(5))), 6, 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3 \\sqrt{3}, -\\frac{4}{7}, 3, 9, \\frac{12}{5}, 2 \\sqrt{3}, \\frac{66}{7}} \\setminus {-8, -3 \\sqrt{3}, -\\frac{54}{7}, 3, -5, \\sqrt{3}, \\frac{12}{5}, 9}$.\n", - "Output Answer": [ - "${-\\frac{4}{7}, 2 \\sqrt{3}, \\frac{66}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(3), -(4/7), 3, 9, (12/5), 2*math.sqrt(3), (66/7),))\nsnd = set((-8, -3*math.sqrt(3), -(54/7), 3, -5, math.sqrt(3), (12/5), 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-216, -1000, 9}$.\n", - "Output Answer": [ - "$60\\ 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -216, -1000, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -\\frac{11}{\\sqrt{5}}, 10, -7} \\setminus {-\\frac{1}{3}, 10, -4, -2, -7, 7, -\\frac{11}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -(11/(math.sqrt(5))), 10, -7,))\nsnd = set((-(1/3), 10, -4, -2, -7, 7, -(11/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 64, -27, 81, 46656, 117649}$.\n", - "Output Answer": [ - "$252 \\sqrt[6]{-1} 3^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 64, -27, 81, 46656, 117649\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -2, -2, 7, 7, -4, -4, 7, 7, -4, 7, 7, 7, -4, 7, 1, 7, -2, 7, -2, -2, 1, 7, 0}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -2, -2, 7, 7, -4, -4, 7, 7, -4, 7, 7, 7, -4, 7, 1, 7, -2, 7, -2, -2, 1, 7, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, \\frac{40}{3}, \\frac{34}{3}}$.\n", - "Output Answer": [ - "$\\frac{2040}{179}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, (40/3), (34/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-13 \\log (2), -\\frac{7}{2}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\sqrt{5}+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -13*math.log(2), -(7/2), math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -3, 1, 6, 4, 9 \\log (2), 6, 0, -9, \\frac{3}{\\sqrt{5}}, \\frac{29}{7}, 7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+\\frac{3}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -3, 1, 6, 4, 9*math.log(2), 6, 0, -9, (3/(math.sqrt(5))), (29/7), 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.295,0.397,0.155\\}$ and $\\{0.269,0.193,0.202\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.295, 0.397, 0.155\ndistribution2 = 0.269, 0.193, 0.202\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9, 2, -8.443, 9.201, -2, 1} \\setminus {-2.376, -2 e, 9, \\frac{22}{7}, 9.201, 2, 1}$.\n", - "Output Answer": [ - "${-8.443, -2}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 2, -8.443, 9.201, -2, 1,))\nsnd = set((-2.376, -2*math.e, 9, (22/7), 9.201, 2, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{13}{2}, \\frac{13}{2}, -\\frac{9}{2}, -\\frac{9}{2}, -\\frac{9}{2}, -\\frac{11}{2}, -\\frac{9}{2}, -\\frac{11}{2}, -\\frac{9}{2}, -\\frac{11}{2}, -4, -\\frac{11}{2}, -\\frac{9}{2}, -\\frac{11}{2}, -4, -2, -2, -2, -2, -\\frac{11}{2}, \\frac{13}{2}, -2, \\frac{13}{2}, -4, -\\frac{11}{2}, -\\frac{9}{2}, -2, -2}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{9}{2},-\\frac{11}{2},-2\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (13/2), (13/2), -(9/2), -(9/2), -(9/2), -(11/2), -(9/2), -(11/2), -(9/2), -(11/2), -4, -(11/2), -(9/2), -(11/2), -4, -2, -2, -2, -2, -(11/2), (13/2), -2, (13/2), -4, -(11/2), -(9/2), -2, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, 5, -\\frac{18}{\\pi }, 9, -5}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, 5, -(18/math.pi), 9, -5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\sqrt{2}, -6, -13 \\log (2), -2 \\sqrt{3}, \\pi, 6, -2 e, 8, -6, -2, -4, 9, 2 \\sqrt{5}, -8}$.\n", - "Output Answer": [ - "$9+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(2), -6, -13*math.log(2), -2*math.sqrt(3), math.pi, 6, -2*math.e, 8, -6, -2, -4, 9, 2*math.sqrt(5), -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -8, 1, 4, 4, -1, -8, 4, -6, -6, -8, 4, 4, -1, -6, 4, 4, 4, -1, -6, -6, -1}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -8, 1, 4, 4, -1, -8, 4, -6, -6, -8, 4, 4, -1, -6, 4, 4, 4, -1, -6, -6, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, 2, 1, 0, \\frac{11}{2}, \\frac{17}{\\sqrt{5}}, -\\frac{5}{\\sqrt{2}}, 7, 7 \\log (2), -6, -7, 9}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, 2, 1, 0, (11/2), (17/(math.sqrt(5))), -(5/(math.sqrt(2))), 7, 7*math.log(2), -6, -7, 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8, \\sqrt{3}, -5 \\sqrt{3}, -\\frac{8}{5}, \\frac{19}{2}, 9, -4 \\sqrt{3}, 8, -5, \\frac{22}{\\pi }} \\cup {-5 \\sqrt{3}, -3, 0, \\frac{19}{2}, -2 \\sqrt{3}, 1, 9, -\\frac{8}{5}, \\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -8, -4 \\sqrt{3}, -5, -2 \\sqrt{3}, -3, -\\frac{8}{5}, 0, 1, \\sqrt{3}, \\frac{22}{\\pi }, 8, 9, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, math.sqrt(3), -5*math.sqrt(3), -(8/5), (19/2), 9, -4*math.sqrt(3), 8, -5, (22/math.pi),))\nsnd = set((-5*math.sqrt(3), -3, 0, (19/2), -2*math.sqrt(3), 1, 9, -(8/5), (22/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -1, -9, 8, 1, -2, -7, -8, -10, 2, 2 \\pi, -3, -9, \\frac{23}{7}, \\frac{11}{4}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -1, -9, 8, 1, -2, -7, -8, -10, 2, 2*math.pi, -3, -9, (23/7), (11/4)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x^2-0.4 x-5.7$ where $x \\sim $ \\text{BetaDistribution}[1.,1.5]\n", - "Output Answer": [ - "$-5.33$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 1.5)\nprint(E(2.3*x**2-0.4*x-5.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -4, -7}$.\n", - "Output Answer": [ - "$-\\frac{20}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -4, -7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, -4, 0, -3, 4.03, -2, -\\frac{11}{\\sqrt{5}}, 8} \\setminus {-\\frac{20}{3}, 2 \\sqrt{2}, -3, -\\frac{11}{\\sqrt{5}}, -8.831, 2, 4.03, -4}$.\n", - "Output Answer": [ - "${-2, 0, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -4, 0, -3, 4.03, -2, -(11/(math.sqrt(5))), 8,))\nsnd = set((-(20/3), 2*math.sqrt(2), -3, -(11/(math.sqrt(5))), -8.831, 2, 4.03, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6 \\sqrt{2}, \\frac{21}{e}, 9, 0} \\setminus {2, 9, 8, -7, \\frac{21}{e}, -4}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.sqrt(2), (21/math.e), 9, 0,))\nsnd = set((2, 9, 8, -7, (21/math.e), -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{10}{e}, \\frac{8}{e}, -\\frac{8}{e}, \\frac{7}{e}, -\\frac{23}{e}}$.\n", - "Output Answer": [ - "$-\\frac{6}{5 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (10/math.e), (8/math.e), -(8/math.e), (7/math.e), -(23/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{9}{\\pi }, -3.66, \\frac{35}{4}, 2, -7.903, -3, -\\frac{10}{e}}$.\n", - "Output Answer": [ - "${-7.903, -\\frac{10}{e}, -3.66, -3, 2, \\frac{9}{\\pi }, \\frac{35}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/math.pi), -3.66, (35/4), 2, -7.903, -3, -(10/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.093,0.049,0.073,0.243,0.148,0.212\\}$ and $\\{0.279,0.02,0.073,0.348,0.159,0.101\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.093, 0.049, 0.073, 0.243, 0.148, 0.212\ndistribution2 = 0.279, 0.02, 0.073, 0.348, 0.159, 0.101\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 9, 7, 1, -9}$.\n", - "Output Answer": [ - "$\\frac{16}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 9, 7, 1, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\pi, -4, 6, \\frac{20}{\\pi }, -8, -9} \\setminus {-9, \\pi, -8, -\\frac{11}{\\pi }, 0, -4}$.\n", - "Output Answer": [ - "${6, \\frac{20}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, math.pi, -4, 6, (20/math.pi), -8, -9,))\nsnd = set((-9, math.pi, -8, -(11/math.pi), 0, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.5 x^2-2.5 x+2.4$ where $x \\sim $ \\text{ExponentialDistribution}[0.8]\n", - "Output Answer": [ - "$0.84$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.8)\nprint(E(0.5*x**2-2.5*x+2.4))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, \\frac{6}{\\sqrt{\\pi }}, \\frac{3}{e}, -\\frac{11}{\\sqrt{\\pi }}} \\setminus {-\\frac{4}{e}, -\\frac{10}{\\sqrt{\\pi }}, 2, -7, 0}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{\\pi }}, \\frac{3}{e}, \\frac{6}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, (6/(math.sqrt(math.pi))), (3/math.e), -(11/(math.sqrt(math.pi))),))\nsnd = set((-(4/math.e), -(10/(math.sqrt(math.pi))), 2, -7, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -\\frac{8}{5}, \\frac{5}{2}, 7, 5, 3 \\log (2)}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -(8/5), (5/2), 7, 5, 3*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{48}{5}, -10, 7}$.\n", - "Output Answer": [ - "${-10, -\\frac{48}{5}, 7}$" - ], - "Output Program": [ - "values = -(48/5), -10, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.5 x^2+4.9 x+0.8$ where $x \\sim $ \\text{BetaDistribution}[1.7,0.4]\n", - "Output Answer": [ - "$3.71$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 0.4)\nprint(E(-1.5*x**2+4.9*x+0.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.211,0.187,0.299,0.128\\}$ and $\\{0.07,0.005,0.897,0.018\\}$.", - "Output Answer": [ - "$1.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.211, 0.187, 0.299, 0.128\ndistribution2 = 0.07, 0.005, 0.897, 0.018\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.026,0.302,0.192,0.04,0.396\\}$ and $\\{0.374,0.076,0.116,0.053,0.238\\}$.", - "Output Answer": [ - "$0.55$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.026, 0.302, 0.192, 0.04, 0.396\ndistribution2 = 0.374, 0.076, 0.116, 0.053, 0.238\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -5, \\frac{19}{3}}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -5, (19/3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -4, 2, -6, -8, -2, 0, 5 \\sqrt{2}, -7 \\sqrt{2}, \\sqrt{5}} \\cup {-6, -7 \\sqrt{2}, 5 \\sqrt{2}, -9, -5, -1, \\sqrt{5}, 2}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -9, -8, -6, -5, -4, -2, -1, 0, 2, \\sqrt{5}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -4, 2, -6, -8, -2, 0, 5*math.sqrt(2), -7*math.sqrt(2), math.sqrt(5),))\nsnd = set((-6, -7*math.sqrt(2), 5*math.sqrt(2), -9, -5, -1, math.sqrt(5), 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{2}, 10, -13 \\log (2), 8, \\sqrt{5}, -6.7, 3}$.\n", - "Output Answer": [ - "${-13 \\log (2), -6.7, -\\frac{13}{2}, \\sqrt{5}, 3, 8, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/2), 10, -13*math.log(2), 8, math.sqrt(5), -6.7, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{\\sqrt{2}}, -2.601, \\frac{13}{3}, -6, 2 e, -3} \\setminus {2 e, -\\frac{9}{4}, 0, -2.601, 6, 5 \\sqrt{2}, -6}$.\n", - "Output Answer": [ - "${-3, \\frac{13}{3}, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/(math.sqrt(2))), -2.601, (13/3), -6, 2*math.e, -3,))\nsnd = set((2*math.e, -(9/4), 0, -2.601, 6, 5*math.sqrt(2), -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 7, -1}$.\n", - "Output Answer": [ - "$\\frac{52}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 7, -1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, 6, 5}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, 6, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{59}{3}, \\frac{23}{3}, 16}$.\n", - "Output Answer": [ - "$\\frac{65136}{5293}$" - ], - "Output Program": [ - "import statistics\nvalues = (59/3), (23/3), 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x^3-2.4 x^2-4.2 x+3.$ where $x \\sim $ \\text{ExponentialDistribution}[0.9]\n", - "Output Answer": [ - "$14.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.9)\nprint(E(2.7*x**3-2.4*x**2-4.2*x+3.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{4}{\\pi }, \\frac{16}{\\pi }, -\\frac{4}{\\pi }, \\frac{21}{\\pi }, \\frac{21}{\\pi }, \\frac{23}{\\pi }, -\\frac{19}{\\pi }, -\\frac{20}{\\pi }, \\frac{21}{\\pi }, \\frac{21}{\\pi }, \\frac{16}{\\pi }, -\\frac{7}{\\pi }, -\\frac{13}{\\pi }, -\\frac{4}{\\pi }, -\\frac{20}{\\pi }, -\\frac{20}{\\pi }, \\frac{16}{\\pi }, -\\frac{13}{\\pi }, -\\frac{4}{\\pi }, -\\frac{13}{\\pi }, \\frac{21}{\\pi }, -\\frac{7}{\\pi }, \\frac{23}{\\pi }, -\\frac{19}{\\pi }, \\frac{16}{\\pi }, \\frac{21}{\\pi }, \\frac{16}{\\pi }, -\\frac{20}{\\pi }, \\frac{21}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{21}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(4/math.pi), (16/math.pi), -(4/math.pi), (21/math.pi), (21/math.pi), (23/math.pi), -(19/math.pi), -(20/math.pi), (21/math.pi), (21/math.pi), (16/math.pi), -(7/math.pi), -(13/math.pi), -(4/math.pi), -(20/math.pi), -(20/math.pi), (16/math.pi), -(13/math.pi), -(4/math.pi), -(13/math.pi), (21/math.pi), -(7/math.pi), (23/math.pi), -(19/math.pi), (16/math.pi), (21/math.pi), (16/math.pi), -(20/math.pi), (21/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x^2-4.5 x-1.9$ where $x \\sim $ \\text{PoissonDistribution}[2.5]\n", - "Output Answer": [ - "$20.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.5)\nprint(E(3.9*x**2-4.5*x-1.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -\\frac{15}{\\pi }, -2 \\pi, 1, 8, -5 \\sqrt{3}, -6, -6, 0}$.", - "Output Answer": [ - "$-\\frac{15}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -(15/math.pi), -2*math.pi, 1, 8, -5*math.sqrt(3), -6, -6, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2, -1, -2, -7, 8} \\cup {-7, 5, 8, -1}$.\n", - "Output Answer": [ - "${-7, -2, -1, 2, 5, 8}$" - ], - "Output Program": [ - "fst = set((2, -1, -2, -7, 8,))\nsnd = set((-7, 5, 8, -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 7, -\\frac{20}{e}, \\frac{16}{\\sqrt{5}}, 4 \\sqrt{2}, -2 e} \\setminus {\\frac{16}{\\sqrt{5}}, -\\frac{20}{e}, 2 e, 2 \\sqrt{2}, -6, -4}$.\n", - "Output Answer": [ - "${-2 e, 4 \\sqrt{2}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 7, -(20/math.e), (16/(math.sqrt(5))), 4*math.sqrt(2), -2*math.e,))\nsnd = set(((16/(math.sqrt(5))), -(20/math.e), 2*math.e, 2*math.sqrt(2), -6, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 3, 6, 6, 7, -3, 6, 3, 3, 3, 4, -3, 3, 6, 3, -3, 7, 3, 6, 4, 6, -3, -3, 4, 3, 3, 6, -3, 6}$.\n", - "Output Answer": [ - "$\\{6,3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 3, 6, 6, 7, -3, 6, 3, 3, 3, 4, -3, 3, 6, 3, -3, 7, 3, 6, 4, 6, -3, -3, 4, 3, 3, 6, -3, 6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, 6, -6, -\\frac{2}{\\sqrt{\\pi }}, 4, 0, 0, -\\frac{14}{\\sqrt{\\pi }}, -\\frac{17}{3}, \\frac{5}{\\sqrt{2}}, 5, -5 \\sqrt{2}, 8, 5 \\sqrt{2}, 14 \\log (2)}$.", - "Output Answer": [ - "$\\frac{5}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 6, -6, -(2/(math.sqrt(math.pi))), 4, 0, 0, -(14/(math.sqrt(math.pi))), -(17/3), (5/(math.sqrt(2))), 5, -5*math.sqrt(2), 8, 5*math.sqrt(2), 14*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, -4, \\frac{28}{5}}$.\n", - "Output Answer": [ - "${-8, -4, \\frac{28}{5}}$" - ], - "Output Program": [ - "values = -8, -4, (28/5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -10, -7, -2, -3 \\pi, 6 \\sqrt{2}, -\\frac{46}{5}}$.\n", - "Output Answer": [ - "$10+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -10, -7, -2, -3*math.pi, 6*math.sqrt(2), -(46/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{39}{2}, \\frac{21}{2}, \\frac{15}{2}, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{23205}{2306}$" - ], - "Output Program": [ - "import statistics\nvalues = (39/2), (21/2), (15/2), (17/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{53}{7}, -1, 4 \\log (2), 1, \\frac{4}{7}, 6 \\sqrt{2}, -8.88} \\setminus {-\\frac{12}{5}, -9, -\\frac{69}{7}, 4 \\log (2), -8, -\\frac{53}{7}}$.\n", - "Output Answer": [ - "${-8.88, -1, \\frac{4}{7}, 1, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(53/7), -1, 4*math.log(2), 1, (4/7), 6*math.sqrt(2), -8.88,))\nsnd = set((-(12/5), -9, -(69/7), 4*math.log(2), -8, -(53/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{38}{3}, \\frac{52}{3}, \\frac{7}{3}, \\frac{23}{3}}$.\n", - "Output Answer": [ - "$\\frac{636272}{110655}$" - ], - "Output Program": [ - "import statistics\nvalues = (38/3), (52/3), (7/3), (23/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -512, -1, 100000, 81, 729}$.\n", - "Output Answer": [ - "$24\\ 3^{2/3} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -512, -1, 100000, 81, 729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{4}{\\sqrt{3}}, 8, -\\frac{1}{2}, 2}$.\n", - "Output Answer": [ - "${-\\frac{4}{\\sqrt{3}}, -\\frac{1}{2}, 2, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(4/(math.sqrt(3))), 8, -(1/2), 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${e, -\\frac{9}{2}, 1, -2 \\sqrt{2}, -3 e, \\frac{4}{5}, -9, -3, 4}$.", - "Output Answer": [ - "$-2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.e, -(9/2), 1, -2*math.sqrt(2), -3*math.e, (4/5), -9, -3, 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.21,0.221,0.078,0.187,0.159\\}$ and $\\{0.214,0.207,0.15,0.183,0.162\\}$.", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.21, 0.221, 0.078, 0.187, 0.159\ndistribution2 = 0.214, 0.207, 0.15, 0.183, 0.162\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -3, -8, -\\frac{10}{\\pi }, 7} \\cup {-\\frac{10}{\\pi }, 6, -1, -3, \\frac{7}{4}, -2 e}$.\n", - "Output Answer": [ - "${-8, -2 e, -\\frac{10}{\\pi }, -3, -1, \\frac{7}{4}, 5, 6, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -3, -8, -(10/math.pi), 7,))\nsnd = set((-(10/math.pi), 6, -1, -3, (7/4), -2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{33}{7}, 4 \\sqrt{3}, -3, -5, -\\frac{5}{e}, 0, -10, -1} \\setminus {-5, \\frac{1}{\\sqrt{2}}, -\\frac{57}{7}, 7, -3, 0}$.\n", - "Output Answer": [ - "${-10, -\\frac{33}{7}, -\\frac{5}{e}, -1, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(33/7), 4*math.sqrt(3), -3, -5, -(5/math.e), 0, -10, -1,))\nsnd = set((-5, (1/(math.sqrt(2))), -(57/7), 7, -3, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9.15, 3 \\sqrt{5}, -5, \\frac{13}{\\sqrt{5}}, -2 \\sqrt{2}} \\setminus {\\frac{13}{\\sqrt{5}}, 0, -5}$.\n", - "Output Answer": [ - "${-2 \\sqrt{2}, 3 \\sqrt{5}, 9.15}$" - ], - "Output Program": [ - "import math\n\nfst = set((9.15, 3*math.sqrt(5), -5, (13/(math.sqrt(5))), -2*math.sqrt(2),))\nsnd = set(((13/(math.sqrt(5))), 0, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{36}{5}, -\\frac{1}{2}, 2, \\frac{23}{e}, -8, -\\frac{6}{e}, -2 \\pi} \\setminus {-\\frac{6}{e}, -\\frac{36}{5}, -\\frac{1}{2}, 2, -2 \\pi, \\frac{4}{e}}$.\n", - "Output Answer": [ - "${-8, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(36/5), -(1/2), 2, (23/math.e), -8, -(6/math.e), -2*math.pi,))\nsnd = set((-(6/math.e), -(36/5), -(1/2), 2, -2*math.pi, (4/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{28}{3}, -\\frac{4}{e}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{28}{3}-\\frac{4}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (28/3), -(4/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -6, 5}$.\n", - "Output Answer": [ - "$-\\frac{11}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -6, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.1 x-1.6$ where $x \\sim $ \\text{PoissonDistribution}[1.8]\n", - "Output Answer": [ - "$-1.78$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.8)\nprint(E(-0.1*x-1.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\log (2), 1, -\\frac{11}{4}, -2, 6, -2, 8, \\sqrt{5}, -4, -\\frac{13}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.log(2), 1, -(11/4), -2, 6, -2, 8, math.sqrt(5), -4, -(13/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -8, 4, 4, 4, 0, 0, 0, 0, -9, -4, 4, -8, 4, 0, -8, 0, -8, -8, 3, 3, 4, -7, -8, -10, -4}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -8, 4, 4, 4, 0, 0, 0, 0, -9, -4, 4, -8, 4, 0, -8, 0, -8, -8, 3, 3, 4, -7, -8, -10, -4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{23}{e}, -4, -3 \\sqrt{3}, -6} \\cup {-2 \\sqrt{2}, -6, \\frac{2}{e}, -3 \\sqrt{3}, -0.2, 5, -4}$.\n", - "Output Answer": [ - "${-\\frac{23}{e}, -6, -3 \\sqrt{3}, -4, -2 \\sqrt{2}, -0.2, \\frac{2}{e}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(23/math.e), -4, -3*math.sqrt(3), -6,))\nsnd = set((-2*math.sqrt(2), -6, (2/math.e), -3*math.sqrt(3), -0.2, 5, -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${3, 8}$.\n", - "Output Answer": [ - "$2 \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{15}{e}, -5 \\sqrt{3}, \\frac{18}{5}, 6}$.\n", - "Output Answer": [ - "$6+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/math.e), -5*math.sqrt(3), (18/5), 6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, \\frac{13}{\\sqrt{2}}, 3 \\sqrt{3}, -5, -3, -5, \\frac{5}{4}, \\sqrt{2}, -5, 9, -5}$.\n", - "Output Answer": [ - "$5+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, (13/(math.sqrt(2))), 3*math.sqrt(3), -5, -3, -5, (5/4), math.sqrt(2), -5, 9, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -9, \\frac{17}{\\pi }, -7, -\\sqrt{3}, \\frac{3}{2}} \\cup {\\frac{3}{2}, \\frac{17}{\\pi }, -7, -9, -3 \\sqrt{3}, -3}$.\n", - "Output Answer": [ - "${-9, -7, -3 \\sqrt{3}, -3, -\\sqrt{3}, \\frac{3}{2}, \\frac{17}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -9, (17/math.pi), -7, -math.sqrt(3), (3/2),))\nsnd = set(((3/2), (17/math.pi), -7, -9, -3*math.sqrt(3), -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 0}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.11,0.061,0.428\\}$ and $\\{0.114,0.264,0.148\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.11, 0.061, 0.428\ndistribution2 = 0.114, 0.264, 0.148\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, -8, -1}$.\n", - "Output Answer": [ - "${-9, -8, -1}$" - ], - "Output Program": [ - "values = -9, -8, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-216, -1, 729, -125}$.\n", - "Output Answer": [ - "$(9+9 i) 5^{3/4} \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -216, -1, 729, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, 5, 5, 2, 8, -\\frac{9}{7}, -\\frac{19}{5}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "values = -10, 5, 5, 2, 8, -(9/7), -(19/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{21}{\\pi }, \\frac{28}{\\pi }, \\frac{4}{\\pi }, -\\frac{9}{\\pi }, \\frac{19}{\\pi }, \\frac{3}{\\pi }, -\\frac{28}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{38}{7 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (21/math.pi), (28/math.pi), (4/math.pi), -(9/math.pi), (19/math.pi), (3/math.pi), -(28/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{19}{2}, \\frac{31}{2}, \\frac{39}{2}, 2}$.\n", - "Output Answer": [ - "$\\frac{183768}{33127}$" - ], - "Output Program": [ - "import statistics\nvalues = (19/2), (31/2), (39/2), 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\sqrt{2}, 2, -1, 10} \\setminus {6, 2, -1}$.\n", - "Output Answer": [ - "${-2 \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(2), 2, -1, 10,))\nsnd = set((6, 2, -1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${13, -2, 5}$.\n", - "Output Answer": [ - "$\\frac{169}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -2, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, -2 \\sqrt{5}, 4, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{25}{e}, -4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-4-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -2*math.sqrt(5), 4, -(11/(math.sqrt(math.pi))), -(25/math.e), -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -1, 0, -1, 6, 2, 2, -1, -9, 0, -10, -10, 2, -1, -10, -1, 2, -9, 6, 0, -2, -2, 3}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -1, 0, -1, 6, 2, 2, -1, -9, 0, -10, -10, 2, -1, -10, -1, 2, -9, 6, 0, -2, -2, 3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 0, 0, 4, -6, 4, -9, 4, 4, 0, 0, -6, 4, 4, 4, -6, 0, -6, -6, -6, 0, -6, -6, -6}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 0, 0, 4, -6, 4, -9, 4, 4, 0, 0, -6, 4, 4, 4, -6, 0, -6, -6, -6, 0, -6, -6, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -10, \\frac{3}{\\sqrt{5}}, -4 \\sqrt{3}, 9, -7, 8, -7, -4, 2, 2, 5, 7, 6 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2+\\frac{3}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, -10, (3/(math.sqrt(5))), -4*math.sqrt(3), 9, -7, 8, -7, -4, 2, 2, 5, 7, 6*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{9}{\\sqrt{2}}, 9.67, 5, 2, -\\sqrt{5}, 2 \\sqrt{3}, -2, 1, \\pi, -\\frac{36}{5}} \\cup {2 \\pi, \\frac{9}{\\sqrt{2}}, -4.1, 1, -\\frac{36}{5}, -7, -9, -2 \\sqrt{3}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-9, -\\frac{36}{5}, -7, -4.1, -2 \\sqrt{3}, -\\sqrt{5}, -2, 1, 2, \\pi, 2 \\sqrt{3}, 5, 2 \\pi, \\frac{9}{\\sqrt{2}}, 3 \\sqrt{5}, 9.67}$" - ], - "Output Program": [ - "import math\n\nfst = set(((9/(math.sqrt(2))), 9.67, 5, 2, -math.sqrt(5), 2*math.sqrt(3), -2, 1, math.pi, -(36/5),))\nsnd = set((2*math.pi, (9/(math.sqrt(2))), -4.1, 1, -(36/5), -7, -9, -2*math.sqrt(3), 3*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\sqrt{3}, -\\frac{16}{\\sqrt{3}}, \\frac{1}{\\sqrt{3}}, 0, 3, 6, 4, 6}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, 0, \\frac{1}{\\sqrt{3}}, \\sqrt{3}, 3, 4, 6, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(3), -(16/(math.sqrt(3))), (1/(math.sqrt(3))), 0, 3, 6, 4, 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\pi, -1, 9, -9, 5 \\sqrt{2}, -7 \\sqrt{2}} \\setminus {-7 \\sqrt{2}, -10}$.\n", - "Output Answer": [ - "${-9, -2 \\pi, -1, 5 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, -1, 9, -9, 5*math.sqrt(2), -7*math.sqrt(2),))\nsnd = set((-7*math.sqrt(2), -10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, 100}$.\n", - "Output Answer": [ - "$20 i$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 2, 16}$.\n", - "Output Answer": [ - "$\\frac{336}{71}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 2, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, 36, 729, -10}$.\n", - "Output Answer": [ - "$72 \\sqrt[4]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, 36, 729, -10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 6561, 27, -729, 15625, 6}$.\n", - "Output Answer": [ - "$135 \\sqrt[6]{-1} \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 6561, 27, -729, 15625, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${11 \\log (2), -7.425}$.\n", - "Output Answer": [ - "${-7.425, 11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 11*math.log(2), -7.425\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-0.892, \\frac{26}{7}, -\\frac{6}{\\sqrt{5}}, 0} \\setminus {\\frac{20}{\\pi }, -4 \\sqrt{5}, 8, -\\frac{8}{\\sqrt{5}}, 2.285, 0, \\frac{26}{7}}$.\n", - "Output Answer": [ - "${-\\frac{6}{\\sqrt{5}}, -0.892}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.892, (26/7), -(6/(math.sqrt(5))), 0,))\nsnd = set(((20/math.pi), -4*math.sqrt(5), 8, -(8/(math.sqrt(5))), 2.285, 0, (26/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.125,0.023,0.154,0.093,0.137,0.095,0.066,0.139,0.124\\}$ and $\\{0.043,0.218,0.081,0.12,0.089,0.068,0.031,0.082,0.174\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.125, 0.023, 0.154, 0.093, 0.137, 0.095, 0.066, 0.139, 0.124\ndistribution2 = 0.043, 0.218, 0.081, 0.12, 0.089, 0.068, 0.031, 0.082, 0.174\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, 0, -8, -7, -6, 0}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 0, -8, -7, -6, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{34}{3}, \\frac{31}{3}, 1}$.\n", - "Output Answer": [ - "$\\frac{3162}{1249}$" - ], - "Output Program": [ - "import statistics\nvalues = (34/3), (31/3), 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{49}{5}, 4, -8, -4 \\log (2), -5, \\frac{17}{\\sqrt{3}}, -3 \\sqrt{2}} \\setminus {-3 \\sqrt{2}, -\\frac{49}{5}, -4 \\log (2), 5, \\frac{17}{\\sqrt{3}}, -8, 3}$.\n", - "Output Answer": [ - "${-5, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(49/5), 4, -8, -4*math.log(2), -5, (17/(math.sqrt(3))), -3*math.sqrt(2),))\nsnd = set((-3*math.sqrt(2), -(49/5), -4*math.log(2), 5, (17/(math.sqrt(3))), -8, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.231,0.208,0.079,0.157\\}$ and $\\{0.178,0.25,0.147,0.259\\}$.", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.231, 0.208, 0.079, 0.157\ndistribution2 = 0.178, 0.25, 0.147, 0.259\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, 8, 9, 2, 5, 2, 1, 9, 2, -5, 2, 8, -5, 2, 5, 5, 2, 1, -5, 1, 8, 1, 5, -5, 2, 8, 9, 5}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, 8, 9, 2, 5, 2, 1, 9, 2, -5, 2, 8, -5, 2, 5, 5, 2, 1, -5, 1, 8, 1, 5, -5, 2, 8, 9, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, \\frac{2}{3}}$.\n", - "Output Answer": [ - "$\\frac{32}{25}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, (2/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.001,0.573,0.231,0.147\\}$ and $\\{0.322,0.268,0.256,0.103\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.001, 0.573, 0.231, 0.147\ndistribution2 = 0.322, 0.268, 0.256, 0.103\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4 \\sqrt{2}, 6 \\sqrt{2}, -\\frac{9}{\\sqrt{2}}, 5 \\sqrt{2}, -\\sqrt{2}} \\cap {-\\frac{13}{\\sqrt{2}}, 6 \\sqrt{2}, -2 \\sqrt{2}, -\\frac{9}{\\sqrt{2}}, \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{9}{\\sqrt{2}}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(2), 6*math.sqrt(2), -(9/(math.sqrt(2))), 5*math.sqrt(2), -math.sqrt(2),))\nsnd = set((-(13/(math.sqrt(2))), 6*math.sqrt(2), -2*math.sqrt(2), -(9/(math.sqrt(2))), math.sqrt(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{2}, 11, 7, 12}$.\n", - "Output Answer": [ - "$\\frac{18480}{3313}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/2), 11, 7, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.51 < -3.3 x-3.6 < 0.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6].", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(P((-0.51 < -3.3*x-3.6) & (-3.3*x-3.6 < 0.2)))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, 7.88, -\\frac{7}{2}, -10, -2, -\\frac{17}{2}} \\cup {-10, 1, -2.34, -3, -\\frac{7}{2}, -7, \\frac{17}{2}}$.\n", - "Output Answer": [ - "${-10, -\\frac{17}{2}, -7, -6, -\\frac{7}{2}, -3, -2.34, -2, 1, 7.88, \\frac{17}{2}}$" - ], - "Output Program": [ - "fst = set((-6, 7.88, -(7/2), -10, -2, -(17/2),))\nsnd = set((-10, 1, -2.34, -3, -(7/2), -7, (17/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -2, -9, -2, -2, -2, 4, 3, -2, 3, 4, 3, -2, -9, -6, 3, 3, 4, 4, 4, 3, -2, -6}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -2, -9, -2, -2, -2, 4, 3, -2, 3, 4, 3, -2, -9, -6, 3, 3, 4, 4, 4, 3, -2, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 9, 9, 6, -2, 9, 5, 6, 10, -1, 5, 6, 10, 6, -1, -1, 6, 3, 9, 6, 6, 5, -2, 9}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 9, 9, 6, -2, 9, 5, 6, 10, -1, 5, 6, 10, 6, -1, -1, 6, 3, 9, 6, 6, 5, -2, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.1 x-3.6$ where $x \\sim $ \\text{NormalDistribution}[-1.9,1.3]\n", - "Output Answer": [ - "$-3.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.9, 1.3)\nprint(E(0.1*x-3.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{35}{2}, \\frac{13}{2}, \\frac{33}{2}, 20}$.\n", - "Output Answer": [ - "$\\frac{48048}{3863}$" - ], - "Output Program": [ - "import statistics\nvalues = (35/2), (13/2), (33/2), 20\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 7, 7, 16}$.\n", - "Output Answer": [ - "$\\frac{2240}{251}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 7, 7, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-1, -6, -3, 5, 0, -10, -4, -2, -7, 1} \\cap {3, -4, 5, -5, -7, 1, 8, -2, -10, -8, 6, 9}$.\n", - "Output Answer": [ - "${-10, -7, -4, -2, 1, 5}$" - ], - "Output Program": [ - "fst = set((-1, -6, -3, 5, 0, -10, -4, -2, -7, 1,))\nsnd = set((3, -4, 5, -5, -7, 1, 8, -2, -10, -8, 6, 9,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3 \\sqrt{3}, \\frac{3}{\\sqrt{2}}, -3, \\frac{2}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -3, \\frac{2}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(3), (3/(math.sqrt(2))), -3, (2/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{15}{2}, -7, -10, -\\frac{14}{\\sqrt{\\pi }}, -1, 1, e} \\setminus {8, -e, -\\frac{14}{\\sqrt{\\pi }}, -1, -\\frac{34}{7}}$.\n", - "Output Answer": [ - "${-10, -7, 1, e, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((15/2), -7, -10, -(14/(math.sqrt(math.pi))), -1, 1, math.e,))\nsnd = set((8, -math.e, -(14/(math.sqrt(math.pi))), -1, -(34/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.3 x^2-0.2 x-4.1$ where $x \\sim $ \\text{BetaDistribution}[1.4,0.3]\n", - "Output Answer": [ - "$-6.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.4, 0.3)\nprint(E(-3.3*x**2-0.2*x-4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-e, 5, -6, 1, -6, -2, 3 e, 1, -1}$.\n", - "Output Answer": [ - "$6+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -math.e, 5, -6, 1, -6, -2, 3*math.e, 1, -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -6, 0, -5 \\sqrt{2}, -2, \\frac{1}{2}, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -6, -2, 0, \\frac{1}{2}, 1, 3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -6, 0, -5*math.sqrt(2), -2, (1/2), 3*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{3}, \\sqrt{3}, -6, -1, 2 \\sqrt{3}, -3, \\frac{8}{3}, 7, -10, -4 \\sqrt{3}, 1, \\frac{2}{\\sqrt{5}}, 4, \\frac{25}{e}, 5}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(3), math.sqrt(3), -6, -1, 2*math.sqrt(3), -3, (8/3), 7, -10, -4*math.sqrt(3), 1, (2/(math.sqrt(5))), 4, (25/math.e), 5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, \\frac{17}{2}}$.\n", - "Output Answer": [ - "${-8, \\frac{17}{2}}$" - ], - "Output Program": [ - "values = -8, (17/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{2}, \\frac{31}{2}, \\frac{35}{2}}$.\n", - "Output Answer": [ - "$\\frac{3255}{566}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/2), (31/2), (35/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{7}{\\sqrt{2}}, 6 \\sqrt{2}, \\frac{67}{7}, -7, -5 \\sqrt{2}, -\\frac{15}{\\sqrt{\\pi }}, 3}$.\n", - "Output Answer": [ - "${-\\frac{15}{\\sqrt{\\pi }}, -5 \\sqrt{2}, -7, -\\frac{7}{\\sqrt{2}}, 3, 6 \\sqrt{2}, \\frac{67}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/(math.sqrt(2))), 6*math.sqrt(2), (67/7), -7, -5*math.sqrt(2), -(15/(math.sqrt(math.pi))), 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{12}{e}, -\\frac{34}{5}, -1, 3 \\sqrt{2}, \\frac{11}{2}, -5, 0, -5.506, \\frac{29}{3}, -3} \\cup {-\\frac{1}{2}, -\\frac{34}{5}, -5.506, -2, -5, 9, -\\frac{21}{4}, -3, \\frac{12}{e}, 0}$.\n", - "Output Answer": [ - "${-\\frac{34}{5}, -5.506, -\\frac{21}{4}, -5, -\\frac{12}{e}, -3, -2, -1, -\\frac{1}{2}, 0, 3 \\sqrt{2}, \\frac{12}{e}, \\frac{11}{2}, 9, \\frac{29}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(12/math.e), -(34/5), -1, 3*math.sqrt(2), (11/2), -5, 0, -5.506, (29/3), -3,))\nsnd = set((-(1/2), -(34/5), -5.506, -2, -5, 9, -(21/4), -3, (12/math.e), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 0, -2 \\sqrt{3}, 10, -\\sqrt{2}, -\\frac{25}{\\pi }, 0, -\\frac{1}{\\sqrt{3}}, e, \\frac{13}{\\sqrt{5}}, -9}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 0, -2*math.sqrt(3), 10, -math.sqrt(2), -(25/math.pi), 0, -(1/(math.sqrt(3))), math.e, (13/(math.sqrt(5))), -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{8}{3}, 6}$.\n", - "Output Answer": [ - "$\\frac{48}{13}$" - ], - "Output Program": [ - "import statistics\nvalues = (8/3), 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.2 x+1.7$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$17.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(4.2*x+1.7))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${2.997, 7.15, 5.108, 0.621, 1.125, -8.439, -7.804, -1.417, -3.508, -3.26} \\cap {-8.194, -7.893, 8.597, 1.835, -1.417, -7.804, 7.15, -3.837, 7.864, -7.26}$.\n", - "Output Answer": [ - "${-7.804, -1.417, 7.15}$" - ], - "Output Program": [ - "fst = set((2.997, 7.15, 5.108, 0.621, 1.125, -8.439, -7.804, -1.417, -3.508, -3.26,))\nsnd = set((-8.194, -7.893, 8.597, 1.835, -1.417, -7.804, 7.15, -3.837, 7.864, -7.26,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{53}{3}, 9, \\frac{16}{3}, 16}$.\n", - "Output Answer": [ - "$\\frac{7632}{797}$" - ], - "Output Program": [ - "import statistics\nvalues = (53/3), 9, (16/3), 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2, 0, 5, -6.356, -2, -8.779, 4 \\sqrt{5}} \\cup {2, 6.247, -2, 0, 5, 5.609, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-8.779, -6.356, -2, 0, 2, 5, 5.609, 6.247, 3 \\sqrt{5}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 0, 5, -6.356, -2, -8.779, 4*math.sqrt(5),))\nsnd = set((2, 6.247, -2, 0, 5, 5.609, 3*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 8, 6, 8}$.\n", - "Output Answer": [ - "$\\frac{48}{17}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 8, 6, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.064,0.02,0.081,0.164,0.252,0.199\\}$ and $\\{0.186,0.171,0.168,0.091,0.004,0.23\\}$.", - "Output Answer": [ - "$1.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.064, 0.02, 0.081, 0.164, 0.252, 0.199\ndistribution2 = 0.186, 0.171, 0.168, 0.091, 0.004, 0.23\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 3, 1, -6, -14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{687}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 3, 1, -6, -14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.391,0.005,0.36,0.222\\}$ and $\\{0.127,0.167,0.184,0.121\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.391, 0.005, 0.36, 0.222\ndistribution2 = 0.127, 0.167, 0.184, 0.121\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, -59049, 64, -16807, 10000}$.\n", - "Output Answer": [ - "$252 \\sqrt[5]{-1} 2^{2/5} 5^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -59049, 64, -16807, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{4}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$-\\frac{13}{2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(4/(math.sqrt(5))), -(9/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3.266, -3, -10, \\frac{9}{\\sqrt{2}}, 0} \\setminus {3.266, 8, -6, 0}$.\n", - "Output Answer": [ - "${-10, -3, \\frac{9}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3.266, -3, -10, (9/(math.sqrt(2))), 0,))\nsnd = set((3.266, 8, -6, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{17}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(17/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -6, 1, -\\frac{46}{5}, -1.46, 2} \\setminus {-2, -1.46, 8, 1, \\frac{3}{\\sqrt{2}}, \\frac{15}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-\\frac{46}{5}, -6, 2, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -6, 1, -(46/5), -1.46, 2,))\nsnd = set((-2, -1.46, 8, 1, (3/(math.sqrt(2))), (15/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${10, -2.168, -\\sqrt{2}, -\\frac{35}{4}, -8, -4 \\sqrt{3}, 5, -3 e} \\cup {-4 \\sqrt{3}, 5, 7, -\\frac{35}{4}, -\\sqrt{2}, -3 e, 10, -9.681}$.\n", - "Output Answer": [ - "${-9.681, -\\frac{35}{4}, -3 e, -8, -4 \\sqrt{3}, -2.168, -\\sqrt{2}, 5, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, -2.168, -math.sqrt(2), -(35/4), -8, -4*math.sqrt(3), 5, -3*math.e,))\nsnd = set((-4*math.sqrt(3), 5, 7, -(35/4), -math.sqrt(2), -3*math.e, 10, -9.681,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{8}{\\sqrt{3}}, 4 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, 4 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -\\frac{16}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, 4 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (8/(math.sqrt(3))), 4*math.sqrt(3), -(10/(math.sqrt(3))), -(5/(math.sqrt(3))), -(16/(math.sqrt(3))), 4*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -(16/(math.sqrt(3))), -(16/(math.sqrt(3))), -(16/(math.sqrt(3))), -(5/(math.sqrt(3))), -(16/(math.sqrt(3))), -(16/(math.sqrt(3))), -(16/(math.sqrt(3))), -(10/(math.sqrt(3))), -(5/(math.sqrt(3))), -(16/(math.sqrt(3))), 4*math.sqrt(3), (8/(math.sqrt(3))), -(10/(math.sqrt(3))), -(16/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-125, 343, 100, 4096, -7, 15625}$.\n", - "Output Answer": [ - "$20 \\sqrt[3]{2} 5^{5/6} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -125, 343, 100, 4096, -7, 15625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x^2-3.6 x-2.3$ where $x \\sim $ \\text{BetaDistribution}[0.3,1.4]\n", - "Output Answer": [ - "$-2.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 1.4)\nprint(E(3.6*x**2-3.6*x-2.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 11 \\log (2), -1, -3.1, 0.064} \\setminus {-1, 0.1, 0.064}$.\n", - "Output Answer": [ - "${-7, -3.1, 11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 11*math.log(2), -1, -3.1, 0.064,))\nsnd = set((-1, 0.1, 0.064,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, 10, -6, -\\sqrt{2}} \\setminus {-8, 4, \\frac{11}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-6, -\\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 10, -6, -math.sqrt(2),))\nsnd = set((-8, 4, (11/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, 6, 4, \\frac{14}{\\sqrt{5}}, -6, 7, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-8, -6, 4, 6, \\frac{14}{\\sqrt{5}}, 4 \\sqrt{3}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 6, 4, (14/(math.sqrt(5))), -6, 7, 4*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.5 x^2-1.4 x-1.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.5]\n", - "Output Answer": [ - "$-0.75$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.5)\nprint(E(0.5*x**2-1.4*x-1.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.006,0.032,0.117,0.217,0.226,0.009,0.104,0.089,0.164\\}$ and $\\{0.105,0.105,0.134,0.191,0.074,0.101,0.052,0.051,0.129\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.006, 0.032, 0.117, 0.217, 0.226, 0.009, 0.104, 0.089, 0.164\ndistribution2 = 0.105, 0.105, 0.134, 0.191, 0.074, 0.101, 0.052, 0.051, 0.129\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, \\frac{23}{2}, 4}$.\n", - "Output Answer": [ - "$\\frac{4140}{557}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, (23/2), 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 e, -4 e, 3 e, -4 e, e, 3 e, e, e, e, e, 2 e, 3 e, 2 e, 0, e, 2 e, e, e, 0, 2 e}$.\n", - "Output Answer": [ - "$\\{e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.e, -4*math.e, 3*math.e, -4*math.e, math.e, 3*math.e, math.e, math.e, math.e, math.e, 2*math.e, 3*math.e, 2*math.e, 0, math.e, 2*math.e, math.e, math.e, 0, 2*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 5, 7}$.\n", - "Output Answer": [ - "$\\frac{105}{47}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 5, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, -7, -10, -\\frac{22}{7}, 0, -6} \\cup {-10, -\\frac{22}{7}, -5, -7, 8}$.\n", - "Output Answer": [ - "${-10, -7, -6, -5, -4, -\\frac{22}{7}, 0, 8}$" - ], - "Output Program": [ - "fst = set((-4, -7, -10, -(22/7), 0, -6,))\nsnd = set((-10, -(22/7), -5, -7, 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3 \\sqrt{5}, -2 \\sqrt{3}, -2, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -2 \\sqrt{3}, -2, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), -2*math.sqrt(3), -2, 2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -\\frac{25}{4}, 2.704, -3.48, 2 \\sqrt{2}, 4 \\sqrt{5}, \\frac{27}{7}, -6}$.\n", - "Output Answer": [ - "${-\\frac{25}{4}, -6, -3.48, 1, 2.704, 2 \\sqrt{2}, \\frac{27}{7}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -(25/4), 2.704, -3.48, 2*math.sqrt(2), 4*math.sqrt(5), (27/7), -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 8, 19}$.\n", - "Output Answer": [ - "$\\frac{2280}{287}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 8, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{22}{3}, 4, \\frac{16}{3}}$.\n", - "Output Answer": [ - "$\\frac{528}{101}$" - ], - "Output Program": [ - "import statistics\nvalues = (22/3), 4, (16/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7.9, 3, 8.6, -1, -9, 9 \\log (2), -\\frac{5}{\\sqrt{2}}} \\cup {-3 \\sqrt{2}, 11 \\log (2), -9, 3, 8.6, 4, 5.6}$.\n", - "Output Answer": [ - "${-9, -3 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -1, 3, 4, 5.6, 9 \\log (2), 11 \\log (2), 7.9, 8.6}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.9, 3, 8.6, -1, -9, 9*math.log(2), -(5/(math.sqrt(2))),))\nsnd = set((-3*math.sqrt(2), 11*math.log(2), -9, 3, 8.6, 4, 5.6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{2}, -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{2}-\\frac{3}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(2), -(3/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.169,0.079,0.084,0.1,0.16,0.191,0.089\\}$ and $\\{0.02,0.073,0.474,0.14,0.047,0.082,0.133\\}$.", - "Output Answer": [ - "$0.69$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.169, 0.079, 0.084, 0.1, 0.16, 0.191, 0.089\ndistribution2 = 0.02, 0.073, 0.474, 0.14, 0.047, 0.082, 0.133\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, -\\frac{23}{e}, -2, 7}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, -(23/math.e), -2, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${256, -32, 1000, -8, -64}$.\n", - "Output Answer": [ - "$32 \\sqrt[5]{-1} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 256, -32, 1000, -8, -64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.143,0.069,0.128,0.064,0.021,0.236,0.067,0.1,0.055\\}$ and $\\{0.025,0.007,0.162,0.081,0.073,0.044,0.062,0.168,0.246\\}$.", - "Output Answer": [ - "$0.67$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.143, 0.069, 0.128, 0.064, 0.021, 0.236, 0.067, 0.1, 0.055\ndistribution2 = 0.025, 0.007, 0.162, 0.081, 0.073, 0.044, 0.062, 0.168, 0.246\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 8, 17, 14}$.\n", - "Output Answer": [ - "$\\frac{11424}{1205}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 8, 17, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2 \\sqrt{5}, 7, 7}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, 7, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), 7, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, 1, -7, -6 \\sqrt{2}, -6, 8, 7, \\frac{31}{4}, 0, -2, -2, \\frac{15}{4}}$.\n", - "Output Answer": [ - "$8+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 1, -7, -6*math.sqrt(2), -6, 8, 7, (31/4), 0, -2, -2, (15/4)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x-2.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$0.75$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(1.3*x-2.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.014,0.026,0.057,0.033,0.409,0.019,0.153,0.175,0.106,0.002\\}$ and $\\{0.07,0.022,0.209,0.054,0.19,0.184,0.067,0.129,0.023,0.03\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.014, 0.026, 0.057, 0.033, 0.409, 0.019, 0.153, 0.175, 0.106, 0.002\ndistribution2 = 0.07, 0.022, 0.209, 0.054, 0.19, 0.184, 0.067, 0.129, 0.023, 0.03\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{20}{3}, 17, 14}$.\n", - "Output Answer": [ - "$\\frac{7140}{667}$" - ], - "Output Program": [ - "import statistics\nvalues = (20/3), 17, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 4, 5, -8, -14}$.\n", - "Output Answer": [ - "$\\frac{647}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 4, 5, -8, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -\\frac{19}{7}}$.\n", - "Output Answer": [ - "$\\frac{75}{7}$" - ], - "Output Program": [ - "values = 8, -(19/7)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, 2, -4 \\sqrt{2}, 4, 4 \\sqrt{2}, 2 \\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, 2, -4*math.sqrt(2), 4, 4*math.sqrt(2), 2*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -4, -6, -7, -6, -9, -7, -6, -2, -6, -2, -4, -9, -4, -2, -6, -4, -9, -7, -7, -9, -4, -4, -7, -7}$.\n", - "Output Answer": [ - "$\\{-6,-4,-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -4, -6, -7, -6, -9, -7, -6, -2, -6, -2, -4, -9, -4, -2, -6, -4, -9, -7, -7, -9, -4, -4, -7, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{5}{\\sqrt{3}}, 0}$.", - "Output Answer": [ - "$-\\frac{5}{2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(5/(math.sqrt(3))), 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 3, 6, -4, -4, -4, 6, 3, 8, 6, 6, 3, 3, 6, 9, 3, 8, 8, 6, 6, 9}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 3, 6, -4, -4, -4, 6, 3, 8, 6, 6, 3, 3, 6, 9, 3, 8, 8, 6, 6, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x+1.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$2.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(3.1*x+1.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.177,0.252,0.324,0.032,0.104\\}$ and $\\{0.209,0.156,0.037,0.116,0.347\\}$.", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.177, 0.252, 0.324, 0.032, 0.104\ndistribution2 = 0.209, 0.156, 0.037, 0.116, 0.347\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -8, 0, 4, 0, -8, 8, 0, 4, 0, -1, 0, 4, -3, 4, 0, 4, 8, 0, 8, 8, 4, 4}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -8, 0, 4, 0, -8, 8, 0, 4, 0, -1, 0, 4, -3, 4, 0, 4, 8, 0, 8, 8, 4, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 9, -9, 8, -5, 8, 6, 6, -5, 8, 5, -5, -5, 1, 5, 8, 8, 1, 1, 8, 8, 9, 1, 6, 7}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 9, -9, 8, -5, 8, 6, 6, -5, 8, 5, -5, -5, 1, 5, 8, 8, 1, 1, 8, 8, 9, 1, 6, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 e, -5, 6}$.", - "Output Answer": [ - "$2 e$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.e, -5, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, -5, -14, 10, 10, -12}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{454}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -5, -14, 10, 10, -12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, 3 \\sqrt{5}, \\frac{16}{3}, -9, -6, -9, -1, 3 e, -8, \\frac{2}{\\pi }, 3 \\sqrt{5}, -9, -\\frac{37}{4}, 1, 7}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, 3*math.sqrt(5), (16/3), -9, -6, -9, -1, 3*math.e, -8, (2/math.pi), 3*math.sqrt(5), -9, -(37/4), 1, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -8, -3, 7 \\log (2)}$.\n", - "Output Answer": [ - "${-8, -3, 1, 7 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -8, -3, 7*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.132,0.196,0.471\\}$ and $\\{0.007,0.322,0.316\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.132, 0.196, 0.471\ndistribution2 = 0.007, 0.322, 0.316\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -\\frac{11}{\\sqrt{3}}, 6, -1, -0.689, 3 \\sqrt{3}, -4.8} \\cup {-4.8, 4, -1, -\\frac{5}{\\sqrt{3}}, 8.418, 6, 10, -7, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -7, -\\frac{11}{\\sqrt{3}}, -4.8, -\\frac{5}{\\sqrt{3}}, -1, -0.689, 4, 5, 3 \\sqrt{3}, 6, 8.418, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -(11/(math.sqrt(3))), 6, -1, -0.689, 3*math.sqrt(3), -4.8,))\nsnd = set((-4.8, 4, -1, -(5/(math.sqrt(3))), 8.418, 6, 10, -7, -5*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6, -2, 8, 3 \\sqrt{2}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{2}}} \\setminus {4 \\sqrt{2}, 6, 7, 3 \\sqrt{2}, -2, 3}$.\n", - "Output Answer": [ - "${-\\frac{4}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{2}}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -2, 8, 3*math.sqrt(2), -(4/(math.sqrt(math.pi))), -(1/(math.sqrt(2))),))\nsnd = set((4*math.sqrt(2), 6, 7, 3*math.sqrt(2), -2, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.084,0.248,0.1,0.126,0.202,0.162\\}$ and $\\{0.107,0.372,0.036,0.081,0.114,0.247\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.084, 0.248, 0.1, 0.126, 0.202, 0.162\ndistribution2 = 0.107, 0.372, 0.036, 0.081, 0.114, 0.247\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.061,0.112,0.09,0.166,0.16,0.125,0.089,0.122\\}$ and $\\{0.062,0.021,0.031,0.059,0.277,0.122,0.143,0.189\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.061, 0.112, 0.09, 0.166, 0.16, 0.125, 0.089, 0.122\ndistribution2 = 0.062, 0.021, 0.031, 0.059, 0.277, 0.122, 0.143, 0.189\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -4, \\frac{2}{\\sqrt{3}}, 1}$.\n", - "Output Answer": [ - "$4+\\frac{2}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -4, (2/(math.sqrt(3))), 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 64, 49, -9, 27}$.\n", - "Output Answer": [ - "$12 \\sqrt[5]{-1} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 64, 49, -9, 27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{2}, -3 \\sqrt{2}, 3 \\sqrt{2}, -7 \\sqrt{2}, 3 \\sqrt{2}, 3 \\sqrt{2}, -5 \\sqrt{2}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{5}{2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(2), -3*math.sqrt(2), 3*math.sqrt(2), -7*math.sqrt(2), 3*math.sqrt(2), 3*math.sqrt(2), -5*math.sqrt(2), -3*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, 729, 27, 625}$.\n", - "Output Answer": [ - "$135\\ 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, 729, 27, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, 5, 3, -4}$.\n", - "Output Answer": [ - "$\\frac{53}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 5, 3, -4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{27}{7}, \\frac{20}{3}, 4.41, 2} \\cup {7.32, 2, \\frac{20}{3}, \\frac{25}{7}}$.\n", - "Output Answer": [ - "${2, \\frac{25}{7}, \\frac{27}{7}, 4.41, \\frac{20}{3}, 7.32}$" - ], - "Output Program": [ - "fst = set(((27/7), (20/3), 4.41, 2,))\nsnd = set((7.32, 2, (20/3), (25/7),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.042,0.151,0.367,0.277\\}$ and $\\{0.4,0.013,0.583,0.004\\}$.", - "Output Answer": [ - "$1.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.042, 0.151, 0.367, 0.277\ndistribution2 = 0.4, 0.013, 0.583, 0.004\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{3}, 7, 1, -\\frac{3}{\\sqrt{2}}, 4 \\sqrt{3}, -2} \\setminus {5, -3, 6}$.\n", - "Output Answer": [ - "${-\\frac{3}{\\sqrt{2}}, -2, 1, 3 \\sqrt{3}, 4 \\sqrt{3}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), 7, 1, -(3/(math.sqrt(2))), 4*math.sqrt(3), -2,))\nsnd = set((5, -3, 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{2}, -\\frac{11}{e}, 1, -\\frac{3}{2}, 7.21, \\sqrt{5}} \\cup {\\sqrt{5}, -2.27, -\\frac{17}{4}, -\\sqrt{2}, \\frac{26}{3}, -\\frac{11}{e}}$.\n", - "Output Answer": [ - "${-\\frac{17}{4}, -3 \\sqrt{2}, -\\frac{11}{e}, -2.27, -\\frac{3}{2}, -\\sqrt{2}, 1, \\sqrt{5}, 7.21, \\frac{26}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(2), -(11/math.e), 1, -(3/2), 7.21, math.sqrt(5),))\nsnd = set((math.sqrt(5), -2.27, -(17/4), -math.sqrt(2), (26/3), -(11/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{35}{3}, 1}$.\n", - "Output Answer": [ - "$\\frac{35}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = (35/3), 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{11}{5}, 10, -\\frac{1}{3}}$.\n", - "Output Answer": [ - "${-\\frac{1}{3}, \\frac{11}{5}, 10}$" - ], - "Output Program": [ - "values = (11/5), 10, -(1/3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 18, \\frac{20}{3}, \\frac{37}{3}}$.\n", - "Output Answer": [ - "$\\frac{26640}{2279}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 18, (20/3), (37/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -9, 6} \\setminus {0, 7, 4, 6}$.\n", - "Output Answer": [ - "${-9, -2}$" - ], - "Output Program": [ - "fst = set((-2, -9, 6,))\nsnd = set((0, 7, 4, 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -2, -7, -10, -5}$.\n", - "Output Answer": [ - "$-\\frac{22}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -2, -7, -10, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6 \\sqrt{3}, 0, -2 \\sqrt{3}, -2 \\sqrt{3}, 5 \\sqrt{3}, 3 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 0, -2 \\sqrt{3}, 0, 5 \\sqrt{3}, 5 \\sqrt{3}, 0, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 0, -2 \\sqrt{3}, -4 \\sqrt{3}, 5 \\sqrt{3}, 6 \\sqrt{3}, 6 \\sqrt{3}, 0, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{5 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 6*math.sqrt(3), 0, -2*math.sqrt(3), -2*math.sqrt(3), 5*math.sqrt(3), 3*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 0, -2*math.sqrt(3), 0, 5*math.sqrt(3), 5*math.sqrt(3), 0, 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 0, -2*math.sqrt(3), -4*math.sqrt(3), 5*math.sqrt(3), 6*math.sqrt(3), 6*math.sqrt(3), 0, 3*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, \\sqrt{3}, 1, -\\frac{10}{e}, \\pi, 4, -\\frac{18}{5}, -7 \\sqrt{2}, -4, 3 \\sqrt{2}}$.", - "Output Answer": [ - "$-\\frac{13}{10}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, math.sqrt(3), 1, -(10/math.e), math.pi, 4, -(18/5), -7*math.sqrt(2), -4, 3*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 16, 1, 27, -3}$.\n", - "Output Answer": [ - "$6^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 16, 1, 27, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\log (2), \\frac{17}{\\sqrt{3}}, \\frac{23}{3}, -\\frac{18}{\\sqrt{5}}, -\\pi, -2, \\frac{9}{\\sqrt{2}}, -9, 5, -\\pi, -e}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.log(2), (17/(math.sqrt(3))), (23/3), -(18/(math.sqrt(5))), -math.pi, -2, (9/(math.sqrt(2))), -9, 5, -math.pi, -math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${343, 9, 6}$.\n", - "Output Answer": [ - "$21 \\sqrt[3]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 343, 9, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 2, 4, 1}$.\n", - "Output Answer": [ - "$\\frac{80}{39}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 2, 4, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -4 \\sqrt{5}, 1, -2, -4, 1, 5, -\\frac{26}{\\pi }, -\\frac{30}{7}}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -4*math.sqrt(5), 1, -2, -4, 1, 5, -(26/math.pi), -(30/7)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, 2 \\pi, -6, 6, 1, 0, 7, 7}$.", - "Output Answer": [ - "$\\frac{7}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, 2*math.pi, -6, 6, 1, 0, 7, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{16}{\\pi }, \\frac{1}{2}, -5, -10, -9, 0, 4, -\\frac{9}{\\pi }, \\frac{22}{3}, 3, 2, 0, -7, 3, -\\frac{17}{\\sqrt{5}}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (16/math.pi), (1/2), -5, -10, -9, 0, 4, -(9/math.pi), (22/3), 3, 2, 0, -7, 3, -(17/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^3+2.7 x^2-3.5 x-1.$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(1.3*x**3+2.7*x**2-3.5*x-1.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, 8, -4, -5, 8, -5, 0, 9, 8, 9, 9, 0, -1, 8, -1, 8, -1, 0, -5, 0, -3, -3, -1, -5, -3, -1}$.\n", - "Output Answer": [ - "$\\{-5,8,-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, 8, -4, -5, 8, -5, 0, 9, 8, 9, 9, 0, -1, 8, -1, 8, -1, 0, -5, 0, -3, -3, -1, -5, -3, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 14 \\log (2), -2 \\sqrt{3}, -\\frac{47}{7}, -6, -1} \\cup {-\\frac{47}{7}, -5 \\sqrt{3}, -5, -9, 14 \\log (2), -\\frac{22}{5}, -1}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -\\frac{47}{7}, -6, -5, -\\frac{22}{5}, -2 \\sqrt{3}, -1, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 14*math.log(2), -2*math.sqrt(3), -(47/7), -6, -1,))\nsnd = set((-(47/7), -5*math.sqrt(3), -5, -9, 14*math.log(2), -(22/5), -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -3, 8, -\\frac{17}{e}}$.\n", - "Output Answer": [ - "$8+\\frac{17}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -3, 8, -(17/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{13}{\\sqrt{5}}, 4, -1, -\\frac{26}{5}, 4 \\sqrt{5}} \\setminus {-7, 4 \\sqrt{5}, -1, -\\frac{19}{5}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{5}}, -\\frac{26}{5}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/(math.sqrt(5))), 4, -1, -(26/5), 4*math.sqrt(5),))\nsnd = set((-7, 4*math.sqrt(5), -1, -(19/5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x-2.3$ where $x \\sim $ \\text{PoissonDistribution}[2.2]\n", - "Output Answer": [ - "$-0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.2)\nprint(E(1.*x-2.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, 8, \\frac{10}{3}, -4.617, 9, 6, 9, -9}$.\n", - "Output Answer": [ - "${-9, -4.617, 3, \\frac{10}{3}, 6, 8, 9, 9}$" - ], - "Output Program": [ - "values = 3, 8, (10/3), -4.617, 9, 6, 9, -9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x^2+3.1 x-2.8$ where $x \\sim $ \\text{NormalDistribution}[-1.4,0.6]\n", - "Output Answer": [ - "$-13.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.4, 0.6)\nprint(E(-2.7*x**2+3.1*x-2.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10, 0, 1, 2 e, \\frac{14}{\\sqrt{\\pi }}, 4 \\sqrt{2}, -\\frac{9}{\\sqrt{\\pi }}, -\\frac{34}{7}} \\setminus {-\\frac{9}{\\sqrt{\\pi }}, 9, 10, 0, 2 e}$.\n", - "Output Answer": [ - "${-\\frac{34}{7}, 1, 4 \\sqrt{2}, \\frac{14}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 0, 1, 2*math.e, (14/(math.sqrt(math.pi))), 4*math.sqrt(2), -(9/(math.sqrt(math.pi))), -(34/7),))\nsnd = set((-(9/(math.sqrt(math.pi))), 9, 10, 0, 2*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 7.9, -4, 2.05, 0, 6} \\setminus {1, 2.05, 1.3, -1, -3 \\log (2), 6, -4}$.\n", - "Output Answer": [ - "${0, 7.9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 7.9, -4, 2.05, 0, 6,))\nsnd = set((1, 2.05, 1.3, -1, -3*math.log(2), 6, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{5}, 2, -2 e, \\frac{15}{\\pi }, -\\frac{9}{\\sqrt{2}}, \\frac{23}{\\pi }, -8, e} \\cup {-2 e, e, -3 \\sqrt{5}, -2 \\sqrt{2}, \\frac{23}{\\pi }, -\\frac{13}{3}, -\\frac{27}{\\pi }, 2}$.\n", - "Output Answer": [ - "${-\\frac{27}{\\pi }, -8, -3 \\sqrt{5}, -\\frac{9}{\\sqrt{2}}, -2 e, -\\frac{13}{3}, -2 \\sqrt{2}, 2, e, \\frac{15}{\\pi }, \\frac{23}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(5), 2, -2*math.e, (15/math.pi), -(9/(math.sqrt(2))), (23/math.pi), -8, math.e,))\nsnd = set((-2*math.e, math.e, -3*math.sqrt(5), -2*math.sqrt(2), (23/math.pi), -(13/3), -(27/math.pi), 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -6, 13, -9}$.\n", - "Output Answer": [ - "$\\frac{341}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -6, 13, -9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.8 x-1.9$ where $x \\sim $ \\text{PoissonDistribution}[3.8]\n", - "Output Answer": [ - "$-8.74$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.8)\nprint(E(-1.8*x-1.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.8 x-1.$ where $x \\sim $ \\text{BetaDistribution}[1.1,1.7]\n", - "Output Answer": [ - "$-0.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.1, 1.7)\nprint(E(0.8*x-1.))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{14}{e}, \\frac{5}{e}, -\\frac{12}{e}, -\\frac{22}{e}, \\frac{23}{e}, \\frac{9}{e}, \\frac{24}{e}, \\frac{14}{e}, -\\frac{1}{e}, -\\frac{6}{e}, -\\frac{15}{e}, 0, \\frac{13}{e}} \\cap {-\\frac{8}{e}, \\frac{3}{e}, \\frac{9}{e}, -\\frac{1}{e}, 0, -\\frac{19}{e}, \\frac{27}{e}, -\\frac{6}{e}, \\frac{20}{e}, \\frac{4}{e}, \\frac{17}{e}, -\\frac{15}{e}, -\\frac{9}{e}, \\frac{23}{e}}$.\n", - "Output Answer": [ - "${-\\frac{15}{e}, -\\frac{6}{e}, -\\frac{1}{e}, 0, \\frac{9}{e}, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(14/math.e), (5/math.e), -(12/math.e), -(22/math.e), (23/math.e), (9/math.e), (24/math.e), (14/math.e), -(1/math.e), -(6/math.e), -(15/math.e), 0, (13/math.e),))\nsnd = set((-(8/math.e), (3/math.e), (9/math.e), -(1/math.e), 0, -(19/math.e), (27/math.e), -(6/math.e), (20/math.e), (4/math.e), (17/math.e), -(15/math.e), -(9/math.e), (23/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.249,0.172,0.497\\}$ and $\\{0.48,0.511,0.008\\}$.", - "Output Answer": [ - "$1.94$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.249, 0.172, 0.497\ndistribution2 = 0.48, 0.511, 0.008\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, 3, 4, -\\frac{48}{5}, 8 \\log (2), -\\frac{40}{7}, 4 \\sqrt{2}} \\cup {-9, -5, \\frac{9}{\\sqrt{2}}, 8 \\log (2), -\\frac{48}{5}, -\\frac{40}{7}, \\frac{46}{5}, 4 \\sqrt{2}, 8}$.\n", - "Output Answer": [ - "${-\\frac{48}{5}, -9, -\\frac{40}{7}, -5, 3, 4, 5, 8 \\log (2), 4 \\sqrt{2}, \\frac{9}{\\sqrt{2}}, 8, \\frac{46}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 3, 4, -(48/5), 8*math.log(2), -(40/7), 4*math.sqrt(2),))\nsnd = set((-9, -5, (9/(math.sqrt(2))), 8*math.log(2), -(48/5), -(40/7), (46/5), 4*math.sqrt(2), 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.47 < 2.8 x-2.8 < 1.01$ where $x \\sim $ \\text{NormalDistribution}[0.9,2.8].", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.9, 2.8)\nprint(P((0.47 < 2.8*x-2.8) & (2.8*x-2.8 < 1.01)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{3}, \\frac{14}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}, \\frac{1}{\\sqrt{3}}, 5 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{2}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(3), (14/(math.sqrt(3))), -(5/(math.sqrt(3))), (1/(math.sqrt(3))), 5*math.sqrt(3), -(10/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 e, 3 e, -e, -e, 2 e, -3 e, 0}$.\n", - "Output Answer": [ - "$-\\frac{3 e}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.e, 3*math.e, -math.e, -math.e, 2*math.e, -3*math.e, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, \\frac{21}{2}, \\frac{9}{2}}$.\n", - "Output Answer": [ - "$\\frac{2079}{283}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, (21/2), (9/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, -3, -1, -3, -7, -1, -1, -9, -3, -1, 9, -1, -1, -1, -1, -9, -3, -1, -3, -1, -1, -3, -3}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, -3, -1, -3, -7, -1, -1, -9, -3, -1, 9, -1, -1, -1, -1, -9, -3, -1, -3, -1, -1, -3, -3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, 4 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, 4 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, 4 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, 4 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), 4*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), 4*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), 4*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), 4*math.sqrt(3), -math.sqrt(3), -math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -3, 0, -2, -5, 0, 5, -3}$.\n", - "Output Answer": [ - "$-\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -3, 0, -2, -5, 0, 5, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 7, 1, 15}$.\n", - "Output Answer": [ - "$\\frac{70}{27}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 7, 1, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\pi, -7.2, 8, \\frac{11}{\\pi }, \\frac{28}{5}, 0, -2.046, 3, 6} \\setminus {-1, \\frac{28}{5}, \\frac{11}{\\pi }, 0, 8, -7.2, 3}$.\n", - "Output Answer": [ - "${-2.046, 6, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, -7.2, 8, (11/math.pi), (28/5), 0, -2.046, 3, 6,))\nsnd = set((-1, (28/5), (11/math.pi), 0, 8, -7.2, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.2 x^3+0.5 x^2-3.9 x+2.$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.]\n", - "Output Answer": [ - "$6.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(E(3.2*x**3+0.5*x**2-3.9*x+2.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.207,0.091,0.085,0.238,0.079,0.113,0.084\\}$ and $\\{0.088,0.068,0.118,0.246,0.037,0.207,0.095\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.207, 0.091, 0.085, 0.238, 0.079, 0.113, 0.084\ndistribution2 = 0.088, 0.068, 0.118, 0.246, 0.037, 0.207, 0.095\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{3}, 9, \\frac{23}{\\pi }, 7, \\frac{7}{\\sqrt{3}}, -\\sqrt{5}, -2, 7, -\\frac{13}{\\pi }, \\frac{19}{e}, -6, 8, -7, -4 \\sqrt{5}, -8}$.", - "Output Answer": [ - "$2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(3), 9, (23/math.pi), 7, (7/(math.sqrt(3))), -math.sqrt(5), -2, 7, -(13/math.pi), (19/math.e), -6, 8, -7, -4*math.sqrt(5), -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -2, -8}$.\n", - "Output Answer": [ - "$-\\frac{16}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -2, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, 3, 1, 7., -8, -\\frac{15}{2}} \\setminus {-8, -3, 0.5, -\\pi, -\\frac{8}{\\sqrt{\\pi }}, -\\frac{29}{3}, -2, 1}$.\n", - "Output Answer": [ - "${-\\frac{15}{2}, 3, 7., 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 3, 1, 7., -8, -(15/2),))\nsnd = set((-8, -3, 0.5, -math.pi, -(8/(math.sqrt(math.pi))), -(29/3), -2, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.103,0.372,0.056,0.127,0.281\\}$ and $\\{0.101,0.141,0.317,0.2,0.161\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.103, 0.372, 0.056, 0.127, 0.281\ndistribution2 = 0.101, 0.141, 0.317, 0.2, 0.161\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, -4 \\log (2), -7 \\log (2), -4 \\log (2), -12 \\log (2), -7 \\log (2), -4 \\log (2), -9 \\log (2), -12 \\log (2), 0, -9 \\log (2), 0, -4 \\log (2), -12 \\log (2), -7 \\log (2), 0, 0, -9 \\log (2), -12 \\log (2), -9 \\log (2), -12 \\log (2), -9 \\log (2), -9 \\log (2), -7 \\log (2), -12 \\log (2)}$.\n", - "Output Answer": [ - "$\\{0,-12 \\log (2),-9 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 0, -4*math.log(2), -7*math.log(2), -4*math.log(2), -12*math.log(2), -7*math.log(2), -4*math.log(2), -9*math.log(2), -12*math.log(2), 0, -9*math.log(2), 0, -4*math.log(2), -12*math.log(2), -7*math.log(2), 0, 0, -9*math.log(2), -12*math.log(2), -9*math.log(2), -12*math.log(2), -9*math.log(2), -9*math.log(2), -7*math.log(2), -12*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.084,0.073,0.032,0.075,0.099,0.286,0.087,0.022,0.174\\}$ and $\\{0.06,0.033,0.213,0.067,0.199,0.095,0.065,0.081,0.035\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.084, 0.073, 0.032, 0.075, 0.099, 0.286, 0.087, 0.022, 0.174\ndistribution2 = 0.06, 0.033, 0.213, 0.067, 0.199, 0.095, 0.065, 0.081, 0.035\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{35}{4}, \\frac{12}{e}, -\\frac{2}{\\pi }, -4, 4 \\sqrt{5}} \\setminus {3 \\sqrt{5}, -8.526, -\\frac{2}{\\pi }}$.\n", - "Output Answer": [ - "${-4, \\frac{12}{e}, \\frac{35}{4}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((35/4), (12/math.e), -(2/math.pi), -4, 4*math.sqrt(5),))\nsnd = set((3*math.sqrt(5), -8.526, -(2/math.pi),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, -13, -15}$.\n", - "Output Answer": [ - "$\\frac{172}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -13, -15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -4 \\sqrt{3}, 2.863, 3, -\\frac{39}{5}, -\\frac{3}{2}} \\setminus {-\\frac{43}{5}, 2.863, -e, 4 \\sqrt{3}, 3}$.\n", - "Output Answer": [ - "${-9, -\\frac{39}{5}, -4 \\sqrt{3}, -\\frac{3}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -4*math.sqrt(3), 2.863, 3, -(39/5), -(3/2),))\nsnd = set((-(43/5), 2.863, -math.e, 4*math.sqrt(3), 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 2, 11}$.\n", - "Output Answer": [ - "$\\frac{198}{61}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 2, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.7 x-1.5$ where $x \\sim $ \\text{BetaDistribution}[1.6,0.5]\n", - "Output Answer": [ - "$-2.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 0.5)\nprint(E(-1.7*x-1.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, 6, -15, 14, 9}$.\n", - "Output Answer": [ - "$\\frac{1443}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, 6, -15, 14, 9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.243,0.21,0.263,0.239\\}$ and $\\{0.21,0.219,0.09,0.212\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.243, 0.21, 0.263, 0.239\ndistribution2 = 0.21, 0.219, 0.09, 0.212\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 3 \\sqrt{2}, 1.253, -5, 0, \\frac{17}{5}, 2, -3 e, -\\frac{9}{4}} \\cup {\\frac{11}{\\sqrt{2}}, -5, 2 \\sqrt{5}, 3, -\\frac{9}{4}, \\frac{9}{7}, -3 e, -7, \\frac{17}{5}}$.\n", - "Output Answer": [ - "${-3 e, -7, -5, -3, -\\frac{9}{4}, 0, 1.253, \\frac{9}{7}, 2, 3, \\frac{17}{5}, 3 \\sqrt{2}, 2 \\sqrt{5}, \\frac{11}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 3*math.sqrt(2), 1.253, -5, 0, (17/5), 2, -3*math.e, -(9/4),))\nsnd = set(((11/(math.sqrt(2))), -5, 2*math.sqrt(5), 3, -(9/4), (9/7), -3*math.e, -7, (17/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-e, -2 e, 2 e}$.\n", - "Output Answer": [ - "$-\\frac{e}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.e, -2*math.e, 2*math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.523,0.073,0.105,0.064,0.114\\}$ and $\\{0.243,0.084,0.227,0.028,0.097\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.523, 0.073, 0.105, 0.064, 0.114\ndistribution2 = 0.243, 0.084, 0.227, 0.028, 0.097\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{29}{2}, 1, 20, 6}$.\n", - "Output Answer": [ - "$\\frac{6960}{2237}$" - ], - "Output Program": [ - "import statistics\nvalues = (29/2), 1, 20, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, -4, 1, 1296}$.\n", - "Output Answer": [ - "$(6+6 i) \\sqrt[4]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -4, 1, 1296\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -4 \\sqrt{5}, 0, 5, 9, -2, -1, 5 \\sqrt{2}, \\frac{17}{\\sqrt{3}}, 8, -3, -8, \\frac{2}{5}, -e}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -4*math.sqrt(5), 0, 5, 9, -2, -1, 5*math.sqrt(2), (17/(math.sqrt(3))), 8, -3, -8, (2/5), -math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 4, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$4+2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 4, -2*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -2 \\sqrt{5}, -\\frac{15}{4}, 1}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -2*math.sqrt(5), -(15/4), 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, -3, \\frac{1}{7}, 6, \\frac{4}{\\sqrt{5}}, 1.04}$.\n", - "Output Answer": [ - "${-8, -3, \\frac{1}{7}, 1.04, \\frac{4}{\\sqrt{5}}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -3, (1/7), 6, (4/(math.sqrt(5))), 1.04\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.174,0.115,0.173,0.106,0.019,0.125,0.064,0.04,0.023\\}$ and $\\{0.017,0.039,0.16,0.032,0.091,0.091,0.288,0.126,0.093\\}$.", - "Output Answer": [ - "$0.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.174, 0.115, 0.173, 0.106, 0.019, 0.125, 0.064, 0.04, 0.023\ndistribution2 = 0.017, 0.039, 0.16, 0.032, 0.091, 0.091, 0.288, 0.126, 0.093\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 0}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "values = -3, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{3}, -4.57, -\\sqrt{2}} \\setminus {3, 4, \\frac{9}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{2}}, -\\frac{1}{\\sqrt{5}}, 2, \\frac{5}{2}}$.\n", - "Output Answer": [ - "${-4.57, -\\sqrt{2}, 3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), -4.57, -math.sqrt(2),))\nsnd = set((3, 4, (9/(math.sqrt(math.pi))), (9/(math.sqrt(2))), -(1/(math.sqrt(5))), 2, (5/2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, \\pi, -\\pi, -\\frac{17}{\\sqrt{5}}, -5 \\log (2), \\frac{18}{5}, -4, -8, -\\frac{10}{3}, -\\sqrt{3}, 7, \\frac{5}{e}, 3}$.", - "Output Answer": [ - "$-\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, math.pi, -math.pi, -(17/(math.sqrt(5))), -5*math.log(2), (18/5), -4, -8, -(10/3), -math.sqrt(3), 7, (5/math.e), 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\pi, 2 \\pi, 2 \\pi, -\\pi, 2 \\pi, 2 \\pi, 2 \\pi, \\pi, \\pi, -2 \\pi, 2 \\pi, 2 \\pi, 2 \\pi, -2 \\pi, 2 \\pi, -2 \\pi, \\pi, 2 \\pi, -2 \\pi, -2 \\pi, 2 \\pi, \\pi, 2 \\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$\\{2 \\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.pi, 2*math.pi, 2*math.pi, -math.pi, 2*math.pi, 2*math.pi, 2*math.pi, math.pi, math.pi, -2*math.pi, 2*math.pi, 2*math.pi, 2*math.pi, -2*math.pi, 2*math.pi, -2*math.pi, math.pi, 2*math.pi, -2*math.pi, -2*math.pi, 2*math.pi, math.pi, 2*math.pi, 2*math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\pi, 2, 1, \\frac{5}{2}, \\frac{9}{2}, -\\frac{21}{\\pi }, -10, 7, -2, -3}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.pi, 2, 1, (5/2), (9/2), -(21/math.pi), -10, 7, -2, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.057,0.004,0.103,0.098,0.063,0.214,0.037,0.012,0.217\\}$ and $\\{0.408,0.031,0.002,0.031,0.001,0.008,0.195,0.035,0.127,0.161\\}$.", - "Output Answer": [ - "$0.74$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.057, 0.004, 0.103, 0.098, 0.063, 0.214, 0.037, 0.012, 0.217\ndistribution2 = 0.408, 0.031, 0.002, 0.031, 0.001, 0.008, 0.195, 0.035, 0.127, 0.161\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1. x^2-2.2 x+1.$ where $x \\sim $ \\text{ExponentialDistribution}[0.3]\n", - "Output Answer": [ - "$-28.56$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.3)\nprint(E(-1.*x**2-2.2*x+1.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x-4.5$ where $x \\sim $ \\text{NormalDistribution}[0.4,1.]\n", - "Output Answer": [ - "$-5.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.4, 1.)\nprint(E(-1.9*x-4.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 e, 1, \\frac{3}{7}, -2, 3, -\\frac{48}{5}, \\frac{3}{\\sqrt{\\pi }}, -1, -\\frac{1}{\\sqrt{2}}, -4, \\frac{7}{\\sqrt{3}}}$.", - "Output Answer": [ - "$\\frac{3}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.e, 1, (3/7), -2, 3, -(48/5), (3/(math.sqrt(math.pi))), -1, -(1/(math.sqrt(2))), -4, (7/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, \\frac{7}{\\sqrt{2}}, -\\frac{30}{7}, 8} \\setminus {-1, 8, -3, 3 \\sqrt{2}, -5 \\sqrt{2}, -9, \\sqrt{5}, -\\frac{30}{7}}$.\n", - "Output Answer": [ - "${\\frac{7}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, (7/(math.sqrt(2))), -(30/7), 8,))\nsnd = set((-1, 8, -3, 3*math.sqrt(2), -5*math.sqrt(2), -9, math.sqrt(5), -(30/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8.3, 6.75, -1, 4 \\log (2), 5, -9, \\frac{27}{4}} \\cup {-14 \\log (2), 1, 0, -8.3, e, -1, -9, 5}$.\n", - "Output Answer": [ - "${-14 \\log (2), -9, -8.3, -1, 0, 1, e, 4 \\log (2), 5, \\frac{27}{4}, 6.75}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8.3, 6.75, -1, 4*math.log(2), 5, -9, (27/4),))\nsnd = set((-14*math.log(2), 1, 0, -8.3, math.e, -1, -9, 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 \\sqrt{3}, -7, -3, -\\frac{5}{2}, 1, -3 \\sqrt{2}, 7, 0, -\\frac{7}{5}, 2 \\pi}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(3), -7, -3, -(5/2), 1, -3*math.sqrt(2), 7, 0, -(7/5), 2*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{24}{e}, -\\frac{37}{4}, \\frac{26}{3}, 6, -\\pi, 7, -\\frac{1}{7}, 3 \\sqrt{5}, -5, -4 e, 9, 2, \\frac{26}{\\pi }}$.\n", - "Output Answer": [ - "$9+4 e$" - ], - "Output Program": [ - "import math\n\nvalues = -(24/math.e), -(37/4), (26/3), 6, -math.pi, 7, -(1/7), 3*math.sqrt(5), -5, -4*math.e, 9, 2, (26/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 4} \\cup {4, -1, -9}$.\n", - "Output Answer": [ - "${-9, -1, 4}$" - ], - "Output Program": [ - "fst = set((-1, 4,))\nsnd = set((4, -1, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{10}{\\sqrt{\\pi }}, 0, \\frac{1}{e}, -4, 7 \\sqrt{2}, 2, -4, 3 \\sqrt{5}, 0}$.\n", - "Output Answer": [ - "$4+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (10/(math.sqrt(math.pi))), 0, (1/math.e), -4, 7*math.sqrt(2), 2, -4, 3*math.sqrt(5), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\pi, -7, \\frac{13}{e}, 9, -1, -\\frac{1}{\\sqrt{2}}} \\cup {-\\frac{1}{\\sqrt{2}}, 3, \\frac{13}{e}, -\\pi, 9, -1}$.\n", - "Output Answer": [ - "${-3 \\pi, -7, -\\pi, -1, -\\frac{1}{\\sqrt{2}}, 3, \\frac{13}{e}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.pi, -7, (13/math.e), 9, -1, -(1/(math.sqrt(2))),))\nsnd = set((-(1/(math.sqrt(2))), 3, (13/math.e), -math.pi, 9, -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 17, 18, 15}$.\n", - "Output Answer": [ - "$\\frac{6120}{787}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 17, 18, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{5}{\\sqrt{3}}, -4 \\sqrt{3}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{1}{3} \\left(\\sqrt{3}-\\frac{5}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(5/(math.sqrt(3))), -4*math.sqrt(3), 5*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1, 4, 10, \\sqrt{5}, -7.437, 7, 2, -6} \\cup {4, -8, 7, 5, \\sqrt{5}, -7.437, -3}$.\n", - "Output Answer": [ - "${-8, -7.437, -6, -3, 1, 2, \\sqrt{5}, 4, 5, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 4, 10, math.sqrt(5), -7.437, 7, 2, -6,))\nsnd = set((4, -8, 7, 5, math.sqrt(5), -7.437, -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, -4 e, 2 \\sqrt{3}, -7, -4, \\frac{19}{\\sqrt{5}}} \\setminus {2 \\sqrt{3}, 8, 13 \\log (2), \\frac{19}{\\sqrt{5}}, 9, -3, -7}$.\n", - "Output Answer": [ - "${-4 e, -4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -4*math.e, 2*math.sqrt(3), -7, -4, (19/(math.sqrt(5))),))\nsnd = set((2*math.sqrt(3), 8, 13*math.log(2), (19/(math.sqrt(5))), 9, -3, -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.178,0.043,0.06,0.083,0.136,0.111,0.054,0.104,0.138\\}$ and $\\{0.029,0.068,0.1,0.34,0.117,0.057,0.018,0.094,0.016\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.178, 0.043, 0.06, 0.083, 0.136, 0.111, 0.054, 0.104, 0.138\ndistribution2 = 0.029, 0.068, 0.1, 0.34, 0.117, 0.057, 0.018, 0.094, 0.016\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, -1, -4 \\sqrt{3}, 7, -\\frac{17}{\\sqrt{3}}, 3, -5, 2 e, -2}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -1, -4*math.sqrt(3), 7, -(17/(math.sqrt(3))), 3, -5, 2*math.e, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{4}{e}, \\frac{4}{e}, \\frac{4}{e}, -\\frac{12}{e}, \\frac{12}{e}, -\\frac{21}{e}, \\frac{4}{e}, -\\frac{21}{e}, \\frac{12}{e}, -\\frac{21}{e}, \\frac{1}{e}, \\frac{4}{e}, -\\frac{21}{e}, -\\frac{15}{e}, \\frac{1}{e}, -\\frac{21}{e}, \\frac{4}{e}, \\frac{1}{e}, -\\frac{15}{e}, -\\frac{15}{e}, -\\frac{12}{e}, -\\frac{12}{e}, -\\frac{21}{e}, \\frac{4}{e}, \\frac{1}{e}, \\frac{4}{e}, \\frac{4}{e}, \\frac{4}{e}, -\\frac{21}{e}, \\frac{4}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (4/math.e), (4/math.e), (4/math.e), -(12/math.e), (12/math.e), -(21/math.e), (4/math.e), -(21/math.e), (12/math.e), -(21/math.e), (1/math.e), (4/math.e), -(21/math.e), -(15/math.e), (1/math.e), -(21/math.e), (4/math.e), (1/math.e), -(15/math.e), -(15/math.e), -(12/math.e), -(12/math.e), -(21/math.e), (4/math.e), (1/math.e), (4/math.e), (4/math.e), (4/math.e), -(21/math.e), (4/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.367,0.079,0.052,0.066,0.191,0.046,0.008,0.029,0.09\\}$ and $\\{0.109,0.253,0.13,0.029,0.077,0.075,0.099,0.066,0.121\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.367, 0.079, 0.052, 0.066, 0.191, 0.046, 0.008, 0.029, 0.09\ndistribution2 = 0.109, 0.253, 0.13, 0.029, 0.077, 0.075, 0.099, 0.066, 0.121\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.094,0.064,0.134,0.316,0.184,0.161\\}$ and $\\{0.148,0.2,0.05,0.091,0.327,0.041\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.094, 0.064, 0.134, 0.316, 0.184, 0.161\ndistribution2 = 0.148, 0.2, 0.05, 0.091, 0.327, 0.041\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -\\frac{14}{e}, 6, -9.8} \\setminus {-8, -\\frac{14}{e}, -2.33, -9, -\\frac{7}{3}, -9.8}$.\n", - "Output Answer": [ - "${-3, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -(14/math.e), 6, -9.8,))\nsnd = set((-8, -(14/math.e), -2.33, -9, -(7/3), -9.8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -\\frac{1}{2}, -5, -2.1} \\cup {-\\frac{1}{2}, 5.2, -5, 0}$.\n", - "Output Answer": [ - "${-5, -2.1, -\\frac{1}{2}, 0, 5.2}$" - ], - "Output Program": [ - "fst = set((0, -(1/2), -5, -2.1,))\nsnd = set((-(1/2), 5.2, -5, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 14, 18}$.\n", - "Output Answer": [ - "$\\frac{189}{29}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 14, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{3}, -8, -\\frac{36}{7}} \\setminus {\\frac{1}{2}, -6, 7, -\\frac{36}{7}, -1, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-8}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(3), -8, -(36/7),))\nsnd = set(((1/2), -6, 7, -(36/7), -1, 5*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -10, 9, -2, -5, -10, -10, -2, -10, -2, -2, 7, -10, -10, 7, -2, 9, -2, 6, -10, -10, -10, 9}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -10, 9, -2, -5, -10, -10, -2, -10, -2, -2, 7, -10, -10, 7, -2, 9, -2, 6, -10, -10, -10, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 6, 6, -7, -4 \\sqrt{2}, e, -2, -3, 2, \\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 6, 6, -7, -4*math.sqrt(2), math.e, -2, -3, 2, (1/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, 0, -3 \\sqrt{3}, -\\sqrt{3}, 4, -\\frac{13}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, 4, -10 \\log (2), -\\frac{9}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-4-\\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, 0, -3*math.sqrt(3), -math.sqrt(3), 4, -(13/(math.sqrt(2))), (5/(math.sqrt(2))), 4, -10*math.log(2), -(9/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{31}{7}, -3.53, -9, 0, 4, 1, 6} \\cup {-\\frac{27}{7}, -4, -2, -7, -3.53, 4}$.\n", - "Output Answer": [ - "${-9, -7, -4, -\\frac{27}{7}, -3.53, -2, 0, 1, 4, \\frac{31}{7}, 6}$" - ], - "Output Program": [ - "fst = set(((31/7), -3.53, -9, 0, 4, 1, 6,))\nsnd = set((-(27/7), -4, -2, -7, -3.53, 4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6, \\frac{7}{\\sqrt{2}}, -6, \\frac{17}{2}, -\\frac{3}{2}, 0.918} \\setminus {\\frac{7}{\\sqrt{2}}, -2, 6, -7}$.\n", - "Output Answer": [ - "${-6, -\\frac{3}{2}, 0.918, \\frac{17}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, (7/(math.sqrt(2))), -6, (17/2), -(3/2), 0.918,))\nsnd = set(((7/(math.sqrt(2))), -2, 6, -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-14 \\log (2), -13 \\log (2), -3 \\log (2), \\log (2), 8 \\log (2), 11 \\log (2), -9 \\log (2), -4 \\log (2), 5 \\log (2), -7 \\log (2), 10 \\log (2)} \\cap {-14 \\log (2), -5 \\log (2), -13 \\log (2), 5 \\log (2), -8 \\log (2), 10 \\log (2), -7 \\log (2), -2 \\log (2), 12 \\log (2), -9 \\log (2), 8 \\log (2), \\log (2)}$.\n", - "Output Answer": [ - "${-14 \\log (2), -13 \\log (2), -9 \\log (2), -7 \\log (2), \\log (2), 5 \\log (2), 8 \\log (2), 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-14*math.log(2), -13*math.log(2), -3*math.log(2), math.log(2), 8*math.log(2), 11*math.log(2), -9*math.log(2), -4*math.log(2), 5*math.log(2), -7*math.log(2), 10*math.log(2),))\nsnd = set((-14*math.log(2), -5*math.log(2), -13*math.log(2), 5*math.log(2), -8*math.log(2), 10*math.log(2), -7*math.log(2), -2*math.log(2), 12*math.log(2), -9*math.log(2), 8*math.log(2), math.log(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-5 \\sqrt{3}, -4 \\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, 5 \\sqrt{3}, 4 \\sqrt{3}, 2 \\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, \\sqrt{3}} \\cap {6 \\sqrt{3}, -3 \\sqrt{3}, 0, 3 \\sqrt{3}, 2 \\sqrt{3}, -4 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -4 \\sqrt{3}, -3 \\sqrt{3}, -\\sqrt{3}, 2 \\sqrt{3}, 3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(3), -4*math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), 5*math.sqrt(3), 4*math.sqrt(3), 2*math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), math.sqrt(3),))\nsnd = set((6*math.sqrt(3), -3*math.sqrt(3), 0, 3*math.sqrt(3), 2*math.sqrt(3), -4*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.4 x-6.$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.7]\n", - "Output Answer": [ - "$-6.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.7)\nprint(E(-3.4*x-6.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x^2+0.9 x+1.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$6.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(2.1*x**2+0.9*x+1.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x^2-0.2 x-4.4$ where $x \\sim $ \\text{PoissonDistribution}[3.5]\n", - "Output Answer": [ - "$-22.42$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(E(-1.1*x**2-0.2*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\pi, -\\frac{3}{5}, 2, 4, 7, 6, \\frac{9}{\\sqrt{5}}, \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{38}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, math.pi, -(3/5), 2, 4, 7, 6, (9/(math.sqrt(5))), math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{5}{4}, -8, \\frac{30}{\\pi }, -2, 6, 0, 3, 7, \\frac{4}{7}, 4 \\sqrt{2}, 4, 9, -4, 6, -\\frac{41}{5}}$.\n", - "Output Answer": [ - "$\\frac{41}{5}+\\frac{30}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (5/4), -8, (30/math.pi), -2, 6, 0, 3, 7, (4/7), 4*math.sqrt(2), 4, 9, -4, 6, -(41/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, 8, 1, 1, 13}$.\n", - "Output Answer": [ - "$\\frac{136}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 8, 1, 1, 13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, -9, -4, 4, -3, -2, 7, -3, 4, -4, -9, -9, 7, -2, -2, 4, 7, 3, -2, -9, -9, 7, 3, 4, -4, 3, -2, 4, 4, 7}$.\n", - "Output Answer": [ - "$\\{7,4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, -9, -4, 4, -3, -2, 7, -3, 4, -4, -9, -9, 7, -2, -2, 4, 7, 3, -2, -9, -9, 7, 3, 4, -4, 3, -2, 4, 4, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -15, 2}$.\n", - "Output Answer": [ - "$73$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -15, 2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6 \\sqrt{2}, -3.1, 3 \\sqrt{3}, 2 \\sqrt{3}, \\frac{9}{7}, 9, -9, -3 \\sqrt{5}} \\cup {3 \\sqrt{3}, -3 \\pi, 7, -7, 6 \\sqrt{2}, \\frac{9}{7}, 2 \\sqrt{3}, -5, 9, -4, -5.7, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -7, -3 \\sqrt{5}, -5.7, -5, -4, -3.1, \\frac{9}{7}, 2 \\sqrt{3}, 3 \\sqrt{3}, 7, 6 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((6*math.sqrt(2), -3.1, 3*math.sqrt(3), 2*math.sqrt(3), (9/7), 9, -9, -3*math.sqrt(5),))\nsnd = set((3*math.sqrt(3), -3*math.pi, 7, -7, 6*math.sqrt(2), (9/7), 2*math.sqrt(3), -5, 9, -4, -5.7, -3*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 6, 5, \\frac{19}{2}, -8, -7, 4, -3, 0.77, 9, -9.374} \\cup {\\frac{19}{2}, -5, 5, 0.77, 0, -0.646, 6, -4, 9, -7, 2}$.\n", - "Output Answer": [ - "${-9.374, -8, -7, -5, -4, -3, -0.646, 0, 0.77, 2, 4, 5, 6, 9, \\frac{19}{2}}$" - ], - "Output Program": [ - "fst = set((-4, 6, 5, (19/2), -8, -7, 4, -3, 0.77, 9, -9.374,))\nsnd = set(((19/2), -5, 5, 0.77, 0, -0.646, 6, -4, 9, -7, 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x^2-0.6 x-4.$ where $x \\sim $ \\text{PoissonDistribution}[2.]\n", - "Output Answer": [ - "$3.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.)\nprint(E(1.4*x**2-0.6*x-4.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -1, 12}$.\n", - "Output Answer": [ - "$79$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -1, 12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -6, \\sqrt{2}, \\frac{2}{3}, -2, -9} \\cup {0, \\sqrt{2}, -9, -2}$.\n", - "Output Answer": [ - "${-9, -6, -2, 0, \\frac{2}{3}, \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -6, math.sqrt(2), (2/3), -2, -9,))\nsnd = set((0, math.sqrt(2), -9, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10 \\log (2), 10 \\log (2), 2 \\log (2), -5 \\log (2), 6 \\log (2), 4 \\log (2), -3 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{4 \\log (2)}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -10*math.log(2), 10*math.log(2), 2*math.log(2), -5*math.log(2), 6*math.log(2), 4*math.log(2), -3*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 2401, 5, -125, -9}$.\n", - "Output Answer": [ - "$3^{2/5} 70^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 2401, 5, -125, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{5}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}-2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), -6*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, -5, -6, -5}$.\n", - "Output Answer": [ - "${-6, -5, -5, 0}$" - ], - "Output Program": [ - "values = 0, -5, -6, -5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.123,0.313,0.071,0.113,0.064,0.032,0.107\\}$ and $\\{0.169,0.013,0.044,0.183,0.058,0.061,0.066,0.152\\}$.", - "Output Answer": [ - "$0.69$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.123, 0.313, 0.071, 0.113, 0.064, 0.032, 0.107\ndistribution2 = 0.169, 0.013, 0.044, 0.183, 0.058, 0.061, 0.066, 0.152\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0.34, \\sqrt{2}, -2} \\cup {5 \\sqrt{2}, 0.34, -2}$.\n", - "Output Answer": [ - "${-2, 0.34, \\sqrt{2}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0.34, math.sqrt(2), -2,))\nsnd = set((5*math.sqrt(2), 0.34, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, -1024, 256, 1, 4, -64}$.\n", - "Output Answer": [ - "$48 \\sqrt[3]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, -1024, 256, 1, 4, -64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{3}{\\sqrt{\\pi }}, -2, \\frac{15}{4}, 2 \\sqrt{2}, 4, 3, -4, -8} \\setminus {-2, -12 \\log (2), 2 \\sqrt{2}, \\frac{15}{4}, -1, 2, 3}$.\n", - "Output Answer": [ - "${-8, -4, \\frac{3}{\\sqrt{\\pi }}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set(((3/(math.sqrt(math.pi))), -2, (15/4), 2*math.sqrt(2), 4, 3, -4, -8,))\nsnd = set((-2, -12*math.log(2), 2*math.sqrt(2), (15/4), -1, 2, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{13}{3}, 11, \\frac{34}{3}, 3}$.\n", - "Output Answer": [ - "$\\frac{58344}{10841}$" - ], - "Output Program": [ - "import statistics\nvalues = (13/3), 11, (34/3), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{5}{\\sqrt{3}}, 8, 6, 9, -\\frac{26}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{26}{\\pi }, -\\frac{5}{\\sqrt{3}}, 6, 8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/(math.sqrt(3))), 8, 6, 9, -(26/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\sqrt{2}, -8, 8, -5} \\cup {-2 \\sqrt{2}, 8, -5}$.\n", - "Output Answer": [ - "${-8, -5, -2 \\sqrt{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(2), -8, 8, -5,))\nsnd = set((-2*math.sqrt(2), 8, -5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1, -\\frac{37}{4}, 8, 7, \\sqrt{2}, 10, -8, -\\frac{13}{\\sqrt{2}}, \\pi} \\cup {\\sqrt{2}, -\\frac{13}{\\sqrt{2}}, \\frac{33}{4}, 1, 5, -8, \\pi, -3, 10}$.\n", - "Output Answer": [ - "${-\\frac{37}{4}, -\\frac{13}{\\sqrt{2}}, -8, -3, 1, \\sqrt{2}, \\pi, 5, 7, 8, \\frac{33}{4}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -(37/4), 8, 7, math.sqrt(2), 10, -8, -(13/(math.sqrt(2))), math.pi,))\nsnd = set((math.sqrt(2), -(13/(math.sqrt(2))), (33/4), 1, 5, -8, math.pi, -3, 10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x-4.$ where $x \\sim $ \\text{PoissonDistribution}[3.6]\n", - "Output Answer": [ - "$-0.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.6)\nprint(E(1.*x-4.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 11, 2}$.\n", - "Output Answer": [ - "$\\frac{99}{25}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 11, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{2}, -\\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}, -\\sqrt{2}, -\\sqrt{2}, 2 \\sqrt{2}, -\\sqrt{2}, \\sqrt{2}, \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}, -\\sqrt{2}, 0, \\sqrt{2}, -5 \\sqrt{2}, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{2},\\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(2), -math.sqrt(2), math.sqrt(2), -5*math.sqrt(2), -math.sqrt(2), -math.sqrt(2), 2*math.sqrt(2), -math.sqrt(2), math.sqrt(2), math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), math.sqrt(2), math.sqrt(2), -5*math.sqrt(2), -math.sqrt(2), 0, math.sqrt(2), -5*math.sqrt(2), -5*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.036,0.149,0.171,0.11,0.354\\}$ and $\\{0.067,0.087,0.331,0.13,0.061\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.036, 0.149, 0.171, 0.11, 0.354\ndistribution2 = 0.067, 0.087, 0.331, 0.13, 0.061\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\sqrt{5}, 5 \\sqrt{3}, -3, -\\frac{28}{3}, \\sqrt{3}, \\frac{3}{4}, \\frac{4}{7}, 3 e, -7} \\cup {\\frac{4}{7}, \\frac{19}{3}, 10, -7, \\frac{3}{4}, 6 \\sqrt{2}, -2 e, -4 \\sqrt{3}, -3}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -7, -4 \\sqrt{3}, -2 e, -2 \\sqrt{5}, -3, \\frac{4}{7}, \\frac{3}{4}, \\sqrt{3}, \\frac{19}{3}, 3 e, 6 \\sqrt{2}, 5 \\sqrt{3}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(5), 5*math.sqrt(3), -3, -(28/3), math.sqrt(3), (3/4), (4/7), 3*math.e, -7,))\nsnd = set(((4/7), (19/3), 10, -7, (3/4), 6*math.sqrt(2), -2*math.e, -4*math.sqrt(3), -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${15625, 49, -343, 1, -59049, 256}$.\n", - "Output Answer": [ - "$30 \\sqrt[3]{2} 3^{2/3} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 15625, 49, -343, 1, -59049, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3 \\sqrt{2}, \\frac{20}{\\pi }, 7, 3.1, \\frac{65}{7}, 3} \\setminus {\\frac{15}{2}, 7, 5, \\frac{22}{\\pi }, 3.1, \\frac{66}{7}, -3 \\sqrt{2}, 4}$.\n", - "Output Answer": [ - "${3, \\frac{20}{\\pi }, \\frac{65}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(2), (20/math.pi), 7, 3.1, (65/7), 3,))\nsnd = set(((15/2), 7, 5, (22/math.pi), 3.1, (66/7), -3*math.sqrt(2), 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\pi, -\\frac{7}{e}, \\frac{15}{\\sqrt{\\pi }}, -9, -\\frac{12}{e}, 4, -3, \\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{21}{\\sqrt{5}}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.pi, -(7/math.e), (15/(math.sqrt(math.pi))), -9, -(12/math.e), 4, -3, (21/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{2}{\\sqrt{\\pi }}, -e, 8, 4, 4, -\\frac{24}{5}, 10, -\\frac{32}{7}}$.\n", - "Output Answer": [ - "${-\\frac{24}{5}, -\\frac{32}{7}, -e, \\frac{2}{\\sqrt{\\pi }}, 4, 4, 8, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = (2/(math.sqrt(math.pi))), -math.e, 8, 4, 4, -(24/5), 10, -(32/7)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{2}, \\frac{21}{2}, 1, 2}$.\n", - "Output Answer": [ - "$\\frac{840}{419}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/2), (21/2), 1, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.127,0.149,0.167,0.095,0.182,0.119\\}$ and $\\{0.171,0.076,0.122,0.142,0.189,0.109,0.092\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.127, 0.149, 0.167, 0.095, 0.182, 0.119\ndistribution2 = 0.171, 0.076, 0.122, 0.142, 0.189, 0.109, 0.092\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 1, 13}$.\n", - "Output Answer": [ - "$\\frac{429}{167}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 1, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.125,0.046,0.124,0.385,0.014,0.122\\}$ and $\\{0.084,0.094,0.149,0.104,0.367,0.036\\}$.", - "Output Answer": [ - "$0.76$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.125, 0.046, 0.124, 0.385, 0.014, 0.122\ndistribution2 = 0.084, 0.094, 0.149, 0.104, 0.367, 0.036\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.7 x^2-3.5 x+2.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.8]\n", - "Output Answer": [ - "$-6.89$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.8)\nprint(E(-1.7*x**2-3.5*x+2.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\pi, 3, -9, 0} \\setminus {-\\frac{1}{e}, -4, 0, -2}$.\n", - "Output Answer": [ - "${-9, 3, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.pi, 3, -9, 0,))\nsnd = set((-(1/math.e), -4, 0, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\sqrt{5}, 8}$.\n", - "Output Answer": [ - "$8+\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(5), 8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{14}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{3}{2 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (14/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, \\frac{53}{3}, \\frac{11}{3}}$.\n", - "Output Answer": [ - "$\\frac{6996}{1351}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, (53/3), (11/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -14, 2, 14, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{574}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -14, 2, 14, 8\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{25}{\\pi }, \\frac{18}{\\pi }, \\frac{19}{\\pi }, -\\frac{25}{\\pi }, \\frac{30}{\\pi }, \\frac{19}{\\pi }, \\frac{19}{\\pi }, -\\frac{7}{\\pi }, -\\frac{25}{\\pi }, -\\frac{7}{\\pi }, \\frac{18}{\\pi }, \\frac{18}{\\pi }, \\frac{30}{\\pi }, \\frac{18}{\\pi }, \\frac{30}{\\pi }, \\frac{19}{\\pi }, \\frac{19}{\\pi }, \\frac{19}{\\pi }, \\frac{30}{\\pi }, \\frac{10}{\\pi }, -\\frac{25}{\\pi }, \\frac{18}{\\pi }, \\frac{30}{\\pi }, \\frac{10}{\\pi }, \\frac{18}{\\pi }, \\frac{18}{\\pi }, -\\frac{7}{\\pi }, -\\frac{25}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{18}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(25/math.pi), (18/math.pi), (19/math.pi), -(25/math.pi), (30/math.pi), (19/math.pi), (19/math.pi), -(7/math.pi), -(25/math.pi), -(7/math.pi), (18/math.pi), (18/math.pi), (30/math.pi), (18/math.pi), (30/math.pi), (19/math.pi), (19/math.pi), (19/math.pi), (30/math.pi), (10/math.pi), -(25/math.pi), (18/math.pi), (30/math.pi), (10/math.pi), (18/math.pi), (18/math.pi), -(7/math.pi), -(25/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 36, 36}$.\n", - "Output Answer": [ - "$6 \\sqrt[3]{42}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 36, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2, 2, -3, -1} \\setminus {\\frac{17}{2}, 1, -\\frac{5}{2}, 7, -2, -1, -9}$.\n", - "Output Answer": [ - "${-3, 2}$" - ], - "Output Program": [ - "fst = set((-2, 2, -3, -1,))\nsnd = set(((17/2), 1, -(5/2), 7, -2, -1, -9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.033,0.05,0.147\\}$ and $\\{0.284,0.365,0.15\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.033, 0.05, 0.147\ndistribution2 = 0.284, 0.365, 0.15\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{23}{5}, -10, \\frac{18}{5}, \\frac{19}{5}, -\\frac{23}{5}, -10, -\\frac{23}{5}, \\frac{11}{5}, -\\frac{23}{5}, -\\frac{34}{5}, -\\frac{34}{5}, -\\frac{34}{5}, -\\frac{34}{5}, -\\frac{34}{5}, \\frac{18}{5}, \\frac{18}{5}, \\frac{19}{5}, \\frac{19}{5}, -\\frac{27}{5}, -\\frac{34}{5}, -\\frac{34}{5}, \\frac{19}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{34}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(23/5), -10, (18/5), (19/5), -(23/5), -10, -(23/5), (11/5), -(23/5), -(34/5), -(34/5), -(34/5), -(34/5), -(34/5), (18/5), (18/5), (19/5), (19/5), -(27/5), -(34/5), -(34/5), (19/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -\\frac{10}{\\sqrt{3}}, \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{1}{3} \\left(\\sqrt{3}-\\frac{10}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, -(10/(math.sqrt(3))), math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{19}{e}, -\\frac{25}{e}, -\\frac{1}{e}, \\frac{10}{e}, -\\frac{18}{e}, \\frac{12}{e}} \\cap {0, \\frac{24}{e}, -\\frac{24}{e}, \\frac{19}{e}, -\\frac{1}{e}, -\\frac{18}{e}, -\\frac{3}{e}}$.\n", - "Output Answer": [ - "${-\\frac{18}{e}, -\\frac{1}{e}, \\frac{19}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((19/math.e), -(25/math.e), -(1/math.e), (10/math.e), -(18/math.e), (12/math.e),))\nsnd = set((0, (24/math.e), -(24/math.e), (19/math.e), -(1/math.e), -(18/math.e), -(3/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${13, 7, -5, -12, 10, -14}$.\n", - "Output Answer": [ - "$\\frac{4097}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, 7, -5, -12, 10, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{2}{e}, 5 \\sqrt{2}, 7, 2 \\pi, -\\frac{1}{3}, -3 e} \\cup {7, 2 \\pi, \\frac{2}{e}, -\\frac{1}{3}, 0}$.\n", - "Output Answer": [ - "${-3 e, -\\frac{1}{3}, 0, \\frac{2}{e}, 2 \\pi, 7, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((2/math.e), 5*math.sqrt(2), 7, 2*math.pi, -(1/3), -3*math.e,))\nsnd = set((7, 2*math.pi, (2/math.e), -(1/3), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5 \\sqrt{3}, 7}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}-7$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(3), 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{16}{\\sqrt{3}}, -8, 3, -4 \\sqrt{2}, -8, 3, -3 \\sqrt{2}, 8, \\frac{1}{2}, -3, -9, -3, -9, -9, -\\frac{26}{e}}$.", - "Output Answer": [ - "$-4 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(16/(math.sqrt(3))), -8, 3, -4*math.sqrt(2), -8, 3, -3*math.sqrt(2), 8, (1/2), -3, -9, -3, -9, -9, -(26/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{13}{e}, 8, \\frac{10}{\\sqrt{3}}, -\\frac{25}{e}, 5, 4 \\sqrt{3}, -\\frac{7}{\\pi }, -\\frac{23}{3}, -6}$.", - "Output Answer": [ - "$-\\frac{7}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(13/math.e), 8, (10/(math.sqrt(3))), -(25/math.e), 5, 4*math.sqrt(3), -(7/math.pi), -(23/3), -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{32}{5}, 5, -3}$.\n", - "Output Answer": [ - "${-3, 5, \\frac{32}{5}}$" - ], - "Output Program": [ - "values = (32/5), 5, -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.245,0.143,0.031,0.142,0.346,0.013,0.001,0.03\\}$ and $\\{0.085,0.109,0.006,0.23,0.254,0.036,0.015,0.028\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.245, 0.143, 0.031, 0.142, 0.346, 0.013, 0.001, 0.03\ndistribution2 = 0.085, 0.109, 0.006, 0.23, 0.254, 0.036, 0.015, 0.028\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{2}, 1, -\\frac{7}{2}, 1, -3 e, 4, 6}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(2), 1, -(7/2), 1, -3*math.e, 4, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x+3.8$ where $x \\sim $ \\text{NormalDistribution}[0.6,3.]\n", - "Output Answer": [ - "$4.04$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.6, 3.)\nprint(E(0.4*x+3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 3, 13}$.\n", - "Output Answer": [ - "$\\frac{26}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 3, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{5}, \\frac{8}{\\sqrt{\\pi }}, 6, 5, -\\frac{47}{7}, 1, 1.8}$.\n", - "Output Answer": [ - "${-\\frac{47}{7}, 1, 1.8, 2 \\sqrt{5}, \\frac{8}{\\sqrt{\\pi }}, 5, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(5), (8/(math.sqrt(math.pi))), 6, 5, -(47/7), 1, 1.8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3 \\sqrt{2}, -10, \\frac{19}{2}, -9, -4, \\sqrt{2}, -2} \\setminus {\\sqrt{2}, -2, -3 \\sqrt{2}, -4, \\frac{19}{2}, 0}$.\n", - "Output Answer": [ - "${-10, -9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(2), -10, (19/2), -9, -4, math.sqrt(2), -2,))\nsnd = set((math.sqrt(2), -2, -3*math.sqrt(2), -4, (19/2), 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, -1, -10, 3, -\\frac{17}{\\sqrt{\\pi }}, -7}$.\n", - "Output Answer": [ - "${-10, -\\frac{17}{\\sqrt{\\pi }}, -7, -2, -1, 3}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -1, -10, 3, -(17/(math.sqrt(math.pi))), -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, 49, 3, 64}$.\n", - "Output Answer": [ - "$6\\ 3^{3/4} \\sqrt{14}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, 49, 3, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-216, 9, 15625, 27, -32, 625}$.\n", - "Output Answer": [ - "$30\\ 5^{2/3} \\sqrt[3]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -216, 9, 15625, 27, -32, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -3 e, -9, 6, -9, 2, \\frac{17}{5}, 9, -2, -\\frac{2}{\\sqrt{\\pi }}, 9, -\\frac{11}{\\sqrt{2}}, \\frac{16}{\\sqrt{5}}, 11 \\log (2)}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -3*math.e, -9, 6, -9, 2, (17/5), 9, -2, -(2/(math.sqrt(math.pi))), 9, -(11/(math.sqrt(2))), (16/(math.sqrt(5))), 11*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{18}{\\sqrt{5}}, 8.159, -\\frac{1}{\\sqrt{\\pi }}, \\frac{5}{e}, 2} \\setminus {\\frac{18}{\\sqrt{5}}, -9, 0, \\frac{11}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{5}{e}}$.\n", - "Output Answer": [ - "${-\\frac{1}{\\sqrt{\\pi }}, 2, 8.159}$" - ], - "Output Program": [ - "import math\n\nfst = set(((18/(math.sqrt(5))), 8.159, -(1/(math.sqrt(math.pi))), (5/math.e), 2,))\nsnd = set(((18/(math.sqrt(5))), -9, 0, (11/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), (5/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.028,0.078,0.037,0.003,0.059,0.243,0.024,0.018,0.011,0.419\\}$ and $\\{0.269,0.016,0.165,0.004,0.03,0.038,0.022,0.114,0.098,0.028\\}$.", - "Output Answer": [ - "$1.55$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.028, 0.078, 0.037, 0.003, 0.059, 0.243, 0.024, 0.018, 0.011, 0.419\ndistribution2 = 0.269, 0.016, 0.165, 0.004, 0.03, 0.038, 0.022, 0.114, 0.098, 0.028\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-343, 3125, 729, -7776, 64, -9}$.\n", - "Output Answer": [ - "$18 \\sqrt[6]{-3} \\sqrt{7} 10^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = -343, 3125, 729, -7776, 64, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{5}, 0, -6, 1} \\cup {6, -3 \\sqrt{5}, -9, -6, -\\frac{57}{7}, 1}$.\n", - "Output Answer": [ - "${-9, -\\frac{57}{7}, -3 \\sqrt{5}, -6, 0, 1, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(5), 0, -6, 1,))\nsnd = set((6, -3*math.sqrt(5), -9, -6, -(57/7), 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, \\frac{64}{7}, -\\frac{49}{5}, -6 \\sqrt{3}, 4, 4}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -\\frac{49}{5}, 4, 4, 4, \\frac{64}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (64/7), -(49/5), -6*math.sqrt(3), 4, 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, 1, -1, 1, 4, 1, 4, 1, 2, -1, 4, 1, 4, -3, 4, -1, 4, 1, 1, 1, -3, -3}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, 1, -1, 1, 4, 1, 4, 1, 2, -1, 4, 1, 4, -3, 4, -1, 4, 1, 1, 1, -3, -3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.011,0.079,0.014,0.266,0.013,0.026,0.155,0.121,0.042\\}$ and $\\{0.033,0.131,0.187,0.009,0.076,0.083,0.024,0.313,0.048\\}$.", - "Output Answer": [ - "$1.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.011, 0.079, 0.014, 0.266, 0.013, 0.026, 0.155, 0.121, 0.042\ndistribution2 = 0.033, 0.131, 0.187, 0.009, 0.076, 0.083, 0.024, 0.313, 0.048\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 e, 3 \\sqrt{2}, -e, 8, -2 \\sqrt{3}, -6, -3}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.e, 3*math.sqrt(2), -math.e, 8, -2*math.sqrt(3), -6, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{2}, 2 \\sqrt{5}, 10, -2, \\frac{11}{4}, 8}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4 \\sqrt{2}+2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(2), 2*math.sqrt(5), 10, -2, (11/4), 8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{7}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, 0, \\frac{7}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (7/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), 0, (7/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.087,0.035,0.226,0.537\\}$ and $\\{0.213,0.378,0.244,0.058\\}$.", - "Output Answer": [ - "$1.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.087, 0.035, 0.226, 0.537\ndistribution2 = 0.213, 0.378, 0.244, 0.058\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 4, 4, -5, -5, 3, 2, -5, 2, -7, 4, -5, -7, 3, 2, -6, -6, -7, -6, 2, 4, -6, -6, 2, 2}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 4, 4, -5, -5, 3, 2, -5, 2, -7, 4, -5, -7, 3, 2, -6, -6, -7, -6, 2, 4, -6, -6, 2, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, -4 \\sqrt{3}, 6, 10, -1}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -1, 0, 6, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -4*math.sqrt(3), 6, 10, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -9, 8, -10, -1, 11}$.\n", - "Output Answer": [ - "$\\frac{445}{6}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -9, 8, -10, -1, 11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, -3}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{5}{\\pi }, -6, 3 \\sqrt{2}, -9, -8, -6 \\log (2), 8, -2.6} \\cup {8, \\frac{29}{\\pi }, 2, -6 \\log (2), -2.6, -8, 7, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-9, -8, -6, -6 \\log (2), -2.6, \\frac{5}{\\pi }, 2, 3 \\sqrt{2}, 7, 8, \\frac{29}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((5/math.pi), -6, 3*math.sqrt(2), -9, -8, -6*math.log(2), 8, -2.6,))\nsnd = set((8, (29/math.pi), 2, -6*math.log(2), -2.6, -8, 7, 3*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -2, -\\frac{2}{7}} \\setminus {9, 5, -6, -\\frac{41}{7}, -7, -\\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-2, -\\frac{2}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -2, -(2/7),))\nsnd = set((9, 5, -6, -(41/7), -7, -(7/(math.sqrt(3))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.052,0.209,0.002,0.023,0.156,0.123,0.004\\}$ and $\\{0.025,0.415,0.043,0.173,0.142,0.124,0.075\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.052, 0.209, 0.002, 0.023, 0.156, 0.123, 0.004\ndistribution2 = 0.025, 0.415, 0.043, 0.173, 0.142, 0.124, 0.075\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-729, 2, -729}$.\n", - "Output Answer": [ - "$81 \\sqrt[3]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -729, 2, -729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 64, 1, 9, 6, 4}$.\n", - "Output Answer": [ - "$2\\ 2^{5/6} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 64, 1, 9, 6, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, 1, -13 \\log (2), 4, 9, -10, -\\frac{1}{\\sqrt{5}}, 1, 0, 1, -\\frac{37}{5}, -\\frac{8}{\\sqrt{\\pi }}, 9, 4, -2 \\sqrt{2}}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 1, -13*math.log(2), 4, 9, -10, -(1/(math.sqrt(5))), 1, 0, 1, -(37/5), -(8/(math.sqrt(math.pi))), 9, 4, -2*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.113,0.058,0.016,0.114,0.09,0.082,0.19,0.086,0.08\\}$ and $\\{0.092,0.195,0.197,0.144,0.031,0.08,0.027,0.037,0.14\\}$.", - "Output Answer": [ - "$0.59$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.113, 0.058, 0.016, 0.114, 0.09, 0.082, 0.19, 0.086, 0.08\ndistribution2 = 0.092, 0.195, 0.197, 0.144, 0.031, 0.08, 0.027, 0.037, 0.14\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{4}{\\sqrt{3}}, -3 e, 5, -\\frac{6}{\\sqrt{\\pi }}, -5, -\\frac{6}{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{4}{\\sqrt{3}}-\\frac{6}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(4/(math.sqrt(3))), -3*math.e, 5, -(6/(math.sqrt(math.pi))), -5, -(6/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.1 x-1.2$ where $x \\sim $ \\text{ExponentialDistribution}[0.5]\n", - "Output Answer": [ - "$-5.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.5)\nprint(E(-2.1*x-1.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, 9, 11, 4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{326}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 9, 11, 4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{24}{5}, -\\sqrt{3}, -5, -3, -4, 3, 4, 7, 0, 1} \\cup {1, -\\frac{3}{2}, 0, 8, \\frac{6}{5}, \\frac{5}{\\sqrt{3}}, 4, -\\frac{24}{5}, 10, -6, -5}$.\n", - "Output Answer": [ - "${-6, -5, -\\frac{24}{5}, -4, -3, -\\sqrt{3}, -\\frac{3}{2}, 0, 1, \\frac{6}{5}, \\frac{5}{\\sqrt{3}}, 3, 4, 7, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(24/5), -math.sqrt(3), -5, -3, -4, 3, 4, 7, 0, 1,))\nsnd = set((1, -(3/2), 0, 8, (6/5), (5/(math.sqrt(3))), 4, -(24/5), 10, -6, -5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{17}{\\sqrt{3}}, -6 \\sqrt{2}, 10, -10, 6, -3, -\\frac{14}{\\sqrt{3}}} \\cup {-\\frac{14}{\\sqrt{3}}, -9, -3, -7, -\\frac{16}{\\sqrt{3}}, -6 \\sqrt{2}, 6}$.\n", - "Output Answer": [ - "${-10, -\\frac{16}{\\sqrt{3}}, -9, -6 \\sqrt{2}, -\\frac{14}{\\sqrt{3}}, -7, -3, 6, \\frac{17}{\\sqrt{3}}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((17/(math.sqrt(3))), -6*math.sqrt(2), 10, -10, 6, -3, -(14/(math.sqrt(3))),))\nsnd = set((-(14/(math.sqrt(3))), -9, -3, -7, -(16/(math.sqrt(3))), -6*math.sqrt(2), 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x+0.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(0.9*x+0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.4 x^2+4.9 x+1.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$-15.75$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(-4.4*x**2+4.9*x+1.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, \\frac{4}{3}, \\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\frac{13}{2}$" - ], - "Output Program": [ - "values = 1, (4/3), (15/2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.051,0.166,0.038,0.069,0.172,0.001,0.24\\}$ and $\\{0.077,0.107,0.146,0.262,0.14,0.096,0.043\\}$.", - "Output Answer": [ - "$0.64$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.051, 0.166, 0.038, 0.069, 0.172, 0.001, 0.24\ndistribution2 = 0.077, 0.107, 0.146, 0.262, 0.14, 0.096, 0.043\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, 4.9, -4 \\log (2), 5, 1, 4 \\sqrt{3}, 6, 5 \\sqrt{2}, -5} \\cup {-6, -4 \\log (2), -5, 4 \\sqrt{3}, 4 \\sqrt{5}, 4.9, \\frac{13}{\\sqrt{3}}, 4, -3, 9}$.\n", - "Output Answer": [ - "${-6, -5, -3, -4 \\log (2), 1, 4, 4.9, 5, 6, 4 \\sqrt{3}, 5 \\sqrt{2}, \\frac{13}{\\sqrt{3}}, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 4.9, -4*math.log(2), 5, 1, 4*math.sqrt(3), 6, 5*math.sqrt(2), -5,))\nsnd = set((-6, -4*math.log(2), -5, 4*math.sqrt(3), 4*math.sqrt(5), 4.9, (13/(math.sqrt(3))), 4, -3, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.7 x-3.$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$5.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(1.7*x-3.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\log (2), 0, \\frac{8}{5}, \\frac{7}{4}, \\sqrt{5}}$.\n", - "Output Answer": [ - "${0, \\log (2), \\frac{8}{5}, \\frac{7}{4}, \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = math.log(2), 0, (8/5), (7/4), math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.309,0.333,0.135\\}$ and $\\{0.525,0.126,0.34\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.309, 0.333, 0.135\ndistribution2 = 0.525, 0.126, 0.34\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.056,0.031,0.03,0.055,0.08\\}$ and $\\{0.138,0.169,0.218,0.061,0.245\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.056, 0.031, 0.03, 0.055, 0.08\ndistribution2 = 0.138, 0.169, 0.218, 0.061, 0.245\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-13, 14, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{757}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 14, 15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6, 1, 3, 2, \\frac{18}{\\pi }, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-6, 1, 2, 3, \\frac{18}{\\pi }, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 1, 3, 2, (18/math.pi), 5*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{15}{2}, -2 \\pi, -9.97} \\setminus {8, -\\frac{15}{2}, -9.97, -\\frac{17}{5}, 9, \\pi, -5}$.\n", - "Output Answer": [ - "${-2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(15/2), -2*math.pi, -9.97,))\nsnd = set((8, -(15/2), -9.97, -(17/5), 9, math.pi, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3 \\sqrt{5}, -1, \\frac{12}{\\sqrt{5}}, 9}$.\n", - "Output Answer": [ - "${-1, \\frac{12}{\\sqrt{5}}, 3 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(5), -1, (12/(math.sqrt(5))), 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x^2-3.8 x+0.8$ where $x \\sim $ \\text{NormalDistribution}[-1.6,2.2]\n", - "Output Answer": [ - "$11.32$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 2.2)\nprint(E(0.6*x**2-3.8*x+0.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x-1.4$ where $x \\sim $ \\text{BetaDistribution}[1.6,1.2]\n", - "Output Answer": [ - "$1.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 1.2)\nprint(E(4.3*x-1.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 6, 9, 5}$.\n", - "Output Answer": [ - "$\\frac{2520}{391}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 6, 9, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -14, -15, -3, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{335}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -14, -15, -3, 14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x-1.3$ where $x \\sim $ \\text{NormalDistribution}[1.5,1.2]\n", - "Output Answer": [ - "$-4.75$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.5, 1.2)\nprint(E(-2.3*x-1.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2 e, 7, 3, \\frac{10}{\\sqrt{3}}, -4, 1, -7.9, \\frac{16}{3}} \\cup {\\frac{2}{\\sqrt{3}}, e, -4, 3, 7, -7.9, -3, -\\frac{28}{3}}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -7.9, -4, -3, 1, \\frac{2}{\\sqrt{3}}, e, 3, \\frac{16}{3}, 2 e, \\frac{10}{\\sqrt{3}}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.e, 7, 3, (10/(math.sqrt(3))), -4, 1, -7.9, (16/3),))\nsnd = set(((2/(math.sqrt(3))), math.e, -4, 3, 7, -7.9, -3, -(28/3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{e}, -\\frac{16}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\pi }, -\\frac{11}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/math.e), -(16/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -1, 4, -7, 4, 4, 6, -7, -7, -7, -1, 4, 6, -7, -7, -7, -7, 6, 6, -7, 4, 4, -7, 4, -7, -1, -7, 4, -7, -7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -1, 4, -7, 4, 4, 6, -7, -7, -7, -1, 4, 6, -7, -7, -7, -7, 6, 6, -7, 4, 4, -7, 4, -7, -1, -7, 4, -7, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^3+4.3 x^2+3.4 x-3.$ where $x \\sim $ \\text{NormalDistribution}[-0.9,2.2]\n", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.9, 2.2)\nprint(E(1.3*x**3+4.3*x**2+3.4*x-3.))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5.9, 7 \\log (2), -5, 3, 0, -5 \\sqrt{2}} \\cup {-5 \\sqrt{2}, 8, 9 \\log (2), 3, 1.8, -\\frac{5}{2}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -5.9, -5, -\\frac{5}{2}, 0, 1.8, 3, 7 \\log (2), 9 \\log (2), 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.9, 7*math.log(2), -5, 3, 0, -5*math.sqrt(2),))\nsnd = set((-5*math.sqrt(2), 8, 9*math.log(2), 3, 1.8, -(5/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -10, 8.211, 5, -9} \\cup {-7.698, -10, 0, 9, 4}$.\n", - "Output Answer": [ - "${-10, -9, -7.698, 0, 4, 5, 8.211, 9}$" - ], - "Output Program": [ - "fst = set((0, -10, 8.211, 5, -9,))\nsnd = set((-7.698, -10, 0, 9, 4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, 3, 11, 5, -10, 2}$.\n", - "Output Answer": [ - "$\\frac{164}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 3, 11, 5, -10, 2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x-1.9$ where $x \\sim $ \\text{BetaDistribution}[1.4,1.2]\n", - "Output Answer": [ - "$-0.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.4, 1.2)\nprint(E(2.*x-1.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -4 \\sqrt{3}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -4*math.sqrt(3), -math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{36}{5}, \\frac{48}{5}, \\frac{48}{5}, -\\frac{22}{5}, \\frac{46}{5}, \\frac{42}{5}, -\\frac{37}{5}, -\\frac{29}{5}}$.\n", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(36/5), (48/5), (48/5), -(22/5), (46/5), (42/5), -(37/5), -(29/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, 1000, 1296, 59049, 64}$.\n", - "Output Answer": [ - "$360 \\sqrt[5]{-10} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, 1000, 1296, 59049, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -9, 1, -9, -3}$.\n", - "Output Answer": [ - "$-\\frac{16}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -9, 1, -9, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -5, -15, 4, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{613}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -5, -15, 4, -9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -9, 0, 4 \\sqrt{3}, 4, 5, \\frac{15}{2}, \\frac{17}{2}, 0, -\\frac{7}{\\sqrt{2}}, \\frac{12}{5}, 3 e, -\\frac{19}{5}}$.\n", - "Output Answer": [ - "$\\frac{35}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -9, 0, 4*math.sqrt(3), 4, 5, (15/2), (17/2), 0, -(7/(math.sqrt(2))), (12/5), 3*math.e, -(19/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{69}{7}, \\frac{57}{7}, \\frac{51}{7}, -\\frac{17}{7}, \\frac{69}{7}, \\frac{69}{7}, \\frac{51}{7}, \\frac{57}{7}, -10, \\frac{6}{7}, -10, \\frac{51}{7}, \\frac{57}{7}, -10, \\frac{46}{7}, \\frac{57}{7}, \\frac{57}{7}, -\\frac{55}{7}, -\\frac{17}{7}, -\\frac{55}{7}, \\frac{69}{7}, \\frac{69}{7}, \\frac{57}{7}, -\\frac{55}{7}, \\frac{57}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{57}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (69/7), (57/7), (51/7), -(17/7), (69/7), (69/7), (51/7), (57/7), -10, (6/7), -10, (51/7), (57/7), -10, (46/7), (57/7), (57/7), -(55/7), -(17/7), -(55/7), (69/7), (69/7), (57/7), -(55/7), (57/7)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{9}{2}, 1.596, \\frac{7}{\\sqrt{5}}, -7, \\frac{13}{\\sqrt{2}}, -14 \\log (2)} \\setminus {\\frac{13}{\\sqrt{2}}, \\frac{7}{2}, 9}$.\n", - "Output Answer": [ - "${-14 \\log (2), -7, 1.596, \\frac{7}{\\sqrt{5}}, \\frac{9}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((9/2), 1.596, (7/(math.sqrt(5))), -7, (13/(math.sqrt(2))), -14*math.log(2),))\nsnd = set(((13/(math.sqrt(2))), (7/2), 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1.805, -4 \\sqrt{5}, 7, -0.1, -\\frac{2}{e}, -\\frac{23}{3}, -\\frac{20}{3}, -0.332, e, -4 \\sqrt{3}} \\cup {-\\frac{2}{e}, -2 \\sqrt{3}, 9.834, -\\frac{20}{3}, -2.2, e, -4 \\sqrt{3}, 0, 7, -\\frac{23}{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -\\frac{23}{3}, -4 \\sqrt{3}, -\\frac{20}{3}, -2 \\sqrt{3}, -2.2, -1.805, -\\frac{2}{e}, -0.332, -0.1, 0, e, 7, 9.834}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1.805, -4*math.sqrt(5), 7, -0.1, -(2/math.e), -(23/3), -(20/3), -0.332, math.e, -4*math.sqrt(3),))\nsnd = set((-(2/math.e), -2*math.sqrt(3), 9.834, -(20/3), -2.2, math.e, -4*math.sqrt(3), 0, 7, -(23/3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -\\frac{5}{e}, -2 \\pi}$.\n", - "Output Answer": [ - "$6+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -(5/math.e), -2*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 2, -4, 0}$.\n", - "Output Answer": [ - "$\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 2, -4, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 5, 3 \\sqrt{3}, -4 \\sqrt{5}, \\frac{15}{\\sqrt{\\pi }}, -1, -11 \\log (2), \\frac{3}{\\pi }, -8, -3 \\sqrt{3}, \\frac{2}{\\sqrt{5}}, 6}$.\n", - "Output Answer": [ - "$4 \\sqrt{5}+\\frac{15}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 5, 3*math.sqrt(3), -4*math.sqrt(5), (15/(math.sqrt(math.pi))), -1, -11*math.log(2), (3/math.pi), -8, -3*math.sqrt(3), (2/(math.sqrt(5))), 6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 10, -3 \\sqrt{3}, \\frac{13}{e}, -\\frac{5}{7}} \\cup {3 \\sqrt{3}, \\frac{13}{e}, 6, -\\frac{11}{7}, -2}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -2, -\\frac{11}{7}, -\\frac{5}{7}, \\frac{13}{e}, 3 \\sqrt{3}, 6, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 10, -3*math.sqrt(3), (13/math.e), -(5/7),))\nsnd = set((3*math.sqrt(3), (13/math.e), 6, -(11/7), -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.64 < 1. x-1. < 2.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.3].", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(P((0.64 < 1.*x-1.) & (1.*x-1. < 2.1)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -9, 5, -7, 5, -2, 9}$.\n", - "Output Answer": [ - "$\\frac{5}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -9, 5, -7, 5, -2, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{7}{e}, -\\frac{33}{7}, -3, -2, 2, -10, -3, -7, 9}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = (7/math.e), -(33/7), -3, -2, 2, -10, -3, -7, 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6, \\frac{28}{5}, 1.6, -7, -9, \\frac{3}{e}} \\cup {6, -7, \\frac{28}{5}, -8, \\frac{3}{e}, -1.6, 0}$.\n", - "Output Answer": [ - "${-9, -8, -7, -1.6, 0, \\frac{3}{e}, 1.6, \\frac{28}{5}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, (28/5), 1.6, -7, -9, (3/math.e),))\nsnd = set((6, -7, (28/5), -8, (3/math.e), -1.6, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.01,0.113,0.158,0.02,0.099,0.012,0.106,0.172,0.027,0.096\\}$ and $\\{0.141,0.031,0.108,0.183,0.128,0.08,0.006,0.01,0.275,0.027\\}$.", - "Output Answer": [ - "$1.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.01, 0.113, 0.158, 0.02, 0.099, 0.012, 0.106, 0.172, 0.027, 0.096\ndistribution2 = 0.141, 0.031, 0.108, 0.183, 0.128, 0.08, 0.006, 0.01, 0.275, 0.027\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.021,0.127,0.082,0.023,0.085,0.174,0.21,0.135,0.025\\}$ and $\\{0.141,0.054,0.054,0.093,0.039,0.096,0.106,0.154,0.094\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.021, 0.127, 0.082, 0.023, 0.085, 0.174, 0.21, 0.135, 0.025\ndistribution2 = 0.141, 0.054, 0.054, 0.093, 0.039, 0.096, 0.106, 0.154, 0.094\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 \\sqrt{5}, -3 \\sqrt{5}, -4 \\sqrt{5}, -3 \\sqrt{5}, -4 \\sqrt{5}, -3 \\sqrt{5}, -4 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.sqrt(5), -3*math.sqrt(5), -4*math.sqrt(5), -3*math.sqrt(5), -4*math.sqrt(5), -3*math.sqrt(5), -4*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${8, 3, 0, 1, -2, -2, 4, -6 \\log (2), -3, 5, -\\frac{19}{2}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 3, 0, 1, -2, -2, 4, -6*math.log(2), -3, 5, -(19/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, -6.1, 7.2, 10, 6, 4, -3 e, -7, -\\sqrt{5}} \\setminus {7.2, 0, 8, 4}$.\n", - "Output Answer": [ - "${-3 e, -7, -6.1, -\\sqrt{5}, 6, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -6.1, 7.2, 10, 6, 4, -3*math.e, -7, -math.sqrt(5),))\nsnd = set((7.2, 0, 8, 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.02,0.045,0.221,0.079,0.059,0.143,0.117,0.014,0.104,0.091\\}$ and $\\{0.143,0.09,0.191,0.071,0.078,0.077,0.024,0.195,0.014,0.02\\}$.", - "Output Answer": [ - "$0.61$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.02, 0.045, 0.221, 0.079, 0.059, 0.143, 0.117, 0.014, 0.104, 0.091\ndistribution2 = 0.143, 0.09, 0.191, 0.071, 0.078, 0.077, 0.024, 0.195, 0.014, 0.02\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{2}, \\frac{35}{2}, \\frac{19}{2}, \\frac{5}{2}}$.\n", - "Output Answer": [ - "$\\frac{15295}{2483}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/2), (35/2), (19/2), (5/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -10, -8, -3, -3, -2, 1}$.\n", - "Output Answer": [ - "$-\\frac{25}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -10, -8, -3, -3, -2, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -2, -4, -9}$.\n", - "Output Answer": [ - "$\\frac{26}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -2, -4, -9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, 0, 0, 0, 3, 0, 9, 6, 0, 3, -9, -9, -9, 9, -9, 0, 6, 6, 9, 9, 0, 3, 9, -9, 9, 0, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 0, 0, 0, 0, 3, 0, 9, 6, 0, 3, -9, -9, -9, 9, -9, 0, 6, 6, 9, 9, 0, 3, 9, -9, 9, 0, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, 14, -7}$.\n", - "Output Answer": [ - "$3 \\sqrt{19}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 14, -7\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2 \\pi, -\\frac{7}{e}, \\frac{26}{7}, \\frac{17}{3}, -7, -5}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, -5, -\\frac{7}{e}, \\frac{26}{7}, \\frac{17}{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.pi, -(7/math.e), (26/7), (17/3), -7, -5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, 4.095, 0, e}$.\n", - "Output Answer": [ - "${-8, 0, e, 4.095}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 4.095, 0, math.e\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{5}, \\sqrt{5}, 0, \\sqrt{5}, -2 \\sqrt{5}, 3 \\sqrt{5}, \\sqrt{5}, -2 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, \\sqrt{5}, \\sqrt{5}, -2 \\sqrt{5}, 0, \\sqrt{5}, 0, -\\sqrt{5}, \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, -2 \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, \\sqrt{5}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(5), math.sqrt(5), 0, math.sqrt(5), -2*math.sqrt(5), 3*math.sqrt(5), math.sqrt(5), -2*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), math.sqrt(5), math.sqrt(5), -math.sqrt(5), math.sqrt(5), math.sqrt(5), -2*math.sqrt(5), 0, math.sqrt(5), 0, -math.sqrt(5), math.sqrt(5), math.sqrt(5), math.sqrt(5), -2*math.sqrt(5), math.sqrt(5), -math.sqrt(5), math.sqrt(5), math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 11 \\log (2), 3, \\frac{16}{\\sqrt{3}}, 9, \\frac{14}{\\sqrt{5}}, -\\frac{23}{3}, 1, 5, -\\frac{16}{\\sqrt{5}}, 5, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{3}}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 11*math.log(2), 3, (16/(math.sqrt(3))), 9, (14/(math.sqrt(5))), -(23/3), 1, 5, -(16/(math.sqrt(5))), 5, -4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 14, -13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{589}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 14, -13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, 0, -4, -10, 3 \\pi, -8 \\log (2), -5, \\frac{36}{7}, 0, -\\frac{8}{\\pi }, -1, -9, -3, 2 \\log (2)}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\frac{8}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 0, -4, -10, 3*math.pi, -8*math.log(2), -5, (36/7), 0, -(8/math.pi), -1, -9, -3, 2*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2+1.1 x-1.3$ where $x \\sim $ \\text{NormalDistribution}[-0.5,2.4]\n", - "Output Answer": [ - "$24.59$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.5, 2.4)\nprint(E(4.4*x**2+1.1*x-1.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -10, -10, 1, 0, -8}$.\n", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -10, -10, 1, 0, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -9, 6, -2, -6, 4, 9, 4}$.\n", - "Output Answer": [ - "$-\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -9, 6, -2, -6, 4, 9, 4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -2 \\sqrt{5}, -6, 9, -7.6, -4} \\setminus {-4, 9, \\frac{8}{\\sqrt{3}}, -7.6, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-6, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -2*math.sqrt(5), -6, 9, -7.6, -4,))\nsnd = set((-4, 9, (8/(math.sqrt(3))), -7.6, -2*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -3 \\sqrt{5}, -\\frac{17}{\\sqrt{\\pi }}, 5, 4}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, -3*math.sqrt(5), -(17/(math.sqrt(math.pi))), 5, 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{19}{2}, -9, 2 \\pi, -4, 3, 2 e, -\\frac{20}{3}, 1, -8, -6}$.", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (19/2), -9, 2*math.pi, -4, 3, 2*math.e, -(20/3), 1, -8, -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, -1.46, -3 \\sqrt{3}, -8}$.\n", - "Output Answer": [ - "${-8, -3 \\sqrt{3}, -2, -1.46}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -1.46, -3*math.sqrt(3), -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 5.927, 4, -1, 2, 3, 5, -3} \\cup {-1, 0, 5.927, -7, 4, -8, -2}$.\n", - "Output Answer": [ - "${-8, -7, -3, -2, -1, 0, 2, 3, 4, 5, 5.927}$" - ], - "Output Program": [ - "fst = set((-2, 5.927, 4, -1, 2, 3, 5, -3,))\nsnd = set((-1, 0, 5.927, -7, 4, -8, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8, -4, 7, -2 e, -2, 0, 3} \\cup {-4, -8, 3, 7, -2 e, 0}$.\n", - "Output Answer": [ - "${-8, -2 e, -4, -2, 0, 3, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -4, 7, -2*math.e, -2, 0, 3,))\nsnd = set((-4, -8, 3, 7, -2*math.e, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1.1, 0, -2, 6, \\sqrt{2}, -2.37, \\frac{2}{e}}$.\n", - "Output Answer": [ - "${-2.37, -2, -1.1, 0, \\frac{2}{e}, \\sqrt{2}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -1.1, 0, -2, 6, math.sqrt(2), -2.37, (2/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 12 \\log (2), 4, 5, 1, -9, 10, 3 \\sqrt{3}, -\\frac{19}{3}, \\frac{4}{7}, 8, 1, -3, -6, -8}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 12*math.log(2), 4, 5, 1, -9, 10, 3*math.sqrt(3), -(19/3), (4/7), 8, 1, -3, -6, -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{57}{7}, -9, -2, 2, e, -1, -7} \\cup {3, 3 e, \\frac{57}{7}, -2, 2, -1, -9}$.\n", - "Output Answer": [ - "${-9, -7, -2, -1, 2, e, 3, \\frac{57}{7}, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set(((57/7), -9, -2, 2, math.e, -1, -7,))\nsnd = set((3, 3*math.e, (57/7), -2, 2, -1, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, 8, -\\frac{9}{\\sqrt{5}}, -5, 1, \\frac{1}{3}, -\\frac{37}{5}, -5 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{1}{3}-\\frac{9}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 8, -(9/(math.sqrt(5))), -5, 1, (1/3), -(37/5), -5*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -10, \\frac{13}{2}, -14 \\log (2), -5 \\sqrt{3}, 9, -3 \\log (2), 4} \\setminus {0, 9, -10, -5 \\sqrt{3}, -\\frac{39}{4}}$.\n", - "Output Answer": [ - "${-14 \\log (2), -3 \\log (2), 4, \\frac{13}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -10, (13/2), -14*math.log(2), -5*math.sqrt(3), 9, -3*math.log(2), 4,))\nsnd = set((0, 9, -10, -5*math.sqrt(3), -(39/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.192,0.095,0.193,0.452\\}$ and $\\{0.196,0.056,0.329,0.18\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.192, 0.095, 0.193, 0.452\ndistribution2 = 0.196, 0.056, 0.329, 0.18\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4. x^3-1.2 x^2-1.4 x+4.8$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$-6.17$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(-4.*x**3-1.2*x**2-1.4*x+4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.239,0.21,0.091,0.076,0.099,0.077,0.001,0.006\\}$ and $\\{0.06,0.145,0.049,0.189,0.119,0.126,0.124,0.138\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.239, 0.21, 0.091, 0.076, 0.099, 0.077, 0.001, 0.006\ndistribution2 = 0.06, 0.145, 0.049, 0.189, 0.119, 0.126, 0.124, 0.138\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, e, 5, 4 \\sqrt{3}, -1.505, -8, -2, 3 \\sqrt{3}} \\cup {e, -2, -8, -1.505, -4, 4 \\sqrt{3}, -9}$.\n", - "Output Answer": [ - "${-9, -8, -7, -4, -2, -1.505, e, 5, 3 \\sqrt{3}, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, math.e, 5, 4*math.sqrt(3), -1.505, -8, -2, 3*math.sqrt(3),))\nsnd = set((math.e, -2, -8, -1.505, -4, 4*math.sqrt(3), -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 6 \\sqrt{2}, 1, 3, -\\frac{5}{e}} \\setminus {1, 2, -\\frac{5}{e}, -6}$.\n", - "Output Answer": [ - "${3, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 6*math.sqrt(2), 1, 3, -(5/math.e),))\nsnd = set((1, 2, -(5/math.e), -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.396,0.183,0.082,0.145\\}$ and $\\{0.211,0.107,0.447,0.219\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.396, 0.183, 0.082, 0.145\ndistribution2 = 0.211, 0.107, 0.447, 0.219\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, 4, -12, -13, 12, -12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{299}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 4, -12, -13, 12, -12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.051,0.169,0.043,0.174,0.078,0.162,0.058,0.053,0.08,0.055\\}$ and $\\{0.04,0.279,0.089,0.105,0.1,0.016,0.028,0.038,0.173,0.049\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.051, 0.169, 0.043, 0.174, 0.078, 0.162, 0.058, 0.053, 0.08, 0.055\ndistribution2 = 0.04, 0.279, 0.089, 0.105, 0.1, 0.016, 0.028, 0.038, 0.173, 0.049\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, 7, -7, 0, -3} \\cap {7, -9, -7, -8, -2, 0}$.\n", - "Output Answer": [ - "${-8, -7, 0, 7}$" - ], - "Output Program": [ - "fst = set((-8, 7, -7, 0, -3,))\nsnd = set((7, -9, -7, -8, -2, 0,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^3-0.8 x^2-1.6 x-0.3$ where $x \\sim $ \\text{BetaDistribution}[1.1,0.6]\n", - "Output Answer": [ - "$-1.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.1, 0.6)\nprint(E(1.3*x**3-0.8*x**2-1.6*x-0.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4, 6, 2, 1, 7, -9, 3, 9} \\cap {0, -9, -7, 3, 9, 6, -4, 1}$.\n", - "Output Answer": [ - "${-9, -4, 1, 3, 6, 9}$" - ], - "Output Program": [ - "fst = set((-4, 6, 2, 1, 7, -9, 3, 9,))\nsnd = set((0, -9, -7, 3, 9, 6, -4, 1,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\pi, -2 \\pi, 0, -\\pi, -2 \\pi, -3 \\pi, -2 \\pi, -\\pi, -\\pi, -\\pi, \\pi, -3 \\pi, \\pi, -2 \\pi, \\pi, \\pi, -2 \\pi, -\\pi, 0, -3 \\pi, \\pi, -3 \\pi, \\pi, -3 \\pi, -\\pi, -3 \\pi}$.\n", - "Output Answer": [ - "$\\{-2 \\pi ,-\\pi ,-3 \\pi ,\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.pi, -2*math.pi, 0, -math.pi, -2*math.pi, -3*math.pi, -2*math.pi, -math.pi, -math.pi, -math.pi, math.pi, -3*math.pi, math.pi, -2*math.pi, math.pi, math.pi, -2*math.pi, -math.pi, 0, -3*math.pi, math.pi, -3*math.pi, math.pi, -3*math.pi, -math.pi, -3*math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.226,0.161,0.351\\}$ and $\\{0.39,0.322,0.085\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.226, 0.161, 0.351\ndistribution2 = 0.39, 0.322, 0.085\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, \\frac{19}{\\pi }, 5, -7 \\log (2), -2}$.\n", - "Output Answer": [ - "${-7 \\log (2), -2, 5, \\frac{19}{\\pi }, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, (19/math.pi), 5, -7*math.log(2), -2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, 10, -6, -5, 8, 4.2} \\cup {1, 4.2, -6, -7, 6, -9 \\log (2)}$.\n", - "Output Answer": [ - "${-7, -9 \\log (2), -6, -5, 1, 4, 4.2, 6, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 10, -6, -5, 8, 4.2,))\nsnd = set((1, 4.2, -6, -7, 6, -9*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{3}, -7, -\\frac{8}{3}, -\\frac{8}{3}, -\\frac{16}{3}, -\\frac{16}{3}, -7, -7, -\\frac{16}{3}, -7, -\\frac{16}{3}, -\\frac{16}{3}, -\\frac{8}{3}, -7, -\\frac{8}{3}, -\\frac{8}{3}, -\\frac{8}{3}, -\\frac{8}{3}, -\\frac{8}{3}, -\\frac{8}{3}, -\\frac{16}{3}, -\\frac{8}{3}, -7, -7, -\\frac{8}{3}, -\\frac{8}{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{8}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(16/3), -7, -(8/3), -(8/3), -(16/3), -(16/3), -7, -7, -(16/3), -7, -(16/3), -(16/3), -(8/3), -7, -(8/3), -(8/3), -(8/3), -(8/3), -(8/3), -(8/3), -(16/3), -(8/3), -7, -7, -(8/3), -(8/3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7 \\sqrt{2}, -4 \\sqrt{2}, -5 \\sqrt{2}, 0, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{6 \\sqrt{2}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 7*math.sqrt(2), -4*math.sqrt(2), -5*math.sqrt(2), 0, -4*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.195,0.265,0.351\\}$ and $\\{0.098,0.338,0.256\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.195, 0.265, 0.351\ndistribution2 = 0.098, 0.338, 0.256\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3 \\sqrt{2}, 3, 2 \\sqrt{2}, 3 \\log (2), 6.893, 12 \\log (2), 8, 2}$.\n", - "Output Answer": [ - "${2, 3 \\log (2), 2 \\sqrt{2}, 3, 3 \\sqrt{2}, 6.893, 8, 12 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(2), 3, 2*math.sqrt(2), 3*math.log(2), 6.893, 12*math.log(2), 8, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, 3, 1, -2 \\pi, -4}$.\n", - "Output Answer": [ - "$5+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 3, 1, -2*math.pi, -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{8}{\\sqrt{3}}, 6, 4} \\cup {1, 4, \\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${1, 4, \\frac{8}{\\sqrt{3}}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set(((8/(math.sqrt(3))), 6, 4,))\nsnd = set((1, 4, (8/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 4 \\sqrt{3}, 7 \\sqrt{2}, 7, -2 \\pi} \\setminus {7, -\\pi, 1, 6, 4 \\sqrt{3}, 7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-2 \\pi, -6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 4*math.sqrt(3), 7*math.sqrt(2), 7, -2*math.pi,))\nsnd = set((7, -math.pi, 1, 6, 4*math.sqrt(3), 7*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x-2.5$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$-0.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(1.3*x-2.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, 0, -15, 2, 14, 4}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{139}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 0, -15, 2, 14, 4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, -8, -6, 3}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -8, -6, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 2, -7, -4, 0, 0, 0, 2, -6, 0, 0, -6, -4, 0, -7, -7, 2, 2, 2, 2, -6, 0, 2}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 2, -7, -4, 0, 0, 0, 2, -6, 0, 0, -6, -4, 0, -7, -7, 2, 2, 2, 2, -6, 0, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.093,0.109,0.282\\}$ and $\\{0.058,0.258,0.17,0.251\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.093, 0.109, 0.282\ndistribution2 = 0.058, 0.258, 0.17, 0.251\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.15,0.042,0.324,0.214,0.063,0.084\\}$ and $\\{0.296,0.163,0.096,0.008,0.194,0.179\\}$.", - "Output Answer": [ - "$0.98$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.15, 0.042, 0.324, 0.214, 0.063, 0.084\ndistribution2 = 0.296, 0.163, 0.096, 0.008, 0.194, 0.179\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 9, 1, 4, 6, 2, 4}$.\n", - "Output Answer": [ - "$\\frac{33}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 9, 1, 4, 6, 2, 4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{1}{2}, \\frac{37}{2}}$.\n", - "Output Answer": [ - "$\\frac{37}{38}$" - ], - "Output Program": [ - "import statistics\nvalues = (1/2), (37/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 10, 10, 1, -8, 10, -8, 1, -8, 1, 10, -3, -3, 1, -3, -3, 10, -8, 1, -3, 1, 10, 10, -3, -8, 1, 1, 10, 1, -8}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 10, 10, 1, -8, 10, -8, 1, -8, 1, 10, -3, -3, 1, -3, -3, 10, -8, 1, -3, 1, 10, 10, -3, -8, 1, 1, 10, 1, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\sqrt{3}, \\frac{31}{4}}$.\n", - "Output Answer": [ - "${\\sqrt{3}, \\frac{31}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(3), (31/4)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{15}{\\sqrt{\\pi }}, 14 \\log (2), \\frac{27}{e}, -1, -\\pi} \\setminus {-1, \\frac{1}{\\sqrt{5}}, -\\frac{7}{\\sqrt{2}}, -\\pi, 7 \\log (2), \\frac{11}{\\sqrt{\\pi }}, -9}$.\n", - "Output Answer": [ - "${\\frac{15}{\\sqrt{\\pi }}, 14 \\log (2), \\frac{27}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((15/(math.sqrt(math.pi))), 14*math.log(2), (27/math.e), -1, -math.pi,))\nsnd = set((-1, (1/(math.sqrt(5))), -(7/(math.sqrt(2))), -math.pi, 7*math.log(2), (11/(math.sqrt(math.pi))), -9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x^3+3.6 x^2-2.1 x-0.7$ where $x \\sim $ \\text{NormalDistribution}[-1.2,2.2]\n", - "Output Answer": [ - "$-25.37$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.2, 2.2)\nprint(E(2.6*x**3+3.6*x**2-2.1*x-0.7))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10 \\log (2), 9, \\frac{9}{4}, 5, -3 \\pi} \\setminus {3 e, \\frac{9}{4}, -5, -4, 2 e, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-3 \\pi, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((10*math.log(2), 9, (9/4), 5, -3*math.pi,))\nsnd = set((3*math.e, (9/4), -5, -4, 2*math.e, 10*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${243, 1296, 729, -7776, 27, -32768}$.\n", - "Output Answer": [ - "$432\\ 3^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 243, 1296, 729, -7776, 27, -32768\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{4}{3}, \\frac{52}{3}}$.\n", - "Output Answer": [ - "$\\frac{52}{21}$" - ], - "Output Program": [ - "import statistics\nvalues = (4/3), (52/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -5, -3}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -5, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.04,0.22,0.052,0.421,0.073,0.122,0.062\\}$ and $\\{0.103,0.211,0.03,0.21,0.054,0.03,0.206\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.04, 0.22, 0.052, 0.421, 0.073, 0.122, 0.062\ndistribution2 = 0.103, 0.211, 0.03, 0.21, 0.054, 0.03, 0.206\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -3, -3, -5, -4, -7, -4, -4, -4, -4, -5, -7, -3, -5, -7, -7, -3, -5, -5, -4, -5, -5, -9, -4, -3, -4, -5, -4, -5}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -3, -3, -5, -4, -7, -4, -4, -4, -4, -5, -7, -3, -5, -7, -7, -3, -5, -5, -4, -5, -5, -9, -4, -3, -4, -5, -4, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{3}{\\sqrt{5}}, -7.065, -10, 4.5, \\frac{25}{4}, \\pi, 5} \\setminus {\\frac{11}{4}, -5, -10, -3.024, \\pi, 4.5, 5}$.\n", - "Output Answer": [ - "${-7.065, -\\frac{3}{\\sqrt{5}}, \\frac{25}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(3/(math.sqrt(5))), -7.065, -10, 4.5, (25/4), math.pi, 5,))\nsnd = set(((11/4), -5, -10, -3.024, math.pi, 4.5, 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{2}, -6, 3, -\\frac{14}{3}, 9, 2, \\frac{17}{3}, -7 \\log (2), 5 \\sqrt{3}, -3 \\sqrt{5}, 4, \\pi, -8, -\\frac{17}{3}, 0}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(2), -6, 3, -(14/3), 9, 2, (17/3), -7*math.log(2), 5*math.sqrt(3), -3*math.sqrt(5), 4, math.pi, -8, -(17/3), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{1}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, 6 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, 5 \\sqrt{2}, 6 \\sqrt{2}, 5 \\sqrt{2}, -\\sqrt{2}, -\\frac{3}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}, 5 \\sqrt{2}, 6 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, 5 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, 6 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{1}{\\sqrt{2}},-\\frac{3}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(1/(math.sqrt(2))), -(3/(math.sqrt(2))), 6*math.sqrt(2), -(1/(math.sqrt(2))), -(3/(math.sqrt(2))), -(3/(math.sqrt(2))), 5*math.sqrt(2), 6*math.sqrt(2), 5*math.sqrt(2), -math.sqrt(2), -(3/(math.sqrt(2))), -(1/(math.sqrt(2))), 5*math.sqrt(2), 6*math.sqrt(2), -(1/(math.sqrt(2))), 5*math.sqrt(2), -(3/(math.sqrt(2))), (1/(math.sqrt(2))), 6*math.sqrt(2), -(1/(math.sqrt(2))), (1/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.9 x-2.2$ where $x \\sim $ \\text{NormalDistribution}[0.9,1.5]\n", - "Output Answer": [ - "$2.21$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.9, 1.5)\nprint(E(4.9*x-2.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.2 x^2-3.2 x+1.7$ where $x \\sim $ \\text{BetaDistribution}[0.8,1.7]\n", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 1.7)\nprint(E(-2.2*x**2-3.2*x+1.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, -8, 2 e, -2, -10, -2, -\\frac{17}{\\pi }, 7, 9, -\\frac{9}{\\sqrt{5}}, -\\frac{7}{4}, \\frac{15}{4}, -2}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -8, 2*math.e, -2, -10, -2, -(17/math.pi), 7, 9, -(9/(math.sqrt(5))), -(7/4), (15/4), -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{\\sqrt{\\pi }}, 3 e}$.\n", - "Output Answer": [ - "$3 e+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(math.pi))), 3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -3 \\log (2), \\frac{22}{\\pi }, 0, 6, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{22}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -3*math.log(2), (22/math.pi), 0, 6, -7*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -1, 0, -3, 4}$.\n", - "Output Answer": [ - "$\\frac{193}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -1, 0, -3, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{21}{\\sqrt{5}}, 7, -7, -\\frac{25}{e}, -2, -2, -1}$.\n", - "Output Answer": [ - "${-\\frac{21}{\\sqrt{5}}, -\\frac{25}{e}, -7, -2, -2, -1, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(21/(math.sqrt(5))), 7, -7, -(25/math.e), -2, -2, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{5}{2}, 5, -4 \\sqrt{5}, -6, 1, \\frac{13}{\\pi }} \\cup {-\\sqrt{3}, \\frac{13}{\\pi }, -4 \\sqrt{5}, 4, -6, \\frac{5}{2}, -4 \\log (2), 9, 5}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -6, -4 \\log (2), -\\sqrt{3}, 1, \\frac{5}{2}, 4, \\frac{13}{\\pi }, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set(((5/2), 5, -4*math.sqrt(5), -6, 1, (13/math.pi),))\nsnd = set((-math.sqrt(3), (13/math.pi), -4*math.sqrt(5), 4, -6, (5/2), -4*math.log(2), 9, 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, -8, 6, -8, -6, 7, -8, 6, -8, -6, -3, -8, -6, -6, -3, 7, -3, 7, -3, 7}$.\n", - "Output Answer": [ - "$\\{7,-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, -8, 6, -8, -6, 7, -8, 6, -8, -6, -3, -8, -6, -6, -3, 7, -3, 7, -3, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 18, 9, 3}$.\n", - "Output Answer": [ - "$\\frac{136}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 18, 9, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, \\pi}$.\n", - "Output Answer": [ - "$\\pi -3$" - ], - "Output Program": [ - "import math\n\nvalues = 3, math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${15, 5, 11, 5, 13}$.\n", - "Output Answer": [ - "$\\frac{106}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 5, 11, 5, 13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{3}, 6, 9} \\setminus {-1, \\frac{10}{\\sqrt{3}}, -\\sqrt{3}, 9, 4}$.\n", - "Output Answer": [ - "${2 \\sqrt{3}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(3), 6, 9,))\nsnd = set((-1, (10/(math.sqrt(3))), -math.sqrt(3), 9, 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6, 3 \\pi, -4, -\\frac{3}{2}, -\\frac{3}{4}} \\setminus {5, -2 \\pi, -8, 6}$.\n", - "Output Answer": [ - "${-4, -\\frac{3}{2}, -\\frac{3}{4}, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 3*math.pi, -4, -(3/2), -(3/4),))\nsnd = set((5, -2*math.pi, -8, 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, 0, 1}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, 0, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 3 e, 7 \\sqrt{2}, 7, \\frac{13}{\\sqrt{3}}, \\frac{22}{5}, 5, -4, 3} \\cup {5, 0, -5, \\frac{49}{5}, 3, 7 \\sqrt{2}, -4, 1, 2 e}$.\n", - "Output Answer": [ - "${-5, -4, 0, 1, 3, \\frac{22}{5}, 5, 2 e, 7, \\frac{13}{\\sqrt{3}}, 3 e, \\frac{49}{5}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 3*math.e, 7*math.sqrt(2), 7, (13/(math.sqrt(3))), (22/5), 5, -4, 3,))\nsnd = set((5, 0, -5, (49/5), 3, 7*math.sqrt(2), -4, 1, 2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x+3.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$4.84$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(2.1*x+3.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{\\sqrt{5}}, -8, 8, \\frac{29}{4}, 3, -3, 6, -2, -5, e, 0, 3, 7}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(5))), -8, 8, (29/4), 3, -3, 6, -2, -5, math.e, 0, 3, 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{2}, -3 e, -8, 3, 4, 0, -\\frac{3}{5}, -7, -1}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(2), -3*math.e, -8, 3, 4, 0, -(3/5), -7, -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.4 x^2-3.2 x+4.8$ where $x \\sim $ \\text{BetaDistribution}[1.8,0.8]\n", - "Output Answer": [ - "$2.37$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.8, 0.8)\nprint(E(-0.4*x**2-3.2*x+4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{14}{\\sqrt{5}}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{1}{2} \\left(4 \\sqrt{5}-\\frac{14}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(14/(math.sqrt(5))), 4*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.145,0.052,0.169,0.069,0.263,0.105,0.061,0.064\\}$ and $\\{0.129,0.2,0.034,0.116,0.033,0.095,0.125,0.204\\}$.", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.145, 0.052, 0.169, 0.069, 0.263, 0.105, 0.061, 0.064\ndistribution2 = 0.129, 0.2, 0.034, 0.116, 0.033, 0.095, 0.125, 0.204\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{10}{e}, \\frac{2}{e}, \\frac{17}{e}, -\\frac{2}{e}, -\\frac{14}{e}, \\frac{19}{e}, \\frac{11}{e}, -\\frac{4}{e}, \\frac{22}{e}, \\frac{9}{e}} \\cap {-\\frac{3}{e}, -\\frac{19}{e}, \\frac{19}{e}, \\frac{15}{e}, \\frac{11}{e}, \\frac{23}{e}, \\frac{5}{e}, \\frac{9}{e}, \\frac{25}{e}, \\frac{2}{e}, -\\frac{24}{e}}$.\n", - "Output Answer": [ - "${\\frac{2}{e}, \\frac{9}{e}, \\frac{11}{e}, \\frac{19}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(10/math.e), (2/math.e), (17/math.e), -(2/math.e), -(14/math.e), (19/math.e), (11/math.e), -(4/math.e), (22/math.e), (9/math.e),))\nsnd = set((-(3/math.e), -(19/math.e), (19/math.e), (15/math.e), (11/math.e), (23/math.e), (5/math.e), (9/math.e), (25/math.e), (2/math.e), -(24/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{2}{3}, 12, 15}$.\n", - "Output Answer": [ - "$\\frac{20}{11}$" - ], - "Output Program": [ - "import statistics\nvalues = (2/3), 12, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{41}{5}, -10, 2 \\pi, -9, -1}$.\n", - "Output Answer": [ - "$10+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -(41/5), -10, 2*math.pi, -9, -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -7, 9, 8}$.\n", - "Output Answer": [ - "$59$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -7, 9, 8\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{18}{7}, \\frac{3}{7}, \\frac{3}{7}, -\\frac{23}{7}, \\frac{3}{7}, \\frac{5}{7}, \\frac{5}{7}, -\\frac{22}{7}, -\\frac{23}{7}, -\\frac{18}{7}, -\\frac{23}{7}, -\\frac{22}{7}, \\frac{5}{7}, \\frac{3}{7}, \\frac{3}{7}, -\\frac{22}{7}, -\\frac{23}{7}, -\\frac{18}{7}, \\frac{3}{7}, -\\frac{22}{7}, -\\frac{23}{7}, -\\frac{23}{7}, -\\frac{22}{7}, -\\frac{18}{7}, -\\frac{18}{7}, \\frac{5}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{3}{7},-\\frac{23}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(18/7), (3/7), (3/7), -(23/7), (3/7), (5/7), (5/7), -(22/7), -(23/7), -(18/7), -(23/7), -(22/7), (5/7), (3/7), (3/7), -(22/7), -(23/7), -(18/7), (3/7), -(22/7), -(23/7), -(23/7), -(22/7), -(18/7), -(18/7), (5/7)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 1000, -8}$.\n", - "Output Answer": [ - "$20 \\sqrt[3]{-1} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 1000, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -1, \\frac{10}{\\sqrt{3}}, -1, 4, -8}$.\n", - "Output Answer": [ - "${-8, -1, -1, 1, 4, \\frac{10}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -1, (10/(math.sqrt(3))), -1, 4, -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9, 3, 4, -3 e, -8 \\log (2)} \\setminus {-\\frac{1}{3}, -3 e, -8 \\log (2), -4.86, 4}$.\n", - "Output Answer": [ - "${3, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 3, 4, -3*math.e, -8*math.log(2),))\nsnd = set((-(1/3), -3*math.e, -8*math.log(2), -4.86, 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6 \\sqrt{2}, 5, 6, -\\frac{4}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}, -9} \\setminus {-\\frac{4}{\\sqrt{3}}, -9, 4 \\sqrt{3}, -6 \\sqrt{2}, 6 \\sqrt{2}, 4}$.\n", - "Output Answer": [ - "${5, 6, \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.sqrt(2), 5, 6, -(4/(math.sqrt(3))), (17/(math.sqrt(3))), -9,))\nsnd = set((-(4/(math.sqrt(3))), -9, 4*math.sqrt(3), -6*math.sqrt(2), 6*math.sqrt(2), 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, 9, -6, 32, 49}$.\n", - "Output Answer": [ - "$8\\ 3^{3/5} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, 9, -6, 32, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{68}{7}, \\frac{69}{7}, -\\frac{33}{7}, \\frac{6}{7}, 6, \\frac{27}{7}, \\frac{20}{7}}$.\n", - "Output Answer": [ - "$\\frac{9}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(68/7), (69/7), -(33/7), (6/7), 6, (27/7), (20/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-14 \\log (2), 2 \\sqrt{2}, 4, -\\frac{31}{7}, -\\frac{5}{3}, -9, 10} \\setminus {2 \\sqrt{2}, -\\frac{5}{3}, 2, \\frac{9}{7}, 4, -14 \\log (2)}$.\n", - "Output Answer": [ - "${-9, -\\frac{31}{7}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-14*math.log(2), 2*math.sqrt(2), 4, -(31/7), -(5/3), -9, 10,))\nsnd = set((2*math.sqrt(2), -(5/3), 2, (9/7), 4, -14*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 6, 3, -2, 2, 9, -2, 2, 3, 2, 2, 2, 2, 6, 2, -2, -2, 2, 9, 9, -2, 6, 6, -2, 3}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 6, 3, -2, 2, 9, -2, 2, 3, 2, 2, 2, 2, 6, 2, -2, -2, 2, 9, 9, -2, 6, 6, -2, 3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\sqrt{3}, -\\sqrt{3}, 5 \\sqrt{3}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{5 \\sqrt{3}}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.sqrt(3), -math.sqrt(3), 5*math.sqrt(3), 3*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 1, -6}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 1, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{3}{2}, -\\frac{19}{2}, -\\frac{19}{2}, 9, -\\frac{19}{2}, -6, -6, 9, -6, -6, -6, -\\frac{19}{2}, -6, -\\frac{11}{2}, -\\frac{19}{2}, -\\frac{3}{2}, -\\frac{19}{2}, -\\frac{3}{2}, -\\frac{3}{2}, -9, -9, -9, -\\frac{19}{2}, -6, -\\frac{11}{2}, -\\frac{3}{2}, -\\frac{3}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{19}{2},-6\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(3/2), -(19/2), -(19/2), 9, -(19/2), -6, -6, 9, -6, -6, -6, -(19/2), -6, -(11/2), -(19/2), -(3/2), -(19/2), -(3/2), -(3/2), -9, -9, -9, -(19/2), -6, -(11/2), -(3/2), -(3/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, 7, -8, -1, 6, -\\frac{12}{\\sqrt{5}}, \\frac{21}{\\pi }, 10}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 7, -8, -1, 6, -(12/(math.sqrt(5))), (21/math.pi), 10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -8, 6, -1, 6, 0, 0, 6, -1, -3, -1, -8, -3, -3, -8, -3, -3, -8, -3, -1, -8}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -8, 6, -1, 6, 0, 0, 6, -1, -3, -1, -8, -3, -3, -8, -3, -3, -8, -3, -1, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, 4, 9.3, -\\frac{11}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\pi }, 4, 9, 9.3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 4, 9.3, -(11/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 1, -1, -216, -59049, 81}$.\n", - "Output Answer": [ - "$18 \\sqrt[6]{-2} 3^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 1, -1, -216, -59049, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, 4096, 625, 4, -27}$.\n", - "Output Answer": [ - "$40 \\sqrt[5]{-10} 3^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, 4096, 625, 4, -27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, 9}$.\n", - "Output Answer": [ - "$3 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${10, 3, -10, 6, 9, -3, -1, -9, 5, -2} \\cap {-7, -8, -9, 1, 5, -2, 3, 8, 9, 0, 2}$.\n", - "Output Answer": [ - "${-9, -2, 3, 5, 9}$" - ], - "Output Program": [ - "fst = set((10, 3, -10, 6, 9, -3, -1, -9, 5, -2,))\nsnd = set((-7, -8, -9, 1, 5, -2, 3, 8, 9, 0, 2,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, 0, 3, -2, 5}$.\n", - "Output Answer": [ - "$\\frac{17}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 0, 3, -2, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{22}{e}, 1, 0, \\frac{19}{\\sqrt{5}}, -6, 8, 2 \\sqrt{2}, 9, \\pi, -5, -1, \\frac{5}{e}, -4}$.\n", - "Output Answer": [ - "$9+\\frac{22}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -(22/math.e), 1, 0, (19/(math.sqrt(5))), -6, 8, 2*math.sqrt(2), 9, math.pi, -5, -1, (5/math.e), -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -7, -\\pi, \\frac{7}{\\sqrt{2}}, \\frac{2}{e}} \\setminus {-4, -\\pi, 1, -5 \\sqrt{2}, \\frac{2}{e}}$.\n", - "Output Answer": [ - "${-7, \\frac{7}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -7, -math.pi, (7/(math.sqrt(2))), (2/math.e),))\nsnd = set((-4, -math.pi, 1, -5*math.sqrt(2), (2/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{4}{3}, 14, 3, \\frac{55}{3}}$.\n", - "Output Answer": [ - "$\\frac{18480}{5587}$" - ], - "Output Program": [ - "import statistics\nvalues = (4/3), 14, 3, (55/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -3, -9, 1}$.\n", - "Output Answer": [ - "$-\\frac{21}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -3, -9, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -2 \\pi, -3, -7, -2, 6, 3.275, 9} \\setminus {6, -5, -2 \\pi, 9, -1, 3.275, -2}$.\n", - "Output Answer": [ - "${-7, -3, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -2*math.pi, -3, -7, -2, 6, 3.275, 9,))\nsnd = set((6, -5, -2*math.pi, 9, -1, 3.275, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{20}{3}, -9.178, 6, 7, 9, -8.24} \\setminus {-9.178, 6, -8.24, -1, 9, -\\frac{20}{3}}$.\n", - "Output Answer": [ - "${7}$" - ], - "Output Program": [ - "fst = set((-(20/3), -9.178, 6, 7, 9, -8.24,))\nsnd = set((-9.178, 6, -8.24, -1, 9, -(20/3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 10, -4, 9}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 10, -4, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{25}{\\pi }, -\\frac{13}{\\sqrt{2}}, 5, 2, \\frac{5}{3}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -\\frac{25}{\\pi }, \\frac{5}{3}, 2, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(25/math.pi), -(13/(math.sqrt(2))), 5, 2, (5/3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, 9, -\\frac{24}{e}, -3, -1}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, 9, -(24/math.e), -3, -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x-3.$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$-6.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(-2.*x-3.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x^2-0.2 x+0.8$ where $x \\sim $ \\text{BetaDistribution}[0.2,0.2]\n", - "Output Answer": [ - "$2.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.2, 0.2)\nprint(E(3.3*x**2-0.2*x+0.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 0, -\\frac{16}{\\sqrt{5}}, -\\frac{3}{\\sqrt{2}}, -\\frac{25}{e}, 7, 0}$.\n", - "Output Answer": [ - "$7+\\frac{25}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 0, -(16/(math.sqrt(5))), -(3/(math.sqrt(2))), -(25/math.e), 7, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.7 x-1.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.7]\n", - "Output Answer": [ - "$-1.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.7)\nprint(E(1.7*x-1.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, -\\frac{14}{\\sqrt{\\pi }}, -9, 5 \\log (2)}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2-\\frac{14}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -(14/(math.sqrt(math.pi))), -9, 5*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -3, -6, -9, 0, 0}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -3, -6, -9, 0, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -4 \\sqrt{5}, 2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, 0, 0, 0, -4 \\sqrt{5}, 2 \\sqrt{5}, 0, 0, 2 \\sqrt{5}, -4 \\sqrt{5}, 0, -2 \\sqrt{5}, 0, 2 \\sqrt{5}, -2 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, -4*math.sqrt(5), 2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), 0, 0, 0, -4*math.sqrt(5), 2*math.sqrt(5), 0, 0, 2*math.sqrt(5), -4*math.sqrt(5), 0, -2*math.sqrt(5), 0, 2*math.sqrt(5), -2*math.sqrt(5), 2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -6, 7, 7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$6+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -6, 7, 7*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -1, -8, -8}$.\n", - "Output Answer": [ - "$-\\frac{11}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -1, -8, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 1, -7, -3, 1, 1, -3, -7, -7, -8, -8, -8, -3, 1, -3, -3, -7, 1, -7, -8, 1}$.\n", - "Output Answer": [ - "$\\{-7,1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 1, -7, -3, 1, 1, -3, -7, -7, -8, -8, -8, -3, 1, -3, -3, -7, 1, -7, -8, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, 5, 4, 13, -13}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{119}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 5, 4, 13, -13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, -4 \\sqrt{3}, -4 \\sqrt{3}, 5 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, -4 \\sqrt{3}, 5 \\sqrt{3}, 2 \\sqrt{3}, 5 \\sqrt{3}, -4 \\sqrt{3}, -4 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 2 \\sqrt{3}, -4 \\sqrt{3}, 2 \\sqrt{3}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{5 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), -4*math.sqrt(3), -4*math.sqrt(3), 5*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), -4*math.sqrt(3), 5*math.sqrt(3), 2*math.sqrt(3), 5*math.sqrt(3), -4*math.sqrt(3), -4*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 2*math.sqrt(3), -4*math.sqrt(3), 2*math.sqrt(3), -4*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6 \\log (2), -3, -\\frac{13}{\\pi }, -9.14, \\frac{11}{2}} \\cup {-\\frac{1}{2}, -2 \\log (2), -\\frac{13}{\\pi }, -9.14, 6}$.\n", - "Output Answer": [ - "${-9.14, -6 \\log (2), -\\frac{13}{\\pi }, -3, -2 \\log (2), -\\frac{1}{2}, \\frac{11}{2}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.log(2), -3, -(13/math.pi), -9.14, (11/2),))\nsnd = set((-(1/2), -2*math.log(2), -(13/math.pi), -9.14, 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 8 \\log (2), \\frac{11}{e}, 6, -8, \\frac{32}{7}, 8, 7, -\\frac{11}{\\sqrt{\\pi }}} \\setminus {-8, 5, -\\frac{19}{3}, 8, \\frac{11}{e}, 7}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{\\pi }}, -3, \\frac{32}{7}, 8 \\log (2), 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 8*math.log(2), (11/math.e), 6, -8, (32/7), 8, 7, -(11/(math.sqrt(math.pi))),))\nsnd = set((-8, 5, -(19/3), 8, (11/math.e), 7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.226,0.176,0.261,0.117\\}$ and $\\{0.148,0.299,0.275,0.025\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.226, 0.176, 0.261, 0.117\ndistribution2 = 0.148, 0.299, 0.275, 0.025\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{3}{2}, -\\frac{17}{2}, -\\frac{17}{2}, -\\frac{11}{2}, \\frac{3}{2}, -3, 9, \\frac{7}{2}}$.\n", - "Output Answer": [ - "$-\\frac{13}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(3/2), -(17/2), -(17/2), -(11/2), (3/2), -3, 9, (7/2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, 0, -9, 9, -7, -9, -\\frac{17}{\\sqrt{3}}, -1, -\\frac{2}{\\sqrt{\\pi }}, 9, 4, \\frac{14}{\\sqrt{3}}}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 0, -9, 9, -7, -9, -(17/(math.sqrt(3))), -1, -(2/(math.sqrt(math.pi))), 9, 4, (14/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, -5, 5, -2} \\setminus {2, 6 \\sqrt{2}, 5, 7, \\frac{31}{4}, \\frac{48}{7}, -5, -6.947}$.\n", - "Output Answer": [ - "${-2}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -5, 5, -2,))\nsnd = set((2, 6*math.sqrt(2), 5, 7, (31/4), (48/7), -5, -6.947,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\sqrt{2}, -6, \\frac{20}{e}, \\frac{57}{7}, -5}$.\n", - "Output Answer": [ - "$\\frac{99}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(2), -6, (20/math.e), (57/7), -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 13, 3, 13}$.\n", - "Output Answer": [ - "$\\frac{78}{11}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 13, 3, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\sqrt{3}, -10, -\\frac{7}{e}, -\\frac{10}{\\pi }, 6, \\frac{11}{\\sqrt{3}}, -2 \\pi} \\cup {-2 \\sqrt{3}, -2 \\pi, -6, -\\frac{10}{\\pi }, -3, -\\frac{22}{e}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-10, -\\frac{22}{e}, -2 \\pi, -6, -2 \\sqrt{3}, -\\frac{10}{\\pi }, -3, -\\frac{7}{e}, -\\sqrt{3}, 6, \\frac{11}{\\sqrt{3}}, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(3), -10, -(7/math.e), -(10/math.pi), 6, (11/(math.sqrt(3))), -2*math.pi,))\nsnd = set((-2*math.sqrt(3), -2*math.pi, -6, -(10/math.pi), -3, -(22/math.e), 4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{3}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{13}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{8}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(3/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (13/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, \\frac{37}{3}, \\frac{35}{3}, \\frac{2}{3}}$.\n", - "Output Answer": [ - "$\\frac{2072}{967}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, (37/3), (35/3), (2/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\sqrt{3}, -\\frac{1}{\\pi }, 3, 3 \\sqrt{5}, 7} \\setminus {-3 \\sqrt{3}, -7, -\\frac{33}{5}, -5 \\sqrt{3}, 3}$.\n", - "Output Answer": [ - "${-\\sqrt{3}, -\\frac{1}{\\pi }, 3 \\sqrt{5}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(3), -(1/math.pi), 3, 3*math.sqrt(5), 7,))\nsnd = set((-3*math.sqrt(3), -7, -(33/5), -5*math.sqrt(3), 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -10, -1, -5, 4}$.\n", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -10, -1, -5, 4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, -2, 729, 6561, 100, -59049}$.\n", - "Output Answer": [ - "$81 \\sqrt{2} 3^{2/3} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, -2, 729, 6561, 100, -59049\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{28}{5}, -\\frac{7}{5}}$.\n", - "Output Answer": [ - "$\\frac{21}{10}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (28/5), -(7/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-10, -\\frac{17}{\\sqrt{5}}, -\\sqrt{2}, -10, 7, -6 \\sqrt{2}, e, 0}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\sqrt{2}-\\frac{17}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, -(17/(math.sqrt(5))), -math.sqrt(2), -10, 7, -6*math.sqrt(2), math.e, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -5, -7, 4, 6, 9, 9}$.\n", - "Output Answer": [ - "$\\frac{22}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -5, -7, 4, 6, 9, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.189,0.112,0.234,0.134,0.067,0.087,0.121\\}$ and $\\{0.086,0.286,0.089,0.176,0.116,0.06,0.047\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.189, 0.112, 0.234, 0.134, 0.067, 0.087, 0.121\ndistribution2 = 0.086, 0.286, 0.089, 0.176, 0.116, 0.06, 0.047\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1296, 10000, -729, 81, 25}$.\n", - "Output Answer": [ - "$90 \\sqrt[5]{-5} 2^{3/5} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1296, 10000, -729, 81, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\frac{3}{\\sqrt{2}}, -4, -\\frac{4}{\\sqrt{3}}, \\frac{18}{\\sqrt{\\pi }}, 3, 4, -\\sqrt{2}, -1, -9, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$9+\\frac{18}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, (3/(math.sqrt(2))), -4, -(4/(math.sqrt(3))), (18/(math.sqrt(math.pi))), 3, 4, -math.sqrt(2), -1, -9, 5*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3 e, 3 \\pi, -\\frac{8}{5}, -7, -\\frac{7}{3}, -3.518, -9}$.\n", - "Output Answer": [ - "${-9, -3 e, -7, -3.518, -\\frac{7}{3}, -\\frac{8}{5}, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.e, 3*math.pi, -(8/5), -7, -(7/3), -3.518, -9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.057,0.074,0.328,0.061,0.095,0.148,0.146\\}$ and $\\{0.017,0.175,0.095,0.075,0.262,0.146,0.128\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.057, 0.074, 0.328, 0.061, 0.095, 0.148, 0.146\ndistribution2 = 0.017, 0.175, 0.095, 0.075, 0.262, 0.146, 0.128\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, \\frac{4}{3}, 7, -3, \\frac{5}{3}, \\frac{16}{3}, -\\frac{26}{3}, 9}$.\n", - "Output Answer": [ - "$\\frac{17}{24}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, (4/3), 7, -3, (5/3), (16/3), -(26/3), 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.01,0.476,0.266\\}$ and $\\{0.357,0.226,0.208\\}$.", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.01, 0.476, 0.266\ndistribution2 = 0.357, 0.226, 0.208\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-1, 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 10*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.202,0.305,0.295\\}$ and $\\{0.133,0.019,0.099,0.02\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.202, 0.305, 0.295\ndistribution2 = 0.133, 0.019, 0.099, 0.02\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -5 \\sqrt{2}, 3, -8, 9.867, \\frac{19}{2}, 5 \\sqrt{2}, -2 e, -4} \\cup {\\frac{9}{\\sqrt{2}}, -4, 9.867, 0, -8, 5 \\sqrt{2}, 6, -2 e, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "${-8, -\\frac{15}{2}, -5 \\sqrt{2}, -2 e, -4, -3, 0, 3, 6, \\frac{9}{\\sqrt{2}}, 5 \\sqrt{2}, \\frac{19}{2}, 9.867}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -5*math.sqrt(2), 3, -8, 9.867, (19/2), 5*math.sqrt(2), -2*math.e, -4,))\nsnd = set(((9/(math.sqrt(2))), -4, 9.867, 0, -8, 5*math.sqrt(2), 6, -2*math.e, -(15/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -1, 7, -3, 4, -3, 7}$.\n", - "Output Answer": [ - "$\\frac{5}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -1, 7, -3, 4, -3, 7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 4 \\sqrt{3}, -\\pi, \\pi, 2 \\sqrt{3}, 2.123, -2} \\cup {-2 \\pi, 0, 4 \\sqrt{3}, -2, 2, 2.123}$.\n", - "Output Answer": [ - "${-9, -2 \\pi, -\\pi, -2, 0, 2, 2.123, \\pi, 2 \\sqrt{3}, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 4*math.sqrt(3), -math.pi, math.pi, 2*math.sqrt(3), 2.123, -2,))\nsnd = set((-2*math.pi, 0, 4*math.sqrt(3), -2, 2, 2.123,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, 9, -1, -5, -\\frac{29}{7}}$.\n", - "Output Answer": [ - "${-5, -\\frac{29}{7}, -1, 6, 9}$" - ], - "Output Program": [ - "values = 6, 9, -1, -5, -(29/7)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -7, -7, 3, 3, 3, -7, 4, 4, -9, -9, -9, -7, -9, 8, -7, 3, 3, 6, 8, 4, -7, 3, -7, 4, -9}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -7, -7, 3, 3, 3, -7, 4, 4, -9, -9, -9, -7, -9, 8, -7, 3, 3, 6, 8, 4, -7, 3, -7, 4, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${1, 9, 13}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{7}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 9, 13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{27}{2}, 6, \\frac{31}{2}, \\frac{27}{2}}$.\n", - "Output Answer": [ - "$\\frac{6696}{635}$" - ], - "Output Program": [ - "import statistics\nvalues = (27/2), 6, (31/2), (27/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{2}{\\pi }, 1}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(1+\\frac{2}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (2/math.pi), 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, \\frac{25}{4}}$.\n", - "Output Answer": [ - "$-\\frac{11}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, (25/4)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, 7, -3 \\sqrt{3}, 3, -5, 3 e, 0, 4}$.\n", - "Output Answer": [ - "$3 \\sqrt{3}+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 7, -3*math.sqrt(3), 3, -5, 3*math.e, 0, 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\pi, -2, -9 \\log (2), \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{3}-2\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.pi, -2, -9*math.log(2), math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-216, 8, 10}$.\n", - "Output Answer": [ - "$12 \\sqrt[3]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = -216, 8, 10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 100, -10}$.\n", - "Output Answer": [ - "$10 \\sqrt[3]{-1} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 100, -10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 3, 6, -2.879, 8, -5} \\setminus {6, -\\sqrt{3}, -7, -2.457, 0, 3, 8, \\frac{1}{e}}$.\n", - "Output Answer": [ - "${-5, -2.879}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 3, 6, -2.879, 8, -5,))\nsnd = set((6, -math.sqrt(3), -7, -2.457, 0, 3, 8, (1/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{2}{3}}$.\n", - "Output Answer": [ - "$\\frac{52}{41}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (2/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-5.42 < 3.2 x-3.5 < -1.25$ where $x \\sim $ \\text{NormalDistribution}[-0.2,2.5].", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.2, 2.5)\nprint(P((-5.42 < 3.2*x-3.5) & (3.2*x-3.5 < -1.25)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, 4, -6, -3}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 4, -6, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, 15, 12, 18}$.\n", - "Output Answer": [ - "$\\frac{2880}{193}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, 15, 12, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 4, 4, 6}$.\n", - "Output Answer": [ - "$\\frac{24}{7}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 4, 4, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -5, 5}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -5, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, 1, -\\frac{16}{5}, 5}$.\n", - "Output Answer": [ - "${-\\frac{16}{5}, -3, 1, 5}$" - ], - "Output Program": [ - "values = -3, 1, -(16/5), 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -4 \\sqrt{5}, 3.375, -8, -3.94, -4.8} \\setminus {0.47, -6, -8}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -4.8, -3.94, -3, 3.375}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -4*math.sqrt(5), 3.375, -8, -3.94, -4.8,))\nsnd = set((0.47, -6, -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.97 < 4.9 x+0.5 < -0.73$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(P((-0.97 < 4.9*x+0.5) & (4.9*x+0.5 < -0.73)))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6.84, -5, -6, 8, 0, 10} \\setminus {8, 0, -6, 10, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-6.84, -5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6.84, -5, -6, 8, 0, 10,))\nsnd = set((8, 0, -6, 10, -2*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, 12, 8, -14, 3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1037}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 12, 8, -14, 3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 e, e, e, 2 e, 2 e, e, 2 e, 2 e, 2 e, e, 2 e, e, -3 e, 0, 0, 0, 2 e, 2 e, -3 e, 0, 0, 2 e, 2 e, 2 e, -3 e}$.\n", - "Output Answer": [ - "$\\{2 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.e, math.e, math.e, 2*math.e, 2*math.e, math.e, 2*math.e, 2*math.e, 2*math.e, math.e, 2*math.e, math.e, -3*math.e, 0, 0, 0, 2*math.e, 2*math.e, -3*math.e, 0, 0, 2*math.e, 2*math.e, 2*math.e, -3*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8, 6, -\\frac{2}{e}, -\\frac{9}{\\sqrt{2}}, -\\frac{34}{5}} \\cup {-\\frac{34}{5}, -\\frac{2}{e}, -8, -7}$.\n", - "Output Answer": [ - "${-8, -7, -\\frac{34}{5}, -\\frac{9}{\\sqrt{2}}, -\\frac{2}{e}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 6, -(2/math.e), -(9/(math.sqrt(2))), -(34/5),))\nsnd = set((-(34/5), -(2/math.e), -8, -7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{7 \\sqrt{3}}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4.317, 9.68, -\\frac{29}{7}, 9, -5} \\setminus {8, 4.317, -5, -4, 9}$.\n", - "Output Answer": [ - "${-\\frac{29}{7}, 9.68}$" - ], - "Output Program": [ - "fst = set((4.317, 9.68, -(29/7), 9, -5,))\nsnd = set((8, 4.317, -5, -4, 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, 0, 5, -1, 10, -10, 1}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "values = 2, 0, 5, -1, 10, -10, 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.198,0.224,0.442\\}$ and $\\{0.082,0.101,0.521\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.198, 0.224, 0.442\ndistribution2 = 0.082, 0.101, 0.521\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\pi, 2 \\pi, 2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -\\pi, -\\pi, -\\pi, 2 \\pi, -2 \\pi, -\\pi, -2 \\pi, 2 \\pi, -\\pi, -\\pi, -\\pi, -2 \\pi, -2 \\pi, -\\pi, -\\pi, -\\pi, 2 \\pi, -2 \\pi, -\\pi, -2 \\pi, -\\pi, -\\pi}$.\n", - "Output Answer": [ - "$\\{-\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.pi, 2*math.pi, 2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -math.pi, -math.pi, -math.pi, 2*math.pi, -2*math.pi, -math.pi, -2*math.pi, 2*math.pi, -math.pi, -math.pi, -math.pi, -2*math.pi, -2*math.pi, -math.pi, -math.pi, -math.pi, 2*math.pi, -2*math.pi, -math.pi, -2*math.pi, -math.pi, -math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${0, -6, -4, 8, 5, 2, -2, -9, -3, -1, 3} \\cap {-1, -8, 8, -3, 7, -2, 5, 3, -4}$.\n", - "Output Answer": [ - "${-4, -3, -2, -1, 3, 5, 8}$" - ], - "Output Program": [ - "fst = set((0, -6, -4, 8, 5, 2, -2, -9, -3, -1, 3,))\nsnd = set((-1, -8, 8, -3, 7, -2, 5, 3, -4,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 9, 81, 16, 1000000, 15625}$.\n", - "Output Answer": [ - "$300\\ 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 9, 81, 16, 1000000, 15625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 10, 10, 10, 5, 1, 10, 3}$.\n", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 10, 10, 10, 5, 1, 10, 3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{12}{\\sqrt{\\pi }}, -\\frac{17}{7}, -2.9, -2 \\pi, \\frac{12}{\\sqrt{5}}, 2, \\frac{17}{\\sqrt{3}}} \\setminus {2, -2 \\pi, -2.9, -\\frac{54}{7}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{25}{3}}$.\n", - "Output Answer": [ - "${-\\frac{17}{7}, \\frac{12}{\\sqrt{5}}, \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(12/(math.sqrt(math.pi))), -(17/7), -2.9, -2*math.pi, (12/(math.sqrt(5))), 2, (17/(math.sqrt(3))),))\nsnd = set((2, -2*math.pi, -2.9, -(54/7), -(12/(math.sqrt(math.pi))), (25/3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, -5, 3}$.\n", - "Output Answer": [ - "${-8, -5, 3}$" - ], - "Output Program": [ - "values = -8, -5, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.076,0.105,0.231,0.221,0.158\\}$ and $\\{0.277,0.253,0.058,0.044,0.077\\}$.", - "Output Answer": [ - "$0.65$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.076, 0.105, 0.231, 0.221, 0.158\ndistribution2 = 0.277, 0.253, 0.058, 0.044, 0.077\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, 7, -7, 1}$.\n", - "Output Answer": [ - "${-7, -5, 1, 7}$" - ], - "Output Program": [ - "values = -5, 7, -7, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3, 512, 1000, 1, 243, 1296}$.\n", - "Output Answer": [ - "$12 \\sqrt[6]{-1} \\sqrt{5} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 512, 1000, 1, 243, 1296\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8.7, 1, -8, 4, 4}$.\n", - "Output Answer": [ - "${-8.7, -8, 1, 4, 4}$" - ], - "Output Program": [ - "values = -8.7, 1, -8, 4, 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 13, 9, 13}$.\n", - "Output Answer": [ - "$\\frac{2574}{229}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 13, 9, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 6, -6, 6, -9, -6, 8, -9, -6, 8, 8, -9, 8, -6, -6, -6, -3, 8, 8, -9, 8}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 6, -6, 6, -9, -6, 8, -9, -6, 8, 8, -9, 8, -6, -6, -6, -3, 8, 8, -9, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\frac{5}{2}, \\frac{6}{\\pi }, -7, -9}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 5, (5/2), (6/math.pi), -7, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{2}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{1}{4} \\left(\\frac{11}{\\sqrt{3}}+4 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (2/(math.sqrt(3))), (14/(math.sqrt(3))), -(5/(math.sqrt(3))), 4*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, 4, 5}$.\n", - "Output Answer": [ - "${-3, 4, 5}$" - ], - "Output Program": [ - "values = -3, 4, 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -2, -5, -2, 10, 7, -2, 7, 0, -1, 7, -5, -5, 10, -2, 10, 0, 0, -1, -1, -2, -1, 7, 10, -2, 10, -5}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -2, -5, -2, 10, 7, -2, 7, 0, -1, 7, -5, -5, 10, -2, 10, 0, 0, -1, -1, -2, -1, 7, 10, -2, 10, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${e, -1}$.\n", - "Output Answer": [ - "${-1, e}$" - ], - "Output Program": [ - "import math\n\nvalues = math.e, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, 2, 2}$.\n", - "Output Answer": [ - "$\\frac{100}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 2, 2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5 \\log (2), -\\frac{17}{\\sqrt{5}}, -4, 6 \\sqrt{2}, 0, 3, 10, 7, -7, 0, -5, 1, 8}$.\n", - "Output Answer": [ - "$10+\\frac{17}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.log(2), -(17/(math.sqrt(5))), -4, 6*math.sqrt(2), 0, 3, 10, 7, -7, 0, -5, 1, 8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, 10, -15, -11}$.\n", - "Output Answer": [ - "$\\frac{494}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 10, -15, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -10, -5, -2 \\pi, \\frac{11}{3}, \\frac{9}{\\sqrt{2}}, \\frac{8}{\\sqrt{3}}, -7}$.\n", - "Output Answer": [ - "$10+\\frac{9}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -10, -5, -2*math.pi, (11/3), (9/(math.sqrt(2))), (8/(math.sqrt(3))), -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 15}$.\n", - "Output Answer": [ - "$\\frac{15}{2}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.111,0.193,0.022,0.015,0.37,0.066,0.025\\}$ and $\\{0.001,0.05,0.087,0.05,0.061,0.59,0.125\\}$.", - "Output Answer": [ - "$1.7$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.111, 0.193, 0.022, 0.015, 0.37, 0.066, 0.025\ndistribution2 = 0.001, 0.05, 0.087, 0.05, 0.061, 0.59, 0.125\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, 11, 5}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{223}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, 11, 5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -3 \\pi, \\frac{4}{7}, -\\sqrt{2}, -4 \\sqrt{3}, 7, 3 \\sqrt{3}, 7, \\frac{1}{3}, 4 \\sqrt{3}, 0, -\\frac{4}{5}, 7, 4}$.\n", - "Output Answer": [ - "$7+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -3*math.pi, (4/7), -math.sqrt(2), -4*math.sqrt(3), 7, 3*math.sqrt(3), 7, (1/3), 4*math.sqrt(3), 0, -(4/5), 7, 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, -2, 5}$.\n", - "Output Answer": [ - "${-2, 4, 5}$" - ], - "Output Program": [ - "values = 4, -2, 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.044,0.061,0.151,0.053,0.184,0.074,0.166,0.092,0.078\\}$ and $\\{0.358,0.074,0.018,0.131,0.02,0.027,0.135,0.112,0.071\\}$.", - "Output Answer": [ - "$0.79$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.044, 0.061, 0.151, 0.053, 0.184, 0.074, 0.166, 0.092, 0.078\ndistribution2 = 0.358, 0.074, 0.018, 0.131, 0.02, 0.027, 0.135, 0.112, 0.071\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 3, -7, \\frac{10}{\\sqrt{3}}, 10, \\frac{18}{5}, -8, 1, -7, \\frac{35}{4}, -1, 5}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 3, -7, (10/(math.sqrt(3))), 10, (18/5), -8, 1, -7, (35/4), -1, 5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 8, 14, 4}$.\n", - "Output Answer": [ - "$\\frac{1363}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 8, 14, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-10, -3, 10, -6, -0.819}$.\n", - "Output Answer": [ - "${-10, -6, -3, -0.819, 10}$" - ], - "Output Program": [ - "values = -10, -3, 10, -6, -0.819\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.8 x^2-3. x-4.4$ where $x \\sim $ \\text{PoissonDistribution}[2.3]\n", - "Output Answer": [ - "$-5.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.3)\nprint(E(0.8*x**2-3.*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{35}{2}, 8}$.\n", - "Output Answer": [ - "$\\frac{2520}{223}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (35/2), 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${0, -5, -3, -2, 5, 7, 2, -9, -6, -4, 4} \\cap {-9, 9, 7, 4, -4, 10, -3, -2, -5, -8}$.\n", - "Output Answer": [ - "${-9, -5, -4, -3, -2, 4, 7}$" - ], - "Output Program": [ - "fst = set((0, -5, -3, -2, 5, 7, 2, -9, -6, -4, 4,))\nsnd = set((-9, 9, 7, 4, -4, 10, -3, -2, -5, -8,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8.5, 9, -7, -6 \\sqrt{2}} \\setminus {0, -9.5, 8.91, -8, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, 8.5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.5, 9, -7, -6*math.sqrt(2),))\nsnd = set((0, -9.5, 8.91, -8, -6*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{3}{\\sqrt{5}}, -5 \\sqrt{3}, -4, -2, -5 \\sqrt{2}, 2 \\pi, -5}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (3/(math.sqrt(5))), -5*math.sqrt(3), -4, -2, -5*math.sqrt(2), 2*math.pi, -5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10 \\log (2), 7 \\log (2), 10 \\log (2), 5 \\log (2), 5 \\log (2), 7 \\log (2), -13 \\log (2), 10 \\log (2), 10 \\log (2), -13 \\log (2), 7 \\log (2), 5 \\log (2), -13 \\log (2), 5 \\log (2), 10 \\log (2), 7 \\log (2), -13 \\log (2), 5 \\log (2), 10 \\log (2), 7 \\log (2)}$.\n", - "Output Answer": [ - "$\\{10 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 10*math.log(2), 7*math.log(2), 10*math.log(2), 5*math.log(2), 5*math.log(2), 7*math.log(2), -13*math.log(2), 10*math.log(2), 10*math.log(2), -13*math.log(2), 7*math.log(2), 5*math.log(2), -13*math.log(2), 5*math.log(2), 10*math.log(2), 7*math.log(2), -13*math.log(2), 5*math.log(2), 10*math.log(2), 7*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 7, 9, 3, 4}$.\n", - "Output Answer": [ - "$\\frac{31}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 7, 9, 3, 4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, 1, 7, -4, -\\frac{47}{7}, 9 \\log (2), -2} \\cup {-13 \\log (2), 1, -\\frac{43}{7}, -9, 9, -4}$.\n", - "Output Answer": [ - "${-13 \\log (2), -9, -\\frac{47}{7}, -\\frac{43}{7}, -5, -4, -2, 1, 9 \\log (2), 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 1, 7, -4, -(47/7), 9*math.log(2), -2,))\nsnd = set((-13*math.log(2), 1, -(43/7), -9, 9, -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.168,0.268,0.285\\}$ and $\\{0.042,0.068,0.529\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.168, 0.268, 0.285\ndistribution2 = 0.042, 0.068, 0.529\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, 4, 11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{37}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 4, 11\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, -3, 3, 216}$.\n", - "Output Answer": [ - "$(3+3 i) \\sqrt[4]{6} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, -3, 3, 216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${531441, 117649, 1, 1000000, -16807, 46656}$.\n", - "Output Answer": [ - "$3780 \\sqrt[6]{-1} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 531441, 117649, 1, 1000000, -16807, 46656\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\sqrt{3}, -\\frac{27}{4}, -2 \\pi, -6, 2}$.", - "Output Answer": [ - "$-2 \\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.sqrt(3), -(27/4), -2*math.pi, -6, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x+4.8$ where $x \\sim $ \\text{BetaDistribution}[0.6,0.9]\n", - "Output Answer": [ - "$5.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.6, 0.9)\nprint(E(2.3*x+4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 1, \\frac{1}{3}, 0, \\frac{4}{7}, 4, -\\frac{24}{\\pi }, 7, -8, -7, -\\frac{11}{\\sqrt{3}}, 3 e, 0}$.\n", - "Output Answer": [ - "$8+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 1, (1/3), 0, (4/7), 4, -(24/math.pi), 7, -8, -7, -(11/(math.sqrt(3))), 3*math.e, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 e, e, e}$.\n", - "Output Answer": [ - "$-\\frac{e}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.e, math.e, math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.372,0.154,0.121\\}$ and $\\{0.269,0.168,0.168\\}$.", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.372, 0.154, 0.121\ndistribution2 = 0.269, 0.168, 0.168\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -11, -8, -10, -9, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1067}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -11, -8, -10, -9, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -4, \\frac{14}{\\sqrt{\\pi }}, 9, 6, -\\frac{5}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -4, (14/(math.sqrt(math.pi))), 9, 6, -(5/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{2}, 7 \\sqrt{2}, -3 \\sqrt{5}, 3 \\sqrt{3}, -\\frac{22}{\\sqrt{5}}, 4, -7, -8, -9}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{22}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(2), 7*math.sqrt(2), -3*math.sqrt(5), 3*math.sqrt(3), -(22/(math.sqrt(5))), 4, -7, -8, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{43}{5}, e, -\\frac{16}{\\pi }, -4} \\setminus {6, 4 \\sqrt{5}, \\frac{17}{4}, \\frac{31}{4}, 0, \\frac{2}{5}, e}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\pi }, -4, \\frac{43}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((43/5), math.e, -(16/math.pi), -4,))\nsnd = set((6, 4*math.sqrt(5), (17/4), (31/4), 0, (2/5), math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, 1, 14, -15, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1217}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 1, 14, -15, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -4, 10, -7, 9, -2}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -4, 10, -7, 9, -2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{9}{\\sqrt{5}}, -1, -4, 6, 5 \\sqrt{3}, \\frac{26}{5}} \\setminus {-9, -\\frac{7}{2}, -1, 5 \\sqrt{3}, -3, 10}$.\n", - "Output Answer": [ - "${-\\frac{9}{\\sqrt{5}}, -4, \\frac{26}{5}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(9/(math.sqrt(5))), -1, -4, 6, 5*math.sqrt(3), (26/5),))\nsnd = set((-9, -(7/2), -1, 5*math.sqrt(3), -3, 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.8 x+1.1$ where $x \\sim $ \\text{BetaDistribution}[1.2,0.4]\n", - "Output Answer": [ - "$2.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.2, 0.4)\nprint(E(1.8*x+1.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-5.17 < -3.6 x^2+2. x-2. < 2.06$ where $x \\sim $ \\text{NormalDistribution}[-0.8,2.3].", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 2.3)\nprint(P((-5.17 < -3.6*x**2+2.*x-2.) & (-3.6*x**2+2.*x-2. < 2.06)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.3 x+4.1$ where $x \\sim $ \\text{NormalDistribution}[-0.8,1.9]\n", - "Output Answer": [ - "$3.86$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 1.9)\nprint(E(0.3*x+4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -14, 5, -1, 10}$.\n", - "Output Answer": [ - "$\\frac{813}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -14, 5, -1, 10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, 14, -14}$.\n", - "Output Answer": [ - "$\\frac{604}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 14, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.025,0.063,0.245,0.231,0.099\\}$ and $\\{0.224,0.152,0.119,0.145,0.047\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.025, 0.063, 0.245, 0.231, 0.099\ndistribution2 = 0.224, 0.152, 0.119, 0.145, 0.047\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -100000, -1000, -343, 1024}$.\n", - "Output Answer": [ - "$40 \\sqrt[5]{-1} 70^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -100000, -1000, -343, 1024\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, 3 \\sqrt{5}, -2 \\pi}$.\n", - "Output Answer": [ - "${-8, -2 \\pi, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 3*math.sqrt(5), -2*math.pi\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{3}{e}, -\\frac{14}{5}, 8, -9} \\cup {\\frac{3}{e}, 10, -\\frac{14}{5}, -9}$.\n", - "Output Answer": [ - "${-9, -\\frac{14}{5}, \\frac{3}{e}, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((3/math.e), -(14/5), 8, -9,))\nsnd = set(((3/math.e), 10, -(14/5), -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, -5, 9, -7}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{971}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -5, 9, -7\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, 13 \\log (2), 2 \\sqrt{2}, -3, -6, 0, -2 \\sqrt{5}, -1, -4} \\cup {-10, -5, -2, 13 \\log (2), -2 \\sqrt{5}, 2 \\sqrt{2}, 2, -3}$.\n", - "Output Answer": [ - "${-10, -7, -6, -5, -2 \\sqrt{5}, -4, -3, -2, -1, 0, 2, 2 \\sqrt{2}, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 13*math.log(2), 2*math.sqrt(2), -3, -6, 0, -2*math.sqrt(5), -1, -4,))\nsnd = set((-10, -5, -2, 13*math.log(2), -2*math.sqrt(5), 2*math.sqrt(2), 2, -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{27}{\\pi }, -\\frac{31}{\\pi }, 5, 2, 6 \\log (2), 4 \\sqrt{3}, -5} \\setminus {-\\frac{26}{\\pi }, 2, -4.026, -\\frac{31}{\\pi }, 6 \\log (2)}$.\n", - "Output Answer": [ - "${-5, 5, 4 \\sqrt{3}, \\frac{27}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((27/math.pi), -(31/math.pi), 5, 2, 6*math.log(2), 4*math.sqrt(3), -5,))\nsnd = set((-(26/math.pi), 2, -4.026, -(31/math.pi), 6*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{4}{\\sqrt{\\pi }}, 0, 6}$.\n", - "Output Answer": [ - "${0, \\frac{4}{\\sqrt{\\pi }}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = (4/(math.sqrt(math.pi))), 0, 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{57}{7}, 4 \\sqrt{3}, \\frac{17}{e}, 5 \\sqrt{3}, 3.5, 8} \\cup {8, 7, -\\frac{11}{e}, 4 \\sqrt{3}, 5 \\sqrt{3}, -\\frac{57}{7}, -0.4}$.\n", - "Output Answer": [ - "${-\\frac{57}{7}, -\\frac{11}{e}, -0.4, 3.5, \\frac{17}{e}, 4 \\sqrt{3}, 7, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(57/7), 4*math.sqrt(3), (17/math.e), 5*math.sqrt(3), 3.5, 8,))\nsnd = set((8, 7, -(11/math.e), 4*math.sqrt(3), 5*math.sqrt(3), -(57/7), -0.4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${10, -2, -\\sqrt{5}, 7, 2 \\pi, -3.6} \\cup {-9.7, -2, -2 \\sqrt{5}, 10, -9, \\pi}$.\n", - "Output Answer": [ - "${-9.7, -9, -2 \\sqrt{5}, -3.6, -\\sqrt{5}, -2, \\pi, 2 \\pi, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, -2, -math.sqrt(5), 7, 2*math.pi, -3.6,))\nsnd = set((-9.7, -2, -2*math.sqrt(5), 10, -9, math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${0, -4, -7, 7, -6, 9, 2} \\cap {9, -6, 6, -3, 2, -9}$.\n", - "Output Answer": [ - "${-6, 2, 9}$" - ], - "Output Program": [ - "fst = set((0, -4, -7, 7, -6, 9, 2,))\nsnd = set((9, -6, 6, -3, 2, -9,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, 1, -1, 1, -3}$.\n", - "Output Answer": [ - "${-3, -1, 1, 1, 4}$" - ], - "Output Program": [ - "values = 4, 1, -1, 1, -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -1, -2 \\pi, 2 \\pi, -9, -\\frac{25}{7}, 3, \\frac{9}{\\pi }, -7} \\cup {-6, -1, \\frac{9}{\\pi }, -7, 2 \\pi, 7, -2 \\pi, -3}$.\n", - "Output Answer": [ - "${-9, -7, -2 \\pi, -6, -\\frac{25}{7}, -3, -1, \\frac{9}{\\pi }, 3, 2 \\pi, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -1, -2*math.pi, 2*math.pi, -9, -(25/7), 3, (9/math.pi), -7,))\nsnd = set((-6, -1, (9/math.pi), -7, 2*math.pi, 7, -2*math.pi, -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.257,0.213,0.211,0.047\\}$ and $\\{0.302,0.218,0.338,0.127\\}$.", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.257, 0.213, 0.211, 0.047\ndistribution2 = 0.302, 0.218, 0.338, 0.127\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4 \\sqrt{5}, 3 e, 2 e, -3.8, -2, -10, -\\frac{22}{e}, 1.92} \\cup {-\\frac{9}{e}, 1.92, 2 e, -2, 3 e, -10, 3, 0, -7.2}$.\n", - "Output Answer": [ - "${-10, -\\frac{22}{e}, -7.2, -3.8, -\\frac{9}{e}, -2, 0, 1.92, 3, 2 e, 3 e, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), 3*math.e, 2*math.e, -3.8, -2, -10, -(22/math.e), 1.92,))\nsnd = set((-(9/math.e), 1.92, 2*math.e, -2, 3*math.e, -10, 3, 0, -7.2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x^2+3.2 x+6.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$7.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(-1.1*x**2+3.2*x+6.1))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5 \\sqrt{3}, -\\frac{6}{\\pi }, 1, 10 \\log (2), -9, \\frac{11}{\\sqrt{5}}} \\setminus {-9, -\\frac{6}{\\pi }, 10 \\log (2), 1, 3 \\log (2), \\frac{3}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, \\frac{11}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(3), -(6/math.pi), 1, 10*math.log(2), -9, (11/(math.sqrt(5))),))\nsnd = set((-9, -(6/math.pi), 10*math.log(2), 1, 3*math.log(2), (3/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.11 < -3.8 x^2-1.4 x+2.2 < 0.59$ where $x \\sim $ \\text{BetaDistribution}[1.3,1.].", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 1.)\nprint(P((0.11 < -3.8*x**2-1.4*x+2.2) & (-3.8*x**2-1.4*x+2.2 < 0.59)))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${10 \\log (2), 2 \\log (2), 5 \\log (2), 12 \\log (2), -\\log (2), -7 \\log (2), 13 \\log (2), -10 \\log (2), -12 \\log (2), 7 \\log (2)} \\cap {-5 \\log (2), 14 \\log (2), 10 \\log (2), 6 \\log (2), -6 \\log (2), 0, -14 \\log (2), 9 \\log (2), 13 \\log (2), 3 \\log (2), 4 \\log (2), 8 \\log (2)}$.\n", - "Output Answer": [ - "${10 \\log (2), 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((10*math.log(2), 2*math.log(2), 5*math.log(2), 12*math.log(2), -math.log(2), -7*math.log(2), 13*math.log(2), -10*math.log(2), -12*math.log(2), 7*math.log(2),))\nsnd = set((-5*math.log(2), 14*math.log(2), 10*math.log(2), 6*math.log(2), -6*math.log(2), 0, -14*math.log(2), 9*math.log(2), 13*math.log(2), 3*math.log(2), 4*math.log(2), 8*math.log(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -5, 4}$.\n", - "Output Answer": [ - "$-\\frac{8}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -5, 4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, 7, 1, 4, 8, \\frac{1}{2}, \\sqrt{5}}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 7, 1, 4, 8, (1/2), math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 \\sqrt{2}, -3 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -3 \\sqrt{2}, -7 \\sqrt{2}, -4 \\sqrt{2}, -7 \\sqrt{2}, -4 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -7 \\sqrt{2}, 6 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -3 \\sqrt{2}, -3 \\sqrt{2}, -7 \\sqrt{2}, -7 \\sqrt{2}, -7 \\sqrt{2}, -3 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, 6 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -7 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.sqrt(2), -3*math.sqrt(2), (1/(math.sqrt(2))), -3*math.sqrt(2), -7*math.sqrt(2), -4*math.sqrt(2), -7*math.sqrt(2), -4*math.sqrt(2), (1/(math.sqrt(2))), -7*math.sqrt(2), 6*math.sqrt(2), (1/(math.sqrt(2))), -3*math.sqrt(2), -3*math.sqrt(2), -7*math.sqrt(2), -7*math.sqrt(2), -7*math.sqrt(2), -3*math.sqrt(2), (1/(math.sqrt(2))), 6*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -7*math.sqrt(2), (1/(math.sqrt(2))), (3/(math.sqrt(2))), (3/(math.sqrt(2))), (3/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 \\sqrt{2}, 6 \\sqrt{2}, -2 \\sqrt{2}, -4 \\sqrt{2}, -2 \\sqrt{2}, -2 \\sqrt{2}, -2 \\sqrt{2}, -4 \\sqrt{2}, 6 \\sqrt{2}, 6 \\sqrt{2}, 6 \\sqrt{2}, -4 \\sqrt{2}, -6 \\sqrt{2}, 2 \\sqrt{2}, -4 \\sqrt{2}, 2 \\sqrt{2}, -4 \\sqrt{2}, -5 \\sqrt{2}, -6 \\sqrt{2}, 2 \\sqrt{2}, -5 \\sqrt{2}, -6 \\sqrt{2}, -7 \\sqrt{2}, 2 \\sqrt{2}, -5 \\sqrt{2}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.sqrt(2), 6*math.sqrt(2), -2*math.sqrt(2), -4*math.sqrt(2), -2*math.sqrt(2), -2*math.sqrt(2), -2*math.sqrt(2), -4*math.sqrt(2), 6*math.sqrt(2), 6*math.sqrt(2), 6*math.sqrt(2), -4*math.sqrt(2), -6*math.sqrt(2), 2*math.sqrt(2), -4*math.sqrt(2), 2*math.sqrt(2), -4*math.sqrt(2), -5*math.sqrt(2), -6*math.sqrt(2), 2*math.sqrt(2), -5*math.sqrt(2), -6*math.sqrt(2), -7*math.sqrt(2), 2*math.sqrt(2), -5*math.sqrt(2), -6*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.9 x+4.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$4.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(4.9*x+4.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 e, 6, 2, -1, \\frac{12}{\\pi }, \\frac{1}{5}, -1, \\sqrt{3}, -5, \\frac{16}{\\sqrt{3}}, \\pi, 3 \\pi, 4, -\\frac{24}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{24}{\\pi }+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.e, 6, 2, -1, (12/math.pi), (1/5), -1, math.sqrt(3), -5, (16/(math.sqrt(3))), math.pi, 3*math.pi, 4, -(24/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{1}{\\sqrt{3}}, -\\frac{28}{\\pi }, 8, 1, 3, -5, \\frac{5}{\\sqrt{3}}, 3 \\sqrt{5}, \\frac{2}{\\sqrt{3}}, \\frac{11}{2}, -\\frac{8}{\\sqrt{5}}, -5, -5}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (1/(math.sqrt(3))), -(28/math.pi), 8, 1, 3, -5, (5/(math.sqrt(3))), 3*math.sqrt(5), (2/(math.sqrt(3))), (11/2), -(8/(math.sqrt(5))), -5, -5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{4}{7}, -\\frac{3}{7}, \\frac{16}{7}, \\frac{66}{7}, -\\frac{66}{7}, -\\frac{31}{7}, \\frac{47}{7}}$.\n", - "Output Answer": [ - "$\\frac{25}{49}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(4/7), -(3/7), (16/7), (66/7), -(66/7), -(31/7), (47/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.207,0.109,0.132\\}$ and $\\{0.352,0.113,0.312\\}$.", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.207, 0.109, 0.132\ndistribution2 = 0.352, 0.113, 0.312\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${10, -7, -15, 5, -3}$.\n", - "Output Answer": [ - "$97$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -7, -15, 5, -3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{7}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, -4 \\sqrt{2}, 4 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{3}{5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(7/(math.sqrt(2))), (13/(math.sqrt(2))), -4*math.sqrt(2), 4*math.sqrt(2), -(3/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{29}{5}, 7.02, 3}$.\n", - "Output Answer": [ - "${-\\frac{29}{5}, 3, 7.02}$" - ], - "Output Program": [ - "values = -(29/5), 7.02, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6 \\log (2), \\frac{16}{\\sqrt{\\pi }}, 0, \\frac{13}{\\sqrt{5}}, \\frac{12}{e}, -8, -\\frac{19}{2}, 4, 5, -\\frac{1}{3}, 12 \\log (2), 0, 4, -4, -\\frac{13}{\\pi }}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6*math.log(2), (16/(math.sqrt(math.pi))), 0, (13/(math.sqrt(5))), (12/math.e), -8, -(19/2), 4, 5, -(1/3), 12*math.log(2), 0, 4, -4, -(13/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 4096, 729, -216, 5}$.\n", - "Output Answer": [ - "$24 \\sqrt[5]{-5} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 4096, 729, -216, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, -7, -6, 7, 6, 7, 2, 9}$.\n", - "Output Answer": [ - "$\\frac{27}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, -7, -6, 7, 6, 7, 2, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, 9, 3, 7, 8}$.\n", - "Output Answer": [ - "$\\frac{23}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, 9, 3, 7, 8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, -11, 6}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{247}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -11, 6\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x^2+1.5 x+2.6$ where $x \\sim $ \\text{BetaDistribution}[0.2,0.3]\n", - "Output Answer": [ - "$2.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.2, 0.3)\nprint(E(-2.7*x**2+1.5*x+2.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, -8, -1, 4, \\frac{6}{\\sqrt{5}}, 7, -4 \\sqrt{2}, -\\frac{2}{\\sqrt{5}}, -6, \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -8, -1, 4, (6/(math.sqrt(5))), 7, -4*math.sqrt(2), -(2/(math.sqrt(5))), -6, math.sqrt(5), 2*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -6, 2 \\pi, -6.579, 4, -14 \\log (2), -1, 2 \\sqrt{5}} \\cup {4 \\sqrt{5}, 2 \\log (2), 2 \\pi, 0, 1, -6, 4, -0.721, -1}$.\n", - "Output Answer": [ - "${-14 \\log (2), -6.579, -6, -5, -1, -0.721, 0, 1, 2 \\log (2), 4, 2 \\sqrt{5}, 2 \\pi, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -6, 2*math.pi, -6.579, 4, -14*math.log(2), -1, 2*math.sqrt(5),))\nsnd = set((4*math.sqrt(5), 2*math.log(2), 2*math.pi, 0, 1, -6, 4, -0.721, -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{5}, 2 \\sqrt{5}, 4 \\sqrt{5}, 0, 0, 3 \\sqrt{5}, -2 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{5 \\sqrt{5}}{8}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(5), 2*math.sqrt(5), 4*math.sqrt(5), 0, 0, 3*math.sqrt(5), -2*math.sqrt(5), 2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8, -\\frac{19}{2}, 4, 0, -\\frac{42}{5}, -5} \\cup {9, -10, 8, 0, -4, -\\frac{19}{2}}$.\n", - "Output Answer": [ - "${-10, -\\frac{19}{2}, -\\frac{42}{5}, -5, -4, 0, 4, 8, 9}$" - ], - "Output Program": [ - "fst = set((8, -(19/2), 4, 0, -(42/5), -5,))\nsnd = set((9, -10, 8, 0, -4, -(19/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, 2, 9 \\log (2), 4, 8, -4} \\setminus {-\\frac{14}{3}, \\sqrt{3}, -\\frac{16}{\\sqrt{\\pi }}, 4, 9 \\log (2), 9, -2, -4}$.\n", - "Output Answer": [ - "${2, 3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 2, 9*math.log(2), 4, 8, -4,))\nsnd = set((-(14/3), math.sqrt(3), -(16/(math.sqrt(math.pi))), 4, 9*math.log(2), 9, -2, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{19}{\\pi }, -4, -\\frac{11}{2}, -3.26} \\cup {-\\frac{11}{2}, -4, -3.26, 0}$.\n", - "Output Answer": [ - "${-\\frac{19}{\\pi }, -\\frac{11}{2}, -4, -3.26, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(19/math.pi), -4, -(11/2), -3.26,))\nsnd = set((-(11/2), -4, -3.26, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${e, -5, -\\frac{31}{4}, -2, 2 \\sqrt{2}} \\cup {e, 2 \\sqrt{2}, -8, -2, \\frac{13}{2}}$.\n", - "Output Answer": [ - "${-8, -\\frac{31}{4}, -5, -2, e, 2 \\sqrt{2}, \\frac{13}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.e, -5, -(31/4), -2, 2*math.sqrt(2),))\nsnd = set((math.e, 2*math.sqrt(2), -8, -2, (13/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -6, 7, -4, 4, 7, 4, 7, 4, -6, 7, 7, -4, 9, -4, -6, 4, 9, 9, 9, 4, -6, 7, 4, 4, -6, -4, -6, 9}$.\n", - "Output Answer": [ - "$\\{-6,4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -6, 7, -4, 4, 7, 4, 7, 4, -6, 7, 7, -4, 9, -4, -6, 4, 9, 9, 9, 4, -6, 7, 4, 4, -6, -4, -6, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, -11, -10, 11, 7, -3}$.\n", - "Output Answer": [ - "$\\frac{538}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -11, -10, 11, 7, -3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 3 \\pi, -2, 6} \\setminus {3 \\pi, \\frac{12}{\\sqrt{\\pi }}, 6, 1, -3, 10 \\log (2), -2}$.\n", - "Output Answer": [ - "${}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 3*math.pi, -2, 6,))\nsnd = set((3*math.pi, (12/(math.sqrt(math.pi))), 6, 1, -3, 10*math.log(2), -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{2}, \\frac{19}{\\pi }, -1}$.", - "Output Answer": [ - "$3 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(2), (19/math.pi), -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 1, -8.9, -7 \\log (2), -2, -\\frac{7}{e}, -5, 7, 8} \\setminus {-8.9, -\\frac{19}{2}, -\\frac{7}{e}, 1, -7 \\log (2), 8, -1, 0}$.\n", - "Output Answer": [ - "${-5, -2, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 1, -8.9, -7*math.log(2), -2, -(7/math.e), -5, 7, 8,))\nsnd = set((-8.9, -(19/2), -(7/math.e), 1, -7*math.log(2), 8, -1, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.169,0.043,0.063,0.115,0.033,0.02,0.336\\}$ and $\\{0.412,0.073,0.012,0.021,0.036,0.05,0.073,0.219\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.169, 0.043, 0.063, 0.115, 0.033, 0.02, 0.336\ndistribution2 = 0.412, 0.073, 0.012, 0.021, 0.036, 0.05, 0.073, 0.219\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 10, 1, -8, 1, -8, 1, -8, 10, 1, -8, 10, 1, 1, -5, -5, -8, -5, -8, -5}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 10, 1, -8, 1, -8, 1, -8, 10, 1, -8, 10, 1, 1, -5, -5, -8, -5, -8, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7 \\sqrt{2}, 4 \\sqrt{2}, -7 \\sqrt{2}, -4 \\sqrt{2}, 0, \\sqrt{2}, \\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{7}{4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 7*math.sqrt(2), 4*math.sqrt(2), -7*math.sqrt(2), -4*math.sqrt(2), 0, math.sqrt(2), math.sqrt(2), 5*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3, 2 \\pi, 6, 5} \\cup {2 \\pi, 5, 6, 3}$.\n", - "Output Answer": [ - "${3, 5, 6, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 2*math.pi, 6, 5,))\nsnd = set((2*math.pi, 5, 6, 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{3}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, 0, \\frac{16}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, 2 \\sqrt{5}, 0, \\frac{3}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, 0}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{2}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (3/(math.sqrt(5))), -(2/(math.sqrt(5))), (19/(math.sqrt(5))), -(2/(math.sqrt(5))), (14/(math.sqrt(5))), -(9/(math.sqrt(5))), -(2/(math.sqrt(5))), (14/(math.sqrt(5))), (16/(math.sqrt(5))), 0, (16/(math.sqrt(5))), (14/(math.sqrt(5))), (19/(math.sqrt(5))), -(2/(math.sqrt(5))), 2*math.sqrt(5), 0, (3/(math.sqrt(5))), -(2/(math.sqrt(5))), (14/(math.sqrt(5))), -(2/(math.sqrt(5))), 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 6, -6, -7, 1, -6, -6, -6, -7, -7, 1, -7, -6, -7, -9, -6, -7, -6, -7, 6, -9, -6, -7, -6}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 6, -6, -7, 1, -6, -6, -6, -7, -7, 1, -7, -6, -7, -9, -6, -7, -6, -7, 6, -9, -6, -7, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.203,0.055,0.061,0.476,0.027,0.07,0.025,0.003,0.074\\}$ and $\\{0.073,0.003,0.065,0.317,0.004,0.023,0.396,0.059,0.06\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.203, 0.055, 0.061, 0.476, 0.027, 0.07, 0.025, 0.003, 0.074\ndistribution2 = 0.073, 0.003, 0.065, 0.317, 0.004, 0.023, 0.396, 0.059, 0.06\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 17, \\frac{40}{3}}$.\n", - "Output Answer": [ - "$\\frac{408}{25}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 17, (40/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x^3-4.3 x^2-0.2 x+0.8$ where $x \\sim $ \\text{BetaDistribution}[0.8,0.7]\n", - "Output Answer": [ - "$-0.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 0.7)\nprint(E(2.*x**3-4.3*x**2-0.2*x+0.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, \\frac{17}{\\sqrt{3}}, -\\frac{2}{3}, -3, \\pi, 5, 3, -6, -\\frac{37}{5}}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, (17/(math.sqrt(3))), -(2/3), -3, math.pi, 5, 3, -6, -(37/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, \\frac{11}{\\pi }}$.\n", - "Output Answer": [ - "$9+\\frac{11}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -9, (11/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5 \\log (2), 14 \\log (2), 4 \\log (2), -5 \\log (2), -6 \\log (2), 14 \\log (2), 5 \\log (2), 5 \\log (2), 4 \\log (2), 4 \\log (2), 4 \\log (2), -13 \\log (2), 5 \\log (2), -5 \\log (2), 5 \\log (2), 5 \\log (2), -9 \\log (2), -9 \\log (2), -5 \\log (2), -5 \\log (2), 14 \\log (2), -13 \\log (2), 5 \\log (2), 4 \\log (2), 4 \\log (2), 5 \\log (2), -6 \\log (2), -5 \\log (2), 4 \\log (2), -9 \\log (2)}$.\n", - "Output Answer": [ - "$\\{5 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 5*math.log(2), 14*math.log(2), 4*math.log(2), -5*math.log(2), -6*math.log(2), 14*math.log(2), 5*math.log(2), 5*math.log(2), 4*math.log(2), 4*math.log(2), 4*math.log(2), -13*math.log(2), 5*math.log(2), -5*math.log(2), 5*math.log(2), 5*math.log(2), -9*math.log(2), -9*math.log(2), -5*math.log(2), -5*math.log(2), 14*math.log(2), -13*math.log(2), 5*math.log(2), 4*math.log(2), 4*math.log(2), 5*math.log(2), -6*math.log(2), -5*math.log(2), 4*math.log(2), -9*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.071,0.171,0.301,0.047,0.193\\}$ and $\\{0.129,0.122,0.033,0.06,0.484\\}$.", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.071, 0.171, 0.301, 0.047, 0.193\ndistribution2 = 0.129, 0.122, 0.033, 0.06, 0.484\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6 \\sqrt{3}, \\sqrt{3}, -2 \\sqrt{3}, 0, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{8 \\sqrt{3}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -6*math.sqrt(3), math.sqrt(3), -2*math.sqrt(3), 0, -math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 125, 1, 10000, 4}$.\n", - "Output Answer": [ - "$10 \\sqrt[5]{2} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 125, 1, 10000, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.5 x^2-4.8 x-0.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.5]\n", - "Output Answer": [ - "$-2.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.5)\nprint(E(-2.5*x**2-4.8*x-0.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, 7, \\sqrt{5}, -\\frac{10}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{10}{\\sqrt{3}}, -1, \\sqrt{5}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 7, math.sqrt(5), -(10/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-12 \\log (2), 8 \\log (2), 8 \\log (2), 2 \\log (2), 9 \\log (2), -5 \\log (2), 14 \\log (2), -13 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{11 \\log (2)}{8}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -12*math.log(2), 8*math.log(2), 8*math.log(2), 2*math.log(2), 9*math.log(2), -5*math.log(2), 14*math.log(2), -13*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5 \\sqrt{2}, -9.4}$.\n", - "Output Answer": [ - "${-9.4, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(2), -9.4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, -8, -6}$.\n", - "Output Answer": [ - "${-8, -6, -4}$" - ], - "Output Program": [ - "values = -4, -8, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -9, -2, -\\frac{4}{3}, -\\frac{11}{2}, -3}$.", - "Output Answer": [ - "$-\\frac{5}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -9, -2, -(4/3), -(11/2), -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8, 4, \\frac{48}{5}, 3 \\sqrt{2}, -\\frac{17}{5}} \\cup {8, 4, 7, \\frac{48}{5}, 3 \\sqrt{2}, \\frac{38}{5}}$.\n", - "Output Answer": [ - "${-\\frac{17}{5}, 4, 3 \\sqrt{2}, 7, \\frac{38}{5}, 8, \\frac{48}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 4, (48/5), 3*math.sqrt(2), -(17/5),))\nsnd = set((8, 4, 7, (48/5), 3*math.sqrt(2), (38/5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, 2, 4, 14}$.\n", - "Output Answer": [ - "$\\frac{88}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 2, 4, 14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{51}{7}, -9, 6, \\frac{3}{e}, 8, -1, 3, -\\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-9, -\\frac{5}{\\sqrt{2}}, -1, \\frac{3}{e}, 3, 6, \\frac{51}{7}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = (51/7), -9, 6, (3/math.e), 8, -1, 3, -(5/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.166,0.069,0.334,0.213,0.057,0.039,0.03,0.063\\}$ and $\\{0.108,0.162,0.146,0.015,0.116,0.045,0.143,0.203\\}$.", - "Output Answer": [ - "$0.67$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.166, 0.069, 0.334, 0.213, 0.057, 0.039, 0.03, 0.063\ndistribution2 = 0.108, 0.162, 0.146, 0.015, 0.116, 0.045, 0.143, 0.203\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, -16807, 6561, -729, 27, 100}$.\n", - "Output Answer": [ - "$9\\ 2^{2/3} \\sqrt[3]{5} 21^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -16807, 6561, -729, 27, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{31}{4}, 6 \\sqrt{2}, 2, -2 \\sqrt{2}, 1, 10, \\frac{16}{e}, \\sqrt{5}, -\\frac{4}{5}, 7, 8, \\frac{4}{\\sqrt{5}}, 2, -\\frac{19}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$10+\\frac{19}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(31/4), 6*math.sqrt(2), 2, -2*math.sqrt(2), 1, 10, (16/math.e), math.sqrt(5), -(4/5), 7, 8, (4/(math.sqrt(5))), 2, -(19/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{66}{7}, -10}$.", - "Output Answer": [ - "$-\\frac{68}{7}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -(66/7), -10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -5, -4}$.\n", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "values = -4, -5, -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${59049, 36, 16, -3, -5}$.\n", - "Output Answer": [ - "$18\\ 3^{3/5} \\sqrt[5]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 59049, 36, 16, -3, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, 6, -6}$.\n", - "Output Answer": [ - "${-6, 3, 6}$" - ], - "Output Program": [ - "values = 3, 6, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, -6, 9}$.\n", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, -6, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -1, 0, -6}$.\n", - "Output Answer": [ - "$-\\frac{7}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -1, 0, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 81, 6561, 16, 16, 100}$.\n", - "Output Answer": [ - "$54\\ 2^{2/3} \\sqrt[3]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 81, 6561, 16, 16, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -7, 5, 7, 7, 7, 10, 2, 7, 2, -7, -7, 7, 5, 3, 2, 5, 2, 5, 2, 5, 3, 3, 7, 7, 3, 5, 5, 5, 10}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -7, 5, 7, 7, 7, 10, 2, 7, 2, -7, -7, 7, 5, 3, 2, 5, 2, 5, 2, 5, 3, 3, 7, 7, 3, 5, 5, 5, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{33}{2}, \\frac{13}{2}, \\frac{33}{2}}$.\n", - "Output Answer": [ - "$\\frac{1287}{118}$" - ], - "Output Program": [ - "import statistics\nvalues = (33/2), (13/2), (33/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -8, 1, 4, -7, -1}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -8, 1, 4, -7, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${3125, 256, 16807, 2401, 216, 2401}$.\n", - "Output Answer": [ - "$98 \\sqrt{3} \\sqrt[6]{7} 10^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 3125, 256, 16807, 2401, 216, 2401\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-10, \\frac{35}{4}, -4, 5, -\\frac{17}{\\sqrt{\\pi }}, -1} \\setminus {-6, -7, -1, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-10, -\\frac{17}{\\sqrt{\\pi }}, -4, 5, \\frac{35}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, (35/4), -4, 5, -(17/(math.sqrt(math.pi))), -1,))\nsnd = set((-6, -7, -1, -3*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{22}{3}, -\\frac{21}{\\sqrt{5}}, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{21}{\\sqrt{5}}, -\\frac{22}{3}, 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -(22/3), -(21/(math.sqrt(5))), 10*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, -\\frac{2}{e}, -e, 6, -2 \\sqrt{3}, -4, \\frac{4}{e}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$10$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -(2/math.e), -math.e, 6, -2*math.sqrt(3), -4, (4/math.e), -2*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\pi, -7, 6.7, \\frac{24}{\\pi }, 4} \\setminus {4, -7, \\frac{30}{\\pi }, 6.7, -3, \\frac{55}{7}}$.\n", - "Output Answer": [ - "${-\\pi, \\frac{24}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, -7, 6.7, (24/math.pi), 4,))\nsnd = set((4, -7, (30/math.pi), 6.7, -3, (55/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.272,0.043,0.235,0.114,0.084,0.006,0.021,0.013,0.045\\}$ and $\\{0.071,0.104,0.144,0.063,0.103,0.04,0.188,0.14,0.08\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.272, 0.043, 0.235, 0.114, 0.084, 0.006, 0.021, 0.013, 0.045\ndistribution2 = 0.071, 0.104, 0.144, 0.063, 0.103, 0.04, 0.188, 0.14, 0.08\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${10, 3 \\sqrt{2}, 6, 0} \\cup {0, 3, -7, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, 0, 3, 3 \\sqrt{2}, 6, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 3*math.sqrt(2), 6, 0,))\nsnd = set((0, 3, -7, 3*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.043,0.259,0.123,0.021,0.398\\}$ and $\\{0.037,0.148,0.072,0.239,0.247\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.043, 0.259, 0.123, 0.021, 0.398\ndistribution2 = 0.037, 0.148, 0.072, 0.239, 0.247\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\sqrt{3}, -2 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, -3 \\sqrt{3}, -3 \\sqrt{3}, -5 \\sqrt{3}, -3 \\sqrt{3}, -2 \\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, 3 \\sqrt{3}, -5 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -3 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -3 \\sqrt{3}, -2 \\sqrt{3}, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.sqrt(3), -2*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), -3*math.sqrt(3), -3*math.sqrt(3), -5*math.sqrt(3), -3*math.sqrt(3), -2*math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), 3*math.sqrt(3), -5*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -3*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -3*math.sqrt(3), -2*math.sqrt(3), -3*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, 3 \\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(9+3 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 3*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{3}{5}, -7, 0, \\frac{1}{4}, -2 \\pi, -8, 9, -10, -\\frac{25}{4}, -3 \\sqrt{5}, \\frac{15}{2}, -\\frac{7}{\\sqrt{5}}, -8}$.", - "Output Answer": [ - "$-\\frac{25}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (3/5), -7, 0, (1/4), -2*math.pi, -8, 9, -10, -(25/4), -3*math.sqrt(5), (15/2), -(7/(math.sqrt(5))), -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1. x-0.3$ where $x \\sim $ \\text{BetaDistribution}[1.1,0.7]\n", - "Output Answer": [ - "$-0.91$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.1, 0.7)\nprint(E(-1.*x-0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{3}, \\frac{14}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$-\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(3), (14/(math.sqrt(3))), -(16/(math.sqrt(3))), (2/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 0, -3 \\pi, -9, 0}$.\n", - "Output Answer": [ - "$3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 0, -3*math.pi, -9, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{15}{2}, \\frac{15}{2}, -10, 5, -10, 5, \\frac{15}{2}, -10, -\\frac{9}{2}, 5, \\frac{15}{2}, -1, -10, 5, 5, -\\frac{9}{2}, -10, \\frac{15}{2}, -10, -\\frac{9}{2}, -10, -1, -10, 5, 5, -\\frac{9}{2}, \\frac{15}{2}, -1, -10}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (15/2), (15/2), -10, 5, -10, 5, (15/2), -10, -(9/2), 5, (15/2), -1, -10, 5, 5, -(9/2), -10, (15/2), -10, -(9/2), -10, -1, -10, 5, 5, -(9/2), (15/2), -1, -10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.36,0.099,0.146,0.129,0.163\\}$ and $\\{0.189,0.023,0.013,0.359,0.365\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.36, 0.099, 0.146, 0.129, 0.163\ndistribution2 = 0.189, 0.023, 0.013, 0.359, 0.365\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, -9, -\\frac{10}{\\sqrt{\\pi }}, -1, -3 e, 2}$.\n", - "Output Answer": [ - "${-9, -3 e, -\\frac{10}{\\sqrt{\\pi }}, -1, 2, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -9, -(10/(math.sqrt(math.pi))), -1, -3*math.e, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 7, 6, 4, -4, -4, 4, 4, 7, -4, 7, -4, 9, 4, 4, 4, 7, 4, 4, 4, 4, 6, 7, 4, 7, 4}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 7, 6, 4, -4, -4, 4, 4, 7, -4, 7, -4, 9, 4, 4, 4, 7, 4, 4, 4, 4, 6, 7, 4, 7, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, -7.226, -9, -8, -\\frac{6}{e}, 3, -2.445, -\\frac{20}{\\pi }, -4} \\setminus {-2.445, -\\frac{6}{e}, -4.384, -\\frac{20}{\\pi }, -5, 0.434}$.\n", - "Output Answer": [ - "${-9, -8, -7.226, -4, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -7.226, -9, -8, -(6/math.e), 3, -2.445, -(20/math.pi), -4,))\nsnd = set((-2.445, -(6/math.e), -4.384, -(20/math.pi), -5, 0.434,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -14, -11, -5, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1473}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -14, -11, -5, 14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{4}{3}, -\\frac{19}{e}, -\\frac{11}{7}}$.", - "Output Answer": [ - "$-\\frac{11}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (4/3), -(19/math.e), -(11/7)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8.451, -4 \\sqrt{2}, -\\frac{11}{2}, -2} \\setminus {1, -4.277, -\\frac{11}{2}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -2, 8.451}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.451, -4*math.sqrt(2), -(11/2), -2,))\nsnd = set((1, -4.277, -(11/2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8.52, -\\frac{17}{\\sqrt{3}}, \\frac{3}{e}, \\frac{22}{\\sqrt{5}}, -6, -\\frac{9}{\\sqrt{5}}, 2, -7}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{3}}, -8.52, -7, -6, -\\frac{9}{\\sqrt{5}}, \\frac{3}{e}, 2, \\frac{22}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8.52, -(17/(math.sqrt(3))), (3/math.e), (22/(math.sqrt(5))), -6, -(9/(math.sqrt(5))), 2, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\frac{8}{\\sqrt{3}}, -2 \\sqrt{5}} \\setminus {-2 \\sqrt{5}, 0, \\frac{1}{\\sqrt{3}}, -\\frac{4}{\\sqrt{5}}, 0.032, -5}$.\n", - "Output Answer": [ - "${\\frac{8}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (8/(math.sqrt(3))), -2*math.sqrt(5),))\nsnd = set((-2*math.sqrt(5), 0, (1/(math.sqrt(3))), -(4/(math.sqrt(5))), 0.032, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{11}{2}, -9.46, -4 \\sqrt{3}, 0, -1} \\setminus {\\frac{5}{e}, -1, 9, \\frac{5}{\\sqrt{3}}, 0, \\frac{16}{\\sqrt{3}}, 6}$.\n", - "Output Answer": [ - "${-9.46, -4 \\sqrt{3}, -\\frac{11}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(11/2), -9.46, -4*math.sqrt(3), 0, -1,))\nsnd = set(((5/math.e), -1, 9, (5/(math.sqrt(3))), 0, (16/(math.sqrt(3))), 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{29}{3}, \\frac{8}{3}, \\frac{50}{3}, \\frac{41}{3}}$.\n", - "Output Answer": [ - "$\\frac{951200}{145443}$" - ], - "Output Program": [ - "import statistics\nvalues = (29/3), (8/3), (50/3), (41/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.168,0.055,0.208,0.143,0.095,0.134\\}$ and $\\{0.126,0.155,0.156,0.206,0.022,0.048,0.125\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.168, 0.055, 0.208, 0.143, 0.095, 0.134\ndistribution2 = 0.126, 0.155, 0.156, 0.206, 0.022, 0.048, 0.125\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -e, -3 \\sqrt{2}, -2} \\cup {-e, 3, -3 \\sqrt{2}, -2}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, -e, -2, 3, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -math.e, -3*math.sqrt(2), -2,))\nsnd = set((-math.e, 3, -3*math.sqrt(2), -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.148,0.278,0.137,0.095,0.209\\}$ and $\\{0.188,0.156,0.191,0.294,0.056\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.148, 0.278, 0.137, 0.095, 0.209\ndistribution2 = 0.188, 0.156, 0.191, 0.294, 0.056\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x+3.4$ where $x \\sim $ \\text{PoissonDistribution}[0.8]\n", - "Output Answer": [ - "$5.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.8)\nprint(E(2.9*x+3.4))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{18}{e}, 2 \\log (2), \\frac{12}{\\pi }, \\frac{16}{\\sqrt{3}}} \\cup {\\frac{12}{\\pi }, -10 \\log (2), -\\frac{18}{e}, \\frac{16}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-10 \\log (2), -\\frac{18}{e}, 2 \\log (2), \\frac{12}{\\pi }, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(18/math.e), 2*math.log(2), (12/math.pi), (16/(math.sqrt(3))),))\nsnd = set(((12/math.pi), -10*math.log(2), -(18/math.e), (16/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.043,0.014,0.23,0.164,0.126,0.059,0.264,0.039\\}$ and $\\{0.341,0.043,0.061,0.049,0.015,0.062,0.176,0.163\\}$.", - "Output Answer": [ - "$0.73$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.043, 0.014, 0.23, 0.164, 0.126, 0.059, 0.264, 0.039\ndistribution2 = 0.341, 0.043, 0.061, 0.049, 0.015, 0.062, 0.176, 0.163\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x-0.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$-0.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(1.9*x-0.7))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2, 5, -8, -9, 9, 7, 8} \\cap {9, 5, 7, -9, -3, 6, -8}$.\n", - "Output Answer": [ - "${-9, -8, 5, 7, 9}$" - ], - "Output Program": [ - "fst = set((-2, 5, -8, -9, 9, 7, 8,))\nsnd = set((9, 5, 7, -9, -3, 6, -8,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.697,0.088,0.051,0.032,0.051\\}$ and $\\{0.304,0.116,0.171,0.182,0.059\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.697, 0.088, 0.051, 0.032, 0.051\ndistribution2 = 0.304, 0.116, 0.171, 0.182, 0.059\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 12, 12, 10}$.\n", - "Output Answer": [ - "$\\frac{120}{11}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 12, 12, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{33}{5}, 1, 7, -\\frac{23}{3}, -6, -2 \\sqrt{5}, -\\sqrt{5}, \\frac{9}{5}}$.\n", - "Output Answer": [ - "${-\\frac{23}{3}, -\\frac{33}{5}, -6, -2 \\sqrt{5}, -\\sqrt{5}, 1, \\frac{9}{5}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(33/5), 1, 7, -(23/3), -6, -2*math.sqrt(5), -math.sqrt(5), (9/5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{9}{5}, -\\frac{52}{7}}$.\n", - "Output Answer": [ - "$\\frac{197}{35}$" - ], - "Output Program": [ - "values = -(9/5), -(52/7)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.217,0.199,0.3,0.05,0.046,0.017,0.033,0.108\\}$ and $\\{0.057,0.04,0.259,0.077,0.175,0.138,0.029,0.086\\}$.", - "Output Answer": [ - "$0.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.217, 0.199, 0.3, 0.05, 0.046, 0.017, 0.033, 0.108\ndistribution2 = 0.057, 0.04, 0.259, 0.077, 0.175, 0.138, 0.029, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 216, 6561, 1, -1, 100}$.\n", - "Output Answer": [ - "$9 \\sqrt[6]{-1} 2^{5/6} \\sqrt{3} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 216, 6561, 1, -1, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, 3 e, -2, -4, -\\frac{4}{\\sqrt{3}}, 0, -9, 0, 8, 10, \\frac{7}{e}, -4 \\sqrt{2}, 2}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, 3*math.e, -2, -4, -(4/(math.sqrt(3))), 0, -9, 0, 8, 10, (7/math.e), -4*math.sqrt(2), 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -9, 1, -6, 1, 6, -4, 4, -4, 4, 6, 6, 4, 1, -6, -9, -9, 4, 4, 4}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -9, 1, -6, 1, 6, -4, 4, -4, 4, 6, 6, 4, 1, -6, -9, -9, 4, 4, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.076,0.204,0.14,0.077,0.371\\}$ and $\\{0.044,0.15,0.376,0.15,0.082\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.076, 0.204, 0.14, 0.077, 0.371\ndistribution2 = 0.044, 0.15, 0.376, 0.15, 0.082\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.074,0.228,0.051,0.029,0.331,0.003\\}$ and $\\{0.136,0.157,0.08,0.132,0.051,0.167\\}$.", - "Output Answer": [ - "$0.82$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.074, 0.228, 0.051, 0.029, 0.331, 0.003\ndistribution2 = 0.136, 0.157, 0.08, 0.132, 0.051, 0.167\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, 49, 256, 216, 64, 15625}$.\n", - "Output Answer": [ - "$60\\ 2^{5/6} \\sqrt{3} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, 49, 256, 216, 64, 15625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.109,0.034,0.108,0.072,0.019,0.124,0.053,0.158,0.158\\}$ and $\\{0.145,0.07,0.051,0.408,0.022,0.117,0.058,0.017,0.1\\}$.", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.109, 0.034, 0.108, 0.072, 0.019, 0.124, 0.053, 0.158, 0.158\ndistribution2 = 0.145, 0.07, 0.051, 0.408, 0.022, 0.117, 0.058, 0.017, 0.1\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -1, -10, 6, 6, -1, 6, 6, -9, 6, 7, 2, 2, 7, -10, 6, 6, -9, 7, -9, -9, 2, 6, 6, -10}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -1, -10, 6, 6, -1, 6, 6, -9, 6, 7, 2, 2, 7, -10, 6, 6, -9, 7, -9, -9, 2, 6, 6, -10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, 3, -2 \\sqrt{2}, 3, 2, 2, -\\frac{23}{e}, -5.137}$.\n", - "Output Answer": [ - "${-\\frac{23}{e}, -5.137, -2 \\sqrt{2}, 0, 2, 2, 3, 3}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 3, -2*math.sqrt(2), 3, 2, 2, -(23/math.e), -5.137\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2, 6, 9, -6.9}$.\n", - "Output Answer": [ - "${-6.9, 2, 6, 9}$" - ], - "Output Program": [ - "values = 2, 6, 9, -6.9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{11}{\\sqrt{5}}, -\\frac{18}{7}, -\\frac{5}{4}, -4, \\frac{3}{e}, -7, 6, -\\frac{27}{\\pi }, \\frac{6}{\\sqrt{5}}, 1, 14 \\log (2), -5, -2 \\sqrt{5}, -4, 0}$.", - "Output Answer": [ - "$-\\frac{5}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (11/(math.sqrt(5))), -(18/7), -(5/4), -4, (3/math.e), -7, 6, -(27/math.pi), (6/(math.sqrt(5))), 1, 14*math.log(2), -5, -2*math.sqrt(5), -4, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${14, 0, 0, 15}$.\n", - "Output Answer": [ - "$\\frac{281}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 0, 0, 15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 7}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\log (2), -4, -3, -5} \\setminus {\\log (2), -4, -5, -\\frac{13}{e}, -6 \\sqrt{3}, 0}$.\n", - "Output Answer": [ - "${-3}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.log(2), -4, -3, -5,))\nsnd = set((math.log(2), -4, -5, -(13/math.e), -6*math.sqrt(3), 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${8, -3, -2.277, -\\frac{59}{7}} \\setminus {6, -\\frac{59}{7}, 8, 0}$.\n", - "Output Answer": [ - "${-3, -2.277}$" - ], - "Output Program": [ - "fst = set((8, -3, -2.277, -(59/7),))\nsnd = set((6, -(59/7), 8, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\log (2), 0, 7 \\sqrt{2}, -5 \\sqrt{2}, \\frac{17}{2}, 9, \\frac{8}{e}, 2, 3}$.\n", - "Output Answer": [ - "$12 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.log(2), 0, 7*math.sqrt(2), -5*math.sqrt(2), (17/2), 9, (8/math.e), 2, 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000000, 1000000, 1296, 25, 5, 59049}$.\n", - "Output Answer": [ - "$900\\ 2^{2/3} \\sqrt[3]{3} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000000, 1000000, 1296, 25, 5, 59049\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2, -e, \\frac{5}{3}, e, -0.28, 3}$.\n", - "Output Answer": [ - "${-e, -0.28, \\frac{5}{3}, 2, e, 3}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -math.e, (5/3), math.e, -0.28, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -\\frac{16}{3}, -\\frac{10}{3}, -\\frac{16}{3}, \\frac{26}{3}, -\\frac{4}{3}, -\\frac{4}{3}, -\\frac{16}{3}, 4, -\\frac{4}{3}, -\\frac{4}{3}, -\\frac{10}{3}, 4, -\\frac{10}{3}, 4, -\\frac{4}{3}, 1, 1, -\\frac{10}{3}, \\frac{26}{3}, \\frac{26}{3}, 1, 4, -\\frac{4}{3}, -\\frac{16}{3}, -\\frac{16}{3}, \\frac{26}{3}, 1, -\\frac{4}{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{4}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -(16/3), -(10/3), -(16/3), (26/3), -(4/3), -(4/3), -(16/3), 4, -(4/3), -(4/3), -(10/3), 4, -(10/3), 4, -(4/3), 1, 1, -(10/3), (26/3), (26/3), 1, 4, -(4/3), -(16/3), -(16/3), (26/3), 1, -(4/3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 6, -8}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 6, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -6, 0, -5} \\setminus {-3, 5, 0}$.\n", - "Output Answer": [ - "${-7, -6, -5}$" - ], - "Output Program": [ - "fst = set((-7, -6, 0, -5,))\nsnd = set((-3, 5, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 7, -9, -5, 2, -8} \\setminus {-8, \\frac{16}{\\pi }, 4, \\frac{3}{7}, 2, -5, 3.6}$.\n", - "Output Answer": [ - "${-9, -7, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 7, -9, -5, 2, -8,))\nsnd = set((-8, (16/math.pi), 4, (3/7), 2, -5, 3.6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -2, 5}$.\n", - "Output Answer": [ - "$\\frac{8}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -2, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{27}{7}, -\\frac{3}{\\sqrt{\\pi }}, -8}$.\n", - "Output Answer": [ - "${-8, -\\frac{3}{\\sqrt{\\pi }}, \\frac{27}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = (27/7), -(3/(math.sqrt(math.pi))), -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, 0, -6, -9, -8, -8, -9, -8, 4, -5, -9, -6, -9, 4, -6, -8, -6, 0, 0, 0, 0, -5, -6, -8, -9, -9, 4, 4, 4}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, 0, -6, -9, -8, -8, -9, -8, 4, -5, -9, -6, -9, 4, -6, -8, -6, 0, 0, 0, 0, -5, -6, -8, -9, -9, 4, 4, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, 3, -7 \\sqrt{2}, 2 \\sqrt{2}, -2}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -2, 2 \\sqrt{2}, 3, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 3, -7*math.sqrt(2), 2*math.sqrt(2), -2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{15}{e}, -3 \\pi, 1}$.\n", - "Output Answer": [ - "${-3 \\pi, 1, \\frac{15}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = (15/math.e), -3*math.pi, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -3 \\pi, 6.2, -5, 0.511, -\\frac{5}{\\sqrt{2}}} \\cup {-\\frac{5}{\\sqrt{2}}, -5, -6, 6.2, -3 \\pi, 3, -0.822}$.\n", - "Output Answer": [ - "${-3 \\pi, -6, -5, -\\frac{5}{\\sqrt{2}}, -0.822, 0.511, 3, 6.2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -3*math.pi, 6.2, -5, 0.511, -(5/(math.sqrt(2))),))\nsnd = set((-(5/(math.sqrt(2))), -5, -6, 6.2, -3*math.pi, 3, -0.822,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, -4, -7, 7, -14, -5}$.\n", - "Output Answer": [ - "$\\frac{1433}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -4, -7, 7, -14, -5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.5 x-3.7$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$-3.41$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(0.5*x-3.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, 2, 2}$.\n", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, 2, 2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.205,0.218,0.143,0.315\\}$ and $\\{0.031,0.115,0.43,0.018\\}$.", - "Output Answer": [ - "$1.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.205, 0.218, 0.143, 0.315\ndistribution2 = 0.031, 0.115, 0.43, 0.018\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.012,0.1,0.102,0.161,0.238,0.226,0.042\\}$ and $\\{0.09,0.079,0.146,0.245,0.104,0.054,0.149\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.012, 0.1, 0.102, 0.161, 0.238, 0.226, 0.042\ndistribution2 = 0.09, 0.079, 0.146, 0.245, 0.104, 0.054, 0.149\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{3}, \\frac{56}{3}, \\frac{20}{3}}$.\n", - "Output Answer": [ - "$\\frac{10360}{983}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/3), (56/3), (20/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, -1, -3, -\\frac{7}{4}, -6, 9}$.\n", - "Output Answer": [ - "${-6, -3, -\\frac{7}{4}, -1, 7, 9}$" - ], - "Output Program": [ - "values = 7, -1, -3, -(7/4), -6, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${11 \\log (2), -3 \\log (2), 12 \\log (2), -3 \\log (2), 7 \\log (2), 7 \\log (2), -13 \\log (2), 12 \\log (2), 7 \\log (2), 11 \\log (2), -3 \\log (2), 7 \\log (2), -13 \\log (2), -3 \\log (2), -3 \\log (2), 7 \\log (2), 7 \\log (2), 7 \\log (2), 11 \\log (2), 2 \\log (2), -3 \\log (2), -3 \\log (2), 2 \\log (2), -3 \\log (2), 2 \\log (2), -13 \\log (2), 5 \\log (2), -3 \\log (2), -13 \\log (2), 2 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-3 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 11*math.log(2), -3*math.log(2), 12*math.log(2), -3*math.log(2), 7*math.log(2), 7*math.log(2), -13*math.log(2), 12*math.log(2), 7*math.log(2), 11*math.log(2), -3*math.log(2), 7*math.log(2), -13*math.log(2), -3*math.log(2), -3*math.log(2), 7*math.log(2), 7*math.log(2), 7*math.log(2), 11*math.log(2), 2*math.log(2), -3*math.log(2), -3*math.log(2), 2*math.log(2), -3*math.log(2), 2*math.log(2), -13*math.log(2), 5*math.log(2), -3*math.log(2), -13*math.log(2), 2*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{9}{2}, 0, -\\frac{6}{e}, -1, 1, 5} \\setminus {3, 10, 4, -\\frac{9}{\\sqrt{\\pi }}, 0, -5 \\sqrt{2}, 3 e}$.\n", - "Output Answer": [ - "${-\\frac{6}{e}, -1, 1, \\frac{9}{2}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set(((9/2), 0, -(6/math.e), -1, 1, 5,))\nsnd = set((3, 10, 4, -(9/(math.sqrt(math.pi))), 0, -5*math.sqrt(2), 3*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-6 \\log (2), -9, -7, -\\frac{9}{2}, \\frac{3}{2}, -\\frac{6}{5}, -6} \\cup {-\\frac{6}{5}, 9, -5, -\\frac{27}{4}, \\frac{3}{2}, -2, 14 \\log (2)}$.\n", - "Output Answer": [ - "${-9, -7, -\\frac{27}{4}, -6, -5, -\\frac{9}{2}, -6 \\log (2), -2, -\\frac{6}{5}, \\frac{3}{2}, 9, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.log(2), -9, -7, -(9/2), (3/2), -(6/5), -6,))\nsnd = set((-(6/5), 9, -5, -(27/4), (3/2), -2, 14*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{\\sqrt{5}}, 0, \\frac{19}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, 0, \\frac{8}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, 0, 0, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, 0, \\frac{19}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{\\sqrt{5}},0\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(16/(math.sqrt(5))), 0, (19/(math.sqrt(5))), (8/(math.sqrt(5))), -(12/(math.sqrt(5))), (2/(math.sqrt(5))), 0, (8/(math.sqrt(5))), (2/(math.sqrt(5))), 0, 0, -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), 0, (19/(math.sqrt(5))), (8/(math.sqrt(5))), (19/(math.sqrt(5))), (8/(math.sqrt(5))), -(16/(math.sqrt(5))), (19/(math.sqrt(5))), (2/(math.sqrt(5))), -(16/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 1, 2, -1, -3, -4}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 1, 2, -1, -3, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x-0.4$ where $x \\sim $ \\text{NormalDistribution}[-0.9,2.2]\n", - "Output Answer": [ - "$-2.29$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.9, 2.2)\nprint(E(2.1*x-0.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 6, -5, 8, 2, 7, 7, 0}$.\n", - "Output Answer": [ - "$\\frac{19}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 6, -5, 8, 2, 7, 7, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.3 x-0.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$-0.29$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(0.3*x-0.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, -7, 2, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{110}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -7, 2, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -5, -6, -13}$.\n", - "Output Answer": [ - "$\\frac{41}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -5, -6, -13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{19}{2}, 10, \\frac{54}{7}, -6.867, -8, -\\frac{30}{\\pi }, 0}$.\n", - "Output Answer": [ - "${-\\frac{30}{\\pi }, -8, -6.867, 0, \\frac{54}{7}, \\frac{19}{2}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = (19/2), 10, (54/7), -6.867, -8, -(30/math.pi), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, -7, -8, 1, -6, -6, -6, -6, -6, -6, -7, -6, -8, -8, 1, 1, 1, 6, -8, -8, 6, -8}$.\n", - "Output Answer": [ - "$\\{-8,-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, -7, -8, 1, -6, -6, -6, -6, -6, -6, -7, -6, -8, -8, 1, 1, 1, 6, -8, -8, 6, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-125, 256, 243, 25, -1}$.\n", - "Output Answer": [ - "$30\\ 2^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -125, 256, 243, 25, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.37 < -3.4 x-0.2 < 4.39$ where $x \\sim $ \\text{NormalDistribution}[0.4,2.2].", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.4, 2.2)\nprint(P((0.37 < -3.4*x-0.2) & (-3.4*x-0.2 < 4.39)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 0, 2, -6, -2, 0, -9, 8, -5, 3 e, -5, \\frac{19}{2}, 6 \\sqrt{3}, \\frac{48}{7}}$.\n", - "Output Answer": [ - "$9+6 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 0, 2, -6, -2, 0, -9, 8, -5, 3*math.e, -5, (19/2), 6*math.sqrt(3), (48/7)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -6, 13, 11, 12, 3}$.\n", - "Output Answer": [ - "$\\frac{158}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -6, 13, 11, 12, 3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, -1, -6}$.\n", - "Output Answer": [ - "$\\sqrt[3]{-42}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -1, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{5}, 9, -2, -7, \\frac{17}{\\sqrt{3}}, -1, 3, -2, \\sqrt{5}, \\frac{7}{2}, 5, 7 \\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(5), 9, -2, -7, (17/(math.sqrt(3))), -1, 3, -2, math.sqrt(5), (7/2), 5, 7*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{16}{5 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(1/(math.sqrt(5))), -(3/(math.sqrt(5))), (11/(math.sqrt(5))), (16/(math.sqrt(5))), -(7/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{1}{3}, 7, 7, 7, 7, 7, 7, -\\frac{25}{3}, -10, \\frac{1}{3}, -10, -10, -\\frac{25}{3}, 7, -10, -10, 7, \\frac{1}{3}, -10, -10, \\frac{1}{3}, \\frac{1}{3}, 7, \\frac{1}{3}, -10, 7, -10}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (1/3), 7, 7, 7, 7, 7, 7, -(25/3), -10, (1/3), -10, -10, -(25/3), 7, -10, -10, 7, (1/3), -10, -10, (1/3), (1/3), 7, (1/3), -10, 7, -10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3 \\sqrt{5}, -3}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -3}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4 \\sqrt{3}, 6, \\frac{43}{7}} \\cup {7, -4 \\sqrt{3}, \\frac{43}{7}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, 6, \\frac{43}{7}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(3), 6, (43/7),))\nsnd = set((7, -4*math.sqrt(3), (43/7),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.44,0.126,0.3\\}$ and $\\{0.029,0.024,0.55\\}$.", - "Output Answer": [ - "$1.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.44, 0.126, 0.3\ndistribution2 = 0.029, 0.024, 0.55\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.144,0.002,0.296,0.171,0.198\\}$ and $\\{0.056,0.213,0.052,0.447,0.104\\}$.", - "Output Answer": [ - "$0.82$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.144, 0.002, 0.296, 0.171, 0.198\ndistribution2 = 0.056, 0.213, 0.052, 0.447, 0.104\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, -15, -2, -15}$.\n", - "Output Answer": [ - "$\\frac{169}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -15, -2, -15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{15}{2}, 11, 4, 19}$.\n", - "Output Answer": [ - "$\\frac{50160}{6607}$" - ], - "Output Program": [ - "import statistics\nvalues = (15/2), 11, 4, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10, -7, 5, -7, -4, -2, 5, 10, 3, -7, -4, 3, 5, -2, 10, -4, 10, 3, -7, -4, 10, -7, -4, -2, -2, -2, -2, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 10, -7, 5, -7, -4, -2, 5, 10, 3, -7, -4, 3, 5, -2, 10, -4, 10, 3, -7, -4, 10, -7, -4, -2, -2, -2, -2, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{5}, 8, 8, -8, -\\frac{5}{2}, 5, -2 e, 3}$.\n", - "Output Answer": [ - "$8+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(5), 8, 8, -8, -(5/2), 5, -2*math.e, 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.166,0.352,0.059,0.16,0.167,0.006\\}$ and $\\{0.16,0.107,0.153,0.105,0.088,0.281\\}$.", - "Output Answer": [ - "$0.55$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.166, 0.352, 0.059, 0.16, 0.167, 0.006\ndistribution2 = 0.16, 0.107, 0.153, 0.105, 0.088, 0.281\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-e, -e, 3 e, -3 e, 0}$.\n", - "Output Answer": [ - "$-\\frac{2 e}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.e, -math.e, 3*math.e, -3*math.e, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 3, 3, 4, 1}$.\n", - "Output Answer": [ - "$\\frac{2}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 3, 3, 4, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, 5, 9, -3, -8, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -8, -7, -3, 5, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 5, 9, -3, -8, -7*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.99 < -3.9 x^2+2.1 x+4.1 < -2.67$ where $x \\sim $ \\text{NormalDistribution}[-1.6,0.7].", - "Output Answer": [ - "$0.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 0.7)\nprint(P((-2.99 < -3.9*x**2+2.1*x+4.1) & (-3.9*x**2+2.1*x+4.1 < -2.67)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{2}, \\sqrt{5}, -8, -2 \\sqrt{3}, 3, -\\frac{4}{5}, -\\frac{25}{\\pi }, -4, 3 e}$.\n", - "Output Answer": [ - "$8+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(2), math.sqrt(5), -8, -2*math.sqrt(3), 3, -(4/5), -(25/math.pi), -4, 3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3, -9, -\\frac{28}{3}, 0, 2, 8, -3 \\pi} \\cup {-\\frac{28}{3}, -9, 3, -\\sqrt{5}, -5 \\sqrt{3}, -7, -3 \\pi, -6}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\frac{28}{3}, -9, -5 \\sqrt{3}, -7, -6, -\\sqrt{5}, 0, 2, 3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -9, -(28/3), 0, 2, 8, -3*math.pi,))\nsnd = set((-(28/3), -9, 3, -math.sqrt(5), -5*math.sqrt(3), -7, -3*math.pi, -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{20}{3}, \\frac{22}{3}}$.\n", - "Output Answer": [ - "$\\frac{440}{63}$" - ], - "Output Program": [ - "import statistics\nvalues = (20/3), (22/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, -12, -1, 12, 14}$.\n", - "Output Answer": [ - "$\\frac{554}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -12, -1, 12, 14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10, 10, 8, -7, 8, -4, -7, -4, 10, -7, -7, -4, -7, 8, 10, 6, 8, -7, 10, -4, 6, -4, 8}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 10, 10, 8, -7, 8, -4, -7, -4, 10, -7, -7, -4, -7, 8, 10, 6, 8, -7, 10, -4, 6, -4, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\sqrt{5}, -9, -7, -3, -\\frac{29}{3}, -3.1, -\\frac{5}{4}, -1, 6 \\sqrt{2}, \\frac{7}{2}} \\cup {\\frac{7}{2}, \\frac{33}{4}, -4, \\frac{11}{\\pi }, 6, -3.1, 3 \\sqrt{5}, -\\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{29}{3}, -9, -7, -4, -3.1, -3, -\\frac{5}{4}, -1, -\\frac{1}{\\sqrt{2}}, \\frac{7}{2}, \\frac{11}{\\pi }, 6, 3 \\sqrt{5}, \\frac{33}{4}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(5), -9, -7, -3, -(29/3), -3.1, -(5/4), -1, 6*math.sqrt(2), (7/2),))\nsnd = set(((7/2), (33/4), -4, (11/math.pi), 6, -3.1, 3*math.sqrt(5), -(1/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, 0, 7 \\sqrt{2}, \\frac{3}{5}, -2, -\\frac{29}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{29}{\\pi }, -2, 0, \\frac{3}{5}, 4, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 0, 7*math.sqrt(2), (3/5), -2, -(29/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${531441, 3, 64, 256, -6, -8}$.\n", - "Output Answer": [ - "$72 \\sqrt[3]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 531441, 3, 64, 256, -6, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.062,0.236,0.14,0.066,0.016,0.287,0.073,0.019\\}$ and $\\{0.106,0.18,0.113,0.15,0.146,0.143,0.067,0.025\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.062, 0.236, 0.14, 0.066, 0.016, 0.287, 0.073, 0.019\ndistribution2 = 0.106, 0.18, 0.113, 0.15, 0.146, 0.143, 0.067, 0.025\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${512, 2401, -27, -27}$.\n", - "Output Answer": [ - "$84 \\sqrt[4]{2} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 512, 2401, -27, -27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 7, -\\frac{2}{\\sqrt{5}}, 0, \\frac{3}{\\sqrt{2}}, 2, -5, -6, -6}$.", - "Output Answer": [ - "$-\\frac{2}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, 7, -(2/(math.sqrt(5))), 0, (3/(math.sqrt(2))), 2, -5, -6, -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, \\frac{20}{3}, \\frac{23}{3}, -5}$.\n", - "Output Answer": [ - "$\\frac{37}{12}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, (20/3), (23/3), -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.2 x^2-1.6 x+0.$ where $x \\sim $ \\text{NormalDistribution}[1.6,2.6]\n", - "Output Answer": [ - "$-4.42$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.6, 2.6)\nprint(E(-0.2*x**2-1.6*x+0.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.055,0.084,0.181,0.032,0.072,0.114,0.046,0.101,0.126,0.091\\}$ and $\\{0.055,0.04,0.186,0.166,0.116,0.031,0.079,0.23,0.014,0.006\\}$.", - "Output Answer": [ - "$0.62$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.055, 0.084, 0.181, 0.032, 0.072, 0.114, 0.046, 0.101, 0.126, 0.091\ndistribution2 = 0.055, 0.04, 0.186, 0.166, 0.116, 0.031, 0.079, 0.23, 0.014, 0.006\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, -27, -3, -343, 1}$.\n", - "Output Answer": [ - "$7 \\sqrt[5]{-1} 3^{4/5} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, -27, -3, -343, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 8, 15, 19}$.\n", - "Output Answer": [ - "$\\frac{3040}{439}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 8, 15, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{7}{3}, 16, \\frac{44}{3}}$.\n", - "Output Answer": [ - "$\\frac{3696}{689}$" - ], - "Output Program": [ - "import statistics\nvalues = (7/3), 16, (44/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{15}{2}, -5, 9.59, 12 \\log (2), -8} \\cup {-5, 12 \\log (2), -8, \\frac{15}{2}, -5.62, \\frac{5}{e}}$.\n", - "Output Answer": [ - "${-8, -5.62, -5, \\frac{5}{e}, \\frac{15}{2}, 12 \\log (2), 9.59}$" - ], - "Output Program": [ - "import math\n\nfst = set(((15/2), -5, 9.59, 12*math.log(2), -8,))\nsnd = set((-5, 12*math.log(2), -8, (15/2), -5.62, (5/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -8, 12, 7}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{923}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -8, 12, 7\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10, -1.091, 3, 2.32, -8, 2} \\setminus {8, 4, 2}$.\n", - "Output Answer": [ - "${-8, -1.091, 2.32, 3, 10}$" - ], - "Output Program": [ - "fst = set((10, -1.091, 3, 2.32, -8, 2,))\nsnd = set((8, 4, 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{17}{\\sqrt{3}}, \\frac{1}{2}, -\\frac{68}{7}, 4, -6, -\\frac{69}{7}, -3, -3, -\\frac{15}{2}, \\frac{17}{5}, 1}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (17/(math.sqrt(3))), (1/2), -(68/7), 4, -6, -(69/7), -3, -3, -(15/2), (17/5), 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, -\\frac{4}{\\sqrt{\\pi }}, -9, 6, -4, 0, -4}$.\n", - "Output Answer": [ - "${-9, -9, -4, -4, -\\frac{4}{\\sqrt{\\pi }}, 0, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -(4/(math.sqrt(math.pi))), -9, 6, -4, 0, -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 e, 2, 8, 6, 6, -8, -3, 1, 3, \\frac{8}{e}, -6, -1}$.\n", - "Output Answer": [ - "$8+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.e, 2, 8, 6, 6, -8, -3, 1, 3, (8/math.e), -6, -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -\\frac{16}{\\sqrt{5}}, -\\frac{8}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$1+\\frac{16}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -(16/(math.sqrt(5))), -(8/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -\\frac{8}{\\pi }, -5 \\log (2), -8, \\frac{21}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, 4, -\\frac{8}{\\pi }, 2 \\sqrt{5}, 7, -\\frac{8}{\\sqrt{3}}, -4}$.\n", - "Output Answer": [ - "$8 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -(8/math.pi), -5*math.log(2), -8, (21/(math.sqrt(5))), -(19/(math.sqrt(5))), 4, -(8/math.pi), 2*math.sqrt(5), 7, -(8/(math.sqrt(3))), -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{56}{3}, 8}$.\n", - "Output Answer": [ - "$\\frac{56}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = (56/3), 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 12, 5, 13}$.\n", - "Output Answer": [ - "$\\frac{59280}{6119}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 12, 5, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, e, 6, -1, -\\frac{19}{7}, 7 \\sqrt{2}, 8} \\setminus {e, -4, 0, -\\frac{52}{7}, -6 \\sqrt{3}, 8, 6}$.\n", - "Output Answer": [ - "${-\\frac{19}{7}, -1, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, math.e, 6, -1, -(19/7), 7*math.sqrt(2), 8,))\nsnd = set((math.e, -4, 0, -(52/7), -6*math.sqrt(3), 8, 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{10}{7}, \\frac{10}{7}, -\\frac{38}{7}, \\frac{10}{7}, \\frac{16}{7}, \\frac{51}{7}, \\frac{51}{7}, \\frac{51}{7}, -\\frac{5}{7}, \\frac{23}{7}, -\\frac{5}{7}, -\\frac{5}{7}, \\frac{23}{7}, \\frac{51}{7}, \\frac{51}{7}, \\frac{23}{7}, -\\frac{38}{7}, \\frac{10}{7}, -\\frac{5}{7}, \\frac{10}{7}, \\frac{10}{7}, -\\frac{5}{7}, -\\frac{38}{7}, \\frac{23}{7}, -\\frac{38}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{10}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (10/7), (10/7), -(38/7), (10/7), (16/7), (51/7), (51/7), (51/7), -(5/7), (23/7), -(5/7), -(5/7), (23/7), (51/7), (51/7), (23/7), -(38/7), (10/7), -(5/7), (10/7), (10/7), -(5/7), -(38/7), (23/7), -(38/7)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 7, 4 \\sqrt{5}, 7, \\frac{18}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{5}}, -\\frac{1}{\\sqrt{\\pi }}, 9}$.", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 7, 4*math.sqrt(5), 7, (18/(math.sqrt(math.pi))), -(13/(math.sqrt(5))), -(1/(math.sqrt(math.pi))), 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x-0.3$ where $x \\sim $ \\text{NormalDistribution}[-1.7,2.]\n", - "Output Answer": [ - "$2.93$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.7, 2.)\nprint(E(-1.9*x-0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.018,0.018,0.006,0.048,0.263,0.022,0.079,0.034,0.01,0.489\\}$ and $\\{0.107,0.22,0.157,0.026,0.096,0.071,0.117,0.096,0.04,0.005\\}$.", - "Output Answer": [ - "$2.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.018, 0.018, 0.006, 0.048, 0.263, 0.022, 0.079, 0.034, 0.01, 0.489\ndistribution2 = 0.107, 0.22, 0.157, 0.026, 0.096, 0.071, 0.117, 0.096, 0.04, 0.005\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{3}{\\sqrt{5}}, 1, -6, -\\frac{22}{e}, 0, 8}$.\n", - "Output Answer": [ - "$8+\\frac{22}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/(math.sqrt(5))), 1, -6, -(22/math.e), 0, 8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{20}{e}, \\frac{18}{e}, \\frac{12}{e}, \\frac{7}{e}, -\\frac{25}{e}, \\frac{11}{e}}$.\n", - "Output Answer": [ - "$\\frac{43}{6 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (20/math.e), (18/math.e), (12/math.e), (7/math.e), -(25/math.e), (11/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -59049, 100, -7, 256, 3125}$.\n", - "Output Answer": [ - "$60 \\sqrt[3]{2} 3^{2/3} \\sqrt[6]{35}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -59049, 100, -7, 256, 3125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-13 \\log (2), 4 \\log (2), -4 \\log (2), 2 \\log (2), -7 \\log (2), 0}$.\n", - "Output Answer": [ - "$-3 \\log (2)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -13*math.log(2), 4*math.log(2), -4*math.log(2), 2*math.log(2), -7*math.log(2), 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{15}{\\pi }, -5, \\frac{12}{\\sqrt{5}}, 3}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+\\frac{15}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (15/math.pi), -5, (12/(math.sqrt(5))), 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3.69, -8, -7, 2, e, -5} \\setminus {-\\frac{16}{5}, -3.69, e, -7, 3}$.\n", - "Output Answer": [ - "${-8, -5, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3.69, -8, -7, 2, math.e, -5,))\nsnd = set((-(16/5), -3.69, math.e, -7, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 3, 0, 3, 7}$.\n", - "Output Answer": [ - "$\\frac{11}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 3, 0, 3, 7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\pi, -2, 2, -9, -14 \\log (2), -7, 9, 2, 2 \\sqrt{3}, -10, -5 \\sqrt{2}, -3}$.", - "Output Answer": [ - "$\\frac{1}{2} (-3-\\pi )$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.pi, -2, 2, -9, -14*math.log(2), -7, 9, 2, 2*math.sqrt(3), -10, -5*math.sqrt(2), -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, -8.07}$.\n", - "Output Answer": [ - "${-8.07, -4}$" - ], - "Output Program": [ - "values = -4, -8.07\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 81, 16, -216, 262144, -1}$.\n", - "Output Answer": [ - "$48 \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 81, 16, -216, 262144, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000000, -16807, 4096, 16, 46656, -8}$.\n", - "Output Answer": [ - "$480 \\sqrt[6]{2} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000000, -16807, 4096, 16, 46656, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -\\frac{31}{\\pi }, \\sqrt{5}, 4, 1, 3 e, -9, -6, -5.9, -7, 5} \\cup {-7, 5, -\\frac{31}{\\pi }, 4, -e, -8, -6, \\sqrt{5}, -5.9, 2}$.\n", - "Output Answer": [ - "${-\\frac{31}{\\pi }, -9, -8, -7, -6, -5.9, -5, -e, 1, 2, \\sqrt{5}, 4, 5, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -(31/math.pi), math.sqrt(5), 4, 1, 3*math.e, -9, -6, -5.9, -7, 5,))\nsnd = set((-7, 5, -(31/math.pi), 4, -math.e, -8, -6, math.sqrt(5), -5.9, 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 4, 36, 6561, 4, 9}$.\n", - "Output Answer": [ - "$18\\ 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 4, 36, 6561, 4, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x^2+1.6 x-1.6$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$26.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(4.6*x**2+1.6*x-1.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -7, -9, -9, -1, -1, -9, 6, -7, 8, -1, -9, -9, -1, -9, 8, 6, 8, 6, -9, -1, 8, -9, -9, 6, 6, -9, -1, 6}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -7, -9, -9, -1, -1, -9, 6, -7, 8, -1, -9, -9, -1, -9, 8, 6, 8, 6, -9, -1, 8, -9, -9, 6, 6, -9, -1, 6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{48}{7}, \\frac{37}{7}, \\frac{29}{7}, -\\frac{41}{7}, -\\frac{34}{7}, \\frac{12}{7}} \\cap {-\\frac{41}{7}, -\\frac{31}{7}, -\\frac{67}{7}, -\\frac{27}{7}, -\\frac{9}{7}, \\frac{37}{7}}$.\n", - "Output Answer": [ - "${-\\frac{41}{7}, \\frac{37}{7}}$" - ], - "Output Program": [ - "fst = set((-(48/7), (37/7), (29/7), -(41/7), -(34/7), (12/7),))\nsnd = set((-(41/7), -(31/7), -(67/7), -(27/7), -(9/7), (37/7),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x-3.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$-0.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(3.6*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4 \\sqrt{2}, 5, -5, 0, -6, -1, -\\frac{4}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-6, -4 \\sqrt{2}, -5, -\\frac{4}{\\sqrt{5}}, -1, 0, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(2), 5, -5, 0, -6, -1, -(4/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5 \\sqrt{2}, -7.71, -7, \\frac{17}{2}, \\frac{49}{5}, -3} \\cup {-9.28, 5 \\sqrt{2}, -3, 3.539, 8, \\frac{49}{5}, 8.949}$.\n", - "Output Answer": [ - "${-9.28, -7.71, -7, -3, 3.539, 5 \\sqrt{2}, 8, \\frac{17}{2}, 8.949, \\frac{49}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), -7.71, -7, (17/2), (49/5), -3,))\nsnd = set((-9.28, 5*math.sqrt(2), -3, 3.539, 8, (49/5), 8.949,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{6}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, 9, 4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+\\frac{8}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (6/(math.sqrt(5))), (8/(math.sqrt(5))), 9, 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1296, 1, -27, 1, 10}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-5} 3^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1296, 1, -27, 1, 10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.1,0.102,0.345,0.242,0.044\\}$ and $\\{0.026,0.029,0.46,0.091,0.258\\}$.", - "Output Answer": [ - "$0.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.1, 0.102, 0.345, 0.242, 0.044\ndistribution2 = 0.026, 0.029, 0.46, 0.091, 0.258\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -\\frac{19}{2}, -\\frac{34}{7}, 4, 9, -\\frac{24}{5}, -4, -2, -6, -\\frac{44}{5}, 6, \\frac{19}{3}, 7}$.\n", - "Output Answer": [ - "$\\frac{37}{2}$" - ], - "Output Program": [ - "values = -6, -(19/2), -(34/7), 4, 9, -(24/5), -4, -2, -6, -(44/5), 6, (19/3), 7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, 64, 25}$.\n", - "Output Answer": [ - "$20\\ 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, 64, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, 5, -4, 1, -6, 7, -10}$.\n", - "Output Answer": [ - "$-\\frac{15}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, 5, -4, 1, -6, 7, -10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, 8, \\frac{9}{e}, 3, -9, -10, 10, \\pi, 0, 7, 1}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 8, (9/math.e), 3, -9, -10, 10, math.pi, 0, 7, 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, 0, \\frac{5}{4}, 5, \\frac{33}{4}, 0, \\frac{7}{4}, -2, \\frac{33}{4}, \\frac{33}{4}, -3, 5, 5, -2, -3, \\frac{5}{4}, -2, 5, \\frac{5}{4}, 5, 0, 5, -2, -2, 0, \\frac{5}{4}, \\frac{5}{4}, 0, -3, \\frac{7}{4}}$.\n", - "Output Answer": [ - "$\\{-2,5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, 0, (5/4), 5, (33/4), 0, (7/4), -2, (33/4), (33/4), -3, 5, 5, -2, -3, (5/4), -2, 5, (5/4), 5, 0, 5, -2, -2, 0, (5/4), (5/4), 0, -3, (7/4)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, 5, -1}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "values = 4, 5, -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{23}{3}, -6, -\\pi, -6, -\\frac{11}{e}, 0, -7, \\frac{1}{2}, -2, \\frac{8}{\\sqrt{3}}, 8, \\frac{14}{\\pi }, -7, -6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{11}{e}-\\pi \\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(23/3), -6, -math.pi, -6, -(11/math.e), 0, -7, (1/2), -2, (8/(math.sqrt(3))), 8, (14/math.pi), -7, -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, \\frac{14}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{17}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$-\\frac{3}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, (14/(math.sqrt(5))), -(22/(math.sqrt(5))), -(17/(math.sqrt(5))), (11/(math.sqrt(5))), -(4/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{12}{e}, \\frac{12}{e}, -\\frac{18}{e}, -\\frac{26}{e}, \\frac{12}{e}, \\frac{12}{e}, \\frac{12}{e}, -\\frac{26}{e}, \\frac{25}{e}, \\frac{12}{e}, \\frac{12}{e}, -\\frac{26}{e}, -\\frac{18}{e}, -\\frac{26}{e}, \\frac{12}{e}, -\\frac{26}{e}, -\\frac{26}{e}, \\frac{25}{e}, -\\frac{26}{e}, \\frac{12}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{12}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (12/math.e), (12/math.e), -(18/math.e), -(26/math.e), (12/math.e), (12/math.e), (12/math.e), -(26/math.e), (25/math.e), (12/math.e), (12/math.e), -(26/math.e), -(18/math.e), -(26/math.e), (12/math.e), -(26/math.e), -(26/math.e), (25/math.e), -(26/math.e), (12/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.2,0.1,0.542\\}$ and $\\{0.68,0.137,0.033\\}$.", - "Output Answer": [ - "$1.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.2, 0.1, 0.542\ndistribution2 = 0.68, 0.137, 0.033\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, \\frac{2}{\\sqrt{3}}, 7, 6 \\sqrt{2}, -\\frac{7}{2}, -5}$.\n", - "Output Answer": [ - "${-5, -4, -\\frac{7}{2}, \\frac{2}{\\sqrt{3}}, 7, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, (2/(math.sqrt(3))), 7, 6*math.sqrt(2), -(7/2), -5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -2 e, \\frac{45}{7}, -\\frac{10}{e}, -7, -3.53} \\setminus {-\\frac{14}{\\sqrt{5}}, \\frac{10}{e}, -7}$.\n", - "Output Answer": [ - "${-9, -2 e, -\\frac{10}{e}, -3.53, \\frac{45}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -2*math.e, (45/7), -(10/math.e), -7, -3.53,))\nsnd = set((-(14/(math.sqrt(5))), (10/math.e), -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{5}, 2, \\frac{64}{7}, \\frac{17}{2}, -8, \\frac{3}{\\sqrt{\\pi }}, \\frac{60}{7}, -e, \\frac{12}{\\sqrt{5}}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(5), 2, (64/7), (17/2), -8, (3/(math.sqrt(math.pi))), (60/7), -math.e, (12/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 100000, 1, -6, 1, 9}$.\n", - "Output Answer": [ - "$2 \\sqrt[6]{-1} \\sqrt{3} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 100000, 1, -6, 1, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x-0.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5]\n", - "Output Answer": [ - "$-0.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(E(-2.7*x-0.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10 \\log (2), -7 \\log (2), -7 \\log (2), 10 \\log (2), 10 \\log (2), 10 \\log (2), 4 \\log (2), -4 \\log (2), -10 \\log (2), -8 \\log (2), -4 \\log (2), 7 \\log (2), -4 \\log (2), -10 \\log (2), 7 \\log (2), -4 \\log (2), 7 \\log (2), 7 \\log (2), 6 \\log (2), -10 \\log (2), 6 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-10 \\log (2),-4 \\log (2),7 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -10*math.log(2), -7*math.log(2), -7*math.log(2), 10*math.log(2), 10*math.log(2), 10*math.log(2), 4*math.log(2), -4*math.log(2), -10*math.log(2), -8*math.log(2), -4*math.log(2), 7*math.log(2), -4*math.log(2), -10*math.log(2), 7*math.log(2), -4*math.log(2), 7*math.log(2), 7*math.log(2), 6*math.log(2), -10*math.log(2), 6*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{9}{\\sqrt{2}}, 0, -3, 2, 5, 0, -\\frac{39}{5}, \\frac{5}{\\pi }, -\\frac{5}{e}, 9, 8, -4}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(9/(math.sqrt(2))), 0, -3, 2, 5, 0, -(39/5), (5/math.pi), -(5/math.e), 9, 8, -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.8 x^2+1.2 x-2.8$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$-0.85$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(1.8*x**2+1.2*x-2.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, \\frac{35}{2}}$.\n", - "Output Answer": [ - "$\\frac{770}{57}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, (35/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.067,0.097,0.194,0.079,0.109,0.087,0.088,0.016,0.056,0.168\\}$ and $\\{0.106,0.089,0.081,0.101,0.042,0.069,0.052,0.148,0.082,0.149\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.067, 0.097, 0.194, 0.079, 0.109, 0.087, 0.088, 0.016, 0.056, 0.168\ndistribution2 = 0.106, 0.089, 0.081, 0.101, 0.042, 0.069, 0.052, 0.148, 0.082, 0.149\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x-3.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.5]\n", - "Output Answer": [ - "$-1.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.5)\nprint(E(1.3*x-3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.144,0.168,0.111,0.044,0.095,0.052,0.115,0.223\\}$ and $\\{0.005,0.334,0.047,0.013,0.282,0.241,0.009,0.03\\}$.", - "Output Answer": [ - "$1.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.144, 0.168, 0.111, 0.044, 0.095, 0.052, 0.115, 0.223\ndistribution2 = 0.005, 0.334, 0.047, 0.013, 0.282, 0.241, 0.009, 0.03\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-10, 3 e, -1, \\frac{11}{\\sqrt{5}}, -5 \\log (2), \\sqrt{3}, -3, -6, -8, 9}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, 3*math.e, -1, (11/(math.sqrt(5))), -5*math.log(2), math.sqrt(3), -3, -6, -8, 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{8}{\\sqrt{3}}, \\frac{14}{\\sqrt{\\pi }}, -4, 3, 10 \\log (2), 8} \\setminus {9, \\frac{17}{\\sqrt{3}}, 6, 3, 8, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{8}{\\sqrt{3}}, -4, \\frac{14}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(8/(math.sqrt(3))), (14/(math.sqrt(math.pi))), -4, 3, 10*math.log(2), 8,))\nsnd = set((9, (17/(math.sqrt(3))), 6, 3, 8, 10*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 9, -3, 7, 9, -3, 5, -3, 5, -3, -3, -3, -3, -3, 0, 7, 5, 0, 5, -3, -3, -3, 7, -3, 5, 0, 9}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 9, -3, 7, 9, -3, 5, -3, 5, -3, -3, -3, -3, -3, 0, 7, 5, 0, 5, -3, -3, -3, 7, -3, 5, 0, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5 \\sqrt{2}, \\frac{3}{\\sqrt{5}}, -2.8, -3, -2 e} \\setminus {3 \\sqrt{2}, -5 \\sqrt{2}, 0, -\\sqrt{3}, -5}$.\n", - "Output Answer": [ - "${-2 e, -3, -2.8, \\frac{3}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(2), (3/(math.sqrt(5))), -2.8, -3, -2*math.e,))\nsnd = set((3*math.sqrt(2), -5*math.sqrt(2), 0, -math.sqrt(3), -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${11 \\log (2), -6, \\frac{3}{\\pi }, 4 \\sqrt{2}, -\\frac{22}{\\sqrt{5}}, -5} \\setminus {9, 8, 11 \\log (2), -4 \\sqrt{2}, -\\frac{22}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-6, -5, \\frac{3}{\\pi }, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((11*math.log(2), -6, (3/math.pi), 4*math.sqrt(2), -(22/(math.sqrt(5))), -5,))\nsnd = set((9, 8, 11*math.log(2), -4*math.sqrt(2), -(22/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-2, 2, 10, 13}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{193}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 2, 10, 13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 11, \\frac{37}{2}, \\frac{1}{2}}$.\n", - "Output Answer": [ - "$\\frac{814}{455}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 11, (37/2), (1/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, 9, -5 \\sqrt{3}, -10 \\log (2), -3.09, -8} \\cup {-3.09, \\frac{23}{5}, -8, 4, -10 \\log (2), 0}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -8, -10 \\log (2), -3.09, 0, 4, \\frac{23}{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 9, -5*math.sqrt(3), -10*math.log(2), -3.09, -8,))\nsnd = set((-3.09, (23/5), -8, 4, -10*math.log(2), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 7, 5, -5, 5, -5, -10, -3, 7, 5, -3, -3, -10, 5, -5, 7, -10, -3, -10, 7, 5, 5, 7, -3, -5, -5, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 7, 5, -5, 5, -5, -10, -3, 7, 5, -3, -3, -10, 5, -5, 7, -10, -3, -10, 7, 5, 5, 7, -3, -5, -5, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3.16, -1, -2, -7, -\\frac{26}{e}, -6} \\cup {-4, -6, -7, 6.32, 2, -1, -\\frac{26}{e}, 3.16}$.\n", - "Output Answer": [ - "${-\\frac{26}{e}, -7, -6, -4, -2, -1, 2, 3.16, 6.32}$" - ], - "Output Program": [ - "import math\n\nfst = set((3.16, -1, -2, -7, -(26/math.e), -6,))\nsnd = set((-4, -6, -7, 6.32, 2, -1, -(26/math.e), 3.16,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, 5, -2, \\frac{13}{\\sqrt{\\pi }}, -1, -10, -3, -8, 1, -\\frac{22}{e}, -\\frac{8}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$10+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 5, -2, (13/(math.sqrt(math.pi))), -1, -10, -3, -8, 1, -(22/math.e), -(8/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, -4, 3}$.\n", - "Output Answer": [ - "$\\frac{7}{\\sqrt{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -4, 3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-27, 1000, 216, 8}$.\n", - "Output Answer": [ - "$(6+6 i) \\sqrt{3} 10^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -27, 1000, 216, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.178,0.074,0.314,0.091,0.027\\}$ and $\\{0.316,0.014,0.001,0.01,0.015\\}$.", - "Output Answer": [ - "$2.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.178, 0.074, 0.314, 0.091, 0.027\ndistribution2 = 0.316, 0.014, 0.001, 0.01, 0.015\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 9, 4, 3, -3, -3, 0, 9, -3, 9, 3, 9, 0, 4, 0, 4, 3, 4, -3, 0}$.\n", - "Output Answer": [ - "$\\{3,9,4,-3,0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 9, 4, 3, -3, -3, 0, 9, -3, 9, 3, 9, 0, 4, 0, 4, 3, 4, -3, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, 12, 13}$.\n", - "Output Answer": [ - "$169$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 12, 13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{5}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{3 \\sqrt{5}}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(5), -math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5 \\sqrt{2}, 4 \\sqrt{5}, -5.01, -6} \\setminus {4 \\sqrt{5}, 6, 0, -5 \\sqrt{2}, 3, -\\frac{14}{\\sqrt{3}}, 5.326}$.\n", - "Output Answer": [ - "${-6, -5.01}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(2), 4*math.sqrt(5), -5.01, -6,))\nsnd = set((4*math.sqrt(5), 6, 0, -5*math.sqrt(2), 3, -(14/(math.sqrt(3))), 5.326,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5 \\sqrt{3}, -9, 6.046, 2, -2, 5, \\pi, \\frac{31}{4}, -\\frac{5}{e}, -6, 0} \\cup {5, \\frac{15}{2}, -2, -6.457, 0, 2, -\\pi}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -6.457, -6, -\\pi, -2, -\\frac{5}{e}, 0, 2, \\pi, 5, 6.046, \\frac{15}{2}, \\frac{31}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(3), -9, 6.046, 2, -2, 5, math.pi, (31/4), -(5/math.e), -6, 0,))\nsnd = set((5, (15/2), -2, -6.457, 0, 2, -math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{15}{7}, 8, 1, 6, 1, \\frac{4}{\\sqrt{5}}, e, \\frac{44}{5}, -\\frac{17}{3}, -\\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{217}{15}$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/7), 8, 1, 6, 1, (4/(math.sqrt(5))), math.e, (44/5), -(17/3), -(8/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.098,0.29,0.069,0.086,0.234,0.155\\}$ and $\\{0.114,0.207,0.047,0.234,0.194,0.158\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.098, 0.29, 0.069, 0.086, 0.234, 0.155\ndistribution2 = 0.114, 0.207, 0.047, 0.234, 0.194, 0.158\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{17}{4}, -2 e, 8, 0, 7, \\frac{2}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$8+2 e$" - ], - "Output Program": [ - "import math\n\nvalues = (17/4), -2*math.e, 8, 0, 7, (2/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9.4, -10, -4, 2, -7, \\frac{8}{3}, -3 \\sqrt{5}} \\cup {0, 2, 9, -3 \\sqrt{5}, -10, \\frac{8}{3}, -6.6, 6, -7}$.\n", - "Output Answer": [ - "${-10, -7, -3 \\sqrt{5}, -6.6, -4, 0, 2, \\frac{8}{3}, 6, 9, 9.4}$" - ], - "Output Program": [ - "import math\n\nfst = set((9.4, -10, -4, 2, -7, (8/3), -3*math.sqrt(5),))\nsnd = set((0, 2, 9, -3*math.sqrt(5), -10, (8/3), -6.6, 6, -7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, -2, 0}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -2, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1, 2, -6, -\\frac{57}{7}, -\\frac{2}{\\sqrt{3}}, -9.407, 0} \\cup {2, 10, 1, -0.378, -\\frac{4}{\\sqrt{3}}, -\\frac{5}{7}, 0}$.\n", - "Output Answer": [ - "${-9.407, -\\frac{57}{7}, -6, -\\frac{4}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -\\frac{5}{7}, -0.378, 0, 1, 2, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 2, -6, -(57/7), -(2/(math.sqrt(3))), -9.407, 0,))\nsnd = set((2, 10, 1, -0.378, -(4/(math.sqrt(3))), -(5/7), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 1, 4, 7, 7, 1, 1, 7, -2, 1, -2, -2, -2, 7, 1, 4, 1, 7, 4, -2}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 1, 4, 7, 7, 1, 1, 7, -2, 1, -2, -2, -2, 7, 1, 4, 1, 7, 4, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -3 \\sqrt{2}} \\cup {-\\frac{1}{\\sqrt{2}}, 0}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -3*math.sqrt(2),))\nsnd = set((-(1/(math.sqrt(2))), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x^2+3.7 x-4.3$ where $x \\sim $ \\text{NormalDistribution}[0.6,2.]\n", - "Output Answer": [ - "$11.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.6, 2.)\nprint(E(3.1*x**2+3.7*x-4.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{5}, 2, \\frac{15}{e}} \\setminus {0.86, 2, -6.49, -\\frac{19}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${\\frac{15}{e}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), 2, (15/math.e),))\nsnd = set((0.86, 2, -6.49, -(19/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.8 x-8.2$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$-1.54$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(1.8*x-8.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${6, -8, 2}$.\n", - "Output Answer": [ - "$52$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -8, 2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 5, -3, 1, -2}$.\n", - "Output Answer": [ - "$-\\frac{8}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 5, -3, 1, -2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, \\frac{11}{2}, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{4488}{635}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, (11/2), (17/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.342,0.176,0.06,0.27\\}$ and $\\{0.119,0.32,0.066,0.296\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.342, 0.176, 0.06, 0.27\ndistribution2 = 0.119, 0.32, 0.066, 0.296\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7 \\sqrt{2}, \\pi, -9, -1, -2 \\sqrt{3}, -2} \\setminus {-9, 2 \\pi, 6, -1, 7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{3}, -2, \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((7*math.sqrt(2), math.pi, -9, -1, -2*math.sqrt(3), -2,))\nsnd = set((-9, 2*math.pi, 6, -1, 7*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, 15, 11, 14, -10}$.\n", - "Output Answer": [ - "$\\frac{1587}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 15, 11, 14, -10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, 6, 1}$.\n", - "Output Answer": [ - "$\\frac{31}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 6, 1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 10, -7, 8, 3.76, -2 \\pi, 2} \\cup {-4, 0, -9, -1, 10, 3.76, 8, -2 \\pi}$.\n", - "Output Answer": [ - "${-9, -7, -2 \\pi, -4, -1, 0, 2, 3.76, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 10, -7, 8, 3.76, -2*math.pi, 2,))\nsnd = set((-4, 0, -9, -1, 10, 3.76, 8, -2*math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{54}{7}, 3 \\pi, 5, -\\frac{25}{7}, -8, 5, 5, 4, 7, -8}$.\n", - "Output Answer": [ - "$8+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -(54/7), 3*math.pi, 5, -(25/7), -8, 5, 5, 4, 7, -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.3 x-2.8$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$-2.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(0.3*x-2.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{21}{4}, -3 e, 0, 3} \\setminus {-\\frac{7}{2}, -1, \\frac{26}{e}, 9, 0}$.\n", - "Output Answer": [ - "${-3 e, 3, \\frac{21}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((21/4), -3*math.e, 0, 3,))\nsnd = set((-(7/2), -1, (26/math.e), 9, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-5, 0, -2, -13}$.\n", - "Output Answer": [ - "$7 \\sqrt{\\frac{2}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 0, -2, -13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 0, -5, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$3 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 0, -5, -3*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -5, 5, 7, 7, 2, 7, 5, 2, 7, 8, 7, 2, 8, -5, 8, 8, -5, 2, 5, 7, 2, 7, 2}$.\n", - "Output Answer": [ - "$\\{2,7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -5, 5, 7, 7, 2, 7, 5, 2, 7, 8, 7, 2, 8, -5, 8, 8, -5, 2, 5, 7, 2, 7, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 7, -5, 3, 9, -9}$.\n", - "Output Answer": [ - "$\\frac{5}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 7, -5, 3, 9, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 e, -3 e, 0, 3 e, e}$.\n", - "Output Answer": [ - "$-\\frac{2 e}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.e, -3*math.e, 0, 3*math.e, math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -3*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.5 x^3+4.3 x^2+2.4 x+3.8$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$6.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(-1.5*x**3+4.3*x**2+2.4*x+3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{5}{3}, -6, -\\frac{30}{\\pi }, 8, -\\frac{16}{7}, -\\frac{27}{4}, 3 \\sqrt{3}, 7 \\sqrt{2}, -\\frac{18}{\\sqrt{5}}, 1, -8, 0, 0, -4}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{30}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/3), -6, -(30/math.pi), 8, -(16/7), -(27/4), 3*math.sqrt(3), 7*math.sqrt(2), -(18/(math.sqrt(5))), 1, -8, 0, 0, -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 19, \\frac{38}{3}, 17}$.\n", - "Output Answer": [ - "$\\frac{38760}{2491}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 19, (38/3), 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, 0, -\\frac{16}{7}}$.\n", - "Output Answer": [ - "${-\\frac{16}{7}, 0, 4}$" - ], - "Output Program": [ - "values = 4, 0, -(16/7)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, 2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, 7, -6, -7, 6 \\log (2), 2, -7.8, -\\frac{25}{7}, 4} \\cup {4, -7, 8, -9.3, -12 \\log (2), 5, -\\frac{25}{7}, 2, -4}$.\n", - "Output Answer": [ - "${-9.3, -12 \\log (2), -7.8, -7, -6, -4, -\\frac{25}{7}, 2, 4, 6 \\log (2), 5, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 7, -6, -7, 6*math.log(2), 2, -7.8, -(25/7), 4,))\nsnd = set((4, -7, 8, -9.3, -12*math.log(2), 5, -(25/7), 2, -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5.83, 0, -7, -1} \\setminus {-1, 0, -2}$.\n", - "Output Answer": [ - "${-7, -5.83}$" - ], - "Output Program": [ - "fst = set((-5.83, 0, -7, -1,))\nsnd = set((-1, 0, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{3}, \\frac{2}{3}, \\frac{52}{3}}$.\n", - "Output Answer": [ - "$\\frac{572}{349}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/3), (2/3), (52/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{15}{e}, -\\frac{29}{\\pi }, 2, 0, 5, \\sqrt{5}, 8 \\log (2), \\frac{10}{\\sqrt{3}}, 6, 3 \\sqrt{5}, -\\sqrt{2}, -2 e, -10}$.\n", - "Output Answer": [ - "$10+3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (15/math.e), -(29/math.pi), 2, 0, 5, math.sqrt(5), 8*math.log(2), (10/(math.sqrt(3))), 6, 3*math.sqrt(5), -math.sqrt(2), -2*math.e, -10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 243, 3125, 729, 6, -5}$.\n", - "Output Answer": [ - "$45 \\sqrt[6]{-1} 2^{5/6} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 243, 3125, 729, 6, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 10, -2, 0, 0, -2, -2, 5, 10, -2, 10, -2, 0, 10, 5, 0, 10, 0, -2, -2, 10, 0, 5, -2, 0, 10}$.\n", - "Output Answer": [ - "$\\{0,-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 10, -2, 0, 0, -2, -2, 5, 10, -2, 10, -2, 0, 10, 5, 0, 10, 0, -2, -2, 10, 0, 5, -2, 0, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 9, -\\frac{47}{5}, -\\frac{7}{5}, 9, 3, -\\frac{7}{5}, 3, 3, -\\frac{7}{5}, -\\frac{7}{5}, -\\frac{47}{5}, -\\frac{47}{5}, 9, 9, 9, 3, -\\frac{7}{5}, -\\frac{7}{5}, 3, -\\frac{7}{5}, 3, -\\frac{7}{5}, 9}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{7}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 9, -(47/5), -(7/5), 9, 3, -(7/5), 3, 3, -(7/5), -(7/5), -(47/5), -(47/5), 9, 9, 9, 3, -(7/5), -(7/5), 3, -(7/5), 3, -(7/5), 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 13, -14, -10}$.\n", - "Output Answer": [ - "$\\frac{1795}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 13, -14, -10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -e, -2, 4 \\sqrt{3}, 8, 3}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -math.e, -2, 4*math.sqrt(3), 8, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.139,0.139,0.288,0.079\\}$ and $\\{0.266,0.291,0.03,0.006\\}$.", - "Output Answer": [ - "$0.94$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.139, 0.139, 0.288, 0.079\ndistribution2 = 0.266, 0.291, 0.03, 0.006\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{2}, -7 \\sqrt{2}, -3 \\sqrt{2}, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{13}{2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(2), -7*math.sqrt(2), -3*math.sqrt(2), -7*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, 10, 10, 10, -2, 0, -2, -2, -2, 10, 0, 10, 10, -2, 10, 10, 0, 10, 10, 10, -2, 0, 0}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, 10, 10, 10, -2, 0, -2, -2, -2, 10, 0, 10, 10, -2, 10, 10, 0, 10, 10, 10, -2, 0, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${10 \\log (2), 2, \\frac{16}{5}, 4 \\sqrt{3}, -6, 2}$.\n", - "Output Answer": [ - "$6+10 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 10*math.log(2), 2, (16/5), 4*math.sqrt(3), -6, 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, -2, -4, 9, -2, 4, -2, -2, -2, -2, -2, -4, 9, -4, -4, 4, 4, -2, -2, -2, -4, -4, -2, -4, -2, 9, -2, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, -2, -4, 9, -2, 4, -2, -2, -2, -2, -2, -4, 9, -4, -4, 4, 4, -2, -2, -2, -4, -4, -2, -4, -2, 9, -2, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-12 \\log (2), 6 \\sqrt{2}, -6, -7, -1, -8, 0, 5}$.", - "Output Answer": [ - "$-\\frac{7}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -12*math.log(2), 6*math.sqrt(2), -6, -7, -1, -8, 0, 5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{5}, 4, -10, 4 \\sqrt{3}, -1, e, 2, -4 \\sqrt{5}, -\\frac{15}{\\sqrt{\\pi }}, 3 \\sqrt{2}, 6, -3, \\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$10+4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/5), 4, -10, 4*math.sqrt(3), -1, math.e, 2, -4*math.sqrt(5), -(15/(math.sqrt(math.pi))), 3*math.sqrt(2), 6, -3, (7/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, 4, -5}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 4, -5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{2}, 6, 10}$.\n", - "Output Answer": [ - "$10+2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(2), 6, 10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, -\\frac{11}{\\sqrt{3}}, 4, -1.648, 3}$.\n", - "Output Answer": [ - "${-7, -\\frac{11}{\\sqrt{3}}, -1.648, 3, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -(11/(math.sqrt(3))), 4, -1.648, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x+1.4$ where $x \\sim $ \\text{PoissonDistribution}[0.8]\n", - "Output Answer": [ - "$1.56$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.8)\nprint(E(0.2*x+1.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 4, 2, -14, -13}$.\n", - "Output Answer": [ - "$\\frac{153}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 4, 2, -14, -13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${7, -7, -5}$.\n", - "Output Answer": [ - "$\\frac{172}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -7, -5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1.29, \\log (2), 8, 0, -8, -7} \\cup {0, 1, -5, 1.29, -10, \\log (2)}$.\n", - "Output Answer": [ - "${-10, -8, -7, -5, 0, \\log (2), 1, 1.29, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((1.29, math.log(2), 8, 0, -8, -7,))\nsnd = set((0, 1, -5, 1.29, -10, math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{15}{\\pi }, -10, 5, -10, 2, 6, -4 \\sqrt{5}, -8, 10, 2 \\sqrt{5}, 8, 7, -9, -\\frac{3}{\\sqrt{2}}, 3}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(15/math.pi), -10, 5, -10, 2, 6, -4*math.sqrt(5), -8, 10, 2*math.sqrt(5), 8, 7, -9, -(3/(math.sqrt(2))), 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{11}{\\sqrt{3}}, 5, 8, 2 \\sqrt{3}, 9, 0, 3, 4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+2 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(11/(math.sqrt(3))), 5, 8, 2*math.sqrt(3), 9, 0, 3, 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x+4.1$ where $x \\sim $ \\text{BetaDistribution}[1.1,0.9]\n", - "Output Answer": [ - "$4.71$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.1, 0.9)\nprint(E(1.1*x+4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -\\frac{35}{4}, 3, \\frac{31}{4}}$.\n", - "Output Answer": [ - "$-\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -(35/4), 3, (31/4)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, 5, -7, 0, 7, \\frac{6}{\\pi }} \\setminus {-7, -2, 6, 2, \\frac{6}{\\pi }, 0, 5, 7}$.\n", - "Output Answer": [ - "${-4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 5, -7, 0, 7, (6/math.pi),))\nsnd = set((-7, -2, 6, 2, (6/math.pi), 0, 5, 7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -5*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $2.9 x+0.3 < 2.3$ where $x \\sim $ \\text{ExponentialDistribution}[0.2].", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(P((2.9*x+0.3 < 2.3)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -\\frac{16}{\\sqrt{5}}, -5, -8, -3 \\sqrt{5}, -e, \\frac{24}{5}, -\\frac{16}{\\pi }, -4 \\sqrt{3}, -5 \\sqrt{2}, 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "$8+6 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(16/(math.sqrt(5))), -5, -8, -3*math.sqrt(5), -math.e, (24/5), -(16/math.pi), -4*math.sqrt(3), -5*math.sqrt(2), 6*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 16, 9, 11}$.\n", - "Output Answer": [ - "$\\frac{6336}{617}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 16, 9, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3, \\frac{37}{4}, -10 \\log (2), -5, 8} \\setminus {9.31, 0, \\frac{1}{4}}$.\n", - "Output Answer": [ - "${-10 \\log (2), -5, 3, 8, \\frac{37}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, (37/4), -10*math.log(2), -5, 8,))\nsnd = set((9.31, 0, (1/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -\\frac{15}{2}, -\\frac{15}{2}, -4, -\\frac{1}{2}, -\\frac{5}{2}, -\\frac{1}{2}, -\\frac{13}{2}, -\\frac{19}{2}, -\\frac{19}{2}, 8, -4, -\\frac{1}{2}, -\\frac{5}{2}, 8, -\\frac{15}{2}, -\\frac{19}{2}, -4, -\\frac{13}{2}, -\\frac{15}{2}, 8, -\\frac{13}{2}, -\\frac{19}{2}, -\\frac{15}{2}, -\\frac{5}{2}, 8, 8, -\\frac{1}{2}, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\left\\{8,-\\frac{15}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -(15/2), -(15/2), -4, -(1/2), -(5/2), -(1/2), -(13/2), -(19/2), -(19/2), 8, -4, -(1/2), -(5/2), 8, -(15/2), -(19/2), -4, -(13/2), -(15/2), 8, -(13/2), -(19/2), -(15/2), -(5/2), 8, 8, -(1/2), -(15/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10, -8, -8, -3, 5, -3, -8, 10, -9, -9, 10, 10, -9, -8, -9, 3, -3, 5, 3, 10}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 10, -8, -8, -3, 5, -3, -8, 10, -9, -9, 10, 10, -9, -8, -9, 3, -3, 5, 3, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, 7, -5, -3}$.\n", - "Output Answer": [ - "${-5, -3, -2, 7}$" - ], - "Output Program": [ - "values = -2, 7, -5, -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5 \\sqrt{3}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{3}, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(3), -2*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 19, 3, 10}$.\n", - "Output Answer": [ - "$\\frac{2280}{847}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 19, 3, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -7, -8, -5, -9, -7, 8, -7, -8, -7, -8, -8, -7, -9, -9, 0, 0, -7, 2, -5, -9}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -7, -8, -5, -9, -7, 8, -7, -8, -7, -8, -8, -7, -9, -9, 0, 0, -7, 2, -5, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -11 \\log (2), 7 \\sqrt{2}, -3 e, -8.348, \\frac{33}{4}} \\setminus {7 \\sqrt{2}, -3 e, 6, 2 e, 9, -8.348}$.\n", - "Output Answer": [ - "${-11 \\log (2), -3, \\frac{33}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -11*math.log(2), 7*math.sqrt(2), -3*math.e, -8.348, (33/4),))\nsnd = set((7*math.sqrt(2), -3*math.e, 6, 2*math.e, 9, -8.348,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, 11, 5, 5, -7, -11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{943}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 11, 5, 5, -7, -11\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, \\frac{20}{e}, -2 \\sqrt{5}, -2, -3 \\pi, -9, 8}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -2 \\sqrt{5}, -2, 1, \\frac{20}{e}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, (20/math.e), -2*math.sqrt(5), -2, -3*math.pi, -9, 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x-2.8$ where $x \\sim $ \\text{BetaDistribution}[1.4,0.9]\n", - "Output Answer": [ - "$-2.25$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.4, 0.9)\nprint(E(0.9*x-2.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, \\frac{23}{e}, \\frac{20}{\\pi }, 3, \\sqrt{3}, -3, 4 \\sqrt{5}, -\\frac{50}{7}}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, (23/math.e), (20/math.pi), 3, math.sqrt(3), -3, 4*math.sqrt(5), -(50/7)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, 100, 81, -6}$.\n", - "Output Answer": [ - "$6 \\sqrt{15}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 100, 81, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 8, 2, 0, 3, 0}$.\n", - "Output Answer": [ - "$10$" - ], - "Output Program": [ - "values = -2, 8, 2, 0, 3, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 5, 6, -1, -2, -6}$.\n", - "Output Answer": [ - "$-\\frac{1}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 5, 6, -1, -2, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5.1, -6, 7, -\\frac{17}{2}, 6} \\setminus {6, 7, -\\frac{17}{2}, -6.7, -6, -\\frac{11}{2}, 10, -9, \\frac{17}{e}}$.\n", - "Output Answer": [ - "${5.1}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.1, -6, 7, -(17/2), 6,))\nsnd = set((6, 7, -(17/2), -6.7, -6, -(11/2), 10, -9, (17/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{17}{\\sqrt{5}}, -7, -9, 3, -4, -\\log (2), -10, \\frac{27}{5}}$.\n", - "Output Answer": [ - "$\\frac{77}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(17/(math.sqrt(5))), -7, -9, 3, -4, -math.log(2), -10, (27/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -8, 2 \\sqrt{5}, -9 \\log (2), 10, \\frac{17}{2}, -\\frac{1}{2}, 4} \\cup {-\\frac{17}{2}, -3 \\sqrt{5}, 6, 10, 5, -8, -6, \\frac{9}{2}, -9 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, -8, -3 \\sqrt{5}, -9 \\log (2), -6, -\\frac{1}{2}, 4, 2 \\sqrt{5}, \\frac{9}{2}, 5, 6, \\frac{17}{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -8, 2*math.sqrt(5), -9*math.log(2), 10, (17/2), -(1/2), 4,))\nsnd = set((-(17/2), -3*math.sqrt(5), 6, 10, 5, -8, -6, (9/2), -9*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x+2.7$ where $x \\sim $ \\text{BetaDistribution}[1.8,1.3]\n", - "Output Answer": [ - "$4.33$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.8, 1.3)\nprint(E(2.8*x+2.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.4 x-0.9 < 0.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8].", - "Output Answer": [ - "$0.99$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(P((0.4*x-0.9 < 0.5)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.5 x^2+3.3 x-2.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.5]\n", - "Output Answer": [ - "$-0.95$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.5)\nprint(E(3.5*x**2+3.3*x-2.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{e}, -1, -\\frac{29}{\\pi }, -9, -2 e, -\\frac{25}{e}, 9, -e, 0, -8, 3, -\\frac{17}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$9+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/math.e), -1, -(29/math.pi), -9, -2*math.e, -(25/math.e), 9, -math.e, 0, -8, 3, -(17/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 e, 8, 9, -3}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, 8, 9, -3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, -1, 8, -1, 1}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, -1, 8, -1, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^2-2.2 x+3.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.6]\n", - "Output Answer": [ - "$-21.83$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.6)\nprint(E(-3.9*x**2-2.2*x+3.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 e, -\\frac{9}{2}, -2, -6, -\\frac{5}{4}, 6, \\frac{31}{4}, -5 \\log (2), -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{55}{4}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, -(9/2), -2, -6, -(5/4), 6, (31/4), -5*math.log(2), -(3/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{2}{e}, -\\frac{9}{e}, -\\frac{5}{e}, -\\frac{24}{e}, -\\frac{13}{e}, \\frac{26}{e}, -\\frac{1}{e}}$.\n", - "Output Answer": [ - "$-\\frac{24}{7 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (2/math.e), -(9/math.e), -(5/math.e), -(24/math.e), -(13/math.e), (26/math.e), -(1/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 3, 3, 8}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "values = -7, 3, 3, 8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{5}, 0, -3 \\sqrt{5}, 2 \\sqrt{5}, -3 \\sqrt{5}, \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$-\\frac{5 \\sqrt{5}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(5), 0, -3*math.sqrt(5), 2*math.sqrt(5), -3*math.sqrt(5), math.sqrt(5), 2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, -1, -2 \\sqrt{5}, 8}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, -1, -1, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -1, -2*math.sqrt(5), 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -4, 9, -10, -\\frac{7}{e}, 4, 10 \\log (2), -2, -\\frac{10}{e}, \\frac{34}{7}, -9 \\log (2), -\\frac{14}{3}, -10, \\frac{16}{\\sqrt{\\pi }}, -8}$.\n", - "Output Answer": [ - "$10+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -4, 9, -10, -(7/math.e), 4, 10*math.log(2), -2, -(10/math.e), (34/7), -9*math.log(2), -(14/3), -10, (16/(math.sqrt(math.pi))), -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 e, -2 e, 0, -2 e, 0, 3 e}$.\n", - "Output Answer": [ - "$-\\frac{e}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.e, -2*math.e, 0, -2*math.e, 0, 3*math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -\\frac{47}{7}, -\\frac{16}{e}}$.\n", - "Output Answer": [ - "$\\frac{19}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -(47/7), -(16/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -0.6, -13 \\log (2), \\frac{2}{\\pi }, -\\frac{2}{5}, 8, 10, \\frac{14}{3}} \\cup {10, -0.6, 8, -8, \\frac{4}{5}, -\\frac{5}{\\sqrt{2}}, -13 \\log (2)}$.\n", - "Output Answer": [ - "${-13 \\log (2), -9, -8, -\\frac{5}{\\sqrt{2}}, -0.6, -\\frac{2}{5}, \\frac{2}{\\pi }, \\frac{4}{5}, \\frac{14}{3}, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -0.6, -13*math.log(2), (2/math.pi), -(2/5), 8, 10, (14/3),))\nsnd = set((10, -0.6, 8, -8, (4/5), -(5/(math.sqrt(2))), -13*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{7}{\\sqrt{2}}, 6 \\sqrt{2}, 3 \\sqrt{2}, 4 \\sqrt{2}, 0, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\frac{7}{\\sqrt{2}}+16 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (7/(math.sqrt(2))), 6*math.sqrt(2), 3*math.sqrt(2), 4*math.sqrt(2), 0, 3*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 9, 2, 3, 1, -3}$.\n", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 9, 2, 3, 1, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{42}{5}, 7, -10, 7, -8, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-10, -\\frac{42}{5}, -8, 2 \\sqrt{3}, 7, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(42/5), 7, -10, 7, -8, 2*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\log (2), -2, 0, -\\frac{11}{\\sqrt{3}}, -5.85, 9, 1, -7, -3 \\sqrt{3}, -4} \\cup {-4 \\sqrt{5}, 2 \\sqrt{3}, 8, 4, -2, -5.85, -\\log (2), -\\frac{11}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -7, -\\frac{11}{\\sqrt{3}}, -5.85, -3 \\sqrt{3}, -4, -2, -\\log (2), 0, 1, 2 \\sqrt{3}, 4, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.log(2), -2, 0, -(11/(math.sqrt(3))), -5.85, 9, 1, -7, -3*math.sqrt(3), -4,))\nsnd = set((-4*math.sqrt(5), 2*math.sqrt(3), 8, 4, -2, -5.85, -math.log(2), -(11/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{15}{4}, \\frac{7}{\\sqrt{\\pi }}, 9, 6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(6+\\frac{7}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(15/4), (7/(math.sqrt(math.pi))), 9, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, 6 \\sqrt{2}, -2, -9, -5, -4, 6, -10, 0, -9}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, 6*math.sqrt(2), -2, -9, -5, -4, 6, -10, 0, -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, -2, 4, -9, -\\frac{10}{\\sqrt{\\pi }}, \\frac{31}{5}, 2, 6, 5, \\frac{1}{2}, 6, 0}$.\n", - "Output Answer": [ - "$\\frac{76}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -2, 4, -9, -(10/(math.sqrt(math.pi))), (31/5), 2, 6, 5, (1/2), 6, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, -27, 64}$.\n", - "Output Answer": [ - "$12 \\sqrt[3]{-1} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, -27, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\sqrt{2}, \\frac{66}{7}, 3 \\sqrt{2}} \\setminus {-\\frac{3}{7}, \\sqrt{2}, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${3 \\sqrt{2}, \\frac{66}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(2), (66/7), 3*math.sqrt(2),))\nsnd = set((-(3/7), math.sqrt(2), 4*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{29}{2}, 17, 14}$.\n", - "Output Answer": [ - "$\\frac{20706}{1375}$" - ], - "Output Program": [ - "import statistics\nvalues = (29/2), 17, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, 0, -9, 7, -5}$.\n", - "Output Answer": [ - "$-\\frac{2}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, 0, -9, 7, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.028,0.139,0.101,0.109,0.19,0.067,0.138,0.061\\}$ and $\\{0.247,0.109,0.05,0.086,0.015,0.038,0.095,0.334\\}$.", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.028, 0.139, 0.101, 0.109, 0.19, 0.067, 0.138, 0.061\ndistribution2 = 0.247, 0.109, 0.05, 0.086, 0.015, 0.038, 0.095, 0.334\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{58}{7}, -7, 5, 6, \\frac{27}{e}}$.\n", - "Output Answer": [ - "${-\\frac{58}{7}, -7, 5, 6, \\frac{27}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(58/7), -7, 5, 6, (27/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\log (2), -7 \\log (2), 9 \\log (2), -2 \\log (2)}$.\n", - "Output Answer": [ - "$-\\log (2)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.log(2), -7*math.log(2), 9*math.log(2), -2*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, 3, -6, \\frac{1}{\\sqrt{5}}, 4}$.\n", - "Output Answer": [ - "${-7, -6, \\frac{1}{\\sqrt{5}}, 3, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 3, -6, (1/(math.sqrt(5))), 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, 0, -3, \\frac{20}{e}} \\setminus {10, 7, \\pi, -10}$.\n", - "Output Answer": [ - "${-3, 0, 2, \\frac{20}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 0, -3, (20/math.e),))\nsnd = set((10, 7, math.pi, -10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, -5, -11, 4, -1}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -5, -11, 4, -1\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{3}, 5, -\\frac{20}{7}, -4 \\sqrt{3}, -5.} \\setminus {5, -4, \\frac{13}{\\sqrt{3}}, \\frac{3}{e}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -5., -\\frac{20}{7}, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(3), 5, -(20/7), -4*math.sqrt(3), -5.,))\nsnd = set((5, -4, (13/(math.sqrt(3))), (3/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 15, 14, 8}$.\n", - "Output Answer": [ - "$\\frac{672}{61}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 15, 14, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, -7, 6, 8, 13, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{3473}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -7, 6, 8, 13, 8\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${216, -1, 64, 3, 8}$.\n", - "Output Answer": [ - "$4 \\sqrt[5]{-1} 2^{2/5} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 216, -1, 64, 3, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 e, 2, -4, -\\frac{19}{2}} \\cup {-e, -4, \\frac{1}{2}, 2}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -3 e, -4, -e, \\frac{1}{2}, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.e, 2, -4, -(19/2),))\nsnd = set((-math.e, -4, (1/2), 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 4, 12, 16}$.\n", - "Output Answer": [ - "$\\frac{2112}{257}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 4, 12, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.2 x+3.4$ where $x \\sim $ \\text{BetaDistribution}[1.4,1.5]\n", - "Output Answer": [ - "$5.43$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.4, 1.5)\nprint(E(4.2*x+3.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, 4, -15, -14}$.\n", - "Output Answer": [ - "$\\frac{454}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 4, -15, -14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 5 \\sqrt{2}, 6, -\\pi, -\\frac{37}{7}, 0, -\\frac{27}{4}, 0}$.\n", - "Output Answer": [ - "$7+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 5*math.sqrt(2), 6, -math.pi, -(37/7), 0, -(27/4), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3. x+3.$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$3.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(3.*x+3.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 9, -6, 6, 2, 9, -6, 7, 6, 2, 9, -6, 7, 2, 9, 7, -6, 6, -6, -6, 9, 6, -6}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 9, -6, 6, 2, 9, -6, 7, 6, 2, 9, -6, 7, 2, 9, 7, -6, 6, -6, -6, 9, 6, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.068,0.125,0.279,0.155,0.066,0.196\\}$ and $\\{0.279,0.347,0.007,0.022,0.011,0.32\\}$.", - "Output Answer": [ - "$1.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.068, 0.125, 0.279, 0.155, 0.066, 0.196\ndistribution2 = 0.279, 0.347, 0.007, 0.022, 0.011, 0.32\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x^3+2.7 x^2-3.9 x-2.8$ where $x \\sim $ \\text{NormalDistribution}[-0.8,1.3]\n", - "Output Answer": [ - "$-2.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 1.3)\nprint(E(2.*x**3+2.7*x**2-3.9*x-2.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, 10, -9, -11, -15, -11}$.\n", - "Output Answer": [ - "$\\frac{408}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 10, -9, -11, -15, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x^2-0.6 x+2.8$ where $x \\sim $ \\text{NormalDistribution}[0.3,2.1]\n", - "Output Answer": [ - "$12.97$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.3, 2.1)\nprint(E(2.3*x**2-0.6*x+2.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, 3 \\sqrt{3}, -5, -8, \\frac{28}{3}, -\\frac{19}{e}}$.\n", - "Output Answer": [ - "${-8, -\\frac{19}{e}, -5, 3 \\sqrt{3}, 9, \\frac{28}{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 3*math.sqrt(3), -5, -8, (28/3), -(19/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.8 x^2-0.9 x+4.4$ where $x \\sim $ \\text{NormalDistribution}[0.6,2.2]\n", - "Output Answer": [ - "$-5.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.6, 2.2)\nprint(E(-1.8*x**2-0.9*x+4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.012,0.042,0.092,0.116,0.063,0.112,0.222,0.142\\}$ and $\\{0.079,0.074,0.047,0.12,0.098,0.15,0.055,0.076,0.163\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.012, 0.042, 0.092, 0.116, 0.063, 0.112, 0.222, 0.142\ndistribution2 = 0.079, 0.074, 0.047, 0.12, 0.098, 0.15, 0.055, 0.076, 0.163\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -3 \\sqrt{3}, 5, -9, 4 \\sqrt{2}, 4 \\sqrt{2}, \\frac{31}{7}, -6, 8, -5 \\sqrt{3}, 7, 11 \\log (2), \\frac{7}{\\sqrt{3}}, -9}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -3*math.sqrt(3), 5, -9, 4*math.sqrt(2), 4*math.sqrt(2), (31/7), -6, 8, -5*math.sqrt(3), 7, 11*math.log(2), (7/(math.sqrt(3))), -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 10, 4, 1}$.\n", - "Output Answer": [ - "$\\frac{17}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 10, 4, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 5, -9, -9, -2, 1, -2, 4, 5, 5, -2, 4, -9, 4, 5, 4, 5, 5, -9, 1, 1, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 5, -9, -9, -2, 1, -2, 4, 5, 5, -2, 4, -9, 4, 5, 4, 5, 5, -9, 1, 1, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\pi, -1, 2, 9, \\frac{31}{5}, -2, 2, -3 \\sqrt{5}, -6, 6, 1, 7, -2, 1}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.pi, -1, 2, 9, (31/5), -2, 2, -3*math.sqrt(5), -6, 6, 1, 7, -2, 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -2, -9, 10, -9, 6, -2, -6, -9, -9, -6, 6, -6, -9, 10, -2, -6, -6, -9, -9, 6, 6, 6, -9, -6, 6, -2}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -2, -9, 10, -9, 6, -2, -6, -9, -9, -6, 6, -6, -9, 10, -2, -6, -6, -9, -9, 6, 6, 6, -9, -6, 6, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{27}{2}, \\frac{11}{2}, \\frac{9}{2}}$.\n", - "Output Answer": [ - "$\\frac{891}{142}$" - ], - "Output Program": [ - "import statistics\nvalues = (27/2), (11/2), (9/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{2}, 12, \\frac{3}{2}, \\frac{23}{2}}$.\n", - "Output Answer": [ - "$\\frac{368}{85}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/2), 12, (3/2), (23/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 9, 125, 16}$.\n", - "Output Answer": [ - "$6 \\sqrt{3} 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 9, 125, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x-4.3$ where $x \\sim $ \\text{NormalDistribution}[1.,1.3]\n", - "Output Answer": [ - "$-2.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1., 1.3)\nprint(E(2.3*x-4.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-10, -5, 3 \\sqrt{3}, -4} \\setminus {-4, 0, -10, \\frac{22}{5}, -\\frac{10}{e}, -7, -1, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-5, 3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, -5, 3*math.sqrt(3), -4,))\nsnd = set((-4, 0, -10, (22/5), -(10/math.e), -7, -1, 2*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 7, -7, 6, 6, -8, 7, -7, -7, 6, 7, 6, 7, 8, -7, 8, 7, -7, -7, 6, -7, 6, -8, 6, 6, 8, 7, 7}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 7, -7, 6, 6, -8, 7, -7, -7, 6, 7, 6, 7, 8, -7, 8, 7, -7, -7, 6, -7, 6, -8, 6, 6, 8, 7, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, 8, 1, -3}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "values = -8, 8, 1, -3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-1.56 < -4. x^2-2.7 x+4.3 < 5.78$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5].", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(P((-1.56 < -4.*x**2-2.7*x+4.3) & (-4.*x**2-2.7*x+4.3 < 5.78)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, \\frac{20}{3}, 1, 4, -2, 2 e, -4, -4, \\frac{11}{2}, 4 \\sqrt{3}, -2, 8, -9}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (20/3), 1, 4, -2, 2*math.e, -4, -4, (11/2), 4*math.sqrt(3), -2, 8, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.088,0.054,0.28,0.055,0.094,0.167,0.145\\}$ and $\\{0.131,0.128,0.054,0.059,0.099,0.093,0.255\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.088, 0.054, 0.28, 0.055, 0.094, 0.167, 0.145\ndistribution2 = 0.131, 0.128, 0.054, 0.059, 0.099, 0.093, 0.255\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -9, 4, 8, 0, -7, 6, 6, 8, -7, 0, 4, -9, -9, 8, 4, 6, 0, -7, 0, -9, -2, 6, -7, -7, 4, 8, 8}$.\n", - "Output Answer": [ - "$\\{4,8,-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -9, 4, 8, 0, -7, 6, 6, 8, -7, 0, 4, -9, -9, 8, 4, 6, 0, -7, 0, -9, -2, 6, -7, -7, 4, 8, 8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, \\frac{10}{e}, 0, -6}$.\n", - "Output Answer": [ - "$6+\\frac{10}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, (10/math.e), 0, -6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 11, -3, -4, 3}$.\n", - "Output Answer": [ - "$\\frac{853}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 11, -3, -4, 3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -13, 14}$.\n", - "Output Answer": [ - "$\\sqrt{201}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -13, 14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, -3, 5, 8, 13, -9}$.\n", - "Output Answer": [ - "$\\frac{544}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -3, 5, 8, 13, -9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 8, 1, -7, 8, -9, 10, 7, 8, 8, 1, -1, 10, 1, 8, -7, 10, 8, 10, -9}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 8, 1, -7, 8, -9, 10, 7, 8, 8, 1, -1, 10, 1, 8, -7, 10, 8, 10, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 3, -7, 6, -5} \\setminus {-7, 6, \\frac{25}{\\pi }, 9}$.\n", - "Output Answer": [ - "${-5, -1, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 3, -7, 6, -5,))\nsnd = set((-7, 6, (25/math.pi), 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -3, -4 \\sqrt{2}} \\setminus {-4 \\sqrt{2}, 6, 2, \\frac{15}{e}}$.\n", - "Output Answer": [ - "${-7, -3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -3, -4*math.sqrt(2),))\nsnd = set((-4*math.sqrt(2), 6, 2, (15/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 e, 2 e, 2 e, 0, 2 e, 2 e, -3 e, 2 e}$.\n", - "Output Answer": [ - "$\\frac{5 e}{8}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.e, 2*math.e, 2*math.e, 0, 2*math.e, 2*math.e, -3*math.e, 2*math.e\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, 0, 14 \\log (2), -8, -\\pi, -6, 6, \\frac{9}{2}, 4 \\sqrt{3}, -8, 6 \\sqrt{2}, 0, -2}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, 0, 14*math.log(2), -8, -math.pi, -6, 6, (9/2), 4*math.sqrt(3), -8, 6*math.sqrt(2), 0, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, 4 \\sqrt{3}, 4, -3 e, 8.53, -\\frac{13}{\\pi }, -1.94}$.\n", - "Output Answer": [ - "${-3 e, -\\frac{13}{\\pi }, -1.94, 4, 4 \\sqrt{3}, 8.53, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 4*math.sqrt(3), 4, -3*math.e, 8.53, -(13/math.pi), -1.94\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, 5 \\sqrt{2}, -2 e, -10, \\frac{17}{3}, -1.694}$.\n", - "Output Answer": [ - "${-10, -8, -2 e, -1.694, \\frac{17}{3}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 5*math.sqrt(2), -2*math.e, -10, (17/3), -1.694\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{22}{\\sqrt{5}}, -2, -\\frac{26}{7}, 0, 1, -\\frac{9}{2}} \\setminus {0, \\frac{22}{\\sqrt{5}}, 1, 3 \\sqrt{3}, -7, -\\frac{26}{7}, -2}$.\n", - "Output Answer": [ - "${-\\frac{9}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((22/(math.sqrt(5))), -2, -(26/7), 0, 1, -(9/2),))\nsnd = set((0, (22/(math.sqrt(5))), 1, 3*math.sqrt(3), -7, -(26/7), -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 2 \\sqrt{5}, -1, 3 \\sqrt{2}, -\\frac{8}{\\sqrt{\\pi }}, \\frac{31}{7}, 7, 4 \\sqrt{3}, \\frac{1}{2}, 10, \\frac{31}{4}}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 2*math.sqrt(5), -1, 3*math.sqrt(2), -(8/(math.sqrt(math.pi))), (31/7), 7, 4*math.sqrt(3), (1/2), 10, (31/4)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${3, -59049, 1296, -5, -1000, 4}$.\n", - "Output Answer": [ - "$18 \\sqrt[6]{-1} 5^{2/3} \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -59049, 1296, -5, -1000, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, 9, 14, 5}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{619}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 9, 14, 5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 256, 81, 1296}$.\n", - "Output Answer": [ - "$144 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 256, 81, 1296\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{21}{\\pi }, -4.015, -7, -6, 5, -10 \\log (2)} \\setminus {2, -6, 5}$.\n", - "Output Answer": [ - "${-7, -10 \\log (2), -4.015, \\frac{21}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((21/math.pi), -4.015, -7, -6, 5, -10*math.log(2),))\nsnd = set((2, -6, 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 9, 10, \\frac{3}{2}}$.\n", - "Output Answer": [ - "$\\frac{2520}{643}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 9, 10, (3/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{2}{5}, -\\frac{43}{5}, -\\frac{2}{5}, \\frac{2}{5}, -\\frac{43}{5}, -\\frac{43}{5}, -\\frac{37}{5}, \\frac{38}{5}, \\frac{38}{5}, -\\frac{43}{5}, \\frac{38}{5}, \\frac{38}{5}, \\frac{2}{5}, -\\frac{43}{5}, -\\frac{24}{5}, -\\frac{24}{5}, \\frac{2}{5}, \\frac{38}{5}, -\\frac{2}{5}, \\frac{2}{5}, -\\frac{37}{5}, -\\frac{2}{5}, \\frac{38}{5}, -\\frac{37}{5}, \\frac{36}{5}, -\\frac{24}{5}, -\\frac{37}{5}, -\\frac{24}{5}, \\frac{2}{5}, \\frac{2}{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{2}{5},\\frac{38}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(2/5), -(43/5), -(2/5), (2/5), -(43/5), -(43/5), -(37/5), (38/5), (38/5), -(43/5), (38/5), (38/5), (2/5), -(43/5), -(24/5), -(24/5), (2/5), (38/5), -(2/5), (2/5), -(37/5), -(2/5), (38/5), -(37/5), (36/5), -(24/5), -(37/5), -(24/5), (2/5), (2/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4.37, -\\frac{24}{7}, 6, -10, -6, 2} \\cup {-7 \\sqrt{2}, -7.65, -10, -\\frac{40}{7}, 8, -\\frac{24}{7}, 6, -6}$.\n", - "Output Answer": [ - "${-10, -7 \\sqrt{2}, -7.65, -6, -\\frac{40}{7}, -\\frac{24}{7}, 2, 4.37, 6, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((4.37, -(24/7), 6, -10, -6, 2,))\nsnd = set((-7*math.sqrt(2), -7.65, -10, -(40/7), 8, -(24/7), 6, -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{16}{e}, \\frac{2}{e}, -\\frac{9}{e}, -\\frac{19}{e}, \\frac{20}{e}, -\\frac{26}{e}, -\\frac{11}{e}}$.\n", - "Output Answer": [ - "$-\\frac{27}{7 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (16/math.e), (2/math.e), -(9/math.e), -(19/math.e), (20/math.e), -(26/math.e), -(11/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, 2, 15, 5}$.\n", - "Output Answer": [ - "$\\frac{137}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 2, 15, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 9, 25, 3, -32}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-1} 15^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 9, 25, 3, -32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, 25, -2}$.\n", - "Output Answer": [ - "$5^{2/3} \\sqrt[3]{14}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 25, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, -2 \\sqrt{3}, 10}$.\n", - "Output Answer": [ - "${-5, -2 \\sqrt{3}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -2*math.sqrt(3), 10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{3}{2}, -8, -8, 1, -2, -1, 0, -8, 0, \\frac{13}{\\sqrt{5}}, -2}$.", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(3/2), -8, -8, 1, -2, -1, 0, -8, 0, (13/(math.sqrt(5))), -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, 6, 8, -\\frac{14}{5}, 7 \\log (2), -3 \\sqrt{3}, \\frac{3}{\\sqrt{5}}, -\\frac{4}{5}, -4}$.", - "Output Answer": [ - "$\\frac{3}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, 6, 8, -(14/5), 7*math.log(2), -3*math.sqrt(3), (3/(math.sqrt(5))), -(4/5), -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -9, 4, -4, 13, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{851}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -9, 4, -4, 13, -9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, \\frac{11}{3}, -\\frac{19}{\\sqrt{5}}, 0.924}$.\n", - "Output Answer": [ - "${-\\frac{19}{\\sqrt{5}}, -5, 0.924, \\frac{11}{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, (11/3), -(19/(math.sqrt(5))), 0.924\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -7, 9, -3, -12}$.\n", - "Output Answer": [ - "$\\frac{617}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -7, 9, -3, -12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, -7, 7, 0, 0, -9}$.\n", - "Output Answer": [ - "$\\frac{1169}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -7, 7, 0, 0, -9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9.27, -10, -3, 4., 10} \\cup {10, -7, 4, -10, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-10, -9.27, -5 \\sqrt{2}, -7, -3, 4., 4, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9.27, -10, -3, 4., 10,))\nsnd = set((10, -7, 4, -10, -5*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 5, -2, 5, -3, -3, -2, -3, -2, -2, -3, 5, -3, -2, 5, 5, -3, -3, -2, 5}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 5, -2, 5, -3, -3, -2, -3, -2, -2, -3, 5, -3, -2, 5, 5, -3, -3, -2, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 16, 16807, -4, -216, 1024}$.\n", - "Output Answer": [ - "$8 \\sqrt[6]{2} \\sqrt{3} \\sqrt[3]{5} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 16, 16807, -4, -216, 1024\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{10}{\\sqrt{\\pi }}, 2, -2, -\\frac{18}{\\sqrt{5}}, -\\frac{1}{\\sqrt{2}}, 3 \\sqrt{2}, -0.583} \\setminus {-2, -\\frac{18}{\\sqrt{5}}, -6, 3 \\sqrt{2}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{2}}, -9.557, 2}$.\n", - "Output Answer": [ - "${-\\frac{10}{\\sqrt{\\pi }}, -0.583}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(10/(math.sqrt(math.pi))), 2, -2, -(18/(math.sqrt(5))), -(1/(math.sqrt(2))), 3*math.sqrt(2), -0.583,))\nsnd = set((-2, -(18/(math.sqrt(5))), -6, 3*math.sqrt(2), -(15/(math.sqrt(math.pi))), -(1/(math.sqrt(2))), -9.557, 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{13}{\\sqrt{2}}, 6 \\sqrt{2}, -4 \\sqrt{2}, 2 \\sqrt{2}, -7 \\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\frac{13}{\\sqrt{2}}+2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (13/(math.sqrt(2))), 6*math.sqrt(2), -4*math.sqrt(2), 2*math.sqrt(2), -7*math.sqrt(2), 5*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${5, -13, -3, 2, 8, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{547}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -13, -3, 2, 8, -2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\pi, 3 \\pi, -3 \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$-\\pi$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.pi, 3*math.pi, -3*math.pi, -2*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 5, 0, 9}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "values = 6, 5, 0, 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, -8, 3, 3, -8, -9, -8, 3, -9, -8, -10, 6, 6, 3, -8, -8, 3, -8, -10, -8, 8, -8, 6, -8}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, -8, 3, 3, -8, -9, -8, 3, -9, -8, -10, 6, 6, 3, -8, -8, 3, -8, -10, -8, 8, -8, 6, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8, -8, 0, -7, -2 e} \\cup {-2 e, 1, 8, 6, -\\pi}$.\n", - "Output Answer": [ - "${-8, -7, -2 e, -\\pi, 0, 1, 6, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -8, 0, -7, -2*math.e,))\nsnd = set((-2*math.e, 1, 8, 6, -math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.15,0.163,0.199,0.108,0.128,0.106,0.098\\}$ and $\\{0.314,0.129,0.076,0.081,0.08,0.118,0.089\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.15, 0.163, 0.199, 0.108, 0.128, 0.106, 0.098\ndistribution2 = 0.314, 0.129, 0.076, 0.081, 0.08, 0.118, 0.089\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -1, -7}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "values = -6, -1, -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 8, -5, -8, 0, -7, -4 \\log (2), 6} \\cup {-9, 6, -7, 10 \\log (2), 0, -5, 8}$.\n", - "Output Answer": [ - "${-9, -8, -7, -5, -4 \\log (2), 0, 6, 10 \\log (2), 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 8, -5, -8, 0, -7, -4*math.log(2), 6,))\nsnd = set((-9, 6, -7, 10*math.log(2), 0, -5, 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{3}{4}, -8, -\\frac{5}{\\pi }, 2, -7 \\sqrt{2}, \\frac{7}{\\sqrt{\\pi }}, \\frac{3}{2}, 0, \\frac{10}{\\sqrt{\\pi }}, 1, -4, -\\frac{18}{\\pi }, -7}$.", - "Output Answer": [ - "$-\\frac{3}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(3/4), -8, -(5/math.pi), 2, -7*math.sqrt(2), (7/(math.sqrt(math.pi))), (3/2), 0, (10/(math.sqrt(math.pi))), 1, -4, -(18/math.pi), -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.046,0.069,0.114,0.213,0.071,0.076,0.308\\}$ and $\\{0.036,0.018,0.126,0.313,0.217,0.061,0.127\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.046, 0.069, 0.114, 0.213, 0.071, 0.076, 0.308\ndistribution2 = 0.036, 0.018, 0.126, 0.313, 0.217, 0.061, 0.127\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 36, -2, 25, 343, 6}$.\n", - "Output Answer": [ - "$7 \\sqrt[6]{-7} 2^{2/3} \\sqrt{3} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 36, -2, 25, 343, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\sqrt{5}, 0, 2 \\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, 0, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{4 \\sqrt{5}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.sqrt(5), 0, 2*math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), 0, -4*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.7 x^3-0.5 x^2+3.7 x-0.9$ where $x \\sim $ \\text{NormalDistribution}[1.1,2.5]\n", - "Output Answer": [ - "$-81.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.1, 2.5)\nprint(E(-3.7*x**3-0.5*x**2+3.7*x-0.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, -6, -13, -4, 11, 3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{469}{6}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -6, -13, -4, 11, 3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7.594, 2, -12 \\log (2)} \\cup {2, 4.208, -12 \\log (2)}$.\n", - "Output Answer": [ - "${-12 \\log (2), 2, 4.208, 7.594}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.594, 2, -12*math.log(2),))\nsnd = set((2, 4.208, -12*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -\\frac{9}{2}, -\\log (2), \\frac{9}{4}, 2 e, -6, -\\frac{10}{\\sqrt{3}}} \\cup {-6, -\\frac{3}{2}, \\frac{9}{4}, 0, 2 e}$.\n", - "Output Answer": [ - "${-6, -\\frac{10}{\\sqrt{3}}, -\\frac{9}{2}, -\\frac{3}{2}, -\\log (2), 0, \\frac{9}{4}, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -(9/2), -math.log(2), (9/4), 2*math.e, -6, -(10/(math.sqrt(3))),))\nsnd = set((-6, -(3/2), (9/4), 0, 2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{13}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{3 \\sqrt{3}}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (13/(math.sqrt(3))), -(4/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -5, 9, -5, -5, -5, 9, -5, 9, 9, 9, -5, -5, 9, -5, 9, 9, -5, 9, 9, -5, 9, -5, 9, 9, -5, 9, -5}$.\n", - "Output Answer": [ - "$\\{-5,9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -5, 9, -5, -5, -5, 9, -5, 9, 9, 9, -5, -5, 9, -5, 9, 9, -5, 9, 9, -5, 9, -5, 9, 9, -5, 9, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.5 x^3-0.3 x^2+4. x-0.7$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$0.83$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(-0.5*x**3-0.3*x**2+4.*x-0.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, \\frac{3}{2}, \\frac{5}{4}, \\frac{11}{2}, -\\frac{21}{4}, \\frac{33}{4}}$.\n", - "Output Answer": [ - "$\\frac{27}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, (3/2), (5/4), (11/2), -(21/4), (33/4)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, -2, 5, 10, 9, -8, 9, -2, 10, 8, 9, -2, 5, 5, 8, 5, -8, -2, 8, 10}$.\n", - "Output Answer": [ - "$\\{-2,5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, -2, 5, 10, 9, -8, 9, -2, 10, 8, 9, -2, 5, 5, 8, 5, -8, -2, 8, 10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1.5, -7, 7, -7.8, 0, -3} \\cup {1.5, -3 \\sqrt{3}, -5.9, 0, 6, 7}$.\n", - "Output Answer": [ - "${-7.8, -7, -5.9, -3 \\sqrt{3}, -3, 0, 1.5, 6, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((1.5, -7, 7, -7.8, 0, -3,))\nsnd = set((1.5, -3*math.sqrt(3), -5.9, 0, 6, 7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{3}, \\frac{17}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -4 \\sqrt{3}, \\frac{1}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$-\\frac{25}{8 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(3), (17/(math.sqrt(3))), -(16/(math.sqrt(3))), -(10/(math.sqrt(3))), -4*math.sqrt(3), (1/(math.sqrt(3))), -(4/(math.sqrt(3))), -(13/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, 2, 7, 14}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{307}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 2, 7, 14\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, -6, -1, -7, -5, 8, 1, 0} \\cap {9, 1, 3, -1, -5, 0, 8, -9}$.\n", - "Output Answer": [ - "${-5, -1, 0, 1, 3, 8}$" - ], - "Output Program": [ - "fst = set((3, -6, -1, -7, -5, 8, 1, 0,))\nsnd = set((9, 1, 3, -1, -5, 0, 8, -9,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${6.3, 9.2, -1.9, -3.3, 3.6, -5.3, 0.3, 5.5, -3.4, 2.2, 6.7, 7.3, 2.4, 2.7} \\cap {-8., 7.3, -5.6, -3.4, 2.7, 5.7, -8.5, -5.3, -6.6, 5.2, -9., -3.2, 6.7, -7.5}$.\n", - "Output Answer": [ - "${-5.3, -3.4, 2.7, 6.7, 7.3}$" - ], - "Output Program": [ - "fst = set((6.3, 9.2, -1.9, -3.3, 3.6, -5.3, 0.3, 5.5, -3.4, 2.2, 6.7, 7.3, 2.4, 2.7,))\nsnd = set((-8., 7.3, -5.6, -3.4, 2.7, 5.7, -8.5, -5.3, -6.6, 5.2, -9., -3.2, 6.7, -7.5,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, 2401, 6561, 81}$.\n", - "Output Answer": [ - "$189\\ 10^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, 2401, 6561, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, 15, 14, 13}$.\n", - "Output Answer": [ - "$\\frac{245}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 15, 14, 13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, -3, 64}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{-3} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, -3, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{19}{2}, -\\frac{11}{2}, -\\frac{11}{2}, \\frac{19}{2}, \\frac{11}{2}, \\frac{19}{2}, -\\frac{11}{2}, \\frac{3}{2}, -\\frac{11}{2}, -\\frac{11}{2}, \\frac{11}{2}, \\frac{3}{2}, -9, -9, \\frac{11}{2}, \\frac{19}{2}, \\frac{3}{2}, -\\frac{11}{2}, -\\frac{11}{2}, \\frac{19}{2}, \\frac{3}{2}, \\frac{19}{2}, \\frac{19}{2}, \\frac{3}{2}, -9, -9, \\frac{11}{2}, -9, -\\frac{11}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{11}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (19/2), -(11/2), -(11/2), (19/2), (11/2), (19/2), -(11/2), (3/2), -(11/2), -(11/2), (11/2), (3/2), -9, -9, (11/2), (19/2), (3/2), -(11/2), -(11/2), (19/2), (3/2), (19/2), (19/2), (3/2), -9, -9, (11/2), -9, -(11/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{49}{3}, \\frac{46}{3}}$.\n", - "Output Answer": [ - "$\\frac{87906}{5959}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (49/3), (46/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 6, \\frac{23}{2}, 1}$.\n", - "Output Answer": [ - "$\\frac{1656}{565}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 6, (23/2), 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.116,0.119,0.116,0.111,0.016,0.134,0.137\\}$ and $\\{0.055,0.392,0.038,0.047,0.151,0.069,0.246\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.116, 0.119, 0.116, 0.111, 0.016, 0.134, 0.137\ndistribution2 = 0.055, 0.392, 0.038, 0.047, 0.151, 0.069, 0.246\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\pi, \\frac{7}{\\pi }, 0, -7, 7, 6, \\frac{7}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.pi, (7/math.pi), 0, -7, 7, 6, (7/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3 \\pi, -6}$.\n", - "Output Answer": [ - "${-6, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.pi, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 11}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 0}$.\n", - "Output Answer": [ - "$-\\frac{9}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, \\frac{8}{\\sqrt{\\pi }}, -\\frac{11}{e}, -4.52, 3, -\\sqrt{2}, 4, -6, 8} \\setminus {6.23, 0, -6, 3, -\\frac{11}{e}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4.52, -3, -\\sqrt{2}, 4, \\frac{8}{\\sqrt{\\pi }}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, (8/(math.sqrt(math.pi))), -(11/math.e), -4.52, 3, -math.sqrt(2), 4, -6, 8,))\nsnd = set((6.23, 0, -6, 3, -(11/math.e), -4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -\\frac{25}{3}, 8, -3, 0, 2, -7, -4, 4} \\cup {-10, -9, 0, -7, -5, 2, 8, -3}$.\n", - "Output Answer": [ - "${-10, -9, -\\frac{25}{3}, -7, -5, -4, -3, 0, 2, 4, 8}$" - ], - "Output Program": [ - "fst = set((-5, -(25/3), 8, -3, 0, 2, -7, -4, 4,))\nsnd = set((-10, -9, 0, -7, -5, 2, 8, -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 9, -8, -11 \\log (2), \\frac{4}{\\sqrt{3}}, 0, 2, -10} \\cup {10, -3, \\frac{17}{e}, -\\frac{31}{7}, -10, -11 \\log (2), \\sqrt{3}, 9, 0, -8}$.\n", - "Output Answer": [ - "${-10, -8, -11 \\log (2), -\\frac{31}{7}, -3, 0, \\sqrt{3}, 2, \\frac{4}{\\sqrt{3}}, \\frac{17}{e}, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 9, -8, -11*math.log(2), (4/(math.sqrt(3))), 0, 2, -10,))\nsnd = set((10, -3, (17/math.e), -(31/7), -10, -11*math.log(2), math.sqrt(3), 9, 0, -8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.088,0.302,0.104,0.079,0.04,0.041,0.166\\}$ and $\\{0.174,0.224,0.11,0.104,0.048,0.043,0.08\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.088, 0.302, 0.104, 0.079, 0.04, 0.041, 0.166\ndistribution2 = 0.174, 0.224, 0.11, 0.104, 0.048, 0.043, 0.08\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -5 \\sqrt{3}, -\\frac{8}{5}, e, -\\frac{11}{\\sqrt{3}}, \\frac{13}{2}, \\pi, 2, -\\frac{15}{4}, 1, 5, \\frac{3}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -5*math.sqrt(3), -(8/5), math.e, -(11/(math.sqrt(3))), (13/2), math.pi, 2, -(15/4), 1, 5, (3/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{15}{2}, 8, 1, -7, -1, -10 \\log (2), 6, -\\frac{1}{\\pi }, \\frac{8}{\\sqrt{5}}, -2, -9, -3 \\sqrt{5}, 4}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/2), 8, 1, -7, -1, -10*math.log(2), 6, -(1/math.pi), (8/(math.sqrt(5))), -2, -9, -3*math.sqrt(5), 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\pi, -3 \\pi, 2 \\pi, -\\pi, -3 \\pi, -\\pi, -\\pi, -2 \\pi, -\\pi, -\\pi, -\\pi, -\\pi, -\\pi, -\\pi, 0, -\\pi, -2 \\pi, -\\pi, -3 \\pi, -2 \\pi, -2 \\pi, -3 \\pi, 0, -3 \\pi, 0, 0, -\\pi, -\\pi}$.\n", - "Output Answer": [ - "$\\{-\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.pi, -3*math.pi, 2*math.pi, -math.pi, -3*math.pi, -math.pi, -math.pi, -2*math.pi, -math.pi, -math.pi, -math.pi, -math.pi, -math.pi, -math.pi, 0, -math.pi, -2*math.pi, -math.pi, -3*math.pi, -2*math.pi, -2*math.pi, -3*math.pi, 0, -3*math.pi, 0, 0, -math.pi, -math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, -8, 5, -4, -7, -9, -8, -8, -8, -7, -6, -4, -6, -7, 5, -7, -4, -8, 5, -9, -6, -7, -6, -4}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, -8, 5, -4, -7, -9, -8, -8, -8, -7, -6, -4, -6, -7, 5, -7, -4, -8, 5, -9, -6, -7, -6, -4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4 \\sqrt{2}, 10, 1, -3, -7, -\\sqrt{5}, -8, 4, -10} \\cup {-7, -4, 3, -8, -10, 2, 1, -4 \\sqrt{2}, -\\frac{39}{7}, -3, -9}$.\n", - "Output Answer": [ - "${-10, -9, -8, -7, -4 \\sqrt{2}, -\\frac{39}{7}, -4, -3, -\\sqrt{5}, 1, 2, 3, 4, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(2), 10, 1, -3, -7, -math.sqrt(5), -8, 4, -10,))\nsnd = set((-7, -4, 3, -8, -10, 2, 1, -4*math.sqrt(2), -(39/7), -3, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 5, 2, -6, 0}$.\n", - "Output Answer": [ - "$\\frac{3}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 5, 2, -6, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 0, \\sqrt{5}, 4 \\sqrt{5}, 0, -4 \\sqrt{5}, 0, -4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 0, math.sqrt(5), 4*math.sqrt(5), 0, -4*math.sqrt(5), 0, -4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-7, -2, 8, 9, 12, -8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{382}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -2, 8, 9, 12, -8\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.228,0.191,0.211,0.142\\}$ and $\\{0.202,0.302,0.126,0.031\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.228, 0.191, 0.211, 0.142\ndistribution2 = 0.202, 0.302, 0.126, 0.031\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 10, 19, 12}$.\n", - "Output Answer": [ - "$\\frac{4560}{1409}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 10, 19, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{5}, 6, -2, 6 \\log (2), \\frac{13}{\\sqrt{3}}, 4, -1, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(5), 6, -2, 6*math.log(2), (13/(math.sqrt(3))), 4, -1, -5*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6, -\\frac{7}{\\sqrt{5}}, -2, 10, 2, \\frac{11}{4}, 6}$.\n", - "Output Answer": [ - "${-6, -\\frac{7}{\\sqrt{5}}, -2, 2, \\frac{11}{4}, 6, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -(7/(math.sqrt(5))), -2, 10, 2, (11/4), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\sqrt{3}, -5.29, -4 \\sqrt{5}, \\frac{28}{5}, 13 \\log (2), 2 \\pi}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -5.29, \\sqrt{3}, \\frac{28}{5}, 2 \\pi, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(3), -5.29, -4*math.sqrt(5), (28/5), 13*math.log(2), 2*math.pi\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.073,0.015,0.11,0.098,0.182,0.151,0.061,0.131\\}$ and $\\{0.028,0.233,0.335,0.071,0.091,0.132,0.085,0.013\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.073, 0.015, 0.11, 0.098, 0.182, 0.151, 0.061, 0.131\ndistribution2 = 0.028, 0.233, 0.335, 0.071, 0.091, 0.132, 0.085, 0.013\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 8, 6}$.\n", - "Output Answer": [ - "$\\frac{360}{59}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 8, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -3, 3, \\frac{13}{\\sqrt{5}}, -2, -7, \\frac{1}{3}, -6}$.", - "Output Answer": [ - "$-\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -3, 3, (13/(math.sqrt(5))), -2, -7, (1/3), -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, 8, 6.65, -3, 3, 8, \\frac{23}{7}}$.\n", - "Output Answer": [ - "${-8, -3, 3, \\frac{23}{7}, 6.65, 8, 8}$" - ], - "Output Program": [ - "values = -8, 8, 6.65, -3, 3, 8, (23/7)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -4, -4, -2, -2, -4, -10, -4, -4, -4, -10, -4, -2, -10, -10, -10, -4, -7, -10, -2, -10, -10, -7, -4, -7, -6, -4, -7, -4}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -4, -4, -2, -2, -4, -10, -4, -4, -4, -10, -4, -2, -10, -10, -10, -4, -7, -10, -2, -10, -10, -7, -4, -7, -6, -4, -7, -4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{2}, \\frac{11}{2}, -\\frac{3}{2}, \\frac{1}{2}, \\frac{1}{2}, -\\frac{1}{2}, -\\frac{3}{2}, -\\frac{13}{2}, \\frac{11}{2}, -\\frac{1}{2}, -\\frac{3}{2}, \\frac{1}{2}, -\\frac{13}{2}, \\frac{11}{2}, 4, 4, \\frac{1}{2}, \\frac{1}{2}, -\\frac{13}{2}, \\frac{11}{2}, -\\frac{13}{2}, -\\frac{13}{2}, \\frac{1}{2}, -\\frac{13}{2}, 4, \\frac{1}{2}, -\\frac{3}{2}, -\\frac{13}{2}, 4, -\\frac{1}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(13/2), (11/2), -(3/2), (1/2), (1/2), -(1/2), -(3/2), -(13/2), (11/2), -(1/2), -(3/2), (1/2), -(13/2), (11/2), 4, 4, (1/2), (1/2), -(13/2), (11/2), -(13/2), -(13/2), (1/2), -(13/2), 4, (1/2), -(3/2), -(13/2), 4, -(1/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{15}{4}, 1, -9, 8, 7} \\setminus {5, -2, -\\frac{27}{4}}$.\n", - "Output Answer": [ - "${-9, 1, \\frac{15}{4}, 7, 8}$" - ], - "Output Program": [ - "fst = set(((15/4), 1, -9, 8, 7,))\nsnd = set((5, -2, -(27/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\sqrt{5}, -4, \\frac{9}{\\sqrt{2}}, -\\frac{3}{e}, -0.2, -8} \\setminus {-8, 9, -0.7, 7, \\frac{9}{\\sqrt{2}}, -\\frac{3}{e}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-4, -0.2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(5), -4, (9/(math.sqrt(2))), -(3/math.e), -0.2, -8,))\nsnd = set((-8, 9, -0.7, 7, (9/(math.sqrt(2))), -(3/math.e), -math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{6}{7}, 6, -9}$.", - "Output Answer": [ - "$\\frac{6}{7}$" - ], - "Output Program": [ - "import statistics\n\nvalues = (6/7), 6, -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, -6, 9}$.\n", - "Output Answer": [ - "$9 \\sqrt[3]{-6}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, -6, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x^2-3.2 x+1.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$2.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(3.8*x**2-3.2*x+1.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-729, 4096, -4, 81, 7}$.\n", - "Output Answer": [ - "$36\\ 2^{4/5} \\sqrt[5]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -729, 4096, -4, 81, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\sqrt{5}, 10, 7, -1, \\frac{27}{4}, -5, \\frac{38}{7}, \\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(5), 10, 7, -1, (27/4), -5, (38/7), (21/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\pi, \\frac{29}{\\pi }, -8, -6, \\sqrt{2}, -4, 4, \\frac{16}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{2}-4\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.pi, (29/math.pi), -8, -6, math.sqrt(2), -4, 4, (16/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-11 \\log (2), 6 \\log (2), -11 \\log (2), -13 \\log (2), -9 \\log (2), -9 \\log (2), -11 \\log (2), 6 \\log (2), -9 \\log (2), -13 \\log (2), -13 \\log (2), 8 \\log (2), 6 \\log (2), -9 \\log (2), -11 \\log (2), 6 \\log (2), -13 \\log (2), -13 \\log (2), 6 \\log (2), -9 \\log (2), -11 \\log (2), -9 \\log (2), 8 \\log (2), 6 \\log (2), -11 \\log (2), -11 \\log (2), 8 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-11 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -11*math.log(2), 6*math.log(2), -11*math.log(2), -13*math.log(2), -9*math.log(2), -9*math.log(2), -11*math.log(2), 6*math.log(2), -9*math.log(2), -13*math.log(2), -13*math.log(2), 8*math.log(2), 6*math.log(2), -9*math.log(2), -11*math.log(2), 6*math.log(2), -13*math.log(2), -13*math.log(2), 6*math.log(2), -9*math.log(2), -11*math.log(2), -9*math.log(2), 8*math.log(2), 6*math.log(2), -11*math.log(2), -11*math.log(2), 8*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, -10, -5}$.\n", - "Output Answer": [ - "$\\sqrt{97}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -10, -5\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -4, 6, 2, -1, -6}$.\n", - "Output Answer": [ - "$-\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -4, 6, 2, -1, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, \\frac{9}{\\sqrt{\\pi }}, -9, 0, 7, 1, \\frac{16}{e}, -7, \\frac{13}{\\sqrt{\\pi }}, -9, -8, -\\frac{11}{3}, -\\frac{5}{2}}$.", - "Output Answer": [ - "$-\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, (9/(math.sqrt(math.pi))), -9, 0, 7, 1, (16/math.e), -7, (13/(math.sqrt(math.pi))), -9, -8, -(11/3), -(5/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-3, 1, 3, 7, 5, -5, -2, 4, 6, -7, 0} \\cap {9, -6, -4, -3, 5, -2, 7, -5, -7, 6, 8, 10}$.\n", - "Output Answer": [ - "${-7, -5, -3, -2, 5, 6, 7}$" - ], - "Output Program": [ - "fst = set((-3, 1, 3, 7, 5, -5, -2, 4, 6, -7, 0,))\nsnd = set((9, -6, -4, -3, 5, -2, 7, -5, -7, 6, 8, 10,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{8}{e}, -\\frac{8}{e}, -\\frac{8}{e}, \\frac{9}{e}, \\frac{13}{e}, \\frac{13}{e}, -\\frac{14}{e}, \\frac{9}{e}, \\frac{13}{e}, -\\frac{8}{e}, -\\frac{8}{e}, -\\frac{14}{e}, \\frac{13}{e}, -\\frac{8}{e}, \\frac{19}{e}, \\frac{9}{e}, \\frac{9}{e}, \\frac{13}{e}, \\frac{19}{e}, \\frac{13}{e}, \\frac{19}{e}, -\\frac{14}{e}, \\frac{13}{e}, \\frac{13}{e}, \\frac{19}{e}, \\frac{13}{e}, -\\frac{14}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{13}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(8/math.e), -(8/math.e), -(8/math.e), (9/math.e), (13/math.e), (13/math.e), -(14/math.e), (9/math.e), (13/math.e), -(8/math.e), -(8/math.e), -(14/math.e), (13/math.e), -(8/math.e), (19/math.e), (9/math.e), (9/math.e), (13/math.e), (19/math.e), (13/math.e), (19/math.e), -(14/math.e), (13/math.e), (13/math.e), (19/math.e), (13/math.e), -(14/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.7 x^2+2.9 x+2.9$ where $x \\sim $ \\text{NormalDistribution}[1.3,2.1]\n", - "Output Answer": [ - "$10.94$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.3, 2.1)\nprint(E(0.7*x**2+2.9*x+2.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 e, -2 e, e, 4 e, -e, 0, e, 4 e, -e, 4 e, -e, e, 2 e, -e, 2 e, -e, e, 4 e, 0, 0, -e, 2 e, -e, 0, 2 e, 4 e}$.\n", - "Output Answer": [ - "$\\{-e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.e, -2*math.e, math.e, 4*math.e, -math.e, 0, math.e, 4*math.e, -math.e, 4*math.e, -math.e, math.e, 2*math.e, -math.e, 2*math.e, -math.e, math.e, 4*math.e, 0, 0, -math.e, 2*math.e, -math.e, 0, 2*math.e, 4*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{11}{3}, 9, 0, -\\frac{26}{3}}$.\n", - "Output Answer": [ - "$\\frac{53}{3}$" - ], - "Output Program": [ - "values = -(11/3), 9, 0, -(26/3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{19}{7}, -2.753, -4 \\log (2), -4 \\sqrt{2}, -1} \\cup {-1, -9.297, \\frac{19}{7}, -4 \\sqrt{2}, -3.83, -7, 4.68}$.\n", - "Output Answer": [ - "${-9.297, -7, -4 \\sqrt{2}, -3.83, -4 \\log (2), -2.753, -1, \\frac{19}{7}, 4.68}$" - ], - "Output Program": [ - "import math\n\nfst = set(((19/7), -2.753, -4*math.log(2), -4*math.sqrt(2), -1,))\nsnd = set((-1, -9.297, (19/7), -4*math.sqrt(2), -3.83, -7, 4.68,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -5, 7, 2, 7, 7, 2, 2, 7, 2, -5, 7, -1, 2, -1, -1, 7, 2, -5, 7, -5, -1, 2, 7, 7, -5, -1}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -5, 7, 2, 7, 7, 2, 2, 7, 2, -5, 7, -1, 2, -1, -1, 7, 2, -5, 7, -5, -1, 2, 7, 7, -5, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x-4.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.2]\n", - "Output Answer": [ - "$-2.83$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(E(2.*x-4.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{26}{3}, \\frac{1}{\\sqrt{3}}, \\frac{53}{7}, \\sqrt{2}, 0, -6, \\frac{2}{\\pi }, -\\frac{29}{7}, 3, -8}$.\n", - "Output Answer": [ - "$\\frac{341}{21}$" - ], - "Output Program": [ - "import math\n\nvalues = -(26/3), (1/(math.sqrt(3))), (53/7), math.sqrt(2), 0, -6, (2/math.pi), -(29/7), 3, -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, -3 \\sqrt{2}, 9, 4}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -3*math.sqrt(2), 9, 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.5 x-3.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.7]\n", - "Output Answer": [ - "$-3.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.7)\nprint(E(4.5*x-3.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 0, -\\frac{4}{\\pi }, -7, -9.8} \\setminus {-\\frac{13}{\\pi }, -7, -\\frac{4}{\\pi }, -1, 0, -9}$.\n", - "Output Answer": [ - "${-9.8, -8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 0, -(4/math.pi), -7, -9.8,))\nsnd = set((-(13/math.pi), -7, -(4/math.pi), -1, 0, -9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, 2 \\log (2), -3 \\sqrt{5}, \\frac{16}{\\sqrt{5}}, \\pi}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, 2 \\log (2), \\pi, \\frac{16}{\\sqrt{5}}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 2*math.log(2), -3*math.sqrt(5), (16/(math.sqrt(5))), math.pi\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -9, -9, 4, -6, -9, -1, -9, -9, -1, -6, -1, -6, -6, -1, -6, -6, -1, -9, -1, -1, -9, -6, -9, -9, -1, -6, 4, 4, 4}$.\n", - "Output Answer": [ - "$\\{-1,-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -9, -9, 4, -6, -9, -1, -9, -9, -1, -6, -1, -6, -6, -1, -6, -6, -1, -9, -1, -1, -9, -6, -9, -9, -1, -6, 4, 4, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 18, 2, 2}$.\n", - "Output Answer": [ - "$\\frac{504}{151}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 18, 2, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 7, 3, 14}$.\n", - "Output Answer": [ - "$\\frac{168}{37}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 7, 3, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 1, -8, -5}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 1, -8, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-e, 5, -6 \\sqrt{2}, -5, 0, 6, 4 \\sqrt{2}} \\setminus {-6 \\sqrt{2}, 6, -5}$.\n", - "Output Answer": [ - "${-e, 0, 5, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.e, 5, -6*math.sqrt(2), -5, 0, 6, 4*math.sqrt(2),))\nsnd = set((-6*math.sqrt(2), 6, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, \\frac{17}{3}, 7} \\setminus {9, -4, \\frac{17}{3}, 3, -2}$.\n", - "Output Answer": [ - "${7}$" - ], - "Output Program": [ - "fst = set((-4, (17/3), 7,))\nsnd = set((9, -4, (17/3), 3, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{9}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, -3 \\sqrt{2}, 5 \\sqrt{2}, -\\sqrt{2}, \\frac{3}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{8} \\left(\\sqrt{2}-\\frac{17}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(9/(math.sqrt(2))), -(11/(math.sqrt(2))), -(9/(math.sqrt(2))), -3*math.sqrt(2), 5*math.sqrt(2), -math.sqrt(2), (3/(math.sqrt(2))), (9/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-3.14 < 2.7 x-1.8 < 1.97$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8].", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(P((-3.14 < 2.7*x-1.8) & (2.7*x-1.8 < 1.97)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -1, -6, -8, -1, 5}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -1, -6, -8, -1, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, -1, 7, 2, -\\frac{24}{5}, -5, 12 \\log (2), \\frac{17}{2}, \\frac{14}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{33}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -1, 7, 2, -(24/5), -5, 12*math.log(2), (17/2), (14/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -2, -15, 4}$.\n", - "Output Answer": [ - "$63$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -2, -15, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, \\frac{19}{\\sqrt{5}}, -4, 0, -\\frac{3}{\\pi }, -\\frac{15}{\\pi }, \\frac{18}{7}, \\frac{4}{\\sqrt{5}}, 0, -9, 3 \\sqrt{3}, 6, -8, -9 \\log (2), 5}$.\n", - "Output Answer": [ - "$9+\\frac{19}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, (19/(math.sqrt(5))), -4, 0, -(3/math.pi), -(15/math.pi), (18/7), (4/(math.sqrt(5))), 0, -9, 3*math.sqrt(3), 6, -8, -9*math.log(2), 5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, 64, 729, -729}$.\n", - "Output Answer": [ - "$(54+54 i) 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, 64, 729, -729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, 9, 1, 3, -5, -8, -7, -3}$.\n", - "Output Answer": [ - "$-\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, 9, 1, 3, -5, -8, -7, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{7}{\\sqrt{5}}, -2 \\sqrt{5}, -\\frac{7}{4}, -4, -4, \\frac{5}{\\sqrt{2}}, -4, \\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{5}{\\sqrt{2}}+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/(math.sqrt(5))), -2*math.sqrt(5), -(7/4), -4, -4, (5/(math.sqrt(2))), -4, (5/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 e, -1, -4, -3 \\pi, \\frac{5}{4}, 2, -\\pi, 14 \\log (2), 9, \\frac{11}{3}, -9, -9, -\\frac{41}{5}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.e, -1, -4, -3*math.pi, (5/4), 2, -math.pi, 14*math.log(2), 9, (11/3), -9, -9, -(41/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 100, 4, -6}$.\n", - "Output Answer": [ - "$2 \\sqrt[4]{-6} \\sqrt{35}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 100, 4, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\pi, 0, -\\pi, 0, 2 \\pi, 2 \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$\\frac{2 \\pi }{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.pi, 0, -math.pi, 0, 2*math.pi, 2*math.pi, -2*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x^2+0.2 x-0.9$ where $x \\sim $ \\text{ExponentialDistribution}[1.2]\n", - "Output Answer": [ - "$3.29$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(E(2.9*x**2+0.2*x-0.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\pi, 2 \\pi, 3 \\pi}$.\n", - "Output Answer": [ - "$\\pi$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.pi, 2*math.pi, 3*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, 16, 8}$.\n", - "Output Answer": [ - "$32 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, 16, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -2 \\pi, 3}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -2*math.pi, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -7, -7, -7, -7, -7, -2, -2, -7, -7, -3, -7, -7, -2, -7, -7, -7, -3, -3, -7, -3, -7, -2, -7, -7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -7, -7, -7, -7, -7, -2, -2, -7, -7, -3, -7, -7, -2, -7, -7, -7, -3, -3, -7, -3, -7, -2, -7, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-11 \\log (2), 13 \\log (2), -11 \\log (2), 2 \\log (2), 0, 2 \\log (2), -11 \\log (2), 2 \\log (2), 0, 13 \\log (2), -11 \\log (2), 0, 0, 2 \\log (2), 13 \\log (2), 0, 0, -11 \\log (2), 8 \\log (2), 0, 8 \\log (2)}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -11*math.log(2), 13*math.log(2), -11*math.log(2), 2*math.log(2), 0, 2*math.log(2), -11*math.log(2), 2*math.log(2), 0, 13*math.log(2), -11*math.log(2), 0, 0, 2*math.log(2), 13*math.log(2), 0, 0, -11*math.log(2), 8*math.log(2), 0, 8*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.8 x^2+4.5 x+0.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5]\n", - "Output Answer": [ - "$4.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(E(0.8*x**2+4.5*x+0.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.244,0.26,0.19,0.099,0.052\\}$ and $\\{0.029,0.23,0.388,0.18,0.05\\}$.", - "Output Answer": [ - "$0.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.244, 0.26, 0.19, 0.099, 0.052\ndistribution2 = 0.029, 0.23, 0.388, 0.18, 0.05\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, -2, 5, -3, -1}$.\n", - "Output Answer": [ - "${-3, -2, -1, 5, 9}$" - ], - "Output Program": [ - "values = 9, -2, 5, -3, -1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{26}{e}, -\\frac{15}{e}, \\frac{16}{e}, -\\frac{19}{e}, \\frac{14}{e}, \\frac{25}{e}}$.\n", - "Output Answer": [ - "$-\\frac{5}{6 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(26/math.e), -(15/math.e), (16/math.e), -(19/math.e), (14/math.e), (25/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, 9, -e, -2 \\pi, -10, -8, \\frac{5}{\\pi }}$.", - "Output Answer": [ - "$-e$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 9, -math.e, -2*math.pi, -10, -8, (5/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, -2, 9, 8, -13}$.\n", - "Output Answer": [ - "$\\frac{973}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -2, 9, 8, -13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, 0, -2, -8, 6, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-8, -2, -1, 0, 6, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 0, -2, -8, 6, 4*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.082,0.049,0.052,0.025,0.063,0.275,0.036,0.107,0.11,0.121\\}$ and $\\{0.099,0.127,0.017,0.031,0.077,0.105,0.126,0.1,0.034,0.247\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.082, 0.049, 0.052, 0.025, 0.063, 0.275, 0.036, 0.107, 0.11, 0.121\ndistribution2 = 0.099, 0.127, 0.017, 0.031, 0.077, 0.105, 0.126, 0.1, 0.034, 0.247\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, 64, 512, -7, 125}$.\n", - "Output Answer": [ - "$8\\ 3^{2/5} 5^{3/5} \\sqrt[5]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 64, 512, -7, 125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, -3, 10, -13, -2}$.\n", - "Output Answer": [ - "$\\frac{683}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -3, 10, -13, -2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, 7, 4, 1, -6, 5}$.\n", - "Output Answer": [ - "$\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, 7, 4, 1, -6, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, -1}$.\n", - "Output Answer": [ - "$\\frac{11}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -1\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 9, 9, -7, -7, -9, -7, 5, 5, -7, 5, -9, -7, -7, -7, -7, -7, -6, 5, -7, -6, -6}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 9, 9, -7, -7, -9, -7, 5, 5, -7, 5, -9, -7, -7, -7, -7, -7, -6, 5, -7, -6, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -7, \\frac{61}{7}, 7, 10} \\setminus {-\\frac{16}{7}, -7, 7}$.\n", - "Output Answer": [ - "${-8, \\frac{61}{7}, 10}$" - ], - "Output Program": [ - "fst = set((-8, -7, (61/7), 7, 10,))\nsnd = set((-(16/7), -7, 7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{5}, -\\frac{11}{\\sqrt{5}}, -1, -\\frac{31}{\\pi }} \\setminus {-1, 2 \\sqrt{5}, -\\frac{21}{\\sqrt{5}}, 7, -\\frac{31}{\\pi }, -2, 0.434, -8}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(5), -(11/(math.sqrt(5))), -1, -(31/math.pi),))\nsnd = set((-1, 2*math.sqrt(5), -(21/(math.sqrt(5))), 7, -(31/math.pi), -2, 0.434, -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{16}{3}, \\frac{26}{3}, \\frac{59}{3}, 17}$.\n", - "Output Answer": [ - "$\\frac{834496}{86069}$" - ], - "Output Program": [ - "import statistics\nvalues = (16/3), (26/3), (59/3), 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, 6, -4, -12}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{217}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 6, -4, -12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{5}, \\frac{3}{2}, -4, -6 \\log (2), -9, 4 \\sqrt{3}, -\\frac{11}{\\sqrt{\\pi }}, \\frac{37}{4}, -\\frac{14}{\\sqrt{\\pi }}, 3 e, -6, 4, 2}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(5), (3/2), -4, -6*math.log(2), -9, 4*math.sqrt(3), -(11/(math.sqrt(math.pi))), (37/4), -(14/(math.sqrt(math.pi))), 3*math.e, -6, 4, 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -\\frac{25}{3}, 2, -\\frac{29}{3}}$.\n", - "Output Answer": [ - "$-\\frac{11}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -(25/3), 2, -(29/3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, \\frac{33}{7}, \\frac{5}{e}, -8.47, \\frac{13}{e}, 2, -\\pi, 11 \\log (2)}$.\n", - "Output Answer": [ - "${-8.47, -4, -\\pi, \\frac{5}{e}, 2, \\frac{33}{7}, \\frac{13}{e}, 11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, (33/7), (5/math.e), -8.47, (13/math.e), 2, -math.pi, 11*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{31}{4}, 4}$.\n", - "Output Answer": [ - "${-\\frac{31}{4}, 4}$" - ], - "Output Program": [ - "values = -(31/4), 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6 \\sqrt{2}, -3 \\sqrt{3}, 7, \\frac{12}{\\pi }, -\\log (2)} \\setminus {-8, \\sqrt{2}, -\\log (2), \\frac{18}{\\sqrt{5}}, 10, 9, -\\frac{14}{\\sqrt{3}}, 4}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -3 \\sqrt{3}, \\frac{12}{\\pi }, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.sqrt(2), -3*math.sqrt(3), 7, (12/math.pi), -math.log(2),))\nsnd = set((-8, math.sqrt(2), -math.log(2), (18/(math.sqrt(5))), 10, 9, -(14/(math.sqrt(3))), 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${8, 6 \\sqrt{3}, -3, -\\frac{13}{2}, \\frac{20}{\\pi }, -4 \\sqrt{5}, -\\frac{11}{4}, -2 \\sqrt{5}, -3, \\frac{25}{\\pi }, -6, 2 \\sqrt{5}, 5, -\\frac{14}{\\sqrt{5}}, -2}$.", - "Output Answer": [ - "$-\\frac{11}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 6*math.sqrt(3), -3, -(13/2), (20/math.pi), -4*math.sqrt(5), -(11/4), -2*math.sqrt(5), -3, (25/math.pi), -6, 2*math.sqrt(5), 5, -(14/(math.sqrt(5))), -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, \\frac{19}{5}, -\\frac{7}{4}, -2, -\\frac{17}{\\sqrt{3}}, 0, 5, 5, -\\frac{5}{\\sqrt{\\pi }}, -4 \\sqrt{5}, -5 \\sqrt{2}, 5, -5, 1}$.", - "Output Answer": [ - "$-\\frac{7}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, (19/5), -(7/4), -2, -(17/(math.sqrt(3))), 0, 5, 5, -(5/(math.sqrt(math.pi))), -4*math.sqrt(5), -5*math.sqrt(2), 5, -5, 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -\\frac{41}{7}, -\\frac{18}{7}, \\frac{4}{7}, \\frac{8}{7}, 7}$.\n", - "Output Answer": [ - "$-\\frac{47}{42}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -(41/7), -(18/7), (4/7), (8/7), 7\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.2 x^2+0.5 x-4.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.3]\n", - "Output Answer": [ - "$-0.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(E(3.2*x**2+0.5*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-0.52, 5, -\\frac{22}{3}, \\frac{13}{2}}$.\n", - "Output Answer": [ - "${-\\frac{22}{3}, -0.52, 5, \\frac{13}{2}}$" - ], - "Output Program": [ - "values = -0.52, 5, -(22/3), (13/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3.7, -3 e}$.\n", - "Output Answer": [ - "${-3 e, -3.7}$" - ], - "Output Program": [ - "import math\n\nvalues = -3.7, -3*math.e\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{31}{5}, \\frac{32}{5}, 8, \\frac{7}{2}, 10} \\setminus {-\\frac{7}{2}, \\frac{32}{5}, 8, 3 \\sqrt{2}, \\frac{11}{\\sqrt{3}}, \\frac{31}{5}, 10}$.\n", - "Output Answer": [ - "${\\frac{7}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((31/5), (32/5), 8, (7/2), 10,))\nsnd = set((-(7/2), (32/5), 8, 3*math.sqrt(2), (11/(math.sqrt(3))), (31/5), 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\pi, 0, 3 \\pi}$.\n", - "Output Answer": [ - "$\\frac{5 \\pi }{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.pi, 0, 3*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -10, -10, 4, 3, 5}$.\n", - "Output Answer": [ - "$\\frac{248}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -10, -10, 4, 3, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -3 e, -6, 3 e, 4 \\sqrt{3}, 8, 1, -2 \\sqrt{2}, -7}$.", - "Output Answer": [ - "$-2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -3*math.e, -6, 3*math.e, 4*math.sqrt(3), 8, 1, -2*math.sqrt(2), -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, -8, 9, -8, -8, 9, -2, 9, -2, 0, -2, -2, 9, 1, 9, -2, 0, 0, 9, 1}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, -8, 9, -8, -8, 9, -2, 9, -2, 0, -2, -2, 9, 1, 9, -2, 0, 0, 9, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, -125, 36, -8, 64}$.\n", - "Output Answer": [ - "$8\\ 5^{3/5} 6^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, -125, 36, -8, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{20}{3}, 3.66, -5, 4, \\frac{4}{\\sqrt{3}}, -4 \\sqrt{3}} \\cup {-4 \\sqrt{3}, 5, \\frac{2}{\\sqrt{3}}, \\frac{20}{3}, 4, -8}$.\n", - "Output Answer": [ - "${-8, -4 \\sqrt{3}, -5, \\frac{2}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, 3.66, 4, 5, \\frac{20}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((20/3), 3.66, -5, 4, (4/(math.sqrt(3))), -4*math.sqrt(3),))\nsnd = set((-4*math.sqrt(3), 5, (2/(math.sqrt(3))), (20/3), 4, -8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{50}{7}, -1, 7, \\frac{18}{e}, \\sqrt{5}, 0, -7, \\frac{17}{3}} \\setminus {-0.1, -\\frac{30}{7}, 7, -7, -1}$.\n", - "Output Answer": [ - "${0, \\sqrt{5}, \\frac{17}{3}, \\frac{18}{e}, \\frac{50}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((50/7), -1, 7, (18/math.e), math.sqrt(5), 0, -7, (17/3),))\nsnd = set((-0.1, -(30/7), 7, -7, -1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.001,0.024,0.342\\}$ and $\\{0.065,0.315,0.101\\}$.", - "Output Answer": [ - "$1.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.001, 0.024, 0.342\ndistribution2 = 0.065, 0.315, 0.101\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.59 < 3.1 x+0.8 < -0.53$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7].", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(P((-2.59 < 3.1*x+0.8) & (3.1*x+0.8 < -0.53)))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7.07, -4 \\sqrt{5}, -7, 9, 11 \\log (2), 8} \\setminus {-9 \\log (2), 8, -2, -4 \\sqrt{5}, -7}$.\n", - "Output Answer": [ - "${-7.07, 11 \\log (2), 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7.07, -4*math.sqrt(5), -7, 9, 11*math.log(2), 8,))\nsnd = set((-9*math.log(2), 8, -2, -4*math.sqrt(5), -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, -12, -1, -1}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{1259}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -12, -1, -1\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 49, 36, 64, 262144, 8}$.\n", - "Output Answer": [ - "$16\\ 2^{5/6} \\sqrt[3]{105}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 49, 36, 64, 262144, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, 6 \\sqrt{2}, 4.753, \\frac{15}{\\sqrt{\\pi }}} \\setminus {4 \\sqrt{2}, -\\frac{10}{\\sqrt{\\pi }}, 7, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${2, 4.753, \\frac{15}{\\sqrt{\\pi }}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 6*math.sqrt(2), 4.753, (15/(math.sqrt(math.pi))),))\nsnd = set((4*math.sqrt(2), -(10/(math.sqrt(math.pi))), 7, 5*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -13, 2, 10, 3, 8}$.\n", - "Output Answer": [ - "$\\frac{667}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -13, 2, 10, 3, 8\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${343, 6, 16, 216, 1, 36}$.\n", - "Output Answer": [ - "$6\\ 2^{2/3} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 343, 6, 16, 216, 1, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-10, 2, -11 \\log (2), -\\frac{17}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-10, -\\frac{17}{\\sqrt{\\pi }}, -11 \\log (2), 2}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, 2, -11*math.log(2), -(17/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -2, -6, 4, 1, 4, -2, 1, 4, 4, 4, -2, 0, 4, 0, 1, 4, -6, -6, 2, 2, 4, 1, 2, 2, -6}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -2, -6, 4, 1, 4, -2, 1, 4, 4, 4, -2, 0, 4, 0, 1, 4, -6, -6, 2, 2, 4, 1, 2, 2, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{4}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, -\\frac{2}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(4/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), -(2/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -8, -4 \\sqrt{3}, -8, -2 \\sqrt{5}, -5, -3, 2}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -8, -4*math.sqrt(3), -8, -2*math.sqrt(5), -5, -3, 2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{1}{\\sqrt{5}}, 5 \\sqrt{3}, \\frac{25}{\\pi }, 3, -5, 9 \\log (2), 8, -11 \\log (2), \\frac{37}{4}, 7, -1}$.\n", - "Output Answer": [ - "$\\frac{37}{4}+11 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -(1/(math.sqrt(5))), 5*math.sqrt(3), (25/math.pi), 3, -5, 9*math.log(2), 8, -11*math.log(2), (37/4), 7, -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 1, -9, -9, 0, -7, 1, 0, -7, 1, -9, -7, 1, -9, 0, -7, 1, -9, -7, -7, 1, -7, 0}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 1, -9, -9, 0, -7, 1, 0, -7, 1, -9, -7, 1, -9, 0, -7, 1, -9, -7, -7, 1, -7, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.5 x^3+2.5 x^2-3.8 x+0.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.]\n", - "Output Answer": [ - "$20.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(E(1.5*x**3+2.5*x**2-3.8*x+0.1))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${7 \\sqrt{2}, -5 \\sqrt{2}, 3 \\sqrt{2}, -4 \\sqrt{2}} \\cap {5 \\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}, -\\sqrt{2}, 2 \\sqrt{2}, -4 \\sqrt{2}, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -4 \\sqrt{2}, 3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7*math.sqrt(2), -5*math.sqrt(2), 3*math.sqrt(2), -4*math.sqrt(2),))\nsnd = set((5*math.sqrt(2), math.sqrt(2), -5*math.sqrt(2), -math.sqrt(2), 2*math.sqrt(2), -4*math.sqrt(2), 3*math.sqrt(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4 \\sqrt{3}, 9, \\frac{18}{\\sqrt{5}}, 5.475, 7, -10, 4}$.\n", - "Output Answer": [ - "${-10, 4, 5.475, 4 \\sqrt{3}, 7, \\frac{18}{\\sqrt{5}}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(3), 9, (18/(math.sqrt(5))), 5.475, 7, -10, 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{11}{2}, 11, 12}$.\n", - "Output Answer": [ - "$\\frac{264}{29}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (11/2), 11, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, -13, 13, -11, 6, 3}$.\n", - "Output Answer": [ - "$\\frac{3581}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -13, 13, -11, 6, 3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -4 \\sqrt{5}, \\frac{26}{\\pi }, -3, 4 \\sqrt{3}, -2}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -4*math.sqrt(5), (26/math.pi), -3, 4*math.sqrt(3), -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{\\sqrt{5}}, -2, \\frac{13}{\\pi }, 7, -3 \\sqrt{5}, -2 \\pi, \\frac{10}{e}, 4, -8, -1, 4, -1, 9}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/(math.sqrt(5))), -2, (13/math.pi), 7, -3*math.sqrt(5), -2*math.pi, (10/math.e), 4, -8, -1, 4, -1, 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x^2+1.3 x+4.$ where $x \\sim $ \\text{NormalDistribution}[-1.,0.6]\n", - "Output Answer": [ - "$1.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1., 0.6)\nprint(E(-1.1*x**2+1.3*x+4.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{5}, -\\frac{37}{5}, 4}$.\n", - "Output Answer": [ - "${-\\frac{37}{5}, 4, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(5), -(37/5), 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 64, -1000, 10000}$.\n", - "Output Answer": [ - "$(40+40 i) 10^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 64, -1000, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, 16, 2}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{2} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, 16, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.3 x^2-0.2 x-2.8$ where $x \\sim $ \\text{BetaDistribution}[0.6,1.6]\n", - "Output Answer": [ - "$-3.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.6, 1.6)\nprint(E(-4.3*x**2-0.2*x-2.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 3, 6}$.\n", - "Output Answer": [ - "$\\frac{102}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 3, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 3, 9}$.\n", - "Output Answer": [ - "$\\frac{27}{13}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 3, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, 1, -8, 0, 4 e} \\setminus {2 e, 9, 4}$.\n", - "Output Answer": [ - "${-8, 0, 1, 4 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 1, -8, 0, 4*math.e,))\nsnd = set((2*math.e, 9, 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -13, -11, -6, 10, -11}$.\n", - "Output Answer": [ - "$\\frac{356}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -13, -11, -6, 10, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4 \\sqrt{3}, 1, -2, -5, -2 \\sqrt{2}, \\frac{12}{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -5, -2 \\sqrt{2}, -2, 1, \\frac{12}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(3), 1, -2, -5, -2*math.sqrt(2), (12/5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{27}{2}, \\frac{17}{2}, \\frac{23}{2}}$.\n", - "Output Answer": [ - "$\\frac{31671}{2942}$" - ], - "Output Program": [ - "import statistics\nvalues = (27/2), (17/2), (23/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -5 \\sqrt{3}, 10, \\frac{7}{\\sqrt{2}}, -10, -2, -2, 3 e, -2, 4, -3 \\sqrt{3}, 5 \\log (2), 8, \\frac{14}{\\sqrt{\\pi }}, \\frac{26}{\\pi }}$.", - "Output Answer": [ - "$5 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -5*math.sqrt(3), 10, (7/(math.sqrt(2))), -10, -2, -2, 3*math.e, -2, 4, -3*math.sqrt(3), 5*math.log(2), 8, (14/(math.sqrt(math.pi))), (26/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x^2+0.5 x+0.6$ where $x \\sim $ \\text{PoissonDistribution}[0.8]\n", - "Output Answer": [ - "$3.88$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.8)\nprint(E(2.*x**2+0.5*x+0.6))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, 2, -9, 0} \\setminus {-3, 8.499, -4.66, \\frac{11}{\\pi }, -7, 1, -\\frac{19}{e}}$.\n", - "Output Answer": [ - "${-9, 0, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 2, -9, 0,))\nsnd = set((-3, 8.499, -4.66, (11/math.pi), -7, 1, -(19/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, 5, 2 \\log (2)}$.\n", - "Output Answer": [ - "${-7, 2 \\log (2), 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 5, 2*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, 2, 2, 0, -4, -4, -4, 2, -6, -1, -1, -1, 0, 2, 2, 2, -4, 0, -6, 2, -4, -4, -4, 0}$.\n", - "Output Answer": [ - "$\\{2,-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, 2, 2, 0, -4, -4, -4, 2, -6, -1, -1, -1, 0, 2, 2, 2, -4, 0, -6, 2, -4, -4, -4, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{\\sqrt{\\pi }}, -3 e, -\\frac{21}{5}, -8, \\frac{18}{\\pi }, 6 \\sqrt{2}, 3, -6}$.\n", - "Output Answer": [ - "${-3 e, -8, -\\frac{13}{\\sqrt{\\pi }}, -6, -\\frac{21}{5}, 3, \\frac{18}{\\pi }, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(math.pi))), -3*math.e, -(21/5), -8, (18/math.pi), 6*math.sqrt(2), 3, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{3}{\\sqrt{5}}, 3 \\sqrt{5}, 0, -\\frac{8}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, 0, \\frac{9}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}, 3 \\sqrt{5}, 3 \\sqrt{5}, \\frac{18}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, 3 \\sqrt{5}, 3 \\sqrt{5}, \\frac{18}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{8}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (3/(math.sqrt(5))), 3*math.sqrt(5), 0, -(8/(math.sqrt(5))), -(9/(math.sqrt(5))), 0, (9/(math.sqrt(5))), -(8/(math.sqrt(5))), -(8/(math.sqrt(5))), 3*math.sqrt(5), 3*math.sqrt(5), (18/(math.sqrt(5))), -(8/(math.sqrt(5))), -(8/(math.sqrt(5))), -(8/(math.sqrt(5))), -(9/(math.sqrt(5))), -(8/(math.sqrt(5))), (9/(math.sqrt(5))), (9/(math.sqrt(5))), 3*math.sqrt(5), 3*math.sqrt(5), (18/(math.sqrt(5))), (9/(math.sqrt(5))), (9/(math.sqrt(5))), (18/(math.sqrt(5))), -(9/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, -12, -9, 12, -3, -15}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{511}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -12, -9, 12, -3, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-10, 1, 64, 100, -5, 16}$.\n", - "Output Answer": [ - "$4 \\sqrt[6]{2} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, 1, 64, 100, -5, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 0, -7, -9, -7 \\sqrt{2}, 0, \\frac{14}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 0, -7, -9, -7*math.sqrt(2), 0, (14/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 4, -5}$.\n", - "Output Answer": [ - "$\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 4, -5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x^2+0.8 x+3.8$ where $x \\sim $ \\text{PoissonDistribution}[2.]\n", - "Output Answer": [ - "$27.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.)\nprint(E(3.6*x**2+0.8*x+3.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{2}, 3, \\frac{23}{4}, 6, 2.7} \\setminus {5 \\sqrt{2}, 6, 3, -\\frac{17}{2}, -\\frac{29}{3}, 2.7, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${\\frac{23}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), 3, (23/4), 6, 2.7,))\nsnd = set((5*math.sqrt(2), 6, 3, -(17/2), -(29/3), 2.7, 2*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${7, -\\frac{7}{\\sqrt{3}}, 6, 3 \\log (2), -\\frac{1}{e}, 9, 8, -3} \\cup {9, -\\frac{18}{e}, 8, -3, \\frac{13}{2}, 2, -\\frac{7}{\\sqrt{3}}, 3 \\log (2), -4}$.\n", - "Output Answer": [ - "${-\\frac{18}{e}, -\\frac{7}{\\sqrt{3}}, -4, -3, -\\frac{1}{e}, 2, 3 \\log (2), 6, \\frac{13}{2}, 7, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -(7/(math.sqrt(3))), 6, 3*math.log(2), -(1/math.e), 9, 8, -3,))\nsnd = set((9, -(18/math.e), 8, -3, (13/2), 2, -(7/(math.sqrt(3))), 3*math.log(2), -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1, 3, 7, -4 \\sqrt{3}, -9, 4} \\cup {3, 4, 1, -9, -6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -9, -4 \\sqrt{3}, 1, 3, 4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 3, 7, -4*math.sqrt(3), -9, 4,))\nsnd = set((3, 4, 1, -9, -6*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\log (2), -2, -3, -5.009, -\\sqrt{3}, -\\frac{55}{7}, \\frac{2}{7}, -5} \\setminus {-2, -5, \\frac{2}{7}, -5.009, 2 \\sqrt{3}, -4 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{55}{7}, -3, -\\sqrt{3}, -\\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.log(2), -2, -3, -5.009, -math.sqrt(3), -(55/7), (2/7), -5,))\nsnd = set((-2, -5, (2/7), -5.009, 2*math.sqrt(3), -4*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-729, 25, 10}$.\n", - "Output Answer": [ - "$45 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = -729, 25, 10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.102,0.09,0.12,0.154,0.111,0.11,0.024,0.176\\}$ and $\\{0.364,0.229,0.01,0.142,0.028,0.034,0.03,0.031\\}$.", - "Output Answer": [ - "$0.74$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.102, 0.09, 0.12, 0.154, 0.111, 0.11, 0.024, 0.176\ndistribution2 = 0.364, 0.229, 0.01, 0.142, 0.028, 0.034, 0.03, 0.031\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 10, -7, 3, 2, -5, -\\sqrt{3}} \\setminus {-6, -2, -5}$.\n", - "Output Answer": [ - "${-7, -\\sqrt{3}, 2, 3, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 10, -7, 3, 2, -5, -math.sqrt(3),))\nsnd = set((-6, -2, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\pi, 14 \\log (2), 5, -8, 1, -10} \\setminus {-3 \\sqrt{5}, -1, 1, 2 \\log (2), 2}$.\n", - "Output Answer": [ - "${-10, -8, -2 \\pi, 5, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, 14*math.log(2), 5, -8, 1, -10,))\nsnd = set((-3*math.sqrt(5), -1, 1, 2*math.log(2), 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 8, -2}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 8, -2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.557,0.173,0.053\\}$ and $\\{0.842,0.083,0.038\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.557, 0.173, 0.053\ndistribution2 = 0.842, 0.083, 0.038\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{34}{3}, \\frac{5}{3}, \\frac{31}{3}, 7}$.\n", - "Output Answer": [ - "$\\frac{147560}{34229}$" - ], - "Output Program": [ - "import statistics\nvalues = (34/3), (5/3), (31/3), 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.112,0.047,0.084,0.033,0.212,0.086,0.222,0.09,0.057\\}$ and $\\{0.163,0.025,0.089,0.153,0.075,0.097,0.184,0.046,0.068\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.112, 0.047, 0.084, 0.033, 0.212, 0.086, 0.222, 0.09, 0.057\ndistribution2 = 0.163, 0.025, 0.089, 0.153, 0.075, 0.097, 0.184, 0.046, 0.068\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 243, 1, 243, 1}$.\n", - "Output Answer": [ - "$9\\ 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 243, 1, 243, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${8, -\\frac{20}{e}, -2, -9, 9, 1, 10, -7, 5, 10, -\\sqrt{5}, 7}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, -(20/math.e), -2, -9, 9, 1, 10, -7, 5, 10, -math.sqrt(5), 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, \\frac{17}{\\sqrt{3}}, -\\sqrt{3}, \\frac{48}{7}, 4, -7}$.\n", - "Output Answer": [ - "$7+\\frac{17}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, (17/(math.sqrt(3))), -math.sqrt(3), (48/7), 4, -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.095,0.183,0.148,0.155,0.283\\}$ and $\\{0.121,0.146,0.397,0.125,0.07\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.095, 0.183, 0.148, 0.155, 0.283\ndistribution2 = 0.121, 0.146, 0.397, 0.125, 0.07\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\pi, \\frac{13}{2}, -\\frac{19}{3}}$.\n", - "Output Answer": [ - "$\\frac{77}{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.pi, (13/2), -(19/3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1, 2 \\sqrt{5}, -4, -\\frac{13}{2}, -6} \\cup {1, -10, -2, 4, 2 \\sqrt{5}, -4}$.\n", - "Output Answer": [ - "${-10, -\\frac{13}{2}, -6, -4, -2, 1, 4, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 2*math.sqrt(5), -4, -(13/2), -6,))\nsnd = set((1, -10, -2, 4, 2*math.sqrt(5), -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{16}{3}, 6, 2 \\pi, 7.3, \\frac{8}{\\sqrt{3}}, 9} \\cup {9, -2 \\sqrt{3}, 6, -3, 7.3, -5}$.\n", - "Output Answer": [ - "${-5, -2 \\sqrt{3}, -3, \\frac{8}{\\sqrt{3}}, \\frac{16}{3}, 6, 2 \\pi, 7.3, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set(((16/3), 6, 2*math.pi, 7.3, (8/(math.sqrt(3))), 9,))\nsnd = set((9, -2*math.sqrt(3), 6, -3, 7.3, -5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^2-2.5 x+3.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$-1.39$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(-3.9*x**2-2.5*x+3.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 7, -11, -1, -15}$.\n", - "Output Answer": [ - "$\\sqrt{154}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 7, -11, -1, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -1, -3 e, -2 \\sqrt{5}, 1, \\frac{21}{\\pi }, 5, 8, 3, 8, -1, -13 \\log (2), e}$.\n", - "Output Answer": [ - "$8+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -1, -3*math.e, -2*math.sqrt(5), 1, (21/math.pi), 5, 8, 3, 8, -1, -13*math.log(2), math.e\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3125, 36, 1, -6, 16807}$.\n", - "Output Answer": [ - "$35\\ 6^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3125, 36, 1, -6, 16807\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 9, -4, -6}$.\n", - "Output Answer": [ - "$\\frac{547}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 9, -4, -6\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{12}{5}, \\frac{16}{e}, 5, -5} \\cup {-5, \\frac{39}{5}, -2, \\frac{16}{e}}$.\n", - "Output Answer": [ - "${-5, -2, \\frac{12}{5}, 5, \\frac{16}{e}, \\frac{39}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((12/5), (16/math.e), 5, -5,))\nsnd = set((-5, (39/5), -2, (16/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6.3, -8 \\log (2), 2.1, -1, 0, 5.94} \\setminus {2.1, 5.94, 4, -\\frac{25}{e}, -6, 6, 0}$.\n", - "Output Answer": [ - "${-8 \\log (2), -1, 6.3}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.3, -8*math.log(2), 2.1, -1, 0, 5.94,))\nsnd = set((2.1, 5.94, 4, -(25/math.e), -6, 6, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.63 < 3.5 x-4.3 < 0.31$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9].", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(P((-0.63 < 3.5*x-4.3) & (3.5*x-4.3 < 0.31)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{e}, -\\frac{12}{e}, \\frac{15}{e}, -\\frac{12}{e}, \\frac{10}{e}, -\\frac{13}{e}, \\frac{10}{e}, \\frac{15}{e}, -\\frac{12}{e}, \\frac{15}{e}, -\\frac{12}{e}, \\frac{15}{e}, \\frac{15}{e}, \\frac{6}{e}, \\frac{6}{e}, -\\frac{13}{e}, \\frac{6}{e}, \\frac{10}{e}, -\\frac{12}{e}, \\frac{15}{e}, \\frac{10}{e}, \\frac{6}{e}, -\\frac{13}{e}, -\\frac{13}{e}, \\frac{6}{e}, \\frac{10}{e}, \\frac{10}{e}, -\\frac{13}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{e},\\frac{15}{e},\\frac{10}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(13/math.e), -(12/math.e), (15/math.e), -(12/math.e), (10/math.e), -(13/math.e), (10/math.e), (15/math.e), -(12/math.e), (15/math.e), -(12/math.e), (15/math.e), (15/math.e), (6/math.e), (6/math.e), -(13/math.e), (6/math.e), (10/math.e), -(12/math.e), (15/math.e), (10/math.e), (6/math.e), -(13/math.e), -(13/math.e), (6/math.e), (10/math.e), (10/math.e), -(13/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{1}{5}, -\\frac{18}{5}, 5, -\\frac{21}{5}, -\\frac{3}{5}}$.\n", - "Output Answer": [ - "$-\\frac{16}{25}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (1/5), -(18/5), 5, -(21/5), -(3/5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{22}{3}, 2 \\sqrt{2}, 3, 0, -0.631, -5, -7, 5} \\cup {-5 \\sqrt{2}, -\\frac{22}{3}, -1, -9, 0, -4, 5, -0.631}$.\n", - "Output Answer": [ - "${-9, -\\frac{22}{3}, -5 \\sqrt{2}, -7, -5, -4, -1, -0.631, 0, 2 \\sqrt{2}, 3, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(22/3), 2*math.sqrt(2), 3, 0, -0.631, -5, -7, 5,))\nsnd = set((-5*math.sqrt(2), -(22/3), -1, -9, 0, -4, 5, -0.631,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${262144, 343, 1, 1, 3125, 4096}$.\n", - "Output Answer": [ - "$32\\ 5^{5/6} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 262144, 343, 1, 1, 3125, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4096, 1, -100000, 3125, 36, 16}$.\n", - "Output Answer": [ - "$40 \\sqrt[6]{-1} 2^{5/6} \\sqrt[3]{3} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 4096, 1, -100000, 3125, 36, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.248,0.037,0.29\\}$ and $\\{0.337,0.045,0.172\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.248, 0.037, 0.29\ndistribution2 = 0.337, 0.045, 0.172\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 10, 10}$.\n", - "Output Answer": [ - "$\\frac{4}{\\sqrt{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 10, 10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, -5, -15}$.\n", - "Output Answer": [ - "$\\frac{175}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -5, -15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x^2+3.5 x+1.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$0.85$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(-3.5*x**2+3.5*x+1.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -\\frac{13}{2}, -\\frac{17}{2}}$.\n", - "Output Answer": [ - "$-6$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -(13/2), -(17/2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x^2-4.3 x-4.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$-17.86$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(-2.*x**2-4.3*x-4.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, 0, -3, -3, 5, -3, -3, -3, -5, 2, 8, -1, 8, -1, -5, 2, 2, 0, 0, -5, 5, 2, 8, -1}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, 0, -3, -3, 5, -3, -3, -3, -5, 2, 8, -1, 8, -1, -5, 2, 2, 0, 0, -5, 5, 2, 8, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\sqrt{3}, \\frac{11}{\\pi }, -1, -4, 6, -\\frac{9}{5}, -6, -5, \\frac{19}{2}, \\sqrt{3}} \\cup {-5, \\frac{13}{5}, \\frac{2}{\\sqrt{3}}, 3 \\sqrt{3}, \\frac{23}{5}, 0, \\frac{11}{\\pi }, \\frac{19}{2}, -9, 6}$.\n", - "Output Answer": [ - "${-9, -6, -5, -4, -\\frac{9}{5}, -1, 0, \\frac{2}{\\sqrt{3}}, \\sqrt{3}, \\frac{13}{5}, \\frac{11}{\\pi }, \\frac{23}{5}, 3 \\sqrt{3}, 6, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), (11/math.pi), -1, -4, 6, -(9/5), -6, -5, (19/2), math.sqrt(3),))\nsnd = set((-5, (13/5), (2/(math.sqrt(3))), 3*math.sqrt(3), (23/5), 0, (11/math.pi), (19/2), -9, 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 1000, 25, 256}$.\n", - "Output Answer": [ - "$20\\ 2^{3/4} \\sqrt[4]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 1000, 25, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -9, -8, 9, 13 \\log (2), -6} \\setminus {-6, -3, 9}$.\n", - "Output Answer": [ - "${-9, -8, -1, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -9, -8, 9, 13*math.log(2), -6,))\nsnd = set((-6, -3, 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, \\frac{11}{2}, 5}$.\n", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, (11/2), 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, -6, 81}$.\n", - "Output Answer": [ - "$6 \\sqrt[3]{2} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -6, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{14}{\\sqrt{3}}, -6, 2, -\\frac{9}{e}, 3, \\frac{7}{5}, -\\frac{12}{\\sqrt{\\pi }}, \\pi, -5, -2 \\sqrt{3}, 4}$.\n", - "Output Answer": [ - "$4+\\frac{14}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(14/(math.sqrt(3))), -6, 2, -(9/math.e), 3, (7/5), -(12/(math.sqrt(math.pi))), math.pi, -5, -2*math.sqrt(3), 4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.22,0.096,0.058,0.095,0.039,0.15,0.106\\}$ and $\\{0.169,0.044,0.048,0.156,0.138,0.116,0.201\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.22, 0.096, 0.058, 0.095, 0.039, 0.15, 0.106\ndistribution2 = 0.169, 0.044, 0.048, 0.156, 0.138, 0.116, 0.201\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, -8, 1296, 16}$.\n", - "Output Answer": [ - "$24 \\sqrt[4]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -8, 1296, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{3}, -3 \\sqrt{3}, -3 \\sqrt{3}, -4 \\sqrt{3}, -4 \\sqrt{3}, 6 \\sqrt{3}, -4 \\sqrt{3}, -4 \\sqrt{3}, 4 \\sqrt{3}, -4 \\sqrt{3}, -4 \\sqrt{3}, -3 \\sqrt{3}, 6 \\sqrt{3}, 4 \\sqrt{3}, 6 \\sqrt{3}, -\\sqrt{3}, 3 \\sqrt{3}, -4 \\sqrt{3}, 6 \\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, 3 \\sqrt{3}, 6 \\sqrt{3}, 3 \\sqrt{3}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(3), -3*math.sqrt(3), -3*math.sqrt(3), -4*math.sqrt(3), -4*math.sqrt(3), 6*math.sqrt(3), -4*math.sqrt(3), -4*math.sqrt(3), 4*math.sqrt(3), -4*math.sqrt(3), -4*math.sqrt(3), -3*math.sqrt(3), 6*math.sqrt(3), 4*math.sqrt(3), 6*math.sqrt(3), -math.sqrt(3), 3*math.sqrt(3), -4*math.sqrt(3), 6*math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), 3*math.sqrt(3), 6*math.sqrt(3), 3*math.sqrt(3), -4*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.116,0.104,0.438,0.039,0.1\\}$ and $\\{0.252,0.36,0.103,0.047,0.162\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.116, 0.104, 0.438, 0.039, 0.1\ndistribution2 = 0.252, 0.36, 0.103, 0.047, 0.162\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{6}{\\pi }, \\frac{33}{4}, -5, -9} \\setminus {-7, -3, -9, -5, -\\frac{6}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{\\pi }}, 0, \\frac{33}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -(13/(math.sqrt(math.pi))), -(6/math.pi), (33/4), -5, -9,))\nsnd = set((-7, -3, -9, -5, -(6/math.pi),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{32}{5}, 4 \\sqrt{2}, -9, -3, 8, \\frac{4}{7}, 5, -\\pi, -10, -\\frac{37}{4}, -\\frac{16}{\\sqrt{5}}, -4 \\sqrt{5}, 4}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (32/5), 4*math.sqrt(2), -9, -3, 8, (4/7), 5, -math.pi, -10, -(37/4), -(16/(math.sqrt(5))), -4*math.sqrt(5), 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -2 \\log (2), \\frac{2}{3}, 3, -3, -\\frac{2}{e}}$.", - "Output Answer": [ - "$-\\frac{1}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -2*math.log(2), (2/3), 3, -3, -(2/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3, -8, \\frac{55}{7}, -10, -\\frac{16}{3}, -6, 1, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-10, -8, -6, -\\frac{16}{3}, -3, 1, 3 \\sqrt{3}, \\frac{55}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -8, (55/7), -10, -(16/3), -6, 1, 3*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x^3-0.9 x^2+3.6 x+5.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$7.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(0.9*x**3-0.9*x**2+3.6*x+5.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${9, \\frac{13}{\\sqrt{2}}, \\frac{17}{e}, -5, -\\frac{12}{\\pi }}$.\n", - "Output Answer": [ - "${-5, -\\frac{12}{\\pi }, \\frac{17}{e}, 9, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, (13/(math.sqrt(2))), (17/math.e), -5, -(12/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{34}{3}, 13}$.\n", - "Output Answer": [ - "$\\frac{884}{73}$" - ], - "Output Program": [ - "import statistics\nvalues = (34/3), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, -8, 8, -1, -7, -4}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{14}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -8, 8, -1, -7, -4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, -3125, 4, 36, -1}$.\n", - "Output Answer": [ - "$10\\ 3^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -3125, 4, 36, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, 5, 4 \\sqrt{3}, 5, \\frac{24}{e}, -1, -7, -\\frac{1}{\\sqrt{3}}, 2, \\frac{12}{\\sqrt{\\pi }}, 4, -\\frac{37}{7}, -3 \\sqrt{3}, -7}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 5, 4*math.sqrt(3), 5, (24/math.e), -1, -7, -(1/(math.sqrt(3))), 2, (12/(math.sqrt(math.pi))), 4, -(37/7), -3*math.sqrt(3), -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, 3, 7, -13, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{887}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 3, 7, -13, -2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, -3, 100, -5}$.\n", - "Output Answer": [ - "$3 \\sqrt{2} 15^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, -3, 100, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 14 \\log (2), -6, -\\frac{3}{\\sqrt{2}}, \\frac{62}{7}, 2 \\sqrt{3}, -5 \\sqrt{2}, 6, 0, 3 \\sqrt{2}, 9}$.\n", - "Output Answer": [ - "$5 \\sqrt{2}+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 14*math.log(2), -6, -(3/(math.sqrt(2))), (62/7), 2*math.sqrt(3), -5*math.sqrt(2), 6, 0, 3*math.sqrt(2), 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 3}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -12, -4, 15, -12, 4}$.\n", - "Output Answer": [ - "$\\frac{1654}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -12, -4, 15, -12, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 4, 8, 125}$.\n", - "Output Answer": [ - "$2\\ 10^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 4, 8, 125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{11}{\\sqrt{2}}, -8, e, -\\frac{24}{\\pi }, 2, -\\frac{26}{\\pi }} \\cup {-\\frac{24}{\\pi }, -\\frac{26}{\\pi }, 2, -5 \\sqrt{2}, -4 \\sqrt{2}, -8}$.\n", - "Output Answer": [ - "${-\\frac{26}{\\pi }, -8, -\\frac{24}{\\pi }, -5 \\sqrt{2}, -4 \\sqrt{2}, 2, e, \\frac{11}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((11/(math.sqrt(2))), -8, math.e, -(24/math.pi), 2, -(26/math.pi),))\nsnd = set((-(24/math.pi), -(26/math.pi), 2, -5*math.sqrt(2), -4*math.sqrt(2), -8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8.84, -6}$.\n", - "Output Answer": [ - "${-6, 8.84}$" - ], - "Output Program": [ - "values = 8.84, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, 7, \\frac{17}{4}, -7 \\sqrt{2}, 3 \\sqrt{2}, -5.6, \\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -5.6, 0, 3 \\sqrt{2}, \\frac{17}{4}, 7, \\frac{21}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 7, (17/4), -7*math.sqrt(2), 3*math.sqrt(2), -5.6, (21/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, 9, -4 \\sqrt{2}, -\\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$9+4 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 9, -4*math.sqrt(2), -(4/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.112,0.272,0.054,0.079,0.068,0.313,0.054\\}$ and $\\{0.023,0.051,0.145,0.124,0.19,0.024,0.235\\}$.", - "Output Answer": [ - "$1.07$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.112, 0.272, 0.054, 0.079, 0.068, 0.313, 0.054\ndistribution2 = 0.023, 0.051, 0.145, 0.124, 0.19, 0.024, 0.235\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.154,0.5,0.05\\}$ and $\\{0.597,0.256,0.013\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.154, 0.5, 0.05\ndistribution2 = 0.597, 0.256, 0.013\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\pi, 0, -\\pi, 3 \\pi, -2 \\pi} \\cap {2 \\pi, \\pi, -\\pi, 0, -2 \\pi, 3 \\pi}$.\n", - "Output Answer": [ - "${-2 \\pi, -\\pi, 0, \\pi, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, 0, -math.pi, 3*math.pi, -2*math.pi,))\nsnd = set((2*math.pi, math.pi, -math.pi, 0, -2*math.pi, 3*math.pi,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.132,0.155,0.229,0.166,0.18\\}$ and $\\{0.06,0.144,0.117,0.234,0.029\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.132, 0.155, 0.229, 0.166, 0.18\ndistribution2 = 0.06, 0.144, 0.117, 0.234, 0.029\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, -8, -\\frac{44}{7}, -10, -4, \\frac{2}{\\sqrt{\\pi }}, 6}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -8, -(44/7), -10, -4, (2/(math.sqrt(math.pi))), 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${13 \\log (2), 7, -8, -\\frac{2}{e}, -10, 5, -4, 8, -9, -6} \\cup {10, -9, 8, 13 \\log (2), 2, 5, -\\frac{2}{e}}$.\n", - "Output Answer": [ - "${-10, -9, -8, -6, -4, -\\frac{2}{e}, 2, 5, 7, 8, 13 \\log (2), 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((13*math.log(2), 7, -8, -(2/math.e), -10, 5, -4, 8, -9, -6,))\nsnd = set((10, -9, 8, 13*math.log(2), 2, 5, -(2/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${14, -6, 7}$.\n", - "Output Answer": [ - "$103$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -6, 7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\sqrt{5}, 6, -\\frac{4}{e}, -\\frac{13}{2}, -3, -\\frac{1}{\\sqrt{2}}, \\frac{42}{5}} \\cup {-\\frac{4}{e}, 5 \\sqrt{2}, -3, -\\frac{13}{2}, 2, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{13}{2}, -3, -\\sqrt{5}, -\\frac{4}{e}, -\\frac{1}{\\sqrt{2}}, 2, 6, 5 \\sqrt{2}, \\frac{42}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(5), 6, -(4/math.e), -(13/2), -3, -(1/(math.sqrt(2))), (42/5),))\nsnd = set((-(4/math.e), 5*math.sqrt(2), -3, -(13/2), 2, -math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{1}{2}, -9.7}$.\n", - "Output Answer": [ - "${-9.7, -\\frac{1}{2}}$" - ], - "Output Program": [ - "values = -(1/2), -9.7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{47}{7}, 0.3, -6, -0.404, -4, 2, -8, \\frac{22}{3}}$.\n", - "Output Answer": [ - "${-8, -\\frac{47}{7}, -6, -4, -0.404, 0.3, 2, \\frac{22}{3}}$" - ], - "Output Program": [ - "values = -(47/7), 0.3, -6, -0.404, -4, 2, -8, (22/3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7 \\log (2), 5, -\\frac{3}{\\sqrt{2}}, 3 \\sqrt{5}, 3, -8} \\setminus {\\frac{11}{\\sqrt{2}}, -2, 7 \\log (2), 5, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-8, -\\frac{3}{\\sqrt{2}}, 3, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7*math.log(2), 5, -(3/(math.sqrt(2))), 3*math.sqrt(5), 3, -8,))\nsnd = set(((11/(math.sqrt(2))), -2, 7*math.log(2), 5, -4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -6, 6, -6, -2, -4, 6, -4, -2, 4, -2, -4, -4, 8, -4, -6, 8, -4, 6, -6, -4, -2, -6}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -6, 6, -6, -2, -4, 6, -4, -2, 4, -2, -4, -4, 8, -4, -6, 8, -4, 6, -6, -4, -2, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-5, -4, 64, 625}$.\n", - "Output Answer": [ - "$20 \\sqrt[4]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -4, 64, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.035,0.036,0.09,0.117,0.104,0.2,0.02,0.169,0.057,0.098\\}$ and $\\{0.11,0.047,0.071,0.161,0.049,0.079,0.034,0.043,0.142,0.12\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.035, 0.036, 0.09, 0.117, 0.104, 0.2, 0.02, 0.169, 0.057, 0.098\ndistribution2 = 0.11, 0.047, 0.071, 0.161, 0.049, 0.079, 0.034, 0.043, 0.142, 0.12\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, 7, 0, 0, -10, -1, 7, 7, -10, 1, -1, 0, -2, 1, -10, 0, 7, -10, 7, 1, 0, 7, 1, 7, 1, 1, -2, 1}$.\n", - "Output Answer": [ - "$\\{7,1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, 7, 0, 0, -10, -1, 7, 7, -10, 1, -1, 0, -2, 1, -10, 0, 7, -10, 7, 1, 0, 7, 1, 7, 1, 1, -2, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.13,0.163,0.021,0.199,0.11,0.276\\}$ and $\\{0.144,0.18,0.125,0.095,0.077,0.286\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.13, 0.163, 0.021, 0.199, 0.11, 0.276\ndistribution2 = 0.144, 0.18, 0.125, 0.095, 0.077, 0.286\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -5, 3, -5, -8, 6, -5, -8, -5, -5, -5, 3, 6, -4, 3, 3, -5, -8, -4, -2}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -5, 3, -5, -8, 6, -5, -8, -5, -5, -5, 3, 6, -4, 3, 3, -5, -8, -4, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{52}{3}, \\frac{52}{3}, 1, \\frac{38}{3}}$.\n", - "Output Answer": [ - "$\\frac{988}{295}$" - ], - "Output Program": [ - "import statistics\nvalues = (52/3), (52/3), 1, (38/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.19 < 3.7 x-3.9 < 1.03$ where $x \\sim $ \\text{NormalDistribution}[0.8,1.9].", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.8, 1.9)\nprint(P((-2.19 < 3.7*x-3.9) & (3.7*x-3.9 < 1.03)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.6 x^2-2. x+3.4$ where $x \\sim $ \\text{NormalDistribution}[-1.9,0.9]\n", - "Output Answer": [ - "$-8.71$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.9, 0.9)\nprint(E(-3.6*x**2-2.*x+3.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 17, 4, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{2448}{329}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 17, 4, (17/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{16}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (16/(math.sqrt(3))), (10/(math.sqrt(3))), (14/(math.sqrt(3))), (4/(math.sqrt(3))), (16/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{23}{5}, \\frac{3}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{23}{5}+\\frac{3}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (23/5), (3/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{3}, -4.818, \\frac{19}{2}, 4} \\cup {-4, \\sqrt{3}, 3, \\frac{19}{2}, -\\frac{59}{7}, 4, -4.818}$.\n", - "Output Answer": [ - "${-\\frac{59}{7}, -4.818, -4, \\sqrt{3}, 3, 4, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), -4.818, (19/2), 4,))\nsnd = set((-4, math.sqrt(3), 3, (19/2), -(59/7), 4, -4.818,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.136,0.358,0.176,0.045,0.19\\}$ and $\\{0.152,0.027,0.243,0.244,0.159\\}$.", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.136, 0.358, 0.176, 0.045, 0.19\ndistribution2 = 0.152, 0.027, 0.243, 0.244, 0.159\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{6}{\\sqrt{\\pi }}, -\\pi, 0, -\\frac{16}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{16}{\\pi }+\\frac{6}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (6/(math.sqrt(math.pi))), -math.pi, 0, -(16/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{28}{3}, 10, -\\frac{37}{4}, -9, 0, 1, -9, -6, 3, -\\log (2), -\\frac{21}{\\pi }, \\frac{35}{4}}$.", - "Output Answer": [ - "$\\frac{1}{2} (-6-\\log (2))$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(28/3), 10, -(37/4), -9, 0, 1, -9, -6, 3, -math.log(2), -(21/math.pi), (35/4)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.9 x-3.2$ where $x \\sim $ \\text{BetaDistribution}[0.4,0.7]\n", - "Output Answer": [ - "$-4.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.4, 0.7)\nprint(E(-4.9*x-3.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 15, 6, 10}$.\n", - "Output Answer": [ - "$\\frac{51}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 15, 6, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1.668, \\pi, -\\frac{24}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{24}{\\pi }, -1.668, \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -1.668, math.pi, -(24/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.1 x+0.2$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(0.1*x+0.2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{44}{7}, 4, 8.2, 0.883, \\frac{10}{\\pi }, -5 \\log (2), \\sqrt{2}, \\frac{6}{\\pi }, \\frac{15}{2}} \\cup {\\frac{44}{7}, \\frac{15}{2}, 7 \\sqrt{2}, -\\frac{18}{\\pi }, 8.2, -6, -2 \\log (2), \\frac{10}{\\pi }, 1.263}$.\n", - "Output Answer": [ - "${-6, -\\frac{18}{\\pi }, -5 \\log (2), -2 \\log (2), 0.883, 1.263, \\sqrt{2}, \\frac{6}{\\pi }, \\frac{10}{\\pi }, 4, \\frac{44}{7}, \\frac{15}{2}, 8.2, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((44/7), 4, 8.2, 0.883, (10/math.pi), -5*math.log(2), math.sqrt(2), (6/math.pi), (15/2),))\nsnd = set(((44/7), (15/2), 7*math.sqrt(2), -(18/math.pi), 8.2, -6, -2*math.log(2), (10/math.pi), 1.263,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{15}{\\pi }, -\\frac{6}{\\pi }, \\frac{17}{\\pi }, -\\frac{12}{\\pi }, -\\frac{17}{\\pi }, \\frac{8}{\\pi }, -\\frac{15}{\\pi }, \\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{15}{\\pi }, -\\frac{17}{\\pi }, -\\frac{6}{\\pi }, -\\frac{17}{\\pi }, -\\frac{12}{\\pi }, -\\frac{6}{\\pi }, \\frac{17}{\\pi }, \\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{12}{\\pi }, -\\frac{17}{\\pi }, -\\frac{12}{\\pi }, \\frac{8}{\\pi }, -\\frac{12}{\\pi }, -\\frac{6}{\\pi }, -\\frac{12}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{12}{\\pi },-\\frac{17}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(15/math.pi), -(6/math.pi), (17/math.pi), -(12/math.pi), -(17/math.pi), (8/math.pi), -(15/math.pi), (17/math.pi), -(17/math.pi), -(15/math.pi), -(17/math.pi), -(6/math.pi), -(17/math.pi), -(12/math.pi), -(6/math.pi), (17/math.pi), (17/math.pi), -(17/math.pi), -(12/math.pi), -(17/math.pi), -(12/math.pi), (8/math.pi), -(12/math.pi), -(6/math.pi), -(12/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.164,0.315,0.09,0.196\\}$ and $\\{0.309,0.15,0.13,0.13\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.164, 0.315, 0.09, 0.196\ndistribution2 = 0.309, 0.15, 0.13, 0.13\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.5 x^2-0.7 x-5.2$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$0.91$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(0.5*x**2-0.7*x-5.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.72 < 4.9 x^2+0.3 x-0.5 < 0.89$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3].", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(P((-2.72 < 4.9*x**2+0.3*x-0.5) & (4.9*x**2+0.3*x-0.5 < 0.89)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 6, 1, -\\pi, 4, \\frac{65}{7}, -6 \\sqrt{2}, 8, -2}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 6, 1, -math.pi, 4, (65/7), -6*math.sqrt(2), 8, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\pi, -3, -\\frac{43}{7}, -7 \\log (2), 6, 9} \\cup {6, 9, -7 \\log (2), -1, \\pi, -\\frac{37}{5}, -\\frac{43}{7}}$.\n", - "Output Answer": [ - "${-\\frac{37}{5}, -2 \\pi, -\\frac{43}{7}, -7 \\log (2), -3, -1, \\pi, 6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, -3, -(43/7), -7*math.log(2), 6, 9,))\nsnd = set((6, 9, -7*math.log(2), -1, math.pi, -(37/5), -(43/7),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{17}{3}, -\\frac{17}{3}, \\frac{22}{3}, -\\frac{17}{3}, \\frac{22}{3}, \\frac{22}{3}, \\frac{22}{3}, 0, -\\frac{17}{3}, \\frac{22}{3}, \\frac{22}{3}, 0, \\frac{22}{3}, -\\frac{17}{3}, \\frac{14}{3}, \\frac{8}{3}, \\frac{22}{3}, \\frac{22}{3}, \\frac{14}{3}, 0, 0, \\frac{14}{3}, \\frac{22}{3}, \\frac{8}{3}, 0, \\frac{8}{3}, \\frac{22}{3}, \\frac{22}{3}, 0}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{22}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(17/3), -(17/3), (22/3), -(17/3), (22/3), (22/3), (22/3), 0, -(17/3), (22/3), (22/3), 0, (22/3), -(17/3), (14/3), (8/3), (22/3), (22/3), (14/3), 0, 0, (14/3), (22/3), (8/3), 0, (8/3), (22/3), (22/3), 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, -\\frac{5}{2}, -1, -2 \\log (2), \\frac{34}{7}, -2, 0, -6}$.", - "Output Answer": [ - "$\\frac{1}{2} (-1-2 \\log (2))$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -(5/2), -1, -2*math.log(2), (34/7), -2, 0, -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 1000, 2401, 64, 10}$.\n", - "Output Answer": [ - "$4\\ 2^{2/5} 35^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 1000, 2401, 64, 10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.08,0.073,0.168,0.241,0.12,0.128,0.128\\}$ and $\\{0.032,0.112,0.104,0.28,0.109,0.133,0.168\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.08, 0.073, 0.168, 0.241, 0.12, 0.128, 0.128\ndistribution2 = 0.032, 0.112, 0.104, 0.28, 0.109, 0.133, 0.168\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x+0.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.2]\n", - "Output Answer": [ - "$3.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(E(3.9*x+0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 9, 8, 10}$.\n", - "Output Answer": [ - "$\\frac{18720}{1933}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 9, 8, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${1, 8, 9, 7, -9, -4, -1, -3, 5, -6, -7} \\cap {-9, -3, -7, -8, -6, -2, -4, -1, 5}$.\n", - "Output Answer": [ - "${-9, -7, -6, -4, -3, -1, 5}$" - ], - "Output Program": [ - "fst = set((1, 8, 9, 7, -9, -4, -1, -3, 5, -6, -7,))\nsnd = set((-9, -3, -7, -8, -6, -2, -4, -1, 5,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.7 x^2-1.8 x+4.1$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$-46.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(-3.7*x**2-1.8*x+4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{15}{2}, -9, -\\frac{6}{\\pi }, -2 \\pi, -4, 1, -6}$.\n", - "Output Answer": [ - "${-9, -2 \\pi, -6, -4, -\\frac{6}{\\pi }, 1, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = (15/2), -9, -(6/math.pi), -2*math.pi, -4, 1, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, -9, -3, -\\frac{5}{4}, 4 \\sqrt{3}, 0}$.\n", - "Output Answer": [ - "${-9, -3, -\\frac{5}{4}, 0, 4 \\sqrt{3}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -9, -3, -(5/4), 4*math.sqrt(3), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{11}{\\sqrt{5}}, \\pi, -6, \\frac{7}{\\pi }, -3} \\setminus {\\frac{11}{\\sqrt{5}}, -6, \\pi, \\frac{7}{\\pi }, 2}$.\n", - "Output Answer": [ - "${-3}$" - ], - "Output Program": [ - "import math\n\nfst = set(((11/(math.sqrt(5))), math.pi, -6, (7/math.pi), -3,))\nsnd = set(((11/(math.sqrt(5))), -6, math.pi, (7/math.pi), 2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{2}, -2 e, 0, -6, 1, 2 \\log (2), -9, \\frac{6}{\\sqrt{5}}, 0, 2 e, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$9+4 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(2), -2*math.e, 0, -6, 1, 2*math.log(2), -9, (6/(math.sqrt(5))), 0, 2*math.e, -2*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, 1, 729}$.\n", - "Output Answer": [ - "$9 \\sqrt[3]{-1} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 1, 729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -8, -4, 5 \\log (2), -3, \\frac{13}{\\pi }, -\\frac{17}{4}, 0}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -8, -4, 5*math.log(2), -3, (13/math.pi), -(17/4), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.211,0.074,0.301,0.1,0.116,0.084\\}$ and $\\{0.015,0.053,0.015,0.157,0.284,0.158\\}$.", - "Output Answer": [ - "$1.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.211, 0.074, 0.301, 0.1, 0.116, 0.084\ndistribution2 = 0.015, 0.053, 0.015, 0.157, 0.284, 0.158\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, \\frac{54}{7}, 1, -6, -2, 3, -9, \\frac{17}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{2}}, -4 \\sqrt{5}, -4, -4, \\frac{65}{7}, 6 \\sqrt{2}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, (54/7), 1, -6, -2, 3, -9, (17/(math.sqrt(math.pi))), (7/(math.sqrt(2))), -4*math.sqrt(5), -4, -4, (65/7), 6*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -3, -9.231, 8.32, 1, -2, -9} \\cup {2, 8.32, 7, -9, 8, 3.488}$.\n", - "Output Answer": [ - "${-9.231, -9, -3, -2, -1, 1, 2, 3.488, 7, 8, 8.32}$" - ], - "Output Program": [ - "fst = set((-1, -3, -9.231, 8.32, 1, -2, -9,))\nsnd = set((2, 8.32, 7, -9, 8, 3.488,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -2, \\frac{1}{\\sqrt{2}}, -3, -3, -8, \\frac{22}{\\sqrt{5}}, 10}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -2, (1/(math.sqrt(2))), -3, -3, -8, (22/(math.sqrt(5))), 10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -9, -9, 7, 2, -9, 9, -9, 7, 1, 7, 7, -9, 2, -6, -6, 9, 9, 2, 1, 1, 7, -9, 2}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -9, -9, 7, 2, -9, 9, -9, 7, 1, 7, 7, -9, 2, -6, -6, 9, 9, 2, 1, 1, 7, -9, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\sqrt{2}, -\\frac{13}{\\sqrt{2}}, 0, -\\frac{1}{\\sqrt{2}}, -6 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, -6 \\sqrt{2}, \\sqrt{2}, 0, \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, 0, -6 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}, -6 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, 0, -\\frac{1}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, \\sqrt{2}, -\\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{1}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.sqrt(2), -(13/(math.sqrt(2))), 0, -(1/(math.sqrt(2))), -6*math.sqrt(2), -(1/(math.sqrt(2))), -6*math.sqrt(2), math.sqrt(2), 0, math.sqrt(2), -(1/(math.sqrt(2))), 0, -6*math.sqrt(2), -(7/(math.sqrt(2))), -(1/(math.sqrt(2))), -6*math.sqrt(2), -(1/(math.sqrt(2))), (9/(math.sqrt(2))), (9/(math.sqrt(2))), (9/(math.sqrt(2))), 0, -(1/(math.sqrt(2))), (9/(math.sqrt(2))), math.sqrt(2), -(7/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 17, 3}$.\n", - "Output Answer": [ - "$\\frac{1224}{211}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 17, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{1}{4} \\left(\\frac{2}{\\sqrt{3}}-5 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(1/(math.sqrt(3))), (16/(math.sqrt(3))), -(13/(math.sqrt(3))), -5*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 1, \\pi, 6} \\cup {-3 \\pi, 6, 0, \\pi, 1}$.\n", - "Output Answer": [ - "${-3 \\pi, 0, 1, \\pi, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 1, math.pi, 6,))\nsnd = set((-3*math.pi, 6, 0, math.pi, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{24}{5}, 9.177, \\frac{12}{\\pi }, -9, 2, -\\frac{11}{\\sqrt{\\pi }}, \\frac{11}{e}}$.\n", - "Output Answer": [ - "${-9, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{24}{5}, 2, \\frac{12}{\\pi }, \\frac{11}{e}, 9.177}$" - ], - "Output Program": [ - "import math\n\nvalues = -(24/5), 9.177, (12/math.pi), -9, 2, -(11/(math.sqrt(math.pi))), (11/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{31}{4}, -8, -4, 4, 2 \\sqrt{5}, 3, -4 \\sqrt{2}} \\setminus {\\frac{27}{4}, -4 \\sqrt{2}, 7, -4, 3}$.\n", - "Output Answer": [ - "${-8, -\\frac{31}{4}, 4, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(31/4), -8, -4, 4, 2*math.sqrt(5), 3, -4*math.sqrt(2),))\nsnd = set(((27/4), -4*math.sqrt(2), 7, -4, 3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{3}, \\frac{11}{3}, \\frac{11}{3}, \\frac{4}{3}, \\frac{19}{3}, \\frac{19}{3}, 3, \\frac{11}{3}, \\frac{19}{3}, \\frac{4}{3}, 3, 6, -\\frac{13}{3}, -\\frac{28}{3}, \\frac{4}{3}, \\frac{4}{3}, 3, \\frac{4}{3}, 6, \\frac{11}{3}, 3, 6, -\\frac{13}{3}, 6, -\\frac{13}{3}, -\\frac{28}{3}, 3, 3, 6, -\\frac{13}{3}}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(13/3), (11/3), (11/3), (4/3), (19/3), (19/3), 3, (11/3), (19/3), (4/3), 3, 6, -(13/3), -(28/3), (4/3), (4/3), 3, (4/3), 6, (11/3), 3, 6, -(13/3), 6, -(13/3), -(28/3), 3, 3, 6, -(13/3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${243, -2, 2401, 9, 36, 117649}$.\n", - "Output Answer": [ - "$21 \\sqrt[6]{-1} \\sqrt{6} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 243, -2, 2401, 9, 36, 117649\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, \\frac{7}{\\sqrt{5}}, \\frac{5}{3}}$.", - "Output Answer": [ - "$\\frac{7}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, (7/(math.sqrt(5))), (5/3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 10, 3, -8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{298}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 10, 3, -8\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, 15, 3, -14, 14, 9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{853}{6}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 15, 3, -14, 14, 9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.115,0.021,0.006,0.083,0.043,0.144,0.092,0.29,0.069\\}$ and $\\{0.074,0.009,0.103,0.118,0.087,0.128,0.08,0.049,0.152\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.115, 0.021, 0.006, 0.083, 0.043, 0.144, 0.092, 0.29, 0.069\ndistribution2 = 0.074, 0.009, 0.103, 0.118, 0.087, 0.128, 0.08, 0.049, 0.152\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, 2, -2}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, 2, -2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1296, 27, 4, 16807, 9}$.\n", - "Output Answer": [ - "$42 \\sqrt[5]{2} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1296, 27, 4, 16807, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.373,0.247\\}$ and $\\{0.217,0.318,0.408\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.373, 0.247\ndistribution2 = 0.217, 0.318, 0.408\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{4}{e}, -\\frac{26}{e}, \\frac{6}{e}, -\\frac{2}{e}}$.\n", - "Output Answer": [ - "$-\\frac{9}{2 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (4/math.e), -(26/math.e), (6/math.e), -(2/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9, e, 3 \\sqrt{3}, 8, 3} \\setminus {3, 8, -3}$.\n", - "Output Answer": [ - "${e, 3 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, math.e, 3*math.sqrt(3), 8, 3,))\nsnd = set((3, 8, -3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{66}{7}, 2, \\sqrt{3}, -\\frac{3}{\\sqrt{2}}, -\\frac{21}{4}, -5, \\frac{18}{5}, -4} \\cup {9, -5, 0, -4, 2, \\sqrt{3}, \\frac{18}{5}, \\frac{66}{7}, -5.871}$.\n", - "Output Answer": [ - "${-5.871, -\\frac{21}{4}, -5, -4, -\\frac{3}{\\sqrt{2}}, 0, \\sqrt{3}, 2, \\frac{18}{5}, 9, \\frac{66}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((66/7), 2, math.sqrt(3), -(3/(math.sqrt(2))), -(21/4), -5, (18/5), -4,))\nsnd = set((9, -5, 0, -4, 2, math.sqrt(3), (18/5), (66/7), -5.871,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.077,0.178,0.069,0.118,0.053,0.08,0.045,0.098,0.127,0.04\\}$ and $\\{0.162,0.058,0.203,0.016,0.066,0.056,0.137,0.139,0.02,0.08\\}$.", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.077, 0.178, 0.069, 0.118, 0.053, 0.08, 0.045, 0.098, 0.127, 0.04\ndistribution2 = 0.162, 0.058, 0.203, 0.016, 0.066, 0.056, 0.137, 0.139, 0.02, 0.08\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.079,0.242,0.094,0.123,0.192,0.082,0.099\\}$ and $\\{0.211,0.105,0.136,0.113,0.11,0.087,0.139\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.079, 0.242, 0.094, 0.123, 0.192, 0.082, 0.099\ndistribution2 = 0.211, 0.105, 0.136, 0.113, 0.11, 0.087, 0.139\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, 0}$.\n", - "Output Answer": [ - "$\\frac{1}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{20}{3}, -3 \\sqrt{3}, 10, 6, \\frac{16}{7}, -8} \\cup {-2 \\sqrt{3}, -\\frac{11}{7}, 10, -9, 4, \\frac{20}{3}}$.\n", - "Output Answer": [ - "${-9, -8, -3 \\sqrt{3}, -2 \\sqrt{3}, -\\frac{11}{7}, \\frac{16}{7}, 4, 6, \\frac{20}{3}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((20/3), -3*math.sqrt(3), 10, 6, (16/7), -8,))\nsnd = set((-2*math.sqrt(3), -(11/7), 10, -9, 4, (20/3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, 6, 0}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{7}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 6, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{29}{7}, -\\frac{18}{e}, \\frac{16}{3}, 6, \\frac{13}{\\sqrt{\\pi }}, 4, -\\frac{13}{\\sqrt{5}}, -2 \\pi, -\\frac{1}{2}, \\frac{4}{\\sqrt{3}}, \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{4}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (29/7), -(18/math.e), (16/3), 6, (13/(math.sqrt(math.pi))), 4, -(13/(math.sqrt(5))), -2*math.pi, -(1/2), (4/(math.sqrt(3))), math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x^2-2. x+0.5$ where $x \\sim $ \\text{NormalDistribution}[-1.,3.]\n", - "Output Answer": [ - "$18.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1., 3.)\nprint(E(1.6*x**2-2.*x+0.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, \\frac{17}{\\sqrt{\\pi }}, -6, 7, \\frac{6}{\\pi }}$.", - "Output Answer": [ - "$\\frac{6}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, (17/(math.sqrt(math.pi))), -6, 7, (6/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 8, 2, 1, -9, 2}$.\n", - "Output Answer": [ - "$\\frac{5}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 8, 2, 1, -9, 2\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, \\frac{5}{3}, \\frac{41}{3}, 18}$.\n", - "Output Answer": [ - "$\\frac{4920}{1033}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, (5/3), (41/3), 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.029,0.075,0.351,0.063,0.085,0.021,0.133,0.097,0.069\\}$ and $\\{0.076,0.15,0.073,0.094,0.064,0.141,0.097,0.237,0.047\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.029, 0.075, 0.351, 0.063, 0.085, 0.021, 0.133, 0.097, 0.069\ndistribution2 = 0.076, 0.15, 0.073, 0.094, 0.064, 0.141, 0.097, 0.237, 0.047\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 e, 9, 2 \\pi, 3, 14 \\log (2), 2, 0, -3, 6} \\cup {3, 0, 10 \\log (2), 6, -3, -3 e, 2}$.\n", - "Output Answer": [ - "${-3 e, -3, 0, 2, 3, 6, 2 \\pi, 10 \\log (2), 9, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.e, 9, 2*math.pi, 3, 14*math.log(2), 2, 0, -3, 6,))\nsnd = set((3, 0, 10*math.log(2), 6, -3, -3*math.e, 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x^3+3.8 x^2+3.9 x+1.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7]\n", - "Output Answer": [ - "$5.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(E(1.6*x**3+3.8*x**2+3.9*x+1.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\sqrt{3}, \\sqrt{3}, -4 \\sqrt{3}, 0, \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{3}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.sqrt(3), math.sqrt(3), -4*math.sqrt(3), 0, math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-3 \\log (2), -7, -8, 6, \\frac{1}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-8, -7, -3 \\log (2), \\frac{1}{\\sqrt{5}}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.log(2), -7, -8, 6, (1/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x^2-2. x+1.$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$19.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(2.8*x**2-2.*x+1.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{5}{\\sqrt{2}}, 0, 12 \\log (2), -5, -6, 6, 5, -8}$.\n", - "Output Answer": [ - "${-8, -6, -5, -\\frac{5}{\\sqrt{2}}, 0, 5, 6, 12 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/(math.sqrt(2))), 0, 12*math.log(2), -5, -6, 6, 5, -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, 9, 4 \\sqrt{3}, -\\sqrt{2}, \\frac{34}{7}}$.", - "Output Answer": [ - "$4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 9, 4*math.sqrt(3), -math.sqrt(2), (34/7)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -4, \\frac{15}{\\pi }} \\setminus {8, 6, \\frac{3}{2}, 0, 3 e}$.\n", - "Output Answer": [ - "${-8, -4, \\frac{15}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -4, (15/math.pi),))\nsnd = set((8, 6, (3/2), 0, 3*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.7 x+1.3 < 1.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2].", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(P((0.7*x+1.3 < 1.3)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{19}{3}, 5, 15, \\frac{29}{3}}$.\n", - "Output Answer": [ - "$\\frac{8265}{1091}$" - ], - "Output Program": [ - "import statistics\nvalues = (19/3), 5, 15, (29/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, 46656, 1, -729, 3125, -7}$.\n", - "Output Answer": [ - "$54\\ 5^{5/6} \\sqrt[6]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, 46656, 1, -729, 3125, -7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, -4, 4, \\frac{30}{\\pi }, 6.7, -7, 8}$.\n", - "Output Answer": [ - "${-9, -7, -4, 4, 6.7, 8, \\frac{30}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -4, 4, (30/math.pi), 6.7, -7, 8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-4, -8, \\frac{14}{\\sqrt{\\pi }}, 5, -\\frac{8}{5}, \\frac{26}{3}, -7, -1, -8, -7}$.", - "Output Answer": [ - "$-\\frac{14}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, -8, (14/(math.sqrt(math.pi))), 5, -(8/5), (26/3), -7, -1, -8, -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 4, 7, 5, -3, \\frac{18}{\\sqrt{5}}, -\\frac{3}{\\sqrt{2}}, -4, -\\frac{43}{5}, 2 \\sqrt{3}, -7}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 4, 7, 5, -3, (18/(math.sqrt(5))), -(3/(math.sqrt(2))), -4, -(43/5), 2*math.sqrt(3), -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x^3+4.2 x^2+1. x-4.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$4.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(1.6*x**3+4.2*x**2+1.*x-4.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{2}{\\sqrt{5}}, -9, \\frac{11}{\\sqrt{5}}, 4 e, -\\frac{16}{e}, 0}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(2/(math.sqrt(5))), -9, (11/(math.sqrt(5))), 4*math.e, -(16/math.e), 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9.46, 1, \\frac{23}{5}, -6, \\frac{23}{3}}$.\n", - "Output Answer": [ - "${-9.46, -6, 1, \\frac{23}{5}, \\frac{23}{3}}$" - ], - "Output Program": [ - "values = -9.46, 1, (23/5), -6, (23/3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.063,0.067,0.062,0.051,0.061,0.09,0.064,0.118,0.184,0.066\\}$ and $\\{0.061,0.005,0.178,0.03,0.212,0.126,0.124,0.005,0.022,0.11\\}$.", - "Output Answer": [ - "$0.93$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.063, 0.067, 0.062, 0.051, 0.061, 0.09, 0.064, 0.118, 0.184, 0.066\ndistribution2 = 0.061, 0.005, 0.178, 0.03, 0.212, 0.126, 0.124, 0.005, 0.022, 0.11\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{37}{5}, -6 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, -1, -4 \\log (2), -2, 3} \\cup {6 \\sqrt{2}, -2, -\\frac{20}{3}, -8 \\log (2), \\frac{39}{5}, 0}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -6 \\sqrt{2}, -\\frac{37}{5}, -\\frac{20}{3}, -8 \\log (2), -4 \\log (2), -2, -1, 0, 3, \\frac{39}{5}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(37/5), -6*math.sqrt(2), -(13/(math.sqrt(2))), -1, -4*math.log(2), -2, 3,))\nsnd = set((6*math.sqrt(2), -2, -(20/3), -8*math.log(2), (39/5), 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, 5, -6, -7, 2} \\cap {-7, -2, -9, 8, -4, 4}$.\n", - "Output Answer": [ - "${-9, -7}$" - ], - "Output Program": [ - "fst = set((-9, 5, -6, -7, 2,))\nsnd = set((-7, -2, -9, 8, -4, 4,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -3, 4, -2 \\pi}$.", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -3, 4, -2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{17}{2}, \\frac{19}{4}, \\frac{17}{2}, \\frac{19}{4}, \\frac{17}{2}, \\frac{19}{4}, \\frac{19}{4}, \\frac{17}{2}, \\frac{17}{2}, \\frac{19}{4}, -\\frac{17}{2}, \\frac{17}{2}, \\frac{17}{2}, -\\frac{17}{2}, \\frac{17}{2}, -\\frac{17}{2}, \\frac{3}{4}, -\\frac{17}{2}, \\frac{17}{2}, \\frac{17}{2}, \\frac{3}{4}, \\frac{17}{2}, \\frac{19}{4}, -\\frac{17}{2}, -\\frac{17}{2}, \\frac{3}{4}, \\frac{3}{4}, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{17}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(17/2), (19/4), (17/2), (19/4), (17/2), (19/4), (19/4), (17/2), (17/2), (19/4), -(17/2), (17/2), (17/2), -(17/2), (17/2), -(17/2), (3/4), -(17/2), (17/2), (17/2), (3/4), (17/2), (19/4), -(17/2), -(17/2), (3/4), (3/4), (17/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{9}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (9/(math.sqrt(5))), -(18/(math.sqrt(5))), -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), (9/(math.sqrt(5))), -(18/(math.sqrt(5))), -(3/(math.sqrt(5))), (2/(math.sqrt(5))), (1/(math.sqrt(5))), (2/(math.sqrt(5))), (2/(math.sqrt(5))), -(18/(math.sqrt(5))), -(3/(math.sqrt(5))), -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), -(3/(math.sqrt(5))), -(3/(math.sqrt(5))), (1/(math.sqrt(5))), -(18/(math.sqrt(5))), (1/(math.sqrt(5))), -(16/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, -9, -1000, 2401, 25, 625}$.\n", - "Output Answer": [ - "$5 \\sqrt[6]{-1} \\sqrt{10} 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -9, -1000, 2401, 25, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 8, 2, 0, -\\frac{10}{e}, -2 \\sqrt{2}, -\\frac{13}{e}, \\frac{8}{5}} \\cup {\\frac{5}{e}, \\frac{8}{5}, 6, 2, -3, -5 \\sqrt{2}, 0, -7}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -7, -\\frac{13}{e}, -\\frac{10}{e}, -3, -2 \\sqrt{2}, 0, \\frac{8}{5}, \\frac{5}{e}, 2, 6, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 8, 2, 0, -(10/math.e), -2*math.sqrt(2), -(13/math.e), (8/5),))\nsnd = set(((5/math.e), (8/5), 6, 2, -3, -5*math.sqrt(2), 0, -7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -\\frac{26}{\\pi }, 8, -8, -6, -5} \\cup {8, 7, 2, -\\frac{4}{\\pi }, -7, -9, -2}$.\n", - "Output Answer": [ - "${-9, -\\frac{26}{\\pi }, -8, -7, -6, -5, -2, -\\frac{4}{\\pi }, 2, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -(26/math.pi), 8, -8, -6, -5,))\nsnd = set((8, 7, 2, -(4/math.pi), -7, -9, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -\\frac{17}{2}, -9, 8, -2 e, 7, -2, 2, -\\frac{26}{e}, -\\frac{8}{3}, 0, -\\frac{1}{\\sqrt{3}}, \\frac{16}{\\sqrt{\\pi }}, 3, 3}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -(17/2), -9, 8, -2*math.e, 7, -2, 2, -(26/math.e), -(8/3), 0, -(1/(math.sqrt(3))), (16/(math.sqrt(math.pi))), 3, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{1}{\\sqrt{2}}, -5, -3, 3, 9, 2, 3}$.\n", - "Output Answer": [ - "${-5, -3, -\\frac{1}{\\sqrt{2}}, 2, 3, 3, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(1/(math.sqrt(2))), -5, -3, 3, 9, 2, 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{2}, -\\frac{14}{\\sqrt{\\pi }}, \\frac{19}{3}, -\\sqrt{2}, -6}$.", - "Output Answer": [ - "$-2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(2), -(14/(math.sqrt(math.pi))), (19/3), -math.sqrt(2), -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{3}, 3, 1, -2, -8, 3}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(3), 3, 1, -2, -8, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, 6, -6, -1, -3, -9, -6 \\sqrt{2}, 1, -2 \\sqrt{5}, -9}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-3-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 6, -6, -1, -3, -9, -6*math.sqrt(2), 1, -2*math.sqrt(5), -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7776, 216, 49, -343, 256, 1}$.\n", - "Output Answer": [ - "$12\\ 2^{2/3} \\sqrt[3]{3} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = -7776, 216, 49, -343, 256, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{1}{\\sqrt{2}}, 4, 3, -6} \\setminus {-3, 9, 4, -8 \\log (2), 3, -6}$.\n", - "Output Answer": [ - "${-\\frac{1}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(1/(math.sqrt(2))), 4, 3, -6,))\nsnd = set((-3, 9, 4, -8*math.log(2), 3, -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2, 9, -\\frac{14}{\\pi }, 7, 10, 7, 2, 5, \\frac{15}{2}, \\frac{27}{e}, 9, -4 \\sqrt{5}, 9, -\\frac{19}{5}}$.", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, 9, -(14/math.pi), 7, 10, 7, 2, 5, (15/2), (27/math.e), 9, -4*math.sqrt(5), 9, -(19/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -4, -\\frac{19}{2}, -\\frac{8}{e}, 2, -3 \\sqrt{5}, -\\frac{12}{5}}$.\n", - "Output Answer": [ - "$\\frac{23}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -4, -(19/2), -(8/math.e), 2, -3*math.sqrt(5), -(12/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 9, -5, -2, -3}$.\n", - "Output Answer": [ - "$\\frac{2}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 9, -5, -2, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -13, -12, -10}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -13, -12, -10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, 8, \\frac{16}{\\sqrt{\\pi }}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 8, (16/(math.sqrt(math.pi))), -5*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{3}, 4.52, -5, 2 \\sqrt{3}, -2, -1} \\cup {4.52, 6, 10, 2 \\sqrt{3}, -\\frac{29}{4}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{29}{4}, -5, -2, -1, \\sqrt{3}, 2 \\sqrt{3}, 4.52, 6, 4 \\sqrt{3}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), 4.52, -5, 2*math.sqrt(3), -2, -1,))\nsnd = set((4.52, 6, 10, 2*math.sqrt(3), -(29/4), 4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, \\frac{15}{2}, -3} \\setminus {2, -7, -9.7, 1, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, (15/2), -3,))\nsnd = set((2, -7, -9.7, 1, 5*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-8, 2 e, -\\frac{19}{e}}$.\n", - "Output Answer": [ - "${-8, -\\frac{19}{e}, 2 e}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 2*math.e, -(19/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, -9, -10, 15, 12}$.\n", - "Output Answer": [ - "$\\frac{1337}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -9, -10, 15, 12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, \\frac{7}{e}}$.\n", - "Output Answer": [ - "$6+\\frac{7}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, (7/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, -0.833, -6.51, 2, 3, 7}$.\n", - "Output Answer": [ - "${-6.51, -0.833, 2, 3, 7, 7}$" - ], - "Output Program": [ - "values = 7, -0.833, -6.51, 2, 3, 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{18}{\\pi }, -8, 1, 0, 6, -3 \\sqrt{2}, \\frac{2}{\\sqrt{5}}, -7}$.", - "Output Answer": [ - "$\\frac{1}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (18/math.pi), -8, 1, 0, 6, -3*math.sqrt(2), (2/(math.sqrt(5))), -7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.041,0.031,0.075,0.083,0.122,0.096,0.114,0.181,0.024,0.111\\}$ and $\\{0.04,0.087,0.134,0.028,0.153,0.18,0.042,0.128,0.088,0.067\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.041, 0.031, 0.075, 0.083, 0.122, 0.096, 0.114, 0.181, 0.024, 0.111\ndistribution2 = 0.04, 0.087, 0.134, 0.028, 0.153, 0.18, 0.042, 0.128, 0.088, 0.067\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -\\frac{11}{\\sqrt{3}}, -4 \\sqrt{2}, -5, -12 \\log (2)} \\setminus {-12 \\log (2), -4 \\sqrt{2}, 1, -8, 4, 2 e}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{3}}, -5}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -(11/(math.sqrt(3))), -4*math.sqrt(2), -5, -12*math.log(2),))\nsnd = set((-12*math.log(2), -4*math.sqrt(2), 1, -8, 4, 2*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${0, -4, -5, -\\frac{1}{3}, \\frac{11}{3}, -\\frac{2}{3}, -9, -\\frac{26}{3}, \\frac{17}{3}, -\\frac{7}{3}, -6, 2} \\cap {\\frac{19}{3}, -\\frac{28}{3}, -9, -2, -4, \\frac{4}{3}, 6, -\\frac{26}{3}, 1, \\frac{11}{3}, -5, 0}$.\n", - "Output Answer": [ - "${-9, -\\frac{26}{3}, -5, -4, 0, \\frac{11}{3}}$" - ], - "Output Program": [ - "fst = set((0, -4, -5, -(1/3), (11/3), -(2/3), -9, -(26/3), (17/3), -(7/3), -6, 2,))\nsnd = set(((19/3), -(28/3), -9, -2, -4, (4/3), 6, -(26/3), 1, (11/3), -5, 0,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.5 x-3.8$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$-1.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(4.5*x-3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{2}, 9, \\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\frac{4995}{497}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/2), 9, (15/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, 7, -4, 2, \\frac{2}{e}}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 7, -4, 2, (2/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{15}{\\sqrt{\\pi }}, -2 e, \\frac{11}{\\sqrt{5}}, 9, -\\frac{23}{e}, 3, -1, \\frac{5}{3}}$.\n", - "Output Answer": [ - "${-\\frac{15}{\\sqrt{\\pi }}, -\\frac{23}{e}, -2 e, -1, \\frac{5}{3}, 3, \\frac{11}{\\sqrt{5}}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/(math.sqrt(math.pi))), -2*math.e, (11/(math.sqrt(5))), 9, -(23/math.e), 3, -1, (5/3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.032,0.123,0.102,0.149,0.077,0.08,0.049,0.177,0.164\\}$ and $\\{0.05,0.075,0.134,0.067,0.115,0.078,0.114,0.04,0.124\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.032, 0.123, 0.102, 0.149, 0.077, 0.08, 0.049, 0.177, 0.164\ndistribution2 = 0.05, 0.075, 0.134, 0.067, 0.115, 0.078, 0.114, 0.04, 0.124\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{10}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, 0, \\frac{14}{\\sqrt{3}}, 0, 0, \\frac{7}{\\sqrt{3}}, 0, 0, -\\frac{13}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, 0, \\frac{14}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{14}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (10/(math.sqrt(3))), (14/(math.sqrt(3))), (14/(math.sqrt(3))), 0, (14/(math.sqrt(3))), 0, 0, (7/(math.sqrt(3))), 0, 0, -(13/(math.sqrt(3))), (14/(math.sqrt(3))), -(13/(math.sqrt(3))), (10/(math.sqrt(3))), (10/(math.sqrt(3))), (14/(math.sqrt(3))), -(13/(math.sqrt(3))), (14/(math.sqrt(3))), 0, (14/(math.sqrt(3))), (14/(math.sqrt(3))), (7/(math.sqrt(3))), -(13/(math.sqrt(3))), (10/(math.sqrt(3))), (10/(math.sqrt(3))), (7/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{17}{3}, 19, \\frac{26}{3}}$.\n", - "Output Answer": [ - "$\\frac{25194}{2893}$" - ], - "Output Program": [ - "import statistics\nvalues = (17/3), 19, (26/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.173,0.066,0.295,0.154,0.188\\}$ and $\\{0.133,0.118,0.015,0.325,0.375\\}$.", - "Output Answer": [ - "$0.83$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.173, 0.066, 0.295, 0.154, 0.188\ndistribution2 = 0.133, 0.118, 0.015, 0.325, 0.375\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-5.62 < -2.4 x-0.6 < 3.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5].", - "Output Answer": [ - "$0.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(P((-5.62 < -2.4*x-0.6) & (-2.4*x-0.6 < 3.5)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, 2, -8, 10, 11, -4}$.\n", - "Output Answer": [ - "$\\frac{1054}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, 2, -8, 10, 11, -4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{2}, 7, 4 \\sqrt{3}, 6, -\\frac{24}{\\pi }, \\frac{3}{\\sqrt{5}}} \\setminus {-5, -\\frac{11}{\\sqrt{5}}, -\\frac{24}{\\pi }, 9, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${\\frac{3}{\\sqrt{5}}, 6, 7, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), 7, 4*math.sqrt(3), 6, -(24/math.pi), (3/(math.sqrt(5))),))\nsnd = set((-5, -(11/(math.sqrt(5))), -(24/math.pi), 9, 4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, -8, 5}$.\n", - "Output Answer": [ - "${-8, 3, 5}$" - ], - "Output Program": [ - "values = 3, -8, 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, -3, -\\frac{9}{\\sqrt{\\pi }}, 3, -2, 4.9, -10, -11 \\log (2)}$.\n", - "Output Answer": [ - "${-10, -9, -11 \\log (2), -\\frac{9}{\\sqrt{\\pi }}, -3, -2, 3, 4.9}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -3, -(9/(math.sqrt(math.pi))), 3, -2, 4.9, -10, -11*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${10, -7, -6, -1, -3, 5, 8} \\cap {10, -3, 2, 5, -6, -7, -1, 8}$.\n", - "Output Answer": [ - "${-7, -6, -3, -1, 5, 8, 10}$" - ], - "Output Program": [ - "fst = set((10, -7, -6, -1, -3, 5, 8,))\nsnd = set((10, -3, 2, 5, -6, -7, -1, 8,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${e, 2 e, e, 2 e, e, 3 e, e, e, e, 3 e, e, 3 e, e, 3 e, e, 2 e, e, 3 e, 3 e, 2 e, e, 3 e, e, 3 e}$.\n", - "Output Answer": [ - "$\\{e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.e, 2*math.e, math.e, 2*math.e, math.e, 3*math.e, math.e, math.e, math.e, 3*math.e, math.e, 3*math.e, math.e, 3*math.e, math.e, 2*math.e, math.e, 3*math.e, 3*math.e, 2*math.e, math.e, 3*math.e, math.e, 3*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4 \\sqrt{2}, 8, 0, \\sqrt{5}, -\\pi, -8.7, 6, 7} \\cup {-\\pi, 5, 8, \\sqrt{5}, -8.7, 0, 5 \\sqrt{2}, -9}$.\n", - "Output Answer": [ - "${-9, -8.7, -4 \\sqrt{2}, -\\pi, 0, \\sqrt{5}, 5, 6, 7, 5 \\sqrt{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(2), 8, 0, math.sqrt(5), -math.pi, -8.7, 6, 7,))\nsnd = set((-math.pi, 5, 8, math.sqrt(5), -8.7, 0, 5*math.sqrt(2), -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{17}{3}, -6, 9, -\\frac{3}{5}, -9.063, 8, -4 \\log (2)} \\cup {-9.063, -8, 5 \\log (2), -6, -5, -\\frac{2}{5}, 8}$.\n", - "Output Answer": [ - "${-9.063, -8, -6, -\\frac{17}{3}, -5, -4 \\log (2), -\\frac{3}{5}, -\\frac{2}{5}, 5 \\log (2), 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(17/3), -6, 9, -(3/5), -9.063, 8, -4*math.log(2),))\nsnd = set((-9.063, -8, 5*math.log(2), -6, -5, -(2/5), 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{2}, -4, -8, -2 e, -2, e, \\frac{39}{4}, 2 e, -\\frac{1}{e}}$.", - "Output Answer": [ - "$-\\frac{1}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(2), -4, -8, -2*math.e, -2, math.e, (39/4), 2*math.e, -(1/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 18, 17, 15}$.\n", - "Output Answer": [ - "$\\frac{1530}{133}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 18, 17, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 2, 9}$.\n", - "Output Answer": [ - "$\\frac{27}{7}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 2, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8, -8, \\frac{1}{\\sqrt{2}}, -3.4, -\\frac{3}{\\pi }, 9, -2} \\cup {\\frac{1}{\\sqrt{2}}, 8, -5, 0, -9.4, 6}$.\n", - "Output Answer": [ - "${-9.4, -8, -5, -3.4, -2, -\\frac{3}{\\pi }, 0, \\frac{1}{\\sqrt{2}}, 6, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -8, (1/(math.sqrt(2))), -3.4, -(3/math.pi), 9, -2,))\nsnd = set(((1/(math.sqrt(2))), 8, -5, 0, -9.4, 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6.6, -2 \\sqrt{5}, -8, -\\frac{41}{5}, 2, -4, -10, \\frac{21}{e}}$.\n", - "Output Answer": [ - "${-10, -\\frac{41}{5}, -8, -2 \\sqrt{5}, -4, 2, 6.6, \\frac{21}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6.6, -2*math.sqrt(5), -8, -(41/5), 2, -4, -10, (21/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{5}{3}, -\\frac{2}{3}, -\\frac{20}{3}, -1, -\\frac{2}{3}, -\\frac{19}{3}, \\frac{14}{3}, -\\frac{2}{3}, -\\frac{19}{3}, -\\frac{19}{3}, -\\frac{20}{3}, -\\frac{2}{3}, -\\frac{5}{3}, -\\frac{2}{3}, -\\frac{19}{3}, -7, -1, -1, 9, -7, -1, -1, -\\frac{5}{3}, 9, -\\frac{20}{3}, \\frac{14}{3}, -\\frac{2}{3}, -1, -7}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{2}{3},-1\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(5/3), -(2/3), -(20/3), -1, -(2/3), -(19/3), (14/3), -(2/3), -(19/3), -(19/3), -(20/3), -(2/3), -(5/3), -(2/3), -(19/3), -7, -1, -1, 9, -7, -1, -1, -(5/3), 9, -(20/3), (14/3), -(2/3), -1, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, -\\sqrt{5}, \\frac{4}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{11}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, -3 \\sqrt{5}, -\\frac{16}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -3 \\sqrt{5}, -\\frac{11}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(16/(math.sqrt(5))), (2/(math.sqrt(5))), -(16/(math.sqrt(5))), (12/(math.sqrt(5))), (4/(math.sqrt(5))), (4/(math.sqrt(5))), -math.sqrt(5), (4/(math.sqrt(5))), (12/(math.sqrt(5))), -math.sqrt(5), -(11/(math.sqrt(5))), (2/(math.sqrt(5))), -(16/(math.sqrt(5))), -(11/(math.sqrt(5))), -(16/(math.sqrt(5))), (12/(math.sqrt(5))), (2/(math.sqrt(5))), (12/(math.sqrt(5))), -3*math.sqrt(5), -(16/(math.sqrt(5))), -(16/(math.sqrt(5))), -3*math.sqrt(5), -(11/(math.sqrt(5))), (4/(math.sqrt(5))), (4/(math.sqrt(5))), -(11/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.036,0.063,0.059,0.009,0.139,0.439\\}$ and $\\{0.053,0.117,0.327,0.211,0.151,0.045\\}$.", - "Output Answer": [ - "$1.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.036, 0.063, 0.059, 0.009, 0.139, 0.439\ndistribution2 = 0.053, 0.117, 0.327, 0.211, 0.151, 0.045\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.5 x^2+1.6 x-0.9$ where $x \\sim $ \\text{BetaDistribution}[1.6,1.8]\n", - "Output Answer": [ - "$1.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 1.8)\nprint(E(4.5*x**2+1.6*x-0.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -2, -9, \\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$9+\\frac{21}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -2, -9, (21/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, \\frac{11}{\\sqrt{5}}, -\\frac{19}{\\pi }, 4 \\sqrt{2}, 2, -6, \\frac{8}{e}, -\\frac{39}{4}, 4 \\sqrt{5}, -4}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, (11/(math.sqrt(5))), -(19/math.pi), 4*math.sqrt(2), 2, -6, (8/math.e), -(39/4), 4*math.sqrt(5), -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{31}{4}, 7, 1, -10, 1}$.\n", - "Output Answer": [ - "${-10, -\\frac{31}{4}, 1, 1, 7}$" - ], - "Output Program": [ - "values = -(31/4), 7, 1, -10, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{7}{e}, \\frac{16}{e}}$.\n", - "Output Answer": [ - "$\\frac{23}{2 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (7/math.e), (16/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, \\frac{35}{2}, 19, 17}$.\n", - "Output Answer": [ - "$\\frac{45220}{13211}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, (35/2), 19, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.262,0.024,0.214,0.141,0.065,0.096\\}$ and $\\{0.221,0.069,0.333,0.232,0.063,0.066\\}$.", - "Output Answer": [ - "$0.07$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.262, 0.024, 0.214, 0.141, 0.065, 0.096\ndistribution2 = 0.221, 0.069, 0.333, 0.232, 0.063, 0.066\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 4, 6, 6, 4, -10, -10, 2, 2, -10, 4, 6, -10, -10, -10, 2, -10, -10, 4, 4, 6, -10, -10, -10, -10, 2, 6, 4}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 4, 6, 6, 4, -10, -10, 2, 2, -10, 4, 6, -10, -10, -10, 2, -10, -10, 4, 4, 6, -10, -10, -10, -10, 2, 6, 4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.001,0.449,0.04,0.364,0.07\\}$ and $\\{0.182,0.091,0.337,0.218,0.155\\}$.", - "Output Answer": [ - "$0.88$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.001, 0.449, 0.04, 0.364, 0.07\ndistribution2 = 0.182, 0.091, 0.337, 0.218, 0.155\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -\\frac{6}{7}, 0, 4 \\sqrt{3}, -2, 3, -5, -\\frac{14}{3}, 3, -3, 9, -3, -\\frac{13}{e}, \\log (2)}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -(6/7), 0, 4*math.sqrt(3), -2, 3, -5, -(14/3), 3, -3, 9, -3, -(13/math.e), math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -\\frac{11}{2}, -\\frac{11}{2}, 3, -4, 3, -\\frac{13}{2}, 5, -4, -4, -4, 3, 3, 0, -\\frac{11}{2}, 3, 0, 0, -\\frac{13}{2}, -4, -\\frac{13}{2}}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -(11/2), -(11/2), 3, -4, 3, -(13/2), 5, -4, -4, -4, 3, 3, 0, -(11/2), 3, 0, 0, -(13/2), -4, -(13/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -4, 5, 0, 0, 5, -4, 0, -2, -2, 5, 0, -8, -8, -2, -8, -4, -4, 0, 5, 5, 5, -8}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -4, 5, 0, 0, 5, -4, 0, -2, -2, 5, 0, -8, -8, -2, -8, -4, -4, 0, 5, 5, 5, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -\\frac{20}{7}, \\frac{15}{4}, -1, 1, 3, \\frac{46}{5}, \\frac{5}{2}, 2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -(20/7), (15/4), -1, 1, 3, (46/5), (5/2), 2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{2}, -\\frac{1}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -7 \\sqrt{2}, -\\sqrt{2}, \\frac{9}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$-\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(2), -(1/(math.sqrt(2))), -(3/(math.sqrt(2))), -7*math.sqrt(2), -math.sqrt(2), (9/(math.sqrt(2))), -(1/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.277,0.211,0.117,0.159,0.031,0.125\\}$ and $\\{0.23,0.047,0.026,0.043,0.146,0.359\\}$.", - "Output Answer": [ - "$0.54$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.277, 0.211, 0.117, 0.159, 0.031, 0.125\ndistribution2 = 0.23, 0.047, 0.026, 0.043, 0.146, 0.359\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{2}, 2, -9, 2, 2 \\sqrt{2}, -7, -\\frac{12}{\\pi }, -2 e, -2, -6, -10, -3, -1, -5, -3}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(2), 2, -9, 2, 2*math.sqrt(2), -7, -(12/math.pi), -2*math.e, -2, -6, -10, -3, -1, -5, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.084,0.134,0.179,0.175,0.206,0.115\\}$ and $\\{0.116,0.216,0.138,0.11,0.279,0.122\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.084, 0.134, 0.179, 0.175, 0.206, 0.115\ndistribution2 = 0.116, 0.216, 0.138, 0.11, 0.279, 0.122\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, e, -7, 3 \\sqrt{2}, 7, \\frac{31}{5}}$.\n", - "Output Answer": [ - "${-7, 1, e, 3 \\sqrt{2}, \\frac{31}{5}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, math.e, -7, 3*math.sqrt(2), 7, (31/5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -2, -10, 8, 9}$.\n", - "Output Answer": [ - "$\\frac{9}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -2, -10, 8, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.09 < -3.4 x-1.5 < 6.59$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8].", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(P((-0.09 < -3.4*x-1.5) & (-3.4*x-1.5 < 6.59)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, -\\sqrt{2}, -4, 0, 9, -9, -5, -9}$.\n", - "Output Answer": [ - "${-9, -9, -5, -4, -\\sqrt{2}, 0, 8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -math.sqrt(2), -4, 0, 9, -9, -5, -9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -6, \\frac{13}{\\sqrt{2}}, -\\pi, 1, -\\frac{1}{\\sqrt{3}}, 2 \\pi, -\\frac{11}{\\sqrt{\\pi }}} \\setminus {-\\frac{11}{\\sqrt{\\pi }}, -8, 0, \\pi, \\frac{13}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-6, -\\pi, -2, -\\frac{1}{\\sqrt{3}}, 1, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -6, (13/(math.sqrt(2))), -math.pi, 1, -(1/(math.sqrt(3))), 2*math.pi, -(11/(math.sqrt(math.pi))),))\nsnd = set((-(11/(math.sqrt(math.pi))), -8, 0, math.pi, (13/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{10}{7}, 9, 3, \\frac{10}{7}, -\\frac{3}{5}, 3 \\log (2), -1, -1}$.", - "Output Answer": [ - "$\\frac{10}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (10/7), 9, 3, (10/7), -(3/5), 3*math.log(2), -1, -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{3}, -\\frac{16}{3}, 2, \\frac{16}{3}, -9, -9, -4, -\\frac{13}{3}, -\\frac{16}{3}, -9, -9, \\frac{29}{3}, -\\frac{16}{3}, -\\frac{16}{3}, -\\frac{16}{3}, \\frac{14}{3}, 2, -4, -\\frac{16}{3}, -4}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(16/3), -(16/3), 2, (16/3), -9, -9, -4, -(13/3), -(16/3), -9, -9, (29/3), -(16/3), -(16/3), -(16/3), (14/3), 2, -4, -(16/3), -4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6, 4, \\frac{15}{2}, -2 \\sqrt{3}, \\frac{15}{7}, -7, 8} \\cup {\\frac{15}{7}, -7, -4, -\\sqrt{3}, 2, 10, 1, 6, \\frac{15}{2}}$.\n", - "Output Answer": [ - "${-7, -4, -2 \\sqrt{3}, -\\sqrt{3}, 1, 2, \\frac{15}{7}, 4, 6, \\frac{15}{2}, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 4, (15/2), -2*math.sqrt(3), (15/7), -7, 8,))\nsnd = set(((15/7), -7, -4, -math.sqrt(3), 2, 10, 1, 6, (15/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -2, -10}$.\n", - "Output Answer": [ - "$-\\frac{14}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -2, -10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-10, \\frac{2}{7}, -7 \\sqrt{2}, \\frac{19}{\\pi }, \\frac{10}{e}, 0, 6} \\setminus {\\frac{10}{e}, -2 \\sqrt{5}, \\frac{3}{\\sqrt{2}}, 6, \\frac{19}{\\pi }, 9}$.\n", - "Output Answer": [ - "${-10, -7 \\sqrt{2}, 0, \\frac{2}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, (2/7), -7*math.sqrt(2), (19/math.pi), (10/math.e), 0, 6,))\nsnd = set(((10/math.e), -2*math.sqrt(5), (3/(math.sqrt(2))), 6, (19/math.pi), 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -8, -2, -1, -2, -8, -2, -8, -1, -8, -6, -2, -2, -1, -6, -2, -2, -8, -1, -2, -2, -2, -8, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -8, -2, -1, -2, -8, -2, -8, -1, -8, -6, -2, -2, -1, -6, -2, -2, -8, -1, -2, -2, -2, -8, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 19, \\frac{13}{2}, \\frac{27}{2}}$.\n", - "Output Answer": [ - "$\\frac{13338}{2047}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 19, (13/2), (27/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -4, -3, -6, -5} \\cup {-8, 5, -5, -1}$.\n", - "Output Answer": [ - "${-8, -6, -5, -4, -3, -1, 5}$" - ], - "Output Program": [ - "fst = set((5, -4, -3, -6, -5,))\nsnd = set((-8, 5, -5, -1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, 0, -2 \\sqrt{5}, -4 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 0, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, -2 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), 0, -2*math.sqrt(5), -4*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 0, 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), -2*math.sqrt(5), 2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x+1.1$ where $x \\sim $ \\text{PoissonDistribution}[2.7]\n", - "Output Answer": [ - "$2.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.7)\nprint(E(0.6*x+1.1))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4, 7, 2, 6, -1, 8, -6} \\cap {7, 1, 2, -1, -8, -6, -4}$.\n", - "Output Answer": [ - "${-6, -4, -1, 2, 7}$" - ], - "Output Program": [ - "fst = set((-4, 7, 2, 6, -1, 8, -6,))\nsnd = set((7, 1, 2, -1, -8, -6, -4,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -4, -3, 0, 15}$.\n", - "Output Answer": [ - "$\\frac{713}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -4, -3, 0, 15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{53}{3}, 13}$.\n", - "Output Answer": [ - "$\\frac{689}{46}$" - ], - "Output Program": [ - "import statistics\nvalues = (53/3), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, -3, -3, -15}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -3, -3, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, \\frac{4}{3}, 0, -\\frac{1}{\\sqrt{2}}, \\frac{8}{\\pi }, 3, -2, -2, 2 \\sqrt{5}, -1}$.\n", - "Output Answer": [ - "$2+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, (4/3), 0, -(1/(math.sqrt(2))), (8/math.pi), 3, -2, -2, 2*math.sqrt(5), -1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${6, 3, -1}$.\n", - "Output Answer": [ - "$\\frac{37}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 3, -1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.028,0.151,0.028,0.037,0.132,0.449,0.124\\}$ and $\\{0.072,0.229,0.079,0.099,0.095,0.046,0.061\\}$.", - "Output Answer": [ - "$0.72$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.028, 0.151, 0.028, 0.037, 0.132, 0.449, 0.124\ndistribution2 = 0.072, 0.229, 0.079, 0.099, 0.095, 0.046, 0.061\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, -1, 7, 3, 9, 7, 3, -1, 3, 9, 9, 7, 7, 7, -1, 7, 7, 7, 7, 9, 9, 9, -1, -1, 9, 7, 7, 9, 7}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, -1, 7, 3, 9, 7, 3, -1, 3, 9, 9, 7, 7, 7, -1, 7, 7, 7, 7, 9, 9, 9, -1, -1, 9, 7, 7, 9, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4.07, -\\frac{2}{\\sqrt{\\pi }}, -8, -0.2, -7, 1} \\setminus {6, -7, 5, -8}$.\n", - "Output Answer": [ - "${-4.07, -\\frac{2}{\\sqrt{\\pi }}, -0.2, 1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4.07, -(2/(math.sqrt(math.pi))), -8, -0.2, -7, 1,))\nsnd = set((6, -7, 5, -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{3}, -8}$.\n", - "Output Answer": [ - "${-8, -\\frac{11}{3}}$" - ], - "Output Program": [ - "values = -(11/3), -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 0, -5, -7 \\sqrt{2}, -3}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 0, -5, -7*math.sqrt(2), -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6 \\sqrt{3}, 5 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, -5 \\sqrt{3}, 2 \\sqrt{3}, \\sqrt{3}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{5 \\sqrt{3}}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 6*math.sqrt(3), 5*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), -5*math.sqrt(3), 2*math.sqrt(3), math.sqrt(3), 5*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 1, 8, 1, -2, 1, 8, 1, -2, 1, 1, 4, 4, -2, 4, -2, 9, 9, 8, -2}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 1, 8, 1, -2, 1, 8, 1, -2, 1, 1, 4, 4, -2, 4, -2, 9, 9, 8, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{4}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{1}{3} \\left(\\frac{12}{\\sqrt{5}}-3 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (4/(math.sqrt(5))), (8/(math.sqrt(5))), -3*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{7}{3 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(1/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\pi, 5, 4 \\sqrt{5}, 3 \\log (2), -\\frac{9}{2}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{26}{3}, 4 \\log (2), 0, -\\frac{61}{7}, -2 \\sqrt{3}, -8}$.", - "Output Answer": [ - "$-\\frac{2}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.pi, 5, 4*math.sqrt(5), 3*math.log(2), -(9/2), -(4/(math.sqrt(math.pi))), -(26/3), 4*math.log(2), 0, -(61/7), -2*math.sqrt(3), -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x^2-3.5 x-0.3$ where $x \\sim $ \\text{NormalDistribution}[0.,1.]\n", - "Output Answer": [ - "$2.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0., 1.)\nprint(E(2.5*x**2-3.5*x-0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, 14, -10, 0}$.\n", - "Output Answer": [ - "$104$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 14, -10, 0\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.098,0.065,0.208,0.193\\}$ and $\\{0.315,0.233,0.06,0.189\\}$.", - "Output Answer": [ - "$0.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.098, 0.065, 0.208, 0.193\ndistribution2 = 0.315, 0.233, 0.06, 0.189\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 7, -3, 8, 7, -3, 7, 8, -3, -3, 8, 3, 8, -3, -2, -3, -3, 3, 3, -3, -3, -2, -3, 8, 7, 3, -2, -3, 7}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 7, -3, 8, 7, -3, 7, 8, -3, -3, 8, 3, 8, -3, -2, -3, -3, 3, 3, -3, -3, -2, -3, 8, 7, 3, -2, -3, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.198,0.099,0.038,0.158,0.119,0.169,0.175,0.029\\}$ and $\\{0.029,0.005,0.149,0.083,0.011,0.034,0.047,0.6\\}$.", - "Output Answer": [ - "$1.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.198, 0.099, 0.038, 0.158, 0.119, 0.169, 0.175, 0.029\ndistribution2 = 0.029, 0.005, 0.149, 0.083, 0.011, 0.034, 0.047, 0.6\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\sqrt{5}, 9, -9, -e, 5, 3, \\frac{12}{\\pi }, -6}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(5), 9, -9, -math.e, 5, 3, (12/math.pi), -6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 5, -12}$.\n", - "Output Answer": [ - "$91$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 5, -12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, \\sqrt{3}}$.\n", - "Output Answer": [ - "${-2, \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, 7, -2, 4, 5}$.\n", - "Output Answer": [ - "$\\frac{477}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 7, -2, 4, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, -\\frac{19}{3}, -\\pi}$.\n", - "Output Answer": [ - "${-\\frac{19}{3}, -\\pi, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -(19/3), -math.pi\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x-1.2$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(0.4*x-1.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, 3 \\log (2), -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -5, 3 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 3*math.log(2), -4*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-0.51, -9, 9, -\\frac{24}{5}, -3 e, -1, 5, -8.1} \\cup {5, -2, 9, -\\frac{24}{5}, -9.1, -0.51, -7}$.\n", - "Output Answer": [ - "${-9.1, -9, -3 e, -8.1, -7, -\\frac{24}{5}, -2, -1, -0.51, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.51, -9, 9, -(24/5), -3*math.e, -1, 5, -8.1,))\nsnd = set((5, -2, 9, -(24/5), -9.1, -0.51, -7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{11}{2}, 5 \\sqrt{3}, 2 e, 9, \\frac{30}{\\pi }, 0, 7, 5, -8}$.", - "Output Answer": [ - "$2 e$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(11/2), 5*math.sqrt(3), 2*math.e, 9, (30/math.pi), 0, 7, 5, -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -6, 5, -9.84, \\frac{19}{e}, 0, \\frac{29}{4}, 2} \\cup {8, -\\frac{10}{\\sqrt{3}}, -4, 6, -9.84, -9, \\frac{19}{e}, -5, 0}$.\n", - "Output Answer": [ - "${-9.84, -9, -6, -\\frac{10}{\\sqrt{3}}, -5, -4, -1, 0, 2, 5, 6, \\frac{19}{e}, \\frac{29}{4}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -6, 5, -9.84, (19/math.e), 0, (29/4), 2,))\nsnd = set((8, -(10/(math.sqrt(3))), -4, 6, -9.84, -9, (19/math.e), -5, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, -\\frac{29}{4}, 9, 8, -9, -\\frac{11}{e}, 7, -5, -2, -5 \\sqrt{3}, 7, 3, 0}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -(29/4), 9, 8, -9, -(11/math.e), 7, -5, -2, -5*math.sqrt(3), 7, 3, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, 8, 15, 10}$.\n", - "Output Answer": [ - "$\\frac{1427}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 8, 15, 10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6, 5, 9}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 5, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, \\frac{22}{7}}$.", - "Output Answer": [ - "$\\frac{29}{14}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, (22/7)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.8 x-0.9$ where $x \\sim $ \\text{PoissonDistribution}[3.8]\n", - "Output Answer": [ - "$-19.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.8)\nprint(E(-4.8*x-0.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{27}{\\pi }, -11 \\log (2), -9, 10, \\frac{9}{\\sqrt{2}}, -\\frac{23}{\\pi }, \\frac{11}{e}, 7 \\sqrt{2}, -1, 0, \\frac{3}{\\sqrt{2}}, -\\sqrt{2}}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = (27/math.pi), -11*math.log(2), -9, 10, (9/(math.sqrt(2))), -(23/math.pi), (11/math.e), 7*math.sqrt(2), -1, 0, (3/(math.sqrt(2))), -math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, 2, -3 \\pi, 0, -5, -\\pi, \\frac{23}{e}}$.\n", - "Output Answer": [ - "${-3 \\pi, -5, -\\pi, -2, 0, 2, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 2, -3*math.pi, 0, -5, -math.pi, (23/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.21 < 3.7 x-0.7 < 5.94$ where $x \\sim $ \\text{PoissonDistribution}[3.5].", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(P((0.21 < 3.7*x-0.7) & (3.7*x-0.7 < 5.94)))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 7, 1, -8, \\frac{24}{7}, -\\log (2), -\\frac{51}{7}} \\setminus {1, 5, 7, 2, -\\frac{51}{7}}$.\n", - "Output Answer": [ - "${-8, -5, -\\log (2), \\frac{24}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 7, 1, -8, (24/7), -math.log(2), -(51/7),))\nsnd = set((1, 5, 7, 2, -(51/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, -59049, 256, -2, 4}$.\n", - "Output Answer": [ - "$144 \\sqrt[5]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, -59049, 256, -2, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -1, -2, -5, -1, -2, -1, -1, 8, -5, -5, -5, 3, 1, -5, -2, 1, 3, -2, 1, 5, -1, 1, -5, -1, -5}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -1, -2, -5, -1, -2, -1, -1, 8, -5, -5, -5, 3, 1, -5, -2, 1, 3, -2, 1, 5, -1, 1, -5, -1, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -\\frac{6}{e}, -\\frac{11}{\\sqrt{2}}, 0, -\\frac{15}{2}, -3 e}$.", - "Output Answer": [ - "$-\\frac{29}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, -(6/math.e), -(11/(math.sqrt(2))), 0, -(15/2), -3*math.e\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-3 e, 2 e, -e, e} \\cap {-3 e, e, 2 e, -e}$.\n", - "Output Answer": [ - "${-3 e, -e, e, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.e, 2*math.e, -math.e, math.e,))\nsnd = set((-3*math.e, math.e, 2*math.e, -math.e,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{e}, \\frac{11}{e}, -\\frac{20}{e}, -\\frac{20}{e}, -\\frac{20}{e}, \\frac{11}{e}, \\frac{1}{e}, -\\frac{20}{e}, \\frac{11}{e}, \\frac{1}{e}, \\frac{11}{e}, -\\frac{15}{e}, \\frac{11}{e}, \\frac{1}{e}, \\frac{23}{e}, \\frac{11}{e}, -\\frac{20}{e}, -\\frac{20}{e}, -\\frac{20}{e}, -\\frac{15}{e}, -\\frac{20}{e}, \\frac{1}{e}, \\frac{1}{e}, -\\frac{20}{e}, \\frac{11}{e}, -\\frac{15}{e}, -\\frac{15}{e}, -\\frac{20}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{20}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (11/math.e), (11/math.e), -(20/math.e), -(20/math.e), -(20/math.e), (11/math.e), (1/math.e), -(20/math.e), (11/math.e), (1/math.e), (11/math.e), -(15/math.e), (11/math.e), (1/math.e), (23/math.e), (11/math.e), -(20/math.e), -(20/math.e), -(20/math.e), -(15/math.e), -(20/math.e), (1/math.e), (1/math.e), -(20/math.e), (11/math.e), -(15/math.e), -(15/math.e), -(20/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{5}{e}, 10, 2 e, 4 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, -4, 2 \\pi, -\\sqrt{2}, -6} \\cup {\\frac{5}{e}, -1, 2 \\pi, 0, -9, \\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-9, -6, -4, -\\frac{3}{\\sqrt{2}}, -\\sqrt{2}, -1, 0, \\frac{5}{e}, \\frac{5}{\\sqrt{2}}, 2 e, 4 \\sqrt{2}, 2 \\pi, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((5/math.e), 10, 2*math.e, 4*math.sqrt(2), -(3/(math.sqrt(2))), -4, 2*math.pi, -math.sqrt(2), -6,))\nsnd = set(((5/math.e), -1, 2*math.pi, 0, -9, (5/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -5, 10, -3 e, 1, -\\frac{5}{\\sqrt{\\pi }}, -7, 10, -10, \\frac{5}{\\pi }, -8, -7}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -5, 10, -3*math.e, 1, -(5/(math.sqrt(math.pi))), -7, 10, -10, (5/math.pi), -8, -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, \\frac{17}{\\sqrt{\\pi }}, -10 \\log (2), -1} \\setminus {-11 \\log (2), -5, -7, \\frac{17}{\\sqrt{\\pi }}, -2, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-8, -10 \\log (2), -1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, (17/(math.sqrt(math.pi))), -10*math.log(2), -1,))\nsnd = set((-11*math.log(2), -5, -7, (17/(math.sqrt(math.pi))), -2, -3*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1296, -10, 243, 1, 100}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-1} 2^{2/5} 3^{4/5} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1296, -10, 243, 1, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{21}{\\pi }, 4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+\\frac{21}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (21/math.pi), 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, -5 \\sqrt{2}, 5, -\\frac{7}{\\sqrt{5}}, -4 \\sqrt{5}, -\\frac{22}{\\pi }, -6, 6, 8, -6, \\log (2)}$.", - "Output Answer": [ - "$-\\frac{7}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -5*math.sqrt(2), 5, -(7/(math.sqrt(5))), -4*math.sqrt(5), -(22/math.pi), -6, 6, 8, -6, math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^3+0.5 x^2+2.1 x-4.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-3.36$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-3.9*x**3+0.5*x**2+2.1*x-4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -8, 3., \\frac{68}{7}, 3, 8.648, -4.45, -3}$.\n", - "Output Answer": [ - "${-8, -4.45, -3, 1, 3, 3., 8.648, \\frac{68}{7}}$" - ], - "Output Program": [ - "values = 1, -8, 3., (68/7), 3, 8.648, -4.45, -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${32768, -64, 1, 625, 4, -32}$.\n", - "Output Answer": [ - "$16\\ 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 32768, -64, 1, 625, 4, -32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 0, 6, -1, 9}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 0, 6, -1, 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 e, 7, \\frac{11}{\\sqrt{2}}, -9, -14 \\log (2), -7}$.\n", - "Output Answer": [ - "${-14 \\log (2), -9, -7, 2 e, 7, \\frac{11}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, 7, (11/(math.sqrt(2))), -9, -14*math.log(2), -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{14}{\\sqrt{5}}, -3 \\sqrt{5}, -7, 5, -\\frac{36}{5}} \\setminus {-7, -3, -8}$.\n", - "Output Answer": [ - "${-\\frac{36}{5}, -3 \\sqrt{5}, 5, \\frac{14}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((14/(math.sqrt(5))), -3*math.sqrt(5), -7, 5, -(36/5),))\nsnd = set((-7, -3, -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${e, -\\frac{7}{\\pi }, -\\frac{4}{\\sqrt{\\pi }}, -6, 2 \\pi, -7, 7}$.", - "Output Answer": [ - "$-\\frac{7}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.e, -(7/math.pi), -(4/(math.sqrt(math.pi))), -6, 2*math.pi, -7, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{3}{\\sqrt{5}}, \\frac{5}{\\sqrt{3}}, -\\frac{20}{e}, -6, \\frac{30}{\\pi }, 2 e, -4, -2, -\\frac{11}{\\sqrt{3}}, 4 \\sqrt{3}, \\frac{14}{\\pi }, \\frac{7}{\\sqrt{3}}, -8, -1, -\\frac{3}{4}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(3/(math.sqrt(5))), (5/(math.sqrt(3))), -(20/math.e), -6, (30/math.pi), 2*math.e, -4, -2, -(11/(math.sqrt(3))), 4*math.sqrt(3), (14/math.pi), (7/(math.sqrt(3))), -8, -1, -(3/4)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${3 e, -7, \\frac{30}{\\pi }, -\\sqrt{3}, \\sqrt{5}, 0, 9 \\log (2), -\\frac{7}{\\pi }, \\frac{5}{4}, -6} \\cup {9 \\log (2), -7, \\frac{5}{4}, 2 e, -4 \\sqrt{3}, -\\frac{7}{\\pi }, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, -4 \\sqrt{3}, -6, -4 \\sqrt{2}, -\\frac{7}{\\pi }, -\\sqrt{3}, 0, \\frac{5}{4}, \\sqrt{5}, 2 e, 9 \\log (2), 3 e, \\frac{30}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.e, -7, (30/math.pi), -math.sqrt(3), math.sqrt(5), 0, 9*math.log(2), -(7/math.pi), (5/4), -6,))\nsnd = set((9*math.log(2), -7, (5/4), 2*math.e, -4*math.sqrt(3), -(7/math.pi), -4*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.017,0.083,0.116,0.249,0.013,0.257,0.084,0.152\\}$ and $\\{0.284,0.077,0.118,0.093,0.078,0.137,0.036,0.074\\}$.", - "Output Answer": [ - "$0.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.017, 0.083, 0.116, 0.249, 0.013, 0.257, 0.084, 0.152\ndistribution2 = 0.284, 0.077, 0.118, 0.093, 0.078, 0.137, 0.036, 0.074\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{15}{e}, 0, 0, -5, -\\frac{4}{\\sqrt{\\pi }}, -9, -7 \\sqrt{2}, 10, -\\sqrt{3}}$.", - "Output Answer": [ - "$-\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (15/math.e), 0, 0, -5, -(4/(math.sqrt(math.pi))), -9, -7*math.sqrt(2), 10, -math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, 9, -8}$.\n", - "Output Answer": [ - "${-8, -2, 9}$" - ], - "Output Program": [ - "values = -2, 9, -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, -7, -4, -12}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{131}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -7, -4, -12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\sqrt{5}, 4.5, 5, 4.81, \\frac{38}{5}, -2, -\\frac{12}{\\pi }, -10 \\log (2)}$.\n", - "Output Answer": [ - "${-10 \\log (2), -\\frac{12}{\\pi }, -2, \\sqrt{5}, 4.5, 4.81, 5, \\frac{38}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(5), 4.5, 5, 4.81, (38/5), -2, -(12/math.pi), -10*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, 6, -\\frac{3}{\\pi }, -4, -7, -9, 4, \\frac{10}{\\pi }} \\cup {-6, -2, 4 \\sqrt{2}, -7, -\\frac{1}{\\pi }, 6, -4, 3, \\frac{10}{\\pi }, -\\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-9, -7, -6, -4, -\\frac{5}{\\sqrt{2}}, -2, -\\frac{3}{\\pi }, -\\frac{1}{\\pi }, 2 \\sqrt{2}, 3, \\frac{10}{\\pi }, 4, 4 \\sqrt{2}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(2), -(5/(math.sqrt(2))), 6, -(3/math.pi), -4, -7, -9, 4, (10/math.pi),))\nsnd = set((-6, -2, 4*math.sqrt(2), -7, -(1/math.pi), 6, -4, 3, (10/math.pi), -(5/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, -15, 3, 12, -5}$.\n", - "Output Answer": [ - "$\\frac{514}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -15, 3, 12, -5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\sqrt{3}, 4 \\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, 2 \\sqrt{3}} \\cap {-2 \\sqrt{3}, -5 \\sqrt{3}, -3 \\sqrt{3}, \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), 4*math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), 2*math.sqrt(3),))\nsnd = set((-2*math.sqrt(3), -5*math.sqrt(3), -3*math.sqrt(3), math.sqrt(3),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{19}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, -2 \\sqrt{5}, \\frac{22}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, -2 \\sqrt{5}, \\frac{19}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, -2 \\sqrt{5}, \\frac{19}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, \\frac{19}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{19}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (19/(math.sqrt(5))), (19/(math.sqrt(5))), (21/(math.sqrt(5))), (21/(math.sqrt(5))), (19/(math.sqrt(5))), (19/(math.sqrt(5))), (22/(math.sqrt(5))), (22/(math.sqrt(5))), (19/(math.sqrt(5))), (19/(math.sqrt(5))), -2*math.sqrt(5), (22/(math.sqrt(5))), (22/(math.sqrt(5))), -2*math.sqrt(5), (19/(math.sqrt(5))), (22/(math.sqrt(5))), -2*math.sqrt(5), (19/(math.sqrt(5))), (22/(math.sqrt(5))), (21/(math.sqrt(5))), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), (19/(math.sqrt(5))), (21/(math.sqrt(5))), (21/(math.sqrt(5))), (21/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x^2+3.4 x+3.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5]\n", - "Output Answer": [ - "$16.95$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(E(2.9*x**2+3.4*x+3.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 5, 18, 3}$.\n", - "Output Answer": [ - "$\\frac{180}{31}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 5, 18, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6, -\\frac{5}{2}, 3 e, 1} \\setminus {-1, -2, -10, -\\frac{5}{2}}$.\n", - "Output Answer": [ - "${1, 6, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -(5/2), 3*math.e, 1,))\nsnd = set((-1, -2, -10, -(5/2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{4}{e}, -\\frac{4}{e}, -\\frac{4}{e}, \\frac{25}{e}, -\\frac{3}{e}, \\frac{13}{e}, -\\frac{4}{e}, \\frac{25}{e}, \\frac{13}{e}, -\\frac{4}{e}, -\\frac{13}{e}, \\frac{13}{e}, \\frac{16}{e}, -\\frac{13}{e}, \\frac{25}{e}, \\frac{16}{e}, \\frac{13}{e}, -\\frac{3}{e}, \\frac{16}{e}, \\frac{16}{e}, \\frac{16}{e}, -\\frac{3}{e}, \\frac{25}{e}, -\\frac{13}{e}, \\frac{16}{e}, \\frac{16}{e}, \\frac{13}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{16}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(4/math.e), -(4/math.e), -(4/math.e), (25/math.e), -(3/math.e), (13/math.e), -(4/math.e), (25/math.e), (13/math.e), -(4/math.e), -(13/math.e), (13/math.e), (16/math.e), -(13/math.e), (25/math.e), (16/math.e), (13/math.e), -(3/math.e), (16/math.e), (16/math.e), (16/math.e), -(3/math.e), (25/math.e), -(13/math.e), (16/math.e), (16/math.e), (13/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 5, -9, -9}$.\n", - "Output Answer": [ - "$-\\frac{5}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 5, -9, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x^2-4.1 x+4.5$ where $x \\sim $ \\text{PoissonDistribution}[1.]\n", - "Output Answer": [ - "$2.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.)\nprint(E(1.1*x**2-4.1*x+4.5))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2.5, -\\frac{15}{2}, \\frac{17}{3}, 4.304, -8, -7, 9, -\\frac{5}{3}, -3, 8} \\cup {4, -\\frac{5}{3}, 1.552, -8, -6, -2.5, 6, \\frac{17}{3}, -3}$.\n", - "Output Answer": [ - "${-8, -\\frac{15}{2}, -7, -6, -3, -2.5, -\\frac{5}{3}, 1.552, 4, 4.304, \\frac{17}{3}, 6, 8, 9}$" - ], - "Output Program": [ - "fst = set((-2.5, -(15/2), (17/3), 4.304, -8, -7, 9, -(5/3), -3, 8,))\nsnd = set((4, -(5/3), 1.552, -8, -6, -2.5, 6, (17/3), -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x-3.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-3.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(3.9*x-3.5))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${9.01, 1.13, 6.96, 5.02, -6.69, -1.76, -1.88, -1.54, 6.38, 7.17, 9.43, -2.83, -2.26, -6.5} \\cap {-8.39, -1.25, -9.02, 6.68, 7.26, 5.56, -1.54, -3.73, 7.23, 9.01, -1.07, 8.77, 9.43, -0.21}$.\n", - "Output Answer": [ - "${-1.54, 9.01, 9.43}$" - ], - "Output Program": [ - "fst = set((9.01, 1.13, 6.96, 5.02, -6.69, -1.76, -1.88, -1.54, 6.38, 7.17, 9.43, -2.83, -2.26, -6.5,))\nsnd = set((-8.39, -1.25, -9.02, 6.68, 7.26, 5.56, -1.54, -3.73, 7.23, 9.01, -1.07, 8.77, 9.43, -0.21,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 2, 4, -3, \\frac{11}{2}, -7 \\sqrt{2}, \\frac{49}{5}, 3 e, -1, -6, -\\frac{2}{3}, 1}$.", - "Output Answer": [ - "$\\frac{1}{6}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, 2, 4, -3, (11/2), -7*math.sqrt(2), (49/5), 3*math.e, -1, -6, -(2/3), 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{12}{\\sqrt{\\pi }}, 7}$.\n", - "Output Answer": [ - "${\\frac{12}{\\sqrt{\\pi }}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = (12/(math.sqrt(math.pi))), 7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 8, -6, -6, -7, -6, -6, -1, 8, -6, -1, 8, 8, 8, -7, -6, 8, -6, -1, -6, -6, 8, 8, 8, -7, 8, -1, -1, -7}$.\n", - "Output Answer": [ - "$\\{-6,8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 8, -6, -6, -7, -6, -6, -1, 8, -6, -1, 8, 8, 8, -7, -6, 8, -6, -1, -6, -6, 8, 8, 8, -7, 8, -1, -1, -7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.9 x^2+4.8 x+3.8$ where $x \\sim $ \\text{BetaDistribution}[1.3,1.9]\n", - "Output Answer": [ - "$5.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 1.9)\nprint(E(-0.9*x**2+4.8*x+3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{2}, \\frac{11}{2}, 17}$.\n", - "Output Answer": [ - "$\\frac{561}{79}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/2), (11/2), 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 2, -\\frac{6}{\\sqrt{\\pi }}, -9}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 2, -(6/(math.sqrt(math.pi))), -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 10, 10}$.\n", - "Output Answer": [ - "$\\frac{210}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 10, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 10, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{19}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 10, 12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, \\frac{27}{5}, -\\frac{7}{\\sqrt{\\pi }}, 5, \\frac{19}{\\pi }, \\frac{4}{\\pi }, -e, 9, \\frac{27}{\\pi }, 5, -12 \\log (2), -4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(5+\\frac{4}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, (27/5), -(7/(math.sqrt(math.pi))), 5, (19/math.pi), (4/math.pi), -math.e, 9, (27/math.pi), 5, -12*math.log(2), -4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5.3, \\frac{5}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${\\frac{5}{\\sqrt{\\pi }}, 5.3}$" - ], - "Output Program": [ - "import math\n\nvalues = 5.3, (5/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 6, 11, 15}$.\n", - "Output Answer": [ - "$\\frac{97}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 6, 11, 15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, -8, -9, -8, -10, 9, -10, 3, 3, 9, 3, 3, -9, -9, -9, -8, 0, 9, 0, 0, -9, 0, -9, -10}$.\n", - "Output Answer": [ - "$\\{0,-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 0, -8, -9, -8, -10, 9, -10, 3, 3, 9, 3, 3, -9, -9, -9, -8, 0, 9, 0, 0, -9, 0, -9, -10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 e, 3 e, 0, 0, 4 e, -3 e, 0, -3 e, 3 e, 3 e, -3 e, 4 e, 3 e, 4 e, 4 e, 3 e, -3 e, 0, -3 e, 0, 3 e, 3 e, 0, 0, 3 e}$.\n", - "Output Answer": [ - "$\\{3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.e, 3*math.e, 0, 0, 4*math.e, -3*math.e, 0, -3*math.e, 3*math.e, 3*math.e, -3*math.e, 4*math.e, 3*math.e, 4*math.e, 4*math.e, 3*math.e, -3*math.e, 0, -3*math.e, 0, 3*math.e, 3*math.e, 0, 0, 3*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${2 \\sqrt{3}, -\\frac{2}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, -\\frac{11}{\\sqrt{3}}, 0, -\\frac{5}{\\sqrt{3}}, -2 \\sqrt{3}, -3 \\sqrt{3}} \\cap {-\\frac{11}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -2 \\sqrt{3}, -\\sqrt{3}, \\frac{11}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}, -3 \\sqrt{3}, -\\frac{14}{\\sqrt{3}}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{3}}, -\\frac{11}{\\sqrt{3}}, -3 \\sqrt{3}, -2 \\sqrt{3}, -\\frac{5}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(3), -(2/(math.sqrt(3))), -(17/(math.sqrt(3))), -(13/(math.sqrt(3))), (14/(math.sqrt(3))), (11/(math.sqrt(3))), -(11/(math.sqrt(3))), 0, -(5/(math.sqrt(3))), -2*math.sqrt(3), -3*math.sqrt(3),))\nsnd = set((-(11/(math.sqrt(3))), -(10/(math.sqrt(3))), -(13/(math.sqrt(3))), -2*math.sqrt(3), -math.sqrt(3), (11/(math.sqrt(3))), (10/(math.sqrt(3))), -(5/(math.sqrt(3))), -3*math.sqrt(3), -(14/(math.sqrt(3))), 3*math.sqrt(3),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{1}{3}, -5, 2, -8, 9, 7, -9, 8 \\log (2), \\frac{5}{e}, 7.48, \\frac{14}{\\sqrt{3}}} \\cup {\\frac{5}{\\sqrt{3}}, 7, 7.48, 9, -3, 4, \\frac{1}{3}, \\frac{5}{e}}$.\n", - "Output Answer": [ - "${-9, -8, -5, -3, \\frac{1}{3}, \\frac{5}{e}, 2, \\frac{5}{\\sqrt{3}}, 4, 8 \\log (2), 7, 7.48, \\frac{14}{\\sqrt{3}}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/3), -5, 2, -8, 9, 7, -9, 8*math.log(2), (5/math.e), 7.48, (14/(math.sqrt(3))),))\nsnd = set(((5/(math.sqrt(3))), 7, 7.48, 9, -3, 4, (1/3), (5/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 17, 12}$.\n", - "Output Answer": [ - "$\\frac{1224}{109}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 17, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, -\\frac{10}{\\sqrt{\\pi }}, 9, 1}$.\n", - "Output Answer": [ - "${-\\frac{10}{\\sqrt{\\pi }}, 1, 4, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -(10/(math.sqrt(math.pi))), 9, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, 8.05, -4, \\frac{2}{\\pi }, 4.71, 5}$.\n", - "Output Answer": [ - "${-4, -2, \\frac{2}{\\pi }, 4.71, 5, 8.05}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 8.05, -4, (2/math.pi), 4.71, 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, -4 \\log (2), -\\frac{67}{7}, -2 \\sqrt{2}, -4 \\sqrt{5}, -6, 2}$.\n", - "Output Answer": [ - "${-\\frac{67}{7}, -4 \\sqrt{5}, -7, -6, -2 \\sqrt{2}, -4 \\log (2), 2}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -4*math.log(2), -(67/7), -2*math.sqrt(2), -4*math.sqrt(5), -6, 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, 4, 7, -5, 3, -11}$.\n", - "Output Answer": [ - "$\\frac{1373}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 4, 7, -5, 3, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.38,0.074,0.342,0.003,0.05,0.105\\}$ and $\\{0.176,0.086,0.084,0.114,0.132,0.336\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.38, 0.074, 0.342, 0.003, 0.05, 0.105\ndistribution2 = 0.176, 0.086, 0.084, 0.114, 0.132, 0.336\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 7, 5}$.\n", - "Output Answer": [ - "$\\frac{420}{83}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 7, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6 \\sqrt{2}, -3}$.\n", - "Output Answer": [ - "${-3, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6*math.sqrt(2), -3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{40}{7}, -8, -1, -2} \\setminus {-7, -8, \\frac{51}{7}, 4, \\frac{31}{7}}$.\n", - "Output Answer": [ - "${-2, -1, \\frac{40}{7}}$" - ], - "Output Program": [ - "fst = set(((40/7), -8, -1, -2,))\nsnd = set((-7, -8, (51/7), 4, (31/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, -10, -14, -13, 3}$.\n", - "Output Answer": [ - "$\\frac{115}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -10, -14, -13, 3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.5 x^2-3.2 x+4.3$ where $x \\sim $ \\text{BetaDistribution}[1.9,1.1]\n", - "Output Answer": [ - "$2.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 1.1)\nprint(E(0.5*x**2-3.2*x+4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{29}{2}, \\frac{13}{2}, 18, 3}$.\n", - "Output Answer": [ - "$\\frac{27144}{4151}$" - ], - "Output Program": [ - "import statistics\nvalues = (29/2), (13/2), 18, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{48}{7}, \\frac{53}{7}}$.\n", - "Output Answer": [ - "$\\frac{101}{14}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (48/7), (53/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4 e, 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 e, 6 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.e, 6*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, -8, -2.997, 3, -4, \\frac{9}{\\sqrt{\\pi }}, 0} \\setminus {-2.997, -7, \\frac{11}{\\sqrt{2}}, -8, 3, 0, -4}$.\n", - "Output Answer": [ - "${\\frac{9}{\\sqrt{\\pi }}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -8, -2.997, 3, -4, (9/(math.sqrt(math.pi))), 0,))\nsnd = set((-2.997, -7, (11/(math.sqrt(2))), -8, 3, 0, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 8, -8, -2 \\log (2)} \\setminus {-7, -3 \\log (2), 8, -8, \\frac{13}{e}, -\\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-2 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 8, -8, -2*math.log(2),))\nsnd = set((-7, -3*math.log(2), 8, -8, (13/math.e), -(1/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{\\pi }, -5, -\\frac{3}{2}, 2, \\frac{4}{\\pi }, -\\frac{11}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{11}{\\pi }+\\frac{11}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (11/math.pi), -5, -(3/2), 2, (4/math.pi), -(11/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -8, -6}$.\n", - "Output Answer": [ - "$2 \\sqrt{7}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -8, -6\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{13}{7}, -5, -\\frac{47}{7}, \\frac{55}{7}, -2, -\\frac{12}{7}, 1, \\frac{9}{7}}$.\n", - "Output Answer": [ - "$-\\frac{3}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (13/7), -5, -(47/7), (55/7), -2, -(12/7), 1, (9/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.152,0.054,0.036,0.162,0.154,0.007,0.039,0.067,0.173,0.096\\}$ and $\\{0.245,0.007,0.111,0.045,0.045,0.029,0.081,0.206,0.042,0.117\\}$.", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.152, 0.054, 0.036, 0.162, 0.154, 0.007, 0.039, 0.067, 0.173, 0.096\ndistribution2 = 0.245, 0.007, 0.111, 0.045, 0.045, 0.029, 0.081, 0.206, 0.042, 0.117\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, -5, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{19}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -5, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${262144, 49, 8, 16, 1, 1}$.\n", - "Output Answer": [ - "$16 \\sqrt[6]{2} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 262144, 49, 8, 16, 1, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.2 x^2-2.2 x-4.$ where $x \\sim $ \\text{ExponentialDistribution}[1.2]\n", - "Output Answer": [ - "$-10.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(E(-3.2*x**2-2.2*x-4.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{38}{7}, \\frac{59}{7}, \\frac{59}{7}, \\frac{24}{7}, \\frac{38}{7}, \\frac{59}{7}, -\\frac{31}{7}, -\\frac{8}{7}, \\frac{38}{7}, -\\frac{8}{7}, -\\frac{8}{7}, \\frac{20}{7}, \\frac{44}{7}, \\frac{59}{7}, \\frac{24}{7}, \\frac{59}{7}, \\frac{38}{7}, \\frac{44}{7}, \\frac{59}{7}, \\frac{24}{7}, \\frac{38}{7}, \\frac{38}{7}, \\frac{59}{7}, \\frac{24}{7}, \\frac{38}{7}, \\frac{24}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{38}{7},\\frac{59}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (38/7), (59/7), (59/7), (24/7), (38/7), (59/7), -(31/7), -(8/7), (38/7), -(8/7), -(8/7), (20/7), (44/7), (59/7), (24/7), (59/7), (38/7), (44/7), (59/7), (24/7), (38/7), (38/7), (59/7), (24/7), (38/7), (24/7)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -4 \\sqrt{2}, -4 \\sqrt{2}, 6 \\sqrt{2}, -5 \\sqrt{2}, 7 \\sqrt{2}, 6 \\sqrt{2}, -4 \\sqrt{2}, -3 \\sqrt{2}, -5 \\sqrt{2}, -3 \\sqrt{2}, -2 \\sqrt{2}, -5 \\sqrt{2}, 0, -2 \\sqrt{2}, -2 \\sqrt{2}, -2 \\sqrt{2}, -3 \\sqrt{2}, 0, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{2},-2 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, -4*math.sqrt(2), -4*math.sqrt(2), 6*math.sqrt(2), -5*math.sqrt(2), 7*math.sqrt(2), 6*math.sqrt(2), -4*math.sqrt(2), -3*math.sqrt(2), -5*math.sqrt(2), -3*math.sqrt(2), -2*math.sqrt(2), -5*math.sqrt(2), 0, -2*math.sqrt(2), -2*math.sqrt(2), -2*math.sqrt(2), -3*math.sqrt(2), 0, -4*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.043,0.218,0.209,0.349,0.154\\}$ and $\\{0.104,0.105,0.249,0.203,0.147\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.043, 0.218, 0.209, 0.349, 0.154\ndistribution2 = 0.104, 0.105, 0.249, 0.203, 0.147\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{9}{7}, -5, -3, 10, 5, -1, -8} \\setminus {-3, 5, -1, 8, -8, -2, -5, -\\frac{19}{\\pi }, -\\frac{9}{7}}$.\n", - "Output Answer": [ - "${10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(9/7), -5, -3, 10, 5, -1, -8,))\nsnd = set((-3, 5, -1, 8, -8, -2, -5, -(19/math.pi), -(9/7),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, -5, 5, 1, 1, 1, 5, -5, -1, 1, -5, -5, 1, 1, -1, 9, 1, -1, 1, 1, 5, -1, -5, -5, -1, 9, -5, -1, 1, 9}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, -5, 5, 1, 1, 1, 5, -5, -1, 1, -5, -5, 1, 1, -1, 9, 1, -1, 1, 1, 5, -1, -5, -5, -1, 9, -5, -1, 1, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${6, 2 \\pi, -10}$.\n", - "Output Answer": [ - "${-10, 6, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 2*math.pi, -10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.23,0.184,0.133,0.164\\}$ and $\\{0.222,0.126,0.208,0.227\\}$.", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.23, 0.184, 0.133, 0.164\ndistribution2 = 0.222, 0.126, 0.208, 0.227\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{3}, -\\sqrt{3}, \\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -\\sqrt{3}, \\frac{11}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, -\\sqrt{3}, -\\sqrt{3}, 5 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, 5 \\sqrt{3}, -\\sqrt{3}, 5 \\sqrt{3}, -\\sqrt{3}, \\frac{8}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{8}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(3), -math.sqrt(3), (8/(math.sqrt(3))), (8/(math.sqrt(3))), -math.sqrt(3), (11/(math.sqrt(3))), (8/(math.sqrt(3))), (8/(math.sqrt(3))), -(8/(math.sqrt(3))), 5*math.sqrt(3), (8/(math.sqrt(3))), -(8/(math.sqrt(3))), -math.sqrt(3), -math.sqrt(3), 5*math.sqrt(3), (8/(math.sqrt(3))), 5*math.sqrt(3), -math.sqrt(3), 5*math.sqrt(3), -math.sqrt(3), (8/(math.sqrt(3))), 5*math.sqrt(3), (8/(math.sqrt(3))), (8/(math.sqrt(3))), -math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{6}{\\pi }, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$4 \\sqrt{5}-\\frac{6}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -(6/math.pi), -4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6, 125, 216, 625}$.\n", - "Output Answer": [ - "$30\\ 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 125, 216, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, 81, 1296, 81}$.\n", - "Output Answer": [ - "$108+108 i$" - ], - "Output Program": [ - "import math\n\nvalues = -64, 81, 1296, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, -7, 10, 5, 6, 5, -7, -4, -7, -10, -7, 10, -7, 10, 10, 6, -10, -10, 10, 10, -7, 5, -4, -7, -7, 10, -10}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, -7, 10, 5, 6, 5, -7, -4, -7, -10, -7, 10, -7, 10, 10, 6, -10, -10, 10, 10, -7, 5, -4, -7, -7, 10, -10\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 4, -1, -5, 9, 9, -1, -1, -5, -1, 4, 9, 9, -1, -3, -3, -3, -3, -3, -5}$.\n", - "Output Answer": [ - "$\\{-1,-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 4, -1, -5, 9, 9, -1, -1, -5, -1, 4, 9, 9, -1, -3, -3, -3, -3, -3, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${1, -\\frac{28}{3}, 0, -2 \\sqrt{3}, -5.416, 2.42} \\cup {-2 \\sqrt{3}, 2.42, \\frac{17}{3}, 0, -5.264, 1}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -5.416, -5.264, -2 \\sqrt{3}, 0, 1, 2.42, \\frac{17}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -(28/3), 0, -2*math.sqrt(3), -5.416, 2.42,))\nsnd = set((-2*math.sqrt(3), 2.42, (17/3), 0, -5.264, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^3-0.2 x^2-1.2 x-0.5$ where $x \\sim $ \\text{PoissonDistribution}[4.]\n", - "Output Answer": [ - "$-229.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 4.)\nprint(E(-1.9*x**3-0.2*x**2-1.2*x-0.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.09,0.383,0.099,0.034,0.2,0.011,0.075\\}$ and $\\{0.138,0.118,0.177,0.059,0.185,0.078,0.133\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.09, 0.383, 0.099, 0.034, 0.2, 0.011, 0.075\ndistribution2 = 0.138, 0.118, 0.177, 0.059, 0.185, 0.078, 0.133\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.069,0.114,0.159,0.159,0.076,0.021,0.05,0.05,0.033,0.208\\}$ and $\\{0.048,0.077,0.079,0.147,0.111,0.135,0.101,0.081,0.036,0.075\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.069, 0.114, 0.159, 0.159, 0.076, 0.021, 0.05, 0.05, 0.033, 0.208\ndistribution2 = 0.048, 0.077, 0.079, 0.147, 0.111, 0.135, 0.101, 0.081, 0.036, 0.075\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, 4, 81, 36, 64}$.\n", - "Output Answer": [ - "$12 \\sqrt[5]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 4, 81, 36, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.123,0.207,0.399\\}$ and $\\{0.356,0.01,0.474\\}$.", - "Output Answer": [ - "$0.73$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.123, 0.207, 0.399\ndistribution2 = 0.356, 0.01, 0.474\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x^2-1.3 x-1.3$ where $x \\sim $ \\text{BetaDistribution}[1.,1.1]\n", - "Output Answer": [ - "$-2.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 1.1)\nprint(E(-2.*x**2-1.3*x-1.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, \\frac{21}{2}, 3}$.\n", - "Output Answer": [ - "$\\frac{315}{52}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, (21/2), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5 \\sqrt{2}, -2 \\sqrt{2}, -6 \\sqrt{2}, \\sqrt{2}, -\\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{9}{4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 5*math.sqrt(2), -2*math.sqrt(2), -6*math.sqrt(2), math.sqrt(2), -math.sqrt(2), math.sqrt(2), -5*math.sqrt(2), -2*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 8, 7, 10}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 8, 7, 10\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -8, -8, 3, -8, -8, -8, -8, 3, 3, 3, -8, -8, 0, 3, -8, -8, -8, -8, -8, -8, -8, -8, 3, -8}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -8, -8, 3, -8, -8, -8, -8, 3, 3, 3, -8, -8, 0, 3, -8, -8, -8, -8, -8, -8, -8, -8, 3, -8\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{1}{2}, 9, -\\frac{23}{4}, \\frac{29}{4}, -\\frac{1}{2}, -\\frac{23}{4}, 9, 0, 9, 0, \\frac{29}{4}, 0, 9, \\frac{29}{4}, 9, \\frac{29}{4}, -\\frac{1}{2}, 0, \\frac{29}{4}, -\\frac{7}{2}, -\\frac{23}{4}, -\\frac{23}{4}, \\frac{29}{4}, -\\frac{1}{2}, 9}$.\n", - "Output Answer": [ - "$\\left\\{9,\\frac{29}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(1/2), 9, -(23/4), (29/4), -(1/2), -(23/4), 9, 0, 9, 0, (29/4), 0, 9, (29/4), 9, (29/4), -(1/2), 0, (29/4), -(7/2), -(23/4), -(23/4), (29/4), -(1/2), 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{2}{5}, -\\frac{26}{5}, -\\frac{12}{5}, -\\frac{43}{5}, 9, 9, -\\frac{12}{5}, -\\frac{43}{5}, -\\frac{2}{5}, -\\frac{2}{5}, \\frac{17}{5}, -\\frac{26}{5}, 9, 9, -\\frac{12}{5}, -\\frac{43}{5}, -\\frac{12}{5}, 9, -\\frac{2}{5}, \\frac{17}{5}, -\\frac{12}{5}, -\\frac{2}{5}, -\\frac{43}{5}, -\\frac{3}{5}, -\\frac{43}{5}, 9, \\frac{17}{5}, -\\frac{43}{5}, -\\frac{26}{5}, -\\frac{43}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{43}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(2/5), -(26/5), -(12/5), -(43/5), 9, 9, -(12/5), -(43/5), -(2/5), -(2/5), (17/5), -(26/5), 9, 9, -(12/5), -(43/5), -(12/5), 9, -(2/5), (17/5), -(12/5), -(2/5), -(43/5), -(3/5), -(43/5), 9, (17/5), -(43/5), -(26/5), -(43/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -4, 6.3, -\\frac{28}{\\pi }, -2, -4 \\sqrt{2}, -5, -9, 8} \\setminus {-\\frac{13}{2}, 1, -8, -1, -\\frac{28}{\\pi }, -4, -6, 8, 6.3}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{2}, -5, -2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -4, 6.3, -(28/math.pi), -2, -4*math.sqrt(2), -5, -9, 8,))\nsnd = set((-(13/2), 1, -8, -1, -(28/math.pi), -4, -6, 8, 6.3,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.082,0.023,0.239,0.062,0.079,0.082,0.015,0.166,0.042,0.055\\}$ and $\\{0.053,0.095,0.124,0.052,0.108,0.16,0.036,0.077,0.146,0.102\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.082, 0.023, 0.239, 0.062, 0.079, 0.082, 0.015, 0.166, 0.042, 0.055\ndistribution2 = 0.053, 0.095, 0.124, 0.052, 0.108, 0.16, 0.036, 0.077, 0.146, 0.102\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-0.065, 5, \\frac{3}{7}, -3 \\sqrt{5}, 1.97, 0, \\frac{3}{\\pi }}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -0.065, 0, \\frac{3}{7}, \\frac{3}{\\pi }, 1.97, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -0.065, 5, (3/7), -3*math.sqrt(5), 1.97, 0, (3/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{1}{5}, -\\frac{5}{\\pi }, -1, 2, 10}$.", - "Output Answer": [ - "$-\\frac{1}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(1/5), -(5/math.pi), -1, 2, 10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x^2+4.7 x+6.4$ where $x \\sim $ \\text{NormalDistribution}[-1.4,1.7]\n", - "Output Answer": [ - "$0.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.4, 1.7)\nprint(E(0.2*x**2+4.7*x+6.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x^2+2.3 x-0.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$1.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(1.*x**2+2.3*x-0.6))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 10, 1, -\\frac{26}{5}, -2 \\sqrt{5}, 7} \\cup {-3, 1, 7, -\\frac{27}{5}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{27}{5}, -\\frac{26}{5}, -2 \\sqrt{5}, -3, 1, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 10, 1, -(26/5), -2*math.sqrt(5), 7,))\nsnd = set((-3, 1, 7, -(27/5), -2*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 6, 1, -3, 3, -2, 1, -4}$.\n", - "Output Answer": [ - "$\\frac{11}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 6, 1, -3, 3, -2, 1, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -3 \\pi, 0, -\\pi, -\\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$-\\frac{\\pi }{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, -3*math.pi, 0, -math.pi, -math.pi, 2*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, 9, 49}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{-1} 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, 9, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 6, 0, 8}$.\n", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 6, 0, 8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 8, 0.5, -6.29, 9} \\setminus {3, -9, -6.29, -8}$.\n", - "Output Answer": [ - "${0.5, 8, 9}$" - ], - "Output Program": [ - "fst = set((-8, 8, 0.5, -6.29, 9,))\nsnd = set((3, -9, -6.29, -8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x^2+2.3 x-9.2$ where $x \\sim $ \\text{PoissonDistribution}[0.9]\n", - "Output Answer": [ - "$-6.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.9)\nprint(E(0.6*x**2+2.3*x-9.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{13}{3}, 12}$.\n", - "Output Answer": [ - "$\\frac{312}{49}$" - ], - "Output Program": [ - "import statistics\nvalues = (13/3), 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{3}{\\sqrt{2}}, 0} \\cup {-2, -8 \\log (2), \\frac{3}{\\sqrt{2}}, 4}$.\n", - "Output Answer": [ - "${-8 \\log (2), -2, 0, \\frac{3}{\\sqrt{2}}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set(((3/(math.sqrt(2))), 0,))\nsnd = set((-2, -8*math.log(2), (3/(math.sqrt(2))), 4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{11}{\\pi }, -\\frac{19}{7}, 6, -2 \\sqrt{5}, 4, -2, -7, -5}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{19}{7}-\\frac{11}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(11/math.pi), -(19/7), 6, -2*math.sqrt(5), 4, -2, -7, -5\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, 3, -3, 5, \\frac{21}{e}, -\\frac{4}{\\sqrt{5}}, 5, 2, \\frac{3}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$8+\\frac{21}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 3, -3, 5, (21/math.e), -(4/(math.sqrt(5))), 5, 2, (3/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, -3, 64, 49}$.\n", - "Output Answer": [ - "$20 \\sqrt[4]{-3} \\sqrt{14}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, -3, 64, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${27, -2, -1, -1000}$.\n", - "Output Answer": [ - "$2 \\sqrt[4]{-1} 15^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 27, -2, -1, -1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-7, 3, -14, -13, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{953}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, 3, -14, -13, 8\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -3, 10000, 2401}$.\n", - "Output Answer": [ - "$70 \\sqrt[4]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -3, 10000, 2401\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.102,0.051,0.079,0.06,0.101,0.251,0.015\\}$ and $\\{0.022,0.024,0.108,0.076,0.207,0.06,0.212\\}$.", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.102, 0.051, 0.079, 0.06, 0.101, 0.251, 0.015\ndistribution2 = 0.022, 0.024, 0.108, 0.076, 0.207, 0.06, 0.212\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{2}, \\frac{9}{4}, -8, -\\frac{18}{7}, -10, -\\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{18}{7}-\\pi \\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(2), (9/4), -8, -(18/7), -10, -math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 16, 3, 100, 625, 243}$.\n", - "Output Answer": [ - "$30 \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 16, 3, 100, 625, 243\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, 1, 1296, 36}$.\n", - "Output Answer": [ - "$12 \\sqrt[4]{2} \\sqrt{3} 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, 1, 1296, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${11 \\log (2), \\sqrt{3}, 5 \\sqrt{2}, -8, 6, -5 \\sqrt{2}, \\frac{12}{\\sqrt{5}}, 2, -\\frac{19}{2}, \\frac{14}{\\sqrt{3}}, 8, 3, \\frac{25}{e}, \\frac{19}{3}, -10}$.", - "Output Answer": [ - "$\\frac{12}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 11*math.log(2), math.sqrt(3), 5*math.sqrt(2), -8, 6, -5*math.sqrt(2), (12/(math.sqrt(5))), 2, -(19/2), (14/(math.sqrt(3))), 8, 3, (25/math.e), (19/3), -10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{27}{2}, 14, 11}$.\n", - "Output Answer": [ - "$\\frac{12474}{983}$" - ], - "Output Program": [ - "import statistics\nvalues = (27/2), 14, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.356,0.001,0.549\\}$ and $\\{0.295,0.173,0.4\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.356, 0.001, 0.549\ndistribution2 = 0.295, 0.173, 0.4\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, 1, 6 \\log (2), \\frac{4}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{5}}, -8 \\log (2), -\\pi}$.", - "Output Answer": [ - "$\\frac{4}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 1, 6*math.log(2), (4/(math.sqrt(math.pi))), (11/(math.sqrt(5))), -8*math.log(2), -math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${10, -6, 2, 5, -9, -\\frac{7}{\\sqrt{2}}, 3, -\\pi}$.\n", - "Output Answer": [ - "${-9, -6, -\\frac{7}{\\sqrt{2}}, -\\pi, 2, 3, 5, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -6, 2, 5, -9, -(7/(math.sqrt(2))), 3, -math.pi\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 3, 0, 6 \\sqrt{2}, -4, 9, -2 \\sqrt{5}, \\frac{15}{2}, \\pi, -2, -5, \\frac{17}{\\pi }, 0, -5, 9}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 3, 0, 6*math.sqrt(2), -4, 9, -2*math.sqrt(5), (15/2), math.pi, -2, -5, (17/math.pi), 0, -5, 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.069,0.163,0.105,0.135,0.125,0.084,0.113,0.113\\}$ and $\\{0.167,0.125,0.09,0.084,0.019,0.065,0.13,0.066\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.069, 0.163, 0.105, 0.135, 0.125, 0.084, 0.113, 0.113\ndistribution2 = 0.167, 0.125, 0.09, 0.084, 0.019, 0.065, 0.13, 0.066\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{\\sqrt{\\pi }}, 9, 6, 9, -4}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{\\pi }}, -4, 6, 9, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(math.pi))), 9, 6, 9, -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, -\\frac{8}{\\sqrt{3}}, -7, -2, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, -\\frac{8}{\\sqrt{3}}, -2, 7, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -(8/(math.sqrt(3))), -7, -2, 6*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5.703, 4 \\sqrt{5}, -\\frac{25}{4}, \\frac{11}{\\pi }, -\\frac{11}{4}, 3.71, -\\frac{1}{7}}$.\n", - "Output Answer": [ - "${-\\frac{25}{4}, -\\frac{11}{4}, -\\frac{1}{7}, \\frac{11}{\\pi }, 3.71, 5.703, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5.703, 4*math.sqrt(5), -(25/4), (11/math.pi), -(11/4), 3.71, -(1/7)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, 64, -100000, -125, 32}$.\n", - "Output Answer": [ - "$80 \\sqrt[5]{-1} 2^{2/5} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, 64, -100000, -125, 32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, \\frac{13}{\\sqrt{3}}, 3, 6, -4, -5, 5, -5 \\log (2), -6 \\log (2), -\\frac{17}{e}, -10, 9, -1, 9, -9}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, (13/(math.sqrt(3))), 3, 6, -4, -5, 5, -5*math.log(2), -6*math.log(2), -(17/math.e), -10, 9, -1, 9, -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, 10, 2, -5, -1}$.\n", - "Output Answer": [ - "$\\frac{307}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 10, 2, -5, -1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{3}, \\frac{16}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, -2 \\sqrt{3}, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{1}{8} \\left(\\frac{56}{\\sqrt{3}}-2 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(3), (16/(math.sqrt(3))), (16/(math.sqrt(3))), (11/(math.sqrt(3))), 5*math.sqrt(3), (13/(math.sqrt(3))), -2*math.sqrt(3), -math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 0, 7, 2, -9, 1}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 0, 7, 2, -9, 1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${46656, 343, 1, 64, 4, 64}$.\n", - "Output Answer": [ - "$24 \\sqrt[3]{2} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 46656, 343, 1, 64, 4, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -\\frac{13}{\\sqrt{5}}, \\frac{1}{2}, 3} \\setminus {\\frac{7}{\\pi }, -6, \\frac{1}{2}, -\\frac{12}{e}, 6, -7}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{5}}, 3, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -(13/(math.sqrt(5))), (1/2), 3,))\nsnd = set(((7/math.pi), -6, (1/2), -(12/math.e), 6, -7,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $1.41 < -0.6 x^2-3.2 x+2.9 < 5.72$ where $x \\sim $ \\text{PoissonDistribution}[3.7].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(P((1.41 < -0.6*x**2-3.2*x+2.9) & (-0.6*x**2-3.2*x+2.9 < 5.72)))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, 2, -7, -8, 10, 7} \\cap {1, -7, -1, 8, -9, -8}$.\n", - "Output Answer": [ - "${-8, -7}$" - ], - "Output Program": [ - "fst = set((3, 2, -7, -8, 10, 7,))\nsnd = set((1, -7, -1, 8, -9, -8,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2 \\pi, 5, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -2 \\pi, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.pi, 5, -6*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.004,0.064,0.038,0.166,0.032,0.077,0.313,0.028\\}$ and $\\{0.09,0.216,0.01,0.217,0.068,0.067,0.081,0.191\\}$.", - "Output Answer": [ - "$0.64$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.004, 0.064, 0.038, 0.166, 0.032, 0.077, 0.313, 0.028\ndistribution2 = 0.09, 0.216, 0.01, 0.217, 0.068, 0.067, 0.081, 0.191\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, -6.66, 5, \\frac{7}{e}, -9.25, -\\frac{3}{\\sqrt{2}}, -7.09, -8}$.\n", - "Output Answer": [ - "${-9.25, -8, -7.09, -6.66, -\\frac{3}{\\sqrt{2}}, \\frac{7}{e}, 3, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -6.66, 5, (7/math.e), -9.25, -(3/(math.sqrt(2))), -7.09, -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -7, -10, -9, 4 \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$10+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -7, -10, -9, 4*math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{31}{5}, -5, 8, -5, 9, \\frac{14}{\\sqrt{\\pi }}, -10, -4, -\\frac{19}{2}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{19}{2}, -\\frac{8}{\\sqrt{5}}, \\frac{11}{2}, -5}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = (31/5), -5, 8, -5, 9, (14/(math.sqrt(math.pi))), -10, -4, -(19/2), -(11/(math.sqrt(math.pi))), -(19/2), -(8/(math.sqrt(5))), (11/2), -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.5 x-0.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$-1.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(-1.5*x-0.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, 81, 36, 216}$.\n", - "Output Answer": [ - "$18\\ 5^{3/4} \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, 81, 36, 216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, 7 \\log (2), 4, -2, -0.3, -\\frac{11}{\\sqrt{3}}, 3, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -\\frac{11}{\\sqrt{3}}, -4, -2, -0.3, 3, 4, 7 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 7*math.log(2), 4, -2, -0.3, -(11/(math.sqrt(3))), 3, -5*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.176,0.131,0.228,0.363\\}$ and $\\{0.071,0.368,0.099,0.424\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.176, 0.131, 0.228, 0.363\ndistribution2 = 0.071, 0.368, 0.099, 0.424\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2 \\sqrt{5}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{15}{2}, \\frac{21}{4}, 0.957, -\\frac{16}{\\sqrt{\\pi }}, 7, 1}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -2 \\sqrt{5}, -\\frac{3}{\\sqrt{\\pi }}, 0.957, 1, \\frac{21}{4}, 7, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), -(3/(math.sqrt(math.pi))), (15/2), (21/4), 0.957, -(16/(math.sqrt(math.pi))), 7, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -\\sqrt{5}, 5, -3, -3 \\sqrt{2}, -8, -3, 6, -9}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -math.sqrt(5), 5, -3, -3*math.sqrt(2), -8, -3, 6, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.9 x^2+1.4 x+4.8$ where $x \\sim $ \\text{NormalDistribution}[1.6,2.1]\n", - "Output Answer": [ - "$-27.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.6, 2.1)\nprint(E(-4.9*x**2+1.4*x+4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 7, 11, 6}$.\n", - "Output Answer": [ - "$\\frac{924}{109}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 7, 11, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 8, 0, -8, \\frac{33}{4}}$.\n", - "Output Answer": [ - "$\\frac{65}{4}$" - ], - "Output Program": [ - "values = -5, 8, 0, -8, (33/4)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.102,0.014,0.141,0.001,0.437,0.06,0.012,0.081,0.008\\}$ and $\\{0.03,0.063,0.205,0.051,0.055,0.163,0.108,0.055,0.047,0.141\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.102, 0.014, 0.141, 0.001, 0.437, 0.06, 0.012, 0.081, 0.008\ndistribution2 = 0.03, 0.063, 0.205, 0.051, 0.055, 0.163, 0.108, 0.055, 0.047, 0.141\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{69}{7}, -\\frac{47}{5}, 3 e, \\frac{40}{7}, 4, -5, 1, \\frac{11}{2}, 4, -8, -9}$.\n", - "Output Answer": [ - "$\\frac{674}{35}$" - ], - "Output Program": [ - "import math\n\nvalues = (69/7), -(47/5), 3*math.e, (40/7), 4, -5, 1, (11/2), 4, -8, -9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, \\frac{19}{2}, -\\frac{13}{2}, \\frac{14}{\\sqrt{3}}, 6, 2 \\sqrt{3}, -6, 8, \\frac{11}{\\sqrt{2}}, 9}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 1, (19/2), -(13/2), (14/(math.sqrt(3))), 6, 2*math.sqrt(3), -6, 8, (11/(math.sqrt(2))), 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 1, -9, 10, 1, 1, -4, -7, 3, -4, 3, -9, -4, -4, -9, 1, -7, -4, 3, 10, -4, 1, -7, 10, 3, 10, -7, -4, -4, -4}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 1, -9, 10, 1, 1, -4, -7, 3, -4, 3, -9, -4, -4, -9, 1, -7, -4, 3, 10, -4, 1, -7, 10, 3, 10, -7, -4, -4, -4\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.182,0.206,0.164,0.147,0.137\\}$ and $\\{0.415,0.54,0.029,0.004,0.007\\}$.", - "Output Answer": [ - "$1.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.182, 0.206, 0.164, 0.147, 0.137\ndistribution2 = 0.415, 0.54, 0.029, 0.004, 0.007\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -3, -13, 1, -14, -13}$.\n", - "Output Answer": [ - "$\\frac{409}{6}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -3, -13, 1, -14, -13\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 5, -\\frac{7}{e}} \\cup {5, -\\frac{7}{e}}$.\n", - "Output Answer": [ - "${-4, -\\frac{7}{e}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 5, -(7/math.e),))\nsnd = set((5, -(7/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, -64, 7, 10, 4}$.\n", - "Output Answer": [ - "$2 \\sqrt[5]{-5} 2^{4/5} 7^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, -64, 7, 10, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 1, 14}$.\n", - "Output Answer": [ - "$\\frac{63}{26}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 1, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, -6, -\\frac{7}{2}, 3, -9, -5, -2 \\pi}$.\n", - "Output Answer": [ - "${-9, -2 \\pi, -6, -5, -\\frac{7}{2}, 3, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -6, -(7/2), 3, -9, -5, -2*math.pi\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{34}{3}, \\frac{53}{3}, \\frac{40}{3}, \\frac{11}{3}}$.\n", - "Output Answer": [ - "$\\frac{1585760}{195273}$" - ], - "Output Program": [ - "import statistics\nvalues = (34/3), (53/3), (40/3), (11/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\sqrt{5}, \\sqrt{5}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{5}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.sqrt(5), math.sqrt(5), 3*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, 25, 729}$.\n", - "Output Answer": [ - "$18 \\sqrt[3]{-1} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 25, 729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 9, -5, -5, -2, -2, -6, -2, -6, -4, -4, -5, -2, 0, -4, -5, -2, -2, 9, 9, -5, -5, -2, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 9, -5, -5, -2, -2, -6, -2, -6, -4, -4, -5, -2, 0, -4, -5, -2, -2, 9, 9, -5, -5, -2, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 2, -9, 2, 2, 8, -9, 8, 2, 2, -9, 8, -9, -9, 2, 2, 8, -6, 2, -6, 2, -6, 2, -6, 2, 1, -9}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 2, -9, 2, 2, 8, -9, 8, 2, 2, -9, 8, -9, -9, 2, 2, 8, -6, 2, -6, 2, -6, 2, -6, 2, 1, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, 9, -8, 2 \\pi, -\\frac{5}{4}, -8, -8, -\\log (2), -\\frac{13}{2}, 0, 9}$.", - "Output Answer": [ - "$-\\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 9, -8, 2*math.pi, -(5/4), -8, -8, -math.log(2), -(13/2), 0, 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -3, -\\frac{17}{\\sqrt{\\pi }}, 0, \\frac{4}{\\sqrt{5}}, -1, -9, \\pi}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -3, -(17/(math.sqrt(math.pi))), 0, (4/(math.sqrt(5))), -1, -9, math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${216, 8, -64}$.\n", - "Output Answer": [ - "$48 \\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = 216, 8, -64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -4 \\sqrt{5}, -\\frac{20}{e}, -2, 6, -12 \\log (2), \\frac{17}{\\sqrt{5}}, -2 \\sqrt{5}, 1, -3 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -4*math.sqrt(5), -(20/math.e), -2, 6, -12*math.log(2), (17/(math.sqrt(5))), -2*math.sqrt(5), 1, -3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, 13, 5, 3}$.\n", - "Output Answer": [ - "$\\frac{12480}{2099}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, 13, 5, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-7, -1, 9, -12}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{979}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -1, 9, -12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 0, -1, -2, -8, -8, -1, -1, 1, 0, -8, -2, -1, -1, -1, 0, -8, 0, -8, -9, -2, 0, -2, 1}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 0, -1, -2, -8, -8, -1, -1, 1, 0, -8, -2, -1, -1, -1, 0, -8, 0, -8, -9, -2, 0, -2, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7 \\log (2), -6 \\log (2), 11 \\log (2), 13 \\log (2), 5 \\log (2), -13 \\log (2), -13 \\log (2), 5 \\log (2), -10 \\log (2), -6 \\log (2), 13 \\log (2), 5 \\log (2), 11 \\log (2), 13 \\log (2), 5 \\log (2), 5 \\log (2), -10 \\log (2), 13 \\log (2), -6 \\log (2), -13 \\log (2), 13 \\log (2)}$.\n", - "Output Answer": [ - "$\\{13 \\log (2),5 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 7*math.log(2), -6*math.log(2), 11*math.log(2), 13*math.log(2), 5*math.log(2), -13*math.log(2), -13*math.log(2), 5*math.log(2), -10*math.log(2), -6*math.log(2), 13*math.log(2), 5*math.log(2), 11*math.log(2), 13*math.log(2), 5*math.log(2), 5*math.log(2), -10*math.log(2), 13*math.log(2), -6*math.log(2), -13*math.log(2), 13*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 7, -8, -8, 8, -8, -8, 9, 9, -8, 9, 8, 7, 5, 1, 5, 8, 1, 5, 7}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 7, -8, -8, 8, -8, -8, 9, 9, -8, 9, 8, 7, 5, 1, 5, 8, 1, 5, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{7}{2}, \\frac{11}{2}, \\frac{9}{2}}$.\n", - "Output Answer": [ - "$\\frac{2079}{478}$" - ], - "Output Program": [ - "import statistics\nvalues = (7/2), (11/2), (9/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{9}{\\sqrt{2}}, 5, -9, -8}$.\n", - "Output Answer": [ - "${-9, -8, 5, \\frac{9}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/(math.sqrt(2))), 5, -9, -8\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x-4.4$ where $x \\sim $ \\text{BetaDistribution}[1.9,0.6]\n", - "Output Answer": [ - "$-7.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 0.6)\nprint(E(-3.5*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\sqrt{3}, -4 \\sqrt{3}, -3 \\sqrt{3}, \\sqrt{3}, -4 \\sqrt{3}, \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{11}{2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.sqrt(3), -4*math.sqrt(3), -3*math.sqrt(3), math.sqrt(3), -4*math.sqrt(3), math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{54}{7}, -5, -3, -10, -14 \\log (2), -\\frac{64}{7}, 9, \\frac{32}{7}, -8} \\cup {\\frac{34}{7}, 9, -\\frac{1}{7}, -\\frac{19}{2}, -7 \\log (2), \\frac{54}{7}, -5, -3}$.\n", - "Output Answer": [ - "${-10, -14 \\log (2), -\\frac{19}{2}, -\\frac{64}{7}, -8, -5, -7 \\log (2), -3, -\\frac{1}{7}, \\frac{32}{7}, \\frac{34}{7}, \\frac{54}{7}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set(((54/7), -5, -3, -10, -14*math.log(2), -(64/7), 9, (32/7), -8,))\nsnd = set(((34/7), 9, -(1/7), -(19/2), -7*math.log(2), (54/7), -5, -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x-4.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$-4.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(3.6*x-4.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{48}{5}, -8, 1, 3, 5, \\frac{14}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{\\pi }}, -6 \\sqrt{2}, \\frac{10}{3}, \\frac{18}{\\sqrt{5}}, 9}$.", - "Output Answer": [ - "$\\frac{10}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (48/5), -8, 1, 3, 5, (14/(math.sqrt(math.pi))), -(1/(math.sqrt(math.pi))), -6*math.sqrt(2), (10/3), (18/(math.sqrt(5))), 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.213,0.237,0.015,0.444,0.044\\}$ and $\\{0.359,0.225,0.125,0.048,0.114\\}$.", - "Output Answer": [ - "$0.77$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.213, 0.237, 0.015, 0.444, 0.044\ndistribution2 = 0.359, 0.225, 0.125, 0.048, 0.114\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, 1, -\\frac{3}{2}, -3} \\setminus {\\frac{28}{3}, -\\frac{3}{2}, 9}$.\n", - "Output Answer": [ - "${-3, 1, 4}$" - ], - "Output Program": [ - "fst = set((4, 1, -(3/2), -3,))\nsnd = set(((28/3), -(3/2), 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\log (2), 0, -7}$.\n", - "Output Answer": [ - "${-7, -\\log (2), 0}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.log(2), 0, -7\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 8, -32768, 49, 256}$.\n", - "Output Answer": [ - "$64 \\sqrt[5]{-1} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 8, -32768, 49, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{11}{2}, \\frac{9}{2}, -6, 5, -4, \\frac{13}{2}, -\\frac{17}{2}, 9}$.\n", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (11/2), (9/2), -6, 5, -4, (13/2), -(17/2), 9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x-0.1$ where $x \\sim $ \\text{PoissonDistribution}[1.]\n", - "Output Answer": [ - "$4.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.)\nprint(E(4.7*x-0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, -8, 1, 3, -\\frac{8}{3}, -\\frac{25}{3}, -6 \\sqrt{2}, 3}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -\\frac{25}{3}, -8, -\\frac{8}{3}, 1, 3, 3, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -8, 1, 3, -(8/3), -(25/3), -6*math.sqrt(2), 3\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -9, -3, 5, -8, 3, 9, -1}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -9, -3, 5, -8, 3, 9, -1\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, \\frac{4}{\\sqrt{5}}, \\frac{26}{3}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{27}{5}, 0, \\frac{3}{2}, 8, -\\frac{19}{5}, 3, -e, -2 \\sqrt{2}, 3}$.", - "Output Answer": [ - "$\\frac{3}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, (4/(math.sqrt(5))), (26/3), (3/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(27/5), 0, (3/2), 8, -(19/5), 3, -math.e, -2*math.sqrt(2), 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 2, 4, 1}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 2, 4, 1\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x-4.1$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$6.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(4.4*x-4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{27}{2}, \\frac{31}{2}, \\frac{19}{2}, 2}$.\n", - "Output Answer": [ - "$\\frac{127224}{23659}$" - ], - "Output Program": [ - "import statistics\nvalues = (27/2), (31/2), (19/2), 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 3, 4, 8}$.\n", - "Output Answer": [ - "$\\frac{1248}{245}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 3, 4, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{10}{e}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{10}{e}-\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(10/math.e), -math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, 9, 0, -7, -4, 1, -7, -9}$.\n", - "Output Answer": [ - "$-\\frac{25}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, 9, 0, -7, -4, 1, -7, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -\\frac{4}{\\sqrt{3}}, 6, -0.983, 4, 10, 8, -7, -4.809, -4} \\cup {-8, \\frac{1}{\\sqrt{3}}, 4, -0.983, 9, 10, -7.065, 8, -4}$.\n", - "Output Answer": [ - "${-8, -7.065, -7, -4.809, -4, -\\frac{4}{\\sqrt{3}}, -0.983, \\frac{1}{\\sqrt{3}}, 4, 6, 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -(4/(math.sqrt(3))), 6, -0.983, 4, 10, 8, -7, -4.809, -4,))\nsnd = set((-8, (1/(math.sqrt(3))), 4, -0.983, 9, 10, -7.065, 8, -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 2 \\pi, 6}$.\n", - "Output Answer": [ - "$3+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 2*math.pi, 6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 3, 6, 7, 0, -6}$.\n", - "Output Answer": [ - "$\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 3, 6, 7, 0, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{3}{\\pi }, \\frac{5}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{4}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (3/math.pi), (5/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{2}{3}, -4, \\frac{7}{\\sqrt{2}}, 3 \\sqrt{5}, -4 e, 0} \\cup {-4, \\frac{22}{e}, 0, 4 \\sqrt{5}, -6 \\sqrt{2}, -8, -3 e}$.\n", - "Output Answer": [ - "${-4 e, -6 \\sqrt{2}, -3 e, -8, -4, -\\frac{2}{3}, 0, \\frac{7}{\\sqrt{2}}, 3 \\sqrt{5}, \\frac{22}{e}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(2/3), -4, (7/(math.sqrt(2))), 3*math.sqrt(5), -4*math.e, 0,))\nsnd = set((-4, (22/math.e), 0, 4*math.sqrt(5), -6*math.sqrt(2), -8, -3*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{9}{2}, 8, -\\frac{5}{e}, -2 \\pi, \\frac{20}{3}, 5, -\\frac{14}{3}, -7} \\cup {\\frac{20}{3}, -2 \\pi, -\\frac{14}{3}, \\frac{1}{e}, -3, 8}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, -\\frac{14}{3}, -\\frac{9}{2}, -3, -\\frac{5}{e}, \\frac{1}{e}, 5, \\frac{20}{3}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(9/2), 8, -(5/math.e), -2*math.pi, (20/3), 5, -(14/3), -7,))\nsnd = set(((20/3), -2*math.pi, -(14/3), (1/math.e), -3, 8,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -3*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, 4, 6, -3 \\pi, 0, -\\frac{25}{3}, \\sqrt{2}, 3, -10, -\\frac{20}{\\pi }, 2, 0, -\\frac{19}{e}, 9, -\\frac{9}{\\sqrt{2}}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 4, 6, -3*math.pi, 0, -(25/3), math.sqrt(2), 3, -10, -(20/math.pi), 2, 0, -(19/math.e), 9, -(9/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 6, 4, 3, 4, 4, 3, 3, 3, -4, -4, 6, 10, -4, 4, 10, 6, 10, 4, -4, 4, 3, -4, 4, 4, 3, 10, 3}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 6, 4, 3, 4, 4, 3, 3, 3, -4, -4, 6, 10, -4, 4, 10, 6, 10, 4, -4, 4, 3, -4, 4, 4, 3, 10, 3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${5, -8, 5, 3, 4 \\sqrt{5}, 1, 4.21, 9}$.\n", - "Output Answer": [ - "${-8, 1, 3, 4.21, 5, 5, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -8, 5, 3, 4*math.sqrt(5), 1, 4.21, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -9, 100, 1, 59049}$.\n", - "Output Answer": [ - "$9 \\sqrt[5]{-1} 30^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -9, 100, 1, 59049\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2 e, 1.6, 7, -\\frac{9}{\\sqrt{2}}, -9, -5}$.\n", - "Output Answer": [ - "${-9, -\\frac{9}{\\sqrt{2}}, -2 e, -5, 1.6, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.e, 1.6, 7, -(9/(math.sqrt(2))), -9, -5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{4}{e}, \\frac{7}{e}, \\frac{7}{e}, -\\frac{4}{e}, -\\frac{18}{e}, -\\frac{4}{e}, -\\frac{4}{e}, \\frac{7}{e}, \\frac{27}{e}, \\frac{27}{e}, -\\frac{18}{e}, \\frac{7}{e}, -\\frac{18}{e}, \\frac{7}{e}, \\frac{7}{e}, \\frac{27}{e}, \\frac{27}{e}, \\frac{7}{e}, -\\frac{18}{e}, \\frac{7}{e}, \\frac{27}{e}, -\\frac{18}{e}, \\frac{7}{e}, -\\frac{18}{e}, \\frac{7}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{7}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(4/math.e), (7/math.e), (7/math.e), -(4/math.e), -(18/math.e), -(4/math.e), -(4/math.e), (7/math.e), (27/math.e), (27/math.e), -(18/math.e), (7/math.e), -(18/math.e), (7/math.e), (7/math.e), (27/math.e), (27/math.e), (7/math.e), -(18/math.e), (7/math.e), (27/math.e), -(18/math.e), (7/math.e), -(18/math.e), (7/math.e)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\frac{50}{7}, -2} \\setminus {\\frac{17}{\\sqrt{5}}, 4, \\frac{50}{7}, -2}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (50/7), -2,))\nsnd = set(((17/(math.sqrt(5))), 4, (50/7), -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 e, -e, 3 e, 2 e, -e, -3 e, -2 e, -2 e, -4 e, -2 e, -2 e, 3 e, -2 e, 3 e, e, -3 e, -2 e, 2 e, -e, 2 e, 2 e, 2 e, -e}$.\n", - "Output Answer": [ - "$\\{-2 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.e, -math.e, 3*math.e, 2*math.e, -math.e, -3*math.e, -2*math.e, -2*math.e, -4*math.e, -2*math.e, -2*math.e, 3*math.e, -2*math.e, 3*math.e, math.e, -3*math.e, -2*math.e, 2*math.e, -math.e, 2*math.e, 2*math.e, 2*math.e, -math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, -7, 10000, 4}$.\n", - "Output Answer": [ - "$20 \\sqrt[4]{-7} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, -7, 10000, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{1}{\\sqrt{2}}, 5, \\frac{4}{5}, 3 e, 3, -\\frac{29}{\\pi }, \\frac{25}{e}, -5, -\\frac{4}{3}, -2, \\frac{15}{\\pi }, \\frac{4}{5}, 10, -3}$.", - "Output Answer": [ - "$\\frac{4}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (1/(math.sqrt(2))), 5, (4/5), 3*math.e, 3, -(29/math.pi), (25/math.e), -5, -(4/3), -2, (15/math.pi), (4/5), 10, -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 81, 1, 81, 81}$.\n", - "Output Answer": [ - "$27 \\sqrt[5]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 81, 1, 81, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x+3.5$ where $x \\sim $ \\text{PoissonDistribution}[3.4]\n", - "Output Answer": [ - "$4.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.4)\nprint(E(0.2*x+3.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.5 x+0.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.9]\n", - "Output Answer": [ - "$1.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.9)\nprint(E(0.5*x+0.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, 9, -0.95, 2, 6, -10, 1}$.\n", - "Output Answer": [ - "${-10, -0.95, 1, 2, 3, 6, 9}$" - ], - "Output Program": [ - "values = 3, 9, -0.95, 2, 6, -10, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, 9, -64, 1}$.\n", - "Output Answer": [ - "$(2+2 i) \\sqrt{3} 10^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, 9, -64, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x^2-1. x+4.$ where $x \\sim $ \\text{BetaDistribution}[0.9,1.]\n", - "Output Answer": [ - "$4.74$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.9, 1.)\nprint(E(3.9*x**2-1.*x+4.))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, -13, -8, -10, 14, 2}$.\n", - "Output Answer": [ - "$\\frac{3533}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -13, -8, -10, 14, 2\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -6, -6, 8}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -6, -6, 8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 343, 2, 36}$.\n", - "Output Answer": [ - "$7 \\sqrt{3} 14^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 343, 2, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -1, -1, -1, -7, 7, -1, 7, 7, -6, -6, -1, -7, -1, 2, -2, -1, -7, -1, -7, -6, 2, -1, -7, -2, -1, -6}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -1, -1, -1, -7, 7, -1, 7, 7, -6, -6, -1, -7, -1, 2, -2, -1, -7, -1, -7, -6, 2, -1, -7, -2, -1, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -7, -7, 6, 1, 9, 9, -7, -7, -6, -2, 1, 9, -1, -5, 1, -2, -1, -5, -6, -2, -7, 9, 1, -5, -1, -2, -5, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -7, -7, 6, 1, 9, 9, -7, -7, -6, -2, 1, 9, -1, -5, 1, -2, -1, -5, -6, -2, -7, 9, 1, -5, -1, -2, -5, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x^2-3.5 x-0.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$24.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(3.8*x**2-3.5*x-0.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, -14 \\log (2), -7, -\\frac{50}{7}, \\frac{17}{4}, -4, 8, -\\frac{22}{\\pi }, -6, -2 \\sqrt{3}, 7, 8, 0, -\\frac{13}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-4-2 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -14*math.log(2), -7, -(50/7), (17/4), -4, 8, -(22/math.pi), -6, -2*math.sqrt(3), 7, 8, 0, -(13/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 1, 16807, 10000, 625}$.\n", - "Output Answer": [ - "$140\\ 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 1, 16807, 10000, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $0.22 < 3.1 x-3.6 < 0.94$ where $x \\sim $ \\text{ExponentialDistribution}[1.].", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(P((0.22 < 3.1*x-3.6) & (3.1*x-3.6 < 0.94)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-1.42 < 4.2 x-2. < 0.61$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2].", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(P((-1.42 < 4.2*x-2.) & (4.2*x-2. < 0.61)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.075,0.032,0.064,0.553,0.041\\}$ and $\\{0.076,0.122,0.204,0.21,0.326\\}$.", - "Output Answer": [ - "$0.64$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.075, 0.032, 0.064, 0.553, 0.041\ndistribution2 = 0.076, 0.122, 0.204, 0.21, 0.326\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x+3.9$ where $x \\sim $ \\text{PoissonDistribution}[2.5]\n", - "Output Answer": [ - "$14.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.5)\nprint(E(4.4*x+3.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{17}{2}, -5 \\sqrt{2}, -8, 6 \\sqrt{2}, -2 \\sqrt{2}, \\sqrt{5}, 5, 7, -10, 4, -2, \\frac{13}{\\sqrt{\\pi }}, -3 \\sqrt{5}, 5}$.\n", - "Output Answer": [ - "$\\frac{37}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (17/2), -5*math.sqrt(2), -8, 6*math.sqrt(2), -2*math.sqrt(2), math.sqrt(5), 5, 7, -10, 4, -2, (13/(math.sqrt(math.pi))), -3*math.sqrt(5), 5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{39}{2}, \\frac{13}{2}, \\frac{31}{2}}$.\n", - "Output Answer": [ - "$\\frac{3627}{326}$" - ], - "Output Program": [ - "import statistics\nvalues = (39/2), (13/2), (31/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${1, -11, 11, 6, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{149}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -11, 11, 6, 8\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{24}{e}, -\\frac{15}{e}, \\frac{7}{e}, -\\frac{26}{e}, \\frac{3}{e}}$.\n", - "Output Answer": [ - "$-\\frac{11}{e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(24/math.e), -(15/math.e), (7/math.e), -(26/math.e), (3/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\log (2), 4 \\log (2), -8 \\log (2), -3 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{9 \\log (2)}{4}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.log(2), 4*math.log(2), -8*math.log(2), -3*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{5}{2}, -5, -7, 5} \\cup {-9, -\\frac{5}{2}, -5, -2}$.\n", - "Output Answer": [ - "${-9, -7, -5, -\\frac{5}{2}, -2, 5}$" - ], - "Output Program": [ - "fst = set((-(5/2), -5, -7, 5,))\nsnd = set((-9, -(5/2), -5, -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{15}{\\sqrt{\\pi }}, 8, 2, \\pi, -10, -8} \\setminus {8, -7 \\sqrt{2}, -8, 2, \\pi, -\\frac{6}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-10, -\\frac{15}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(15/(math.sqrt(math.pi))), 8, 2, math.pi, -10, -8,))\nsnd = set((8, -7*math.sqrt(2), -8, 2, math.pi, -(6/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 256, -6, -125}$.\n", - "Output Answer": [ - "$8\\ 5^{3/4} \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 256, -6, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x-0.8$ where $x \\sim $ \\text{BetaDistribution}[0.2,0.2]\n", - "Output Answer": [ - "$0.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.2, 0.2)\nprint(E(3.4*x-0.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7, -3, 9, \\frac{5}{3}, -4} \\setminus {-10, 3, -5, -3, \\frac{5}{3}}$.\n", - "Output Answer": [ - "${-4, 7, 9}$" - ], - "Output Program": [ - "fst = set((7, -3, 9, (5/3), -4,))\nsnd = set((-10, 3, -5, -3, (5/3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, 64, 100}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{-7} 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 64, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -\\frac{19}{e}, 3, 2 \\pi, 3, -4, -e, 4, 8, -\\frac{24}{\\pi }, -2, -3, 4, -1, \\frac{17}{\\sqrt{3}}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -(19/math.e), 3, 2*math.pi, 3, -4, -math.e, 4, 8, -(24/math.pi), -2, -3, 4, -1, (17/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 1, -7, 5, -9, 1, 1, 5, 5, 1, 3, 1, 3, 5, -9, -7, -9, 5, 3, -7, -6, 5, -7, -6, 5, 3, 1, -7, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 1, -7, 5, -9, 1, 1, 5, 5, 1, 3, 1, 3, 5, -9, -7, -9, 5, 3, -7, -6, 5, -7, -6, 5, 3, 1, -7, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, -6 \\log (2), 6 \\sqrt{2}, 3 \\sqrt{3}, 3, -7, -4, \\frac{11}{2}} \\setminus {3 \\sqrt{3}, -\\frac{13}{e}, 1, -6 \\log (2), -7, 6 \\sqrt{2}, \\frac{11}{2}, -4}$.\n", - "Output Answer": [ - "${3}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -6*math.log(2), 6*math.sqrt(2), 3*math.sqrt(3), 3, -7, -4, (11/2),))\nsnd = set((3*math.sqrt(3), -(13/math.e), 1, -6*math.log(2), -7, 6*math.sqrt(2), (11/2), -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3 e, 5, \\frac{58}{7}, -3}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.e, 5, (58/7), -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 3, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$3+4 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 3, -4*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{7}{2}, 18, 10, \\frac{31}{2}}$.\n", - "Output Answer": [ - "$\\frac{39060}{4939}$" - ], - "Output Program": [ - "import statistics\nvalues = (7/2), 18, 10, (31/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2.044, -8, 2 \\sqrt{3}, 5, 9} \\setminus {-\\frac{9}{7}, 8, 2 \\sqrt{3}, 6, -1, 5}$.\n", - "Output Answer": [ - "${-8, 2.044, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((2.044, -8, 2*math.sqrt(3), 5, 9,))\nsnd = set((-(9/7), 8, 2*math.sqrt(3), 6, -1, 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 16, 9, 1}$.\n", - "Output Answer": [ - "$\\frac{6336}{2003}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 16, 9, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{14}{\\sqrt{5}}, 1, -\\frac{5}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$-\\frac{5}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(14/(math.sqrt(5))), 1, -(5/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\log (2), -13 \\log (2), -13 \\log (2), -13 \\log (2), -5 \\log (2), -14 \\log (2), -5 \\log (2), -10 \\log (2), -2 \\log (2), -10 \\log (2), 11 \\log (2), -5 \\log (2), -14 \\log (2), -14 \\log (2), -13 \\log (2), -2 \\log (2), -14 \\log (2), -10 \\log (2), 11 \\log (2), -14 \\log (2), -5 \\log (2), -2 \\log (2), -5 \\log (2), -13 \\log (2), -10 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-5 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.log(2), -13*math.log(2), -13*math.log(2), -13*math.log(2), -5*math.log(2), -14*math.log(2), -5*math.log(2), -10*math.log(2), -2*math.log(2), -10*math.log(2), 11*math.log(2), -5*math.log(2), -14*math.log(2), -14*math.log(2), -13*math.log(2), -2*math.log(2), -14*math.log(2), -10*math.log(2), 11*math.log(2), -14*math.log(2), -5*math.log(2), -2*math.log(2), -5*math.log(2), -13*math.log(2), -10*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (4/(math.sqrt(3))), (4/(math.sqrt(3))), -(17/(math.sqrt(3))), -(17/(math.sqrt(3))), -(17/(math.sqrt(3))), -(17/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), -(17/(math.sqrt(3))), -(17/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), -(17/(math.sqrt(3))), (4/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, -6, -5, \\frac{42}{5}, 2}$.\n", - "Output Answer": [ - "${-6, -5, -1, 2, \\frac{42}{5}}$" - ], - "Output Program": [ - "values = -1, -6, -5, (42/5), 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4 \\sqrt{2}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$4 \\sqrt{2}+\\frac{2}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(2), -(7/(math.sqrt(math.pi))), (2/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8.68, -2, 2, 8, 4, -8, -4 \\sqrt{5}} \\cup {10, 8.68, -1, -4 \\sqrt{5}, -8, 9}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -8, -2, -1, 2, 4, 8, 8.68, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.68, -2, 2, 8, 4, -8, -4*math.sqrt(5),))\nsnd = set((10, 8.68, -1, -4*math.sqrt(5), -8, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\pi, \\pi, 0, 0, 3 \\pi, 2 \\pi, 3 \\pi}$.\n", - "Output Answer": [ - "$\\pi$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.pi, math.pi, 0, 0, 3*math.pi, 2*math.pi, 3*math.pi\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x-4.2$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$5.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(1.9*x-4.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.4 x-2.1$ where $x \\sim $ \\text{PoissonDistribution}[2.1]\n", - "Output Answer": [ - "$-7.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.1)\nprint(E(-2.4*x-2.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 125, 8}$.\n", - "Output Answer": [ - "$10\\ 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 125, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${2, -\\sqrt{3}, 1, 5} \\setminus {0, -6, -9, -\\frac{39}{4}, \\frac{20}{\\pi }, -1, -2}$.\n", - "Output Answer": [ - "${-\\sqrt{3}, 1, 2, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -math.sqrt(3), 1, 5,))\nsnd = set((0, -6, -9, -(39/4), (20/math.pi), -1, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -9, -3, -8, 0} \\setminus {-8, -e, -9, 2 \\log (2), -1}$.\n", - "Output Answer": [ - "${-3, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -9, -3, -8, 0,))\nsnd = set((-8, -math.e, -9, 2*math.log(2), -1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, -6, 10}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -6, 10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7 \\log (2), -3 e, -\\frac{10}{3}, -7.07}$.\n", - "Output Answer": [ - "${-3 e, -7.07, -\\frac{10}{3}, 7 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 7*math.log(2), -3*math.e, -(10/3), -7.07\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -\\frac{1}{e}, -3, -4, 4 \\log (2), -8, -7, -\\frac{1}{3}, \\frac{4}{\\sqrt{5}}, -\\frac{20}{3}, \\frac{25}{e}}$.", - "Output Answer": [ - "$-\\frac{1}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -(1/math.e), -3, -4, 4*math.log(2), -8, -7, -(1/3), (4/(math.sqrt(5))), -(20/3), (25/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-0.241, \\frac{11}{\\sqrt{3}}, \\frac{20}{\\pi }, 2, 9, -2, -7, 3, \\frac{19}{2}} \\cup {9, 3, -7, -5, 2, -2, -5 \\sqrt{3}, \\frac{4}{\\pi }, 1.004}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -7, -5, -2, -0.241, 1.004, \\frac{4}{\\pi }, 2, 3, \\frac{11}{\\sqrt{3}}, \\frac{20}{\\pi }, 9, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.241, (11/(math.sqrt(3))), (20/math.pi), 2, 9, -2, -7, 3, (19/2),))\nsnd = set((9, 3, -7, -5, 2, -2, -5*math.sqrt(3), (4/math.pi), 1.004,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, 4 \\sqrt{5}, \\frac{11}{2}, 5} \\setminus {2.444, -4 \\sqrt{5}, \\frac{11}{2}, \\frac{17}{\\sqrt{5}}, 5, 0}$.\n", - "Output Answer": [ - "${4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 4*math.sqrt(5), (11/2), 5,))\nsnd = set((2.444, -4*math.sqrt(5), (11/2), (17/(math.sqrt(5))), 5, 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, 9, -6, -15}$.\n", - "Output Answer": [ - "$\\frac{21}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 9, -6, -15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 11, 13, 1}$.\n", - "Output Answer": [ - "$\\frac{429}{161}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 11, 13, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x-0.3$ where $x \\sim $ \\text{BetaDistribution}[0.2,0.2]\n", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.2, 0.2)\nprint(E(2.2*x-0.3))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-10, -9, -\\frac{17}{\\sqrt{3}}, -5 \\log (2), \\frac{47}{5}, 6, 2} \\cup {-5 \\log (2), -9, \\frac{47}{5}, -5 \\sqrt{2}, -\\frac{14}{\\sqrt{3}}, -10, \\frac{17}{4}}$.\n", - "Output Answer": [ - "${-10, -\\frac{17}{\\sqrt{3}}, -9, -\\frac{14}{\\sqrt{3}}, -5 \\sqrt{2}, -5 \\log (2), 2, \\frac{17}{4}, 6, \\frac{47}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, -9, -(17/(math.sqrt(3))), -5*math.log(2), (47/5), 6, 2,))\nsnd = set((-5*math.log(2), -9, (47/5), -5*math.sqrt(2), -(14/(math.sqrt(3))), -10, (17/4),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, 0, 3, -10, 0, 9}$.\n", - "Output Answer": [ - "$2 \\sqrt{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 0, 3, -10, 0, 9\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, -4, -4, 4, -\\frac{33}{4}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{33}{4}, -2 \\sqrt{5}, -4, -4, 3, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -4, -4, 4, -(33/4), -2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 16807, 2, 64, 1, 32}$.\n", - "Output Answer": [ - "$28 \\sqrt[6]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 16807, 2, 64, 1, 32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 4, 49}$.\n", - "Output Answer": [ - "$2 \\sqrt[3]{2} 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 4, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4, -10, 0, 1, -\\frac{3}{\\sqrt{5}}, 4 \\sqrt{3}, -\\frac{1}{\\sqrt{\\pi }}, -\\frac{6}{\\pi }} \\setminus {4, \\frac{14}{\\pi }, -\\frac{1}{\\sqrt{\\pi }}, 4 \\sqrt{3}, -10}$.\n", - "Output Answer": [ - "${-\\frac{6}{\\pi }, -\\frac{3}{\\sqrt{5}}, 0, 1}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -10, 0, 1, -(3/(math.sqrt(5))), 4*math.sqrt(3), -(1/(math.sqrt(math.pi))), -(6/math.pi),))\nsnd = set((4, (14/math.pi), -(1/(math.sqrt(math.pi))), 4*math.sqrt(3), -10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x-4.8$ where $x \\sim $ \\text{NormalDistribution}[0.2,1.2]\n", - "Output Answer": [ - "$-4.42$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.2, 1.2)\nprint(E(1.9*x-4.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 9, 1, -1, 4}$.\n", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 9, 1, -1, 4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${32, 2401, 4, -729, 1}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-3} 2^{2/5} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 32, 2401, 4, -729, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x^2-4. x-2.2$ where $x \\sim $ \\text{NormalDistribution}[1.5,3.]\n", - "Output Answer": [ - "$40.17$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.5, 3.)\nprint(E(4.3*x**2-4.*x-2.2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{5}, 3 \\sqrt{5}, -4 \\sqrt{5}, \\sqrt{5}, 3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, 3 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, 3 \\sqrt{5}, 3 \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, \\sqrt{5}, -4 \\sqrt{5}, 3 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, 3 \\sqrt{5}, \\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{3 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(5), 3*math.sqrt(5), -4*math.sqrt(5), math.sqrt(5), 3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), 3*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), 3*math.sqrt(5), 3*math.sqrt(5), math.sqrt(5), -math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), math.sqrt(5), -4*math.sqrt(5), 3*math.sqrt(5), math.sqrt(5), math.sqrt(5), 3*math.sqrt(5), math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), 3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.6 x^3-1.3 x^2-3.6 x+2.5$ where $x \\sim $ \\text{NormalDistribution}[1.8,1.7]\n", - "Output Answer": [ - "$-46.25$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.8, 1.7)\nprint(E(-1.6*x**3-1.3*x**2-3.6*x+2.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 10000, 81, 1296, 16, 10000}$.\n", - "Output Answer": [ - "$120\\ 2^{2/3} \\sqrt[3]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 10000, 81, 1296, 16, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{1}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{2 \\sqrt{5}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (1/(math.sqrt(5))), (18/(math.sqrt(5))), -(9/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.11,0.173,0.066,0.147,0.064,0.027,0.182\\}$ and $\\{0.42,0.163,0.117,0.016,0.006,0.006,0.239\\}$.", - "Output Answer": [ - "$0.61$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.11, 0.173, 0.066, 0.147, 0.064, 0.027, 0.182\ndistribution2 = 0.42, 0.163, 0.117, 0.016, 0.006, 0.006, 0.239\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -5, -2, 9, 9, -6}$.\n", - "Output Answer": [ - "$-\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -5, -2, 9, 9, -6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 9, -8, -\\frac{33}{4}, \\frac{13}{e}, 5, -\\frac{22}{5}, -\\frac{17}{e}, 7, \\frac{23}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{13}{e}-\\frac{22}{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 9, -8, -(33/4), (13/math.e), 5, -(22/5), -(17/math.e), 7, (23/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{5}{2}, -\\frac{11}{5}, -\\frac{17}{2}, -\\log (2), \\frac{17}{\\pi }, -\\frac{59}{7}, 0}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, -\\frac{59}{7}, -\\frac{5}{2}, -\\frac{11}{5}, -\\log (2), 0, \\frac{17}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/2), -(11/5), -(17/2), -math.log(2), (17/math.pi), -(59/7), 0\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 1, 12}$.\n", - "Output Answer": [ - "$\\frac{396}{155}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 1, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.3 x-6.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-6.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-0.3*x-6.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -2, 1, 9, -2, -2, 5, 5, 1, -2, -2, -9, 9, 1, 1, 1, 5, -2, -9, -2, 5, -2, 9, 5, 5, -9, 1, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -2, 1, 9, -2, -2, 5, 5, 1, -2, -2, -9, 9, 1, 1, 1, 5, -2, -9, -2, 5, -2, 9, 5, 5, -9, 1, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 10, -7}$.\n", - "Output Answer": [ - "$\\frac{223}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 10, -7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 5, 4, 12}$.\n", - "Output Answer": [ - "$\\frac{840}{127}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 5, 4, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{34}{5}, -1, \\frac{1}{e}, -9, \\frac{2}{e}, -10}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{1}{e}-1\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (34/5), -1, (1/math.e), -9, (2/math.e), -10\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -9, -7, -7, 9, 7, -4, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -9, -7, -7, 9, 7, -4, -4*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -4 e, 4.51, -4 \\sqrt{5}, 5 \\sqrt{2}, 3, -6 \\log (2), -6} \\cup {-4, 10, -6 \\log (2), -7 \\sqrt{2}, 4, -3 e, 4.51, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 e, -7 \\sqrt{2}, -4 \\sqrt{5}, -3 e, -6, -6 \\log (2), -4, 3, 4, 4.51, 5, 5 \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -4*math.e, 4.51, -4*math.sqrt(5), 5*math.sqrt(2), 3, -6*math.log(2), -6,))\nsnd = set((-4, 10, -6*math.log(2), -7*math.sqrt(2), 4, -3*math.e, 4.51, -4*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, -\\frac{1}{\\sqrt{\\pi }}, 3, \\sqrt{2}, 4, \\frac{13}{\\sqrt{2}}, -6, 2.4} \\setminus {-\\frac{1}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, -6, e}$.\n", - "Output Answer": [ - "${0, \\sqrt{2}, 2.4, 3, 4, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -(1/(math.sqrt(math.pi))), 3, math.sqrt(2), 4, (13/(math.sqrt(2))), -6, 2.4,))\nsnd = set((-(1/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), -6, math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${10, 2, -4, 15}$.\n", - "Output Answer": [ - "$\\frac{851}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 2, -4, 15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\pi, -1, -\\sqrt{2}, 0} \\setminus {0, -8.214, -1, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-2 \\pi, -\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, -1, -math.sqrt(2), 0,))\nsnd = set((0, -8.214, -1, 4*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 5, 9, 7, 0, 4, 10, -5, 9, -5, 4, 5, 5, 5, 8, -5, 10, 10, 5, 10, 8, 5, 5, 10, 10, 5, -5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 5, 9, 7, 0, 4, 10, -5, 9, -5, 4, 5, 5, 5, 8, -5, 10, 10, 5, 10, 8, 5, 5, 10, 10, 5, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, -12, -14, -5}$.\n", - "Output Answer": [ - "$\\frac{187}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -12, -14, -5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.067,0.114,0.125,0.03,0.244,0.077,0.005,0.184,0.062\\}$ and $\\{0.143,0.053,0.094,0.137,0.089,0.093,0.117,0.164,0.069\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.067, 0.114, 0.125, 0.03, 0.244, 0.077, 0.005, 0.184, 0.062\ndistribution2 = 0.143, 0.053, 0.094, 0.137, 0.089, 0.093, 0.117, 0.164, 0.069\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2, -\\frac{17}{2}}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, 2}$" - ], - "Output Program": [ - "values = 2, -(17/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.083,0.425,0.072,0.056,0.012,0.161,0.139\\}$ and $\\{0.013,0.114,0.144,0.038,0.083,0.355,0.158\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.083, 0.425, 0.072, 0.056, 0.012, 0.161, 0.139\ndistribution2 = 0.013, 0.114, 0.144, 0.038, 0.083, 0.355, 0.158\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -6, 9, 0, \\frac{1}{3}, 8, 1} \\cup {-6, \\frac{1}{3}, 2 \\pi, -1, -9, -2, 1, 6, 10, 0}$.\n", - "Output Answer": [ - "${-9, -6, -2, -1, 0, \\frac{1}{3}, 1, 6, 2 \\pi, 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -6, 9, 0, (1/3), 8, 1,))\nsnd = set((-6, (1/3), 2*math.pi, -1, -9, -2, 1, 6, 10, 0,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, \\frac{16}{3}, -3, -\\frac{22}{e}, 10, 9, -9, -2, -4, \\frac{46}{7}, -\\frac{6}{5}}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -3, (16/3), -3, -(22/math.e), 10, 9, -9, -2, -4, (46/7), -(6/5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9 \\log (2), -4 \\log (2), 9 \\log (2), -5 \\log (2), -9 \\log (2), 9 \\log (2), 9 \\log (2), 9 \\log (2), 10 \\log (2), -4 \\log (2), -5 \\log (2), 9 \\log (2), -4 \\log (2), 9 \\log (2), 9 \\log (2), 9 \\log (2), -5 \\log (2), -4 \\log (2), 9 \\log (2), 9 \\log (2), 9 \\log (2), -4 \\log (2)}$.\n", - "Output Answer": [ - "$\\{9 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 9*math.log(2), -4*math.log(2), 9*math.log(2), -5*math.log(2), -9*math.log(2), 9*math.log(2), 9*math.log(2), 9*math.log(2), 10*math.log(2), -4*math.log(2), -5*math.log(2), 9*math.log(2), -4*math.log(2), 9*math.log(2), 9*math.log(2), 9*math.log(2), -5*math.log(2), -4*math.log(2), 9*math.log(2), 9*math.log(2), 9*math.log(2), -4*math.log(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{21}{5}, 4 \\sqrt{5}, 4, -4} \\setminus {\\frac{29}{7}, -5, -4 \\sqrt{5}, 4, \\frac{26}{5}, -4, 9, -2 \\pi, -\\frac{46}{7}, 0}$.\n", - "Output Answer": [ - "${-\\frac{21}{5}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(21/5), 4*math.sqrt(5), 4, -4,))\nsnd = set(((29/7), -5, -4*math.sqrt(5), 4, (26/5), -4, 9, -2*math.pi, -(46/7), 0,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -9, 8, -5, -9, 3, -9, -5, -7, 8, -7, -5, -9, -8, -9, 8, -8, -5, -9, -9, -5}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -9, 8, -5, -9, 3, -9, -5, -7, 8, -7, -5, -9, -8, -9, 8, -8, -5, -9, -9, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{16}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, 0, \\frac{16}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{53}{8 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (16/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), 0, (16/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -1, -10, -\\frac{7}{e}} \\cup {-10, -1, 3, -\\frac{7}{e}}$.\n", - "Output Answer": [ - "${-10, -\\frac{7}{e}, -1, 3, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -1, -10, -(7/math.e),))\nsnd = set((-10, -1, 3, -(7/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 6, 5, 12, -9, 12}$.\n", - "Output Answer": [ - "$7 \\sqrt{\\frac{22}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 6, 5, 12, -9, 12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x-1.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$-1.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(3.4*x-1.4))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9, \\frac{3}{e}, -\\frac{16}{e}, 0, 7, 2, -8} \\setminus {1, 9, -9, 7, -\\frac{7}{e}}$.\n", - "Output Answer": [ - "${-8, -\\frac{16}{e}, 0, \\frac{3}{e}, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, (3/math.e), -(16/math.e), 0, 7, 2, -8,))\nsnd = set((1, 9, -9, 7, -(7/math.e),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 262144, 16807, 10000, 6561, 25}$.\n", - "Output Answer": [ - "$120\\ 2^{2/3} 7^{5/6} \\sqrt[3]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 262144, 16807, 10000, 6561, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\log (2), -2, 2.512, -\\frac{3}{e}, 1} \\setminus {\\frac{21}{e}, -3 \\sqrt{5}, 9, \\frac{39}{7}, -\\frac{8}{\\sqrt{5}}, -\\frac{24}{5}}$.\n", - "Output Answer": [ - "${-2, -2 \\log (2), -\\frac{3}{e}, 1, 2.512}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.log(2), -2, 2.512, -(3/math.e), 1,))\nsnd = set(((21/math.e), -3*math.sqrt(5), 9, (39/7), -(8/(math.sqrt(5))), -(24/5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x-3.1$ where $x \\sim $ \\text{BetaDistribution}[0.8,1.]\n", - "Output Answer": [ - "$-1.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 1.)\nprint(E(3.6*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{19}{e}, 2 \\sqrt{2}, 3, 0, -10, -2, \\frac{15}{\\sqrt{\\pi }}, -10, 0, -8, 0, 3 \\sqrt{2}, 4 \\log (2), 0}$.\n", - "Output Answer": [ - "$10+\\frac{15}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/math.e), 2*math.sqrt(2), 3, 0, -10, -2, (15/(math.sqrt(math.pi))), -10, 0, -8, 0, 3*math.sqrt(2), 4*math.log(2), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${6, 4, 2 \\pi, \\frac{13}{\\sqrt{2}}, -6, \\frac{34}{7}, 1, -4, -\\frac{7}{\\sqrt{5}}, -5, -7, -4 \\sqrt{5}, \\frac{16}{3}}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 4, 2*math.pi, (13/(math.sqrt(2))), -6, (34/7), 1, -4, -(7/(math.sqrt(5))), -5, -7, -4*math.sqrt(5), (16/3)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, \\frac{27}{4}, -2, -3 \\sqrt{5}, -8, \\frac{1}{2}, -3, 0, 9, -\\sqrt{5}, 4, -1, \\pi}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, (27/4), -2, -3*math.sqrt(5), -8, (1/2), -3, 0, 9, -math.sqrt(5), 4, -1, math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 \\sqrt{2}, 6 \\sqrt{2}, 6 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, -4 \\sqrt{2}, 6 \\sqrt{2}, -4 \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{2}, -\\sqrt{2}, 6 \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{2}, -4 \\sqrt{2}, 6 \\sqrt{2}, 6 \\sqrt{2}, -\\sqrt{2}, 4 \\sqrt{2}, 6 \\sqrt{2}, -\\sqrt{2}, -4 \\sqrt{2}, -\\sqrt{2}, 4 \\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{6 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.sqrt(2), 6*math.sqrt(2), 6*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), -4*math.sqrt(2), 6*math.sqrt(2), -4*math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(2), -math.sqrt(2), 6*math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(2), -4*math.sqrt(2), 6*math.sqrt(2), 6*math.sqrt(2), -math.sqrt(2), 4*math.sqrt(2), 6*math.sqrt(2), -math.sqrt(2), -4*math.sqrt(2), -math.sqrt(2), 4*math.sqrt(2), 5*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -\\frac{60}{7}, \\frac{16}{5}, 4, -\\frac{7}{2}, \\frac{9}{e}, 9, -5, -3, -\\frac{8}{\\pi }, -6}$.\n", - "Output Answer": [ - "$\\frac{123}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(60/7), (16/5), 4, -(7/2), (9/math.e), 9, -5, -3, -(8/math.pi), -6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x^3-4.7 x^2-3.8 x+4.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$1.12$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(3.4*x**3-4.7*x**2-3.8*x+4.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{3}, 6, -3 \\sqrt{5}, 4, -9, -3, -7, -\\frac{29}{4}, 0}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(3), 6, -3*math.sqrt(5), 4, -9, -3, -7, -(29/4), 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 512, 25, 81}$.\n", - "Output Answer": [ - "$12 \\sqrt[4]{2} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 512, 25, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.199,0.048,0.215,0.117,0.059\\}$ and $\\{0.324,0.228,0.073,0.055,0.123\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.199, 0.048, 0.215, 0.117, 0.059\ndistribution2 = 0.324, 0.228, 0.073, 0.055, 0.123\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -9}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-5.41 < 2.8 x+2.2 < -4.83$ where $x \\sim $ \\text{NormalDistribution}[-0.1,2.7].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.1, 2.7)\nprint(P((-5.41 < 2.8*x+2.2) & (2.8*x+2.2 < -4.83)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.039,0.289,0.265,0.23\\}$ and $\\{0.276,0.197,0.21,0.137\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.039, 0.289, 0.265, 0.23\ndistribution2 = 0.276, 0.197, 0.21, 0.137\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.035,0.237,0.077,0.252,0.067,0.064,0.054\\}$ and $\\{0.079,0.299,0.094,0.076,0.232,0.044,0.136\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.035, 0.237, 0.077, 0.252, 0.067, 0.064, 0.054\ndistribution2 = 0.079, 0.299, 0.094, 0.076, 0.232, 0.044, 0.136\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 6, -2, -4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{59}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 6, -2, -4\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.1 x^3+2.6 x^2-1.5 x+0.6$ where $x \\sim $ \\text{BetaDistribution}[1.,1.5]\n", - "Output Answer": [ - "$0.61$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 1.5)\nprint(E(0.1*x**3+2.6*x**2-1.5*x+0.6))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -\\frac{33}{7}, \\frac{33}{7}, \\frac{43}{7}, -\\frac{25}{7}, \\frac{25}{7}}$.\n", - "Output Answer": [ - "$\\frac{11}{21}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -(33/7), (33/7), (43/7), -(25/7), (25/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${10, -8, 9, -7, \\frac{20}{\\pi }} \\setminus {\\frac{20}{\\pi }, 1, \\pi, \\frac{25}{4}, -8, -5, -5.8}$.\n", - "Output Answer": [ - "${-7, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, -8, 9, -7, (20/math.pi),))\nsnd = set(((20/math.pi), 1, math.pi, (25/4), -8, -5, -5.8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -\\frac{11}{2}, \\frac{13}{3}, -8, -3, -7, -e, -9, 5, -\\frac{11}{\\pi }, -3, \\frac{3}{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-3-\\frac{11}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, -(11/2), (13/3), -8, -3, -7, -math.e, -9, 5, -(11/math.pi), -3, (3/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, 6, -8}$.\n", - "Output Answer": [ - "$2 \\sqrt[3]{42}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 6, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, 2, -9, -11}$.\n", - "Output Answer": [ - "$\\frac{395}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 2, -9, -11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, -8.4, \\frac{11}{3}, -8, 5, \\frac{5}{\\sqrt{2}}} \\cup {-8.4, 3, \\frac{2}{3}, 4, -4, 5, \\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-8.4, -8, -4, \\frac{2}{3}, 3, \\frac{5}{\\sqrt{2}}, \\frac{11}{3}, 4, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -8.4, (11/3), -8, 5, (5/(math.sqrt(2))),))\nsnd = set((-8.4, 3, (2/3), 4, -4, 5, (5/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-10 \\log (2), 9.1, \\sqrt{5}, 5} \\cup {-10 \\log (2), 9.1, 5, \\sqrt{5}, \\frac{2}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-10 \\log (2), \\frac{2}{\\sqrt{3}}, \\sqrt{5}, 5, 9.1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10*math.log(2), 9.1, math.sqrt(5), 5,))\nsnd = set((-10*math.log(2), 9.1, 5, math.sqrt(5), (2/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 256, 4, 1296, 16}$.\n", - "Output Answer": [ - "$24\\ 2^{3/5} \\sqrt[5]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 256, 4, 1296, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x-4.5$ where $x \\sim $ \\text{NormalDistribution}[-1.,2.6]\n", - "Output Answer": [ - "$-7.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1., 2.6)\nprint(E(3.1*x-4.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${4, -5 \\sqrt{3}, -7, 7, -\\frac{5}{4}, 7, -4, -7, -4, 5, 0, 3 \\sqrt{5}, -10, -6}$.", - "Output Answer": [ - "$-\\frac{21}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -5*math.sqrt(3), -7, 7, -(5/4), 7, -4, -7, -4, 5, 0, 3*math.sqrt(5), -10, -6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{48}{5}, -\\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{48}{5}, -\\frac{1}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(48/5), -(1/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3. x^2+0.3 x+4.3$ where $x \\sim $ \\text{PoissonDistribution}[3.9]\n", - "Output Answer": [ - "$62.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.9)\nprint(E(3.*x**2+0.3*x+4.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 6561, 9, 4096}$.\n", - "Output Answer": [ - "$72 \\sqrt{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 6561, 9, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\sqrt{5}, -\\frac{17}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{5}}, \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(5), -(17/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{5}, 8}$.\n", - "Output Answer": [ - "$8+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), 8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, 3, 5, 2, \\frac{43}{5}, 8, \\frac{17}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, 3, 5, 2, (43/5), 8, (17/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{5}, 4, -4, -5, 3, -6}$.\n", - "Output Answer": [ - "${-6, -5, -4, 3, 4, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(5), 4, -4, -5, 3, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{7}{\\pi }, \\frac{19}{\\pi }, -\\frac{7}{\\pi }, -\\frac{23}{\\pi }, \\frac{14}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{2}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (7/math.pi), (19/math.pi), -(7/math.pi), -(23/math.pi), (14/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.2 x^2-2. x-0.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.2]\n", - "Output Answer": [ - "$-5.12$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(E(-2.2*x**2-2.*x-0.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 2, -10, 2, -6, -6, -6, 2, 2, -10, -6, 0, 0, 9, -6, -10, -10, 0, 9, -10, -6, -6, 9, 0, -6}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 2, -10, 2, -6, -6, -6, 2, 2, -10, -6, 0, 0, 9, -6, -10, -10, 0, 9, -10, -6, -6, 9, 0, -6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{2}, 9, 1, \\frac{5}{2}, 3}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(1/2), 9, 1, (5/2), 3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -1, -\\frac{3}{\\pi }, -4} \\cup {-1, -\\frac{3}{\\pi }, 3, 9}$.\n", - "Output Answer": [ - "${-4, -1, -\\frac{3}{\\pi }, 3, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -1, -(3/math.pi), -4,))\nsnd = set((-1, -(3/math.pi), 3, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.057,0.23,0.195,0.156,0.033\\}$ and $\\{0.081,0.146,0.231,0.19,0.189\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.057, 0.23, 0.195, 0.156, 0.033\ndistribution2 = 0.081, 0.146, 0.231, 0.19, 0.189\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, -4, -2 \\sqrt{3}, 8.92, \\frac{11}{3}, -8, 3 \\sqrt{3}} \\cup {-2 \\sqrt{3}, 4, \\frac{11}{3}, 3 \\sqrt{3}, -8, 0, 8.92}$.\n", - "Output Answer": [ - "${-8, -4, -2 \\sqrt{3}, 0, \\frac{11}{3}, 4, 3 \\sqrt{3}, 8.92}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -4, -2*math.sqrt(3), 8.92, (11/3), -8, 3*math.sqrt(3),))\nsnd = set((-2*math.sqrt(3), 4, (11/3), 3*math.sqrt(3), -8, 0, 8.92,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, -1000, -125, 5}$.\n", - "Output Answer": [ - "$(50+50 i) \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, -1000, -125, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{5}{\\sqrt{\\pi }}, -\\frac{41}{5}, 6}$.\n", - "Output Answer": [ - "${-\\frac{41}{5}, \\frac{5}{\\sqrt{\\pi }}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/(math.sqrt(math.pi))), -(41/5), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, \\frac{1}{2}, \\frac{31}{4}, 6, -\\frac{17}{e}, -\\frac{16}{\\sqrt{\\pi }}, e, 0, e, -\\frac{16}{e}, 6 \\log (2), 1, -13 \\log (2), 0}$.\n", - "Output Answer": [ - "$10+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, (1/2), (31/4), 6, -(17/math.e), -(16/(math.sqrt(math.pi))), math.e, 0, math.e, -(16/math.e), 6*math.log(2), 1, -13*math.log(2), 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.089,0.114,0.003,0.095,0.032,0.083,0.279,0.042,0.009\\}$ and $\\{0.057,0.147,0.177,0.11,0.058,0.168,0.059,0.109,0.034\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.089, 0.114, 0.003, 0.095, 0.032, 0.083, 0.279, 0.042, 0.009\ndistribution2 = 0.057, 0.147, 0.177, 0.11, 0.058, 0.168, 0.059, 0.109, 0.034\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.007,0.17,0.042,0.018,0.057,0.239,0.078,0.002,0.06,0.093\\}$ and $\\{0.128,0.051,0.051,0.03,0.037,0.128,0.143,0.072,0.195,0.127\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.007, 0.17, 0.042, 0.018, 0.057, 0.239, 0.078, 0.002, 0.06, 0.093\ndistribution2 = 0.128, 0.051, 0.051, 0.03, 0.037, 0.128, 0.143, 0.072, 0.195, 0.127\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -2, 0, -8, -4 \\sqrt{2}, -7 \\sqrt{2}, 0, -6, 2, \\frac{4}{\\sqrt{5}}, -6, -9, -8, -1}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-5-4 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, -2, 0, -8, -4*math.sqrt(2), -7*math.sqrt(2), 0, -6, 2, (4/(math.sqrt(5))), -6, -9, -8, -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{3}{4}, 3, 4, -8, 2 \\pi, -\\frac{3}{2}, -6, \\sqrt{2}} \\cup {\\frac{3}{4}, 2 \\pi, -6, \\frac{9}{\\sqrt{2}}, 4, -\\frac{3}{2}, -5, 2}$.\n", - "Output Answer": [ - "${-8, -6, -5, -\\frac{3}{2}, \\frac{3}{4}, \\sqrt{2}, 2, 3, 4, 2 \\pi, \\frac{9}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((3/4), 3, 4, -8, 2*math.pi, -(3/2), -6, math.sqrt(2),))\nsnd = set(((3/4), 2*math.pi, -6, (9/(math.sqrt(2))), 4, -(3/2), -5, 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{17}{7}, \\frac{54}{7}, \\frac{45}{7}, -9}$.\n", - "Output Answer": [ - "$\\frac{19}{28}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(17/7), (54/7), (45/7), -9\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, -15, 5, 1, -12, 15}$.\n", - "Output Answer": [ - "$\\frac{4421}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -15, 5, 1, -12, 15\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{19}{2}, -4, -5, -10, \\frac{15}{\\sqrt{\\pi }}, 6, 3, 4, 6, -\\frac{23}{7}}$.\n", - "Output Answer": [ - "$10+\\frac{15}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/2), -4, -5, -10, (15/(math.sqrt(math.pi))), 6, 3, 4, 6, -(23/7)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.45,0.06,0.285\\}$ and $\\{0.264,0.229,0.397\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.45, 0.06, 0.285\ndistribution2 = 0.264, 0.229, 0.397\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2 e, 8 \\log (2), 7, 2 \\pi, \\frac{4}{\\sqrt{\\pi }}, 5}$.\n", - "Output Answer": [ - "${-2 e, \\frac{4}{\\sqrt{\\pi }}, 5, 8 \\log (2), 2 \\pi, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.e, 8*math.log(2), 7, 2*math.pi, (4/(math.sqrt(math.pi))), 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{21}{\\sqrt{5}}, \\frac{12}{\\sqrt{\\pi }}, 0, 1, -6 \\sqrt{2}, -7, 4 \\sqrt{5}} \\setminus {5, -7, 1}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, 0, \\frac{12}{\\sqrt{\\pi }}, 4 \\sqrt{5}, \\frac{21}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((21/(math.sqrt(5))), (12/(math.sqrt(math.pi))), 0, 1, -6*math.sqrt(2), -7, 4*math.sqrt(5),))\nsnd = set((5, -7, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 36, 343}$.\n", - "Output Answer": [ - "$14 \\sqrt[3]{2} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 36, 343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{5}{2}, 0, -4, -6, -0.958, e} \\setminus {-\\frac{5}{2}, e, -6, 3.083, 0, -4, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-0.958}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(5/2), 0, -4, -6, -0.958, math.e,))\nsnd = set((-(5/2), math.e, -6, 3.083, 0, -4, 4*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4 \\sqrt{5}, 0, 2 \\sqrt{5}, -\\sqrt{5}} \\cap {\\sqrt{5}, -\\sqrt{5}, 3 \\sqrt{5}, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), 0, 2*math.sqrt(5), -math.sqrt(5),))\nsnd = set((math.sqrt(5), -math.sqrt(5), 3*math.sqrt(5), -4*math.sqrt(5),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -\\sqrt{2}, -5, \\frac{28}{3}, 5, -5, 4 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{43}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -math.sqrt(2), -5, (28/3), 5, -5, 4*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, -16807, 81, -9, 15625, 64}$.\n", - "Output Answer": [ - "$30 \\sqrt{5} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, -16807, 81, -9, 15625, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $2.15 < -4.2 x^2-0.7 x+3.5 < 8.32$ where $x \\sim $ \\text{ExponentialDistribution}[0.5].", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.5)\nprint(P((2.15 < -4.2*x**2-0.7*x+3.5) & (-4.2*x**2-0.7*x+3.5 < 8.32)))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, -7, -2 \\sqrt{3}, -\\frac{1}{2}, \\frac{6}{5}, -1, -0.8} \\setminus {-2 \\sqrt{3}, \\frac{34}{5}, -7, -0.8, -1, -5, 1}$.\n", - "Output Answer": [ - "${-\\frac{1}{2}, \\frac{6}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -7, -2*math.sqrt(3), -(1/2), (6/5), -1, -0.8,))\nsnd = set((-2*math.sqrt(3), (34/5), -7, -0.8, -1, -5, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{6}{\\pi }, 6, 3 e, -7, -\\frac{21}{\\sqrt{5}}, -2, 0} \\setminus {3 e, \\sqrt{5}, -\\frac{6}{\\pi }, \\frac{11}{\\sqrt{3}}, -7, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{21}{\\sqrt{5}}, -2, 0, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(6/math.pi), 6, 3*math.e, -7, -(21/(math.sqrt(5))), -2, 0,))\nsnd = set((3*math.e, math.sqrt(5), -(6/math.pi), (11/(math.sqrt(3))), -7, 10*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, -5, -9, 7}$.\n", - "Output Answer": [ - "$\\frac{235}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -5, -9, 7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{42}{5}, 1, 2 \\log (2), 3, \\pi, -\\frac{43}{5}, \\frac{9}{\\sqrt{2}}, -10, \\frac{6}{\\sqrt{5}}, -9}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{6}{\\sqrt{5}}+2 \\log (2)\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (42/5), 1, 2*math.log(2), 3, math.pi, -(43/5), (9/(math.sqrt(2))), -10, (6/(math.sqrt(5))), -9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, -7, -9, -10, 5}$.\n", - "Output Answer": [ - "$\\frac{383}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, -7, -9, -10, 5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.092,0.136,0.175,0.032,0.07,0.094,0.013,0.081,0.121,0.035\\}$ and $\\{0.032,0.186,0.067,0.177,0.036,0.083,0.12,0.077,0.077,0.084\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.092, 0.136, 0.175, 0.032, 0.07, 0.094, 0.013, 0.081, 0.121, 0.035\ndistribution2 = 0.032, 0.186, 0.067, 0.177, 0.036, 0.083, 0.12, 0.077, 0.077, 0.084\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, -5, 2, -3, -7, 4, -8} \\cap {7, -7, 2, -5, -2, -4, 1}$.\n", - "Output Answer": [ - "${-7, -5, 2}$" - ], - "Output Program": [ - "fst = set((-9, -5, 2, -3, -7, 4, -8,))\nsnd = set((7, -7, 2, -5, -2, -4, 1,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x-2.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$-2.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(-1.1*x-2.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.5 x-1.3$ where $x \\sim $ \\text{NormalDistribution}[1.5,1.5]\n", - "Output Answer": [ - "$-3.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.5, 1.5)\nprint(E(-1.5*x-1.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.19,0.174,0.052,0.39\\}$ and $\\{0.217,0.056,0.177,0.216\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.19, 0.174, 0.052, 0.39\ndistribution2 = 0.217, 0.056, 0.177, 0.216\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 11, 8}$.\n", - "Output Answer": [ - "$\\frac{1496}{137}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 11, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, 7, -4, \\sqrt{5}, \\frac{13}{e}}$.\n", - "Output Answer": [ - "${-4, \\sqrt{5}, 4, \\frac{13}{e}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 7, -4, math.sqrt(5), (13/math.e)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, 1, 2, 1, -4, 2, -1, -4, -1, 2, -4, -4, 1, -4, 1, -1, 1, 1, -4, 2, 8, 2, -4, -4, 8, -4, -4, 1, -4, -1}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, 1, 2, 1, -4, 2, -1, -4, -1, 2, -4, -4, 1, -4, 1, -1, 1, 1, -4, 2, 8, 2, -4, -4, 8, -4, -4, 1, -4, -1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, -7, -5.91, 11 \\log (2)}$.\n", - "Output Answer": [ - "${-7, -5.91, 1, 11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -7, -5.91, 11*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, 4, 9}$.\n", - "Output Answer": [ - "$6 \\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 4, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-1.62 < 2.7 x^2+2.4 x-2.4 < -0.8$ where $x \\sim $ \\text{NormalDistribution}[-1.2,2.9].", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.2, 2.9)\nprint(P((-1.62 < 2.7*x**2+2.4*x-2.4) & (2.7*x**2+2.4*x-2.4 < -0.8)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, -11, 2, -11, -3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{313}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -11, 2, -11, -3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${1, -0.41, 0, -3} \\setminus {2, 5, -9, -0.41, -2}$.\n", - "Output Answer": [ - "${-3, 0, 1}$" - ], - "Output Program": [ - "fst = set((1, -0.41, 0, -3,))\nsnd = set((2, 5, -9, -0.41, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, 5 \\sqrt{2}, 7, -4, 7.}$.\n", - "Output Answer": [ - "${-4, -4, 7., 7, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 5*math.sqrt(2), 7, -4, 7.\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 3}$.\n", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 9, 8, 7}$.\n", - "Output Answer": [ - "$\\frac{2016}{695}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 9, 8, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $1.02 < 2.7 x+0. < 1.35$ where $x \\sim $ \\text{ExponentialDistribution}[0.7].", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.7)\nprint(P((1.02 < 2.7*x+0.) & (2.7*x+0. < 1.35)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${0, 2, 5, -6}$.\n", - "Output Answer": [ - "${-6, 0, 2, 5}$" - ], - "Output Program": [ - "values = 0, 2, 5, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 8, 11, 5}$.\n", - "Output Answer": [ - "$\\frac{1760}{271}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 8, 11, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 1, 8} \\setminus {9, 1}$.\n", - "Output Answer": [ - "${-9, 8}$" - ], - "Output Program": [ - "fst = set((-9, 1, 8,))\nsnd = set((9, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${10, \\frac{3}{2}, \\frac{11}{4}, -\\frac{7}{\\sqrt{2}}, 6, -7, -11 \\log (2), -\\frac{7}{3}, 0, -\\frac{37}{4}, 3, -\\frac{12}{\\sqrt{\\pi }}, 10, -\\frac{10}{\\sqrt{3}}}$.", - "Output Answer": [ - "$-\\frac{7}{6}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 10, (3/2), (11/4), -(7/(math.sqrt(2))), 6, -7, -11*math.log(2), -(7/3), 0, -(37/4), 3, -(12/(math.sqrt(math.pi))), 10, -(10/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, 8, 2, -5, 2, 8, 2, 8, -5, 2, 8, 8, 2, -5, 8, 8, 8, -5, 2, 8, 2, -5, 8, 2, 2, -5}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, 8, 2, -5, 2, 8, 2, 8, -5, 2, 8, 8, 2, -5, 8, 8, 8, -5, 2, 8, 2, -5, 8, 2, 2, -5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${4, -\\frac{23}{e}, 3, 6.9, 10, 5}$.\n", - "Output Answer": [ - "${-\\frac{23}{e}, 3, 4, 5, 6.9, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -(23/math.e), 3, 6.9, 10, 5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, 9, 5}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, 9, 5\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{8}{3}, 8, -4 e, -\\frac{25}{3}, 1, -3, \\frac{1}{e}, 4, \\frac{7}{2}}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (8/3), 8, -4*math.e, -(25/3), 1, -3, (1/math.e), 4, (7/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5.75, -\\frac{12}{7}, -3 \\sqrt{3}, 8, 1, -4, -\\frac{3}{\\sqrt{2}}, 0, -\\frac{7}{2}} \\cup {5, -\\frac{12}{7}, 0, -3 \\sqrt{3}, 1, -9.18, -9, -6}$.\n", - "Output Answer": [ - "${-9.18, -9, -6, -3 \\sqrt{3}, -4, -\\frac{7}{2}, -\\frac{3}{\\sqrt{2}}, -\\frac{12}{7}, 0, 1, 5, 5.75, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.75, -(12/7), -3*math.sqrt(3), 8, 1, -4, -(3/(math.sqrt(2))), 0, -(7/2),))\nsnd = set((5, -(12/7), 0, -3*math.sqrt(3), 1, -9.18, -9, -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 2, -5, -9, 6, 0}$.\n", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 2, -5, -9, 6, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{25}{2}, 14, \\frac{25}{2}, \\frac{37}{2}}$.\n", - "Output Answer": [ - "$\\frac{51800}{3697}$" - ], - "Output Program": [ - "import statistics\nvalues = (25/2), 14, (25/2), (37/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$7+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 6*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{5}, -\\frac{8}{3}, -\\frac{46}{7}, -\\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{8}{3}-\\pi \\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(5), -(8/3), -(46/7), -math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -7, \\frac{6}{\\sqrt{\\pi }}, 1, 3, \\frac{6}{\\pi }, -11 \\log (2), -\\frac{3}{\\sqrt{\\pi }}, 0, -1, -\\frac{28}{3}, -4}$.\n", - "Output Answer": [ - "$\\frac{43}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -7, (6/(math.sqrt(math.pi))), 1, 3, (6/math.pi), -11*math.log(2), -(3/(math.sqrt(math.pi))), 0, -1, -(28/3), -4\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3, -2, \\frac{13}{\\sqrt{5}}, -7, 1}$.\n", - "Output Answer": [ - "${-7, -2, 1, 3, \\frac{13}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -2, (13/(math.sqrt(5))), -7, 1\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\sqrt{3}, -2 \\sqrt{3}, -3 \\sqrt{3}, -3 \\sqrt{3}, -\\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}, 5 \\sqrt{3}, -2 \\sqrt{3}, -3 \\sqrt{3}, 5 \\sqrt{3}, -3 \\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, 4 \\sqrt{3}, 0, -3 \\sqrt{3}, 0, 4 \\sqrt{3}, 5 \\sqrt{3}, -2 \\sqrt{3}, 5 \\sqrt{3}, -2 \\sqrt{3}, -3 \\sqrt{3}, -2 \\sqrt{3}, 0, 4 \\sqrt{3}, -\\sqrt{3}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-2 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.sqrt(3), -2*math.sqrt(3), -3*math.sqrt(3), -3*math.sqrt(3), -math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3), 5*math.sqrt(3), -2*math.sqrt(3), -3*math.sqrt(3), 5*math.sqrt(3), -3*math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), 4*math.sqrt(3), 0, -3*math.sqrt(3), 0, 4*math.sqrt(3), 5*math.sqrt(3), -2*math.sqrt(3), 5*math.sqrt(3), -2*math.sqrt(3), -3*math.sqrt(3), -2*math.sqrt(3), 0, 4*math.sqrt(3), -math.sqrt(3), -2*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, -7, -8, -\\frac{11}{3}, 8} \\setminus {8, 10, -7., -10}$.\n", - "Output Answer": [ - "${-8, -7, -\\frac{11}{3}, 5}$" - ], - "Output Program": [ - "fst = set((5, -7, -8, -(11/3), 8,))\nsnd = set((8, 10, -7., -10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, 6, -9, -\\frac{21}{e}, -10, -4 \\sqrt{5}, 3 \\sqrt{5}, -3 \\sqrt{2}, -\\frac{19}{2}} \\cup {\\frac{24}{e}, 0, 9, 3 \\sqrt{5}, -\\sqrt{2}, 5, -9, 2 e}$.\n", - "Output Answer": [ - "${-10, -\\frac{19}{2}, -9, -4 \\sqrt{5}, -\\frac{21}{e}, -3 \\sqrt{2}, -\\sqrt{2}, 0, 5, 2 e, 6, 3 \\sqrt{5}, \\frac{24}{e}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 6, -9, -(21/math.e), -10, -4*math.sqrt(5), 3*math.sqrt(5), -3*math.sqrt(2), -(19/2),))\nsnd = set(((24/math.e), 0, 9, 3*math.sqrt(5), -math.sqrt(2), 5, -9, 2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, -7, 9, -512, 32, 25}$.\n", - "Output Answer": [ - "$4\\ 7^{5/6} \\sqrt[3]{30}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, -7, 9, -512, 32, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8 \\log (2), -\\frac{35}{4}, -3, -4, -5 \\log (2)} \\cup {4, -8 \\log (2), \\frac{21}{4}, -4, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{35}{4}, -8 \\log (2), -4, -5 \\log (2), -3, 4, \\frac{21}{4}, 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8*math.log(2), -(35/4), -3, -4, -5*math.log(2),))\nsnd = set((4, -8*math.log(2), (21/4), -4, 10*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.03,0.039,0.136,0.053,0.221,0.061,0.02,0.15,0.092\\}$ and $\\{0.101,0.051,0.063,0.093,0.088,0.085,0.11,0.134,0.168\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.03, 0.039, 0.136, 0.053, 0.221, 0.061, 0.02, 0.15, 0.092\ndistribution2 = 0.101, 0.051, 0.063, 0.093, 0.088, 0.085, 0.11, 0.134, 0.168\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{6}{\\sqrt{\\pi }}, -8, 2 \\pi, 3 \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{6}{\\sqrt{\\pi }}+2 \\pi \\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (6/(math.sqrt(math.pi))), -8, 2*math.pi, 3*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, -3, -512}$.\n", - "Output Answer": [ - "$24\\ 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, -3, -512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{22}{5}, 2 \\pi, -6, 1, -3 e, 3} \\cup {-6, 2 \\pi, 1, -\\frac{27}{5}, -3 e, 3}$.\n", - "Output Answer": [ - "${-3 e, -6, -\\frac{27}{5}, -\\frac{22}{5}, 1, 3, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(22/5), 2*math.pi, -6, 1, -3*math.e, 3,))\nsnd = set((-6, 2*math.pi, 1, -(27/5), -3*math.e, 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.026,0.246,0.03,0.038,0.165,0.381,0.031\\}$ and $\\{0.051,0.064,0.177,0.3,0.037,0.273,0.041\\}$.", - "Output Answer": [ - "$0.62$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.026, 0.246, 0.03, 0.038, 0.165, 0.381, 0.031\ndistribution2 = 0.051, 0.064, 0.177, 0.3, 0.037, 0.273, 0.041\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\sqrt{3}, -\\frac{15}{2}, -\\frac{5}{\\sqrt{\\pi }}, -5 \\sqrt{3}, 8, 6 \\log (2)} \\setminus {-\\frac{5}{\\sqrt{\\pi }}, 8, 7, 5}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -\\frac{15}{2}, -4 \\sqrt{3}, 6 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(3), -(15/2), -(5/(math.sqrt(math.pi))), -5*math.sqrt(3), 8, 6*math.log(2),))\nsnd = set((-(5/(math.sqrt(math.pi))), 8, 7, 5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.1 x^2+1.3 x+0.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$-15.47$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(-3.1*x**2+1.3*x+0.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, 6, -10}$.\n", - "Output Answer": [ - "$\\sqrt{91}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 6, -10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -\\frac{14}{\\sqrt{5}}, 0, -7, \\frac{17}{\\sqrt{\\pi }}, -6, -3, \\pi, -2, 6, -\\frac{2}{3}, \\frac{17}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$7+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(14/(math.sqrt(5))), 0, -7, (17/(math.sqrt(math.pi))), -6, -3, math.pi, -2, 6, -(2/3), (17/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${9, -\\frac{2}{\\pi }, -4, -\\frac{24}{\\pi }, 2, 0} \\cup {-1, -\\frac{24}{\\pi }, 0, 2, -\\frac{2}{\\pi }, -4}$.\n", - "Output Answer": [ - "${-\\frac{24}{\\pi }, -4, -1, -\\frac{2}{\\pi }, 0, 2, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -(2/math.pi), -4, -(24/math.pi), 2, 0,))\nsnd = set((-1, -(24/math.pi), 0, 2, -(2/math.pi), -4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x-0.8$ where $x \\sim $ \\text{NormalDistribution}[0.4,0.8]\n", - "Output Answer": [ - "$-0.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.4, 0.8)\nprint(E(0.9*x-0.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, -3, 4, 5, -2, -1, -10, 8}$.\n", - "Output Answer": [ - "$\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, -3, 4, 5, -2, -1, -10, 8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x^2+4.7 x-3.5$ where $x \\sim $ \\text{NormalDistribution}[-0.8,1.1]\n", - "Output Answer": [ - "$-5.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 1.1)\nprint(E(0.9*x**2+4.7*x-3.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{6}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{20}{3 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (6/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.173,0.262,0.204,0.087,0.042,0.179,0.039\\}$ and $\\{0.07,0.151,0.271,0.123,0.105,0.118,0.086\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.173, 0.262, 0.204, 0.087, 0.042, 0.179, 0.039\ndistribution2 = 0.07, 0.151, 0.271, 0.123, 0.105, 0.118, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 20, 4, 6}$.\n", - "Output Answer": [ - "$\\frac{165}{23}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 20, 4, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${13, -6, 2, -14, 5, 11}$.\n", - "Output Answer": [ - "$\\frac{637}{6}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -6, 2, -14, 5, 11\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -512, 25, -64}$.\n", - "Output Answer": [ - "$16\\ 2^{3/4} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -512, 25, -64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 5, -3, 6, -6, -3, -3, -3, -3, -3, 5, -3, -3, -3, -3, -3, -6, -2, -2, -3, 6, 6, 5, -2, -3, -2}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 5, -3, 6, -6, -3, -3, -3, -3, -3, 5, -3, -3, -3, -3, -3, -6, -2, -2, -3, 6, 6, 5, -2, -3, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.06,0.344,0.165\\}$ and $\\{0.493,0.203,0.194\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.06, 0.344, 0.165\ndistribution2 = 0.493, 0.203, 0.194\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, \\frac{7}{\\sqrt{3}}, -2, 9, 2, -8}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, (7/(math.sqrt(3))), -2, 9, 2, -8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{14}{\\sqrt{3}}, 2 \\pi, \\frac{22}{3}, -\\frac{9}{7}, -10, 6}$.", - "Output Answer": [ - "$\\frac{1}{2} (6+2 \\pi )$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (14/(math.sqrt(3))), 2*math.pi, (22/3), -(9/7), -10, 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3, -\\frac{22}{7}, -10, 1, -5 \\sqrt{2}, \\frac{27}{e}, -1}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -(22/7), -10, 1, -5*math.sqrt(2), (27/math.e), -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, -4, 6, 13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{149}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -4, 6, 13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 1, 2, 2, -6, 0, -3, 2, -6, 2, -6, 2, 2, 1, 0, -3, 2, 2, -6, 1, 2}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 1, 2, 2, -6, 0, -3, 2, -6, 2, -6, 2, 2, 1, 0, -3, 2, 2, -6, 1, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, -3, 6, \\frac{11}{\\sqrt{5}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(6+\\frac{11}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -3, 6, (11/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, 49, 8}$.\n", - "Output Answer": [ - "$16 \\sqrt[3]{-1} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, 49, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, 7, -4, 1, 2, 7, 9, 1, 9, 1, -4, 8, 7, 9, 1, 1, 1, -4, 2, 7, 2}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, 7, -4, 1, 2, 7, 9, 1, 9, 1, -4, 8, 7, 9, 1, 1, 1, -4, 2, 7, 2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 2, -1, 3, -5, -8} \\cup {-1, 4, 6, -8, 3, 1, 2, -5}$.\n", - "Output Answer": [ - "${-8, -5, -1, 0, 1, 2, 3, 4, 6}$" - ], - "Output Program": [ - "fst = set((0, 2, -1, 3, -5, -8,))\nsnd = set((-1, 4, 6, -8, 3, 1, 2, -5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{16}{5}, 3, 9, 6, -8.4, -7, -6, 2, 2 \\pi, -1} \\cup {3, -7, -8.4, 4, -\\frac{21}{5}, 0, -1, 9}$.\n", - "Output Answer": [ - "${-8.4, -7, -6, -\\frac{21}{5}, -\\frac{16}{5}, -1, 0, 2, 3, 4, 6, 2 \\pi, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(16/5), 3, 9, 6, -8.4, -7, -6, 2, 2*math.pi, -1,))\nsnd = set((3, -7, -8.4, 4, -(21/5), 0, -1, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-5, -2, -4.21, -5, -5, -\\frac{4}{\\sqrt{\\pi }}, -7, -9}$.\n", - "Output Answer": [ - "${-9, -7, -5, -5, -5, -4.21, -\\frac{4}{\\sqrt{\\pi }}, -2}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -2, -4.21, -5, -5, -(4/(math.sqrt(math.pi))), -7, -9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{5}{2}, 4, 6 \\log (2), -\\frac{69}{7}, -10, \\frac{24}{e}, 1, 4}$.\n", - "Output Answer": [ - "${-10, -\\frac{69}{7}, -\\frac{5}{2}, 1, 4, 4, 6 \\log (2), \\frac{24}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/2), 4, 6*math.log(2), -(69/7), -10, (24/math.e), 1, 4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -\\frac{17}{\\sqrt{3}}, 8}$.", - "Output Answer": [ - "$-7$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, -(17/(math.sqrt(3))), 8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x-1.1$ where $x \\sim $ \\text{BetaDistribution}[1.5,1.2]\n", - "Output Answer": [ - "$1.51$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 1.2)\nprint(E(4.7*x-1.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${1, 10, -\\frac{14}{3}, \\frac{15}{e}, 5, -2 \\sqrt{3}, 9, -2}$.\n", - "Output Answer": [ - "${-\\frac{14}{3}, -2 \\sqrt{3}, -2, 1, 5, \\frac{15}{e}, 9, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 10, -(14/3), (15/math.e), 5, -2*math.sqrt(3), 9, -2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-9, \\frac{26}{\\pi }, 4, -1, -9}$.\n", - "Output Answer": [ - "${-9, -9, -1, 4, \\frac{26}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, (26/math.pi), 4, -1, -9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x-3.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.7]\n", - "Output Answer": [ - "$-3.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.7)\nprint(E(2.1*x-3.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, 1, 2, 0, 8, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{19}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 1, 2, 0, 8, 0\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{22}{e}, -\\frac{14}{e}, -\\frac{23}{e}, -\\frac{18}{e}}$.\n", - "Output Answer": [ - "$-\\frac{77}{4 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(22/math.e), -(14/math.e), -(23/math.e), -(18/math.e)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{17}{\\sqrt{\\pi }}, 0, 5 \\sqrt{3}, -8, -\\frac{7}{2}, -\\sqrt{2}, 1, 9, 1, 2, -2 \\pi, -6}$.\n", - "Output Answer": [ - "$8+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (17/(math.sqrt(math.pi))), 0, 5*math.sqrt(3), -8, -(7/2), -math.sqrt(2), 1, 9, 1, 2, -2*math.pi, -6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.079,0.06,0.062,0.023,0.294,0.083,0.042,0.178,0.104\\}$ and $\\{0.101,0.133,0.088,0.013,0.137,0.085,0.148,0.16,0.091\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.079, 0.06, 0.062, 0.023, 0.294, 0.083, 0.042, 0.178, 0.104\ndistribution2 = 0.101, 0.133, 0.088, 0.013, 0.137, 0.085, 0.148, 0.16, 0.091\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{3}, \\frac{14}{3}, \\frac{16}{3}, -3, -5, -\\frac{20}{3}}$.\n", - "Output Answer": [ - "$-\\frac{5}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(1/3), (14/3), (16/3), -3, -5, -(20/3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -13, 7, -15, -6, 12}$.\n", - "Output Answer": [ - "$\\frac{1171}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -13, 7, -15, -6, 12\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5.73, 7, -\\frac{26}{5}, 2 \\sqrt{3}, -3 e, -\\frac{32}{5}, -\\frac{12}{\\pi }, -1.021} \\setminus {2 \\sqrt{3}, -\\frac{12}{\\pi }, -\\frac{26}{5}, 7, -5.73, -\\frac{32}{5}, -3.724, 2 e}$.\n", - "Output Answer": [ - "${-3 e, -1.021}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.73, 7, -(26/5), 2*math.sqrt(3), -3*math.e, -(32/5), -(12/math.pi), -1.021,))\nsnd = set((2*math.sqrt(3), -(12/math.pi), -(26/5), 7, -5.73, -(32/5), -3.724, 2*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${9, 3, 2 \\sqrt{2}, -2, 4, -1, 4, \\frac{6}{e}, 3 \\sqrt{2}, -5, -9, -\\frac{10}{\\sqrt{3}}, -7, -2 e, \\frac{3}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{3}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 3, 2*math.sqrt(2), -2, 4, -1, 4, (6/math.e), 3*math.sqrt(2), -5, -9, -(10/(math.sqrt(3))), -7, -2*math.e, (3/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x^2-0.5 x+4.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$8.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(2.6*x**2-0.5*x+4.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -\\frac{19}{\\pi }, 4, \\frac{5}{4}, \\frac{8}{\\sqrt{3}}, 6}$.\n", - "Output Answer": [ - "$6+\\frac{19}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(19/math.pi), 4, (5/4), (8/(math.sqrt(3))), 6\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, -11, 14}$.\n", - "Output Answer": [ - "$157$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -11, 14\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.179,0.105,0.039,0.294,0.195\\}$ and $\\{0.083,0.195,0.031,0.044,0.035,0.436\\}$.", - "Output Answer": [ - "$0.54$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.179, 0.105, 0.039, 0.294, 0.195\ndistribution2 = 0.083, 0.195, 0.031, 0.044, 0.035, 0.436\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${8, 5 \\sqrt{2}, -2 \\sqrt{5}, 7, 9, -3} \\cup {5 \\sqrt{2}, -7, 3, 0, 9, 4, 1}$.\n", - "Output Answer": [ - "${-7, -2 \\sqrt{5}, -3, 0, 1, 3, 4, 7, 5 \\sqrt{2}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 5*math.sqrt(2), -2*math.sqrt(5), 7, 9, -3,))\nsnd = set((5*math.sqrt(2), -7, 3, 0, 9, 4, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${4.1, 8.5, 1.7, -7., -4.8, -6.6, 5.1, -9.8, -7.8, 2., 8.2, 5.9, -9.9} \\cap {-5.7, 5.9, 1.1, 6., -9.8, -4.2, 4.1, -1., 8.7, -0.8, 0.6, -6.1}$.\n", - "Output Answer": [ - "${-9.8, 4.1, 5.9}$" - ], - "Output Program": [ - "fst = set((4.1, 8.5, 1.7, -7., -4.8, -6.6, 5.1, -9.8, -7.8, 2., 8.2, 5.9, -9.9,))\nsnd = set((-5.7, 5.9, 1.1, 6., -9.8, -4.2, 4.1, -1., 8.7, -0.8, 0.6, -6.1,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, 5, 6, 10, -\\frac{5}{\\sqrt{3}}} \\cup {5, -\\frac{14}{\\sqrt{3}}, -7, -5, 6}$.\n", - "Output Answer": [ - "${-\\frac{14}{\\sqrt{3}}, -7, -5, -\\frac{5}{\\sqrt{3}}, 5, 6, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 5, 6, 10, -(5/(math.sqrt(3))),))\nsnd = set((5, -(14/(math.sqrt(3))), -7, -5, 6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, 8, 3 \\sqrt{2}, 3, 2, \\frac{34}{5}, 6, -\\frac{21}{4}, 5 \\log (2)}$.", - "Output Answer": [ - "$3 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 8, 3*math.sqrt(2), 3, 2, (34/5), 6, -(21/4), 5*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 2 \\pi, 0, 5, -6 \\log (2), -\\frac{21}{e}} \\cup {3, -6 \\log (2), -8, -2 \\pi, 0, -\\frac{21}{e}, 10}$.\n", - "Output Answer": [ - "${-8, -\\frac{21}{e}, -2 \\pi, -6 \\log (2), -2, 0, 3, 5, 2 \\pi, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 2*math.pi, 0, 5, -6*math.log(2), -(21/math.e),))\nsnd = set((3, -6*math.log(2), -8, -2*math.pi, 0, -(21/math.e), 10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, -27, 7}$.\n", - "Output Answer": [ - "$12 \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, -27, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, 6, -5, \\frac{20}{e}, \\frac{16}{\\sqrt{3}}, -e} \\cup {-5, -e, -\\frac{15}{e}, 6, 0, \\frac{16}{\\sqrt{3}}, e}$.\n", - "Output Answer": [ - "${-\\frac{15}{e}, -5, -e, 0, e, 6, \\frac{20}{e}, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 6, -5, (20/math.e), (16/(math.sqrt(3))), -math.e,))\nsnd = set((-5, -math.e, -(15/math.e), 6, 0, (16/(math.sqrt(3))), math.e,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{2}, 8, 19}$.\n", - "Output Answer": [ - "$\\frac{2280}{439}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/2), 8, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${6.579, 7, 0, -3, -12 \\log (2)} \\setminus {7, 6.579, -9, \\sqrt{5}, -12 \\log (2)}$.\n", - "Output Answer": [ - "${-3, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.579, 7, 0, -3, -12*math.log(2),))\nsnd = set((7, 6.579, -9, math.sqrt(5), -12*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -2, \\frac{37}{4}, 0, -\\frac{23}{\\pi }, -1, 8, \\frac{8}{\\sqrt{3}}, 5} \\setminus {\\frac{8}{\\sqrt{3}}, 4 \\sqrt{2}, 0, -1}$.\n", - "Output Answer": [ - "${-\\frac{23}{\\pi }, -3, -2, 5, 8, \\frac{37}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -2, (37/4), 0, -(23/math.pi), -1, 8, (8/(math.sqrt(3))), 5,))\nsnd = set(((8/(math.sqrt(3))), 4*math.sqrt(2), 0, -1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, 1, 2, -6, 1, 3, 3, -6, 9, -6, 3, 1, -6, 1, -8, 9, 1, -6, 1, 3, -6, -6, -8, -6, 2, 3, 1, -6, -8, 9}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, 1, 2, -6, 1, 3, 3, -6, 9, -6, 3, 1, -6, 1, -8, 9, 1, -6, 1, 3, -6, -6, -8, -6, 2, 3, 1, -6, -8, 9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x^2+0.1 x+4.$ where $x \\sim $ \\text{BetaDistribution}[0.9,1.4]\n", - "Output Answer": [ - "$4.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.9, 1.4)\nprint(E(2.2*x**2+0.1*x+4.))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3 e, 2, 6} \\cup {3 e, 6, 2}$.\n", - "Output Answer": [ - "${-3 e, 2, 6, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.e, 2, 6,))\nsnd = set((3*math.e, 6, 2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 10, -2, 3, 6}$.\n", - "Output Answer": [ - "$\\frac{18}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 10, -2, 3, 6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -1, 0}$.\n", - "Output Answer": [ - "$\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -1, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5 \\sqrt{3}, 2 \\sqrt{3}, 3 \\sqrt{3}, -4 \\sqrt{3}, -5 \\sqrt{3}, -4 \\sqrt{3}, 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{3 \\sqrt{3}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 5*math.sqrt(3), 2*math.sqrt(3), 3*math.sqrt(3), -4*math.sqrt(3), -5*math.sqrt(3), -4*math.sqrt(3), 6*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{12}{7}, 6}$.\n", - "Output Answer": [ - "${\\frac{12}{7}, 6}$" - ], - "Output Program": [ - "values = (12/7), 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, 2, \\frac{6}{\\pi }, -8, -\\frac{7}{\\sqrt{\\pi }}, 6, -5}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 2, (6/math.pi), -8, -(7/(math.sqrt(math.pi))), 6, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{15}{7}, -2, -\\frac{37}{7}, \\frac{15}{7}, -\\frac{17}{7}, -\\frac{37}{7}, \\frac{24}{7}, \\frac{40}{7}}$.\n", - "Output Answer": [ - "$-\\frac{41}{56}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(15/7), -2, -(37/7), (15/7), -(17/7), -(37/7), (24/7), (40/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -9, \\frac{6}{\\sqrt{\\pi }}, -4 \\sqrt{2}, \\frac{23}{3}, 2, -4, \\frac{17}{3}, 2 \\pi, -7, \\frac{5}{e}, -9, 9, -8, -8}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -9, (6/(math.sqrt(math.pi))), -4*math.sqrt(2), (23/3), 2, -4, (17/3), 2*math.pi, -7, (5/math.e), -9, 9, -8, -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6, 46656, 1, -1024, 4, 7}$.\n", - "Output Answer": [ - "$24 \\sqrt[6]{-42}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 46656, 1, -1024, 4, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, 9, -3 \\pi, \\frac{3}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, 3, 8, \\frac{10}{e}, 6, -\\frac{1}{2}, 5, 1, 4}$.", - "Output Answer": [ - "$\\frac{7}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 9, -3*math.pi, (3/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), 3, 8, (10/math.e), 6, -(1/2), 5, 1, 4\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{3}{7}, -\\frac{15}{2}, -8, 2, -9, 6} \\cup {-8, -9, 4, \\frac{25}{7}, -1, -\\frac{9}{2}}$.\n", - "Output Answer": [ - "${-9, -8, -\\frac{15}{2}, -\\frac{9}{2}, -1, \\frac{3}{7}, 2, \\frac{25}{7}, 4, 6}$" - ], - "Output Program": [ - "fst = set(((3/7), -(15/2), -8, 2, -9, 6,))\nsnd = set((-8, -9, 4, (25/7), -1, -(9/2),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x^3+4.5 x^2+3. x-4.1$ where $x \\sim $ \\text{PoissonDistribution}[0.7]\n", - "Output Answer": [ - "$-6.95$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.7)\nprint(E(-4.1*x**3+4.5*x**2+3.*x-4.1))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{5}, 2 e, -\\frac{3}{\\sqrt{5}}, -5, 11 \\log (2), -9, 0} \\setminus {4 \\sqrt{5}, -\\frac{3}{\\sqrt{5}}, 4 \\log (2), -2 e, -9, -5}$.\n", - "Output Answer": [ - "${0, 2 e, 11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), 2*math.e, -(3/(math.sqrt(5))), -5, 11*math.log(2), -9, 0,))\nsnd = set((4*math.sqrt(5), -(3/(math.sqrt(5))), 4*math.log(2), -2*math.e, -9, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.3 x^2-2.2 x-3.8$ where $x \\sim $ \\text{PoissonDistribution}[2.4]\n", - "Output Answer": [ - "$-11.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.4)\nprint(E(-0.3*x**2-2.2*x-3.8))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\sqrt{2}, 13 \\log (2), -\\frac{10}{\\sqrt{3}}, 8}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(8-\\frac{10}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.sqrt(2), 13*math.log(2), -(10/(math.sqrt(3))), 8\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -4, 0, -9, 4, -4, -5, -4, -5, 0, 1, 4, 0, -4, -5, 1, -9, -4, -4, -4, -4, -4, -4, -5, -4, 4, 1, 4, -4, 0}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -4, 0, -9, 4, -4, -5, -4, -5, 0, 1, 4, 0, -4, -5, 1, -9, -4, -4, -4, -4, -4, -4, -5, -4, 4, 1, 4, -4, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8, 9, 6, \\frac{5}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, 0, 2} \\cup {2, 6, \\frac{13}{\\sqrt{3}}, 3, \\frac{5}{\\sqrt{3}}, 9}$.\n", - "Output Answer": [ - "${-8, 0, 2, \\frac{5}{\\sqrt{3}}, 3, 6, \\frac{13}{\\sqrt{3}}, 9, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 9, 6, (5/(math.sqrt(3))), (16/(math.sqrt(3))), 0, 2,))\nsnd = set((2, 6, (13/(math.sqrt(3))), 3, (5/(math.sqrt(3))), 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{29}{\\pi }, \\frac{5}{\\sqrt{2}}, 6.86, -\\frac{12}{\\sqrt{\\pi }}, 2}$.\n", - "Output Answer": [ - "${-\\frac{12}{\\sqrt{\\pi }}, 2, \\frac{5}{\\sqrt{2}}, 6.86, \\frac{29}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (29/math.pi), (5/(math.sqrt(2))), 6.86, -(12/(math.sqrt(math.pi))), 2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x^2-4.2 x-1.8$ where $x \\sim $ \\text{PoissonDistribution}[3.5]\n", - "Output Answer": [ - "$43.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(E(3.8*x**2-4.2*x-1.8))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-10, -\\frac{15}{4}, \\frac{22}{\\pi }} \\cup {\\frac{22}{\\pi }, 3, -\\frac{15}{4}}$.\n", - "Output Answer": [ - "${-10, -\\frac{15}{4}, 3, \\frac{22}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, -(15/4), (22/math.pi),))\nsnd = set(((22/math.pi), 3, -(15/4),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -9, 8, 6.57, 3} \\setminus {\\frac{19}{2}, 8, -2.07, 3, -3, -9, \\frac{11}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${6.57}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -9, 8, 6.57, 3,))\nsnd = set(((19/2), 8, -2.07, 3, -3, -9, (11/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x^3+0.8 x^2+4.3 x-3.1$ where $x \\sim $ \\text{PoissonDistribution}[0.7]\n", - "Output Answer": [ - "$4.38$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.7)\nprint(E(1.4*x**3+0.8*x**2+4.3*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, 14, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{307}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 14, 15\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x^3+3.9 x^2-0.2 x-2.$ where $x \\sim $ \\text{PoissonDistribution}[0.7]\n", - "Output Answer": [ - "$-7.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.7)\nprint(E(-4.1*x**3+3.9*x**2-0.2*x-2.))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${4, -\\pi, -3 \\pi, 4 \\sqrt{5}, \\frac{25}{7}, 5, 7} \\cup {7, -\\frac{2}{7}, \\frac{41}{7}, 2 \\pi, 5, 4}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\pi, -\\frac{2}{7}, \\frac{25}{7}, 4, 5, \\frac{41}{7}, 2 \\pi, 7, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -math.pi, -3*math.pi, 4*math.sqrt(5), (25/7), 5, 7,))\nsnd = set((7, -(2/7), (41/7), 2*math.pi, 5, 4,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, 2, -15, 12, 10}$.\n", - "Output Answer": [ - "$\\frac{569}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 2, -15, 12, 10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-6 \\log (2), 9, -\\frac{13}{3}, 1, -\\frac{22}{5}, -\\frac{36}{7}, 8, 6}$.\n", - "Output Answer": [ - "${-\\frac{36}{7}, -\\frac{22}{5}, -\\frac{13}{3}, -6 \\log (2), 1, 6, 8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.log(2), 9, -(13/3), 1, -(22/5), -(36/7), 8, 6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, -10, -5}$.\n", - "Output Answer": [ - "$25$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -10, -5\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 1, 18, 19}$.\n", - "Output Answer": [ - "$\\frac{1368}{493}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 1, 18, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, -27, 4}$.\n", - "Output Answer": [ - "$27 \\sqrt[3]{-1} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, -27, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1, -\\frac{22}{e}, -\\sqrt{3}, -1, -1, \\frac{10}{3}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{22}{e}, -\\sqrt{3}, -1, -1, -1, \\frac{10}{3}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -(22/math.e), -math.sqrt(3), -1, -1, (10/3), 5*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.354,0.142,0.004,0.348,0.031\\}$ and $\\{0.257,0.154,0.118,0.156,0.153\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.354, 0.142, 0.004, 0.348, 0.031\ndistribution2 = 0.257, 0.154, 0.118, 0.156, 0.153\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{\\sqrt{3}}, 2 \\pi, -5}$.\n", - "Output Answer": [ - "$\\frac{13}{\\sqrt{3}}+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(3))), 2*math.pi, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-8, 5, -\\frac{15}{2}, -6 \\sqrt{2}, 8, -9, -\\frac{1}{e}} \\cup {-9, -\\frac{3}{2}, 8, 5, -6 \\sqrt{2}, -8, \\frac{12}{e}}$.\n", - "Output Answer": [ - "${-9, -6 \\sqrt{2}, -8, -\\frac{15}{2}, -\\frac{3}{2}, -\\frac{1}{e}, \\frac{12}{e}, 5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 5, -(15/2), -6*math.sqrt(2), 8, -9, -(1/math.e),))\nsnd = set((-9, -(3/2), 8, 5, -6*math.sqrt(2), -8, (12/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{52}{7}, 10 \\log (2), -6, -1, 8, -9, -\\frac{19}{\\pi }, 7, 9, -7, -2}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -(52/7), 10*math.log(2), -6, -1, 8, -9, -(19/math.pi), 7, 9, -7, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{15}{\\sqrt{\\pi }}, 4, 2 \\pi, 6.5}$.\n", - "Output Answer": [ - "${-\\frac{15}{\\sqrt{\\pi }}, 4, 2 \\pi, 6.5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/(math.sqrt(math.pi))), 4, 2*math.pi, 6.5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -9, -9, -5, -2, -9, 2, 2, -9, -9, -9, -7, -2, -2, 2, -4, -7, -5, -4, 2, -9, -7, -5, -7, 2, -5, -2}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -9, -9, -5, -2, -9, 2, 2, -9, -9, -9, -7, -2, -2, 2, -4, -7, -5, -4, 2, -9, -7, -5, -7, 2, -5, -2\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 15, 5}$.\n", - "Output Answer": [ - "$\\frac{585}{67}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 15, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.244,0.23,0.023,0.159,0.03,0.038,0.048\\}$ and $\\{0.053,0.184,0.066,0.093,0.044,0.109,0.235\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.244, 0.23, 0.023, 0.159, 0.03, 0.038, 0.048\ndistribution2 = 0.053, 0.184, 0.066, 0.093, 0.044, 0.109, 0.235\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.143,0.001,0.639\\}$ and $\\{0.203,0.261,0.384,0.07\\}$.", - "Output Answer": [ - "$1.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.143, 0.001, 0.639\ndistribution2 = 0.203, 0.261, 0.384, 0.07\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 e, 3 e, -3 e, -3 e, e, 2 e, e, 3 e, 3 e, e, 2 e, 2 e, 2 e, -2 e, 3 e, 3 e, 2 e, -2 e, -2 e, -2 e, 2 e, e, 3 e, 3 e, -2 e, -3 e}$.\n", - "Output Answer": [ - "$\\{3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.e, 3*math.e, -3*math.e, -3*math.e, math.e, 2*math.e, math.e, 3*math.e, 3*math.e, math.e, 2*math.e, 2*math.e, 2*math.e, -2*math.e, 3*math.e, 3*math.e, 2*math.e, -2*math.e, -2*math.e, -2*math.e, 2*math.e, math.e, 3*math.e, 3*math.e, -2*math.e, -3*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.59 < -2.1 x^2-2.5 x-0.2 < 0.39$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2].", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(P((-2.59 < -2.1*x**2-2.5*x-0.2) & (-2.1*x**2-2.5*x-0.2 < 0.39)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 4, 10, -1, 5, -3}$.\n", - "Output Answer": [ - "$\\frac{23}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 4, 10, -1, 5, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{13}{\\sqrt{2}}, -7, -3.543, \\frac{17}{4}, -10}$.\n", - "Output Answer": [ - "${-10, -7, -3.543, \\frac{17}{4}, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(2))), -7, -3.543, (17/4), -10\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{23}{2}, 5, 3}$.\n", - "Output Answer": [ - "$\\frac{5520}{971}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (23/2), 5, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, \\frac{16}{3}}$.\n", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import statistics\nvalues = 16, (16/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x^3-0.1 x^2+1.1 x-4.4$ where $x \\sim $ \\text{ExponentialDistribution}[2.]\n", - "Output Answer": [ - "$-0.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 2.)\nprint(E(3.9*x**3-0.1*x**2+1.1*x-4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.036,0.081,0.072,0.051,0.131,0.135,0.037,0.26,0.035,0.121\\}$ and $\\{0.042,0.022,0.173,0.019,0.118,0.186,0.033,0.014,0.187,0.143\\}$.", - "Output Answer": [ - "$0.75$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.036, 0.081, 0.072, 0.051, 0.131, 0.135, 0.037, 0.26, 0.035, 0.121\ndistribution2 = 0.042, 0.022, 0.173, 0.019, 0.118, 0.186, 0.033, 0.014, 0.187, 0.143\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, 2, -1, 8, 5} \\cap {-7, -5, -10, 5, -1, 3}$.\n", - "Output Answer": [ - "${-1, 3, 5}$" - ], - "Output Program": [ - "fst = set((3, 2, -1, 8, 5,))\nsnd = set((-7, -5, -10, 5, -1, 3,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, e, 1, -\\frac{16}{\\sqrt{5}}, \\frac{3}{\\pi }, -2 \\sqrt{5}, -\\frac{21}{\\sqrt{5}}, 1, -3, -5 \\sqrt{3}, 9, -\\frac{3}{e}, -5}$.\n", - "Output Answer": [ - "$9+\\frac{21}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, math.e, 1, -(16/(math.sqrt(5))), (3/math.pi), -2*math.sqrt(5), -(21/(math.sqrt(5))), 1, -3, -5*math.sqrt(3), 9, -(3/math.e), -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{19}{2}, 1, -4.3, -8, 7 \\sqrt{2}} \\cup {7 \\sqrt{2}, -4.3, \\frac{19}{2}, -10, -\\frac{1}{3}, -8, 1}$.\n", - "Output Answer": [ - "${-10, -8, -4.3, -\\frac{1}{3}, 1, \\frac{19}{2}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((19/2), 1, -4.3, -8, 7*math.sqrt(2),))\nsnd = set((7*math.sqrt(2), -4.3, (19/2), -10, -(1/3), -8, 1,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, -5, \\frac{39}{5}, -\\frac{5}{\\sqrt{3}}, \\frac{19}{\\sqrt{5}}, 13 \\log (2), -2, 0, -\\frac{6}{5}, \\frac{8}{\\sqrt{3}}, \\frac{13}{\\pi }, 7, 2 e, \\frac{1}{\\sqrt{5}}, -3}$.", - "Output Answer": [ - "$\\frac{13}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -5, (39/5), -(5/(math.sqrt(3))), (19/(math.sqrt(5))), 13*math.log(2), -2, 0, -(6/5), (8/(math.sqrt(3))), (13/math.pi), 7, 2*math.e, (1/(math.sqrt(5))), -3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.052,0.03,0.132,0.053,0.014,0.052,0.194,0.078,0.19,0.043\\}$ and $\\{0.378,0.005,0.412,0.002,0.002,0.06,0.061,0.004,0.009,0.055\\}$.", - "Output Answer": [ - "$1.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.052, 0.03, 0.132, 0.053, 0.014, 0.052, 0.194, 0.078, 0.19, 0.043\ndistribution2 = 0.378, 0.005, 0.412, 0.002, 0.002, 0.06, 0.061, 0.004, 0.009, 0.055\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 2 \\sqrt{5}, -\\frac{20}{e}, -9, 0, 9, 5, 0, \\frac{17}{5}, -4, -8, -\\frac{1}{e}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 2*math.sqrt(5), -(20/math.e), -9, 0, 9, 5, 0, (17/5), -4, -8, -(1/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{18}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{18}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(18/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (8/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), (8/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), (8/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), (8/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -5 \\sqrt{2}, -7 \\sqrt{2}, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, -5*math.sqrt(2), -7*math.sqrt(2), 4*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 0, 6, 3 \\pi, -3 e, 1} \\setminus {3 \\pi, 0.3, -3, -6, 6, 1}$.\n", - "Output Answer": [ - "${-3 e, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 0, 6, 3*math.pi, -3*math.e, 1,))\nsnd = set((3*math.pi, 0.3, -3, -6, 6, 1,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{2}, 4, 2 \\pi, 3 \\sqrt{2}, -7, -6, 4, -\\frac{17}{\\sqrt{\\pi }}, -2, 1, 4 \\sqrt{5}, \\frac{39}{4}, 3 \\sqrt{3}, -7}$.\n", - "Output Answer": [ - "$\\frac{39}{4}+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(2), 4, 2*math.pi, 3*math.sqrt(2), -7, -6, 4, -(17/(math.sqrt(math.pi))), -2, 1, 4*math.sqrt(5), (39/4), 3*math.sqrt(3), -7\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.22,0.079,0.054,0.175,0.111,0.079\\}$ and $\\{0.305,0.056,0.407,0.123,0.046,0.062\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.22, 0.079, 0.054, 0.175, 0.111, 0.079\ndistribution2 = 0.305, 0.056, 0.407, 0.123, 0.046, 0.062\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, 4096, 46656, 3, 625, 531441}$.\n", - "Output Answer": [ - "$216 \\sqrt[6]{-2} \\sqrt[3]{3} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 4096, 46656, 3, 625, 531441\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.9 x+8.3$ where $x \\sim $ \\text{BetaDistribution}[1.2,1.3]\n", - "Output Answer": [ - "$10.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.2, 1.3)\nprint(E(4.9*x+8.3))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${2 \\log (2), -3.7, 4 \\sqrt{2}, \\sqrt{3}, -9, 0, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, -3.7, 0, 2 \\log (2), \\sqrt{3}, 2 \\sqrt{3}, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.log(2), -3.7, 4*math.sqrt(2), math.sqrt(3), -9, 0, 2*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.316,0.304,0.076\\}$ and $\\{0.274,0.345,0.15\\}$.", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.316, 0.304, 0.076\ndistribution2 = 0.274, 0.345, 0.15\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{17}{4}, 9, 3 \\pi, 4 \\sqrt{3}, -6, -5, -4 \\sqrt{5}, -7, -\\frac{23}{3}, 1} \\cup {-\\frac{5}{\\sqrt{3}}, -\\frac{18}{7}, 2, -7, -4 \\sqrt{5}, -5, 0, -\\frac{17}{4}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -\\frac{23}{3}, -7, -6, -5, -\\frac{17}{4}, -\\frac{5}{\\sqrt{3}}, -\\frac{18}{7}, 0, 1, 2, 4 \\sqrt{3}, 9, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(17/4), 9, 3*math.pi, 4*math.sqrt(3), -6, -5, -4*math.sqrt(5), -7, -(23/3), 1,))\nsnd = set((-(5/(math.sqrt(3))), -(18/7), 2, -7, -4*math.sqrt(5), -5, 0, -(17/4),))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-6, 2, 5, \\sqrt{3}, -\\frac{8}{\\sqrt{5}}, -7, -\\frac{10}{\\pi }, 4 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{3}-\\frac{10}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, 2, 5, math.sqrt(3), -(8/(math.sqrt(5))), -7, -(10/math.pi), 4*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -7, -1, 6, -7, 6, -7, -6, 6, -6, -6, -7, -1, -6, -1, 6, -6, -1, -1, 6, -1, -1, -6, -1, -6, 6, -1, 6}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -7, -1, 6, -7, 6, -7, -6, 6, -6, -6, -7, -1, -6, -1, 6, -6, -1, -1, 6, -1, -1, -6, -1, -6, 6, -1, 6\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.365,0.049,0.113,0.466\\}$ and $\\{0.207,0.253,0.295,0.084\\}$.", - "Output Answer": [ - "$0.65$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.365, 0.049, 0.113, 0.466\ndistribution2 = 0.207, 0.253, 0.295, 0.084\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, 6, -8, 2, 9, 8, -7, 5} \\cap {-9, 5, -8, 6, 2, -5, -4, -3, 8}$.\n", - "Output Answer": [ - "${-9, -8, 2, 5, 6, 8}$" - ], - "Output Program": [ - "fst = set((-9, 6, -8, 2, 9, 8, -7, 5,))\nsnd = set((-9, 5, -8, 6, 2, -5, -4, -3, 8,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 2, 4, -4, 8, -2} \\setminus {-9, 2, 4, -5, 0, -2}$.\n", - "Output Answer": [ - "${-4, 8}$" - ], - "Output Program": [ - "fst = set((-9, 2, 4, -4, 8, -2,))\nsnd = set((-9, 2, 4, -5, 0, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 4, 9, 2, -10, -3}$.\n", - "Output Answer": [ - "$-\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 4, 9, 2, -10, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, 8, 64, 64, 32, -3125}$.\n", - "Output Answer": [ - "$16\\ 10^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, 8, 64, 64, 32, -3125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, -5, -14, -8, -3}$.\n", - "Output Answer": [ - "$\\frac{213}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -5, -14, -8, -3\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\sqrt{2}, 4, 0, \\frac{35}{4}, -\\frac{2}{3}, 6, -\\frac{27}{5}, -\\sqrt{2}} \\cup {6, 3, 4, 4 \\sqrt{2}, -\\frac{13}{2}, \\frac{7}{\\sqrt{2}}, -\\frac{2}{3}, 0, -10}$.\n", - "Output Answer": [ - "${-10, -\\frac{13}{2}, -\\frac{27}{5}, -2 \\sqrt{2}, -\\sqrt{2}, -\\frac{2}{3}, 0, 3, 4, \\frac{7}{\\sqrt{2}}, 4 \\sqrt{2}, 6, \\frac{35}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(2), 4, 0, (35/4), -(2/3), 6, -(27/5), -math.sqrt(2),))\nsnd = set((6, 3, 4, 4*math.sqrt(2), -(13/2), (7/(math.sqrt(2))), -(2/3), 0, -10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{9}{e}, -2, -8, -\\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import math\n\nvalues = -(9/math.e), -2, -8, -(22/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${5, -5, 0, -6 \\sqrt{3}, -4, -7, -6} \\cup {7, 0, -5, -6 \\sqrt{3}, -\\frac{3}{\\sqrt{2}}, -6, -7, \\frac{7}{2}, 5}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -7, -6, -5, -4, -\\frac{3}{\\sqrt{2}}, 0, \\frac{7}{2}, 5, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -5, 0, -6*math.sqrt(3), -4, -7, -6,))\nsnd = set((7, 0, -5, -6*math.sqrt(3), -(3/(math.sqrt(2))), -6, -7, (7/2), 5,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, -5, -10, 4, 6, 4}$.\n", - "Output Answer": [ - "$\\frac{116}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -5, -10, 4, 6, 4\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -8, 4}$.\n", - "Output Answer": [ - "$-\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -8, 4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\pi, \\frac{15}{4}, -4, 5, 4} \\setminus {-4, -3 \\pi, -7, 4}$.\n", - "Output Answer": [ - "${\\pi, \\frac{15}{4}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, (15/4), -4, 5, 4,))\nsnd = set((-4, -3*math.pi, -7, 4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3 \\sqrt{5}, 4 \\sqrt{5}, -9, \\frac{21}{\\sqrt{5}}, -\\frac{13}{4}}$.\n", - "Output Answer": [ - "${-9, -\\frac{13}{4}, 3 \\sqrt{5}, 4 \\sqrt{5}, \\frac{21}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(5), 4*math.sqrt(5), -9, (21/(math.sqrt(5))), -(13/4)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, -64, 2}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{14}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -64, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-9.1, -7, 8, 4 \\sqrt{3}} \\cup {3 \\sqrt{3}, -9.1, -7, 10}$.\n", - "Output Answer": [ - "${-9.1, -7, 3 \\sqrt{3}, 4 \\sqrt{3}, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9.1, -7, 8, 4*math.sqrt(3),))\nsnd = set((3*math.sqrt(3), -9.1, -7, 10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{5}{\\sqrt{2}}, 0, -2.7, -4, \\frac{10}{e}, \\frac{16}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-4, -\\frac{5}{\\sqrt{2}}, -2.7, 0, \\frac{10}{e}, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/(math.sqrt(2))), 0, -2.7, -4, (10/math.e), (16/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, 3 \\sqrt{2}, -\\frac{3}{e}, \\frac{2}{\\sqrt{\\pi }}, -9, -6, \\frac{8}{\\sqrt{\\pi }}, \\frac{11}{e}, \\pi, -9, \\frac{10}{\\pi }, \\frac{25}{e}, 4, 3}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{10}{\\pi }+\\pi \\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 3*math.sqrt(2), -(3/math.e), (2/(math.sqrt(math.pi))), -9, -6, (8/(math.sqrt(math.pi))), (11/math.e), math.pi, -9, (10/math.pi), (25/math.e), 4, 3\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, -6, 81, 512}$.\n", - "Output Answer": [ - "$24 \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -6, 81, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{1}{2}, \\frac{7}{2}, -\\frac{9}{4}, -10, 0, -\\frac{9}{2}}$.\n", - "Output Answer": [ - "$-\\frac{17}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (1/2), (7/2), -(9/4), -10, 0, -(9/2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{5}, -1, -9, \\frac{19}{\\sqrt{5}}, 2, 5, 1}$.\n", - "Output Answer": [ - "$9+\\frac{19}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), -1, -9, (19/(math.sqrt(5))), 2, 5, 1\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${5, -3 \\log (2), -\\frac{9}{\\sqrt{\\pi }}, 3 \\pi, 0} \\setminus {-2 \\log (2), -\\frac{9}{\\sqrt{\\pi }}, 10, 3 \\pi}$.\n", - "Output Answer": [ - "${-3 \\log (2), 0, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -3*math.log(2), -(9/(math.sqrt(math.pi))), 3*math.pi, 0,))\nsnd = set((-2*math.log(2), -(9/(math.sqrt(math.pi))), 10, 3*math.pi,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -\\pi, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -math.pi, 0\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, -5, 9, 9, -3, -3, -5, 4, 9, 0, 4, -3, -5, 0, -5, 4, -3, 9, -5, 4, 9, 4, 0}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, -5, 9, 9, -3, -3, -5, 4, 9, 0, 4, -3, -5, 0, -5, 4, -3, 9, -5, 4, 9, 4, 0\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.098,0.141,0.114,0.064,0.036,0.205,0.022,0.067,0.105,0.048\\}$ and $\\{0.039,0.219,0.194,0.005,0.067,0.213,0.092,0.004,0.074,0.064\\}$.", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.098, 0.141, 0.114, 0.064, 0.036, 0.205, 0.022, 0.067, 0.105, 0.048\ndistribution2 = 0.039, 0.219, 0.194, 0.005, 0.067, 0.213, 0.092, 0.004, 0.074, 0.064\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.144,0.118,0.129,0.073,0.214,0.093,0.176\\}$ and $\\{0.208,0.053,0.025,0.039,0.183,0.291,0.138\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.144, 0.118, 0.129, 0.073, 0.214, 0.093, 0.176\ndistribution2 = 0.208, 0.053, 0.025, 0.039, 0.183, 0.291, 0.138\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 64, 10000, 10000, 256}$.\n", - "Output Answer": [ - "$80\\ 2^{2/5} 3^{4/5} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 64, 10000, 10000, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{13}{\\sqrt{2}}, \\sqrt{2}, \\frac{3}{\\sqrt{2}}, -5 \\sqrt{2}, 5 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, 5 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -5 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, -3 \\sqrt{2}, -5 \\sqrt{2}, \\sqrt{2}, 5 \\sqrt{2}, -5 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, 5 \\sqrt{2}, \\sqrt{2}, \\frac{13}{\\sqrt{2}}, -3 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, -3 \\sqrt{2}, 5 \\sqrt{2}, -3 \\sqrt{2}, \\frac{13}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (13/(math.sqrt(2))), math.sqrt(2), (3/(math.sqrt(2))), -5*math.sqrt(2), 5*math.sqrt(2), (13/(math.sqrt(2))), 5*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -5*math.sqrt(2), (3/(math.sqrt(2))), -3*math.sqrt(2), -5*math.sqrt(2), math.sqrt(2), 5*math.sqrt(2), -5*math.sqrt(2), (13/(math.sqrt(2))), (3/(math.sqrt(2))), 5*math.sqrt(2), math.sqrt(2), (13/(math.sqrt(2))), -3*math.sqrt(2), (13/(math.sqrt(2))), -3*math.sqrt(2), 5*math.sqrt(2), -3*math.sqrt(2), (13/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 7, 7, 7, 3, -3, -3, 3, 5, -5, -3, -5, -5, 5, 7, 5, 3, -3, 3, -3, 7, 5, 3, 7}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 7, 7, 7, 3, -3, -3, 3, 5, -5, -3, -5, -5, 5, 7, 5, 3, -3, 3, -3, 7, 5, 3, 7\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6, 1, 3 \\sqrt{3}, -2, 3, -1, 0, -9, \\frac{1}{\\sqrt{2}}, -5} \\cup {\\frac{1}{\\sqrt{2}}, -5, 3, 0, \\sqrt{3}, -9, 7, -6}$.\n", - "Output Answer": [ - "${-9, -6, -5, -2, -1, 0, \\frac{1}{\\sqrt{2}}, 1, \\sqrt{3}, 3, 3 \\sqrt{3}, 6, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 1, 3*math.sqrt(3), -2, 3, -1, 0, -9, (1/(math.sqrt(2))), -5,))\nsnd = set(((1/(math.sqrt(2))), -5, 3, 0, math.sqrt(3), -9, 7, -6,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-3 e, 5, \\frac{29}{5}, \\frac{12}{e}, 8, -2 e, -3, 1, 3, -\\frac{2}{e}, \\frac{11}{\\pi }, -1, -1, 7}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.e, 5, (29/5), (12/math.e), 8, -2*math.e, -3, 1, 3, -(2/math.e), (11/math.pi), -1, -1, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{2}{\\sqrt{\\pi }}, 3, -2, -4 \\sqrt{5}, \\frac{19}{2}} \\setminus {-2, -\\frac{4}{\\sqrt{\\pi }}, -4 \\sqrt{5}, -5}$.\n", - "Output Answer": [ - "${\\frac{2}{\\sqrt{\\pi }}, 3, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((2/(math.sqrt(math.pi))), 3, -2, -4*math.sqrt(5), (19/2),))\nsnd = set((-2, -(4/(math.sqrt(math.pi))), -4*math.sqrt(5), -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{9}{2}, -2, \\sqrt{5}, \\frac{11}{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{9}{2}+\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (9/2), -2, math.sqrt(5), (11/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -6, 8, -4}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -6, 8, -4\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${10, 0, 0, -9, -6}$.\n", - "Output Answer": [ - "${-9, -6, 0, 0, 10}$" - ], - "Output Program": [ - "values = 10, 0, 0, -9, -6\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, 12, 2, 11, 6, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{869}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 12, 2, 11, 6, -2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, 2, -12, 7, -12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1147}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 2, -12, 7, -12\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 4, \\frac{23}{\\pi }, e, -3 e, 7} \\setminus {-2, -4, 2, -10, -2 e}$.\n", - "Output Answer": [ - "${-3 e, -3, e, 4, 7, \\frac{23}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 4, (23/math.pi), math.e, -3*math.e, 7,))\nsnd = set((-2, -4, 2, -10, -2*math.e,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 2, \\frac{2}{7}, -10, \\frac{7}{\\sqrt{2}}, -9, -\\frac{18}{e}} \\cup {\\frac{7}{\\sqrt{2}}, -\\frac{18}{e}, -6, \\frac{45}{7}, -9, -10}$.\n", - "Output Answer": [ - "${-10, -9, -\\frac{18}{e}, -6, -3, \\frac{2}{7}, 2, \\frac{7}{\\sqrt{2}}, \\frac{45}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 2, (2/7), -10, (7/(math.sqrt(2))), -9, -(18/math.e),))\nsnd = set(((7/(math.sqrt(2))), -(18/math.e), -6, (45/7), -9, -10,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.014,0.115,0.373,0.113\\}$ and $\\{0.03,0.345,0.156,0.273\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.014, 0.115, 0.373, 0.113\ndistribution2 = 0.03, 0.345, 0.156, 0.273\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{7}{\\sqrt{\\pi }}, -3, 0, 6 \\sqrt{2}, -7 \\sqrt{2}, 1} \\setminus {-\\frac{7}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{5}}, 1, 6 \\sqrt{2}, 0, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(7/(math.sqrt(math.pi))), -3, 0, 6*math.sqrt(2), -7*math.sqrt(2), 1,))\nsnd = set((-(7/(math.sqrt(math.pi))), -(11/(math.sqrt(5))), 1, 6*math.sqrt(2), 0, -7*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{27}{5}, \\frac{46}{5}, -\\frac{29}{5}, \\frac{27}{5}, -\\frac{46}{5}, \\frac{27}{5}, \\frac{14}{5}, \\frac{46}{5}, \\frac{46}{5}, \\frac{46}{5}, -\\frac{29}{5}, \\frac{46}{5}, -\\frac{7}{5}, \\frac{14}{5}, \\frac{27}{5}, \\frac{46}{5}, -\\frac{7}{5}, -\\frac{7}{5}, -\\frac{29}{5}, -\\frac{29}{5}, \\frac{27}{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{46}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (27/5), (46/5), -(29/5), (27/5), -(46/5), (27/5), (14/5), (46/5), (46/5), (46/5), -(29/5), (46/5), -(7/5), (14/5), (27/5), (46/5), -(7/5), -(7/5), -(29/5), -(29/5), (27/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-6.01 < 3.7 x-4.4 < -5.42$ where $x \\sim $ \\text{NormalDistribution}[-0.8,2.7].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 2.7)\nprint(P((-6.01 < 3.7*x-4.4) & (3.7*x-4.4 < -5.42)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.9 x^2-0.3 x-4.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.8]\n", - "Output Answer": [ - "$-7.89$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.8)\nprint(E(-0.9*x**2-0.3*x-4.7))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{13}{\\pi }, -\\frac{5}{\\pi }, -\\frac{13}{\\pi }, \\frac{25}{\\pi }, \\frac{13}{\\pi }, \\frac{13}{\\pi }, \\frac{13}{\\pi }, \\frac{13}{\\pi }, \\frac{13}{\\pi }, -\\frac{30}{\\pi }, -\\frac{5}{\\pi }, -\\frac{15}{\\pi }, -\\frac{15}{\\pi }, \\frac{13}{\\pi }, \\frac{25}{\\pi }, \\frac{25}{\\pi }, \\frac{13}{\\pi }, -\\frac{5}{\\pi }, \\frac{13}{\\pi }, -\\frac{15}{\\pi }, \\frac{13}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{13}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (13/math.pi), -(5/math.pi), -(13/math.pi), (25/math.pi), (13/math.pi), (13/math.pi), (13/math.pi), (13/math.pi), (13/math.pi), -(30/math.pi), -(5/math.pi), -(15/math.pi), -(15/math.pi), (13/math.pi), (25/math.pi), (25/math.pi), (13/math.pi), -(5/math.pi), (13/math.pi), -(15/math.pi), (13/math.pi)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-5, 2 \\sqrt{3}, -\\frac{13}{\\sqrt{2}}, -\\frac{6}{5}, 5, -7, -10, -2, 8, \\frac{61}{7}}$.", - "Output Answer": [ - "$-\\frac{8}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, 2*math.sqrt(3), -(13/(math.sqrt(2))), -(6/5), 5, -7, -10, -2, 8, (61/7)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{3}, 7, -2, -\\frac{15}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{3}}} \\setminus {\\frac{11}{\\sqrt{3}}, -\\frac{13}{5}, 4 \\sqrt{5}, 1, \\frac{15}{\\sqrt{\\pi }}, 4.1, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{15}{\\sqrt{\\pi }}, -2, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), 7, -2, -(15/(math.sqrt(math.pi))), (11/(math.sqrt(3))),))\nsnd = set(((11/(math.sqrt(3))), -(13/5), 4*math.sqrt(5), 1, (15/(math.sqrt(math.pi))), 4.1, 3*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, 0, 9, -15, -12, 2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{3113}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 0, 9, -15, -12, 2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{23}{\\pi }, -\\frac{5}{\\sqrt{2}}, -\\pi, 0, 2, \\frac{19}{2}, -\\sqrt{3}, 0, -\\frac{27}{4}, 1, -\\frac{5}{4}, -1, 4 \\sqrt{3}, 8, 7}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(23/math.pi), -(5/(math.sqrt(2))), -math.pi, 0, 2, (19/2), -math.sqrt(3), 0, -(27/4), 1, -(5/4), -1, 4*math.sqrt(3), 8, 7\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{\\pi }, 3, -3, -\\frac{32}{7}, -3, \\frac{10}{\\pi }, 0, -8, -2 e, \\frac{23}{e}, 8, \\frac{13}{2}}$.", - "Output Answer": [ - "$\\frac{5}{2 \\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/math.pi), 3, -3, -(32/7), -3, (10/math.pi), 0, -8, -2*math.e, (23/math.e), 8, (13/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, -\\frac{17}{\\pi }, -\\frac{13}{\\sqrt{2}}, -4 \\log (2), 4, -5, 9}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -\\frac{17}{\\pi }, -5, -4, -4 \\log (2), 4, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -(17/math.pi), -(13/(math.sqrt(2))), -4*math.log(2), 4, -5, 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -3, 9, 2, 1, 6, -3}$.\n", - "Output Answer": [ - "$\\frac{2}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -3, 9, 2, 1, 6, -3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x-0.1$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$-3.71$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(-1.9*x-0.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.48,0.089,0.054\\}$ and $\\{0.706,0.21,0.08\\}$.", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.48, 0.089, 0.054\ndistribution2 = 0.706, 0.21, 0.08\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, 10, 13 \\log (2), -4, 2 \\sqrt{2}, -7 \\sqrt{2}, -6, -3, -8, -\\frac{11}{e}, -\\frac{2}{5}, 9}$.\n", - "Output Answer": [ - "$10+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 10, 13*math.log(2), -4, 2*math.sqrt(2), -7*math.sqrt(2), -6, -3, -8, -(11/math.e), -(2/5), 9\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 2, 4}$.\n", - "Output Answer": [ - "$\\frac{12}{7}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 2, 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${9, -7, 0.247, -4} \\setminus {9, -7, -\\frac{16}{e}, 3.135}$.\n", - "Output Answer": [ - "${-4, 0.247}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -7, 0.247, -4,))\nsnd = set((9, -7, -(16/math.e), 3.135,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${7, 8, \\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "${7, \\frac{22}{\\pi }, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 8, (22/math.pi)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, \\frac{36}{7}, -\\frac{37}{7}, \\frac{57}{7}, \\frac{15}{7}, -\\frac{4}{7}}$.\n", - "Output Answer": [ - "$\\frac{41}{14}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, (36/7), -(37/7), (57/7), (15/7), -(4/7)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{11}{2}, \\frac{15}{e}, -3, -\\frac{1}{\\sqrt{3}}, -1.908, 1} \\cup {-\\frac{11}{2}, 5.753, -9, \\sqrt{3}, \\frac{25}{e}, -3}$.\n", - "Output Answer": [ - "${-9, -\\frac{11}{2}, -3, -1.908, -\\frac{1}{\\sqrt{3}}, 1, \\sqrt{3}, \\frac{15}{e}, 5.753, \\frac{25}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(11/2), (15/math.e), -3, -(1/(math.sqrt(3))), -1.908, 1,))\nsnd = set((-(11/2), 5.753, -9, math.sqrt(3), (25/math.e), -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{3}{\\sqrt{2}}, -10, 5, -2, -8, 0.2}$.\n", - "Output Answer": [ - "${-10, -8, -\\frac{3}{\\sqrt{2}}, -2, 0.2, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/(math.sqrt(2))), -10, 5, -2, -8, 0.2\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x-3.1$ where $x \\sim $ \\text{PoissonDistribution}[1.2]\n", - "Output Answer": [ - "$0.86$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.2)\nprint(E(3.3*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -\\sqrt{3}, -3, -e, \\frac{12}{\\sqrt{\\pi }}, -9, 4, -3, \\frac{23}{7}, 4, -\\frac{49}{5}, 4 \\sqrt{3}, -2 \\sqrt{5}, -1}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-\\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -math.sqrt(3), -3, -math.e, (12/(math.sqrt(math.pi))), -9, 4, -3, (23/7), 4, -(49/5), 4*math.sqrt(3), -2*math.sqrt(5), -1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.81 < 0.9 x^2+1. x+4.5 < 7.07$ where $x \\sim $ \\text{NormalDistribution}[0.4,2.9].", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.4, 2.9)\nprint(P((-0.81 < 0.9*x**2+1.*x+4.5) & (0.9*x**2+1.*x+4.5 < 7.07)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-10, 6 \\log (2), 0, 7, -5 \\sqrt{2}, -1, 1, \\frac{15}{2}}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, 6*math.log(2), 0, 7, -5*math.sqrt(2), -1, 1, (15/2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -6, -2, -1, 0, -4, -2, 9, -7, 0}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "values = 9, -6, -2, -1, 0, -4, -2, 9, -7, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3. x-3.1$ where $x \\sim $ \\text{NormalDistribution}[-1.4,0.7]\n", - "Output Answer": [ - "$1.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.4, 0.7)\nprint(E(-3.*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, -3, -\\frac{43}{5}, -7, -2, 8, 7, -2, -\\frac{15}{2}, 10, -\\frac{20}{\\pi }, 0, 8, \\frac{3}{5}, 6}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -3, -(43/5), -7, -2, 8, 7, -2, -(15/2), 10, -(20/math.pi), 0, 8, (3/5), 6\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{7}{\\sqrt{3}}, -e, 0, -2, 3, -3, -4, \\frac{15}{2}}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{3}}, -4, -3, -e, -2, 0, 3, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/(math.sqrt(3))), -math.e, 0, -2, 3, -3, -4, (15/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, -\\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{3}}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -(7/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -9, \\frac{24}{e}, 3 \\sqrt{2}, 3, -5} \\setminus {4 \\sqrt{2}, 4, 0, -9, \\frac{24}{e}, 3, \\frac{5}{\\pi }}$.\n", - "Output Answer": [ - "${-5, -4, 3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -9, (24/math.e), 3*math.sqrt(2), 3, -5,))\nsnd = set((4*math.sqrt(2), 4, 0, -9, (24/math.e), 3, (5/math.pi),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 9, -125}$.\n", - "Output Answer": [ - "$10 \\sqrt[3]{-1} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 9, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{14}{3}, \\frac{25}{3}, 4, 13}$.\n", - "Output Answer": [ - "$\\frac{36400}{6017}$" - ], - "Output Program": [ - "import statistics\nvalues = (14/3), (25/3), 4, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-0.35 < 3.7 x-2.1 < 4.51$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.].", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(P((-0.35 < 3.7*x-2.1) & (3.7*x-2.1 < 4.51)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.086,0.21,0.168,0.466\\}$ and $\\{0.039,0.006,0.457,0.459\\}$.", - "Output Answer": [ - "$0.74$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.086, 0.21, 0.168, 0.466\ndistribution2 = 0.039, 0.006, 0.457, 0.459\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\pi, -4}$.\n", - "Output Answer": [ - "${-4, -\\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.pi, -4\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, 5, 2, -10, -2}$.\n", - "Output Answer": [ - "$13 \\sqrt{\\frac{3}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 5, 2, -10, -2\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{2}, 5 \\sqrt{2}, 2 \\sqrt{2}, 2 \\sqrt{2}, 2 \\sqrt{2}, 5 \\sqrt{2}, \\sqrt{2}, 5 \\sqrt{2}, \\sqrt{2}, -6 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, 3 \\sqrt{2}, 2 \\sqrt{2}, -6 \\sqrt{2}, \\sqrt{2}, 2 \\sqrt{2}, 3 \\sqrt{2}, 2 \\sqrt{2}, 3 \\sqrt{2}, 2 \\sqrt{2}, 2 \\sqrt{2}, -6 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(2), 5*math.sqrt(2), 2*math.sqrt(2), 2*math.sqrt(2), 2*math.sqrt(2), 5*math.sqrt(2), math.sqrt(2), 5*math.sqrt(2), math.sqrt(2), -6*math.sqrt(2), math.sqrt(2), math.sqrt(2), 3*math.sqrt(2), 2*math.sqrt(2), -6*math.sqrt(2), math.sqrt(2), 2*math.sqrt(2), 3*math.sqrt(2), 2*math.sqrt(2), 3*math.sqrt(2), 2*math.sqrt(2), 2*math.sqrt(2), -6*math.sqrt(2), math.sqrt(2), math.sqrt(2), math.sqrt(2), math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{5}{\\sqrt{3}}, 3 \\sqrt{3}, \\frac{5}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{5}{\\sqrt{3}}, 5 \\sqrt{3}, -\\frac{1}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, 3 \\sqrt{3}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{5}{\\sqrt{3}},-\\frac{16}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (8/(math.sqrt(3))), (8/(math.sqrt(3))), 5*math.sqrt(3), (5/(math.sqrt(3))), 3*math.sqrt(3), (5/(math.sqrt(3))), -(13/(math.sqrt(3))), (8/(math.sqrt(3))), -(16/(math.sqrt(3))), -(13/(math.sqrt(3))), -(1/(math.sqrt(3))), (5/(math.sqrt(3))), (5/(math.sqrt(3))), -(16/(math.sqrt(3))), -(1/(math.sqrt(3))), 5*math.sqrt(3), (5/(math.sqrt(3))), 5*math.sqrt(3), -(1/(math.sqrt(3))), -(1/(math.sqrt(3))), -(16/(math.sqrt(3))), -(16/(math.sqrt(3))), -(16/(math.sqrt(3))), -(13/(math.sqrt(3))), 3*math.sqrt(3), 3*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 14, -7, 0, -14, 8}$.\n", - "Output Answer": [ - "$\\frac{203}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 14, -7, 0, -14, 8\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${3 e, -2, -\\frac{8}{\\pi }, 5, 4, \\pi, \\frac{25}{\\pi }, -\\frac{17}{3}, 0, 7, -2 \\sqrt{2}, 3, 2 \\sqrt{5}, \\frac{9}{\\sqrt{2}}, -2 \\log (2)}$.", - "Output Answer": [ - "$\\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.e, -2, -(8/math.pi), 5, 4, math.pi, (25/math.pi), -(17/3), 0, 7, -2*math.sqrt(2), 3, 2*math.sqrt(5), (9/(math.sqrt(2))), -2*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.346,0.014,0.111,0.022,0.437\\}$ and $\\{0.162,0.199,0.253,0.147,0.013\\}$.", - "Output Answer": [ - "$1.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.346, 0.014, 0.111, 0.022, 0.437\ndistribution2 = 0.162, 0.199, 0.253, 0.147, 0.013\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${0, -7, \\frac{5}{4}, -\\frac{2}{5}, 5 \\sqrt{2}, -\\frac{15}{2}, -\\frac{18}{e}, 0, \\frac{4}{3}, -9, \\frac{37}{5}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -7, (5/4), -(2/5), 5*math.sqrt(2), -(15/2), -(18/math.e), 0, (4/3), -9, (37/5)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 10, -4} \\setminus {\\frac{23}{\\pi }, -4, \\sqrt{3}, 6}$.\n", - "Output Answer": [ - "${-3, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 10, -4,))\nsnd = set(((23/math.pi), -4, math.sqrt(3), 6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-10, \\pi, -3, 3 \\pi, -1} \\setminus {-10, \\pi, -1, -4}$.\n", - "Output Answer": [ - "${-3, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, math.pi, -3, 3*math.pi, -1,))\nsnd = set((-10, math.pi, -1, -4,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, 6, 5, 3, 2, 6}$.\n", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, 6, 5, 3, 2, 6\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\sqrt{3}, 0, \\frac{7}{2}, 9} \\setminus {-4 \\sqrt{3}, 9, 5, -3, \\frac{7}{2}}$.\n", - "Output Answer": [ - "${-\\sqrt{3}, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(3), 0, (7/2), 9,))\nsnd = set((-4*math.sqrt(3), 9, 5, -3, (7/2),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{10}{\\sqrt{\\pi }}, 4.62, -2, \\frac{3}{\\sqrt{\\pi }}, -2 \\sqrt{5}, 5 \\sqrt{3}, \\pi} \\setminus {-\\frac{10}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, 5 \\sqrt{3}, 4.62, \\pi, -2, \\sqrt{5}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(10/(math.sqrt(math.pi))), 4.62, -2, (3/(math.sqrt(math.pi))), -2*math.sqrt(5), 5*math.sqrt(3), math.pi,))\nsnd = set((-(10/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), 5*math.sqrt(3), 4.62, math.pi, -2, math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{14}{3}, \\frac{46}{3}, \\frac{37}{3}, 15}$.\n", - "Output Answer": [ - "$\\frac{357420}{38177}$" - ], - "Output Program": [ - "import statistics\nvalues = (14/3), (46/3), (37/3), 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -2 e, -6, 2} \\setminus {e, -2, -6, 5, -5}$.\n", - "Output Answer": [ - "${-2 e, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -2*math.e, -6, 2,))\nsnd = set((math.e, -2, -6, 5, -5,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 0, -4, 6, 7, \\sqrt{5}, 0, \\frac{2}{\\sqrt{\\pi }}, -5, 4, -\\frac{16}{3}, \\frac{4}{7}, -8, 6, -5}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 0, -4, 6, 7, math.sqrt(5), 0, (2/(math.sqrt(math.pi))), -5, 4, -(16/3), (4/7), -8, 6, -5\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, 36, 64, 256, 8}$.\n", - "Output Answer": [ - "$8\\ 2^{4/5} 3^{2/5} \\sqrt[5]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 36, 64, 256, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 18, 19, 16}$.\n", - "Output Answer": [ - "$\\frac{10944}{3203}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 18, 19, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${6 \\sqrt{2}, 4, -2 \\sqrt{2}, 0, 2, -\\frac{17}{e}, 1, -5, -3} \\cup {-2 \\sqrt{2}, 1, -\\frac{17}{e}, 6 \\sqrt{2}, -3}$.\n", - "Output Answer": [ - "${-\\frac{17}{e}, -5, -3, -2 \\sqrt{2}, 0, 1, 2, 4, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6*math.sqrt(2), 4, -2*math.sqrt(2), 0, 2, -(17/math.e), 1, -5, -3,))\nsnd = set((-2*math.sqrt(2), 1, -(17/math.e), 6*math.sqrt(2), -3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -9, \\frac{17}{7}, 4, -e, -\\sqrt{2}, -4, -2, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -9, (17/7), 4, -math.e, -math.sqrt(2), -4, -2, -6*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${8, -6, 2, \\frac{23}{5}, -2, -8, -4 \\sqrt{3}, \\frac{6}{e}, 3, -6, \\frac{23}{4}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, -6, 2, (23/5), -2, -8, -4*math.sqrt(3), (6/math.e), 3, -6, (23/4)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -14, -12, -7, 3, -9}$.\n", - "Output Answer": [ - "$\\frac{934}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -14, -12, -7, 3, -9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.115,0.111,0.357,0.155\\}$ and $\\{0.117,0.401,0.157,0.183\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.115, 0.111, 0.357, 0.155\ndistribution2 = 0.117, 0.401, 0.157, 0.183\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.158,0.101,0.01,0.073,0.078,0.106,0.04,0.086,0.061,0.189\\}$ and $\\{0.038,0.251,0.132,0.071,0.058,0.08,0.095,0.06,0.059,0.042\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.158, 0.101, 0.01, 0.073, 0.078, 0.106, 0.04, 0.086, 0.061, 0.189\ndistribution2 = 0.038, 0.251, 0.132, 0.071, 0.058, 0.08, 0.095, 0.06, 0.059, 0.042\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-1.1, \\pi, -3 \\log (2)}$.\n", - "Output Answer": [ - "${-3 \\log (2), -1.1, \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -1.1, math.pi, -3*math.log(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{22}{5}, -4 \\sqrt{3}, 1, \\sqrt{5}, -\\frac{14}{5}, 2 e, 0, -\\frac{24}{\\pi }, -3, -\\frac{16}{7}, 7.3} \\cup {7, \\frac{17}{5}, -\\frac{16}{7}, \\frac{2}{\\sqrt{3}}, -3, \\sqrt{5}, -8, 2 e, 7.3}$.\n", - "Output Answer": [ - "${-8, -\\frac{24}{\\pi }, -4 \\sqrt{3}, -\\frac{22}{5}, -3, -\\frac{14}{5}, -\\frac{16}{7}, 0, 1, \\frac{2}{\\sqrt{3}}, \\sqrt{5}, \\frac{17}{5}, 2 e, 7, 7.3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(22/5), -4*math.sqrt(3), 1, math.sqrt(5), -(14/5), 2*math.e, 0, -(24/math.pi), -3, -(16/7), 7.3,))\nsnd = set((7, (17/5), -(16/7), (2/(math.sqrt(3))), -3, math.sqrt(5), -8, 2*math.e, 7.3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{3}{\\sqrt{2}}, -7, -\\frac{2}{\\sqrt{5}}, 0, 2, -4, \\frac{1}{\\sqrt{3}}, -2.59}$.\n", - "Output Answer": [ - "${-7, -4, -2.59, -\\frac{3}{\\sqrt{2}}, -\\frac{2}{\\sqrt{5}}, 0, \\frac{1}{\\sqrt{3}}, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/(math.sqrt(2))), -7, -(2/(math.sqrt(5))), 0, 2, -4, (1/(math.sqrt(3))), -2.59\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\pi, 2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, 2 \\pi, 2 \\pi, 3 \\pi, 2 \\pi, 2 \\pi, 2 \\pi, 3 \\pi, -2 \\pi, 3 \\pi, 3 \\pi, 2 \\pi, 2 \\pi, 3 \\pi}$.\n", - "Output Answer": [ - "$\\{2 \\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.pi, 2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, 2*math.pi, 2*math.pi, 3*math.pi, 2*math.pi, 2*math.pi, 2*math.pi, 3*math.pi, -2*math.pi, 3*math.pi, 3*math.pi, 2*math.pi, 2*math.pi, 3*math.pi\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5 \\log (2), 8 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{3 \\log (2)}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -5*math.log(2), 8*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -1, -1, -1, 5, 5, -1, -1, -5, 5, -5, -5, -5, 5, 5, -1, -5, -5, -5, -5, -1, 5}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -1, -1, -1, 5, 5, -1, -1, -5, 5, -5, -5, -5, 5, 5, -1, -5, -5, -5, -5, -1, 5\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{4}{5}, \\frac{44}{5}, \\frac{13}{5}, -\\frac{14}{5}, -\\frac{4}{5}, \\frac{13}{5}, 3, -\\frac{29}{5}, 9, -\\frac{4}{5}, 3, \\frac{13}{5}, 3, -\\frac{4}{5}, 9, \\frac{44}{5}, -\\frac{14}{5}, -\\frac{4}{5}, \\frac{17}{5}, 3, \\frac{13}{5}, -\\frac{4}{5}, \\frac{13}{5}, 9, \\frac{44}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{4}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(4/5), (44/5), (13/5), -(14/5), -(4/5), (13/5), 3, -(29/5), 9, -(4/5), 3, (13/5), 3, -(4/5), 9, (44/5), -(14/5), -(4/5), (17/5), 3, (13/5), -(4/5), (13/5), 9, (44/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -10, 10, 10}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{22}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -10, 10, 10\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 5, 14}$.\n", - "Output Answer": [ - "$\\frac{210}{89}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 5, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.049,0.061,0.143,0.139,0.131,0.103,0.044,0.175,0.027,0.056\\}$ and $\\{0.128,0.141,0.009,0.067,0.037,0.159,0.036,0.074,0.169,0.125\\}$.", - "Output Answer": [ - "$0.65$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.049, 0.061, 0.143, 0.139, 0.131, 0.103, 0.044, 0.175, 0.027, 0.056\ndistribution2 = 0.128, 0.141, 0.009, 0.067, 0.037, 0.159, 0.036, 0.074, 0.169, 0.125\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{31}{3}, \\frac{55}{3}, \\frac{50}{3}}$.\n", - "Output Answer": [ - "$\\frac{17050}{1201}$" - ], - "Output Program": [ - "import statistics\nvalues = (31/3), (55/3), (50/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 10, 6, 7, -9, 9}$.\n", - "Output Answer": [ - "$\\frac{1481}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 10, 6, 7, -9, 9\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.804,0.033,0.134,0.011\\}$ and $\\{0.257,0.258,0.108,0.211\\}$.", - "Output Answer": [ - "$0.7$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.804, 0.033, 0.134, 0.011\ndistribution2 = 0.257, 0.258, 0.108, 0.211\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-e, -2 e, -2 e, -2 e, -2 e, -2 e, -2 e, -2 e, -e, -e, -2 e, -e, 3 e, -2 e, -e, -2 e, -2 e, -2 e, -2 e, -e, 3 e, 3 e, -2 e, -2 e, -e, 3 e, -2 e, -2 e}$.\n", - "Output Answer": [ - "$\\{-2 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.e, -2*math.e, -2*math.e, -2*math.e, -2*math.e, -2*math.e, -2*math.e, -2*math.e, -math.e, -math.e, -2*math.e, -math.e, 3*math.e, -2*math.e, -math.e, -2*math.e, -2*math.e, -2*math.e, -2*math.e, -math.e, 3*math.e, 3*math.e, -2*math.e, -2*math.e, -math.e, 3*math.e, -2*math.e, -2*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{31}{4}, -\\frac{26}{\\pi }, -4 \\log (2), -7} \\setminus {-\\frac{26}{\\pi }, -\\frac{8}{3}, -8, -6, \\frac{31}{4}}$.\n", - "Output Answer": [ - "${-7, -4 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set(((31/4), -(26/math.pi), -4*math.log(2), -7,))\nsnd = set((-(26/math.pi), -(8/3), -8, -6, (31/4),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${9, -1, 1, -8, -7, 4, -6, 3, 10, 6, -5, 0} \\cap {-8, -1, -6, 0, -2, 4, 1, 3, -5, 9, 2, -10, -4}$.\n", - "Output Answer": [ - "${-8, -6, -5, -1, 0, 1, 3, 4, 9}$" - ], - "Output Program": [ - "fst = set((9, -1, 1, -8, -7, 4, -6, 3, 10, 6, -5, 0,))\nsnd = set((-8, -1, -6, 0, -2, 4, 1, 3, -5, 9, 2, -10, -4,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-6.74, -\\frac{29}{\\pi }, -\\sqrt{5}, -7, -\\frac{17}{\\sqrt{\\pi }}, 3 \\sqrt{5}, -4} \\setminus {-\\sqrt{5}, -7, -2 \\sqrt{5}, 9}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{\\pi }}, -\\frac{29}{\\pi }, -6.74, -4, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6.74, -(29/math.pi), -math.sqrt(5), -7, -(17/(math.sqrt(math.pi))), 3*math.sqrt(5), -4,))\nsnd = set((-math.sqrt(5), -7, -2*math.sqrt(5), 9,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{7}{\\sqrt{2}}, 2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{4} \\left(\\frac{3}{\\sqrt{2}}+2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(7/(math.sqrt(2))), 2*math.sqrt(2), (1/(math.sqrt(2))), (9/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, 8, -6, -9, 8, 6, 0, -8}$.\n", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, 8, -6, -9, 8, 6, 0, -8\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${3 \\sqrt{2}, -5.9, \\frac{11}{2}, 4 \\sqrt{3}, -3, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5.9, -4 \\sqrt{2}, -3, 3 \\sqrt{2}, \\frac{11}{2}, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(2), -5.9, (11/2), 4*math.sqrt(3), -3, -4*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -\\frac{1}{7}, -10, 3, -\\frac{1}{7}, 3, \\frac{36}{7}, \\frac{20}{7}, \\frac{36}{7}, -\\frac{50}{7}, \\frac{36}{7}, -\\frac{50}{7}, -\\frac{1}{7}, -\\frac{50}{7}, \\frac{20}{7}, \\frac{20}{7}, -\\frac{1}{7}, -\\frac{50}{7}, -\\frac{50}{7}, 3, \\frac{36}{7}, -\\frac{1}{7}, -\\frac{1}{7}, \\frac{20}{7}, \\frac{36}{7}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{1}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -(1/7), -10, 3, -(1/7), 3, (36/7), (20/7), (36/7), -(50/7), (36/7), -(50/7), -(1/7), -(50/7), (20/7), (20/7), -(1/7), -(50/7), -(50/7), 3, (36/7), -(1/7), -(1/7), (20/7), (36/7)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{16}{3}, 1, 9, \\frac{19}{3}, -\\frac{26}{3}, 10, -\\frac{28}{3}, \\frac{13}{3}, -\\frac{22}{3}, \\frac{5}{3}, -10, -1, \\frac{28}{3}} \\cap {0, 9, -\\frac{8}{3}, -\\frac{14}{3}, -\\frac{10}{3}, 1, -1, -\\frac{2}{3}, \\frac{1}{3}, \\frac{5}{3}, 8, -\\frac{13}{3}, \\frac{17}{3}, -2, \\frac{13}{3}}$.\n", - "Output Answer": [ - "${-1, 1, \\frac{5}{3}, \\frac{13}{3}, 9}$" - ], - "Output Program": [ - "fst = set((-(16/3), 1, 9, (19/3), -(26/3), 10, -(28/3), (13/3), -(22/3), (5/3), -10, -1, (28/3),))\nsnd = set((0, 9, -(8/3), -(14/3), -(10/3), 1, -1, -(2/3), (1/3), (5/3), 8, -(13/3), (17/3), -2, (13/3),))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -3, -5, -9, -2, -2, -9, -3, -2, -3, -6, -2, -5, -9, -2, -9, -6, -5, -5, -5, -6, -5, -3, -6, -9, -2, -9}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -3, -5, -9, -2, -2, -9, -3, -2, -3, -6, -2, -5, -9, -2, -9, -6, -5, -5, -5, -6, -5, -3, -6, -9, -2, -9\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -7, 7, 5, -2, 0}$.\n", - "Output Answer": [ - "$\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -7, 7, 5, -2, 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -5, 3, 4, -5, 4, 1, 10, -5, -5, 10, 10, 1, 3, 8, 1, 3, 8, 8, 8, 3, -5, 1, 7, -5, -5, 4, 4, 3, 1}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -5, 3, 4, -5, 4, 1, 10, -5, -5, 10, 10, 1, 3, 8, 1, 3, 8, 8, 8, 3, -5, 1, 7, -5, -5, 4, 4, 3, 1\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-4, \\frac{17}{4}, 9}$.\n", - "Output Answer": [ - "${-4, \\frac{17}{4}, 9}$" - ], - "Output Program": [ - "values = -4, (17/4), 9\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{19}{3}, \\frac{8}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{5}}, \\frac{11}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{19}{3}-\\frac{8}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (19/3), (8/(math.sqrt(math.pi))), (11/(math.sqrt(5))), (11/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{13}{2}, 10, -1, 5, 7, 1, 4, -e} \\cup {4, -e, -3, 3, -3.329, -1, -\\frac{13}{2}, 10, 5, 7}$.\n", - "Output Answer": [ - "${-\\frac{13}{2}, -3.329, -3, -e, -1, 1, 3, 4, 5, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/2), 10, -1, 5, 7, 1, 4, -math.e,))\nsnd = set((4, -math.e, -3, 3, -3.329, -1, -(13/2), 10, 5, 7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{3}{2}, \\frac{3}{2}, 17, 12}$.\n", - "Output Answer": [ - "$\\frac{816}{301}$" - ], - "Output Program": [ - "import statistics\nvalues = (3/2), (3/2), 17, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\frac{14}{\\sqrt{5}}, 7 \\sqrt{2}, -6, -9.8, -\\frac{12}{\\sqrt{\\pi }}} \\setminus {-7, -3 \\sqrt{2}, -3, 0, -9.8, -7.2, \\frac{2}{\\sqrt{5}}, 6, -\\frac{12}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-6, \\frac{14}{\\sqrt{5}}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (14/(math.sqrt(5))), 7*math.sqrt(2), -6, -9.8, -(12/(math.sqrt(math.pi))),))\nsnd = set((-7, -3*math.sqrt(2), -3, 0, -9.8, -7.2, (2/(math.sqrt(5))), 6, -(12/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 5, 2, 6, -2, -7, -3, 3}$.\n", - "Output Answer": [ - "$-\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 5, 2, 6, -2, -7, -3, 3\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.027,0.007,0.039,0.002,0.268,0.037,0.276,0.186\\}$ and $\\{0.227,0.184,0.059,0.039,0.099,0.043,0.07,0.18\\}$.", - "Output Answer": [ - "$0.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.027, 0.007, 0.039, 0.002, 0.268, 0.037, 0.276, 0.186\ndistribution2 = 0.227, 0.184, 0.059, 0.039, 0.099, 0.043, 0.07, 0.18\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{31}{5}, -\\frac{16}{5}, -6, -\\frac{31}{5}, -\\frac{31}{5}, -\\frac{13}{5}, -\\frac{16}{5}, 3, -\\frac{31}{5}, -6, -\\frac{31}{5}, 3, 3, -\\frac{16}{5}, -6, -5, -\\frac{31}{5}, -\\frac{31}{5}, -\\frac{46}{5}, -\\frac{16}{5}, -\\frac{31}{5}, -5, -\\frac{13}{5}, 3, -\\frac{46}{5}, -\\frac{13}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{31}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(31/5), -(16/5), -6, -(31/5), -(31/5), -(13/5), -(16/5), 3, -(31/5), -6, -(31/5), 3, 3, -(16/5), -6, -5, -(31/5), -(31/5), -(46/5), -(16/5), -(31/5), -5, -(13/5), 3, -(46/5), -(13/5)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{22}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{1}{4} \\left(\\frac{47}{\\sqrt{5}}-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (22/(math.sqrt(5))), (14/(math.sqrt(5))), (11/(math.sqrt(5))), -2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${5, -9, 5, -2 \\sqrt{5}, \\frac{26}{3}, 1}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -9, 5, -2*math.sqrt(5), (26/3), 1\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.086,0.002,0.067,0.001,0.059,0.307,0.139,0.007\\}$ and $\\{0.137,0.15,0.085,0.114,0.074,0.122,0.136,0.081\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.086, 0.002, 0.067, 0.001, 0.059, 0.307, 0.139, 0.007\ndistribution2 = 0.137, 0.15, 0.085, 0.114, 0.074, 0.122, 0.136, 0.081\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -\\log (2), 7, 5, 8, -4, 9, 9, -\\frac{8}{3}, -6, -2}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -math.log(2), 7, 5, 8, -4, 9, 9, -(8/3), -6, -2\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.118,0.05,0.097,0.003,0.498\\}$ and $\\{0.19,0.12,0.356,0.13,0.112\\}$.", - "Output Answer": [ - "$0.83$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.118, 0.05, 0.097, 0.003, 0.498\ndistribution2 = 0.19, 0.12, 0.356, 0.13, 0.112\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x^2+2.8 x-4.6$ where $x \\sim $ \\text{NormalDistribution}[-1.5,2.1]\n", - "Output Answer": [ - "$-32.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.5, 2.1)\nprint(E(-3.5*x**2+2.8*x-4.6))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -6, -3 \\log (2), 8, -3, 6, 10} \\setminus {\\frac{14}{\\sqrt{5}}, 4, 7, 1, 8}$.\n", - "Output Answer": [ - "${-7, -6, -3, -3 \\log (2), 6, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -6, -3*math.log(2), 8, -3, 6, 10,))\nsnd = set(((14/(math.sqrt(5))), 4, 7, 1, 8,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${1, 1, 3, -1, 2 \\sqrt{5}, -6 \\log (2), 6, 1, 0, -\\log (2), 2, -\\frac{20}{3}, -2 e, -5, -2}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 1, 3, -1, 2*math.sqrt(5), -6*math.log(2), 6, 1, 0, -math.log(2), 2, -(20/3), -2*math.e, -5, -2\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.085,0.044,0.077,0.211,0.09,0.108,0.147,0.173\\}$ and $\\{0.127,0.137,0.161,0.035,0.087,0.082,0.146,0.075\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.085, 0.044, 0.077, 0.211, 0.09, 0.108, 0.147, 0.173\ndistribution2 = 0.127, 0.137, 0.161, 0.035, 0.087, 0.082, 0.146, 0.075\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${8, \\frac{35}{4}, -\\frac{9}{2}}$.\n", - "Output Answer": [ - "${-\\frac{9}{2}, 8, \\frac{35}{4}}$" - ], - "Output Program": [ - "values = 8, (35/4), -(9/2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, -343, -1000}$.\n", - "Output Answer": [ - "$280$" - ], - "Output Program": [ - "import math\n\nvalues = 64, -343, -1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{2}{3}, \\frac{47}{3}, \\frac{16}{3}}$.\n", - "Output Answer": [ - "$\\frac{752}{439}$" - ], - "Output Program": [ - "import statistics\nvalues = (2/3), (47/3), (16/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{3}{\\sqrt{\\pi }}, 6, 0, 2, -\\frac{6}{5}, 2, 2, \\frac{30}{\\pi }, -4, -8, -\\frac{27}{e}, -4, 4 \\sqrt{2}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{27}{e}+\\frac{30}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (3/(math.sqrt(math.pi))), 6, 0, 2, -(6/5), 2, 2, (30/math.pi), -4, -8, -(27/math.e), -4, 4*math.sqrt(2), -2*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 18, 10}$.\n", - "Output Answer": [ - "$\\frac{945}{94}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 18, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${343, 100, -1, 4}$.\n", - "Output Answer": [ - "$(1+i) 7^{3/4} \\sqrt{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 343, 100, -1, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, 3, -5, 8, 7, 5, 2, -1, 9, -7, -4, -6, -2} \\cap {-9, 3, 2, -5, 9, 5, -4, -8, -2, 8, 4, -6}$.\n", - "Output Answer": [ - "${-9, -6, -5, -4, -2, 2, 3, 5, 8, 9}$" - ], - "Output Program": [ - "fst = set((-9, 3, -5, 8, 7, 5, 2, -1, 9, -7, -4, -6, -2,))\nsnd = set((-9, 3, 2, -5, 9, 5, -4, -8, -2, 8, 4, -6,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-4, -\\frac{39}{4}, \\frac{31}{7}, 4, -2 \\sqrt{3}, \\frac{5}{\\sqrt{2}}, \\frac{3}{2}} \\cup {-4 \\sqrt{3}, -\\frac{39}{4}, \\frac{3}{2}, -\\frac{3}{7}, \\frac{17}{7}, -7, \\frac{5}{\\sqrt{2}}, 3}$.\n", - "Output Answer": [ - "${-\\frac{39}{4}, -7, -4 \\sqrt{3}, -4, -2 \\sqrt{3}, -\\frac{3}{7}, \\frac{3}{2}, \\frac{17}{7}, 3, \\frac{5}{\\sqrt{2}}, 4, \\frac{31}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -(39/4), (31/7), 4, -2*math.sqrt(3), (5/(math.sqrt(2))), (3/2),))\nsnd = set((-4*math.sqrt(3), -(39/4), (3/2), -(3/7), (17/7), -7, (5/(math.sqrt(2))), 3,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 2, \\frac{55}{7}, 5} \\setminus {-9, 5, \\frac{61}{7}, 10}$.\n", - "Output Answer": [ - "${2, \\frac{55}{7}}$" - ], - "Output Program": [ - "fst = set((-9, 2, (55/7), 5,))\nsnd = set((-9, 5, (61/7), 10,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^2-0.8 x-3.1$ where $x \\sim $ \\text{BetaDistribution}[1.9,0.3]\n", - "Output Answer": [ - "$-5.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 0.3)\nprint(E(-1.9*x**2-0.8*x-3.1))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-0.629, 0, -9, -\\frac{1}{\\sqrt{3}}, 10, \\frac{3}{2}, 4, 1, -\\frac{39}{4}} \\cup {-6, 1, 4, 0, 2, -2, -\\frac{7}{4}, -7.667, -9}$.\n", - "Output Answer": [ - "${-\\frac{39}{4}, -9, -7.667, -6, -2, -\\frac{7}{4}, -0.629, -\\frac{1}{\\sqrt{3}}, 0, 1, \\frac{3}{2}, 2, 4, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.629, 0, -9, -(1/(math.sqrt(3))), 10, (3/2), 4, 1, -(39/4),))\nsnd = set((-6, 1, 4, 0, 2, -2, -(7/4), -7.667, -9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -4, -1, 5.58, -5, 3 \\sqrt{3}, \\frac{17}{4}} \\setminus {-4, -7, -\\frac{4}{\\sqrt{\\pi }}, -5, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, -1, \\frac{17}{4}, 3 \\sqrt{3}, 5.58}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -4, -1, 5.58, -5, 3*math.sqrt(3), (17/4),))\nsnd = set((-4, -7, -(4/(math.sqrt(math.pi))), -5, 2*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-7, -2, 1, \\frac{14}{\\pi }, \\frac{7}{2}, 7, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, -2, 1, \\frac{7}{2}, \\frac{14}{\\pi }, 7, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -2, 1, (14/math.pi), (7/2), 7, 6*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -3 \\sqrt{3}, 3 e, 6, \\frac{11}{\\sqrt{2}}, \\frac{9}{2}, -8, \\frac{10}{\\sqrt{3}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{9}{2}+\\frac{10}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -3*math.sqrt(3), 3*math.e, 6, (11/(math.sqrt(2))), (9/2), -8, (10/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-5 \\sqrt{3}, -\\frac{9}{\\sqrt{2}}, 1, -6, \\frac{21}{\\pi }, -\\pi, -\\frac{9}{\\sqrt{\\pi }}} \\setminus {-\\frac{15}{\\pi }, -\\frac{9}{\\sqrt{\\pi }}, 3, 3 \\sqrt{2}, -5 \\sqrt{3}, -\\pi, -6}$.\n", - "Output Answer": [ - "${-\\frac{9}{\\sqrt{2}}, 1, \\frac{21}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(3), -(9/(math.sqrt(2))), 1, -6, (21/math.pi), -math.pi, -(9/(math.sqrt(math.pi))),))\nsnd = set((-(15/math.pi), -(9/(math.sqrt(math.pi))), 3, 3*math.sqrt(2), -5*math.sqrt(3), -math.pi, -6,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${-9, 1, 0, -6, -6, -6, -8, -\\frac{19}{2}, -2 \\sqrt{3}, -1, \\sqrt{2}}$.", - "Output Answer": [ - "$-6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, 1, 0, -6, -6, -6, -8, -(19/2), -2*math.sqrt(3), -1, math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.107,0.427,0.104,0.102\\}$ and $\\{0.146,0.139,0.375,0.227\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.107, 0.427, 0.104, 0.102\ndistribution2 = 0.146, 0.139, 0.375, 0.227\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -\\frac{9}{4}, -2, \\frac{3}{2}, -\\frac{9}{4}, \\frac{3}{2}, \\frac{13}{4}, -2, \\frac{13}{4}, -\\frac{9}{4}, -2, \\frac{3}{2}, -2, -2, -2, -\\frac{9}{4}, \\frac{13}{4}, \\frac{3}{2}, -\\frac{9}{4}, \\frac{13}{4}, -\\frac{9}{4}, \\frac{13}{4}, \\frac{3}{2}, -2, \\frac{13}{4}, \\frac{3}{2}, -\\frac{9}{4}, -2, -\\frac{9}{4}, \\frac{3}{2}}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -(9/4), -2, (3/2), -(9/4), (3/2), (13/4), -2, (13/4), -(9/4), -2, (3/2), -2, -2, -2, -(9/4), (13/4), (3/2), -(9/4), (13/4), -(9/4), (13/4), (3/2), -2, (13/4), (3/2), -(9/4), -2, -(9/4), (3/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.097,0.131,0.126,0.069,0.15\\}$ and $\\{0.128,0.054,0.214,0.178,0.186\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.097, 0.131, 0.126, 0.069, 0.15\ndistribution2 = 0.128, 0.054, 0.214, 0.178, 0.186\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${0, -3, 5, \\frac{22}{\\pi }, 6, 8} \\cup {\\frac{22}{\\pi }, \\frac{8}{e}, -3, 8, 7}$.\n", - "Output Answer": [ - "${-3, 0, \\frac{8}{e}, 5, 6, 7, \\frac{22}{\\pi }, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -3, 5, (22/math.pi), 6, 8,))\nsnd = set(((22/math.pi), (8/math.e), -3, 8, 7,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${10, -7}$.\n", - "Output Answer": [ - "$\\frac{289}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -7\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{56}{3}, 16, 7, 6}$.\n", - "Output Answer": [ - "$\\frac{1344}{143}$" - ], - "Output Program": [ - "import statistics\nvalues = (56/3), 16, 7, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, 10, 12, 8, -13, 10}$.\n", - "Output Answer": [ - "$\\frac{2597}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 10, 12, 8, -13, 10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 64, 15625, 1000000, 3, -16807}$.\n", - "Output Answer": [ - "$200 \\sqrt[6]{-3} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 64, 15625, 1000000, 3, -16807\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{2}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{2}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{\\pi }}, -\\frac{2}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{2}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, -\\frac{2}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{17}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(2/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), (11/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(2/(math.sqrt(math.pi))), (11/(math.sqrt(math.pi))), -(2/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (11/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(2/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), -(2/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x^2-2. x+2.5$ where $x \\sim $ \\text{PoissonDistribution}[3.1]\n", - "Output Answer": [ - "$43.33$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.1)\nprint(E(3.7*x**2-2.*x+2.5))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${-2, 0, \\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-2, 0, \\frac{8}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 0, (8/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4096, 1, 256, 1296}$.\n", - "Output Answer": [ - "$192$" - ], - "Output Program": [ - "import math\n\nvalues = 4096, 1, 256, 1296\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, 27, 1, 2401, 625}$.\n", - "Output Answer": [ - "$7 \\sqrt[5]{-1} 3^{3/5} 5^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 27, 1, 2401, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${7.516, -2, \\frac{13}{\\sqrt{5}}, -3, 1} \\setminus {11 \\log (2), 5, 9, 0, 7.516}$.\n", - "Output Answer": [ - "${-3, -2, 1, \\frac{13}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.516, -2, (13/(math.sqrt(5))), -3, 1,))\nsnd = set((11*math.log(2), 5, 9, 0, 7.516,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 12, 7, 1}$.\n", - "Output Answer": [ - "$\\frac{336}{131}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 12, 7, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${27, 81, -27, 2, -5}$.\n", - "Output Answer": [ - "$9 \\sqrt[5]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 27, 81, -27, 2, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, \\frac{17}{2}, \\frac{17}{2}, \\frac{33}{2}}$.\n", - "Output Answer": [ - "$\\frac{2244}{217}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, (17/2), (17/2), (33/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.7 < -2.3 x-2.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3].", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(P((-2.7 < -2.3*x-2.6)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.121,0.247,0.11,0.221,0.121\\}$ and $\\{0.144,0.331,0.034,0.122,0.105\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.121, 0.247, 0.11, 0.221, 0.121\ndistribution2 = 0.144, 0.331, 0.034, 0.122, 0.105\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-1.84 < 2.8 x^2-2.6 x-0.9 < 0.64$ where $x \\sim $ \\text{NormalDistribution}[-1.3,1.5].", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.3, 1.5)\nprint(P((-1.84 < 2.8*x**2-2.6*x-0.9) & (2.8*x**2-2.6*x-0.9 < 0.64)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 e, -2, -\\frac{4}{\\sqrt{3}}, 10, -4, -9, -\\pi}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.e, -2, -(4/(math.sqrt(3))), 10, -4, -9, -math.pi\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-5, 7, -7 \\log (2), e, 5, -2} \\cup {3, 8, e, 0, 5, -5, -13 \\log (2), -\\frac{1}{4}, -2}$.\n", - "Output Answer": [ - "${-13 \\log (2), -5, -7 \\log (2), -2, -\\frac{1}{4}, 0, e, 3, 5, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 7, -7*math.log(2), math.e, 5, -2,))\nsnd = set((3, 8, math.e, 0, 5, -5, -13*math.log(2), -(1/4), -2,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{40}{3}, \\frac{59}{3}, \\frac{7}{3}, 1}$.\n", - "Output Answer": [ - "$\\frac{66080}{25679}$" - ], - "Output Program": [ - "import statistics\nvalues = (40/3), (59/3), (7/3), 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-2.25 < -0.4 x-0.1 < -0.06$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3].", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(P((-2.25 < -0.4*x-0.1) & (-0.4*x-0.1 < -0.06)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{13}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}, 0}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{2}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (13/(math.sqrt(2))), -(11/(math.sqrt(2))), 0\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.13,0.094,0.242,0.031,0.093,0.061,0.063,0.082\\}$ and $\\{0.108,0.094,0.088,0.126,0.083,0.088,0.129,0.072\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.13, 0.094, 0.242, 0.031, 0.093, 0.061, 0.063, 0.082\ndistribution2 = 0.108, 0.094, 0.088, 0.126, 0.083, 0.088, 0.129, 0.072\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 0, \\frac{43}{5}, \\frac{19}{\\pi }, 0, -6 \\log (2), \\frac{7}{e}, -\\frac{3}{\\pi }, -10}$.\n", - "Output Answer": [ - "$\\frac{93}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 0, (43/5), (19/math.pi), 0, -6*math.log(2), (7/math.e), -(3/math.pi), -10\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 4, -\\frac{7}{5}, 10, 1, 3, 0}$.\n", - "Output Answer": [ - "$\\frac{57}{5}$" - ], - "Output Program": [ - "values = 7, 4, -(7/5), 10, 1, 3, 0\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{1}{4}, \\frac{1}{2}, \\frac{21}{4}, -\\frac{37}{4}, \\frac{1}{2}, -4, -\\frac{37}{4}, -\\frac{1}{4}, -4, \\frac{1}{2}, -4, -4, \\frac{1}{2}, -\\frac{1}{4}, \\frac{1}{2}, -\\frac{1}{4}, -4, \\frac{1}{2}, \\frac{1}{2}, -4, -\\frac{37}{4}, \\frac{1}{2}, -4, \\frac{21}{4}, -\\frac{37}{4}, -\\frac{1}{4}, -\\frac{1}{4}, -4, -\\frac{1}{4}, \\frac{1}{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{1}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(1/4), (1/2), (21/4), -(37/4), (1/2), -4, -(37/4), -(1/4), -4, (1/2), -4, -4, (1/2), -(1/4), (1/2), -(1/4), -4, (1/2), (1/2), -4, -(37/4), (1/2), -4, (21/4), -(37/4), -(1/4), -(1/4), -4, -(1/4), (1/2)\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 2 \\sqrt{3}, -\\frac{28}{\\pi }, \\frac{9}{\\sqrt{2}}, \\sqrt{5}, \\frac{8}{e}, -3, \\sqrt{5}, -5, -8}$.\n", - "Output Answer": [ - "$\\frac{9}{\\sqrt{2}}+\\frac{28}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 2*math.sqrt(3), -(28/math.pi), (9/(math.sqrt(2))), math.sqrt(5), (8/math.e), -3, math.sqrt(5), -5, -8\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 5, 3}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "values = -2, 5, 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.097,0.271,0.317,0.28\\}$ and $\\{0.166,0.267,0.185,0.201\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.097, 0.271, 0.317, 0.28\ndistribution2 = 0.166, 0.267, 0.185, 0.201\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2 e, e, -4 e, 2 e, -3 e, 3 e, 0} \\cap {-e, -3 e, 2 e, 3 e, 0, e}$.\n", - "Output Answer": [ - "${-3 e, 0, e, 2 e, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, math.e, -4*math.e, 2*math.e, -3*math.e, 3*math.e, 0,))\nsnd = set((-math.e, -3*math.e, 2*math.e, 3*math.e, 0, math.e,))\nprint(fst.intersection(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{\\sqrt{5}}, -4, 7, -\\frac{1}{4}, -\\frac{24}{e}, 2, -\\frac{12}{\\sqrt{\\pi }}, -5}$.\n", - "Output Answer": [ - "${-\\frac{24}{e}, -\\frac{12}{\\sqrt{\\pi }}, -5, -4, -\\frac{1}{4}, \\frac{1}{\\sqrt{5}}, 2, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = (1/(math.sqrt(5))), -4, 7, -(1/4), -(24/math.e), 2, -(12/(math.sqrt(math.pi))), -5\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nSort ${\\frac{22}{\\pi }, -\\log (2), -8, -\\frac{43}{5}, -8, -\\frac{2}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{43}{5}, -8, -8, -\\frac{2}{\\sqrt{3}}, -\\log (2), \\frac{22}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (22/math.pi), -math.log(2), -8, -(43/5), -8, -(2/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -13, -2, -9, -10}$.\n", - "Output Answer": [ - "$\\frac{707}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -13, -2, -9, -10\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x^2-3.7 x+3.9$ where $x \\sim $ \\text{NormalDistribution}[0.4,1.1]\n", - "Output Answer": [ - "$5.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.4, 1.1)\nprint(E(2.6*x**2-3.7*x+3.9))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -8, 5, -9, -6, 8}$.\n", - "Output Answer": [ - "$\\frac{158}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -8, 5, -9, -6, 8\nprint(statistics.variance(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${1, 8, -3}$.\n", - "Output Answer": [ - "$\\sqrt{31}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 8, -3\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, 100000, -7, 1296, 6561}$.\n", - "Output Answer": [ - "$180 \\sqrt[5]{-7} 3^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 100000, -7, 1296, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, -9}$.\n", - "Output Answer": [ - "$3 \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nCompute the median of ${7, -3, -2 \\sqrt{5}, -7, -4, 3, 3, 8, 0, 3, -5, 9}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -3, -2*math.sqrt(5), -7, -4, 3, 3, 8, 0, 3, -5, 9\nprint(statistics.median(values)) \n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, -9, 10, -3, 8, -13}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{406}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -9, 10, -3, 8, -13\nprint(statistics.stdev(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-12 \\log (2), 0, 4 \\log (2), -7 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{15 \\log (2)}{4}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -12*math.log(2), 0, 4*math.log(2), -7*math.log(2)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.099,0.044,0.098,0.123,0.144,0.093,0.073,0.117,0.116\\}$ and $\\{0.118,0.099,0.097,0.162,0.093,0.041,0.055,0.223,0.079\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.099, 0.044, 0.098, 0.123, 0.144, 0.093, 0.073, 0.117, 0.116\ndistribution2 = 0.118, 0.099, 0.097, 0.162, 0.093, 0.041, 0.055, 0.223, 0.079\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, 0, 3, 3, 0, 2, 3, 0, 2, 0, 0, 3, 2, 3, 3, 2, 3, 0, 2, 3, 2, 3, 2, 3, 3}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, 0, 3, 3, 0, 2, 3, 0, 2, 0, 0, 3, 2, 3, 3, 2, 3, 0, 2, 3, 2, 3, 2, 3, 3\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-7, \\frac{17}{2}, -5, 2.65} \\setminus {-4.8, 1, -5, 5.31}$.\n", - "Output Answer": [ - "${-7, 2.65, \\frac{17}{2}}$" - ], - "Output Program": [ - "fst = set((-7, (17/2), -5, 2.65,))\nsnd = set((-4.8, 1, -5, 5.31,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{21}{\\sqrt{5}}, -2 \\sqrt{3}, -\\frac{7}{2}, -3, \\frac{5}{\\sqrt{\\pi }}, -2 e, \\frac{7}{\\sqrt{5}}, 6} \\setminus {5., -2 e, 2, -3, \\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-\\frac{21}{\\sqrt{5}}, -\\frac{7}{2}, -2 \\sqrt{3}, \\frac{5}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{5}}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(21/(math.sqrt(5))), -2*math.sqrt(3), -(7/2), -3, (5/(math.sqrt(math.pi))), -2*math.e, (7/(math.sqrt(5))), 6,))\nsnd = set((5., -2*math.e, 2, -3, (9/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 13, 8, 17}$.\n", - "Output Answer": [ - "$\\frac{7072}{903}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 13, 8, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-e, -e, -4 e, -4 e, -e, -4 e, -e, -e, -e, -e, -4 e, -3 e, -4 e, -e, -3 e, -4 e, -e, -e, -e, -e, -e, -3 e, -e, -e, -4 e, -3 e, -3 e, -3 e, -3 e, -3 e}$.\n", - "Output Answer": [ - "$\\{-e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.e, -math.e, -4*math.e, -4*math.e, -math.e, -4*math.e, -math.e, -math.e, -math.e, -math.e, -4*math.e, -3*math.e, -4*math.e, -math.e, -3*math.e, -4*math.e, -math.e, -math.e, -math.e, -math.e, -math.e, -3*math.e, -math.e, -math.e, -4*math.e, -3*math.e, -3*math.e, -3*math.e, -3*math.e, -3*math.e\nprint(mode(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 6, \\frac{14}{\\pi }, -\\frac{26}{\\pi }, -1, -5, -2 \\pi, \\frac{46}{7}, 2, 3}$.\n", - "Output Answer": [ - "$\\frac{46}{7}+\\frac{26}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 6, (14/math.pi), -(26/math.pi), -1, -5, -2*math.pi, (46/7), 2, 3\nprint(max(values) - min(values))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nFind the probability that $-3.15 < 3.5 x-2.6 < -1.1$ where $x \\sim $ \\text{NormalDistribution}[-1.3,0.8].", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.3, 0.8)\nprint(P((-3.15 < 3.5*x-2.6) & (3.5*x-2.6 < -1.1)))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.109,0.107,0.017,0.093,0.079,0.087,0.146,0.241\\}$ and $\\{0.131,0.098,0.073,0.095,0.109,0.254,0.024,0.069\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.109, 0.107, 0.017, 0.093, 0.079, 0.087, 0.146, 0.241\ndistribution2 = 0.131, 0.098, 0.073, 0.095, 0.109, 0.254, 0.024, 0.069\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x^3-1.4 x^2-2.2 x+4.4$ where $x \\sim $ \\text{NormalDistribution}[-0.2,1.4]\n", - "Output Answer": [ - "$-1.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.2, 1.4)\nprint(E(3.1*x**3-1.4*x**2-2.2*x+4.4))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{11}{\\pi }, -\\frac{26}{\\pi }, -\\frac{13}{\\pi }, 0, \\frac{5}{\\pi }, -\\frac{25}{\\pi }, -\\frac{5}{\\pi }, \\frac{6}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{47}{8 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (11/math.pi), -(26/math.pi), -(13/math.pi), 0, (5/math.pi), -(25/math.pi), -(5/math.pi), (6/math.pi)\nprint(mean(values))\n" - ], - "split": "train" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -6, -2 \\sqrt{2}, -9.41, 2, -5.947, -2 \\pi, 9} \\cup {-5.947, -3, -2 \\pi, 5.35, 8, -2, -8, -5, 9}$.\n", - "Output Answer": [ - "${-9.41, -8, -2 \\pi, -6, -5.947, -5, -3, -2 \\sqrt{2}, -2, 2, 5.35, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -6, -2*math.sqrt(2), -9.41, 2, -5.947, -2*math.pi, 9,))\nsnd = set((-5.947, -3, -2*math.pi, 5.35, 8, -2, -8, -5, 9,))\nprint(fst.union(snd))\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 10000, 16, -8, 9}$.\n", - "Output Answer": [ - "$8 \\sqrt[5]{-1} 3^{2/5} 5^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 10000, 16, -8, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "train" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{7}{\\sqrt{2}}, -\\frac{10}{7}, -8, 4} \\setminus {-5, \\frac{19}{\\sqrt{5}}, 4, -8, -\\frac{10}{7}, -8.879, -2}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(7/(math.sqrt(2))), -(10/7), -8, 4,))\nsnd = set((-5, (19/(math.sqrt(5))), 4, -8, -(10/7), -8.879, -2,))\nprint(fst - snd)\n" - ], - "split": "train" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{19}{2}, \\frac{23}{2}, \\frac{3}{2}, \\frac{39}{2}}$.\n", - "Output Answer": [ - "$\\frac{17043}{3878}$" - ], - "Output Program": [ - "import statistics\nvalues = (19/2), (23/2), (3/2), (39/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-2 \\log (2), \\frac{3}{\\pi }, 4, 4, 3 \\sqrt{2}, \\sqrt{2}, 5}$.\n", - "Output Answer": [ - "${-2 \\log (2), \\frac{3}{\\pi }, \\sqrt{2}, 4, 4, 3 \\sqrt{2}, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.log(2), (3/math.pi), 4, 4, 3*math.sqrt(2), math.sqrt(2), 5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, -2, 15, 3, -13}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{41}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -2, 15, 3, -13\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4096, -16807, 1296, -343, 5}$.\n", - "Output Answer": [ - "$56\\ 3^{4/5} 7^{3/5} \\sqrt[5]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 4096, -16807, 1296, -343, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, \\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\frac{684}{55}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, (19/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3, 5, -\\frac{9}{\\pi }, -3 \\log (2), 1, \\frac{8}{\\sqrt{3}}, -\\frac{41}{5}, 7.51} \\cup {13 \\log (2), -8, 7.51, 9, -\\frac{9}{\\pi }, -\\frac{41}{5}, -7, \\frac{8}{\\sqrt{3}}, 5}$.\n", - "Output Answer": [ - "${-\\frac{41}{5}, -8, -7, -\\frac{9}{\\pi }, -3 \\log (2), 1, 3, \\frac{8}{\\sqrt{3}}, 5, 7.51, 9, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 5, -(9/math.pi), -3*math.log(2), 1, (8/(math.sqrt(3))), -(41/5), 7.51,))\nsnd = set((13*math.log(2), -8, 7.51, 9, -(9/math.pi), -(41/5), -7, (8/(math.sqrt(3))), 5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{52}{3}, \\frac{53}{3}, \\frac{7}{3}, \\frac{49}{3}}$.\n", - "Output Answer": [ - "$\\frac{540176}{81579}$" - ], - "Output Program": [ - "import statistics\nvalues = (52/3), (53/3), (7/3), (49/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${5, 3 \\sqrt{2}, \\frac{38}{5}, -4 \\sqrt{2}, 2 \\sqrt{3}, \\frac{11}{\\sqrt{\\pi }}, -2 e, \\frac{5}{2}, -\\frac{19}{7}, -1, -4, 3, 5, \\frac{24}{5}, -5 \\sqrt{2}}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 3*math.sqrt(2), (38/5), -4*math.sqrt(2), 2*math.sqrt(3), (11/(math.sqrt(math.pi))), -2*math.e, (5/2), -(19/7), -1, -4, 3, 5, (24/5), -5*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${0, 3, -\\frac{18}{\\pi }, -7, 5, -6 \\log (2), 0, 9, \\frac{32}{5}, -5, -8 \\log (2)}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, 3, -(18/math.pi), -7, 5, -6*math.log(2), 0, 9, (32/5), -5, -8*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.053,0.107,0.135,0.026,0.097,0.177,0.08,0.031,0.076\\}$ and $\\{0.064,0.023,0.136,0.092,0.179,0.09,0.169,0.047,0.185\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.053, 0.107, 0.135, 0.026, 0.097, 0.177, 0.08, 0.031, 0.076\ndistribution2 = 0.064, 0.023, 0.136, 0.092, 0.179, 0.09, 0.169, 0.047, 0.185\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{36}{5}, 5, \\frac{25}{4}, -2 \\pi} \\cup {\\frac{36}{5}, \\frac{25}{4}, 5, -\\pi}$.\n", - "Output Answer": [ - "${-2 \\pi, -\\pi, 5, \\frac{25}{4}, \\frac{36}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((36/5), 5, (25/4), -2*math.pi,))\nsnd = set(((36/5), (25/4), 5, -math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, -1, -14, 10, -9}$.\n", - "Output Answer": [ - "$\\frac{907}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -1, -14, 10, -9\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${262144, 1, 2, 25, 59049, 125}$.\n", - "Output Answer": [ - "$24 \\sqrt[6]{2} 3^{2/3} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 262144, 1, 2, 25, 59049, 125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${46656, -1024, 64, 7, -3125, 4096}$.\n", - "Output Answer": [ - "$96\\ 2^{2/3} 5^{5/6} \\sqrt[6]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 46656, -1024, 64, 7, -3125, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{3}{\\sqrt{\\pi }}, -8, -4}$.\n", - "Output Answer": [ - "${-8, -4, -\\frac{3}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/(math.sqrt(math.pi))), -8, -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, -15, -12, -10}$.\n", - "Output Answer": [ - "$\\sqrt{26}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -15, -12, -10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{18}{e}, \\pi, -4 \\sqrt{5}, -2}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-\\frac{18}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(18/math.e), math.pi, -4*math.sqrt(5), -2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 1, 8, -2, 1, -6}$.\n", - "Output Answer": [ - "$2^{5/6} \\sqrt[6]{21}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 1, 8, -2, 1, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -\\frac{23}{\\pi }, \\frac{10}{\\pi }, \\frac{15}{2}, -9, 3, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{33}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -(23/math.pi), (10/math.pi), (15/2), -9, 3, -4*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{19}{7}, 0, -2, 5 \\sqrt{2}, -3 \\sqrt{2}} \\setminus {-\\frac{19}{7}, 3 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-2, 0, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(19/7), 0, -2, 5*math.sqrt(2), -3*math.sqrt(2),))\nsnd = set((-(19/7), 3*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 0, -9, 4, 3, 0, 3, 5, 5, -7, 4, 8, -9, 3, 10, 3, 10, 8, 10, -7, -9, 8, 10, 10, 5, 10, 3, 3, 8}$.\n", - "Output Answer": [ - "$\\{3,10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 0, -9, 4, 3, 0, 3, 5, 5, -7, 4, 8, -9, 3, 10, 3, 10, 8, 10, -7, -9, 8, 10, 10, 5, 10, 3, 3, 8\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{24}{\\pi }, -\\frac{24}{\\pi }, -\\frac{24}{\\pi }, \\frac{21}{\\pi }, \\frac{24}{\\pi }, \\frac{24}{\\pi }, -\\frac{24}{\\pi }, \\frac{2}{\\pi }, \\frac{23}{\\pi }, \\frac{21}{\\pi }, \\frac{2}{\\pi }, -\\frac{27}{\\pi }, \\frac{24}{\\pi }, -\\frac{24}{\\pi }, \\frac{23}{\\pi }, \\frac{23}{\\pi }, -\\frac{27}{\\pi }, \\frac{21}{\\pi }, \\frac{21}{\\pi }, \\frac{2}{\\pi }, \\frac{2}{\\pi }, -\\frac{27}{\\pi }, \\frac{2}{\\pi }, -\\frac{27}{\\pi }, \\frac{2}{\\pi }, \\frac{24}{\\pi }, \\frac{23}{\\pi }, -\\frac{27}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{2}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(24/math.pi), -(24/math.pi), -(24/math.pi), (21/math.pi), (24/math.pi), (24/math.pi), -(24/math.pi), (2/math.pi), (23/math.pi), (21/math.pi), (2/math.pi), -(27/math.pi), (24/math.pi), -(24/math.pi), (23/math.pi), (23/math.pi), -(27/math.pi), (21/math.pi), (21/math.pi), (2/math.pi), (2/math.pi), -(27/math.pi), (2/math.pi), -(27/math.pi), (2/math.pi), (24/math.pi), (23/math.pi), -(27/math.pi)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\sqrt{2}, \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{2}, -5 \\sqrt{2}, -5 \\sqrt{2}, -5 \\sqrt{2}, 5 \\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}, \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}, -5 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-5 \\sqrt{2},\\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.sqrt(2), math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(2), -5*math.sqrt(2), -5*math.sqrt(2), -5*math.sqrt(2), 5*math.sqrt(2), math.sqrt(2), -5*math.sqrt(2), math.sqrt(2), -5*math.sqrt(2), math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(2), math.sqrt(2), math.sqrt(2), -5*math.sqrt(2), -5*math.sqrt(2), math.sqrt(2), math.sqrt(2), math.sqrt(2), -5*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{2}{\\pi }, 4, 5 \\sqrt{2}, 0, -8.4} \\setminus {-\\pi, 1, -8.4, -3, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{2}{\\pi }, \\frac{24}{7}}$.\n", - "Output Answer": [ - "${0, 4, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(2/math.pi), 4, 5*math.sqrt(2), 0, -8.4,))\nsnd = set((-math.pi, 1, -8.4, -3, -(3/(math.sqrt(math.pi))), -(2/math.pi), (24/7),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $5.46 < 0.3 x^2+2.2 x+3.5 < 16.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.2].", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(P((5.46 < 0.3*x**2+2.2*x+3.5) & (0.3*x**2+2.2*x+3.5 < 16.8)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{25}{7}, -6 \\sqrt{2}, -\\frac{39}{5}, e, 9, 8, 2, -2}$.", - "Output Answer": [ - "$\\frac{2+e}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (25/7), -6*math.sqrt(2), -(39/5), math.e, 9, 8, 2, -2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.431,0.029,0.103,0.043,0.043,0.253,0.047\\}$ and $\\{0.049,0.078,0.102,0.058,0.221,0.097,0.185\\}$.", - "Output Answer": [ - "$0.87$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.431, 0.029, 0.103, 0.043, 0.043, 0.253, 0.047\ndistribution2 = 0.049, 0.078, 0.102, 0.058, 0.221, 0.097, 0.185\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-1.75 < 2.8 x-0.6 < -1.59$ where $x \\sim $ \\text{NormalDistribution}[-1.2,2.9].", - "Output Answer": [ - "$0.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.2, 2.9)\nprint(P((-1.75 < 2.8*x-0.6) & (2.8*x-0.6 < -1.59)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 15, \\frac{58}{3}, \\frac{22}{3}}$.\n", - "Output Answer": [ - "$\\frac{114840}{8909}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 15, (58/3), (22/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x-1.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$2.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(1.4*x-1.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-0.51 < 4.5 x+1.5 < 2.83$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1].", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(P((-0.51 < 4.5*x+1.5) & (4.5*x+1.5 < 2.83)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{3}{2}, \\frac{2}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, -2 e, 7, 7, -3 \\sqrt{2}, -9, 4, \\frac{17}{\\sqrt{\\pi }}, 5 \\sqrt{3}, -7, -7, 7, -9}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (3/2), (2/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), -2*math.e, 7, 7, -3*math.sqrt(2), -9, 4, (17/(math.sqrt(math.pi))), 5*math.sqrt(3), -7, -7, 7, -9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, \\frac{9}{\\sqrt{2}}, -2, 3, -5, -\\pi, 2}$.\n", - "Output Answer": [ - "$5+\\frac{9}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, (9/(math.sqrt(2))), -2, 3, -5, -math.pi, 2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{7}{5}, 3 \\sqrt{5}, \\frac{30}{7}, 0, \\frac{11}{\\sqrt{3}}, 4, -3, 2, \\frac{3}{2}, \\frac{3}{\\sqrt{2}}, -7, -7, -\\sqrt{2}}$.\n", - "Output Answer": [ - "$7+3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/5), 3*math.sqrt(5), (30/7), 0, (11/(math.sqrt(3))), 4, -3, 2, (3/2), (3/(math.sqrt(2))), -7, -7, -math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{17}{3}, \\frac{25}{3}, \\frac{59}{3}}$.\n", - "Output Answer": [ - "$\\frac{25075}{2903}$" - ], - "Output Program": [ - "import statistics\nvalues = (17/3), (25/3), (59/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, 1, -8, 81, 64, 49}$.\n", - "Output Answer": [ - "$4\\ 3^{2/3} \\sqrt{5} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, 1, -8, 81, 64, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${6, 4 \\sqrt{3}, -8, -5, -1, 9, -7}$.\n", - "Output Answer": [ - "${-8, -7, -5, -1, 6, 4 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 4*math.sqrt(3), -8, -5, -1, 9, -7\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 6, -6, 7, 0, 3, -3, 3, 3, 0, 0, -3, -6, 7, 6, 7, -6, -6, 6, 3, -6, -6, -6, 0, 7, 0}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 6, -6, 7, 0, 3, -3, 3, 3, 0, 0, -3, -6, 7, 6, 7, -6, -6, 6, 3, -6, -6, -6, 0, 7, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{7}{3}, \\frac{23}{3}}$.\n", - "Output Answer": [ - "$\\frac{5796}{1241}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (7/3), (23/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -4 \\log (2), \\frac{9}{\\sqrt{2}}, 3, 7, 6, 1, -1.93} \\cup {-13 \\log (2), 0, -8, \\frac{9}{\\sqrt{2}}, 6, 7.56, 7, 1}$.\n", - "Output Answer": [ - "${-13 \\log (2), -8, -6, -4 \\log (2), -1.93, 0, 1, 3, 6, \\frac{9}{\\sqrt{2}}, 7, 7.56}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -4*math.log(2), (9/(math.sqrt(2))), 3, 7, 6, 1, -1.93,))\nsnd = set((-13*math.log(2), 0, -8, (9/(math.sqrt(2))), 6, 7.56, 7, 1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, -5 \\sqrt{3}, 13 \\log (2), -3}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -5*math.sqrt(3), 13*math.log(2), -3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, 4, -3 e, 2, 2, 6, 1, \\pi, -2, -5, -3, 3, -10, 1, -7}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 4, -3*math.e, 2, 2, 6, 1, math.pi, -2, -5, -3, 3, -10, 1, -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, -\\frac{3}{\\pi }, -\\frac{11}{5}, \\frac{25}{3}, 0, \\frac{13}{2}, 0, -\\pi, -6, \\frac{17}{2}, 3, -3 \\log (2), -\\frac{9}{\\sqrt{5}}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -(3/math.pi), -(11/5), (25/3), 0, (13/2), 0, -math.pi, -6, (17/2), 3, -3*math.log(2), -(9/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 2 \\pi, \\frac{13}{\\sqrt{5}}, -2, -9, -2, -\\frac{7}{2}, -10, -7}$.\n", - "Output Answer": [ - "$10+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 2*math.pi, (13/(math.sqrt(5))), -2, -9, -2, -(7/2), -10, -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -5, -4}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "values = 8, -5, -4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x^3+0.6 x^2+3.3 x-2.8$ where $x \\sim $ \\text{BetaDistribution}[1.3,0.6]\n", - "Output Answer": [ - "$-2.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 0.6)\nprint(E(-4.1*x**3+0.6*x**2+3.3*x-2.8))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\pi, 8, 7, -\\frac{50}{7}}$.", - "Output Answer": [ - "$\\frac{15}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.pi, 8, 7, -(50/7)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-1, \\frac{8}{\\pi }, -0.8, \\frac{2}{3}, \\frac{23}{e}, 0}$.\n", - "Output Answer": [ - "${-1, -0.8, 0, \\frac{2}{3}, \\frac{8}{\\pi }, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, (8/math.pi), -0.8, (2/3), (23/math.e), 0\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{4}{\\sqrt{\\pi }}, \\frac{4}{e}, -8, 6} \\setminus {\\frac{4}{e}, 3, -8, -\\frac{4}{\\sqrt{\\pi }}, -5}$.\n", - "Output Answer": [ - "${6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/(math.sqrt(math.pi))), (4/math.e), -8, 6,))\nsnd = set(((4/math.e), 3, -8, -(4/(math.sqrt(math.pi))), -5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{2}, \\frac{13}{\\sqrt{3}}, 14 \\log (2), 6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(6+\\frac{13}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(2), (13/(math.sqrt(3))), 14*math.log(2), 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\sqrt{5}, \\frac{3}{\\sqrt{\\pi }}, 7, 4, -7, -\\frac{14}{\\sqrt{5}}, -8, -3 \\log (2), -7, -5 \\sqrt{3}, \\frac{11}{\\sqrt{3}}}$.", - "Output Answer": [ - "$-3 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.sqrt(5), (3/(math.sqrt(math.pi))), 7, 4, -7, -(14/(math.sqrt(5))), -8, -3*math.log(2), -7, -5*math.sqrt(3), (11/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${14 \\log (2), -6, -\\frac{20}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{20}{\\pi }, -6, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 14*math.log(2), -6, -(20/math.pi)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-9, -2 \\pi, 0.9, 2, 9, \\frac{24}{5}, -\\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{3}}, -9, -2 \\pi, 0.9, 2, \\frac{24}{5}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -2*math.pi, 0.9, 2, 9, (24/5), -(17/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -3 \\log (2), -\\frac{19}{e}, 10, 1, 0, -8, 9, -\\frac{16}{e}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -3*math.log(2), -(19/math.e), 10, 1, 0, -8, 9, -(16/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 e, -4 e}$.\n", - "Output Answer": [ - "$-3 e$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.e, -4*math.e\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{9}{7}, 4, -\\frac{9}{\\pi }, -7, -2 \\pi, \\pi, -4 \\sqrt{3}, -9}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{9}{\\pi }-2 \\pi \\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(9/7), 4, -(9/math.pi), -7, -2*math.pi, math.pi, -4*math.sqrt(3), -9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, -1, 15, -7, 9, 14}$.\n", - "Output Answer": [ - "$\\frac{1366}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -1, 15, -7, 9, 14\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{3}{2}, \\frac{29}{2}, 13}$.\n", - "Output Answer": [ - "$\\frac{3393}{919}$" - ], - "Output Program": [ - "import statistics\nvalues = (3/2), (29/2), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, 3}$.\n", - "Output Answer": [ - "$\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 3\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, \\frac{16}{e}, -6 \\sqrt{3}, 0, -2 e, \\sqrt{5}, -3 \\sqrt{3}} \\setminus {-9, -6 \\sqrt{3}, \\sqrt{5}, -3 \\sqrt{3}, \\frac{9}{2}, -2 e}$.\n", - "Output Answer": [ - "${-7, 0, \\frac{16}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, (16/math.e), -6*math.sqrt(3), 0, -2*math.e, math.sqrt(5), -3*math.sqrt(3),))\nsnd = set((-9, -6*math.sqrt(3), math.sqrt(5), -3*math.sqrt(3), (9/2), -2*math.e,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${15, 0, 11, -8}$.\n", - "Output Answer": [ - "$\\frac{329}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 0, 11, -8\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\sqrt{2}, -\\frac{9}{2}, -\\sqrt{2}, -\\frac{12}{\\sqrt{5}}, \\pi, 9, -\\frac{2}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{\\pi }}, \\frac{43}{5}, -6, 3 \\sqrt{2}, \\frac{16}{7}, 9, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(2), -(9/2), -math.sqrt(2), -(12/(math.sqrt(5))), math.pi, 9, -(2/(math.sqrt(math.pi))), -(1/(math.sqrt(math.pi))), (43/5), -6, 3*math.sqrt(2), (16/7), 9, 5*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.5 x+0.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$1.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(1.5*x+0.3))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-0.236, -10, 5, 0.8, -4, 9, -1} \\cup {8.2, 5, 9, \\frac{21}{\\pi }, -1, 4.3, -4.244, -10, -4, -9, 3 e}$.\n", - "Output Answer": [ - "${-10, -9, -4.244, -4, -1, -0.236, 0.8, 4.3, 5, \\frac{21}{\\pi }, 3 e, 8.2, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.236, -10, 5, 0.8, -4, 9, -1,))\nsnd = set((8.2, 5, 9, (21/math.pi), -1, 4.3, -4.244, -10, -4, -9, 3*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, -7, -5, 5, 12, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2417}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -7, -5, 5, 12, 12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{3}, \\frac{48}{5}, 1, -6, 6, 6, -7, -\\frac{44}{5}, 2, -\\sqrt{3}, -8, \\frac{8}{\\sqrt{\\pi }}, 1}$.\n", - "Output Answer": [ - "$\\frac{92}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(3), (48/5), 1, -6, 6, 6, -7, -(44/5), 2, -math.sqrt(3), -8, (8/(math.sqrt(math.pi))), 1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 8, -10, -\\frac{22}{3}, -2, \\frac{39}{4}, -\\frac{27}{4}}$.\n", - "Output Answer": [ - "$\\frac{79}{4}$" - ], - "Output Program": [ - "values = -3, 8, -10, -(22/3), -2, (39/4), -(27/4)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{e}, 0, -\\frac{8}{7}, 6, -2, 8 \\log (2), -\\frac{12}{\\sqrt{\\pi }}, 3, 6, 4, 2, 0, -e, 6 \\sqrt{2}, -2}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+\\frac{12}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/math.e), 0, -(8/7), 6, -2, 8*math.log(2), -(12/(math.sqrt(math.pi))), 3, 6, 4, 2, 0, -math.e, 6*math.sqrt(2), -2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4.882, -5, 9, 7} \\setminus {7, 9, -e, -4.882}$.\n", - "Output Answer": [ - "${-5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4.882, -5, 9, 7,))\nsnd = set((7, 9, -math.e, -4.882,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-2.14 < 4.4 x^2-0.5 x-2.2 < 3.44$ where $x \\sim $ \\text{NormalDistribution}[-1.3,2.2].", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.3, 2.2)\nprint(P((-2.14 < 4.4*x**2-0.5*x-2.2) & (4.4*x**2-0.5*x-2.2 < 3.44)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x-0.3$ where $x \\sim $ \\text{PoissonDistribution}[1.6]\n", - "Output Answer": [ - "$-4.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.6)\nprint(E(-2.7*x-0.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, 7, -\\frac{5}{\\sqrt{2}}, -5, -3, \\frac{7}{\\sqrt{3}}, 2 \\log (2), -7, 6 \\sqrt{2}, -\\frac{14}{\\sqrt{3}}, 10, -7, -\\frac{4}{\\sqrt{\\pi }}, \\sqrt{5}, 0}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 7, -(5/(math.sqrt(2))), -5, -3, (7/(math.sqrt(3))), 2*math.log(2), -7, 6*math.sqrt(2), -(14/(math.sqrt(3))), 10, -7, -(4/(math.sqrt(math.pi))), math.sqrt(5), 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 4, 3, -6, -5, 3, -10, -6, -6, 3, 3, 4, 0, 3, 0, -10, -6, 3, -10, 3, 0, 0, -10, 3, 0, -6, 3, -10, -10}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 4, 3, -6, -5, 3, -10, -6, -6, 3, 3, 4, 0, 3, 0, -10, -6, 3, -10, 3, 0, 0, -10, 3, 0, -6, 3, -10, -10\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{4}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{\\sqrt{\\pi }},-\\frac{4}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (4/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 6, -3, 10, -8, 2 \\log (2), -5, -6, -4, 3 \\log (2)} \\cup {-10, -6, -8, 2 \\log (2), -9, 10, -\\frac{9}{2}, -3, 7 \\log (2)}$.\n", - "Output Answer": [ - "${-10, -9, -8, -6, -5, -\\frac{9}{2}, -4, -3, 2 \\log (2), 3 \\log (2), 7 \\log (2), 6, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 6, -3, 10, -8, 2*math.log(2), -5, -6, -4, 3*math.log(2),))\nsnd = set((-10, -6, -8, 2*math.log(2), -9, 10, -(9/2), -3, 7*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 6, -11, -6}$.\n", - "Output Answer": [ - "$\\frac{169}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 6, -11, -6\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, -2 \\pi, -\\frac{16}{\\sqrt{3}}, 3, 9, -\\frac{15}{e}, 1, 4} \\cup {-7, \\pi, 5, 9, 3, -\\frac{15}{e}, -3}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -7, -2 \\pi, -\\frac{15}{e}, -3, 1, 3, \\pi, 4, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -2*math.pi, -(16/(math.sqrt(3))), 3, 9, -(15/math.e), 1, 4,))\nsnd = set((-7, math.pi, 5, 9, 3, -(15/math.e), -3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.08,0.283,0.252,0.183\\}$ and $\\{0.173,0.162,0.383,0.103\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.08, 0.283, 0.252, 0.183\ndistribution2 = 0.173, 0.162, 0.383, 0.103\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${1, 8, \\frac{6}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{6}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 8, (6/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${8, -8, 6}$.", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -8, 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${9, -4 \\sqrt{5}, 2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -4*math.sqrt(5), 2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-1.12 < 5. x-0.4 < 3.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9].", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(P((-1.12 < 5.*x-0.4) & (5.*x-0.4 < 3.4)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, -6, 5, 16}$.\n", - "Output Answer": [ - "$6 \\sqrt[4]{-30}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, -6, 5, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -2, -4, -1, 1, 1, -2, -2, -4, 1, 1, 1, 1, 1, -1, 1, -7, 1, -4, -7, -2}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -2, -4, -1, 1, 1, -2, -2, -4, 1, 1, 1, 1, 1, -1, 1, -7, 1, -4, -7, -2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -8, -\\frac{26}{e}, -7, 8}$.\n", - "Output Answer": [ - "$8+\\frac{26}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -8, -(26/math.e), -7, 8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 262144, 100000, 1, 1, -32768}$.\n", - "Output Answer": [ - "$64 \\sqrt[6]{-1} 10^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 262144, 100000, 1, 1, -32768\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-6, 3, -8}$.\n", - "Output Answer": [ - "${-8, -6, 3}$" - ], - "Output Program": [ - "values = -6, 3, -8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-3.13 < -2. x-2.4 < 0.84$ where $x \\sim $ \\text{NormalDistribution}[0.2,2.6].", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.2, 2.6)\nprint(P((-3.13 < -2.*x-2.4) & (-2.*x-2.4 < 0.84)))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, 2, 8, 6, -1, -9} \\cup {-1, -9, 8, 2, 1, 7}$.\n", - "Output Answer": [ - "${-9, -1, 1, 2, 5, 6, 7, 8}$" - ], - "Output Program": [ - "fst = set((5, 2, 8, 6, -1, -9,))\nsnd = set((-1, -9, 8, 2, 1, 7,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -\\frac{41}{5}, -1, -3 e, -4, -5, -8, -\\frac{4}{3}, -\\frac{37}{4}, \\sqrt{3}, -\\frac{2}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{37}{4}+\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -(41/5), -1, -3*math.e, -4, -5, -8, -(4/3), -(37/4), math.sqrt(3), -(2/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x+3.$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$21.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(3.6*x+3.))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{2}, -4, 6, -7, 4, 5, -7 \\log (2), -\\frac{1}{\\sqrt{2}}} \\cup {-\\frac{13}{\\sqrt{2}}, 13 \\log (2), -3 \\sqrt{2}, -7, 4, 5, -1, -2.64, -4}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -7, -7 \\log (2), -3 \\sqrt{2}, -4, -2.64, -1, -\\frac{1}{\\sqrt{2}}, 4, 5, 6, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(2), -4, 6, -7, 4, 5, -7*math.log(2), -(1/(math.sqrt(2))),))\nsnd = set((-(13/(math.sqrt(2))), 13*math.log(2), -3*math.sqrt(2), -7, 4, 5, -1, -2.64, -4,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{4}{e}, -3 \\sqrt{5}, -2, 6 \\sqrt{2}, -\\frac{1}{2}, -2, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$7 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(4/math.e), -3*math.sqrt(5), -2, 6*math.sqrt(2), -(1/2), -2, 4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{21}{\\sqrt{5}}, \\sqrt{5}, 3 \\sqrt{5}, \\frac{2}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$-\\frac{5 \\sqrt{5}}{6}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(21/(math.sqrt(5))), math.sqrt(5), 3*math.sqrt(5), (2/(math.sqrt(5))), -(12/(math.sqrt(5))), -(14/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9.43, -4, 7} \\setminus {-6, 5, 9.43}$.\n", - "Output Answer": [ - "${-4, 7}$" - ], - "Output Program": [ - "fst = set((9.43, -4, 7,))\nsnd = set((-6, 5, 9.43,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-10, 0, 9, 7, \\frac{13}{\\sqrt{3}}} \\setminus {4, -4 \\sqrt{3}, -10, 0, 9}$.\n", - "Output Answer": [ - "${7, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, 0, 9, 7, (13/(math.sqrt(3))),))\nsnd = set((4, -4*math.sqrt(3), -10, 0, 9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4 \\sqrt{3}, -\\frac{47}{5}, 7, 0, -e, -2, 1.7, -9}$.\n", - "Output Answer": [ - "${-\\frac{47}{5}, -9, -4 \\sqrt{3}, -e, -2, 0, 1.7, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(3), -(47/5), 7, 0, -math.e, -2, 1.7, -9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.099,0.082,0.027,0.203,0.023,0.077,0.125,0.074,0.124,0.104\\}$ and $\\{0.108,0.094,0.129,0.048,0.059,0.068,0.099,0.09,0.117,0.151\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.099, 0.082, 0.027, 0.203, 0.023, 0.077, 0.125, 0.074, 0.124, 0.104\ndistribution2 = 0.108, 0.094, 0.129, 0.048, 0.059, 0.068, 0.099, 0.09, 0.117, 0.151\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${7 \\log (2), 0, -\\frac{15}{\\sqrt{\\pi }}, -0.302, -5} \\setminus {2 \\pi, -\\frac{15}{\\sqrt{\\pi }}, 10}$.\n", - "Output Answer": [ - "${-5, -0.302, 0, 7 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((7*math.log(2), 0, -(15/(math.sqrt(math.pi))), -0.302, -5,))\nsnd = set((2*math.pi, -(15/(math.sqrt(math.pi))), 10,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 2, 4, 0, 11, 4}$.\n", - "Output Answer": [ - "$\\frac{784}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 2, 4, 0, 11, 4\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 6, 5, -4, \\pi, \\frac{11}{\\sqrt{2}}, 0, 0, 7, \\frac{1}{\\sqrt{5}}, 5, \\log (2), -4, \\frac{3}{e}, 7}$.\n", - "Output Answer": [ - "$4+\\frac{11}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 6, 5, -4, math.pi, (11/(math.sqrt(2))), 0, 0, 7, (1/(math.sqrt(5))), 5, math.log(2), -4, (3/math.e), 7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 16, 8, 17}$.\n", - "Output Answer": [ - "$\\frac{9792}{875}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 16, 8, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.224,0.16,0.123\\}$ and $\\{0.25,0.184,0.376\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.224, 0.16, 0.123\ndistribution2 = 0.25, 0.184, 0.376\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 1, 10, 6, -3}$.\n", - "Output Answer": [ - "$\\frac{11}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 1, 10, 6, -3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 4 \\sqrt{5}, -2 e, -\\frac{19}{e}, -1, -3, \\frac{11}{4}, 9, -\\frac{22}{\\pi }, -\\frac{7}{\\sqrt{2}}, 8, 1, 10}$.\n", - "Output Answer": [ - "$10+\\frac{22}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 4*math.sqrt(5), -2*math.e, -(19/math.e), -1, -3, (11/4), 9, -(22/math.pi), -(7/(math.sqrt(2))), 8, 1, 10\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 9, 5, 1, 6, 5, -8, 6, -4, 5, 9, 5, -8, 1, 9, -4, 1, -9, 9, 5, -4, 9, -9, 6, 6, 5, 6}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 9, 5, 1, 6, 5, -8, 6, -4, 5, 9, 5, -8, 1, 9, -4, 1, -9, 9, 5, -4, 9, -9, 6, 6, 5, 6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -1, -\\frac{9}{2}}$.\n", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -1, -(9/2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{4}, 5 \\log (2), -2 \\pi}$.", - "Output Answer": [ - "$\\frac{13}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (13/4), 5*math.log(2), -2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, 0, -\\frac{11}{7}, \\frac{16}{\\sqrt{3}}, -5, \\frac{14}{\\sqrt{3}}, -9, -5, \\frac{7}{\\sqrt{\\pi }}, -2, \\frac{24}{e}, -3 \\sqrt{2}, -8}$.\n", - "Output Answer": [ - "$9+\\frac{16}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 0, -(11/7), (16/(math.sqrt(3))), -5, (14/(math.sqrt(3))), -9, -5, (7/(math.sqrt(math.pi))), -2, (24/math.e), -3*math.sqrt(2), -8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-10, -\\frac{12}{\\sqrt{5}}, 2, 4, -4, -\\log (2)} \\setminus {-6, 8, 0, -6.679, -10}$.\n", - "Output Answer": [ - "${-\\frac{12}{\\sqrt{5}}, -4, -\\log (2), 2, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, -(12/(math.sqrt(5))), 2, 4, -4, -math.log(2),))\nsnd = set((-6, 8, 0, -6.679, -10,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, 4, -9}$.\n", - "Output Answer": [ - "$-\\frac{13}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, 4, -9\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, \\frac{38}{5}, \\frac{9}{5}, 5, -\\frac{46}{5}}$.\n", - "Output Answer": [ - "$-\\frac{9}{25}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, (38/5), (9/5), 5, -(46/5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{7}{\\sqrt{2}}, -1, \\frac{25}{\\pi }, -\\frac{24}{\\pi }, \\frac{8}{3}, -2} \\setminus {-\\frac{7}{2}, \\frac{7}{\\sqrt{2}}, -7, \\frac{25}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{24}{\\pi }, -2, -1, \\frac{8}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/(math.sqrt(2))), -1, (25/math.pi), -(24/math.pi), (8/3), -2,))\nsnd = set((-(7/2), (7/(math.sqrt(2))), -7, (25/math.pi),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\pi, 0, 3 \\pi, 0}$.\n", - "Output Answer": [ - "$\\frac{\\pi }{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.pi, 0, 3*math.pi, 0\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${32768, -4, -1, 243, -343}$.\n", - "Output Answer": [ - "$24 \\sqrt[5]{-1} 2^{2/5} 7^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 32768, -4, -1, 243, -343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${262144, 7776, 64, -1024, 4096, -6}$.\n", - "Output Answer": [ - "$768\\ 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 262144, 7776, 64, -1024, 4096, -6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{3}, 4 \\sqrt{3}, -5, -6, -5, -5, \\frac{5}{e}, 2, -7, -2 \\sqrt{5}, -5, 13 \\log (2)}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(3), 4*math.sqrt(3), -5, -6, -5, -5, (5/math.e), 2, -7, -2*math.sqrt(5), -5, 13*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 8, 1}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{127}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 8, 1\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{31}{\\pi }, 2, 8, -\\frac{16}{\\sqrt{3}}, 1, 5, 3, 5}$.\n", - "Output Answer": [ - "${-\\frac{31}{\\pi }, -\\frac{16}{\\sqrt{3}}, 1, 2, 3, 5, 5, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(31/math.pi), 2, 8, -(16/(math.sqrt(3))), 1, 5, 3, 5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, \\frac{15}{2}, \\log (2), -4 \\sqrt{2}, -7 \\sqrt{2}, \\frac{23}{4}, 0, 4, \\frac{27}{\\pi }}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{27}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -6, (15/2), math.log(2), -4*math.sqrt(2), -7*math.sqrt(2), (23/4), 0, 4, (27/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x+5.7$ where $x \\sim $ \\text{PoissonDistribution}[2.1]\n", - "Output Answer": [ - "$8.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.1)\nprint(E(1.1*x+5.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -10, -15, -10}$.\n", - "Output Answer": [ - "$\\frac{209}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -10, -15, -10\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{47}{5}, \\frac{11}{3}, -2, -2}$.\n", - "Output Answer": [ - "${-\\frac{47}{5}, -2, -2, \\frac{11}{3}}$" - ], - "Output Program": [ - "values = -(47/5), (11/3), -2, -2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 e, 0, 2 e, -e, 2 e, -e, -e, -e, 0, 2 e, -e, -e, 2 e, -e, -e, 2 e, 0, -e, 0, -e, -e, 2 e, -e, 0, 2 e, -e, -e, 2 e}$.\n", - "Output Answer": [ - "$\\{-e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.e, 0, 2*math.e, -math.e, 2*math.e, -math.e, -math.e, -math.e, 0, 2*math.e, -math.e, -math.e, 2*math.e, -math.e, -math.e, 2*math.e, 0, -math.e, 0, -math.e, -math.e, 2*math.e, -math.e, 0, 2*math.e, -math.e, -math.e, 2*math.e\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, -1, 1, 9}$.\n", - "Output Answer": [ - "$(1+i) \\sqrt[4]{2} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -1, 1, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, 2, 7, 3, 2, 2, 7, 7, 3, -4, 7, 3, 7, -4, -4, 2, -4, 2, 2, -4, 7, -4, -4}$.\n", - "Output Answer": [ - "$\\{2,-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, 2, 7, 3, 2, 2, 7, 7, 3, -4, 7, 3, 7, -4, -4, 2, -4, 2, 2, -4, 7, -4, -4\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${3 \\sqrt{2}, 4, -6}$.\n", - "Output Answer": [ - "${-6, 4, 3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(2), 4, -6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 8, 64, 27}$.\n", - "Output Answer": [ - "$36 \\sqrt[4]{2} 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 8, 64, 27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.7 x^2-1.3 x-3.8$ where $x \\sim $ \\text{BetaDistribution}[0.4,0.4]\n", - "Output Answer": [ - "$-3.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.4, 0.4)\nprint(E(1.7*x**2-1.3*x-3.8))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{25}{3}, \\frac{28}{3}, -\\frac{28}{3}, \\frac{13}{3}, -4, -\\frac{13}{3}, \\frac{16}{3}, 8} \\cap {-\\frac{8}{3}, \\frac{2}{3}, -\\frac{25}{3}, 7, -6, \\frac{1}{3}, -\\frac{13}{3}, -4}$.\n", - "Output Answer": [ - "${-\\frac{25}{3}, -\\frac{13}{3}, -4}$" - ], - "Output Program": [ - "fst = set((-(25/3), (28/3), -(28/3), (13/3), -4, -(13/3), (16/3), 8,))\nsnd = set((-(8/3), (2/3), -(25/3), 7, -6, (1/3), -(13/3), -4,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${1, -8, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{301}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -8, 12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 100000, -10, 36, -27}$.\n", - "Output Answer": [ - "$30\\ 2^{3/5} 3^{4/5} \\sqrt[5]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 100000, -10, 36, -27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 6}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${4, 0, -3 \\sqrt{5}, 0, -\\frac{37}{7}, -7, 4.386}$.\n", - "Output Answer": [ - "${-7, -3 \\sqrt{5}, -\\frac{37}{7}, 0, 0, 4, 4.386}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 0, -3*math.sqrt(5), 0, -(37/7), -7, 4.386\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{51}{7}, -\\frac{15}{7}, \\frac{17}{7}, -\\frac{15}{7}, \\frac{40}{7}, \\frac{40}{7}, \\frac{40}{7}, \\frac{17}{7}, -\\frac{15}{7}, -\\frac{15}{7}, \\frac{17}{7}, \\frac{17}{7}, \\frac{51}{7}, \\frac{40}{7}, -\\frac{15}{7}, \\frac{40}{7}, \\frac{40}{7}, \\frac{40}{7}, \\frac{40}{7}, -\\frac{15}{7}, -\\frac{15}{7}, \\frac{17}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{40}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (51/7), -(15/7), (17/7), -(15/7), (40/7), (40/7), (40/7), (17/7), -(15/7), -(15/7), (17/7), (17/7), (51/7), (40/7), -(15/7), (40/7), (40/7), (40/7), (40/7), -(15/7), -(15/7), (17/7)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -9, -2, 0, -7, 5}$.\n", - "Output Answer": [ - "$-\\frac{13}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -9, -2, 0, -7, 5\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.8 x^3-1.8 x^2-4. x+1.5$ where $x \\sim $ \\text{NormalDistribution}[1.,1.5]\n", - "Output Answer": [ - "$-14.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1., 1.5)\nprint(E(-0.8*x**3-1.8*x**2-4.*x+1.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.042,0.131,0.123,0.032,0.04,0.295,0.057,0.067,0.076\\}$ and $\\{0.173,0.108,0.1,0.079,0.016,0.062,0.125,0.091,0.152\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.042, 0.131, 0.123, 0.032, 0.04, 0.295, 0.057, 0.067, 0.076\ndistribution2 = 0.173, 0.108, 0.1, 0.079, 0.016, 0.062, 0.125, 0.091, 0.152\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${6.2, -3 \\sqrt{2}, \\frac{6}{\\pi }, 7, \\frac{15}{7}} \\cup {-\\frac{54}{7}, -4, \\frac{6}{\\pi }, 7, -\\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{54}{7}, -3 \\sqrt{2}, -4, -\\frac{4}{\\sqrt{3}}, \\frac{6}{\\pi }, \\frac{15}{7}, 6.2, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.2, -3*math.sqrt(2), (6/math.pi), 7, (15/7),))\nsnd = set((-(54/7), -4, (6/math.pi), 7, -(4/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{13}{e}, \\frac{8}{e}, -\\frac{4}{e}, \\frac{4}{e}, \\frac{2}{e}, \\frac{5}{e}}$.\n", - "Output Answer": [ - "$\\frac{14}{3 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (13/math.e), (8/math.e), -(4/math.e), (4/math.e), (2/math.e), (5/math.e)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -e, \\frac{15}{2}, \\frac{13}{4}, 6, 1, \\frac{9}{2}, -\\frac{3}{2}, 2, \\frac{5}{\\pi }, 9, -5}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -math.e, (15/2), (13/4), 6, 1, (9/2), -(3/2), 2, (5/math.pi), 9, -5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{31}{2}, \\frac{5}{2}, 7}$.\n", - "Output Answer": [ - "$\\frac{3255}{659}$" - ], - "Output Program": [ - "import statistics\nvalues = (31/2), (5/2), 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{52}{3}, \\frac{20}{3}, \\frac{11}{3}, 7}$.\n", - "Output Answer": [ - "$\\frac{40040}{6239}$" - ], - "Output Program": [ - "import statistics\nvalues = (52/3), (20/3), (11/3), 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, -\\frac{14}{3}, -\\sqrt{3}, -3 \\pi, -\\frac{11}{\\sqrt{\\pi }}, -2, 2 \\sqrt{2}, \\frac{33}{7}, 5 \\sqrt{3}, -\\frac{19}{\\pi }, -9, 0, -7, \\frac{22}{e}, 5}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -(14/3), -math.sqrt(3), -3*math.pi, -(11/(math.sqrt(math.pi))), -2, 2*math.sqrt(2), (33/7), 5*math.sqrt(3), -(19/math.pi), -9, 0, -7, (22/math.e), 5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-3 \\sqrt{5}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{2}}, 4} \\setminus {-\\frac{3}{\\sqrt{2}}, -\\frac{8}{e}, 3, \\frac{37}{5}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{5}{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, 4, \\frac{7}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(5), -(7/(math.sqrt(math.pi))), (7/(math.sqrt(2))), 4,))\nsnd = set((-(3/(math.sqrt(2))), -(8/math.e), 3, (37/5), -(7/(math.sqrt(math.pi))), (5/2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -12, 11, 12}$.\n", - "Output Answer": [ - "$\\frac{454}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -12, 11, 12\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x^3-0.7 x^2-1.8 x-2.$ where $x \\sim $ \\text{PoissonDistribution}[3.5]\n", - "Output Answer": [ - "$180.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(E(2.4*x**3-0.7*x**2-1.8*x-2.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, -13, 4, -10, -12}$.\n", - "Output Answer": [ - "$50$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -13, 4, -10, -12\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.086,0.192,0.137,0.145,0.177,0.114,0.101\\}$ and $\\{0.112,0.1,0.117,0.111,0.203,0.06,0.173\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.086, 0.192, 0.137, 0.145, 0.177, 0.114, 0.101\ndistribution2 = 0.112, 0.1, 0.117, 0.111, 0.203, 0.06, 0.173\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.9 x-4.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-4.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-4.9*x-4.5))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, 6} \\setminus {3 \\sqrt{2}, 0, \\frac{37}{5}, -7.955, 7, 5 \\sqrt{3}, -6, 2}$.\n", - "Output Answer": [ - "${6}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 6,))\nsnd = set((3*math.sqrt(2), 0, (37/5), -7.955, 7, 5*math.sqrt(3), -6, 2,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{33}{5}, \\frac{34}{5}, -\\frac{27}{5}, -\\frac{38}{5}, -\\frac{34}{5}}$.\n", - "Output Answer": [ - "$-\\frac{32}{25}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (33/5), (34/5), -(27/5), -(38/5), -(34/5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-5, 9, 6, 6, 3, \\frac{10}{\\sqrt{\\pi }}, -6, -9 \\log (2), 2, -\\frac{16}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, 9, 6, 6, 3, (10/(math.sqrt(math.pi))), -6, -9*math.log(2), 2, -(16/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x^2+4.5 x-9.5$ where $x \\sim $ \\text{BetaDistribution}[0.6,0.4]\n", - "Output Answer": [ - "$-5.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.6, 0.4)\nprint(E(2.4*x**2+4.5*x-9.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -9, -9, -2, 6, 2}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -9, -9, -2, 6, 2\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-5.06 < 2.6 x+3.4 < -0.85$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3].", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(P((-5.06 < 2.6*x+3.4) & (2.6*x+3.4 < -0.85)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${8, -5, 0, 4, -9}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -5, 0, 4, -9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.888,0.072,0.003\\}$ and $\\{0.334,0.181,0.196\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.888, 0.072, 0.003\ndistribution2 = 0.334, 0.181, 0.196\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{2}, \\frac{9}{e}, 0, \\frac{12}{7}, 0, 0, -5 \\sqrt{3}, 0, \\frac{19}{5}, -7, 8}$.\n", - "Output Answer": [ - "$8+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/2), (9/math.e), 0, (12/7), 0, 0, -5*math.sqrt(3), 0, (19/5), -7, 8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{23}{e}, -4 \\sqrt{5}, 6, -9, -\\sqrt{2}, 4, -1, 1, -2} \\cup {-1, -9, 7, -4 \\sqrt{5}, -6, -\\sqrt{2}, -\\frac{25}{e}, -3, 0}$.\n", - "Output Answer": [ - "${-\\frac{25}{e}, -9, -4 \\sqrt{5}, -6, -3, -2, -\\sqrt{2}, -1, 0, 1, 4, 6, 7, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((23/math.e), -4*math.sqrt(5), 6, -9, -math.sqrt(2), 4, -1, 1, -2,))\nsnd = set((-1, -9, 7, -4*math.sqrt(5), -6, -math.sqrt(2), -(25/math.e), -3, 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{3}, \\frac{14}{3}}$.\n", - "Output Answer": [ - "$\\frac{308}{75}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/3), (14/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{52}{3}, 5, 19, \\frac{22}{3}}$.\n", - "Output Answer": [ - "$\\frac{217360}{24273}$" - ], - "Output Program": [ - "import statistics\nvalues = (52/3), 5, 19, (22/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.094,0.004,0.34,0.073,0.016\\}$ and $\\{0.041,0.13,0.092,0.136,0.256,0.171\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.094, 0.004, 0.34, 0.073, 0.016\ndistribution2 = 0.041, 0.13, 0.092, 0.136, 0.256, 0.171\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-3 e, \\sqrt{5}, -7, -9.13}$.\n", - "Output Answer": [ - "${-9.13, -3 e, -7, \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.e, math.sqrt(5), -7, -9.13\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 3, 5, 3, 0, 4, 5, -6, 5, 3, 3, 5, -6, -6, 3, -6, 5, 3, 0, 3, -6, 5, 3, 4, 3, 0}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 3, 5, 3, 0, 4, 5, -6, 5, 3, 3, 5, -6, -6, 3, -6, 5, 3, 0, 3, -6, 5, 3, 4, 3, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -\\frac{9}{e}, -\\frac{9}{e}, -\\frac{14}{e}, \\frac{18}{e}, -\\frac{14}{e}, -\\frac{9}{e}, 0, 0, -\\frac{9}{e}, -\\frac{9}{e}, 0, \\frac{18}{e}, 0, 0, -\\frac{9}{e}, -\\frac{14}{e}, -\\frac{14}{e}, \\frac{18}{e}, \\frac{18}{e}, \\frac{18}{e}, -\\frac{9}{e}, \\frac{18}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{9}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, -(9/math.e), -(9/math.e), -(14/math.e), (18/math.e), -(14/math.e), -(9/math.e), 0, 0, -(9/math.e), -(9/math.e), 0, (18/math.e), 0, 0, -(9/math.e), -(14/math.e), -(14/math.e), (18/math.e), (18/math.e), (18/math.e), -(9/math.e), (18/math.e)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${12 \\log (2), -6, -\\frac{11}{4}, -4, -6, -7, -\\frac{9}{\\sqrt{2}}, -4 \\sqrt{3}, 8, 7, \\frac{51}{7}, 2 \\log (2), -1}$.\n", - "Output Answer": [ - "$7+12 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 12*math.log(2), -6, -(11/4), -4, -6, -7, -(9/(math.sqrt(2))), -4*math.sqrt(3), 8, 7, (51/7), 2*math.log(2), -1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.095,0.533,0.008,0.052,0.218\\}$ and $\\{0.087,0.103,0.17,0.055,0.246\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.095, 0.533, 0.008, 0.052, 0.218\ndistribution2 = 0.087, 0.103, 0.17, 0.055, 0.246\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${5, -2 \\sqrt{5}, 9, -\\frac{20}{e}} \\setminus {\\frac{26}{e}, -2 \\sqrt{5}, -6, 5}$.\n", - "Output Answer": [ - "${-\\frac{20}{e}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -2*math.sqrt(5), 9, -(20/math.e),))\nsnd = set(((26/math.e), -2*math.sqrt(5), -6, 5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x+0.4$ where $x \\sim $ \\text{PoissonDistribution}[2.5]\n", - "Output Answer": [ - "$3.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.5)\nprint(E(1.3*x+0.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1024, 27, -2, -64, -5}$.\n", - "Output Answer": [ - "$8 \\sqrt[5]{-5} 2^{2/5} 3^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1024, 27, -2, -64, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-5. x^2-0.9 x-2.6$ where $x \\sim $ \\text{BetaDistribution}[1.7,1.5]\n", - "Output Answer": [ - "$-4.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 1.5)\nprint(E(-5.*x**2-0.9*x-2.6))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2, \\sqrt{5}, -8, -3 \\pi, -3, 5, 7, -5, 6} \\cup {5, -2, 3 \\sqrt{5}, -3 \\pi, -7, -5, -3, 2 \\pi, -10}$.\n", - "Output Answer": [ - "${-10, -3 \\pi, -8, -7, -5, -3, -2, \\sqrt{5}, 5, 6, 2 \\pi, 3 \\sqrt{5}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, math.sqrt(5), -8, -3*math.pi, -3, 5, 7, -5, 6,))\nsnd = set((5, -2, 3*math.sqrt(5), -3*math.pi, -7, -5, -3, 2*math.pi, -10,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${7, \\frac{37}{7}, 6, -7, -4.85, -2 \\sqrt{2}} \\setminus {6, -4, \\frac{34}{7}, -7}$.\n", - "Output Answer": [ - "${-4.85, -2 \\sqrt{2}, \\frac{37}{7}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, (37/7), 6, -7, -4.85, -2*math.sqrt(2),))\nsnd = set((6, -4, (34/7), -7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-4, \\frac{3}{\\sqrt{\\pi }}, 5, -4, 0, 0, 2 \\log (2), -10, 5 \\log (2), -\\sqrt{5}, -5, 0, -2, 2 \\log (2), 3}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, (3/(math.sqrt(math.pi))), 5, -4, 0, 0, 2*math.log(2), -10, 5*math.log(2), -math.sqrt(5), -5, 0, -2, 2*math.log(2), 3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.8 x-7.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$-7.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(-1.8*x-7.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.076,0.178,0.112,0.123,0.104,0.109,0.171\\}$ and $\\{0.082,0.089,0.118,0.188,0.051,0.154,0.18\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.076, 0.178, 0.112, 0.123, 0.104, 0.109, 0.171\ndistribution2 = 0.082, 0.089, 0.118, 0.188, 0.051, 0.154, 0.18\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\sqrt{3}, -9, -5 \\log (2), -0.974, \\frac{12}{7}} \\setminus {12 \\log (2), -\\frac{1}{\\sqrt{5}}, 8, -\\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, -5 \\log (2), -0.974, \\frac{12}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(3), -9, -5*math.log(2), -0.974, (12/7),))\nsnd = set((12*math.log(2), -(1/(math.sqrt(5))), 8, -math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -1, 9, 5, 0, -9, 4, 8}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -1, 9, 5, 0, -9, 4, 8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2 e, 3, 1, -\\frac{7}{\\sqrt{\\pi }}} \\setminus {-\\frac{8}{\\sqrt{\\pi }}, 0, 1, -e}$.\n", - "Output Answer": [ - "${-2 e, -\\frac{7}{\\sqrt{\\pi }}, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, 3, 1, -(7/(math.sqrt(math.pi))),))\nsnd = set((-(8/(math.sqrt(math.pi))), 0, 1, -math.e,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6 \\sqrt{2}, -2 \\sqrt{2}, -6 \\sqrt{2}, 3 \\sqrt{2}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{7 \\sqrt{2}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 6*math.sqrt(2), -2*math.sqrt(2), -6*math.sqrt(2), 3*math.sqrt(2), 6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.167,0.233,0.488\\}$ and $\\{0.168,0.075,0.272\\}$.", - "Output Answer": [ - "$0.07$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.167, 0.233, 0.488\ndistribution2 = 0.168, 0.075, 0.272\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.236,0.125,0.152,0.183,0.023,0.144,0.069\\}$ and $\\{0.144,0.234,0.168,0.021,0.089,0.217,0.105\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.236, 0.125, 0.152, 0.183, 0.023, 0.144, 0.069\ndistribution2 = 0.144, 0.234, 0.168, 0.021, 0.089, 0.217, 0.105\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${1, 4, -\\frac{3}{2}, -7.42, -\\frac{22}{e}, \\frac{22}{3}, -4 \\sqrt{2}, -1} \\cup {1, \\frac{20}{3}, 3, 0, -4 \\sqrt{2}, -\\frac{22}{e}, 9., -7.95, -\\frac{3}{2}}$.\n", - "Output Answer": [ - "${-\\frac{22}{e}, -7.95, -7.42, -4 \\sqrt{2}, -\\frac{3}{2}, -1, 0, 1, 3, 4, \\frac{20}{3}, \\frac{22}{3}, 9.}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 4, -(3/2), -7.42, -(22/math.e), (22/3), -4*math.sqrt(2), -1,))\nsnd = set((1, (20/3), 3, 0, -4*math.sqrt(2), -(22/math.e), 9., -7.95, -(3/2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.015,0.122,0.058,0.019,0.178,0.132,0.016,0.036,0.036,0.304\\}$ and $\\{0.049,0.014,0.065,0.038,0.079,0.129,0.102,0.214,0.091,0.116\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.015, 0.122, 0.058, 0.019, 0.178, 0.132, 0.016, 0.036, 0.036, 0.304\ndistribution2 = 0.049, 0.014, 0.065, 0.038, 0.079, 0.129, 0.102, 0.214, 0.091, 0.116\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 6, -2 \\sqrt{2}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 6, -2*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -1, -5, -\\frac{8}{5}} \\setminus {1, -2 \\sqrt{3}, -1, 0}$.\n", - "Output Answer": [ - "${-8, -5, -\\frac{8}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -1, -5, -(8/5),))\nsnd = set((1, -2*math.sqrt(3), -1, 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\sqrt{5}, -3 \\sqrt{5}, 8, -7}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(5), -3*math.sqrt(5), 8, -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, 14, 13, -15, -15, -12}$.\n", - "Output Answer": [ - "$8 \\sqrt{\\frac{43}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 14, 13, -15, -15, -12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, 8, -3.702, -\\frac{24}{\\pi }, 4.2, \\frac{7}{4}, -5} \\cup {8.3, -\\frac{24}{\\pi }, 5, -3, \\frac{29}{4}, -5}$.\n", - "Output Answer": [ - "${-\\frac{24}{\\pi }, -5, -3.702, -3, \\frac{7}{4}, 4.2, 5, \\frac{29}{4}, 8, 8.3}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 8, -3.702, -(24/math.pi), 4.2, (7/4), -5,))\nsnd = set((8.3, -(24/math.pi), 5, -3, (29/4), -5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.225,0.264,0.123,0.251\\}$ and $\\{0.441,0.223,0.162,0.172\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.225, 0.264, 0.123, 0.251\ndistribution2 = 0.441, 0.223, 0.162, 0.172\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -4, 8, -8, -1, 8, -4, -1, 8, -4, -8, 8, -4, 8, -4, -1, -1, 8, -8, -1, -1, 8}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -4, 8, -8, -1, 8, -4, -1, 8, -4, -8, 8, -4, 8, -4, -1, -1, 8, -8, -1, -1, 8\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, -4, 0, -10, -1}$.\n", - "Output Answer": [ - "$3 \\sqrt{\\frac{19}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -4, 0, -10, -1\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 2, 0, -2 e} \\setminus {\\frac{19}{2}, 2, 9, -9, 3 e, 10}$.\n", - "Output Answer": [ - "${-2 e, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 2, 0, -2*math.e,))\nsnd = set(((19/2), 2, 9, -9, 3*math.e, 10,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{18}{e}, -8, 0}$.\n", - "Output Answer": [ - "${-8, -\\frac{18}{e}, 0}$" - ], - "Output Program": [ - "import math\n\nvalues = -(18/math.e), -8, 0\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 8, 9, 1}$.\n", - "Output Answer": [ - "$\\frac{288}{125}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 8, 9, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${2, 3, -3 \\pi, -\\frac{17}{e}, \\frac{17}{\\pi }, 9.6} \\setminus {2, 0, -\\sqrt{3}, -2, 3, 1.2}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\frac{17}{e}, \\frac{17}{\\pi }, 9.6}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 3, -3*math.pi, -(17/math.e), (17/math.pi), 9.6,))\nsnd = set((2, 0, -math.sqrt(3), -2, 3, 1.2,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, -\\frac{7}{\\sqrt{2}}, 6}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{2}}, 0, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(7/(math.sqrt(2))), 6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 6, 9, 5, 6, 5, 9, 9, 5, 5, 5, 6, 5, 5, 5, 6, 6, 6, 5, -8, 5, -8, 6, 5, 6, -8}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 6, 9, 5, 6, 5, 9, 9, 5, 5, 5, 6, 5, 5, 5, 6, 6, 6, 5, -8, 5, -8, 6, 5, 6, -8\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, 1, 3, -11}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{467}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 1, 3, -11\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 2 \\pi, -\\frac{10}{e}, 2, 7, 2, -6, 2, 3, 2 \\pi, 8, -5}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 2*math.pi, -(10/math.e), 2, 7, 2, -6, 2, 3, 2*math.pi, 8, -5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{3}, -\\frac{17}{\\sqrt{3}}, 1} \\cup {-5, \\sqrt{3}, -\\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{3}}, -5, 1, \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), -(17/(math.sqrt(3))), 1,))\nsnd = set((-5, math.sqrt(3), -(17/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x-6.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$-6.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(-2.3*x-6.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${9, -4, 2.093, 8, 6 \\sqrt{2}, 5}$.\n", - "Output Answer": [ - "${-4, 2.093, 5, 8, 6 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -4, 2.093, 8, 6*math.sqrt(2), 5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{1}{\\sqrt{5}}, -\\pi, 0, 0, -3 \\pi, \\frac{39}{5}, \\frac{15}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{39}{5}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = (1/(math.sqrt(5))), -math.pi, 0, 0, -3*math.pi, (39/5), (15/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.5 x-0.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$-0.38$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(-0.5*x-0.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 9, 1, 1, -4}$.\n", - "Output Answer": [ - "$\\frac{13}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 9, 1, 1, -4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{2}, -\\frac{29}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3 \\sqrt{2}-\\frac{29}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(2), -(29/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -1, 7, 1, 1, 6, 6, 6, 6, 7, 7, 6, 7, -1, 7, 7, 1, 7, 7, 6, -1, 7, -1}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -1, 7, 1, 1, 6, 6, 6, 6, 7, 7, 6, 7, -1, 7, 7, 1, 7, 7, 6, -1, 7, -1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6, 256, 64, 6561, 100, 10000}$.\n", - "Output Answer": [ - "$120 \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 256, 64, 6561, 100, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2 e, 4 \\sqrt{2}, -4.132, \\frac{2}{\\pi }} \\cup {-4.132, 0, \\frac{27}{\\pi }, -2 e, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-2 e, -4.132, 0, \\frac{2}{\\pi }, 4 \\sqrt{2}, \\frac{27}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, 4*math.sqrt(2), -4.132, (2/math.pi),))\nsnd = set((-4.132, 0, (27/math.pi), -2*math.e, 4*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 e, -2 e, -2 e, -2 e, -e, -2 e, e, -2 e, -e, -2 e, e, -2 e, -e, e, e, -2 e, -2 e, -2 e, -2 e, -2 e, -e, -e, -2 e, 0, -e}$.\n", - "Output Answer": [ - "$\\{-2 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.e, -2*math.e, -2*math.e, -2*math.e, -math.e, -2*math.e, math.e, -2*math.e, -math.e, -2*math.e, math.e, -2*math.e, -math.e, math.e, math.e, -2*math.e, -2*math.e, -2*math.e, -2*math.e, -2*math.e, -math.e, -math.e, -2*math.e, 0, -math.e\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\pi, 8, \\frac{28}{3}, 6, -1, 5 \\sqrt{3}} \\setminus {3 \\pi, \\frac{23}{3}, 5 \\sqrt{3}, 9}$.\n", - "Output Answer": [ - "${-1, 6, 8, \\frac{28}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, 8, (28/3), 6, -1, 5*math.sqrt(3),))\nsnd = set((3*math.pi, (23/3), 5*math.sqrt(3), 9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${e, -6, \\pi}$.", - "Output Answer": [ - "$e$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.e, -6, math.pi\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${3 e, 3 e, -2 \\sqrt{2}, -9}$.\n", - "Output Answer": [ - "${-9, -2 \\sqrt{2}, 3 e, 3 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.e, 3*math.e, -2*math.sqrt(2), -9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, 1, -7, 1, 1, 1, 0, -9, 1, -2, 3, 1, -9, -9, 1, -7, -2, 1, -2, 1, -9, -9, -2, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, 1, -7, 1, 1, 1, 0, -9, 1, -2, 3, 1, -9, -9, 1, -7, -2, 1, -2, 1, -9, -9, -2, 1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.311,0.379,0.119,0.081\\}$ and $\\{0.394,0.088,0.099,0.193\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.311, 0.379, 0.119, 0.081\ndistribution2 = 0.394, 0.088, 0.099, 0.193\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 10, 5, 5, 0, -7, -7, 5, -7, 5, 0, 0, 10, 10, 0, -7, -6, -7, -7, -6, 5, -7, 10, -7, -6, -7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 10, 5, 5, 0, -7, -7, 5, -7, 5, 0, 0, 10, 10, 0, -7, -6, -7, -7, -6, 5, -7, 10, -7, -6, -7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9 \\log (2), 4 \\log (2), -3 \\log (2), 2 \\log (2), 2 \\log (2), 2 \\log (2), 9 \\log (2), 4 \\log (2), -12 \\log (2), 4 \\log (2), 9 \\log (2), -3 \\log (2), 4 \\log (2), -14 \\log (2), -12 \\log (2), 4 \\log (2), -14 \\log (2), -14 \\log (2), 2 \\log (2), -3 \\log (2), 4 \\log (2), -12 \\log (2), \\log (2), 4 \\log (2), 2 \\log (2), 9 \\log (2)}$.\n", - "Output Answer": [ - "$\\{4 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 9*math.log(2), 4*math.log(2), -3*math.log(2), 2*math.log(2), 2*math.log(2), 2*math.log(2), 9*math.log(2), 4*math.log(2), -12*math.log(2), 4*math.log(2), 9*math.log(2), -3*math.log(2), 4*math.log(2), -14*math.log(2), -12*math.log(2), 4*math.log(2), -14*math.log(2), -14*math.log(2), 2*math.log(2), -3*math.log(2), 4*math.log(2), -12*math.log(2), math.log(2), 4*math.log(2), 2*math.log(2), 9*math.log(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{19}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, -2 \\sqrt{5}, -\\frac{11}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\frac{19}{\\sqrt{5}}-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (19/(math.sqrt(5))), (14/(math.sqrt(5))), (1/(math.sqrt(5))), -2*math.sqrt(5), -(11/(math.sqrt(5))), -(4/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $1.5 x^2+1.2 x+0.2 < 1.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.2].", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(P((1.5*x**2+1.2*x+0.2 < 1.5)))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\pi, \\frac{4}{\\pi }, 2 e, -3, 8} \\cup {-3, 10, 2 e, -2 \\pi}$.\n", - "Output Answer": [ - "${-2 \\pi, -3, \\frac{4}{\\pi }, 2 e, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, (4/math.pi), 2*math.e, -3, 8,))\nsnd = set((-3, 10, 2*math.e, -2*math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.128,0.087,0.103,0.124,0.064,0.109,0.054,0.157,0.092\\}$ and $\\{0.093,0.033,0.056,0.059,0.09,0.059,0.07,0.083,0.302\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.128, 0.087, 0.103, 0.124, 0.064, 0.109, 0.054, 0.157, 0.092\ndistribution2 = 0.093, 0.033, 0.056, 0.059, 0.09, 0.059, 0.07, 0.083, 0.302\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, 36, -64}$.\n", - "Output Answer": [ - "$40\\ 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, 36, -64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x+2.7$ where $x \\sim $ \\text{PoissonDistribution}[2.4]\n", - "Output Answer": [ - "$3.66$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.4)\nprint(E(0.4*x+2.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -2, -8, 0, -4, -8}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -2, -8, 0, -4, -8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 9, 13, 11}$.\n", - "Output Answer": [ - "$\\frac{102960}{8467}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 9, 13, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 4, 9.82, -2.1, -\\frac{5}{e}, -9, 6, -11 \\log (2)} \\cup {-\\frac{5}{e}, -3, -1.306, -1, -2.1, -9, 7 \\log (2), 9.82}$.\n", - "Output Answer": [ - "${-9, -11 \\log (2), -3, -2.1, -\\frac{5}{e}, -1.306, -1, 4, 7 \\log (2), 6, 9.82}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 4, 9.82, -2.1, -(5/math.e), -9, 6, -11*math.log(2),))\nsnd = set((-(5/math.e), -3, -1.306, -1, -2.1, -9, 7*math.log(2), 9.82,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{54}{7}, -5 \\sqrt{2}, -7, \\frac{25}{e}, -\\frac{16}{3}, -1, -\\frac{1}{\\sqrt{2}}, -9, -7, 3 \\sqrt{3}, -\\frac{13}{e}, 1, 5, -9, 7}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (54/7), -5*math.sqrt(2), -7, (25/math.e), -(16/3), -1, -(1/(math.sqrt(2))), -9, -7, 3*math.sqrt(3), -(13/math.e), 1, 5, -9, 7\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{11}{2}, -2, 1.325, 3 \\sqrt{3}, 3, 3 \\log (2), 4} \\setminus {0, 2 \\sqrt{3}, 1.325, 3}$.\n", - "Output Answer": [ - "${-2, 3 \\log (2), 4, 3 \\sqrt{3}, \\frac{11}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((11/2), -2, 1.325, 3*math.sqrt(3), 3, 3*math.log(2), 4,))\nsnd = set((0, 2*math.sqrt(3), 1.325, 3,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{5}, -3, -6, -5}$.\n", - "Output Answer": [ - "${-6, -5, -3, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(5), -3, -6, -5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 6, 15, \\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\frac{1320}{151}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 6, 15, (15/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{29}{2}, \\frac{37}{2}, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{875568}{70921}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (29/2), (37/2), (17/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{2}{e}, \\frac{16}{e}, \\frac{19}{e}, \\frac{22}{e}, \\frac{17}{e}, \\frac{17}{e}, \\frac{17}{e}, \\frac{23}{e}, \\frac{24}{e}, \\frac{17}{e}, \\frac{16}{e}, \\frac{16}{e}, \\frac{16}{e}, \\frac{17}{e}, \\frac{17}{e}, \\frac{17}{e}, \\frac{16}{e}, \\frac{16}{e}, \\frac{23}{e}, \\frac{17}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{17}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (2/math.e), (16/math.e), (19/math.e), (22/math.e), (17/math.e), (17/math.e), (17/math.e), (23/math.e), (24/math.e), (17/math.e), (16/math.e), (16/math.e), (16/math.e), (17/math.e), (17/math.e), (17/math.e), (16/math.e), (16/math.e), (23/math.e), (17/math.e)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{8}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{8}{\\sqrt{\\pi }},-\\frac{3}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(8/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{1}{\\sqrt{2}}, -2 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, 0, 4 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, -3 \\sqrt{2}, 0, -2 \\sqrt{2}, -2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, 4 \\sqrt{2}, 4 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, 4 \\sqrt{2}, 4 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, 0, 0, -2 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, 4 \\sqrt{2}, 0, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (1/(math.sqrt(2))), -2*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), 0, 4*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), (5/(math.sqrt(2))), -3*math.sqrt(2), 0, -2*math.sqrt(2), -2*math.sqrt(2), (1/(math.sqrt(2))), 4*math.sqrt(2), 4*math.sqrt(2), (5/(math.sqrt(2))), 4*math.sqrt(2), 4*math.sqrt(2), (5/(math.sqrt(2))), 0, 0, -2*math.sqrt(2), (5/(math.sqrt(2))), 4*math.sqrt(2), 0, -2*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 8, -7, -6, -5, 8, -5, 8, 1, -6, 9, -6, -6, 8, 0, 1, 1, -6, -6, -7, -6, -6, -7, 9, -7, -6, 8, -5, 8}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 8, -7, -6, -5, 8, -5, 8, 1, -6, 9, -6, -6, 8, 0, 1, 1, -6, -6, -7, -6, -6, -7, 9, -7, -6, 8, -5, 8\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-9, 2, -3, -7, 0, -\\frac{5}{\\sqrt{3}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-3-\\frac{5}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, 2, -3, -7, 0, -(5/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9.2, -7, 6} \\setminus {-5, 1, -7, -9.2, -\\frac{3}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9.2, -7, 6,))\nsnd = set((-5, 1, -7, -9.2, -(3/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 9, \\frac{44}{3}, 11}$.\n", - "Output Answer": [ - "$\\frac{528}{43}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 9, (44/3), 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, \\frac{17}{2}, 4, -\\frac{2}{\\sqrt{3}}, -3 \\sqrt{2}, -6, 6, 9, -5 \\sqrt{3}} \\cup {10, 9, 6 \\sqrt{2}, 2 \\sqrt{2}, -7, 4, -\\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -7, -6, -3 \\sqrt{2}, -\\sqrt{3}, -\\frac{2}{\\sqrt{3}}, 2 \\sqrt{2}, 4, 5, 6, 6 \\sqrt{2}, \\frac{17}{2}, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, (17/2), 4, -(2/(math.sqrt(3))), -3*math.sqrt(2), -6, 6, 9, -5*math.sqrt(3),))\nsnd = set((10, 9, 6*math.sqrt(2), 2*math.sqrt(2), -7, 4, -math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-59049, 4, 25, 6, 46656, -8}$.\n", - "Output Answer": [ - "$36\\ 3^{5/6} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -59049, 4, 25, 6, 46656, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -2, -2, -8, -\\frac{18}{e}, \\frac{11}{3}, -6, \\frac{12}{e}, \\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$8+\\frac{12}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -2, -2, -8, -(18/math.e), (11/3), -6, (12/math.e), (1/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{18}{\\pi }, -\\frac{27}{\\pi }, -\\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{31}{3 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (18/math.pi), -(27/math.pi), -(22/math.pi)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, 18, 17, 6}$.\n", - "Output Answer": [ - "$\\frac{9792}{841}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, 18, 17, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${8, -7.9, -1, -\\frac{19}{2}, 3, 3 \\sqrt{5}, -\\frac{6}{\\sqrt{\\pi }}} \\setminus {8, -\\frac{11}{\\sqrt{\\pi }}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -7.9, -\\frac{6}{\\sqrt{\\pi }}, -1, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -7.9, -1, -(19/2), 3, 3*math.sqrt(5), -(6/(math.sqrt(math.pi))),))\nsnd = set((8, -(11/(math.sqrt(math.pi))), 3*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{4}, \\frac{19}{4}, -\\frac{21}{4}, \\frac{19}{4}, 3, \\frac{11}{4}, \\frac{19}{4}, \\frac{19}{4}, -\\frac{21}{4}, \\frac{11}{4}, -\\frac{21}{4}, 3, 3, -\\frac{21}{4}, 3, -\\frac{21}{4}, \\frac{19}{4}, -\\frac{21}{4}, \\frac{11}{4}, \\frac{19}{4}, -\\frac{21}{4}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{21}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (11/4), (19/4), -(21/4), (19/4), 3, (11/4), (19/4), (19/4), -(21/4), (11/4), -(21/4), 3, 3, -(21/4), 3, -(21/4), (19/4), -(21/4), (11/4), (19/4), -(21/4)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{9}{2}, -\\frac{15}{2}, \\frac{5}{2}, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (9/2), -(15/2), (5/2), -(15/2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-1, \\frac{17}{2}, 10, 1, 3, 2 \\sqrt{2}, 2, 7, 6, -\\frac{35}{4}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, (17/2), 10, 1, 3, 2*math.sqrt(2), 2, 7, 6, -(35/4)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 9, -7, 2, 4}$.\n", - "Output Answer": [ - "$\\frac{12}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 9, -7, 2, 4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-9 \\log (2), 0, -\\frac{4}{3}}$.\n", - "Output Answer": [ - "${-9 \\log (2), -\\frac{4}{3}, 0}$" - ], - "Output Program": [ - "import math\n\nvalues = -9*math.log(2), 0, -(4/3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-8, 9, -9}$.\n", - "Output Answer": [ - "${-9, -8, 9}$" - ], - "Output Program": [ - "values = -8, 9, -9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5 \\sqrt{2}, 7, -\\frac{21}{5}, -5 \\sqrt{2}, -\\frac{17}{4}, -1, 7, 2, -6, 4, -3 \\sqrt{3}, -\\sqrt{5}, -\\frac{9}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$7+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(2), 7, -(21/5), -5*math.sqrt(2), -(17/4), -1, 7, 2, -6, 4, -3*math.sqrt(3), -math.sqrt(5), -(9/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${8.8, -6, \\frac{5}{2}, -4}$.\n", - "Output Answer": [ - "${-6, -4, \\frac{5}{2}, 8.8}$" - ], - "Output Program": [ - "values = 8.8, -6, (5/2), -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, 4, 3, -8, \\frac{7}{e}, 8, \\frac{14}{\\sqrt{\\pi }}, -3 \\pi, \\frac{7}{4}, -4}$.\n", - "Output Answer": [ - "$8+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 4, 3, -8, (7/math.e), 8, (14/(math.sqrt(math.pi))), -3*math.pi, (7/4), -4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, 5, 4, -\\frac{23}{e}, -7, 1, 3 \\sqrt{5}, -\\frac{24}{7}, 2, -7, 4 \\sqrt{2}, -1, -1, -5}$.\n", - "Output Answer": [ - "$3 \\sqrt{5}+\\frac{23}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 5, 4, -(23/math.e), -7, 1, 3*math.sqrt(5), -(24/7), 2, -7, 4*math.sqrt(2), -1, -1, -5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 6, 3 \\sqrt{5}, 5 \\sqrt{2}, 2 \\sqrt{3}, -6, 4, -8, 0}$.\n", - "Output Answer": [ - "$8+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 6, 3*math.sqrt(5), 5*math.sqrt(2), 2*math.sqrt(3), -6, 4, -8, 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -2, -6}$.\n", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -2, -6\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, -7., 9} \\cup {5, 9, -0.2}$.\n", - "Output Answer": [ - "${-7., -0.2, 5, 9}$" - ], - "Output Program": [ - "fst = set((5, -7., 9,))\nsnd = set((5, 9, -0.2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{2}, e, 0, 6}$.", - "Output Answer": [ - "$\\frac{e}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(2), math.e, 0, 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${8, \\frac{6}{e}, -8, -3, -5.773, 1, -\\frac{27}{4}, -\\frac{16}{\\sqrt{3}}} \\cup {-8, 1, -\\frac{23}{4}, \\frac{6}{e}, 2.226, -7, -5, 9}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -8, -7, -\\frac{27}{4}, -5.773, -\\frac{23}{4}, -5, -3, 1, \\frac{6}{e}, 2.226, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, (6/math.e), -8, -3, -5.773, 1, -(27/4), -(16/(math.sqrt(3))),))\nsnd = set((-8, 1, -(23/4), (6/math.e), 2.226, -7, -5, 9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 7, 7, 7, -7, -7, 3, 7, 7, -7, 3, 3, -7, 3, -7, -7, 7, 3, 3, 7, 3, 3, -7}$.\n", - "Output Answer": [ - "$\\{-7,3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 7, 7, 7, -7, -7, 3, 7, 7, -7, 3, 3, -7, 3, -7, -7, 7, 3, 3, 7, 3, 3, -7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 e, 4 \\sqrt{3}, 3 e}$.\n", - "Output Answer": [ - "$5 e$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.e, 4*math.sqrt(3), 3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4, 10, -\\frac{13}{\\pi }, -e, 10, 5 \\sqrt{3}, -5, \\frac{22}{e}}$.\n", - "Output Answer": [ - "${-5, -\\frac{13}{\\pi }, -4, -e, \\frac{22}{e}, 5 \\sqrt{3}, 10, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 10, -(13/math.pi), -math.e, 10, 5*math.sqrt(3), -5, (22/math.e)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x-2.9$ where $x \\sim $ \\text{PoissonDistribution}[3.1]\n", - "Output Answer": [ - "$9.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.1)\nprint(E(4.*x-2.9))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-6, \\frac{8}{3}, 8 \\log (2)} \\cup {\\frac{8}{3}, 8 \\log (2), -2}$.\n", - "Output Answer": [ - "${-6, -2, \\frac{8}{3}, 8 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, (8/3), 8*math.log(2),))\nsnd = set(((8/3), 8*math.log(2), -2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x^3+2.4 x^2+4.3 x+4.8$ where $x \\sim $ \\text{BetaDistribution}[1.3,1.8]\n", - "Output Answer": [ - "$7.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 1.8)\nprint(E(3.6*x**3+2.4*x**2+4.3*x+4.8))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-6, \\frac{2}{3}, -\\frac{27}{4}, \\frac{15}{\\pi }, -12 \\log (2), e, -\\frac{12}{e}}$.\n", - "Output Answer": [ - "${-12 \\log (2), -\\frac{27}{4}, -6, -\\frac{12}{e}, \\frac{2}{3}, e, \\frac{15}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, (2/3), -(27/4), (15/math.pi), -12*math.log(2), math.e, -(12/math.e)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, 9, 1024, -27, 59049}$.\n", - "Output Answer": [ - "$108 \\sqrt[5]{-1} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, 9, 1024, -27, 59049\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, 0, -12}$.\n", - "Output Answer": [ - "$2 \\sqrt{21}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 0, -12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 16, 4096, 6561}$.\n", - "Output Answer": [ - "$432$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 16, 4096, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, \\frac{4}{3}}$.\n", - "Output Answer": [ - "$\\frac{22}{3}$" - ], - "Output Program": [ - "values = -6, (4/3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.5 x^2-3.9 x-0.1$ where $x \\sim $ \\text{PoissonDistribution}[3.5]\n", - "Output Answer": [ - "$57.12$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(E(4.5*x**2-3.9*x-0.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 4, -\\frac{14}{e}, -1, -2 e, -4, -8, \\frac{11}{\\sqrt{\\pi }}, -2 e, 9, -7, 6, -\\frac{7}{e}, \\frac{9}{e}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 4, -(14/math.e), -1, -2*math.e, -4, -8, (11/(math.sqrt(math.pi))), -2*math.e, 9, -7, 6, -(7/math.e), (9/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\sqrt{3}, 0, 4 \\sqrt{3}, 0, 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{7 \\sqrt{3}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.sqrt(3), 0, 4*math.sqrt(3), 0, 6*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -512, 100}$.\n", - "Output Answer": [ - "$8 \\sqrt[3]{-1} 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -512, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -6, 4, 3 \\sqrt{5}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, -6, 4, 3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.079,0.099,0.063,0.067,0.062,0.067,0.277,0.104,0.128\\}$ and $\\{0.28,0.004,0.195,0.103,0.041,0.009,0.174,0.001,0.055\\}$.", - "Output Answer": [ - "$0.96$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.079, 0.099, 0.063, 0.067, 0.062, 0.067, 0.277, 0.104, 0.128\ndistribution2 = 0.28, 0.004, 0.195, 0.103, 0.041, 0.009, 0.174, 0.001, 0.055\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -9, -7, 3, -5, 8, \\frac{7}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -9, -7, 3, -5, 8, (7/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-7, 2, \\frac{5}{\\pi }, -1.51, -10, -8, 4}$.\n", - "Output Answer": [ - "${-10, -8, -7, -1.51, \\frac{5}{\\pi }, 2, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 2, (5/math.pi), -1.51, -10, -8, 4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{22}{\\sqrt{5}}, 10, -\\frac{5}{\\sqrt{\\pi }}, \\frac{2}{3}, -\\frac{4}{\\sqrt{3}}, -6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{2}{3}-\\frac{4}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (22/(math.sqrt(5))), 10, -(5/(math.sqrt(math.pi))), (2/3), -(4/(math.sqrt(3))), -6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.6 x-0.5$ where $x \\sim $ \\text{BetaDistribution}[0.9,0.5]\n", - "Output Answer": [ - "$-1.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.9, 0.5)\nprint(E(-1.6*x-0.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, 8, 100, 243, 1}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{2} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 8, 100, 243, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, 9, 3, 11, -15}$.\n", - "Output Answer": [ - "$150$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 9, 3, 11, -15\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{2}, -3 \\sqrt{5}, 0, 4 \\sqrt{5}, \\frac{3}{\\sqrt{5}}, -\\frac{18}{e}, 1}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(2), -3*math.sqrt(5), 0, 4*math.sqrt(5), (3/(math.sqrt(5))), -(18/math.e), 1\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9, -9, 0.217, \\frac{1}{e}, 8, 8.16} \\setminus {-7, \\frac{9}{e}, -3, 0.217, -9}$.\n", - "Output Answer": [ - "${\\frac{1}{e}, 8, 8.16, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -9, 0.217, (1/math.e), 8, 8.16,))\nsnd = set((-7, (9/math.e), -3, 0.217, -9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{3}{\\pi }, \\frac{12}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{15}{2 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (3/math.pi), (12/math.pi)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, -8, 0, 3, \\frac{11}{2}, 9}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -8, 0, 3, (11/2), 9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 117649, 10, -6, 7776, 256}$.\n", - "Output Answer": [ - "$84 \\sqrt[6]{-35} \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 117649, 10, -6, 7776, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{5}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, -6 \\sqrt{2}, -6 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, -6 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}, -6 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, -6 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, -6 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -6 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -6 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{-6 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (5/(math.sqrt(2))), -(7/(math.sqrt(2))), -6*math.sqrt(2), -6*math.sqrt(2), (5/(math.sqrt(2))), -6*math.sqrt(2), -(5/(math.sqrt(2))), -(7/(math.sqrt(2))), -(5/(math.sqrt(2))), -6*math.sqrt(2), (5/(math.sqrt(2))), (5/(math.sqrt(2))), -6*math.sqrt(2), -(7/(math.sqrt(2))), -(5/(math.sqrt(2))), -(7/(math.sqrt(2))), -6*math.sqrt(2), -(5/(math.sqrt(2))), -6*math.sqrt(2), -(5/(math.sqrt(2))), -6*math.sqrt(2), -(5/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.023,0.122,0.069,0.095,0.035,0.291,0.056,0.033,0.179\\}$ and $\\{0.205,0.041,0.058,0.058,0.038,0.045,0.14,0.158,0.176\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.023, 0.122, 0.069, 0.095, 0.035, 0.291, 0.056, 0.033, 0.179\ndistribution2 = 0.205, 0.041, 0.058, 0.058, 0.038, 0.045, 0.14, 0.158, 0.176\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-8, 3.1, -8, -8.12, 7}$.\n", - "Output Answer": [ - "${-8.12, -8, -8, 3.1, 7}$" - ], - "Output Program": [ - "values = -8, 3.1, -8, -8.12, 7\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{17}{\\sqrt{5}}, -\\frac{17}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\frac{17}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{3}{\\sqrt{5}},\\frac{12}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(17/(math.sqrt(5))), -(17/(math.sqrt(5))), (21/(math.sqrt(5))), (3/(math.sqrt(5))), (18/(math.sqrt(5))), (21/(math.sqrt(5))), (12/(math.sqrt(5))), (12/(math.sqrt(5))), (19/(math.sqrt(5))), (12/(math.sqrt(5))), (12/(math.sqrt(5))), (18/(math.sqrt(5))), (18/(math.sqrt(5))), (18/(math.sqrt(5))), (19/(math.sqrt(5))), (18/(math.sqrt(5))), (12/(math.sqrt(5))), (19/(math.sqrt(5))), (21/(math.sqrt(5))), (3/(math.sqrt(5))), (3/(math.sqrt(5))), (3/(math.sqrt(5))), -(17/(math.sqrt(5))), (3/(math.sqrt(5))), (19/(math.sqrt(5))), (12/(math.sqrt(5))), (3/(math.sqrt(5))), (21/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{37}{7}, \\frac{2}{3}, -\\frac{13}{7}, 1, 7 \\sqrt{2}, -\\frac{14}{\\sqrt{3}}, -5}$.", - "Output Answer": [ - "$-\\frac{13}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(37/7), (2/3), -(13/7), 1, 7*math.sqrt(2), -(14/(math.sqrt(3))), -5\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${14, 7, -12, 1, 4}$.\n", - "Output Answer": [ - "$\\frac{917}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 7, -12, 1, 4\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 8, 19, 17}$.\n", - "Output Answer": [ - "$\\frac{10336}{747}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 8, 19, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 e, -5, -10, \\frac{44}{7}, -1, 0, -\\frac{19}{e}, -4}$.\n", - "Output Answer": [ - "$\\frac{114}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, -5, -10, (44/7), -1, 0, -(19/math.e), -4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -8, -4, 3, 10, -9, 9, -8, -8, 10, 10, -8, 10, -8, 9, -4, -9, -8, 9, 9, -9, 10}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -8, -4, 3, 10, -9, 9, -8, -8, 10, 10, -8, 10, -8, 9, -4, -9, -8, 9, 9, -9, 10\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{21}{\\pi }, -\\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{21}{\\pi }+\\frac{4}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (21/math.pi), -(4/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{22}{3}, 7 \\sqrt{2}, -2, 6, 5}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(22/3), 7*math.sqrt(2), -2, 6, 5\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, 6, 3, 4, 8, 4, 8, 3, 8, -6, 6, -4, 6, -6, 3, 6, 3, 4, -6, 8, -4, 6}$.\n", - "Output Answer": [ - "$\\{8,6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, 6, 3, 4, 8, 4, 8, 3, 8, -6, 6, -4, 6, -6, 3, 6, 3, 4, -6, 8, -4, 6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, 15, 14}$.\n", - "Output Answer": [ - "$\\frac{871}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 15, 14\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, 6, -10, 1, 10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{733}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 6, -10, 1, 10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 2, -5, -5, -6, 10}$.\n", - "Output Answer": [ - "$\\frac{1121}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 2, -5, -5, -6, 10\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.46,0.115,0.081,0.241\\}$ and $\\{0.172,0.407,0.251,0.121\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.46, 0.115, 0.081, 0.241\ndistribution2 = 0.172, 0.407, 0.251, 0.121\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{2}, \\frac{21}{4}, -\\frac{13}{7}}$.\n", - "Output Answer": [ - "${-\\frac{13}{7}, 2 \\sqrt{2}, \\frac{21}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(2), (21/4), -(13/7)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $0.69 < 2.1 x-1.5 < 1.13$ where $x \\sim $ \\text{ExponentialDistribution}[1.8].", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(P((0.69 < 2.1*x-1.5) & (2.1*x-1.5 < 1.13)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, -9, -4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{31}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -9, -4\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{5}, -2 \\sqrt{5}, -3 \\sqrt{5}, -\\sqrt{5}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(5), -2*math.sqrt(5), -3*math.sqrt(5), -math.sqrt(5), 3*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 0}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.083,0.102,0.12,0.066,0.138,0.036,0.09,0.099,0.096\\}$ and $\\{0.026,0.149,0.049,0.081,0.105,0.217,0.113,0.138,0.116\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.083, 0.102, 0.12, 0.066, 0.138, 0.036, 0.09, 0.099, 0.096\ndistribution2 = 0.026, 0.149, 0.049, 0.081, 0.105, 0.217, 0.113, 0.138, 0.116\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.343,0.034,0.266\\}$ and $\\{0.366,0.101,0.229\\}$.", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.343, 0.034, 0.266\ndistribution2 = 0.366, 0.101, 0.229\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${625, 625, 16, 6, 9}$.\n", - "Output Answer": [ - "$10\\ 15^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 625, 625, 16, 6, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, -1, 0, 2, 0, -1, -1, -10, -3, -3, -1, -3, -1, 0, -3, -1, -1, 2, 2, 0, -10, -1, 0}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, -1, 0, 2, 0, -1, -1, -10, -3, -3, -1, -3, -1, 0, -3, -1, -1, 2, 2, 0, -10, -1, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9.2, -\\frac{3}{\\sqrt{2}}, -7, 7} \\setminus {-7, 0, -1.9, 5}$.\n", - "Output Answer": [ - "${-\\frac{3}{\\sqrt{2}}, 7, 9.2}$" - ], - "Output Program": [ - "import math\n\nfst = set((9.2, -(3/(math.sqrt(2))), -7, 7,))\nsnd = set((-7, 0, -1.9, 5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.8 x^2-4.3 x+2.4$ where $x \\sim $ \\text{PoissonDistribution}[2.3]\n", - "Output Answer": [ - "$-13.56$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.3)\nprint(E(-0.8*x**2-4.3*x+2.4))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2 \\sqrt{3}, 6 \\sqrt{3}, -3 \\sqrt{3}, -5 \\sqrt{3}, -4 \\sqrt{3}, 2 \\sqrt{3}, 0, \\sqrt{3}} \\cap {0, 6 \\sqrt{3}, 2 \\sqrt{3}, \\sqrt{3}, -6 \\sqrt{3}, -\\sqrt{3}, -2 \\sqrt{3}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -2 \\sqrt{3}, 0, \\sqrt{3}, 2 \\sqrt{3}, 6 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(3), 6*math.sqrt(3), -3*math.sqrt(3), -5*math.sqrt(3), -4*math.sqrt(3), 2*math.sqrt(3), 0, math.sqrt(3),))\nsnd = set((0, 6*math.sqrt(3), 2*math.sqrt(3), math.sqrt(3), -6*math.sqrt(3), -math.sqrt(3), -2*math.sqrt(3), -4*math.sqrt(3),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{2}, \\frac{15}{2}, -8, 3, 1, -10} \\setminus {-3, 5, -10, 5 \\sqrt{2}, 3, 10, 1}$.\n", - "Output Answer": [ - "${-8, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), (15/2), -8, 3, 1, -10,))\nsnd = set((-3, 5, -10, 5*math.sqrt(2), 3, 10, 1,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{39}{5}, 1, -\\frac{1}{4}, -5 \\sqrt{2}, 7, 4, -6, -3, -2.5, \\frac{2}{3}} \\cup {1, -3, 6, 3, -2.5, -5 \\sqrt{2}, \\frac{39}{5}, -\\frac{1}{4}, 4, -9}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{2}, -6, -3, -2.5, -\\frac{1}{4}, \\frac{2}{3}, 1, 3, 4, 6, 7, \\frac{39}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((39/5), 1, -(1/4), -5*math.sqrt(2), 7, 4, -6, -3, -2.5, (2/3),))\nsnd = set((1, -3, 6, 3, -2.5, -5*math.sqrt(2), (39/5), -(1/4), 4, -9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${4 \\sqrt{3}, -\\sqrt{2}, -2, 3 \\pi, -8, 9} \\cup {2, 3 \\pi, -2, \\frac{9}{4}, 5 \\sqrt{3}, -8, 9}$.\n", - "Output Answer": [ - "${-8, -2, -\\sqrt{2}, 2, \\frac{9}{4}, 4 \\sqrt{3}, 5 \\sqrt{3}, 9, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(3), -math.sqrt(2), -2, 3*math.pi, -8, 9,))\nsnd = set((2, 3*math.pi, -2, (9/4), 5*math.sqrt(3), -8, 9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -\\pi, -\\frac{13}{\\sqrt{2}}}$.", - "Output Answer": [ - "$-\\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -math.pi, -(13/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{21}{5}, \\frac{1}{5}, \\frac{41}{5}, -\\frac{9}{5}, \\frac{33}{5}, -6, -\\frac{21}{5}, \\frac{43}{5}}$.\n", - "Output Answer": [ - "$\\frac{37}{40}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(21/5), (1/5), (41/5), -(9/5), (33/5), -6, -(21/5), (43/5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -\\frac{7}{\\sqrt{5}}, 2, -\\frac{24}{\\pi }, -6, 5, -8}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -(7/(math.sqrt(5))), 2, -(24/math.pi), -6, 5, -8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-13, 11, -13, 6, -11, -11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{3461}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 11, -13, 6, -11, -11\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{16}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{48}{5 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (16/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, \\frac{46}{3}, \\frac{16}{3}}$.\n", - "Output Answer": [ - "$\\frac{9936}{1205}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, (46/3), (16/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3, -4, 49, 256}$.\n", - "Output Answer": [ - "$4 \\sqrt[4]{3} \\sqrt{14}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -4, 49, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x+2.$ where $x \\sim $ \\text{BetaDistribution}[1.,0.3]\n", - "Output Answer": [ - "$3.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 0.3)\nprint(E(1.6*x+2.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -3, -1}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -3, -1\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -9, 6, 3, 7, -7, 3, -8}$.\n", - "Output Answer": [ - "$-\\frac{1}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -9, 6, 3, 7, -7, 3, -8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${4, -7, 2, -2, -\\frac{20}{3}} \\setminus {4, -\\frac{5}{4}, -\\frac{20}{3}, -2, 2}$.\n", - "Output Answer": [ - "${-7}$" - ], - "Output Program": [ - "fst = set((4, -7, 2, -2, -(20/3),))\nsnd = set((4, -(5/4), -(20/3), -2, 2,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 2 e, 2, -\\pi} \\setminus {5.341, -\\pi, 10, -5, -7}$.\n", - "Output Answer": [ - "${2, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 2*math.e, 2, -math.pi,))\nsnd = set((5.341, -math.pi, 10, -5, -7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 16, 6}$.\n", - "Output Answer": [ - "$\\frac{432}{41}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 16, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 36, 16, 4, -7776}$.\n", - "Output Answer": [ - "$12 \\sqrt[5]{-1} 2^{3/5} 15^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 36, 16, 4, -7776\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x^2-1.2 x-1.7$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$10.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(2.6*x**2-1.2*x-1.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 1, 1, 3, 1, 1, 3, 1, 3, 3, -2, -2, 1, 3, 1, -2, -2, 1, 3, 1, 1, 3}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 1, 1, 3, 1, 1, 3, 1, 3, 3, -2, -2, 1, 3, 1, -2, -2, 1, 3, 1, 1, 3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, 3, 10, -10, 8, 10}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{19}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 3, 10, -10, 8, 10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{23}{5}, -1, -1, -9, 2 \\sqrt{2}, 7, 10, 5, 3 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{23}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (23/5), -1, -1, -9, 2*math.sqrt(2), 7, 10, 5, 3*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.207,0.079,0.235,0.155,0.059,0.151\\}$ and $\\{0.297,0.037,0.129,0.19,0.138,0.088\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.207, 0.079, 0.235, 0.155, 0.059, 0.151\ndistribution2 = 0.297, 0.037, 0.129, 0.19, 0.138, 0.088\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.8 x^3+3. x^2+4. x-9.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$-3.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(-0.8*x**3+3.*x**2+4.*x-9.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $10.94 < 2.4 x+3.3 < 21.11$ where $x \\sim $ \\text{ExponentialDistribution}[0.2].", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(P((10.94 < 2.4*x+3.3) & (2.4*x+3.3 < 21.11)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -8, -5 \\sqrt{2}, -5, -\\frac{13}{7}}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -8, -5*math.sqrt(2), -5, -(13/7)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, \\frac{20}{3}, \\frac{13}{3}}$.\n", - "Output Answer": [ - "$\\frac{5460}{823}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, (20/3), (13/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x-0.1$ where $x \\sim $ \\text{BetaDistribution}[0.3,2.]\n", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 2.)\nprint(E(3.1*x-0.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-2, -13, -5, 4, -11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{473}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, -13, -5, 4, -11\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.321,0.009,0.097,0.02,0.075,0.114,0.14,0.186,0.012\\}$ and $\\{0.071,0.033,0.053,0.049,0.214,0.134,0.045,0.041,0.147\\}$.", - "Output Answer": [ - "$0.64$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.321, 0.009, 0.097, 0.02, 0.075, 0.114, 0.14, 0.186, 0.012\ndistribution2 = 0.071, 0.033, 0.053, 0.049, 0.214, 0.134, 0.045, 0.041, 0.147\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{12}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, 0, 2 \\sqrt{3}, -2, -\\frac{7}{\\sqrt{3}}, -7 \\sqrt{2}, -2 \\sqrt{5}, -\\frac{46}{5}, \\frac{4}{\\sqrt{\\pi }}, -3, 7}$.\n", - "Output Answer": [ - "$7+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(12/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), 0, 2*math.sqrt(3), -2, -(7/(math.sqrt(3))), -7*math.sqrt(2), -2*math.sqrt(5), -(46/5), (4/(math.sqrt(math.pi))), -3, 7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.074,0.004,0.01,0.168,0.121,0.194,0.126\\}$ and $\\{0.143,0.087,0.141,0.068,0.147,0.193,0.1,0.014\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.074, 0.004, 0.01, 0.168, 0.121, 0.194, 0.126\ndistribution2 = 0.143, 0.087, 0.141, 0.068, 0.147, 0.193, 0.1, 0.014\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${4, -8, -1, -6, -3, -5, 7, -7, 6, 10, 1, -9, 3, -2} \\cap {8, 2, -4, -3, -6, -9, 4, 10, -2, 6}$.\n", - "Output Answer": [ - "${-9, -6, -3, -2, 4, 6, 10}$" - ], - "Output Program": [ - "fst = set((4, -8, -1, -6, -3, -5, 7, -7, 6, 10, 1, -9, 3, -2,))\nsnd = set((8, 2, -4, -3, -6, -9, 4, 10, -2, 6,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{15}{\\sqrt{\\pi }}, -2 \\pi, 9, -10}$.\n", - "Output Answer": [ - "${-10, -\\frac{15}{\\sqrt{\\pi }}, -2 \\pi, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/(math.sqrt(math.pi))), -2*math.pi, 9, -10\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, -5 \\sqrt{3}, -3, 6, 2, 7, 0.9, 0, -\\pi} \\cup {7, -5 \\sqrt{3}, -1, -9, \\frac{25}{3}, -\\pi, 0}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -\\pi, -3, -1, 0, 0.9, 2, 5, 6, 7, \\frac{25}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -5*math.sqrt(3), -3, 6, 2, 7, 0.9, 0, -math.pi,))\nsnd = set((7, -5*math.sqrt(3), -1, -9, (25/3), -math.pi, 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.8 x-0.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-0.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(-2.8*x-0.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${14 \\log (2), 0, 8 \\log (2), 8 \\log (2), -5 \\log (2), 2 \\log (2), 14 \\log (2), -5 \\log (2), 8 \\log (2), 0, 14 \\log (2), 0, 8 \\log (2), 14 \\log (2), -5 \\log (2), 0, 8 \\log (2), 0, 14 \\log (2), 0, 8 \\log (2), 14 \\log (2), 0, 8 \\log (2), -5 \\log (2), 0, 0, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 14*math.log(2), 0, 8*math.log(2), 8*math.log(2), -5*math.log(2), 2*math.log(2), 14*math.log(2), -5*math.log(2), 8*math.log(2), 0, 14*math.log(2), 0, 8*math.log(2), 14*math.log(2), -5*math.log(2), 0, 8*math.log(2), 0, 14*math.log(2), 0, 8*math.log(2), 14*math.log(2), 0, 8*math.log(2), -5*math.log(2), 0, 0, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-1, 8, -4, 9, 3, 7, -2} \\cap {9, 3, 5, -1, 6, -8, -7, -9, -5, 8}$.\n", - "Output Answer": [ - "${-1, 3, 8, 9}$" - ], - "Output Program": [ - "fst = set((-1, 8, -4, 9, 3, 7, -2,))\nsnd = set((9, 3, 5, -1, 6, -8, -7, -9, -5, 8,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\pi, 4, 3, -7, 4 \\sqrt{3}, -\\frac{14}{\\sqrt{\\pi }}, 3 \\sqrt{2}, \\frac{7}{2}, -6, \\frac{13}{3}, 5, 6}$.", - "Output Answer": [ - "$\\frac{15}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.pi, 4, 3, -7, 4*math.sqrt(3), -(14/(math.sqrt(math.pi))), 3*math.sqrt(2), (7/2), -6, (13/3), 5, 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x+5.2$ where $x \\sim $ \\text{PoissonDistribution}[3.8]\n", - "Output Answer": [ - "$13.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.8)\nprint(E(2.1*x+5.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.106,0.149,0.094\\}$ and $\\{0.19,0.398,0.189\\}$.", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.106, 0.149, 0.094\ndistribution2 = 0.19, 0.398, 0.189\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 4, 9, 4, 4, -6, 9, 4, 4, 9, -3, -7, 3, -3, -3, 3, 3, -6, 3, -3, 4, 3, -3, -6}$.\n", - "Output Answer": [ - "$\\{3,4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 4, 9, 4, 4, -6, 9, 4, 4, 9, -3, -7, 3, -3, -3, 3, 3, -6, 3, -3, 4, 3, -3, -6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{5}{\\sqrt{3}}, 9, 6, \\frac{7}{\\sqrt{2}}, -10, \\frac{5}{\\sqrt{\\pi }}, -4, -\\frac{33}{4}, 10, -3 \\sqrt{2}, 6, 8, -9}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = (5/(math.sqrt(3))), 9, 6, (7/(math.sqrt(2))), -10, (5/(math.sqrt(math.pi))), -4, -(33/4), 10, -3*math.sqrt(2), 6, 8, -9\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{9}{\\pi }, -\\frac{17}{\\pi }, -\\frac{7}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{11}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(9/math.pi), -(17/math.pi), -(7/math.pi)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -1, -6, -9, -6, -9, 4, -9, -9, -4, 4, 8, -9, 3, 3, -4, 8, -9, -6, -9, -9}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -1, -6, -9, -6, -9, 4, -9, -9, -4, 4, 8, -9, 3, 3, -4, 8, -9, -6, -9, -9\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{20}{e}, -\\frac{69}{7}, -\\frac{9}{2}, -\\frac{29}{5}, -7}$.\n", - "Output Answer": [ - "$\\frac{69}{7}+\\frac{20}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = (20/math.e), -(69/7), -(9/2), -(29/5), -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -7, -\\frac{17}{\\sqrt{5}}, -6, 12 \\log (2), -5, 6, -6 \\sqrt{2}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+12 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -7, -(17/(math.sqrt(5))), -6, 12*math.log(2), -5, 6, -6*math.sqrt(2), -5*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{16}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{19}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{16}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{16}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{19}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{16}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{16}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (16/(math.sqrt(5))), (16/(math.sqrt(5))), 2*math.sqrt(5), (19/(math.sqrt(5))), (19/(math.sqrt(5))), 2*math.sqrt(5), (16/(math.sqrt(5))), 2*math.sqrt(5), (16/(math.sqrt(5))), 2*math.sqrt(5), (19/(math.sqrt(5))), (16/(math.sqrt(5))), -(13/(math.sqrt(5))), (16/(math.sqrt(5))), -(13/(math.sqrt(5))), 2*math.sqrt(5), (16/(math.sqrt(5))), (19/(math.sqrt(5))), (16/(math.sqrt(5))), (19/(math.sqrt(5))), -(13/(math.sqrt(5))), (19/(math.sqrt(5))), (16/(math.sqrt(5))), (19/(math.sqrt(5))), 2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-5, 9, 5, 8, -9, 0} \\cap {5, -1, -5, 10, 0, 2}$.\n", - "Output Answer": [ - "${-5, 0, 5}$" - ], - "Output Program": [ - "fst = set((-5, 9, 5, 8, -9, 0,))\nsnd = set((5, -1, -5, 10, 0, 2,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{11}{e}, \\frac{17}{e}, \\frac{23}{e}, \\frac{13}{e}, \\frac{8}{e}, \\frac{24}{e}, -\\frac{8}{e}, -\\frac{18}{e}, -\\frac{25}{e}, \\frac{2}{e}, -\\frac{12}{e}, \\frac{10}{e}} \\cap {\\frac{20}{e}, \\frac{27}{e}, \\frac{2}{e}, -\\frac{19}{e}, \\frac{11}{e}, -\\frac{12}{e}, -\\frac{5}{e}, -\\frac{2}{e}, -\\frac{25}{e}, \\frac{8}{e}, -\\frac{10}{e}, \\frac{12}{e}}$.\n", - "Output Answer": [ - "${-\\frac{25}{e}, -\\frac{12}{e}, \\frac{2}{e}, \\frac{8}{e}, \\frac{11}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((11/math.e), (17/math.e), (23/math.e), (13/math.e), (8/math.e), (24/math.e), -(8/math.e), -(18/math.e), -(25/math.e), (2/math.e), -(12/math.e), (10/math.e),))\nsnd = set(((20/math.e), (27/math.e), (2/math.e), -(19/math.e), (11/math.e), -(12/math.e), -(5/math.e), -(2/math.e), -(25/math.e), (8/math.e), -(10/math.e), (12/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${8, 8.947, 4, 5, -8.223, -3, \\frac{6}{e}} \\cup {2, -8.223, \\frac{6}{e}, -2, -7, 8, 8.947}$.\n", - "Output Answer": [ - "${-8.223, -7, -3, -2, 2, \\frac{6}{e}, 4, 5, 8, 8.947}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 8.947, 4, 5, -8.223, -3, (6/math.e),))\nsnd = set((2, -8.223, (6/math.e), -2, -7, 8, 8.947,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -6, -1, -3, 2, -8}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "values = 5, -6, -1, -3, 2, -8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-8, \\frac{9}{\\sqrt{2}}, 3, 0, 8}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, (9/(math.sqrt(2))), 3, 0, 8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\frac{20}{\\pi }, 6}$.\n", - "Output Answer": [ - "$\\frac{20}{\\pi }-5$" - ], - "Output Program": [ - "import math\n\nvalues = 5, (20/math.pi), 6\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{15}{2}, 10, \\frac{27}{2}}$.\n", - "Output Answer": [ - "$\\frac{810}{83}$" - ], - "Output Program": [ - "import statistics\nvalues = (15/2), 10, (27/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3, 0, \\frac{2}{3}, -7, -8} \\cup {-7, 3, 9, -4, 2}$.\n", - "Output Answer": [ - "${-8, -7, -4, 0, \\frac{2}{3}, 2, 3, 9}$" - ], - "Output Program": [ - "fst = set((3, 0, (2/3), -7, -8,))\nsnd = set((-7, 3, 9, -4, 2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2, 2, 5, -8, 6, 3, 4, 8, 9} \\cap {6, 5, -3, 2, -4, -9, -6, 7}$.\n", - "Output Answer": [ - "${2, 5, 6}$" - ], - "Output Program": [ - "fst = set((-2, 2, 5, -8, 6, 3, 4, 8, 9,))\nsnd = set((6, 5, -3, 2, -4, -9, -6, 7,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{19}{2}, \\frac{5}{2}, \\frac{11}{2}}$.\n", - "Output Answer": [ - "$\\frac{3135}{718}$" - ], - "Output Program": [ - "import statistics\nvalues = (19/2), (5/2), (11/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 9., -8, -4, -\\frac{31}{4}} \\setminus {-\\frac{31}{4}, 8, 3.6, -8}$.\n", - "Output Answer": [ - "${-9, -4, 9.}$" - ], - "Output Program": [ - "fst = set((-9, 9., -8, -4, -(31/4),))\nsnd = set((-(31/4), 8, 3.6, -8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 5, -10, 1, 9, -10, -9, 9, -9, 8, -9, 9, -8, -8, 5, 8, -10, -10, 8, 1, 1, 1, -9}$.\n", - "Output Answer": [ - "$\\{-10,1,-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 5, -10, 1, 9, -10, -9, 9, -9, 8, -9, 9, -8, -8, 5, 8, -10, -10, 8, 1, 1, 1, -9\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-343, 4096, -1000, -5, 1, -1}$.\n", - "Output Answer": [ - "$4\\ 5^{2/3} \\sqrt{14}$" - ], - "Output Program": [ - "import math\n\nvalues = -343, 4096, -1000, -5, 1, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${343, -7, 512}$.\n", - "Output Answer": [ - "$56 \\sqrt[3]{-7}$" - ], - "Output Program": [ - "import math\n\nvalues = 343, -7, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${10, -2, 0, 9, -\\frac{21}{\\sqrt{5}}, -\\frac{16}{e}, -7 \\sqrt{2}, -e, 7, 3 \\sqrt{5}, -3 \\sqrt{2}, -8, -\\frac{24}{e}, 5}$.", - "Output Answer": [ - "$\\frac{1}{2} (-2-e)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 10, -2, 0, 9, -(21/(math.sqrt(5))), -(16/math.e), -7*math.sqrt(2), -math.e, 7, 3*math.sqrt(5), -3*math.sqrt(2), -8, -(24/math.e), 5\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\log (2), -5, \\frac{4}{\\sqrt{3}}, \\frac{5}{2}, 6, -\\sqrt{3}, 9} \\setminus {3, -\\frac{5}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, 6, \\frac{5}{2}, -\\frac{10}{7}, -2 \\log (2)}$.\n", - "Output Answer": [ - "${-5, -\\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.log(2), -5, (4/(math.sqrt(3))), (5/2), 6, -math.sqrt(3), 9,))\nsnd = set((3, -(5/(math.sqrt(3))), (4/(math.sqrt(3))), 6, (5/2), -(10/7), -2*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -9, 11, -2}$.\n", - "Output Answer": [ - "$\\frac{971}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -9, 11, -2\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, -10, 5, -9, 9, -10, 9, 8, 8, 6, 5, 8, 5, 5, 9, 9, 9, 9, 5, 9, 5, 6, 8, 6, -10, 5, -6}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, -10, 5, -9, 9, -10, 9, 8, 8, 6, 5, 8, 5, 5, 9, 9, 9, 9, 5, 9, 5, 6, 8, 6, -10, 5, -6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, 9, 5, 3, 3, 5, 9, 2, 1, 2, 5, 2, 2, 1, -4, -2, 1, -4, -4, -2, 5, 2, -4, -4, -4}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, 9, 5, 3, 3, 5, 9, 2, 1, 2, 5, 2, 2, 1, -4, -2, 1, -4, -4, -2, 5, 2, -4, -4, -4\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-9, -8, -5, 8, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{215}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -8, -5, 8, 14\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x-1.7$ where $x \\sim $ \\text{BetaDistribution}[0.8,0.9]\n", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 0.9)\nprint(E(4.*x-1.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-3.76, \\frac{10}{\\sqrt{3}}, \\frac{8}{e}, 0, -4, \\frac{36}{7}, \\frac{14}{\\sqrt{3}}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4, -3.76, 0, \\frac{8}{e}, \\frac{36}{7}, 3 \\sqrt{3}, \\frac{10}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3.76, (10/(math.sqrt(3))), (8/math.e), 0, -4, (36/7), (14/(math.sqrt(3))), 3*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, 2, 2, -3, 10, 2, 10, -2, -3, 5, 2, -2, 5, -1, 2, 2, -3, 2, 5, 2, 2, 10, -3}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, 2, 2, -3, 10, 2, 10, -2, -3, 5, 2, -2, 5, -1, 2, 2, -3, 2, 5, 2, 2, 10, -3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, 13, 2, -4, -2}$.\n", - "Output Answer": [ - "$\\frac{321}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 13, 2, -4, -2\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -10, -8, -7, 0}$.\n", - "Output Answer": [ - "$\\frac{274}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -10, -8, -7, 0\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{15}{2}, 1.547}$.\n", - "Output Answer": [ - "${-\\frac{15}{2}, 1.547}$" - ], - "Output Program": [ - "values = -(15/2), 1.547\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -1, \\frac{11}{5}, -9} \\setminus {\\frac{11}{5}, -9, -2, 0}$.\n", - "Output Answer": [ - "${-1}$" - ], - "Output Program": [ - "fst = set((-2, -1, (11/5), -9,))\nsnd = set(((11/5), -9, -2, 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, \\frac{25}{2}, 7}$.\n", - "Output Answer": [ - "$\\frac{8400}{799}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, (25/2), 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-0.202, -7, 5, -3} \\cup {2, 6, -0.202, 5}$.\n", - "Output Answer": [ - "${-7, -3, -0.202, 2, 5, 6}$" - ], - "Output Program": [ - "fst = set((-0.202, -7, 5, -3,))\nsnd = set((2, 6, -0.202, 5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.148,0.151,0.295,0.16,0.088\\}$ and $\\{0.068,0.093,0.179,0.106,0.354\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.148, 0.151, 0.295, 0.16, 0.088\ndistribution2 = 0.068, 0.093, 0.179, 0.106, 0.354\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-4 e, -9, 9, 4, -2 \\sqrt{5}, -2 e, 0, 7, -8, -5, -1, 8}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.e, -9, 9, 4, -2*math.sqrt(5), -2*math.e, 0, 7, -8, -5, -1, 8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-14 \\log (2), -10, \\frac{6}{\\sqrt{\\pi }}, -4, 8 \\log (2), 1, -3 e, 4, 5, -\\frac{54}{7}}$.\n", - "Output Answer": [ - "$10+8 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -14*math.log(2), -10, (6/(math.sqrt(math.pi))), -4, 8*math.log(2), 1, -3*math.e, 4, 5, -(54/7)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-3 \\sqrt{2}, 1, 0, 8}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, 0, 1, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(2), 1, 0, 8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${1, -5, \\frac{13}{\\sqrt{3}}, -8} \\setminus {-2, 2 \\sqrt{2}, -8, 1}$.\n", - "Output Answer": [ - "${-5, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -5, (13/(math.sqrt(3))), -8,))\nsnd = set((-2, 2*math.sqrt(2), -8, 1,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -8, \\frac{16}{\\sqrt{\\pi }}, -\\frac{28}{\\pi }, -10 \\log (2), -8, \\frac{9}{2}}$.\n", - "Output Answer": [ - "$\\frac{28}{\\pi }+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -8, (16/(math.sqrt(math.pi))), -(28/math.pi), -10*math.log(2), -8, (9/2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{39}{5}, -\\frac{16}{\\sqrt{\\pi }}, 3, -4.957, 2 \\sqrt{2}} \\setminus {3.014, \\frac{5}{7}, 3, \\frac{39}{5}, -2 \\sqrt{2}, 9}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -4.957, 2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((39/5), -(16/(math.sqrt(math.pi))), 3, -4.957, 2*math.sqrt(2),))\nsnd = set((3.014, (5/7), 3, (39/5), -2*math.sqrt(2), 9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{\\sqrt{5}}, -7, 3, -3 e, \\frac{5}{3}, -\\frac{5}{7}, \\frac{7}{\\sqrt{2}}, 3, \\frac{11}{\\pi }, -6 \\sqrt{2}, -5, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\frac{7}{\\sqrt{2}}+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (11/(math.sqrt(5))), -7, 3, -3*math.e, (5/3), -(5/7), (7/(math.sqrt(2))), 3, (11/math.pi), -6*math.sqrt(2), -5, -(15/2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, -2, -27}$.\n", - "Output Answer": [ - "$27 \\sqrt[3]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, -2, -27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${1, 4, -9, 5 \\sqrt{2}, 6, 4, -\\sqrt{2}, 7, -6, 9, 4, \\frac{29}{5}, -11 \\log (2), \\frac{42}{5}}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 4, -9, 5*math.sqrt(2), 6, 4, -math.sqrt(2), 7, -6, 9, 4, (29/5), -11*math.log(2), (42/5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 4 \\sqrt{3}, 7, e}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4 \\sqrt{3}+e\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 4*math.sqrt(3), 7, math.e\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, -7, \\frac{11}{\\sqrt{\\pi }}, -\\sqrt{2}, 9, 6, 8, 9 \\log (2), -9, 4}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -7, (11/(math.sqrt(math.pi))), -math.sqrt(2), 9, 6, 8, 9*math.log(2), -9, 4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{13}{\\sqrt{2}}, 1, 7.51, \\frac{33}{4}, -4, \\frac{18}{e}} \\cup {-\\frac{37}{4}, \\frac{18}{e}, -6.94, -4, 4, -7, 7, \\frac{13}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{37}{4}, -7, -6.94, -4, 1, 4, \\frac{18}{e}, 7, 7.51, \\frac{33}{4}, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/(math.sqrt(2))), 1, 7.51, (33/4), -4, (18/math.e),))\nsnd = set((-(37/4), (18/math.e), -6.94, -4, 4, -7, 7, (13/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.052,0.176,0.078,0.154,0.072,0.035,0.106,0.127\\}$ and $\\{0.053,0.252,0.152,0.094,0.017,0.118,0.052,0.131\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.052, 0.176, 0.078, 0.154, 0.072, 0.035, 0.106, 0.127\ndistribution2 = 0.053, 0.252, 0.152, 0.094, 0.017, 0.118, 0.052, 0.131\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -4, \\frac{3}{2}, -4, \\frac{3}{2}, -\\frac{5}{4}, \\frac{3}{4}, \\frac{3}{2}, \\frac{3}{4}, -\\frac{5}{4}, -\\frac{13}{4}, \\frac{3}{4}, -4, \\frac{3}{2}, -\\frac{39}{4}, -\\frac{13}{4}, -4, -\\frac{13}{4}, -\\frac{39}{4}, -\\frac{5}{4}, -\\frac{13}{4}, \\frac{3}{4}, -\\frac{5}{4}, -4, 0, \\frac{3}{2}, -\\frac{13}{4}, -\\frac{39}{4}, \\frac{3}{4}, -\\frac{39}{4}}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -4, (3/2), -4, (3/2), -(5/4), (3/4), (3/2), (3/4), -(5/4), -(13/4), (3/4), -4, (3/2), -(39/4), -(13/4), -4, -(13/4), -(39/4), -(5/4), -(13/4), (3/4), -(5/4), -4, 0, (3/2), -(13/4), -(39/4), (3/4), -(39/4)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 36, -3}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{-1} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 36, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${5, -4.75, 0, 1, -9, 8} \\setminus {-7, -4.75, 0, 5}$.\n", - "Output Answer": [ - "${-9, 1, 8}$" - ], - "Output Program": [ - "fst = set((5, -4.75, 0, 1, -9, 8,))\nsnd = set((-7, -4.75, 0, 5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{55}{7}, 4, -\\frac{23}{5}}$.", - "Output Answer": [ - "$-\\frac{23}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -(55/7), 4, -(23/5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\pi, -5, \\frac{17}{2}, -\\frac{12}{e}, 3, 5, \\frac{20}{\\pi }, 8, -3 \\sqrt{5}, 4, \\frac{14}{\\sqrt{3}}, -5 \\sqrt{3}, 7}$.\n", - "Output Answer": [ - "$\\frac{17}{2}+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.pi, -5, (17/2), -(12/math.e), 3, 5, (20/math.pi), 8, -3*math.sqrt(5), 4, (14/(math.sqrt(3))), -5*math.sqrt(3), 7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{13}{\\sqrt{\\pi }}, -7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-7-\\frac{13}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(13/(math.sqrt(math.pi))), -7\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, 3, -8, -11, -8}$.\n", - "Output Answer": [ - "$\\frac{287}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, 3, -8, -11, -8\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3, 729, 1, 81, -16807, 1000000}$.\n", - "Output Answer": [ - "$30\\ 21^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 729, 1, 81, -16807, 1000000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, 5, 5, -1, 2, 2, -10, -1, -10, -1, 5, -1, 2, -1, 5, -1, 5, 2, -10, -10, 5, -10, -10, -10, 5}$.\n", - "Output Answer": [ - "$\\{-1,5,-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, 5, 5, -1, 2, 2, -10, -1, -10, -1, 5, -1, 2, -1, 5, -1, 5, 2, -10, -10, 5, -10, -10, -10, 5\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4, 0, 3, \\frac{17}{e}, \\frac{15}{4}, 8, -\\sqrt{2}} \\setminus {0, 3, -\\frac{26}{5}, 8, 3 \\sqrt{2}, -4, -\\frac{8}{e}}$.\n", - "Output Answer": [ - "${-\\sqrt{2}, \\frac{15}{4}, \\frac{17}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 0, 3, (17/math.e), (15/4), 8, -math.sqrt(2),))\nsnd = set((0, 3, -(26/5), 8, 3*math.sqrt(2), -4, -(8/math.e),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-8, \\frac{8}{\\pi }, 2, -\\frac{10}{3}}$.\n", - "Output Answer": [ - "${-8, -\\frac{10}{3}, 2, \\frac{8}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, (8/math.pi), 2, -(10/3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, 6, 8, 2, 2, -1, -9, -9, 2, 8, -9, -9, 2, 2, 8, 6, 6, 6, -2, 6, -9, -2, -9, 2, 2, 6, 2, -9, 6, -9}$.\n", - "Output Answer": [ - "$\\{2,-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, 6, 8, 2, 2, -1, -9, -9, 2, 8, -9, -9, 2, 2, 8, 6, 6, 6, -2, 6, -9, -2, -9, 2, 2, 6, 2, -9, 6, -9\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{11}{3}, 4 \\sqrt{3}, -7, -9, -\\frac{13}{\\sqrt{5}}, 0, \\frac{35}{4}, 2}$.\n", - "Output Answer": [ - "${-9, -7, -\\frac{13}{\\sqrt{5}}, 0, 2, \\frac{11}{3}, 4 \\sqrt{3}, \\frac{35}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = (11/3), 4*math.sqrt(3), -7, -9, -(13/(math.sqrt(5))), 0, (35/4), 2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -1, 2, -8, 5, 7, -1}$.\n", - "Output Answer": [ - "$-\\frac{6}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -1, 2, -8, 5, 7, -1\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x^2-3.7 x-4.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$-5.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(1.4*x**2-3.7*x-4.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${27, -7, 7}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{-1} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 27, -7, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, 13, -11, -12, 0, -15}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{141}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 13, -11, -12, 0, -15\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\frac{11}{2}, 6, -4, 3} \\setminus {3, 6, 7.28, -4, \\frac{2}{\\sqrt{3}}, \\frac{5}{2}, 0, -5.3}$.\n", - "Output Answer": [ - "${\\frac{11}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (11/2), 6, -4, 3,))\nsnd = set((3, 6, 7.28, -4, (2/(math.sqrt(3))), (5/2), 0, -5.3,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{3}, -\\frac{55}{7}, -4, e, 6, -9, 8, -\\sqrt{5}} \\setminus {1, -\\sqrt{5}, 2 \\sqrt{3}, 6, 3 e, -9, 0}$.\n", - "Output Answer": [ - "${-\\frac{55}{7}, -4, e, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(3), -(55/7), -4, math.e, 6, -9, 8, -math.sqrt(5),))\nsnd = set((1, -math.sqrt(5), 2*math.sqrt(3), 6, 3*math.e, -9, 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x-0.2$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$2.93$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(4.7*x-0.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{15}{\\sqrt{\\pi }}, 9, \\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${\\frac{4}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = (15/(math.sqrt(math.pi))), 9, (4/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -2 \\pi, \\frac{18}{\\sqrt{5}}, 5, \\frac{1}{\\sqrt{5}}, -7 \\sqrt{2}, \\frac{26}{3}, -1, 0, -\\frac{33}{4}, -8, 6, -6, -\\frac{11}{e}, -\\frac{59}{7}}$.\n", - "Output Answer": [ - "$\\frac{26}{3}+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -2*math.pi, (18/(math.sqrt(5))), 5, (1/(math.sqrt(5))), -7*math.sqrt(2), (26/3), -1, 0, -(33/4), -8, 6, -6, -(11/math.e), -(59/7)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-9, \\sqrt{3}, -7, 7, -9}$.", - "Output Answer": [ - "$-7$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, math.sqrt(3), -7, 7, -9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9, -8, -e, -14 \\log (2), -9.96, -3 \\sqrt{3}, 8} \\setminus {-9.96, -3 \\sqrt{3}, -\\frac{20}{3}, -14 \\log (2)}$.\n", - "Output Answer": [ - "${-8, -e, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -8, -math.e, -14*math.log(2), -9.96, -3*math.sqrt(3), 8,))\nsnd = set((-9.96, -3*math.sqrt(3), -(20/3), -14*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 7, e, -9, -\\frac{61}{7}} \\cup {-4, 7, -3, 8}$.\n", - "Output Answer": [ - "${-9, -\\frac{61}{7}, -4, -3, e, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 7, math.e, -9, -(61/7),))\nsnd = set((-4, 7, -3, 8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.127,0.112,0.167,0.075,0.106,0.097,0.063,0.062,0.127\\}$ and $\\{0.116,0.058,0.111,0.062,0.13,0.042,0.031,0.108,0.16\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.127, 0.112, 0.167, 0.075, 0.106, 0.097, 0.063, 0.062, 0.127\ndistribution2 = 0.116, 0.058, 0.111, 0.062, 0.13, 0.042, 0.031, 0.108, 0.16\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.19,0.386,0.113,0.088\\}$ and $\\{0.138,0.243,0.152,0.193\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.19, 0.386, 0.113, 0.088\ndistribution2 = 0.138, 0.243, 0.152, 0.193\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{36}{7}, \\frac{36}{7}, -\\frac{43}{7}, \\frac{37}{7}, -\\frac{43}{7}, -\\frac{43}{7}, -\\frac{43}{7}, \\frac{37}{7}, \\frac{36}{7}, \\frac{37}{7}, 0, \\frac{36}{7}, -\\frac{9}{7}, -\\frac{9}{7}, \\frac{37}{7}, -\\frac{9}{7}, 0, \\frac{37}{7}, -\\frac{43}{7}, \\frac{36}{7}, \\frac{36}{7}, -\\frac{9}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{36}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (36/7), (36/7), -(43/7), (37/7), -(43/7), -(43/7), -(43/7), (37/7), (36/7), (37/7), 0, (36/7), -(9/7), -(9/7), (37/7), -(9/7), 0, (37/7), -(43/7), (36/7), (36/7), -(9/7)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -10, 4096, -64}$.\n", - "Output Answer": [ - "$16\\ 2^{3/4} \\sqrt[4]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -10, 4096, -64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.301,0.185,0.083,0.097,0.195\\}$ and $\\{0.147,0.073,0.263,0.03,0.206,0.044\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.301, 0.185, 0.083, 0.097, 0.195\ndistribution2 = 0.147, 0.073, 0.263, 0.03, 0.206, 0.044\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -6, -10, -15}$.\n", - "Output Answer": [ - "$\\frac{62}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -6, -10, -15\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 10, 19, 2}$.\n", - "Output Answer": [ - "$\\frac{6840}{1211}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 10, 19, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^3-3.9 x^2+0.1 x-1.9$ where $x \\sim $ \\text{ExponentialDistribution}[0.3]\n", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.3)\nprint(E(0.4*x**3-3.9*x**2+0.1*x-1.9))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 2 \\log (2), -\\frac{18}{e}, -\\frac{15}{7}}$.\n", - "Output Answer": [ - "$8+\\frac{18}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 2*math.log(2), -(18/math.e), -(15/7)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.5 x^2+1. x+0.7$ where $x \\sim $ \\text{PoissonDistribution}[1.6]\n", - "Output Answer": [ - "$-16.42$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.6)\nprint(E(-4.5*x**2+1.*x+0.7))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${4, -6, 7, 1, -2, -5, 2, 3, -1, 0, -9, -7, 9} \\cap {-8, 8, 3, 6, -4, 5, 7, 1, 10, -2, 2}$.\n", - "Output Answer": [ - "${-2, 1, 2, 3, 7}$" - ], - "Output Program": [ - "fst = set((4, -6, 7, 1, -2, -5, 2, 3, -1, 0, -9, -7, 9,))\nsnd = set((-8, 8, 3, 6, -4, 5, 7, 1, 10, -2, 2,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 0, 7, 9, 5, -8, 2}$.\n", - "Output Answer": [ - "$\\frac{22}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 0, 7, 9, 5, -8, 2\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, \\frac{15}{2}, \\frac{37}{2}, 15}$.\n", - "Output Answer": [ - "$\\frac{1480}{279}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, (15/2), (37/2), 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -6, -8, -3, -5, -6, -3, 4, 4, 4, -6, 6, -6, -3, -8, -3, -8, -8, -3, -8, 8, -5, -3, 8, -6, -8, -3, -5}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -6, -8, -3, -5, -6, -3, 4, 4, 4, -6, 6, -6, -3, -8, -3, -8, -8, -3, -8, 8, -5, -3, 8, -6, -8, -3, -5\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${5, -8.1} \\setminus {-6.77, -3 \\sqrt{3}, -6, 0, 3}$.\n", - "Output Answer": [ - "${-8.1, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -8.1,))\nsnd = set((-6.77, -3*math.sqrt(3), -6, 0, 3,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 4, -12 \\log (2), \\frac{11}{2}, 3 \\sqrt{5}, 0, -\\frac{25}{4}}$.\n", - "Output Answer": [ - "$3 \\sqrt{5}+12 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 4, -12*math.log(2), (11/2), 3*math.sqrt(5), 0, -(25/4)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{23}{5}, \\frac{46}{5}, \\frac{14}{5}, -\\frac{26}{5}, \\frac{32}{5}, -3}$.\n", - "Output Answer": [ - "$\\frac{14}{15}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(23/5), (46/5), (14/5), -(26/5), (32/5), -3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{2}, \\frac{7}{2}, 17, 7}$.\n", - "Output Answer": [ - "$\\frac{2737}{393}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/2), (7/2), 17, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, 0, 1, 10}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{259}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 0, 1, 10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{3}, -\\frac{4}{3}, -2, -8, -\\frac{16}{3}, \\frac{11}{3}, -2, -\\frac{4}{3}, -\\frac{4}{3}, -2, -\\frac{19}{3}, -\\frac{19}{3}, -\\frac{26}{3}, -8, -\\frac{16}{3}, -\\frac{4}{3}, -\\frac{16}{3}, -\\frac{26}{3}, -\\frac{4}{3}, -\\frac{4}{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{4}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (11/3), -(4/3), -2, -8, -(16/3), (11/3), -2, -(4/3), -(4/3), -2, -(19/3), -(19/3), -(26/3), -8, -(16/3), -(4/3), -(16/3), -(26/3), -(4/3), -(4/3)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x^2+3.1 x+4.5$ where $x \\sim $ \\text{BetaDistribution}[0.1,1.1]\n", - "Output Answer": [ - "$4.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.1, 1.1)\nprint(E(0.9*x**2+3.1*x+4.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-11 \\log (2), 9., -3, 5, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-11 \\log (2), -3, 5, 5 \\sqrt{3}, 9.}$" - ], - "Output Program": [ - "import math\n\nvalues = -11*math.log(2), 9., -3, 5, 5*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${1, -\\sqrt{2}, -\\frac{5}{\\sqrt{3}}}$.", - "Output Answer": [ - "$-\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, -math.sqrt(2), -(5/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.036,0.417,0.164\\}$ and $\\{0.083,0.276,0.273\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.036, 0.417, 0.164\ndistribution2 = 0.083, 0.276, 0.273\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{3}, 4, -2 \\sqrt{5}, -5, -2, 0, 14 \\log (2), -\\frac{21}{4}, \\frac{7}{\\sqrt{\\pi }}, 8, -\\frac{12}{\\sqrt{5}}, 5, 4 \\log (2), -14 \\log (2)}$.", - "Output Answer": [ - "$2 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(3), 4, -2*math.sqrt(5), -5, -2, 0, 14*math.log(2), -(21/4), (7/(math.sqrt(math.pi))), 8, -(12/(math.sqrt(5))), 5, 4*math.log(2), -14*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -8, 2 \\sqrt{5}, \\frac{17}{e}}$.\n", - "Output Answer": [ - "$8+\\frac{17}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -8, 2*math.sqrt(5), (17/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, -100000, 8, 10000, 32}$.\n", - "Output Answer": [ - "$200 \\sqrt[5]{-1} 2^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -100000, 8, 10000, 32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{16}{\\sqrt{3}}, 4 \\sqrt{3}, 4, 3, -5, 4 \\log (2), \\frac{29}{7}}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(16/(math.sqrt(3))), 4*math.sqrt(3), 4, 3, -5, 4*math.log(2), (29/7)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, -15, -9, -7}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{179}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -15, -9, -7\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.137,0.145,0.153,0.105,0.141,0.109,0.109\\}$ and $\\{0.092,0.185,0.11,0.043,0.094,0.057,0.303\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.137, 0.145, 0.153, 0.105, 0.141, 0.109, 0.109\ndistribution2 = 0.092, 0.185, 0.11, 0.043, 0.094, 0.057, 0.303\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\sqrt{3}, -\\frac{16}{\\sqrt{3}}, -2 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, \\frac{7}{\\sqrt{3}}, -\\frac{14}{\\sqrt{3}}, -2 \\sqrt{3}, -\\frac{7}{\\sqrt{3}}, 2 \\sqrt{3}, -2 \\sqrt{3}, 2 \\sqrt{3}, -2 \\sqrt{3}, -\\frac{2}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{14}{\\sqrt{3}}, -\\frac{14}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -2 \\sqrt{3}, \\frac{7}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.sqrt(3), -(16/(math.sqrt(3))), -2*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), (7/(math.sqrt(3))), -(14/(math.sqrt(3))), -2*math.sqrt(3), -(7/(math.sqrt(3))), 2*math.sqrt(3), -2*math.sqrt(3), 2*math.sqrt(3), -2*math.sqrt(3), -(2/(math.sqrt(3))), -(7/(math.sqrt(3))), -(16/(math.sqrt(3))), -(2/(math.sqrt(3))), 2*math.sqrt(3), -(14/(math.sqrt(3))), -(14/(math.sqrt(3))), -(16/(math.sqrt(3))), -(16/(math.sqrt(3))), -(2/(math.sqrt(3))), -2*math.sqrt(3), (7/(math.sqrt(3))), -(2/(math.sqrt(3))), -(2/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.184,0.016,0.017,0.045,0.019,0.114\\}$ and $\\{0.091,0.117,0.027,0.288,0.37,0.002\\}$.", - "Output Answer": [ - "$1.86$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.184, 0.016, 0.017, 0.045, 0.019, 0.114\ndistribution2 = 0.091, 0.117, 0.027, 0.288, 0.37, 0.002\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${6.545, 0, -0.18, 4, -3 \\sqrt{3}} \\cup {-\\frac{3}{\\pi }, 0.34, 4, -3 \\sqrt{3}, 0}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -\\frac{3}{\\pi }, -0.18, 0, 0.34, 4, 6.545}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.545, 0, -0.18, 4, -3*math.sqrt(3),))\nsnd = set((-(3/math.pi), 0.34, 4, -3*math.sqrt(3), 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 2 e, 5, -1, -2, -\\frac{11}{2}, -9, \\sqrt{3}, 7, -7, 3 \\sqrt{3}, -4, 3 \\sqrt{5}, -7, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 2*math.e, 5, -1, -2, -(11/2), -9, math.sqrt(3), 7, -7, 3*math.sqrt(3), -4, 3*math.sqrt(5), -7, 2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\pi, -2 \\pi, 3 \\pi, \\pi, \\pi, 3 \\pi, \\pi, 3 \\pi, -2 \\pi, 3 \\pi, 2 \\pi, -2 \\pi, \\pi, \\pi, -3 \\pi, 2 \\pi, \\pi, -3 \\pi, -3 \\pi, -3 \\pi, 3 \\pi, -2 \\pi, \\pi, \\pi, -2 \\pi, -2 \\pi, 2 \\pi, 3 \\pi, -3 \\pi}$.\n", - "Output Answer": [ - "$\\{\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.pi, -2*math.pi, 3*math.pi, math.pi, math.pi, 3*math.pi, math.pi, 3*math.pi, -2*math.pi, 3*math.pi, 2*math.pi, -2*math.pi, math.pi, math.pi, -3*math.pi, 2*math.pi, math.pi, -3*math.pi, -3*math.pi, -3*math.pi, 3*math.pi, -2*math.pi, math.pi, math.pi, -2*math.pi, -2*math.pi, 2*math.pi, 3*math.pi, -3*math.pi\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5 \\sqrt{2}, -3, 2, -9 \\log (2), 3 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, -3, -3, -6, 6, \\frac{3}{\\sqrt{2}}, 8, 9, 5, 6}$.\n", - "Output Answer": [ - "$9+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(2), -3, 2, -9*math.log(2), 3*math.sqrt(2), (7/(math.sqrt(2))), -3, -3, -6, 6, (3/(math.sqrt(2))), 8, 9, 5, 6\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, -6, 2, \\sqrt{3}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -6, 0, \\sqrt{3}, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -6, 2, math.sqrt(3), -3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{5}, \\frac{21}{\\sqrt{5}}, 4 \\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, \\frac{3}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\sqrt{5}, \\frac{21}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\sqrt{5}, \\frac{3}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, 4 \\sqrt{5}, \\frac{3}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, -\\sqrt{5}, 4 \\sqrt{5}, \\frac{1}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, \\frac{3}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{3}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(5), (21/(math.sqrt(5))), 4*math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), (3/(math.sqrt(5))), (21/(math.sqrt(5))), (1/(math.sqrt(5))), (3/(math.sqrt(5))), -math.sqrt(5), (21/(math.sqrt(5))), (3/(math.sqrt(5))), -math.sqrt(5), (3/(math.sqrt(5))), (21/(math.sqrt(5))), 4*math.sqrt(5), (3/(math.sqrt(5))), (3/(math.sqrt(5))), -math.sqrt(5), 4*math.sqrt(5), (1/(math.sqrt(5))), (1/(math.sqrt(5))), (21/(math.sqrt(5))), (1/(math.sqrt(5))), (3/(math.sqrt(5))), (21/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.147,0.119,0.104,0.085,0.097,0.155,0.043,0.069,0.068,0.092\\}$ and $\\{0.197,0.108,0.195,0.042,0.078,0.038,0.058,0.127,0.006,0.069\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.147, 0.119, 0.104, 0.085, 0.097, 0.155, 0.043, 0.069, 0.068, 0.092\ndistribution2 = 0.197, 0.108, 0.195, 0.042, 0.078, 0.038, 0.058, 0.127, 0.006, 0.069\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x-0.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$1.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(3.3*x-0.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, \\frac{5}{2}, 9}$.\n", - "Output Answer": [ - "$\\frac{270}{61}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, (5/2), 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{35}{4}, 0, 2, -3.35}$.\n", - "Output Answer": [ - "${-3.35, 0, 2, \\frac{35}{4}}$" - ], - "Output Program": [ - "values = (35/4), 0, 2, -3.35\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${0, -\\frac{2}{\\pi }, 3, -5, \\frac{11}{2}, -8, -8, -3 \\sqrt{3}, -\\frac{8}{e}, -\\frac{19}{4}, -2, -\\frac{10}{\\sqrt{3}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{19}{4}-\\frac{8}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -(2/math.pi), 3, -5, (11/2), -8, -8, -3*math.sqrt(3), -(8/math.e), -(19/4), -2, -(10/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -2, 0, 5, -10, 5, 5, -9, 5, 0, 0, -2, 5, 3, -9, -10, -2, -9, 3, 5, 3, -2, -10, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -2, 0, 5, -10, 5, 5, -9, 5, 0, 0, -2, 5, 3, -9, -10, -2, -9, 3, 5, 3, -2, -10, 5\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{10}{\\sqrt{3}}, -\\frac{11}{\\sqrt{3}}, 3 \\sqrt{3}, \\frac{10}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, 3 \\sqrt{3}, \\frac{10}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{11}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{11}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{11}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{11}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{11}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{1}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (10/(math.sqrt(3))), -(11/(math.sqrt(3))), 3*math.sqrt(3), (10/(math.sqrt(3))), -(1/(math.sqrt(3))), -(1/(math.sqrt(3))), 3*math.sqrt(3), (10/(math.sqrt(3))), (10/(math.sqrt(3))), -(1/(math.sqrt(3))), -(11/(math.sqrt(3))), -(4/(math.sqrt(3))), (10/(math.sqrt(3))), -(1/(math.sqrt(3))), -(1/(math.sqrt(3))), -(11/(math.sqrt(3))), -(4/(math.sqrt(3))), -(1/(math.sqrt(3))), -(4/(math.sqrt(3))), -(4/(math.sqrt(3))), -(1/(math.sqrt(3))), -(11/(math.sqrt(3))), (10/(math.sqrt(3))), -(4/(math.sqrt(3))), -(4/(math.sqrt(3))), -(1/(math.sqrt(3))), -(11/(math.sqrt(3))), -(4/(math.sqrt(3))), -(11/(math.sqrt(3))), -(1/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -3, -4, -2, -7}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -3, -4, -2, -7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.5 x+2.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$2.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(0.5*x+2.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.186,0.059,0.058,0.033,0.02,0.016,0.151,0.038,0.095\\}$ and $\\{0.128,0.002,0.155,0.054,0.223,0.097,0.067,0.098,0.056\\}$.", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.186, 0.059, 0.058, 0.033, 0.02, 0.016, 0.151, 0.038, 0.095\ndistribution2 = 0.128, 0.002, 0.155, 0.054, 0.223, 0.097, 0.067, 0.098, 0.056\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${2, -\\pi, -\\frac{9}{5}, -9, -3, \\frac{13}{e}, 8, 3 \\sqrt{2}, -9, 0, 3 \\sqrt{5}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -math.pi, -(9/5), -9, -3, (13/math.e), 8, 3*math.sqrt(2), -9, 0, 3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x-1.1$ where $x \\sim $ \\text{NormalDistribution}[-0.5,0.9]\n", - "Output Answer": [ - "$-1.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.5, 0.9)\nprint(E(0.6*x-1.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -3, 6, -3, 6, 4, 6, 6, 6, -3, 6, 6, 6, 4, 6, 6, 2, 2, -3, -3, 2}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -3, 6, -3, 6, 4, 6, 6, 6, -3, 6, 6, 6, 4, 6, 6, 2, 2, -3, -3, 2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.026,0.005,0.576\\}$ and $\\{0.261,0.082,0.355\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.026, 0.005, 0.576\ndistribution2 = 0.261, 0.082, 0.355\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{21}{e}, -3 \\sqrt{3}, -4}$.\n", - "Output Answer": [ - "${-\\frac{21}{e}, -3 \\sqrt{3}, -4}$" - ], - "Output Program": [ - "import math\n\nvalues = -(21/math.e), -3*math.sqrt(3), -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -7, -4, -9}$.\n", - "Output Answer": [ - "$\\sqrt{23}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -7, -4, -9\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{4}{7}, \\frac{15}{7}}$.\n", - "Output Answer": [ - "$\\frac{11}{14}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(4/7), (15/7)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${1, -\\frac{5}{7}, -5, -\\sqrt{3}, 4 \\sqrt{2}, 2, -\\frac{3}{4}} \\cup {1, 4 \\sqrt{2}, 4, -\\sqrt{3}, -\\frac{3}{4}, 0, -5, -\\frac{5}{7}, 2}$.\n", - "Output Answer": [ - "${-5, -\\sqrt{3}, -\\frac{3}{4}, -\\frac{5}{7}, 0, 1, 2, 4, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -(5/7), -5, -math.sqrt(3), 4*math.sqrt(2), 2, -(3/4),))\nsnd = set((1, 4*math.sqrt(2), 4, -math.sqrt(3), -(3/4), 0, -5, -(5/7), 2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${5, 5, -2 \\pi, 7, \\frac{27}{4}, 5, -8, 4 \\sqrt{5}, -8, -8, 0, 3 \\sqrt{5}}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 5, -2*math.pi, 7, (27/4), 5, -8, 4*math.sqrt(5), -8, -8, 0, 3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{13}{2}, 4 \\sqrt{5}, -\\frac{13}{\\sqrt{3}}, 1, -9, -10, 8} \\setminus {8, \\frac{20}{\\pi }, 4 \\sqrt{3}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-10, -9, -\\frac{13}{\\sqrt{3}}, -\\frac{13}{2}, 1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/2), 4*math.sqrt(5), -(13/(math.sqrt(3))), 1, -9, -10, 8,))\nsnd = set((8, (20/math.pi), 4*math.sqrt(3), 4*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, 2 \\log (2), -5, \\frac{17}{\\sqrt{\\pi }}, -\\frac{6}{\\sqrt{\\pi }}, -8, -\\frac{17}{\\sqrt{3}}, \\sqrt{5}, 5, -2}$.", - "Output Answer": [ - "$\\frac{1}{2} (2 \\log (2)-2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 2*math.log(2), -5, (17/(math.sqrt(math.pi))), -(6/(math.sqrt(math.pi))), -8, -(17/(math.sqrt(3))), math.sqrt(5), 5, -2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{17}{2}, \\frac{33}{2}, \\frac{19}{2}, \\frac{31}{2}}$.\n", - "Output Answer": [ - "$\\frac{330429}{28750}$" - ], - "Output Program": [ - "import statistics\nvalues = (17/2), (33/2), (19/2), (31/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.5 x^2+2.7 x+3.5$ where $x \\sim $ \\text{PoissonDistribution}[2.]\n", - "Output Answer": [ - "$5.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.)\nprint(E(-0.5*x**2+2.7*x+3.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 7, 7, -2, 0, 7, 5, 0, 0, 7, 0, 5, -7, 7, 0, 0, -7, -2, 7, 0, 5, -2, 5, -7, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 7, 7, -2, 0, 7, 5, 0, 0, 7, 0, 5, -7, 7, 0, 0, -7, -2, 7, 0, 5, -2, 5, -7, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{4}, \\frac{17}{2}, 4, -\\frac{5}{4}, \\frac{17}{2}, -\\frac{5}{4}, 4, -\\frac{5}{4}, -\\frac{5}{4}, \\frac{9}{4}, \\frac{17}{2}, \\frac{9}{4}, -\\frac{5}{4}, \\frac{9}{4}, \\frac{11}{4}, 4, \\frac{17}{2}, -\\frac{5}{4}, \\frac{17}{2}, \\frac{11}{4}, -\\frac{5}{4}, \\frac{11}{4}, \\frac{9}{4}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{5}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (11/4), (17/2), 4, -(5/4), (17/2), -(5/4), 4, -(5/4), -(5/4), (9/4), (17/2), (9/4), -(5/4), (9/4), (11/4), 4, (17/2), -(5/4), (17/2), (11/4), -(5/4), (11/4), (9/4)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{17}{3}, 6, \\frac{19}{3}, -\\frac{28}{3}, -8}$.\n", - "Output Answer": [ - "$-\\frac{32}{15}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(17/3), 6, (19/3), -(28/3), -8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\pi, 2 \\pi, -\\frac{13}{7}, 2.418} \\cup {2 \\pi, -\\frac{13}{7}, -\\pi, 2.418}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\pi, -\\frac{13}{7}, 2.418, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.pi, 2*math.pi, -(13/7), 2.418,))\nsnd = set((2*math.pi, -(13/7), -math.pi, 2.418,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.16,0.198,0.466,0.116\\}$ and $\\{0.388,0.071,0.44,0.004\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.16, 0.198, 0.466, 0.116\ndistribution2 = 0.388, 0.071, 0.44, 0.004\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-9, \\frac{18}{\\pi }, -11 \\log (2), -1, 2.4, 0, -\\frac{28}{3}, 3 \\sqrt{3}, \\frac{26}{3}} \\cup {2 \\pi, -1, -1.9, -\\frac{9}{\\pi }, -\\frac{28}{3}, -9, \\frac{25}{3}, 0, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -9, -11 \\log (2), -\\frac{9}{\\pi }, -1.9, -1, 0, 2.4, 3 \\sqrt{3}, \\frac{18}{\\pi }, 2 \\pi, 4 \\sqrt{3}, \\frac{25}{3}, \\frac{26}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, (18/math.pi), -11*math.log(2), -1, 2.4, 0, -(28/3), 3*math.sqrt(3), (26/3),))\nsnd = set((2*math.pi, -1, -1.9, -(9/math.pi), -(28/3), -9, (25/3), 0, 4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 9, 46656, -343, 27, 9}$.\n", - "Output Answer": [ - "$18 \\sqrt[6]{-3} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 9, 46656, -343, 27, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2, -9, \\frac{23}{e}, 8.2, 3, 1, \\frac{12}{e}} \\cup {7, -9, \\frac{11}{e}, 3, \\frac{12}{e}, 1, 8.2}$.\n", - "Output Answer": [ - "${-9, 1, 2, 3, \\frac{11}{e}, \\frac{12}{e}, 7, 8.2, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -9, (23/math.e), 8.2, 3, 1, (12/math.e),))\nsnd = set((7, -9, (11/math.e), 3, (12/math.e), 1, 8.2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{2}{e}, 9, -e, 5, 7, 3}$.\n", - "Output Answer": [ - "$9+e$" - ], - "Output Program": [ - "import math\n\nvalues = (2/math.e), 9, -math.e, 5, 7, 3\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2, -\\frac{5}{2}, 0, \\sqrt{3}} \\cup {0, -\\frac{5}{2}, -2}$.\n", - "Output Answer": [ - "${-\\frac{5}{2}, -2, 0, \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -(5/2), 0, math.sqrt(3),))\nsnd = set((0, -(5/2), -2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4, -2, -5, -10, 5, 1, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-10, -5, -4, -2, 1, 2 \\sqrt{5}, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -2, -5, -10, 5, 1, 2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 12, \\frac{8}{3}}$.\n", - "Output Answer": [ - "$\\frac{360}{61}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 12, (8/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${9, -3 \\pi, -7, -\\frac{7}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-7-\\frac{7}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -3*math.pi, -7, -(7/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.048,0.13,0.114,0.187,0.129,0.268\\}$ and $\\{0.145,0.172,0.242,0.111,0.114,0.111\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.048, 0.13, 0.114, 0.187, 0.129, 0.268\ndistribution2 = 0.145, 0.172, 0.242, 0.111, 0.114, 0.111\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{2}, 5, 3, -8, -8.976, -3 \\pi} \\cup {5, -9, -8, -3 \\pi, -5.881, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -8.976, -8, -5.881, -3 \\sqrt{2}, 3, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(2), 5, 3, -8, -8.976, -3*math.pi,))\nsnd = set((5, -9, -8, -3*math.pi, -5.881, -3*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x^2-4.5 x+3.4$ where $x \\sim $ \\text{BetaDistribution}[0.6,1.1]\n", - "Output Answer": [ - "$1.58$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.6, 1.1)\nprint(E(-1.1*x**2-4.5*x+3.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{3}, -4 \\sqrt{3}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{8}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(3), -4*math.sqrt(3), -5*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{16}{\\sqrt{3}}, 4, -\\frac{18}{\\pi }, 1, 8, -\\frac{22}{3}, -\\frac{23}{4}, 0}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (16/(math.sqrt(3))), 4, -(18/math.pi), 1, 8, -(22/3), -(23/4), 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 3 \\sqrt{5}, 1, -7, 2 \\sqrt{5}, -\\frac{25}{3}}$.\n", - "Output Answer": [ - "$\\frac{25}{3}+3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 3*math.sqrt(5), 1, -7, 2*math.sqrt(5), -(25/3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{24}{5}, -4, -1, -10, -2}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "values = -(24/5), -4, -1, -10, -2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, 3, 7, -4, -5, -5, 7, 3, 7, -2, 3, 3, -5, 7, -5, 3, -2, 7, -4, 7, 7}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, 3, 7, -4, -5, -5, 7, 3, 7, -2, 3, 3, -5, 7, -5, 3, -2, 7, -4, 7, 7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${7, 0, -8, -4, -4}$.\n", - "Output Answer": [ - "${-8, -4, -4, 0, 7}$" - ], - "Output Program": [ - "values = 7, 0, -8, -4, -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{23}{\\pi }, -\\frac{3}{2}, -\\pi, 4 \\sqrt{2}, \\frac{29}{5}, 7, -7}$.\n", - "Output Answer": [ - "$7+\\frac{23}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (23/math.pi), -(3/2), -math.pi, 4*math.sqrt(2), (29/5), 7, -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 3, -9, -3, -3, -4, 3, -3, 3, 3, -3, 3, 3, 3, -4, -1, -4, 3, 3, -1}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 3, -9, -3, -3, -4, 3, -3, 3, 3, -3, 3, 3, 3, -4, -1, -4, 3, 3, -1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -\\frac{17}{\\sqrt{\\pi }}, -5 \\sqrt{2}}$.", - "Output Answer": [ - "$-5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -(17/(math.sqrt(math.pi))), -5*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{19}{3}, -8, 7, 0, 7 \\log (2), -\\frac{14}{\\sqrt{\\pi }}, \\frac{3}{e}, -\\sqrt{3}, \\frac{2}{\\sqrt{\\pi }}, 8, 5, \\frac{27}{\\pi }, 3 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{2}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(19/3), -8, 7, 0, 7*math.log(2), -(14/(math.sqrt(math.pi))), (3/math.e), -math.sqrt(3), (2/(math.sqrt(math.pi))), 8, 5, (27/math.pi), 3*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, 11, 10, 10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 11, 10, 10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{25}{4}, \\frac{1}{4}, \\frac{1}{4}, \\frac{1}{4}, -\\frac{37}{4}, -\\frac{37}{4}, \\frac{19}{2}, \\frac{19}{2}, -\\frac{13}{4}, -\\frac{37}{4}, -\\frac{37}{4}, \\frac{25}{4}, \\frac{19}{2}, \\frac{25}{4}, \\frac{1}{4}, -\\frac{13}{4}, -\\frac{13}{2}, -\\frac{13}{2}, \\frac{19}{2}, \\frac{5}{4}, \\frac{5}{4}, -\\frac{13}{2}, \\frac{1}{4}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{1}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (25/4), (1/4), (1/4), (1/4), -(37/4), -(37/4), (19/2), (19/2), -(13/4), -(37/4), -(37/4), (25/4), (19/2), (25/4), (1/4), -(13/4), -(13/2), -(13/2), (19/2), (5/4), (5/4), -(13/2), (1/4)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.7 x-1.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$-1.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(0.7*x-1.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-8, \\frac{1}{3}, \\frac{3}{4}, -\\frac{12}{7}, 1}$.", - "Output Answer": [ - "$\\frac{1}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, (1/3), (3/4), -(12/7), 1\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, -4, 729}$.\n", - "Output Answer": [ - "$18 \\sqrt[3]{-2} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, -4, 729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, 7, -4, 3, -7, 0}$.\n", - "Output Answer": [ - "$-\\frac{5}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, 7, -4, 3, -7, 0\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, -8, -9, 0, -8, 8}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, -8, -9, 0, -8, 8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-5, 8, 7 \\sqrt{2}, -\\frac{36}{5}, \\frac{27}{4}} \\cup {\\frac{21}{4}, -\\frac{36}{5}, -9, 4, 7 \\sqrt{2}, -5, -1}$.\n", - "Output Answer": [ - "${-9, -\\frac{36}{5}, -5, -1, 4, \\frac{21}{4}, \\frac{27}{4}, 8, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 8, 7*math.sqrt(2), -(36/5), (27/4),))\nsnd = set(((21/4), -(36/5), -9, 4, 7*math.sqrt(2), -5, -1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x+1.9$ where $x \\sim $ \\text{NormalDistribution}[0.5,1.9]\n", - "Output Answer": [ - "$2.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.5, 1.9)\nprint(E(1.3*x+1.9))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4, 7, -\\frac{12}{5}, 7, -8, 2, 9, 3, \\frac{1}{7}, -4, 4}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 7, -(12/5), 7, -8, 2, 9, 3, (1/7), -4, 4\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{1}{e}, \\frac{3}{7}, 6, 14 \\log (2)}$.", - "Output Answer": [ - "$\\frac{45}{14}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(1/math.e), (3/7), 6, 14*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${9, -5, -\\sqrt{5}, \\frac{23}{\\pi }, -4, -4 \\sqrt{5}, -2 \\pi, -3.723, -9} \\cup {6.061, 9, 3 \\sqrt{5}, \\frac{23}{\\pi }, -4, 3 \\pi, -5, 8, 5.7}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{5}, -2 \\pi, -5, -4, -3.723, -\\sqrt{5}, 5.7, 6.061, 3 \\sqrt{5}, \\frac{23}{\\pi }, 8, 9, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -5, -math.sqrt(5), (23/math.pi), -4, -4*math.sqrt(5), -2*math.pi, -3.723, -9,))\nsnd = set((6.061, 9, 3*math.sqrt(5), (23/math.pi), -4, 3*math.pi, -5, 8, 5.7,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 4, -1, 4, -3, -8}$.\n", - "Output Answer": [ - "$\\frac{5}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 4, -1, 4, -3, -8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\sqrt{3}, 9, 6, -6 \\sqrt{2}, \\frac{1}{3}, -\\frac{34}{5}, \\frac{7}{\\sqrt{3}}, 0}$.\n", - "Output Answer": [ - "$9+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(3), 9, 6, -6*math.sqrt(2), (1/3), -(34/5), (7/(math.sqrt(3))), 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\sqrt{5}, -\\frac{43}{7}, 2, 4, 4, -9, -9, 0, 6, 3, -6}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(5), -(43/7), 2, 4, 4, -9, -9, 0, 6, 3, -6\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{3}, \\frac{8}{\\pi }, 6, -\\frac{47}{5}} \\setminus {1, -\\frac{47}{5}, -2 \\sqrt{5}, -5 \\sqrt{2}, -4, 3 \\sqrt{3}, \\frac{8}{\\pi }}$.\n", - "Output Answer": [ - "${6}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), (8/math.pi), 6, -(47/5),))\nsnd = set((1, -(47/5), -2*math.sqrt(5), -5*math.sqrt(2), -4, 3*math.sqrt(3), (8/math.pi),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4, 5, 0, -5} \\setminus {5, -5 \\sqrt{2}, 0, -4}$.\n", - "Output Answer": [ - "${-5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 5, 0, -5,))\nsnd = set((5, -5*math.sqrt(2), 0, -4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, \\frac{4}{3}, \\frac{58}{3}}$.\n", - "Output Answer": [ - "$\\frac{2436}{709}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, (4/3), (58/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -5, -1, -3, -3, 7, -3, -3, -1, -1, -3, -5, 7, -1, -1, -1, 7, -1, -1, 7, 2, 2, 7, 7, -3, -3}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -5, -1, -3, -3, 7, -3, -3, -1, -1, -3, -5, 7, -1, -1, -1, 7, -1, -1, 7, 2, 2, 7, 7, -3, -3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -4, -7}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "values = 6, -4, -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6 \\log (2), -6 \\log (2), -2 \\log (2), 13 \\log (2), -14 \\log (2), 9 \\log (2), 4 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{2 \\log (2)}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -6*math.log(2), -6*math.log(2), -2*math.log(2), 13*math.log(2), -14*math.log(2), 9*math.log(2), 4*math.log(2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x^2+2.9 x-1.1$ where $x \\sim $ \\text{BetaDistribution}[0.3,0.9]\n", - "Output Answer": [ - "$-0.71$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 0.9)\nprint(E(-2.3*x**2+2.9*x-1.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, \\frac{4}{\\sqrt{5}}, 2, \\frac{5}{\\sqrt{3}}, \\frac{12}{\\sqrt{5}}, \\frac{10}{\\sqrt{3}}, \\frac{17}{\\sqrt{5}}, 6, -3 \\sqrt{5}, \\frac{15}{7}, -2 \\log (2)}$.\n", - "Output Answer": [ - "$8+\\frac{17}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, (4/(math.sqrt(5))), 2, (5/(math.sqrt(3))), (12/(math.sqrt(5))), (10/(math.sqrt(3))), (17/(math.sqrt(5))), 6, -3*math.sqrt(5), (15/7), -2*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.7 x^2+0.3 x-0.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$-5.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(-0.7*x**2+0.3*x-0.7))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${8, \\frac{1}{e}, 9, 7, 2, \\frac{29}{4}, -3 \\sqrt{3}, -1} \\cup {\\frac{17}{4}, -1, 7, 4, 8, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -1, \\frac{1}{e}, 2, 4, \\frac{17}{4}, 7, \\frac{29}{4}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, (1/math.e), 9, 7, 2, (29/4), -3*math.sqrt(3), -1,))\nsnd = set(((17/4), -1, 7, 4, 8, -3*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{18}{\\pi }, \\frac{12}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{15}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (18/math.pi), (12/math.pi)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 2, 6}$.\n", - "Output Answer": [ - "$\\frac{18}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 2, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{13}{3}, 5, \\frac{11}{3}}$.\n", - "Output Answer": [ - "$\\frac{13}{9}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(13/3), 5, (11/3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 0, \\frac{14}{\\sqrt{5}}, -9.753} \\setminus {4 \\sqrt{5}, 2 \\sqrt{5}, -9.753, \\frac{9}{2}, 0}$.\n", - "Output Answer": [ - "${-1, \\frac{14}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 0, (14/(math.sqrt(5))), -9.753,))\nsnd = set((4*math.sqrt(5), 2*math.sqrt(5), -9.753, (9/2), 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{10}{\\sqrt{3}}, \\frac{25}{\\pi }, -6, -2 e, -6 \\sqrt{2}, 9}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -6, -\\frac{10}{\\sqrt{3}}, -2 e, \\frac{25}{\\pi }, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(10/(math.sqrt(3))), (25/math.pi), -6, -2*math.e, -6*math.sqrt(2), 9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 7, 3}$.\n", - "Output Answer": [ - "$\\frac{14}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 7, 3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{13}{4}, 14 \\log (2), -4, 4.27, -\\frac{9}{2}, 3, -\\frac{10}{\\pi }} \\cup {3, -\\frac{13}{4}, \\frac{17}{\\pi }, 14 \\log (2), -4, -\\frac{9}{2}, -2.51}$.\n", - "Output Answer": [ - "${-\\frac{9}{2}, -4, -\\frac{13}{4}, -\\frac{10}{\\pi }, -2.51, 3, 4.27, \\frac{17}{\\pi }, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/4), 14*math.log(2), -4, 4.27, -(9/2), 3, -(10/math.pi),))\nsnd = set((3, -(13/4), (17/math.pi), 14*math.log(2), -4, -(9/2), -2.51,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -\\frac{4}{\\sqrt{5}}, 3, \\frac{4}{e}, \\frac{7}{\\sqrt{2}}, 3, -2, \\frac{23}{4}, \\frac{15}{2}, \\frac{7}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{5}}, 4}$.\n", - "Output Answer": [ - "$\\frac{19}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -(4/(math.sqrt(5))), 3, (4/math.e), (7/(math.sqrt(2))), 3, -2, (23/4), (15/2), (7/(math.sqrt(math.pi))), (14/(math.sqrt(5))), 4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${5.797, -4, -9, 8, -6} \\setminus {-6, 5.797, 2, -\\frac{24}{5}, 4.8}$.\n", - "Output Answer": [ - "${-9, -4, 8}$" - ], - "Output Program": [ - "fst = set((5.797, -4, -9, 8, -6,))\nsnd = set((-6, 5.797, 2, -(24/5), 4.8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.134,0.124,0.177,0.17,0.145,0.179\\}$ and $\\{0.043,0.206,0.153,0.05,0.27,0.126\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.134, 0.124, 0.177, 0.17, 0.145, 0.179\ndistribution2 = 0.043, 0.206, 0.153, 0.05, 0.27, 0.126\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.5 x^2+1. x+0.1$ where $x \\sim $ \\text{NormalDistribution}[1.4,2.2]\n", - "Output Answer": [ - "$11.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.4, 2.2)\nprint(E(1.5*x**2+1.*x+0.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -2, -5, 9, 3, 3}$.\n", - "Output Answer": [ - "$-\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -2, -5, 9, 3, 3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x+0.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$0.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(2.6*x+0.9))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, -1, 8, -4}$.\n", - "Output Answer": [ - "$\\sqrt{51}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -1, 8, -4\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${5 \\sqrt{3}, -10, -9, 3.837, \\sqrt{5}, -9, 5}$.\n", - "Output Answer": [ - "${-10, -9, -9, \\sqrt{5}, 3.837, 5, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(3), -10, -9, 3.837, math.sqrt(5), -9, 5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 64, 25, 64}$.\n", - "Output Answer": [ - "$16 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 64, 25, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.016,0.072,0.087,0.14,0.058,0.054,0.11,0.181,0.105\\}$ and $\\{0.102,0.053,0.154,0.078,0.163,0.095,0.077,0.088,0.062\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.016, 0.072, 0.087, 0.14, 0.058, 0.054, 0.11, 0.181, 0.105\ndistribution2 = 0.102, 0.053, 0.154, 0.078, 0.163, 0.095, 0.077, 0.088, 0.062\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{19}{2}, \\frac{5}{2}}$.\n", - "Output Answer": [ - "$\\frac{95}{24}$" - ], - "Output Program": [ - "import statistics\nvalues = (19/2), (5/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-6, 2 \\sqrt{3}, -10}$.\n", - "Output Answer": [ - "${-10, -6, 2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 2*math.sqrt(3), -10\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{2}, 0, -3, \\frac{19}{\\sqrt{5}}, -\\frac{15}{e}} \\setminus {9, -2 e, 7, -6, \\frac{19}{\\sqrt{5}}, 0, \\frac{7}{e}}$.\n", - "Output Answer": [ - "${-\\frac{15}{e}, -3, \\frac{13}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/2), 0, -3, (19/(math.sqrt(5))), -(15/math.e),))\nsnd = set((9, -2*math.e, 7, -6, (19/(math.sqrt(5))), 0, (7/math.e),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, 5, -\\frac{13}{\\sqrt{2}}, -8, -\\frac{17}{5}, -4} \\setminus {-2, -\\frac{17}{5}, -2 e, -\\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -8, -4, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 5, -(13/(math.sqrt(2))), -8, -(17/5), -4,))\nsnd = set((-2, -(17/5), -2*math.e, -(9/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\sqrt{2}, -5 \\sqrt{2}, -4 \\sqrt{2}, -4 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, -4 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, -5 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, -5 \\sqrt{2}, -4 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, -5 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, -4 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, -4 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{13}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.sqrt(2), -5*math.sqrt(2), -4*math.sqrt(2), -4*math.sqrt(2), (13/(math.sqrt(2))), (13/(math.sqrt(2))), -4*math.sqrt(2), (13/(math.sqrt(2))), (13/(math.sqrt(2))), (13/(math.sqrt(2))), -5*math.sqrt(2), (13/(math.sqrt(2))), -5*math.sqrt(2), -4*math.sqrt(2), (13/(math.sqrt(2))), -5*math.sqrt(2), (13/(math.sqrt(2))), (1/(math.sqrt(2))), (13/(math.sqrt(2))), (13/(math.sqrt(2))), (13/(math.sqrt(2))), -4*math.sqrt(2), (1/(math.sqrt(2))), (1/(math.sqrt(2))), -4*math.sqrt(2), (13/(math.sqrt(2))), (13/(math.sqrt(2))), (1/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{17}{\\sqrt{\\pi }}, -3, -1, -7, \\frac{12}{\\sqrt{\\pi }}, -2, 0, 2}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{\\pi }}, -7, -3, -2, -1, 0, 2, \\frac{12}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(17/(math.sqrt(math.pi))), -3, -1, -7, (12/(math.sqrt(math.pi))), -2, 0, 2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{59}{7}, -\\frac{15}{7}, -10, \\frac{6}{7}, -\\frac{23}{7}, -\\frac{13}{7}, -10, -1}$.\n", - "Output Answer": [ - "$-\\frac{251}{56}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(59/7), -(15/7), -10, (6/7), -(23/7), -(13/7), -10, -1\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 15, 4}$.\n", - "Output Answer": [ - "$\\frac{360}{53}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 15, 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, -9, 14, 1, -12, -14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{3833}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -9, 14, 1, -12, -14\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{29}{5}, -e, -\\frac{4}{\\sqrt{\\pi }}, -3 \\sqrt{2}, 3 \\pi} \\setminus {-e, -\\sqrt{2}, -\\frac{4}{\\sqrt{\\pi }}, 7., 3 \\pi, -\\frac{43}{5}}$.\n", - "Output Answer": [ - "${-\\frac{29}{5}, -3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(29/5), -math.e, -(4/(math.sqrt(math.pi))), -3*math.sqrt(2), 3*math.pi,))\nsnd = set((-math.e, -math.sqrt(2), -(4/(math.sqrt(math.pi))), 7., 3*math.pi, -(43/5),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, 0, -6, 5, -6, 5, -1, 0, -1, 0, 0, -1, -6, -1, 0, -1, -6, 5, -6, -6, 0, -1, -1, -1, 5, -1, 5, 0, 0}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, 0, -6, 5, -6, 5, -1, 0, -1, 0, 0, -1, -6, -1, 0, -1, -6, 5, -6, -6, 0, -1, -1, -1, 5, -1, 5, 0, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-8, 7, 5, 3 e, 0} \\cup {7, -7, 0, 3 e, 5}$.\n", - "Output Answer": [ - "${-8, -7, 0, 5, 7, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 7, 5, 3*math.e, 0,))\nsnd = set((7, -7, 0, 3*math.e, 5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.191,0.202,0.126,0.204,0.184\\}$ and $\\{0.107,0.098,0.163,0.341,0.094\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.191, 0.202, 0.126, 0.204, 0.184\ndistribution2 = 0.107, 0.098, 0.163, 0.341, 0.094\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{1}{\\sqrt{3}}, -8, -\\frac{3}{2}, \\frac{3}{\\sqrt{\\pi }}, 5, 2, 3, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-8, -\\frac{3}{2}, -\\frac{1}{\\sqrt{3}}, \\frac{3}{\\sqrt{\\pi }}, 2, 3, 5, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(1/(math.sqrt(3))), -8, -(3/2), (3/(math.sqrt(math.pi))), 5, 2, 3, 5*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 1.591, 8} \\setminus {-1, \\frac{9}{e}, -7, 1.591, 2, -4}$.\n", - "Output Answer": [ - "${8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 1.591, 8,))\nsnd = set((-1, (9/math.e), -7, 1.591, 2, -4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.181,0.058,0.035,0.095,0.071,0.074,0.101,0.035,0.086,0.111\\}$ and $\\{0.211,0.094,0.139,0.061,0.116,0.061,0.041,0.058,0.084,0.06\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.181, 0.058, 0.035, 0.095, 0.071, 0.074, 0.101, 0.035, 0.086, 0.111\ndistribution2 = 0.211, 0.094, 0.139, 0.061, 0.116, 0.061, 0.041, 0.058, 0.084, 0.06\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x^2-5. x+4.7$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$3.07$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(1.9*x**2-5.*x+4.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, -7, 9, 5, 9, 5, -4, -7, -7, 9, 9, 9, 5, 9, 2, 2, 9, 2, -8, -8, -4, -4, -8, 9, -4, 5, 5}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, -7, 9, 5, 9, 5, -4, -7, -7, 9, 9, 9, 5, 9, 2, 2, 9, 2, -8, -8, -4, -4, -8, 9, -4, 5, 5\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6, 81, 6561, 4096, -7776}$.\n", - "Output Answer": [ - "$216 \\sqrt[5]{-1} 6^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 81, 6561, 4096, -7776\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 2, 10}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 2, 10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 20, 2}$.\n", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 20, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{3}{2}, \\frac{27}{2}, 5}$.\n", - "Output Answer": [ - "$\\frac{3510}{893}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (3/2), (27/2), 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.101,0.065,0.476\\}$ and $\\{0.28,0.202,0.247\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.101, 0.065, 0.476\ndistribution2 = 0.28, 0.202, 0.247\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, -8, -3, -\\frac{5}{e}, 4, 9, -3.833, 10} \\cup {\\frac{4}{e}, 0, -6 \\sqrt{2}, 7, 10, 2 \\sqrt{2}, 5, -2.285, 8}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -8, -3.833, -3, -2.285, -\\frac{5}{e}, 0, \\frac{4}{e}, 2 \\sqrt{2}, 4, 5, 7, 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -8, -3, -(5/math.e), 4, 9, -3.833, 10,))\nsnd = set(((4/math.e), 0, -6*math.sqrt(2), 7, 10, 2*math.sqrt(2), 5, -2.285, 8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 3, \\frac{55}{3}, \\frac{13}{3}}$.\n", - "Output Answer": [ - "$\\frac{6435}{1174}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 3, (55/3), (13/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{5}{e}, \\frac{10}{e}, \\frac{15}{e}, -\\frac{4}{e}, \\frac{15}{e}, -\\frac{7}{e}, -\\frac{4}{e}, -\\frac{7}{e}, -\\frac{7}{e}, \\frac{10}{e}, -\\frac{22}{e}, \\frac{10}{e}, \\frac{24}{e}, \\frac{24}{e}, -\\frac{4}{e}, -\\frac{7}{e}, -\\frac{26}{e}, \\frac{10}{e}, -\\frac{22}{e}, -\\frac{22}{e}, -\\frac{7}{e}, -\\frac{5}{e}, \\frac{15}{e}, \\frac{10}{e}, -\\frac{22}{e}, -\\frac{26}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{10}{e},-\\frac{7}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(5/math.e), (10/math.e), (15/math.e), -(4/math.e), (15/math.e), -(7/math.e), -(4/math.e), -(7/math.e), -(7/math.e), (10/math.e), -(22/math.e), (10/math.e), (24/math.e), (24/math.e), -(4/math.e), -(7/math.e), -(26/math.e), (10/math.e), -(22/math.e), -(22/math.e), -(7/math.e), -(5/math.e), (15/math.e), (10/math.e), -(22/math.e), -(26/math.e)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{3}{5}, \\frac{36}{5}, -\\frac{28}{5}, -\\frac{13}{5}}$.\n", - "Output Answer": [ - "$-\\frac{1}{10}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (3/5), (36/5), -(28/5), -(13/5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, 11, 3}$.\n", - "Output Answer": [ - "$\\frac{532}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 11, 3\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{66}{7}, \\frac{19}{\\sqrt{5}}, 2 \\pi, 7}$.", - "Output Answer": [ - "$\\frac{1}{2} (7+2 \\pi )$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(66/7), (19/(math.sqrt(5))), 2*math.pi, 7\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${9, -10, -\\frac{17}{7}, 7, -2 \\pi, 2 e}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2 e-\\frac{17}{7}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -10, -(17/7), 7, -2*math.pi, 2*math.e\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, 3 \\sqrt{3}, -\\sqrt{3}, -\\frac{2}{\\sqrt{3}}, -3 \\sqrt{3}, \\frac{5}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{1}{7} \\left(-\\frac{7}{\\sqrt{3}}-3 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.sqrt(3), -(10/(math.sqrt(3))), 3*math.sqrt(3), -math.sqrt(3), -(2/(math.sqrt(3))), -3*math.sqrt(3), (5/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5.6, 4, 8, 2 \\sqrt{2}, -3, -4, 4.099, \\frac{10}{3}, -3 e} \\cup {\\frac{22}{3}, -2 \\pi, 4.099, -\\log (2), 2 \\sqrt{2}, 4, 7, -9.4, 8}$.\n", - "Output Answer": [ - "${-9.4, -3 e, -2 \\pi, -4, -3, -\\log (2), 2 \\sqrt{2}, \\frac{10}{3}, 4, 4.099, 5.6, 7, \\frac{22}{3}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.6, 4, 8, 2*math.sqrt(2), -3, -4, 4.099, (10/3), -3*math.e,))\nsnd = set(((22/3), -2*math.pi, 4.099, -math.log(2), 2*math.sqrt(2), 4, 7, -9.4, 8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -512, 25}$.\n", - "Output Answer": [ - "$8\\ 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -512, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-6, 3, -8, 0, \\frac{54}{7}, -5 \\sqrt{2}, 0, 5 \\sqrt{3}, \\frac{13}{e}, 2, 8}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, 3, -8, 0, (54/7), -5*math.sqrt(2), 0, 5*math.sqrt(3), (13/math.e), 2, 8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${1, -7, \\frac{34}{5}, 9, -2 e, -4} \\cup {-7, -11 \\log (2), -\\frac{16}{\\sqrt{3}}, 1, -\\frac{36}{5}, -2 e, 9.7}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -11 \\log (2), -\\frac{36}{5}, -7, -2 e, -4, 1, \\frac{34}{5}, 9, 9.7}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -7, (34/5), 9, -2*math.e, -4,))\nsnd = set((-7, -11*math.log(2), -(16/(math.sqrt(3))), 1, -(36/5), -2*math.e, 9.7,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-729, 10, -1}$.\n", - "Output Answer": [ - "$9 \\sqrt[3]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = -729, 10, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-5, \\frac{54}{7}, \\frac{1}{2}, -2, 6} \\setminus {1, -5, \\frac{1}{2}, -4, 9, 8}$.\n", - "Output Answer": [ - "${-2, 6, \\frac{54}{7}}$" - ], - "Output Program": [ - "fst = set((-5, (54/7), (1/2), -2, 6,))\nsnd = set((1, -5, (1/2), -4, 9, 8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.054,0.173,0.24,0.043,0.121,0.216\\}$ and $\\{0.001,0.031,0.655,0.001,0.255,0.044\\}$.", - "Output Answer": [ - "$0.96$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.054, 0.173, 0.24, 0.043, 0.121, 0.216\ndistribution2 = 0.001, 0.031, 0.655, 0.001, 0.255, 0.044\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2, \\frac{21}{e}, -9, -8, 2, \\frac{29}{4}, -9, -7}$.\n", - "Output Answer": [ - "${-9, -9, -8, -7, 2, 2, \\frac{29}{4}, \\frac{21}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, (21/math.e), -9, -8, 2, (29/4), -9, -7\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x^3+4.6 x^2-0.7 x+3.7$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$2.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(-3.5*x**3+4.6*x**2-0.7*x+3.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, -9, -10, 7, -9, 7, 10, -10, -8, 10, 10, -9, -9, -10, 10, 10, 7, 10, 10, -9, 10, -9, 7}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, -9, -10, 7, -9, 7, 10, -10, -8, 10, 10, -9, -9, -10, 10, 10, 7, 10, 10, -9, 10, -9, 7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -7, -7, 5, 5}$.\n", - "Output Answer": [ - "$-\\frac{7}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -7, -7, 5, 5\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${1, -3, -4, -10 \\log (2), 9} \\cup {-3, -4, -6, -10 \\log (2), 9}$.\n", - "Output Answer": [ - "${-10 \\log (2), -6, -4, -3, 1, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -3, -4, -10*math.log(2), 9,))\nsnd = set((-3, -4, -6, -10*math.log(2), 9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-9.4, -7, -8, -1, \\frac{38}{7}, 10} \\cup {-8, \\frac{38}{7}, -9.4, -7, -1, 7}$.\n", - "Output Answer": [ - "${-9.4, -8, -7, -1, \\frac{38}{7}, 7, 10}$" - ], - "Output Program": [ - "fst = set((-9.4, -7, -8, -1, (38/7), 10,))\nsnd = set((-8, (38/7), -9.4, -7, -1, 7,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, -5.42, 0.6, -7 \\sqrt{2}, 7, 4, -\\frac{18}{\\sqrt{5}}} \\setminus {-5.42, -1, -\\frac{18}{\\sqrt{5}}, 0.6, 7, 0}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -5.42, 0.6, -7*math.sqrt(2), 7, 4, -(18/(math.sqrt(5))),))\nsnd = set((-5.42, -1, -(18/(math.sqrt(5))), 0.6, 7, 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x+3.3$ where $x \\sim $ \\text{PoissonDistribution}[1.]\n", - "Output Answer": [ - "$6.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.)\nprint(E(2.8*x+3.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{16}{3}, 16}$.\n", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import statistics\nvalues = (16/3), 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -\\frac{1}{2}, \\frac{6}{\\pi }, \\frac{4}{\\pi }, -\\frac{41}{7}} \\cup {\\frac{4}{\\pi }, -3, \\frac{26}{\\pi }, -\\frac{1}{2}, \\frac{1}{7}}$.\n", - "Output Answer": [ - "${-\\frac{41}{7}, -3, -\\frac{1}{2}, \\frac{1}{7}, \\frac{4}{\\pi }, \\frac{6}{\\pi }, \\frac{26}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -(1/2), (6/math.pi), (4/math.pi), -(41/7),))\nsnd = set(((4/math.pi), -3, (26/math.pi), -(1/2), (1/7),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, 1, 1, -5, 64, 6}$.\n", - "Output Answer": [ - "$2 \\sqrt[6]{-3} \\sqrt{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, 1, 1, -5, 64, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 17, 14, 20}$.\n", - "Output Answer": [ - "$\\frac{104720}{7099}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 17, 14, 20\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{\\sqrt{2}}, -2 \\sqrt{2}, 0, 4 \\sqrt{2}, 8.61, -9, 1}$.\n", - "Output Answer": [ - "${-9, -\\frac{11}{\\sqrt{2}}, -2 \\sqrt{2}, 0, 1, 4 \\sqrt{2}, 8.61}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/(math.sqrt(2))), -2*math.sqrt(2), 0, 4*math.sqrt(2), 8.61, -9, 1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, 15, 5, -3}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{659}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 15, 5, -3\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.264,0.208,0.474\\}$ and $\\{0.55,0.113,0.062\\}$.", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.264, 0.208, 0.474\ndistribution2 = 0.55, 0.113, 0.062\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x^2+3.6 x+3.3$ where $x \\sim $ \\text{PoissonDistribution}[2.6]\n", - "Output Answer": [ - "$-12.61$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.6)\nprint(E(-2.7*x**2+3.6*x+3.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $0.07 < 2.6 x^2+2.6 x+0.9 < 8.4$ where $x \\sim $ \\text{PoissonDistribution}[3.6].", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.6)\nprint(P((0.07 < 2.6*x**2+2.6*x+0.9) & (2.6*x**2+2.6*x+0.9 < 8.4)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 4, -\\frac{16}{3}, 6, \\pi, -\\frac{9}{2}, -5, -13 \\log (2), -\\frac{48}{5}, -\\frac{18}{\\sqrt{5}}, -4, 1, -6, \\frac{20}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{48}{5}+\\frac{20}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 4, -(16/3), 6, math.pi, -(9/2), -5, -13*math.log(2), -(48/5), -(18/(math.sqrt(5))), -4, 1, -6, (20/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -9, -1, -7, -8, -6, 6}$.\n", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -9, -1, -7, -8, -6, 6\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, \\frac{9}{2}, -\\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{13}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, (9/2), -math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-9, \\frac{44}{5}, 5 \\sqrt{3}, 4, 1}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, (44/5), 5*math.sqrt(3), 4, 1\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.7 x^2-3.9 x-4.2$ where $x \\sim $ \\text{NormalDistribution}[0.5,0.6]\n", - "Output Answer": [ - "$-5.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.5, 0.6)\nprint(E(0.7*x**2-3.9*x-4.2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, -2, 2, \\frac{11}{2}} \\cup {\\frac{11}{2}, 5, -2, \\frac{32}{5}}$.\n", - "Output Answer": [ - "${-2, 2, 5, \\frac{11}{2}, \\frac{32}{5}}$" - ], - "Output Program": [ - "fst = set((5, -2, 2, (11/2),))\nsnd = set(((11/2), 5, -2, (32/5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${4, 9, \\frac{11}{\\sqrt{2}}, 3, -10, -2, -6} \\cup {\\frac{11}{\\sqrt{2}}, 4, 2, 3, 5, -2, 8, -6, -e}$.\n", - "Output Answer": [ - "${-10, -6, -e, -2, 2, 3, 4, 5, \\frac{11}{\\sqrt{2}}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 9, (11/(math.sqrt(2))), 3, -10, -2, -6,))\nsnd = set(((11/(math.sqrt(2))), 4, 2, 3, 5, -2, 8, -6, -math.e,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, 3, -6, \\frac{5}{\\sqrt{2}}, -5, -5.218} \\setminus {-5, 7 \\log (2), 2 \\sqrt{2}, 0, -2}$.\n", - "Output Answer": [ - "${-6, -5.218, 3, \\frac{5}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 3, -6, (5/(math.sqrt(2))), -5, -5.218,))\nsnd = set((-5, 7*math.log(2), 2*math.sqrt(2), 0, -2,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-4 \\sqrt{5}, -2, 0, -5 \\sqrt{2}, -3, -7, 5} \\cup {-4 \\sqrt{5}, -7, 6, -5 \\sqrt{2}, -2, -9, -10}$.\n", - "Output Answer": [ - "${-10, -9, -4 \\sqrt{5}, -5 \\sqrt{2}, -7, -3, -2, 0, 5, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), -2, 0, -5*math.sqrt(2), -3, -7, 5,))\nsnd = set((-4*math.sqrt(5), -7, 6, -5*math.sqrt(2), -2, -9, -10,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.098,0.061,0.058,0.203,0.033,0.096,0.067,0.217\\}$ and $\\{0.012,0.143,0.196,0.069,0.119,0.309,0.079,0.063\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.098, 0.061, 0.058, 0.203, 0.033, 0.096, 0.067, 0.217\ndistribution2 = 0.012, 0.143, 0.196, 0.069, 0.119, 0.309, 0.079, 0.063\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -\\frac{14}{3}, 10, -\\frac{28}{3}, 4, -\\frac{14}{3}, \\frac{29}{3}, -\\frac{29}{3}}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -(14/3), 10, -(28/3), 4, -(14/3), (29/3), -(29/3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${1, 6, 3, 8, -7.6, -5, -3 \\sqrt{2}, 5 \\sqrt{3}} \\cup {1, -1, -3 \\sqrt{2}, 10, \\frac{17}{\\sqrt{3}}, 6, -7.6, 2}$.\n", - "Output Answer": [ - "${-7.6, -5, -3 \\sqrt{2}, -1, 1, 2, 3, 6, 8, 5 \\sqrt{3}, \\frac{17}{\\sqrt{3}}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 6, 3, 8, -7.6, -5, -3*math.sqrt(2), 5*math.sqrt(3),))\nsnd = set((1, -1, -3*math.sqrt(2), 10, (17/(math.sqrt(3))), 6, -7.6, 2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-10, 7.26, -9.9, \\frac{8}{3}, 6, -3 e}$.\n", - "Output Answer": [ - "${-10, -9.9, -3 e, \\frac{8}{3}, 6, 7.26}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, 7.26, -9.9, (8/3), 6, -3*math.e\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${6, 8, -4, 9, -5}$.\n", - "Output Answer": [ - "$\\frac{457}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 8, -4, 9, -5\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${6 \\sqrt{3}, 3 e, 7}$.\n", - "Output Answer": [ - "${7, 3 e, 6 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6*math.sqrt(3), 3*math.e, 7\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9, -\\frac{3}{4}, 3, 7.3, -2} \\setminus {\\frac{39}{4}, 0, -2, 9, 3}$.\n", - "Output Answer": [ - "${-\\frac{3}{4}, 7.3}$" - ], - "Output Program": [ - "fst = set((9, -(3/4), 3, 7.3, -2,))\nsnd = set(((39/4), 0, -2, 9, 3,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${531441, -5, 1, 49, -1, 625}$.\n", - "Output Answer": [ - "$9\\ 5^{5/6} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 531441, -5, 1, 49, -1, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.169,0.25,0.306\\}$ and $\\{0.191,0.157,0.329\\}$.", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.169, 0.25, 0.306\ndistribution2 = 0.191, 0.157, 0.329\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -2, 8, -2, 4, 4, 4, -2, 8, 4, 6, 6, 8, 6, -2, 8, 8, -2, 2, 8, 3, -2, 2, 6, -2, -2, 6}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -2, 8, -2, 4, 4, 4, -2, 8, 4, 6, 6, 8, 6, -2, 8, 8, -2, 2, 8, 3, -2, 2, 6, -2, -2, 6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-6, 10, 5, -\\pi, 4 \\sqrt{2}, \\frac{24}{e}, \\frac{14}{5}, 0} \\cup {-\\pi, 10, -4, 5, \\frac{14}{e}, -9, \\frac{3}{5}}$.\n", - "Output Answer": [ - "${-9, -6, -4, -\\pi, 0, \\frac{3}{5}, \\frac{14}{5}, 5, \\frac{14}{e}, 4 \\sqrt{2}, \\frac{24}{e}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 10, 5, -math.pi, 4*math.sqrt(2), (24/math.e), (14/5), 0,))\nsnd = set((-math.pi, 10, -4, 5, (14/math.e), -9, (3/5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -9, 9, 5, 5, -9, 9, -9, -8, -9, 5, -9, 9, -9, -8, -8, -8, 2, 5, 5, -8, 2, -9, -9, -9}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -9, 9, 5, 5, -9, 9, -9, -8, -9, 5, -9, 9, -9, -8, -8, -8, 2, 5, 5, -8, 2, -9, -9, -9\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, \\frac{38}{3}, \\frac{10}{3}, \\frac{5}{3}}$.\n", - "Output Answer": [ - "$\\frac{95}{47}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, (38/3), (10/3), (5/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, -2, -7, -5, -10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{967}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -2, -7, -5, -10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${6.068, 4 \\sqrt{3}, -\\frac{11}{5}, -6}$.\n", - "Output Answer": [ - "${-6, -\\frac{11}{5}, 6.068, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6.068, 4*math.sqrt(3), -(11/5), -6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{16}{5}, -5, \\frac{55}{7}, 4 \\sqrt{5}, \\sqrt{3}, 4, 6, \\frac{11}{4}, -1, 4, \\frac{7}{\\sqrt{2}}, -\\frac{11}{2}}$.", - "Output Answer": [ - "$\\frac{18}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (16/5), -5, (55/7), 4*math.sqrt(5), math.sqrt(3), 4, 6, (11/4), -1, 4, (7/(math.sqrt(2))), -(11/2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, -15, -8}$.\n", - "Output Answer": [ - "$\\frac{49}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -15, -8\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, 2}$.\n", - "Output Answer": [ - "$\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 2\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${7, -\\frac{23}{e}, -3} \\setminus {5.937, -4, 8}$.\n", - "Output Answer": [ - "${-\\frac{23}{e}, -3, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -(23/math.e), -3,))\nsnd = set((5.937, -4, 8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.06,0.069,0.125,0.462,0.167,0.022\\}$ and $\\{0.103,0.171,0.091,0.01,0.179,0.311\\}$.", - "Output Answer": [ - "$1.77$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.06, 0.069, 0.125, 0.462, 0.167, 0.022\ndistribution2 = 0.103, 0.171, 0.091, 0.01, 0.179, 0.311\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -2, \\sqrt{2}, -5, e} \\setminus {\\sqrt{2}, -\\frac{21}{e}, -13 \\log (2), 0, -3, -7}$.\n", - "Output Answer": [ - "${-5, -2, e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -2, math.sqrt(2), -5, math.e,))\nsnd = set((math.sqrt(2), -(21/math.e), -13*math.log(2), 0, -3, -7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, 8, -9}$.\n", - "Output Answer": [ - "$-\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, 8, -9\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6 \\sqrt{3}, 2 \\sqrt{3}, -2 \\sqrt{3}, 0, -2 \\sqrt{3}, 6 \\sqrt{3}, 0, 3 \\sqrt{3}, 3 \\sqrt{3}, -2 \\sqrt{3}, 6 \\sqrt{3}, 6 \\sqrt{3}, 6 \\sqrt{3}, 6 \\sqrt{3}, -2 \\sqrt{3}, 6 \\sqrt{3}, 0, 6 \\sqrt{3}, 6 \\sqrt{3}, 2 \\sqrt{3}, 0, -2 \\sqrt{3}, \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, 3 \\sqrt{3}, 2 \\sqrt{3}, 0}$.\n", - "Output Answer": [ - "$\\left\\{6 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 6*math.sqrt(3), 2*math.sqrt(3), -2*math.sqrt(3), 0, -2*math.sqrt(3), 6*math.sqrt(3), 0, 3*math.sqrt(3), 3*math.sqrt(3), -2*math.sqrt(3), 6*math.sqrt(3), 6*math.sqrt(3), 6*math.sqrt(3), 6*math.sqrt(3), -2*math.sqrt(3), 6*math.sqrt(3), 0, 6*math.sqrt(3), 6*math.sqrt(3), 2*math.sqrt(3), 0, -2*math.sqrt(3), math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), 3*math.sqrt(3), 2*math.sqrt(3), 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.149,0.169,0.096,0.103,0.042,0.022,0.024,0.16,0.103,0.047\\}$ and $\\{0.04,0.1,0.237,0.199,0.017,0.045,0.032,0.03,0.159,0.052\\}$.", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.149, 0.169, 0.096, 0.103, 0.042, 0.022, 0.024, 0.16, 0.103, 0.047\ndistribution2 = 0.04, 0.1, 0.237, 0.199, 0.017, 0.045, 0.032, 0.03, 0.159, 0.052\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{5}, \\sqrt{5}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(5), math.sqrt(5), 3*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, -729, -10}$.\n", - "Output Answer": [ - "$27 \\sqrt[3]{30}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, -729, -10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x-4.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$-4.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(3.7*x-4.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-7, \\frac{31}{5}, -\\frac{13}{\\sqrt{2}}, -6, -6, 2 \\sqrt{2}, -\\frac{9}{\\pi }, -\\frac{1}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -7, -6, -6, -\\frac{9}{\\pi }, -\\frac{1}{\\pi }, 2 \\sqrt{2}, \\frac{31}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, (31/5), -(13/(math.sqrt(2))), -6, -6, 2*math.sqrt(2), -(9/math.pi), -(1/math.pi)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{22}{e}, 3 \\sqrt{2}, 10, \\frac{3}{\\sqrt{2}}, 9, 6.75}$.\n", - "Output Answer": [ - "${\\frac{3}{\\sqrt{2}}, 3 \\sqrt{2}, 6.75, \\frac{22}{e}, 9, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = (22/math.e), 3*math.sqrt(2), 10, (3/(math.sqrt(2))), 9, 6.75\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 9}$.\n", - "Output Answer": [ - "$\\frac{7}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 9\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x^2+3.2 x+0.8$ where $x \\sim $ \\text{PoissonDistribution}[2.5]\n", - "Output Answer": [ - "$41.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.5)\nprint(E(3.7*x**2+3.2*x+0.8))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{2}, \\frac{11}{\\sqrt{2}}, 0, -\\frac{1}{\\sqrt{2}}, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{\\sqrt{2}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(2), (11/(math.sqrt(2))), 0, -(1/(math.sqrt(2))), -5*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.05,0.118,0.026,0.044,0.121,0.194,0.101,0.103,0.066,0.119\\}$ and $\\{0.124,0.114,0.156,0.035,0.015,0.017,0.005,0.1,0.186,0.128\\}$.", - "Output Answer": [ - "$0.86$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.05, 0.118, 0.026, 0.044, 0.121, 0.194, 0.101, 0.103, 0.066, 0.119\ndistribution2 = 0.124, 0.114, 0.156, 0.035, 0.015, 0.017, 0.005, 0.1, 0.186, 0.128\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, -7, 4, -8, 6, 1, -4, -3, 5, -5, 8, -1, -2} \\cap {-3, 6, 3, 5, 2, -1, 0, 10, -7, -6, 7, -8}$.\n", - "Output Answer": [ - "${-8, -7, -3, -1, 3, 5, 6}$" - ], - "Output Program": [ - "fst = set((3, -7, 4, -8, 6, 1, -4, -3, 5, -5, 8, -1, -2,))\nsnd = set((-3, 6, 3, 5, 2, -1, 0, 10, -7, -6, 7, -8,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{2}, e, \\frac{7}{\\sqrt{2}}, 3 \\sqrt{3}, -9, 9, 4}$.\n", - "Output Answer": [ - "${-9, e, 2 \\sqrt{2}, 4, \\frac{7}{\\sqrt{2}}, 3 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(2), math.e, (7/(math.sqrt(2))), 3*math.sqrt(3), -9, 9, 4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-9.6, 3 e, -7 \\log (2), 2, 0.7} \\cup {-9.6, 3 e, -7, 0.7, -7 \\log (2)}$.\n", - "Output Answer": [ - "${-9.6, -7, -7 \\log (2), 0.7, 2, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9.6, 3*math.e, -7*math.log(2), 2, 0.7,))\nsnd = set((-9.6, 3*math.e, -7, 0.7, -7*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\sqrt{3}, 8.6, -1, 7, -10} \\cup {-1, 3 \\sqrt{3}, -8, 8, 8.6}$.\n", - "Output Answer": [ - "${-10, -8, -1, 3 \\sqrt{3}, 7, 8, 8.6}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), 8.6, -1, 7, -10,))\nsnd = set((-1, 3*math.sqrt(3), -8, 8, 8.6,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 2, -5, -3 \\sqrt{2}, \\frac{15}{7}, \\frac{13}{\\sqrt{\\pi }}} \\setminus {-8, -2.1, \\frac{13}{7}, -7, \\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-5, -3 \\sqrt{2}, -1, 2, \\frac{15}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 2, -5, -3*math.sqrt(2), (15/7), (13/(math.sqrt(math.pi))),))\nsnd = set((-8, -2.1, (13/7), -7, (13/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 0, \\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, \\sqrt{5}, -3 \\sqrt{5}, -\\sqrt{5}, -3 \\sqrt{5}, -\\sqrt{5}, \\sqrt{5}, -3 \\sqrt{5}, 3 \\sqrt{5}, 3 \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, -3 \\sqrt{5}, 0, -3 \\sqrt{5}, -\\sqrt{5}, 0, 4 \\sqrt{5}, -\\sqrt{5}, 0}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{5},-\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 0, math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), math.sqrt(5), -3*math.sqrt(5), -math.sqrt(5), -3*math.sqrt(5), -math.sqrt(5), math.sqrt(5), -3*math.sqrt(5), 3*math.sqrt(5), 3*math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), -3*math.sqrt(5), 0, -3*math.sqrt(5), -math.sqrt(5), 0, 4*math.sqrt(5), -math.sqrt(5), 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 8, -1, -1, -4 \\sqrt{2}, 1, 6 \\sqrt{2}, 1, 4 \\sqrt{2}, -3, -11 \\log (2), -\\frac{42}{5}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, 8, -1, -1, -4*math.sqrt(2), 1, 6*math.sqrt(2), 1, 4*math.sqrt(2), -3, -11*math.log(2), -(42/5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, 14, -3, 10, -14, 8}$.\n", - "Output Answer": [ - "$110$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 14, -3, 10, -14, 8\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${5 \\sqrt{2}, -4 \\sqrt{2}, 3 \\sqrt{2}, -3 \\sqrt{2}, -5 \\sqrt{2}} \\cap {4 \\sqrt{2}, 3 \\sqrt{2}, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, 3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), -4*math.sqrt(2), 3*math.sqrt(2), -3*math.sqrt(2), -5*math.sqrt(2),))\nsnd = set((4*math.sqrt(2), 3*math.sqrt(2), -5*math.sqrt(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-1, 8.999, 3 \\sqrt{5}, \\frac{12}{\\sqrt{5}}, 2.4}$.\n", - "Output Answer": [ - "${-1, 2.4, \\frac{12}{\\sqrt{5}}, 3 \\sqrt{5}, 8.999}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 8.999, 3*math.sqrt(5), (12/(math.sqrt(5))), 2.4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-7, 0, 8, 11 \\log (2), 10, -2, 3 \\sqrt{2}, 9} \\cup {3, 0, 8, 9, -7, 2, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -7, -2, 0, 2, 3, 3 \\sqrt{2}, 11 \\log (2), 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 0, 8, 11*math.log(2), 10, -2, 3*math.sqrt(2), 9,))\nsnd = set((3, 0, 8, 9, -7, 2, -5*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${7, \\sqrt{3}, 6, -10, -10, 9, -4, -9}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{3}-4\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, math.sqrt(3), 6, -10, -10, 9, -4, -9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x-2.6$ where $x \\sim $ \\text{NormalDistribution}[0.4,1.]\n", - "Output Answer": [ - "$-3.52$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.4, 1.)\nprint(E(-2.3*x-2.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{8}{\\pi }, -9, -2 \\sqrt{2}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$9+3 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -(8/math.pi), -9, -2*math.sqrt(2), 3*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.081,0.038,0.152,0.109,0.182,0.397\\}$ and $\\{0.192,0.253,0.099,0.156,0.069,0.163\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.081, 0.038, 0.152, 0.109, 0.182, 0.397\ndistribution2 = 0.192, 0.253, 0.099, 0.156, 0.069, 0.163\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.259,0.225\\}$ and $\\{0.588,0.32,0.044\\}$.", - "Output Answer": [ - "$0.75$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.259, 0.225\ndistribution2 = 0.588, 0.32, 0.044\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -3 e, 0, -e, -4 e, -3 e, -e}$.\n", - "Output Answer": [ - "$-\\frac{12 e}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, -3*math.e, 0, -math.e, -4*math.e, -3*math.e, -math.e\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-2, 7, 10}$.\n", - "Output Answer": [ - "${-2, 7, 10}$" - ], - "Output Program": [ - "values = -2, 7, 10\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\log (2), -\\log (2), -\\log (2), -\\log (2), -11 \\log (2), -7 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{17 \\log (2)}{6}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.log(2), -math.log(2), -math.log(2), -math.log(2), -11*math.log(2), -7*math.log(2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -9, -6, 2, -2, -9, -7, 2, -9, -2, 2, 2, 2, 2, -9, 6, -6, 2, -7, -2, -9, 2, 2, -9, 2, 2}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -9, -6, 2, -2, -9, -7, 2, -9, -2, 2, 2, 2, 2, -9, 6, -6, 2, -7, -2, -9, 2, 2, -9, 2, 2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 27, 1, 1, -9}$.\n", - "Output Answer": [ - "$3 \\sqrt[5]{-1} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 27, 1, 1, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 10, 16, 18}$.\n", - "Output Answer": [ - "$\\frac{2880}{217}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 10, 16, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 16, 9, 5}$.\n", - "Output Answer": [ - "$\\frac{48960}{5293}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 16, 9, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, -7, 9, -6., \\frac{4}{3}} \\cup {-7, 9, \\frac{7}{\\sqrt{3}}, -\\frac{23}{3}}$.\n", - "Output Answer": [ - "${-\\frac{23}{3}, -7, -6., 0, \\frac{4}{3}, \\frac{7}{\\sqrt{3}}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -7, 9, -6., (4/3),))\nsnd = set((-7, 9, (7/(math.sqrt(3))), -(23/3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{33}{5}, 9, 2}$.\n", - "Output Answer": [ - "${-\\frac{33}{5}, 2, 9}$" - ], - "Output Program": [ - "values = -(33/5), 9, 2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, -6}$.", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{2}{5}, -7, -2 \\sqrt{3}, \\frac{1}{\\sqrt{5}}, -\\log (2)}$.", - "Output Answer": [ - "$-\\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(2/5), -7, -2*math.sqrt(3), (1/(math.sqrt(5))), -math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x-4.8$ where $x \\sim $ \\text{NormalDistribution}[-0.7,1.4]\n", - "Output Answer": [ - "$-6.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.7, 1.4)\nprint(E(2.2*x-4.8))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 7, 7, -6, -8, 9, 5, -3}$.\n", - "Output Answer": [ - "$\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 7, 7, -6, -8, 9, 5, -3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, 4, -343}$.\n", - "Output Answer": [ - "$7\\ 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 4, -343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 0, 2 e, -3, -\\frac{5}{\\sqrt{3}}, -10}$.\n", - "Output Answer": [ - "$10+2 e$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 0, 2*math.e, -3, -(5/(math.sqrt(3))), -10\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\sqrt{2}, 2.896, -1, 9, -4}$.\n", - "Output Answer": [ - "${-4, -\\sqrt{2}, -1, 2.896, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(2), 2.896, -1, 9, -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, -9, -10, -9, -1, 7, -1, 7, -9, -1, -9, -1, 7, -1, -10, -1, -1, 7, -1, -1, -9}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, -9, -10, -9, -1, 7, -1, 7, -9, -1, -9, -1, 7, -1, -10, -1, -1, 7, -1, -1, -9\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 17, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{153}{26}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 17, (17/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{2}, \\frac{5}{2}, \\frac{25}{2}}$.\n", - "Output Answer": [ - "$\\frac{825}{182}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/2), (5/2), (25/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -6, 1, 2 \\sqrt{2}, 3 \\log (2), -5, \\frac{4}{\\sqrt{\\pi }}, 3 \\log (2), -9, 0, 0}$.\n", - "Output Answer": [ - "$9+2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -6, 1, 2*math.sqrt(2), 3*math.log(2), -5, (4/(math.sqrt(math.pi))), 3*math.log(2), -9, 0, 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 11, 5, 15}$.\n", - "Output Answer": [ - "$\\frac{2145}{233}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 11, 5, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{19}{7}, 2 \\sqrt{2}, \\frac{68}{7}, 2 \\sqrt{5}, 6, -13 \\log (2), -4, -4, -6 \\log (2), -7, -4, -7}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(19/7), 2*math.sqrt(2), (68/7), 2*math.sqrt(5), 6, -13*math.log(2), -4, -4, -6*math.log(2), -7, -4, -7\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -1, 9, 6, 5, 6, 0, -3}$.\n", - "Output Answer": [ - "$\\frac{15}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -1, 9, 6, 5, 6, 0, -3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 0, 6, 15}$.\n", - "Output Answer": [ - "$63$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 0, 6, 15\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\pi, -4 \\sqrt{5}, 8, 2 \\pi, \\frac{50}{7}, -8, \\sqrt{2}}$.\n", - "Output Answer": [ - "$8+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.pi, -4*math.sqrt(5), 8, 2*math.pi, (50/7), -8, math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-9, 1, 4}$.\n", - "Output Answer": [ - "${-9, 1, 4}$" - ], - "Output Program": [ - "values = -9, 1, 4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{32}{5}, -\\frac{8}{5}, \\frac{4}{5}, -\\frac{8}{5}, -\\frac{22}{5}, \\frac{4}{5}, -\\frac{48}{5}, -\\frac{8}{5}, \\frac{43}{5}, \\frac{4}{5}, -\\frac{48}{5}, -\\frac{48}{5}, -\\frac{34}{5}, -\\frac{48}{5}, -\\frac{8}{5}, \\frac{4}{5}, -\\frac{34}{5}, \\frac{4}{5}, -\\frac{48}{5}, -\\frac{48}{5}, -\\frac{48}{5}, \\frac{4}{5}, \\frac{43}{5}, -\\frac{34}{5}, \\frac{4}{5}, \\frac{43}{5}, -\\frac{8}{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{5},-\\frac{48}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (32/5), -(8/5), (4/5), -(8/5), -(22/5), (4/5), -(48/5), -(8/5), (43/5), (4/5), -(48/5), -(48/5), -(34/5), -(48/5), -(8/5), (4/5), -(34/5), (4/5), -(48/5), -(48/5), -(48/5), (4/5), (43/5), -(34/5), (4/5), (43/5), -(8/5)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-5.115, -7.7, -9, -3, e} \\cup {0.5, -3, 1.275, -9, -6, e}$.\n", - "Output Answer": [ - "${-9, -7.7, -6, -5.115, -3, 0.5, 1.275, e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.115, -7.7, -9, -3, math.e,))\nsnd = set((0.5, -3, 1.275, -9, -6, math.e,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, 5, -3, 2}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, 5, -3, 2\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^3-2.5 x^2+1.8 x-1.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$9.25$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(0.4*x**3-2.5*x**2+1.8*x-1.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{27}{5}, \\frac{32}{5}, \\frac{32}{5}, \\frac{32}{5}, -\\frac{14}{5}, \\frac{33}{5}, -\\frac{27}{5}, -\\frac{14}{5}, -\\frac{18}{5}, -\\frac{18}{5}, -\\frac{18}{5}, \\frac{33}{5}, -\\frac{14}{5}, -\\frac{14}{5}, -\\frac{14}{5}, \\frac{32}{5}, \\frac{33}{5}, \\frac{32}{5}, \\frac{32}{5}, \\frac{33}{5}, \\frac{32}{5}, -\\frac{18}{5}, -\\frac{14}{5}, -\\frac{14}{5}, -\\frac{14}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{14}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(27/5), (32/5), (32/5), (32/5), -(14/5), (33/5), -(27/5), -(14/5), -(18/5), -(18/5), -(18/5), (33/5), -(14/5), -(14/5), -(14/5), (32/5), (33/5), (32/5), (32/5), (33/5), (32/5), -(18/5), -(14/5), -(14/5), -(14/5)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-3.22 < 4.6 x^2-3.8 x+1.4 < 7.83$ where $x \\sim $ \\text{NormalDistribution}[1.7,2.9].", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.7, 2.9)\nprint(P((-3.22 < 4.6*x**2-3.8*x+1.4) & (4.6*x**2-3.8*x+1.4 < 7.83)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -1, 8, 3, 8, 1, -7, -5, 3, 1, -5, 1, 1, -5, -7, -1, -5, -5, -5, -5, -1, 1, 8, 3, -5, -1}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -1, 8, 3, 8, 1, -7, -5, 3, 1, -5, 1, 1, -5, -7, -1, -5, -5, -5, -5, -1, 1, 8, 3, -5, -1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.061,0.148,0.126,0.229,0.165,0.104,0.072,0.055\\}$ and $\\{0.105,0.025,0.102,0.198,0.118,0.084,0.109,0.041\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.061, 0.148, 0.126, 0.229, 0.165, 0.104, 0.072, 0.055\ndistribution2 = 0.105, 0.025, 0.102, 0.198, 0.118, 0.084, 0.109, 0.041\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-16807, 6561, 10000, 81, 16}$.\n", - "Output Answer": [ - "$126 \\sqrt[5]{-1} 2^{3/5} 3^{2/5} 5^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -16807, 6561, 10000, 81, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{2}, -2, 8, -2, \\frac{11}{2}, 9, -6, 9, 9, 9, 9, 9, \\frac{11}{2}, -2, \\frac{11}{2}, 9, \\frac{11}{2}, -2, 8, 8, -6, -6}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (11/2), -2, 8, -2, (11/2), 9, -6, 9, 9, 9, 9, 9, (11/2), -2, (11/2), 9, (11/2), -2, 8, 8, -6, -6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-10, \\frac{1}{e}, -3, -4, 8} \\cup {\\frac{1}{e}, -9, 8, -3, -10, 10.}$.\n", - "Output Answer": [ - "${-10, -9, -4, -3, \\frac{1}{e}, 8, 10.}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, (1/math.e), -3, -4, 8,))\nsnd = set(((1/math.e), -9, 8, -3, -10, 10.,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, \\frac{11}{3}, 15}$.\n", - "Output Answer": [ - "$\\frac{495}{71}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, (11/3), 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{2}, -6, 6, -\\frac{13}{e}, -8, 9, -\\frac{12}{e}, 3, 7, -5, 4, \\frac{6}{\\pi }, -9, \\frac{8}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+\\frac{6}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(2), -6, 6, -(13/math.e), -8, 9, -(12/math.e), 3, 7, -5, 4, (6/math.pi), -9, (8/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${5, \\frac{38}{7}, -8, -2, 3 \\sqrt{5}, 1, 2, 8}$.", - "Output Answer": [ - "$\\frac{7}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, (38/7), -8, -2, 3*math.sqrt(5), 1, 2, 8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\log (2), 7, -\\frac{55}{7}} \\setminus {-3 e, -\\frac{55}{7}, -9, -2 \\log (2), 1}$.\n", - "Output Answer": [ - "${7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.log(2), 7, -(55/7),))\nsnd = set((-3*math.e, -(55/7), -9, -2*math.log(2), 1,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x^2+3.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.2]\n", - "Output Answer": [ - "$10.13$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(E(4.7*x**2+3.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.2 x^2+5. x+0.2$ where $x \\sim $ \\text{NormalDistribution}[1.8,1.1]\n", - "Output Answer": [ - "$27.89$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.8, 1.1)\nprint(E(4.2*x**2+5.*x+0.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, 13, 3, -2}$.\n", - "Output Answer": [ - "$\\frac{15}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, 13, 3, -2\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-e, -\\frac{8}{\\sqrt{5}}, \\frac{3}{\\sqrt{\\pi }}, 1, 7, 5, -6, 1, \\frac{27}{4}, -9 \\log (2), -5, 0}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.e, -(8/(math.sqrt(5))), (3/(math.sqrt(math.pi))), 1, 7, 5, -6, 1, (27/4), -9*math.log(2), -5, 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, \\frac{17}{\\sqrt{3}}, 1, -\\frac{15}{4}, -2, -5, -3, -5, 3 \\sqrt{3}, -6, -6, 10, 7, -2 e}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (17/(math.sqrt(3))), 1, -(15/4), -2, -5, -3, -5, 3*math.sqrt(3), -6, -6, 10, 7, -2*math.e\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{14}{e}, -\\frac{23}{\\pi }, -1, -7, -\\frac{6}{7}} \\cup {-3, -\\frac{14}{e}, -7, \\sqrt{2}, 3 \\sqrt{5}, -1}$.\n", - "Output Answer": [ - "${-\\frac{23}{\\pi }, -7, -\\frac{14}{e}, -3, -1, -\\frac{6}{7}, \\sqrt{2}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(14/math.e), -(23/math.pi), -1, -7, -(6/7),))\nsnd = set((-3, -(14/math.e), -7, math.sqrt(2), 3*math.sqrt(5), -1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{4}{7}, \\frac{7}{\\sqrt{5}}, -\\sqrt{2}, \\frac{5}{3}, -4}$.\n", - "Output Answer": [ - "$4+\\frac{7}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(4/7), (7/(math.sqrt(5))), -math.sqrt(2), (5/3), -4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, -10, -10, -10, 5, 1, 5, 1, -10, 2, 2, 2, 1, -10, 5, 1, 5, 2, 1, 1, 2, 1, 5, -7, -10, 1, 2}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, -10, -10, -10, 5, 1, 5, 1, -10, 2, 2, 2, 1, -10, 5, 1, 5, 2, 1, 1, 2, 1, 5, -7, -10, 1, 2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, -2, -2, 5, 5, -2, -2, 3, 3, -2, -8, -2, 3, -2, 3, 5, 3, 3, -8, 3, 3, -2}$.\n", - "Output Answer": [ - "$\\{-2,3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, -2, -2, 5, 5, -2, -2, 3, 3, -2, -8, -2, 3, -2, 3, 5, 3, 3, -8, 3, 3, -2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\pi, 2 \\sqrt{5}, -\\frac{12}{\\sqrt{\\pi }}, -8, -3, 8, 7, 0}$.", - "Output Answer": [ - "$\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.pi, 2*math.sqrt(5), -(12/(math.sqrt(math.pi))), -8, -3, 8, 7, 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^2-3.6 x+3.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.]\n", - "Output Answer": [ - "$13.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(E(1.3*x**2-3.6*x+3.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6 \\sqrt{3}, 2 \\sqrt{3}, \\sqrt{3}, -\\sqrt{3}, 3 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{9 \\sqrt{3}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 6*math.sqrt(3), 2*math.sqrt(3), math.sqrt(3), -math.sqrt(3), 3*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{52}{3}, 15}$.\n", - "Output Answer": [ - "$\\frac{1560}{97}$" - ], - "Output Program": [ - "import statistics\nvalues = (52/3), 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${10, 8, 5, 0, -1, -8}$.\n", - "Output Answer": [ - "$\\frac{7}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 10, 8, 5, 0, -1, -8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.49,0.21,0.085\\}$ and $\\{0.334,0.334,0.144\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.49, 0.21, 0.085\ndistribution2 = 0.334, 0.334, 0.144\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -12, -9, -7, 11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{177}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -12, -9, -7, 11\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.102,0.078,0.38,0.328\\}$ and $\\{0.428,0.101,0.073,0.049\\}$.", - "Output Answer": [ - "$0.91$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.102, 0.078, 0.38, 0.328\ndistribution2 = 0.428, 0.101, 0.073, 0.049\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, -2 \\sqrt{2}, 0.65, -\\frac{4}{e}, -\\frac{25}{\\pi }, -8.681, -9, -4, 3} \\cup {-2 \\sqrt{2}, -6.49, -\\frac{4}{e}, -9, 0, 3, -1.667, 5, -\\frac{25}{\\pi }}$.\n", - "Output Answer": [ - "${-9, -8.681, -\\frac{25}{\\pi }, -6.49, -4, -2 \\sqrt{2}, -1.667, -\\frac{4}{e}, 0, 0.65, 3, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -2*math.sqrt(2), 0.65, -(4/math.e), -(25/math.pi), -8.681, -9, -4, 3,))\nsnd = set((-2*math.sqrt(2), -6.49, -(4/math.e), -9, 0, 3, -1.667, 5, -(25/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, -5, -15, 12, 15, -13}$.\n", - "Output Answer": [ - "$\\frac{1567}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -5, -15, 12, 15, -13\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 6, -7, 6, -7, 2, -2, 6, 2, 6, -2, -2, -7, -7, -7, -7, -2, 6, 2, 6, 6, -2}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 6, -7, 6, -7, 2, -2, 6, 2, 6, -2, -2, -7, -7, -7, -7, -2, 6, 2, 6, 6, -2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 6, -\\frac{11}{\\sqrt{2}}, -1.3, -1.773} \\setminus {\\frac{7}{\\sqrt{3}}, -1.3, -3, -\\frac{11}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-8, -1.773, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 6, -(11/(math.sqrt(2))), -1.3, -1.773,))\nsnd = set(((7/(math.sqrt(3))), -1.3, -3, -(11/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, 8, -\\frac{22}{\\pi }, -3} \\setminus {10, 4, -\\frac{22}{\\pi }, 8}$.\n", - "Output Answer": [ - "${-3, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 8, -(22/math.pi), -3,))\nsnd = set((10, 4, -(22/math.pi), 8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{2}, 4, -\\frac{8}{\\sqrt{\\pi }}, 0, -2, 2, \\pi, -5, 3, -\\frac{26}{7}}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(2), 4, -(8/(math.sqrt(math.pi))), 0, -2, 2, math.pi, -5, 3, -(26/7)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, -12, 11, -9, 13, -12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{4601}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -12, 11, -9, 13, -12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{13}{3}, -8, -\\frac{46}{7}, -9} \\cup {-\\frac{13}{3}, 5, -8, -\\frac{46}{7}, -5}$.\n", - "Output Answer": [ - "${-9, -8, -\\frac{46}{7}, -5, -\\frac{13}{3}, 5}$" - ], - "Output Program": [ - "fst = set((-(13/3), -8, -(46/7), -9,))\nsnd = set((-(13/3), 5, -8, -(46/7), -5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, 0, 10 \\log (2), 0, -5, 4 \\sqrt{5}, -\\frac{30}{7}, -8, -\\frac{15}{\\sqrt{\\pi }}, -6, 9}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 0, 10*math.log(2), 0, -5, 4*math.sqrt(5), -(30/7), -8, -(15/(math.sqrt(math.pi))), -6, 9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-12 \\log (2), 0, -5}$.\n", - "Output Answer": [ - "${-12 \\log (2), -5, 0}$" - ], - "Output Program": [ - "import math\n\nvalues = -12*math.log(2), 0, -5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${6 \\sqrt{2}, -3, -8, -6 \\sqrt{2}, 3 e, 2 \\sqrt{3}, -3 \\sqrt{2}, -3 \\sqrt{5}, -2, -\\frac{9}{e}}$.\n", - "Output Answer": [ - "$12 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 6*math.sqrt(2), -3, -8, -6*math.sqrt(2), 3*math.e, 2*math.sqrt(3), -3*math.sqrt(2), -3*math.sqrt(5), -2, -(9/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x^2+0.2 x+3.2$ where $x \\sim $ \\text{NormalDistribution}[0.6,0.7]\n", - "Output Answer": [ - "$1.36$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.6, 0.7)\nprint(E(-2.3*x**2+0.2*x+3.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.6 x^2-1.3 x-2.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$-4.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(-0.6*x**2-1.3*x-2.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{24}{\\pi }, 5, 7, -\\pi, 13 \\log (2), \\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\pi, \\frac{1}{\\sqrt{2}}, 5, 7, \\frac{24}{\\pi }, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = (24/math.pi), 5, 7, -math.pi, 13*math.log(2), (1/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${4, 2, 5.785} \\cup {5.785, 1, 2, 3, 4}$.\n", - "Output Answer": [ - "${1, 2, 3, 4, 5.785}$" - ], - "Output Program": [ - "fst = set((4, 2, 5.785,))\nsnd = set((5.785, 1, 2, 3, 4,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{14}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{14}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (14/(math.sqrt(3))), (7/(math.sqrt(3))), -(13/(math.sqrt(3))), -(13/(math.sqrt(3))), (14/(math.sqrt(3))), -(1/(math.sqrt(3))), (7/(math.sqrt(3))), -(17/(math.sqrt(3))), -(1/(math.sqrt(3))), -(13/(math.sqrt(3))), (14/(math.sqrt(3))), (14/(math.sqrt(3))), -(13/(math.sqrt(3))), -(1/(math.sqrt(3))), -(13/(math.sqrt(3))), (14/(math.sqrt(3))), -(17/(math.sqrt(3))), -(1/(math.sqrt(3))), (14/(math.sqrt(3))), -(13/(math.sqrt(3))), -(17/(math.sqrt(3))), (14/(math.sqrt(3))), (7/(math.sqrt(3))), (14/(math.sqrt(3))), (14/(math.sqrt(3))), (7/(math.sqrt(3))), -(1/(math.sqrt(3))), -(13/(math.sqrt(3))), -(17/(math.sqrt(3))), -(17/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2.68, -8, 4, -8 \\log (2), -\\frac{14}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{3}}, 5} \\setminus {-8, -6, 4, -\\frac{14}{\\sqrt{\\pi }}, 5, -1, -2.68, 5 \\log (2)}$.\n", - "Output Answer": [ - "${-8 \\log (2), \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2.68, -8, 4, -8*math.log(2), -(14/(math.sqrt(math.pi))), (16/(math.sqrt(3))), 5,))\nsnd = set((-8, -6, 4, -(14/(math.sqrt(math.pi))), 5, -1, -2.68, 5*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{29}{5}, -7, 2, -1}$.\n", - "Output Answer": [ - "${-7, -1, 2, \\frac{29}{5}}$" - ], - "Output Program": [ - "values = (29/5), -7, 2, -1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{12}{\\pi }, 8, -4, 3, -5, \\frac{11}{\\sqrt{2}}, 3}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (12/math.pi), 8, -4, 3, -5, (11/(math.sqrt(2))), 3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 5, -3}$.\n", - "Output Answer": [ - "$-\\frac{7}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 5, -3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-5.59, -6, -3 e, -6.45, -\\frac{11}{e}}$.\n", - "Output Answer": [ - "${-3 e, -6.45, -6, -5.59, -\\frac{11}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5.59, -6, -3*math.e, -6.45, -(11/math.e)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 9, \\frac{35}{2}}$.\n", - "Output Answer": [ - "$\\frac{945}{88}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 9, (35/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{17}{\\pi }, 6, \\frac{46}{5}} \\cup {\\frac{31}{5}, -\\frac{17}{\\pi }, 6}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\pi }, 6, \\frac{31}{5}, \\frac{46}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(17/math.pi), 6, (46/5),))\nsnd = set(((31/5), -(17/math.pi), 6,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{18}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}, 7, 6, 7 \\sqrt{2}, 0, \\frac{6}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{5}}, -10, -9, \\frac{18}{\\pi }, 5 \\sqrt{2}, 6}$.", - "Output Answer": [ - "$\\frac{18}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (18/(math.sqrt(5))), -(21/(math.sqrt(5))), 7, 6, 7*math.sqrt(2), 0, (6/(math.sqrt(math.pi))), -(12/(math.sqrt(5))), -10, -9, (18/math.pi), 5*math.sqrt(2), 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, 216, 64, -243, 100000, 1}$.\n", - "Output Answer": [ - "$12\\ 5^{5/6} \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 216, 64, -243, 100000, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 16, 6}$.\n", - "Output Answer": [ - "$8 \\sqrt[3]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 16, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 3, 3, \\frac{4}{3}, 0, 3 \\log (2), -\\frac{21}{4}, -3, 10, -3, -\\frac{28}{\\pi }, 0, \\frac{41}{5}}$.\n", - "Output Answer": [ - "$10+\\frac{28}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 3, 3, (4/3), 0, 3*math.log(2), -(21/4), -3, 10, -3, -(28/math.pi), 0, (41/5)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-7, 9, 3 \\pi, -\\frac{12}{e}}$.\n", - "Output Answer": [ - "${-7, -\\frac{12}{e}, 9, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 9, 3*math.pi, -(12/math.e)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{29}{3}, -4, -8, -5} \\cup {-4, -5, \\frac{23}{3}, -8}$.\n", - "Output Answer": [ - "${-8, -5, -4, \\frac{23}{3}, \\frac{29}{3}}$" - ], - "Output Program": [ - "fst = set(((29/3), -4, -8, -5,))\nsnd = set((-4, -5, (23/3), -8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, 0, -6, 3, -11, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2753}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, 0, -6, 3, -11, 12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{16}{3}, 0, -5, -2 \\sqrt{2}, -4.1}$.\n", - "Output Answer": [ - "${-\\frac{16}{3}, -5, -4.1, -2 \\sqrt{2}, 0}$" - ], - "Output Program": [ - "import math\n\nvalues = -(16/3), 0, -5, -2*math.sqrt(2), -4.1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-1, \\frac{3}{\\sqrt{2}}, -8, -7.5} \\cup {\\frac{3}{\\sqrt{2}}, -1, 1, -4.7}$.\n", - "Output Answer": [ - "${-8, -7.5, -4.7, -1, 1, \\frac{3}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, (3/(math.sqrt(2))), -8, -7.5,))\nsnd = set(((3/(math.sqrt(2))), -1, 1, -4.7,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 14, 13, 4, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{457}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 14, 13, 4, 0\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -10, -7, -9, -9, -4}$.\n", - "Output Answer": [ - "$-\\frac{15}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -10, -7, -9, -9, -4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-1.23 < 3.2 x+4.1 < 0.33$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8].", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(P((-1.23 < 3.2*x+4.1) & (3.2*x+4.1 < 0.33)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.079,0.035,0.061,0.106,0.009,0.118,0.444,0.014\\}$ and $\\{0.083,0.159,0.041,0.041,0.05,0.243,0.101,0.17\\}$.", - "Output Answer": [ - "$0.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.079, 0.035, 0.061, 0.106, 0.009, 0.118, 0.444, 0.014\ndistribution2 = 0.083, 0.159, 0.041, 0.041, 0.05, 0.243, 0.101, 0.17\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, 11, \\frac{31}{2}, 17}$.\n", - "Output Answer": [ - "$\\frac{371008}{25669}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, 11, (31/2), 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, 0, -13, -12, -5, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1073}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 0, -13, -12, -5, -15\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x+1.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$1.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(1.1*x+1.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{9}{\\sqrt{\\pi }}, -5, -\\frac{21}{4}, 10, 3}$.\n", - "Output Answer": [ - "${-\\frac{21}{4}, -5, 3, \\frac{9}{\\sqrt{\\pi }}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/(math.sqrt(math.pi))), -5, -(21/4), 10, 3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, \\frac{18}{\\sqrt{5}}, -2, 4 \\sqrt{3}, -\\sqrt{5}, 7, -7, -9, -6 \\sqrt{2}, 8, 7, -1}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 10, (18/(math.sqrt(5))), -2, 4*math.sqrt(3), -math.sqrt(5), 7, -7, -9, -6*math.sqrt(2), 8, 7, -1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, -3 \\sqrt{3}, 4, -4 \\sqrt{3}, \\frac{19}{2}, 2, \\frac{1}{2}, -\\frac{51}{7}, -10, 8, -10, 0, -10, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -3*math.sqrt(3), 4, -4*math.sqrt(3), (19/2), 2, (1/2), -(51/7), -10, 8, -10, 0, -10, 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3, 81, 64, 7776, 1024, 9}$.\n", - "Output Answer": [ - "$72 \\sqrt[6]{-1} \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 81, 64, 7776, 1024, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{4}{\\pi }, -\\sqrt{3}, 5, -e, 8, -5, -12 \\log (2), 3}$.\n", - "Output Answer": [ - "$8+12 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = (4/math.pi), -math.sqrt(3), 5, -math.e, 8, -5, -12*math.log(2), 3\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{3}, 1, \\frac{26}{7}, -8, 2, 0, -8, -7, -6, 4, 2, -\\frac{23}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(3), 1, (26/7), -8, 2, 0, -8, -7, -6, 4, 2, -(23/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -15, -5, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{278}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -15, -5, 0\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 4, -8, 7, -1, -8, -8, -1, -4, 7, -8, -8, -4, -4, -1, -4, -1, -8, -1, -5, 7, -5, -8, 4, -4, -1, -5, -5}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 4, -8, 7, -1, -8, -8, -1, -4, 7, -8, -8, -4, -4, -1, -4, -1, -8, -1, -5, 7, -5, -8, 4, -4, -1, -5, -5\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{8}{5}, 2, 0, \\frac{39}{4}} \\setminus {0, \\frac{39}{4}, \\frac{34}{5}, \\frac{29}{3}}$.\n", - "Output Answer": [ - "${-\\frac{8}{5}, 2}$" - ], - "Output Program": [ - "fst = set((-(8/5), 2, 0, (39/4),))\nsnd = set((0, (39/4), (34/5), (29/3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\sqrt{3}, 8}$.\n", - "Output Answer": [ - "$8-\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(3), 8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 6, 5 \\log (2), 0, -3, -8, 2.11} \\cup {5 \\log (2), 2.11, -7, -3, 9, 5, 6}$.\n", - "Output Answer": [ - "${-8, -7, -3, -2, 0, 2.11, 5 \\log (2), 5, 6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 6, 5*math.log(2), 0, -3, -8, 2.11,))\nsnd = set((5*math.log(2), 2.11, -7, -3, 9, 5, 6,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{1}{e}, 1, -10, -7, 8.72, 0}$.\n", - "Output Answer": [ - "${-10, -7, -\\frac{1}{e}, 0, 1, 8.72}$" - ], - "Output Program": [ - "import math\n\nvalues = -(1/math.e), 1, -10, -7, 8.72, 0\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -8, \\frac{9}{2}, 2, \\frac{4}{\\pi }, 10, \\frac{1}{e}, -6}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -8, (9/2), 2, (4/math.pi), 10, (1/math.e), -6\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, -5, 8, -2 \\pi, -3 e, 3, -\\frac{23}{\\pi }, -1.8} \\setminus {-5, -1.8, 3, -2 \\pi, 8, e, -\\frac{18}{\\pi }, \\frac{17}{5}, 0}$.\n", - "Output Answer": [ - "${-3 e, -\\frac{23}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -5, 8, -2*math.pi, -3*math.e, 3, -(23/math.pi), -1.8,))\nsnd = set((-5, -1.8, 3, -2*math.pi, 8, math.e, -(18/math.pi), (17/5), 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{28}{\\pi }, -6, 4, 5, -8, \\frac{37}{5}, 3 e, -7}$.\n", - "Output Answer": [ - "$8+\\frac{28}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (28/math.pi), -6, 4, 5, -8, (37/5), 3*math.e, -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{12}{7}, -2, -5, 1, -2 \\sqrt{2}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(12/7), -2, -5, 1, -2*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\pi, 0, -2, -7, -3, 13 \\log (2), \\pi, -5} \\cup {0, 13 \\log (2), -1, \\pi, -9, 8, 3 \\pi, 10, -5}$.\n", - "Output Answer": [ - "${-9, -7, -5, -3, -2, -1, 0, \\pi, 8, 13 \\log (2), 3 \\pi, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, 0, -2, -7, -3, 13*math.log(2), math.pi, -5,))\nsnd = set((0, 13*math.log(2), -1, math.pi, -9, 8, 3*math.pi, 10, -5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, \\frac{10}{e}, 2}$.\n", - "Output Answer": [ - "$3+\\frac{10}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, (10/math.e), 2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 8, 1, 8}$.\n", - "Output Answer": [ - "$\\frac{25}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 8, 1, 8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{17}{3}, \\frac{10}{3}, \\frac{10}{3}, -8, \\frac{17}{3}, \\frac{17}{3}, \\frac{17}{3}, \\frac{10}{3}, -8, \\frac{10}{3}, -8, \\frac{10}{3}, -8, -8, -8, \\frac{17}{3}, \\frac{10}{3}, \\frac{17}{3}, \\frac{10}{3}, -\\frac{5}{3}, -8, -8, -\\frac{5}{3}, \\frac{10}{3}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{10}{3},-8\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (17/3), (10/3), (10/3), -8, (17/3), (17/3), (17/3), (10/3), -8, (10/3), -8, (10/3), -8, -8, -8, (17/3), (10/3), (17/3), (10/3), -(5/3), -8, -8, -(5/3), (10/3)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{43}{5}, -4 \\sqrt{3}, 3}$.", - "Output Answer": [ - "$-4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(43/5), -4*math.sqrt(3), 3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{7}{\\sqrt{2}}, 0, 2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, 0, -\\frac{7}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, 0, 0, -\\frac{1}{\\sqrt{2}}, 2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, 0, -\\frac{7}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, 2 \\sqrt{2}, 2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, 2 \\sqrt{2}, 2 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{7}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(7/(math.sqrt(2))), 0, 2*math.sqrt(2), (1/(math.sqrt(2))), -(7/(math.sqrt(2))), 0, -(7/(math.sqrt(2))), (1/(math.sqrt(2))), (1/(math.sqrt(2))), 0, 0, -(1/(math.sqrt(2))), 2*math.sqrt(2), (1/(math.sqrt(2))), -(1/(math.sqrt(2))), -(1/(math.sqrt(2))), (1/(math.sqrt(2))), -(7/(math.sqrt(2))), 0, -(7/(math.sqrt(2))), -(7/(math.sqrt(2))), 2*math.sqrt(2), 2*math.sqrt(2), (1/(math.sqrt(2))), -(7/(math.sqrt(2))), -(7/(math.sqrt(2))), 2*math.sqrt(2), 2*math.sqrt(2), -(7/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${7, -4}$.\n", - "Output Answer": [ - "$\\frac{121}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -4\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.035,0.243,0.213,0.104,0.203,0.125,0.014\\}$ and $\\{0.239,0.002,0.041,0.192,0.031,0.246,0.246\\}$.", - "Output Answer": [ - "$1.82$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.035, 0.243, 0.213, 0.104, 0.203, 0.125, 0.014\ndistribution2 = 0.239, 0.002, 0.041, 0.192, 0.031, 0.246, 0.246\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${1, -1, -5, -\\frac{7}{\\sqrt{2}}, -6 \\sqrt{2}, \\frac{1}{\\sqrt{3}}, 2}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -5, -\\frac{7}{\\sqrt{2}}, -1, \\frac{1}{\\sqrt{3}}, 1, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -1, -5, -(7/(math.sqrt(2))), -6*math.sqrt(2), (1/(math.sqrt(3))), 2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{34}{7}, -3 \\sqrt{5}, -1, -8, \\frac{7}{e}, \\sqrt{3}, \\frac{27}{\\pi }, -1}$.\n", - "Output Answer": [ - "${-8, -3 \\sqrt{5}, -1, -1, \\sqrt{3}, \\frac{7}{e}, \\frac{34}{7}, \\frac{27}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (34/7), -3*math.sqrt(5), -1, -8, (7/math.e), math.sqrt(3), (27/math.pi), -1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.2 x^2-0.1 x-4.2$ where $x \\sim $ \\text{PoissonDistribution}[3.6]\n", - "Output Answer": [ - "$-74.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.6)\nprint(E(-4.2*x**2-0.1*x-4.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{3}, 2, 8 \\log (2), -7.54, -3 e, 2}$.\n", - "Output Answer": [ - "${-3 e, -7.54, 2, 2, 2 \\sqrt{3}, 8 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(3), 2, 8*math.log(2), -7.54, -3*math.e, 2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4, 3, -5, 5, -5 \\sqrt{2}, 4.891} \\setminus {8, -7.869, -5 \\sqrt{2}, 3, 10, 5}$.\n", - "Output Answer": [ - "${-5, -4, 4.891}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 3, -5, 5, -5*math.sqrt(2), 4.891,))\nsnd = set((8, -7.869, -5*math.sqrt(2), 3, 10, 5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.7 x^3-1. x^2+3.9 x-3.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-3.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(-1.7*x**3-1.*x**2+3.9*x-3.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, -64, 2401, 1, 343, 6}$.\n", - "Output Answer": [ - "$14 \\sqrt[6]{-6} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -64, 2401, 1, 343, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -1, -1, 8, 7, -1, 6, 7, 7, 7, -5, -5, -1, 7, 7, 6, 8, -5, 7, -1, -1, 7, -5, 6}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -1, -1, 8, 7, -1, 6, 7, 7, 7, -5, -5, -1, 7, 7, 6, 8, -5, 7, -1, -1, 7, -5, 6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -5, \\frac{11}{e}, 3, -\\frac{26}{e}, 0} \\setminus {-\\frac{26}{e}, -6, -5, 0, \\frac{11}{e}}$.\n", - "Output Answer": [ - "${-7, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -5, (11/math.e), 3, -(26/math.e), 0,))\nsnd = set((-(26/math.e), -6, -5, 0, (11/math.e),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4, -\\frac{15}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4-\\frac{15}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -(15/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 8, -27, 343}$.\n", - "Output Answer": [ - "$2 \\sqrt[4]{-1} 42^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 8, -27, 343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, 4, -5, 7, \\sqrt{5}, 6, 4, -\\frac{8}{3}}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 4, -5, 7, math.sqrt(5), 6, 4, -(8/3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-5, 2, 3 \\sqrt{5}, 1, -6, -\\frac{21}{e}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, 2, 3*math.sqrt(5), 1, -6, -(21/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-7, 8 \\log (2), -\\frac{7}{\\sqrt{\\pi }}, \\frac{50}{7}, \\frac{12}{\\sqrt{\\pi }}, 3, -\\frac{43}{7}, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-7, -\\frac{43}{7}, -\\frac{7}{\\sqrt{\\pi }}, 3, 8 \\log (2), \\frac{12}{\\sqrt{\\pi }}, 10 \\log (2), \\frac{50}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 8*math.log(2), -(7/(math.sqrt(math.pi))), (50/7), (12/(math.sqrt(math.pi))), 3, -(43/7), 10*math.log(2)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{10}{3}, 3, 13}$.\n", - "Output Answer": [ - "$\\frac{1170}{277}$" - ], - "Output Program": [ - "import statistics\nvalues = (10/3), 3, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-8, 5, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-8, 5, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 5, 4*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x-2.9$ where $x \\sim $ \\text{PoissonDistribution}[1.]\n", - "Output Answer": [ - "$-0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.)\nprint(E(2.8*x-2.9))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-e, -\\frac{7}{\\pi }, -3, 1} \\cup {2 e, 3, 1, \\frac{5}{\\pi }, -3}$.\n", - "Output Answer": [ - "${-3, -e, -\\frac{7}{\\pi }, 1, \\frac{5}{\\pi }, 3, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.e, -(7/math.pi), -3, 1,))\nsnd = set((2*math.e, 3, 1, (5/math.pi), -3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-1, -\\frac{6}{7}, 7, -\\frac{22}{\\sqrt{5}}, \\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{22}{\\sqrt{5}}, -1, -\\frac{6}{7}, \\frac{4}{\\sqrt{3}}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -(6/7), 7, -(22/(math.sqrt(5))), (4/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.379,0.221,0.356\\}$ and $\\{0.215,0.132,0.168\\}$.", - "Output Answer": [ - "$0.$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.379, 0.221, 0.356\ndistribution2 = 0.215, 0.132, 0.168\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\sqrt{5}, 3 \\sqrt{5}, -4 \\sqrt{5}, 0, 3 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{6 \\sqrt{5}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.sqrt(5), 3*math.sqrt(5), -4*math.sqrt(5), 0, 3*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 1000, 1296, -100000, -1024, 1000}$.\n", - "Output Answer": [ - "$240 \\sqrt[6]{2} \\sqrt[3]{3} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 1000, 1296, -100000, -1024, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{2}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{1}{3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(2/(math.sqrt(3))), -(4/(math.sqrt(3))), (7/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${6 \\sqrt{3}, 7 \\sqrt{2}, -\\frac{28}{\\pi }, 8, 3} \\cup {7 \\sqrt{2}, 6 \\sqrt{3}, -\\frac{10}{\\pi }, 3}$.\n", - "Output Answer": [ - "${-\\frac{28}{\\pi }, -\\frac{10}{\\pi }, 3, 8, 7 \\sqrt{2}, 6 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6*math.sqrt(3), 7*math.sqrt(2), -(28/math.pi), 8, 3,))\nsnd = set((7*math.sqrt(2), 6*math.sqrt(3), -(10/math.pi), 3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -1, 2, -7, 2, 2, -1, -7, 2, -7, 2, -7, -7, -7, 3, -7, 3, 2, 3, -1, 2, -1}$.\n", - "Output Answer": [ - "$\\{2,-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -1, 2, -7, 2, 2, -1, -7, 2, -7, 2, -7, -7, -7, 3, -7, 3, 2, 3, -1, 2, -1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{17}{5}, -8, -\\sqrt{3}, -2, 1, 7} \\cup {-5 \\sqrt{3}, -2, -8, \\frac{26}{5}, -5, 0}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -8, -5, -\\frac{17}{5}, -2, -\\sqrt{3}, 0, 1, \\frac{26}{5}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(17/5), -8, -math.sqrt(3), -2, 1, 7,))\nsnd = set((-5*math.sqrt(3), -2, -8, (26/5), -5, 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 \\log (2), 6, -6, -13 \\log (2), 10, 3 e, 1, \\frac{8}{\\pi }, -2 \\pi, -\\frac{3}{\\sqrt{5}}, -3, \\frac{62}{7}}$.\n", - "Output Answer": [ - "$10+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.log(2), 6, -6, -13*math.log(2), 10, 3*math.e, 1, (8/math.pi), -2*math.pi, -(3/(math.sqrt(5))), -3, (62/7)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.2,0.045,0.063,0.106,0.159,0.096,0.09,0.151\\}$ and $\\{0.001,0.127,0.034,0.123,0.027,0.074,0.007,0.446\\}$.", - "Output Answer": [ - "$1.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.2, 0.045, 0.063, 0.106, 0.159, 0.096, 0.09, 0.151\ndistribution2 = 0.001, 0.127, 0.034, 0.123, 0.027, 0.074, 0.007, 0.446\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{1}{2}, 0, 1, 5 \\sqrt{2}, -8, -2, 7, -7 \\sqrt{2}}$.", - "Output Answer": [ - "$-\\frac{1}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(1/2), 0, 1, 5*math.sqrt(2), -8, -2, 7, -7*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 6, 19, 6}$.\n", - "Output Answer": [ - "$\\frac{1140}{167}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 6, 19, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -6, -7, -2, 4, 1}$.\n", - "Output Answer": [ - "$-\\frac{7}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -6, -7, -2, 4, 1\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-5.23 < 0.8 x+2.8 < 0.52$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9].", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(P((-5.23 < 0.8*x+2.8) & (0.8*x+2.8 < 0.52)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.478,0.143,0.003,0.158\\}$ and $\\{0.22,0.213,0.191,0.128\\}$.", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.478, 0.143, 0.003, 0.158\ndistribution2 = 0.22, 0.213, 0.191, 0.128\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${1, -3, 8, 0, -4, -6} \\cap {1, 0, 10, -4, -6}$.\n", - "Output Answer": [ - "${-6, -4, 0, 1}$" - ], - "Output Program": [ - "fst = set((1, -3, 8, 0, -4, -6,))\nsnd = set((1, 0, 10, -4, -6,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, -2, 0, 1, 4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{453}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -2, 0, 1, 4\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, 2, 1, 4, 46656, -216}$.\n", - "Output Answer": [ - "$12 \\sqrt[3]{2} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 2, 1, 4, 46656, -216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x-0.8$ where $x \\sim $ \\text{NormalDistribution}[0.1,1.5]\n", - "Output Answer": [ - "$-0.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.1, 1.5)\nprint(E(2.*x-0.8))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-13, 10, 0, 0, 12, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2573}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 10, 0, 0, 12, 8\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -8, -4, 12 \\log (2), \\frac{3}{5}} \\setminus {\\frac{3}{5}, -7, 1, -8}$.\n", - "Output Answer": [ - "${-4, -2, 12 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -8, -4, 12*math.log(2), (3/5),))\nsnd = set(((3/5), -7, 1, -8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{12}{5}, 4 \\sqrt{5}, -2 e, -3 \\sqrt{2}, -\\frac{22}{\\pi }, \\frac{11}{2}, -10, \\sqrt{3}, \\frac{19}{2}, -6} \\cup {-\\frac{22}{\\pi }, -10, 1, \\sqrt{3}, -4, -\\frac{47}{5}, -6, -2 e, 2 \\sqrt{2}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-10, -\\frac{47}{5}, -\\frac{22}{\\pi }, -6, -2 e, -3 \\sqrt{2}, -4, -\\frac{12}{5}, 1, \\sqrt{3}, 2 \\sqrt{2}, \\frac{11}{2}, 4 \\sqrt{5}, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(12/5), 4*math.sqrt(5), -2*math.e, -3*math.sqrt(2), -(22/math.pi), (11/2), -10, math.sqrt(3), (19/2), -6,))\nsnd = set((-(22/math.pi), -10, 1, math.sqrt(3), -4, -(47/5), -6, -2*math.e, 2*math.sqrt(2), 4*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1024, 5, 36, -1, -216}$.\n", - "Output Answer": [ - "$24 \\sqrt[5]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1024, 5, 36, -1, -216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2 e, 4 e, -10, 9, -2, 2 \\sqrt{5}} \\setminus {4 \\sqrt{5}, -2 e, 0, \\frac{17}{2}, 4 e}$.\n", - "Output Answer": [ - "${-10, -2, 2 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, 4*math.e, -10, 9, -2, 2*math.sqrt(5),))\nsnd = set((4*math.sqrt(5), -2*math.e, 0, (17/2), 4*math.e,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x+1.8$ where $x \\sim $ \\text{BetaDistribution}[1.2,1.6]\n", - "Output Answer": [ - "$2.66$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.2, 1.6)\nprint(E(2.*x+1.8))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-5.469, 1, -7, 4, \\frac{15}{e}, 7, \\frac{9}{\\sqrt{2}}} \\cup {-\\frac{11}{\\sqrt{2}}, 9, 4, \\frac{15}{e}, -8, -3.109, -7}$.\n", - "Output Answer": [ - "${-8, -\\frac{11}{\\sqrt{2}}, -7, -5.469, -3.109, 1, 4, \\frac{15}{e}, \\frac{9}{\\sqrt{2}}, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.469, 1, -7, 4, (15/math.e), 7, (9/(math.sqrt(2))),))\nsnd = set((-(11/(math.sqrt(2))), 9, 4, (15/math.e), -8, -3.109, -7,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x^2+0.1 x-5.7$ where $x \\sim $ \\text{PoissonDistribution}[0.7]\n", - "Output Answer": [ - "$-1.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.7)\nprint(E(3.3*x**2+0.1*x-5.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 4, -4}$.\n", - "Output Answer": [ - "$\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 4, -4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 7, -3, 3, -\\frac{23}{4}, 4, -4 \\sqrt{2}, -4} \\cup {-4 \\sqrt{2}, 0, -\\frac{9}{4}, 5.7, -4, -10, -7, 3}$.\n", - "Output Answer": [ - "${-10, -9, -7, -\\frac{23}{4}, -4 \\sqrt{2}, -4, -3, -\\frac{9}{4}, 0, 3, 4, 5.7, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 7, -3, 3, -(23/4), 4, -4*math.sqrt(2), -4,))\nsnd = set((-4*math.sqrt(2), 0, -(9/4), 5.7, -4, -10, -7, 3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.9 x^2-3.2 x-0.7$ where $x \\sim $ \\text{PoissonDistribution}[3.6]\n", - "Output Answer": [ - "$-93.36$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.6)\nprint(E(-4.9*x**2-3.2*x-0.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.188,0.12,0.256,0.222,0.174\\}$ and $\\{0.037,0.371,0.137,0.217,0.172\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.188, 0.12, 0.256, 0.222, 0.174\ndistribution2 = 0.037, 0.371, 0.137, 0.217, 0.172\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{47}{3}}$.\n", - "Output Answer": [ - "$\\frac{611}{43}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (47/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 e, -3 e, -3 e, -2 e, -e, -2 e, -e, e, -2 e, e, e, -e, e, e, -2 e, -e, -3 e, -e, -2 e, -e, -e, e}$.\n", - "Output Answer": [ - "$\\{-e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.e, -3*math.e, -3*math.e, -2*math.e, -math.e, -2*math.e, -math.e, math.e, -2*math.e, math.e, math.e, -math.e, math.e, math.e, -2*math.e, -math.e, -3*math.e, -math.e, -2*math.e, -math.e, -math.e, math.e\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{6}{e}, -\\frac{21}{e}, \\frac{18}{e}, \\frac{16}{e}, -\\frac{13}{e}, -\\frac{16}{e}, -\\frac{2}{e}, \\frac{26}{e}}$.\n", - "Output Answer": [ - "$\\frac{1}{4 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(6/math.e), -(21/math.e), (18/math.e), (16/math.e), -(13/math.e), -(16/math.e), -(2/math.e), (26/math.e)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{2}, 6 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, 4 \\sqrt{2}, 6 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, 4 \\sqrt{2}, -2 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, 4 \\sqrt{2}, -2 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, -2 \\sqrt{2}, 4 \\sqrt{2}, 6 \\sqrt{2}, -2 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(2), 6*math.sqrt(2), -(13/(math.sqrt(2))), 4*math.sqrt(2), 6*math.sqrt(2), -(7/(math.sqrt(2))), -(13/(math.sqrt(2))), 4*math.sqrt(2), -2*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), -(13/(math.sqrt(2))), -(13/(math.sqrt(2))), 4*math.sqrt(2), -2*math.sqrt(2), -(13/(math.sqrt(2))), -2*math.sqrt(2), 4*math.sqrt(2), 6*math.sqrt(2), -2*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), 6*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${1, 4, 5, 11 \\log (2), -\\frac{20}{3}}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 4, 5, 11*math.log(2), -(20/3)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x^2-1. x+0.3$ where $x \\sim $ \\text{PoissonDistribution}[2.1]\n", - "Output Answer": [ - "$13.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.1)\nprint(E(2.4*x**2-1.*x+0.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.119,0.121,0.068,0.06,0.133,0.164\\}$ and $\\{0.176,0.208,0.11,0.162,0.263,0.029\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.119, 0.121, 0.068, 0.06, 0.133, 0.164\ndistribution2 = 0.176, 0.208, 0.11, 0.162, 0.263, 0.029\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{55}{3}, \\frac{25}{3}, \\frac{2}{3}, 15}$.\n", - "Output Answer": [ - "$\\frac{6600}{2873}$" - ], - "Output Program": [ - "import statistics\nvalues = (55/3), (25/3), (2/3), 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 2 \\sqrt{3}, -\\frac{9}{2}, \\frac{22}{\\pi }, -8, -\\frac{32}{7}, -5, -\\frac{1}{3}, \\frac{1}{3}, 4, 0, -\\frac{31}{\\pi }, -3, -\\frac{5}{\\sqrt{3}}, 4}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 2*math.sqrt(3), -(9/2), (22/math.pi), -8, -(32/7), -5, -(1/3), (1/3), 4, 0, -(31/math.pi), -3, -(5/(math.sqrt(3))), 4\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${5, -2, -\\log (2)}$.\n", - "Output Answer": [ - "${-2, -\\log (2), 5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -2, -math.log(2)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, -2, -6, \\frac{2}{e}, -8, 5, \\frac{8}{\\sqrt{3}}, \\frac{28}{5}, -\\frac{6}{e}, -9 \\log (2), 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{68}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -2, -6, (2/math.e), -8, 5, (8/(math.sqrt(3))), (28/5), -(6/math.e), -9*math.log(2), 2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, -9, -3, 3, 4, 8}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, -9, -3, 3, 4, 8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -15, 12, 4, -6, -10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{3461}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -15, 12, 4, -6, -10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\pi, -5, -2, -10, 7, -\\frac{9}{4}, -4 \\sqrt{3}, -6} \\setminus {4, 6, -5}$.\n", - "Output Answer": [ - "${-10, -4 \\sqrt{3}, -6, -\\pi, -\\frac{9}{4}, -2, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, -5, -2, -10, 7, -(9/4), -4*math.sqrt(3), -6,))\nsnd = set((4, 6, -5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.7 x+4.7$ where $x \\sim $ \\text{NormalDistribution}[-0.2,1.4]\n", - "Output Answer": [ - "$4.56$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.2, 1.4)\nprint(E(0.7*x+4.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.08,0.271,0.069,0.033,0.138,0.069,0.143,0.051,0.139\\}$ and $\\{0.178,0.044,0.073,0.17,0.077,0.105,0.072,0.054,0.084\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.08, 0.271, 0.069, 0.033, 0.138, 0.069, 0.143, 0.051, 0.139\ndistribution2 = 0.178, 0.044, 0.073, 0.17, 0.077, 0.105, 0.072, 0.054, 0.084\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\sqrt{3}, 3 \\sqrt{3}, 0, -3 \\sqrt{3}, 0, 3 \\sqrt{3}, 0, 3 \\sqrt{3}, 0, 3 \\sqrt{3}, 0, 0, 3 \\sqrt{3}, 3 \\sqrt{3}, 0, -3 \\sqrt{3}, 0, 3 \\sqrt{3}, 0, 0, -3 \\sqrt{3}, 0, 3 \\sqrt{3}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.sqrt(3), 3*math.sqrt(3), 0, -3*math.sqrt(3), 0, 3*math.sqrt(3), 0, 3*math.sqrt(3), 0, 3*math.sqrt(3), 0, 0, 3*math.sqrt(3), 3*math.sqrt(3), 0, -3*math.sqrt(3), 0, 3*math.sqrt(3), 0, 0, -3*math.sqrt(3), 0, 3*math.sqrt(3), 3*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, -11, -12}$.\n", - "Output Answer": [ - "$\\frac{211}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -11, -12\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -512, 117649, -1, 27, 625}$.\n", - "Output Answer": [ - "$28 \\sqrt[6]{2} \\sqrt{3} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -512, 117649, -1, 27, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -10, 1, -4, -3 \\log (2), -3, \\frac{65}{7}} \\cup {1, -3, -1, -9, \\frac{65}{7}, -10, 2 \\log (2)}$.\n", - "Output Answer": [ - "${-10, -9, -4, -3, -3 \\log (2), -1, 1, 2 \\log (2), \\frac{65}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -10, 1, -4, -3*math.log(2), -3, (65/7),))\nsnd = set((1, -3, -1, -9, (65/7), -10, 2*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-3 \\sqrt{5}, -5, 4, 10 \\log (2), -7}$.\n", - "Output Answer": [ - "${-7, -3 \\sqrt{5}, -5, 4, 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), -5, 4, 10*math.log(2), -7\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{27}{\\pi }, -\\frac{23}{\\pi }, -\\frac{7}{\\pi }, -\\frac{28}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{31}{4 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (27/math.pi), -(23/math.pi), -(7/math.pi), -(28/math.pi)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.204,0.092,0.09,0.045,0.128,0.048,0.071,0.127,0.045\\}$ and $\\{0.051,0.067,0.051,0.094,0.118,0.002,0.021,0.214,0.219\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.204, 0.092, 0.09, 0.045, 0.128, 0.048, 0.071, 0.127, 0.045\ndistribution2 = 0.051, 0.067, 0.051, 0.094, 0.118, 0.002, 0.021, 0.214, 0.219\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 6, -5, -5, 9, \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} (\\pi -1)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 6, -5, -5, 9, math.pi\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, 9, 27}$.\n", - "Output Answer": [ - "$30 \\sqrt[3]{-1} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, 9, 27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{23}{4}, 13 \\log (2), 8}$.\n", - "Output Answer": [ - "${\\frac{23}{4}, 8, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = (23/4), 13*math.log(2), 8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${e, -3 e, 4 e, -2 e, 0, e, -3 e}$.\n", - "Output Answer": [ - "$-\\frac{2 e}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.e, -3*math.e, 4*math.e, -2*math.e, 0, math.e, -3*math.e\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${3 \\sqrt{3}, 1, 6}$.\n", - "Output Answer": [ - "${1, 3 \\sqrt{3}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(3), 1, 6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 5, 10, 19}$.\n", - "Output Answer": [ - "$\\frac{6840}{793}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 5, 10, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\sqrt{3}, -\\frac{28}{3}, -6.084, 5, 9, 2}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -6.084, -\\sqrt{3}, 2, 5, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(3), -(28/3), -6.084, 5, 9, 2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{27}{e}, 7.36, -2, 3, 8, -5 \\sqrt{3}} \\setminus {-\\frac{4}{e}, -2, -4.11, 8, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{27}{e}, 3, 7.36}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(27/math.e), 7.36, -2, 3, 8, -5*math.sqrt(3),))\nsnd = set((-(4/math.e), -2, -4.11, 8, -5*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.18,0.324,0.196,0.075\\}$ and $\\{0.269,0.233,0.104,0.12\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.18, 0.324, 0.196, 0.075\ndistribution2 = 0.269, 0.233, 0.104, 0.12\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, -6, -8, 1, 8, -7, 7, -9}$.\n", - "Output Answer": [ - "$-\\frac{5}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, -6, -8, 1, 8, -7, 7, -9\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^2-0.3 x-1.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$-4.58$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(-1.9*x**2-0.3*x-1.5))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, -1, -9, 3, -2, 0, 8, -4} \\cap {9, -1, 4, 0, -5, 5, -3}$.\n", - "Output Answer": [ - "${-1, 0}$" - ], - "Output Program": [ - "fst = set((-8, -1, -9, 3, -2, 0, 8, -4,))\nsnd = set((9, -1, 4, 0, -5, 5, -3,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 e, -2 \\sqrt{2}, -\\frac{5}{e}, 2, 2, -3 \\sqrt{3}, -\\frac{6}{e}, 5, 9 \\log (2), -\\frac{11}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{11}{\\sqrt{\\pi }}+9 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.e, -2*math.sqrt(2), -(5/math.e), 2, 2, -3*math.sqrt(3), -(6/math.e), 5, 9*math.log(2), -(11/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 0, -9, -9, 0, -7, -7, 5, -9, 0, -9, -7, 0, -7, 10, 5, -7, 5, 0, 0, 0, 5, 0, 10, 6, 0, 10, -7, 6}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 0, -9, -9, 0, -7, -7, 5, -9, 0, -9, -7, 0, -7, 10, 5, -7, 5, 0, 0, 0, 5, 0, 10, 6, 0, 10, -7, 6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 7, 0, 0, 0, 0, 7, 0, 7, 8, 7, 0, 8, 0, 8, -3, 0, 8, 8, 0, 7, 7, 8, 0, 0, 0, 7, 7, 0, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 7, 0, 0, 0, 0, 7, 0, 7, 8, 7, 0, 8, 0, 8, -3, 0, 8, 8, 0, 7, 7, 8, 0, 0, 0, 7, 7, 0, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, -3, -1, 7, -12, 7}$.\n", - "Output Answer": [ - "$\\frac{1877}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -3, -1, 7, -12, 7\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, -4, 5, -5}$.\n", - "Output Answer": [ - "$\\frac{563}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -4, 5, -5\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.13,0.019,0.002,0.085,0.046,0.033,0.301,0.22,0.054\\}$ and $\\{0.16,0.061,0.031,0.003,0.028,0.01,0.021,0.11,0.574\\}$.", - "Output Answer": [ - "$1.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.13, 0.019, 0.002, 0.085, 0.046, 0.033, 0.301, 0.22, 0.054\ndistribution2 = 0.16, 0.061, 0.031, 0.003, 0.028, 0.01, 0.021, 0.11, 0.574\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2.48, 0, -1.88, 8}$.\n", - "Output Answer": [ - "${-1.88, 0, 2.48, 8}$" - ], - "Output Program": [ - "values = 2.48, 0, -1.88, 8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 25, 81}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{3} 35^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 25, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\sqrt{3}, 0}$.\n", - "Output Answer": [ - "$\\frac{3 \\sqrt{3}}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.sqrt(3), 0\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-10, \\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-10, \\frac{9}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, (9/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -1, -2, 2, 4, -5, 1}$.\n", - "Output Answer": [ - "$\\frac{2}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -1, -2, 2, 4, -5, 1\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.06,0.06,0.117,0.186,0.043,0.118,0.063,0.1,0.099\\}$ and $\\{0.025,0.147,0.036,0.229,0.161,0.058,0.039,0.119,0.121,0.003\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.06, 0.06, 0.117, 0.186, 0.043, 0.118, 0.063, 0.1, 0.099\ndistribution2 = 0.025, 0.147, 0.036, 0.229, 0.161, 0.058, 0.039, 0.119, 0.121, 0.003\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, -7, -6, -7, 2, 0}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{67}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -7, -6, -7, 2, 0\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x-1.6$ where $x \\sim $ \\text{BetaDistribution}[1.4,0.8]\n", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.4, 0.8)\nprint(E(3.3*x-1.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x^2-0.4 x+3.4$ where $x \\sim $ \\text{PoissonDistribution}[3.9]\n", - "Output Answer": [ - "$64.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.9)\nprint(E(3.3*x**2-0.4*x+3.4))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3 e, 0, \\frac{9}{\\sqrt{2}}, 5 \\log (2), \\frac{15}{2}, -\\frac{1}{e}, \\frac{7}{\\sqrt{3}}, e, 2 \\log (2)} \\cup {\\log (2), \\frac{15}{2}, \\frac{7}{\\sqrt{3}}, \\frac{26}{e}, 5 \\log (2), e, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 e, -3 \\sqrt{2}, -\\frac{1}{e}, 0, \\log (2), 2 \\log (2), e, 5 \\log (2), \\frac{7}{\\sqrt{3}}, \\frac{9}{\\sqrt{2}}, \\frac{15}{2}, \\frac{26}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.e, 0, (9/(math.sqrt(2))), 5*math.log(2), (15/2), -(1/math.e), (7/(math.sqrt(3))), math.e, 2*math.log(2),))\nsnd = set((math.log(2), (15/2), (7/(math.sqrt(3))), (26/math.e), 5*math.log(2), math.e, -3*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${9, 9, -7, -6, -4, -\\frac{17}{\\sqrt{\\pi }}, 8}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{\\pi }}, -7, -6, -4, 8, 9, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 9, -7, -6, -4, -(17/(math.sqrt(math.pi))), 8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 7, 1, 7, -1, 1, 1, 7, 0, 1, 0, 0, 7, 1, 1, -1, 7, 7, 0, 7, 1, 0, 0, -1, -1, 1, -1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 7, 1, 7, -1, 1, 1, 7, 0, 1, 0, 0, 7, 1, 1, -1, 7, 7, 0, 7, 1, 0, 0, -1, -1, 1, -1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4, 4 \\sqrt{2}, -7, 5, 4, 6, -10}$.\n", - "Output Answer": [ - "${-10, -7, -4, 4, 5, 4 \\sqrt{2}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 4*math.sqrt(2), -7, 5, 4, 6, -10\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.077,0.095,0.081,0.072,0.382,0.059,0.088,0.032,0.054,0.005\\}$ and $\\{0.056,0.07,0.033,0.161,0.067,0.006,0.127,0.241,0.074,0.054\\}$.", - "Output Answer": [ - "$0.72$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.077, 0.095, 0.081, 0.072, 0.382, 0.059, 0.088, 0.032, 0.054, 0.005\ndistribution2 = 0.056, 0.07, 0.033, 0.161, 0.067, 0.006, 0.127, 0.241, 0.074, 0.054\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${6, 2, 1, 0}$.\n", - "Output Answer": [ - "$\\frac{83}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 2, 1, 0\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\sqrt{2}, -2, \\frac{12}{5}, -6}$.\n", - "Output Answer": [ - "${-6, -2, \\sqrt{2}, \\frac{12}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(2), -2, (12/5), -6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -\\sqrt{2}, -6 \\sqrt{2}, -\\sqrt{2}, -\\sqrt{2}, 6 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -\\sqrt{2}, -\\sqrt{2}, 6 \\sqrt{2}, -6 \\sqrt{2}, 6 \\sqrt{2}, -\\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, -3 \\sqrt{2}, 6 \\sqrt{2}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{6 \\sqrt{2},-\\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 6*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -math.sqrt(2), -6*math.sqrt(2), -math.sqrt(2), -math.sqrt(2), 6*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -math.sqrt(2), -math.sqrt(2), 6*math.sqrt(2), -6*math.sqrt(2), 6*math.sqrt(2), -math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), -3*math.sqrt(2), 6*math.sqrt(2), 6*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.045,0.071,0.036,0.034,0.101,0.089,0.119,0.103,0.047,0.22\\}$ and $\\{0.073,0.048,0.069,0.151,0.087,0.077,0.135,0.114,0.069,0.095\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.045, 0.071, 0.036, 0.034, 0.101, 0.089, 0.119, 0.103, 0.047, 0.22\ndistribution2 = 0.073, 0.048, 0.069, 0.151, 0.087, 0.077, 0.135, 0.114, 0.069, 0.095\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${10, 6, -1, -7}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 10, 6, -1, -7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9, -2, \\frac{18}{e}, 1, -\\sqrt{3}, -5, -\\frac{7}{\\sqrt{5}}, 0.39, 0} \\setminus {\\frac{49}{5}, 4 \\sqrt{3}, 0, 9, -5, -3, 6, 0.39, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{5}}, -2, -\\sqrt{3}, 1, \\frac{18}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -2, (18/math.e), 1, -math.sqrt(3), -5, -(7/(math.sqrt(5))), 0.39, 0,))\nsnd = set(((49/5), 4*math.sqrt(3), 0, 9, -5, -3, 6, 0.39, -4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -1, -8, 6}$.\n", - "Output Answer": [ - "$-\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -1, -8, 6\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\sqrt{3}, 7, \\sqrt{5}, -0.16, 2, -6, 2 \\sqrt{5}, -5} \\cup {2, -6, -8, 5, -0.16, 4, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -8, -6, -5, -0.16, 2, \\sqrt{5}, 4, 2 \\sqrt{5}, 5, 3 \\sqrt{3}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), 7, math.sqrt(5), -0.16, 2, -6, 2*math.sqrt(5), -5,))\nsnd = set((2, -6, -8, 5, -0.16, 4, -4*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2, -6, -\\frac{20}{\\pi }, -9, -3, -7.9, -e, 3, -5, -3.01} \\cup {2, -9, 0, -3, -3.01, -1, -\\frac{31}{\\pi }, -7.9, 2 e, 6}$.\n", - "Output Answer": [ - "${-\\frac{31}{\\pi }, -9, -7.9, -\\frac{20}{\\pi }, -6, -5, -3.01, -3, -e, -1, 0, 2, 3, 2 e, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -6, -(20/math.pi), -9, -3, -7.9, -math.e, 3, -5, -3.01,))\nsnd = set((2, -9, 0, -3, -3.01, -1, -(31/math.pi), -7.9, 2*math.e, 6,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $0.01 < 4.6 x+1.1 < 2.7$ where $x \\sim $ \\text{PoissonDistribution}[2.9].", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.9)\nprint(P((0.01 < 4.6*x+1.1) & (4.6*x+1.1 < 2.7)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 6, -3 e, -7, 2, 1, -6, -7, \\frac{19}{2}, -8, 8, 6 \\sqrt{2}}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 6, -3*math.e, -7, 2, 1, -6, -7, (19/2), -8, 8, 6*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x-1.1$ where $x \\sim $ \\text{BetaDistribution}[1.9,1.]\n", - "Output Answer": [ - "$-2.87$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 1.)\nprint(E(-2.7*x-1.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 64, 1}$.\n", - "Output Answer": [ - "$4\\ 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 64, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 12, 7}$.\n", - "Output Answer": [ - "$\\frac{1260}{137}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 12, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 0, 5, 8, 5, -4, -7, 5, 5, -7, -7, -2, -2, -4, 8, 0, -1, -7, 5, 5, 0, -1, -1, 0, -2, 5, 5, -7}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 0, 5, 8, 5, -4, -7, 5, 5, -7, -7, -2, -2, -4, 8, 0, -1, -7, 5, 5, 0, -1, -1, 0, -2, 5, 5, -7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 1, 8, -9, 1, -3, 8, 1, -7, 8, -9, -3, 8, 1, 1, 1, -9, -9, -3, 8, -9, 1, 1, -7, -9, -3, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 1, 8, -9, 1, -3, 8, 1, -7, 8, -9, -3, 8, 1, 1, 1, -9, -9, -3, 8, -9, 1, 1, -7, -9, -3, 1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.08,0.207,0.027,0.105,0.214,0.12,0.017,0.062,0.055\\}$ and $\\{0.203,0.081,0.003,0.138,0.019,0.044,0.002,0.333,0.098\\}$.", - "Output Answer": [ - "$0.81$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.08, 0.207, 0.027, 0.105, 0.214, 0.12, 0.017, 0.062, 0.055\ndistribution2 = 0.203, 0.081, 0.003, 0.138, 0.019, 0.044, 0.002, 0.333, 0.098\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${4, -\\frac{11}{\\sqrt{2}}, -\\frac{13}{7}, 3 \\pi, -2, 6, -8.732, -\\sqrt{3}, 4.85, 8, \\frac{23}{5}, -\\frac{15}{\\pi }} \\cup {0, 6, -\\sqrt{3}, \\frac{1}{\\sqrt{2}}, 2, 4.85, -\\frac{9}{5}, -\\frac{11}{e}, -\\frac{13}{7}}$.\n", - "Output Answer": [ - "${-8.732, -\\frac{11}{\\sqrt{2}}, -\\frac{15}{\\pi }, -\\frac{11}{e}, -2, -\\frac{13}{7}, -\\frac{9}{5}, -\\sqrt{3}, 0, \\frac{1}{\\sqrt{2}}, 2, 4, \\frac{23}{5}, 4.85, 6, 8, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -(11/(math.sqrt(2))), -(13/7), 3*math.pi, -2, 6, -8.732, -math.sqrt(3), 4.85, 8, (23/5), -(15/math.pi),))\nsnd = set((0, 6, -math.sqrt(3), (1/(math.sqrt(2))), 2, 4.85, -(9/5), -(11/math.e), -(13/7),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 \\sqrt{2}, -\\frac{10}{\\sqrt{3}}, -6 \\sqrt{2}, -8, \\frac{10}{\\sqrt{3}}, 7, -\\frac{21}{4}, \\frac{5}{\\sqrt{\\pi }}, -2 \\pi, 1, -4 \\sqrt{2}, -5, -9, 9, 0}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(2), -(10/(math.sqrt(3))), -6*math.sqrt(2), -8, (10/(math.sqrt(3))), 7, -(21/4), (5/(math.sqrt(math.pi))), -2*math.pi, 1, -4*math.sqrt(2), -5, -9, 9, 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 4, \\frac{39}{4}, -2, 3 \\sqrt{2}, 6, -6, 1.912} \\cup {2 \\sqrt{2}, 1.912, -4, \\frac{7}{2}, -2}$.\n", - "Output Answer": [ - "${-6, -4, -2, 1.912, 2 \\sqrt{2}, \\frac{7}{2}, 4, 3 \\sqrt{2}, 6, \\frac{39}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 4, (39/4), -2, 3*math.sqrt(2), 6, -6, 1.912,))\nsnd = set((2*math.sqrt(2), 1.912, -4, (7/2), -2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{3}, -1, -2 \\sqrt{5}, \\frac{26}{3}, -\\frac{2}{e}, -7, -\\frac{10}{7}, \\frac{9}{e}, -\\frac{8}{5}, 5, -6, -1}$.\n", - "Output Answer": [ - "$\\frac{47}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(3), -1, -2*math.sqrt(5), (26/3), -(2/math.e), -7, -(10/7), (9/math.e), -(8/5), 5, -6, -1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{\\sqrt{3}}, 2.444, 3, \\frac{26}{7}, -8, 1.1, 5}$.\n", - "Output Answer": [ - "${-8, -\\frac{11}{\\sqrt{3}}, 1.1, 2.444, 3, \\frac{26}{7}, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/(math.sqrt(3))), 2.444, 3, (26/7), -8, 1.1, 5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{2}, 5, \\frac{25}{2}, \\frac{25}{2}}$.\n", - "Output Answer": [ - "$\\frac{100}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/2), 5, (25/2), (25/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\pi, 0, -5, 10, 3 \\sqrt{2}, 10, \\frac{15}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$10+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.pi, 0, -5, 10, 3*math.sqrt(2), 10, (15/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6, 81, 16, 512}$.\n", - "Output Answer": [ - "$24 \\sqrt{2} \\sqrt[4]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 81, 16, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, 15, 13, 12}$.\n", - "Output Answer": [ - "$\\frac{505}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 15, 13, 12\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{37}{4}, 7}$.\n", - "Output Answer": [ - "$\\frac{65}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (37/4), 7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3, \\frac{1}{\\sqrt{2}}, \\sqrt{2}, 9, -6, -4} \\cup {\\frac{1}{\\sqrt{2}}, 9, \\sqrt{2}, -6, 6, -9}$.\n", - "Output Answer": [ - "${-9, -6, -4, \\frac{1}{\\sqrt{2}}, \\sqrt{2}, 3, 6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, (1/(math.sqrt(2))), math.sqrt(2), 9, -6, -4,))\nsnd = set(((1/(math.sqrt(2))), 9, math.sqrt(2), -6, 6, -9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${7, 14, -8, -1, -13, 14}$.\n", - "Output Answer": [ - "$\\frac{3881}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 14, -8, -1, -13, 14\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 5, 4, 1, 14}$.\n", - "Output Answer": [ - "$\\frac{57}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 5, 4, 1, 14\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3, \\frac{5}{\\pi }, -3 \\sqrt{2}, 7, 6, -6, 2 \\log (2), 1, -\\frac{19}{e}, 6 \\sqrt{2}, 3 \\sqrt{3}, \\frac{14}{\\sqrt{3}}, 2} \\cup {\\sqrt{3}, 1, -3, -5, -\\frac{19}{e}, -\\sqrt{3}, -3 \\sqrt{2}, \\frac{1}{\\pi }, 10, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{19}{e}, -6, -5, -3 \\sqrt{2}, -3, -\\sqrt{3}, \\frac{1}{\\pi }, 1, 2 \\log (2), \\frac{5}{\\pi }, \\sqrt{3}, 2, 3 \\sqrt{3}, 6, 7, \\frac{14}{\\sqrt{3}}, 6 \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, (5/math.pi), -3*math.sqrt(2), 7, 6, -6, 2*math.log(2), 1, -(19/math.e), 6*math.sqrt(2), 3*math.sqrt(3), (14/(math.sqrt(3))), 2,))\nsnd = set((math.sqrt(3), 1, -3, -5, -(19/math.e), -math.sqrt(3), -3*math.sqrt(2), (1/math.pi), 10, 6*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${1, -2, -\\frac{42}{5}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -2, -(42/5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{52}{3}, 17}$.\n", - "Output Answer": [ - "$\\frac{1768}{103}$" - ], - "Output Program": [ - "import statistics\nvalues = (52/3), 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.253,0.26,0.218,0.066,0.045,0.042\\}$ and $\\{0.038,0.145,0.079,0.073,0.199,0.419\\}$.", - "Output Answer": [ - "$0.85$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.253, 0.26, 0.218, 0.066, 0.045, 0.042\ndistribution2 = 0.038, 0.145, 0.079, 0.073, 0.199, 0.419\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -5, -5, 4, -5, 4, -4, -8, -5, 5, 5, -5, 4, 5, -4, 5, -4, -2, -5, -8, -8}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -5, -5, 4, -5, 4, -4, -8, -5, 5, 5, -5, 4, 5, -4, 5, -4, -2, -5, -8, -8\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-5.89, 6, -2, -\\frac{30}{7}, -3, 5, -4} \\cup {-4, 9, -2, 5.21, -\\frac{4}{3}, 6, -\\frac{30}{7}, \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5.89, -\\frac{30}{7}, -4, -3, -2, -\\frac{4}{3}, \\sqrt{2}, 5, 5.21, 6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.89, 6, -2, -(30/7), -3, 5, -4,))\nsnd = set((-4, 9, -2, 5.21, -(4/3), 6, -(30/7), math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${7, 3 \\pi, 3}$.\n", - "Output Answer": [ - "${3, 7, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 3*math.pi, 3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${216, 64, -2}$.\n", - "Output Answer": [ - "$24 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = 216, 64, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-7, 4, 2.7, 5} \\cup {-6.8, 0, 4, 5}$.\n", - "Output Answer": [ - "${-7, -6.8, 0, 2.7, 4, 5}$" - ], - "Output Program": [ - "fst = set((-7, 4, 2.7, 5,))\nsnd = set((-6.8, 0, 4, 5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, -3, 9, -9, 3}$.\n", - "Output Answer": [ - "$90$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -3, 9, -9, 3\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -9, 8, -3}$.\n", - "Output Answer": [ - "$\\frac{214}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -9, 8, -3\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${2, \\frac{9}{\\sqrt{2}}, 7, -6.74, 3} \\setminus {2, \\frac{15}{e}, 6, -2 \\sqrt{3}, 8, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-6.74, 3, \\frac{9}{\\sqrt{2}}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, (9/(math.sqrt(2))), 7, -6.74, 3,))\nsnd = set((2, (15/math.e), 6, -2*math.sqrt(3), 8, -4*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x+1.2$ where $x \\sim $ \\text{BetaDistribution}[1.,0.7]\n", - "Output Answer": [ - "$1.73$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 0.7)\nprint(E(0.9*x+1.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.2 x^2-1.8 x-0.4$ where $x \\sim $ \\text{BetaDistribution}[0.2,1.8]\n", - "Output Answer": [ - "$-0.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.2, 1.8)\nprint(E(3.2*x**2-1.8*x-0.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -\\frac{8}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$9-\\frac{8}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -(8/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{11}{2}, -7, \\frac{29}{4}, -\\frac{27}{4}, \\frac{9}{2}, -\\frac{35}{4}}$.\n", - "Output Answer": [ - "$-\\frac{7}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (11/2), -7, (29/4), -(27/4), (9/2), -(35/4)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{28}{3}, 0}$.\n", - "Output Answer": [ - "${0, \\frac{28}{3}}$" - ], - "Output Program": [ - "values = (28/3), 0\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -6, \\frac{23}{5}} \\setminus {\\frac{23}{5}, 0, 10, \\frac{4}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-7, -6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -6, (23/5),))\nsnd = set(((23/5), 0, 10, (4/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 5, 3, -3}$.\n", - "Output Answer": [ - "$\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 5, 3, -3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${9, 3, -2} \\cup {-2, 8, 3}$.\n", - "Output Answer": [ - "${-2, 3, 8, 9}$" - ], - "Output Program": [ - "fst = set((9, 3, -2,))\nsnd = set((-2, 8, 3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.105,0.039,0.048,0.172,0.245,0.082,0.199,0.049,0.017,0.024\\}$ and $\\{0.062,0.048,0.06,0.038,0.172,0.066,0.095,0.109,0.131,0.146\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.105, 0.039, 0.048, 0.172, 0.245, 0.082, 0.199, 0.049, 0.017, 0.024\ndistribution2 = 0.062, 0.048, 0.06, 0.038, 0.172, 0.066, 0.095, 0.109, 0.131, 0.146\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-9, 0, 7, 4, -10, -14}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{271}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 0, 7, 4, -10, -14\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 7, \\frac{5}{2}}$.\n", - "Output Answer": [ - "$\\frac{19}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 7, (5/2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{8}{\\sqrt{5}}, 0.66, -5 \\sqrt{2}, -5, 1, 1.687, -5}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -5, -5, 0.66, 1, 1.687, \\frac{8}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (8/(math.sqrt(5))), 0.66, -5*math.sqrt(2), -5, 1, 1.687, -5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.1 x^2+3.6 x+4.2$ where $x \\sim $ \\text{PoissonDistribution}[2.8]\n", - "Output Answer": [ - "$-18.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.8)\nprint(E(-3.1*x**2+3.6*x+4.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${11 \\log (2), -3, -4, \\frac{1}{\\sqrt{\\pi }}, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$4+11 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 11*math.log(2), -3, -4, (1/(math.sqrt(math.pi))), -2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -2, 12}$.\n", - "Output Answer": [ - "$\\frac{247}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -2, 12\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{7}, -\\frac{8}{\\sqrt{\\pi }}, 9, 13 \\log (2), 0, 0, -4 \\sqrt{2}, -\\frac{22}{3}, -\\frac{19}{\\pi }, 7, 5, -\\frac{33}{4}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (13/7), -(8/(math.sqrt(math.pi))), 9, 13*math.log(2), 0, 0, -4*math.sqrt(2), -(22/3), -(19/math.pi), 7, 5, -(33/4)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{37}{5}, -\\frac{8}{e}, 11 \\log (2), 1, -2 \\sqrt{5}, -2, 2 e, \\sqrt{2}, -2, -\\frac{5}{7}, -\\frac{19}{2}, -\\frac{1}{\\sqrt{2}}, 9}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (37/5), -(8/math.e), 11*math.log(2), 1, -2*math.sqrt(5), -2, 2*math.e, math.sqrt(2), -2, -(5/7), -(19/2), -(1/(math.sqrt(2))), 9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${8, 6, 9, 4, 3, -4, -1, 0, 1} \\cap {-4, -1, 8, 6, 4, 2, 7, 1}$.\n", - "Output Answer": [ - "${-4, -1, 1, 4, 6, 8}$" - ], - "Output Program": [ - "fst = set((8, 6, 9, 4, 3, -4, -1, 0, 1,))\nsnd = set((-4, -1, 8, 6, 4, 2, 7, 1,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, -1, -1, -7, -7, -10, -7, -1, -7, -1, -7, -7, -10, -7, -1, -7, -7, -7, -7, -10, -7, -1, -7, -7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, -1, -1, -7, -7, -10, -7, -1, -7, -1, -7, -7, -10, -7, -1, -7, -7, -7, -7, -10, -7, -1, -7, -7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 14, -10, -11, 15, -2}$.\n", - "Output Answer": [ - "$\\frac{1307}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 14, -10, -11, 15, -2\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2, \\frac{14}{e}, -3, 4, 2 \\sqrt{2}} \\cup {-5, 6 \\sqrt{2}, \\frac{14}{e}, -3, 5}$.\n", - "Output Answer": [ - "${-5, -3, 2, 2 \\sqrt{2}, 4, 5, \\frac{14}{e}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, (14/math.e), -3, 4, 2*math.sqrt(2),))\nsnd = set((-5, 6*math.sqrt(2), (14/math.e), -3, 5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, -5, -9, 4, 3, 8, -4} \\cap {-10, 0, -2, 2, 7, 3, 8, -3}$.\n", - "Output Answer": [ - "${3, 8}$" - ], - "Output Program": [ - "fst = set((-8, -5, -9, 4, 3, 8, -4,))\nsnd = set((-10, 0, -2, 2, 7, 3, 8, -3,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-1.81 < -0.1 x^2-0.7 x-1.9 < 0.35$ where $x \\sim $ \\text{NormalDistribution}[0.1,1.].", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.1, 1.)\nprint(P((-1.81 < -0.1*x**2-0.7*x-1.9) & (-0.1*x**2-0.7*x-1.9 < 0.35)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${0, -14, -4, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{347}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -14, -4, 12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{9}{4}, -\\frac{6}{\\pi }, 3, 4.95, -3}$.\n", - "Output Answer": [ - "${-3, -\\frac{6}{\\pi }, \\frac{9}{4}, 3, 4.95}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/4), -(6/math.pi), 3, 4.95, -3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${7, -4, 14 \\log (2), 6, \\sqrt{5}, -\\frac{26}{7}, 6, 4, -3, \\sqrt{5}, -4}$.", - "Output Answer": [ - "$\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -4, 14*math.log(2), 6, math.sqrt(5), -(26/7), 6, 4, -3, math.sqrt(5), -4\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 1, 17}$.\n", - "Output Answer": [ - "$\\frac{306}{125}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 1, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 14, -5}$.\n", - "Output Answer": [ - "$\\frac{511}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 14, -5\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, -10, 13, 9, 3, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1303}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -10, 13, 9, 3, -15\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 4, 8}$.\n", - "Output Answer": [ - "$\\frac{216}{35}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 4, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-100000, 6, 16, 1, 27, 7}$.\n", - "Output Answer": [ - "$2 \\sqrt[6]{-7} 5^{5/6} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -100000, 6, 16, 1, 27, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${8, -8, 2, -8, -10, \\frac{2}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-10, -8, -8, \\frac{2}{\\sqrt{3}}, 2, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -8, 2, -8, -10, (2/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{3}, 6, 1, \\frac{43}{3}}$.\n", - "Output Answer": [ - "$\\frac{38184}{12577}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/3), 6, 1, (43/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-5, -3, 9, 6, 7, 2, 10} \\cap {-8, -9, -3, 0, 1, -7, -5}$.\n", - "Output Answer": [ - "${-5, -3}$" - ], - "Output Program": [ - "fst = set((-5, -3, 9, 6, 7, 2, 10,))\nsnd = set((-8, -9, -3, 0, 1, -7, -5,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, -1, -9, -9, 10, 10, -7, -1, -5, -9, -7, -7, 9, -5, 0, 10, 0, 10, -5, 9, -9, 9, -1}$.\n", - "Output Answer": [ - "$\\{-7,-9,10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, -1, -9, -9, 10, 10, -7, -1, -5, -9, -7, -7, 9, -5, 0, 10, 0, 10, -5, 9, -9, 9, -1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, -12, 5}$.\n", - "Output Answer": [ - "$91$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -12, 5\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -4, 0, 7}$.\n", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -4, 0, 7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, \\frac{17}{e}, -6, 9, -3 e, -8, \\frac{9}{\\sqrt{5}}, -4, -6, 0, -\\frac{22}{3}}$.\n", - "Output Answer": [ - "$9+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = 2, (17/math.e), -6, 9, -3*math.e, -8, (9/(math.sqrt(5))), -4, -6, 0, -(22/3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${6 \\sqrt{2}, -3, \\frac{13}{7}, 0} \\setminus {-3, 4 \\sqrt{2}, \\sqrt{3}}$.\n", - "Output Answer": [ - "${0, \\frac{13}{7}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6*math.sqrt(2), -3, (13/7), 0,))\nsnd = set((-3, 4*math.sqrt(2), math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -5} \\setminus {2 \\sqrt{5}, \\frac{7}{3}, -10}$.\n", - "Output Answer": [ - "${-9, -5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -5,))\nsnd = set((2*math.sqrt(5), (7/3), -10,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${0, \\frac{57}{7}, -8, 4, 0, -\\frac{30}{\\pi }, 3 \\sqrt{2}, 8, 0, -6, 5, \\sqrt{5}, 5, -\\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{\\sqrt{5}}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, (57/7), -8, 4, 0, -(30/math.pi), 3*math.sqrt(2), 8, 0, -6, 5, math.sqrt(5), 5, -math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{2}, 1, -9, -\\sqrt{5}, 7, \\frac{1}{\\sqrt{\\pi }}, 2 e}$.\n", - "Output Answer": [ - "${-9, -\\frac{11}{2}, -\\sqrt{5}, \\frac{1}{\\sqrt{\\pi }}, 1, 2 e, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/2), 1, -9, -math.sqrt(5), 7, (1/(math.sqrt(math.pi))), 2*math.e\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-2 e, -9.44, \\frac{1}{2}, 2 \\sqrt{2}, -7, -5}$.\n", - "Output Answer": [ - "${-9.44, -7, -2 e, -5, \\frac{1}{2}, 2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.e, -9.44, (1/2), 2*math.sqrt(2), -7, -5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.114,0.276,0.154,0.149,0.104,0.159\\}$ and $\\{0.237,0.098,0.021,0.018,0.158,0.136\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.114, 0.276, 0.154, 0.149, 0.104, 0.159\ndistribution2 = 0.237, 0.098, 0.021, 0.018, 0.158, 0.136\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{8}{\\pi }, 0, 3 \\sqrt{3}, -9, 4 \\sqrt{5}, -\\frac{3}{\\sqrt{5}}, -4 \\sqrt{3}, -6, 9 \\log (2), 1, -2, 3 \\sqrt{3}, -4, -4}$.\n", - "Output Answer": [ - "$9+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (8/math.pi), 0, 3*math.sqrt(3), -9, 4*math.sqrt(5), -(3/(math.sqrt(5))), -4*math.sqrt(3), -6, 9*math.log(2), 1, -2, 3*math.sqrt(3), -4, -4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 5, -3, 0, 9, -4}$.\n", - "Output Answer": [ - "$-\\frac{1}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 5, -3, 0, 9, -4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, 7 \\sqrt{2}, 7 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -3 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, -3 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, -3 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, -5 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}, 7 \\sqrt{2}, 7 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, -5 \\sqrt{2}, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{\\sqrt{2}},-\\frac{3}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(13/(math.sqrt(2))), -(3/(math.sqrt(2))), 7*math.sqrt(2), 7*math.sqrt(2), -(5/(math.sqrt(2))), -3*math.sqrt(2), -(13/(math.sqrt(2))), -(13/(math.sqrt(2))), -3*math.sqrt(2), -(3/(math.sqrt(2))), -3*math.sqrt(2), -(3/(math.sqrt(2))), -(3/(math.sqrt(2))), -(13/(math.sqrt(2))), -5*math.sqrt(2), -(5/(math.sqrt(2))), -(5/(math.sqrt(2))), -(3/(math.sqrt(2))), -(5/(math.sqrt(2))), 7*math.sqrt(2), 7*math.sqrt(2), -(13/(math.sqrt(2))), -5*math.sqrt(2), -5*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4, 4, \\frac{8}{e}, 2 \\pi, -4.24}$.\n", - "Output Answer": [ - "${-4.24, -4, \\frac{8}{e}, 4, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 4, (8/math.e), 2*math.pi, -4.24\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.144,0.124,0.03,0.097,0.23,0.143\\}$ and $\\{0.109,0.07,0.263,0.115,0.135,0.082\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.144, 0.124, 0.03, 0.097, 0.23, 0.143\ndistribution2 = 0.109, 0.07, 0.263, 0.115, 0.135, 0.082\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4, 7, -3, 4, -2} \\cap {-3, 3, -5, -10, -2, -4}$.\n", - "Output Answer": [ - "${-4, -3, -2}$" - ], - "Output Program": [ - "fst = set((-4, 7, -3, 4, -2,))\nsnd = set((-3, 3, -5, -10, -2, -4,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{3}, \\frac{43}{3}, 3, \\frac{29}{3}}$.\n", - "Output Answer": [ - "$\\frac{276834}{40669}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/3), (43/3), 3, (29/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -7, 5, 4, -6, -6, 5, -7, 5, 4, -6, 4, -6, -7, -7, -6, -7, 4, -6, -7, 4, -6, 4, 4, 5, 5, 4, -7, 5}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -7, 5, 4, -6, -6, 5, -7, 5, 4, -6, 4, -6, -7, -7, -6, -7, 4, -6, -7, 4, -6, 4, 4, 5, 5, 4, -7, 5\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.2 x^2+5. x+1.9$ where $x \\sim $ \\text{PoissonDistribution}[0.9]\n", - "Output Answer": [ - "$-0.78$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.9)\nprint(E(-4.2*x**2+5.*x+1.9))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 7, 3, 8}$.\n", - "Output Answer": [ - "$\\frac{672}{143}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 7, 3, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{13}{e}, \\frac{6}{e}, -8, \\frac{23}{4}, -\\sqrt{2}, 5.19, 1} \\setminus {4, 5.19, \\frac{23}{4}, -6, \\frac{6}{e}, 10}$.\n", - "Output Answer": [ - "${-8, -\\frac{13}{e}, -\\sqrt{2}, 1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/math.e), (6/math.e), -8, (23/4), -math.sqrt(2), 5.19, 1,))\nsnd = set((4, 5.19, (23/4), -6, (6/math.e), 10,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 19, 4, 8}$.\n", - "Output Answer": [ - "$\\frac{1824}{347}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 19, 4, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{47}{7}, 8, -3 \\pi, -5, -4 \\sqrt{5}, -2 \\pi, 0, 3 \\sqrt{5}} \\setminus {3 \\pi, 3 \\sqrt{5}, 0, -3 \\pi, -\\frac{17}{\\sqrt{5}}, 8, -5, -\\frac{47}{7}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(47/7), 8, -3*math.pi, -5, -4*math.sqrt(5), -2*math.pi, 0, 3*math.sqrt(5),))\nsnd = set((3*math.pi, 3*math.sqrt(5), 0, -3*math.pi, -(17/(math.sqrt(5))), 8, -5, -(47/7),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.038,0.171,0.061,0.02,0.001,0.072,0.005,0.338,0.004\\}$ and $\\{0.08,0.125,0.075,0.079,0.019,0.255,0.108,0.031,0.149\\}$.", - "Output Answer": [ - "$1.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.038, 0.171, 0.061, 0.02, 0.001, 0.072, 0.005, 0.338, 0.004\ndistribution2 = 0.08, 0.125, 0.075, 0.079, 0.019, 0.255, 0.108, 0.031, 0.149\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, -1, \\frac{1}{\\sqrt{2}}, -3} \\cup {-3, 0, 8, -\\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{5}{\\sqrt{2}}, -3, -1, 0, \\frac{1}{\\sqrt{2}}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -1, (1/(math.sqrt(2))), -3,))\nsnd = set((-3, 0, 8, -(5/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{24}{e}, -\\frac{25}{e}, \\frac{9}{e}, -\\frac{3}{e}, \\frac{7}{e}, \\frac{14}{e}} \\cap {-\\frac{13}{e}, \\frac{10}{e}, -\\frac{11}{e}, \\frac{21}{e}, -\\frac{25}{e}, -\\frac{18}{e}}$.\n", - "Output Answer": [ - "${-\\frac{25}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((24/math.e), -(25/math.e), (9/math.e), -(3/math.e), (7/math.e), (14/math.e),))\nsnd = set((-(13/math.e), (10/math.e), -(11/math.e), (21/math.e), -(25/math.e), -(18/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 6561, -100000, -32768, 64, -125}$.\n", - "Output Answer": [ - "$240 \\sqrt[3]{30}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 6561, -100000, -32768, 64, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -3 \\pi, -2 e, 0, -4, \\frac{33}{7}, -\\frac{13}{e}, 6} \\setminus {-4, -2 e, -5, -\\frac{13}{e}}$.\n", - "Output Answer": [ - "${-3 \\pi, -2, 0, \\frac{33}{7}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -3*math.pi, -2*math.e, 0, -4, (33/7), -(13/math.e), 6,))\nsnd = set((-4, -2*math.e, -5, -(13/math.e),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{22}{\\pi }, 6, -2 \\sqrt{5}, -\\frac{3}{2}}$.\n", - "Output Answer": [ - "${-\\frac{22}{\\pi }, -2 \\sqrt{5}, -\\frac{3}{2}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -(22/math.pi), 6, -2*math.sqrt(5), -(3/2)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${4, -5, 5} \\setminus {-6, \\frac{11}{\\sqrt{2}}, 4, 8.1}$.\n", - "Output Answer": [ - "${-5, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -5, 5,))\nsnd = set((-6, (11/(math.sqrt(2))), 4, 8.1,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -3, 0, -10, -4, 7}$.\n", - "Output Answer": [ - "$\\frac{502}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -3, 0, -10, -4, 7\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${9, 1, \\sqrt{3}, \\frac{17}{4}, -8, 3 \\sqrt{5}} \\cup {3 \\sqrt{3}, -6, -8, 5, -3, 3 \\sqrt{5}, 6}$.\n", - "Output Answer": [ - "${-8, -6, -3, 1, \\sqrt{3}, \\frac{17}{4}, 5, 3 \\sqrt{3}, 6, 3 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 1, math.sqrt(3), (17/4), -8, 3*math.sqrt(5),))\nsnd = set((3*math.sqrt(3), -6, -8, 5, -3, 3*math.sqrt(5), 6,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4, 1, 8, 6, 8, -1, 5 \\log (2), 9.08}$.\n", - "Output Answer": [ - "${-4, -1, 1, 5 \\log (2), 6, 8, 8, 9.08}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 1, 8, 6, 8, -1, 5*math.log(2), 9.08\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${6, 3 \\sqrt{2}, 5, -\\frac{31}{4}, -\\sqrt{2}, 3}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+3 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 3*math.sqrt(2), 5, -(31/4), -math.sqrt(2), 3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 5, \\frac{39}{7}, \\frac{39}{7}, 4, \\frac{10}{7}, \\frac{29}{7}, \\frac{10}{7}, \\frac{10}{7}, 5, \\frac{39}{7}, \\frac{10}{7}, \\frac{10}{7}, \\frac{29}{7}, 4, 5, \\frac{39}{7}, \\frac{39}{7}, \\frac{10}{7}, 5, 4, \\frac{29}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{10}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 5, (39/7), (39/7), 4, (10/7), (29/7), (10/7), (10/7), 5, (39/7), (10/7), (10/7), (29/7), 4, 5, (39/7), (39/7), (10/7), 5, 4, (29/7)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-2.62 < -1.4 x-4.1 < -0.94$ where $x \\sim $ \\text{NormalDistribution}[-1.8,1.6].", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 1.6)\nprint(P((-2.62 < -1.4*x-4.1) & (-1.4*x-4.1 < -0.94)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 125, -32, 7, -7, 49}$.\n", - "Output Answer": [ - "$2\\ 2^{5/6} \\sqrt{5} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 125, -32, 7, -7, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, -3, 7, -1, \\frac{5}{3}, \\frac{5}{4}} \\cup {3, -1, -2, 2, \\frac{5}{3}, -8, \\frac{5}{4}}$.\n", - "Output Answer": [ - "${-8, -3, -2, -1, \\frac{5}{4}, \\frac{5}{3}, 2, 3, 5, 7}$" - ], - "Output Program": [ - "fst = set((5, -3, 7, -1, (5/3), (5/4),))\nsnd = set((3, -1, -2, 2, (5/3), -8, (5/4),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, 8, -10, -10, 5, 2, 5, 2, 5, 2, -10, 2, 8, 5, 8, 8, 5, 2, 8, 8, 5, -10, 2, 5, 2, -10, 2, -10}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, 8, -10, -10, 5, 2, 5, 2, 5, 2, -10, 2, 8, 5, 8, 8, 5, 2, 8, 8, 5, -10, 2, 5, 2, -10, 2, -10\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 0, -12, -5, -4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1007}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 0, -12, -5, -4\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, 5 \\sqrt{2}, -\\sqrt{2}, -6 \\sqrt{2}, 5 \\sqrt{2}, 0, -\\sqrt{2}, 0, -6 \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{2}, -\\sqrt{2}, 0, 5 \\sqrt{2}, 0, 0, -\\sqrt{2}, 5 \\sqrt{2}, -6 \\sqrt{2}, -\\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-6 \\sqrt{2},5 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), 5*math.sqrt(2), -math.sqrt(2), -6*math.sqrt(2), 5*math.sqrt(2), 0, -math.sqrt(2), 0, -6*math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(2), -math.sqrt(2), 0, 5*math.sqrt(2), 0, 0, -math.sqrt(2), 5*math.sqrt(2), -6*math.sqrt(2), -math.sqrt(2), 5*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{11}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{5}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(11/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, \\frac{7}{3}, 2, \\frac{34}{3}}$.\n", - "Output Answer": [ - "$\\frac{3570}{967}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, (7/3), 2, (34/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 1, 1, 1, 9, 9, 8, 1, 2, 9, 1, 9, 8, 2, 8, 9, 8, 2, 1, 8, 8, 2}$.\n", - "Output Answer": [ - "$\\{9,1,8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 1, 1, 1, 9, 9, 8, 1, 2, 9, 1, 9, 8, 2, 8, 9, 8, 2, 1, 8, 8, 2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.068,0.041,0.177,0.039,0.189,0.336,0.051,0.081\\}$ and $\\{0.028,0.163,0.092,0.23,0.048,0.055,0.033,0.244\\}$.", - "Output Answer": [ - "$0.77$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.068, 0.041, 0.177, 0.039, 0.189, 0.336, 0.051, 0.081\ndistribution2 = 0.028, 0.163, 0.092, 0.23, 0.048, 0.055, 0.033, 0.244\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${6, 9, -8, \\frac{18}{\\sqrt{5}}, -8, -5, -1, -8}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 9, -8, (18/(math.sqrt(5))), -8, -5, -1, -8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-3, 0, 5, -4, 3, -\\sqrt{5}, 1, \\sqrt{2}}$.\n", - "Output Answer": [ - "${-4, -3, -\\sqrt{5}, 0, 1, \\sqrt{2}, 3, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 0, 5, -4, 3, -math.sqrt(5), 1, math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-4, -10, 0, 0, -1, -4, -3 \\sqrt{5}, -2 \\sqrt{5}}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, -10, 0, 0, -1, -4, -3*math.sqrt(5), -2*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{2}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{2}{3}, -\\sqrt{2}, -9}$.\n", - "Output Answer": [ - "${-9, -\\sqrt{2}, \\frac{2}{3}, \\frac{2}{\\sqrt{3}}, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = (2/(math.sqrt(3))), 5*math.sqrt(3), (2/3), -math.sqrt(2), -9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 3, 3, -8, 1, 1, 3, 2, -8, 7, 7, 7, -8, 3, 2, -8, 1, 7, 2, 3, 2}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 3, 3, -8, 1, 1, 3, 2, -8, 7, 7, 7, -8, 3, 2, -8, 1, 7, 2, 3, 2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-7, \\frac{14}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-7, \\frac{14}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, (14/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -5, -\\frac{43}{5}} \\setminus {-9, -\\frac{2}{\\sqrt{3}}, -4, -\\frac{43}{5}, 9, -5, 8}$.\n", - "Output Answer": [ - "${-2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -5, -(43/5),))\nsnd = set((-9, -(2/(math.sqrt(3))), -4, -(43/5), 9, -5, 8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{3}, -2 \\sqrt{3}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{5}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(3), -2*math.sqrt(3), -4*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, \\frac{52}{3}, \\frac{23}{3}, \\frac{34}{3}}$.\n", - "Output Answer": [ - "$\\frac{1545232}{127093}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, (52/3), (23/3), (34/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\pi, 6, 9, 3, -3.6, -7, -3, 5} \\cup {-7, -3.6, 4 \\sqrt{5}, 5, 3, -\\pi, 9, -4}$.\n", - "Output Answer": [ - "${-7, -4, -3.6, -\\pi, -3, 3, 5, 6, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, 6, 9, 3, -3.6, -7, -3, 5,))\nsnd = set((-7, -3.6, 4*math.sqrt(5), 5, 3, -math.pi, 9, -4,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{14}{5}, -1, -3, 6} \\setminus {\\frac{2}{\\pi }, \\pi, 2, -5, 8.17, -6, \\frac{19}{4}, 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3, -1, \\frac{14}{5}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set(((14/5), -1, -3, 6,))\nsnd = set(((2/math.pi), math.pi, 2, -5, 8.17, -6, (19/4), 6*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{8}{\\pi }, \\frac{16}{3}, \\frac{34}{7}, -\\frac{34}{7}, 4, -14 \\log (2), -5, -7, -8}$.", - "Output Answer": [ - "$-\\frac{34}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (8/math.pi), (16/3), (34/7), -(34/7), 4, -14*math.log(2), -5, -7, -8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-13 \\log (2), -\\frac{5}{\\sqrt{\\pi }}, -2 \\sqrt{5}, -6}$.\n", - "Output Answer": [ - "${-13 \\log (2), -6, -2 \\sqrt{5}, -\\frac{5}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -13*math.log(2), -(5/(math.sqrt(math.pi))), -2*math.sqrt(5), -6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-6.32, 5, -7, 2 \\sqrt{3}, \\frac{6}{5}, \\frac{10}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-7, -6.32, \\frac{6}{5}, 2 \\sqrt{3}, 5, \\frac{10}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6.32, 5, -7, 2*math.sqrt(3), (6/5), (10/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -3, -3}$.\n", - "Output Answer": [ - "$-\\frac{14}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -3, -3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -9, 0}$.\n", - "Output Answer": [ - "$10$" - ], - "Output Program": [ - "values = -10, -9, 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -\\frac{11}{e}}$.\n", - "Output Answer": [ - "$6+\\frac{11}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -(11/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 10000, 343, -8}$.\n", - "Output Answer": [ - "$30 \\sqrt[4]{-1} 14^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 10000, 343, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{42}{5}, \\frac{23}{5}, \\frac{2}{5}, \\frac{26}{5}, -\\frac{42}{5}, 5, \\frac{9}{5}} \\cap {-10, \\frac{2}{5}, -\\frac{42}{5}, \\frac{14}{5}, \\frac{31}{5}, \\frac{9}{5}, \\frac{23}{5}}$.\n", - "Output Answer": [ - "${-\\frac{42}{5}, \\frac{2}{5}, \\frac{9}{5}, \\frac{23}{5}}$" - ], - "Output Program": [ - "fst = set(((42/5), (23/5), (2/5), (26/5), -(42/5), 5, (9/5),))\nsnd = set((-10, (2/5), -(42/5), (14/5), (31/5), (9/5), (23/5),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, 10, 3 \\sqrt{2}, \\pi, -\\frac{26}{e}, 13 \\log (2)} \\cup {-\\frac{26}{e}, 0, -\\pi, \\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{26}{e}, -\\pi, 0, \\pi, 3 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, 13 \\log (2), 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 10, 3*math.sqrt(2), math.pi, -(26/math.e), 13*math.log(2),))\nsnd = set((-(26/math.e), 0, -math.pi, (7/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, \\frac{40}{3}, 8}$.\n", - "Output Answer": [ - "$\\frac{45}{8}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, (40/3), 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\sqrt{5}, -5 \\sqrt{3}, -5.3, -5, 5, \\frac{17}{\\pi }} \\cup {-5., -5, \\frac{17}{\\pi }, -3 \\sqrt{5}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -3 \\sqrt{5}, -5.3, -5., -5, -\\sqrt{5}, 5, \\frac{17}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(5), -5*math.sqrt(3), -5.3, -5, 5, (17/math.pi),))\nsnd = set((-5., -5, (17/math.pi), -3*math.sqrt(5), -5*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{4}{\\sqrt{3}}, -2, -5, -\\frac{1}{2}, -6, -4, -2.7, -4}$.\n", - "Output Answer": [ - "${-6, -5, -4, -4, -2.7, -\\frac{4}{\\sqrt{3}}, -2, -\\frac{1}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(4/(math.sqrt(3))), -2, -5, -(1/2), -6, -4, -2.7, -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 4, -59049, 3125, 10000, 15625}$.\n", - "Output Answer": [ - "$150 \\sqrt[6]{-1} 3^{2/3} \\sqrt{5} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 4, -59049, 3125, 10000, 15625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, -1000, 25}$.\n", - "Output Answer": [ - "$50 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -1000, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -2, -6, -3, -5, -1, 6, 4}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -2, -6, -3, -5, -1, 6, 4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 7, 7, 9, -9, -1, -7}$.\n", - "Output Answer": [ - "$-\\frac{3}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 7, 7, 9, -9, -1, -7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3. x^2+1.7 x+1.1$ where $x \\sim $ \\text{NormalDistribution}[0.7,1.2]\n", - "Output Answer": [ - "$8.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.7, 1.2)\nprint(E(3.*x**2+1.7*x+1.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 3 \\sqrt{3}, 6, -\\frac{3}{7}, -5, 6}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 3*math.sqrt(3), 6, -(3/7), -5, 6\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -13, -10, -14, 11, -9}$.\n", - "Output Answer": [ - "$\\frac{422}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -13, -10, -14, 11, -9\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${0, 4, 5}$.\n", - "Output Answer": [ - "$\\sqrt{7}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 4, 5\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\sqrt{5}, 4 \\sqrt{5}, 0, 2 \\sqrt{5}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{2}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.sqrt(5), 4*math.sqrt(5), 0, 2*math.sqrt(5), -math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 729, -1, -3125, 1, 625}$.\n", - "Output Answer": [ - "$15\\ 3^{2/3} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 729, -1, -3125, 1, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -3, 5, -7, 0, -3 \\sqrt{5}, 4, -\\frac{43}{7}, 7, 2, 7, 9}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -3, 5, -7, 0, -3*math.sqrt(5), 4, -(43/7), 7, 2, 7, 9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, -12, -10, -6, 9}$.\n", - "Output Answer": [ - "$\\sqrt{83}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -12, -10, -6, 9\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${6, -\\frac{17}{\\sqrt{\\pi }}, -4, \\frac{23}{4}, 1, 9} \\setminus {\\frac{36}{7}, \\frac{23}{4}, -\\frac{17}{\\sqrt{\\pi }}, 6, -5, -4}$.\n", - "Output Answer": [ - "${1, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -(17/(math.sqrt(math.pi))), -4, (23/4), 1, 9,))\nsnd = set(((36/7), (23/4), -(17/(math.sqrt(math.pi))), 6, -5, -4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{18}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}, 4 \\sqrt{5}, -\\frac{4}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{18}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{1}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{4}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (18/(math.sqrt(5))), -(4/(math.sqrt(5))), -(4/(math.sqrt(5))), -(2/(math.sqrt(5))), -(4/(math.sqrt(5))), 4*math.sqrt(5), -(4/(math.sqrt(5))), (1/(math.sqrt(5))), -(4/(math.sqrt(5))), (16/(math.sqrt(5))), -(2/(math.sqrt(5))), (18/(math.sqrt(5))), (16/(math.sqrt(5))), (1/(math.sqrt(5))), -(2/(math.sqrt(5))), (1/(math.sqrt(5))), -(2/(math.sqrt(5))), -(4/(math.sqrt(5))), -(2/(math.sqrt(5))), -(4/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{4}{\\sqrt{3}}, -\\frac{23}{5}}$.\n", - "Output Answer": [ - "$\\frac{23}{5}-\\frac{4}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(4/(math.sqrt(3))), -(23/5)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9, 10 \\log (2), -\\frac{15}{2}, -10, -\\frac{11}{\\sqrt{3}}, -\\frac{7}{2}, -4} \\setminus {-\\frac{11}{\\sqrt{3}}, -4, -\\frac{15}{2}, 5, 3, -8}$.\n", - "Output Answer": [ - "${-10, -\\frac{7}{2}, 10 \\log (2), 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 10*math.log(2), -(15/2), -10, -(11/(math.sqrt(3))), -(7/2), -4,))\nsnd = set((-(11/(math.sqrt(3))), -4, -(15/2), 5, 3, -8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, -15, 15, -13, -14, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2003}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -15, 15, -13, -14, 14\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 1, -\\frac{12}{5}, e, 9, -2, 0, -7, -\\frac{31}{7}}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 1, -(12/5), math.e, 9, -2, 0, -7, -(31/7)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\frac{7}{4}, -\\frac{25}{3}, 3, 6, 9, \\frac{7}{e}, 7, 9, -5, -2 \\sqrt{5}, 7}$.\n", - "Output Answer": [ - "$\\frac{52}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, (7/4), -(25/3), 3, 6, 9, (7/math.e), 7, 9, -5, -2*math.sqrt(5), 7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\pi, 9, -7, -2 \\log (2), 6, -7, -2 \\sqrt{2}, 6, \\frac{16}{e}, 2 \\pi, -11 \\log (2), 3, -\\sqrt{3}, 10, -8}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.pi, 9, -7, -2*math.log(2), 6, -7, -2*math.sqrt(2), 6, (16/math.e), 2*math.pi, -11*math.log(2), 3, -math.sqrt(3), 10, -8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 0, -9, 0}$.\n", - "Output Answer": [ - "$-\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 0, -9, 0\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -1, -3, 4, 4, -7, -4 \\sqrt{2}, 7, -5, 2 \\pi, \\sqrt{2}, \\frac{58}{7}, 9, -4}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -1, -3, 4, 4, -7, -4*math.sqrt(2), 7, -5, 2*math.pi, math.sqrt(2), (58/7), 9, -4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.156,0.172,0.128,0.21,0.194,0.083\\}$ and $\\{0.136,0.094,0.264,0.309,0.135,0.001\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.156, 0.172, 0.128, 0.21, 0.194, 0.083\ndistribution2 = 0.136, 0.094, 0.264, 0.309, 0.135, 0.001\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x+2.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$2.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(1.2*x+2.9))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.043,0.069,0.046,0.348,0.075,0.065,0.049,0.3\\}$ and $\\{0.031,0.27,0.542,0.001,0.002,0.001,0.092,0.004\\}$.", - "Output Answer": [ - "$3.62$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.043, 0.069, 0.046, 0.348, 0.075, 0.065, 0.049, 0.3\ndistribution2 = 0.031, 0.27, 0.542, 0.001, 0.002, 0.001, 0.092, 0.004\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x-2.6$ where $x \\sim $ \\text{PoissonDistribution}[2.9]\n", - "Output Answer": [ - "$-10.43$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.9)\nprint(E(-2.7*x-2.6))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{19}{5}, -4 \\sqrt{2}, \\sqrt{2}, 1, -\\frac{9}{\\sqrt{2}}} \\setminus {-2 \\sqrt{2}, \\frac{19}{5}, -6 \\log (2), -\\frac{11}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, 1, \\frac{39}{5}, -9}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((19/5), -4*math.sqrt(2), math.sqrt(2), 1, -(9/(math.sqrt(2))),))\nsnd = set((-2*math.sqrt(2), (19/5), -6*math.log(2), -(11/(math.sqrt(2))), -(9/(math.sqrt(2))), 1, (39/5), -9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 4 \\sqrt{5}, \\sqrt{2}, \\frac{25}{4}, -\\frac{3}{e}, 1}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(1+\\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 4*math.sqrt(5), math.sqrt(2), (25/4), -(3/math.e), 1\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${10, 3, -9, 0, 3}$.\n", - "Output Answer": [ - "${-9, 0, 3, 3, 10}$" - ], - "Output Program": [ - "values = 10, 3, -9, 0, 3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -7, -9, -3, -9, -6, -7, -3, -5, -3, 4, -7, 4, -9, 4, -6, -7, 4, 4, -7, -6, -5, -9, 4, 4, -7, 4}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -7, -9, -3, -9, -6, -7, -3, -5, -3, 4, -7, 4, -9, 4, -6, -7, 4, 4, -7, -6, -5, -9, 4, 4, -7, 4\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.124,0.205,0.329,0.046,0.127,0.117\\}$ and $\\{0.228,0.041,0.14,0.069,0.192,0.244\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.124, 0.205, 0.329, 0.046, 0.127, 0.117\ndistribution2 = 0.228, 0.041, 0.14, 0.069, 0.192, 0.244\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -8, -3}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "values = 9, -8, -3\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${8, \\frac{11}{2}, -7, -3 \\sqrt{5}, 2, 5, 7, 5 \\log (2), -\\frac{11}{\\sqrt{5}}, 4 \\sqrt{3}, -\\frac{2}{\\sqrt{\\pi }}, \\frac{16}{3}, 1}$.", - "Output Answer": [ - "$5 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, (11/2), -7, -3*math.sqrt(5), 2, 5, 7, 5*math.log(2), -(11/(math.sqrt(5))), 4*math.sqrt(3), -(2/(math.sqrt(math.pi))), (16/3), 1\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{24}{5}, 6 \\log (2), -\\frac{58}{7}, 1, -5, -3, -8}$.\n", - "Output Answer": [ - "$\\frac{58}{7}+6 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -(24/5), 6*math.log(2), -(58/7), 1, -5, -3, -8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 8, 12, 9}$.\n", - "Output Answer": [ - "$\\frac{2016}{197}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 8, 12, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x+0.9$ where $x \\sim $ \\text{BetaDistribution}[1.6,1.9]\n", - "Output Answer": [ - "$2.41$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 1.9)\nprint(E(3.3*x+0.9))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.804,0.001,0.157,0.001\\}$ and $\\{0.021,0.211,0.074,0.484\\}$.", - "Output Answer": [ - "$2.96$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.804, 0.001, 0.157, 0.001\ndistribution2 = 0.021, 0.211, 0.074, 0.484\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, 1, -1, 10, 10, -\\frac{11}{\\sqrt{3}}, -5.8}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{3}}, -5.8, -1, 0, 1, 10, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 1, -1, 10, 10, -(11/(math.sqrt(3))), -5.8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^2+2.3 x-3.6$ where $x \\sim $ \\text{NormalDistribution}[1.1,2.]\n", - "Output Answer": [ - "$-10.97$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.1, 2.)\nprint(E(-1.9*x**2+2.3*x-3.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.251,0.11,0.532\\}$ and $\\{0.109,0.553,0.178\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.251, 0.11, 0.532\ndistribution2 = 0.109, 0.553, 0.178\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, -\\frac{27}{7}, 10, \\frac{7}{\\sqrt{3}}, -3, 4, 4, \\frac{1}{\\sqrt{5}}, \\frac{16}{\\sqrt{\\pi }}, -3 \\sqrt{3}, -9, 7, 7 \\log (2)}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -(27/7), 10, (7/(math.sqrt(3))), -3, 4, 4, (1/(math.sqrt(5))), (16/(math.sqrt(math.pi))), -3*math.sqrt(3), -9, 7, 7*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -\\frac{14}{5}, \\frac{26}{e}, 8, 10 \\log (2), 5, 1, -9}$.\n", - "Output Answer": [ - "$9+\\frac{26}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -(14/5), (26/math.e), 8, 10*math.log(2), 5, 1, -9\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 4, -4, 4, 1, 0, -\\frac{13}{3}, -1, \\frac{16}{\\sqrt{3}}, 3}$.\n", - "Output Answer": [ - "$5+\\frac{16}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 4, -4, 4, 1, 0, -(13/3), -1, (16/(math.sqrt(3))), 3\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 15, -6, -5, 12}$.\n", - "Output Answer": [ - "$\\frac{1013}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 15, -6, -5, 12\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.7 x^2+4.6 x+4.1$ where $x \\sim $ \\text{BetaDistribution}[2.,1.8]\n", - "Output Answer": [ - "$6.75$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 2., 1.8)\nprint(E(0.7*x**2+4.6*x+4.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2, -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{3}{\\sqrt{2}}, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -(3/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, 8, -\\sqrt{3}, -2, -2 \\pi, 1, -14 \\log (2), -4}$.\n", - "Output Answer": [ - "$8+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 8, -math.sqrt(3), -2, -2*math.pi, 1, -14*math.log(2), -4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{13}{\\sqrt{\\pi }}, 2}$.\n", - "Output Answer": [ - "${2, \\frac{13}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(math.pi))), 2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{60}{7}, -\\frac{1}{7}, 0, 3, -1, -8} \\cup {-\\frac{1}{7}, -5, \\frac{60}{7}, 3, -8}$.\n", - "Output Answer": [ - "${-8, -5, -1, -\\frac{1}{7}, 0, 3, \\frac{60}{7}}$" - ], - "Output Program": [ - "fst = set(((60/7), -(1/7), 0, 3, -1, -8,))\nsnd = set((-(1/7), -5, (60/7), 3, -8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{25}{4}, 1, 3 e} \\cup {1, \\frac{15}{2}, 3 e}$.\n", - "Output Answer": [ - "${1, \\frac{25}{4}, \\frac{15}{2}, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set(((25/4), 1, 3*math.e,))\nsnd = set((1, (15/2), 3*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{6}{\\sqrt{\\pi }}, -7, -4, -5, 2, 1}$.\n", - "Output Answer": [ - "${-7, -5, -4, -\\frac{6}{\\sqrt{\\pi }}, 1, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(6/(math.sqrt(math.pi))), -7, -4, -5, 2, 1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{15}{2}, -10, 8, 7, \\frac{9}{2}, \\frac{7}{3}, 6.4, 0, -1, 2.6} \\cup {-\\frac{19}{5}, -4, -7, -9.2, \\frac{9}{2}, -1.15, \\frac{7}{3}, 8, 4, -1}$.\n", - "Output Answer": [ - "${-10, -9.2, -\\frac{15}{2}, -7, -4, -\\frac{19}{5}, -1.15, -1, 0, \\frac{7}{3}, 2.6, 4, \\frac{9}{2}, 6.4, 7, 8}$" - ], - "Output Program": [ - "fst = set((-(15/2), -10, 8, 7, (9/2), (7/3), 6.4, 0, -1, 2.6,))\nsnd = set((-(19/5), -4, -7, -9.2, (9/2), -1.15, (7/3), 8, 4, -1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 0, 4, -7 \\sqrt{2}, \\frac{17}{\\sqrt{3}}, 2, -4 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{17}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 0, 4, -7*math.sqrt(2), (17/(math.sqrt(3))), 2, -4*math.sqrt(5), 2*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x-0.5$ where $x \\sim $ \\text{PoissonDistribution}[0.6]\n", - "Output Answer": [ - "$0.94$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.6)\nprint(E(2.4*x-0.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-2 \\sqrt{5}, -8, -3 e}$.\n", - "Output Answer": [ - "${-3 e, -8, -2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), -8, -3*math.e\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 1, 16, 13}$.\n", - "Output Answer": [ - "$\\frac{2496}{815}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 1, 16, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${1, 2 \\pi, 8, 6, 0.2, \\frac{9}{2}, \\frac{6}{\\pi }}$.\n", - "Output Answer": [ - "${0.2, 1, \\frac{6}{\\pi }, \\frac{9}{2}, 6, 2 \\pi, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 2*math.pi, 8, 6, 0.2, (9/2), (6/math.pi)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-7, 2, -3, 3 \\log (2), 6, -\\frac{7}{5}, 1, 3, -4, -10, 1, \\sqrt{3}, 2, \\frac{23}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(1+\\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, 2, -3, 3*math.log(2), 6, -(7/5), 1, 3, -4, -10, 1, math.sqrt(3), 2, (23/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${7.99, 0, 9.693, 3 \\pi, -\\frac{7}{\\sqrt{3}}, -9, 5, -5} \\cup {-9, 0, 3 \\pi, -\\frac{7}{\\sqrt{3}}, 5, 7.99, 9.693}$.\n", - "Output Answer": [ - "${-9, -5, -\\frac{7}{\\sqrt{3}}, 0, 5, 7.99, 3 \\pi, 9.693}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.99, 0, 9.693, 3*math.pi, -(7/(math.sqrt(3))), -9, 5, -5,))\nsnd = set((-9, 0, 3*math.pi, -(7/(math.sqrt(3))), 5, 7.99, 9.693,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{29}{3}, 2 \\sqrt{5}, -10, -8, -7, 7} \\cup {-4, -10, -7, -3 \\sqrt{5}, 3, -\\frac{29}{3}, -8}$.\n", - "Output Answer": [ - "${-10, -\\frac{29}{3}, -8, -7, -3 \\sqrt{5}, -4, 3, 2 \\sqrt{5}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(29/3), 2*math.sqrt(5), -10, -8, -7, 7,))\nsnd = set((-4, -10, -7, -3*math.sqrt(5), 3, -(29/3), -8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.308,0.044,0.066,0.187,0.304\\}$ and $\\{0.008,0.487,0.028,0.09,0.131\\}$.", - "Output Answer": [ - "$1.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.308, 0.044, 0.066, 0.187, 0.304\ndistribution2 = 0.008, 0.487, 0.028, 0.09, 0.131\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${1, -\\frac{4}{\\pi }, -4, \\frac{36}{5}, 0, 7.766, 6, -7, -2} \\cup {10, 7.766, -4, 8, -\\frac{4}{\\pi }, \\frac{16}{5}, -7, -2}$.\n", - "Output Answer": [ - "${-7, -4, -2, -\\frac{4}{\\pi }, 0, 1, \\frac{16}{5}, 6, \\frac{36}{5}, 7.766, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -(4/math.pi), -4, (36/5), 0, 7.766, 6, -7, -2,))\nsnd = set((10, 7.766, -4, 8, -(4/math.pi), (16/5), -7, -2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, \\frac{25}{3}, \\frac{14}{3}}$.\n", - "Output Answer": [ - "$\\frac{1575}{263}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, (25/3), (14/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3, -1, -\\frac{21}{\\pi }, 4 \\sqrt{3}, \\frac{9}{\\sqrt{2}}, -2.2, 5, -5} \\cup {-10, -0.992, -3, 4., 4 \\sqrt{3}, 9, 2 \\log (2), -5, -5 \\sqrt{2}, -\\frac{21}{\\pi }, \\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-10, -5 \\sqrt{2}, -\\frac{21}{\\pi }, -5, -3, -2.2, -1, -0.992, 2 \\log (2), 3, 4., 5, \\frac{9}{\\sqrt{2}}, 4 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -1, -(21/math.pi), 4*math.sqrt(3), (9/(math.sqrt(2))), -2.2, 5, -5,))\nsnd = set((-10, -0.992, -3, 4., 4*math.sqrt(3), 9, 2*math.log(2), -5, -5*math.sqrt(2), -(21/math.pi), (9/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{55}{3}, \\frac{50}{3}, \\frac{31}{3}, 3}$.\n", - "Output Answer": [ - "$\\frac{204600}{27859}$" - ], - "Output Program": [ - "import statistics\nvalues = (55/3), (50/3), (31/3), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -2, -9, -3, 3 \\sqrt{3}, -5}$.\n", - "Output Answer": [ - "$9+3 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -2, -9, -3, 3*math.sqrt(3), -5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 6, 1}$.\n", - "Output Answer": [ - "$\\frac{342}{139}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 6, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{6}{5}, -10, -2, -3 e, -7, -1} \\cup {-\\frac{6}{5}, 0, -10, -2, 3 e, -8.47}$.\n", - "Output Answer": [ - "${-10, -8.47, -3 e, -7, -2, -\\frac{6}{5}, -1, 0, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(6/5), -10, -2, -3*math.e, -7, -1,))\nsnd = set((-(6/5), 0, -10, -2, 3*math.e, -8.47,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 1, -9, 0, -9, -3, -3, -3, 1, -9, -9, -9, -9, 3, -5, -9, -3, 3, 6, -3, 0}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 1, -9, 0, -9, -3, -3, -3, 1, -9, -9, -9, -9, 3, -5, -9, -3, 3, 6, -3, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -8, -7, 3, -4, -5, -7, 4}$.\n", - "Output Answer": [ - "$-\\frac{25}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -8, -7, 3, -4, -5, -7, 4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{2}{\\sqrt{3}}, 5, -2, -4, -8, 10, -3}$.\n", - "Output Answer": [ - "${-8, -4, -3, -2, -\\frac{2}{\\sqrt{3}}, 5, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -(2/(math.sqrt(3))), 5, -2, -4, -8, 10, -3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 10, 8, 1, 5, -3, 3, 9}$.\n", - "Output Answer": [ - "$\\frac{41}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 10, 8, 1, 5, -3, 3, 9\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, \\frac{29}{7}, \\frac{6}{5}, -\\frac{17}{\\sqrt{3}}, -\\frac{24}{\\pi }, -\\frac{13}{2}, -\\sqrt{5}, 2 \\pi, 10, 6, -6, 6, -5}$.\n", - "Output Answer": [ - "$10+\\frac{17}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, (29/7), (6/5), -(17/(math.sqrt(3))), -(24/math.pi), -(13/2), -math.sqrt(5), 2*math.pi, 10, 6, -6, 6, -5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 9, -10, 10}$.\n", - "Output Answer": [ - "$\\frac{1019}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 9, -10, 10\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, -6, 9, 14, 2, 11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{814}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -6, 9, 14, 2, 11\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -2, -6 \\sqrt{2}, 8, 6, \\frac{2}{\\sqrt{3}}, -\\frac{7}{e}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -2, -6*math.sqrt(2), 8, 6, (2/(math.sqrt(3))), -(7/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 5, 14, 8}$.\n", - "Output Answer": [ - "$\\frac{10080}{1279}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 5, 14, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.1 x-2.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$-2.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(-2.1*x-2.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 4, 0, -3, -3}$.\n", - "Output Answer": [ - "$\\frac{87}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 4, 0, -3, -3\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${4 \\log (2), \\frac{16}{3}}$.\n", - "Output Answer": [ - "${4 \\log (2), \\frac{16}{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.log(2), (16/3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -8, -9.702, -\\frac{24}{5}, 0, \\pi} \\cup {-5, \\pi, 6, -9.702, -8, -\\frac{24}{5}, -3}$.\n", - "Output Answer": [ - "${-9.702, -8, -5, -\\frac{24}{5}, -3, 0, \\pi, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -8, -9.702, -(24/5), 0, math.pi,))\nsnd = set((-5, math.pi, 6, -9.702, -8, -(24/5), -3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 0, -2 \\sqrt{2}, 10 \\log (2)} \\setminus {-\\frac{40}{7}, 2 \\sqrt{3}, 6, 10 \\log (2), 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5, -2 \\sqrt{2}, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 0, -2*math.sqrt(2), 10*math.log(2),))\nsnd = set((-(40/7), 2*math.sqrt(3), 6, 10*math.log(2), 4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, 4, 3, -13}$.\n", - "Output Answer": [ - "$\\frac{755}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 4, 3, -13\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, -\\frac{27}{5}, 0, 0, -3, -7, 7 \\log (2), -8, 4, \\frac{14}{\\sqrt{3}}, -10, -7, -2, -3 e, 6}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -(27/5), 0, 0, -3, -7, 7*math.log(2), -8, 4, (14/(math.sqrt(3))), -10, -7, -2, -3*math.e, 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{29}{5}, \\frac{39}{7}, -9, -2, -1, -\\frac{2}{e}, 9.41, 5.517} \\setminus {\\frac{39}{7}, -\\frac{29}{5}, 5.517, 2, \\frac{12}{e}, 9.41}$.\n", - "Output Answer": [ - "${-9, -2, -1, -\\frac{2}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(29/5), (39/7), -9, -2, -1, -(2/math.e), 9.41, 5.517,))\nsnd = set(((39/7), -(29/5), 5.517, 2, (12/math.e), 9.41,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x^2+4.2 x+2.6$ where $x \\sim $ \\text{PoissonDistribution}[3.6]\n", - "Output Answer": [ - "$88.93$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.6)\nprint(E(4.3*x**2+4.2*x+2.6))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-8, \\frac{23}{e}, 7, -9, 1.79} \\cup {-9, -8, -2, \\frac{23}{e}, 1.79}$.\n", - "Output Answer": [ - "${-9, -8, -2, 1.79, 7, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, (23/math.e), 7, -9, 1.79,))\nsnd = set((-9, -8, -2, (23/math.e), 1.79,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -\\frac{13}{3}, 8, -6, -\\sqrt{5}, -2}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(13/3), 8, -6, -math.sqrt(5), -2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, 5, -4, 10, 3, 10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{406}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 5, -4, 10, 3, 10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 6, -4, -\\frac{1}{e}}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 6, -4, -(1/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4, -9, \\frac{30}{\\pi }, 10, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4-\\frac{1}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -9, (30/math.pi), 10, -(12/(math.sqrt(math.pi))), -(1/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -2 \\pi, \\frac{6}{\\sqrt{5}}, -3, -\\frac{2}{7}, 2 \\sqrt{5}, 8, \\frac{61}{7}, -\\frac{16}{\\sqrt{\\pi }}, 4 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{6}{\\sqrt{5}}-\\frac{2}{7}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -2*math.pi, (6/(math.sqrt(5))), -3, -(2/7), 2*math.sqrt(5), 8, (61/7), -(16/(math.sqrt(math.pi))), 4*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${13 \\log (2), -\\frac{13}{\\sqrt{5}}, -5, 2, -4 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -5, -4 \\sqrt{3}, -5}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 13*math.log(2), -(13/(math.sqrt(5))), -5, 2, -4*math.sqrt(2), -(7/(math.sqrt(2))), -5, -4*math.sqrt(3), -5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x+0.2$ where $x \\sim $ \\text{NormalDistribution}[-1.8,1.]\n", - "Output Answer": [ - "$-3.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 1.)\nprint(E(1.9*x+0.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 729, 25, 10}$.\n", - "Output Answer": [ - "$6 \\sqrt[4]{2} \\sqrt{3} 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 729, 25, 10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x^3+1.7 x^2-3.9 x-1.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$3.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(2.5*x**3+1.7*x**2-3.9*x-1.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${15, 15, 13}$.\n", - "Output Answer": [ - "$\\frac{4}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 15, 13\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.162,0.143,0.123,0.124,0.147,0.13\\}$ and $\\{0.119,0.106,0.151,0.148,0.057,0.142\\}$.", - "Output Answer": [ - "$0.07$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.162, 0.143, 0.123, 0.124, 0.147, 0.13\ndistribution2 = 0.119, 0.106, 0.151, 0.148, 0.057, 0.142\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{29}{2}, 6, \\frac{23}{2}, \\frac{31}{2}}$.\n", - "Output Answer": [ - "$\\frac{496248}{48025}$" - ], - "Output Program": [ - "import statistics\nvalues = (29/2), 6, (23/2), (31/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -3, 4, 0, 7, -4, \\frac{3}{\\sqrt{2}}} \\cup {-9, -8, -4, 1, 0.82, 2 \\sqrt{2}, 3}$.\n", - "Output Answer": [ - "${-9, -8, -4, -3, 0, 0.82, 1, \\frac{3}{\\sqrt{2}}, 2 \\sqrt{2}, 3, 4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -3, 4, 0, 7, -4, (3/(math.sqrt(2))),))\nsnd = set((-9, -8, -4, 1, 0.82, 2*math.sqrt(2), 3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -6, 3 \\sqrt{5}, 4 e} \\setminus {2, 4 e, -3 \\sqrt{5}, -9, -7, -4}$.\n", - "Output Answer": [ - "${-6, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -6, 3*math.sqrt(5), 4*math.e,))\nsnd = set((2, 4*math.e, -3*math.sqrt(5), -9, -7, -4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, \\frac{23}{3}}$.\n", - "Output Answer": [ - "$\\frac{368}{47}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, (23/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.8 x+3.4$ where $x \\sim $ \\text{NormalDistribution}[-1.6,2.1]\n", - "Output Answer": [ - "$2.12$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 2.1)\nprint(E(0.8*x+3.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{60}{7}, -\\frac{3}{7}, -\\frac{50}{7}, -\\frac{50}{7}, -\\frac{3}{7}, -\\frac{50}{7}, -\\frac{3}{7}, -\\frac{3}{7}, -\\frac{50}{7}, -\\frac{50}{7}, \\frac{60}{7}, -\\frac{3}{7}, -\\frac{3}{7}, -\\frac{50}{7}, -\\frac{50}{7}, \\frac{60}{7}, \\frac{60}{7}, -\\frac{3}{7}, \\frac{60}{7}, -\\frac{3}{7}, -\\frac{50}{7}, -\\frac{3}{7}, -\\frac{2}{7}, \\frac{60}{7}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{3}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (60/7), -(3/7), -(50/7), -(50/7), -(3/7), -(50/7), -(3/7), -(3/7), -(50/7), -(50/7), (60/7), -(3/7), -(3/7), -(50/7), -(50/7), (60/7), (60/7), -(3/7), (60/7), -(3/7), -(50/7), -(3/7), -(2/7), (60/7)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 9, -2, 0, -4, 7}$.\n", - "Output Answer": [ - "$\\frac{1}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 9, -2, 0, -4, 7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-4, -6 \\sqrt{2}, 7, -6, 6 \\sqrt{2}, -1, -\\frac{8}{\\sqrt{5}}, -1, -9, -6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-4-\\frac{8}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, -6*math.sqrt(2), 7, -6, 6*math.sqrt(2), -1, -(8/(math.sqrt(5))), -1, -9, -6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-3.6, 5, 4, \\frac{10}{3}, -3 \\pi, -\\frac{16}{\\sqrt{3}}, -2} \\setminus {5, -\\frac{16}{\\sqrt{3}}, 6, -2, -3, 8}$.\n", - "Output Answer": [ - "${-3 \\pi, -3.6, \\frac{10}{3}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3.6, 5, 4, (10/3), -3*math.pi, -(16/(math.sqrt(3))), -2,))\nsnd = set((5, -(16/(math.sqrt(3))), 6, -2, -3, 8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.068,0.064,0.083,0.213,0.208,0.108,0.106,0.023,0.076\\}$ and $\\{0.13,0.111,0.072,0.081,0.09,0.033,0.211,0.052,0.089\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.068, 0.064, 0.083, 0.213, 0.208, 0.108, 0.106, 0.023, 0.076\ndistribution2 = 0.13, 0.111, 0.072, 0.081, 0.09, 0.033, 0.211, 0.052, 0.089\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{21}{5}, \\pi, -5.27, 2, -8, 0} \\cup {-5, 3, -8, \\pi, -5.27, -\\frac{47}{5}}$.\n", - "Output Answer": [ - "${-\\frac{47}{5}, -8, -5.27, -5, -\\frac{21}{5}, 0, 2, 3, \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(21/5), math.pi, -5.27, 2, -8, 0,))\nsnd = set((-5, 3, -8, math.pi, -5.27, -(47/5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{47}{3}, 12, \\frac{56}{3}, 3}$.\n", - "Output Answer": [ - "$\\frac{31584}{4217}$" - ], - "Output Program": [ - "import statistics\nvalues = (47/3), 12, (56/3), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, \\frac{5}{2}, \\frac{17}{2}, 5}$.\n", - "Output Answer": [ - "$\\frac{170}{33}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, (5/2), (17/2), 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.187,0.131,0.097,0.077,0.136,0.215,0.066\\}$ and $\\{0.051,0.054,0.166,0.183,0.115,0.193,0.2\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.187, 0.131, 0.097, 0.077, 0.136, 0.215, 0.066\ndistribution2 = 0.051, 0.054, 0.166, 0.183, 0.115, 0.193, 0.2\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\pi, 1, 2 \\sqrt{2}, -5}$.\n", - "Output Answer": [ - "$5+\\pi$" - ], - "Output Program": [ - "import math\n\nvalues = math.pi, 1, 2*math.sqrt(2), -5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 17, 17}$.\n", - "Output Answer": [ - "$\\frac{510}{37}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 17, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${10, -4, -8, 6, 3, 2}$.\n", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 10, -4, -8, 6, 3, 2\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{17}{2}, 6, \\frac{17}{2}, \\frac{5}{2}}$.\n", - "Output Answer": [ - "$\\frac{2040}{409}$" - ], - "Output Program": [ - "import statistics\nvalues = (17/2), 6, (17/2), (5/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-3.27, -7.992, -5.036, 8.776, -2.489, 1.717, 9.51, 0.923, -9.649} \\cap {4.254, 2.641, 8.744, -1.403, -4.086, 1.717, -5.35, -1.848, 6.886}$.\n", - "Output Answer": [ - "${1.717}$" - ], - "Output Program": [ - "fst = set((-3.27, -7.992, -5.036, 8.776, -2.489, 1.717, 9.51, 0.923, -9.649,))\nsnd = set((4.254, 2.641, 8.744, -1.403, -4.086, 1.717, -5.35, -1.848, 6.886,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.7 x-5.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-5.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(-4.7*x-5.4))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${6.6, 0, -\\sqrt{2}, -2 e, 9, e, -4} \\setminus {-5, -8, e, 0}$.\n", - "Output Answer": [ - "${-2 e, -4, -\\sqrt{2}, 6.6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.6, 0, -math.sqrt(2), -2*math.e, 9, math.e, -4,))\nsnd = set((-5, -8, math.e, 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, -4, 13}$.\n", - "Output Answer": [ - "$79$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -4, 13\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, 5, 9}$.\n", - "Output Answer": [ - "$52$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 5, 9\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, 15, -15, -1, -10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1473}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 15, -15, -1, -10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\pi, -7 \\sqrt{2}, 2 \\sqrt{5}}$.", - "Output Answer": [ - "$-3 \\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.pi, -7*math.sqrt(2), 2*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${59049, -64, 9, 4, 4096}$.\n", - "Output Answer": [ - "$144 \\sqrt[5]{-1} 3^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 59049, -64, 9, 4, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 9, -9, 3 e, 2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 9, -9, 3*math.e, 2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{17}{2}, -2 \\sqrt{5}, 0, -\\frac{7}{\\sqrt{3}}, \\frac{20}{3}, -5, \\sqrt{5}, -\\frac{1}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{7}{\\sqrt{3}}-\\frac{1}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(17/2), -2*math.sqrt(5), 0, -(7/(math.sqrt(3))), (20/3), -5, math.sqrt(5), -(1/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${3 \\log (2), 11 \\log (2), 12 \\log (2), -12 \\log (2), -4 \\log (2)} \\cap {\\log (2), 3 \\log (2), 8 \\log (2), -4 \\log (2), -3 \\log (2)}$.\n", - "Output Answer": [ - "${-4 \\log (2), 3 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.log(2), 11*math.log(2), 12*math.log(2), -12*math.log(2), -4*math.log(2),))\nsnd = set((math.log(2), 3*math.log(2), 8*math.log(2), -4*math.log(2), -3*math.log(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -3, 6, -2}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -3, 6, -2\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.081,0.164,0.34\\}$ and $\\{0.428,0.204,0.154\\}$.", - "Output Answer": [ - "$0.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.081, 0.164, 0.34\ndistribution2 = 0.428, 0.204, 0.154\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${2, -2, -1, -5, -3, -7, -9, 9, 4} \\cap {-7, 7, 4, -9, 5, 9, 0, -1}$.\n", - "Output Answer": [ - "${-9, -7, -1, 4, 9}$" - ], - "Output Program": [ - "fst = set((2, -2, -1, -5, -3, -7, -9, 9, 4,))\nsnd = set((-7, 7, 4, -9, 5, 9, 0, -1,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\sqrt{2}, \\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{3}{\\sqrt{2}}-3 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.sqrt(2), (3/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -1, 3, -5, 0}$.\n", - "Output Answer": [ - "$\\frac{3}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -1, 3, -5, 0\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.214,0.36,0.257\\}$ and $\\{0.109,0.191,0.383\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.214, 0.36, 0.257\ndistribution2 = 0.109, 0.191, 0.383\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 8, 12}$.\n", - "Output Answer": [ - "$\\frac{216}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 8, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.009,0.158,0.112,0.113,0.089,0.024,0.086,0.116,0.108,0.041\\}$ and $\\{0.103,0.018,0.165,0.084,0.052,0.087,0.098,0.139,0.048,0.138\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.009, 0.158, 0.112, 0.113, 0.089, 0.024, 0.086, 0.116, 0.108, 0.041\ndistribution2 = 0.103, 0.018, 0.165, 0.084, 0.052, 0.087, 0.098, 0.139, 0.048, 0.138\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, -8, 5, -10, 5, 8, 8, 8, -8, 8, 8, -10, 5, 8, 8, -8, 8, -10, 5, 5, -10, 8, 8, 5, 8, 5, 5, 8, 5}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, -8, 5, -10, 5, 8, 8, 8, -8, 8, 8, -10, 5, 8, 8, -8, 8, -10, 5, 5, -10, 8, 8, 5, 8, 5, 5, 8, 5\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, 8, -125, -729}$.\n", - "Output Answer": [ - "$30 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 8, -125, -729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -4, -4}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -4, -4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\sqrt{3}, -9, 5, 9, \\frac{9}{2}, 4, 4, 7}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(3), -9, 5, 9, (9/2), 4, 4, 7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${4 \\log (2), -6 \\log (2), 10 \\log (2), -3 \\log (2), 3 \\log (2), -9 \\log (2), 7 \\log (2), 9 \\log (2), -11 \\log (2), -10 \\log (2)} \\cap {-\\log (2), 2 \\log (2), -12 \\log (2), 10 \\log (2), -2 \\log (2), 7 \\log (2), 4 \\log (2), -9 \\log (2), 11 \\log (2), -10 \\log (2), -5 \\log (2)}$.\n", - "Output Answer": [ - "${-10 \\log (2), -9 \\log (2), 4 \\log (2), 7 \\log (2), 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.log(2), -6*math.log(2), 10*math.log(2), -3*math.log(2), 3*math.log(2), -9*math.log(2), 7*math.log(2), 9*math.log(2), -11*math.log(2), -10*math.log(2),))\nsnd = set((-math.log(2), 2*math.log(2), -12*math.log(2), 10*math.log(2), -2*math.log(2), 7*math.log(2), 4*math.log(2), -9*math.log(2), 11*math.log(2), -10*math.log(2), -5*math.log(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, -13, 10, -3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{341}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -13, 10, -3\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.043,0.376,0.062,0.034,0.194,0.187\\}$ and $\\{0.215,0.053,0.385,0.109,0.044,0.145\\}$.", - "Output Answer": [ - "$1.01$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.043, 0.376, 0.062, 0.034, 0.194, 0.187\ndistribution2 = 0.215, 0.053, 0.385, 0.109, 0.044, 0.145\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-5.23 < -3.5 x-2.1 < 5.87$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8].", - "Output Answer": [ - "$0.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(P((-5.23 < -3.5*x-2.1) & (-3.5*x-2.1 < 5.87)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 3, 3, -9, 3, -4, 3, -3, 3, -4, 3, -4, 3, -7, -3, 1, -1, -3, -9, -1, 3, -3, -7, -1, -9, 3, -7}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 3, 3, -9, 3, -4, 3, -3, 3, -4, 3, -4, 3, -7, -3, 1, -1, -3, -9, -1, 3, -3, -7, -1, -9, 3, -7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{16}{e}, -\\pi, \\frac{26}{e}, 3} \\setminus {\\frac{1}{e}, \\frac{32}{5}, 3}$.\n", - "Output Answer": [ - "${-\\pi, \\frac{16}{e}, \\frac{26}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((16/math.e), -math.pi, (26/math.e), 3,))\nsnd = set(((1/math.e), (32/5), 3,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\pi, 4, 1, -3, 3} \\setminus {-\\pi, -4, 0, 4}$.\n", - "Output Answer": [ - "${-3, 1, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, 4, 1, -3, 3,))\nsnd = set((-math.pi, -4, 0, 4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, -9, -3 \\sqrt{2}, 2 \\sqrt{2}, \\frac{10}{\\pi }, -2, 0, 2, 5, -10, \\frac{46}{5}, -1, 2, 3 \\pi}$.\n", - "Output Answer": [ - "$10+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -9, -3*math.sqrt(2), 2*math.sqrt(2), (10/math.pi), -2, 0, 2, 5, -10, (46/5), -1, 2, 3*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -2, -7, -5}$.\n", - "Output Answer": [ - "$-\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -2, -7, -5\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, \\frac{35}{3}}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import statistics\nvalues = 5, (35/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{4}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, -\\frac{6}{\\sqrt{5}}, 4 \\sqrt{5}, \\frac{12}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{8} \\left(4 \\sqrt{5}-\\frac{29}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(4/(math.sqrt(5))), -(11/(math.sqrt(5))), -(22/(math.sqrt(5))), -(19/(math.sqrt(5))), (21/(math.sqrt(5))), -(6/(math.sqrt(5))), 4*math.sqrt(5), (12/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, \\frac{10}{e}, -9, -6, -\\frac{10}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$9+\\frac{10}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, (10/math.e), -9, -6, -(10/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{26}{e}, -5, 6, -\\frac{68}{7}, -9, 9} \\setminus {-5, 9, 6}$.\n", - "Output Answer": [ - "${-\\frac{68}{7}, -\\frac{26}{e}, -9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(26/math.e), -5, 6, -(68/7), -9, 9,))\nsnd = set((-5, 9, 6,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-10, -\\frac{17}{5}, \\frac{18}{e}, 3, -8, -6} \\setminus {3, 1, -10, \\frac{18}{e}, -9, -\\frac{17}{5}}$.\n", - "Output Answer": [ - "${-8, -6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, -(17/5), (18/math.e), 3, -8, -6,))\nsnd = set((3, 1, -10, (18/math.e), -9, -(17/5),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, 25, 1, -3}$.\n", - "Output Answer": [ - "$\\sqrt[4]{-6} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 25, 1, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-6, -8, -1, -4, 1, -3, 5, -9} \\cap {-2, -4, -7, 0, -10, -8, -3, -9, 7, 1}$.\n", - "Output Answer": [ - "${-9, -8, -4, -3, 1}$" - ], - "Output Program": [ - "fst = set((-6, -8, -1, -4, 1, -3, 5, -9,))\nsnd = set((-2, -4, -7, 0, -10, -8, -3, -9, 7, 1,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{22}{\\sqrt{5}}, 7 \\sqrt{2}, -4, 5, -\\frac{1}{3}, -2.336, -\\frac{3}{2}} \\setminus {\\frac{19}{\\sqrt{5}}, 9, -5, -6, -\\frac{3}{2}, 5, -2}$.\n", - "Output Answer": [ - "${-4, -2.336, -\\frac{1}{3}, \\frac{22}{\\sqrt{5}}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((22/(math.sqrt(5))), 7*math.sqrt(2), -4, 5, -(1/3), -2.336, -(3/2),))\nsnd = set(((19/(math.sqrt(5))), 9, -5, -6, -(3/2), 5, -2,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4, \\frac{5}{\\pi }, \\frac{13}{2}, 0, -\\frac{11}{5}} \\setminus {-6 \\log (2), \\frac{5}{\\pi }, \\frac{13}{2}}$.\n", - "Output Answer": [ - "${-4, -\\frac{11}{5}, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, (5/math.pi), (13/2), 0, -(11/5),))\nsnd = set((-6*math.log(2), (5/math.pi), (13/2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -\\frac{13}{4}, 1, 2, -4 \\sqrt{5}, -\\frac{23}{\\pi }, -\\frac{31}{4}}$.\n", - "Output Answer": [ - "$2+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -(13/4), 1, 2, -4*math.sqrt(5), -(23/math.pi), -(31/4)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-8, -2 \\sqrt{2}, -\\frac{64}{7}, 4, \\frac{10}{e}, -\\frac{24}{\\pi }, -5 \\sqrt{2}}$.", - "Output Answer": [ - "$-5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, -2*math.sqrt(2), -(64/7), 4, (10/math.e), -(24/math.pi), -5*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.256,0.234,0.036,0.044,0.189,0.02,0.138,0.08\\}$ and $\\{0.148,0.008,0.162,0.072,0.152,0.029,0.379,0.003\\}$.", - "Output Answer": [ - "$0.97$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.256, 0.234, 0.036, 0.044, 0.189, 0.02, 0.138, 0.08\ndistribution2 = 0.148, 0.008, 0.162, 0.072, 0.152, 0.029, 0.379, 0.003\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, -8, \\frac{9}{\\sqrt{2}}, 4 \\sqrt{2}} \\setminus {0, -3, -1, -2, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-8, \\frac{9}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -8, (9/(math.sqrt(2))), 4*math.sqrt(2),))\nsnd = set((0, -3, -1, -2, 4*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\sqrt{5}, 0, -9, 0.8, 8, \\sqrt{5}, 4, 4 \\sqrt{2}} \\cup {2 \\sqrt{5}, 4, -7, 8, -9}$.\n", - "Output Answer": [ - "${-9, -7, 0, 0.8, \\sqrt{5}, 4, 2 \\sqrt{5}, 4 \\sqrt{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(5), 0, -9, 0.8, 8, math.sqrt(5), 4, 4*math.sqrt(2),))\nsnd = set((2*math.sqrt(5), 4, -7, 8, -9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-12 \\log (2), -\\frac{11}{e}, 0}$.\n", - "Output Answer": [ - "$12 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -12*math.log(2), -(11/math.e), 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{5}, \\frac{22}{\\sqrt{5}}, 4 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, 3 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, 3 \\sqrt{5}, 4 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, 3 \\sqrt{5}, 3 \\sqrt{5}, 3 \\sqrt{5}, 4 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, 3 \\sqrt{5}, \\frac{22}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, 3 \\sqrt{5}, 3 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{3 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(5), (22/(math.sqrt(5))), 4*math.sqrt(5), (14/(math.sqrt(5))), 3*math.sqrt(5), (14/(math.sqrt(5))), (22/(math.sqrt(5))), (14/(math.sqrt(5))), 3*math.sqrt(5), 4*math.sqrt(5), (14/(math.sqrt(5))), 3*math.sqrt(5), 3*math.sqrt(5), 3*math.sqrt(5), 4*math.sqrt(5), (14/(math.sqrt(5))), 3*math.sqrt(5), (22/(math.sqrt(5))), (22/(math.sqrt(5))), 3*math.sqrt(5), 3*math.sqrt(5), (14/(math.sqrt(5))), (22/(math.sqrt(5))), (14/(math.sqrt(5))), (22/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3.01, -6, 7, 3 \\sqrt{3}, -4.12, \\frac{15}{\\pi }, \\sqrt{3}, -\\frac{11}{2}, 5, -7, -5} \\cup {\\frac{4}{3}, 10, \\sqrt{3}, -3.01, -\\frac{25}{\\pi }, 6.82, -6 \\sqrt{2}, 7, 5, 3 \\sqrt{3}, -\\frac{11}{2}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -\\frac{25}{\\pi }, -7, -6, -\\frac{11}{2}, -5, -4.12, -3.01, \\frac{4}{3}, \\sqrt{3}, \\frac{15}{\\pi }, 5, 3 \\sqrt{3}, 6.82, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3.01, -6, 7, 3*math.sqrt(3), -4.12, (15/math.pi), math.sqrt(3), -(11/2), 5, -7, -5,))\nsnd = set(((4/3), 10, math.sqrt(3), -3.01, -(25/math.pi), 6.82, -6*math.sqrt(2), 7, 5, 3*math.sqrt(3), -(11/2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{2}{\\sqrt{3}}, -\\frac{11}{\\sqrt{2}}, 8, -5, 3 \\sqrt{2}, 5 \\sqrt{2}, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$8+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(2/(math.sqrt(3))), -(11/(math.sqrt(2))), 8, -5, 3*math.sqrt(2), 5*math.sqrt(2), -4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 9, 1000}$.\n", - "Output Answer": [ - "$10\\ 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 9, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.3 x^3+0.8 x^2+2.1 x+3.2$ where $x \\sim $ \\text{BetaDistribution}[1.4,1.1]\n", - "Output Answer": [ - "$3.73$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.4, 1.1)\nprint(E(-3.3*x**3+0.8*x**2+2.1*x+3.2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{7}{2}, 4 \\log (2), -9, 3 e, -3} \\setminus {-3, 11 \\log (2), -\\frac{7}{2}, -4}$.\n", - "Output Answer": [ - "${-9, 4 \\log (2), 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(7/2), 4*math.log(2), -9, 3*math.e, -3,))\nsnd = set((-3, 11*math.log(2), -(7/2), -4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 3, 4} \\setminus {7, -2.1, -8, 3, -\\frac{66}{7}, -\\frac{9}{2}, -6}$.\n", - "Output Answer": [ - "${4}$" - ], - "Output Program": [ - "fst = set((-8, 3, 4,))\nsnd = set((7, -2.1, -8, 3, -(66/7), -(9/2), -6,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${9, \\frac{17}{2}, 6, -6, \\frac{19}{e}, -\\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(6+\\frac{19}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, (17/2), 6, -6, (19/math.e), -math.pi\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{7}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -2 \\sqrt{3}, \\frac{10}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, -2 \\sqrt{3}, -\\frac{2}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -2 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, \\frac{7}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{7}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (7/(math.sqrt(3))), (10/(math.sqrt(3))), -2*math.sqrt(3), (10/(math.sqrt(3))), (13/(math.sqrt(3))), (7/(math.sqrt(3))), (7/(math.sqrt(3))), (7/(math.sqrt(3))), -(2/(math.sqrt(3))), (13/(math.sqrt(3))), (7/(math.sqrt(3))), (10/(math.sqrt(3))), (7/(math.sqrt(3))), (13/(math.sqrt(3))), -2*math.sqrt(3), -(2/(math.sqrt(3))), (7/(math.sqrt(3))), (7/(math.sqrt(3))), -(13/(math.sqrt(3))), (7/(math.sqrt(3))), (10/(math.sqrt(3))), (13/(math.sqrt(3))), (13/(math.sqrt(3))), -(2/(math.sqrt(3))), -(13/(math.sqrt(3))), -2*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), (7/(math.sqrt(3))), (13/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -6, 0, 0}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -6, 0, 0\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 e, -4 e, -2 e, e, -e}$.\n", - "Output Answer": [ - "$-\\frac{9 e}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.e, -4*math.e, -2*math.e, math.e, -math.e\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x+2.9$ where $x \\sim $ \\text{NormalDistribution}[-0.8,2.]\n", - "Output Answer": [ - "$2.42$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 2.)\nprint(E(0.6*x+2.9))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-7, 8, \\frac{1}{4}, -\\frac{5}{\\sqrt{3}}, -5 \\sqrt{3}, -2}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -7, -\\frac{5}{\\sqrt{3}}, -2, \\frac{1}{4}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 8, (1/4), -(5/(math.sqrt(3))), -5*math.sqrt(3), -2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, 216, 7, 6561}$.\n", - "Output Answer": [ - "$81\\ 2^{3/4} \\sqrt[4]{21}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, 216, 7, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, -\\frac{17}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{\\sqrt{\\pi }},-\\frac{17}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(16/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), -(17/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{53}{3}, \\frac{16}{3}, 13, \\frac{41}{3}}$.\n", - "Output Answer": [ - "$\\frac{1807936}{178171}$" - ], - "Output Program": [ - "import statistics\nvalues = (53/3), (16/3), 13, (41/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 13, 8}$.\n", - "Output Answer": [ - "$\\frac{1560}{131}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 13, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.152,0.164,0.055,0.145,0.124,0.216\\}$ and $\\{0.143,0.087,0.171,0.319,0.013,0.257\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.152, 0.164, 0.055, 0.145, 0.124, 0.216\ndistribution2 = 0.143, 0.087, 0.171, 0.319, 0.013, 0.257\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${7, -5, -\\frac{25}{\\pi }, -3, -4 \\log (2), -\\frac{6}{\\sqrt{5}}, -1, 0, -1, 2}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\frac{6}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -5, -(25/math.pi), -3, -4*math.log(2), -(6/(math.sqrt(5))), -1, 0, -1, 2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-5 \\sqrt{3}, 0}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, 0}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(3), 0\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $0.34 < 4. x-3.3 < 0.38$ where $x \\sim $ \\text{BetaDistribution}[1.8,1.6].", - "Output Answer": [ - "$0.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.8, 1.6)\nprint(P((0.34 < 4.*x-3.3) & (4.*x-3.3 < 0.38)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, -7, -5, -5, 2, -5, 2, -7, 2, 2, 0, 0, 0, -5, -2, 2, 0, 2, 2, 2, -2, 2, 2, 0}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, -7, -5, -5, 2, -5, 2, -7, 2, 2, 0, 0, 0, -5, -2, 2, 0, 2, 2, 2, -2, 2, 2, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${9, -7, \\frac{13}{\\sqrt{2}}, -\\frac{6}{7}, -4 \\sqrt{3}, 8 \\log (2), 1} \\cup {-7, -\\frac{24}{7}, 8 \\log (2), 1, -3 e, 9, -5 \\sqrt{2}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 e, -5 \\sqrt{2}, -7, -4 \\sqrt{3}, -\\frac{24}{7}, -\\frac{6}{7}, 1, 8 \\log (2), 9, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -7, (13/(math.sqrt(2))), -(6/7), -4*math.sqrt(3), 8*math.log(2), 1,))\nsnd = set((-7, -(24/7), 8*math.log(2), 1, -3*math.e, 9, -5*math.sqrt(2), -4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2, -\\frac{47}{5}, -2, -7, -\\frac{24}{e}, -3.9} \\cup {8, -3.9, -\\frac{47}{5}, -7, -2}$.\n", - "Output Answer": [ - "${-\\frac{47}{5}, -\\frac{24}{e}, -7, -3.9, -2, 2, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -(47/5), -2, -7, -(24/math.e), -3.9,))\nsnd = set((8, -3.9, -(47/5), -7, -2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, \\frac{22}{5}, -8, \\frac{41}{5}, \\frac{14}{5}, -\\frac{47}{5}}$.\n", - "Output Answer": [ - "$-\\frac{11}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, (22/5), -8, (41/5), (14/5), -(47/5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{19}{3}, \\frac{20}{3}, \\frac{14}{3}}$.\n", - "Output Answer": [ - "$\\frac{2660}{463}$" - ], - "Output Program": [ - "import statistics\nvalues = (19/3), (20/3), (14/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.426,0.165,0.105,0.205\\}$ and $\\{0.246,0.115,0.241,0.294\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.426, 0.165, 0.105, 0.205\ndistribution2 = 0.246, 0.115, 0.241, 0.294\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{15}{2}, \\frac{1}{4}, -\\frac{7}{2}, -\\frac{23}{4}}$.\n", - "Output Answer": [ - "$-\\frac{33}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(15/2), (1/4), -(7/2), -(23/4)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.487,0.299,0.131\\}$ and $\\{0.125,0.322,0.209\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.487, 0.299, 0.131\ndistribution2 = 0.125, 0.322, 0.209\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, -4, -15, 14}$.\n", - "Output Answer": [ - "$143$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -4, -15, 14\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.103,0.133,0.153,0.038,0.064,0.28\\}$ and $\\{0.072,0.168,0.238,0.211,0.051,0.133\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.103, 0.133, 0.153, 0.038, 0.064, 0.28\ndistribution2 = 0.072, 0.168, 0.238, 0.211, 0.051, 0.133\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{2}, \\frac{6}{\\sqrt{\\pi }}, 5, 3, 0} \\setminus {-8, 5, -7}$.\n", - "Output Answer": [ - "${0, 3, \\frac{6}{\\sqrt{\\pi }}, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), (6/(math.sqrt(math.pi))), 5, 3, 0,))\nsnd = set((-8, 5, -7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{e}, -8, 0, 10, -\\frac{1}{2}, 8, -\\frac{22}{e}, 6}$.\n", - "Output Answer": [ - "${-\\frac{22}{e}, -8, -\\frac{13}{e}, -\\frac{1}{2}, 0, 6, 8, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/math.e), -8, 0, 10, -(1/2), 8, -(22/math.e), 6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x-1.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$-1.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(2.5*x-1.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-7, -14, -2, -1}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{106}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -14, -2, -1\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, -2 \\sqrt{5}, -\\sqrt{5}, -3 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, -2 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, -2 \\sqrt{5}, 2 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, -4 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), -2*math.sqrt(5), -math.sqrt(5), -3*math.sqrt(5), math.sqrt(5), math.sqrt(5), -2*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), -2*math.sqrt(5), 2*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), -4*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{4}{\\sqrt{3}}, -9, -4, -8, 4 \\sqrt{3}} \\setminus {4, -8, 0, -\\frac{4}{\\sqrt{3}}, -4}$.\n", - "Output Answer": [ - "${-9, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/(math.sqrt(3))), -9, -4, -8, 4*math.sqrt(3),))\nsnd = set((4, -8, 0, -(4/(math.sqrt(3))), -4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 14, -2, 2, 0}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{19}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 14, -2, 2, 0\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{7}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, \\frac{12}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{29}{7 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(7/(math.sqrt(5))), -(11/(math.sqrt(5))), (14/(math.sqrt(5))), (8/(math.sqrt(5))), (12/(math.sqrt(5))), (21/(math.sqrt(5))), -(8/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -5 \\sqrt{3}, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -5*math.sqrt(3), -math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2 e, 4, 8, -3} \\setminus {-4, 5 \\log (2), -3, 10, -2 e}$.\n", - "Output Answer": [ - "${4, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, 4, 8, -3,))\nsnd = set((-4, 5*math.log(2), -3, 10, -2*math.e,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.145,0.201,0.232,0.207\\}$ and $\\{0.046,0.014,0.121,0.437\\}$.", - "Output Answer": [ - "$0.65$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.145, 0.201, 0.232, 0.207\ndistribution2 = 0.046, 0.014, 0.121, 0.437\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, 0, 12, 7}$.\n", - "Output Answer": [ - "$\\frac{299}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 0, 12, 7\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2 \\sqrt{5}, 7, 2 \\pi, 1, -\\frac{1}{e}, -1, -4}$.\n", - "Output Answer": [ - "${-4, -1, -\\frac{1}{e}, 1, 2 \\sqrt{5}, 2 \\pi, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(5), 7, 2*math.pi, 1, -(1/math.e), -1, -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 14, 15, -8}$.\n", - "Output Answer": [ - "$\\frac{1427}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 14, 15, -8\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${0, -6, 5, -13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{181}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -6, 5, -13\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${512, 6, -1000}$.\n", - "Output Answer": [ - "$80 \\sqrt[3]{-6}$" - ], - "Output Program": [ - "import math\n\nvalues = 512, 6, -1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\pi, 0, 3 \\pi, -2 \\pi, \\pi, 0}$.\n", - "Output Answer": [ - "$\\frac{\\pi }{6}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.pi, 0, 3*math.pi, -2*math.pi, math.pi, 0\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\sqrt{2}, -\\frac{15}{4}, 6}$.", - "Output Answer": [ - "$-\\frac{15}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.sqrt(2), -(15/4), 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x-4.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$-2.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(2.1*x-4.3))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-8, \\frac{36}{5}, 6, 2} \\cup {-8, 6, \\frac{36}{5}}$.\n", - "Output Answer": [ - "${-8, 2, 6, \\frac{36}{5}}$" - ], - "Output Program": [ - "fst = set((-8, (36/5), 6, 2,))\nsnd = set((-8, 6, (36/5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 5, -6, 8, 3, 3}$.\n", - "Output Answer": [ - "$\\frac{10}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 5, -6, 8, 3, 3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -1, -4, 0, 0.5, 5, -2, -7, -2.9} \\cup {-9.5, 5, -8, -2, -1, 8, 1.06, -6, 6}$.\n", - "Output Answer": [ - "${-9.5, -9, -8, -7, -6, -4, -2.9, -2, -1, 0, 0.5, 1.06, 5, 6, 8}$" - ], - "Output Program": [ - "fst = set((-9, -1, -4, 0, 0.5, 5, -2, -7, -2.9,))\nsnd = set((-9.5, 5, -8, -2, -1, 8, 1.06, -6, 6,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -\\frac{12}{\\pi }, 4.94, 2} \\setminus {-3, -\\sqrt{3}, 4.94, -9, 9, -\\frac{12}{\\pi }, 3}$.\n", - "Output Answer": [ - "${2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -(12/math.pi), 4.94, 2,))\nsnd = set((-3, -math.sqrt(3), 4.94, -9, 9, -(12/math.pi), 3,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, -11, -14, 3, -3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{309}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -11, -14, 3, -3\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, -2, 3 \\log (2), 4, -\\frac{1}{2}, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-2, -\\frac{1}{2}, 0, 3 \\log (2), 4, 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -2, 3*math.log(2), 4, -(1/2), 10*math.log(2)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 12, 3, 15, -1}$.\n", - "Output Answer": [ - "$3 \\sqrt{\\frac{53}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 12, 3, 15, -1\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -\\frac{17}{\\pi }, \\frac{4}{\\sqrt{\\pi }}, 4}$.\n", - "Output Answer": [ - "$4+\\frac{17}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -(17/math.pi), (4/(math.sqrt(math.pi))), 4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 \\sqrt{2}, -8, -\\frac{12}{\\sqrt{\\pi }}, 7}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(2), -8, -(12/(math.sqrt(math.pi))), 7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 8, 10, -4 \\sqrt{3}} \\cup {-6, 0, -4, 10}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -6, -4, 0, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 8, 10, -4*math.sqrt(3),))\nsnd = set((-6, 0, -4, 10,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, 4, -1, -4}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{113}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 4, -1, -4\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, \\frac{19}{2}, \\frac{15}{2}, \\frac{19}{2}, \\frac{19}{2}, \\frac{15}{2}, \\frac{15}{2}, \\frac{19}{2}, 6, -\\frac{3}{2}, 2, \\frac{15}{2}, 2, \\frac{19}{2}, 6, -\\frac{3}{2}, 2, 6, 2, 6, -\\frac{3}{2}, \\frac{19}{2}, \\frac{19}{2}, 6, \\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{19}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, (19/2), (15/2), (19/2), (19/2), (15/2), (15/2), (19/2), 6, -(3/2), 2, (15/2), 2, (19/2), 6, -(3/2), 2, 6, 2, 6, -(3/2), (19/2), (19/2), 6, (19/2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{14}{\\sqrt{\\pi }}, -e}$.\n", - "Output Answer": [ - "${-\\frac{14}{\\sqrt{\\pi }}, -e}$" - ], - "Output Program": [ - "import math\n\nvalues = -(14/(math.sqrt(math.pi))), -math.e\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -10, -2, -3, \\frac{32}{7}} \\setminus {-\\frac{41}{7}, -10, -2, -3, -8}$.\n", - "Output Answer": [ - "${\\frac{32}{7}}$" - ], - "Output Program": [ - "fst = set((-8, -10, -2, -3, (32/7),))\nsnd = set((-(41/7), -10, -2, -3, -8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3, 4 \\sqrt{5}, 4.994} \\cup {-\\sqrt{5}, 4.994, 3}$.\n", - "Output Answer": [ - "${-\\sqrt{5}, 3, 4.994, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 4*math.sqrt(5), 4.994,))\nsnd = set((-math.sqrt(5), 4.994, 3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.23,0.122,0.292\\}$ and $\\{0.142,0.258,0.11\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.23, 0.122, 0.292\ndistribution2 = 0.142, 0.258, 0.11\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, -2, 12, 8, -4}$.\n", - "Output Answer": [ - "$\\frac{566}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -2, 12, 8, -4\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, \\frac{21}{4}, \\frac{61}{7}, 5}$.\n", - "Output Answer": [ - "$\\frac{26}{7}$" - ], - "Output Program": [ - "values = 8, (21/4), (61/7), 5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -6, 1, \\frac{11}{\\sqrt{2}}, \\frac{17}{\\sqrt{3}}, \\frac{22}{\\pi }, -7, 4 \\sqrt{5}, 4 \\sqrt{2}, \\frac{1}{e}, -8, 10, -6 \\sqrt{2}, -\\frac{22}{7}, -6}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -6, 1, (11/(math.sqrt(2))), (17/(math.sqrt(3))), (22/math.pi), -7, 4*math.sqrt(5), 4*math.sqrt(2), (1/math.e), -8, 10, -6*math.sqrt(2), -(22/7), -6\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.092,0.142,0.217,0.082,0.103,0.221\\}$ and $\\{0.084,0.199,0.1,0.271,0.105,0.175\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.092, 0.142, 0.217, 0.082, 0.103, 0.221\ndistribution2 = 0.084, 0.199, 0.1, 0.271, 0.105, 0.175\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.317,0.067,0.099,0.118,0.144\\}$ and $\\{0.116,0.435,0.089,0.039,0.226\\}$.", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.317, 0.067, 0.099, 0.118, 0.144\ndistribution2 = 0.116, 0.435, 0.089, 0.039, 0.226\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.016,0.114,0.025,0.25,0.055,0.084,0.167,0.05,0.073,0.136\\}$ and $\\{0.029,0.081,0.061,0.053,0.094,0.043,0.059,0.215,0.168,0.174\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.016, 0.114, 0.025, 0.25, 0.055, 0.084, 0.167, 0.05, 0.073, 0.136\ndistribution2 = 0.029, 0.081, 0.061, 0.053, 0.094, 0.043, 0.059, 0.215, 0.168, 0.174\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${6, -8, 3 e, 1, \\frac{16}{\\sqrt{3}}, -\\frac{7}{\\sqrt{2}}, -6 \\sqrt{3}} \\setminus {-5.69, 2 \\sqrt{2}, -6 \\sqrt{3}, \\frac{16}{\\sqrt{3}}, -1, -8, 1}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{2}}, 6, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -8, 3*math.e, 1, (16/(math.sqrt(3))), -(7/(math.sqrt(2))), -6*math.sqrt(3),))\nsnd = set((-5.69, 2*math.sqrt(2), -6*math.sqrt(3), (16/(math.sqrt(3))), -1, -8, 1,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x^2-1.6 x+2.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7]\n", - "Output Answer": [ - "$5.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(E(3.9*x**2-1.6*x+2.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\sqrt{3}, \\sqrt{3}, -\\frac{25}{7}}$.\n", - "Output Answer": [ - "${-\\frac{25}{7}, -\\sqrt{3}, \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(3), math.sqrt(3), -(25/7)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x-0.1$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$2.17$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(3.4*x-0.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, 12, -13, -6}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{1507}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 12, -13, -6\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, -13, 11, 2, 9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{283}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -13, 11, 2, 9\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, -15, 8, 6, -6}$.\n", - "Output Answer": [ - "$\\frac{469}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -15, 8, 6, -6\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x^2+1.5 x+1.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$6.77$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(1.9*x**2+1.5*x+1.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, -9, -12, 12, 6}$.\n", - "Output Answer": [ - "$3 \\sqrt{14}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -9, -12, 12, 6\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\log (2), 3}$.\n", - "Output Answer": [ - "${-\\log (2), 3}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.log(2), 3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.073,0.236,0.003,0.053,0.393,0.001,0.079,0.162\\}$ and $\\{0.174,0.111,0.1,0.183,0.065,0.169,0.097,0.07\\}$.", - "Output Answer": [ - "$0.83$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.073, 0.236, 0.003, 0.053, 0.393, 0.001, 0.079, 0.162\ndistribution2 = 0.174, 0.111, 0.1, 0.183, 0.065, 0.169, 0.097, 0.07\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -2, -\\frac{7}{2}, 3, -1} \\cup {-9, 2, -1, -5, \\frac{13}{2}, -10, -8}$.\n", - "Output Answer": [ - "${-10, -9, -8, -5, -\\frac{7}{2}, -2, -1, 2, 3, \\frac{13}{2}}$" - ], - "Output Program": [ - "fst = set((-5, -2, -(7/2), 3, -1,))\nsnd = set((-9, 2, -1, -5, (13/2), -10, -8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, \\frac{27}{5}}$.\n", - "Output Answer": [ - "$\\frac{26}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, (27/5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{15}{2}, 2, \\frac{14}{\\sqrt{3}}, \\frac{10}{\\sqrt{\\pi }}, -\\frac{24}{\\pi }, 5, 9, -10, -1, -8, 10, -7 \\log (2), -4}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/2), 2, (14/(math.sqrt(3))), (10/(math.sqrt(math.pi))), -(24/math.pi), 5, 9, -10, -1, -8, 10, -7*math.log(2), -4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{6}{e}, \\frac{2}{\\pi }}$.\n", - "Output Answer": [ - "${\\frac{2}{\\pi }, \\frac{6}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = (6/math.e), (2/math.pi)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -8, -1, 8, -1, 1, -1, 7, 7, 7, 3, 7, 3, 1, 3, -8, -1, 7, 3, 1, 3, 7, -8, 7, 7, -1, 7}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -8, -1, 8, -1, 1, -1, 7, 7, 7, 3, 7, 3, 1, 3, -8, -1, 7, 3, 1, 3, 7, -8, 7, 7, -1, 7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -3, 4, \\frac{6}{7}, 2 \\sqrt{2}, -5, 4, 5 \\sqrt{2}, \\frac{15}{\\sqrt{\\pi }}, -4, -8}$.\n", - "Output Answer": [ - "$8+\\frac{15}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -3, 4, (6/7), 2*math.sqrt(2), -5, 4, 5*math.sqrt(2), (15/(math.sqrt(math.pi))), -4, -8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${7, -4, -8, 1, 0, 8} \\cup {8, 0, -1, 5, 7, -3.2}$.\n", - "Output Answer": [ - "${-8, -4, -3.2, -1, 0, 1, 5, 7, 8}$" - ], - "Output Program": [ - "fst = set((7, -4, -8, 1, 0, 8,))\nsnd = set((8, 0, -1, 5, 7, -3.2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 \\pi, 2 e, -9, 0, 5, \\frac{4}{\\pi }, \\frac{28}{\\pi }, -3 \\pi, -13 \\log (2), -9, -10, -4, -6, -2}$.\n", - "Output Answer": [ - "$10+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.pi, 2*math.e, -9, 0, 5, (4/math.pi), (28/math.pi), -3*math.pi, -13*math.log(2), -9, -10, -4, -6, -2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${6 \\log (2), 2, -3 \\sqrt{3}, 2 \\pi, -\\frac{16}{\\sqrt{3}}, -2, 2 \\sqrt{5}} \\cup {6 \\log (2), -3 \\sqrt{3}, 2, -\\frac{16}{\\sqrt{3}}, -2, -2 \\sqrt{5}, 2 \\pi}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -3 \\sqrt{3}, -2 \\sqrt{5}, -2, 2, 6 \\log (2), 2 \\sqrt{5}, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((6*math.log(2), 2, -3*math.sqrt(3), 2*math.pi, -(16/(math.sqrt(3))), -2, 2*math.sqrt(5),))\nsnd = set((6*math.log(2), -3*math.sqrt(3), 2, -(16/(math.sqrt(3))), -2, -2*math.sqrt(5), 2*math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${8 \\log (2), -8, 5, 8, 6, -8, \\frac{4}{\\pi }, -6}$.\n", - "Output Answer": [ - "${-8, -8, -6, \\frac{4}{\\pi }, 5, 8 \\log (2), 6, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8*math.log(2), -8, 5, 8, 6, -8, (4/math.pi), -6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-9, 2, 9, e, 7, -\\frac{39}{4}, -8, 6.707}$.\n", - "Output Answer": [ - "${-\\frac{39}{4}, -9, -8, 2, e, 6.707, 7, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 2, 9, math.e, 7, -(39/4), -8, 6.707\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, 5, 5, 0, -3}$.\n", - "Output Answer": [ - "$\\frac{339}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 5, 5, 0, -3\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-7, \\frac{3}{2}, -5, -7.428, 3} \\cup {-7, \\frac{3}{2}, 7.268, -5}$.\n", - "Output Answer": [ - "${-7.428, -7, -5, \\frac{3}{2}, 3, 7.268}$" - ], - "Output Program": [ - "fst = set((-7, (3/2), -5, -7.428, 3,))\nsnd = set((-7, (3/2), 7.268, -5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $1.25 < 1.7 x^2+2.5 x+0.2 < 2.08$ where $x \\sim $ \\text{ExponentialDistribution}[1.6].", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(P((1.25 < 1.7*x**2+2.5*x+0.2) & (1.7*x**2+2.5*x+0.2 < 2.08)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{3}, 2 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(3), 2*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), -2*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16807, -5, 625, 729, -125, 3}$.\n", - "Output Answer": [ - "$15 \\sqrt[6]{3} \\sqrt[3]{5} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 16807, -5, 625, 729, -125, 3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, -9, 8, 13, -6, -10}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{91}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -9, 8, 13, -6, -10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, \\frac{7}{2}, \\frac{21}{2}}$.\n", - "Output Answer": [ - "$\\frac{315}{61}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, (7/2), (21/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8 \\log (2), \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{7 \\log (2)}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -8*math.log(2), math.log(2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 1, -9, -6, -6, 9, 9, -6, 1, -6, -6, 9, 1, -6, -9, 9, -6, 9, 9, -9, -6, 1, 9, 9}$.\n", - "Output Answer": [ - "$\\{-6,9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 1, -9, -6, -6, 9, 9, -6, 1, -6, -6, 9, 1, -6, -9, 9, -6, 9, 9, -9, -6, 1, 9, 9\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{9}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, -\\frac{6}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{22}{\\sqrt{5}}, -\\frac{6}{\\sqrt{5}}, -\\frac{7}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{9}{\\sqrt{5}},-\\frac{14}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(9/(math.sqrt(5))), -(14/(math.sqrt(5))), -(14/(math.sqrt(5))), -(2/(math.sqrt(5))), -(7/(math.sqrt(5))), -(14/(math.sqrt(5))), -(2/(math.sqrt(5))), -(14/(math.sqrt(5))), (22/(math.sqrt(5))), -(7/(math.sqrt(5))), -(14/(math.sqrt(5))), -(9/(math.sqrt(5))), (22/(math.sqrt(5))), -(6/(math.sqrt(5))), (22/(math.sqrt(5))), -(14/(math.sqrt(5))), -(9/(math.sqrt(5))), -(9/(math.sqrt(5))), -(7/(math.sqrt(5))), (22/(math.sqrt(5))), -(7/(math.sqrt(5))), -(2/(math.sqrt(5))), (22/(math.sqrt(5))), -(6/(math.sqrt(5))), -(7/(math.sqrt(5))), -(9/(math.sqrt(5))), -(9/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.145,0.034,0.101,0.085,0.079,0.073,0.127,0.039,0.115\\}$ and $\\{0.019,0.111,0.048,0.03,0.31,0.098,0.09,0.096,0.103\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.145, 0.034, 0.101, 0.085, 0.079, 0.073, 0.127, 0.039, 0.115\ndistribution2 = 0.019, 0.111, 0.048, 0.03, 0.31, 0.098, 0.09, 0.096, 0.103\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{3}, 4, 7, -2, 5, 0, 10, 4, 7, 3 \\sqrt{3}, -\\frac{9}{\\sqrt{5}}, -3 \\pi}$.\n", - "Output Answer": [ - "$10+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = (11/3), 4, 7, -2, 5, 0, 10, 4, 7, 3*math.sqrt(3), -(9/(math.sqrt(5))), -3*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 4, -5.8, -\\frac{19}{2}, -\\frac{11}{5}, 6, -\\frac{3}{4}} \\setminus {-5.8, \\frac{31}{5}, -3, -\\frac{6}{\\sqrt{\\pi }}, 6}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -\\frac{11}{5}, -\\frac{3}{4}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 4, -5.8, -(19/2), -(11/5), 6, -(3/4),))\nsnd = set((-5.8, (31/5), -3, -(6/(math.sqrt(math.pi))), 6,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9, 0, 1, 7, 5, \\frac{10}{\\sqrt{3}}} \\setminus {-\\frac{7}{4}, 7, -\\frac{61}{7}, 9, -8.71}$.\n", - "Output Answer": [ - "${0, 1, 5, \\frac{10}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 0, 1, 7, 5, (10/(math.sqrt(3))),))\nsnd = set((-(7/4), 7, -(61/7), 9, -8.71,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${6 \\log (2), 10, \\frac{22}{3}, -7, -\\frac{14}{\\sqrt{\\pi }}, -3, -4, 0, 2 \\sqrt{5}, -\\frac{3}{\\sqrt{2}}, 3, 2, -2, -\\frac{14}{\\pi }, -10}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6*math.log(2), 10, (22/3), -7, -(14/(math.sqrt(math.pi))), -3, -4, 0, 2*math.sqrt(5), -(3/(math.sqrt(2))), 3, 2, -2, -(14/math.pi), -10\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 15, 12}$.\n", - "Output Answer": [ - "$\\frac{420}{31}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 15, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{37}{5}, 9, 6 \\sqrt{3}, -3.945} \\setminus {4.547, 9, 6 \\sqrt{3}, -\\frac{37}{5}, -\\frac{14}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-3.945}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(37/5), 9, 6*math.sqrt(3), -3.945,))\nsnd = set((4.547, 9, 6*math.sqrt(3), -(37/5), -(14/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -\\frac{19}{e}, -6 \\sqrt{2}, -7, -2, 6, -\\frac{16}{\\sqrt{5}}, -6, 6, -8, 2 \\sqrt{3}, 0, \\frac{25}{e}, \\frac{8}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$9+\\frac{25}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -(19/math.e), -6*math.sqrt(2), -7, -2, 6, -(16/(math.sqrt(5))), -6, 6, -8, 2*math.sqrt(3), 0, (25/math.e), (8/(math.sqrt(math.pi))), (9/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, \\frac{25}{7}, -8, 7}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "values = -7, (25/7), -8, 7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, -2 \\sqrt{5}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), -2*math.sqrt(5), 3*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.5 x-0.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$-0.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(3.5*x-0.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -\\sqrt{2}, 10, \\frac{1}{2}}$.\n", - "Output Answer": [ - "$10+\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -math.sqrt(2), 10, (1/2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{8}{e}, -\\frac{18}{\\pi }, -3, 6, 3, 5 \\sqrt{3}, \\frac{9}{4}, 5, -3 e, \\frac{1}{2}}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = (8/math.e), -(18/math.pi), -3, 6, 3, 5*math.sqrt(3), (9/4), 5, -3*math.e, (1/2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, -3, 0}$.\n", - "Output Answer": [ - "$63$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -3, 0\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-8, -\\frac{5}{\\sqrt{2}}, -2 \\sqrt{2}, -3, 4, 9, -1}$.\n", - "Output Answer": [ - "${-8, -\\frac{5}{\\sqrt{2}}, -3, -2 \\sqrt{2}, -1, 4, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -(5/(math.sqrt(2))), -2*math.sqrt(2), -3, 4, 9, -1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${6 \\sqrt{2}, 0, -3 e, 9, 5 \\sqrt{3}, \\frac{15}{2}, 6, -3, 4 \\sqrt{3}, -2, 2, -3 \\sqrt{2}, 3 \\sqrt{5}, -7}$.\n", - "Output Answer": [ - "$9+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = 6*math.sqrt(2), 0, -3*math.e, 9, 5*math.sqrt(3), (15/2), 6, -3, 4*math.sqrt(3), -2, 2, -3*math.sqrt(2), 3*math.sqrt(5), -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.046,0.078,0.114,0.098,0.06,0.111,0.209,0.088,0.164\\}$ and $\\{0.153,0.063,0.226,0.162,0.05,0.145,0.027,0.115,0.031\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.046, 0.078, 0.114, 0.098, 0.06, 0.111, 0.209, 0.088, 0.164\ndistribution2 = 0.153, 0.063, 0.226, 0.162, 0.05, 0.145, 0.027, 0.115, 0.031\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-2., -1, -1, -5, -7, 6, 6.2}$.\n", - "Output Answer": [ - "${-7, -5, -2., -1, -1, 6, 6.2}$" - ], - "Output Program": [ - "values = -2., -1, -1, -5, -7, 6, 6.2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{2}{e}, -\\frac{14}{e}, -\\frac{16}{e}, \\frac{16}{e}, -\\frac{11}{e}, \\frac{1}{e}, \\frac{23}{e}, \\frac{13}{e}, -\\frac{24}{e}} \\cap {\\frac{13}{e}, \\frac{2}{e}, -\\frac{11}{e}, \\frac{18}{e}, -\\frac{16}{e}, \\frac{10}{e}, -\\frac{20}{e}}$.\n", - "Output Answer": [ - "${-\\frac{16}{e}, -\\frac{11}{e}, \\frac{2}{e}, \\frac{13}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((2/math.e), -(14/math.e), -(16/math.e), (16/math.e), -(11/math.e), (1/math.e), (23/math.e), (13/math.e), -(24/math.e),))\nsnd = set(((13/math.e), (2/math.e), -(11/math.e), (18/math.e), -(16/math.e), (10/math.e), -(20/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, 3, 1}$.\n", - "Output Answer": [ - "$\\frac{292}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 3, 1\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${27, -1, -59049, -343, 8}$.\n", - "Output Answer": [ - "$9 \\sqrt[5]{-1} 42^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 27, -1, -59049, -343, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -8, \\frac{24}{\\pi }, \\frac{13}{2}, -7, -\\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-6-\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -8, (24/math.pi), (13/2), -7, -math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -8, 14, 9, 1}$.\n", - "Output Answer": [ - "$\\frac{857}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -8, 14, 9, 1\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9, 3 \\sqrt{5}, e, -1.3, \\frac{5}{e}, 8, \\frac{4}{\\sqrt{5}}} \\setminus {-2 e, 8, \\frac{4}{\\sqrt{5}}, -3 \\sqrt{2}, 9}$.\n", - "Output Answer": [ - "${-1.3, \\frac{5}{e}, e, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 3*math.sqrt(5), math.e, -1.3, (5/math.e), 8, (4/(math.sqrt(5))),))\nsnd = set((-2*math.e, 8, (4/(math.sqrt(5))), -3*math.sqrt(2), 9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, \\frac{18}{\\pi }, -8, -7 \\sqrt{2}, -\\frac{13}{2}, \\frac{22}{3}, 10, 13 \\log (2), -5, -\\pi, 0, -3}$.\n", - "Output Answer": [ - "$10+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (18/math.pi), -8, -7*math.sqrt(2), -(13/2), (22/3), 10, 13*math.log(2), -5, -math.pi, 0, -3\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2.59, -\\sqrt{3}, 0, \\frac{8}{7}, 2, -10, 1, \\frac{10}{\\sqrt{3}}, \\frac{34}{5}, 4, 8, -\\frac{5}{2}} \\cup {\\frac{8}{7}, -1, 4, 0, \\frac{10}{\\sqrt{3}}, \\frac{34}{5}, 7.63, -\\frac{5}{2}, \\frac{11}{\\sqrt{3}}, 2}$.\n", - "Output Answer": [ - "${-10, -2.59, -\\frac{5}{2}, -\\sqrt{3}, -1, 0, 1, \\frac{8}{7}, 2, 4, \\frac{10}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{34}{5}, 7.63, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2.59, -math.sqrt(3), 0, (8/7), 2, -10, 1, (10/(math.sqrt(3))), (34/5), 4, 8, -(5/2),))\nsnd = set(((8/7), -1, 4, 0, (10/(math.sqrt(3))), (34/5), 7.63, -(5/2), (11/(math.sqrt(3))), 2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 4, \\frac{18}{\\sqrt{5}}, 4 \\sqrt{2}, -3 \\pi, -\\frac{11}{4}, -2, 4}$.\n", - "Output Answer": [ - "$\\frac{18}{\\sqrt{5}}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 4, (18/(math.sqrt(5))), 4*math.sqrt(2), -3*math.pi, -(11/4), -2, 4\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, \\sqrt{5}, 0, -\\frac{15}{7}, \\frac{25}{4}, -\\frac{1}{\\sqrt{5}}, 5, \\sqrt{5}, 0}$.\n", - "Output Answer": [ - "$\\frac{49}{4}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, math.sqrt(5), 0, -(15/7), (25/4), -(1/(math.sqrt(5))), 5, math.sqrt(5), 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 13, -4, -5, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{821}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 13, -4, -5, -15\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -4, \\frac{35}{4}, -4 \\sqrt{5}, -\\frac{41}{7}, 8, 0, 5, -2 \\log (2), -8, \\frac{57}{7}}$.", - "Output Answer": [ - "$-2 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, -4, (35/4), -4*math.sqrt(5), -(41/7), 8, 0, 5, -2*math.log(2), -8, (57/7)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.3,0.242,0.313\\}$ and $\\{0.033,0.011,0.057\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.3, 0.242, 0.313\ndistribution2 = 0.033, 0.011, 0.057\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{11}{2}, 5, -9, -2, -2, \\frac{41}{5}}$.\n", - "Output Answer": [ - "${-9, -2, -2, 5, \\frac{11}{2}, \\frac{41}{5}}$" - ], - "Output Program": [ - "values = (11/2), 5, -9, -2, -2, (41/5)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.048,0.026,0.169,0.193,0.195,0.031,0.107,0.034,0.138\\}$ and $\\{0.059,0.072,0.094,0.102,0.102,0.088,0.152,0.116,0.096\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.048, 0.026, 0.169, 0.193, 0.195, 0.031, 0.107, 0.034, 0.138\ndistribution2 = 0.059, 0.072, 0.094, 0.102, 0.102, 0.088, 0.152, 0.116, 0.096\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -8.321, -7, 5, -6} \\setminus {1.229, -6, -7, 5}$.\n", - "Output Answer": [ - "${-8.321, -4}$" - ], - "Output Program": [ - "fst = set((-4, -8.321, -7, 5, -6,))\nsnd = set((1.229, -6, -7, 5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{2}{5}, -4 \\sqrt{5}, 2 \\sqrt{5}, 14 \\log (2), 0, -2 \\sqrt{3}, -5, 5, -\\frac{9}{\\sqrt{\\pi }}, 3, 9, -\\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$4 \\sqrt{5}+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = (2/5), -4*math.sqrt(5), 2*math.sqrt(5), 14*math.log(2), 0, -2*math.sqrt(3), -5, 5, -(9/(math.sqrt(math.pi))), 3, 9, -(1/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-10, 9, 8, -3, 6, 0, -9, -1} \\cap {4, 7, 5, -1, -9, 0, -2, -6, -4, 9, 1, -7}$.\n", - "Output Answer": [ - "${-9, -1, 0, 9}$" - ], - "Output Program": [ - "fst = set((-10, 9, 8, -3, 6, 0, -9, -1,))\nsnd = set((4, 7, 5, -1, -9, 0, -2, -6, -4, 9, 1, -7,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{\\sqrt{3}}, -\\frac{14}{\\sqrt{\\pi }}, -3 \\sqrt{2}, -5, -9, -1}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-5-3 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/(math.sqrt(3))), -(14/(math.sqrt(math.pi))), -3*math.sqrt(2), -5, -9, -1\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -3, 6, 7, 2, -5, -9, 7, -9, 7, 6, -3, 6, 6, 2, 2, -5, -6, -3, -3, 7}$.\n", - "Output Answer": [ - "$\\{-3,6,7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -3, 6, 7, 2, -5, -9, 7, -9, 7, 6, -3, 6, 6, 2, 2, -5, -6, -3, -3, 7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${4, \\frac{8}{e}, 0, -6} \\setminus {4, -1, 2.4, 10, 1, -6, -7}$.\n", - "Output Answer": [ - "${0, \\frac{8}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, (8/math.e), 0, -6,))\nsnd = set((4, -1, 2.4, 10, 1, -6, -7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.069,0.532,0.015,0.156\\}$ and $\\{0.178,0.237,0.072,0.134\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.069, 0.532, 0.015, 0.156\ndistribution2 = 0.178, 0.237, 0.072, 0.134\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, \\frac{27}{7}, 9, -7, -8, -10 \\log (2), 5, -\\frac{20}{3}, -3, -1} \\cup {-3, -8, 5, \\frac{36}{7}, 9, \\frac{27}{7}, 0, 10, -\\frac{20}{3}}$.\n", - "Output Answer": [ - "${-8, -7, -10 \\log (2), -\\frac{20}{3}, -3, -1, 0, \\frac{27}{7}, 5, \\frac{36}{7}, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (27/7), 9, -7, -8, -10*math.log(2), 5, -(20/3), -3, -1,))\nsnd = set((-3, -8, 5, (36/7), 9, (27/7), 0, 10, -(20/3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -9, 4, 10, 1, \\frac{13}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -9, 4, 10, 1, (13/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 5, 10, \\frac{19}{\\sqrt{5}}, 4 \\sqrt{2}, -\\frac{13}{\\sqrt{3}}} \\setminus {\\frac{14}{\\sqrt{5}}, 10, 4, -\\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-9, 5, 4 \\sqrt{2}, \\frac{19}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 5, 10, (19/(math.sqrt(5))), 4*math.sqrt(2), -(13/(math.sqrt(3))),))\nsnd = set(((14/(math.sqrt(5))), 10, 4, -(13/(math.sqrt(3))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, 9, 14}$.\n", - "Output Answer": [ - "$\\frac{439}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 9, 14\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\sqrt{5}, 3, -5, -5, 0, \\frac{10}{3}, -5}$.\n", - "Output Answer": [ - "$\\frac{25}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(5), 3, -5, -5, 0, (10/3), -5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-6, -2, -\\frac{2}{e}, \\frac{37}{4}, -4}$.\n", - "Output Answer": [ - "${-6, -4, -2, -\\frac{2}{e}, \\frac{37}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -2, -(2/math.e), (37/4), -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $1.2 < 1. x-2.2$ where $x \\sim $ \\text{NormalDistribution}[-1.6,2.3].", - "Output Answer": [ - "$0.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 2.3)\nprint(P((1.2 < 1.*x-2.2)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -9, 5, -2}$.\n", - "Output Answer": [ - "$-\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -9, 5, -2\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -4, -4, 5, -3, -3, -4, -4, -3, -4, 9, -3, -3, -4, -3, 5, -3, 5, 5, 9, -4, -3, -3, -3, 9, -3, 9, 9, -3, -3}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -4, -4, 5, -3, -3, -4, -4, -3, -4, 9, -3, -3, -4, -3, 5, -3, 5, 5, 9, -4, -3, -3, -3, 9, -3, 9, 9, -3, -3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.236,0.293,0.187\\}$ and $\\{0.321,0.138,0.284\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.236, 0.293, 0.187\ndistribution2 = 0.321, 0.138, 0.284\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{1}{\\sqrt{2}}, 6, 12 \\log (2), 9, -3 \\sqrt{5}, 4, 3 e}$.", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(1/(math.sqrt(2))), 6, 12*math.log(2), 9, -3*math.sqrt(5), 4, 3*math.e\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2-2. x+3.4$ where $x \\sim $ \\text{BetaDistribution}[1.5,0.6]\n", - "Output Answer": [ - "$4.51$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 0.6)\nprint(E(4.4*x**2-2.*x+3.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, -2, 7, -15, 10, -4}$.\n", - "Output Answer": [ - "$\\frac{191}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -2, 7, -15, 10, -4\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.226,0.02,0.097,0.031,0.054\\}$ and $\\{0.071,0.247,0.071,0.133,0.184,0.119\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.226, 0.02, 0.097, 0.031, 0.054\ndistribution2 = 0.071, 0.247, 0.071, 0.133, 0.184, 0.119\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 16, 3}$.\n", - "Output Answer": [ - "$\\frac{144}{43}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 16, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, -5, 7, -1}$.\n", - "Output Answer": [ - "$25$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -5, 7, -1\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{46}{5}, -\\frac{44}{5}, -2, \\frac{37}{5}, 0, -\\frac{39}{5}, \\frac{2}{5}}$.\n", - "Output Answer": [ - "$-\\frac{20}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(46/5), -(44/5), -2, (37/5), 0, -(39/5), (2/5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x^2-1.6 x+1.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(-1.1*x**2-1.6*x+1.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\pi, 2 \\pi, \\pi, -3 \\pi, \\pi, 2 \\pi, 2 \\pi, 2 \\pi, 2 \\pi, 2 \\pi, -3 \\pi, \\pi, -\\pi, 0, 0, 0, -3 \\pi, 0, 0, -\\pi, -\\pi, \\pi, \\pi}$.\n", - "Output Answer": [ - "$\\{2 \\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.pi, 2*math.pi, math.pi, -3*math.pi, math.pi, 2*math.pi, 2*math.pi, 2*math.pi, 2*math.pi, 2*math.pi, -3*math.pi, math.pi, -math.pi, 0, 0, 0, -3*math.pi, 0, 0, -math.pi, -math.pi, math.pi, math.pi\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${2, -5 \\sqrt{2}, -9, -\\frac{9}{\\sqrt{2}}, -4, -8, 3, -2 \\sqrt{2}, 3, -6, e, 4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-4-2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -5*math.sqrt(2), -9, -(9/(math.sqrt(2))), -4, -8, 3, -2*math.sqrt(2), 3, -6, math.e, 4\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, 9, -5 \\log (2), -e} \\setminus {-2, 2.5, -\\frac{4}{\\sqrt{\\pi }}, 3, 6, -5 \\log (2), -3 e}$.\n", - "Output Answer": [ - "${-e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 9, -5*math.log(2), -math.e,))\nsnd = set((-2, 2.5, -(4/(math.sqrt(math.pi))), 3, 6, -5*math.log(2), -3*math.e,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.198,0.09,0.097,0.091,0.116,0.064,0.083,0.001,0.129\\}$ and $\\{0.064,0.086,0.061,0.044,0.161,0.008,0.033,0.284,0.209\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.198, 0.09, 0.097, 0.091, 0.116, 0.064, 0.083, 0.001, 0.129\ndistribution2 = 0.064, 0.086, 0.061, 0.044, 0.161, 0.008, 0.033, 0.284, 0.209\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -6 \\log (2), -5 \\sqrt{3}, 4 \\sqrt{5}, 0, -\\pi, -12 \\log (2)}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -6*math.log(2), -5*math.sqrt(3), 4*math.sqrt(5), 0, -math.pi, -12*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.175,0.455,0.039,0.13\\}$ and $\\{0.678,0.087,0.163,0.06\\}$.", - "Output Answer": [ - "$0.91$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.175, 0.455, 0.039, 0.13\ndistribution2 = 0.678, 0.087, 0.163, 0.06\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 7, 7}$.\n", - "Output Answer": [ - "$\\frac{91}{11}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 7, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0.2, -1, 2, 7, 3, -2, 6} \\cup {-2, 7, -1, -3, 3, 0.2, -10}$.\n", - "Output Answer": [ - "${-10, -3, -2, -1, 0.2, 2, 3, 6, 7}$" - ], - "Output Program": [ - "fst = set((0.2, -1, 2, 7, 3, -2, 6,))\nsnd = set((-2, 7, -1, -3, 3, 0.2, -10,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -2 \\sqrt{2}, -7, 5, \\frac{3}{\\pi }, \\frac{7}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{3}{\\pi }-2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -2*math.sqrt(2), -7, 5, (3/math.pi), (7/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -6 \\sqrt{2}, \\frac{13}{\\sqrt{\\pi }}, 3, \\frac{11}{\\sqrt{5}}, 6, \\frac{29}{5}, -1, -10, -\\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$10+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -6*math.sqrt(2), (13/(math.sqrt(math.pi))), 3, (11/(math.sqrt(5))), 6, (29/5), -1, -10, -(17/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -\\frac{22}{\\pi }, 1, 4, \\frac{13}{\\sqrt{2}}, 6, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{9}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{13}{\\sqrt{2}}+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -(22/math.pi), 1, 4, (13/(math.sqrt(2))), 6, -(13/(math.sqrt(math.pi))), -(9/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 5, 25}$.\n", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 5, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{39}{4}, 0, \\frac{32}{5}, -e, -4, 5, -5, \\frac{17}{\\sqrt{3}}, 10, 4 \\sqrt{2}, 9}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = (39/4), 0, (32/5), -math.e, -4, 5, -5, (17/(math.sqrt(3))), 10, 4*math.sqrt(2), 9\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.19,0.199,0.383,0.117\\}$ and $\\{0.219,0.16,0.246,0.159\\}$.", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.19, 0.199, 0.383, 0.117\ndistribution2 = 0.219, 0.16, 0.246, 0.159\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${0, \\frac{19}{5}, -10, 2, \\frac{13}{\\sqrt{\\pi }}, -3}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, (19/5), -10, 2, (13/(math.sqrt(math.pi))), -3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{13}{\\sqrt{5}}, -9, -3 \\pi, -\\frac{54}{7}, \\frac{12}{\\pi }, -3}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -\\frac{54}{7}, -3, \\frac{12}{\\pi }, \\frac{13}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(5))), -9, -3*math.pi, -(54/7), (12/math.pi), -3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -3 \\sqrt{5}, 6 \\sqrt{2}, 1, 0, 8, -6 \\sqrt{2}, -6, -\\frac{19}{2}, \\frac{24}{e}, -6, 5}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -3*math.sqrt(5), 6*math.sqrt(2), 1, 0, 8, -6*math.sqrt(2), -6, -(19/2), (24/math.e), -6, 5\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${8, 2, -3, 9, 6} \\cap {1, 6, 8, 2, -5, 4, 9}$.\n", - "Output Answer": [ - "${2, 6, 8, 9}$" - ], - "Output Program": [ - "fst = set((8, 2, -3, 9, 6,))\nsnd = set((1, 6, 8, 2, -5, 4, 9,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, \\frac{16}{\\pi }, -0.827, -4.51, 3 \\log (2), -3 e, -4 \\sqrt{3}, -1, 2.241, 4 \\sqrt{3}, -5 \\sqrt{3}} \\cup {2.241, 7.556, -4 \\sqrt{3}, 0, \\frac{16}{\\pi }, 2 e, 4 \\sqrt{3}, \\log (2), -\\frac{1}{\\sqrt{3}}, -4.51, -6, -8}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -3 e, -8, -4 \\sqrt{3}, -6, -4.51, -1, -0.827, -\\frac{1}{\\sqrt{3}}, 0, \\log (2), 3 \\log (2), 2.241, \\frac{16}{\\pi }, 2 e, 4 \\sqrt{3}, 7.556}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (16/math.pi), -0.827, -4.51, 3*math.log(2), -3*math.e, -4*math.sqrt(3), -1, 2.241, 4*math.sqrt(3), -5*math.sqrt(3),))\nsnd = set((2.241, 7.556, -4*math.sqrt(3), 0, (16/math.pi), 2*math.e, 4*math.sqrt(3), math.log(2), -(1/(math.sqrt(3))), -4.51, -6, -8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -8}$.\n", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "values = -9, -8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{15}{2}, 3, -\\frac{11}{4}, -\\frac{15}{2}, -\\frac{11}{4}, 3, -\\frac{17}{4}, 3, -\\frac{11}{4}, -\\frac{11}{4}, -\\frac{11}{4}, -\\frac{15}{2}, 3, 3, -\\frac{15}{2}, -\\frac{11}{4}, -\\frac{11}{4}, 3, 3, -\\frac{17}{4}, 3}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(15/2), 3, -(11/4), -(15/2), -(11/4), 3, -(17/4), 3, -(11/4), -(11/4), -(11/4), -(15/2), 3, 3, -(15/2), -(11/4), -(11/4), 3, 3, -(17/4), 3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, 0, -\\frac{3}{4}, 4, 5, -\\frac{17}{\\sqrt{\\pi }}, -1} \\setminus {4, -2, 2 e, -1, -10, 0, -\\frac{17}{\\sqrt{\\pi }}, 9, 9.99}$.\n", - "Output Answer": [ - "${-\\frac{3}{4}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 0, -(3/4), 4, 5, -(17/(math.sqrt(math.pi))), -1,))\nsnd = set((4, -2, 2*math.e, -1, -10, 0, -(17/(math.sqrt(math.pi))), 9, 9.99,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, -1024, -8, -32, 4}$.\n", - "Output Answer": [ - "$16 \\sqrt[5]{-1} 10^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, -1024, -8, -32, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, e, 0, 2, 6 \\sqrt{2}, 0, -\\frac{17}{4}, 9, -\\frac{36}{5}, 2, 3 \\sqrt{3}, -\\frac{9}{2}, -3, 9}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, math.e, 0, 2, 6*math.sqrt(2), 0, -(17/4), 9, -(36/5), 2, 3*math.sqrt(3), -(9/2), -3, 9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{14}{\\pi }, \\frac{14}{\\pi }, -\\frac{13}{\\pi }, \\frac{22}{\\pi }, \\frac{5}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }, \\frac{5}{\\pi }, -\\frac{13}{\\pi }, \\frac{14}{\\pi }, \\frac{5}{\\pi }, -\\frac{13}{\\pi }, \\frac{5}{\\pi }, -\\frac{13}{\\pi }, \\frac{14}{\\pi }, \\frac{5}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }, -\\frac{13}{\\pi }, -\\frac{13}{\\pi }, \\frac{5}{\\pi }, \\frac{5}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{22}{\\pi },\\frac{5}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (14/math.pi), (14/math.pi), -(13/math.pi), (22/math.pi), (5/math.pi), (22/math.pi), (22/math.pi), (5/math.pi), -(13/math.pi), (14/math.pi), (5/math.pi), -(13/math.pi), (5/math.pi), -(13/math.pi), (14/math.pi), (5/math.pi), (22/math.pi), (22/math.pi), -(13/math.pi), -(13/math.pi), (5/math.pi), (5/math.pi), (22/math.pi), (22/math.pi)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, -4, \\frac{11}{2}, -\\frac{5}{2}, 4, 1, \\frac{7}{2}} \\cap {\\frac{7}{2}, 4, 3, -9, -4, \\frac{15}{2}, 0}$.\n", - "Output Answer": [ - "${-4, 3, \\frac{7}{2}, 4}$" - ], - "Output Program": [ - "fst = set((3, -4, (11/2), -(5/2), 4, 1, (7/2),))\nsnd = set(((7/2), 4, 3, -9, -4, (15/2), 0,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, -7, -4, -\\sqrt{5}, -\\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{\\pi }}, -7, -4, -\\sqrt{5}, 0}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -7, -4, -math.sqrt(5), -(13/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-2, 0, 10, -14, -12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{474}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 0, 10, -14, -12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{26}{\\pi }, -\\frac{17}{\\pi }, \\frac{26}{\\pi }, \\frac{25}{\\pi }, \\frac{26}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }, \\frac{16}{\\pi }, \\frac{26}{\\pi }, \\frac{26}{\\pi }, \\frac{26}{\\pi }, \\frac{27}{\\pi }, -\\frac{17}{\\pi }, \\frac{26}{\\pi }, \\frac{25}{\\pi }, \\frac{25}{\\pi }, \\frac{25}{\\pi }, \\frac{16}{\\pi }, \\frac{16}{\\pi }, \\frac{16}{\\pi }, \\frac{27}{\\pi }, \\frac{26}{\\pi }, \\frac{16}{\\pi }, -\\frac{17}{\\pi }, \\frac{16}{\\pi }, \\frac{16}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{26}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (26/math.pi), -(17/math.pi), (26/math.pi), (25/math.pi), (26/math.pi), -(17/math.pi), -(17/math.pi), (16/math.pi), (26/math.pi), (26/math.pi), (26/math.pi), (27/math.pi), -(17/math.pi), (26/math.pi), (25/math.pi), (25/math.pi), (25/math.pi), (16/math.pi), (16/math.pi), (16/math.pi), (27/math.pi), (26/math.pi), (16/math.pi), -(17/math.pi), (16/math.pi), (16/math.pi)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-3, -\\sqrt{5}, -2}$.\n", - "Output Answer": [ - "${-3, -\\sqrt{5}, -2}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -math.sqrt(5), -2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -4, -1, 1, 2 \\sqrt{2}, -3 \\sqrt{5}, \\frac{29}{\\pi }} \\setminus {2 \\sqrt{2}, -4, -3 \\sqrt{5}, -\\frac{23}{7}, 3, 7}$.\n", - "Output Answer": [ - "${-7, -1, 1, \\frac{29}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -4, -1, 1, 2*math.sqrt(2), -3*math.sqrt(5), (29/math.pi),))\nsnd = set((2*math.sqrt(2), -4, -3*math.sqrt(5), -(23/7), 3, 7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.116,0.179,0.183,0.106,0.033,0.182,0.021,0.036,0.118\\}$ and $\\{0.008,0.139,0.001,0.013,0.128,0.066,0.293,0.159,0.01\\}$.", - "Output Answer": [ - "$1.73$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.116, 0.179, 0.183, 0.106, 0.033, 0.182, 0.021, 0.036, 0.118\ndistribution2 = 0.008, 0.139, 0.001, 0.013, 0.128, 0.066, 0.293, 0.159, 0.01\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 6, 8, 7 \\sqrt{2}, -9, -1}$.\n", - "Output Answer": [ - "$9+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 6, 8, 7*math.sqrt(2), -9, -1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{7}{4}, 2, 3, -7} \\setminus {1, -\\frac{4}{5}, 2, -7, \\frac{7}{4}, 0}$.\n", - "Output Answer": [ - "${3}$" - ], - "Output Program": [ - "fst = set(((7/4), 2, 3, -7,))\nsnd = set((1, -(4/5), 2, -7, (7/4), 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{9}{e}, -\\frac{14}{e}, -\\frac{4}{e}, \\frac{14}{e}, \\frac{27}{e}, \\frac{5}{e}} \\cap {\\frac{5}{e}, \\frac{14}{e}, -\\frac{26}{e}, \\frac{20}{e}, \\frac{27}{e}, \\frac{3}{e}}$.\n", - "Output Answer": [ - "${\\frac{5}{e}, \\frac{14}{e}, \\frac{27}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((9/math.e), -(14/math.e), -(4/math.e), (14/math.e), (27/math.e), (5/math.e),))\nsnd = set(((5/math.e), (14/math.e), -(26/math.e), (20/math.e), (27/math.e), (3/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -\\frac{15}{e}, 2, 8}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -(15/math.e), 2, 8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{7}{2}, -\\frac{25}{4}, -\\frac{4}{\\sqrt{\\pi }}, -4}$.\n", - "Output Answer": [ - "${-\\frac{25}{4}, -4, -\\frac{7}{2}, -\\frac{4}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/2), -(25/4), -(4/(math.sqrt(math.pi))), -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\pi, 3.67, 8, -\\frac{21}{4}, -2 \\sqrt{2}} \\cup {\\pi, -\\sqrt{2}, 3.67, 6, 4, \\frac{31}{4}}$.\n", - "Output Answer": [ - "${-\\frac{21}{4}, -2 \\sqrt{2}, -\\sqrt{2}, \\pi, 3.67, 4, 6, \\frac{31}{4}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, 3.67, 8, -(21/4), -2*math.sqrt(2),))\nsnd = set((math.pi, -math.sqrt(2), 3.67, 6, 4, (31/4),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -2, 9, -3 \\pi, 0, 7, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, -2, 9, -3*math.pi, 0, 7, 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -10, \\pi} \\setminus {\\frac{22}{3}, -\\sqrt{5}, 7, 5, -3}$.\n", - "Output Answer": [ - "${-10, -2, \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -10, math.pi,))\nsnd = set(((22/3), -math.sqrt(5), 7, 5, -3,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 1, -27, 4}$.\n", - "Output Answer": [ - "$(2+2 i) 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 1, -27, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${1, e, -1, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -1, 1, e}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, math.e, -1, -3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{18}{5}, -5 \\sqrt{2}, \\frac{69}{7}, -4 \\sqrt{2}, \\frac{19}{4}, -2.7, -\\frac{11}{\\sqrt{2}}, -1} \\cup {-4 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, -3 \\sqrt{2}, -1, 10., -\\frac{27}{7}, -4, -\\frac{18}{5}, \\frac{7}{2}}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{2}}, -5 \\sqrt{2}, -4 \\sqrt{2}, -3 \\sqrt{2}, -4, -\\frac{27}{7}, -\\frac{18}{5}, -2.7, -1, \\frac{7}{2}, \\frac{5}{\\sqrt{2}}, \\frac{19}{4}, \\frac{69}{7}, 10.}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(18/5), -5*math.sqrt(2), (69/7), -4*math.sqrt(2), (19/4), -2.7, -(11/(math.sqrt(2))), -1,))\nsnd = set((-4*math.sqrt(2), (5/(math.sqrt(2))), -3*math.sqrt(2), -1, 10., -(27/7), -4, -(18/5), (7/2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{2}, -6 \\sqrt{2}, 3 \\sqrt{2}, -6 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, \\sqrt{2}, 3 \\sqrt{2}, 3 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, 3 \\sqrt{2}, \\sqrt{2}, -6 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, 3 \\sqrt{2}, \\sqrt{2}, 3 \\sqrt{2}, -6 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(2), -6*math.sqrt(2), 3*math.sqrt(2), -6*math.sqrt(2), -(3/(math.sqrt(2))), -(3/(math.sqrt(2))), math.sqrt(2), 3*math.sqrt(2), 3*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), 3*math.sqrt(2), math.sqrt(2), -6*math.sqrt(2), -(3/(math.sqrt(2))), 3*math.sqrt(2), math.sqrt(2), 3*math.sqrt(2), -6*math.sqrt(2), math.sqrt(2), math.sqrt(2), 3*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x^3-2.3 x^2+1.5 x-1.6$ where $x \\sim $ \\text{PoissonDistribution}[2.]\n", - "Output Answer": [ - "$11.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.)\nprint(E(1.1*x**3-2.3*x**2+1.5*x-1.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${3, 243, -6, 4, 32, -1024}$.\n", - "Output Answer": [ - "$24 \\sqrt[6]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 243, -6, 4, 32, -1024\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.16,0.043,0.033,0.124,0.039,0.293\\}$ and $\\{0.316,0.154,0.12,0.167,0.059,0.175\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.16, 0.043, 0.033, 0.124, 0.039, 0.293\ndistribution2 = 0.316, 0.154, 0.12, 0.167, 0.059, 0.175\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{2}{\\sqrt{3}}, 0, 9, -\\frac{10}{3}, 0}$.\n", - "Output Answer": [ - "${-\\frac{10}{3}, 0, 0, \\frac{2}{\\sqrt{3}}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = (2/(math.sqrt(3))), 0, 9, -(10/3), 0\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, -59049, 25, 5, 2401}$.\n", - "Output Answer": [ - "$9 \\sqrt[5]{-1} 5^{3/5} 6^{2/5} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, -59049, 25, 5, 2401\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{29}{5}, \\pi, -4, -9} \\setminus {\\frac{29}{5}, 2 \\pi, -9, -\\frac{5}{2}}$.\n", - "Output Answer": [ - "${-4, \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set(((29/5), math.pi, -4, -9,))\nsnd = set(((29/5), 2*math.pi, -9, -(5/2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-5 \\log (2), 9}$.\n", - "Output Answer": [ - "${-5 \\log (2), 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.log(2), 9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -5, 6, -5, -9, 6, 6, 6, -9, 8, 6, -5, 8, 4, 6, 4, 4, 6, 8, -5, 8, 6, 6}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -5, 6, -5, -9, 6, 6, 6, -9, 8, 6, -5, 8, 4, 6, 4, 4, 6, 8, -5, 8, 6, 6\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, -13, -1, 1}$.\n", - "Output Answer": [ - "$\\frac{739}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -13, -1, 1\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${8, 0, -2, -2 \\log (2)} \\cup {-2 \\log (2), -\\frac{11}{5}, 8, 0, 2}$.\n", - "Output Answer": [ - "${-\\frac{11}{5}, -2, -2 \\log (2), 0, 2, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 0, -2, -2*math.log(2),))\nsnd = set((-2*math.log(2), -(11/5), 8, 0, 2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-0.311, -1, 6, -\\frac{41}{7}, 4, 0, 8, -6} \\cup {-6, -3, -\\frac{41}{7}, 8, \\frac{33}{5}, -2, 1, -5, -4, -1}$.\n", - "Output Answer": [ - "${-6, -\\frac{41}{7}, -5, -4, -3, -2, -1, -0.311, 0, 1, 4, 6, \\frac{33}{5}, 8}$" - ], - "Output Program": [ - "fst = set((-0.311, -1, 6, -(41/7), 4, 0, 8, -6,))\nsnd = set((-6, -3, -(41/7), 8, (33/5), -2, 1, -5, -4, -1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${9.8, -8., 4.8, -8.2, 5.1, 1.6} \\cap {5.1, 1.4, 7.3, 9.7, -8., -4.9}$.\n", - "Output Answer": [ - "${-8., 5.1}$" - ], - "Output Program": [ - "fst = set((9.8, -8., 4.8, -8.2, 5.1, 1.6,))\nsnd = set((5.1, 1.4, 7.3, 9.7, -8., -4.9,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x^2+4.9 x+2.7$ where $x \\sim $ \\text{BetaDistribution}[0.4,1.4]\n", - "Output Answer": [ - "$4.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.4, 1.4)\nprint(E(4.6*x**2+4.9*x+2.7))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${6, 4, 4 \\sqrt{5}, -10, -7} \\cup {-7, -4, 2 \\sqrt{5}, 5, 4}$.\n", - "Output Answer": [ - "${-10, -7, -4, 4, 2 \\sqrt{5}, 5, 6, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 4, 4*math.sqrt(5), -10, -7,))\nsnd = set((-7, -4, 2*math.sqrt(5), 5, 4,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-2, -14, -2}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, -14, -2\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${4, \\frac{2}{\\pi }, \\frac{14}{\\sqrt{5}}, 2 \\pi, -3, \\frac{1}{\\sqrt{5}}, \\frac{27}{5}, -2}$.\n", - "Output Answer": [ - "${-3, -2, \\frac{1}{\\sqrt{5}}, \\frac{2}{\\pi }, 4, \\frac{27}{5}, \\frac{14}{\\sqrt{5}}, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (2/math.pi), (14/(math.sqrt(5))), 2*math.pi, -3, (1/(math.sqrt(5))), (27/5), -2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x+1.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$3.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(3.6*x+1.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.7 x^2+0.8 x+3.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.3]\n", - "Output Answer": [ - "$6.13$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(E(1.7*x**2+0.8*x+3.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.007,0.023,0.205,0.58,0.026\\}$ and $\\{0.054,0.275,0.228,0.242,0.106\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.007, 0.023, 0.205, 0.58, 0.026\ndistribution2 = 0.054, 0.275, 0.228, 0.242, 0.106\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{23}{\\pi }, \\frac{4}{\\pi }, -\\frac{23}{\\pi }, -\\frac{24}{\\pi }, -\\frac{3}{\\pi }, -\\frac{23}{\\pi }, -\\frac{23}{\\pi }, -\\frac{15}{\\pi }, \\frac{18}{\\pi }, -\\frac{15}{\\pi }, -\\frac{23}{\\pi }, \\frac{4}{\\pi }, -\\frac{15}{\\pi }, -\\frac{3}{\\pi }, -\\frac{24}{\\pi }, -\\frac{24}{\\pi }, -\\frac{24}{\\pi }, \\frac{4}{\\pi }, \\frac{18}{\\pi }, \\frac{18}{\\pi }, -\\frac{3}{\\pi }, -\\frac{15}{\\pi }, -\\frac{15}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{23}{\\pi },-\\frac{15}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(23/math.pi), (4/math.pi), -(23/math.pi), -(24/math.pi), -(3/math.pi), -(23/math.pi), -(23/math.pi), -(15/math.pi), (18/math.pi), -(15/math.pi), -(23/math.pi), (4/math.pi), -(15/math.pi), -(3/math.pi), -(24/math.pi), -(24/math.pi), -(24/math.pi), (4/math.pi), (18/math.pi), (18/math.pi), -(3/math.pi), -(15/math.pi), -(15/math.pi)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{9}{e}, 7, 8, 2 \\pi, \\frac{23}{7}, -\\frac{5}{\\sqrt{2}}} \\setminus {8, 7, \\frac{8}{\\sqrt{\\pi }}, \\frac{23}{7}, -\\frac{9}{e}, 0}$.\n", - "Output Answer": [ - "${-\\frac{5}{\\sqrt{2}}, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(9/math.e), 7, 8, 2*math.pi, (23/7), -(5/(math.sqrt(2))),))\nsnd = set((8, 7, (8/(math.sqrt(math.pi))), (23/7), -(9/math.e), 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${3.13, \\frac{11}{5}, 2, 8, 0, -1, -\\frac{25}{\\pi }, -\\frac{38}{5}, \\frac{17}{2}} \\setminus {-\\frac{44}{5}, -9, 0, \\frac{26}{7}, 2}$.\n", - "Output Answer": [ - "${-\\frac{25}{\\pi }, -\\frac{38}{5}, -1, \\frac{11}{5}, 3.13, 8, \\frac{17}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3.13, (11/5), 2, 8, 0, -1, -(25/math.pi), -(38/5), (17/2),))\nsnd = set((-(44/5), -9, 0, (26/7), 2,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4, -\\frac{23}{e}, -4 \\sqrt{2}, 4, 3}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -(23/math.e), -4*math.sqrt(2), 4, 3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${8, -4.7, 4, -\\frac{62}{7}, -5, -1, 9} \\setminus {9, 7, -3, -\\frac{23}{4}, -\\frac{62}{7}, -2}$.\n", - "Output Answer": [ - "${-5, -4.7, -1, 4, 8}$" - ], - "Output Program": [ - "fst = set((8, -4.7, 4, -(62/7), -5, -1, 9,))\nsnd = set((9, 7, -3, -(23/4), -(62/7), -2,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.053,0.155,0.145,0.177,0.208,0.15,0.096\\}$ and $\\{0.009,0.187,0.001,0.016,0.617,0.062,0.014\\}$.", - "Output Answer": [ - "$1.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.053, 0.155, 0.145, 0.177, 0.208, 0.15, 0.096\ndistribution2 = 0.009, 0.187, 0.001, 0.016, 0.617, 0.062, 0.014\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{53}{3}}$.\n", - "Output Answer": [ - "$\\frac{689}{46}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (53/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.252,0.126,0.264,0.101,0.085,0.113\\}$ and $\\{0.027,0.11,0.576,0.095,0.093,0.084\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.252, 0.126, 0.264, 0.101, 0.085, 0.113\ndistribution2 = 0.027, 0.11, 0.576, 0.095, 0.093, 0.084\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${5, 4, -\\frac{5}{\\sqrt{3}}, 3, \\frac{22}{e}, -\\frac{49}{5}} \\setminus {-\\frac{4}{5}, 3, -\\frac{5}{\\sqrt{3}}, \\frac{22}{e}, 5}$.\n", - "Output Answer": [ - "${-\\frac{49}{5}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 4, -(5/(math.sqrt(3))), 3, (22/math.e), -(49/5),))\nsnd = set((-(4/5), 3, -(5/(math.sqrt(3))), (22/math.e), 5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{8}{3}, -9, -8, -6, 9, -9}$.\n", - "Output Answer": [ - "${-9, -9, -8, -6, \\frac{8}{3}, 9}$" - ], - "Output Program": [ - "values = (8/3), -9, -8, -6, 9, -9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 49, 9}$.\n", - "Output Answer": [ - "$\\sqrt[3]{-1} 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 49, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2, -4, -5, 4, 0, -6, 10} \\cap {1, 4, 0, -6, -3, -2, -5}$.\n", - "Output Answer": [ - "${-6, -5, -2, 0, 4}$" - ], - "Output Program": [ - "fst = set((-2, -4, -5, 4, 0, -6, 10,))\nsnd = set((1, 4, 0, -6, -3, -2, -5,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-8, \\frac{7}{3}, 0, \\frac{3}{\\sqrt{\\pi }}, \\frac{37}{5}, 1, -10}$.\n", - "Output Answer": [ - "${-10, -8, 0, 1, \\frac{3}{\\sqrt{\\pi }}, \\frac{7}{3}, \\frac{37}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, (7/3), 0, (3/(math.sqrt(math.pi))), (37/5), 1, -10\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.037,0.164,0.044,0.149,0.044,0.053,0.088,0.226,0.093\\}$ and $\\{0.021,0.165,0.183,0.038,0.087,0.054,0.037,0.255,0.078\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.037, 0.164, 0.044, 0.149, 0.044, 0.053, 0.088, 0.226, 0.093\ndistribution2 = 0.021, 0.165, 0.183, 0.038, 0.087, 0.054, 0.037, 0.255, 0.078\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-6 \\sqrt{2}, -5, 8, -\\frac{11}{e}, -1, \\frac{25}{3}, 2, \\frac{9}{2}, -8, -6, -1, 8, 1, \\frac{10}{3}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6*math.sqrt(2), -5, 8, -(11/math.e), -1, (25/3), 2, (9/2), -8, -6, -1, 8, 1, (10/3)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, 14, 4, 11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{509}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 14, 4, 11\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{2}{e}, 1, -7, \\frac{22}{5}, -6, -3 \\sqrt{5}, 11 \\log (2), -5} \\cup {-1, -4 \\log (2), -2, \\frac{22}{5}, -\\frac{2}{e}, -3 \\sqrt{5}, 8, 1}$.\n", - "Output Answer": [ - "${-7, -3 \\sqrt{5}, -6, -5, -4 \\log (2), -2, -1, -\\frac{2}{e}, 1, \\frac{22}{5}, 11 \\log (2), 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(2/math.e), 1, -7, (22/5), -6, -3*math.sqrt(5), 11*math.log(2), -5,))\nsnd = set((-1, -4*math.log(2), -2, (22/5), -(2/math.e), -3*math.sqrt(5), 8, 1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.121,0.161,0.071,0.061,0.206,0.166\\}$ and $\\{0.125,0.077,0.028,0.088,0.062,0.096,0.097\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.121, 0.161, 0.071, 0.061, 0.206, 0.166\ndistribution2 = 0.125, 0.077, 0.028, 0.088, 0.062, 0.096, 0.097\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-5.9, \\pi, -5, -1, -2, -\\pi} \\cup {-1, \\pi, 7, -2, 1, -\\pi, -5.9}$.\n", - "Output Answer": [ - "${-5.9, -5, -\\pi, -2, -1, 1, \\pi, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.9, math.pi, -5, -1, -2, -math.pi,))\nsnd = set((-1, math.pi, 7, -2, 1, -math.pi, -5.9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -\\frac{32}{5}, -1, 0, 0, -10, -e, \\frac{9}{\\sqrt{5}}, -5, \\frac{5}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -8, 6}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -(32/5), -1, 0, 0, -10, -math.e, (9/(math.sqrt(5))), -5, (5/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -8, 6\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{45}{7}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{45}{7}+\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(45/7), math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\sqrt{3}, 4 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, \\sqrt{3}, -5 \\sqrt{3}, 4 \\sqrt{3}, \\sqrt{3}, 4 \\sqrt{3}, 2 \\sqrt{3}, \\sqrt{3}, 4 \\sqrt{3}, -5 \\sqrt{3}, 4 \\sqrt{3}, 2 \\sqrt{3}, \\sqrt{3}, 4 \\sqrt{3}, 4 \\sqrt{3}, -5 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, 4 \\sqrt{3}, 4 \\sqrt{3}, \\sqrt{3}, 2 \\sqrt{3}, 4 \\sqrt{3}, 4 \\sqrt{3}, \\sqrt{3}, -5 \\sqrt{3}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.sqrt(3), 4*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), math.sqrt(3), -5*math.sqrt(3), 4*math.sqrt(3), math.sqrt(3), 4*math.sqrt(3), 2*math.sqrt(3), math.sqrt(3), 4*math.sqrt(3), -5*math.sqrt(3), 4*math.sqrt(3), 2*math.sqrt(3), math.sqrt(3), 4*math.sqrt(3), 4*math.sqrt(3), -5*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), 4*math.sqrt(3), 4*math.sqrt(3), math.sqrt(3), 2*math.sqrt(3), 4*math.sqrt(3), 4*math.sqrt(3), math.sqrt(3), -5*math.sqrt(3), 4*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{e}, 7, 2 \\sqrt{3}, 8, -1, 6, 8 \\log (2), -7, 0, \\frac{26}{7}, 4, 5 \\sqrt{3}, -5 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{26}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/math.e), 7, 2*math.sqrt(3), 8, -1, 6, 8*math.log(2), -7, 0, (26/7), 4, 5*math.sqrt(3), -5*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-7, -\\frac{1}{2}, -9, -\\frac{19}{2}, -\\frac{9}{2}} \\cap {-\\frac{9}{2}, -1, 3, -9, 1, 5}$.\n", - "Output Answer": [ - "${-9, -\\frac{9}{2}}$" - ], - "Output Program": [ - "fst = set((-7, -(1/2), -9, -(19/2), -(9/2),))\nsnd = set((-(9/2), -1, 3, -9, 1, 5,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, 5 \\sqrt{3}, \\frac{4}{\\sqrt{\\pi }}, 3}$.\n", - "Output Answer": [ - "$8+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 5*math.sqrt(3), (4/(math.sqrt(math.pi))), 3\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{3}, 8, -9, -8.937} \\cup {-3 \\sqrt{3}, -8.937, 3, -9}$.\n", - "Output Answer": [ - "${-9, -8.937, -3 \\sqrt{3}, 3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(3), 8, -9, -8.937,))\nsnd = set((-3*math.sqrt(3), -8.937, 3, -9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x-3.6$ where $x \\sim $ \\text{BetaDistribution}[0.8,1.8]\n", - "Output Answer": [ - "$-3.94$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 1.8)\nprint(E(-1.1*x-3.6))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{62}{7}, -4 \\sqrt{2}, -\\frac{14}{e}, 2, \\frac{7}{3}, -7, 5, -4 \\sqrt{3}, \\frac{15}{2}, 2 \\sqrt{2}} \\cup {\\frac{15}{2}, -\\frac{47}{7}, \\sqrt{2}, -4 \\sqrt{2}, -3, 6, -4 \\sqrt{3}, -\\frac{14}{e}}$.\n", - "Output Answer": [ - "${-\\frac{62}{7}, -7, -4 \\sqrt{3}, -\\frac{47}{7}, -4 \\sqrt{2}, -\\frac{14}{e}, -3, \\sqrt{2}, 2, \\frac{7}{3}, 2 \\sqrt{2}, 5, 6, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(62/7), -4*math.sqrt(2), -(14/math.e), 2, (7/3), -7, 5, -4*math.sqrt(3), (15/2), 2*math.sqrt(2),))\nsnd = set(((15/2), -(47/7), math.sqrt(2), -4*math.sqrt(2), -3, 6, -4*math.sqrt(3), -(14/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2 \\pi, 5}$.\n", - "Output Answer": [ - "${5, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.pi, 5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, 9, 27}$.\n", - "Output Answer": [ - "$30\\ 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, 9, 27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4, -3 e, -\\frac{31}{5}, 2, 6, -7}$.\n", - "Output Answer": [ - "${-3 e, -7, -\\frac{31}{5}, -4, 2, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -3*math.e, -(31/5), 2, 6, -7\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{26}{3}, -\\frac{3}{2}, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{26}{3}+2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -(26/3), -(3/2), 2*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -7, 3 \\sqrt{5}, -9, 7, \\frac{11}{\\sqrt{2}}, \\frac{23}{7}} \\cup {-6, -9.888, -7, -9, 4 \\sqrt{5}, \\frac{23}{7}, \\frac{11}{\\sqrt{2}}, 9}$.\n", - "Output Answer": [ - "${-9.888, -9, -7, -6, -1, \\frac{23}{7}, 3 \\sqrt{5}, 7, \\frac{11}{\\sqrt{2}}, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -7, 3*math.sqrt(5), -9, 7, (11/(math.sqrt(2))), (23/7),))\nsnd = set((-6, -9.888, -7, -9, 4*math.sqrt(5), (23/7), (11/(math.sqrt(2))), 9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.6 x^2+2.8 x+2.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$-5.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(-4.6*x**2+2.8*x+2.1))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 0, \\sqrt{3}, 7, 6 \\sqrt{2}, 5 \\sqrt{3}} \\cup {-3, 10, 0, -6 \\sqrt{2}, 5.747, \\sqrt{3}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -3, 0, \\sqrt{3}, 5.747, 7, 6 \\sqrt{2}, 5 \\sqrt{3}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 0, math.sqrt(3), 7, 6*math.sqrt(2), 5*math.sqrt(3),))\nsnd = set((-3, 10, 0, -6*math.sqrt(2), 5.747, math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, \\frac{19}{\\pi }, 0, -\\frac{15}{\\pi }, \\frac{19}{\\pi }, \\frac{5}{\\pi }, -\\frac{15}{\\pi }, -\\frac{14}{\\pi }, 0, 0, -\\frac{21}{\\pi }, \\frac{22}{\\pi }, -\\frac{21}{\\pi }, \\frac{19}{\\pi }, -\\frac{15}{\\pi }, -\\frac{24}{\\pi }, -\\frac{15}{\\pi }, \\frac{19}{\\pi }, \\frac{5}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }, -\\frac{24}{\\pi }, -\\frac{24}{\\pi }, -\\frac{15}{\\pi }, -\\frac{21}{\\pi }, 0}$.\n", - "Output Answer": [ - "$\\left\\{0,-\\frac{15}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, (19/math.pi), 0, -(15/math.pi), (19/math.pi), (5/math.pi), -(15/math.pi), -(14/math.pi), 0, 0, -(21/math.pi), (22/math.pi), -(21/math.pi), (19/math.pi), -(15/math.pi), -(24/math.pi), -(15/math.pi), (19/math.pi), (5/math.pi), (22/math.pi), (22/math.pi), -(24/math.pi), -(24/math.pi), -(15/math.pi), -(21/math.pi), 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -2, \\frac{16}{3}, 5, -9, -9, -3 \\sqrt{3}, -4 \\sqrt{5}, -3, -2, 4 \\sqrt{5}, 5, \\frac{11}{3}, 5}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -2, (16/3), 5, -9, -9, -3*math.sqrt(3), -4*math.sqrt(5), -3, -2, 4*math.sqrt(5), 5, (11/3), 5\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{2}, 16}$.\n", - "Output Answer": [ - "$\\frac{1184}{69}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/2), 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{48}{7}, \\frac{32}{7}, \\frac{16}{7}, \\frac{48}{7}, \\frac{48}{7}, \\frac{48}{7}, \\frac{16}{7}, \\frac{16}{7}, -\\frac{11}{7}, -\\frac{11}{7}, \\frac{48}{7}, \\frac{48}{7}, \\frac{32}{7}, \\frac{48}{7}, -\\frac{11}{7}, -\\frac{11}{7}, \\frac{48}{7}, \\frac{32}{7}, \\frac{32}{7}, \\frac{32}{7}, -\\frac{11}{7}, \\frac{16}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{48}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (48/7), (32/7), (16/7), (48/7), (48/7), (48/7), (16/7), (16/7), -(11/7), -(11/7), (48/7), (48/7), (32/7), (48/7), -(11/7), -(11/7), (48/7), (32/7), (32/7), (32/7), -(11/7), (16/7)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, 6561, 64, 25, 32768, 25}$.\n", - "Output Answer": [ - "$24 \\sqrt[6]{-1} \\sqrt{3} 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 6561, 64, 25, 32768, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2.84, 8.99, -8.83, -4.97, -2.4, 8.36, 9.22, -0.08, 8.59} \\cap {-2.84, 9.74, -1.84, -0.08, -2.4, 0., 3.79, 6.46, 9.83}$.\n", - "Output Answer": [ - "${-2.84, -2.4, -0.08}$" - ], - "Output Program": [ - "fst = set((-2.84, 8.99, -8.83, -4.97, -2.4, 8.36, 9.22, -0.08, 8.59,))\nsnd = set((-2.84, 9.74, -1.84, -0.08, -2.4, 0., 3.79, 6.46, 9.83,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{5}, -\\frac{26}{3}, -6}$.", - "Output Answer": [ - "$-6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(5), -(26/3), -6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -1, 0, -6, 8, 4}$.\n", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -1, 0, -6, 8, 4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4, -10, \\frac{13}{2}}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -10, (13/2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${5, 7, 13}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{13}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, 7, 13\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -7, -4 \\sqrt{2}, 9, -2 \\sqrt{3}, -5.87, 8, \\frac{19}{3}} \\setminus {-5.87, -7, 1, \\frac{19}{3}, \\frac{1}{3}, -2 \\sqrt{3}, -8}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -4, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -7, -4*math.sqrt(2), 9, -2*math.sqrt(3), -5.87, 8, (19/3),))\nsnd = set((-5.87, -7, 1, (19/3), (1/3), -2*math.sqrt(3), -8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 0, 2}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "values = 0, 0, 2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, -\\pi, 0, 0, \\pi, \\pi, 2 \\pi, 0, 0, 0, \\pi, 0, 0, 0, -\\pi, 0, 0, 0, -\\pi, 0, 2 \\pi, -\\pi, 0, 0, -\\pi}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 0, -math.pi, 0, 0, math.pi, math.pi, 2*math.pi, 0, 0, 0, math.pi, 0, 0, 0, -math.pi, 0, 0, 0, -math.pi, 0, 2*math.pi, -math.pi, 0, 0, -math.pi\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-7 \\log (2), -6, -5}$.\n", - "Output Answer": [ - "${-6, -5, -7 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -7*math.log(2), -6, -5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{12}{\\pi }, -4, 5, 5 \\log (2), 3 \\sqrt{2}, -3, -2} \\cup {-4, -2 \\log (2), 4, \\frac{12}{\\pi }, -6 \\sqrt{2}, 8, -7}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -7, -4, -3, -2, -2 \\log (2), 5 \\log (2), \\frac{12}{\\pi }, 4, 3 \\sqrt{2}, 5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set(((12/math.pi), -4, 5, 5*math.log(2), 3*math.sqrt(2), -3, -2,))\nsnd = set((-4, -2*math.log(2), 4, (12/math.pi), -6*math.sqrt(2), 8, -7,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.187,0.215,0.107,0.046,0.115,0.125,0.064,0.098\\}$ and $\\{0.12,0.109,0.072,0.193,0.051,0.061,0.192,0.044\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.187, 0.215, 0.107, 0.046, 0.115, 0.125, 0.064, 0.098\ndistribution2 = 0.12, 0.109, 0.072, 0.193, 0.051, 0.061, 0.192, 0.044\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\sqrt{3}, -7, 2 \\log (2), -2 \\sqrt{5}, 7.006, -\\frac{22}{e}} \\setminus {3 \\sqrt{5}, -4, \\frac{4}{\\sqrt{\\pi }}, -2.773, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{22}{e}, -7, -2 \\sqrt{5}, 2 \\log (2), 7.006}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(3), -7, 2*math.log(2), -2*math.sqrt(5), 7.006, -(22/math.e),))\nsnd = set((3*math.sqrt(5), -4, (4/(math.sqrt(math.pi))), -2.773, -4*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-729, 3, 7776, 1, 4096, -9}$.\n", - "Output Answer": [ - "$36\\ 2^{5/6} \\sqrt[3]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -729, 3, 7776, 1, 4096, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.2 x-2.$ where $x \\sim $ \\text{BetaDistribution}[0.3,1.9]\n", - "Output Answer": [ - "$-1.43$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 1.9)\nprint(E(4.2*x-2.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{9}{2}, -6, 8, 8, 8, \\frac{21}{4}, -\\frac{25}{4}, \\frac{21}{4}, -2, -6, -2, \\frac{21}{4}, -2, -6, \\frac{21}{4}, 8, -\\frac{1}{4}, -6, -6, -\\frac{1}{4}, -6, -\\frac{9}{2}, 8, -\\frac{25}{4}, 8, 8, -\\frac{25}{4}}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(9/2), -6, 8, 8, 8, (21/4), -(25/4), (21/4), -2, -6, -2, (21/4), -2, -6, (21/4), 8, -(1/4), -6, -6, -(1/4), -6, -(9/2), 8, -(25/4), 8, 8, -(25/4)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x+1.$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$2.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(2.3*x+1.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\pi, -2 \\pi, -3 \\pi, 3 \\pi, 0, -\\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$-\\frac{2 \\pi }{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.pi, -2*math.pi, -3*math.pi, 3*math.pi, 0, -math.pi, -2*math.pi\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x^2-1.2 x+2.1$ where $x \\sim $ \\text{BetaDistribution}[1.6,1.4]\n", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 1.4)\nprint(E(-2.7*x**2-1.2*x+2.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-3.05 < 1.9 x-1.2 < 2.55$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2].", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(P((-3.05 < 1.9*x-1.2) & (1.9*x-1.2 < 2.55)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, -59049, -10, 49, 3125}$.\n", - "Output Answer": [ - "$45 \\sqrt[5]{-5} 2^{4/5} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -59049, -10, 49, 3125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -\\frac{37}{4}, 4, -\\frac{16}{\\sqrt{3}}, \\frac{11}{e}, \\frac{5}{\\sqrt{2}}, \\frac{17}{\\sqrt{5}}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{37}{4}+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -(37/4), 4, -(16/(math.sqrt(3))), (11/math.e), (5/(math.sqrt(2))), (17/(math.sqrt(5))), 6*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4, 0, -10, -4 \\sqrt{2}, -7, -8, -9, -2, 5, -7, -2, -8, -9, \\frac{9}{7}, 0}$.", - "Output Answer": [ - "$-4 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, 0, -10, -4*math.sqrt(2), -7, -8, -9, -2, 5, -7, -2, -8, -9, (9/7), 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${7, -8.1, \\frac{13}{4}, -6.463, 3 \\sqrt{3}, -1} \\setminus {-5.6, -1, -4.18, -6.463}$.\n", - "Output Answer": [ - "${-8.1, \\frac{13}{4}, 3 \\sqrt{3}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -8.1, (13/4), -6.463, 3*math.sqrt(3), -1,))\nsnd = set((-5.6, -1, -4.18, -6.463,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{39}{7}, \\frac{19}{\\pi }, -3.4, 5}$.\n", - "Output Answer": [ - "${-\\frac{39}{7}, -3.4, 5, \\frac{19}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(39/7), (19/math.pi), -3.4, 5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -3, 4 \\sqrt{3}, -3 \\pi, \\sqrt{2}}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -3, 4*math.sqrt(3), -3*math.pi, math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, -8, 8, 3, -\\frac{22}{\\pi }, -2} \\cup {-1, -\\frac{22}{\\pi }, -8, 3, 0}$.\n", - "Output Answer": [ - "${-8, -\\frac{22}{\\pi }, -2, -1, 0, 3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -8, 8, 3, -(22/math.pi), -2,))\nsnd = set((-1, -(22/math.pi), -8, 3, 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, 15, -11, -15}$.\n", - "Output Answer": [ - "$\\frac{596}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 15, -11, -15\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-5, 625, 9, 10000, -7776, 1}$.\n", - "Output Answer": [ - "$30 \\sqrt[6]{3} \\sqrt{10}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 625, 9, 10000, -7776, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4.274, 5.717, -1.631, 8.617, -8.66, 9.996, -5.641, -7.178, -5.074} \\cap {4.95, 9.996, -8.66, -9.635, -5.446, -5.016, -7.178, -4.274, 3.542}$.\n", - "Output Answer": [ - "${-8.66, -7.178, -4.274, 9.996}$" - ], - "Output Program": [ - "fst = set((-4.274, 5.717, -1.631, 8.617, -8.66, 9.996, -5.641, -7.178, -5.074,))\nsnd = set((4.95, 9.996, -8.66, -9.635, -5.446, -5.016, -7.178, -4.274, 3.542,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4, 3, -\\frac{27}{e}, 7, -4, -9, \\sqrt{2}, 3, \\frac{3}{4}, -3 \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{3}{4}+\\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, 3, -(27/math.e), 7, -4, -9, math.sqrt(2), 3, (3/4), -3*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, 531441, -1, 1, 59049, 512}$.\n", - "Output Answer": [ - "$162 \\sqrt[6]{-1} \\sqrt{2} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, 531441, -1, 1, 59049, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, \\frac{18}{\\pi }, \\frac{17}{\\pi }, -\\frac{10}{\\pi }, \\frac{23}{\\pi }, -\\frac{13}{\\pi }, \\frac{18}{\\pi }, \\frac{18}{\\pi }, -\\frac{13}{\\pi }, \\frac{23}{\\pi }, 0, -\\frac{27}{\\pi }, -\\frac{27}{\\pi }, -\\frac{13}{\\pi }, 0, -\\frac{27}{\\pi }, -\\frac{27}{\\pi }, 0, \\frac{18}{\\pi }, -\\frac{13}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{0,\\frac{18}{\\pi },-\\frac{13}{\\pi },-\\frac{27}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, (18/math.pi), (17/math.pi), -(10/math.pi), (23/math.pi), -(13/math.pi), (18/math.pi), (18/math.pi), -(13/math.pi), (23/math.pi), 0, -(27/math.pi), -(27/math.pi), -(13/math.pi), 0, -(27/math.pi), -(27/math.pi), 0, (18/math.pi), -(13/math.pi)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-9.808, -2, 9, -4 \\sqrt{2}, -4, -5 \\sqrt{2}, -\\frac{7}{3}, \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9.808, -5 \\sqrt{2}, -4 \\sqrt{2}, -4, -\\frac{7}{3}, -2, \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -9.808, -2, 9, -4*math.sqrt(2), -4, -5*math.sqrt(2), -(7/3), math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, 9, -1, -4, 2, -5, 8, 7, 5, 4, -10, 0, 1} \\cap {-5, -1, 2, 0, 4, 5, -7, -8, 7, 1, 9, -6, -2, -3}$.\n", - "Output Answer": [ - "${-8, -5, -1, 0, 1, 2, 4, 5, 7, 9}$" - ], - "Output Program": [ - "fst = set((-8, 9, -1, -4, 2, -5, 8, 7, 5, 4, -10, 0, 1,))\nsnd = set((-5, -1, 2, 0, 4, 5, -7, -8, 7, 1, 9, -6, -2, -3,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 5, 7, -1, -\\frac{9}{\\sqrt{5}}, 2, 4 \\sqrt{2}, 0, -10}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 5, 7, -1, -(9/(math.sqrt(5))), 2, 4*math.sqrt(2), 0, -10\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{5}{e}, 5, 0, -5, -5 \\sqrt{3}, \\frac{3}{2}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -5, 0, \\frac{3}{2}, \\frac{5}{e}, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/math.e), 5, 0, -5, -5*math.sqrt(3), (3/2)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -8, 10, \\frac{9}{\\sqrt{\\pi }}, -1, -4, 8, -\\pi, -\\frac{19}{2}, 4, 6, 9, 13 \\log (2), -7}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -8, 10, (9/(math.sqrt(math.pi))), -1, -4, 8, -math.pi, -(19/2), 4, 6, 9, 13*math.log(2), -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${4, -\\frac{35}{4}, -3 \\sqrt{3}, \\frac{10}{\\pi }, -3 \\sqrt{5}, -4 \\sqrt{3}} \\cup {-3 \\sqrt{3}, \\frac{29}{\\pi }, -3 \\sqrt{5}, -6, \\sqrt{3}, 4}$.\n", - "Output Answer": [ - "${-\\frac{35}{4}, -4 \\sqrt{3}, -3 \\sqrt{5}, -6, -3 \\sqrt{3}, \\sqrt{3}, \\frac{10}{\\pi }, 4, \\frac{29}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -(35/4), -3*math.sqrt(3), (10/math.pi), -3*math.sqrt(5), -4*math.sqrt(3),))\nsnd = set((-3*math.sqrt(3), (29/math.pi), -3*math.sqrt(5), -6, math.sqrt(3), 4,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{4}{3}, 1, \\frac{5}{2}, -\\frac{13}{\\sqrt{5}}, -3, \\frac{21}{\\sqrt{5}}, 7, -2 \\sqrt{3}, 0, -\\pi}$.", - "Output Answer": [ - "$-\\frac{2}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(4/3), 1, (5/2), -(13/(math.sqrt(5))), -3, (21/(math.sqrt(5))), 7, -2*math.sqrt(3), 0, -math.pi\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -\\frac{5}{2}, -3 e}$.", - "Output Answer": [ - "$-3 e$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -(5/2), -3*math.e\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{3}, \\frac{2}{\\sqrt{3}}, -\\frac{14}{\\pi }, -\\frac{17}{2}, 4, 1, 2}$.", - "Output Answer": [ - "$\\frac{2}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(3), (2/(math.sqrt(3))), -(14/math.pi), -(17/2), 4, 1, 2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 625, 64, 531441, 4096, 100000}$.\n", - "Output Answer": [ - "$720 \\sqrt[3]{2} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 625, 64, 531441, 4096, 100000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -9, -6, -6, 1, 4}$.\n", - "Output Answer": [ - "$-\\frac{19}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -9, -6, -6, 1, 4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-5, -9, 10, 8, 0.03, -8} \\setminus {-5, -8, -2, -9, 10, 0.03}$.\n", - "Output Answer": [ - "${8}$" - ], - "Output Program": [ - "fst = set((-5, -9, 10, 8, 0.03, -8,))\nsnd = set((-5, -8, -2, -9, 10, 0.03,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 13, \\frac{29}{2}, 13}$.\n", - "Output Answer": [ - "$\\frac{6032}{713}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 13, (29/2), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{39}{5}, \\frac{43}{5}, -\\frac{41}{5}, \\frac{36}{5}, -\\frac{28}{5}, -\\frac{29}{5}, \\frac{3}{5}}$.\n", - "Output Answer": [ - "$\\frac{23}{35}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (39/5), (43/5), -(41/5), (36/5), -(28/5), -(29/5), (3/5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\log (2), -\\frac{11}{2}, 7, 2 e, -6, -4} \\setminus {2 e, 3 \\log (2), 7, -4, -7, -5}$.\n", - "Output Answer": [ - "${-6, -\\frac{11}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.log(2), -(11/2), 7, 2*math.e, -6, -4,))\nsnd = set((2*math.e, 3*math.log(2), 7, -4, -7, -5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{25}{2}, 11, 3, 5}$.\n", - "Output Answer": [ - "$\\frac{3300}{581}$" - ], - "Output Program": [ - "import statistics\nvalues = (25/2), 11, 3, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, \\frac{19}{3}, 5, \\frac{58}{3}}$.\n", - "Output Answer": [ - "$\\frac{5510}{1253}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, (19/3), 5, (58/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 1, 12, 16}$.\n", - "Output Answer": [ - "$\\frac{192}{61}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 1, 12, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2, -6, 3, 0, 5, -1, 2, 6} \\cap {7, 2, -10, 3, -5, -6, -3, 8, 0, -4}$.\n", - "Output Answer": [ - "${-6, 0, 2, 3}$" - ], - "Output Program": [ - "fst = set((-2, -6, 3, 0, 5, -1, 2, 6,))\nsnd = set((7, 2, -10, 3, -5, -6, -3, 8, 0, -4,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2, -5, 7, 0, -6, -7, 4 \\sqrt{5}, 5, -4} \\cup {7, -6, -\\frac{28}{3}, 5, 4 \\sqrt{5}, -7, 0}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -7, -6, -5, -4, 0, 2, 5, 7, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -5, 7, 0, -6, -7, 4*math.sqrt(5), 5, -4,))\nsnd = set((7, -6, -(28/3), 5, 4*math.sqrt(5), -7, 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\pi, \\frac{52}{7}, -\\sqrt{5}, e, 7, 0.03, 4} \\cup {7, -2.71, e, \\frac{52}{7}, 3 \\pi, 5, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -2.71, -\\sqrt{5}, 0.03, e, 4, 5, 7, \\frac{52}{7}, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, (52/7), -math.sqrt(5), math.e, 7, 0.03, 4,))\nsnd = set((7, -2.71, math.e, (52/7), 3*math.pi, 5, -4*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${6, -2, 0, -3, 2, 3, 1, -4, 7} \\cap {-2, 4, 5, -1, 2, -6, -7}$.\n", - "Output Answer": [ - "${-2, 2}$" - ], - "Output Program": [ - "fst = set((6, -2, 0, -3, 2, 3, 1, -4, 7,))\nsnd = set((-2, 4, 5, -1, 2, -6, -7,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{9}{\\sqrt{2}}, 3, 5, -9, \\frac{1}{e}, 0, -\\frac{14}{e}, -14 \\log (2), 4, 4, -\\frac{3}{2}, 9, 6}$.\n", - "Output Answer": [ - "$9+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -(9/(math.sqrt(2))), 3, 5, -9, (1/math.e), 0, -(14/math.e), -14*math.log(2), 4, 4, -(3/2), 9, 6\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{3}, -3, 5, 4, 2 \\pi, -5, 8, 7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(5+3 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(3), -3, 5, 4, 2*math.pi, -5, 8, 7\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, 1, \\frac{14}{\\sqrt{\\pi }}, 7, \\frac{22}{3}} \\setminus {6, 5, \\frac{5}{\\pi }, -8, -5, -\\frac{13}{\\sqrt{\\pi }}, \\frac{22}{3}}$.\n", - "Output Answer": [ - "${-2, 1, 7, \\frac{14}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 1, (14/(math.sqrt(math.pi))), 7, (22/3),))\nsnd = set((6, 5, (5/math.pi), -8, -5, -(13/(math.sqrt(math.pi))), (22/3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -14, 2, -3}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{1043}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -14, 2, -3\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 15, 14, 2, 3, -12}$.\n", - "Output Answer": [ - "$3 \\sqrt{\\frac{62}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 15, 14, 2, 3, -12\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, 3 \\sqrt{5}, 4 \\sqrt{2}, \\frac{28}{3}, -1, 0, -3, -2, 1, 5}$.\n", - "Output Answer": [ - "$\\frac{37}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 3*math.sqrt(5), 4*math.sqrt(2), (28/3), -1, 0, -3, -2, 1, 5\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${8, 3, \\frac{21}{\\sqrt{5}}}$.", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 3, (21/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.164,0.186,0.157,0.087,0.139,0.058,0.096,0.027\\}$ and $\\{0.009,0.064,0.089,0.212,0.115,0.082,0.103,0.126,0.071\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.164, 0.186, 0.157, 0.087, 0.139, 0.058, 0.096, 0.027\ndistribution2 = 0.009, 0.064, 0.089, 0.212, 0.115, 0.082, 0.103, 0.126, 0.071\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x^3+0.9 x^2-2.4 x+4.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$7.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(1.2*x**3+0.9*x**2-2.4*x+4.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 8, -8, 6}$.\n", - "Output Answer": [ - "$\\frac{152}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 8, -8, 6\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, -9, -9, 4, 8, 5}$.\n", - "Output Answer": [ - "$\\frac{1012}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -9, -9, 4, 8, 5\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.1,0.056,0.237,0.283,0.112,0.112\\}$ and $\\{0.165,0.148,0.038,0.144,0.205,0.136\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.1, 0.056, 0.237, 0.283, 0.112, 0.112\ndistribution2 = 0.165, 0.148, 0.038, 0.144, 0.205, 0.136\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{29}{3}, 0, 2 \\sqrt{3}, 10, -5, 8, 3, -\\frac{3}{\\sqrt{2}}} \\cup {\\frac{29}{3}, -10, -5 \\sqrt{3}, 7, -5, 8, \\frac{9}{\\sqrt{2}}, 3}$.\n", - "Output Answer": [ - "${-10, -5 \\sqrt{3}, -5, -\\frac{3}{\\sqrt{2}}, 0, 3, 2 \\sqrt{3}, \\frac{9}{\\sqrt{2}}, 7, 8, \\frac{29}{3}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((29/3), 0, 2*math.sqrt(3), 10, -5, 8, 3, -(3/(math.sqrt(2))),))\nsnd = set(((29/3), -10, -5*math.sqrt(3), 7, -5, 8, (9/(math.sqrt(2))), 3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7776, -1, 1, 25, 64}$.\n", - "Output Answer": [ - "$12 \\sqrt[5]{2} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -7776, -1, 1, 25, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -5, 6, 8, 2, -8, 3, -6}$.\n", - "Output Answer": [ - "$-\\frac{3}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -5, 6, 8, 2, -8, 3, -6\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, 7, 8}$.\n", - "Output Answer": [ - "$\\sqrt{61}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, 7, 8\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-9, -1, -1, \\frac{9}{e}, 3, 7, 1, -1}$.\n", - "Output Answer": [ - "${-9, -1, -1, -1, 1, 3, \\frac{9}{e}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -1, -1, (9/math.e), 3, 7, 1, -1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-9, 6, 15, -4}$.\n", - "Output Answer": [ - "$\\sqrt{114}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 6, 15, -4\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, 81, -1, -5, 7}$.\n", - "Output Answer": [ - "$3^{4/5} \\sqrt[5]{70}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 81, -1, -5, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{29}{3}, 8, -7 \\sqrt{2}, -2, \\frac{55}{7}} \\setminus {-6, -1.36, -7 \\sqrt{2}, \\frac{67}{7}, -\\frac{29}{3}}$.\n", - "Output Answer": [ - "${-2, \\frac{55}{7}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(29/3), 8, -7*math.sqrt(2), -2, (55/7),))\nsnd = set((-6, -1.36, -7*math.sqrt(2), (67/7), -(29/3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{5}, 0, 0, \\sqrt{5}, 2 \\sqrt{5}, -2 \\sqrt{5}, 3 \\sqrt{5}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$-\\frac{3 \\sqrt{5}}{8}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(5), 0, 0, math.sqrt(5), 2*math.sqrt(5), -2*math.sqrt(5), 3*math.sqrt(5), -3*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3 e, 2, -9, 2 e} \\cup {3 e, 2, 2 e, -9}$.\n", - "Output Answer": [ - "${-9, 2, 2 e, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.e, 2, -9, 2*math.e,))\nsnd = set((3*math.e, 2, 2*math.e, -9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.052,0.061,0.454,0.063,0.307\\}$ and $\\{0.016,0.343,0.353,0.048,0.2\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.052, 0.061, 0.454, 0.063, 0.307\ndistribution2 = 0.016, 0.343, 0.353, 0.048, 0.2\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5 \\sqrt{3}, 0, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{2}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 5*math.sqrt(3), 0, -3*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${5, -\\frac{11}{\\sqrt{5}}, 5, -7, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -(11/(math.sqrt(5))), 5, -7, 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${8, 9, 6, -\\frac{12}{e}, 9 \\log (2), -2, 7, -4, 0, -\\sqrt{2}, 10, -4, -\\frac{7}{4}, 5 \\sqrt{3}}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 9, 6, -(12/math.e), 9*math.log(2), -2, 7, -4, 0, -math.sqrt(2), 10, -4, -(7/4), 5*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.118,0.065,0.104,0.157,0.073,0.147,0.101,0.125,0.027\\}$ and $\\{0.111,0.056,0.025,0.095,0.051,0.13,0.199,0.123,0.115\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.118, 0.065, 0.104, 0.157, 0.073, 0.147, 0.101, 0.125, 0.027\ndistribution2 = 0.111, 0.056, 0.025, 0.095, 0.051, 0.13, 0.199, 0.123, 0.115\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\pi, -3 \\pi, -2 \\pi, 0, \\pi, -2 \\pi, \\pi, -\\pi, -3 \\pi, 0, 0, -\\pi, -3 \\pi, 0, -3 \\pi, \\pi, 0, \\pi, -2 \\pi, -2 \\pi, -\\pi, \\pi, -3 \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$\\{-2 \\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.pi, -3*math.pi, -2*math.pi, 0, math.pi, -2*math.pi, math.pi, -math.pi, -3*math.pi, 0, 0, -math.pi, -3*math.pi, 0, -3*math.pi, math.pi, 0, math.pi, -2*math.pi, -2*math.pi, -math.pi, math.pi, -3*math.pi, -2*math.pi\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, 13, 4, 13, -14}$.\n", - "Output Answer": [ - "$\\frac{1247}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 13, 4, 13, -14\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{2}{\\pi }, -9, \\frac{9}{2}, -3, 4, -3 \\sqrt{3}, 7, 0, -1.1} \\cup {-3 \\sqrt{3}, -\\frac{2}{5}, -4.6, 6, 7, -6, \\frac{1}{2}, -\\frac{2}{\\pi }, -7, 10, 0}$.\n", - "Output Answer": [ - "${-9, -7, -6, -3 \\sqrt{3}, -4.6, -3, -1.1, -\\frac{2}{\\pi }, -\\frac{2}{5}, 0, \\frac{1}{2}, 4, \\frac{9}{2}, 6, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(2/math.pi), -9, (9/2), -3, 4, -3*math.sqrt(3), 7, 0, -1.1,))\nsnd = set((-3*math.sqrt(3), -(2/5), -4.6, 6, 7, -6, (1/2), -(2/math.pi), -7, 10, 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 5, 9, 5, -7, 5, 5, 5, 5, 9, 5, -6, 5, 9, 5, -7, 5, 9, -6, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 5, 9, 5, -7, 5, 5, 5, 5, 9, 5, -6, 5, 9, 5, -7, 5, 9, -6, 5\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\pi, -2 \\pi, 2 \\pi, -3 \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$-\\frac{6 \\pi }{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.pi, -2*math.pi, 2*math.pi, -3*math.pi, -2*math.pi\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{7}{2}, \\frac{37}{2}}$.\n", - "Output Answer": [ - "$\\frac{259}{44}$" - ], - "Output Program": [ - "import statistics\nvalues = (7/2), (37/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 4, \\frac{1}{4}, 3} \\cup {\\frac{1}{4}, 7, -1, 4, 3}$.\n", - "Output Answer": [ - "${-1, \\frac{1}{4}, 3, 4, 7}$" - ], - "Output Program": [ - "fst = set((-1, 4, (1/4), 3,))\nsnd = set(((1/4), 7, -1, 4, 3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 4, 6, 8}$.\n", - "Output Answer": [ - "$\\frac{96}{37}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 4, 6, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{2}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{26}{5 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(2/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, 5, 0, -6, 6, -10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1066}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 5, 0, -6, 6, -10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.9 x-2.6$ where $x \\sim $ \\text{PoissonDistribution}[0.6]\n", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.6)\nprint(E(4.9*x-2.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, 0, 0, 0, -5 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, 0, 0, -\\frac{7}{\\sqrt{2}}, \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, -5 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, \\sqrt{2}, -5 \\sqrt{2}, 0, -\\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{0,-\\frac{7}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.sqrt(2), math.sqrt(2), math.sqrt(2), 0, 0, 0, -5*math.sqrt(2), -(7/(math.sqrt(2))), 0, 0, -(7/(math.sqrt(2))), math.sqrt(2), -(7/(math.sqrt(2))), -(7/(math.sqrt(2))), -5*math.sqrt(2), -(7/(math.sqrt(2))), math.sqrt(2), -5*math.sqrt(2), 0, -(7/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${15625, 64, 8, 81, 100, -243}$.\n", - "Output Answer": [ - "$30 \\sqrt[6]{-1} 2^{5/6} \\sqrt{3} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 15625, 64, 8, 81, 100, -243\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 9, -14, 9, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1363}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 9, -14, 9, 14\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -5, 10, -8, 0}$.\n", - "Output Answer": [ - "$\\frac{1}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -5, 10, -8, 0\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, -5, 15, 11}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{1259}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -5, 15, 11\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 1, 11, 3}$.\n", - "Output Answer": [ - "$\\frac{33}{20}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 1, 11, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, \\frac{1}{2}}$.\n", - "Output Answer": [ - "$\\frac{12}{13}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, (1/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4, 3.7, \\frac{38}{7}, -2, \\frac{3}{\\sqrt{\\pi }}, -10, -9, 3}$.\n", - "Output Answer": [ - "${-10, -9, -4, -2, \\frac{3}{\\sqrt{\\pi }}, 3, 3.7, \\frac{38}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 3.7, (38/7), -2, (3/(math.sqrt(math.pi))), -10, -9, 3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-243, 9, 36, -4, -5}$.\n", - "Output Answer": [ - "$3 \\sqrt[5]{-5} 6^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -243, 9, 36, -4, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -\\frac{28}{3}, -\\frac{10}{3}, -\\frac{23}{3}}$.\n", - "Output Answer": [ - "$-\\frac{19}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -(28/3), -(10/3), -(23/3)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{4}{e}, 2 \\pi, 2 e, 9, \\frac{8}{\\pi }, \\frac{23}{3}, -6, \\frac{13}{7}, -\\frac{3}{5}, 3, 2.95} \\cup {0, \\frac{8}{\\pi }, -\\frac{12}{e}, \\frac{13}{7}, \\frac{23}{3}, 2 \\pi, 8, \\frac{14}{5}}$.\n", - "Output Answer": [ - "${-6, -\\frac{12}{e}, -\\frac{3}{5}, 0, \\frac{4}{e}, \\frac{13}{7}, \\frac{8}{\\pi }, \\frac{14}{5}, 2.95, 3, 2 e, 2 \\pi, \\frac{23}{3}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set(((4/math.e), 2*math.pi, 2*math.e, 9, (8/math.pi), (23/3), -6, (13/7), -(3/5), 3, 2.95,))\nsnd = set((0, (8/math.pi), -(12/math.e), (13/7), (23/3), 2*math.pi, 8, (14/5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.003,0.132,0.253,0.149,0.011,0.125,0.034,0.221\\}$ and $\\{0.117,0.054,0.027,0.152,0.006,0.081,0.044,0.287\\}$.", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.003, 0.132, 0.253, 0.149, 0.011, 0.125, 0.034, 0.221\ndistribution2 = 0.117, 0.054, 0.027, 0.152, 0.006, 0.081, 0.044, 0.287\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{25}{3}, \\frac{2}{3}, \\frac{53}{3}}$.\n", - "Output Answer": [ - "$\\frac{2650}{1481}$" - ], - "Output Program": [ - "import statistics\nvalues = (25/3), (2/3), (53/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x-2.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$-2.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(-2.*x-2.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\sqrt{5}, -\\frac{18}{\\sqrt{5}}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$-\\frac{6}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.sqrt(5), -(18/(math.sqrt(5))), 2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{5}{2}, 4 \\sqrt{3}, \\frac{16}{\\sqrt{\\pi }}, -3, -\\frac{10}{e}, \\frac{4}{e}} \\setminus {\\frac{67}{7}, -5, \\frac{16}{\\sqrt{\\pi }}, -\\frac{10}{e}}$.\n", - "Output Answer": [ - "${-3, \\frac{4}{e}, \\frac{5}{2}, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((5/2), 4*math.sqrt(3), (16/(math.sqrt(math.pi))), -3, -(10/math.e), (4/math.e),))\nsnd = set(((67/7), -5, (16/(math.sqrt(math.pi))), -(10/math.e),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{17}{2}, 4 \\sqrt{2}, 1, 1, -5, -\\frac{15}{2}, -8, 1, -7, 10}$.\n", - "Output Answer": [ - "$\\frac{37}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(17/2), 4*math.sqrt(2), 1, 1, -5, -(15/2), -8, 1, -7, 10\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, 3, \\frac{19}{\\pi }, 2.022, -6, -\\frac{37}{7}, -10} \\setminus {2.022, 0, -5}$.\n", - "Output Answer": [ - "${-10, -6, -\\frac{37}{7}, 3, \\frac{19}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 3, (19/math.pi), 2.022, -6, -(37/7), -10,))\nsnd = set((2.022, 0, -5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5 \\sqrt{3}, -\\frac{6}{e}}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}-\\frac{6}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(3), -(6/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{24}{e}, \\frac{3}{e}, -\\frac{3}{e}, -\\frac{3}{e}, \\frac{3}{e}, \\frac{4}{e}, -\\frac{3}{e}, \\frac{3}{e}, \\frac{24}{e}, -\\frac{3}{e}, -\\frac{3}{e}, \\frac{4}{e}, \\frac{17}{e}, -\\frac{3}{e}, \\frac{4}{e}, -\\frac{5}{e}, \\frac{24}{e}, \\frac{4}{e}, \\frac{17}{e}, \\frac{16}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{3}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (24/math.e), (3/math.e), -(3/math.e), -(3/math.e), (3/math.e), (4/math.e), -(3/math.e), (3/math.e), (24/math.e), -(3/math.e), -(3/math.e), (4/math.e), (17/math.e), -(3/math.e), (4/math.e), -(5/math.e), (24/math.e), (4/math.e), (17/math.e), (16/math.e)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{8}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -4, 5, 8 \\log (2), \\sqrt{2}, \\frac{21}{\\sqrt{5}}, \\frac{5}{\\sqrt{2}}, 3, \\frac{8}{\\sqrt{3}}, -\\frac{19}{e}, -7 \\log (2), -3, \\frac{11}{\\sqrt{3}}, \\frac{59}{7}}$.", - "Output Answer": [ - "$\\frac{8}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (8/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -4, 5, 8*math.log(2), math.sqrt(2), (21/(math.sqrt(5))), (5/(math.sqrt(2))), 3, (8/(math.sqrt(3))), -(19/math.e), -7*math.log(2), -3, (11/(math.sqrt(3))), (59/7)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.175,0.2,0.277,0.183\\}$ and $\\{0.074,0.363,0.299,0.051\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.175, 0.2, 0.277, 0.183\ndistribution2 = 0.074, 0.363, 0.299, 0.051\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.108,0.012,0.075,0.067,0.297,0.204\\}$ and $\\{0.144,0.14,0.138,0.112,0.225,0.078,0.053\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.108, 0.012, 0.075, 0.067, 0.297, 0.204\ndistribution2 = 0.144, 0.14, 0.138, 0.112, 0.225, 0.078, 0.053\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.3 x-0.2$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$-0.39$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(-0.3*x-0.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${4, -5 \\sqrt{2}, -8}$.", - "Output Answer": [ - "$-5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -5*math.sqrt(2), -8\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{23}{\\pi }, -\\frac{18}{\\pi }, -\\frac{11}{\\pi }, \\frac{15}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{37}{4 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(23/math.pi), -(18/math.pi), -(11/math.pi), (15/math.pi)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{\\sqrt{2}}, 0, 6, \\frac{1}{2}, -10, -\\frac{5}{\\sqrt{3}}, 8}$.\n", - "Output Answer": [ - "${-10, -\\frac{11}{\\sqrt{2}}, -\\frac{5}{\\sqrt{3}}, 0, \\frac{1}{2}, 6, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/(math.sqrt(2))), 0, 6, (1/2), -10, -(5/(math.sqrt(3))), 8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-7, -1}$.\n", - "Output Answer": [ - "$3 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -1\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${7.403, 6, -4, -2, -\\frac{16}{\\sqrt{5}}, -0.37, -3.4} \\setminus {-1, -2, 7.403, -\\frac{16}{\\sqrt{5}}, -4, -0.37, -10}$.\n", - "Output Answer": [ - "${-3.4, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.403, 6, -4, -2, -(16/(math.sqrt(5))), -0.37, -3.4,))\nsnd = set((-1, -2, 7.403, -(16/(math.sqrt(5))), -4, -0.37, -10,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${8, 6, 10, -3, 0, 7} \\cap {8, 3, -3, -2, -8, 4, 0, 9}$.\n", - "Output Answer": [ - "${-3, 0, 8}$" - ], - "Output Program": [ - "fst = set((8, 6, 10, -3, 0, 7,))\nsnd = set((8, 3, -3, -2, -8, 4, 0, 9,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.155,0.175,0.21,0.276,0.035,0.119\\}$ and $\\{0.471,0.022,0.032,0.274,0.189,0.005\\}$.", - "Output Answer": [ - "$0.96$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.155, 0.175, 0.21, 0.276, 0.035, 0.119\ndistribution2 = 0.471, 0.022, 0.032, 0.274, 0.189, 0.005\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${6 \\log (2), -1.285, 9, -1, -6, \\frac{57}{7}, -6.8, -4 \\sqrt{3}} \\cup {-4 \\sqrt{3}, 1, -1.285, \\frac{57}{7}, -1, 9, -3 \\log (2), 1.1}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -6.8, -6, -3 \\log (2), -1.285, -1, 1, 1.1, 6 \\log (2), \\frac{57}{7}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((6*math.log(2), -1.285, 9, -1, -6, (57/7), -6.8, -4*math.sqrt(3),))\nsnd = set((-4*math.sqrt(3), 1, -1.285, (57/7), -1, 9, -3*math.log(2), 1.1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${6, -2, 1, 3, 0}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -2, 1, 3, 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -10, -6, 4, 0, -7, -8}$.\n", - "Output Answer": [ - "$-\\frac{24}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -10, -6, 4, 0, -7, -8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2, -8, 2, 7.2, -6, -\\frac{38}{7}} \\cup {-6, -7, -\\frac{38}{7}, -2, 7.2, 8, -8}$.\n", - "Output Answer": [ - "${-8, -7, -6, -\\frac{38}{7}, -2, 2, 7.2, 8}$" - ], - "Output Program": [ - "fst = set((-2, -8, 2, 7.2, -6, -(38/7),))\nsnd = set((-6, -7, -(38/7), -2, 7.2, 8, -8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{18}{7}, 2, \\frac{11}{\\pi }, -7, \\pi} \\setminus {2 \\pi, \\pi, -2 \\sqrt{5}, \\frac{18}{7}, -\\pi, -8, 2, \\frac{11}{\\pi }}$.\n", - "Output Answer": [ - "${-7}$" - ], - "Output Program": [ - "import math\n\nfst = set(((18/7), 2, (11/math.pi), -7, math.pi,))\nsnd = set((2*math.pi, math.pi, -2*math.sqrt(5), (18/7), -math.pi, -8, 2, (11/math.pi),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 6, \\frac{14}{\\sqrt{5}}, 2, 7} \\setminus {\\sqrt{3}, -1, 7}$.\n", - "Output Answer": [ - "${-7, 2, 6, \\frac{14}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 6, (14/(math.sqrt(5))), 2, 7,))\nsnd = set((math.sqrt(3), -1, 7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, -7, 9, 5 \\sqrt{3}, -\\frac{26}{3}} \\setminus {-\\frac{26}{3}, \\frac{29}{4}, -5, -1, -4}$.\n", - "Output Answer": [ - "${-7, 0, 5 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -7, 9, 5*math.sqrt(3), -(26/3),))\nsnd = set((-(26/3), (29/4), -5, -1, -4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, -15, 14, 8, -13}$.\n", - "Output Answer": [ - "$\\frac{1613}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -15, 14, 8, -13\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{23}{3}, -3.8, \\frac{31}{\\pi }, -4.6, 0, -7, -6, 9} \\cup {\\frac{18}{e}, -9.7, \\frac{31}{\\pi }, -1, -\\frac{23}{3}, -6, -\\sqrt{2}, -3.8}$.\n", - "Output Answer": [ - "${-9.7, -\\frac{23}{3}, -7, -6, -4.6, -3.8, -\\sqrt{2}, -1, 0, \\frac{18}{e}, 9, \\frac{31}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(23/3), -3.8, (31/math.pi), -4.6, 0, -7, -6, 9,))\nsnd = set(((18/math.e), -9.7, (31/math.pi), -1, -(23/3), -6, -math.sqrt(2), -3.8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 17, 5, 11}$.\n", - "Output Answer": [ - "$\\frac{29920}{3551}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 17, 5, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 5, 14}$.\n", - "Output Answer": [ - "$\\frac{770}{93}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 5, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.6 x-3.2$ where $x \\sim $ \\text{BetaDistribution}[0.1,0.7]\n", - "Output Answer": [ - "$-3.78$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.1, 0.7)\nprint(E(-4.6*x-3.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 16}$.\n", - "Output Answer": [ - "$28$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, 8, 7, -14, 8}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{134}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 8, 7, -14, 8\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 9, 8, -6 \\sqrt{2}, -1, 9, 4 \\sqrt{5}, -\\sqrt{3}, -9, -2 e, 0, \\frac{11}{\\sqrt{2}}, 8, -7 \\log (2)}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 9, 8, -6*math.sqrt(2), -1, 9, 4*math.sqrt(5), -math.sqrt(3), -9, -2*math.e, 0, (11/(math.sqrt(2))), 8, -7*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 6, -10, -2, -\\frac{1}{2}, 6, -7, 6, 6, -\\frac{19}{2}, -7, -\\frac{13}{2}, -\\frac{1}{2}, -7, -7, -10, -2, -\\frac{1}{2}, -\\frac{13}{2}, 6, 6, -\\frac{13}{2}, -\\frac{1}{2}, -\\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 6, -10, -2, -(1/2), 6, -7, 6, 6, -(19/2), -7, -(13/2), -(1/2), -7, -7, -10, -2, -(1/2), -(13/2), 6, 6, -(13/2), -(1/2), -(19/2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6 \\sqrt{2}, 2 e}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+2 e$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.sqrt(2), 2*math.e\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 8, 10, 12}$.\n", - "Output Answer": [ - "$\\frac{5280}{527}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 8, 10, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{\\pi }, -6, 4, -3 \\sqrt{5}, -1}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -6, -\\frac{11}{\\pi }, -1, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/math.pi), -6, 4, -3*math.sqrt(5), -1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2.26, -8, \\frac{9}{\\sqrt{2}}, 0} \\setminus {-2.26, 3, 9, 0}$.\n", - "Output Answer": [ - "${-8, \\frac{9}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2.26, -8, (9/(math.sqrt(2))), 0,))\nsnd = set((-2.26, 3, 9, 0,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.8 x^2-2.2 x-1.$ where $x \\sim $ \\text{PoissonDistribution}[2.3]\n", - "Output Answer": [ - "$7.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.3)\nprint(E(1.8*x**2-2.2*x-1.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.11,0.241,0.284,0.192\\}$ and $\\{0.143,0.197,0.432,0.059\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.11, 0.241, 0.284, 0.192\ndistribution2 = 0.143, 0.197, 0.432, 0.059\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${6, \\pi, -6, \\frac{64}{7}, 1, \\frac{1}{2}, 7 \\sqrt{2}, -\\frac{14}{3}, \\frac{15}{2}, 2 \\sqrt{5}, 8, -\\frac{11}{5}, -9, -1, -3}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, math.pi, -6, (64/7), 1, (1/2), 7*math.sqrt(2), -(14/3), (15/2), 2*math.sqrt(5), 8, -(11/5), -9, -1, -3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-7, \\frac{31}{5}, -11 \\log (2), 1, -\\frac{39}{5}, \\frac{29}{5}} \\cup {\\frac{33}{4}, 8, \\frac{29}{5}, -11 \\log (2), \\frac{31}{5}, 1}$.\n", - "Output Answer": [ - "${-\\frac{39}{5}, -11 \\log (2), -7, 1, \\frac{29}{5}, \\frac{31}{5}, 8, \\frac{33}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, (31/5), -11*math.log(2), 1, -(39/5), (29/5),))\nsnd = set(((33/4), 8, (29/5), -11*math.log(2), (31/5), 1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, 0, 0, -4 \\sqrt{5}, 3 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, 0, -\\sqrt{5}, -\\sqrt{5}, -3 \\sqrt{5}, 3 \\sqrt{5}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(5), -math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), 0, 0, -4*math.sqrt(5), 3*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), 0, -math.sqrt(5), -math.sqrt(5), -3*math.sqrt(5), 3*math.sqrt(5), 3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{11}{5}, \\frac{21}{5}, -\\frac{2}{5}, -\\frac{44}{5}, -\\frac{37}{5}, \\frac{19}{5}, 1}$.\n", - "Output Answer": [ - "$-\\frac{7}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(11/5), (21/5), -(2/5), -(44/5), -(37/5), (19/5), 1\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, -4, \\sqrt{5}, -\\frac{31}{4}, 7, -10, -1.795} \\cup {-7, 7, -\\frac{15}{2}, 4, -1.795, -2 \\sqrt{5}, -4, 3, \\sqrt{5}}$.\n", - "Output Answer": [ - "${-10, -\\frac{31}{4}, -\\frac{15}{2}, -7, -2 \\sqrt{5}, -4, -1.795, 0, \\sqrt{5}, 3, 4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -4, math.sqrt(5), -(31/4), 7, -10, -1.795,))\nsnd = set((-7, 7, -(15/2), 4, -1.795, -2*math.sqrt(5), -4, 3, math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -7.57, 13 \\log (2), 9.4, -\\frac{14}{\\pi }} \\setminus {1.068, -3, -\\frac{14}{\\pi }, 13 \\log (2), -5.7, \\frac{6}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{5}}, -9}$.\n", - "Output Answer": [ - "${-7.57, 9.4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -7.57, 13*math.log(2), 9.4, -(14/math.pi),))\nsnd = set((1.068, -3, -(14/math.pi), 13*math.log(2), -5.7, (6/(math.sqrt(math.pi))), (17/(math.sqrt(5))), -9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${5, -\\frac{14}{\\sqrt{\\pi }}, -7, 0, -14 \\log (2), 5, \\frac{14}{\\sqrt{5}}, -4 \\sqrt{2}, -6, 0, 2}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -(14/(math.sqrt(math.pi))), -7, 0, -14*math.log(2), 5, (14/(math.sqrt(5))), -4*math.sqrt(2), -6, 0, 2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\sqrt{3}, 5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, 4 \\sqrt{3}, 4 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, 5 \\sqrt{3}, 4 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, 4 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{3 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.sqrt(3), 5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), 4*math.sqrt(3), 4*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), 5*math.sqrt(3), 4*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), 4*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, -\\frac{15}{\\sqrt{\\pi }}, -7, -6, 6.96, -4} \\setminus {6.96, -6, -7}$.\n", - "Output Answer": [ - "${-\\frac{15}{\\sqrt{\\pi }}, -4, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -(15/(math.sqrt(math.pi))), -7, -6, 6.96, -4,))\nsnd = set((6.96, -6, -7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${1, -2, 5, -11, -7, -4}$.\n", - "Output Answer": [ - "$9 \\sqrt{\\frac{2}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -2, 5, -11, -7, -4\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${9, \\frac{12}{e}, 5, 4 \\sqrt{2}, \\frac{16}{3}, -6, -\\frac{23}{3}, 4 \\sqrt{5}, -2 \\pi, 7} \\cup {-3 \\sqrt{5}, -5 \\sqrt{2}, \\sqrt{5}, 7, -6, -\\frac{23}{3}, 5, 4, -\\frac{18}{e}, -5}$.\n", - "Output Answer": [ - "${-\\frac{23}{3}, -5 \\sqrt{2}, -3 \\sqrt{5}, -\\frac{18}{e}, -2 \\pi, -6, -5, \\sqrt{5}, 4, \\frac{12}{e}, 5, \\frac{16}{3}, 4 \\sqrt{2}, 7, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, (12/math.e), 5, 4*math.sqrt(2), (16/3), -6, -(23/3), 4*math.sqrt(5), -2*math.pi, 7,))\nsnd = set((-3*math.sqrt(5), -5*math.sqrt(2), math.sqrt(5), 7, -6, -(23/3), 5, 4, -(18/math.e), -5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 1, 9, 16, 81}$.\n", - "Output Answer": [ - "$3\\ 2^{4/5} \\sqrt[5]{21}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 1, 9, 16, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, 7, 0, 3}$.\n", - "Output Answer": [ - "$30$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, 7, 0, 3\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${8.425, 6 \\sqrt{2}, 0, 4.3, \\frac{20}{e}, 9} \\setminus {0, 4.3, -1}$.\n", - "Output Answer": [ - "${\\frac{20}{e}, 8.425, 6 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.425, 6*math.sqrt(2), 0, 4.3, (20/math.e), 9,))\nsnd = set((0, 4.3, -1,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${5.01, -5, 7}$.\n", - "Output Answer": [ - "${-5, 5.01, 7}$" - ], - "Output Program": [ - "values = 5.01, -5, 7\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, -\\frac{28}{5}, 6, -4, 8 \\log (2), 0}$.\n", - "Output Answer": [ - "${-\\frac{28}{5}, -4, 0, 0, 8 \\log (2), 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(28/5), 6, -4, 8*math.log(2), 0\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.127,0.035,0.085,0.07,0.032,0.045,0.074,0.263,0.089,0.059\\}$ and $\\{0.076,0.06,0.201,0.074,0.037,0.017,0.046,0.281,0.125,0.017\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.127, 0.035, 0.085, 0.07, 0.032, 0.045, 0.074, 0.263, 0.089, 0.059\ndistribution2 = 0.076, 0.06, 0.201, 0.074, 0.037, 0.017, 0.046, 0.281, 0.125, 0.017\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -4, -8, -8, -8, 3, 3, 3, 6, 6, -8, -8, -8, -7, -4, -4, -7, 3, -4, 3}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -4, -8, -8, -8, 3, 3, 3, 6, 6, -8, -8, -8, -7, -4, -4, -7, 3, -4, 3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${7, \\frac{29}{7}, \\frac{16}{e}, 5, 7, 12 \\log (2), -2 \\sqrt{3}, 6, -5, 3}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(5+\\frac{16}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, (29/7), (16/math.e), 5, 7, 12*math.log(2), -2*math.sqrt(3), 6, -5, 3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 6, 6, -5}$.\n", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 6, 6, -5\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.037,0.168,0.124,0.163,0.193,0.162,0.091\\}$ and $\\{0.145,0.163,0.166,0.045,0.103,0.134,0.116\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.037, 0.168, 0.124, 0.163, 0.193, 0.162, 0.091\ndistribution2 = 0.145, 0.163, 0.166, 0.045, 0.103, 0.134, 0.116\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, \\frac{9}{5}, 4, -3, -8, 3 \\sqrt{5}, -7, 5, 6, \\frac{6}{e}, 5, 5, -3, -3 \\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+\\frac{6}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, (9/5), 4, -3, -8, 3*math.sqrt(5), -7, 5, 6, (6/math.e), 5, 5, -3, -3*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $1.11 < 4.4 x^2+3.3 x+2.2 < 4.64$ where $x \\sim $ \\text{ExponentialDistribution}[0.7].", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.7)\nprint(P((1.11 < 4.4*x**2+3.3*x+2.2) & (4.4*x**2+3.3*x+2.2 < 4.64)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8 \\log (2), \\log (2), -\\log (2), 12 \\log (2), 10 \\log (2), 13 \\log (2), -\\log (2)}$.\n", - "Output Answer": [ - "$6 \\log (2)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 8*math.log(2), math.log(2), -math.log(2), 12*math.log(2), 10*math.log(2), 13*math.log(2), -math.log(2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\pi, -7, \\frac{1}{\\pi }, \\frac{26}{5}, 4, 5} \\setminus {3, \\frac{26}{5}, 1, -4, 5, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, -\\pi, \\frac{1}{\\pi }, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, -7, (1/math.pi), (26/5), 4, 5,))\nsnd = set((3, (26/5), 1, -4, 5, 2*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x-3.7$ where $x \\sim $ \\text{NormalDistribution}[1.5,0.8]\n", - "Output Answer": [ - "$-2.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.5, 0.8)\nprint(E(1.1*x-3.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{9}{4}, -2, -\\frac{13}{\\sqrt{2}}, -\\frac{17}{\\sqrt{5}}, -8, 7, 2, 8}$.\n", - "Output Answer": [ - "$8+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(9/4), -2, -(13/(math.sqrt(2))), -(17/(math.sqrt(5))), -8, 7, 2, 8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 7, -27}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 7, -27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${5, 3, 2.651, \\frac{13}{\\sqrt{3}}, 2 \\sqrt{5}, -4.87, -4 \\sqrt{3}, -2}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -4.87, -2, 2.651, 3, 2 \\sqrt{5}, 5, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 3, 2.651, (13/(math.sqrt(3))), 2*math.sqrt(5), -4.87, -4*math.sqrt(3), -2\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, 8, 1}$.\n", - "Output Answer": [ - "$2 \\sqrt[3]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 8, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.321,0.387,0.095,0.112\\}$ and $\\{0.056,0.004,0.221,0.59\\}$.", - "Output Answer": [ - "$2.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.321, 0.387, 0.095, 0.112\ndistribution2 = 0.056, 0.004, 0.221, 0.59\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -\\frac{4}{\\pi }, 9, 10, -10, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -(4/math.pi), 9, 10, -10, -3*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-13 \\log (2), 2, -9, -1, -7 \\log (2), \\frac{10}{e}} \\cup {\\frac{21}{e}, -13 \\log (2), 4, -7 \\log (2), 0, -1, 2}$.\n", - "Output Answer": [ - "${-13 \\log (2), -9, -7 \\log (2), -1, 0, 2, \\frac{10}{e}, 4, \\frac{21}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-13*math.log(2), 2, -9, -1, -7*math.log(2), (10/math.e),))\nsnd = set(((21/math.e), -13*math.log(2), 4, -7*math.log(2), 0, -1, 2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x^2-4.9 x+4.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$17.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(4.3*x**2-4.9*x+4.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{35}{2}, 11, \\frac{5}{2}}$.\n", - "Output Answer": [ - "$\\frac{1155}{211}$" - ], - "Output Program": [ - "import statistics\nvalues = (35/2), 11, (5/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${6, 3, -12, 3, 9}$.\n", - "Output Answer": [ - "$\\frac{657}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 3, -12, 3, 9\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 4, 8, 8, 8, 8, -4, -4, 8, 8, -4, 8, 4, 8, 4, 8, 8, 4, 4, 8, 8, 8, 8, 8, 8, 4, -4, 4, 4, 4}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 4, 8, 8, 8, 8, -4, -4, 8, 8, -4, 8, 4, 8, 4, 8, 8, 4, 4, 8, 8, 8, 8, 8, 8, 4, -4, 4, 4, 4\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 8, -1, -e} \\setminus {-1, 5, 8, \\frac{5}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-9, -e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 8, -1, -math.e,))\nsnd = set((-1, 5, 8, (5/(math.sqrt(3))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, 6, -\\frac{14}{\\pi }, -4, -4, -4, \\frac{5}{\\sqrt{2}}, -\\frac{23}{5}, 1, 9, -4, \\pi}$.\n", - "Output Answer": [ - "$\\frac{68}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 6, -(14/math.pi), -4, -4, -4, (5/(math.sqrt(2))), -(23/5), 1, 9, -4, math.pi\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2 \\pi, -7, \\frac{11}{e}, -10, -4}$.\n", - "Output Answer": [ - "${-10, -7, -4, \\frac{11}{e}, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.pi, -7, (11/math.e), -10, -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.155,0.101,0.549,0.122\\}$ and $\\{0.159,0.367,0.127,0.243\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.155, 0.101, 0.549, 0.122\ndistribution2 = 0.159, 0.367, 0.127, 0.243\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${10, 0, -6} \\setminus {-8, -6, -9, \\frac{1}{2}, -4 \\sqrt{2}, -5.9, 0, 4, 10}$.\n", - "Output Answer": [ - "${}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 0, -6,))\nsnd = set((-8, -6, -9, (1/2), -4*math.sqrt(2), -5.9, 0, 4, 10,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${5, -\\frac{3}{4}, 5.55, -1, -3, -3.631, 1, -4, 4.12} \\cup {-4, 4.12, 5.55, 1.918, 10, -1, 5}$.\n", - "Output Answer": [ - "${-4, -3.631, -3, -1, -\\frac{3}{4}, 1, 1.918, 4.12, 5, 5.55, 10}$" - ], - "Output Program": [ - "fst = set((5, -(3/4), 5.55, -1, -3, -3.631, 1, -4, 4.12,))\nsnd = set((-4, 4.12, 5.55, 1.918, 10, -1, 5,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 5, -1, 14 \\log (2), 11 \\log (2), -\\frac{10}{e}, -3} \\cup {-3, -2, 14 \\log (2), -5, -9, 11 \\log (2), \\frac{25}{e}}$.\n", - "Output Answer": [ - "${-9, -5, -\\frac{10}{e}, -3, -2, -1, 5, 11 \\log (2), \\frac{25}{e}, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 5, -1, 14*math.log(2), 11*math.log(2), -(10/math.e), -3,))\nsnd = set((-3, -2, 14*math.log(2), -5, -9, 11*math.log(2), (25/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 7, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 7, 4*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, -14}$.\n", - "Output Answer": [ - "$\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -14\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 0, 8}$.\n", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 0, 8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, 1, -5}$.\n", - "Output Answer": [ - "$\\sqrt{57}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 1, -5\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 2, 9, 0, 0, 0, 9, 0, 2, 0, 2, 9, 10, 2, 10, 2, 10, 0, 2, 2, 10, 0, 2}$.\n", - "Output Answer": [ - "$\\{0,2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 2, 9, 0, 0, 0, 9, 0, 2, 0, 2, 9, 10, 2, 10, 2, 10, 0, 2, 2, 10, 0, 2\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{23}{3}, \\frac{8}{3}, -8, -\\frac{23}{3}, \\frac{5}{3}, \\frac{13}{3}, -7, \\frac{11}{3}, \\frac{25}{3}, -\\frac{1}{3}} \\cap {\\frac{11}{3}, 5, -\\frac{4}{3}, \\frac{23}{3}, \\frac{8}{3}, -\\frac{25}{3}, -\\frac{17}{3}, \\frac{13}{3}, -7, -\\frac{23}{3}, -2}$.\n", - "Output Answer": [ - "${-\\frac{23}{3}, -7, \\frac{8}{3}, \\frac{11}{3}, \\frac{13}{3}, \\frac{23}{3}}$" - ], - "Output Program": [ - "fst = set(((23/3), (8/3), -8, -(23/3), (5/3), (13/3), -7, (11/3), (25/3), -(1/3),))\nsnd = set(((11/3), 5, -(4/3), (23/3), (8/3), -(25/3), -(17/3), (13/3), -7, -(23/3), -2,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -4, 6, 2, 10, -4 \\sqrt{2}, -7, 7}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -4, 6, 2, 10, -4*math.sqrt(2), -7, 7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -8, -\\frac{17}{2}, -6, 4, 0, -1, \\frac{13}{5}, 5, \\frac{8}{3}}$.\n", - "Output Answer": [ - "$\\frac{27}{2}$" - ], - "Output Program": [ - "values = -7, -8, -(17/2), -6, 4, 0, -1, (13/5), 5, (8/3)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, -4, \\frac{23}{4}, -6, 8, 5} \\setminus {0, -4, 10, 6}$.\n", - "Output Answer": [ - "${-6, 5, \\frac{23}{4}, 8}$" - ], - "Output Program": [ - "fst = set((0, -4, (23/4), -6, 8, 5,))\nsnd = set((0, -4, 10, 6,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 6, 3, 18}$.\n", - "Output Answer": [ - "$\\frac{63}{11}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 6, 3, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-6, 0, 5, 1, -e, 6, -\\frac{23}{\\pi }}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, 0, 5, 1, -math.e, 6, -(23/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${8, -1, 2, 3, -2, 4 \\sqrt{5}, -6, 1.261} \\cup {-8, 7.291, 3, 4, 2, 0, -2, -6}$.\n", - "Output Answer": [ - "${-8, -6, -2, -1, 0, 1.261, 2, 3, 4, 7.291, 8, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -1, 2, 3, -2, 4*math.sqrt(5), -6, 1.261,))\nsnd = set((-8, 7.291, 3, 4, 2, 0, -2, -6,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${10, -\\frac{25}{\\pi }, 1, 4, -3.855, 6.977, 5, -2} \\cup {-\\frac{1}{2}, 10, -\\frac{25}{\\pi }, -5, 5, -1, -3.855, 1.396, 4}$.\n", - "Output Answer": [ - "${-\\frac{25}{\\pi }, -5, -3.855, -2, -1, -\\frac{1}{2}, 1, 1.396, 4, 5, 6.977, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, -(25/math.pi), 1, 4, -3.855, 6.977, 5, -2,))\nsnd = set((-(1/2), 10, -(25/math.pi), -5, 5, -1, -3.855, 1.396, 4,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x-2.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-2.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(4.3*x-2.9))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${117649, 262144, 625, 81, -243, 81}$.\n", - "Output Answer": [ - "$504 \\sqrt[6]{-3} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 117649, 262144, 625, 81, -243, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{26}{7}, \\frac{9}{7}, -\\frac{37}{7}, \\frac{57}{7}}$.\n", - "Output Answer": [ - "$\\frac{3}{28}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(26/7), (9/7), -(37/7), (57/7)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-5, 8, -10, 2 \\sqrt{5}, -\\frac{9}{\\sqrt{\\pi }}, -5}$.\n", - "Output Answer": [ - "${-10, -\\frac{9}{\\sqrt{\\pi }}, -5, -5, 2 \\sqrt{5}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 8, -10, 2*math.sqrt(5), -(9/(math.sqrt(math.pi))), -5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${7, 5, -\\frac{17}{\\sqrt{3}}, 3, 3 \\sqrt{2}, 8} \\setminus {1, 8, -\\frac{17}{\\sqrt{3}}, 7}$.\n", - "Output Answer": [ - "${3, 3 \\sqrt{2}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 5, -(17/(math.sqrt(3))), 3, 3*math.sqrt(2), 8,))\nsnd = set((1, 8, -(17/(math.sqrt(3))), 7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-2, -10, -12, -10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{59}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, -10, -12, -10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 13, 14, 5}$.\n", - "Output Answer": [ - "$\\frac{455}{51}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 13, 14, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.319,0.218,0.176\\}$ and $\\{0.206,0.18,0.036\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.319, 0.218, 0.176\ndistribution2 = 0.206, 0.18, 0.036\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{7}{2}, -\\frac{15}{4}, \\frac{15}{2}, -\\frac{27}{4}, -\\frac{5}{2}}$.\n", - "Output Answer": [ - "$-\\frac{2}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (7/2), -(15/4), (15/2), -(27/4), -(5/2)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{3}, -8, 2, 0, -\\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\frac{23}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(3), -8, 2, 0, -(19/2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{19}{2}, 9, -5, -4 \\sqrt{3}, \\frac{42}{5}}$.\n", - "Output Answer": [ - "$\\frac{19}{2}+4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = (19/2), 9, -5, -4*math.sqrt(3), (42/5)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2, -3 \\sqrt{3}, 3 \\sqrt{3}, \\frac{4}{3}, 3, 0}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, 0, \\frac{4}{3}, 2, 3, 3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -3*math.sqrt(3), 3*math.sqrt(3), (4/3), 3, 0\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${7, -4, -\\frac{13}{2}, -1, -7, 4 \\sqrt{5}, 8, 7.9}$.\n", - "Output Answer": [ - "${-7, -\\frac{13}{2}, -4, -1, 7, 7.9, 8, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -4, -(13/2), -1, -7, 4*math.sqrt(5), 8, 7.9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, 25, 1, 3}$.\n", - "Output Answer": [ - "$5^{3/4} \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 25, 1, 3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, -13, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{91}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -13, -2\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 7776, 2401, 256, 6}$.\n", - "Output Answer": [ - "$24\\ 2^{2/5} \\sqrt[5]{3} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 7776, 2401, 256, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{11}{2}, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$4 \\sqrt{2}-\\frac{11}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/2), -4*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{60}{7}, \\sqrt{5}, -2, -\\frac{26}{3}}$.\n", - "Output Answer": [ - "${-\\frac{26}{3}, -\\frac{60}{7}, -2, \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(60/7), math.sqrt(5), -2, -(26/3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 8, -8} \\cup {8, -5, -2}$.\n", - "Output Answer": [ - "${-8, -5, -2, 8}$" - ], - "Output Program": [ - "fst = set((-2, 8, -8,))\nsnd = set((8, -5, -2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.1 x+0.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7]\n", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(E(0.1*x+0.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, -10, -3, 6}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{185}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -10, -3, 6\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.113,0.299,0.011,0.275,0.002\\}$ and $\\{0.115,0.163,0.13,0.119,0.331\\}$.", - "Output Answer": [ - "$0.74$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.113, 0.299, 0.011, 0.275, 0.002\ndistribution2 = 0.115, 0.163, 0.13, 0.119, 0.331\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${4, -2.3, -1, 5}$.\n", - "Output Answer": [ - "${-2.3, -1, 4, 5}$" - ], - "Output Program": [ - "values = 4, -2.3, -1, 5\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0, 5, \\frac{2}{\\pi }, -\\frac{34}{5}, 2, 9, \\frac{9}{2}} \\cup {-9, 6, -\\frac{26}{\\pi }, -3, 9, -\\frac{34}{5}, 0, -\\frac{3}{2}}$.\n", - "Output Answer": [ - "${-9, -\\frac{26}{\\pi }, -\\frac{34}{5}, -3, -\\frac{3}{2}, 0, \\frac{2}{\\pi }, 2, \\frac{9}{2}, 5, 6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 5, (2/math.pi), -(34/5), 2, 9, (9/2),))\nsnd = set((-9, 6, -(26/math.pi), -3, 9, -(34/5), 0, -(3/2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${8, -\\sqrt{3}, 3, 4, -10, 0}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, -math.sqrt(3), 3, 4, -10, 0\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{20}{e}, 2 \\log (2), -1, 3 \\pi, -8, 0, -6 \\sqrt{2}, \\frac{1}{2}}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(20/math.e), 2*math.log(2), -1, 3*math.pi, -8, 0, -6*math.sqrt(2), (1/2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${2, -2, \\frac{1}{e}, 1, -3 e}$.", - "Output Answer": [ - "$\\frac{1}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -2, (1/math.e), 1, -3*math.e\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{5}{\\sqrt{3}}, -8, \\frac{23}{3}, 6, -5, -8, -3 \\pi, \\frac{18}{\\pi }, -\\frac{20}{3}, 0, \\frac{14}{\\sqrt{\\pi }}, 4 \\sqrt{5}, -3, -1}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\frac{5}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(5/(math.sqrt(3))), -8, (23/3), 6, -5, -8, -3*math.pi, (18/math.pi), -(20/3), 0, (14/(math.sqrt(math.pi))), 4*math.sqrt(5), -3, -1\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6 \\sqrt{2}, 11 \\log (2), -\\frac{6}{7}, -10, -1}$.\n", - "Output Answer": [ - "$10+11 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.sqrt(2), 11*math.log(2), -(6/7), -10, -1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.181,0.083,0.242,0.103\\}$ and $\\{0.009,0.104,0.231,0.408\\}$.", - "Output Answer": [ - "$0.86$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.181, 0.083, 0.242, 0.103\ndistribution2 = 0.009, 0.104, 0.231, 0.408\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 6, 3, 7, 8, \\frac{32}{7}, -5, -2, \\frac{13}{\\pi }}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 6, 3, 7, 8, (32/7), -5, -2, (13/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4 \\sqrt{2}, 6, 2 e, -12 \\log (2), 2, -1, 3, -\\frac{4}{\\pi }, -4, -6, -2, -7, -6, 3, 2}$.\n", - "Output Answer": [ - "$6+12 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(2), 6, 2*math.e, -12*math.log(2), 2, -1, 3, -(4/math.pi), -4, -6, -2, -7, -6, 3, 2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -3, -\\frac{62}{7}, -5 \\log (2), \\frac{11}{\\pi }, -3 \\sqrt{5}, 2, -\\frac{7}{\\sqrt{2}}, \\frac{1}{\\pi }, -10, 1, -3 \\sqrt{3}, 3, 6, -\\frac{1}{2}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -3, -(62/7), -5*math.log(2), (11/math.pi), -3*math.sqrt(5), 2, -(7/(math.sqrt(2))), (1/math.pi), -10, 1, -3*math.sqrt(3), 3, 6, -(1/2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.094,0.147,0.164,0.204,0.192\\}$ and $\\{0.075,0.255,0.37,0.228,0.024\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.094, 0.147, 0.164, 0.204, 0.192\ndistribution2 = 0.075, 0.255, 0.37, 0.228, 0.024\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.429,0.332,0.208\\}$ and $\\{0.303,0.09,0.236\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.429, 0.332, 0.208\ndistribution2 = 0.303, 0.09, 0.236\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{2}, 6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(6+3 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(2), 6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${8, \\frac{3}{5}, -4, -\\frac{3}{\\pi }, -2, 9} \\cup {-\\frac{48}{5}, -\\frac{3}{\\pi }, -2, 8, -\\frac{7}{\\sqrt{3}}, 9, \\frac{24}{7}}$.\n", - "Output Answer": [ - "${-\\frac{48}{5}, -\\frac{7}{\\sqrt{3}}, -4, -2, -\\frac{3}{\\pi }, \\frac{3}{5}, \\frac{24}{7}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, (3/5), -4, -(3/math.pi), -2, 9,))\nsnd = set((-(48/5), -(3/math.pi), -2, 8, -(7/(math.sqrt(3))), 9, (24/7),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${7, 0, 4 \\sqrt{5}, -\\frac{3}{e}, 10, 5, e, -7, -10} \\cup {2 e, 5, -4 \\sqrt{3}, -2 \\sqrt{5}, -7, -10, 3, \\frac{24}{e}, 0}$.\n", - "Output Answer": [ - "${-10, -7, -4 \\sqrt{3}, -2 \\sqrt{5}, -\\frac{3}{e}, 0, e, 3, 5, 2 e, 7, \\frac{24}{e}, 4 \\sqrt{5}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 0, 4*math.sqrt(5), -(3/math.e), 10, 5, math.e, -7, -10,))\nsnd = set((2*math.e, 5, -4*math.sqrt(3), -2*math.sqrt(5), -7, -10, 3, (24/math.e), 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -6, -1., -3 \\sqrt{2}, 3.6} \\setminus {-5, 9 \\log (2), -1., -6, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, 3.6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -6, -1., -3*math.sqrt(2), 3.6,))\nsnd = set((-5, 9*math.log(2), -1., -6, -3*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${1, -7, 8, 4, -1, -3} \\setminus {0, -\\frac{24}{e}, -5, 3, -\\frac{3}{e}}$.\n", - "Output Answer": [ - "${-7, -3, -1, 1, 4, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -7, 8, 4, -1, -3,))\nsnd = set((0, -(24/math.e), -5, 3, -(3/math.e),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 11, 16, 7}$.\n", - "Output Answer": [ - "$\\frac{4928}{1597}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 11, 16, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 e, -e, -3 e, 3 e, -2 e, -4 e, 2 e, -e}$.\n", - "Output Answer": [ - "$-\\frac{e}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.e, -math.e, -3*math.e, 3*math.e, -2*math.e, -4*math.e, 2*math.e, -math.e\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, 1, -243, 25, 25, 256}$.\n", - "Output Answer": [ - "$2\\ 3^{5/6} 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 1, -243, 25, 25, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, 7, -5, 5, 10, 2}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, 7, -5, 5, 10, 2\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\pi, -\\pi, 0, 2 \\pi, 2 \\pi, 0, 0, 0, -2 \\pi, -\\pi, -\\pi, -\\pi, 0, -\\pi, 2 \\pi, -\\pi, 2 \\pi, 0, 2 \\pi, -\\pi, -\\pi}$.\n", - "Output Answer": [ - "$\\{-\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.pi, -math.pi, 0, 2*math.pi, 2*math.pi, 0, 0, 0, -2*math.pi, -math.pi, -math.pi, -math.pi, 0, -math.pi, 2*math.pi, -math.pi, 2*math.pi, 0, 2*math.pi, -math.pi, -math.pi\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.069,0.396,0.457\\}$ and $\\{0.349,0.366,0.266\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.069, 0.396, 0.457\ndistribution2 = 0.349, 0.366, 0.266\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -\\frac{19}{2}, 8, -\\frac{35}{4}, -2, 3, -2, -9, -1, -1, 2}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -(19/2), 8, -(35/4), -2, 3, -2, -9, -1, -1, 2\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x+4.7$ where $x \\sim $ \\text{NormalDistribution}[1.2,0.5]\n", - "Output Answer": [ - "$8.78$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.2, 0.5)\nprint(E(3.4*x+4.7))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{13}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -4 \\sqrt{3}, -4 \\sqrt{3}, -4 \\sqrt{3}, -4 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, -4 \\sqrt{3}, -\\frac{1}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, -4 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -4 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, -4 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (13/(math.sqrt(3))), -(10/(math.sqrt(3))), -4*math.sqrt(3), -4*math.sqrt(3), -4*math.sqrt(3), -4*math.sqrt(3), -(10/(math.sqrt(3))), -4*math.sqrt(3), -(1/(math.sqrt(3))), -(10/(math.sqrt(3))), (13/(math.sqrt(3))), -(10/(math.sqrt(3))), -(1/(math.sqrt(3))), (13/(math.sqrt(3))), -4*math.sqrt(3), -(10/(math.sqrt(3))), -(1/(math.sqrt(3))), -(10/(math.sqrt(3))), -(1/(math.sqrt(3))), -4*math.sqrt(3), (13/(math.sqrt(3))), -(1/(math.sqrt(3))), -(1/(math.sqrt(3))), (13/(math.sqrt(3))), -4*math.sqrt(3), (13/(math.sqrt(3))), -(10/(math.sqrt(3))), -4*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, 0, 4 \\sqrt{5}, 2 \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 0, -\\sqrt{5}, 4 \\sqrt{5}, 0, 4 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, 0, 0, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 0, 0, 4*math.sqrt(5), 2*math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 0, -math.sqrt(5), 4*math.sqrt(5), 0, 4*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), 0, 0, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -4 \\sqrt{2}, 2, 1, 7} \\setminus {7, -2, 1}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -1, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -4*math.sqrt(2), 2, 1, 7,))\nsnd = set((7, -2, 1,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${10, 8, 10}$.\n", - "Output Answer": [ - "$\\frac{4}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 8, 10\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.072,0.232,0.295,0.143,0.178\\}$ and $\\{0.303,0.028,0.152,0.232,0.184\\}$.", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.072, 0.232, 0.295, 0.143, 0.178\ndistribution2 = 0.303, 0.028, 0.152, 0.232, 0.184\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${2, -8, 9, -\\frac{26}{3}, \\frac{13}{\\pi }} \\setminus {-\\frac{26}{3}, -7, 2, -5, -8, 0, -10}$.\n", - "Output Answer": [ - "${\\frac{13}{\\pi }, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -8, 9, -(26/3), (13/math.pi),))\nsnd = set((-(26/3), -7, 2, -5, -8, 0, -10,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 4, -1, \\frac{47}{7}, 0} \\cup {0, -3, -6, \\frac{47}{7}, -1, -\\frac{10}{3}}$.\n", - "Output Answer": [ - "${-6, -\\frac{10}{3}, -3, -1, 0, 4, \\frac{47}{7}}$" - ], - "Output Program": [ - "fst = set((-3, 4, -1, (47/7), 0,))\nsnd = set((0, -3, -6, (47/7), -1, -(10/3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.6 x^2-2.2 x+4.6$ where $x \\sim $ \\text{BetaDistribution}[0.5,0.4]\n", - "Output Answer": [ - "$1.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.5, 0.4)\nprint(E(-3.6*x**2-2.2*x+4.6))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-4, -\\sqrt{2}, 2, -3, -\\frac{7}{e}} \\cup {-5, 2, -3, -\\frac{7}{e}, -\\sqrt{2}}$.\n", - "Output Answer": [ - "${-5, -4, -3, -\\frac{7}{e}, -\\sqrt{2}, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -math.sqrt(2), 2, -3, -(7/math.e),))\nsnd = set((-5, 2, -3, -(7/math.e), -math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{14}{\\sqrt{\\pi }}, -5, e, -\\frac{18}{\\pi }, -9, -2 e, \\frac{1}{\\sqrt{\\pi }}, -2, 4, -1, -7, -7, -3, -1}$.\n", - "Output Answer": [ - "$9+\\frac{14}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (14/(math.sqrt(math.pi))), -5, math.e, -(18/math.pi), -9, -2*math.e, (1/(math.sqrt(math.pi))), -2, 4, -1, -7, -7, -3, -1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.052,0.158,0.193,0.311,0.08,0.088\\}$ and $\\{0.087,0.058,0.084,0.105,0.095,0.238\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.052, 0.158, 0.193, 0.311, 0.08, 0.088\ndistribution2 = 0.087, 0.058, 0.084, 0.105, 0.095, 0.238\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{3}{\\pi }, 8, -\\frac{5}{\\sqrt{\\pi }}, 4, 5, 8, 6, \\frac{60}{7}, -e, 0, -2, 0, -\\frac{10}{7}, -6, 2}$.\n", - "Output Answer": [ - "$\\frac{102}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/math.pi), 8, -(5/(math.sqrt(math.pi))), 4, 5, 8, 6, (60/7), -math.e, 0, -2, 0, -(10/7), -6, 2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-2 \\sqrt{3}, 6, 5 \\sqrt{3}, -2, -\\frac{12}{\\sqrt{\\pi }}, -\\sqrt{2}, 10 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{12}{\\sqrt{\\pi }}, -2 \\sqrt{3}, -2, -\\sqrt{2}, 6, 10 \\log (2), 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(3), 6, 5*math.sqrt(3), -2, -(12/(math.sqrt(math.pi))), -math.sqrt(2), 10*math.log(2)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${3, 4 \\sqrt{3}, 0, 1} \\setminus {3, -9, 8}$.\n", - "Output Answer": [ - "${0, 1, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 4*math.sqrt(3), 0, 1,))\nsnd = set((3, -9, 8,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $0.17 < 4.6 x-1.4 < 0.71$ where $x \\sim $ \\text{BetaDistribution}[1.5,1.2].", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 1.2)\nprint(P((0.17 < 4.6*x-1.4) & (4.6*x-1.4 < 0.71)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 2 \\sqrt{5}, 0, -6, -2, 4 \\sqrt{5}, 9, 6 \\sqrt{2}, 6, \\frac{5}{4}, 0, -\\sqrt{3}, \\frac{16}{\\sqrt{3}}, -\\frac{5}{3}, -1}$.\n", - "Output Answer": [ - "$6+\\frac{16}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 2*math.sqrt(5), 0, -6, -2, 4*math.sqrt(5), 9, 6*math.sqrt(2), 6, (5/4), 0, -math.sqrt(3), (16/(math.sqrt(3))), -(5/3), -1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${6.994, 4.378, 5.152, -2.896, 1.383, 4.797, -8.899, 3.528, -7.817} \\cap {3.528, -9.26, -2.956, 6.543, -1.566, -2.27, 1.383, 6.228, 5.503}$.\n", - "Output Answer": [ - "${1.383, 3.528}$" - ], - "Output Program": [ - "fst = set((6.994, 4.378, 5.152, -2.896, 1.383, 4.797, -8.899, 3.528, -7.817,))\nsnd = set((3.528, -9.26, -2.956, 6.543, -1.566, -2.27, 1.383, 6.228, 5.503,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-8, 3.86, \\frac{19}{e}, 2, 2.13, 4}$.\n", - "Output Answer": [ - "${-8, 2, 2.13, 3.86, 4, \\frac{19}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 3.86, (19/math.e), 2, 2.13, 4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-3, 4 \\sqrt{3}, \\frac{23}{3}, 4.548}$.\n", - "Output Answer": [ - "${-3, 4.548, 4 \\sqrt{3}, \\frac{23}{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 4*math.sqrt(3), (23/3), 4.548\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${7, 10, 6, e, -10 \\log (2)} \\cup {7, e, 10, 6, -10}$.\n", - "Output Answer": [ - "${-10, -10 \\log (2), e, 6, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 10, 6, math.e, -10*math.log(2),))\nsnd = set((7, math.e, 10, 6, -10,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 6, -2, 9}$.\n", - "Output Answer": [ - "$(7+7 i) 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 6, -2, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-6.7, -\\frac{3}{\\sqrt{2}}, -11 \\log (2), -2, \\frac{11}{\\sqrt{2}}, -2, 8}$.\n", - "Output Answer": [ - "${-11 \\log (2), -6.7, -\\frac{3}{\\sqrt{2}}, -2, -2, \\frac{11}{\\sqrt{2}}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -6.7, -(3/(math.sqrt(2))), -11*math.log(2), -2, (11/(math.sqrt(2))), -2, 8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-5, -3, -7, -8, -4, 7} \\setminus {2, -4, 5}$.\n", - "Output Answer": [ - "${-8, -7, -5, -3, 7}$" - ], - "Output Program": [ - "fst = set((-5, -3, -7, -8, -4, 7,))\nsnd = set((2, -4, 5,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{23}{4}, 6.27, -\\frac{2}{\\sqrt{\\pi }}, -8, \\frac{3}{\\pi }, 4 \\sqrt{5}} \\setminus {-8, -2 \\sqrt{5}, \\frac{11}{e}, -\\frac{23}{4}, -\\frac{3}{\\sqrt{\\pi }}, 6.27, \\frac{3}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{2}{\\sqrt{\\pi }}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(23/4), 6.27, -(2/(math.sqrt(math.pi))), -8, (3/math.pi), 4*math.sqrt(5),))\nsnd = set((-8, -2*math.sqrt(5), (11/math.e), -(23/4), -(3/(math.sqrt(math.pi))), 6.27, (3/math.pi),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${3.16, 9, -9, -4, 2, \\frac{5}{\\sqrt{3}}, -8} \\cup {-8.26, \\frac{5}{\\sqrt{3}}, -4, -9, -10, 0, 5, -8, 2}$.\n", - "Output Answer": [ - "${-10, -9, -8.26, -8, -4, 0, 2, \\frac{5}{\\sqrt{3}}, 3.16, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3.16, 9, -9, -4, 2, (5/(math.sqrt(3))), -8,))\nsnd = set((-8.26, (5/(math.sqrt(3))), -4, -9, -10, 0, 5, -8, 2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 49, 1000}$.\n", - "Output Answer": [ - "$20 \\sqrt[3]{2} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 49, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3 e, -4, -6 \\log (2), -3, \\frac{3}{e}, -3 \\sqrt{2}, -\\pi} \\cup {2 \\log (2), 0, -3 \\sqrt{2}, \\frac{3}{e}, -6, -3 e, 7}$.\n", - "Output Answer": [ - "${-3 e, -6, -3 \\sqrt{2}, -6 \\log (2), -4, -\\pi, -3, 0, \\frac{3}{e}, 2 \\log (2), 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.e, -4, -6*math.log(2), -3, (3/math.e), -3*math.sqrt(2), -math.pi,))\nsnd = set((2*math.log(2), 0, -3*math.sqrt(2), (3/math.e), -6, -3*math.e, 7,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${6, 1, 2, -\\frac{12}{e}, -6, -2, 0, 4} \\cup {-2, 6, 0, -6, -\\frac{26}{e}, -\\frac{28}{5}, 2}$.\n", - "Output Answer": [ - "${-\\frac{26}{e}, -6, -\\frac{28}{5}, -\\frac{12}{e}, -2, 0, 1, 2, 4, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 1, 2, -(12/math.e), -6, -2, 0, 4,))\nsnd = set((-2, 6, 0, -6, -(26/math.e), -(28/5), 2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, 3, -9, 5, -9, 13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1474}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, 3, -9, 5, -9, 13\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4 \\sqrt{5}, 4, \\frac{11}{\\sqrt{\\pi }}, \\frac{25}{\\pi }, -8, 9, \\frac{13}{e}, 8}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -8, 4, \\frac{13}{e}, \\frac{11}{\\sqrt{\\pi }}, \\frac{25}{\\pi }, 8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(5), 4, (11/(math.sqrt(math.pi))), (25/math.pi), -8, 9, (13/math.e), 8\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${625, -1024, -64, 25, -243}$.\n", - "Output Answer": [ - "$120 \\sqrt[5]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = 625, -1024, -64, 25, -243\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -9, -2, 14, -2, 3}$.\n", - "Output Answer": [ - "$\\frac{292}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -9, -2, 14, -2, 3\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 11, \\frac{31}{2}}$.\n", - "Output Answer": [ - "$\\frac{10230}{871}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 11, (31/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -\\frac{9}{4}, -4, 9, 4, 4, \\frac{19}{3}, -4 \\sqrt{2}, -7, 3 \\sqrt{5}, 0}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -(9/4), -4, 9, 4, 4, (19/3), -4*math.sqrt(2), -7, 3*math.sqrt(5), 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -8, -\\frac{17}{\\sqrt{3}}, -10 \\log (2), 6 \\sqrt{3}, \\frac{12}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{17}{\\sqrt{3}}+6 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -8, -(17/(math.sqrt(3))), -10*math.log(2), 6*math.sqrt(3), (12/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{3}, -3, 7 \\log (2), -8.931} \\setminus {-6.138, 9, -3, 3.1, -5, 4 \\sqrt{3}, 7 \\log (2)}$.\n", - "Output Answer": [ - "${-8.931, 3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), -3, 7*math.log(2), -8.931,))\nsnd = set((-6.138, 9, -3, 3.1, -5, 4*math.sqrt(3), 7*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.3 x^2+0.6 x+2.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$4.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(0.3*x**2+0.6*x+2.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, 6 \\sqrt{3}, 6 \\sqrt{2}, 6, 3, 2, -7, -8, -\\frac{21}{\\sqrt{5}}, 8}$.\n", - "Output Answer": [ - "$6 \\sqrt{3}+\\frac{21}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 6*math.sqrt(3), 6*math.sqrt(2), 6, 3, 2, -7, -8, -(21/(math.sqrt(5))), 8\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -4, -5, 7, 9}$.\n", - "Output Answer": [ - "$\\frac{9}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -4, -5, 7, 9\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.139,0.317,0.469\\}$ and $\\{0.22,0.381,0.19\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.139, 0.317, 0.469\ndistribution2 = 0.22, 0.381, 0.19\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x-4.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$-4.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(3.9*x-4.4))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-4, \\frac{11}{\\sqrt{3}}, \\frac{12}{\\sqrt{\\pi }}, 9, -3} \\setminus {-\\frac{10}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, -9, -4, -3}$.\n", - "Output Answer": [ - "${\\frac{11}{\\sqrt{3}}, \\frac{12}{\\sqrt{\\pi }}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, (11/(math.sqrt(3))), (12/(math.sqrt(math.pi))), 9, -3,))\nsnd = set((-(10/(math.sqrt(3))), -(7/(math.sqrt(3))), -9, -4, -3,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${0.882, -\\frac{22}{3}, 10, -\\frac{26}{e}, -4 \\sqrt{3}} \\cup {-6, 0.882, -4 \\sqrt{3}, -\\frac{26}{e}, -\\frac{13}{3}}$.\n", - "Output Answer": [ - "${-\\frac{26}{e}, -\\frac{22}{3}, -4 \\sqrt{3}, -6, -\\frac{13}{3}, 0.882, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((0.882, -(22/3), 10, -(26/math.e), -4*math.sqrt(3),))\nsnd = set((-6, 0.882, -4*math.sqrt(3), -(26/math.e), -(13/3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 10, 4}$.\n", - "Output Answer": [ - "$\\frac{20}{9}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 10, 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -8, -1, 6, 6, -1, -8, -1, 6, -1, -8, -1, 0, 0, -1, -8, 6, 0, -1, 0, -8, -1, 6, 0}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -8, -1, 6, 6, -1, -8, -1, 6, -1, -8, -1, 0, 0, -1, -8, 6, 0, -1, 0, -8, -1, 6, 0\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, -6, 1}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, -6, 1\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, \\frac{37}{3}, 10}$.\n", - "Output Answer": [ - "$\\frac{7770}{839}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, (37/3), 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{30}{\\pi }, -6 \\sqrt{2}, -5, \\frac{10}{\\pi }, -4 \\sqrt{3}, -6} \\cup {\\frac{11}{2}, -5, -\\frac{27}{\\pi }, 3, -\\frac{23}{\\pi }, -4 \\sqrt{3}, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{30}{\\pi }, -\\frac{27}{\\pi }, -6 \\sqrt{2}, -\\frac{23}{\\pi }, -4 \\sqrt{3}, -6, -5, 3, \\frac{10}{\\pi }, \\frac{11}{2}, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(30/math.pi), -6*math.sqrt(2), -5, (10/math.pi), -4*math.sqrt(3), -6,))\nsnd = set(((11/2), -5, -(27/math.pi), 3, -(23/math.pi), -4*math.sqrt(3), 4*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.087,0.128,0.07,0.027,0.064,0.226,0.073,0.072,0.048,0.074\\}$ and $\\{0.256,0.154,0.118,0.054,0.069,0.097,0.016,0.02,0.101,0.075\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.087, 0.128, 0.07, 0.027, 0.064, 0.226, 0.073, 0.072, 0.048, 0.074\ndistribution2 = 0.256, 0.154, 0.118, 0.054, 0.069, 0.097, 0.016, 0.02, 0.101, 0.075\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{2}, -4 \\sqrt{5}, 8, 0, -\\frac{23}{e}, 0, -1, \\frac{3}{2}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(2), -4*math.sqrt(5), 8, 0, -(23/math.e), 0, -1, (3/2)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${9, -9, 2.47, 5} \\cup {2.47, 5, 9, 1}$.\n", - "Output Answer": [ - "${-9, 1, 2.47, 5, 9}$" - ], - "Output Program": [ - "fst = set((9, -9, 2.47, 5,))\nsnd = set((2.47, 5, 9, 1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -4, -4, -3, -4, 1, -3, -4, -4, -3, -3, 1, -4, 7, -3, 7, -4, -4, -4, 7}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -4, -4, -3, -4, 1, -3, -4, -4, -3, -3, 1, -4, 7, -3, 7, -4, -4, -4, 7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{61}{7}, 9, \\frac{17}{\\pi }, 8, -3, -2, 4} \\cup {4, 6, 10, -\\frac{16}{7}, -8, \\frac{17}{\\pi }, 8, 2, -6}$.\n", - "Output Answer": [ - "${-\\frac{61}{7}, -8, -6, -3, -\\frac{16}{7}, -2, 2, 4, \\frac{17}{\\pi }, 6, 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(61/7), 9, (17/math.pi), 8, -3, -2, 4,))\nsnd = set((4, 6, 10, -(16/7), -8, (17/math.pi), 8, 2, -6,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{2}, -\\frac{9}{\\sqrt{2}}, 3 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, 4 \\sqrt{2}, -2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, 3 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}, 3 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, 4 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, 3 \\sqrt{2}, 4 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{7}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(2), -(9/(math.sqrt(2))), 3*math.sqrt(2), (7/(math.sqrt(2))), 4*math.sqrt(2), -2*math.sqrt(2), (1/(math.sqrt(2))), 3*math.sqrt(2), -(5/(math.sqrt(2))), -(5/(math.sqrt(2))), 3*math.sqrt(2), -(5/(math.sqrt(2))), (1/(math.sqrt(2))), (1/(math.sqrt(2))), 4*math.sqrt(2), -(5/(math.sqrt(2))), (7/(math.sqrt(2))), 3*math.sqrt(2), 4*math.sqrt(2), (7/(math.sqrt(2))), (7/(math.sqrt(2))), (7/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -2, -7, e, 4, 9, 6, 0}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -2, -7, math.e, 4, 9, 6, 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-7, \\frac{33}{5}, -2, 2, -14 \\log (2)} \\setminus {-7, \\frac{33}{5}, -4, -14 \\log (2)}$.\n", - "Output Answer": [ - "${-2, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, (33/5), -2, 2, -14*math.log(2),))\nsnd = set((-7, (33/5), -4, -14*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${3, \\sqrt{5}, -1, 2, -3, 6.504} \\setminus {-4.866, 9, 2}$.\n", - "Output Answer": [ - "${-3, -1, \\sqrt{5}, 3, 6.504}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, math.sqrt(5), -1, 2, -3, 6.504,))\nsnd = set((-4.866, 9, 2,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2, 9, 0, -8.8} \\cup {-8.8, 2, 9, 0}$.\n", - "Output Answer": [ - "${-8.8, 0, 2, 9}$" - ], - "Output Program": [ - "fst = set((2, 9, 0, -8.8,))\nsnd = set((-8.8, 2, 9, 0,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, 8, 4 \\sqrt{3}, 8, 0, 1, -\\frac{8}{5}, \\frac{30}{7}, 3 e}$.", - "Output Answer": [ - "$\\frac{30}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 8, 4*math.sqrt(3), 8, 0, 1, -(8/5), (30/7), 3*math.e\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -2, 4, 4, 2, -2, -6, 1, -6, -6, -8, -4, -8, -8, 1, 2, -8, -6, -2, 2, -2, -4, 1, -4, 4, -6, 2, 4}$.\n", - "Output Answer": [ - "$\\{4,-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -2, 4, 4, 2, -2, -6, 1, -6, -6, -8, -4, -8, -8, 1, 2, -8, -6, -2, 2, -2, -4, 1, -4, 4, -6, 2, 4\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, \\frac{5}{4}}$.\n", - "Output Answer": [ - "$-\\frac{31}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, (5/4)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2 e, -5, -\\frac{14}{3}, 2, -10, 7} \\cup {-5, -3, 2, -e, -\\frac{14}{3}, -1}$.\n", - "Output Answer": [ - "${-10, -5, -\\frac{14}{3}, -3, -e, -1, 2, 2 e, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.e, -5, -(14/3), 2, -10, 7,))\nsnd = set((-5, -3, 2, -math.e, -(14/3), -1,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.046,0.047,0.288,0.264,0.147,0.117\\}$ and $\\{0.1,0.153,0.14,0.162,0.077,0.151\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.046, 0.047, 0.288, 0.264, 0.147, 0.117\ndistribution2 = 0.1, 0.153, 0.14, 0.162, 0.077, 0.151\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x-5.1$ where $x \\sim $ \\text{PoissonDistribution}[3.8]\n", - "Output Answer": [ - "$9.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.8)\nprint(E(3.9*x-5.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-6, \\frac{1}{\\sqrt{5}}, -7, -9}$.\n", - "Output Answer": [ - "${-9, -7, -6, \\frac{1}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, (1/(math.sqrt(5))), -7, -9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.048,0.29,0.114,0.085,0.221\\}$ and $\\{0.118,0.063,0.155,0.062,0.441\\}$.", - "Output Answer": [ - "$0.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.048, 0.29, 0.114, 0.085, 0.221\ndistribution2 = 0.118, 0.063, 0.155, 0.062, 0.441\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 1, 5}$.\n", - "Output Answer": [ - "$\\frac{120}{53}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 1, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{17}{7}, 8, -8.169, 0.28, 6, -2} \\setminus {6, -2, -4, \\frac{1}{\\sqrt{5}}, 8, 2 \\sqrt{3}, \\frac{25}{7}}$.\n", - "Output Answer": [ - "${-8.169, -\\frac{17}{7}, 0.28}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(17/7), 8, -8.169, 0.28, 6, -2,))\nsnd = set((6, -2, -4, (1/(math.sqrt(5))), 8, 2*math.sqrt(3), (25/7),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${8, -2, -2 \\sqrt{5}, -6, -3, -7, 7, 1}$.\n", - "Output Answer": [ - "${-7, -6, -2 \\sqrt{5}, -3, -2, 1, 7, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -2, -2*math.sqrt(5), -6, -3, -7, 7, 1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -5, 0, 10, -5, -\\sqrt{5}, 0, -\\frac{1}{3}, \\frac{12}{\\pi }, 4 \\sqrt{5}}$.", - "Output Answer": [ - "$-\\frac{1}{6}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -5, 0, 10, -5, -math.sqrt(5), 0, -(1/3), (12/math.pi), 4*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, -12, -11, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{122}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -12, -11, 0\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, \\frac{55}{3}, \\frac{11}{3}, \\frac{2}{3}}$.\n", - "Output Answer": [ - "$\\frac{440}{311}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, (55/3), (11/3), (2/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x+8.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$8.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(0.2*x+8.5))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-5, 3, 6, -3, -1, 4, 1, 9} \\cap {10, -7, -6, 6, 7, -9, -8, -5, 4}$.\n", - "Output Answer": [ - "${-5, 4, 6}$" - ], - "Output Program": [ - "fst = set((-5, 3, 6, -3, -1, 4, 1, 9,))\nsnd = set((10, -7, -6, 6, 7, -9, -8, -5, 4,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 4, 1, 4}$.\n", - "Output Answer": [ - "$\\frac{88}{35}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 4, 1, 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -14, 13, 4}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{505}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -14, 13, 4\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 0, -2, -\\frac{1}{\\sqrt{3}}, \\frac{1}{\\sqrt{2}}, -5, -3, -7} \\setminus {-\\frac{9}{\\sqrt{2}}, -\\frac{1}{\\sqrt{3}}, 0, 5, -5, -7}$.\n", - "Output Answer": [ - "${-8, -3, -2, \\frac{1}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 0, -2, -(1/(math.sqrt(3))), (1/(math.sqrt(2))), -5, -3, -7,))\nsnd = set((-(9/(math.sqrt(2))), -(1/(math.sqrt(3))), 0, 5, -5, -7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.5 x^2-1.5 x-4.2$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$-6.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(-1.5*x**2-1.5*x-4.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.141,0.103,0.061,0.182,0.143,0.19,0.04,0.116\\}$ and $\\{0.147,0.104,0.033,0.056,0.099,0.153,0.134,0.089\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.141, 0.103, 0.061, 0.182, 0.143, 0.19, 0.04, 0.116\ndistribution2 = 0.147, 0.104, 0.033, 0.056, 0.099, 0.153, 0.134, 0.089\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x+0.4$ where $x \\sim $ \\text{PoissonDistribution}[2.7]\n", - "Output Answer": [ - "$12.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.7)\nprint(E(4.3*x+0.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, -1, 2}$.\n", - "Output Answer": [ - "$\\frac{7}{\\sqrt{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -1, 2\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, -343, 64, 1, -9, 625}$.\n", - "Output Answer": [ - "$10\\ 2^{2/3} \\sqrt{7} \\sqrt[3]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, -343, 64, 1, -9, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.2 x^2-3.5 x+2.5$ where $x \\sim $ \\text{NormalDistribution}[-1.8,0.7]\n", - "Output Answer": [ - "$8.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 0.7)\nprint(E(-0.2*x**2-3.5*x+2.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${15, -12, -7, -1, 2}$.\n", - "Output Answer": [ - "$\\frac{1053}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -12, -7, -1, 2\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-0.71 < -2.2 x^2-1.6 x+1.9 < 1.72$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3].", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(P((-0.71 < -2.2*x**2-1.6*x+1.9) & (-2.2*x**2-1.6*x+1.9 < 1.72)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, -4, 7, -5, -9, 7}$.\n", - "Output Answer": [ - "$\\frac{1}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, -4, 7, -5, -9, 7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{9}{2}, -\\frac{5}{2}, -\\frac{5}{2}, -\\frac{5}{2}, -\\frac{11}{2}, \\frac{9}{2}, -\\frac{5}{2}, \\frac{9}{2}, -\\frac{11}{2}, -\\frac{5}{2}, \\frac{9}{2}, \\frac{9}{2}, -\\frac{5}{2}, -\\frac{11}{2}, \\frac{9}{2}, \\frac{9}{2}, \\frac{9}{2}, -\\frac{5}{2}, \\frac{9}{2}, \\frac{9}{2}, -\\frac{11}{2}, \\frac{9}{2}, \\frac{9}{2}, -\\frac{5}{2}, \\frac{9}{2}, \\frac{9}{2}, \\frac{9}{2}, \\frac{9}{2}, -\\frac{11}{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{9}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (9/2), -(5/2), -(5/2), -(5/2), -(11/2), (9/2), -(5/2), (9/2), -(11/2), -(5/2), (9/2), (9/2), -(5/2), -(11/2), (9/2), (9/2), (9/2), -(5/2), (9/2), (9/2), -(11/2), (9/2), (9/2), -(5/2), (9/2), (9/2), (9/2), (9/2), -(11/2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{3}, \\frac{14}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{14}{\\sqrt{3}}+4 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(3), (14/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{19}{\\pi }, \\frac{17}{\\pi }, \\frac{14}{\\pi }, \\frac{8}{\\pi }, \\frac{12}{\\pi }, -\\frac{4}{\\pi }, -\\frac{28}{\\pi }} \\cap {-\\frac{4}{\\pi }, -\\frac{28}{\\pi }, \\frac{19}{\\pi }, -\\frac{2}{\\pi }, -\\frac{19}{\\pi }, \\frac{23}{\\pi }, -\\frac{21}{\\pi }, \\frac{14}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{28}{\\pi }, -\\frac{19}{\\pi }, -\\frac{4}{\\pi }, \\frac{14}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(19/math.pi), (17/math.pi), (14/math.pi), (8/math.pi), (12/math.pi), -(4/math.pi), -(28/math.pi),))\nsnd = set((-(4/math.pi), -(28/math.pi), (19/math.pi), -(2/math.pi), -(19/math.pi), (23/math.pi), -(21/math.pi), (14/math.pi),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 4 \\sqrt{5}, 7, 3} \\cup {-3, -7, 3, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-7, -3, 3, 7, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 4*math.sqrt(5), 7, 3,))\nsnd = set((-3, -7, 3, 4*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -\\frac{11}{7}, -5.428, 9, -3.13} \\setminus {9, \\frac{39}{7}, \\frac{5}{3}, -3.13, 10, 0.583}$.\n", - "Output Answer": [ - "${-5.428, -\\frac{11}{7}, -1}$" - ], - "Output Program": [ - "fst = set((-1, -(11/7), -5.428, 9, -3.13,))\nsnd = set((9, (39/7), (5/3), -3.13, 10, 0.583,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{17}{4}, -\\frac{31}{4}, -\\frac{23}{4}, -\\frac{11}{4}, \\frac{7}{4}, -\\frac{25}{4}} \\cap {\\frac{7}{4}, -\\frac{15}{2}, -\\frac{23}{4}, \\frac{3}{4}, \\frac{17}{4}, -\\frac{9}{4}}$.\n", - "Output Answer": [ - "${-\\frac{23}{4}, \\frac{7}{4}, \\frac{17}{4}}$" - ], - "Output Program": [ - "fst = set(((17/4), -(31/4), -(23/4), -(11/4), (7/4), -(25/4),))\nsnd = set(((7/4), -(15/2), -(23/4), (3/4), (17/4), -(9/4),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x+1.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$1.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(2.3*x+1.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{18}{e}, -\\frac{6}{e}, \\frac{12}{e}, \\frac{12}{e}, \\frac{18}{e}, -\\frac{6}{e}, \\frac{12}{e}, \\frac{12}{e}, \\frac{12}{e}, \\frac{9}{e}, \\frac{12}{e}, \\frac{9}{e}, \\frac{12}{e}, \\frac{12}{e}, \\frac{12}{e}, \\frac{12}{e}, \\frac{18}{e}, \\frac{18}{e}, \\frac{18}{e}, \\frac{18}{e}, \\frac{12}{e}, \\frac{9}{e}, \\frac{18}{e}, \\frac{12}{e}, \\frac{9}{e}, -\\frac{6}{e}, \\frac{12}{e}, \\frac{12}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{12}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (18/math.e), -(6/math.e), (12/math.e), (12/math.e), (18/math.e), -(6/math.e), (12/math.e), (12/math.e), (12/math.e), (9/math.e), (12/math.e), (9/math.e), (12/math.e), (12/math.e), (12/math.e), (12/math.e), (18/math.e), (18/math.e), (18/math.e), (18/math.e), (12/math.e), (9/math.e), (18/math.e), (12/math.e), (9/math.e), -(6/math.e), (12/math.e), (12/math.e)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, 3, -3, \\frac{31}{5}, 8 \\log (2), \\frac{13}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{3}}, -8, -\\frac{29}{3}, -\\pi, 2 e, 5 \\sqrt{2}, 9, 10}$.\n", - "Output Answer": [ - "$\\frac{59}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 3, -3, (31/5), 8*math.log(2), (13/(math.sqrt(math.pi))), -(5/(math.sqrt(3))), -8, -(29/3), -math.pi, 2*math.e, 5*math.sqrt(2), 9, 10\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -2, -8, 1, 1, -1, -8, 9, -8, 3, 9, 3, -4, 3, 9, 1, -4, 1, -1, 1, -1, 1, 1, 9, -4, -8, -8, -1, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -2, -8, 1, 1, -1, -8, 9, -8, 3, 9, 3, -4, 3, 9, 1, -4, 1, -1, 1, -1, 1, 1, 9, -4, -8, -8, -1, 1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, -11, 2}$.\n", - "Output Answer": [ - "$133$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -11, 2\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{3}, 4, 0, \\frac{39}{4}} \\setminus {7, 4, -2, 4 \\sqrt{3}, \\frac{39}{4}}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(3), 4, 0, (39/4),))\nsnd = set((7, 4, -2, 4*math.sqrt(3), (39/4),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${6, -\\frac{8}{\\sqrt{3}}, -2, -5, 5, -\\frac{58}{7}} \\setminus {-4, -\\frac{58}{7}, \\frac{59}{7}, 5, \\frac{1}{\\sqrt{3}}, -6, 2.68, 0, 6}$.\n", - "Output Answer": [ - "${-5, -\\frac{8}{\\sqrt{3}}, -2}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -(8/(math.sqrt(3))), -2, -5, 5, -(58/7),))\nsnd = set((-4, -(58/7), (59/7), 5, (1/(math.sqrt(3))), -6, 2.68, 0, 6,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -7}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "values = 6, -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.027,0.043,0.139,0.071,0.229,0.062,0.145,0.062,0.064,0.075\\}$ and $\\{0.064,0.095,0.054,0.126,0.05,0.031,0.14,0.014,0.268,0.119\\}$.", - "Output Answer": [ - "$0.48$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.027, 0.043, 0.139, 0.071, 0.229, 0.062, 0.145, 0.062, 0.064, 0.075\ndistribution2 = 0.064, 0.095, 0.054, 0.126, 0.05, 0.031, 0.14, 0.014, 0.268, 0.119\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, 2, -1, -9.792, -4}$.\n", - "Output Answer": [ - "${-9.792, -4, -1, 0, 2}$" - ], - "Output Program": [ - "values = 0, 2, -1, -9.792, -4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{3}{2}, -2, 0, -5, 4, -2, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -5, -2, -2, -\\frac{3}{2}, 0, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/2), -2, 0, -5, 4, -2, -3*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 0, 9, -10, 6, -4, 5, 6}$.\n", - "Output Answer": [ - "$\\frac{7}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 0, 9, -10, 6, -4, 5, 6\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, -9, 5.38, -10, \\frac{45}{7}, 3, -6, -\\frac{20}{7}} \\setminus {-5, 3, 5.38, \\frac{17}{\\pi }, -\\frac{20}{7}, -6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-10, -9, -6, 0, \\frac{45}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -9, 5.38, -10, (45/7), 3, -6, -(20/7),))\nsnd = set((-5, 3, 5.38, (17/math.pi), -(20/7), -6*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x^2+0.6 x-4.8$ where $x \\sim $ \\text{BetaDistribution}[1.9,0.4]\n", - "Output Answer": [ - "$-0.96$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 0.4)\nprint(E(4.6*x**2+0.6*x-4.8))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 0, 6, -4, 0, -3, -3}$.\n", - "Output Answer": [ - "$-\\frac{13}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 0, 6, -4, 0, -3, -3\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{25}{3}, -7 \\log (2), \\frac{49}{5}, 2 \\pi, -3, -4 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\frac{14}{3}, 6, 7.39, -2.8} \\cup {\\frac{25}{3}, -7 \\log (2), 0, 2, \\pi, \\frac{14}{3}, -3.2, -\\frac{16}{\\sqrt{3}}, \\frac{49}{5}, -4 \\sqrt{3}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -5 \\sqrt{3}, -4 \\sqrt{3}, -7 \\log (2), -3.2, -3, -2.8, 0, 2, \\frac{4}{\\sqrt{3}}, \\pi, \\frac{14}{3}, 6, 2 \\pi, 7.39, \\frac{25}{3}, \\frac{49}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((25/3), -7*math.log(2), (49/5), 2*math.pi, -3, -4*math.sqrt(3), (4/(math.sqrt(3))), (14/3), 6, 7.39, -2.8,))\nsnd = set(((25/3), -7*math.log(2), 0, 2, math.pi, (14/3), -3.2, -(16/(math.sqrt(3))), (49/5), -4*math.sqrt(3), -5*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\pi, -10, -7, -\\frac{14}{e}}$.\n", - "Output Answer": [ - "$10-\\frac{14}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.pi, -10, -7, -(14/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 1, -9, 10, 1, 9, -9 \\log (2), -8, -7, -3, 0}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 1, -9, 10, 1, 9, -9*math.log(2), -8, -7, -3, 0\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.8 x+3.5$ where $x \\sim $ \\text{NormalDistribution}[0.2,2.4]\n", - "Output Answer": [ - "$4.46$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.2, 2.4)\nprint(E(4.8*x+3.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.469,0.163,0.205,0.001\\}$ and $\\{0.059,0.34,0.236,0.23\\}$.", - "Output Answer": [ - "$1.01$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.469, 0.163, 0.205, 0.001\ndistribution2 = 0.059, 0.34, 0.236, 0.23\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, 12, -1, -8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{398}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 12, -1, -8\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 7, \\frac{8}{\\sqrt{5}}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$7+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 7, (8/(math.sqrt(5))), -2*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 8, -10, -2, 8}$.\n", - "Output Answer": [ - "$\\frac{8}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 8, -10, -2, 8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${5, 3, -5, -11 \\log (2), 6, -9}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 3, -5, -11*math.log(2), 6, -9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{7}, 2 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{11}{7}-2 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = (11/7), 2*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${10, 3, -6, 3, -6, 3, -5}$.\n", - "Output Answer": [ - "$\\frac{2}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 10, 3, -6, 3, -6, 3, -5\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -6 \\log (2), 7, \\frac{20}{3}, 2 \\log (2), -6, -\\frac{16}{\\sqrt{\\pi }}, -2, 2}$.\n", - "Output Answer": [ - "$7+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -6*math.log(2), 7, (20/3), 2*math.log(2), -6, -(16/(math.sqrt(math.pi))), -2, 2\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-4 \\sqrt{3}, 5, \\frac{13}{3}, \\frac{1}{\\sqrt{3}}, \\frac{4}{\\pi }, -\\frac{13}{e}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -\\frac{13}{e}, \\frac{1}{\\sqrt{3}}, \\frac{4}{\\pi }, \\frac{13}{3}, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(3), 5, (13/3), (1/(math.sqrt(3))), (4/math.pi), -(13/math.e)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 6, 2, 1}$.\n", - "Output Answer": [ - "$\\frac{24}{13}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 6, 2, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$-\\frac{9 \\sqrt{5}}{4}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{6}{\\sqrt{\\pi }}, -\\frac{3}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -\\frac{9}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{3}{4 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(6/(math.sqrt(math.pi))), -(3/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -(9/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 9, 1, -6, -6, 5, 1, 6, -3, 9, -3, -3, -3, -6, 9, -3, 1, 5, -6, 6, 6, 9, -6, -3}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 9, 1, -6, -6, 5, 1, 6, -3, 9, -3, -3, -3, -6, 9, -3, 1, 5, -6, 6, 6, 9, -6, -3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-343, 125, -10, 36}$.\n", - "Output Answer": [ - "$5 \\sqrt{3} 14^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -343, 125, -10, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\sqrt{3}, -4, -\\frac{13}{\\sqrt{3}}, 2, \\sqrt{5}}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.sqrt(3), -4, -(13/(math.sqrt(3))), 2, math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 16, \\frac{10}{3}}$.\n", - "Output Answer": [ - "$\\frac{3120}{457}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 16, (10/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 15, 19, 13}$.\n", - "Output Answer": [ - "$\\frac{81510}{5851}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 15, 19, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.104,0.026,0.285,0.172,0.037,0.064,0.067,0.105\\}$ and $\\{0.026,0.051,0.091,0.156,0.069,0.028,0.073,0.107\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.104, 0.026, 0.285, 0.172, 0.037, 0.064, 0.067, 0.105\ndistribution2 = 0.026, 0.051, 0.091, 0.156, 0.069, 0.028, 0.073, 0.107\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 11, 19}$.\n", - "Output Answer": [ - "$\\frac{8778}{629}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 11, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{15}{e}, \\frac{22}{e}, -\\frac{5}{e}, \\frac{24}{e}, -\\frac{20}{e}, -\\frac{4}{e}, \\frac{23}{e}, -\\frac{22}{e}, \\frac{8}{e}} \\cap {-\\frac{22}{e}, -\\frac{11}{e}, -\\frac{20}{e}, -\\frac{15}{e}, \\frac{10}{e}, \\frac{15}{e}, -\\frac{25}{e}, 0, \\frac{7}{e}}$.\n", - "Output Answer": [ - "${-\\frac{22}{e}, -\\frac{20}{e}, \\frac{15}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((15/math.e), (22/math.e), -(5/math.e), (24/math.e), -(20/math.e), -(4/math.e), (23/math.e), -(22/math.e), (8/math.e),))\nsnd = set((-(22/math.e), -(11/math.e), -(20/math.e), -(15/math.e), (10/math.e), (15/math.e), -(25/math.e), 0, (7/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${0, -7, 4 \\sqrt{5}, -\\frac{26}{\\pi }, 4, 11 \\log (2), -4} \\setminus {11 \\log (2), -\\frac{29}{\\pi }, 6}$.\n", - "Output Answer": [ - "${-\\frac{26}{\\pi }, -7, -4, 0, 4, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -7, 4*math.sqrt(5), -(26/math.pi), 4, 11*math.log(2), -4,))\nsnd = set((11*math.log(2), -(29/math.pi), 6,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${1, 10, -\\frac{4}{\\pi }, 0, -1, 7, 10, -3, 2, 4, 0, -9}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 10, -(4/math.pi), 0, -1, 7, 10, -3, 2, 4, 0, -9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.2 x-4.2$ where $x \\sim $ \\text{PoissonDistribution}[2.6]\n", - "Output Answer": [ - "$-9.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.6)\nprint(E(-2.2*x-4.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${5, -8 \\log (2), 3}$.\n", - "Output Answer": [ - "${-8 \\log (2), 3, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -8*math.log(2), 3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, -13}$.\n", - "Output Answer": [ - "$5 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -13\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${0, 9, 7, 4, -6, -10, -3, 3, 6} \\cap {-10, -8, 2, 9, 0, 7, -2}$.\n", - "Output Answer": [ - "${-10, 0, 7, 9}$" - ], - "Output Program": [ - "fst = set((0, 9, 7, 4, -6, -10, -3, 3, 6,))\nsnd = set((-10, -8, 2, 9, 0, 7, -2,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-2.76 < 2.3 x+2.3 < 4.91$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6].", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(P((-2.76 < 2.3*x+2.3) & (2.3*x+2.3 < 4.91)))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-10, 0, 5, -7 \\log (2), 2, -6, -1, \\frac{25}{4}} \\cup {-1, -7 \\log (2), 1, -\\sqrt{5}, -2, -6, -\\frac{9}{2}}$.\n", - "Output Answer": [ - "${-10, -6, -7 \\log (2), -\\frac{9}{2}, -\\sqrt{5}, -2, -1, 0, 1, 2, 5, \\frac{25}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, 0, 5, -7*math.log(2), 2, -6, -1, (25/4),))\nsnd = set((-1, -7*math.log(2), 1, -math.sqrt(5), -2, -6, -(9/2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{3}, -1, 9, -\\sqrt{2}, \\frac{5}{\\sqrt{\\pi }}} \\setminus {\\frac{13}{\\sqrt{2}}, 0, -2 \\sqrt{2}, 10, 2 \\pi}$.\n", - "Output Answer": [ - "${-\\sqrt{2}, -1, \\frac{5}{\\sqrt{\\pi }}, 2 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(3), -1, 9, -math.sqrt(2), (5/(math.sqrt(math.pi))),))\nsnd = set(((13/(math.sqrt(2))), 0, -2*math.sqrt(2), 10, 2*math.pi,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-7, 10, 3, -2.9, -\\log (2), \\frac{43}{5}} \\cup {10, -4.7, -5, \\frac{43}{5}, -3, 3, 5 \\log (2)}$.\n", - "Output Answer": [ - "${-7, -5, -4.7, -3, -2.9, -\\log (2), 3, 5 \\log (2), \\frac{43}{5}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 10, 3, -2.9, -math.log(2), (43/5),))\nsnd = set((10, -4.7, -5, (43/5), -3, 3, 5*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4 \\sqrt{2}, -6 \\sqrt{2}, 3 \\sqrt{2}, 7 \\sqrt{2}, 2 \\sqrt{2}, -3 \\sqrt{2}, 0} \\cap {-4 \\sqrt{2}, 2 \\sqrt{2}, 5 \\sqrt{2}, -\\sqrt{2}, 0, -2 \\sqrt{2}, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, 0, 2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(2), -6*math.sqrt(2), 3*math.sqrt(2), 7*math.sqrt(2), 2*math.sqrt(2), -3*math.sqrt(2), 0,))\nsnd = set((-4*math.sqrt(2), 2*math.sqrt(2), 5*math.sqrt(2), -math.sqrt(2), 0, -2*math.sqrt(2), -7*math.sqrt(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{5}, 0, -\\sqrt{5}, -3 \\sqrt{5}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{1}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(5), 0, -math.sqrt(5), -3*math.sqrt(5), math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{2}{\\sqrt{3}}, 2 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, 2 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, 2 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, 2 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}, \\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{13}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (2/(math.sqrt(3))), 2*math.sqrt(3), (8/(math.sqrt(3))), (13/(math.sqrt(3))), (2/(math.sqrt(3))), (16/(math.sqrt(3))), 2*math.sqrt(3), (13/(math.sqrt(3))), (13/(math.sqrt(3))), (13/(math.sqrt(3))), (8/(math.sqrt(3))), (7/(math.sqrt(3))), (2/(math.sqrt(3))), (16/(math.sqrt(3))), (13/(math.sqrt(3))), (16/(math.sqrt(3))), (13/(math.sqrt(3))), (2/(math.sqrt(3))), (16/(math.sqrt(3))), 2*math.sqrt(3), (13/(math.sqrt(3))), (13/(math.sqrt(3))), (13/(math.sqrt(3))), (7/(math.sqrt(3))), 2*math.sqrt(3), (8/(math.sqrt(3))), (7/(math.sqrt(3))), (7/(math.sqrt(3))), (7/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -10, 2, -3 \\sqrt{2}, -7}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -10, 2, -3*math.sqrt(2), -7\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${7, \\frac{31}{\\pi }, 0, -1, -10} \\setminus {\\frac{31}{\\pi }, -3 e, 7}$.\n", - "Output Answer": [ - "${-10, -1, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, (31/math.pi), 0, -1, -10,))\nsnd = set(((31/math.pi), -3*math.e, 7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -5, -5, -4, -4, 4, -4, 9, 0, 0, -4, -5, -5, 8, -4, -5, 8, -4, -4, 4, 4, 9, 4, -4, -4}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -5, -5, -4, -4, 4, -4, 9, 0, 0, -4, -5, -5, 8, -4, -5, 8, -4, -4, 4, 4, 9, 4, -4, -4\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.299,0.101,0.392\\}$ and $\\{0.277,0.097,0.28\\}$.", - "Output Answer": [ - "$0.01$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.299, 0.101, 0.392\ndistribution2 = 0.277, 0.097, 0.28\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-5, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-5, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{17}{2}, 7}$.\n", - "Output Answer": [ - "$-\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(17/2), 7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, -11, -9, 14}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{2411}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -11, -9, 14\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-4.273, -4, 5 \\sqrt{2}, 6, 1, 2.89, \\frac{31}{4}} \\cup {-\\frac{32}{7}, -4.273, -9, 1, -6.66, 5 \\sqrt{2}, \\frac{31}{4}}$.\n", - "Output Answer": [ - "${-9, -6.66, -\\frac{32}{7}, -4.273, -4, 1, 2.89, 6, 5 \\sqrt{2}, \\frac{31}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4.273, -4, 5*math.sqrt(2), 6, 1, 2.89, (31/4),))\nsnd = set((-(32/7), -4.273, -9, 1, -6.66, 5*math.sqrt(2), (31/4),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${7, \\frac{18}{e}, 2 \\log (2), 6 \\sqrt{2}, -7, \\frac{39}{5}, -\\frac{1}{3}, \\frac{10}{\\sqrt{\\pi }}} \\setminus {13 \\log (2), 7, -\\frac{1}{3}, -\\frac{23}{5}, -7}$.\n", - "Output Answer": [ - "${2 \\log (2), \\frac{10}{\\sqrt{\\pi }}, \\frac{18}{e}, \\frac{39}{5}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, (18/math.e), 2*math.log(2), 6*math.sqrt(2), -7, (39/5), -(1/3), (10/(math.sqrt(math.pi))),))\nsnd = set((13*math.log(2), 7, -(1/3), -(23/5), -7,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-8, \\frac{19}{\\sqrt{5}}, 8.46, 0, 7, -9} \\setminus {-8, -5, \\frac{19}{\\sqrt{5}}, 9}$.\n", - "Output Answer": [ - "${-9, 0, 7, 8.46}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, (19/(math.sqrt(5))), 8.46, 0, 7, -9,))\nsnd = set((-8, -5, (19/(math.sqrt(5))), 9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.2 x-0.6$ where $x \\sim $ \\text{PoissonDistribution}[1.1]\n", - "Output Answer": [ - "$2.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.1)\nprint(E(3.2*x-0.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -9, 4}$.\n", - "Output Answer": [ - "$-\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -9, 4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, \\sqrt{2}, 0, -\\frac{1}{\\sqrt{3}}, -\\frac{13}{\\pi }, \\frac{7}{\\sqrt{\\pi }}, 10, 0, 6, -7 \\sqrt{2}, -2, 0, 5 \\sqrt{2}, -2, -\\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$10+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, math.sqrt(2), 0, -(1/(math.sqrt(3))), -(13/math.pi), (7/(math.sqrt(math.pi))), 10, 0, 6, -7*math.sqrt(2), -2, 0, 5*math.sqrt(2), -2, -(7/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{5}, 2 \\log (2), -7, -\\frac{22}{\\sqrt{5}}, 9, 7, \\frac{37}{7}, -6, \\frac{55}{7}, -3, 4, 9, 10, -3}$.", - "Output Answer": [ - "$\\frac{1}{2} (4+2 \\log (2))$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(5), 2*math.log(2), -7, -(22/(math.sqrt(5))), 9, 7, (37/7), -6, (55/7), -3, 4, 9, 10, -3\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-2 \\pi, \\frac{13}{\\sqrt{\\pi }}, -\\frac{60}{7}}$.\n", - "Output Answer": [ - "${-\\frac{60}{7}, -2 \\pi, \\frac{13}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.pi, (13/(math.sqrt(math.pi))), -(60/7)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{7}{\\sqrt{2}}, \\frac{17}{3}, -8, -4, -0.08, -4 \\log (2)} \\setminus {0, -4, -8, -4 \\log (2), -5.81, -\\frac{5}{\\sqrt{\\pi }}, \\frac{17}{3}}$.\n", - "Output Answer": [ - "${-0.08, \\frac{7}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/(math.sqrt(2))), (17/3), -8, -4, -0.08, -4*math.log(2),))\nsnd = set((0, -4, -8, -4*math.log(2), -5.81, -(5/(math.sqrt(math.pi))), (17/3),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.7 x^2-1.7 x-2.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-12.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-3.7*x**2-1.7*x-2.1))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{7}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{22}{3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (7/(math.sqrt(3))), -(2/(math.sqrt(3))), (17/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-5, -0.7, 6, -3, 3 \\pi, -5 \\sqrt{2}, -6}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -6, -5, -3, -0.7, 6, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -0.7, 6, -3, 3*math.pi, -5*math.sqrt(2), -6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 12, 16, 19}$.\n", - "Output Answer": [ - "$\\frac{10944}{847}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 12, 16, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${6 \\sqrt{3}, -9.87, \\frac{18}{5}, \\frac{5}{\\sqrt{2}}, -5 \\sqrt{3}, -6 \\sqrt{2}, 2 \\pi, \\frac{11}{\\sqrt{3}}} \\setminus {6 \\sqrt{3}, -3 \\sqrt{2}, -\\frac{16}{\\sqrt{3}}, \\frac{18}{5}, -9.87}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -6 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, 2 \\pi, \\frac{11}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6*math.sqrt(3), -9.87, (18/5), (5/(math.sqrt(2))), -5*math.sqrt(3), -6*math.sqrt(2), 2*math.pi, (11/(math.sqrt(3))),))\nsnd = set((6*math.sqrt(3), -3*math.sqrt(2), -(16/(math.sqrt(3))), (18/5), -9.87,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${625, 64, -10, -3, 1, 64}$.\n", - "Output Answer": [ - "$4\\ 5^{5/6} \\sqrt[6]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 625, 64, -10, -3, 1, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, 9, 3, 8, -2, -1, 1, 4}$.\n", - "Output Answer": [ - "${-2, -1, 0, 1, 3, 4, 8, 9}$" - ], - "Output Program": [ - "values = 0, 9, 3, 8, -2, -1, 1, 4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-8.3, 3, 1, -8, -\\frac{4}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}} \\cup {-\\frac{4}{\\sqrt{3}}, -6, -2, 3, -8.3, -\\frac{16}{\\sqrt{3}}, 8}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -8.3, -8, -6, -\\frac{4}{\\sqrt{3}}, -2, 1, 3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8.3, 3, 1, -8, -(4/(math.sqrt(3))), -(16/(math.sqrt(3))),))\nsnd = set((-(4/(math.sqrt(3))), -6, -2, 3, -8.3, -(16/(math.sqrt(3))), 8,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 2401, -1024, 2, 15625, 16}$.\n", - "Output Answer": [ - "$40 \\sqrt[6]{-1} \\sqrt{2} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 2401, -1024, 2, 15625, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{15}{2}, 6}$.\n", - "Output Answer": [ - "${-\\frac{15}{2}, 6}$" - ], - "Output Program": [ - "values = -(15/2), 6\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -5, -5, -1, -5, 10, 10, -5, -1, -5, -2, -1, -1, -5, -2, 10, 10, -5, -2, -1, 10, -5, 10, -2, -5, -1, -2, -1}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -5, -5, -1, -5, 10, 10, -5, -1, -5, -2, -1, -1, -5, -2, 10, 10, -5, -2, -1, 10, -5, 10, -2, -5, -1, -2, -1\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{25}{7}, \\frac{51}{7}}$.\n", - "Output Answer": [ - "$\\frac{38}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (25/7), (51/7)\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 729, -1}$.\n", - "Output Answer": [ - "$9 \\sqrt[3]{-1} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 729, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2.989, -10}$.\n", - "Output Answer": [ - "${-10, 2.989}$" - ], - "Output Program": [ - "values = 2.989, -10\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, 15, -1, -2}$.\n", - "Output Answer": [ - "$\\frac{230}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 15, -1, -2\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${0, -e, -1, \\frac{2}{\\pi }, 2 \\sqrt{3}, 10}$.\n", - "Output Answer": [ - "${-e, -1, 0, \\frac{2}{\\pi }, 2 \\sqrt{3}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -math.e, -1, (2/math.pi), 2*math.sqrt(3), 10\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, -13, -10, 6, -10}$.\n", - "Output Answer": [ - "$3 \\sqrt{\\frac{77}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -13, -10, 6, -10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.6 x-1.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$-2.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(-0.6*x-1.6))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{29}{4}, 0, \\frac{32}{5}, 7, -\\frac{29}{4}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import statistics\n\nvalues = -(29/4), 0, (32/5), 7, -(29/4)\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{15}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{34}{3 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(15/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, 10000, -10, 49}$.\n", - "Output Answer": [ - "$(10+10 i) \\sqrt{35}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 10000, -10, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 4, 7}$.\n", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 4, 7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x^2+1.3 x+0.$ where $x \\sim $ \\text{PoissonDistribution}[1.5]\n", - "Output Answer": [ - "$10.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.5)\nprint(E(2.2*x**2+1.3*x+0.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -2, 7}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -2, 7\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-5, 14, -9, 2, 10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{943}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 14, -9, 2, 10\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${7, 0, \\frac{13}{\\sqrt{2}}, -8, -10, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-10, -8, -2 \\sqrt{5}, 0, 7, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 0, (13/(math.sqrt(2))), -8, -10, -2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${9, -8, \\frac{23}{e}, \\frac{17}{4}, 2, 0} \\setminus {\\frac{9}{2}, 2, -\\frac{23}{e}, -\\frac{11}{e}, 0, \\frac{39}{4}, -\\frac{10}{\\pi }, 9}$.\n", - "Output Answer": [ - "${-8, \\frac{17}{4}, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -8, (23/math.e), (17/4), 2, 0,))\nsnd = set(((9/2), 2, -(23/math.e), -(11/math.e), 0, (39/4), -(10/math.pi), 9,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{1}{\\sqrt{\\pi }}, -e, -\\frac{50}{7}, -6, \\frac{17}{7}, -9, -3, -2 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, \\frac{54}{7}, -\\frac{16}{\\sqrt{\\pi }}, -9, 2, -6}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{10}{\\sqrt{3}}-2 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(1/(math.sqrt(math.pi))), -math.e, -(50/7), -6, (17/7), -9, -3, -2*math.sqrt(3), -(10/(math.sqrt(3))), (54/7), -(16/(math.sqrt(math.pi))), -9, 2, -6\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x^2+3. x-1.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$10.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(3.9*x**2+3.*x-1.2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 9, -2}$.\n", - "Output Answer": [ - "$\\frac{97}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 9, -2\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-9, -\\frac{23}{e}, 7.8, -7, \\frac{1}{3}, 9}$.\n", - "Output Answer": [ - "${-9, -\\frac{23}{e}, -7, \\frac{1}{3}, 7.8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -(23/math.e), 7.8, -7, (1/3), 9\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -\\frac{24}{\\pi }, \\frac{10}{3}, -\\frac{18}{e}, -10, \\frac{24}{\\pi }, 8, \\frac{5}{2}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -(24/math.pi), (10/3), -(18/math.e), -10, (24/math.pi), 8, (5/2)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{4}{3}, -2, 2, -\\frac{26}{3}, -6, 4 \\sqrt{5}, -1}$.\n", - "Output Answer": [ - "$\\frac{26}{3}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(4/3), -2, 2, -(26/3), -6, 4*math.sqrt(5), -1\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -1, 7, -\\frac{11}{2}, -\\frac{15}{2}, -6} \\cup {-6, -7, -\\frac{11}{2}, 7, 3 e, -9}$.\n", - "Output Answer": [ - "${-9, -\\frac{15}{2}, -7, -6, -\\frac{11}{2}, -1, 7, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -1, 7, -(11/2), -(15/2), -6,))\nsnd = set((-6, -7, -(11/2), 7, 3*math.e, -9,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x+0.$ where $x \\sim $ \\text{BetaDistribution}[0.8,1.2]\n", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 1.2)\nprint(E(1.1*x+0.))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${14, 7, 5}$.\n", - "Output Answer": [ - "$\\frac{67}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 7, 5\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, -7, \\frac{3}{\\pi }, -10, -9, 1, -\\frac{37}{5}, -1, \\frac{5}{2}, -7, 8, -9, 5, -\\frac{15}{e}, \\frac{17}{\\pi }}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -7, (3/math.pi), -10, -9, 1, -(37/5), -1, (5/2), -7, 8, -9, 5, -(15/math.e), (17/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 3, -6, 8, -6, -6, 5}$.\n", - "Output Answer": [ - "$-\\frac{1}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 3, -6, 8, -6, -6, 5\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{e}, -\\frac{16}{\\sqrt{\\pi }}, 2 \\sqrt{5}, -\\frac{25}{3}, 0, 6 \\sqrt{2}, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -\\frac{25}{3}, 0, \\frac{1}{e}, 2 \\sqrt{3}, 2 \\sqrt{5}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = (1/math.e), -(16/(math.sqrt(math.pi))), 2*math.sqrt(5), -(25/3), 0, 6*math.sqrt(2), 2*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -5, -9, -5, -3, 3, -7, -5, -2, -2, -7, -7, -3, 3, -7, 3, -9, -2, 3, -7, -2, -3}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -5, -9, -5, -3, 3, -7, -5, -2, -2, -7, -7, -3, 3, -7, 3, -9, -2, 3, -7, -2, -3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-1.05 < 1.8 x^2-0.8 x+2.8 < 4.59$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5].", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(P((-1.05 < 1.8*x**2-0.8*x+2.8) & (1.8*x**2-0.8*x+2.8 < 4.59)))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x-2.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$-1.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(1.6*x-2.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${9, 2, -9, 0, -4, \\frac{7}{\\sqrt{5}}}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 2, -9, 0, -4, (7/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${4, -9, \\frac{32}{7}, \\pi, \\frac{6}{\\pi }} \\setminus {8, -9, -6, 4}$.\n", - "Output Answer": [ - "${\\frac{6}{\\pi }, \\pi, \\frac{32}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -9, (32/7), math.pi, (6/math.pi),))\nsnd = set((8, -9, -6, 4,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{2}, -\\frac{13}{2}, -10, \\frac{15}{2}, -\\frac{9}{2}, -\\frac{9}{2}, \\frac{15}{2}, -10, \\frac{11}{2}, 6, -\\frac{1}{2}, -\\frac{13}{2}, \\frac{15}{2}, -\\frac{13}{2}, \\frac{11}{2}, -10, \\frac{15}{2}, -10, -10, -10, -\\frac{1}{2}}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(13/2), -(13/2), -10, (15/2), -(9/2), -(9/2), (15/2), -10, (11/2), 6, -(1/2), -(13/2), (15/2), -(13/2), (11/2), -10, (15/2), -10, -10, -10, -(1/2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${7, -10, -7, -9, -4, -5, -2} \\cap {7, -8, 3, 4, 6, -5, 5, -7}$.\n", - "Output Answer": [ - "${-7, -5, 7}$" - ], - "Output Program": [ - "fst = set((7, -10, -7, -9, -4, -5, -2,))\nsnd = set((7, -8, 3, 4, 6, -5, 5, -7,))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nFind the probability that $-5.5 < -4.3 x-5. < 1.92$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8].", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(P((-5.5 < -4.3*x-5.) & (-4.3*x-5. < 1.92)))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{5}, -3, -\\frac{46}{7}, -9, 6, \\pi} \\cup {5, 10, 1, -\\frac{46}{7}, 4 \\sqrt{5}, \\pi, -\\frac{30}{\\pi }, 14 \\log (2), -3}$.\n", - "Output Answer": [ - "${-\\frac{30}{\\pi }, -9, -3 \\sqrt{5}, -\\frac{46}{7}, -3, 1, \\pi, 5, 6, 4 \\sqrt{5}, 14 \\log (2), 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(5), -3, -(46/7), -9, 6, math.pi,))\nsnd = set((5, 10, 1, -(46/7), 4*math.sqrt(5), math.pi, -(30/math.pi), 14*math.log(2), -3,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 11, \\frac{33}{2}, 5}$.\n", - "Output Answer": [ - "$\\frac{9240}{977}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 11, (33/2), 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, \\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\frac{330}{37}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, (15/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10, 6561, -729, -1}$.\n", - "Output Answer": [ - "$27 \\sqrt{3} \\sqrt[4]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 6561, -729, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.012,0.041,0.099,0.192,0.051,0.135,0.14,0.048,0.074,0.193\\}$ and $\\{0.096,0.071,0.107,0.05,0.063,0.149,0.033,0.03,0.187,0.156\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.012, 0.041, 0.099, 0.192, 0.051, 0.135, 0.14, 0.048, 0.074, 0.193\ndistribution2 = 0.096, 0.071, 0.107, 0.05, 0.063, 0.149, 0.033, 0.03, 0.187, 0.156\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, 5, -3, 14}$.\n", - "Output Answer": [ - "$\\sqrt{70}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 5, -3, 14\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.243,0.305,0.076,0.218,0.075\\}$ and $\\{0.177,0.368,0.031,0.231,0.05\\}$.", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.243, 0.305, 0.076, 0.218, 0.075\ndistribution2 = 0.177, 0.368, 0.031, 0.231, 0.05\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 3 e, 8, \\frac{3}{2}, -2 \\sqrt{5}} \\setminus {3 e, -6, -1, \\frac{3}{2}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 3*math.e, 8, (3/2), -2*math.sqrt(5),))\nsnd = set((3*math.e, -6, -1, (3/2), -2*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 6, 3, 3, 6, 6, -1, 3, 3, -7, 6, 3, -8, -7, 6, 3, -1, -5, -8, 3}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 6, 3, 3, 6, 6, -1, 3, 3, -7, 6, 3, -8, -7, 6, 3, -1, -5, -8, 3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\sqrt{3}, -\\frac{62}{7}, -7 \\sqrt{2}, 0, -7, 7, 2, 2 \\sqrt{2}, -\\frac{17}{5}} \\cup {7, 1, -6 \\sqrt{2}, \\frac{1}{7}, 2, 2 \\sqrt{3}, 2 \\sqrt{2}, 7 \\sqrt{2}, \\frac{6}{5}}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -\\frac{62}{7}, -6 \\sqrt{2}, -7, -\\frac{17}{5}, 0, \\frac{1}{7}, 1, \\frac{6}{5}, 2, 2 \\sqrt{2}, 2 \\sqrt{3}, 7, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(3), -(62/7), -7*math.sqrt(2), 0, -7, 7, 2, 2*math.sqrt(2), -(17/5),))\nsnd = set((7, 1, -6*math.sqrt(2), (1/7), 2, 2*math.sqrt(3), 2*math.sqrt(2), 7*math.sqrt(2), (6/5),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.185,0.183,0.001,0.344\\}$ and $\\{0.19,0.013,0.586,0.096\\}$.", - "Output Answer": [ - "$1.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.185, 0.183, 0.001, 0.344\ndistribution2 = 0.19, 0.013, 0.586, 0.096\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, -9, -3125, 16, 243, -64}$.\n", - "Output Answer": [ - "$24\\ 5^{5/6} \\sqrt[6]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, -9, -3125, 16, 243, -64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.016,0.26,0.052,0.195,0.002,0.428\\}$ and $\\{0.171,0.097,0.178,0.207,0.119,0.114\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.016, 0.26, 0.052, 0.195, 0.002, 0.428\ndistribution2 = 0.171, 0.097, 0.178, 0.207, 0.119, 0.114\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, -11, 9, 10, -8}$.\n", - "Output Answer": [ - "$\\frac{1077}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -11, 9, 10, -8\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -2, -7, -6, -2, -7, -9, -6, -6, -7, -3, -2, -7, -2, -6, -2, -2, -2, -6, -2, -7, -6, -8, -2, -3}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -2, -7, -6, -2, -7, -9, -6, -6, -7, -3, -2, -7, -2, -6, -2, -2, -2, -6, -2, -7, -6, -8, -2, -3\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 19, \\frac{29}{2}}$.\n", - "Output Answer": [ - "$\\frac{2204}{273}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 19, (29/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${2 e, 3, \\frac{7}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{2}}, 6.596, 4}$.\n", - "Output Answer": [ - "${-\\frac{1}{\\sqrt{2}}, 3, \\frac{7}{\\sqrt{\\pi }}, 4, 2 e, 6.596}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, 3, (7/(math.sqrt(math.pi))), -(1/(math.sqrt(2))), 6.596, 4\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{1}{\\sqrt{2}}, -\\frac{2}{5}, 5}$.", - "Output Answer": [ - "$\\frac{1}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (1/(math.sqrt(2))), -(2/5), 5\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 512, 256, 81}$.\n", - "Output Answer": [ - "$96 \\sqrt[4]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 512, 256, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, \\frac{15}{2}, 14, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{3570}{377}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, (15/2), 14, (17/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\pi, 0, -2 \\pi, \\pi, \\pi, 3 \\pi, 0, -2 \\pi, 3 \\pi, 0, \\pi, -2 \\pi, 3 \\pi, -2 \\pi, -2 \\pi, -\\pi, 3 \\pi, -2 \\pi, -3 \\pi, -\\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$\\{-2 \\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.pi, 0, -2*math.pi, math.pi, math.pi, 3*math.pi, 0, -2*math.pi, 3*math.pi, 0, math.pi, -2*math.pi, 3*math.pi, -2*math.pi, -2*math.pi, -math.pi, 3*math.pi, -2*math.pi, -3*math.pi, -math.pi, -2*math.pi\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, -14, 0, 2, 15, 5}$.\n", - "Output Answer": [ - "$\\frac{175}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -14, 0, 2, 15, 5\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x-3.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$-3.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(-4.1*x-3.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.267,0.087,0.046,0.075,0.216,0.03,0.064,0.06,0.055\\}$ and $\\{0.196,0.046,0.014,0.006,0.327,0.019,0.249,0.024,0.009\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.267, 0.087, 0.046, 0.075, 0.216, 0.03, 0.064, 0.06, 0.055\ndistribution2 = 0.196, 0.046, 0.014, 0.006, 0.327, 0.019, 0.249, 0.024, 0.009\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${5, 9, 15}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{19}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, 9, 15\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{2}, -8, 0, -8, 8, 4, -12 \\log (2), -2, -4, -2, 7, 3, -\\pi, \\pi, 9}$.", - "Output Answer": [ - "$-\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(2), -8, 0, -8, 8, 4, -12*math.log(2), -2, -4, -2, 7, 3, -math.pi, math.pi, 9\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, -8, -9, 3, -4, -5, 8}$.\n", - "Output Answer": [ - "$-\\frac{6}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, -8, -9, 3, -4, -5, 8\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.065,0.09,0.193,0.2,0.035,0.137\\}$ and $\\{0.223,0.109,0.161,0.083,0.054,0.105\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.065, 0.09, 0.193, 0.2, 0.035, 0.137\ndistribution2 = 0.223, 0.109, 0.161, 0.083, 0.054, 0.105\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 5, 4, 9, 2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{83}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 5, 4, 9, 2\nprint(statistics.stdev(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.289,0.177,0.107,0.262,0.084\\}$ and $\\{0.004,0.044,0.291,0.058,0.008\\}$.", - "Output Answer": [ - "$1.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.289, 0.177, 0.107, 0.262, 0.084\ndistribution2 = 0.004, 0.044, 0.291, 0.058, 0.008\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1296, 8, 256, 100}$.\n", - "Output Answer": [ - "$48 \\sqrt[4]{2} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1296, 8, 256, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, -2, 8, -7, 5, 4}$.\n", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, -2, 8, -7, 5, 4\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, \\frac{3}{2}, \\frac{21}{2}}$.\n", - "Output Answer": [ - "$\\frac{63}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, (3/2), (21/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nCompute the median of ${3, \\frac{2}{3}, 2, -6, 2, 10, -\\frac{11}{\\sqrt{\\pi }}, 0, 7}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, (2/3), 2, -6, 2, 10, -(11/(math.sqrt(math.pi))), 0, 7\nprint(statistics.median(values)) \n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, -2, -6}$.\n", - "Output Answer": [ - "$\\frac{37}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -2, -6\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x+3.3$ where $x \\sim $ \\text{BetaDistribution}[1.4,0.5]\n", - "Output Answer": [ - "$6.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.4, 0.5)\nprint(E(3.8*x+3.3))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{22}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -\\sqrt{5}, -3 \\sqrt{5}, \\frac{16}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{5} \\left(\\frac{46}{\\sqrt{5}}-4 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (22/(math.sqrt(5))), (8/(math.sqrt(5))), -math.sqrt(5), -3*math.sqrt(5), (16/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x+1.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$1.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(1.6*x+1.5))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -7, 0, -7, 7, -7, -7, 0, 2, 0, -7, 7, 0, 0, 2, -7, -7, 7, 0, 2, 0, 2, -7, -7, -7, 7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -7, 0, -7, 7, -7, -7, 0, 2, 0, -7, 7, 0, 0, 2, -7, -7, 7, 0, 2, 0, 2, -7, -7, -7, 7\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, 36, 59049, 16, -125}$.\n", - "Output Answer": [ - "$18\\ 3^{2/5} 5^{3/5} \\sqrt[5]{14}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 36, 59049, 16, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, 10, -7, 3, 11}$.\n", - "Output Answer": [ - "$\\frac{209}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 10, -7, 3, 11\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-2, 3, \\frac{9}{\\sqrt{5}}, -\\frac{11}{7}, -1, \\frac{3}{\\sqrt{\\pi }}, -6, 5} \\setminus {-\\frac{55}{7}, 5, -5, \\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-6, -2, -\\frac{11}{7}, -1, \\frac{3}{\\sqrt{\\pi }}, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 3, (9/(math.sqrt(5))), -(11/7), -1, (3/(math.sqrt(math.pi))), -6, 5,))\nsnd = set((-(55/7), 5, -5, (9/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-6, 1, \\frac{5}{\\sqrt{3}}, -\\frac{11}{2}, 0, -2, 9, -3} \\cup {1, 5, \\frac{5}{\\sqrt{3}}, -\\frac{11}{2}, 7, \\frac{19}{2}, 6, 0, -\\frac{2}{5}, \\frac{21}{\\pi }}$.\n", - "Output Answer": [ - "${-6, -\\frac{11}{2}, -3, -2, -\\frac{2}{5}, 0, 1, \\frac{5}{\\sqrt{3}}, 5, 6, \\frac{21}{\\pi }, 7, 9, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 1, (5/(math.sqrt(3))), -(11/2), 0, -2, 9, -3,))\nsnd = set((1, 5, (5/(math.sqrt(3))), -(11/2), 7, (19/2), 6, 0, -(2/5), (21/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{23}{5}, 4, 10, 5, 2.26, 1, -6, 4.1} \\setminus {-6, 5 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, 1, -\\frac{15}{2}, 5, 2.26}$.\n", - "Output Answer": [ - "${4, 4.1, \\frac{23}{5}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((23/5), 4, 10, 5, 2.26, 1, -6, 4.1,))\nsnd = set((-6, 5*math.sqrt(2), (7/(math.sqrt(2))), 1, -(15/2), 5, 2.26,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\pi, 3 \\pi, 3 \\pi, 2 \\pi, -\\pi}$.\n", - "Output Answer": [ - "$\\frac{6 \\pi }{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.pi, 3*math.pi, 3*math.pi, 2*math.pi, -math.pi\nprint(mean(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${\\frac{4}{\\sqrt{\\pi }}, -1, \\frac{21}{5}, -e}$.\n", - "Output Answer": [ - "${-e, -1, \\frac{4}{\\sqrt{\\pi }}, \\frac{21}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = (4/(math.sqrt(math.pi))), -1, (21/5), -math.e\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-5, \\frac{23}{e}, -e, 9, -5.29, 6., -4.41, -5.8, \\sqrt{3}} \\cup {-5.8, 9, -8, -e, \\frac{46}{7}, -5.29, 3, \\frac{22}{e}, 2.11, -\\sqrt{2}, 6., -\\frac{11}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-8, -\\frac{11}{\\sqrt{3}}, -5.8, -5.29, -5, -4.41, -e, -\\sqrt{2}, \\sqrt{3}, 2.11, 3, 6., \\frac{46}{7}, \\frac{22}{e}, \\frac{23}{e}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, (23/math.e), -math.e, 9, -5.29, 6., -4.41, -5.8, math.sqrt(3),))\nsnd = set((-5.8, 9, -8, -math.e, (46/7), -5.29, 3, (22/math.e), 2.11, -math.sqrt(2), 6., -(11/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x+0.$ where $x \\sim $ \\text{BetaDistribution}[1.7,1.8]\n", - "Output Answer": [ - "$2.09$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 1.8)\nprint(E(4.3*x+0.))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{19}{\\sqrt{5}}, -\\frac{11}{2}, -4 \\sqrt{3}, -3, 3, 0} \\setminus {-4 \\sqrt{3}, 7, 0, \\frac{19}{\\sqrt{5}}, -3, \\pi}$.\n", - "Output Answer": [ - "${-\\frac{11}{2}, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set(((19/(math.sqrt(5))), -(11/2), -4*math.sqrt(3), -3, 3, 0,))\nsnd = set((-4*math.sqrt(3), 7, 0, (19/(math.sqrt(5))), -3, math.pi,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -11, 6, 13, -8, 2}$.\n", - "Output Answer": [ - "$\\frac{2633}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -11, 6, 13, -8, 2\nprint(statistics.variance(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 5, -7, -\\frac{13}{\\sqrt{3}}, 8, -5} \\setminus {8, -8, -11 \\log (2), -e, -\\frac{5}{\\sqrt{3}}, 9.495, 1}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{3}}, -7, -5, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 5, -7, -(13/(math.sqrt(3))), 8, -5,))\nsnd = set((8, -8, -11*math.log(2), -math.e, -(5/(math.sqrt(3))), 9.495, 1,))\nprint(fst - snd)\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${7, -4, 6, -9, -9, -6, 9.3}$.\n", - "Output Answer": [ - "${-9, -9, -6, -4, 6, 7, 9.3}$" - ], - "Output Program": [ - "values = 7, -4, 6, -9, -9, -6, 9.3\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.16,0.099,0.136,0.101,0.058,0.071,0.035,0.079,0.083,0.034\\}$ and $\\{0.054,0.104,0.116,0.07,0.205,0.132,0.102,0.03,0.07,0.041\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.16, 0.099, 0.136, 0.101, 0.058, 0.071, 0.035, 0.079, 0.083, 0.034\ndistribution2 = 0.054, 0.104, 0.116, 0.07, 0.205, 0.132, 0.102, 0.03, 0.07, 0.041\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\frac{11}{e}, \\frac{26}{e}, \\frac{16}{e}, -\\frac{16}{e}, \\frac{8}{e}} \\cap {-\\frac{7}{e}, \\frac{26}{e}, \\frac{11}{e}, \\frac{25}{e}, \\frac{3}{e}}$.\n", - "Output Answer": [ - "${\\frac{11}{e}, \\frac{26}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((11/math.e), (26/math.e), (16/math.e), -(16/math.e), (8/math.e),))\nsnd = set((-(7/math.e), (26/math.e), (11/math.e), (25/math.e), (3/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\sqrt{2}, -2 \\sqrt{2}, -4 \\sqrt{2}, -4 \\sqrt{2}, 2 \\sqrt{2}, -2 \\sqrt{2}, 0, -\\frac{5}{\\sqrt{2}}, -4 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}, -4 \\sqrt{2}, 0, 2 \\sqrt{2}, 2 \\sqrt{2}, -\\sqrt{2}, -\\sqrt{2}, 2 \\sqrt{2}, -4 \\sqrt{2}, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.sqrt(2), -2*math.sqrt(2), -4*math.sqrt(2), -4*math.sqrt(2), 2*math.sqrt(2), -2*math.sqrt(2), 0, -(5/(math.sqrt(2))), -4*math.sqrt(2), -(5/(math.sqrt(2))), -(5/(math.sqrt(2))), -4*math.sqrt(2), 0, 2*math.sqrt(2), 2*math.sqrt(2), -math.sqrt(2), -math.sqrt(2), 2*math.sqrt(2), -4*math.sqrt(2), 2*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-1, \\frac{3}{2}, 3, -2, 0} \\cup {3, -\\frac{25}{7}, 7, 0, -6 \\sqrt{2}, -\\frac{19}{2}}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -6 \\sqrt{2}, -\\frac{25}{7}, -2, -1, 0, \\frac{3}{2}, 3, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, (3/2), 3, -2, 0,))\nsnd = set((3, -(25/7), 7, 0, -6*math.sqrt(2), -(19/2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-5.2, -6, 6, -10, 3, -3, -10, -1.18}$.\n", - "Output Answer": [ - "${-10, -10, -6, -5.2, -3, -1.18, 3, 6}$" - ], - "Output Program": [ - "values = -5.2, -6, 6, -10, 3, -3, -10, -1.18\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${262144, 1, 1, 531441, 15625, 3}$.\n", - "Output Answer": [ - "$360 \\sqrt[6]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 262144, 1, 1, 531441, 15625, 3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x+0.4$ where $x \\sim $ \\text{BetaDistribution}[0.5,0.4]\n", - "Output Answer": [ - "$1.07$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.5, 0.4)\nprint(E(1.2*x+0.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 4, 216}$.\n", - "Output Answer": [ - "$6\\ 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 4, 216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{15}{\\sqrt{\\pi }}, 3, 1, 1, 1}$.\n", - "Output Answer": [ - "${-\\frac{15}{\\sqrt{\\pi }}, 1, 1, 1, 3}$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/(math.sqrt(math.pi))), 3, 1, 1, 1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.05,0.071,0.053,0.015,0.074,0.162,0.057,0.328,0.028,0.126\\}$ and $\\{0.203,0.033,0.014,0.181,0.264,0.09,0.068,0.03,0.01,0.016\\}$.", - "Output Answer": [ - "$1.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.05, 0.071, 0.053, 0.015, 0.074, 0.162, 0.057, 0.328, 0.028, 0.126\ndistribution2 = 0.203, 0.033, 0.014, 0.181, 0.264, 0.09, 0.068, 0.03, 0.01, 0.016\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.5 x^2+3.6 x-0.8$ where $x \\sim $ \\text{PoissonDistribution}[1.5]\n", - "Output Answer": [ - "$-12.27$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.5)\nprint(E(-4.5*x**2+3.6*x-0.8))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{26}{7}, -8, -2, 4, 0, -e}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "import math\n\nvalues = (26/7), -8, -2, 4, 0, -math.e\nprint(max(values) - min(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{29}{4}, -\\frac{17}{3}, 7, 3, -10, -2, -\\frac{14}{\\sqrt{3}}} \\cup {-\\frac{29}{4}, 0, 7, -10, \\frac{13}{\\sqrt{3}}, -\\frac{10}{3}, 1, -2}$.\n", - "Output Answer": [ - "${-10, -\\frac{14}{\\sqrt{3}}, -\\frac{29}{4}, -\\frac{17}{3}, -\\frac{10}{3}, -2, 0, 1, 3, 7, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(29/4), -(17/3), 7, 3, -10, -2, -(14/(math.sqrt(3))),))\nsnd = set((-(29/4), 0, 7, -10, (13/(math.sqrt(3))), -(10/3), 1, -2,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.154,0.036,0.028,0.031,0.198,0.103,0.001,0.001,0.047,0.401\\}$ and $\\{0.17,0.057,0.052,0.059,0.019,0.185,0.117,0.079,0.146,0.056\\}$.", - "Output Answer": [ - "$1.$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.154, 0.036, 0.028, 0.031, 0.198, 0.103, 0.001, 0.001, 0.047, 0.401\ndistribution2 = 0.17, 0.057, 0.052, 0.059, 0.019, 0.185, 0.117, 0.079, 0.146, 0.056\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{31}{4}, -\\frac{28}{\\pi }, 7 \\sqrt{2}, 2, -4, -2, 8, -\\frac{17}{\\sqrt{3}}} \\cup {-2, \\frac{5}{\\pi }, -\\frac{31}{4}, 2, -4, -5, -\\frac{17}{\\sqrt{3}}, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -\\frac{17}{\\sqrt{3}}, -\\frac{28}{\\pi }, -\\frac{31}{4}, -5, -4, -2, \\frac{5}{\\pi }, 2, 8, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(31/4), -(28/math.pi), 7*math.sqrt(2), 2, -4, -2, 8, -(17/(math.sqrt(3))),))\nsnd = set((-2, (5/math.pi), -(31/4), 2, -4, -5, -(17/(math.sqrt(3))), -7*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{\\pi }, -4 \\sqrt{2}, -\\frac{46}{7}, 2.8, 1}$.\n", - "Output Answer": [ - "${-\\frac{46}{7}, -4 \\sqrt{2}, -\\frac{13}{\\pi }, 1, 2.8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/math.pi), -4*math.sqrt(2), -(46/7), 2.8, 1\nprint(sorted(values))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -1, -4, -4, -4, 6, -4, -4, -1, 6, -4, -4, -4, 6, -4, 6, -1, 6, -4, -4, 6, -4, -4}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -1, -4, -4, -4, 6, -4, -4, -1, 6, -4, -4, -4, 6, -4, 6, -1, 6, -4, -4, 6, -4, -4\nprint(mode(values))\n" - ], - "split": "dev" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 5, -10, 7, -6, -1, 1.8} \\cup {-4, 7, -3, -7, -9.3, -2 \\log (2), -10}$.\n", - "Output Answer": [ - "${-10, -9.3, -7, -6, -4, -3, -2 \\log (2), -1, 1.8, 5, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 5, -10, 7, -6, -1, 1.8,))\nsnd = set((-4, 7, -3, -7, -9.3, -2*math.log(2), -10,))\nprint(fst.union(snd))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${625, 1, 1000, -100000, 1, 256}$.\n", - "Output Answer": [ - "$100 \\sqrt[6]{-1} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 625, 1, 1000, -100000, 1, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x^3-3.9 x^2+2.2 x+4.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$-5.04$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(4.*x**3-3.9*x**2+2.2*x+4.4))\n" - ], - "split": "dev" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{19}{3}, \\frac{10}{3}, \\frac{47}{3}, \\frac{13}{3}}$.\n", - "Output Answer": [ - "$\\frac{464360}{87357}$" - ], - "Output Program": [ - "import statistics\nvalues = (19/3), (10/3), (47/3), (13/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -9, 3 e, -2, 5.398} \\setminus {\\frac{10}{\\pi }, 2, -0.48, -9, -2, 5.6, 4, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-7, 5.398, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -9, 3*math.e, -2, 5.398,))\nsnd = set(((10/math.pi), 2, -0.48, -9, -2, 5.6, 4, -4*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, 2, 4, -\\frac{38}{5}, 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{38}{5}, 0, 2, 4, 6 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 2, 4, -(38/5), 6*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, 7, -4}$.\n", - "Output Answer": [ - "$\\frac{121}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 7, -4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{33}{4}, 5, 5.59, -\\sqrt{2}, 0} \\cup {-2 \\pi, 5, 0, -\\frac{33}{4}}$.\n", - "Output Answer": [ - "${-\\frac{33}{4}, -2 \\pi, -\\sqrt{2}, 0, 5, 5.59}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(33/4), 5, 5.59, -math.sqrt(2), 0,))\nsnd = set((-2*math.pi, 5, 0, -(33/4),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${14, -14, 12, -8, 1}$.\n", - "Output Answer": [ - "$149$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -14, 12, -8, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.077,0.072,0.186,0.071,0.179,0.158\\}$ and $\\{0.032,0.226,0.014,0.197,0.139,0.279\\}$.", - "Output Answer": [ - "$0.65$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.077, 0.072, 0.186, 0.071, 0.179, 0.158\ndistribution2 = 0.032, 0.226, 0.014, 0.197, 0.139, 0.279\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{2}, 0, -4 \\sqrt{5}, 4, -\\frac{33}{4}, 10, 3 \\sqrt{3}, -\\sqrt{3}, 9, -4 \\sqrt{3}}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(2), 0, -4*math.sqrt(5), 4, -(33/4), 10, 3*math.sqrt(3), -math.sqrt(3), 9, -4*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${8., 7.2, -\\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\sqrt{3}, 7.2, 8.}$" - ], - "Output Program": [ - "import math\n\nvalues = 8., 7.2, -math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, 8, -3, 9, 9, 8, 2, -3, -3, 8, -3, 8, 2, 8, 9, 2, 2, 9, 8, 8}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, 8, -3, 9, 9, 8, 2, -3, -3, 8, -3, 8, 2, 8, 9, 2, 2, 9, 8, 8\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.4 x-1.1$ where $x \\sim $ \\text{BetaDistribution}[1.3,1.8]\n", - "Output Answer": [ - "$-2.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 1.8)\nprint(E(-2.4*x-1.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, \\frac{11}{2}, \\frac{25}{2}}$.\n", - "Output Answer": [ - "$\\frac{13200}{1427}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, (11/2), (25/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, \\frac{22}{3}, 18}$.\n", - "Output Answer": [ - "$\\frac{297}{52}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, (22/3), 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.125,0.031,0.129,0.263,0.194,0.09,0.042,0.062,0.003\\}$ and $\\{0.149,0.145,0.034,0.087,0.069,0.212,0.051,0.082,0.087\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.125, 0.031, 0.129, 0.263, 0.194, 0.09, 0.042, 0.062, 0.003\ndistribution2 = 0.149, 0.145, 0.034, 0.087, 0.069, 0.212, 0.051, 0.082, 0.087\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -3 \\pi, -7, 7, \\frac{29}{3}, 3 \\log (2), 0, \\frac{17}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{29}{3}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -3*math.pi, -7, 7, (29/3), 3*math.log(2), 0, (17/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.04,0.127,0.039,0.087,0.279,0.115,0.119\\}$ and $\\{0.102,0.14,0.138,0.127,0.197,0.101,0.11\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.04, 0.127, 0.039, 0.087, 0.279, 0.115, 0.119\ndistribution2 = 0.102, 0.14, 0.138, 0.127, 0.197, 0.101, 0.11\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, -3 \\sqrt{5}, -3.1, 2, -\\frac{10}{3}, 3 \\sqrt{5}, -5, \\frac{5}{4}} \\setminus {2, 8, \\sqrt{5}, -5}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -\\frac{10}{3}, -3.1, \\frac{5}{4}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -3*math.sqrt(5), -3.1, 2, -(10/3), 3*math.sqrt(5), -5, (5/4),))\nsnd = set((2, 8, math.sqrt(5), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.6 x-0.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$-2.46$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(-2.6*x-0.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{1}{e}, -6, -1, -4, -7, -5, -2 \\sqrt{2}, 7, -2.1, -\\frac{13}{2}} \\cup {-\\frac{13}{2}, -2.1, -4, -8, 1, -\\frac{1}{e}, \\frac{9}{\\sqrt{2}}, -3}$.\n", - "Output Answer": [ - "${-8, -7, -\\frac{13}{2}, -6, -5, -4, -3, -2 \\sqrt{2}, -2.1, -1, -\\frac{1}{e}, 1, \\frac{9}{\\sqrt{2}}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(1/math.e), -6, -1, -4, -7, -5, -2*math.sqrt(2), 7, -2.1, -(13/2),))\nsnd = set((-(13/2), -2.1, -4, -8, 1, -(1/math.e), (9/(math.sqrt(2))), -3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, -2, -5, 10, 1296, 16}$.\n", - "Output Answer": [ - "$6 \\sqrt[3]{5} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, -2, -5, 10, 1296, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, 3, -10, 11, -13, 3}$.\n", - "Output Answer": [ - "$\\frac{1414}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 3, -10, 11, -13, 3\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.256,0.119,0.251\\}$ and $\\{0.405,0.174,0.026\\}$.", - "Output Answer": [ - "$0.62$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.256, 0.119, 0.251\ndistribution2 = 0.405, 0.174, 0.026\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-1, -4, 3, 0, -7, 5, 7, 1} \\cap {4, 0, -7, -3, 3, 10, -4}$.\n", - "Output Answer": [ - "${-7, -4, 0, 3}$" - ], - "Output Program": [ - "fst = set((-1, -4, 3, 0, -7, 5, 7, 1,))\nsnd = set((4, 0, -7, -3, 3, 10, -4,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, -14}$.\n", - "Output Answer": [ - "$\\frac{29}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -14\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{5}, -3, 2.233, e, 6, 5 \\sqrt{2}} \\setminus {7, -\\frac{1}{\\sqrt{2}}, 6, 4}$.\n", - "Output Answer": [ - "${-3, 2.233, e, 5 \\sqrt{2}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), -3, 2.233, math.e, 6, 5*math.sqrt(2),))\nsnd = set((7, -(1/(math.sqrt(2))), 6, 4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.065,0.068,0.096,0.049,0.288\\}$ and $\\{0.09,0.063,0.162,0.431,0.121\\}$.", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.065, 0.068, 0.096, 0.049, 0.288\ndistribution2 = 0.09, 0.063, 0.162, 0.431, 0.121\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\pi, -\\frac{2}{3}, -7, -\\frac{13}{\\sqrt{3}}, -2, -2, 4 \\sqrt{3}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.pi, -(2/3), -7, -(13/(math.sqrt(3))), -2, -2, 4*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.094,0.273,0.189,0.231\\}$ and $\\{0.213,0.124,0.166,0.166\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.094, 0.273, 0.189, 0.231\ndistribution2 = 0.213, 0.124, 0.166, 0.166\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.175,0.121,0.298,0.065,0.083,0.056,0.071,0.038\\}$ and $\\{0.105,0.185,0.187,0.077,0.086,0.036,0.158,0.102\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.175, 0.121, 0.298, 0.065, 0.083, 0.056, 0.071, 0.038\ndistribution2 = 0.105, 0.185, 0.187, 0.077, 0.086, 0.036, 0.158, 0.102\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 8, 7, -4, 8, 6, 8, 6, 8, -4, 6, 7, 8, 6, 6, -4, -4, -4, 8, -4, 6, -4, 6, 7, 6, 7, 7, 8, 7}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 8, 7, -4, 8, 6, 8, 6, 8, -4, 6, 7, 8, 6, 6, -4, -4, -4, 8, -4, 6, -4, 6, 7, 6, 7, 7, 8, 7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5 \\sqrt{2}, -5, -\\frac{3}{\\sqrt{5}}, -1, 0, -\\frac{9}{2}, -10, -3, -2, -\\frac{5}{e}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-\\frac{5}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5*math.sqrt(2), -5, -(3/(math.sqrt(5))), -1, 0, -(9/2), -10, -3, -2, -(5/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 1, -729, 10000, -5}$.\n", - "Output Answer": [ - "$45\\ 6^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 1, -729, 10000, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x-2.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$-2.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(4.6*x-2.5))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-e, \\frac{1}{e}, 9.9, -\\frac{2}{e}} \\cup {-e, -5.8, \\frac{1}{e}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -5.8, -e, -\\frac{2}{e}, \\frac{1}{e}, 9.9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.e, (1/math.e), 9.9, -(2/math.e),))\nsnd = set((-math.e, -5.8, (1/math.e), -6*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 7, 13}$.\n", - "Output Answer": [ - "$\\frac{1365}{191}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 7, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4, 3, -6, \\sqrt{2}, 7, -2 e, 4, \\frac{6}{e}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\sqrt{2}+\\frac{6}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, 3, -6, math.sqrt(2), 7, -2*math.e, 4, (6/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{32}{3}, \\frac{19}{3}}$.\n", - "Output Answer": [ - "$\\frac{1216}{153}$" - ], - "Output Program": [ - "import statistics\nvalues = (32/3), (19/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, 8, -12, -4, -4}$.\n", - "Output Answer": [ - "$2 \\sqrt{14}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 8, -12, -4, -4\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -\\frac{7}{\\sqrt{2}}, -\\frac{5}{\\sqrt{\\pi }}, 6, \\frac{17}{e}, 4 \\sqrt{2}, 0, \\frac{20}{3}, -\\frac{1}{\\sqrt{\\pi }}, 9, -\\frac{5}{\\pi }}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -(7/(math.sqrt(2))), -(5/(math.sqrt(math.pi))), 6, (17/math.e), 4*math.sqrt(2), 0, (20/3), -(1/(math.sqrt(math.pi))), 9, -(5/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.343,0.23,0.131\\}$ and $\\{0.005,0.629,0.155\\}$.", - "Output Answer": [ - "$1.81$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.343, 0.23, 0.131\ndistribution2 = 0.005, 0.629, 0.155\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{14}{5}, 7, 8, -2 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{21}{10}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(14/5), 7, 8, -2*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{10}{\\sqrt{\\pi }}, -\\frac{26}{\\pi }, 3, 9} \\setminus {9, -\\frac{9}{\\pi }, -2, -8, -\\frac{10}{\\sqrt{\\pi }}, 3}$.\n", - "Output Answer": [ - "${-\\frac{26}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(10/(math.sqrt(math.pi))), -(26/math.pi), 3, 9,))\nsnd = set((9, -(9/math.pi), -2, -8, -(10/(math.sqrt(math.pi))), 3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-7, 8, -1, -\\frac{3}{\\sqrt{\\pi }}, e, 0, -3, \\frac{9}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, 8, -1, -(3/(math.sqrt(math.pi))), math.e, 0, -3, (9/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, -1, 4, 8, 1, 0} \\cap {-4, -8, 0, 9, -9, 1, 4}$.\n", - "Output Answer": [ - "${-8, 0, 1, 4}$" - ], - "Output Program": [ - "fst = set((-8, -1, 4, 8, 1, 0,))\nsnd = set((-4, -8, 0, 9, -9, 1, 4,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, -32, 4096, 1, -5}$.\n", - "Output Answer": [ - "$80 \\sqrt[5]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, -32, 4096, 1, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 3, -5, 4 \\sqrt{3}, 7, -3} \\cup {8, 10, -5 \\sqrt{2}, 7, -5, 4 \\sqrt{3}, -3}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -5, -3, -1, 3, 4 \\sqrt{3}, 7, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 3, -5, 4*math.sqrt(3), 7, -3,))\nsnd = set((8, 10, -5*math.sqrt(2), 7, -5, 4*math.sqrt(3), -3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{47}{5}, \\frac{32}{5}, \\frac{32}{5}, -\\frac{31}{5}, -\\frac{31}{5}, \\frac{47}{5}, \\frac{46}{5}, \\frac{32}{5}, \\frac{32}{5}, -\\frac{48}{5}, -\\frac{3}{5}, \\frac{32}{5}, \\frac{6}{5}, -\\frac{31}{5}, -\\frac{3}{5}, \\frac{6}{5}, \\frac{47}{5}, \\frac{46}{5}, \\frac{47}{5}, -\\frac{48}{5}, \\frac{46}{5}, -\\frac{3}{5}, \\frac{32}{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{32}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (47/5), (32/5), (32/5), -(31/5), -(31/5), (47/5), (46/5), (32/5), (32/5), -(48/5), -(3/5), (32/5), (6/5), -(31/5), -(3/5), (6/5), (47/5), (46/5), (47/5), -(48/5), (46/5), -(3/5), (32/5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${256, 512, 2, -343}$.\n", - "Output Answer": [ - "$(16+16 i) 7^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 256, 512, 2, -343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${9, -\\frac{7}{4}, 0.551, 7, 7.5} \\setminus {-10, -\\frac{7}{4}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${0.551, 7, 7.5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -(7/4), 0.551, 7, 7.5,))\nsnd = set((-10, -(7/4), -5*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, -4, 7, -3}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{659}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -4, 7, -3\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x^2+2.8 x+1.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.5]\n", - "Output Answer": [ - "$34.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.5)\nprint(E(3.4*x**2+2.8*x+1.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.324,0.129,0.06,0.243,0.174,0.023\\}$ and $\\{0.162,0.027,0.154,0.136,0.165,0.179\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.324, 0.129, 0.06, 0.243, 0.174, 0.023\ndistribution2 = 0.162, 0.027, 0.154, 0.136, 0.165, 0.179\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-3 \\sqrt{2}, -2, 3 e, -10, -6} \\setminus {-10, 3 e, -3 \\sqrt{2}, 8, -6}$.\n", - "Output Answer": [ - "${-2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(2), -2, 3*math.e, -10, -6,))\nsnd = set((-10, 3*math.e, -3*math.sqrt(2), 8, -6,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, -13}$.\n", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -13\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.002,0.488,0.068\\}$ and $\\{0.09,0.338,0.153\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.002, 0.488, 0.068\ndistribution2 = 0.09, 0.338, 0.153\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{53}{7}, 6, \\frac{15}{2}, 7, -\\frac{24}{\\pi }, 2 e, 8, 2 \\sqrt{5}, -3, 6, -1, 2 \\pi}$.\n", - "Output Answer": [ - "$8+\\frac{24}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -(53/7), 6, (15/2), 7, -(24/math.pi), 2*math.e, 8, 2*math.sqrt(5), -3, 6, -1, 2*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${10, 4, -11}$.\n", - "Output Answer": [ - "$117$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 4, -11\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${9.1, \\sqrt{3}, -1, 3, 2 \\sqrt{5}, \\frac{65}{7}} \\cup {-1, \\frac{14}{\\sqrt{3}}, 9.1, -9, 6, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-9, -1, \\sqrt{3}, 3, 2 \\sqrt{5}, 6, \\frac{14}{\\sqrt{3}}, 9.1, \\frac{65}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((9.1, math.sqrt(3), -1, 3, 2*math.sqrt(5), (65/7),))\nsnd = set((-1, (14/(math.sqrt(3))), 9.1, -9, 6, 2*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, -2, 1}$.\n", - "Output Answer": [ - "$10 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, -2, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${7, -6, -13, -9}$.\n", - "Output Answer": [ - "$\\frac{899}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -6, -13, -9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x+1.4$ where $x \\sim $ \\text{BetaDistribution}[1.3,0.1]\n", - "Output Answer": [ - "$1.96$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 0.1)\nprint(E(0.6*x+1.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 2, 5, 9}$.\n", - "Output Answer": [ - "$\\frac{180}{41}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 2, 5, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute $\\binom{7}{6}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import math\n\nprint(math.comb(7,6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{2}, -2 \\sqrt{2}, -6 \\sqrt{2}, -2 \\sqrt{2}, 0, 5 \\sqrt{2}, -2 \\sqrt{2}, 2 \\sqrt{2}, -6 \\sqrt{2}, 2 \\sqrt{2}, 2 \\sqrt{2}, 2 \\sqrt{2}, 5 \\sqrt{2}, -6 \\sqrt{2}, 2 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, 2 \\sqrt{2}, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(2), -2*math.sqrt(2), -6*math.sqrt(2), -2*math.sqrt(2), 0, 5*math.sqrt(2), -2*math.sqrt(2), 2*math.sqrt(2), -6*math.sqrt(2), 2*math.sqrt(2), 2*math.sqrt(2), 2*math.sqrt(2), 5*math.sqrt(2), -6*math.sqrt(2), 2*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), 2*math.sqrt(2), 2*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^2-4.3 x+0.5$ where $x \\sim $ \\text{NormalDistribution}[-1.,1.]\n", - "Output Answer": [ - "$5.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1., 1.)\nprint(E(0.4*x**2-4.3*x+0.5))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\sqrt{2}, 4, -\\frac{4}{\\sqrt{3}}, 8, -3 \\sqrt{2}, 5, 2 \\sqrt{2}} \\cup {2 \\sqrt{2}, 8, 4, -3 \\sqrt{2}, -2 \\sqrt{2}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, -2 \\sqrt{2}, -\\frac{4}{\\sqrt{3}}, 2 \\sqrt{2}, 4, 5, 4 \\sqrt{3}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(2), 4, -(4/(math.sqrt(3))), 8, -3*math.sqrt(2), 5, 2*math.sqrt(2),))\nsnd = set((2*math.sqrt(2), 8, 4, -3*math.sqrt(2), -2*math.sqrt(2), 4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2 e, 6, \\frac{10}{\\sqrt{3}}, 4, -6} \\cup {\\frac{10}{\\sqrt{3}}, -\\frac{11}{2}, 5, 6, -2 e}$.\n", - "Output Answer": [ - "${-6, -\\frac{11}{2}, -2 e, 4, 5, 2 e, \\frac{10}{\\sqrt{3}}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.e, 6, (10/(math.sqrt(3))), 4, -6,))\nsnd = set(((10/(math.sqrt(3))), -(11/2), 5, 6, -2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{9}{\\sqrt{5}}, \\frac{44}{5}, -2 \\sqrt{5}} \\setminus {1, 3 \\sqrt{5}, 3, \\frac{44}{5}, \\frac{16}{\\sqrt{5}}, 3 \\log (2), \\frac{8}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, \\frac{9}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((9/(math.sqrt(5))), (44/5), -2*math.sqrt(5),))\nsnd = set((1, 3*math.sqrt(5), 3, (44/5), (16/(math.sqrt(5))), 3*math.log(2), (8/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x^2-4.9 x-4.3$ where $x \\sim $ \\text{NormalDistribution}[-1.,1.6]\n", - "Output Answer": [ - "$14.84$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1., 1.6)\nprint(E(4.*x**2-4.9*x-4.3))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\sqrt{2}, -\\sqrt{5}} \\setminus {0, 3 \\sqrt{5}, -2, -7.1}$.\n", - "Output Answer": [ - "${-\\sqrt{5}, \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, math.sqrt(2), -math.sqrt(5),))\nsnd = set((0, 3*math.sqrt(5), -2, -7.1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, -14, 10, 12, 3, 6}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{133}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -14, 10, 12, 3, 6\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{3}{\\sqrt{2}}, \\frac{20}{\\pi }, -2, e, -10, \\frac{16}{\\sqrt{\\pi }}, \\frac{11}{\\sqrt{5}}, 0, 7, 6, 5, \\frac{19}{2}, -7, 0, 3 e}$.", - "Output Answer": [ - "$\\frac{11}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (3/(math.sqrt(2))), (20/math.pi), -2, math.e, -10, (16/(math.sqrt(math.pi))), (11/(math.sqrt(5))), 0, 7, 6, 5, (19/2), -7, 0, 3*math.e\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.5 x-4.$ where $x \\sim $ \\text{NormalDistribution}[-0.8,2.5]\n", - "Output Answer": [ - "$-2.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 2.5)\nprint(E(-2.5*x-4.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, \\sqrt{5}, 9, -7, -\\sqrt{2}, \\frac{13}{\\sqrt{\\pi }}, 8, \\frac{31}{\\pi }, -\\frac{31}{4}, -5 \\log (2), -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+\\frac{31}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 2, math.sqrt(5), 9, -7, -math.sqrt(2), (13/(math.sqrt(math.pi))), 8, (31/math.pi), -(31/4), -5*math.log(2), -6*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-e, \\frac{12}{5}, -5, 0, 2 \\sqrt{3}} \\setminus {2 \\sqrt{3}, \\frac{12}{5}, -5, 7, -6, -e}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.e, (12/5), -5, 0, 2*math.sqrt(3),))\nsnd = set((2*math.sqrt(3), (12/5), -5, 7, -6, -math.e,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, -2, 7, 4, 9, -8, -3, 5}$.\n", - "Output Answer": [ - "$\\frac{13}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, -2, 7, 4, 9, -8, -3, 5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{60}{7}, -4, -\\frac{20}{3}, -8, -7, -3 \\sqrt{3}, -\\frac{4}{e}, 3, -\\pi, -11 \\log (2)} \\cup {-4, -\\frac{24}{7}, -7, -\\frac{11}{e}, -8, -11 \\log (2), -1, -3 \\sqrt{3}, \\frac{28}{3}, -\\pi}$.\n", - "Output Answer": [ - "${-8, -11 \\log (2), -7, -\\frac{20}{3}, -3 \\sqrt{3}, -\\frac{11}{e}, -4, -\\frac{24}{7}, -\\pi, -\\frac{4}{e}, -1, 3, \\frac{60}{7}, \\frac{28}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((60/7), -4, -(20/3), -8, -7, -3*math.sqrt(3), -(4/math.e), 3, -math.pi, -11*math.log(2),))\nsnd = set((-4, -(24/7), -7, -(11/math.e), -8, -11*math.log(2), -1, -3*math.sqrt(3), (28/3), -math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 9, 216, -5, -1, 1}$.\n", - "Output Answer": [ - "$\\sqrt{2} 3^{5/6} \\sqrt[6]{5} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 9, 216, -5, -1, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{8}{\\pi }, 7, -4, -\\pi, -6, 7, -7, \\frac{17}{2}, 1, -1, \\frac{6}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{31}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(8/math.pi), 7, -4, -math.pi, -6, 7, -7, (17/2), 1, -1, (6/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-27, 27, 1000}$.\n", - "Output Answer": [ - "$90 \\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = -27, 27, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, \\frac{9}{2}, \\frac{1}{\\sqrt{3}}, 1, \\frac{49}{5}}$.\n", - "Output Answer": [ - "$\\frac{69}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, (9/2), (1/(math.sqrt(3))), 1, (49/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 5, 256, -8, -3, 59049}$.\n", - "Output Answer": [ - "$18\\ 2^{5/6} \\sqrt[6]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 5, 256, -8, -3, 59049\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, -9, 1, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -9, 1, -5*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -1, -8, 2, 4} \\setminus {1, 2, -2 \\pi, -5}$.\n", - "Output Answer": [ - "${-8, -6, -1, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -1, -8, 2, 4,))\nsnd = set((1, 2, -2*math.pi, -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -1, -6, -3 \\sqrt{2}, -\\frac{1}{e}} \\cup {0.01, -9, \\frac{47}{5}, -3 \\sqrt{2}, -1, -\\frac{1}{e}}$.\n", - "Output Answer": [ - "${-9, -6, -3 \\sqrt{2}, -1, -\\frac{1}{e}, 0.01, \\frac{47}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -1, -6, -3*math.sqrt(2), -(1/math.e),))\nsnd = set((0.01, -9, (47/5), -3*math.sqrt(2), -1, -(1/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -2, -5, -7, -5, 7, -2, -7, -5, -5, -7, 7, -5, 7, 7, -2, -2, -2, -2, -2, -5, -7, -7, 7, -2, -2, -7, -5}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -2, -5, -7, -5, 7, -2, -7, -5, -5, -7, 7, -5, 7, 7, -2, -2, -2, -2, -2, -5, -7, -7, 7, -2, -2, -7, -5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{17}{\\sqrt{3}}, -\\frac{1}{\\sqrt{2}}, -5, -5 \\sqrt{2}, -6, \\frac{3}{e}, 3, 5 \\log (2), 2 e} \\setminus {-\\frac{10}{\\sqrt{3}}, \\frac{5}{\\sqrt{2}}, 0, 2 e, 3, -5 \\sqrt{2}, \\frac{3}{e}}$.\n", - "Output Answer": [ - "${-6, -5, -\\frac{1}{\\sqrt{2}}, 5 \\log (2), \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((17/(math.sqrt(3))), -(1/(math.sqrt(2))), -5, -5*math.sqrt(2), -6, (3/math.e), 3, 5*math.log(2), 2*math.e,))\nsnd = set((-(10/(math.sqrt(3))), (5/(math.sqrt(2))), 0, 2*math.e, 3, -5*math.sqrt(2), (3/math.e),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.538,0.021,0.37\\}$ and $\\{0.263,0.328,0.195\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.538, 0.021, 0.37\ndistribution2 = 0.263, 0.328, 0.195\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, 8, -9, 6561}$.\n", - "Output Answer": [ - "$18\\ 5^{3/4} \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, 8, -9, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.13,0.008,0.101,0.098,0.186,0.133,0.065,0.127,0.111\\}$ and $\\{0.026,0.286,0.045,0.049,0.031,0.227,0.044,0.039,0.086\\}$.", - "Output Answer": [ - "$0.69$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.13, 0.008, 0.101, 0.098, 0.186, 0.133, 0.065, 0.127, 0.111\ndistribution2 = 0.026, 0.286, 0.045, 0.049, 0.031, 0.227, 0.044, 0.039, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\sqrt{5}, -2 \\pi, 8, 7, -2, \\frac{33}{5}} \\cup {-2 \\pi, -3, 2, 8, 7, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -2 \\pi, -3, -2, 2, 2 \\sqrt{5}, \\frac{33}{5}, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(5), -2*math.pi, 8, 7, -2, (33/5),))\nsnd = set((-2*math.pi, -3, 2, 8, 7, -4*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\pi, 3 \\pi}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.pi, 3*math.pi\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 7, -9, 7, -1, 7, 7, -7, -7, 7, -1, -1, 7, 7, 7, -1, 7, -1, -7, -9, -9, -1, -9, -7, -1, -1, -7, -9}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 7, -9, 7, -1, 7, 7, -7, -7, 7, -1, -1, 7, 7, 7, -1, 7, -1, -7, -9, -9, -1, -9, -7, -1, -1, -7, -9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.046,0.162,0.049,0.162,0.077,0.021,0.109,0.166,0.042,0.133\\}$ and $\\{0.039,0.051,0.097,0.064,0.034,0.064,0.078,0.197,0.127,0.166\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.046, 0.162, 0.049, 0.162, 0.077, 0.021, 0.109, 0.166, 0.042, 0.133\ndistribution2 = 0.039, 0.051, 0.097, 0.064, 0.034, 0.064, 0.078, 0.197, 0.127, 0.166\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, 14, -8, 3}$.\n", - "Output Answer": [ - "$\\frac{5 \\sqrt{\\frac{59}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 14, -8, 3\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, -\\frac{10}{\\sqrt{\\pi }}, 2 \\sqrt{5}, -9, -9, -2, -2, -0.9}$.\n", - "Output Answer": [ - "${-9, -9, -\\frac{10}{\\sqrt{\\pi }}, -2, -2, -0.9, 2 \\sqrt{5}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -(10/(math.sqrt(math.pi))), 2*math.sqrt(5), -9, -9, -2, -2, -0.9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{2}{3}, \\frac{20}{3}, 8, 2 \\pi, -10, 10, -4}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -(2/3), (20/3), 8, 2*math.pi, -10, 10, -4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.067,0.151,0.117,0.089,0.035,0.232,0.03,0.22\\}$ and $\\{0.038,0.091,0.109,0.043,0.139,0.24,0.079,0.083\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.067, 0.151, 0.117, 0.089, 0.035, 0.232, 0.03, 0.22\ndistribution2 = 0.038, 0.091, 0.109, 0.043, 0.139, 0.24, 0.079, 0.083\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-10, 10, -9, 3}$.\n", - "Output Answer": [ - "${-10, -9, 3, 10}$" - ], - "Output Program": [ - "values = -10, 10, -9, 3\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $0.22 < 3.2 x-1.5 < 3.7$ where $x \\sim $ \\text{ExponentialDistribution}[1.2].", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(P((0.22 < 3.2*x-1.5) & (3.2*x-1.5 < 3.7)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-3, \\frac{5}{2}, 1}$.\n", - "Output Answer": [ - "${-3, 1, \\frac{5}{2}}$" - ], - "Output Program": [ - "values = -3, (5/2), 1\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -7, -8}$.\n", - "Output Answer": [ - "$-\\frac{11}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -7, -8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, \\frac{31}{4}, 5, 8, 9, 2, 9 \\log (2), 5 \\sqrt{3}, 3 e, 5, 0, -10, \\frac{33}{4}, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -2, (31/4), 5, 8, 9, 2, 9*math.log(2), 5*math.sqrt(3), 3*math.e, 5, 0, -10, (33/4), 2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 0, 2, 6 \\sqrt{2}, 2 \\pi, -6} \\setminus {-9, 2, 6 \\sqrt{2}, -3 \\log (2), -5, 2 \\pi}$.\n", - "Output Answer": [ - "${-6, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 0, 2, 6*math.sqrt(2), 2*math.pi, -6,))\nsnd = set((-9, 2, 6*math.sqrt(2), -3*math.log(2), -5, 2*math.pi,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.9 x-4.7$ where $x \\sim $ \\text{PoissonDistribution}[2.6]\n", - "Output Answer": [ - "$-12.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.6)\nprint(E(-2.9*x-4.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -8, -8, 8, -8, 1, 1, 1, -8, -8, 8, -8, 8, 9, 8, 9, 8, 9, 1, -8, 8, 9, 8, -8, 1, 8, 8, -8, 9}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -8, -8, 8, -8, 1, 1, 1, -8, -8, 8, -8, 8, 9, 8, 9, 8, 9, 1, -8, 8, 9, 8, -8, 1, 8, 8, -8, 9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 2, 15}$.\n", - "Output Answer": [ - "$\\frac{9}{2}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 2, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.043,0.245,0.092,0.1,0.134,0.071,0.082,0.156\\}$ and $\\{0.029,0.345,0.112,0.039,0.012,0.157,0.11,0.15\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.043, 0.245, 0.092, 0.1, 0.134, 0.071, 0.082, 0.156\ndistribution2 = 0.029, 0.345, 0.112, 0.039, 0.012, 0.157, 0.11, 0.15\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.378,0.105,0.017,0.059,0.03,0.04,0.062,0.024,0.155,0.13\\}$ and $\\{0.074,0.069,0.073,0.132,0.083,0.03,0.133,0.081,0.16,0.052\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.378, 0.105, 0.017, 0.059, 0.03, 0.04, 0.062, 0.024, 0.155, 0.13\ndistribution2 = 0.074, 0.069, 0.073, 0.132, 0.083, 0.03, 0.133, 0.081, 0.16, 0.052\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${6, -8, \\frac{6}{e}, 2, 5, -\\frac{2}{\\sqrt{3}}} \\cup {2, \\frac{25}{3}, 8, -1, -4, 6, -\\frac{2}{\\sqrt{3}}, \\frac{6}{e}}$.\n", - "Output Answer": [ - "${-8, -4, -\\frac{2}{\\sqrt{3}}, -1, 2, \\frac{6}{e}, 5, 6, 8, \\frac{25}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -8, (6/math.e), 2, 5, -(2/(math.sqrt(3))),))\nsnd = set((2, (25/3), 8, -1, -4, 6, -(2/(math.sqrt(3))), (6/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${512, 343, 1}$.\n", - "Output Answer": [ - "$56$" - ], - "Output Program": [ - "import math\n\nvalues = 512, 343, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{11}{\\pi }, -3, -4, \\sqrt{2}, 8, 3, -5, -\\sqrt{2}}$.\n", - "Output Answer": [ - "${-5, -4, -3, -\\sqrt{2}, \\sqrt{2}, 3, \\frac{11}{\\pi }, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = (11/math.pi), -3, -4, math.sqrt(2), 8, 3, -5, -math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-14 \\log (2), 6 \\log (2), 8 \\log (2), 14 \\log (2), 11 \\log (2), -7 \\log (2), -7 \\log (2), 14 \\log (2), -12 \\log (2), -14 \\log (2), 14 \\log (2), -14 \\log (2), 11 \\log (2), 6 \\log (2), -14 \\log (2), 11 \\log (2), -12 \\log (2), -7 \\log (2), -14 \\log (2), 6 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-14 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -14*math.log(2), 6*math.log(2), 8*math.log(2), 14*math.log(2), 11*math.log(2), -7*math.log(2), -7*math.log(2), 14*math.log(2), -12*math.log(2), -14*math.log(2), 14*math.log(2), -14*math.log(2), 11*math.log(2), 6*math.log(2), -14*math.log(2), 11*math.log(2), -12*math.log(2), -7*math.log(2), -14*math.log(2), 6*math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.3 x^2+4.1 x+3.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-6.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-3.3*x**2+4.1*x+3.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -9, -6, 9, -7, 9, 9, -7, -5, -7, -6, -5, -10, -10, -7, -9, -5, -7, -9, 9, -10, -6, -9, -6, -10, -7}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -9, -6, 9, -7, 9, 9, -7, -5, -7, -6, -5, -10, -10, -7, -9, -5, -7, -9, 9, -10, -6, -9, -6, -10, -7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, 4, -4, 6, 4, -1}$.\n", - "Output Answer": [ - "$-\\frac{1}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, 4, -4, 6, 4, -1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 5, 19, 12}$.\n", - "Output Answer": [ - "$\\frac{4560}{611}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 5, 19, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 0, -5} \\setminus {0, 5}$.\n", - "Output Answer": [ - "${-6, -5}$" - ], - "Output Program": [ - "fst = set((-6, 0, -5,))\nsnd = set((0, 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${7, -2 \\log (2), -1, \\frac{7}{\\sqrt{2}}, 0.794, 0, -4} \\cup {7, -\\frac{4}{5}, -2 e, -\\sqrt{5}, 8, \\frac{7}{\\sqrt{2}}, 0.794, -\\pi, \\frac{19}{2}, -\\frac{9}{\\pi }, -4, -2 \\log (2), -\\sqrt{2}}$.\n", - "Output Answer": [ - "${-2 e, -4, -\\pi, -\\frac{9}{\\pi }, -\\sqrt{5}, -\\sqrt{2}, -2 \\log (2), -1, -\\frac{4}{5}, 0, 0.794, \\frac{7}{\\sqrt{2}}, 7, 8, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -2*math.log(2), -1, (7/(math.sqrt(2))), 0.794, 0, -4,))\nsnd = set((7, -(4/5), -2*math.e, -math.sqrt(5), 8, (7/(math.sqrt(2))), 0.794, -math.pi, (19/2), -(9/math.pi), -4, -2*math.log(2), -math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{7}{3}, 3, -1, \\frac{8}{e}, 1, -7, 2, \\sqrt{3}, -5, -1, 0, 6 \\sqrt{3}, \\pi, -8, -3 \\sqrt{5}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(7/3), 3, -1, (8/math.e), 1, -7, 2, math.sqrt(3), -5, -1, 0, 6*math.sqrt(3), math.pi, -8, -3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\log (2), -7, 4, 5 \\sqrt{3}, 5} \\setminus {-2 \\sqrt{3}, -5 \\log (2), 6 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, 5, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, 4 \\log (2), 4, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.log(2), -7, 4, 5*math.sqrt(3), 5,))\nsnd = set((-2*math.sqrt(3), -5*math.log(2), 6*math.sqrt(2), -(3/(math.sqrt(2))), 5, 4*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{32}{7}, -\\frac{45}{7}, \\frac{32}{7}, \\frac{62}{7}, -\\frac{45}{7}, \\frac{62}{7}, \\frac{8}{7}, -\\frac{59}{7}, \\frac{4}{7}, \\frac{3}{7}, \\frac{32}{7}, -\\frac{45}{7}, \\frac{32}{7}, \\frac{62}{7}, \\frac{62}{7}, \\frac{3}{7}, \\frac{41}{7}, \\frac{32}{7}, -\\frac{59}{7}, \\frac{62}{7}, \\frac{8}{7}, \\frac{8}{7}, -\\frac{45}{7}, -\\frac{45}{7}, \\frac{41}{7}, \\frac{41}{7}, \\frac{4}{7}, \\frac{8}{7}, \\frac{41}{7}, \\frac{4}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{32}{7},-\\frac{45}{7},\\frac{62}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (32/7), -(45/7), (32/7), (62/7), -(45/7), (62/7), (8/7), -(59/7), (4/7), (3/7), (32/7), -(45/7), (32/7), (62/7), (62/7), (3/7), (41/7), (32/7), -(59/7), (62/7), (8/7), (8/7), -(45/7), -(45/7), (41/7), (41/7), (4/7), (8/7), (41/7), (4/7)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-5.67 < 4. x-4.6 < 3.17$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.].", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(P((-5.67 < 4.*x-4.6) & (4.*x-4.6 < 3.17)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{3}, -\\frac{41}{7}, \\pi, 3, 4, -8, \\frac{3}{\\sqrt{\\pi }}, 1}$.\n", - "Output Answer": [ - "$8+4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(3), -(41/7), math.pi, 3, 4, -8, (3/(math.sqrt(math.pi))), 1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x^2+4.3 x+2.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.5]\n", - "Output Answer": [ - "$2.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.5)\nprint(E(1.*x**2+4.3*x+2.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9 \\log (2), 0, 6, -\\frac{4}{\\sqrt{3}}, 6, -\\frac{15}{e}, \\frac{3}{\\sqrt{2}}, -4, 9}$.\n", - "Output Answer": [ - "$9+\\frac{15}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 9*math.log(2), 0, 6, -(4/(math.sqrt(3))), 6, -(15/math.e), (3/(math.sqrt(2))), -4, 9\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -4, \\frac{7}{\\sqrt{2}}, 7}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -4, (7/(math.sqrt(2))), 7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.23,0.077,0.187,0.181,0.09\\}$ and $\\{0.102,0.152,0.096,0.285,0.237\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.23, 0.077, 0.187, 0.181, 0.09\ndistribution2 = 0.102, 0.152, 0.096, 0.285, 0.237\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{2}, 1, 11, 2}$.\n", - "Output Answer": [ - "$\\frac{3256}{1339}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/2), 1, 11, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${216, -8, 4, -6, 81}$.\n", - "Output Answer": [ - "$6\\ 2^{4/5} 3^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 216, -8, 4, -6, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.7 x+0.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.]\n", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(E(1.7*x+0.5))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -\\frac{1}{\\sqrt{3}}, 7} \\cup {-\\frac{1}{\\sqrt{3}}, -6, 7, 3}$.\n", - "Output Answer": [ - "${-6, -3, -\\frac{1}{\\sqrt{3}}, 3, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -(1/(math.sqrt(3))), 7,))\nsnd = set((-(1/(math.sqrt(3))), -6, 7, 3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, \\frac{25}{\\pi }}$.", - "Output Answer": [ - "$\\frac{25}{2 \\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, (25/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.175,0.388\\}$ and $\\{0.144,0.396,0.389\\}$.", - "Output Answer": [ - "$0.07$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.175, 0.388\ndistribution2 = 0.144, 0.396, 0.389\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, 10, -\\frac{12}{e}, 4, \\sqrt{5}, -8, 10, -5}$.\n", - "Output Answer": [ - "${-8, -5, -\\frac{12}{e}, \\sqrt{5}, 4, 9, 10, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 10, -(12/math.e), 4, math.sqrt(5), -8, 10, -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{14}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, -2 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{19}{\\sqrt{5}}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, \\frac{14}{\\sqrt{5}}, -2 \\sqrt{5}, -2 \\sqrt{5}, -2 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, -2 \\sqrt{5}, \\frac{14}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{19}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{14}{\\sqrt{5}},-2 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (14/(math.sqrt(5))), -(19/(math.sqrt(5))), -2*math.sqrt(5), (14/(math.sqrt(5))), (14/(math.sqrt(5))), 3*math.sqrt(5), -(19/(math.sqrt(5))), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), (14/(math.sqrt(5))), (14/(math.sqrt(5))), (14/(math.sqrt(5))), -2*math.sqrt(5), -2*math.sqrt(5), -2*math.sqrt(5), (14/(math.sqrt(5))), -2*math.sqrt(5), (14/(math.sqrt(5))), 3*math.sqrt(5), -(19/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 9, 10, 10}$.\n", - "Output Answer": [ - "$\\frac{180}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 9, 10, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{10}{7}, 2}$.\n", - "Output Answer": [ - "$\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (10/7), 2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{33}{7}, \\frac{11}{7}, \\frac{3}{7}, -\\frac{39}{7}, \\frac{11}{7}, \\frac{11}{7}, -\\frac{39}{7}, -\\frac{39}{7}, \\frac{3}{7}, \\frac{11}{7}, \\frac{11}{7}, -\\frac{33}{7}, \\frac{3}{7}, \\frac{11}{7}, -\\frac{39}{7}, \\frac{11}{7}, -\\frac{39}{7}, -\\frac{33}{7}, -\\frac{39}{7}, -\\frac{33}{7}, \\frac{11}{7}, \\frac{3}{7}, -\\frac{39}{7}, \\frac{11}{7}, \\frac{11}{7}, \\frac{11}{7}, -\\frac{39}{7}, -\\frac{33}{7}, \\frac{11}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{11}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(33/7), (11/7), (3/7), -(39/7), (11/7), (11/7), -(39/7), -(39/7), (3/7), (11/7), (11/7), -(33/7), (3/7), (11/7), -(39/7), (11/7), -(39/7), -(33/7), -(39/7), -(33/7), (11/7), (3/7), -(39/7), (11/7), (11/7), (11/7), -(39/7), -(33/7), (11/7)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 9, -\\frac{42}{5}, -\\frac{42}{5}, -\\frac{41}{5}, 9, \\frac{32}{5}, -7, \\frac{32}{5}, -\\frac{41}{5}, -6, -7, -6, -\\frac{42}{5}, \\frac{32}{5}, 9, \\frac{32}{5}, -6, -\\frac{42}{5}, \\frac{32}{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{32}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 9, -(42/5), -(42/5), -(41/5), 9, (32/5), -7, (32/5), -(41/5), -6, -7, -6, -(42/5), (32/5), 9, (32/5), -6, -(42/5), (32/5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.115,0.088,0.001,0.006,0.584,0.033,0.003\\}$ and $\\{0.029,0.06,0.15,0.039,0.464,0.102,0.095\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.115, 0.088, 0.001, 0.006, 0.584, 0.033, 0.003\ndistribution2 = 0.029, 0.06, 0.15, 0.039, 0.464, 0.102, 0.095\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 5, 5, 1, 5, -8, 1, 5, -10, -5, -5, -10, 1, -5, -10, -4, -5, 5, -4, -10, -4, -8, -4, 1, -8, 1, -4, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 5, 5, 1, 5, -8, 1, 5, -10, -5, -5, -10, 1, -5, -10, -4, -5, 5, -4, -10, -4, -8, -4, 1, -8, 1, -4, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, 4096, 2, 625}$.\n", - "Output Answer": [ - "$(40+40 i) \\sqrt[4]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 4096, 2, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-2, 100, -1, 1296, 49}$.\n", - "Output Answer": [ - "$2\\ 3^{4/5} 70^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 100, -1, 1296, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-7, 10, -10, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{458}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, 10, -10, 15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-0.24 < 0.1 x^2-1.3 x+3.3 < 1.35$ where $x \\sim $ \\text{NormalDistribution}[1.3,2.4].", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.3, 2.4)\nprint(P((-0.24 < 0.1*x**2-1.3*x+3.3) & (0.1*x**2-1.3*x+3.3 < 1.35)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{2}, 2, 11, 15}$.\n", - "Output Answer": [ - "$\\frac{48840}{8689}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/2), 2, 11, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${10, 8, -1}$.", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 8, -1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -\\frac{11}{\\pi }, 3 \\pi, \\frac{1}{\\sqrt{3}}, 2 \\sqrt{3}, -8, -4} \\setminus {\\frac{1}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{8}{\\pi }, 8, -6, -3 \\pi}$.\n", - "Output Answer": [ - "${-9, -8, -4, -\\frac{11}{\\pi }, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -(11/math.pi), 3*math.pi, (1/(math.sqrt(3))), 2*math.sqrt(3), -8, -4,))\nsnd = set(((1/(math.sqrt(3))), 2*math.sqrt(3), -(8/math.pi), 8, -6, -3*math.pi,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{14}{5}, -\\frac{21}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{14}{5}+\\frac{21}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (14/5), -(21/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${3, 1, 11 \\log (2)}$.\n", - "Output Answer": [ - "${1, 3, 11 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 1, 11*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{2}{\\sqrt{3}}, 2 \\sqrt{2}, \\frac{10}{\\pi }, 7}$.\n", - "Output Answer": [ - "${-\\frac{2}{\\sqrt{3}}, 2 \\sqrt{2}, \\frac{10}{\\pi }, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(2/(math.sqrt(3))), 2*math.sqrt(2), (10/math.pi), 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{13}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -2 \\sqrt{2}, 2 \\sqrt{2}, 2 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, 2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, 2 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, 2 \\sqrt{2}, -2 \\sqrt{2}, -2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, 2 \\sqrt{2}, 2 \\sqrt{2}, \\frac{13}{\\sqrt{2}}, \\frac{13}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, -2 \\sqrt{2}, \\frac{13}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (13/(math.sqrt(2))), (3/(math.sqrt(2))), -2*math.sqrt(2), 2*math.sqrt(2), 2*math.sqrt(2), (3/(math.sqrt(2))), 2*math.sqrt(2), (1/(math.sqrt(2))), 2*math.sqrt(2), (13/(math.sqrt(2))), 2*math.sqrt(2), -2*math.sqrt(2), -2*math.sqrt(2), (1/(math.sqrt(2))), 2*math.sqrt(2), 2*math.sqrt(2), (13/(math.sqrt(2))), (13/(math.sqrt(2))), (3/(math.sqrt(2))), (1/(math.sqrt(2))), -2*math.sqrt(2), (13/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 1, 4, -6, -9, -8, -5, 3}$.\n", - "Output Answer": [ - "$-\\frac{23}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 1, 4, -6, -9, -8, -5, 3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.093,0.048,0.153,0.167,0.094,0.023,0.018,0.142,0.085,0.097\\}$ and $\\{0.289,0.081,0.031,0.072,0.032,0.134,0.163,0.032,0.072,0.044\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.093, 0.048, 0.153, 0.167, 0.094, 0.023, 0.018, 0.142, 0.085, 0.097\ndistribution2 = 0.289, 0.081, 0.031, 0.072, 0.032, 0.134, 0.163, 0.032, 0.072, 0.044\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.215,0.279,0.249,0.183\\}$ and $\\{0.128,0.089,0.352,0.199\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.215, 0.279, 0.249, 0.183\ndistribution2 = 0.128, 0.089, 0.352, 0.199\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{2}{\\sqrt{3}}, -3 \\sqrt{3}, 4, 3 \\sqrt{5}, 9}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(2/(math.sqrt(3))), -3*math.sqrt(3), 4, 3*math.sqrt(5), 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\sqrt{2}, -1, -6, \\sqrt{2}, -6 \\sqrt{3}, -7, -2, -4, 4} \\cup {0, 1, -3 \\sqrt{3}, -4, 2 \\sqrt{2}, -\\frac{9}{2}, -2, -1}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -7, -6, -3 \\sqrt{3}, -\\frac{9}{2}, -4, -2, -1, 0, 1, \\sqrt{2}, 2 \\sqrt{2}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(2), -1, -6, math.sqrt(2), -6*math.sqrt(3), -7, -2, -4, 4,))\nsnd = set((0, 1, -3*math.sqrt(3), -4, 2*math.sqrt(2), -(9/2), -2, -1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, \\frac{14}{\\pi }, 5}$.\n", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import math\n\nvalues = -3, (14/math.pi), 5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, -9, -6, -12, 1}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{257}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -9, -6, -12, 1\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, \\frac{22}{e}, -1, 0, -4} \\setminus {\\frac{22}{e}, 1, \\frac{2}{3}, \\frac{16}{5}}$.\n", - "Output Answer": [ - "${-4, -2, -1, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, (22/math.e), -1, 0, -4,))\nsnd = set(((22/math.e), 1, (2/3), (16/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -4 \\sqrt{5}, -\\frac{29}{3}, \\frac{46}{5}, -8, -8, 3 \\pi, -\\frac{43}{5}, 3 \\sqrt{3}, 7, -\\frac{25}{4}, -\\frac{5}{\\sqrt{\\pi }}, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{29}{3}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -4*math.sqrt(5), -(29/3), (46/5), -8, -8, 3*math.pi, -(43/5), 3*math.sqrt(3), 7, -(25/4), -(5/(math.sqrt(math.pi))), -2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, -4 \\sqrt{3}, \\frac{18}{7}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, \\frac{18}{7}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -4*math.sqrt(3), (18/7)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8, 3, -7 \\log (2), 7, 6, 5, 1.99} \\cup {8, 3, 7, 5, 4 \\sqrt{5}, -7.825, 6}$.\n", - "Output Answer": [ - "${-7.825, -7 \\log (2), 1.99, 3, 5, 6, 7, 8, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 3, -7*math.log(2), 7, 6, 5, 1.99,))\nsnd = set((8, 3, 7, 5, 4*math.sqrt(5), -7.825, 6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5 \\sqrt{2}, -6, -\\frac{2}{e}, -\\frac{15}{2}, 9}$.", - "Output Answer": [ - "$-\\frac{2}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5*math.sqrt(2), -6, -(2/math.e), -(15/2), 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.209,0.138,0.351,0.095\\}$ and $\\{0.355,0.031,0.021,0.327\\}$.", - "Output Answer": [ - "$1.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.209, 0.138, 0.351, 0.095\ndistribution2 = 0.355, 0.031, 0.021, 0.327\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3. x-3.5$ where $x \\sim $ \\text{PoissonDistribution}[2.7]\n", - "Output Answer": [ - "$4.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.7)\nprint(E(3.*x-3.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{2}{3}, \\frac{58}{3}, \\frac{8}{3}}$.\n", - "Output Answer": [ - "$\\frac{232}{149}$" - ], - "Output Program": [ - "import statistics\nvalues = (2/3), (58/3), (8/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x^2+1.5 x-0.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.1]\n", - "Output Answer": [ - "$8.37$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.1)\nprint(E(4.6*x**2+1.5*x-0.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 8, -9, -2, 10, -5}$.\n", - "Output Answer": [ - "$\\frac{5}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 8, -9, -2, 10, -5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.2 x^3+2.3 x^2+2.4 x+3.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$6.64$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(-3.2*x**3+2.3*x**2+2.4*x+3.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.332,0.106,0.067,0.005,0.403\\}$ and $\\{0.044,0.03,0.5,0.32,0.003\\}$.", - "Output Answer": [ - "$2.86$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.332, 0.106, 0.067, 0.005, 0.403\ndistribution2 = 0.044, 0.03, 0.5, 0.32, 0.003\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{5}, 0, -2 \\sqrt{5}, \\sqrt{5}, 0, 4 \\sqrt{5}, 4 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, 0, 0, 0, -4 \\sqrt{5}, 4 \\sqrt{5}, 0, -4 \\sqrt{5}, -2 \\sqrt{5}, 4 \\sqrt{5}, -2 \\sqrt{5}, 0, -2 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, 0, -2 \\sqrt{5}, 0, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(5), 0, -2*math.sqrt(5), math.sqrt(5), 0, 4*math.sqrt(5), 4*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), 0, 0, 0, -4*math.sqrt(5), 4*math.sqrt(5), 0, -4*math.sqrt(5), -2*math.sqrt(5), 4*math.sqrt(5), -2*math.sqrt(5), 0, -2*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), 0, -2*math.sqrt(5), 0, math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\pi, 0, -\\pi, -2 \\pi, 2 \\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$-\\frac{\\pi }{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.pi, 0, -math.pi, -2*math.pi, 2*math.pi, 2*math.pi\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, -2, -5, 3.8, -4, 2, -9} \\setminus {3, 3.8, -4, 8, -2, -2 \\sqrt{5}, -8, -5}$.\n", - "Output Answer": [ - "${-9, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -2, -5, 3.8, -4, 2, -9,))\nsnd = set((3, 3.8, -4, 8, -2, -2*math.sqrt(5), -8, -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, 2, \\frac{1}{\\sqrt{\\pi }}, 0, 6, 1, \\frac{2}{e}, -\\frac{2}{\\pi }, -\\frac{16}{e}, \\frac{20}{7}, 4, -6, 3, -\\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{29}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 2, (1/(math.sqrt(math.pi))), 0, 6, 1, (2/math.e), -(2/math.pi), -(16/math.e), (20/7), 4, -6, 3, -(17/2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8, 2, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -8, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 2, -5*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, 1, 2, 1, -1, -1, 2, -1, 2, 1, 1, 2, 2, -1, -1, 1, 0, 2, -6, -1, 0, -1, 0, 2, 2, -6}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, 1, 2, 1, -1, -1, 2, -1, 2, 1, 1, 2, 2, -1, -1, 1, 0, 2, -6, -1, 0, -1, 0, 2, 2, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2.026, 1, -4 \\sqrt{3}, -6, -\\pi, 5.806}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -6, -\\pi, -2.026, 1, 5.806}$" - ], - "Output Program": [ - "import math\n\nvalues = -2.026, 1, -4*math.sqrt(3), -6, -math.pi, 5.806\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, \\frac{3}{e}, -10, -4, 2.277, \\frac{3}{\\sqrt{\\pi }}} \\setminus {-\\frac{22}{e}, 2, -4, 4, \\frac{3}{\\sqrt{\\pi }}, -10, -2.418}$.\n", - "Output Answer": [ - "${\\frac{3}{e}, 2.277}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, (3/math.e), -10, -4, 2.277, (3/(math.sqrt(math.pi))),))\nsnd = set((-(22/math.e), 2, -4, 4, (3/(math.sqrt(math.pi))), -10, -2.418,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 8, 16, 1, 16}$.\n", - "Output Answer": [ - "$4 \\sqrt[5]{2} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 8, 16, 1, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.326,0.169,0.09,0.407\\}$ and $\\{0.262,0.089,0.069,0.027\\}$.", - "Output Answer": [ - "$0.52$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.326, 0.169, 0.09, 0.407\ndistribution2 = 0.262, 0.089, 0.069, 0.027\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${9, 1, -1, -\\frac{29}{5}, -3 \\sqrt{3}, -5, 4, -4, 1, -9, -4, 8, -\\frac{21}{5}}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 1, -1, -(29/5), -3*math.sqrt(3), -5, 4, -4, 1, -9, -4, 8, -(21/5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{37}{5}, -14 \\log (2), 6 \\sqrt{3}, 7, -2} \\setminus {5, 10, \\frac{37}{5}, 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-14 \\log (2), -2, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set(((37/5), -14*math.log(2), 6*math.sqrt(3), 7, -2,))\nsnd = set((5, 10, (37/5), 6*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.067,0.158,0.025,0.101,0.08,0.087,0.152,0.161\\}$ and $\\{0.067,0.09,0.145,0.208,0.089,0.006,0.249,0.093,0.026\\}$.", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.067, 0.158, 0.025, 0.101, 0.08, 0.087, 0.152, 0.161\ndistribution2 = 0.067, 0.09, 0.145, 0.208, 0.089, 0.006, 0.249, 0.093, 0.026\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 0, -8, -2, 9, 3, 5, -2, 5, -8, 9, -2, -3, -3, 5, -2, -8, 0, 9, -3, -2, -8, 5, -2, 0}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 0, -8, -2, 9, 3, 5, -2, 5, -8, 9, -2, -3, -3, 5, -2, -8, 0, 9, -3, -2, -8, 5, -2, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x-9.1$ where $x \\sim $ \\text{NormalDistribution}[-0.9,1.8]\n", - "Output Answer": [ - "$-7.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.9, 1.8)\nprint(E(-2.3*x-9.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{3}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{12}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (3/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (3/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -\\frac{1}{\\sqrt{\\pi }}, \\sqrt{5}, -\\frac{9}{2}, 6, -\\frac{27}{\\pi }, \\frac{6}{\\pi }, 9, 1, 3, -5 \\log (2), -5, 7}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -(1/(math.sqrt(math.pi))), math.sqrt(5), -(9/2), 6, -(27/math.pi), (6/math.pi), 9, 1, 3, -5*math.log(2), -5, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, \\frac{2}{\\pi }, 5, 2, 1} \\setminus {8, 3, \\frac{2}{\\pi }}$.\n", - "Output Answer": [ - "${1, 2, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, (2/math.pi), 5, 2, 1,))\nsnd = set((8, 3, (2/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{29}{4}, -\\frac{17}{2}, \\frac{3}{4}, -\\frac{3}{4}, -\\frac{19}{4}, \\frac{33}{4}}$.\n", - "Output Answer": [ - "$-\\frac{49}{24}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(29/4), -(17/2), (3/4), -(3/4), -(19/4), (33/4)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{5}, \\frac{31}{5}, \\frac{13}{3}, \\frac{13}{\\sqrt{2}}, -2, 7.396} \\setminus {\\frac{31}{5}, 4 \\sqrt{5}, -2, 7.396, \\frac{11}{\\sqrt{2}}, 8, \\frac{13}{3}}$.\n", - "Output Answer": [ - "${\\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), (31/5), (13/3), (13/(math.sqrt(2))), -2, 7.396,))\nsnd = set(((31/5), 4*math.sqrt(5), -2, 7.396, (11/(math.sqrt(2))), 8, (13/3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -4, 9}$.\n", - "Output Answer": [ - "$\\frac{8}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -4, 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, -5, -6, 4, 2, 4}$.\n", - "Output Answer": [ - "$\\frac{7}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, -5, -6, 4, 2, 4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -4, -2, -8, 7, 3, 6, -4}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -4, -2, -8, 7, 3, 6, -4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 4, 6, 9}$.\n", - "Output Answer": [ - "$\\frac{1008}{151}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 4, 6, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^2+5. x+5.4$ where $x \\sim $ \\text{NormalDistribution}[-0.1,2.6]\n", - "Output Answer": [ - "$13.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.1, 2.6)\nprint(E(1.3*x**2+5.*x+5.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.171,0.211,0.156,0.176,0.201\\}$ and $\\{0.023,0.017,0.102,0.458,0.003\\}$.", - "Output Answer": [ - "$1.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.171, 0.211, 0.156, 0.176, 0.201\ndistribution2 = 0.023, 0.017, 0.102, 0.458, 0.003\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 3, 1, -7, 2, 1, 2, -8, 3, -8, 1, 2, 0, 2, 7, -4, -4, 3, 2, 3, 1, -4}$.\n", - "Output Answer": [ - "$\\{1,2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 3, 1, -7, 2, 1, 2, -8, 3, -8, 1, 2, 0, 2, 7, -4, -4, 3, 2, 3, 1, -4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -8, -7, 6, 3, -\\frac{1}{2}, -3} \\setminus {9, 2.6, 10}$.\n", - "Output Answer": [ - "${-8, -7, -3, -\\frac{1}{2}, 0, 3, 6}$" - ], - "Output Program": [ - "fst = set((0, -8, -7, 6, 3, -(1/2), -3,))\nsnd = set((9, 2.6, 10,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3, -10, -8, \\frac{7}{5}} \\cup {-7, -3, -10, \\frac{7}{5}, \\frac{37}{7}}$.\n", - "Output Answer": [ - "${-10, -8, -7, -3, \\frac{7}{5}, 3, \\frac{37}{7}}$" - ], - "Output Program": [ - "fst = set((3, -10, -8, (7/5),))\nsnd = set((-7, -3, -10, (7/5), (37/7),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-7, -1, -4}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -1, -4\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 4, 11, 7}$.\n", - "Output Answer": [ - "$\\frac{20944}{2841}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 4, 11, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, 14, 14, 1, 10, -12}$.\n", - "Output Answer": [ - "$\\frac{3221}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 14, 14, 1, 10, -12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 6, 4096, 6, -8}$.\n", - "Output Answer": [ - "$8 \\sqrt[5]{-1} 6^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 6, 4096, 6, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.017,0.044,0.211,0.349,0.16\\}$ and $\\{0.124,0.131,0.195,0.14,0.182\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.017, 0.044, 0.211, 0.349, 0.16\ndistribution2 = 0.124, 0.131, 0.195, 0.14, 0.182\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${10, 8, 2, 5, -4, 0, -3 \\sqrt{3}} \\cup {10, -10, 0, 4, 5, 1, -4, \\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-10, -3 \\sqrt{3}, -4, 0, 1, 2, 4, \\frac{8}{\\sqrt{3}}, 5, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 8, 2, 5, -4, 0, -3*math.sqrt(3),))\nsnd = set((10, -10, 0, 4, 5, 1, -4, (8/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, \\frac{14}{\\sqrt{5}}, -3 e}$.\n", - "Output Answer": [ - "${-3 e, 6, \\frac{14}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (14/(math.sqrt(5))), -3*math.e\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -2, 8, -9, 3, -9, -2, 3, -2, 3, -2, 3, 3, 3, -9, -9, -9, 3, 3, 3}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -2, 8, -9, 3, -9, -2, 3, -2, 3, -2, 3, 3, 3, -9, -9, -9, 3, 3, 3\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${10, -4}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{25}{e}, -6.8, -9, -\\frac{11}{e}, -1, \\pi}$.\n", - "Output Answer": [ - "${-\\frac{25}{e}, -9, -6.8, -\\frac{11}{e}, -1, \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -(25/math.e), -6.8, -9, -(11/math.e), -1, math.pi\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.5 x-1.4$ where $x \\sim $ \\text{BetaDistribution}[1.3,1.6]\n", - "Output Answer": [ - "$-1.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.3, 1.6)\nprint(E(-0.5*x-1.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.071,0.099,0.056,0.126,0.219,0.048,0.083,0.057,0.114,0.087\\}$ and $\\{0.094,0.07,0.091,0.014,0.28,0.072,0.039,0.085,0.086,0.091\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.071, 0.099, 0.056, 0.126, 0.219, 0.048, 0.083, 0.057, 0.114, 0.087\ndistribution2 = 0.094, 0.07, 0.091, 0.014, 0.28, 0.072, 0.039, 0.085, 0.086, 0.091\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2, \\frac{3}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${\\frac{3}{\\sqrt{5}}, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, (3/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.212,0.276,0.063,0.239,0.081\\}$ and $\\{0.373,0.064,0.066,0.198,0.035\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.212, 0.276, 0.063, 0.239, 0.081\ndistribution2 = 0.373, 0.064, 0.066, 0.198, 0.035\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, -27, 64}$.\n", - "Output Answer": [ - "$12 \\sqrt[3]{-7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -27, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{19}{e}, -3, 7 \\sqrt{2}, -6, -5, \\sqrt{2}, 2 \\sqrt{5}, -3 \\log (2)}$.\n", - "Output Answer": [ - "$6+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (19/math.e), -3, 7*math.sqrt(2), -6, -5, math.sqrt(2), 2*math.sqrt(5), -3*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-2 e, 0, -\\frac{29}{3}, \\pi, \\frac{1}{\\sqrt{2}}, -\\frac{39}{4}, 1, 3 e, -\\sqrt{2}, -7 \\sqrt{2}, -8} \\cup {1, -\\frac{29}{4}, 8, -\\frac{16}{3}, \\frac{1}{\\sqrt{2}}, -8, -2 \\pi, -\\frac{9}{\\sqrt{2}}, -e, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -\\frac{39}{4}, -\\frac{29}{3}, -8, -\\frac{29}{4}, -\\frac{9}{\\sqrt{2}}, -2 \\pi, -2 e, -\\frac{16}{3}, -e, -\\sqrt{2}, 0, \\frac{1}{\\sqrt{2}}, 1, \\pi, 8, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, 0, -(29/3), math.pi, (1/(math.sqrt(2))), -(39/4), 1, 3*math.e, -math.sqrt(2), -7*math.sqrt(2), -8,))\nsnd = set((1, -(29/4), 8, -(16/3), (1/(math.sqrt(2))), -8, -2*math.pi, -(9/(math.sqrt(2))), -math.e, -7*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1. x-0.7$ where $x \\sim $ \\text{NormalDistribution}[-1.5,1.8]\n", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.5, 1.8)\nprint(E(-1.*x-0.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${1, 9}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-2.87 < 0.3 x-3.9 < -0.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3].", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(P((-2.87 < 0.3*x-3.9) & (0.3*x-3.9 < -0.3)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{9}{\\sqrt{5}}, 0, \\frac{23}{5}, -\\frac{5}{\\sqrt{\\pi }}, 1, 5, \\frac{17}{\\sqrt{\\pi }}, \\frac{36}{7}, -\\frac{46}{5}, \\frac{28}{\\pi }, -3 \\sqrt{5}, -\\frac{13}{\\sqrt{5}}, -8, -5, -5}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (9/(math.sqrt(5))), 0, (23/5), -(5/(math.sqrt(math.pi))), 1, 5, (17/(math.sqrt(math.pi))), (36/7), -(46/5), (28/math.pi), -3*math.sqrt(5), -(13/(math.sqrt(5))), -8, -5, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{3}{7}, 5, -7}$.", - "Output Answer": [ - "$-\\frac{3}{7}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -(3/7), 5, -7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, 3 \\sqrt{3}, -2 \\sqrt{3}, -3, -5, -10, -9, 5, 7, -3 \\pi, -8, -10, 7 \\log (2)}$.", - "Output Answer": [ - "$-2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 3*math.sqrt(3), -2*math.sqrt(3), -3, -5, -10, -9, 5, 7, -3*math.pi, -8, -10, 7*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-6, -3 e, 8, 5, \\frac{13}{4}}$.\n", - "Output Answer": [ - "${-3 e, -6, \\frac{13}{4}, 5, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -3*math.e, 8, 5, (13/4)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{5}{4}, -\\frac{29}{4}, -\\frac{29}{4}, -\\frac{29}{4}, -\\frac{29}{4}, -\\frac{29}{4}, \\frac{5}{4}, -\\frac{21}{4}, -\\frac{21}{4}, \\frac{5}{4}, \\frac{1}{4}, \\frac{21}{4}, \\frac{1}{4}, -\\frac{21}{4}, \\frac{21}{4}, -\\frac{37}{4}, \\frac{5}{4}, 7, -\\frac{29}{4}, \\frac{21}{4}, \\frac{5}{4}, -\\frac{37}{4}, -\\frac{29}{4}, \\frac{5}{4}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{29}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (5/4), -(29/4), -(29/4), -(29/4), -(29/4), -(29/4), (5/4), -(21/4), -(21/4), (5/4), (1/4), (21/4), (1/4), -(21/4), (21/4), -(37/4), (5/4), 7, -(29/4), (21/4), (5/4), -(37/4), -(29/4), (5/4)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{1}{\\sqrt{\\pi }}, -4, -\\frac{1}{3}, -1, \\frac{16}{\\sqrt{3}}, 3, 3, 10 \\log (2)}$.\n", - "Output Answer": [ - "$4+\\frac{16}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(1/(math.sqrt(math.pi))), -4, -(1/3), -1, (16/(math.sqrt(3))), 3, 3, 10*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, 1, 64}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 1, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, 5, -2, 1, \\frac{16}{3}, \\frac{30}{7}, 9} \\setminus {-1, 3, 5, -2, \\frac{16}{3}}$.\n", - "Output Answer": [ - "${1, \\frac{30}{7}, 9}$" - ], - "Output Program": [ - "fst = set((3, 5, -2, 1, (16/3), (30/7), 9,))\nsnd = set((-1, 3, 5, -2, (16/3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{2}{\\sqrt{\\pi }}, -\\frac{3}{4}, -6, 4, 8, 1}$.", - "Output Answer": [ - "$\\frac{1}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(2/(math.sqrt(math.pi))), -(3/4), -6, 4, 8, 1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{19}{2}, 4.838, 5 \\sqrt{2}, 4, 10, 7, 8, -\\frac{16}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -\\frac{16}{\\sqrt{3}}, 4, 4.838, 7, 5 \\sqrt{2}, 8, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/2), 4.838, 5*math.sqrt(2), 4, 10, 7, 8, -(16/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, -5, -1, -8, -2, -4, -7, -7}$.\n", - "Output Answer": [ - "$-\\frac{11}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, -5, -1, -8, -2, -4, -7, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{5}, -9, -\\frac{1}{\\sqrt{2}}, 2 \\sqrt{2}, -5 \\sqrt{3}, 0, 0, 2, -\\sqrt{5}, -\\frac{10}{e}, \\frac{8}{\\sqrt{\\pi }}, \\frac{29}{5}, -4 \\sqrt{2}}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(5), -9, -(1/(math.sqrt(2))), 2*math.sqrt(2), -5*math.sqrt(3), 0, 0, 2, -math.sqrt(5), -(10/math.e), (8/(math.sqrt(math.pi))), (29/5), -4*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-2 e, -3.3, 3 \\sqrt{3}, -6, 2 e, -8, 7} \\cup {-9, 2 e, -6, 7, -8, -5 \\sqrt{3}, -4, 0, -5, -3.3}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -8, -6, -2 e, -5, -4, -3.3, 0, 3 \\sqrt{3}, 2 e, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, -3.3, 3*math.sqrt(3), -6, 2*math.e, -8, 7,))\nsnd = set((-9, 2*math.e, -6, 7, -8, -5*math.sqrt(3), -4, 0, -5, -3.3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, -3 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -\\sqrt{2}, -1, 1, 7, 6, 4, -\\frac{26}{5}, -4, -6}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -3*math.sqrt(2), -(7/(math.sqrt(2))), -math.sqrt(2), -1, 1, 7, 6, 4, -(26/5), -4, -6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{9}{\\sqrt{5}}, -\\frac{12}{\\sqrt{\\pi }}, -\\pi, 9, 9}$.", - "Output Answer": [ - "$-\\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(9/(math.sqrt(5))), -(12/(math.sqrt(math.pi))), -math.pi, 9, 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8.572, -3.763, 2.11, \\frac{9}{4}, \\pi, -9}$.\n", - "Output Answer": [ - "${-9, -8.572, -3.763, 2.11, \\frac{9}{4}, \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -8.572, -3.763, 2.11, (9/4), math.pi, -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{7}{2}, 7.55}$.\n", - "Output Answer": [ - "${\\frac{7}{2}, 7.55}$" - ], - "Output Program": [ - "values = (7/2), 7.55\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, 0, 2 \\sqrt{5}, 0, -4 \\sqrt{5}, \\sqrt{5}, -4 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, 0, -4 \\sqrt{5}, \\sqrt{5}, 0, 2 \\sqrt{5}, 2 \\sqrt{5}, 0, 0, \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, -4 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 0}$.\n", - "Output Answer": [ - "$\\left\\{\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 0, 0, 2*math.sqrt(5), 0, -4*math.sqrt(5), math.sqrt(5), -4*math.sqrt(5), math.sqrt(5), math.sqrt(5), 0, -4*math.sqrt(5), math.sqrt(5), 0, 2*math.sqrt(5), 2*math.sqrt(5), 0, 0, math.sqrt(5), math.sqrt(5), math.sqrt(5), -4*math.sqrt(5), math.sqrt(5), math.sqrt(5), math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-11 \\log (2), \\frac{4}{\\sqrt{5}}, -9, \\frac{3}{\\sqrt{2}}, -5 \\sqrt{3}, -\\frac{15}{2}} \\setminus {-5 \\sqrt{3}, \\frac{21}{\\sqrt{5}}, -\\frac{1}{\\sqrt{3}}, -7, \\frac{1}{\\pi }}$.\n", - "Output Answer": [ - "${-9, -11 \\log (2), -\\frac{15}{2}, \\frac{4}{\\sqrt{5}}, \\frac{3}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-11*math.log(2), (4/(math.sqrt(5))), -9, (3/(math.sqrt(2))), -5*math.sqrt(3), -(15/2),))\nsnd = set((-5*math.sqrt(3), (21/(math.sqrt(5))), -(1/(math.sqrt(3))), -7, (1/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.043,0.134,0.168,0.085,0.203,0.04,0.076,0.028,0.211\\}$ and $\\{0.055,0.027,0.113,0.122,0.151,0.018,0.136,0.123,0.019\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.043, 0.134, 0.168, 0.085, 0.203, 0.04, 0.076, 0.028, 0.211\ndistribution2 = 0.055, 0.027, 0.113, 0.122, 0.151, 0.018, 0.136, 0.123, 0.019\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, -\\frac{42}{5}, -3 \\sqrt{3}, -\\pi, -6}$.", - "Output Answer": [ - "$-3 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -(42/5), -3*math.sqrt(3), -math.pi, -6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -\\frac{10}{\\pi }, -\\sqrt{2}, -9.6} \\setminus {-2, 4, -9.6, -\\sqrt{2}, -\\frac{25}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{10}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -(10/math.pi), -math.sqrt(2), -9.6,))\nsnd = set((-2, 4, -9.6, -math.sqrt(2), -(25/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 3, 15}$.\n", - "Output Answer": [ - "$\\frac{195}{31}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 3, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x+7.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$7.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(2.1*x+7.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4, -9, 2 e, 6, -6, -\\sqrt{3}, -3.9}$.\n", - "Output Answer": [ - "${-9, -6, -3.9, -\\sqrt{3}, 4, 2 e, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -9, 2*math.e, 6, -6, -math.sqrt(3), -3.9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, 11, 0, -5, -13}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{541}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 11, 0, -5, -13\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.755,0.044,0.06\\}$ and $\\{0.178,0.483,0.107\\}$.", - "Output Answer": [ - "$0.99$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.755, 0.044, 0.06\ndistribution2 = 0.178, 0.483, 0.107\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x+2.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$2.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(3.7*x+2.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, -3, 3, -8, -3, -8, -8, -3, -8, -3, -8, -8, -3, -8, 3, -3, -3, -3, 3, -3}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, -3, 3, -8, -3, -8, -8, -3, -8, -3, -8, -8, -3, -8, 3, -3, -3, -3, 3, -3\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -\\frac{1}{3}, \\frac{5}{3}}$.\n", - "Output Answer": [ - "$\\frac{1}{9}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -(1/3), (5/3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, 8, 64}$.\n", - "Output Answer": [ - "$8 \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 8, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${1, 2., 9.965} \\cup {2., 1.53, 1}$.\n", - "Output Answer": [ - "${1, 1.53, 2., 9.965}$" - ], - "Output Program": [ - "fst = set((1, 2., 9.965,))\nsnd = set((2., 1.53, 1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, \\frac{4}{\\sqrt{3}}, -3 \\sqrt{3}, -\\frac{12}{5}, \\frac{11}{2}, -2, 9, -8, 3, 3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -6, (4/(math.sqrt(3))), -3*math.sqrt(3), -(12/5), (11/2), -2, 9, -8, 3, 3*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, 1, -216}$.\n", - "Output Answer": [ - "$6 \\sqrt[3]{-5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 1, -216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 4, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\frac{68}{31}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 4, (17/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, -343, -2, 6561}$.\n", - "Output Answer": [ - "$9 \\sqrt[4]{2} \\sqrt{3} 7^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -343, -2, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{11}{\\pi }, 0, 3, -\\frac{5}{2}, -\\frac{5}{\\sqrt{2}}, 6}$.\n", - "Output Answer": [ - "$6+\\frac{5}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/math.pi), 0, 3, -(5/2), -(5/(math.sqrt(2))), 6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -3 \\sqrt{5}, -\\frac{18}{\\pi }, -\\frac{14}{\\sqrt{3}}, -3 \\log (2)} \\setminus {-\\frac{8}{\\pi }, 0, -6}$.\n", - "Output Answer": [ - "${-\\frac{14}{\\sqrt{3}}, -3 \\sqrt{5}, -\\frac{18}{\\pi }, -3 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -3*math.sqrt(5), -(18/math.pi), -(14/(math.sqrt(3))), -3*math.log(2),))\nsnd = set((-(8/math.pi), 0, -6,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -4 \\sqrt{5}, 1, 0, \\frac{9}{4}, -\\frac{44}{5}, 0}$.\n", - "Output Answer": [ - "$\\frac{9}{4}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -4*math.sqrt(5), 1, 0, (9/4), -(44/5), 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, \\frac{29}{3}, -\\frac{9}{\\sqrt{2}}, 6, 0, 1.022, -\\frac{1}{e}, 3} \\cup {-5, -\\frac{8}{5}, 6, 0, 3, 2, -\\frac{8}{3}, -\\frac{9}{\\sqrt{2}}, -\\frac{1}{e}}$.\n", - "Output Answer": [ - "${-9, -\\frac{9}{\\sqrt{2}}, -5, -\\frac{8}{3}, -\\frac{8}{5}, -\\frac{1}{e}, 0, 1.022, 2, 3, 6, \\frac{29}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, (29/3), -(9/(math.sqrt(2))), 6, 0, 1.022, -(1/math.e), 3,))\nsnd = set((-5, -(8/5), 6, 0, 3, 2, -(8/3), -(9/(math.sqrt(2))), -(1/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -5, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$7-2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -5, -2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.5 x-1.9$ where $x \\sim $ \\text{ExponentialDistribution}[0.8]\n", - "Output Answer": [ - "$2.47$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.8)\nprint(E(3.5*x-1.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-2.82 < -1.2 x^2+0.1 x+0.6 < 3.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.].", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(P((-2.82 < -1.2*x**2+0.1*x+0.6) & (-1.2*x**2+0.1*x+0.6 < 3.6)))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -1, -\\frac{25}{7}, -1.8, 7} \\cup {-\\frac{3}{7}, -1.8, -1, -10, -6}$.\n", - "Output Answer": [ - "${-10, -6, -5, -\\frac{25}{7}, -1.8, -1, -\\frac{3}{7}, 7}$" - ], - "Output Program": [ - "fst = set((-5, -1, -(25/7), -1.8, 7,))\nsnd = set((-(3/7), -1.8, -1, -10, -6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{2}{\\sqrt{5}}, -2, 0, -5, -3, -5, 5, -\\frac{2}{3}, -\\frac{3}{e}, -10, -\\frac{5}{3}}$.", - "Output Answer": [ - "$-\\frac{5}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(2/(math.sqrt(5))), -2, 0, -5, -3, -5, 5, -(2/3), -(3/math.e), -10, -(5/3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2, 3, 4, \\log (2), e, -7}$.\n", - "Output Answer": [ - "${-7, -2, \\log (2), e, 3, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 3, 4, math.log(2), math.e, -7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-10, -\\frac{9}{\\pi }, 9, -1, 1, 2 \\sqrt{2}} \\setminus {-2, -\\frac{9}{\\pi }, -\\sqrt{3}, -5}$.\n", - "Output Answer": [ - "${-10, -1, 1, 2 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, -(9/math.pi), 9, -1, 1, 2*math.sqrt(2),))\nsnd = set((-2, -(9/math.pi), -math.sqrt(3), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{2}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, 10, -9, 3, 6, 2 \\sqrt{5}, -2}$.\n", - "Output Answer": [ - "${-9, -\\frac{18}{\\sqrt{5}}, -2, -\\frac{2}{\\sqrt{5}}, 3, 2 \\sqrt{5}, 6, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -(2/(math.sqrt(5))), -(18/(math.sqrt(5))), 10, -9, 3, 6, 2*math.sqrt(5), -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${8, 8, 5, -4 e, -4, 8, -9}$.\n", - "Output Answer": [ - "${-4 e, -9, -4, 5, 8, 8, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 8, 5, -4*math.e, -4, 8, -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{6}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{5}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{67}{7 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (6/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), -(5/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-6 \\log (2), \\log (2), -7 \\log (2), -10 \\log (2), -2 \\log (2), -9 \\log (2), 7 \\log (2), -3 \\log (2), 8 \\log (2)} \\cap {2 \\log (2), 5 \\log (2), -4 \\log (2), \\log (2), 11 \\log (2), 7 \\log (2), 6 \\log (2), -\\log (2), 9 \\log (2)}$.\n", - "Output Answer": [ - "${\\log (2), 7 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.log(2), math.log(2), -7*math.log(2), -10*math.log(2), -2*math.log(2), -9*math.log(2), 7*math.log(2), -3*math.log(2), 8*math.log(2),))\nsnd = set((2*math.log(2), 5*math.log(2), -4*math.log(2), math.log(2), 11*math.log(2), 7*math.log(2), 6*math.log(2), -math.log(2), 9*math.log(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.046,0.155,0.007,0.079,0.116,0.333,0.051,0.073\\}$ and $\\{0.174,0.139,0.126,0.147,0.045,0.116,0.097,0.076\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.046, 0.155, 0.007, 0.079, 0.116, 0.333, 0.051, 0.073\ndistribution2 = 0.174, 0.139, 0.126, 0.147, 0.045, 0.116, 0.097, 0.076\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{13}{\\sqrt{2}}, -8, 3 \\sqrt{3}, -1, 8, -3}$.\n", - "Output Answer": [ - "${-8, -3, -1, 3 \\sqrt{3}, 8, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(2))), -8, 3*math.sqrt(3), -1, 8, -3\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{3}{\\sqrt{2}}, 7, -4, 9, 3 \\sqrt{2}, 0} \\setminus {-4, \\frac{11}{\\sqrt{2}}, 7, 4 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${0, 3 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(3/(math.sqrt(2))), 7, -4, 9, 3*math.sqrt(2), 0,))\nsnd = set((-4, (11/(math.sqrt(2))), 7, 4*math.sqrt(2), -(3/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 9, 2 \\sqrt{3}, 8, \\frac{9}{e}, -1.591, 7, 0, -4} \\cup {2 \\sqrt{3}, 9, -1.591, -9, 0, 5, -2, -\\frac{5}{e}, -1}$.\n", - "Output Answer": [ - "${-9, -4, -2, -\\frac{5}{e}, -1.591, -1, 0, \\frac{9}{e}, 2 \\sqrt{3}, 5, 7, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 9, 2*math.sqrt(3), 8, (9/math.e), -1.591, 7, 0, -4,))\nsnd = set((2*math.sqrt(3), 9, -1.591, -9, 0, 5, -2, -(5/math.e), -1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${10, -10, -1, \\frac{5}{e}}$.\n", - "Output Answer": [ - "${-10, -1, \\frac{5}{e}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -10, -1, (5/math.e)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6.7, -\\frac{37}{4}, -6, 10, -2.9}$.\n", - "Output Answer": [ - "${-\\frac{37}{4}, -6, -2.9, 6.7, 10}$" - ], - "Output Program": [ - "values = 6.7, -(37/4), -6, 10, -2.9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{17}{5}, -4, 1.17, -7.549, -3, 3, 8}$.\n", - "Output Answer": [ - "${-7.549, -4, -3, 1.17, 3, \\frac{17}{5}, 8}$" - ], - "Output Program": [ - "values = (17/5), -4, 1.17, -7.549, -3, 3, 8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 81, 81, 16}$.\n", - "Output Answer": [ - "$18 \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 81, 81, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x+4.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$4.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(2.5*x+4.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, 8 \\log (2), -\\frac{17}{e}, -9, -\\frac{14}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{3}}, 9, -9, -\\frac{12}{\\pi }}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 8*math.log(2), -(17/math.e), -9, -(14/(math.sqrt(math.pi))), -(7/(math.sqrt(3))), 9, -9, -(12/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-5, 6.843, 3, 9, -3 \\pi, 7, \\frac{33}{4}, \\frac{19}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-3 \\pi, -5, 3, 6.843, 7, \\frac{33}{4}, \\frac{19}{\\sqrt{5}}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 6.843, 3, 9, -3*math.pi, 7, (33/4), (19/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $1.39 < 1.2 x^2+4.8 x+1.3 < 2.19$ where $x \\sim $ \\text{ExponentialDistribution}[1.2].", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.2)\nprint(P((1.39 < 1.2*x**2+4.8*x+1.3) & (1.2*x**2+4.8*x+1.3 < 2.19)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.5 x-3.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-3.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(1.5*x-3.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.145,0.1,0.466,0.22,0.069\\}$ and $\\{0.051,0.106,0.223,0.152,0.248\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.145, 0.1, 0.466, 0.22, 0.069\ndistribution2 = 0.051, 0.106, 0.223, 0.152, 0.248\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.8 x-3.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-3.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-1.8*x-3.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, 7, 6, 2, 2, -4, -5}$.\n", - "Output Answer": [ - "$\\frac{9}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, 7, 6, 2, 2, -4, -5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{2}, \\frac{8}{\\pi }, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$4 \\sqrt{5}+\\frac{8}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/2), (8/math.pi), -4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.478,0.186,0.147\\}$ and $\\{0.131,0.328,0.37\\}$.", - "Output Answer": [ - "$0.49$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.478, 0.186, 0.147\ndistribution2 = 0.131, 0.328, 0.37\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{9}{\\sqrt{2}}, 4, -\\frac{3}{\\sqrt{2}}, -\\frac{16}{\\sqrt{\\pi }}, 1, -\\frac{46}{7}}$.", - "Output Answer": [ - "$-3 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(9/(math.sqrt(2))), 4, -(3/(math.sqrt(2))), -(16/(math.sqrt(math.pi))), 1, -(46/7)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{28}{5}, -4 \\sqrt{2}, -\\frac{8}{3}, -12 \\log (2), -2 e, 5, 2, \\frac{3}{\\sqrt{2}}, -\\frac{4}{\\sqrt{5}}} \\setminus {-\\frac{4}{\\sqrt{5}}, 2, -\\frac{8}{3}, -2 e, -\\frac{3}{\\sqrt{2}}, 5}$.\n", - "Output Answer": [ - "${-12 \\log (2), -4 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, \\frac{28}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((28/5), -4*math.sqrt(2), -(8/3), -12*math.log(2), -2*math.e, 5, 2, (3/(math.sqrt(2))), -(4/(math.sqrt(5))),))\nsnd = set((-(4/(math.sqrt(5))), 2, -(8/3), -2*math.e, -(3/(math.sqrt(2))), 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.116,0.109,0.08,0.003,0.136\\}$ and $\\{0.051,0.365,0.06,0.08,0.281\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.116, 0.109, 0.08, 0.003, 0.136\ndistribution2 = 0.051, 0.365, 0.06, 0.08, 0.281\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5, -\\frac{19}{\\pi }, 8} \\cup {8, -\\frac{19}{\\pi }, 10}$.\n", - "Output Answer": [ - "${-\\frac{19}{\\pi }, 5, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -(19/math.pi), 8,))\nsnd = set((8, -(19/math.pi), 10,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.156,0.365,0.149\\}$ and $\\{0.185,0.296,0.42\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.156, 0.365, 0.149\ndistribution2 = 0.185, 0.296, 0.42\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2, 0, -7, -\\frac{2}{\\sqrt{3}}, 5.47, 7}$.\n", - "Output Answer": [ - "${-7, -\\frac{2}{\\sqrt{3}}, 0, 2, 5.47, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 0, -7, -(2/(math.sqrt(3))), 5.47, 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -3, 6 \\sqrt{2}, 5, -7.145} \\setminus {-14 \\log (2), 6 \\sqrt{2}, -1.671, 2}$.\n", - "Output Answer": [ - "${-7.145, -6, -3, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -3, 6*math.sqrt(2), 5, -7.145,))\nsnd = set((-14*math.log(2), 6*math.sqrt(2), -1.671, 2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{1}{\\pi }, -\\frac{14}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{5}}, -5, -\\frac{47}{5}, -\\frac{18}{\\pi }} \\setminus {-\\frac{21}{\\pi }, \\sqrt{2}, \\frac{1}{\\sqrt{5}}, -\\frac{13}{2}, -\\frac{14}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-\\frac{47}{5}, -\\frac{18}{\\pi }, -5, \\frac{1}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/math.pi), -(14/(math.sqrt(math.pi))), (1/(math.sqrt(5))), -5, -(47/5), -(18/math.pi),))\nsnd = set((-(21/math.pi), math.sqrt(2), (1/(math.sqrt(5))), -(13/2), -(14/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 7, -5.914, 5.1} \\setminus {5.1, \\frac{4}{\\sqrt{3}}, 2, -2, -5.914, -\\frac{17}{\\pi }}$.\n", - "Output Answer": [ - "${-5, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 7, -5.914, 5.1,))\nsnd = set((5.1, (4/(math.sqrt(3))), 2, -2, -5.914, -(17/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.149,0.482,0.175,0.084\\}$ and $\\{0.22,0.194,0.265,0.194\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.149, 0.482, 0.175, 0.084\ndistribution2 = 0.22, 0.194, 0.265, 0.194\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3 e, -\\frac{9}{\\sqrt{2}}, \\frac{10}{e}, -8, 3, \\frac{13}{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3+\\frac{10}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.e, -(9/(math.sqrt(2))), (10/math.e), -8, 3, (13/2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, 15, -8, -14}$.\n", - "Output Answer": [ - "$\\frac{589}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 15, -8, -14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8, -2, -\\frac{15}{\\pi }, -3, 8.7, 3.4, 1, 0, \\sqrt{5}, -8} \\cup {-10, 8, 0, -5, -9.4, -8, 14 \\log (2)}$.\n", - "Output Answer": [ - "${-10, -9.4, -8, -5, -\\frac{15}{\\pi }, -3, -2, 0, 1, \\sqrt{5}, 3.4, 8, 8.7, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -2, -(15/math.pi), -3, 8.7, 3.4, 1, 0, math.sqrt(5), -8,))\nsnd = set((-10, 8, 0, -5, -9.4, -8, 14*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.355,0.01,0.505\\}$ and $\\{0.255,0.304,0.24\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.355, 0.01, 0.505\ndistribution2 = 0.255, 0.304, 0.24\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-0.99 < 0.9 x^2-0.5 x+4.4 < 4.41$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2].", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(P((-0.99 < 0.9*x**2-0.5*x+4.4) & (0.9*x**2-0.5*x+4.4 < 4.41)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${3, -6, 0, -2}$.\n", - "Output Answer": [ - "${-6, -2, 0, 3}$" - ], - "Output Program": [ - "values = 3, -6, 0, -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -8, \\frac{3}{\\pi }, -4 \\sqrt{5}, -4 \\sqrt{3}, 10} \\setminus {-\\sqrt{5}, -8, 10, 5, \\frac{4}{\\pi }}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -4 \\sqrt{3}, 0, \\frac{3}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -8, (3/math.pi), -4*math.sqrt(5), -4*math.sqrt(3), 10,))\nsnd = set((-math.sqrt(5), -8, 10, 5, (4/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.266,0.313,0.257\\}$ and $\\{0.245,0.256,0.211,0.055\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.266, 0.313, 0.257\ndistribution2 = 0.245, 0.256, 0.211, 0.055\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.8 x-0.1$ where $x \\sim $ \\text{BetaDistribution}[1.2,0.8]\n", - "Output Answer": [ - "$2.78$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.2, 0.8)\nprint(E(4.8*x-0.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.083,0.451,0.214,0.179\\}$ and $\\{0.151,0.532,0.033,0.082\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.083, 0.451, 0.214, 0.179\ndistribution2 = 0.151, 0.532, 0.033, 0.082\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${9, -7 \\log (2), -3 \\sqrt{2}, -4, 3, -3, -4, -5 \\sqrt{3}, -9, \\frac{11}{\\sqrt{\\pi }}, 4, -8, 4}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -7*math.log(2), -3*math.sqrt(2), -4, 3, -3, -4, -5*math.sqrt(3), -9, (11/(math.sqrt(math.pi))), 4, -8, 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{25}{3}, 9, -6}$.\n", - "Output Answer": [ - "${-\\frac{25}{3}, -6, 9}$" - ], - "Output Program": [ - "values = -(25/3), 9, -6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.107,0.094,0.158,0.051,0.247,0.03,0.168\\}$ and $\\{0.056,0.108,0.22,0.044,0.05,0.112,0.112\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.107, 0.094, 0.158, 0.051, 0.247, 0.03, 0.168\ndistribution2 = 0.056, 0.108, 0.22, 0.044, 0.05, 0.112, 0.112\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\pi, 4, 8, -\\frac{8}{e}, -9, 10, 7, -2 \\sqrt{3}} \\cup {4, -\\frac{5}{\\sqrt{3}}, -7, -3 \\pi, \\frac{8}{3}, 9, \\frac{3}{e}, -9}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -7, -2 \\sqrt{3}, -\\frac{8}{e}, -\\frac{5}{\\sqrt{3}}, \\frac{3}{e}, \\frac{8}{3}, 4, 7, 8, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.pi, 4, 8, -(8/math.e), -9, 10, 7, -2*math.sqrt(3),))\nsnd = set((4, -(5/(math.sqrt(3))), -7, -3*math.pi, (8/3), 9, (3/math.e), -9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 e, e, -2 e, e, 4 e, -e}$.\n", - "Output Answer": [ - "$\\frac{e}{6}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.e, math.e, -2*math.e, math.e, 4*math.e, -math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\pi, 4 \\log (2), 10, 3, -6} \\cup {4 \\log (2), 4, -2, 9, 0, -8}$.\n", - "Output Answer": [ - "${-8, -6, -2, 0, 4 \\log (2), 3, 4, 2 \\pi, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.pi, 4*math.log(2), 10, 3, -6,))\nsnd = set((4*math.log(2), 4, -2, 9, 0, -8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{21}{2}, \\frac{31}{2}, 9}$.\n", - "Output Answer": [ - "$\\frac{5859}{529}$" - ], - "Output Program": [ - "import statistics\nvalues = (21/2), (31/2), 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{25}{3}, 19, 13}$.\n", - "Output Answer": [ - "$\\frac{18525}{1541}$" - ], - "Output Program": [ - "import statistics\nvalues = (25/3), 19, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.076,0.058,0.359,0.116\\}$ and $\\{0.021,0.151,0.029,0.588\\}$.", - "Output Answer": [ - "$1.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.076, 0.058, 0.359, 0.116\ndistribution2 = 0.021, 0.151, 0.029, 0.588\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2 e, -e, 2 e, e, 3 e} \\cap {3 e, 0, e, -2 e}$.\n", - "Output Answer": [ - "${-2 e, e, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, -math.e, 2*math.e, math.e, 3*math.e,))\nsnd = set((3*math.e, 0, math.e, -2*math.e,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\pi, -2 \\pi, \\pi, 0, 3 \\pi, \\pi, 0, -2 \\pi, -2 \\pi, 3 \\pi, -2 \\pi, \\pi, \\pi, 3 \\pi, 3 \\pi, 3 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, \\pi, \\pi, -2 \\pi, \\pi, 3 \\pi, 0, 0, 0, \\pi, -2 \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$\\{-2 \\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.pi, -2*math.pi, math.pi, 0, 3*math.pi, math.pi, 0, -2*math.pi, -2*math.pi, 3*math.pi, -2*math.pi, math.pi, math.pi, 3*math.pi, 3*math.pi, 3*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, math.pi, math.pi, -2*math.pi, math.pi, 3*math.pi, 0, 0, 0, math.pi, -2*math.pi, -2*math.pi\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x-1.8$ where $x \\sim $ \\text{NormalDistribution}[1.3,0.8]\n", - "Output Answer": [ - "$-4.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.3, 0.8)\nprint(E(-2.3*x-1.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, 1, 0, -1, 1, -7, -5, 6, -1, -\\frac{60}{7}, -4, 9, 3 \\sqrt{3}, 3 \\pi}$.\n", - "Output Answer": [ - "$\\frac{130}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 1, 0, -1, 1, -7, -5, 6, -1, -(60/7), -4, 9, 3*math.sqrt(3), 3*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 3, 7, -8, -5 \\sqrt{3}, 5, 4 \\sqrt{2}} \\setminus {-3, -5 \\sqrt{3}, -\\frac{12}{\\sqrt{\\pi }}, -7, -8, -2, -9, 3, 8}$.\n", - "Output Answer": [ - "${5, 4 \\sqrt{2}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 3, 7, -8, -5*math.sqrt(3), 5, 4*math.sqrt(2),))\nsnd = set((-3, -5*math.sqrt(3), -(12/(math.sqrt(math.pi))), -7, -8, -2, -9, 3, 8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, 3 \\sqrt{2}, 7, -2, 1, -\\frac{25}{3}, 0, \\frac{4}{e}, -2 \\sqrt{3}, -3 e, 6, 2 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(1+\\frac{4}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, 3*math.sqrt(2), 7, -2, 1, -(25/3), 0, (4/math.e), -2*math.sqrt(3), -3*math.e, 6, 2*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{5}, -2, 2 \\sqrt{3}, 1, -8, -7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(5), -2, 2*math.sqrt(3), 1, -8, -7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${7, 5 \\sqrt{3}, -2 \\sqrt{5}, -7, 5, -3.4} \\cup {-7, 2 \\sqrt{5}, -3.4, -6, -4, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -7, -6, -2 \\sqrt{5}, -4, -3.4, 2 \\sqrt{5}, 5, 7, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 5*math.sqrt(3), -2*math.sqrt(5), -7, 5, -3.4,))\nsnd = set((-7, 2*math.sqrt(5), -3.4, -6, -4, -5*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $1.68 < 4.8 x^2-0.3 x-0.6 < 2.51$ where $x \\sim $ \\text{ExponentialDistribution}[1.1].", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.1)\nprint(P((1.68 < 4.8*x**2-0.3*x-0.6) & (4.8*x**2-0.3*x-0.6 < 2.51)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-16807, 9, 625, -1000, 49, 4096}$.\n", - "Output Answer": [ - "$140 \\sqrt{2} \\sqrt[3]{3} \\sqrt[6]{35}$" - ], - "Output Program": [ - "import math\n\nvalues = -16807, 9, 625, -1000, 49, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -\\frac{14}{\\pi }, 4.37, -1, \\frac{8}{\\sqrt{5}}, 10, 4} \\setminus {-1, 10, 4.37, 8, \\frac{2}{\\sqrt{5}}, 4, 9}$.\n", - "Output Answer": [ - "${-7, -\\frac{14}{\\pi }, \\frac{8}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -(14/math.pi), 4.37, -1, (8/(math.sqrt(5))), 10, 4,))\nsnd = set((-1, 10, 4.37, 8, (2/(math.sqrt(5))), 4, 9,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 6, 5, -8, -3, -4, 10, 4}$.\n", - "Output Answer": [ - "$\\frac{17}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 6, 5, -8, -3, -4, 10, 4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.073,0.078,0.11,0.052,0.056,0.118,0.158,0.15,0.145,0.028\\}$ and $\\{0.095,0.167,0.039,0.056,0.128,0.033,0.129,0.086,0.113,0.068\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.073, 0.078, 0.11, 0.052, 0.056, 0.118, 0.158, 0.15, 0.145, 0.028\ndistribution2 = 0.095, 0.167, 0.039, 0.056, 0.128, 0.033, 0.129, 0.086, 0.113, 0.068\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.131,0.051,0.111,0.221,0.019,0.098,0.007,0.007\\}$ and $\\{0.085,0.092,0.05,0.267,0.191,0.142,0.017,0.018\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.131, 0.051, 0.111, 0.221, 0.019, 0.098, 0.007, 0.007\ndistribution2 = 0.085, 0.092, 0.05, 0.267, 0.191, 0.142, 0.017, 0.018\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${3 \\pi, 2 \\pi, 0, -3 \\pi, \\pi, -\\pi} \\cap {\\pi, 0, 3 \\pi, -3 \\pi, -2 \\pi, -\\pi}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\pi, 0, \\pi, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, 2*math.pi, 0, -3*math.pi, math.pi, -math.pi,))\nsnd = set((math.pi, 0, 3*math.pi, -3*math.pi, -2*math.pi, -math.pi,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{31}{3}, \\frac{44}{3}, \\frac{53}{3}}$.\n", - "Output Answer": [ - "$\\frac{3759184}{280513}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (31/3), (44/3), (53/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{5}, -3, -10 \\log (2), 0} \\cup {\\sqrt{5}, -3, -3 \\log (2), 0, 3}$.\n", - "Output Answer": [ - "${-10 \\log (2), -3, -3 \\log (2), 0, \\sqrt{5}, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(5), -3, -10*math.log(2), 0,))\nsnd = set((math.sqrt(5), -3, -3*math.log(2), 0, 3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.063,0.244,0.256,0.147\\}$ and $\\{0.276,0.267,0.167,0.159\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.063, 0.244, 0.256, 0.147\ndistribution2 = 0.276, 0.267, 0.167, 0.159\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.9 x+2.7$ where $x \\sim $ \\text{BetaDistribution}[0.6,0.6]\n", - "Output Answer": [ - "$5.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.6, 0.6)\nprint(E(4.9*x+2.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{18}{\\sqrt{5}}, 2 \\sqrt{5}, -\\frac{18}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{19}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, 2 \\sqrt{5}, \\frac{19}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{18}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(18/(math.sqrt(5))), 2*math.sqrt(5), -(18/(math.sqrt(5))), -(18/(math.sqrt(5))), 2*math.sqrt(5), (19/(math.sqrt(5))), -(18/(math.sqrt(5))), -(18/(math.sqrt(5))), (7/(math.sqrt(5))), (7/(math.sqrt(5))), -(18/(math.sqrt(5))), -(18/(math.sqrt(5))), (19/(math.sqrt(5))), -(18/(math.sqrt(5))), (7/(math.sqrt(5))), (7/(math.sqrt(5))), (7/(math.sqrt(5))), (7/(math.sqrt(5))), -(18/(math.sqrt(5))), 2*math.sqrt(5), (19/(math.sqrt(5))), (19/(math.sqrt(5))), -(18/(math.sqrt(5))), -(18/(math.sqrt(5))), -(18/(math.sqrt(5))), (19/(math.sqrt(5))), (19/(math.sqrt(5))), (19/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, -216, 81}$.\n", - "Output Answer": [ - "$36 \\sqrt[3]{-3}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -216, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, 0, -10, 5, 1, 7, -9}$.\n", - "Output Answer": [ - "$-\\frac{10}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, 0, -10, 5, 1, 7, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.311,0.235,0.156\\}$ and $\\{0.23,0.384,0.193\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.311, 0.235, 0.156\ndistribution2 = 0.23, 0.384, 0.193\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\pi, 3 \\pi, -3 \\pi, \\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$\\frac{2 \\pi }{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.pi, 3*math.pi, -3*math.pi, math.pi, 2*math.pi\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{2}, -\\sqrt{2}, \\sqrt{2}, 5 \\sqrt{2}, -\\sqrt{2}, -\\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{1}{3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(2), -math.sqrt(2), math.sqrt(2), 5*math.sqrt(2), -math.sqrt(2), -math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{2}{\\pi }, -8, 7, -6} \\cup {0, -3, 6, -8}$.\n", - "Output Answer": [ - "${-8, -6, -3, 0, \\frac{2}{\\pi }, 6, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set(((2/math.pi), -8, 7, -6,))\nsnd = set((0, -3, 6, -8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{69}{7}, \\frac{23}{7}, \\frac{54}{7}, -\\frac{6}{7}, \\frac{24}{7}, \\frac{66}{7}}$.\n", - "Output Answer": [ - "$\\frac{46}{21}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(69/7), (23/7), (54/7), -(6/7), (24/7), (66/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.165,0.143,0.289,0.078,0.222\\}$ and $\\{0.011,0.098,0.043,0.005,0.299\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.165, 0.143, 0.289, 0.078, 0.222\ndistribution2 = 0.011, 0.098, 0.043, 0.005, 0.299\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-0.55 < 3.9 x^2-2. x+0.4 < 3.91$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6].", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(P((-0.55 < 3.9*x**2-2.*x+0.4) & (3.9*x**2-2.*x+0.4 < 3.91)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{24}{\\pi }, -\\frac{1}{\\pi }, -\\frac{25}{\\pi }, -\\frac{1}{\\pi }, -\\frac{1}{\\pi }, -\\frac{1}{\\pi }, \\frac{7}{\\pi }, -\\frac{25}{\\pi }, \\frac{9}{\\pi }, \\frac{9}{\\pi }, \\frac{9}{\\pi }, -\\frac{1}{\\pi }, \\frac{9}{\\pi }, -\\frac{1}{\\pi }, -\\frac{25}{\\pi }, -\\frac{25}{\\pi }, \\frac{7}{\\pi }, \\frac{24}{\\pi }, \\frac{7}{\\pi }, \\frac{24}{\\pi }, \\frac{24}{\\pi }, \\frac{9}{\\pi }, -\\frac{25}{\\pi }, \\frac{7}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{1}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (24/math.pi), -(1/math.pi), -(25/math.pi), -(1/math.pi), -(1/math.pi), -(1/math.pi), (7/math.pi), -(25/math.pi), (9/math.pi), (9/math.pi), (9/math.pi), -(1/math.pi), (9/math.pi), -(1/math.pi), -(25/math.pi), -(25/math.pi), (7/math.pi), (24/math.pi), (7/math.pi), (24/math.pi), (24/math.pi), (9/math.pi), -(25/math.pi), (7/math.pi)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, 0, 7, 2 e, 6 \\sqrt{2}, \\frac{3}{2}, -8, 3 e, -7, \\frac{26}{e}, \\pi, -\\frac{5}{\\sqrt{2}}, -\\frac{4}{\\pi }}$.", - "Output Answer": [ - "$\\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 0, 7, 2*math.e, 6*math.sqrt(2), (3/2), -8, 3*math.e, -7, (26/math.e), math.pi, -(5/(math.sqrt(2))), -(4/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{25}{e}, \\frac{21}{e}, -\\frac{16}{e}, \\frac{6}{e}, -\\frac{16}{e}, -\\frac{13}{e}, -\\frac{16}{e}, \\frac{25}{e}, \\frac{6}{e}, -\\frac{16}{e}, \\frac{21}{e}, -\\frac{13}{e}, \\frac{25}{e}, \\frac{6}{e}, \\frac{6}{e}, -\\frac{13}{e}, -\\frac{13}{e}, -\\frac{16}{e}, \\frac{6}{e}, \\frac{25}{e}, \\frac{6}{e}, \\frac{6}{e}, \\frac{6}{e}, -\\frac{16}{e}, -\\frac{16}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{6}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (25/math.e), (21/math.e), -(16/math.e), (6/math.e), -(16/math.e), -(13/math.e), -(16/math.e), (25/math.e), (6/math.e), -(16/math.e), (21/math.e), -(13/math.e), (25/math.e), (6/math.e), (6/math.e), -(13/math.e), -(13/math.e), -(16/math.e), (6/math.e), (25/math.e), (6/math.e), (6/math.e), (6/math.e), -(16/math.e), -(16/math.e)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\log (2), -10 \\log (2), -10 \\log (2), 4 \\log (2), -10 \\log (2), 11 \\log (2), 4 \\log (2), 0, 11 \\log (2), 0, -10 \\log (2), -10 \\log (2), 11 \\log (2), 11 \\log (2), 11 \\log (2), 0, 11 \\log (2), 4 \\log (2), 11 \\log (2), -10 \\log (2), 11 \\log (2), 11 \\log (2), 11 \\log (2), 11 \\log (2), 0, 0, 11 \\log (2), 0, 0}$.\n", - "Output Answer": [ - "$\\{11 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.log(2), -10*math.log(2), -10*math.log(2), 4*math.log(2), -10*math.log(2), 11*math.log(2), 4*math.log(2), 0, 11*math.log(2), 0, -10*math.log(2), -10*math.log(2), 11*math.log(2), 11*math.log(2), 11*math.log(2), 0, 11*math.log(2), 4*math.log(2), 11*math.log(2), -10*math.log(2), 11*math.log(2), 11*math.log(2), 11*math.log(2), 11*math.log(2), 0, 0, 11*math.log(2), 0, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5, 5 \\sqrt{3}, -1, 7, -7, -8, 3 \\sqrt{5}, -4, 5.897, \\frac{20}{3}, 6} \\cup {-4, -6.899, 6, -10, \\frac{20}{3}, 7, 2, 4 \\sqrt{5}, 3 \\sqrt{3}, -8, -1}$.\n", - "Output Answer": [ - "${-10, -8, -7, -6.899, -5, -4, -1, 2, 3 \\sqrt{3}, 5.897, 6, \\frac{20}{3}, 3 \\sqrt{5}, 7, 5 \\sqrt{3}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 5*math.sqrt(3), -1, 7, -7, -8, 3*math.sqrt(5), -4, 5.897, (20/3), 6,))\nsnd = set((-4, -6.899, 6, -10, (20/3), 7, 2, 4*math.sqrt(5), 3*math.sqrt(3), -8, -1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 5, 9, -2, 0, 1}$.\n", - "Output Answer": [ - "$\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 5, 9, -2, 0, 1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 36, 4, 4, 4096}$.\n", - "Output Answer": [ - "$8\\ 2^{3/5} 21^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 36, 4, 4, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 1296, -10, 256}$.\n", - "Output Answer": [ - "$24 \\sqrt[4]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 1296, -10, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-8, -2 \\sqrt{5}, 2 \\pi, -8}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-8-2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, -2*math.sqrt(5), 2*math.pi, -8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{47}{3}, \\frac{20}{3}, 18, \\frac{34}{3}}$.\n", - "Output Answer": [ - "$\\frac{575280}{51433}$" - ], - "Output Program": [ - "import statistics\nvalues = (47/3), (20/3), 18, (34/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, \\frac{7}{2}}$.\n", - "Output Answer": [ - "$\\frac{140}{27}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, (7/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.3 x^2-2.6 x-3.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.7]\n", - "Output Answer": [ - "$-1.77$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.7)\nprint(E(0.3*x**2-2.6*x-3.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${13 \\log (2), \\frac{2}{\\sqrt{\\pi }}, -9, -2, -\\frac{21}{5}, -9, -5}$.", - "Output Answer": [ - "$-\\frac{21}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 13*math.log(2), (2/(math.sqrt(math.pi))), -9, -2, -(21/5), -9, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 0, -3 \\sqrt{2}, \\frac{19}{7}, -4, 3, 4 \\sqrt{3}, -\\sqrt{5}, 9, -4, \\frac{23}{\\pi }, 0}$.\n", - "Output Answer": [ - "$9+3 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 0, -3*math.sqrt(2), (19/7), -4, 3, 4*math.sqrt(3), -math.sqrt(5), 9, -4, (23/math.pi), 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -7, -5 \\sqrt{2}, -\\pi, -4 \\sqrt{2}, \\frac{12}{\\pi }, 0, 1.9} \\cup {-5 \\sqrt{2}, \\frac{12}{\\pi }, -7, -\\pi, 0, 7, 7 \\sqrt{2}, -6, 1.9, -5}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -7, -6, -4 \\sqrt{2}, -5, -\\pi, 0, 1.9, \\frac{12}{\\pi }, 7, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -7, -5*math.sqrt(2), -math.pi, -4*math.sqrt(2), (12/math.pi), 0, 1.9,))\nsnd = set((-5*math.sqrt(2), (12/math.pi), -7, -math.pi, 0, 7, 7*math.sqrt(2), -6, 1.9, -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{3}, \\frac{25}{3}}$.\n", - "Output Answer": [ - "$\\frac{275}{54}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/3), (25/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x^2-0.7 x+1.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$-7.07$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(-3.5*x**2-0.7*x+1.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.064,0.16,0.036,0.222,0.206,0.157,0.072\\}$ and $\\{0.356,0.052,0.078,0.049,0.342,0.004,0.049\\}$.", - "Output Answer": [ - "$0.97$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.064, 0.16, 0.036, 0.222, 0.206, 0.157, 0.072\ndistribution2 = 0.356, 0.052, 0.078, 0.049, 0.342, 0.004, 0.049\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x+0.1$ where $x \\sim $ \\text{NormalDistribution}[-1.6,2.3]\n", - "Output Answer": [ - "$-1.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 2.3)\nprint(E(1.2*x+0.1))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{23}{3}, \\frac{3}{\\sqrt{\\pi }}, 7, \\frac{17}{\\sqrt{3}}, \\frac{3}{\\sqrt{2}}} \\setminus {7, \\frac{25}{\\pi }, \\frac{22}{\\sqrt{5}}, \\frac{17}{\\sqrt{3}}, -\\frac{17}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${\\frac{3}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{2}}, \\frac{23}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((23/3), (3/(math.sqrt(math.pi))), 7, (17/(math.sqrt(3))), (3/(math.sqrt(2))),))\nsnd = set((7, (25/math.pi), (22/(math.sqrt(5))), (17/(math.sqrt(3))), -(17/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{19}{3}, -\\frac{1}{3}, -3, \\frac{11}{3}, \\frac{11}{3}}$.\n", - "Output Answer": [ - "$\\frac{31}{15}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (19/3), -(1/3), -3, (11/3), (11/3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, 4, -2, -8, 9, 2, -7, 2, 2, 2, -7, -8, 4, 4, -1, -7, 4, -1, -2, -8, 2, -8, -2, 2, 2, 2, 2}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, 4, -2, -8, 9, 2, -7, 2, 2, 2, -7, -8, 4, 4, -1, -7, 4, -1, -2, -8, 2, -8, -2, 2, 2, 2, 2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, 9 \\log (2), -\\frac{7}{\\sqrt{2}}, -\\frac{4}{\\sqrt{\\pi }}, -10, -3 \\sqrt{2}, -1, -3, -4, 8 \\log (2), -8}$.\n", - "Output Answer": [ - "$10+9 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -10, 9*math.log(2), -(7/(math.sqrt(2))), -(4/(math.sqrt(math.pi))), -10, -3*math.sqrt(2), -1, -3, -4, 8*math.log(2), -8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-4, 4, -2 \\sqrt{5}, \\frac{10}{\\sqrt{3}}, -8, -7 \\sqrt{2}} \\setminus {4, \\frac{7}{\\sqrt{3}}, -\\frac{5}{2}, -4}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -8, -2 \\sqrt{5}, \\frac{10}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 4, -2*math.sqrt(5), (10/(math.sqrt(3))), -8, -7*math.sqrt(2),))\nsnd = set((4, (7/(math.sqrt(3))), -(5/2), -4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.208,0.222,0.08,0.105,0.148,0.072,0.086\\}$ and $\\{0.305,0.015,0.281,0.16,0.115,0.075,0.001\\}$.", - "Output Answer": [ - "$0.89$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.208, 0.222, 0.08, 0.105, 0.148, 0.072, 0.086\ndistribution2 = 0.305, 0.015, 0.281, 0.16, 0.115, 0.075, 0.001\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, -14}$.\n", - "Output Answer": [ - "$13 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -14\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.5 x-1.5$ where $x \\sim $ \\text{NormalDistribution}[1.7,1.7]\n", - "Output Answer": [ - "$-5.75$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.7, 1.7)\nprint(E(-2.5*x-1.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 256, 81, 2}$.\n", - "Output Answer": [ - "$12 \\sqrt[4]{2} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 256, 81, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^2+2.4 x-4.6$ where $x \\sim $ \\text{NormalDistribution}[1.1,2.7]\n", - "Output Answer": [ - "$-35.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.1, 2.7)\nprint(E(-3.9*x**2+2.4*x-4.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 5, 5, \\frac{39}{2}}$.\n", - "Output Answer": [ - "$\\frac{780}{103}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 5, 5, (39/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${9, -\\frac{25}{e}, -6 \\sqrt{2}, \\sqrt{5}, -5} \\setminus {-5, 0, -8}$.\n", - "Output Answer": [ - "${-\\frac{25}{e}, -6 \\sqrt{2}, \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -(25/math.e), -6*math.sqrt(2), math.sqrt(5), -5,))\nsnd = set((-5, 0, -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 0, -2 e, 2 e, 0, 3 e, 0}$.\n", - "Output Answer": [ - "$\\frac{3 e}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, 0, -2*math.e, 2*math.e, 0, 3*math.e, 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 3, 9, 3, -4, 1, 9, -1, -4, -1, 3, -4, -4, 3, 9, -1, 9, 3, 3, 9, -1, 9}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 3, 9, 3, -4, 1, 9, -1, -4, -1, 3, -4, -4, 3, 9, -1, 9, 3, 3, 9, -1, 9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 1}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "values = 1, 1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 9, -1, 1, -9, -1, 1}$.\n", - "Output Answer": [ - "$-\\frac{6}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 9, -1, 1, -9, -1, 1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{22}{5}, -3 \\pi, \\pi}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\frac{22}{5}, \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -(22/5), -3*math.pi, math.pi\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5 \\sqrt{3}, -4, 4, 3 \\log (2), 4, 3 e, -4, -10, 9, 1, 0, -\\frac{10}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(3), -4, 4, 3*math.log(2), 4, 3*math.e, -4, -10, 9, 1, 0, -(10/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^2-1.3 x-1.$ where $x \\sim $ \\text{PoissonDistribution}[2.4]\n", - "Output Answer": [ - "$-0.86$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.4)\nprint(E(0.4*x**2-1.3*x-1.))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${6, 6.916, -8 \\log (2), -9, -3.5} \\setminus {2, 6.916, -10}$.\n", - "Output Answer": [ - "${-9, -8 \\log (2), -3.5, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, 6.916, -8*math.log(2), -9, -3.5,))\nsnd = set((2, 6.916, -10,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 1, 6, -2, -9, 4, 3, -4}$.\n", - "Output Answer": [ - "$\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 1, 6, -2, -9, 4, 3, -4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2. x-0.1$ where $x \\sim $ \\text{NormalDistribution}[0.,2.]\n", - "Output Answer": [ - "$-0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0., 2.)\nprint(E(2.*x-0.1))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, -8, -\\frac{9}{\\pi }, -6, e, 9 \\log (2)} \\cup {-8 \\log (2), e, -6, -\\frac{9}{\\pi }, 2}$.\n", - "Output Answer": [ - "${-8, -6, -8 \\log (2), -\\frac{9}{\\pi }, 2, e, 9 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -8, -(9/math.pi), -6, math.e, 9*math.log(2),))\nsnd = set((-8*math.log(2), math.e, -6, -(9/math.pi), 2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 6}$.\n", - "Output Answer": [ - "$4 \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 e, 2 e, -e, -e, -2 e, e, -3 e, e, -e, e, e, -2 e, 2 e, -3 e, -3 e, -e, e, e, -e, 2 e, -e, e, -3 e, -e, -e, e, e, e, -e}$.\n", - "Output Answer": [ - "$\\{e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.e, 2*math.e, -math.e, -math.e, -2*math.e, math.e, -3*math.e, math.e, -math.e, math.e, math.e, -2*math.e, 2*math.e, -3*math.e, -3*math.e, -math.e, math.e, math.e, -math.e, 2*math.e, -math.e, math.e, -3*math.e, -math.e, -math.e, math.e, math.e, math.e, -math.e\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${256, -8, 9, -3125, 81}$.\n", - "Output Answer": [ - "$60 \\sqrt[5]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 256, -8, 9, -3125, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -1, 9, -7, -4, -\\frac{7}{3}}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "values = 8, -1, 9, -7, -4, -(7/3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -1, -7}$.\n", - "Output Answer": [ - "$3 \\sqrt{13}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -1, -7\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5 \\sqrt{3}, 2, -\\frac{13}{5}, -\\frac{11}{2}, 1, -5 \\sqrt{3}, -\\frac{17}{\\sqrt{\\pi }}, -8, 0, -\\frac{69}{7}, 1, -4 \\sqrt{2}, 4}$.\n", - "Output Answer": [ - "$\\frac{97}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(3), 2, -(13/5), -(11/2), 1, -5*math.sqrt(3), -(17/(math.sqrt(math.pi))), -8, 0, -(69/7), 1, -4*math.sqrt(2), 4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.388,0.097,0.35\\}$ and $\\{0.215,0.336,0.337\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.388, 0.097, 0.35\ndistribution2 = 0.215, 0.336, 0.337\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 e, -3 e, e, 2 e, 2 e, -2 e, 2 e, -2 e, -2 e, -2 e, -e, 2 e, -3 e, -3 e, -3 e, -e, e, -3 e, -e, e, -3 e, -3 e, -2 e, e, -3 e, 2 e, -2 e, -e, -3 e, -e}$.\n", - "Output Answer": [ - "$\\{-3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.e, -3*math.e, math.e, 2*math.e, 2*math.e, -2*math.e, 2*math.e, -2*math.e, -2*math.e, -2*math.e, -math.e, 2*math.e, -3*math.e, -3*math.e, -3*math.e, -math.e, math.e, -3*math.e, -math.e, math.e, -3*math.e, -3*math.e, -2*math.e, math.e, -3*math.e, 2*math.e, -2*math.e, -math.e, -3*math.e, -math.e\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\sqrt{3}, 8.523, -10, -\\frac{3}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, 5}$.\n", - "Output Answer": [ - "${-10, -\\frac{13}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -\\sqrt{3}, 5, 8.523}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(3), 8.523, -10, -(3/(math.sqrt(2))), -(13/(math.sqrt(2))), 5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${8.2, -2 \\pi, -\\frac{13}{2}, 6, 4.6}$.\n", - "Output Answer": [ - "${-\\frac{13}{2}, -2 \\pi, 4.6, 6, 8.2}$" - ], - "Output Program": [ - "import math\n\nvalues = 8.2, -2*math.pi, -(13/2), 6, 4.6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x+1.7$ where $x \\sim $ \\text{PoissonDistribution}[3.3]\n", - "Output Answer": [ - "$12.59$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.3)\nprint(E(3.3*x+1.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, -5, -6, 0, -8, -10}$.\n", - "Output Answer": [ - "$-\\frac{7}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, -5, -6, 0, -8, -10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-6, -2 \\pi, -3, 8, 5, 6} \\cup {6, -2 \\pi, -6, 8, 5, -7, 7}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, -6, -3, 5, 6, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -2*math.pi, -3, 8, 5, 6,))\nsnd = set((6, -2*math.pi, -6, 8, 5, -7, 7,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 2, -3, -6, 5, 3, 9}$.\n", - "Output Answer": [ - "$\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 2, -3, -6, 5, 3, 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{\\sqrt{3}}, 6, -4, \\sqrt{2}, 2 \\sqrt{5}, -2, -1, 7, -4}$.", - "Output Answer": [ - "$\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (13/(math.sqrt(3))), 6, -4, math.sqrt(2), 2*math.sqrt(5), -2, -1, 7, -4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${3, \\frac{8}{\\pi }, -2}$.\n", - "Output Answer": [ - "${-2, \\frac{8}{\\pi }, 3}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, (8/math.pi), -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-10, 9, \\frac{29}{\\pi }, -3, -2, -\\frac{15}{\\pi }, -3, 3, 6 \\sqrt{2}, -\\frac{5}{\\pi }}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-\\frac{5}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, 9, (29/math.pi), -3, -2, -(15/math.pi), -3, 3, 6*math.sqrt(2), -(5/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{1}{2}, -8, -\\frac{9}{\\sqrt{5}}, -\\frac{17}{\\pi }, -8, -4, 5, 9, -\\frac{11}{\\sqrt{5}}}$.", - "Output Answer": [ - "$-\\frac{9}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(1/2), -8, -(9/(math.sqrt(5))), -(17/math.pi), -8, -4, 5, 9, -(11/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -\\frac{13}{\\sqrt{2}}, -\\frac{11}{\\sqrt{3}}, -7, 9, 8}$.\n", - "Output Answer": [ - "$9+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -(13/(math.sqrt(2))), -(11/(math.sqrt(3))), -7, 9, 8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.6 x-1.7$ where $x \\sim $ \\text{NormalDistribution}[-1.2,2.]\n", - "Output Answer": [ - "$2.62$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.2, 2.)\nprint(E(-3.6*x-1.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{31}{3}, \\frac{2}{3}, \\frac{8}{3}}$.\n", - "Output Answer": [ - "$\\frac{248}{163}$" - ], - "Output Program": [ - "import statistics\nvalues = (31/3), (2/3), (8/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.001,0.746,0.006,0.12\\}$ and $\\{0.107,0.204,0.125,0.346\\}$.", - "Output Answer": [ - "$0.83$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.001, 0.746, 0.006, 0.12\ndistribution2 = 0.107, 0.204, 0.125, 0.346\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${243, 625, 1000, -1, 81}$.\n", - "Output Answer": [ - "$15 \\sqrt[5]{-1} 2^{3/5} 3^{4/5} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 243, 625, 1000, -1, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -8} \\setminus {1, 2 e, -2}$.\n", - "Output Answer": [ - "${-8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -8,))\nsnd = set((1, 2*math.e, -2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, 3, -10, -8, 5, 8, -6}$.\n", - "Output Answer": [ - "$-\\frac{13}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, 3, -10, -8, 5, 8, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, 100, 25}$.\n", - "Output Answer": [ - "$5 \\sqrt[3]{-5} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 100, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6.071, -9, \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, \\sqrt{3}, 6.071}$" - ], - "Output Program": [ - "import math\n\nvalues = 6.071, -9, math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${1, -\\sqrt{5}, 8, 8, -2.2, -\\frac{16}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{5}}, -\\sqrt{5}, -2.2, 1, 8, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -math.sqrt(5), 8, 8, -2.2, -(16/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 7, 7, -\\frac{34}{5}, -1, -\\frac{34}{5}, -9, -\\frac{34}{5}, -\\frac{34}{5}, -\\frac{34}{5}, \\frac{28}{5}, \\frac{28}{5}, 7, \\frac{28}{5}, -9, -\\frac{34}{5}, 7, -1, \\frac{28}{5}, -1}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{34}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 7, 7, -(34/5), -1, -(34/5), -9, -(34/5), -(34/5), -(34/5), (28/5), (28/5), 7, (28/5), -9, -(34/5), 7, -1, (28/5), -1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5 \\sqrt{2}, 4, -2, 4, \\frac{7}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, -\\sqrt{2}, -2 \\sqrt{2}, -6, 8, 12 \\log (2), -9}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4-\\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5*math.sqrt(2), 4, -2, 4, (7/(math.sqrt(3))), -(7/(math.sqrt(3))), -math.sqrt(2), -2*math.sqrt(2), -6, 8, 12*math.log(2), -9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{4}{3}, \\frac{32}{3}, \\frac{55}{3}, \\frac{7}{3}}$.\n", - "Output Answer": [ - "$\\frac{49280}{16347}$" - ], - "Output Program": [ - "import statistics\nvalues = (4/3), (32/3), (55/3), (7/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{26}{e}, 3, -2 \\sqrt{5}, 8, \\log (2), -2 \\sqrt{3}, 1}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (26/math.e), 3, -2*math.sqrt(5), 8, math.log(2), -2*math.sqrt(3), 1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{16}{\\sqrt{3}}, 3 \\sqrt{3}, -\\frac{1}{\\sqrt{3}}, 4 \\sqrt{3}, \\frac{11}{\\sqrt{3}}, -\\sqrt{3}, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{3}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(16/(math.sqrt(3))), 3*math.sqrt(3), -(1/(math.sqrt(3))), 4*math.sqrt(3), (11/(math.sqrt(3))), -math.sqrt(3), -3*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-e, 3 e, -e, -2 e, -3 e, 0, -e}$.\n", - "Output Answer": [ - "$-\\frac{5 e}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.e, 3*math.e, -math.e, -2*math.e, -3*math.e, 0, -math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\pi, 1, 5, -\\frac{7}{2}} \\setminus {1, 6, 3, 3 \\pi, 4, 5}$.\n", - "Output Answer": [ - "${-\\frac{7}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, 1, 5, -(7/2),))\nsnd = set((1, 6, 3, 3*math.pi, 4, 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-10, -\\frac{25}{e}, 3 \\sqrt{3}, 0, 3 \\pi, 7, -2, -4, -1, -3}$.", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, -(25/math.e), 3*math.sqrt(3), 0, 3*math.pi, 7, -2, -4, -1, -3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, e}$.\n", - "Output Answer": [ - "${e, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, math.e\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -7, -7, 8, 6, -2, 6}$.\n", - "Output Answer": [ - "$\\frac{4}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -7, -7, 8, 6, -2, 6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-5 \\sqrt{3}, \\frac{3}{2}, 6, -1, -8, -7, -7, 1, -5 \\sqrt{3}, -\\sqrt{5}, -10 \\log (2), 4, \\pi, 3 \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5*math.sqrt(3), (3/2), 6, -1, -8, -7, -7, 1, -5*math.sqrt(3), -math.sqrt(5), -10*math.log(2), 4, math.pi, 3*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{27}{4}, \\frac{1}{4}, \\frac{9}{4}, \\frac{9}{4}, \\frac{9}{4}, \\frac{1}{4}, -\\frac{27}{4}, \\frac{9}{4}, \\frac{1}{4}, -\\frac{5}{2}, \\frac{9}{4}, \\frac{9}{4}, \\frac{9}{4}, -\\frac{27}{4}, -\\frac{5}{2}, -\\frac{5}{2}, -\\frac{27}{4}, \\frac{1}{4}, -\\frac{27}{4}, \\frac{9}{4}, \\frac{1}{4}, -\\frac{5}{2}, \\frac{9}{4}, \\frac{9}{4}, -\\frac{27}{4}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{9}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(27/4), (1/4), (9/4), (9/4), (9/4), (1/4), -(27/4), (9/4), (1/4), -(5/2), (9/4), (9/4), (9/4), -(27/4), -(5/2), -(5/2), -(27/4), (1/4), -(27/4), (9/4), (1/4), -(5/2), (9/4), (9/4), -(27/4)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${1, -2 \\sqrt{2}, -\\frac{26}{3}, -7, 2 \\sqrt{3}, -5 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-7-2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, -2*math.sqrt(2), -(26/3), -7, 2*math.sqrt(3), -5*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 9, -4, 625}$.\n", - "Output Answer": [ - "$5 \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 9, -4, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{19}{\\pi }, -4, \\frac{11}{\\sqrt{3}}, -\\frac{59}{7}}$.\n", - "Output Answer": [ - "${-\\frac{59}{7}, -\\frac{19}{\\pi }, -4, \\frac{11}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/math.pi), -4, (11/(math.sqrt(3))), -(59/7)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{22}{\\pi }, -8, 5 \\sqrt{3}, 2 e, -1, 7, 10, -4}$.", - "Output Answer": [ - "$\\frac{1}{2} (7+2 e)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (22/math.pi), -8, 5*math.sqrt(3), 2*math.e, -1, 7, 10, -4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.133,0.293,0.018,0.102,0.317\\}$ and $\\{0.052,0.132,0.393,0.146,0.141\\}$.", - "Output Answer": [ - "$0.61$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.133, 0.293, 0.018, 0.102, 0.317\ndistribution2 = 0.052, 0.132, 0.393, 0.146, 0.141\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-5, -9, 8, 0, \\frac{39}{4}, -\\frac{14}{e}}$.\n", - "Output Answer": [ - "${-9, -\\frac{14}{e}, -5, 0, 8, \\frac{39}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -9, 8, 0, (39/4), -(14/math.e)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x^2+0.3 x-2.4$ where $x \\sim $ \\text{NormalDistribution}[1.1,2.9]\n", - "Output Answer": [ - "$-21.31$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.1, 2.9)\nprint(E(-2.*x**2+0.3*x-2.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, -7, 0, 2, 3, 4, -5, 1}$.\n", - "Output Answer": [ - "$-\\frac{1}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, -7, 0, 2, 3, 4, -5, 1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -7, -2, -4, 10}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "values = 0, -7, -2, -4, 10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{28}{\\pi }, 9, 3 \\sqrt{3}, 2 \\sqrt{3}, -4, 4 \\sqrt{5}, -2, -3} \\setminus {4 \\sqrt{5}, -3, 4 \\sqrt{3}, 3 \\pi}$.\n", - "Output Answer": [ - "${-\\frac{28}{\\pi }, -4, -2, 2 \\sqrt{3}, 3 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(28/math.pi), 9, 3*math.sqrt(3), 2*math.sqrt(3), -4, 4*math.sqrt(5), -2, -3,))\nsnd = set((4*math.sqrt(5), -3, 4*math.sqrt(3), 3*math.pi,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{3}, -2, 1, \\frac{17}{\\sqrt{3}}, 3, -7, 2 \\sqrt{5}, 3, 4 \\sqrt{5}, 0, -6, 1, -\\frac{2}{\\pi }}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(3), -2, 1, (17/(math.sqrt(3))), 3, -7, 2*math.sqrt(5), 3, 4*math.sqrt(5), 0, -6, 1, -(2/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-3, \\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-3, \\frac{1}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, (1/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.35,0.297,0.059,0.137\\}$ and $\\{0.369,0.126,0.234,0.124\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.35, 0.297, 0.059, 0.137\ndistribution2 = 0.369, 0.126, 0.234, 0.124\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 12, -6}$.\n", - "Output Answer": [ - "$\\frac{247}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 12, -6\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, 9, 1, -3, -2, 8} \\setminus {-7, 8, -1, -2}$.\n", - "Output Answer": [ - "${-3, 0, 1, 9}$" - ], - "Output Program": [ - "fst = set((0, 9, 1, -3, -2, 8,))\nsnd = set((-7, 8, -1, -2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 8, \\frac{29}{\\pi }, 10} \\setminus {-9.907, -6 \\log (2), -\\frac{23}{4}, \\frac{17}{2}, 5, -\\frac{3}{2}, -1, \\frac{25}{\\pi }, -5, \\frac{8}{3}}$.\n", - "Output Answer": [ - "${8, \\frac{29}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 8, (29/math.pi), 10,))\nsnd = set((-9.907, -6*math.log(2), -(23/4), (17/2), 5, -(3/2), -1, (25/math.pi), -5, (8/3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 3., -10, 7, -\\frac{7}{e}, 5 \\log (2)} \\cup {-12 \\log (2), 8.1, -2, 5, -\\frac{7}{e}, 1}$.\n", - "Output Answer": [ - "${-10, -12 \\log (2), -\\frac{7}{e}, -2, 1, 3., 5 \\log (2), 5, 7, 8.1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 3., -10, 7, -(7/math.e), 5*math.log(2),))\nsnd = set((-12*math.log(2), 8.1, -2, 5, -(7/math.e), 1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{3}, \\frac{53}{3}}$.\n", - "Output Answer": [ - "$\\frac{265}{87}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/3), (53/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{3}, \\frac{35}{3}, \\frac{14}{3}}$.\n", - "Output Answer": [ - "$\\frac{230}{33}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/3), (35/3), (14/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, \\frac{13}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{13}{\\sqrt{\\pi }}-3\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, (13/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2, -2, -6, -5, 16807}$.\n", - "Output Answer": [ - "$7 \\sqrt[5]{-15} 2^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -2, -6, -5, 16807\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{32}{5}, \\frac{18}{5}, -\\frac{16}{5}, -\\frac{4}{5}, -\\frac{38}{5}}$.\n", - "Output Answer": [ - "$-\\frac{72}{25}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(32/5), (18/5), -(16/5), -(4/5), -(38/5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 19, 2, 12}$.\n", - "Output Answer": [ - "$\\frac{228}{41}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 19, 2, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -\\frac{8}{3}, 6, 9, -7.2, -2 \\sqrt{2}, -1} \\setminus {6, -\\sqrt{2}, -8, \\frac{14}{3}}$.\n", - "Output Answer": [ - "${-7.2, -3, -2 \\sqrt{2}, -\\frac{8}{3}, -1, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -(8/3), 6, 9, -7.2, -2*math.sqrt(2), -1,))\nsnd = set((6, -math.sqrt(2), -8, (14/3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{3}{2}, -7, 6, 9} \\setminus {6, 0, -\\frac{3}{2}, 9, -4, -3, 1, -\\frac{6}{7}}$.\n", - "Output Answer": [ - "${-7}$" - ], - "Output Program": [ - "fst = set((-(3/2), -7, 6, 9,))\nsnd = set((6, 0, -(3/2), 9, -4, -3, 1, -(6/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 13, -12, 10, 9, -15}$.\n", - "Output Answer": [ - "$\\frac{834}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 13, -12, 10, 9, -15\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${e, -2 e, -2 e, e, e, e, e, e, -3 e, e, -3 e, -3 e, -2 e, e, -3 e, -4 e, -2 e, -2 e, -4 e, e, -4 e, -2 e, -2 e, e, -2 e, -4 e, -3 e}$.\n", - "Output Answer": [ - "$\\{e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.e, -2*math.e, -2*math.e, math.e, math.e, math.e, math.e, math.e, -3*math.e, math.e, -3*math.e, -3*math.e, -2*math.e, math.e, -3*math.e, -4*math.e, -2*math.e, -2*math.e, -4*math.e, math.e, -4*math.e, -2*math.e, -2*math.e, math.e, -2*math.e, -4*math.e, -3*math.e\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${2, 7, -2, -9, 0, -7, 1, -3, -4} \\cap {-2, -6, -9, 0, -8, -5, -7, 3}$.\n", - "Output Answer": [ - "${-9, -7, -2, 0}$" - ], - "Output Program": [ - "fst = set((2, 7, -2, -9, 0, -7, 1, -3, -4,))\nsnd = set((-2, -6, -9, 0, -8, -5, -7, 3,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\pi, e, -6, -2 \\pi, -4, -\\frac{23}{\\pi }}$.\n", - "Output Answer": [ - "$e+\\frac{23}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -math.pi, math.e, -6, -2*math.pi, -4, -(23/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{14}{\\sqrt{\\pi }}, -6, -10, \\sqrt{5}}$.\n", - "Output Answer": [ - "${-10, -6, \\sqrt{5}, \\frac{14}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (14/(math.sqrt(math.pi))), -6, -10, math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{2}, 14 \\log (2), 2 \\sqrt{3}, \\sqrt{3}, -3, -2 \\sqrt{2}, 3, 6, 1, \\frac{11}{\\sqrt{2}}, 6, 2, 6, \\sqrt{5}, -5}$.\n", - "Output Answer": [ - "$5+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(2), 14*math.log(2), 2*math.sqrt(3), math.sqrt(3), -3, -2*math.sqrt(2), 3, 6, 1, (11/(math.sqrt(2))), 6, 2, 6, math.sqrt(5), -5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{3}, 3, 7, -5, \\pi, -4, \\frac{15}{\\sqrt{\\pi }}, \\frac{3}{\\sqrt{2}}, \\frac{17}{5}, -\\frac{32}{5}, 3 \\sqrt{2}, -2, \\frac{5}{\\sqrt{2}}, -3, 0}$.", - "Output Answer": [ - "$\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(3), 3, 7, -5, math.pi, -4, (15/(math.sqrt(math.pi))), (3/(math.sqrt(2))), (17/5), -(32/5), 3*math.sqrt(2), -2, (5/(math.sqrt(2))), -3, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\log (2), -13 \\log (2), -3 \\log (2), -\\log (2), 6 \\log (2), 14 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{7 \\log (2)}{6}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.log(2), -13*math.log(2), -3*math.log(2), -math.log(2), 6*math.log(2), 14*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -10, 1, 2 \\sqrt{5}, -1, 5, 9, 6, \\frac{20}{e}, \\frac{19}{e}, -5 \\sqrt{3}, 12 \\log (2), -1, -4, 0}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -10, 1, 2*math.sqrt(5), -1, 5, 9, 6, (20/math.e), (19/math.e), -5*math.sqrt(3), 12*math.log(2), -1, -4, 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 2, -7, 2, 9, 2, 9, 7, -7, 7, -7, 2, -7, 2, -7, 9, 7, -7, -7, 9, -1, 9, -7, -7, -7, 7, 9, -1}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 2, -7, 2, 9, 2, 9, 7, -7, 7, -7, 2, -7, 2, -7, 9, 7, -7, -7, 9, -1, 9, -7, -7, -7, 7, 9, -1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.456,0.156\\}$ and $\\{0.276,0.238,0.119\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.456, 0.156\ndistribution2 = 0.276, 0.238, 0.119\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.06,0.154,0.04,0.079,0.233,0.017,0.132,0.033,0.032,0.127\\}$ and $\\{0.016,0.145,0.137,0.03,0.155,0.079,0.084,0.003,0.062,0.101\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.06, 0.154, 0.04, 0.079, 0.233, 0.017, 0.132, 0.033, 0.032, 0.127\ndistribution2 = 0.016, 0.145, 0.137, 0.03, 0.155, 0.079, 0.084, 0.003, 0.062, 0.101\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.9 x^2-0.6 x-3.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-5.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(-2.9*x**2-0.6*x-3.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, -3, -\\frac{31}{\\pi }, 4 \\sqrt{2}, -5} \\setminus {7, 0, -\\frac{31}{\\pi }, 2, -\\frac{22}{7}, -3}$.\n", - "Output Answer": [ - "${-5, 4 \\sqrt{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -3, -(31/math.pi), 4*math.sqrt(2), -5,))\nsnd = set((7, 0, -(31/math.pi), 2, -(22/7), -3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.335,0.03,0.12,0.045\\}$ and $\\{0.052,0.078,0.246,0.471\\}$.", - "Output Answer": [ - "$1.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.335, 0.03, 0.12, 0.045\ndistribution2 = 0.052, 0.078, 0.246, 0.471\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 1, 729, 3}$.\n", - "Output Answer": [ - "$9 \\sqrt[4]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 1, 729, 3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -1, -2, 100}$.\n", - "Output Answer": [ - "$2^{3/4} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -1, -2, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{13}{2}, 2 \\pi, 3, -4, 7, -3, -2 \\sqrt{5}, 6 \\sqrt{3}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(13/2), 2*math.pi, 3, -4, 7, -3, -2*math.sqrt(5), 6*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, -8, 1, 9, -\\frac{16}{\\sqrt{3}}, -2 \\sqrt{5}, 6, -\\log (2), 6 \\log (2), -\\frac{2}{e}, 7, -7, 5}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -8, 1, 9, -(16/(math.sqrt(3))), -2*math.sqrt(5), 6, -math.log(2), 6*math.log(2), -(2/math.e), 7, -7, 5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x-1.2$ where $x \\sim $ \\text{PoissonDistribution}[2.]\n", - "Output Answer": [ - "$5.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.)\nprint(E(3.4*x-1.2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, 2, -3, -\\frac{4}{\\sqrt{5}}, 9, e, -\\frac{8}{\\sqrt{3}}} \\setminus {3, -\\sqrt{3}, 8, -\\frac{4}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-\\frac{8}{\\sqrt{3}}, -3, 2, e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 2, -3, -(4/(math.sqrt(5))), 9, math.e, -(8/(math.sqrt(3))),))\nsnd = set((3, -math.sqrt(3), 8, -(4/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{17}{\\pi }, -\\frac{8}{\\pi }, -\\frac{8}{\\pi }, -\\frac{8}{\\pi }, \\frac{31}{\\pi }, -\\frac{17}{\\pi }, \\frac{31}{\\pi }, -\\frac{17}{\\pi }, -\\frac{17}{\\pi }, -\\frac{22}{\\pi }, -\\frac{8}{\\pi }, -\\frac{8}{\\pi }, -\\frac{22}{\\pi }, -\\frac{22}{\\pi }, -\\frac{9}{\\pi }, -\\frac{22}{\\pi }, -\\frac{21}{\\pi }, \\frac{31}{\\pi }, -\\frac{9}{\\pi }, -\\frac{17}{\\pi }, -\\frac{8}{\\pi }, -\\frac{21}{\\pi }, -\\frac{22}{\\pi }, -\\frac{21}{\\pi }, -\\frac{17}{\\pi }, -\\frac{9}{\\pi }, -\\frac{22}{\\pi }, -\\frac{8}{\\pi }, -\\frac{21}{\\pi }, \\frac{31}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{8}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(17/math.pi), -(8/math.pi), -(8/math.pi), -(8/math.pi), (31/math.pi), -(17/math.pi), (31/math.pi), -(17/math.pi), -(17/math.pi), -(22/math.pi), -(8/math.pi), -(8/math.pi), -(22/math.pi), -(22/math.pi), -(9/math.pi), -(22/math.pi), -(21/math.pi), (31/math.pi), -(9/math.pi), -(17/math.pi), -(8/math.pi), -(21/math.pi), -(22/math.pi), -(21/math.pi), -(17/math.pi), -(9/math.pi), -(22/math.pi), -(8/math.pi), -(21/math.pi), (31/math.pi)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, -5, -7, -7, -4, -5, -5, -5, -5, -4, -10, -7, -7, -4, -10, -7, -5, -4, -5, -5, -5, -7, -5, -7, -4, -10, -5, -10}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, -5, -7, -7, -4, -5, -5, -5, -5, -4, -10, -7, -7, -4, -10, -7, -5, -4, -5, -5, -5, -7, -5, -7, -4, -10, -5, -10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-4.12 < 1.4 x+1. < -3.24$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(P((-4.12 < 1.4*x+1.) & (1.4*x+1. < -3.24)))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{69}{7}, -2, -\\frac{11}{\\sqrt{3}}} \\setminus {-2, -6, -7, \\frac{69}{7}, -5 \\sqrt{3}, -3 e}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((69/7), -2, -(11/(math.sqrt(3))),))\nsnd = set((-2, -6, -7, (69/7), -5*math.sqrt(3), -3*math.e,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.142,0.077,0.299,0.021,0.127,0.171\\}$ and $\\{0.182,0.127,0.275,0.093,0.136,0.083\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.142, 0.077, 0.299, 0.021, 0.127, 0.171\ndistribution2 = 0.182, 0.127, 0.275, 0.093, 0.136, 0.083\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-10, -7.43, 3 \\sqrt{5}, -\\frac{49}{5}, \\frac{18}{\\pi }, -2}$.\n", - "Output Answer": [ - "${-10, -\\frac{49}{5}, -7.43, -2, \\frac{18}{\\pi }, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -7.43, 3*math.sqrt(5), -(49/5), (18/math.pi), -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 4, 4, 4, 3, -10, 5, 4, -10, 5, 3, 4, 4, -10, 3, -10, -10, -10, 4, -10, -10, -10, 7, 4}$.\n", - "Output Answer": [ - "$\\{4,-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 4, 4, 4, 3, -10, 5, 4, -10, 5, 3, 4, 4, -10, 3, -10, -10, -10, 4, -10, -10, -10, 7, 4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${7, -\\sqrt{3}, -\\frac{25}{\\pi }, 9, 5, 10 \\log (2), -13 \\log (2)}$.\n", - "Output Answer": [ - "${-13 \\log (2), -\\frac{25}{\\pi }, -\\sqrt{3}, 5, 10 \\log (2), 7, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -math.sqrt(3), -(25/math.pi), 9, 5, 10*math.log(2), -13*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${1, 2, -6, -\\frac{5}{\\sqrt{3}}, 0} \\setminus {-9, -6, -5, 1}$.\n", - "Output Answer": [ - "${-\\frac{5}{\\sqrt{3}}, 0, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 2, -6, -(5/(math.sqrt(3))), 0,))\nsnd = set((-9, -6, -5, 1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${6.4, -4, 7, -6 \\log (2), 3 \\pi, -10} \\cup {-4, 7, 9 \\log (2), 6.4, 0}$.\n", - "Output Answer": [ - "${-10, -6 \\log (2), -4, 0, 9 \\log (2), 6.4, 7, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.4, -4, 7, -6*math.log(2), 3*math.pi, -10,))\nsnd = set((-4, 7, 9*math.log(2), 6.4, 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{25}{4}, \\frac{39}{4}, \\frac{27}{4}, \\frac{21}{4}, -\\frac{15}{2}, \\frac{3}{4}, -6}$.\n", - "Output Answer": [ - "$\\frac{61}{28}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (25/4), (39/4), (27/4), (21/4), -(15/2), (3/4), -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.207,0.105,0.135,0.089\\}$ and $\\{0.124,0.138,0.145,0.294,0.09\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.207, 0.105, 0.135, 0.089\ndistribution2 = 0.124, 0.138, 0.145, 0.294, 0.09\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${3, 1000000, 1, 36, 100000, 5}$.\n", - "Output Answer": [ - "$100 \\sqrt[6]{2} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 1000000, 1, 36, 100000, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.298,0.334,0.156\\}$ and $\\{0.247,0.109,0.406\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.298, 0.334, 0.156\ndistribution2 = 0.247, 0.109, 0.406\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, -6, 10, -8, -3, 9, -3, 0, 6, -6, 10, 6, 0, 9, 0, 0, -6, 6, 6, 6, 9, -6, 6, 10}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, -6, 10, -8, -3, 9, -3, 0, 6, -6, 10, 6, 0, 9, 0, 0, -6, 6, 6, 6, 9, -6, 6, 10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.2 x^3-4.8 x^2-3.1 x-5.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$-14.07$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(-1.2*x**3-4.8*x**2-3.1*x-5.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{2}, -\\frac{16}{5}, -3 e, 4} \\cup {-\\frac{26}{5}, -3 e, 7, \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 e, -\\frac{26}{5}, -\\frac{16}{5}, \\sqrt{2}, 4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(2), -(16/5), -3*math.e, 4,))\nsnd = set((-(26/5), -3*math.e, 7, math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\pi, 6, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{1}{2}, -8, \\frac{13}{3}} \\setminus {\\frac{3}{\\sqrt{\\pi }}, \\frac{13}{3}, -2 \\pi, 6}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -8, -\\frac{1}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, 6, -(16/(math.sqrt(math.pi))), -(1/2), -8, (13/3),))\nsnd = set(((3/(math.sqrt(math.pi))), (13/3), -2*math.pi, 6,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{3}{\\sqrt{5}}, \\frac{38}{5}, -6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -\\frac{3}{\\sqrt{5}}, \\frac{38}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/(math.sqrt(5))), (38/5), -6*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, \\frac{52}{3}}$.\n", - "Output Answer": [ - "$\\frac{13}{2}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, (52/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.131,0.335,0.503\\}$ and $\\{0.353,0.341,0.121\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.131, 0.335, 0.503\ndistribution2 = 0.353, 0.341, 0.121\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, 4 \\sqrt{5}, \\frac{11}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, 4 \\sqrt{5}, -\\frac{19}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, 4 \\sqrt{5}, 4 \\sqrt{5}, \\frac{11}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}, -\\frac{3}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{11}{\\sqrt{5}},-\\frac{22}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (11/(math.sqrt(5))), -(22/(math.sqrt(5))), (11/(math.sqrt(5))), 4*math.sqrt(5), (11/(math.sqrt(5))), -(22/(math.sqrt(5))), (21/(math.sqrt(5))), -(22/(math.sqrt(5))), (11/(math.sqrt(5))), -(22/(math.sqrt(5))), (21/(math.sqrt(5))), (21/(math.sqrt(5))), (21/(math.sqrt(5))), -(22/(math.sqrt(5))), -(22/(math.sqrt(5))), 4*math.sqrt(5), -(19/(math.sqrt(5))), -(3/(math.sqrt(5))), (11/(math.sqrt(5))), 4*math.sqrt(5), 4*math.sqrt(5), (11/(math.sqrt(5))), (21/(math.sqrt(5))), -(22/(math.sqrt(5))), -(3/(math.sqrt(5))), (11/(math.sqrt(5))), -(3/(math.sqrt(5))), -(3/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -8, -5, -\\frac{25}{\\pi }, -\\frac{2}{5}} \\setminus {0, 2, 4, -5, -8, -\\frac{25}{\\pi }, 3.3, \\frac{11}{5}}$.\n", - "Output Answer": [ - "${-\\frac{2}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -8, -5, -(25/math.pi), -(2/5),))\nsnd = set((0, 2, 4, -5, -8, -(25/math.pi), 3.3, (11/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x^3+4.8 x^2+0.7 x+1.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$32.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(3.4*x**3+4.8*x**2+0.7*x+1.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 3, 11, 10}$.\n", - "Output Answer": [ - "$\\frac{22440}{3271}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 3, 11, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 7, 5, 9, 4, 9, -9, 5, 6, 9, 7, 4, 6, -9, -9, 4, 4, 7, 7, 6}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 7, 5, 9, 4, 9, -9, 5, 6, 9, 7, 4, 6, -9, -9, 4, 4, 7, 7, 6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${7, -9, 1, 8, 0, 9, \\frac{12}{\\sqrt{5}}, 3} \\setminus {\\frac{12}{\\sqrt{5}}, 9, 3, -3 \\sqrt{2}, -3}$.\n", - "Output Answer": [ - "${-9, 0, 1, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -9, 1, 8, 0, 9, (12/(math.sqrt(5))), 3,))\nsnd = set(((12/(math.sqrt(5))), 9, 3, -3*math.sqrt(2), -3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.059,0.149,0.126,0.284\\}$ and $\\{0.067,0.158,0.223,0.229\\}$.", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.059, 0.149, 0.126, 0.284\ndistribution2 = 0.067, 0.158, 0.223, 0.229\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.173,0.287,0.322,0.117\\}$ and $\\{0.084,0.135,0.391,0.193\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.173, 0.287, 0.322, 0.117\ndistribution2 = 0.084, 0.135, 0.391, 0.193\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{17}{\\sqrt{3}}, 3.093, -6, 4 \\log (2), 0, -3 \\pi, -8, 9} \\cup {8 \\log (2), 1, 3 e, 3.093, 9, -2 \\pi, \\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-3 \\pi, -8, -2 \\pi, -6, 0, 1, 4 \\log (2), 3.093, 8 \\log (2), 3 e, 9, \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((17/(math.sqrt(3))), 3.093, -6, 4*math.log(2), 0, -3*math.pi, -8, 9,))\nsnd = set((8*math.log(2), 1, 3*math.e, 3.093, 9, -2*math.pi, (17/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, 9, 8, -3, -2}$.\n", - "Output Answer": [ - "$\\frac{17}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, 9, 8, -3, -2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, 2, 9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{79}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 2, 9\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, -8, 3, -10, -15, -9}$.\n", - "Output Answer": [ - "$\\frac{1217}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, -8, 3, -10, -15, -9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${7, -1, -7, -\\frac{43}{5}, 8}$.\n", - "Output Answer": [ - "${-\\frac{43}{5}, -7, -1, 7, 8}$" - ], - "Output Program": [ - "values = 7, -1, -7, -(43/5), 8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.2 x-1.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$-2.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(-2.2*x-1.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.197,0.22,0.105,0.201,0.083\\}$ and $\\{0.032,0.032,0.089,0.35,0.075\\}$.", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.197, 0.22, 0.105, 0.201, 0.083\ndistribution2 = 0.032, 0.032, 0.089, 0.35, 0.075\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, -5, -9, -\\frac{8}{5}, \\frac{14}{e}} \\cup {-3, -\\frac{3}{e}, -5, 0, -9, -4}$.\n", - "Output Answer": [ - "${-9, -5, -4, -3, -\\frac{8}{5}, -\\frac{3}{e}, 0, \\frac{14}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -5, -9, -(8/5), (14/math.e),))\nsnd = set((-3, -(3/math.e), -5, 0, -9, -4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5, -2 \\sqrt{5}, -8, 10, -\\frac{34}{5}, -7, 6} \\cup {-\\frac{38}{5}, 6, 1, -8, -2 \\sqrt{5}, 4}$.\n", - "Output Answer": [ - "${-8, -\\frac{38}{5}, -7, -\\frac{34}{5}, -2 \\sqrt{5}, 1, 4, 5, 6, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -2*math.sqrt(5), -8, 10, -(34/5), -7, 6,))\nsnd = set((-(38/5), 6, 1, -8, -2*math.sqrt(5), 4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 6, -6, -1, -8}$.\n", - "Output Answer": [ - "$-\\frac{3}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 6, -6, -1, -8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{51}{7}, -\\frac{23}{7}, \\frac{61}{7}, -\\frac{20}{7}, \\frac{58}{7}, -\\frac{66}{7}}$.\n", - "Output Answer": [ - "$-\\frac{41}{42}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(51/7), -(23/7), (61/7), -(20/7), (58/7), -(66/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{3}, 5 \\sqrt{3}, 0}$.\n", - "Output Answer": [ - "$2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(3), 5*math.sqrt(3), 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{2}, 4, \\sqrt{3}, -3, 0, -\\frac{52}{7}} \\setminus {\\frac{10}{\\sqrt{3}}, 3, 4, -\\frac{52}{7}}$.\n", - "Output Answer": [ - "${-3, 0, \\sqrt{3}, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(2), 4, math.sqrt(3), -3, 0, -(52/7),))\nsnd = set(((10/(math.sqrt(3))), 3, 4, -(52/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.122,0.163,0.079,0.018,0.122,0.336,0.069,0.023,0.037,0.014\\}$ and $\\{0.128,0.017,0.061,0.068,0.021,0.034,0.02,0.026,0.107,0.359\\}$.", - "Output Answer": [ - "$1.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.122, 0.163, 0.079, 0.018, 0.122, 0.336, 0.069, 0.023, 0.037, 0.014\ndistribution2 = 0.128, 0.017, 0.061, 0.068, 0.021, 0.034, 0.02, 0.026, 0.107, 0.359\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.113,0.103,0.042,0.067,0.042,0.067,0.056,0.049,0.287,0.037\\}$ and $\\{0.02,0.16,0.112,0.224,0.03,0.002,0.158,0.142,0.018,0.067\\}$.", - "Output Answer": [ - "$1.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.113, 0.103, 0.042, 0.067, 0.042, 0.067, 0.056, 0.049, 0.287, 0.037\ndistribution2 = 0.02, 0.16, 0.112, 0.224, 0.03, 0.002, 0.158, 0.142, 0.018, 0.067\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4.68, 0, 1, 5, -3, 6.896, 2, -10}$.\n", - "Output Answer": [ - "${-10, -3, 0, 1, 2, 4.68, 5, 6.896}$" - ], - "Output Program": [ - "values = 4.68, 0, 1, 5, -3, 6.896, 2, -10\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 8, 4}$.\n", - "Output Answer": [ - "$\\frac{24}{11}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 8, 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-9, -7, 3, 4 \\sqrt{2}, -10, -\\frac{9}{\\pi }, -\\frac{1}{3}, 9}$.\n", - "Output Answer": [ - "${-10, -9, -7, -\\frac{9}{\\pi }, -\\frac{1}{3}, 3, 4 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -7, 3, 4*math.sqrt(2), -10, -(9/math.pi), -(1/3), 9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x^2-1.2 x+0.1$ where $x \\sim $ \\text{PoissonDistribution}[2.7]\n", - "Output Answer": [ - "$15.84$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.7)\nprint(E(1.9*x**2-1.2*x+0.1))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8, 3.615, -10, -2} \\cup {-10, 2.861, 0, 8}$.\n", - "Output Answer": [ - "${-10, -2, 0, 2.861, 3.615, 8}$" - ], - "Output Program": [ - "fst = set((8, 3.615, -10, -2,))\nsnd = set((-10, 2.861, 0, 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{11}{7}, 2.1, 0, \\frac{32}{5}} \\setminus {-2 e, 5, 3 \\sqrt{5}, 2.1, 8, -4}$.\n", - "Output Answer": [ - "${-\\frac{11}{7}, 0, \\frac{32}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(11/7), 2.1, 0, (32/5),))\nsnd = set((-2*math.e, 5, 3*math.sqrt(5), 2.1, 8, -4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.5 x^2+2.3 x+2.2$ where $x \\sim $ \\text{BetaDistribution}[0.5,1.3]\n", - "Output Answer": [ - "$2.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.5, 1.3)\nprint(E(-0.5*x**2+2.3*x+2.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -\\frac{12}{\\sqrt{\\pi }}, 4, 6, 10, \\frac{31}{5}, 1, 1, 8, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$10+\\frac{12}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -(12/(math.sqrt(math.pi))), 4, 6, 10, (31/5), 1, 1, 8, 2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 6, -\\frac{13}{3}, -2 \\sqrt{3}, -\\frac{18}{\\sqrt{\\pi }}, 2, 12 \\log (2), -7 \\log (2), \\pi, 4, -2, 0}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, 6, -(13/3), -2*math.sqrt(3), -(18/(math.sqrt(math.pi))), 2, 12*math.log(2), -7*math.log(2), math.pi, 4, -2, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{3}{2}, \\frac{35}{2}, \\frac{15}{2}}$.\n", - "Output Answer": [ - "$\\frac{7}{2}$" - ], - "Output Program": [ - "import statistics\nvalues = (3/2), (35/2), (15/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, -5, \\frac{13}{7}, 0, 0, 2 \\sqrt{3}}$.", - "Output Answer": [ - "$\\frac{13}{14}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -5, (13/7), 0, 0, 2*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.147,0.107,0.073,0.051,0.054,0.256,0.047,0.073,0.131,0.04\\}$ and $\\{0.043,0.027,0.313,0.041,0.069,0.138,0.062,0.113,0.164,0.016\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.147, 0.107, 0.073, 0.051, 0.054, 0.256, 0.047, 0.073, 0.131, 0.04\ndistribution2 = 0.043, 0.027, 0.313, 0.041, 0.069, 0.138, 0.062, 0.113, 0.164, 0.016\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, -\\frac{15}{4}, -3, 9}$.\n", - "Output Answer": [ - "${-\\frac{15}{4}, -3, 0, 9}$" - ], - "Output Program": [ - "values = 0, -(15/4), -3, 9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, 2 e, -\\frac{22}{e}, -4 \\sqrt{3}, \\frac{2}{\\sqrt{3}}} \\setminus {\\frac{7}{e}, 2 e, -4 \\sqrt{3}, \\frac{2}{\\sqrt{3}}, 8, 2, 0}$.\n", - "Output Answer": [ - "${-\\frac{22}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 2*math.e, -(22/math.e), -4*math.sqrt(3), (2/(math.sqrt(3))),))\nsnd = set(((7/math.e), 2*math.e, -4*math.sqrt(3), (2/(math.sqrt(3))), 8, 2, 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, 8, -1, -\\frac{17}{2}, 8}$.\n", - "Output Answer": [ - "$\\frac{11}{10}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, 8, -1, -(17/2), 8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.28,0.18,0.359\\}$ and $\\{0.418,0.257,0.259\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.28, 0.18, 0.359\ndistribution2 = 0.418, 0.257, 0.259\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.155,0.228,0.218\\}$ and $\\{0.276,0.061,0.608\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.155, 0.228, 0.218\ndistribution2 = 0.276, 0.061, 0.608\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, -\\frac{3}{2}, 9}$.\n", - "Output Answer": [ - "$\\frac{23}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, -(3/2), 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${7, -10, 6, 5, -6, -5, -8, 9, 10} \\cap {-5, 8, -4, -8, 9, 1, -10, 0}$.\n", - "Output Answer": [ - "${-10, -8, -5, 9}$" - ], - "Output Program": [ - "fst = set((7, -10, 6, 5, -6, -5, -8, 9, 10,))\nsnd = set((-5, 8, -4, -8, 9, 1, -10, 0,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, -1, 3 \\sqrt{2}, 0} \\cup {-2, 3 \\sqrt{2}, 0, -1, 2}$.\n", - "Output Answer": [ - "${-2, -1, 0, 2, 3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -1, 3*math.sqrt(2), 0,))\nsnd = set((-2, 3*math.sqrt(2), 0, -1, 2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{34}{3}, 13, \\frac{7}{3}}$.\n", - "Output Answer": [ - "$\\frac{9282}{1837}$" - ], - "Output Program": [ - "import statistics\nvalues = (34/3), 13, (7/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, 5, 5, 12}$.\n", - "Output Answer": [ - "$86$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 5, 5, 12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{13}{3}, 11, \\frac{14}{3}, \\frac{16}{3}}$.\n", - "Output Answer": [ - "$\\frac{64064}{11587}$" - ], - "Output Program": [ - "import statistics\nvalues = (13/3), 11, (14/3), (16/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.06,0.09,0.186,0.094,0.141,0.043,0.082,0.102,0.054\\}$ and $\\{0.108,0.092,0.076,0.057,0.092,0.082,0.183,0.048,0.124\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.06, 0.09, 0.186, 0.094, 0.141, 0.043, 0.082, 0.102, 0.054\ndistribution2 = 0.108, 0.092, 0.076, 0.057, 0.092, 0.082, 0.183, 0.048, 0.124\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\sqrt{2}, 4 \\log (2), 7 \\sqrt{2}, -7, 2, -6, 2 \\sqrt{5}} \\cup {\\frac{1}{3}, 7 \\sqrt{2}, \\sqrt{2}, -6, -7, 2 \\sqrt{5}, -2 \\log (2), 2}$.\n", - "Output Answer": [ - "${-7, -6, -2 \\log (2), \\frac{1}{3}, \\sqrt{2}, 2, 4 \\log (2), 3 \\sqrt{2}, 2 \\sqrt{5}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(2), 4*math.log(2), 7*math.sqrt(2), -7, 2, -6, 2*math.sqrt(5),))\nsnd = set(((1/3), 7*math.sqrt(2), math.sqrt(2), -6, -7, 2*math.sqrt(5), -2*math.log(2), 2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{17}{\\sqrt{\\pi }}, -10, \\frac{5}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{5}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (17/(math.sqrt(math.pi))), -10, (5/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{17}{\\pi }, 1, -6, -1, -\\pi, 10, 4, -3, 5, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = (17/math.pi), 1, -6, -1, -math.pi, 10, 4, -3, 5, 3*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-10, -59049, 4, 256, 46656, 1}$.\n", - "Output Answer": [ - "$36\\ 2^{5/6} 3^{2/3} \\sqrt[6]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, -59049, 4, 256, 46656, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5 \\sqrt{2}, -\\frac{1}{\\sqrt{5}}, -8, -9} \\setminus {-\\frac{1}{\\sqrt{5}}, -\\sqrt{5}, 7, -5 \\sqrt{2}, 4, -8}$.\n", - "Output Answer": [ - "${-9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(2), -(1/(math.sqrt(5))), -8, -9,))\nsnd = set((-(1/(math.sqrt(5))), -math.sqrt(5), 7, -5*math.sqrt(2), 4, -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{9}{\\sqrt{2}}, 7 \\sqrt{2}, \\frac{9}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, -2 \\sqrt{2}, \\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{10 \\sqrt{2}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (9/(math.sqrt(2))), 7*math.sqrt(2), (9/(math.sqrt(2))), (11/(math.sqrt(2))), -2*math.sqrt(2), (1/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.177,0.438,0.048,0.096\\}$ and $\\{0.016,0.073,0.325,0.4\\}$.", - "Output Answer": [ - "$1.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.177, 0.438, 0.048, 0.096\ndistribution2 = 0.016, 0.073, 0.325, 0.4\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.322,0.046,0.123,0.06,0.143,0.201\\}$ and $\\{0.075,0.169,0.163,0.06,0.051,0.2\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.322, 0.046, 0.123, 0.06, 0.143, 0.201\ndistribution2 = 0.075, 0.169, 0.163, 0.06, 0.051, 0.2\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.079,0.074,0.004,0.134,0.087,0.291,0.21\\}$ and $\\{0.112,0.138,0.076,0.146,0.232,0.1,0.068\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.079, 0.074, 0.004, 0.134, 0.087, 0.291, 0.21\ndistribution2 = 0.112, 0.138, 0.076, 0.146, 0.232, 0.1, 0.068\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{4}{e}, -9, 0, -5, -\\frac{14}{\\pi }, -2, -6} \\cup {-5, -2, 0, -6, -9}$.\n", - "Output Answer": [ - "${-9, -6, -5, -\\frac{14}{\\pi }, -2, -\\frac{4}{e}, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/math.e), -9, 0, -5, -(14/math.pi), -2, -6,))\nsnd = set((-5, -2, 0, -6, -9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 3, 14, 7}$.\n", - "Output Answer": [ - "$\\frac{2184}{341}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 3, 14, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${216, -2, -343}$.\n", - "Output Answer": [ - "$42 \\sqrt[3]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 216, -2, -343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8 \\log (2), -\\frac{33}{4}, 3 \\sqrt{2}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{33}{4}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8*math.log(2), -(33/4), 3*math.sqrt(2), 4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{40}{3}, \\frac{49}{3}}$.\n", - "Output Answer": [ - "$\\frac{3920}{267}$" - ], - "Output Program": [ - "import statistics\nvalues = (40/3), (49/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${10, 9, -6 \\sqrt{2}, -\\frac{17}{2}, 0, \\pi, -0.91, 5 \\sqrt{3}} \\cup {5, 1.9, -6 \\sqrt{2}, 9, -2, \\frac{11}{2}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, -6 \\sqrt{2}, -2, -0.91, 0, 1.9, \\pi, 5, \\frac{11}{2}, 5 \\sqrt{3}, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 9, -6*math.sqrt(2), -(17/2), 0, math.pi, -0.91, 5*math.sqrt(3),))\nsnd = set((5, 1.9, -6*math.sqrt(2), 9, -2, (11/2), 5*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.11,0.231,0.141,0.08,0.198,0.086\\}$ and $\\{0.187,0.091,0.184,0.114,0.185,0.191\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.11, 0.231, 0.141, 0.08, 0.198, 0.086\ndistribution2 = 0.187, 0.091, 0.184, 0.114, 0.185, 0.191\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{21}{2}, \\frac{23}{2}}$.\n", - "Output Answer": [ - "$\\frac{483}{44}$" - ], - "Output Program": [ - "import statistics\nvalues = (21/2), (23/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 1, 15, 6}$.\n", - "Output Answer": [ - "$\\frac{480}{163}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 1, 15, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.29,0.219,0.111,0.036,0.094,0.096,0.052\\}$ and $\\{0.134,0.023,0.115,0.087,0.096,0.205,0.077\\}$.", - "Output Answer": [ - "$0.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.29, 0.219, 0.111, 0.036, 0.094, 0.096, 0.052\ndistribution2 = 0.134, 0.023, 0.115, 0.087, 0.096, 0.205, 0.077\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 5, 6, -3, 6561, 81}$.\n", - "Output Answer": [ - "$27 \\sqrt[6]{-10}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 5, 6, -3, 6561, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, -12}$.\n", - "Output Answer": [ - "$3 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, -9, -2 \\sqrt{3}, -3, 3, \\frac{8}{3}, \\frac{14}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-9, -2 \\sqrt{3}, -3, \\frac{8}{3}, 3, \\frac{14}{\\sqrt{3}}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -9, -2*math.sqrt(3), -3, 3, (8/3), (14/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4096, -8, 512, 1, 125, 25}$.\n", - "Output Answer": [ - "$16 \\sqrt[6]{-1} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4096, -8, 512, 1, 125, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{8}{e}, -\\frac{11}{e}, -\\frac{7}{e}, \\frac{10}{e}, \\frac{1}{e}, -\\frac{3}{e}}$.\n", - "Output Answer": [ - "$-\\frac{3}{e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(8/math.e), -(11/math.e), -(7/math.e), (10/math.e), (1/math.e), -(3/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${256, 7776, 25, 4096, 27}$.\n", - "Output Answer": [ - "$96\\ 3^{3/5} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 256, 7776, 25, 4096, 27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, -2, -\\frac{23}{4}, -10, 2, 8, 0, -\\frac{11}{5}, -\\sqrt{2}, 8, 6}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -2, -(23/4), -10, 2, 8, 0, -(11/5), -math.sqrt(2), 8, 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-6 \\log (2), 3, -6}$.\n", - "Output Answer": [ - "${-6, -6 \\log (2), 3}$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.log(2), 3, -6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{3}, \\frac{5}{\\sqrt{3}}, -6, 7 \\log (2), 5.46} \\cup {0, \\frac{5}{\\sqrt{3}}, -8, 10 \\log (2), 2 \\pi}$.\n", - "Output Answer": [ - "${-8, -6, 0, \\sqrt{3}, \\frac{5}{\\sqrt{3}}, 7 \\log (2), 5.46, 2 \\pi, 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), (5/(math.sqrt(3))), -6, 7*math.log(2), 5.46,))\nsnd = set((0, (5/(math.sqrt(3))), -8, 10*math.log(2), 2*math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${6, \\frac{11}{2}, 0.8, \\frac{16}{e}, \\sqrt{3}} \\setminus {2 \\sqrt{5}, \\frac{11}{2}, -3 \\sqrt{3}, 4.5}$.\n", - "Output Answer": [ - "${0.8, \\sqrt{3}, \\frac{16}{e}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, (11/2), 0.8, (16/math.e), math.sqrt(3),))\nsnd = set((2*math.sqrt(5), (11/2), -3*math.sqrt(3), 4.5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-5, 10, 10, 8, -14, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{601}{6}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 10, 10, 8, -14, 8\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${256, -7, 125, 1000, 16}$.\n", - "Output Answer": [ - "$40 \\sqrt[5]{-35}$" - ], - "Output Program": [ - "import math\n\nvalues = 256, -7, 125, 1000, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-7 \\sqrt{2}, -5, 3, 4, -7, \\frac{17}{e}, 3, 2 \\pi, 5, 9, -9, \\frac{29}{7}, \\frac{17}{\\sqrt{3}}, \\frac{3}{e}, 10}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7*math.sqrt(2), -5, 3, 4, -7, (17/math.e), 3, 2*math.pi, 5, 9, -9, (29/7), (17/(math.sqrt(3))), (3/math.e), 10\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, -5, -\\sqrt{2}, 6, -\\frac{10}{\\sqrt{3}}, -3 \\log (2), -\\frac{33}{5}, 9, \\frac{30}{\\pi }}$.", - "Output Answer": [ - "$-\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -5, -math.sqrt(2), 6, -(10/(math.sqrt(3))), -3*math.log(2), -(33/5), 9, (30/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 6, 7}$.", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 6, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 14, 14, 8}$.\n", - "Output Answer": [ - "$\\frac{672}{73}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 14, 14, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{3}, 7, -4, \\frac{14}{\\sqrt{5}}, 6}$.", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(3), 7, -4, (14/(math.sqrt(5))), 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.083,0.183,0.124,0.239\\}$ and $\\{0.174,0.291,0.266,0.2\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.083, 0.183, 0.124, 0.239\ndistribution2 = 0.174, 0.291, 0.266, 0.2\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{17}{\\pi }, 8, 8, -3, 3 e, 0, -10 \\log (2), 5, 5, -3, -2 e, -9, -2}$.\n", - "Output Answer": [ - "$9+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -(17/math.pi), 8, 8, -3, 3*math.e, 0, -10*math.log(2), 5, 5, -3, -2*math.e, -9, -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.058,0.175,0.101,0.145,0.068,0.045,0.118,0.089,0.081\\}$ and $\\{0.02,0.096,0.13,0.04,0.049,0.029,0.178,0.283,0.109\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.058, 0.175, 0.101, 0.145, 0.068, 0.045, 0.118, 0.089, 0.081\ndistribution2 = 0.02, 0.096, 0.13, 0.04, 0.049, 0.029, 0.178, 0.283, 0.109\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, -10, 6 \\log (2), -\\frac{29}{5}, -10, 10, -5}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -6, -10, 6*math.log(2), -(29/5), -10, 10, -5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{9}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, \\sqrt{5}, -\\frac{9}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}, -\\frac{18}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{6}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(9/(math.sqrt(5))), (6/(math.sqrt(5))), (6/(math.sqrt(5))), -(18/(math.sqrt(5))), -(13/(math.sqrt(5))), -(18/(math.sqrt(5))), (6/(math.sqrt(5))), -(13/(math.sqrt(5))), -(9/(math.sqrt(5))), (6/(math.sqrt(5))), -(9/(math.sqrt(5))), -(13/(math.sqrt(5))), -(18/(math.sqrt(5))), -(13/(math.sqrt(5))), (6/(math.sqrt(5))), math.sqrt(5), -(9/(math.sqrt(5))), -(18/(math.sqrt(5))), -(18/(math.sqrt(5))), (6/(math.sqrt(5))), (6/(math.sqrt(5))), -(13/(math.sqrt(5))), -(18/(math.sqrt(5))), (6/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $3. x-0.8 < -1.8 x-3.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9].", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(P((3.*x-0.8 < -1.8*x-3.)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.6 x^2-2.1 x-3.7$ where $x \\sim $ \\text{BetaDistribution}[0.6,0.2]\n", - "Output Answer": [ - "$-8.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.6, 0.2)\nprint(E(-4.6*x**2-2.1*x-3.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{8}{\\sqrt{5}}, -2, \\frac{9}{4}, -8, -10 \\log (2), -\\frac{8}{3}, 4}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "import math\n\nvalues = -(8/(math.sqrt(5))), -2, (9/4), -8, -10*math.log(2), -(8/3), 4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.4 x^3+4.1 x^2-0.4 x+4.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$11.54$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(-2.4*x**3+4.1*x**2-0.4*x+4.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{54}{7}, 1, 0, 8, -1, \\frac{24}{e}, 0, -2, -3 \\pi, -2 \\sqrt{3}, \\frac{13}{2}, -5}$.\n", - "Output Answer": [ - "$\\frac{24}{e}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = (54/7), 1, 0, 8, -1, (24/math.e), 0, -2, -3*math.pi, -2*math.sqrt(3), (13/2), -5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, -14, -6, -7}$.\n", - "Output Answer": [ - "$\\frac{50}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, -14, -6, -7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 3, 7, 7, 3, -7, 7, 3, -7, 7, -7, 7, -1, -7, -7, -7, -7, 7, 3, 7, 7, -1, -1, 7, 7, 7, 3, -7, -1, 3}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 3, 7, 7, 3, -7, 7, 3, -7, 7, -7, 7, -1, -7, -7, -7, -7, 7, 3, 7, 7, -1, -1, 7, 7, 7, 3, -7, -1, 3\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 4, 8, -5, -7, -8, -2}$.\n", - "Output Answer": [ - "$-\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 4, 8, -5, -7, -8, -2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{27}{4}, \\frac{37}{4}, \\frac{5}{4}}$.\n", - "Output Answer": [ - "$\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(27/4), (37/4), (5/4)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, 6, 8, -6, -11, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2537}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 6, 8, -6, -11, -15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.138,0.176,0.057,0.32,0.101,0.142\\}$ and $\\{0.158,0.083,0.148,0.335,0.1,0.098\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.138, 0.176, 0.057, 0.32, 0.101, 0.142\ndistribution2 = 0.158, 0.083, 0.148, 0.335, 0.1, 0.098\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{2}{\\pi }, 3 \\sqrt{5}, -2 \\sqrt{3}, -7.416, 5, 0, -3 \\sqrt{2}, -6, 8.45, 8.} \\cup {0, 3 \\sqrt{5}, 8., -3 \\sqrt{2}, 8.45, -\\frac{2}{\\pi }, 1.371, -3, -4, 9, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-7.416, -6, -3 \\sqrt{2}, -4, -2 \\sqrt{3}, -3, -\\frac{2}{\\pi }, 0, 1.371, 5, 3 \\sqrt{5}, 8., 8.45, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(2/math.pi), 3*math.sqrt(5), -2*math.sqrt(3), -7.416, 5, 0, -3*math.sqrt(2), -6, 8.45, 8.,))\nsnd = set((0, 3*math.sqrt(5), 8., -3*math.sqrt(2), 8.45, -(2/math.pi), 1.371, -3, -4, 9, -2*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -2, \\log (2), -1, -9} \\cup {\\log (2), -5, 4, -4 \\sqrt{3}, 8.8, -2, -1}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{3}, -5, -2, -1, \\log (2), 4, 8.8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -2, math.log(2), -1, -9,))\nsnd = set((math.log(2), -5, 4, -4*math.sqrt(3), 8.8, -2, -1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{7}{\\sqrt{\\pi }}, 2, 4, 1, 5}$.\n", - "Output Answer": [ - "${1, 2, \\frac{7}{\\sqrt{\\pi }}, 4, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/(math.sqrt(math.pi))), 2, 4, 1, 5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 19, 2, 2}$.\n", - "Output Answer": [ - "$\\frac{684}{199}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 19, 2, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, 3, -4, -2 \\pi, 7}$.\n", - "Output Answer": [ - "${-2 \\pi, -4, 3, 5, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 3, -4, -2*math.pi, 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, -\\frac{6}{\\sqrt{5}}, -6, 4 \\sqrt{5}, -5, 0, \\pi}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -(6/(math.sqrt(5))), -6, 4*math.sqrt(5), -5, 0, math.pi\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, \\sqrt{2}}$.\n", - "Output Answer": [ - "$7-\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-0.4, -\\frac{3}{\\sqrt{2}}, 2, \\frac{61}{7}, -\\frac{3}{2}, 4, 9.507, -6} \\cup {-\\frac{3}{2}, 7, -1, 9.507, -\\frac{7}{3}, -\\frac{3}{\\sqrt{2}}, -6.6, \\frac{61}{7}}$.\n", - "Output Answer": [ - "${-6.6, -6, -\\frac{7}{3}, -\\frac{3}{\\sqrt{2}}, -\\frac{3}{2}, -1, -0.4, 2, 4, 7, \\frac{61}{7}, 9.507}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.4, -(3/(math.sqrt(2))), 2, (61/7), -(3/2), 4, 9.507, -6,))\nsnd = set((-(3/2), 7, -1, 9.507, -(7/3), -(3/(math.sqrt(2))), -6.6, (61/7),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 3, -11, -14}$.\n", - "Output Answer": [ - "$66$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 3, -11, -14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{13}{3}, \\frac{10}{3}}$.\n", - "Output Answer": [ - "$\\frac{260}{69}$" - ], - "Output Program": [ - "import statistics\nvalues = (13/3), (10/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -7, -1} \\setminus {\\frac{14}{5}, -7, -9, 2, 1}$.\n", - "Output Answer": [ - "${-2, -1}$" - ], - "Output Program": [ - "fst = set((-2, -7, -1,))\nsnd = set(((14/5), -7, -9, 2, 1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{10}{\\sqrt{3}}, 3, -8, 0, -1, -\\frac{17}{3}, -2, -11 \\log (2)}$.\n", - "Output Answer": [ - "$8+\\frac{10}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = (10/(math.sqrt(3))), 3, -8, 0, -1, -(17/3), -2, -11*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, 5, -6, -1, -14}$.\n", - "Output Answer": [ - "$\\frac{187}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 5, -6, -1, -14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -2, -\\frac{8}{\\pi }, 3, 5, \\frac{28}{\\pi }} \\cup {-\\frac{23}{3}, 3, -7, -\\frac{8}{\\pi }, -\\frac{24}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{23}{3}, -\\frac{24}{\\pi }, -7, -\\frac{8}{\\pi }, -2, 3, 5, \\frac{28}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -2, -(8/math.pi), 3, 5, (28/math.pi),))\nsnd = set((-(23/3), 3, -7, -(8/math.pi), -(24/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -10, -13}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -10, -13\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.9 x^2-1.3 x+3.$ where $x \\sim $ \\text{NormalDistribution}[-0.2,2.8]\n", - "Output Answer": [ - "$41.87$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.2, 2.8)\nprint(E(4.9*x**2-1.3*x+3.))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{22}{3}, 5, 1, -1, -\\frac{23}{3}} \\cup {-\\frac{23}{3}, -1, 1, 5, -\\frac{22}{3}, 2}$.\n", - "Output Answer": [ - "${-\\frac{23}{3}, -\\frac{22}{3}, -1, 1, 2, 5}$" - ], - "Output Program": [ - "fst = set((-(22/3), 5, 1, -1, -(23/3),))\nsnd = set((-(23/3), -1, 1, 5, -(22/3), 2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, 5, 11}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 5, 11\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, 1, -1, -7, -11}$.\n", - "Output Answer": [ - "$\\frac{116}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, 1, -1, -7, -11\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3 \\pi, 2, 14 \\log (2), 8, -7 \\sqrt{2}, -2} \\cup {\\frac{1}{\\sqrt{2}}, 0, 3 \\pi, 8, -10 \\log (2), -3}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -10 \\log (2), -3, -2, 0, \\frac{1}{\\sqrt{2}}, 2, 8, 3 \\pi, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.pi, 2, 14*math.log(2), 8, -7*math.sqrt(2), -2,))\nsnd = set(((1/(math.sqrt(2))), 0, 3*math.pi, 8, -10*math.log(2), -3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, -\\sqrt{5}, -2, 4, -0.06, -4.252}$.\n", - "Output Answer": [ - "${-4.252, -\\sqrt{5}, -2, -0.06, 4, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -math.sqrt(5), -2, 4, -0.06, -4.252\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, -3 \\sqrt{5}, -8, -14 \\log (2), -1, \\frac{8}{\\sqrt{5}}} \\setminus {-1, \\frac{8}{\\sqrt{5}}, -8, 0, 3 \\log (2), -2}$.\n", - "Output Answer": [ - "${-14 \\log (2), -3 \\sqrt{5}, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -3*math.sqrt(5), -8, -14*math.log(2), -1, (8/(math.sqrt(5))),))\nsnd = set((-1, (8/(math.sqrt(5))), -8, 0, 3*math.log(2), -2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -8, -5, -8, 3, -3, -8, -6, -8, 3, 3, -7, 3, -6, -7, -8, -8, -6, 3, -7, -8, -6, -5, -8, -8, 3, -7}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -8, -5, -8, 3, -3, -8, -6, -8, 3, 3, -7, 3, -6, -7, -8, -8, -6, 3, -7, -8, -6, -5, -8, -8, 3, -7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${11 \\log (2), -e, -8, -\\sqrt{5}, 0, -\\frac{8}{\\sqrt{5}}, -\\frac{13}{\\pi }, -\\frac{10}{3}}$.\n", - "Output Answer": [ - "$8+11 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 11*math.log(2), -math.e, -8, -math.sqrt(5), 0, -(8/(math.sqrt(5))), -(13/math.pi), -(10/3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, -8, 16, -8, -1}$.\n", - "Output Answer": [ - "$4 \\sqrt[5]{-1} 10^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, -8, 16, -8, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{27}{\\pi }, \\frac{1}{\\sqrt{2}}, 2 \\sqrt{5}, 7, -5, \\frac{14}{\\sqrt{\\pi }}, 0, -8, -10, -2}$.\n", - "Output Answer": [ - "$10+\\frac{27}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (27/math.pi), (1/(math.sqrt(2))), 2*math.sqrt(5), 7, -5, (14/(math.sqrt(math.pi))), 0, -8, -10, -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\sqrt{5}, 3 \\sqrt{5}, -4 \\sqrt{5}, 2 \\sqrt{5}, 3 \\sqrt{5}, 0, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{3 \\sqrt{5}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.sqrt(5), 3*math.sqrt(5), -4*math.sqrt(5), 2*math.sqrt(5), 3*math.sqrt(5), 0, math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 11, 3, 16}$.\n", - "Output Answer": [ - "$\\frac{2112}{301}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 11, 3, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, 3, -10, -\\frac{57}{7}, \\frac{19}{5}} \\cup {2, \\frac{19}{5}, -10, 6, -3, 3}$.\n", - "Output Answer": [ - "${-10, -\\frac{57}{7}, -3, 2, 3, \\frac{19}{5}, 6}$" - ], - "Output Program": [ - "fst = set((2, 3, -10, -(57/7), (19/5),))\nsnd = set((2, (19/5), -10, 6, -3, 3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x-4.2$ where $x \\sim $ \\text{NormalDistribution}[-0.4,0.6]\n", - "Output Answer": [ - "$-5.36$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.4, 0.6)\nprint(E(2.9*x-4.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.078,0.118,0.062,0.107,0.134,0.05,0.157,0.037,0.096,0.051\\}$ and $\\{0.035,0.129,0.118,0.07,0.097,0.058,0.159,0.025,0.119,0.098\\}$.", - "Output Answer": [ - "$0.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.078, 0.118, 0.062, 0.107, 0.134, 0.05, 0.157, 0.037, 0.096, 0.051\ndistribution2 = 0.035, 0.129, 0.118, 0.07, 0.097, 0.058, 0.159, 0.025, 0.119, 0.098\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x+2.$ where $x \\sim $ \\text{PoissonDistribution}[1.1]\n", - "Output Answer": [ - "$3.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.1)\nprint(E(1.6*x+2.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $0.66 < 3.7 x-1.5 < 4.42$ where $x \\sim $ \\text{PoissonDistribution}[2.2].", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.2)\nprint(P((0.66 < 3.7*x-1.5) & (3.7*x-1.5 < 4.42)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4, 4.996, -4, -2, \\frac{13}{7}, -6}$.\n", - "Output Answer": [ - "${-6, -4, -2, \\frac{13}{7}, 4, 4.996}$" - ], - "Output Program": [ - "values = 4, 4.996, -4, -2, (13/7), -6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, \\frac{13}{e}, -4, \\frac{37}{7}, 1, 0, -1, \\frac{24}{e}, 3, \\frac{1}{e}, 0}$.\n", - "Output Answer": [ - "$4+\\frac{24}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, (13/math.e), -4, (37/7), 1, 0, -1, (24/math.e), 3, (1/math.e), 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -5 \\log (2), -7 \\log (2), -6, 0, -1, -\\frac{7}{e}, 8, 2 \\pi, \\frac{5}{\\sqrt{3}}, -10, -4 \\sqrt{5}, -7, -\\frac{11}{\\sqrt{2}}}$.", - "Output Answer": [ - "$-6 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -5*math.log(2), -7*math.log(2), -6, 0, -1, -(7/math.e), 8, 2*math.pi, (5/(math.sqrt(3))), -10, -4*math.sqrt(5), -7, -(11/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{15}{2}, -9, -10, 4, -2 e, -\\frac{17}{4}, -2, 5.8, -6} \\cup {-1, 7, -10, -2 e, -4.3, -\\frac{9}{2}, 4}$.\n", - "Output Answer": [ - "${-10, -9, -6, -2 e, -\\frac{9}{2}, -4.3, -\\frac{17}{4}, -2, -1, 4, 5.8, 7, \\frac{15}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((15/2), -9, -10, 4, -2*math.e, -(17/4), -2, 5.8, -6,))\nsnd = set((-1, 7, -10, -2*math.e, -4.3, -(9/2), 4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{8}{\\sqrt{\\pi }}, -1}$.\n", - "Output Answer": [ - "${-1, \\frac{8}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (8/(math.sqrt(math.pi))), -1\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{6}{7}, 2 e, -2 \\sqrt{3}, -e, -\\frac{46}{7}, -8, 3, 7, 7, -1, 8, -\\frac{19}{2}, \\frac{3}{2}, -\\frac{15}{e}, -\\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{35}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (6/7), 2*math.e, -2*math.sqrt(3), -math.e, -(46/7), -8, 3, 7, 7, -1, 8, -(19/2), (3/2), -(15/math.e), -math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-59049, -729, -4, 343, 117649, 46656}$.\n", - "Output Answer": [ - "$378 \\sqrt[6]{-1} \\sqrt[3]{2} 3^{2/3} \\sqrt{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -59049, -729, -4, 343, 117649, 46656\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, 5, -1}$.\n", - "Output Answer": [ - "$2^{2/3} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 5, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, -2, -9, 13, 1, 3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2237}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, -2, -9, 13, 1, 3\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5, 6, -8, -3, -\\frac{55}{7}, 7} \\cup {-9, -\\frac{55}{7}, 6, 7, 5, -6}$.\n", - "Output Answer": [ - "${-9, -8, -\\frac{55}{7}, -6, -3, 5, 6, 7}$" - ], - "Output Program": [ - "fst = set((5, 6, -8, -3, -(55/7), 7,))\nsnd = set((-9, -(55/7), 6, 7, 5, -6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{5}, -\\sqrt{5}, \\frac{27}{e}, 3 \\log (2), \\frac{38}{7}, 5, -8, 2 e, -6 \\sqrt{2}, -7, -\\frac{11}{\\sqrt{3}}, -4, 3, -5}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-4-\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(5), -math.sqrt(5), (27/math.e), 3*math.log(2), (38/7), 5, -8, 2*math.e, -6*math.sqrt(2), -7, -(11/(math.sqrt(3))), -4, 3, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, \\frac{17}{\\sqrt{\\pi }}, 9, -6, \\frac{3}{\\pi }, -6, -8, 2, 1, -\\frac{21}{4}}$.\n", - "Output Answer": [ - "$8+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, (17/(math.sqrt(math.pi))), 9, -6, (3/math.pi), -6, -8, 2, 1, -(21/4)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{3}{e}, 4, \\frac{43}{5}, 9, 8, -\\frac{9}{\\sqrt{2}}, \\pi, 8, -3, 4, 1, -5, -\\sqrt{3}, -8, 0}$.", - "Output Answer": [ - "$\\frac{3}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (3/math.e), 4, (43/5), 9, 8, -(9/(math.sqrt(2))), math.pi, 8, -3, 4, 1, -5, -math.sqrt(3), -8, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${9 \\log (2), \\frac{29}{\\pi }, 6}$.", - "Output Answer": [ - "$9 \\log (2)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9*math.log(2), (29/math.pi), 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -13, -14, -10}$.\n", - "Output Answer": [ - "$\\frac{425}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -13, -14, -10\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 e, 3, 2, -5}$.", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.e, 3, 2, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{4}{e}, 2, -2, -8.783, -5}$.\n", - "Output Answer": [ - "${-8.783, -5, -2, \\frac{4}{e}, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = (4/math.e), 2, -2, -8.783, -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${8, -7, -8, 14 \\log (2)}$.\n", - "Output Answer": [ - "${-8, -7, 8, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -7, -8, 14*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3.5, -3, 2 \\sqrt{2}, 4, 8} \\setminus {5, -7.5, 4, \\frac{25}{e}, -3, 7, 2 \\sqrt{2}, -5}$.\n", - "Output Answer": [ - "${3.5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((3.5, -3, 2*math.sqrt(2), 4, 8,))\nsnd = set((5, -7.5, 4, (25/math.e), -3, 7, 2*math.sqrt(2), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -8, 9, 10, 6 \\sqrt{2}} \\setminus {-2, 6, 8}$.\n", - "Output Answer": [ - "${-8, 6 \\sqrt{2}, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -8, 9, 10, 6*math.sqrt(2),))\nsnd = set((-2, 6, 8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 2, 3, -5, -5, 3, 2, -10, -5, 2, 2, 2, -5, -6, -6, 2, 2, -5, 2, -10, 3, -5, -6, -6, -5, 3, -6}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 2, 3, -5, -5, 3, 2, -10, -5, 2, 2, 2, -5, -6, -6, 2, 2, -5, 2, -10, 3, -5, -6, -6, -5, 3, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, -1, -9, -1, 7, 4, 5}$.\n", - "Output Answer": [ - "$\\frac{4}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, -1, -9, -1, 7, 4, 5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{11}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$-\\frac{31}{4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(11/(math.sqrt(3))), -(8/(math.sqrt(3))), -(7/(math.sqrt(3))), -(5/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, -8, 2}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{19}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -8, 2\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -7, 6, -6, 6, -7, 6, -6, 7, -6, -6, -6, -6, -10, -6, -6, -6, -6, -6, -10, -7, 6, 7}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -7, 6, -6, 6, -7, 6, -6, 7, -6, -6, -6, -6, -10, -6, -6, -6, -6, -6, -10, -7, 6, 7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-2.8 x^2-1.5 x+0.1 < -2.1 x-0.1$ where $x \\sim $ \\text{NormalDistribution}[-1.5,3.].", - "Output Answer": [ - "$0.93$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.5, 3.)\nprint(P((-2.8*x**2-1.5*x+0.1 < -2.1*x-0.1)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 3, 8, -6}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 3, 8, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 5, 11, 11}$.\n", - "Output Answer": [ - "$\\frac{55}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 5, 11, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -4 \\sqrt{2}, -3 \\log (2), -6.3, -6 \\sqrt{2}, 0} \\cup {-4 \\sqrt{2}, -6.3, -5, -3 \\log (2), -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -7, -6.3, -4 \\sqrt{2}, -5, -3 \\log (2), 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -4*math.sqrt(2), -3*math.log(2), -6.3, -6*math.sqrt(2), 0,))\nsnd = set((-4*math.sqrt(2), -6.3, -5, -3*math.log(2), -6*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -2, -2, -6, -2, -6, -6, -1, -2, -2, -2, -1, -2, -6, -2, -2, -2, -2, -6, -2, -1, -2, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -2, -2, -6, -2, -6, -6, -1, -2, -2, -2, -1, -2, -6, -2, -2, -2, -2, -6, -2, -1, -2, -2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{5}{\\sqrt{2}}, -5 \\log (2), 3}$.\n", - "Output Answer": [ - "$\\frac{5}{\\sqrt{2}}+5 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = (5/(math.sqrt(2))), -5*math.log(2), 3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.139,0.156,0.132,0.077\\}$ and $\\{0.094,0.212,0.442,0.072\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.139, 0.156, 0.132, 0.077\ndistribution2 = 0.094, 0.212, 0.442, 0.072\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.041,0.085,0.247,0.104,0.144\\}$ and $\\{0.185,0.383,0.081,0.062,0.203\\}$.", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.041, 0.085, 0.247, 0.104, 0.144\ndistribution2 = 0.185, 0.383, 0.081, 0.062, 0.203\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5, -3 \\sqrt{3}, 4, -5., \\frac{3}{\\sqrt{5}}, -1.26, 7} \\setminus {7, \\frac{2}{\\sqrt{3}}, 3, 4}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -5., -5, -1.26, \\frac{3}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -3*math.sqrt(3), 4, -5., (3/(math.sqrt(5))), -1.26, 7,))\nsnd = set((7, (2/(math.sqrt(3))), 3, 4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{1}{2}, 7, 7, -1, \\frac{17}{5}, -2 e, -8}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(1/2), 7, 7, -1, (17/5), -2*math.e, -8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{2}, -\\pi, -\\frac{47}{7}, 11 \\log (2), -6, 3}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{5}{2}-\\pi \\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/2), -math.pi, -(47/7), 11*math.log(2), -6, 3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 2, 12, -12, 12, -14}$.\n", - "Output Answer": [ - "$\\frac{4397}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 2, 12, -12, 12, -14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -10, 7, -7, -4, -\\frac{22}{5}} \\setminus {7, 1, -10, -\\frac{22}{5}, -4.3}$.\n", - "Output Answer": [ - "${-7, -4, 0}$" - ], - "Output Program": [ - "fst = set((0, -10, 7, -7, -4, -(22/5),))\nsnd = set((7, 1, -10, -(22/5), -4.3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{\\sqrt{3}}, 2, 4, \\frac{20}{\\pi }, -5, 10, -1}$.\n", - "Output Answer": [ - "${-5, -1, \\frac{1}{\\sqrt{3}}, 2, 4, \\frac{20}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = (1/(math.sqrt(3))), 2, 4, (20/math.pi), -5, 10, -1\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-2.08 < 3.9 x-3.7 < -1.86$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.7].", - "Output Answer": [ - "$0.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.7)\nprint(P((-2.08 < 3.9*x-3.7) & (3.9*x-3.7 < -1.86)))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6.7, -7, -3.795, -8} \\setminus {-\\frac{12}{\\sqrt{5}}, 7, -5.92, 1.1, -7}$.\n", - "Output Answer": [ - "${-8, -6.7, -3.795}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6.7, -7, -3.795, -8,))\nsnd = set((-(12/(math.sqrt(5))), 7, -5.92, 1.1, -7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.2 x^2+0.8 x-2.5$ where $x \\sim $ \\text{NormalDistribution}[-1.6,1.8]\n", - "Output Answer": [ - "$-28.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 1.8)\nprint(E(-4.2*x**2+0.8*x-2.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{8}{\\sqrt{3}}, 0, -1, -\\frac{17}{\\sqrt{3}}, -5}$.\n", - "Output Answer": [ - "$\\frac{17}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(8/(math.sqrt(3))), 0, -1, -(17/(math.sqrt(3))), -5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{12}{\\sqrt{\\pi }}, -\\frac{13}{2}, 5, -6, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -\\frac{13}{2}, -6, 5, \\frac{12}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (12/(math.sqrt(math.pi))), -(13/2), 5, -6, -4*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{24}{e}, -\\pi, -\\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-\\frac{21}{\\sqrt{5}}, -\\pi, \\frac{24}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = (24/math.e), -math.pi, -(21/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 7, 7}$.\n", - "Output Answer": [ - "$\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 7, 7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{4}{\\sqrt{5}}, -5, -10, -7, 1, -8, -\\frac{27}{5}}$.\n", - "Output Answer": [ - "$10+\\frac{4}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = (4/(math.sqrt(5))), -5, -10, -7, 1, -8, -(27/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.2,0.285,0.093,0.143,0.151\\}$ and $\\{0.15,0.126,0.226,0.05,0.277\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.2, 0.285, 0.093, 0.143, 0.151\ndistribution2 = 0.15, 0.126, 0.226, 0.05, 0.277\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.9 x-5.$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$-3.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(2.9*x-5.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-0.86 < 0.5 x^2-4.7 x-1.2 < 2.15$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7].", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(P((-0.86 < 0.5*x**2-4.7*x-1.2) & (0.5*x**2-4.7*x-1.2 < 2.15)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5, -1, -1, -4, -8, 8, -\\frac{12}{\\sqrt{5}}, 2 \\sqrt{5}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -1, -1, -4, -8, 8, -(12/(math.sqrt(5))), 2*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x+2.1$ where $x \\sim $ \\text{ExponentialDistribution}[0.9]\n", - "Output Answer": [ - "$2.77$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.9)\nprint(E(0.6*x+2.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 3, 3 \\sqrt{5}, -4, -5, 7, \\sqrt{3}, -5}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 3, 3*math.sqrt(5), -4, -5, 7, math.sqrt(3), -5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{13}{e}, 0, \\frac{5}{e}, -\\frac{19}{e}, -8, -5 \\sqrt{2}, -\\frac{14}{3}, 2 e} \\cup {-\\frac{13}{e}, 6, \\frac{5}{e}, -\\frac{14}{3}, -\\frac{9}{\\sqrt{2}}, 2 e, \\frac{11}{e}}$.\n", - "Output Answer": [ - "${-8, -5 \\sqrt{2}, -\\frac{19}{e}, -\\frac{9}{\\sqrt{2}}, -\\frac{13}{e}, -\\frac{14}{3}, 0, \\frac{5}{e}, \\frac{11}{e}, 2 e, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/math.e), 0, (5/math.e), -(19/math.e), -8, -5*math.sqrt(2), -(14/3), 2*math.e,))\nsnd = set((-(13/math.e), 6, (5/math.e), -(14/3), -(9/(math.sqrt(2))), 2*math.e, (11/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.382,0.185,0.319\\}$ and $\\{0.008,0.21,0.745\\}$.", - "Output Answer": [ - "$1.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.382, 0.185, 0.319\ndistribution2 = 0.008, 0.21, 0.745\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${243, 100, 512, 1, -100000}$.\n", - "Output Answer": [ - "$120 \\sqrt[5]{-2} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 243, 100, 512, 1, -100000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -2, \\frac{9}{2}, \\frac{9}{2}, 1, \\frac{11}{2}, \\frac{9}{2}, -2, -\\frac{19}{2}, \\frac{9}{2}, -2, \\frac{11}{2}, -2, \\frac{11}{2}, \\frac{11}{2}, -\\frac{19}{2}, \\frac{9}{2}, -2, -2, -\\frac{19}{2}, \\frac{9}{2}, 1, -\\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -2, (9/2), (9/2), 1, (11/2), (9/2), -2, -(19/2), (9/2), -2, (11/2), -2, (11/2), (11/2), -(19/2), (9/2), -2, -2, -(19/2), (9/2), 1, -(19/2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 3, 7, -8, 9, 7, 5, \\sqrt{5}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 3, 7, -8, 9, 7, 5, math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{4}{\\sqrt{3}}, 8, 3, 3, -4, -5, 0, \\sqrt{2}, 4}$.", - "Output Answer": [ - "$\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(4/(math.sqrt(3))), 8, 3, 3, -4, -5, 0, math.sqrt(2), 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${10, -9, -7, 9, 3, 0}$.\n", - "Output Answer": [ - "$\\frac{314}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -9, -7, 9, 3, 0\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8, -10, 7, -1, \\frac{1}{\\sqrt{3}}, -4, 9, -9.718} \\cup {-8, -1, -2, \\frac{1}{\\sqrt{3}}, 7, -10, -9.718, 5, 9}$.\n", - "Output Answer": [ - "${-10, -9.718, -8, -4, -2, -1, \\frac{1}{\\sqrt{3}}, 5, 7, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -10, 7, -1, (1/(math.sqrt(3))), -4, 9, -9.718,))\nsnd = set((-8, -1, -2, (1/(math.sqrt(3))), 7, -10, -9.718, 5, 9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 5 \\sqrt{2}, -9, 7, -\\frac{10}{\\sqrt{3}}, 7, 9, \\frac{19}{e}, \\pi, 4, -\\frac{9}{\\sqrt{\\pi }}, -\\sqrt{3}, 9, \\frac{16}{\\pi }, -1}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 5*math.sqrt(2), -9, 7, -(10/(math.sqrt(3))), 7, 9, (19/math.e), math.pi, 4, -(9/(math.sqrt(math.pi))), -math.sqrt(3), 9, (16/math.pi), -1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -4, 1, 2, 1, 1, -9, -9, 7, -4, 5, -4, -9, -9, 7, 7, 5, -9, 5, 2, 7, 5, 5, -4, 1, -4, 1, -9}$.\n", - "Output Answer": [ - "$\\{1,-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -4, 1, 2, 1, 1, -9, -9, 7, -4, 5, -4, -9, -9, 7, 7, 5, -9, 5, 2, 7, 5, 5, -4, 1, -4, 1, -9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.066,0.098,0.128,0.096,0.041,0.031,0.038,0.102,0.143\\}$ and $\\{0.199,0.106,0.067,0.111,0.086,0.026,0.082,0.031,0.214,0.045\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.066, 0.098, 0.128, 0.096, 0.041, 0.031, 0.038, 0.102, 0.143\ndistribution2 = 0.199, 0.106, 0.067, 0.111, 0.086, 0.026, 0.082, 0.031, 0.214, 0.045\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 14, 14, 2, 15}$.\n", - "Output Answer": [ - "$\\frac{587}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 14, 14, 2, 15\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${7, 7, 7, 7, -4, -4, -4, -4, 7, 2, -4, -4, 2, -4, -4, -4, 7, -4, 7, 2, -4, 2, 2, -4}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 7, 7, 7, 7, -4, -4, -4, -4, 7, 2, -4, -4, 2, -4, -4, -4, 7, -4, 7, 2, -4, 2, 2, -4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-9.5, -\\frac{37}{7}, -\\frac{34}{5}}$.\n", - "Output Answer": [ - "${-9.5, -\\frac{34}{5}, -\\frac{37}{7}}$" - ], - "Output Program": [ - "values = -9.5, -(37/7), -(34/5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 3, \\frac{9}{\\sqrt{2}}, -2 \\pi, -6 \\sqrt{2}, 2}$.\n", - "Output Answer": [ - "$\\frac{9}{\\sqrt{2}}+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 3, (9/(math.sqrt(2))), -2*math.pi, -6*math.sqrt(2), 2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{3}{2}, -10, -9, 8, -3.2, -2 \\log (2)}$.\n", - "Output Answer": [ - "${-10, -9, -3.2, -\\frac{3}{2}, -2 \\log (2), 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/2), -10, -9, 8, -3.2, -2*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{14}{\\sqrt{\\pi }}, \\frac{19}{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{19}{2}+\\frac{14}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (14/(math.sqrt(math.pi))), (19/2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{5}{3}, -9, 0.46, 3, -\\frac{34}{7}, -8, -\\frac{7}{\\sqrt{2}}} \\cup {-\\frac{34}{7}, -\\frac{7}{\\sqrt{2}}, 7, -8, -2, -\\frac{4}{3}, 9, 0.46}$.\n", - "Output Answer": [ - "${-9, -8, -\\frac{7}{\\sqrt{2}}, -\\frac{34}{7}, -2, -\\frac{5}{3}, -\\frac{4}{3}, 0.46, 3, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(5/3), -9, 0.46, 3, -(34/7), -8, -(7/(math.sqrt(2))),))\nsnd = set((-(34/7), -(7/(math.sqrt(2))), 7, -8, -2, -(4/3), 9, 0.46,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5 \\log (2), -4}$.", - "Output Answer": [ - "$\\frac{1}{2} (5 \\log (2)-4)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5*math.log(2), -4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{3}{4}, -10, -4, -1, -\\frac{53}{7}, 8, -\\frac{5}{e}, 5, -2 e} \\cup {8, -1, -\\frac{1}{2}, -3, -\\frac{53}{7}, 5, 2 e, -7, \\frac{22}{e}, \\frac{25}{4}}$.\n", - "Output Answer": [ - "${-10, -\\frac{53}{7}, -7, -2 e, -4, -3, -\\frac{5}{e}, -1, -\\frac{1}{2}, \\frac{3}{4}, 5, 2 e, \\frac{25}{4}, 8, \\frac{22}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((3/4), -10, -4, -1, -(53/7), 8, -(5/math.e), 5, -2*math.e,))\nsnd = set((8, -1, -(1/2), -3, -(53/7), 5, 2*math.e, -7, (22/math.e), (25/4),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{33}{5}, -\\frac{23}{5}, -\\frac{9}{5}, \\frac{32}{5}, -5}$.\n", - "Output Answer": [ - "$\\frac{8}{25}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (33/5), -(23/5), -(9/5), (32/5), -5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5.2, 8.44, \\sqrt{2}, -8, -4 \\sqrt{5}, 5 \\sqrt{2}} \\setminus {\\sqrt{2}, -8, -5.84, -4, -4 \\sqrt{5}, 5.2}$.\n", - "Output Answer": [ - "${5 \\sqrt{2}, 8.44}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.2, 8.44, math.sqrt(2), -8, -4*math.sqrt(5), 5*math.sqrt(2),))\nsnd = set((math.sqrt(2), -8, -5.84, -4, -4*math.sqrt(5), 5.2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, 4, \\frac{15}{\\pi }, -5 \\sqrt{3}, \\frac{8}{\\pi }, -\\frac{19}{2}, -e, -4, -1, -7, 2 \\pi}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 4, (15/math.pi), -5*math.sqrt(3), (8/math.pi), -(19/2), -math.e, -4, -1, -7, 2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, 5, -8, 8, -8, 0, -6, -\\pi, -8, -\\frac{22}{3}}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 5, -8, 8, -8, 0, -6, -math.pi, -8, -(22/3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.19,0.088,0.102,0.008,0.105,0.098,0.069,0.009,0.034,0.104\\}$ and $\\{0.048,0.173,0.02,0.034,0.15,0.1,0.037,0.101,0.163,0.099\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.19, 0.088, 0.102, 0.008, 0.105, 0.098, 0.069, 0.009, 0.034, 0.104\ndistribution2 = 0.048, 0.173, 0.02, 0.034, 0.15, 0.1, 0.037, 0.101, 0.163, 0.099\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{31}{\\pi }, 9, -\\frac{8}{\\sqrt{5}}, -2 e, -\\frac{1}{\\sqrt{2}}, 5, 0, -4, \\frac{20}{7}, -5, -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$2 e+\\frac{31}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (31/math.pi), 9, -(8/(math.sqrt(5))), -2*math.e, -(1/(math.sqrt(2))), 5, 0, -4, (20/7), -5, -(3/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-9, 1, 2 \\pi, -6, -\\frac{1}{3}}$.", - "Output Answer": [ - "$-\\frac{1}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, 1, 2*math.pi, -6, -(1/3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x+4.1$ where $x \\sim $ \\text{BetaDistribution}[1.9,1.4]\n", - "Output Answer": [ - "$4.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.9, 1.4)\nprint(E(1.2*x+4.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 9, 1, -6, 7, -4, -6, -6, 1, 9, 1, 9, 7, -4, -6, 1, -6, -4, -6, -6}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 9, 1, -6, 7, -4, -6, -6, 1, 9, 1, 9, 7, -4, -6, 1, -6, -4, -6, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -6, \\frac{23}{3}, 2 \\sqrt{5}, \\frac{3}{e}, 1, -8, 8, -\\frac{19}{\\sqrt{5}}, -\\frac{19}{\\sqrt{5}}, 5, 10}$.\n", - "Output Answer": [ - "$10+\\frac{19}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -6, (23/3), 2*math.sqrt(5), (3/math.e), 1, -8, 8, -(19/(math.sqrt(5))), -(19/(math.sqrt(5))), 5, 10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${3 \\sqrt{5}, 5.95, 0, 4, -6, \\frac{46}{7}, 6, 1}$.\n", - "Output Answer": [ - "${-6, 0, 1, 4, 5.95, 6, \\frac{46}{7}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.sqrt(5), 5.95, 0, 4, -6, (46/7), 6, 1\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 4, \\frac{6}{\\sqrt{5}}, -4, 3, 6.603} \\setminus {5, 6.603, -\\frac{11}{\\sqrt{5}}, -8}$.\n", - "Output Answer": [ - "${-4, \\frac{6}{\\sqrt{5}}, 3, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 4, (6/(math.sqrt(5))), -4, 3, 6.603,))\nsnd = set((5, 6.603, -(11/(math.sqrt(5))), -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.122,0.074,0.082,0.16,0.072,0.13,0.034,0.102,0.087,0.064\\}$ and $\\{0.129,0.08,0.093,0.061,0.055,0.083,0.209,0.085,0.019,0.032\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.122, 0.074, 0.082, 0.16, 0.072, 0.13, 0.034, 0.102, 0.087, 0.064\ndistribution2 = 0.129, 0.08, 0.093, 0.061, 0.055, 0.083, 0.209, 0.085, 0.019, 0.032\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{26}{3}, -\\frac{13}{2}, \\pi, -2, 0, -\\frac{1}{2}} \\setminus {-3, -\\frac{13}{2}, -\\frac{8}{\\sqrt{\\pi }}, 0, -\\frac{22}{5}, 3 \\sqrt{2}, -\\frac{26}{3}}$.\n", - "Output Answer": [ - "${-2, -\\frac{1}{2}, \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(26/3), -(13/2), math.pi, -2, 0, -(1/2),))\nsnd = set((-3, -(13/2), -(8/(math.sqrt(math.pi))), 0, -(22/5), 3*math.sqrt(2), -(26/3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.258,0.446,0.034,0.023,0.075,0.115,0.009,0.007\\}$ and $\\{0.128,0.021,0.047,0.017,0.11,0.152,0.079,0.108\\}$.", - "Output Answer": [ - "$1.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.258, 0.446, 0.034, 0.023, 0.075, 0.115, 0.009, 0.007\ndistribution2 = 0.128, 0.021, 0.047, 0.017, 0.11, 0.152, 0.079, 0.108\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $0.09 < 2.2 x-0.2 < 2.49$ where $x \\sim $ \\text{PoissonDistribution}[1.1].", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.1)\nprint(P((0.09 < 2.2*x-0.2) & (2.2*x-0.2 < 2.49)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.6 x^2-4.2 x+0.4$ where $x \\sim $ \\text{NormalDistribution}[0.3,1.2]\n", - "Output Answer": [ - "$-3.31$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.3, 1.2)\nprint(E(-1.6*x**2-4.2*x+0.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 2 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 0, -4 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, 0, -4 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 0, 2 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 0, -\\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 2*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 0, -4*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), 0, -4*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 0, 2*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 0, -math.sqrt(5), 2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -2, 9, \\frac{7}{\\pi }} \\setminus {-\\frac{7}{\\pi }, -\\frac{10}{e}, 9, -7, 2 \\pi, -2, 0}$.\n", - "Output Answer": [ - "${\\frac{7}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -2, 9, (7/math.pi),))\nsnd = set((-(7/math.pi), -(10/math.e), 9, -7, 2*math.pi, -2, 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.3 x^2+0.7 x-2.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$2.85$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(3.3*x**2+0.7*x-2.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -5, -\\frac{1}{2}, -8 \\log (2), -e, 0, -\\frac{9}{\\sqrt{2}}, -6, -2, -7, -7, -7, 6, \\frac{25}{7}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$6+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -5, -(1/2), -8*math.log(2), -math.e, 0, -(9/(math.sqrt(2))), -6, -2, -7, -7, -7, 6, (25/7), -5*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{3}{e}, -\\frac{25}{\\pi }, 4, -7, 2, -\\frac{18}{\\pi }, -2, -1} \\cup {2, \\frac{2}{\\pi }, 4, -7, -3, -\\frac{20}{\\pi }, -2, -9, -1}$.\n", - "Output Answer": [ - "${-9, -\\frac{25}{\\pi }, -7, -\\frac{20}{\\pi }, -\\frac{18}{\\pi }, -3, -2, -\\frac{3}{e}, -1, \\frac{2}{\\pi }, 2, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(3/math.e), -(25/math.pi), 4, -7, 2, -(18/math.pi), -2, -1,))\nsnd = set((2, (2/math.pi), 4, -7, -3, -(20/math.pi), -2, -9, -1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -6, -9}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "values = 7, -6, -9\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{14}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, -\\frac{14}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{14}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(14/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -(1/(math.sqrt(math.pi))), -(1/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), -(14/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), -(1/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), -(1/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x-0.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.9]\n", - "Output Answer": [ - "$-0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.9)\nprint(E(1.*x-0.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\sqrt{2}, -3 \\sqrt{2}, -7 \\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.sqrt(2), -3*math.sqrt(2), -7*math.sqrt(2), 5*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(17/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (8/(math.sqrt(3))), (8/(math.sqrt(3))), (4/(math.sqrt(3))), (8/(math.sqrt(3))), (8/(math.sqrt(3))), (16/(math.sqrt(3))), -(17/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), -(17/(math.sqrt(3))), (16/(math.sqrt(3))), (8/(math.sqrt(3))), (16/(math.sqrt(3))), (16/(math.sqrt(3))), (16/(math.sqrt(3))), (4/(math.sqrt(3))), (16/(math.sqrt(3))), -(17/(math.sqrt(3))), (4/(math.sqrt(3))), (16/(math.sqrt(3))), (4/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\sqrt{5}, 4 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$-\\frac{2}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.sqrt(5), 4*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, 1, -7, -7}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{57}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 1, -7, -7\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, 0.8, -5.152, -4, 5, -1} \\setminus {-6.6, 5, 2, 4}$.\n", - "Output Answer": [ - "${-5.152, -4, -1, 0.8}$" - ], - "Output Program": [ - "fst = set((4, 0.8, -5.152, -4, 5, -1,))\nsnd = set((-6.6, 5, 2, 4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x-1.8$ where $x \\sim $ \\text{BetaDistribution}[1.7,1.]\n", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 1.)\nprint(E(3.7*x-1.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, -10, -9, -11}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{83}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -10, -9, -11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{8}{\\sqrt{3}}, 3, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{8}{\\sqrt{3}}, 3, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(8/(math.sqrt(3))), 3, 5*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{47}{7}, -\\frac{9}{2}, -\\frac{7}{\\sqrt{3}}, -\\frac{27}{e}, -6 \\log (2)}$.\n", - "Output Answer": [ - "${-\\frac{27}{e}, -\\frac{9}{2}, -6 \\log (2), -\\frac{7}{\\sqrt{3}}, \\frac{47}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = (47/7), -(9/2), -(7/(math.sqrt(3))), -(27/math.e), -6*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.088,0.08,0.536,0.164,0.008,0.002,0.025,0.002,0.084,0.008\\}$ and $\\{0.158,0.19,0.093,0.083,0.017,0.035,0.164,0.072,0.014,0.097\\}$.", - "Output Answer": [ - "$0.92$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.088, 0.08, 0.536, 0.164, 0.008, 0.002, 0.025, 0.002, 0.084, 0.008\ndistribution2 = 0.158, 0.19, 0.093, 0.083, 0.017, 0.035, 0.164, 0.072, 0.014, 0.097\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.018,0.04,0.037,0.805,0.084\\}$ and $\\{0.14,0.105,0.103,0.121,0.339\\}$.", - "Output Answer": [ - "$1.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.018, 0.04, 0.037, 0.805, 0.084\ndistribution2 = 0.14, 0.105, 0.103, 0.121, 0.339\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{13}{2}, 9 \\log (2), -3, 5} \\setminus {1, -4.109, 9 \\log (2), -\\frac{1}{2}, 2, 5, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{13}{2}, -3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/2), 9*math.log(2), -3, 5,))\nsnd = set((1, -4.109, 9*math.log(2), -(1/2), 2, 5, -2*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 e, -3 e, 2 e, -e, -e}$.\n", - "Output Answer": [ - "$-\\frac{e}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.e, -3*math.e, 2*math.e, -math.e, -math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{24}{\\pi }, -\\frac{1}{\\sqrt{2}}, -\\sqrt{5}, 0, -\\frac{27}{e}, 9, 4, -1} \\setminus {-2 \\sqrt{2}, 4, \\frac{9}{\\sqrt{5}}, \\sqrt{5}, 9}$.\n", - "Output Answer": [ - "${-\\frac{27}{e}, -\\sqrt{5}, -1, -\\frac{1}{\\sqrt{2}}, 0, \\frac{24}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((24/math.pi), -(1/(math.sqrt(2))), -math.sqrt(5), 0, -(27/math.e), 9, 4, -1,))\nsnd = set((-2*math.sqrt(2), 4, (9/(math.sqrt(5))), math.sqrt(5), 9,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -4, 9, -9}$.\n", - "Output Answer": [ - "$-\\frac{7}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -4, 9, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-4, 10, 512, 1, 27}$.\n", - "Output Answer": [ - "$4 \\sqrt[5]{-5} 2^{2/5} 3^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 10, 512, 1, 27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 0, -8., 2 e, \\frac{25}{4}, -3, \\frac{13}{\\sqrt{\\pi }}} \\setminus {\\frac{25}{4}, \\frac{5}{\\sqrt{2}}, -8., e, -3, 8, \\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-6, 0, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 0, -8., 2*math.e, (25/4), -3, (13/(math.sqrt(math.pi))),))\nsnd = set(((25/4), (5/(math.sqrt(2))), -8., math.e, -3, 8, (13/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, -4 \\sqrt{2}, 9, 2, -e, 3, -\\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{3}}, -4 \\sqrt{2}, -e, 0, 2, 3, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -4*math.sqrt(2), 9, 2, -math.e, 3, -(13/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.201,0.053,0.042,0.054,0.026,0.066,0.273,0.004\\}$ and $\\{0.164,0.115,0.12,0.176,0.163,0.061,0.038,0.002\\}$.", - "Output Answer": [ - "$0.7$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.201, 0.053, 0.042, 0.054, 0.026, 0.066, 0.273, 0.004\ndistribution2 = 0.164, 0.115, 0.12, 0.176, 0.163, 0.061, 0.038, 0.002\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{e}, \\frac{25}{\\pi }, \\frac{2}{\\sqrt{3}}, 2, \\frac{54}{7}, -5 \\sqrt{2}, 0, -7, -\\frac{17}{\\sqrt{3}}, -\\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{17}{\\sqrt{3}}+\\frac{25}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/math.e), (25/math.pi), (2/(math.sqrt(3))), 2, (54/7), -5*math.sqrt(2), 0, -7, -(17/(math.sqrt(3))), -(1/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 2, 4, 4, -6, -7, -4, -6, -7, -7, -5, -7, -6, -4, -7, 2, -5, -6, 2, -6, 2, -4}$.\n", - "Output Answer": [ - "$\\{-6,-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 2, 4, 4, -6, -7, -4, -6, -7, -7, -5, -7, -6, -4, -7, 2, -5, -6, 2, -6, 2, -4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, -13, -4, -3}$.\n", - "Output Answer": [ - "$23$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -13, -4, -3\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 e, 2 e, 3 e, -2 e, 3 e, -e, -e, -e, -e, 3 e, 2 e, -2 e, 4 e, 3 e, 3 e, 4 e, 2 e, 3 e, -2 e, 4 e, 4 e}$.\n", - "Output Answer": [ - "$\\{3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.e, 2*math.e, 3*math.e, -2*math.e, 3*math.e, -math.e, -math.e, -math.e, -math.e, 3*math.e, 2*math.e, -2*math.e, 4*math.e, 3*math.e, 3*math.e, 4*math.e, 2*math.e, 3*math.e, -2*math.e, 4*math.e, 4*math.e\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 \\pi, -9, -4, -6, -10, 4 \\log (2), \\frac{35}{4}, 7, 0, 8, -7, e, \\frac{11}{e}, -\\frac{8}{\\pi }}$.\n", - "Output Answer": [ - "$10+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.pi, -9, -4, -6, -10, 4*math.log(2), (35/4), 7, 0, 8, -7, math.e, (11/math.e), -(8/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${16, \\frac{21}{2}, \\frac{33}{2}}$.\n", - "Output Answer": [ - "$\\frac{3696}{269}$" - ], - "Output Program": [ - "import statistics\nvalues = 16, (21/2), (33/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -4, 5, -4, 1, 1, 6, 2, -4, 4, 2, 6, 5, 1, 5, 4, 6, 5, 2, 1, 4, 2, 2, 2, 5}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -4, 5, -4, 1, 1, 6, 2, -4, 4, 2, 6, 5, 1, 5, 4, 6, 5, 2, 1, 4, 2, 2, 2, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{5}, 3 \\sqrt{5}, 2 \\sqrt{5}, -2 \\sqrt{5}, 2 \\sqrt{5}, 0, 0, 0, \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, 0, -2 \\sqrt{5}, \\sqrt{5}, 0, 0, \\sqrt{5}, 0, 0, 2 \\sqrt{5}, 0, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(5), 3*math.sqrt(5), 2*math.sqrt(5), -2*math.sqrt(5), 2*math.sqrt(5), 0, 0, 0, math.sqrt(5), math.sqrt(5), math.sqrt(5), math.sqrt(5), 0, -2*math.sqrt(5), math.sqrt(5), 0, 0, math.sqrt(5), 0, 0, 2*math.sqrt(5), 0, 3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^2-0.5 x-3.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$-11.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(-1.9*x**2-0.5*x-3.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x^2-0.5 x+1.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.7]\n", - "Output Answer": [ - "$12.38$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.7)\nprint(E(1.9*x**2-0.5*x+1.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -5 \\sqrt{2}, -3 e}$.\n", - "Output Answer": [ - "$3 e-3$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -5*math.sqrt(2), -3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x^2+0.6 x+2.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$19.46$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(4.3*x**2+0.6*x+2.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5, 0, -4 \\sqrt{3}, -7, 3.76, 4.62, 10, 9, \\frac{27}{7}, 2, -\\frac{4}{\\sqrt{3}}, \\frac{1}{e}} \\cup {-\\frac{12}{7}, 10, 0, \\frac{1}{e}, 4.51, \\frac{13}{\\sqrt{2}}, 4.62, -7, -4 \\sqrt{3}, 3, 5, 8}$.\n", - "Output Answer": [ - "${-7, -4 \\sqrt{3}, -5, -\\frac{4}{\\sqrt{3}}, -\\frac{12}{7}, 0, \\frac{1}{e}, 2, 3, 3.76, \\frac{27}{7}, 4.51, 4.62, 5, 8, 9, \\frac{13}{\\sqrt{2}}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 0, -4*math.sqrt(3), -7, 3.76, 4.62, 10, 9, (27/7), 2, -(4/(math.sqrt(3))), (1/math.e),))\nsnd = set((-(12/7), 10, 0, (1/math.e), 4.51, (13/(math.sqrt(2))), 4.62, -7, -4*math.sqrt(3), 3, 5, 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{14}{3}, 10, \\frac{1}{\\sqrt{3}}, -3 \\pi, -3, 0, 3, -2 \\pi, -6} \\cup {-\\pi, -3, 10, -\\frac{28}{3}, 3, -1, -2 \\pi, -4 \\sqrt{5}, \\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\frac{28}{3}, -4 \\sqrt{5}, -2 \\pi, -6, -\\frac{14}{3}, -\\pi, -3, -1, 0, \\frac{1}{\\sqrt{3}}, 3, \\frac{7}{\\sqrt{3}}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(14/3), 10, (1/(math.sqrt(3))), -3*math.pi, -3, 0, 3, -2*math.pi, -6,))\nsnd = set((-math.pi, -3, 10, -(28/3), 3, -1, -2*math.pi, -4*math.sqrt(5), (7/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.251,0.088,0.465\\}$ and $\\{0.109,0.257,0.457\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.251, 0.088, 0.465\ndistribution2 = 0.109, 0.257, 0.457\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, 8, -1}$.\n", - "Output Answer": [ - "$2 \\sqrt[3]{-1} 10^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, 8, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, 0, -\\frac{19}{4}, 0, -9 \\log (2), 10, -\\frac{29}{\\pi }, 10, -\\frac{15}{2}, 6, -7}$.\n", - "Output Answer": [ - "$10+\\frac{29}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 0, -(19/4), 0, -9*math.log(2), 10, -(29/math.pi), 10, -(15/2), 6, -7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, 14, 6, 4}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{227}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 14, 6, 4\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${7, -4, -3, 9, -6, 1, -10, 0, 6} \\cup {3, -2 \\pi, -3, -10, 9, -4, 7, -9, 6}$.\n", - "Output Answer": [ - "${-10, -9, -2 \\pi, -6, -4, -3, 0, 1, 3, 6, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -4, -3, 9, -6, 1, -10, 0, 6,))\nsnd = set((3, -2*math.pi, -3, -10, 9, -4, 7, -9, 6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{16}{3}, -\\frac{16}{3}, \\frac{13}{3}, -\\frac{7}{3}, -\\frac{26}{3}, \\frac{5}{3}, -\\frac{13}{3}}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (16/3), -(16/3), (13/3), -(7/3), -(26/3), (5/3), -(13/3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.1 x-3.7$ where $x \\sim $ \\text{PoissonDistribution}[2.5]\n", - "Output Answer": [ - "$6.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.5)\nprint(E(4.1*x-3.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4, 2 \\pi, 2 \\sqrt{5}, -5, -3 \\pi}$.\n", - "Output Answer": [ - "${-3 \\pi, -5, 4, 2 \\sqrt{5}, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 2*math.pi, 2*math.sqrt(5), -5, -3*math.pi\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, 8, -1, -3 \\sqrt{2}, -5, 1, 2, -0.34}$.\n", - "Output Answer": [ - "${-5, -3 \\sqrt{2}, -1, -0.34, 1, 2, 8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 8, -1, -3*math.sqrt(2), -5, 1, 2, -0.34\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -\\frac{6}{\\sqrt{5}}, \\pi, \\frac{1}{4}, 7, 7, -6, 3 \\log (2)}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{1}{4}+3 \\log (2)\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -(6/(math.sqrt(5))), math.pi, (1/4), 7, 7, -6, 3*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, 5, \\frac{19}{5}, \\frac{25}{e}}$.\n", - "Output Answer": [ - "$\\frac{25}{e}-\\frac{19}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 5, (19/5), (25/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{5}, 4 \\sqrt{3}, -3}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), 4*math.sqrt(3), -3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, 3 e, -\\frac{29}{4}, 1, 5, -\\sqrt{5}} \\setminus {10, 4, -\\frac{29}{4}, 0, 5}$.\n", - "Output Answer": [ - "${-\\sqrt{5}, 1, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 3*math.e, -(29/4), 1, 5, -math.sqrt(5),))\nsnd = set((10, 4, -(29/4), 0, 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 1, -5, -3, -3, -3, -1, 8, 1, 8, -1, 8, 8, -5, 8, -3, 1, -1, -1, -5, -5, -1, 8, -5}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 1, -5, -3, -3, -3, -1, 8, 1, 8, -1, 8, 8, -5, 8, -3, 1, -1, -1, -5, -5, -1, 8, -5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3, 4, 49, 4096, 32}$.\n", - "Output Answer": [ - "$8 \\sqrt[5]{-3} 2^{4/5} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 4, 49, 4096, 32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, 4, 2, 6, 10, 1, 8, 5, -10, 7} \\cap {2, 3, 8, 1, 7, -7, -3, 6, 0, -1}$.\n", - "Output Answer": [ - "${1, 2, 6, 7, 8}$" - ], - "Output Program": [ - "fst = set((-9, 4, 2, 6, 10, 1, 8, 5, -10, 7,))\nsnd = set((2, 3, 8, 1, 7, -7, -3, 6, 0, -1,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x^2-0.5 x-3.2$ where $x \\sim $ \\text{BetaDistribution}[0.3,1.7]\n", - "Output Answer": [ - "$-3.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 1.7)\nprint(E(2.1*x**2-0.5*x-3.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{27}{4}, \\frac{3}{e}, \\frac{36}{7}, 2, -\\frac{8}{\\sqrt{\\pi }}, 1, 2, e, -2 \\sqrt{5}, -4, 1, -\\frac{19}{4}, -5}$.\n", - "Output Answer": [ - "$\\frac{333}{28}$" - ], - "Output Program": [ - "import math\n\nvalues = -(27/4), (3/math.e), (36/7), 2, -(8/(math.sqrt(math.pi))), 1, 2, math.e, -2*math.sqrt(5), -4, 1, -(19/4), -5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-3, -4 \\sqrt{2}, \\pi, 1, \\frac{22}{5}, \\frac{35}{4}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -3, 1, \\pi, \\frac{22}{5}, \\frac{35}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -4*math.sqrt(2), math.pi, 1, (22/5), (35/4)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-10, 3, -4, -8.592, -2, 2, 8} \\setminus {3, -10, -4.992, 8, 7, -\\pi, 4}$.\n", - "Output Answer": [ - "${-8.592, -4, -2, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, 3, -4, -8.592, -2, 2, 8,))\nsnd = set((3, -10, -4.992, 8, 7, -math.pi, 4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-5. x^2-2.9 x-1.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-16.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-5.*x**2-2.9*x-1.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 4, -216, 10000}$.\n", - "Output Answer": [ - "$(10+10 i) 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 4, -216, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 0, -7, -9, -7, -9, 0, -3, 0, -9, -1, -7, -1, 2, -7, 1, -9, 0, -9, -9, -9, -9, -9, -7, 1, -3}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 0, -7, -9, -7, -9, 0, -3, 0, -9, -1, -7, -1, 2, -7, 1, -9, 0, -9, -9, -9, -9, -9, -7, 1, -3\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-5, -7, 1000, 2401}$.\n", - "Output Answer": [ - "$35\\ 2^{3/4} \\sqrt[4]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -7, 1000, 2401\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{3}, 4, 4, 3 e, 9, -8, -3, -\\frac{3}{\\pi }, -6, 6, \\frac{22}{5}, \\frac{19}{e}}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(3), 4, 4, 3*math.e, 9, -8, -3, -(3/math.pi), -6, 6, (22/5), (19/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.34,0.184,0.083,0.111,0.083,0.031\\}$ and $\\{0.054,0.131,0.153,0.198,0.148,0.223\\}$.", - "Output Answer": [ - "$0.64$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.34, 0.184, 0.083, 0.111, 0.083, 0.031\ndistribution2 = 0.054, 0.131, 0.153, 0.198, 0.148, 0.223\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, -1, 7, -9, 5, -5, -4}$.\n", - "Output Answer": [ - "$-\\frac{6}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, -1, 7, -9, 5, -5, -4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, -12, -3, 9, 3, 12}$.\n", - "Output Answer": [ - "$\\frac{183}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -12, -3, 9, 3, 12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 17}$.\n", - "Output Answer": [ - "$\\frac{187}{14}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-8 \\log (2), 2, 9, 4, -2 e, 8} \\setminus {-2, 9, -2 e, \\log (2), 8}$.\n", - "Output Answer": [ - "${-8 \\log (2), 2, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8*math.log(2), 2, 9, 4, -2*math.e, 8,))\nsnd = set((-2, 9, -2*math.e, math.log(2), 8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{3}, -\\frac{9}{\\sqrt{2}}, \\frac{23}{\\pi }, -\\frac{11}{2}, -4, -7, 9, -10}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(3), -(9/(math.sqrt(2))), (23/math.pi), -(11/2), -4, -7, 9, -10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, \\frac{17}{\\sqrt{3}}, -\\frac{13}{5}, 0, -9, -8, -6, -8}$.\n", - "Output Answer": [ - "${-9, -8, -8, -6, -\\frac{13}{5}, 0, 0, \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, (17/(math.sqrt(3))), -(13/5), 0, -9, -8, -6, -8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, -6, 0, -6, -3, 0, 1, 0, -6, 1, 0, 0, -3, 0, -6, 0, -3, -3, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, 0, -6, 0, -6, -3, 0, 1, 0, -6, 1, 0, 0, -3, 0, -6, 0, -3, -3, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-5, \\frac{24}{\\pi }, 10}$.\n", - "Output Answer": [ - "${-5, \\frac{24}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, (24/math.pi), 10\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4.2, 2}$.\n", - "Output Answer": [ - "${2, 4.2}$" - ], - "Output Program": [ - "values = 4.2, 2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 3, 7} \\setminus {-2 \\sqrt{5}, -4, 0, 7, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-9, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 3, 7,))\nsnd = set((-2*math.sqrt(5), -4, 0, 7, -3*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, -4, 15, -14}$.\n", - "Output Answer": [ - "$\\frac{461}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -4, 15, -14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -9.8, \\frac{6}{\\sqrt{\\pi }}, 6} \\setminus {\\frac{22}{e}, -\\frac{13}{\\sqrt{\\pi }}, -4, -6, 10}$.\n", - "Output Answer": [ - "${-9.8, \\frac{6}{\\sqrt{\\pi }}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -9.8, (6/(math.sqrt(math.pi))), 6,))\nsnd = set(((22/math.e), -(13/(math.sqrt(math.pi))), -4, -6, 10,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{16}{3}, -1, -\\frac{22}{3}, \\frac{22}{3}, 1}$.\n", - "Output Answer": [ - "$\\frac{16}{15}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (16/3), -1, -(22/3), (22/3), 1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -\\frac{5}{e}, -\\frac{11}{\\sqrt{2}}, -3, -6, -\\frac{16}{\\sqrt{3}}, -8} \\cup {-6, -4.02, -3, 10, -\\frac{11}{\\sqrt{2}}, -\\frac{8}{\\sqrt{3}}, -\\frac{5}{e}, 4}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -8, -\\frac{11}{\\sqrt{2}}, -6, -\\frac{8}{\\sqrt{3}}, -4.02, -3, -\\frac{5}{e}, 4, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -(5/math.e), -(11/(math.sqrt(2))), -3, -6, -(16/(math.sqrt(3))), -8,))\nsnd = set((-6, -4.02, -3, 10, -(11/(math.sqrt(2))), -(8/(math.sqrt(3))), -(5/math.e), 4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\pi, 9, -6, 2}$.\n", - "Output Answer": [ - "${-6, 2, \\pi, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = math.pi, 9, -6, 2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.5 x-3.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$3.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(1.5*x-3.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4 \\log (2), -6 \\log (2), 2 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{8 \\log (2)}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -4*math.log(2), -6*math.log(2), 2*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.088,0.066,0.055,0.23,0.127,0.243\\}$ and $\\{0.278,0.28,0.049,0.185,0.1,0.086\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.088, 0.066, 0.055, 0.23, 0.127, 0.243\ndistribution2 = 0.278, 0.28, 0.049, 0.185, 0.1, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -3 \\sqrt{2}, -4, -8, -10, 0, -\\sqrt{3}, 1, 8}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -3*math.sqrt(2), -4, -8, -10, 0, -math.sqrt(3), 1, 8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4, 2, \\frac{11}{\\sqrt{2}}, -2, 5, -6, 3 \\sqrt{2}, -7}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, 2, (11/(math.sqrt(2))), -2, 5, -6, 3*math.sqrt(2), -7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x-4.4$ where $x \\sim $ \\text{PoissonDistribution}[3.8]\n", - "Output Answer": [ - "$1.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.8)\nprint(E(1.6*x-4.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, \\frac{28}{3}, -\\frac{48}{5}, -4, -10}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, (28/3), -(48/5), -4, -10\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5.2, -7, 0, -\\frac{1}{\\sqrt{3}}, 6, \\frac{13}{3}, -7}$.\n", - "Output Answer": [ - "${-7, -7, -\\frac{1}{\\sqrt{3}}, 0, \\frac{13}{3}, 5.2, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 5.2, -7, 0, -(1/(math.sqrt(3))), 6, (13/3), -7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 0}$.\n", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "values = 8, 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.215,0.071,0.083,0.094,0.072,0.141,0.047,0.167\\}$ and $\\{0.077,0.052,0.077,0.126,0.253,0.073,0.124,0.083\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.215, 0.071, 0.083, 0.094, 0.072, 0.141, 0.047, 0.167\ndistribution2 = 0.077, 0.052, 0.077, 0.126, 0.253, 0.073, 0.124, 0.083\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-9, -7, -1, 10, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-9, -7, -\\sqrt{5}, -1, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -7, -1, 10, -math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${1, -7, 9, -1}$.\n", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 1, -7, 9, -1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.161,0.115,0.085,0.055,0.045,0.087,0.066,0.205,0.088\\}$ and $\\{0.031,0.065,0.022,0.22,0.122,0.003,0.177,0.093,0.05\\}$.", - "Output Answer": [ - "$0.7$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.161, 0.115, 0.085, 0.055, 0.045, 0.087, 0.066, 0.205, 0.088\ndistribution2 = 0.031, 0.065, 0.022, 0.22, 0.122, 0.003, 0.177, 0.093, 0.05\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{3}, -3 \\sqrt{3}, 0, \\frac{15}{\\pi }, -4 \\sqrt{5}, 7, 4, 8} \\setminus {\\sqrt{3}, 3, -4 \\sqrt{5}, \\frac{12}{\\pi }, 8}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, 0, 4, \\frac{15}{\\pi }, 7, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(3), -3*math.sqrt(3), 0, (15/math.pi), -4*math.sqrt(5), 7, 4, 8,))\nsnd = set((math.sqrt(3), 3, -4*math.sqrt(5), (12/math.pi), 8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.178,0.023,0.021,0.138,0.422,0.059\\}$ and $\\{0.089,0.108,0.125,0.296,0.091,0.152\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.178, 0.023, 0.021, 0.138, 0.422, 0.059\ndistribution2 = 0.089, 0.108, 0.125, 0.296, 0.091, 0.152\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, 2, -3 \\sqrt{3}, -\\frac{9}{7}, 7, -2, \\frac{9}{2}, -5, 8 \\log (2), 3, -\\sqrt{3}, 4 \\log (2), -5, -3, -4}$.", - "Output Answer": [ - "$-\\frac{9}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, 2, -3*math.sqrt(3), -(9/7), 7, -2, (9/2), -5, 8*math.log(2), 3, -math.sqrt(3), 4*math.log(2), -5, -3, -4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${6, -7, 10, 7, -14}$.\n", - "Output Answer": [ - "$\\frac{1073}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -7, 10, 7, -14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${e, -\\frac{11}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(e-\\frac{11}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.e, -(11/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.8 x^3-4.3 x^2-4.7 x-4.6$ where $x \\sim $ \\text{PoissonDistribution}[3.1]\n", - "Output Answer": [ - "$222.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.1)\nprint(E(4.8*x**3-4.3*x**2-4.7*x-4.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\pi, -\\pi, -\\pi, -\\pi, 3 \\pi, -\\pi, -\\pi, -\\pi, -\\pi, -2 \\pi, -2 \\pi, -\\pi, -\\pi, -\\pi, -\\pi, 3 \\pi, -\\pi, -\\pi, -2 \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$\\{-\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.pi, -math.pi, -math.pi, -math.pi, 3*math.pi, -math.pi, -math.pi, -math.pi, -math.pi, -2*math.pi, -2*math.pi, -math.pi, -math.pi, -math.pi, -math.pi, 3*math.pi, -math.pi, -math.pi, -2*math.pi, -2*math.pi\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 18, 18, 9}$.\n", - "Output Answer": [ - "$\\frac{612}{43}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 18, 18, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.142,0.012,0.295,0.058,0.002,0.022,0.222\\}$ and $\\{0.144,0.097,0.054,0.061,0.148,0.13,0.232\\}$.", - "Output Answer": [ - "$0.69$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.142, 0.012, 0.295, 0.058, 0.002, 0.022, 0.222\ndistribution2 = 0.144, 0.097, 0.054, 0.061, 0.148, 0.13, 0.232\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 7776, -64, -32768, -64, 6561}$.\n", - "Output Answer": [ - "$288 \\sqrt[3]{2} \\sqrt[6]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 7776, -64, -32768, -64, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6 \\sqrt{2}, \\sqrt{3}, -3, -7}$.\n", - "Output Answer": [ - "$6 \\sqrt{2}+\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.sqrt(2), math.sqrt(3), -3, -7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 1000, 16, 625, 1296}$.\n", - "Output Answer": [ - "$60 \\sqrt[5]{2} 3^{3/5} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 1000, 16, 625, 1296\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.053,0.059,0.04,0.133,0.112,0.129,0.165,0.138,0.118\\}$ and $\\{0.024,0.011,0.069,0.15,0.105,0.071,0.165,0.147,0.179\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.053, 0.059, 0.04, 0.133, 0.112, 0.129, 0.165, 0.138, 0.118\ndistribution2 = 0.024, 0.011, 0.069, 0.15, 0.105, 0.071, 0.165, 0.147, 0.179\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -5, 6 \\sqrt{3}, \\frac{9}{\\sqrt{5}}, \\frac{67}{7}, 3 \\pi, -3, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$5+6 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -5, 6*math.sqrt(3), (9/(math.sqrt(5))), (67/7), 3*math.pi, -3, 5*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2 \\sqrt{5}, -3 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}} \\cap {-4 \\sqrt{5}, -2 \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, 3 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, 2 \\sqrt{5}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(5), -3*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5),))\nsnd = set((-4*math.sqrt(5), -2*math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), 3*math.sqrt(5), 2*math.sqrt(5),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5 \\sqrt{2}, 3, 9, -8, -\\frac{31}{\\pi }}$.\n", - "Output Answer": [ - "$9+\\frac{31}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(2), 3, 9, -8, -(31/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.122,0.181,0.072,0.094,0.041,0.066,0.362\\}$ and $\\{0.035,0.082,0.31,0.119,0.181,0.122,0.084\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.122, 0.181, 0.072, 0.094, 0.041, 0.066, 0.362\ndistribution2 = 0.035, 0.082, 0.31, 0.119, 0.181, 0.122, 0.084\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x^2-2. x-1.8$ where $x \\sim $ \\text{NormalDistribution}[-1.8,1.2]\n", - "Output Answer": [ - "$4.61$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 1.2)\nprint(E(0.6*x**2-2.*x-1.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, \\frac{5}{3}, 13}$.\n", - "Output Answer": [ - "$\\frac{1170}{329}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, (5/3), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.137,0.43,0.046,0.288\\}$ and $\\{0.085,0.032,0.304,0.326\\}$.", - "Output Answer": [ - "$0.99$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.137, 0.43, 0.046, 0.288\ndistribution2 = 0.085, 0.032, 0.304, 0.326\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2 \\log (2), 2, -2, -2, -7, \\frac{6}{\\sqrt{\\pi }}, 2.8, -10}$.\n", - "Output Answer": [ - "${-10, -7, -2, -2, 2 \\log (2), 2, 2.8, \\frac{6}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.log(2), 2, -2, -2, -7, (6/(math.sqrt(math.pi))), 2.8, -10\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $0.95 < 1.8 x-0.6 < 1.34$ where $x \\sim $ \\text{ExponentialDistribution}[2.].", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 2.)\nprint(P((0.95 < 1.8*x-0.6) & (1.8*x-0.6 < 1.34)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${343, 1, -3}$.\n", - "Output Answer": [ - "$7 \\sqrt[3]{-3}$" - ], - "Output Program": [ - "import math\n\nvalues = 343, 1, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, 6, 1, 6, 1}$.\n", - "Output Answer": [ - "$\\frac{123}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 6, 1, 6, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{\\pi }, -3 \\sqrt{3}, -\\frac{21}{e}, 2 \\sqrt{2}, 6, -6, -2, 3, 0, -9 \\log (2), 8, -8, 7}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/math.pi), -3*math.sqrt(3), -(21/math.e), 2*math.sqrt(2), 6, -6, -2, 3, 0, -9*math.log(2), 8, -8, 7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, 11, 11, 8, 9, 7}$.\n", - "Output Answer": [ - "$64$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 11, 11, 8, 9, 7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 1, 7, 1, -\\frac{14}{3}, 1, -9, 2, 5}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "values = -7, 1, 7, 1, -(14/3), 1, -9, 2, 5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${6, -\\frac{12}{5}, 0, -9, 5, -4 \\sqrt{2}, 6 \\sqrt{2}, 2 \\log (2), 7} \\cup {7, 6 \\sqrt{2}, -2, 6, 9, 4 \\sqrt{2}, -\\frac{12}{5}}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{2}, -\\frac{12}{5}, -2, 0, 2 \\log (2), 5, 4 \\sqrt{2}, 6, 7, 6 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -(12/5), 0, -9, 5, -4*math.sqrt(2), 6*math.sqrt(2), 2*math.log(2), 7,))\nsnd = set((7, 6*math.sqrt(2), -2, 6, 9, 4*math.sqrt(2), -(12/5),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${10, 2, \\frac{47}{5}, 9 \\log (2), 2 \\pi, 3 \\sqrt{3}, -7, \\frac{49}{5}, 2 e, 3.98} \\cup {-9, \\frac{47}{5}, 3.98, -3 \\pi, 10, -5, 10 \\log (2), -3 e}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -3 e, -7, -5, 2, 3.98, 3 \\sqrt{3}, 2 e, 9 \\log (2), 2 \\pi, 10 \\log (2), \\frac{47}{5}, \\frac{49}{5}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 2, (47/5), 9*math.log(2), 2*math.pi, 3*math.sqrt(3), -7, (49/5), 2*math.e, 3.98,))\nsnd = set((-9, (47/5), 3.98, -3*math.pi, 10, -5, 10*math.log(2), -3*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, \\frac{4}{\\sqrt{3}}, -4, 5, 0, -\\frac{4}{\\sqrt{5}}, -\\frac{6}{\\sqrt{5}}, 9, -9, -\\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\frac{37}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, (4/(math.sqrt(3))), -4, 5, 0, -(4/(math.sqrt(5))), -(6/(math.sqrt(5))), 9, -9, -(19/2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 1, 8, -8, -7776}$.\n", - "Output Answer": [ - "$12 \\sqrt[5]{2} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 1, 8, -8, -7776\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.108,0.115,0.102,0.071,0.04,0.06,0.035,0.195,0.11\\}$ and $\\{0.05,0.122,0.179,0.132,0.139,0.068,0.027,0.04,0.182\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.108, 0.115, 0.102, 0.071, 0.04, 0.06, 0.035, 0.195, 0.11\ndistribution2 = 0.05, 0.122, 0.179, 0.132, 0.139, 0.068, 0.027, 0.04, 0.182\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-1.63 < -2.6 x^2+0.9 x-0.1 < -1.5$ where $x \\sim $ \\text{NormalDistribution}[-1.6,0.6].", - "Output Answer": [ - "$0.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 0.6)\nprint(P((-1.63 < -2.6*x**2+0.9*x-0.1) & (-2.6*x**2+0.9*x-0.1 < -1.5)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -3, -2, -2, 8, -2, -3, 4, 10, 6, -2, -3, -6, -3, 8, 3, 10, 4, 8, 4, -2, 3, 6, -2, 4, -2, -2, 3, -6}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -3, -2, -2, 8, -2, -3, 4, 10, 6, -2, -3, -6, -3, 8, 3, 10, 4, 8, 4, -2, 3, 6, -2, 4, -2, -2, 3, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-1.58, \\frac{23}{3}, -7, -\\frac{1}{\\sqrt{2}}, -\\frac{15}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-\\frac{15}{\\sqrt{\\pi }}, -7, -1.58, -\\frac{1}{\\sqrt{2}}, \\frac{23}{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -1.58, (23/3), -7, -(1/(math.sqrt(2))), -(15/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -5, -4 \\sqrt{5}, -\\frac{20}{\\pi }, \\frac{11}{7}, 4, -10}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -5, -4*math.sqrt(5), -(20/math.pi), (11/7), 4, -10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, -7, 256, -1}$.\n", - "Output Answer": [ - "$4 \\sqrt[4]{-7} 10^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, -7, 256, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{11}{2}, 4, 19, \\frac{27}{2}}$.\n", - "Output Answer": [ - "$\\frac{90288}{12607}$" - ], - "Output Program": [ - "import statistics\nvalues = (11/2), 4, 19, (27/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.082,0.141,0.253,0.202,0.075\\}$ and $\\{0.038,0.203,0.163,0.233,0.185\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.082, 0.141, 0.253, 0.202, 0.075\ndistribution2 = 0.038, 0.203, 0.163, 0.233, 0.185\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{31}{5}, 1, -4, 4, 9, \\frac{17}{2}, -\\frac{12}{\\sqrt{\\pi }}, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$9+\\frac{12}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(31/5), 1, -4, 4, 9, (17/2), -(12/(math.sqrt(math.pi))), 4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.146,0.326,0.204,0.166\\}$ and $\\{0.059,0.102,0.65,0.037\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.146, 0.326, 0.204, 0.166\ndistribution2 = 0.059, 0.102, 0.65, 0.037\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${1, -\\frac{23}{7}, 9, 0, 8, 4 \\sqrt{2}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{23}{7}, 0, 1, 4 \\sqrt{2}, 8, 5 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -(23/7), 9, 0, 8, 4*math.sqrt(2), 5*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.184,0.198,0.217,0.263\\}$ and $\\{0.048,0.062,0.23,0.109,0.302\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.184, 0.198, 0.217, 0.263\ndistribution2 = 0.048, 0.062, 0.23, 0.109, 0.302\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5.89, -3 \\sqrt{2}, \\frac{22}{e}, -2.322, 9.262, 5 \\sqrt{2}, 7} \\setminus {4, -8.005, 0, -5, 9.262, \\frac{43}{5}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-2.322, 5.89, 7, 5 \\sqrt{2}, \\frac{22}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.89, -3*math.sqrt(2), (22/math.e), -2.322, 9.262, 5*math.sqrt(2), 7,))\nsnd = set((4, -8.005, 0, -5, 9.262, (43/5), -3*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-2, 5 \\sqrt{3}, -5, -3, \\pi, 9, -1, \\sqrt{5}} \\cup {\\sqrt{5}, -3, -5, -2, -4 \\sqrt{3}, 3 \\pi, -4, -8, 9}$.\n", - "Output Answer": [ - "${-8, -4 \\sqrt{3}, -5, -4, -3, -2, -1, \\sqrt{5}, \\pi, 5 \\sqrt{3}, 9, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 5*math.sqrt(3), -5, -3, math.pi, 9, -1, math.sqrt(5),))\nsnd = set((math.sqrt(5), -3, -5, -2, -4*math.sqrt(3), 3*math.pi, -4, -8, 9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7 \\log (2), 10, 2, 4 \\sqrt{5}, -\\frac{20}{e}, 6, 7, -10, \\frac{26}{7}, -\\frac{6}{\\sqrt{5}}, -\\frac{27}{\\pi }}$.", - "Output Answer": [ - "$\\frac{26}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7*math.log(2), 10, 2, 4*math.sqrt(5), -(20/math.e), 6, 7, -10, (26/7), -(6/(math.sqrt(5))), -(27/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 0, 8, -8, 1, -5, -3, 9}$.\n", - "Output Answer": [ - "$\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 0, 8, -8, 1, -5, -3, 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, -10, 1296, 100000, 16, -1}$.\n", - "Output Answer": [ - "$20 \\sqrt[6]{-1} 2^{5/6} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -10, 1296, 100000, 16, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -2, 3, 7, 4, 4, 7, 4, 0, -3, 0, 3, 7, 0, 9, 9, -3, 7, -3, 3, 4}$.\n", - "Output Answer": [ - "$\\{3,7,4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -2, 3, 7, 4, 4, 7, 4, 0, -3, 0, 3, 7, 0, 9, 9, -3, 7, -3, 3, 4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8, 0, -\\pi}$.\n", - "Output Answer": [ - "${-8, -\\pi, 0}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 0, -math.pi\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${11 \\log (2), 5, -6, 4, 1.034, -4 \\sqrt{2}} \\cup {-4 \\sqrt{2}, -6, 13 \\log (2), 8, 1.034, 5}$.\n", - "Output Answer": [ - "${-6, -4 \\sqrt{2}, 1.034, 4, 5, 11 \\log (2), 8, 13 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((11*math.log(2), 5, -6, 4, 1.034, -4*math.sqrt(2),))\nsnd = set((-4*math.sqrt(2), -6, 13*math.log(2), 8, 1.034, 5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4, -\\frac{18}{e}, 4, \\frac{5}{2}, -5, -\\frac{55}{7}, 8, -4}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, -(18/math.e), 4, (5/2), -5, -(55/7), 8, -4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-5, e, 1, 4, 2 \\sqrt{3}, 5, -\\frac{31}{\\pi }, -4, 3 \\sqrt{3}, 5, -\\frac{3}{\\sqrt{5}}, \\frac{60}{7}, -\\frac{21}{\\sqrt{5}}, \\frac{19}{4}, 3 e}$.", - "Output Answer": [ - "$2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, math.e, 1, 4, 2*math.sqrt(3), 5, -(31/math.pi), -4, 3*math.sqrt(3), 5, -(3/(math.sqrt(5))), (60/7), -(21/(math.sqrt(5))), (19/4), 3*math.e\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, -6 \\sqrt{2}, -\\frac{17}{\\sqrt{5}}, 7, -3 \\sqrt{3}, 10, -\\frac{52}{7}, 2 \\sqrt{2}, \\frac{29}{4}, -\\frac{4}{\\sqrt{3}}, -3, \\frac{8}{\\sqrt{5}}, \\frac{12}{e}, 9, -3 e}$.\n", - "Output Answer": [ - "$10+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -6*math.sqrt(2), -(17/(math.sqrt(5))), 7, -3*math.sqrt(3), 10, -(52/7), 2*math.sqrt(2), (29/4), -(4/(math.sqrt(3))), -3, (8/(math.sqrt(5))), (12/math.e), 9, -3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.049,0.145,0.186,0.054,0.112,0.022,0.164,0.047,0.16\\}$ and $\\{0.091,0.196,0.006,0.134,0.227,0.081,0.097,0.034,0.105\\}$.", - "Output Answer": [ - "$0.65$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.049, 0.145, 0.186, 0.054, 0.112, 0.022, 0.164, 0.047, 0.16\ndistribution2 = 0.091, 0.196, 0.006, 0.134, 0.227, 0.081, 0.097, 0.034, 0.105\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, 2, -\\pi, 7, \\pi, -6 \\sqrt{3}, \\frac{18}{e}, 7, -2 \\pi, -8, -4, \\frac{15}{\\sqrt{\\pi }}, 5, -4, \\frac{33}{5}}$.\n", - "Output Answer": [ - "$6 \\sqrt{3}+\\frac{15}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 2, -math.pi, 7, math.pi, -6*math.sqrt(3), (18/math.e), 7, -2*math.pi, -8, -4, (15/(math.sqrt(math.pi))), 5, -4, (33/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -3, 7, 49}$.\n", - "Output Answer": [ - "$\\sqrt[4]{-3} 7^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -3, 7, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{9}{4}, -\\frac{3}{4}, \\frac{11}{4}, \\frac{3}{2}, \\frac{5}{4}, \\frac{11}{2}, \\frac{3}{2}, \\frac{3}{2}, \\frac{5}{4}, \\frac{3}{2}, \\frac{11}{4}, \\frac{5}{4}, -\\frac{3}{4}, \\frac{11}{2}, \\frac{9}{2}, \\frac{3}{2}, \\frac{11}{4}, \\frac{3}{2}, -\\frac{9}{4}, \\frac{9}{2}, \\frac{11}{4}, -\\frac{3}{4}, \\frac{5}{4}, \\frac{3}{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{3}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(9/4), -(3/4), (11/4), (3/2), (5/4), (11/2), (3/2), (3/2), (5/4), (3/2), (11/4), (5/4), -(3/4), (11/2), (9/2), (3/2), (11/4), (3/2), -(9/4), (9/2), (11/4), -(3/4), (5/4), (3/2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5, -4 \\sqrt{3}, -9, -\\frac{5}{\\sqrt{2}}} \\cup {8, -4 \\sqrt{3}, -10, -\\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-10, -9, -4 \\sqrt{3}, -\\frac{5}{\\sqrt{2}}, 5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -4*math.sqrt(3), -9, -(5/(math.sqrt(2))),))\nsnd = set((8, -4*math.sqrt(3), -10, -(5/(math.sqrt(2))),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 0, 6, 0}$.\n", - "Output Answer": [ - "$\\frac{13}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 0, 6, 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{15}{e}, -\\frac{6}{\\sqrt{5}}, 1, -6, 5, 6.5, -\\frac{60}{7}} \\setminus {-\\frac{6}{\\sqrt{5}}, -10, \\frac{21}{e}}$.\n", - "Output Answer": [ - "${-\\frac{60}{7}, -6, 1, 5, \\frac{15}{e}, 6.5}$" - ], - "Output Program": [ - "import math\n\nfst = set(((15/math.e), -(6/(math.sqrt(5))), 1, -6, 5, 6.5, -(60/7),))\nsnd = set((-(6/(math.sqrt(5))), -10, (21/math.e),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.241,0.036,0.093,0.184,0.056,0.138,0.156\\}$ and $\\{0.239,0.194,0.043,0.186,0.108,0.081,0.08\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.241, 0.036, 0.093, 0.184, 0.056, 0.138, 0.156\ndistribution2 = 0.239, 0.194, 0.043, 0.186, 0.108, 0.081, 0.08\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, -3, 15, 12}$.\n", - "Output Answer": [ - "$\\sqrt{66}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -3, 15, 12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${10, -7, -3, 2 \\sqrt{2}, 5, 0} \\cup {-5, -3, 0, 3, -4, 2 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7, -5, -4, -3, 0, 2 \\sqrt{2}, 3, 5, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, -7, -3, 2*math.sqrt(2), 5, 0,))\nsnd = set((-5, -3, 0, 3, -4, 2*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\sqrt{3}, -4, 10, -2, \\frac{5}{2}, 0, -9} \\cup {-2, 1, \\sqrt{3}, 4.416, \\frac{5}{2}, 10, -3}$.\n", - "Output Answer": [ - "${-9, -4, -3, -2, 0, 1, \\sqrt{3}, \\frac{5}{2}, 4.416, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), -4, 10, -2, (5/2), 0, -9,))\nsnd = set((-2, 1, math.sqrt(3), 4.416, (5/2), 10, -3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4.997, -\\frac{13}{2}, -\\frac{4}{3}, 3 \\pi, -4} \\setminus {-3 \\pi, 7, -\\frac{13}{2}}$.\n", - "Output Answer": [ - "${-4, -\\frac{4}{3}, 4.997, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((4.997, -(13/2), -(4/3), 3*math.pi, -4,))\nsnd = set((-3*math.pi, 7, -(13/2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{50}{7}, 2.507, -6, 0, 2, 5, \\frac{3}{\\sqrt{\\pi }}} \\setminus {\\frac{50}{7}, -6, 2, 5, -\\frac{3}{\\sqrt{\\pi }}, -5}$.\n", - "Output Answer": [ - "${0, \\frac{3}{\\sqrt{\\pi }}, 2.507}$" - ], - "Output Program": [ - "import math\n\nfst = set(((50/7), 2.507, -6, 0, 2, 5, (3/(math.sqrt(math.pi))),))\nsnd = set(((50/7), -6, 2, 5, -(3/(math.sqrt(math.pi))), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{11}{\\sqrt{3}}, 0, \\frac{4}{3}, -9, \\frac{16}{\\sqrt{3}}, -\\frac{7}{2}, -\\frac{60}{7}, -\\frac{37}{7}, -3, \\frac{18}{\\pi }}$.", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (11/(math.sqrt(3))), 0, (4/3), -9, (16/(math.sqrt(3))), -(7/2), -(60/7), -(37/7), -3, (18/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -1, 1}$.\n", - "Output Answer": [ - "$\\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -1, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x^2-3.2 x+2.1$ where $x \\sim $ \\text{PoissonDistribution}[3.]\n", - "Output Answer": [ - "$-39.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.)\nprint(E(-2.7*x**2-3.2*x+2.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -2 e, 3, 0, -5, -\\frac{28}{\\pi }, -7, \\frac{5}{2}, 4 \\sqrt{3}, -2}$.", - "Output Answer": [ - "$-\\frac{7}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -2*math.e, 3, 0, -5, -(28/math.pi), -7, (5/2), 4*math.sqrt(3), -2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 7, 14, 2}$.\n", - "Output Answer": [ - "$\\frac{91}{18}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 7, 14, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, -2, 2 \\sqrt{2}, -1, 0, -2 \\pi, -5 \\sqrt{3}, \\frac{12}{e}, -1}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -2, 2*math.sqrt(2), -1, 0, -2*math.pi, -5*math.sqrt(3), (12/math.e), -1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-3 \\sqrt{3}, 2 \\sqrt{3}, -\\sqrt{3}, -6 \\sqrt{3}, \\sqrt{3}, 5 \\sqrt{3}, -5 \\sqrt{3}, 0} \\cap {0, \\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, 3 \\sqrt{3}, -3 \\sqrt{3}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -3 \\sqrt{3}, -\\sqrt{3}, 0, \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(3), 2*math.sqrt(3), -math.sqrt(3), -6*math.sqrt(3), math.sqrt(3), 5*math.sqrt(3), -5*math.sqrt(3), 0,))\nsnd = set((0, math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), 3*math.sqrt(3), -3*math.sqrt(3), -5*math.sqrt(3),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0.55, 9, 4, \\frac{7}{\\pi }, 7.7} \\setminus {-e, -0.5, -6}$.\n", - "Output Answer": [ - "${0.55, \\frac{7}{\\pi }, 4, 7.7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0.55, 9, 4, (7/math.pi), 7.7,))\nsnd = set((-math.e, -0.5, -6,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 2, 15}$.\n", - "Output Answer": [ - "$\\frac{180}{49}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 2, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 1, 3, -9, 3, 3, 1, -9, -9, 3, -5, -5, -5, 1, -5, 3, 3, -9, 3, -9, 3}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 1, 3, -9, 3, 3, 1, -9, -9, 3, -5, -5, -5, 1, -5, 3, 3, -9, 3, -9, 3\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-7, -7, 6, -4 \\sqrt{3}, 4}$.", - "Output Answer": [ - "$-4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, -7, 6, -4*math.sqrt(3), 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 3, \\frac{4}{\\sqrt{3}}, -3 \\pi, \\frac{24}{7}, -6, 4, 1, 7 \\sqrt{2}, \\log (2), -\\frac{17}{3}}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 3, (4/(math.sqrt(3))), -3*math.pi, (24/7), -6, 4, 1, 7*math.sqrt(2), math.log(2), -(17/3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{14}{\\sqrt{\\pi }}, 4 \\sqrt{3}, -9, \\frac{46}{7}, 2 \\sqrt{3}, 2} \\setminus {4 \\sqrt{3}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{1}{e}, 2 \\sqrt{3}, -\\frac{30}{7}}$.\n", - "Output Answer": [ - "${-9, 2, \\frac{46}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((14/(math.sqrt(math.pi))), 4*math.sqrt(3), -9, (46/7), 2*math.sqrt(3), 2,))\nsnd = set((4*math.sqrt(3), (14/(math.sqrt(math.pi))), -(1/math.e), 2*math.sqrt(3), -(30/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-e, -2 e, e, e, e, -2 e, e, -e, e, -2 e, e, -e, -2 e, e, -e, e, -2 e, -2 e, e, -2 e, -2 e}$.\n", - "Output Answer": [ - "$\\{e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.e, -2*math.e, math.e, math.e, math.e, -2*math.e, math.e, -math.e, math.e, -2*math.e, math.e, -math.e, -2*math.e, math.e, -math.e, math.e, -2*math.e, -2*math.e, math.e, -2*math.e, -2*math.e\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 1, 1, 8, 2, 2, -9, 1, 2, 1, 8, 2, 2, -9, 2, 8, 8, 8, 2, 1, -9, 1, -9, 8, -9, 2, 2, -9, 8, -9}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 1, 1, 8, 2, 2, -9, 1, 2, 1, 8, 2, 2, -9, 2, 8, 8, 8, 2, 1, -9, 1, -9, 8, -9, 2, 2, -9, 8, -9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, 8, 4, -6, -1}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "values = 4, 8, 4, -6, -1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 2 \\sqrt{3}, -4, -3 \\pi, -1, -\\frac{18}{\\sqrt{5}}, 8, -6, 2, 4 \\sqrt{2}, 8}$.\n", - "Output Answer": [ - "$8+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 2*math.sqrt(3), -4, -3*math.pi, -1, -(18/(math.sqrt(5))), 8, -6, 2, 4*math.sqrt(2), 8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 3, -2, 4}$.\n", - "Output Answer": [ - "$\\frac{7}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 3, -2, 4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.253,0.075,0.291,0.102,0.041\\}$ and $\\{0.132,0.027,0.183,0.009,0.474\\}$.", - "Output Answer": [ - "$0.77$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.253, 0.075, 0.291, 0.102, 0.041\ndistribution2 = 0.132, 0.027, 0.183, 0.009, 0.474\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{2}{\\sqrt{3}}, -6, 6, -2, 1, -7, \\frac{4}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-7, -6, -2, 1, \\frac{2}{\\sqrt{3}}, \\frac{4}{\\sqrt{5}}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = (2/(math.sqrt(3))), -6, 6, -2, 1, -7, (4/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4. x^2-1.8 x+7.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$-8.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(-4.*x**2-1.8*x+7.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.189,0.112,0.024,0.038,0.188,0.205,0.089,0.094\\}$ and $\\{0.093,0.185,0.123,0.069,0.075,0.038,0.1,0.279\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.189, 0.112, 0.024, 0.038, 0.188, 0.205, 0.089, 0.094\ndistribution2 = 0.093, 0.185, 0.123, 0.069, 0.075, 0.038, 0.1, 0.279\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.039,0.037,0.216,0.435,0.098,0.064\\}$ and $\\{0.224,0.088,0.1,0.226,0.237,0.103\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.039, 0.037, 0.216, 0.435, 0.098, 0.064\ndistribution2 = 0.224, 0.088, 0.1, 0.226, 0.237, 0.103\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -2, -5.286, -8, 8, 4 \\sqrt{2}, \\frac{13}{2}, 0, -\\frac{8}{7}, \\frac{23}{\\pi }} \\cup {-\\frac{29}{4}, 0, 9, 8, 2, \\frac{23}{\\pi }, \\frac{13}{2}, -\\frac{13}{\\sqrt{2}}, 4, -\\frac{8}{7}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -9, -8, -\\frac{29}{4}, -5.286, -2, -\\frac{8}{7}, 0, 2, 4, 4 \\sqrt{2}, \\frac{13}{2}, \\frac{23}{\\pi }, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -2, -5.286, -8, 8, 4*math.sqrt(2), (13/2), 0, -(8/7), (23/math.pi),))\nsnd = set((-(29/4), 0, 9, 8, 2, (23/math.pi), (13/2), -(13/(math.sqrt(2))), 4, -(8/7),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, 8, 3, -6.34}$.\n", - "Output Answer": [ - "${-6.34, 3, 8, 9}$" - ], - "Output Program": [ - "values = 9, 8, 3, -6.34\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x^3-2.6 x^2+3.1 x+1.5$ where $x \\sim $ \\text{PoissonDistribution}[1.4]\n", - "Output Answer": [ - "$9.13$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.4)\nprint(E(1.2*x**3-2.6*x**2+3.1*x+1.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1296, 4096, 81, -125}$.\n", - "Output Answer": [ - "$144 \\sqrt[4]{-1} 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1296, 4096, 81, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x^2-0.3 x-0.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.8]\n", - "Output Answer": [ - "$2.26$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.8)\nprint(E(1.1*x**2-0.3*x-0.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3 e, 4 \\sqrt{5}, 3 \\log (2), \\frac{15}{2}, 8, 8, -\\frac{11}{\\sqrt{\\pi }}, 2, -5, -3 \\sqrt{3}, 8, 0}$.", - "Output Answer": [ - "$\\frac{1}{2} (2+3 \\log (2))$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.e, 4*math.sqrt(5), 3*math.log(2), (15/2), 8, 8, -(11/(math.sqrt(math.pi))), 2, -5, -3*math.sqrt(3), 8, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5, -7, 5, \\frac{29}{\\pi }, -6, 6 \\sqrt{2}, \\frac{13}{e}, \\frac{11}{\\sqrt{\\pi }}, \\frac{51}{7}, -3, -6 \\sqrt{2}}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -7, 5, (29/math.pi), -6, 6*math.sqrt(2), (13/math.e), (11/(math.sqrt(math.pi))), (51/7), -3, -6*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.153,0.028,0.17,0.05,0.139,0.134,0.1,0.017,0.105,0.089\\}$ and $\\{0.071,0.079,0.172,0.152,0.043,0.135,0.076,0.102,0.132,0.012\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.153, 0.028, 0.17, 0.05, 0.139, 0.134, 0.1, 0.017, 0.105, 0.089\ndistribution2 = 0.071, 0.079, 0.172, 0.152, 0.043, 0.135, 0.076, 0.102, 0.132, 0.012\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -\\frac{24}{e}, 0, 2, \\frac{6}{\\sqrt{5}}, 5, -e, 1, -2}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -(24/math.e), 0, 2, (6/(math.sqrt(5))), 5, -math.e, 1, -2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.211,0.115,0.414,0.159\\}$ and $\\{0.192,0.172,0.197,0.056\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.211, 0.115, 0.414, 0.159\ndistribution2 = 0.192, 0.172, 0.197, 0.056\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -9, -3, \\frac{9}{2}, -\\frac{13}{2}, 0.32, 10, 2 \\sqrt{3}, 2, 8, 4} \\cup {10, -7, -2 \\sqrt{3}, 2, -9, -\\frac{13}{2}, -2.08}$.\n", - "Output Answer": [ - "${-9, -7, -\\frac{13}{2}, -2 \\sqrt{3}, -3, -2.08, 0.32, 2, 2 \\sqrt{3}, 4, \\frac{9}{2}, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -9, -3, (9/2), -(13/2), 0.32, 10, 2*math.sqrt(3), 2, 8, 4,))\nsnd = set((10, -7, -2*math.sqrt(3), 2, -9, -(13/2), -2.08,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.13,0.703,0.046,0.012,0.052,0.053\\}$ and $\\{0.257,0.058,0.124,0.058,0.199,0.247\\}$.", - "Output Answer": [ - "$1.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.13, 0.703, 0.046, 0.012, 0.052, 0.053\ndistribution2 = 0.257, 0.058, 0.124, 0.058, 0.199, 0.247\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.6 x^3-1.5 x^2+0.9 x+0.6$ where $x \\sim $ \\text{PoissonDistribution}[0.5]\n", - "Output Answer": [ - "$-6.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.5)\nprint(E(-4.6*x**3-1.5*x**2+0.9*x+0.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.308,0.085,0.26,0.004,0.012,0.089\\}$ and $\\{0.143,0.407,0.103,0.1,0.051,0.002\\}$.", - "Output Answer": [ - "$0.92$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.308, 0.085, 0.26, 0.004, 0.012, 0.089\ndistribution2 = 0.143, 0.407, 0.103, 0.1, 0.051, 0.002\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, -1, \\frac{19}{2}, 4 \\sqrt{3}, 0, 3, -5}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, -1, (19/2), 4*math.sqrt(3), 0, 3, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.1 x^2-2.3 x-1.9$ where $x \\sim $ \\text{NormalDistribution}[0.6,1.9]\n", - "Output Answer": [ - "$-3.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.6, 1.9)\nprint(E(-0.1*x**2-2.3*x-1.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x-3.9$ where $x \\sim $ \\text{NormalDistribution}[-1.,2.4]\n", - "Output Answer": [ - "$-7.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1., 2.4)\nprint(E(4.*x-3.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, 10, -6, -5, -\\sqrt{5}, -1, -1, 9, -\\frac{30}{\\pi }, -\\frac{7}{\\sqrt{2}}, -9, 2, 3}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 10, -6, -5, -math.sqrt(5), -1, -1, 9, -(30/math.pi), -(7/(math.sqrt(2))), -9, 2, 3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${14 \\log (2), -13 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{\\log (2)}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 14*math.log(2), -13*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.278,0.19,0.166,0.035\\}$ and $\\{0.261,0.079,0.048,0.188\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.278, 0.19, 0.166, 0.035\ndistribution2 = 0.261, 0.079, 0.048, 0.188\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{7}{\\sqrt{2}}, 3, -7, -5 \\sqrt{2}, -4 \\sqrt{5}, 3 \\sqrt{5}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (7/(math.sqrt(2))), 3, -7, -5*math.sqrt(2), -4*math.sqrt(5), 3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.292,0.198,0.173\\}$ and $\\{0.256,0.577,0.109\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.292, 0.198, 0.173\ndistribution2 = 0.256, 0.577, 0.109\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, \\sqrt{5}, -\\sqrt{2}, 3 e, 0, -10, 1, -5, 0, 9}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, math.sqrt(5), -math.sqrt(2), 3*math.e, 0, -10, 1, -5, 0, 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.087,0.092,0.104,0.257,0.186,0.052,0.022\\}$ and $\\{0.021,0.131,0.105,0.003,0.048,0.026,0.564\\}$.", - "Output Answer": [ - "$1.93$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.087, 0.092, 0.104, 0.257, 0.186, 0.052, 0.022\ndistribution2 = 0.021, 0.131, 0.105, 0.003, 0.048, 0.026, 0.564\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{41}{5}, \\frac{39}{5}, \\frac{4}{5}, -\\frac{41}{5}, \\frac{39}{5}, \\frac{39}{5}, \\frac{39}{5}, -\\frac{39}{5}, \\frac{4}{5}, \\frac{4}{5}, -\\frac{44}{5}, -\\frac{39}{5}, -\\frac{39}{5}, -\\frac{44}{5}, \\frac{4}{5}, \\frac{39}{5}, -\\frac{44}{5}, \\frac{3}{5}, \\frac{3}{5}, -\\frac{41}{5}, \\frac{39}{5}, -\\frac{39}{5}, -\\frac{39}{5}, \\frac{3}{5}, -\\frac{41}{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{39}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(41/5), (39/5), (4/5), -(41/5), (39/5), (39/5), (39/5), -(39/5), (4/5), (4/5), -(44/5), -(39/5), -(39/5), -(44/5), (4/5), (39/5), -(44/5), (3/5), (3/5), -(41/5), (39/5), -(39/5), -(39/5), (3/5), -(41/5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3. x^2+4.8 x-4.7$ where $x \\sim $ \\text{PoissonDistribution}[2.5]\n", - "Output Answer": [ - "$-18.95$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.5)\nprint(E(-3.*x**2+4.8*x-4.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, 0, 12, 1}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{395}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 0, 12, 1\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, -11, -1, 1}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{179}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -11, -1, 1\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-3, -2 \\log (2), 1, \\frac{14}{\\sqrt{5}}, -8.726, -6, 4}$.\n", - "Output Answer": [ - "${-8.726, -6, -3, -2 \\log (2), 1, 4, \\frac{14}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -2*math.log(2), 1, (14/(math.sqrt(5))), -8.726, -6, 4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9 \\log (2), 10 \\log (2), 5 \\log (2), 10 \\log (2), -9 \\log (2), 10 \\log (2), 9 \\log (2), 5 \\log (2), 5 \\log (2), 5 \\log (2), 10 \\log (2), -9 \\log (2), 9 \\log (2), -9 \\log (2), 10 \\log (2), 9 \\log (2), 9 \\log (2), -9 \\log (2), 9 \\log (2), 5 \\log (2), 9 \\log (2), -9 \\log (2), 5 \\log (2), 5 \\log (2)}$.\n", - "Output Answer": [ - "$\\{5 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -9*math.log(2), 10*math.log(2), 5*math.log(2), 10*math.log(2), -9*math.log(2), 10*math.log(2), 9*math.log(2), 5*math.log(2), 5*math.log(2), 5*math.log(2), 10*math.log(2), -9*math.log(2), 9*math.log(2), -9*math.log(2), 10*math.log(2), 9*math.log(2), 9*math.log(2), -9*math.log(2), 9*math.log(2), 5*math.log(2), 9*math.log(2), -9*math.log(2), 5*math.log(2), 5*math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5, 7.023, 4, -10 \\log (2), 6} \\cup {2.415, 5, \\log (2), 6, 4}$.\n", - "Output Answer": [ - "${-10 \\log (2), \\log (2), 2.415, 4, 5, 6, 7.023}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 7.023, 4, -10*math.log(2), 6,))\nsnd = set((2.415, 5, math.log(2), 6, 4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${6.458, -5, -9, -\\frac{17}{7}, -\\frac{18}{\\sqrt{5}}, 6, -\\pi} \\setminus {6, -2, -4.696}$.\n", - "Output Answer": [ - "${-9, -\\frac{18}{\\sqrt{5}}, -5, -\\pi, -\\frac{17}{7}, 6.458}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.458, -5, -9, -(17/7), -(18/(math.sqrt(5))), 6, -math.pi,))\nsnd = set((6, -2, -4.696,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -2, 0, -6, -9}$.\n", - "Output Answer": [ - "$-\\frac{26}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -2, 0, -6, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${117649, 3, 1000, 32, -59049, 1000}$.\n", - "Output Answer": [ - "$210 \\sqrt[6]{-1} 6^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 117649, 3, 1000, 32, -59049, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${9, 2 e, -10, e, -2 \\sqrt{5}, -4 \\sqrt{5}, -\\frac{14}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{5}}, -3 e, -9, -3 \\pi, -\\frac{1}{\\sqrt{2}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2 \\sqrt{5}-\\frac{14}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, 2*math.e, -10, math.e, -2*math.sqrt(5), -4*math.sqrt(5), -(14/(math.sqrt(math.pi))), (8/(math.sqrt(5))), -3*math.e, -9, -3*math.pi, -(1/(math.sqrt(2)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.1 x^2-3.9 x+0.9$ where $x \\sim $ \\text{BetaDistribution}[0.5,0.9]\n", - "Output Answer": [ - "$-0.52$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.5, 0.9)\nprint(E(-0.1*x**2-3.9*x+0.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.4 x^2-3.7 x+0.5$ where $x \\sim $ \\text{BetaDistribution}[1.,0.6]\n", - "Output Answer": [ - "$-3.93$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 0.6)\nprint(E(-4.4*x**2-3.7*x+0.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8 \\log (2), -11 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{19 \\log (2)}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -8*math.log(2), -11*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\pi, -1, 0, 10}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.pi, -1, 0, 10\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{23}{4}, -5, \\frac{1}{2}, \\frac{1}{2}, 8, \\frac{23}{4}, -5, -\\frac{25}{4}, \\frac{1}{2}, -5, -\\frac{25}{4}, -\\frac{25}{4}, \\frac{35}{4}, -\\frac{11}{4}, \\frac{1}{2}, -\\frac{11}{4}, \\frac{35}{4}, -5, -\\frac{11}{4}, -5, \\frac{1}{2}, -\\frac{25}{4}, \\frac{1}{2}, -5, 8}$.\n", - "Output Answer": [ - "$\\left\\{-5,\\frac{1}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (23/4), -5, (1/2), (1/2), 8, (23/4), -5, -(25/4), (1/2), -5, -(25/4), -(25/4), (35/4), -(11/4), (1/2), -(11/4), (35/4), -5, -(11/4), -5, (1/2), -(25/4), (1/2), -5, 8\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6, \\frac{2}{\\sqrt{3}}, -7, 7, -\\sqrt{5}, -\\frac{13}{4}, 4, -\\frac{28}{\\pi }, 7, -7, -3 \\sqrt{2}}$.", - "Output Answer": [ - "$-\\frac{13}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, (2/(math.sqrt(3))), -7, 7, -math.sqrt(5), -(13/4), 4, -(28/math.pi), 7, -7, -3*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.174,0.13,0.061,0.093,0.165,0.175,0.019,0.016\\}$ and $\\{0.174,0.087,0.115,0.129,0.046,0.178,0.047,0.051\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.174, 0.13, 0.061, 0.093, 0.165, 0.175, 0.019, 0.016\ndistribution2 = 0.174, 0.087, 0.115, 0.129, 0.046, 0.178, 0.047, 0.051\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, 8, \\frac{5}{\\sqrt{2}}, 3 \\sqrt{5}, -4, -e, -\\frac{17}{\\sqrt{\\pi }}, -6 \\sqrt{2}, -1, \\frac{2}{3}, -9, \\frac{12}{\\pi }, 6}$.\n", - "Output Answer": [ - "$8+\\frac{17}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 8, (5/(math.sqrt(2))), 3*math.sqrt(5), -4, -math.e, -(17/(math.sqrt(math.pi))), -6*math.sqrt(2), -1, (2/3), -9, (12/math.pi), 6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, \\frac{13}{2}, \\frac{13}{2}, \\frac{19}{2}, -8, -\\frac{9}{2}, 5, -\\frac{9}{2}, \\frac{13}{2}, -6, 5, -8, 1, -6, 1, \\frac{19}{2}, \\frac{13}{2}, \\frac{19}{2}, \\frac{19}{2}, \\frac{13}{2}, -\\frac{9}{2}, -7, -8, \\frac{19}{2}, 1, \\frac{19}{2}, 1}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{19}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, (13/2), (13/2), (19/2), -8, -(9/2), 5, -(9/2), (13/2), -6, 5, -8, 1, -6, 1, (19/2), (13/2), (19/2), (19/2), (13/2), -(9/2), -7, -8, (19/2), 1, (19/2), 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-7, 6, \\frac{20}{e}, -3, -\\frac{25}{3}, 8, \\frac{13}{e}}$.", - "Output Answer": [ - "$\\frac{13}{e}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, 6, (20/math.e), -3, -(25/3), 8, (13/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 7, 9, 7, 1, 9, 5, 7, 9, 1, 9, 1, 7, 1, 1, 1, 5, 7, 1, 4, 9, 5}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 7, 9, 7, 1, 9, 5, 7, 9, 1, 9, 1, 7, 1, 1, 1, 5, 7, 1, 4, 9, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 6, 0, -3, 2, 7}$.\n", - "Output Answer": [ - "$\\frac{19}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 6, 0, -3, 2, 7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.26,0.359,0.212,0.067\\}$ and $\\{0.477,0.445,0.069,0.004\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.26, 0.359, 0.212, 0.067\ndistribution2 = 0.477, 0.445, 0.069, 0.004\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.5 x^2+3.2 x-1.9$ where $x \\sim $ \\text{NormalDistribution}[-1.6,1.8]\n", - "Output Answer": [ - "$-33.12$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.6, 1.8)\nprint(E(-4.5*x**2+3.2*x-1.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 100, 9}$.\n", - "Output Answer": [ - "$5 \\sqrt[3]{5} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 100, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-1.63, -3 e, -7, -2, 7, -2.8, 5, -2}$.\n", - "Output Answer": [ - "${-3 e, -7, -2.8, -2, -2, -1.63, 5, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -1.63, -3*math.e, -7, -2, 7, -2.8, 5, -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{4}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, -5 \\sqrt{3}, \\frac{14}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\frac{13}{\\sqrt{3}}-5 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(4/(math.sqrt(3))), (17/(math.sqrt(3))), (2/(math.sqrt(3))), -(16/(math.sqrt(3))), -5*math.sqrt(3), (14/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.2 x^3-3.6 x^2+0.5 x-1.5$ where $x \\sim $ \\text{BetaDistribution}[1.7,1.7]\n", - "Output Answer": [ - "$-1.47$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 1.7)\nprint(E(4.2*x**3-3.6*x**2+0.5*x-1.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${1, 13, -15}$.\n", - "Output Answer": [ - "$\\frac{592}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 13, -15\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-8, -7.396, 8, -5, -9} \\cup {5.785, -8, 3.959, 8, -5}$.\n", - "Output Answer": [ - "${-9, -8, -7.396, -5, 3.959, 5.785, 8}$" - ], - "Output Program": [ - "fst = set((-8, -7.396, 8, -5, -9,))\nsnd = set((5.785, -8, 3.959, 8, -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2, 0, -4}$.\n", - "Output Answer": [ - "${-4, -2, 0}$" - ], - "Output Program": [ - "values = -2, 0, -4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 729, 16, -8, 2401, 1296}$.\n", - "Output Answer": [ - "$6 \\sqrt[6]{-1} 2^{5/6} 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 729, 16, -8, 2401, 1296\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -8, 0, 3, 7, -7, 8}$.\n", - "Output Answer": [ - "$-\\frac{6}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -8, 0, 3, 7, -7, 8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.272,0.094,0.113\\}$ and $\\{0.066,0.268,0.316\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.272, 0.094, 0.113\ndistribution2 = 0.066, 0.268, 0.316\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, -5, -8}$.\n", - "Output Answer": [ - "$2\\ 2^{2/3} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -5, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 100, 16807, 6, 9, 4}$.\n", - "Output Answer": [ - "$2 \\sqrt[6]{2} \\sqrt{3} \\sqrt[3]{5} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 100, 16807, 6, 9, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, -5, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{331}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -5, -15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, 7, -3, -9}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, 7, -3, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\pi, -1, -11 \\log (2), 8, 6, -\\frac{4}{\\sqrt{5}}, -1, 10, -7, -2 \\log (2), 2, 1, 4, 4 \\sqrt{3}, -8}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.pi, -1, -11*math.log(2), 8, 6, -(4/(math.sqrt(5))), -1, 10, -7, -2*math.log(2), 2, 1, 4, 4*math.sqrt(3), -8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, \\frac{7}{\\sqrt{5}}, \\frac{13}{2}}$.\n", - "Output Answer": [ - "${\\frac{7}{\\sqrt{5}}, 5, \\frac{13}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, (7/(math.sqrt(5))), (13/2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{14}{\\pi }, 9, \\frac{41}{7}, -5, 3 \\sqrt{2}, -\\frac{3}{e}, \\frac{4}{e}, 5}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(3 \\sqrt{2}+\\frac{14}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (14/math.pi), 9, (41/7), -5, 3*math.sqrt(2), -(3/math.e), (4/math.e), 5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-4, -5, -11, 15, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{953}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -5, -11, 15, -2\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 0, 1, -3, 5, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{809}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 0, 1, -3, 5, 12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2.115, 6, -1, -7, -3 e, -\\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-3 e, -\\frac{13}{\\sqrt{\\pi }}, -7, -1, 2.115, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 2.115, 6, -1, -7, -3*math.e, -(13/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{8}{\\sqrt{3}}, -4}$.\n", - "Output Answer": [ - "${-\\frac{8}{\\sqrt{3}}, -4}$" - ], - "Output Program": [ - "import math\n\nvalues = -(8/(math.sqrt(3))), -4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{37}{3}, \\frac{52}{3}, 5, \\frac{28}{3}}$.\n", - "Output Answer": [ - "$\\frac{67340}{7507}$" - ], - "Output Program": [ - "import statistics\nvalues = (37/3), (52/3), 5, (28/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.149,0.033,0.124,0.191,0.174,0.158\\}$ and $\\{0.028,0.06,0.311,0.245,0.147,0.09\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.149, 0.033, 0.124, 0.191, 0.174, 0.158\ndistribution2 = 0.028, 0.06, 0.311, 0.245, 0.147, 0.09\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${7, -5, -\\frac{14}{5}, 1, -\\frac{27}{\\pi }, -2, 2, -3.95, -\\frac{12}{\\pi }, 3, \\frac{5}{7}} \\cup {2, -10, 1, -\\frac{14}{5}, \\frac{5}{7}, -6, -1.06, -5, -\\frac{12}{\\pi }, 8, -2}$.\n", - "Output Answer": [ - "${-10, -\\frac{27}{\\pi }, -6, -5, -3.95, -\\frac{12}{\\pi }, -\\frac{14}{5}, -2, -1.06, \\frac{5}{7}, 1, 2, 3, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -5, -(14/5), 1, -(27/math.pi), -2, 2, -3.95, -(12/math.pi), 3, (5/7),))\nsnd = set((2, -10, 1, -(14/5), (5/7), -6, -1.06, -5, -(12/math.pi), 8, -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\pi, 3, 6, -5, 3, 10, -4 \\sqrt{3}, 7, -7}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.pi, 3, 6, -5, 3, 10, -4*math.sqrt(3), 7, -7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.586,0.05,0.131,0.233\\}$ and $\\{0.157,0.436,0.174,0.147\\}$.", - "Output Answer": [ - "$0.64$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.586, 0.05, 0.131, 0.233\ndistribution2 = 0.157, 0.436, 0.174, 0.147\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, 14, -13}$.\n", - "Output Answer": [ - "$7 \\sqrt{\\frac{13}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, 14, -13\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.1 x+3.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.1]\n", - "Output Answer": [ - "$7.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.1)\nprint(E(4.1*x+3.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, -4 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, -4 \\sqrt{3}, \\frac{14}{\\sqrt{3}}, -4 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, -4 \\sqrt{3}, \\frac{11}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, 3 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, 3 \\sqrt{3}, 3 \\sqrt{3}, -4 \\sqrt{3}, \\frac{11}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{13}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (11/(math.sqrt(3))), (14/(math.sqrt(3))), (11/(math.sqrt(3))), (13/(math.sqrt(3))), (11/(math.sqrt(3))), (13/(math.sqrt(3))), -4*math.sqrt(3), (13/(math.sqrt(3))), (11/(math.sqrt(3))), -4*math.sqrt(3), (14/(math.sqrt(3))), -4*math.sqrt(3), (13/(math.sqrt(3))), -4*math.sqrt(3), (11/(math.sqrt(3))), (13/(math.sqrt(3))), (13/(math.sqrt(3))), 3*math.sqrt(3), (13/(math.sqrt(3))), (14/(math.sqrt(3))), (13/(math.sqrt(3))), (14/(math.sqrt(3))), (14/(math.sqrt(3))), 3*math.sqrt(3), 3*math.sqrt(3), -4*math.sqrt(3), (11/(math.sqrt(3))), (14/(math.sqrt(3))), (13/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.7 x+3.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.5]\n", - "Output Answer": [ - "$3.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.5)\nprint(E(1.7*x+3.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^2+1.6 x-5.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$-10.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(-1.9*x**2+1.6*x-5.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${8, 10, 5, 4}$.", - "Output Answer": [ - "$\\frac{13}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 10, 5, 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{25}{3}, -7, 0, -\\sqrt{5}, 5, \\frac{28}{\\pi }, -\\frac{20}{\\pi }} \\cup {\\frac{19}{\\pi }, 10, 0, -\\frac{20}{\\pi }, 5, -\\sqrt{5}, \\frac{25}{3}}$.\n", - "Output Answer": [ - "${-7, -\\frac{20}{\\pi }, -\\sqrt{5}, 0, 5, \\frac{19}{\\pi }, \\frac{25}{3}, \\frac{28}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((25/3), -7, 0, -math.sqrt(5), 5, (28/math.pi), -(20/math.pi),))\nsnd = set(((19/math.pi), 10, 0, -(20/math.pi), 5, -math.sqrt(5), (25/3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{1}{\\pi }, -\\frac{2}{\\pi }, -\\frac{25}{\\pi }, -\\frac{25}{\\pi }, \\frac{30}{\\pi }, \\frac{30}{\\pi }, \\frac{1}{\\pi }, \\frac{30}{\\pi }, -\\frac{2}{\\pi }, \\frac{1}{\\pi }, -\\frac{25}{\\pi }, -\\frac{25}{\\pi }, -\\frac{2}{\\pi }, \\frac{30}{\\pi }, -\\frac{25}{\\pi }, -\\frac{25}{\\pi }, \\frac{30}{\\pi }, \\frac{1}{\\pi }, \\frac{1}{\\pi }, \\frac{1}{\\pi }, -\\frac{25}{\\pi }, \\frac{1}{\\pi }, -\\frac{2}{\\pi }, \\frac{30}{\\pi }, -\\frac{25}{\\pi }, -\\frac{2}{\\pi }, \\frac{1}{\\pi }, \\frac{30}{\\pi }, -\\frac{25}{\\pi }, -\\frac{2}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{25}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (1/math.pi), -(2/math.pi), -(25/math.pi), -(25/math.pi), (30/math.pi), (30/math.pi), (1/math.pi), (30/math.pi), -(2/math.pi), (1/math.pi), -(25/math.pi), -(25/math.pi), -(2/math.pi), (30/math.pi), -(25/math.pi), -(25/math.pi), (30/math.pi), (1/math.pi), (1/math.pi), (1/math.pi), -(25/math.pi), (1/math.pi), -(2/math.pi), (30/math.pi), -(25/math.pi), -(2/math.pi), (1/math.pi), (30/math.pi), -(25/math.pi), -(2/math.pi)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 9, \\frac{1}{5}, \\frac{12}{\\sqrt{\\pi }}, -\\frac{21}{\\sqrt{5}}, 9, -\\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$9+\\frac{21}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 9, (1/5), (12/(math.sqrt(math.pi))), -(21/(math.sqrt(5))), 9, -(8/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-3.78, 9, \\frac{1}{\\sqrt{2}}, -2.941, -6, 2, \\frac{23}{5}} \\setminus {-3 \\sqrt{2}, -1, -2.941, -6, 4, \\frac{23}{5}}$.\n", - "Output Answer": [ - "${-3.78, \\frac{1}{\\sqrt{2}}, 2, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3.78, 9, (1/(math.sqrt(2))), -2.941, -6, 2, (23/5),))\nsnd = set((-3*math.sqrt(2), -1, -2.941, -6, 4, (23/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 5, -\\frac{19}{e}, 9} \\setminus {3, -\\frac{19}{e}, -8}$.\n", - "Output Answer": [ - "${-7, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 5, -(19/math.e), 9,))\nsnd = set((3, -(19/math.e), -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, 8, 4}$.\n", - "Output Answer": [ - "$\\sqrt{7}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 8, 4\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, 5, 14, 2, -6}$.\n", - "Output Answer": [ - "$\\frac{243}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 5, 14, 2, -6\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{5}{2}, \\frac{1}{2}, -10, -\\frac{13}{2}, -10, -7, \\frac{9}{2}, \\frac{17}{2}, -\\frac{13}{2}, -\\frac{13}{2}, -10, -\\frac{13}{2}, \\frac{9}{2}, -7, -7, -10, -\\frac{13}{2}, -\\frac{13}{2}, \\frac{9}{2}, -7, -\\frac{13}{2}, \\frac{1}{2}, \\frac{17}{2}, \\frac{17}{2}, -\\frac{13}{2}, \\frac{1}{2}, \\frac{1}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(5/2), (1/2), -10, -(13/2), -10, -7, (9/2), (17/2), -(13/2), -(13/2), -10, -(13/2), (9/2), -7, -7, -10, -(13/2), -(13/2), (9/2), -7, -(13/2), (1/2), (17/2), (17/2), -(13/2), (1/2), (1/2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{29}{\\pi }, -\\frac{29}{\\pi }, -\\frac{29}{\\pi }, \\frac{8}{\\pi }, \\frac{26}{\\pi }, \\frac{8}{\\pi }, \\frac{8}{\\pi }, \\frac{8}{\\pi }, -\\frac{22}{\\pi }, -\\frac{29}{\\pi }, -\\frac{29}{\\pi }, -\\frac{29}{\\pi }, \\frac{26}{\\pi }, -\\frac{22}{\\pi }, -\\frac{22}{\\pi }, \\frac{8}{\\pi }, -\\frac{29}{\\pi }, -\\frac{29}{\\pi }, \\frac{8}{\\pi }, -\\frac{22}{\\pi }, -\\frac{22}{\\pi }, \\frac{8}{\\pi }, \\frac{26}{\\pi }, \\frac{8}{\\pi }, \\frac{8}{\\pi }, \\frac{26}{\\pi }, -\\frac{29}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{29}{\\pi },\\frac{8}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(29/math.pi), -(29/math.pi), -(29/math.pi), (8/math.pi), (26/math.pi), (8/math.pi), (8/math.pi), (8/math.pi), -(22/math.pi), -(29/math.pi), -(29/math.pi), -(29/math.pi), (26/math.pi), -(22/math.pi), -(22/math.pi), (8/math.pi), -(29/math.pi), -(29/math.pi), (8/math.pi), -(22/math.pi), -(22/math.pi), (8/math.pi), (26/math.pi), (8/math.pi), (8/math.pi), (26/math.pi), -(29/math.pi)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3 e, 0, -9}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.e, 0, -9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{4}{3}, \\frac{25}{3}, \\frac{55}{3}, \\frac{4}{3}}$.\n", - "Output Answer": [ - "$\\frac{2200}{921}$" - ], - "Output Program": [ - "import statistics\nvalues = (4/3), (25/3), (55/3), (4/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${25, 9, -1000, 1, 100}$.\n", - "Output Answer": [ - "$10 \\sqrt[5]{-1} 15^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 25, 9, -1000, 1, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\sqrt{2}, 10, -1.6}$.\n", - "Output Answer": [ - "${-1.6, \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(2), 10, -1.6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-27, 36, 1000}$.\n", - "Output Answer": [ - "$30 \\sqrt[3]{-1} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -27, 36, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -7, 1, 9}$.\n", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -7, 1, 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -\\frac{44}{5}, 9, 2, -5, -3 \\sqrt{2}, \\frac{11}{2}, 1, \\frac{7}{\\sqrt{\\pi }}, -2, -13 \\log (2)}$.\n", - "Output Answer": [ - "$9+13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -(44/5), 9, 2, -5, -3*math.sqrt(2), (11/2), 1, (7/(math.sqrt(math.pi))), -2, -13*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{29}{3}, \\frac{28}{3}}$.\n", - "Output Answer": [ - "$\\frac{1624}{171}$" - ], - "Output Program": [ - "import statistics\nvalues = (29/3), (28/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.3 x-0.2$ where $x \\sim $ \\text{BetaDistribution}[1.7,1.7]\n", - "Output Answer": [ - "$-1.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 1.7)\nprint(E(-2.3*x-0.2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-7, 10, 2, -2, -4, 7, 6, -1, -5} \\cap {8, 5, -4, 7, -5, -8, -2}$.\n", - "Output Answer": [ - "${-5, -4, -2, 7}$" - ], - "Output Program": [ - "fst = set((-7, 10, 2, -2, -4, 7, 6, -1, -5,))\nsnd = set((8, 5, -4, 7, -5, -8, -2,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 9, 15}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 9, 15\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{29}{4}, -4, \\frac{1}{4}, \\frac{1}{4}, \\frac{15}{2}, -4, \\frac{1}{4}, \\frac{15}{2}, -4, -\\frac{19}{4}, \\frac{7}{4}, \\frac{7}{4}, \\frac{1}{4}, -4, \\frac{1}{4}, \\frac{1}{4}, \\frac{1}{4}, -4, -4, \\frac{1}{4}, \\frac{15}{2}, -\\frac{19}{4}, \\frac{1}{4}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{1}{4}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (29/4), -4, (1/4), (1/4), (15/2), -4, (1/4), (15/2), -4, -(19/4), (7/4), (7/4), (1/4), -4, (1/4), (1/4), (1/4), -4, -4, (1/4), (15/2), -(19/4), (1/4)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -2, 9} \\setminus {10, -6 \\sqrt{3}, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-6, -2, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -2, 9,))\nsnd = set((10, -6*math.sqrt(3), -7*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -7 \\sqrt{2}, 7, 0, -2 \\sqrt{3}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -7*math.sqrt(2), 7, 0, -2*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, -6, 11}$.\n", - "Output Answer": [ - "$\\sqrt{91}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -6, 11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.084,0.037,0.138,0.128,0.022,0.242,0.074,0.092\\}$ and $\\{0.249,0.09,0.139,0.129,0.051,0.094,0.089,0.047,0.078\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.084, 0.037, 0.138, 0.128, 0.022, 0.242, 0.074, 0.092\ndistribution2 = 0.249, 0.09, 0.139, 0.129, 0.051, 0.094, 0.089, 0.047, 0.078\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.075,0.237,0.002,0.039,0.176,0.018,0.249\\}$ and $\\{0.153,0.12,0.187,0.136,0.11,0.163,0.08\\}$.", - "Output Answer": [ - "$0.65$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.075, 0.237, 0.002, 0.039, 0.176, 0.018, 0.249\ndistribution2 = 0.153, 0.12, 0.187, 0.136, 0.11, 0.163, 0.08\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4 \\log (2), -\\frac{16}{3}, -1, \\frac{64}{7}, 3 \\sqrt{5}, -\\frac{9}{e}, 1} \\cup {3 \\log (2), -\\frac{8}{3}, 1, -\\frac{13}{5}, -\\frac{8}{e}, -1, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{16}{3}, -\\frac{9}{e}, -\\frac{8}{e}, -\\frac{8}{3}, -\\frac{13}{5}, -1, 1, 3 \\log (2), 4 \\log (2), 3 \\sqrt{5}, \\frac{64}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.log(2), -(16/3), -1, (64/7), 3*math.sqrt(5), -(9/math.e), 1,))\nsnd = set((3*math.log(2), -(8/3), 1, -(13/5), -(8/math.e), -1, 3*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{16}{3}, 18, \\frac{38}{3}, 5}$.\n", - "Output Answer": [ - "$\\frac{54720}{7141}$" - ], - "Output Program": [ - "import statistics\nvalues = (16/3), 18, (38/3), 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{44}{5}, \\frac{13}{5}, -3, \\frac{34}{5}, -\\frac{38}{5}}$.\n", - "Output Answer": [ - "$\\frac{38}{25}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (44/5), (13/5), -3, (34/5), -(38/5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\sqrt{3}, -7, \\frac{32}{5}, -\\frac{4}{\\sqrt{3}}, -3 \\sqrt{5}} \\setminus {-8, 2 \\sqrt{3}, \\frac{4}{e}, \\frac{14}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-7, -3 \\sqrt{5}, -2 \\sqrt{3}, -\\frac{4}{\\sqrt{3}}, \\frac{32}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(3), -7, (32/5), -(4/(math.sqrt(3))), -3*math.sqrt(5),))\nsnd = set((-8, 2*math.sqrt(3), (4/math.e), (14/(math.sqrt(3))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2 \\pi, -\\frac{52}{7}, -4 \\sqrt{2}, 6, -\\frac{24}{e}, 9 \\log (2), 1, 7}$.\n", - "Output Answer": [ - "${-\\frac{24}{e}, -\\frac{52}{7}, -2 \\pi, -4 \\sqrt{2}, 1, 6, 9 \\log (2), 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.pi, -(52/7), -4*math.sqrt(2), 6, -(24/math.e), 9*math.log(2), 1, 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -\\frac{2}{\\sqrt{\\pi }}, 1} \\setminus {-7, 5, -6.7, -\\frac{2}{\\sqrt{\\pi }}, -2 e}$.\n", - "Output Answer": [ - "${1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -(2/(math.sqrt(math.pi))), 1,))\nsnd = set((-7, 5, -6.7, -(2/(math.sqrt(math.pi))), -2*math.e,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{5}{\\sqrt{3}}, 3 \\sqrt{3}, \\frac{16}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, -3 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -3 \\sqrt{3}, \\frac{16}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, 3 \\sqrt{3}, -3 \\sqrt{3}, \\frac{5}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{5}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{5}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (5/(math.sqrt(3))), 3*math.sqrt(3), (16/(math.sqrt(3))), (5/(math.sqrt(3))), -3*math.sqrt(3), (8/(math.sqrt(3))), (16/(math.sqrt(3))), (5/(math.sqrt(3))), (4/(math.sqrt(3))), (8/(math.sqrt(3))), (4/(math.sqrt(3))), (5/(math.sqrt(3))), (8/(math.sqrt(3))), (8/(math.sqrt(3))), -3*math.sqrt(3), (16/(math.sqrt(3))), (16/(math.sqrt(3))), (16/(math.sqrt(3))), (8/(math.sqrt(3))), (5/(math.sqrt(3))), 3*math.sqrt(3), -3*math.sqrt(3), (5/(math.sqrt(3))), (4/(math.sqrt(3))), (5/(math.sqrt(3))), (4/(math.sqrt(3))), (8/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{2}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -\\frac{17}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{17}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, -4 \\sqrt{5}, 3 \\sqrt{5}, -\\frac{2}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -\\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -\\frac{2}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{17}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -4 \\sqrt{5}, \\frac{9}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -\\sqrt{5}, -4 \\sqrt{5}, \\frac{6}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{17}{\\sqrt{5}}, -4 \\sqrt{5}, \\frac{6}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(2/(math.sqrt(5))), (11/(math.sqrt(5))), (11/(math.sqrt(5))), (11/(math.sqrt(5))), -(17/(math.sqrt(5))), 3*math.sqrt(5), -(17/(math.sqrt(5))), (9/(math.sqrt(5))), -4*math.sqrt(5), 3*math.sqrt(5), -(2/(math.sqrt(5))), -(2/(math.sqrt(5))), -math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -(2/(math.sqrt(5))), -math.sqrt(5), -(17/(math.sqrt(5))), (11/(math.sqrt(5))), -(2/(math.sqrt(5))), -4*math.sqrt(5), (9/(math.sqrt(5))), (11/(math.sqrt(5))), -math.sqrt(5), -4*math.sqrt(5), (6/(math.sqrt(5))), -math.sqrt(5), -(17/(math.sqrt(5))), -4*math.sqrt(5), (6/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -\\frac{8}{e}, 6} \\cup {6, -\\frac{43}{7}, -\\frac{8}{e}}$.\n", - "Output Answer": [ - "${-9, -\\frac{43}{7}, -\\frac{8}{e}, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -(8/math.e), 6,))\nsnd = set((6, -(43/7), -(8/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, \\frac{21}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, 0, 0, -\\frac{19}{\\sqrt{5}}, 0, 0, 0, \\frac{21}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, 0, \\frac{9}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, 0, \\frac{21}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, (21/(math.sqrt(5))), (9/(math.sqrt(5))), -(9/(math.sqrt(5))), 0, 0, -(19/(math.sqrt(5))), 0, 0, 0, (21/(math.sqrt(5))), -(11/(math.sqrt(5))), -(9/(math.sqrt(5))), (9/(math.sqrt(5))), 0, (9/(math.sqrt(5))), -(9/(math.sqrt(5))), -(11/(math.sqrt(5))), -(9/(math.sqrt(5))), 0, (21/(math.sqrt(5))), (9/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-4, -\\frac{14}{e}, \\frac{22}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-\\frac{14}{e}, -4, \\frac{22}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -(14/math.e), (22/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, 5, -1, 0}$.\n", - "Output Answer": [ - "$\\sqrt{39}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 5, -1, 0\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 2 e, e, 0, -e, -e, 0, -e}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, 2*math.e, math.e, 0, -math.e, -math.e, 0, -math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, \\frac{14}{3}, 5, 17}$.\n", - "Output Answer": [ - "$\\frac{4760}{733}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, (14/3), 5, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-6, 10, 0, 4, 6, 14}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{38}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, 10, 0, 4, 6, 14\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -4, \\frac{34}{5}, -\\frac{21}{4}, 4, -2 \\sqrt{3}, -\\frac{15}{e}, -5 \\sqrt{2}}$.", - "Output Answer": [ - "$-\\frac{37}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -4, (34/5), -(21/4), 4, -2*math.sqrt(3), -(15/math.e), -5*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, 15, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{739}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 15, 8\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -7, -3, 3, -9, 3, 0}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -7, -3, 3, -9, 3, 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{47}{7}, -4 \\sqrt{2}, 0, -4 \\sqrt{3}, 4, -3, -1}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (47/7), -4*math.sqrt(2), 0, -4*math.sqrt(3), 4, -3, -1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x+2.1$ where $x \\sim $ \\text{BetaDistribution}[1.1,0.4]\n", - "Output Answer": [ - "$5.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.1, 0.4)\nprint(E(4.7*x+2.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 7, 7776, -729, 16807}$.\n", - "Output Answer": [ - "$378 \\sqrt[5]{-7} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 7, 7776, -729, 16807\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4. x^2+3.9 x+1.7$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(-4.*x**2+3.9*x+1.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2+1.2 x+0.4$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$226.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(4.4*x**2+1.2*x+0.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 1, \\frac{9}{\\sqrt{5}}, -3 \\sqrt{5}, -\\frac{7}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{9}{\\sqrt{5}}+3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 1, (9/(math.sqrt(5))), -3*math.sqrt(5), -(7/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, 11, -5, -7}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{329}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 11, -5, -7\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{5}{2}, -\\frac{13}{\\pi }, -10}$.\n", - "Output Answer": [ - "$\\frac{25}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/2), -(13/math.pi), -10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{6}{7}, -3, 9, 0, \\frac{7}{\\sqrt{\\pi }}, 7} \\setminus {\\frac{7}{\\sqrt{\\pi }}, -\\frac{11}{5}, -\\frac{18}{7}, 10, 0, 7, 3}$.\n", - "Output Answer": [ - "${-3, \\frac{6}{7}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set(((6/7), -3, 9, 0, (7/(math.sqrt(math.pi))), 7,))\nsnd = set(((7/(math.sqrt(math.pi))), -(11/5), -(18/7), 10, 0, 7, 3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5, -\\frac{14}{\\sqrt{5}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(5-\\frac{14}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -(14/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 4, 3, 3}$.\n", - "Output Answer": [ - "$\\frac{240}{61}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 4, 3, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{34}{3}, \\frac{8}{3}, \\frac{4}{3}, 10}$.\n", - "Output Answer": [ - "$\\frac{2720}{893}$" - ], - "Output Program": [ - "import statistics\nvalues = (34/3), (8/3), (4/3), 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $5. x-4.9$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$4.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(5.*x-4.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{3}, 4 \\sqrt{2}, -\\frac{58}{7}, 8, 5, 9, -8}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(3), 4*math.sqrt(2), -(58/7), 8, 5, 9, -8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -7, -8, 5 \\sqrt{2}, 4, 10, 8} \\setminus {-9, 8, 5 \\sqrt{2}, 5, -7, 10}$.\n", - "Output Answer": [ - "${-8, -2, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -7, -8, 5*math.sqrt(2), 4, 10, 8,))\nsnd = set((-9, 8, 5*math.sqrt(2), 5, -7, 10,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.209,0.415,0.046,0.136\\}$ and $\\{0.292,0.271,0.226,0.051\\}$.", - "Output Answer": [ - "$0.25$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.209, 0.415, 0.046, 0.136\ndistribution2 = 0.292, 0.271, 0.226, 0.051\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8.46, 4 \\sqrt{5}, \\frac{5}{\\sqrt{3}}, 2, 4, -8} \\setminus {4 \\sqrt{5}, \\frac{5}{\\sqrt{3}}, -1.97, -8}$.\n", - "Output Answer": [ - "${2, 4, 8.46}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.46, 4*math.sqrt(5), (5/(math.sqrt(3))), 2, 4, -8,))\nsnd = set((4*math.sqrt(5), (5/(math.sqrt(3))), -1.97, -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, 2 \\pi, \\frac{4}{\\sqrt{\\pi }}, -7, -6, 7, -\\frac{8}{\\pi }, -2, \\frac{24}{5}, 7, \\frac{15}{\\sqrt{\\pi }}, -\\frac{1}{e}, -\\sqrt{5}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, 2*math.pi, (4/(math.sqrt(math.pi))), -7, -6, 7, -(8/math.pi), -2, (24/5), 7, (15/(math.sqrt(math.pi))), -(1/math.e), -math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, \\frac{16}{\\sqrt{\\pi }}, 8, -6, -\\frac{7}{\\sqrt{2}}, 4}$.\n", - "Output Answer": [ - "$6+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, (16/(math.sqrt(math.pi))), 8, -6, -(7/(math.sqrt(2))), 4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{19}{4}, -4, -\\frac{7}{\\sqrt{3}}, 0, -3, \\frac{26}{7}, 8}$.\n", - "Output Answer": [ - "${-\\frac{19}{4}, -\\frac{7}{\\sqrt{3}}, -4, -3, 0, \\frac{26}{7}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/4), -4, -(7/(math.sqrt(3))), 0, -3, (26/7), 8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, 1, \\frac{11}{3}, -9, -1} \\cup {4, -2, \\frac{11}{3}, -6, 5}$.\n", - "Output Answer": [ - "${-9, -6, -2, -1, 1, \\frac{11}{3}, 4, 5}$" - ], - "Output Program": [ - "fst = set((4, 1, (11/3), -9, -1,))\nsnd = set((4, -2, (11/3), -6, 5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${15, -1, -4, -8, -7}$.\n", - "Output Answer": [ - "$\\frac{175}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -1, -4, -8, -7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -9, -2, 7, -2, 7, -3, 1, -2, -3, 7, -9, -3, -3, -9, 1, 0, 1, 7, -2, 1, -3, -9, -2, -2, 0, -9}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -9, -2, 7, -2, 7, -3, 1, -2, -3, 7, -9, -3, -3, -9, 1, 0, 1, 7, -2, 1, -3, -9, -2, -2, 0, -9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.104,0.137,0.026,0.127,0.005,0.106,0.064,0.103,0.13,0.105\\}$ and $\\{0.176,0.035,0.033,0.086,0.072,0.042,0.187,0.101,0.138,0.047\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.104, 0.137, 0.026, 0.127, 0.005, 0.106, 0.064, 0.103, 0.13, 0.105\ndistribution2 = 0.176, 0.035, 0.033, 0.086, 0.072, 0.042, 0.187, 0.101, 0.138, 0.047\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5 \\sqrt{3}, -2 \\sqrt{3}, 0, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$2 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 5*math.sqrt(3), -2*math.sqrt(3), 0, 5*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.2 x-4.$ where $x \\sim $ \\text{PoissonDistribution}[1.9]\n", - "Output Answer": [ - "$2.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.9)\nprint(E(3.2*x-4.))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\sqrt{2}, -\\frac{5}{\\pi }, -3, -2} \\cup {4, -\\sqrt{2}, -\\frac{11}{\\pi }, -3}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\pi }, -3, -2, -\\frac{5}{\\pi }, -\\sqrt{2}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(2), -(5/math.pi), -3, -2,))\nsnd = set((4, -math.sqrt(2), -(11/math.pi), -3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\pi, 5, 3, -3 e, \\frac{32}{5}, -5} \\setminus {-\\frac{3}{5}, 5, -7, -2, -9, 10}$.\n", - "Output Answer": [ - "${-3 e, -5, 3, 2 \\pi, \\frac{32}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.pi, 5, 3, -3*math.e, (32/5), -5,))\nsnd = set((-(3/5), 5, -7, -2, -9, 10,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{5}, 2 \\sqrt{5}, 3 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$-\\frac{7 \\sqrt{5}}{8}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(5), 2*math.sqrt(5), 3*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{27}{5}, 0, 5, 0, -7, -10, -7, -\\frac{17}{\\sqrt{5}}, 2, -6, 9, -1, 9, 5, -1}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -(27/5), 0, 5, 0, -7, -10, -7, -(17/(math.sqrt(5))), 2, -6, 9, -1, 9, 5, -1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{3}, -6, 2 e, -\\frac{1}{5}, 0, \\frac{18}{5}, \\frac{1}{3}, -4, e, 3} \\cup {0, -7, -4, 2 e, \\frac{24}{5}, 7, \\frac{33}{5}, \\frac{1}{3}, e}$.\n", - "Output Answer": [ - "${-7, -6, -3 \\sqrt{3}, -4, -\\frac{1}{5}, 0, \\frac{1}{3}, e, 3, \\frac{18}{5}, \\frac{24}{5}, 2 e, \\frac{33}{5}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(3), -6, 2*math.e, -(1/5), 0, (18/5), (1/3), -4, math.e, 3,))\nsnd = set((0, -7, -4, 2*math.e, (24/5), 7, (33/5), (1/3), math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{5}, -\\frac{2}{\\pi }, -1, -9, -3, -1, 5, 4 e, 6 \\sqrt{3}, -7, 7 \\sqrt{2}, 7, -2 e}$.\n", - "Output Answer": [ - "$9+4 e$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(5), -(2/math.pi), -1, -9, -3, -1, 5, 4*math.e, 6*math.sqrt(3), -7, 7*math.sqrt(2), 7, -2*math.e\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.073,0.227,0.273,0.207\\}$ and $\\{0.24,0.17,0.149,0.214\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.073, 0.227, 0.273, 0.207\ndistribution2 = 0.24, 0.17, 0.149, 0.214\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, 2, -\\frac{1}{e}, -\\frac{1}{\\pi }, -3, -1, -\\sqrt{5}, -7, -5, 7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\frac{1}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 2, -(1/math.e), -(1/math.pi), -3, -1, -math.sqrt(5), -7, -5, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.129,0.092,0.097,0.055,0.123,0.113,0.047,0.014,0.202\\}$ and $\\{0.048,0.068,0.265,0.078,0.165,0.051,0.09,0.066,0.038\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.129, 0.092, 0.097, 0.055, 0.123, 0.113, 0.047, 0.014, 0.202\ndistribution2 = 0.048, 0.068, 0.265, 0.078, 0.165, 0.051, 0.09, 0.066, 0.038\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -2, -6, -3, -9, -7}$.\n", - "Output Answer": [ - "$-\\frac{25}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -2, -6, -3, -9, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -4, 0, -5, -7, -5, 4, -1, -1, -1, -4, -6, -5, -4, 0, -6, 0, 4, -4, -7, -7, -7, 4, -4, -6}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -4, 0, -5, -7, -5, 4, -1, -1, -1, -4, -6, -5, -4, 0, -6, 0, 4, -4, -7, -7, -7, 4, -4, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 4, 9, 9, 7, 4, -9, 4, 2, 9, 9, -9, 7, 9, -9, -1, 7, 2, 9, 4, -1, 4, 7, 2, 7, 9, 7, -1, -9, 9}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 4, 9, 9, 7, 4, -9, 4, 2, 9, 9, -9, 7, 9, -9, -1, 7, 2, 9, 4, -1, 4, 7, 2, 7, 9, 7, -1, -9, 9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 9, 10, -\\frac{8}{\\sqrt{3}}, -\\frac{8}{\\pi }, 9, -7, -\\frac{11}{5}, -\\frac{19}{\\sqrt{5}}, -10}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 9, 10, -(8/(math.sqrt(3))), -(8/math.pi), 9, -7, -(11/5), -(19/(math.sqrt(5))), -10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\log (2), 10 \\log (2)}$.\n", - "Output Answer": [ - "$7 \\log (2)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.log(2), 10*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{7}{\\sqrt{3}}, -4 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, -\\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{1}{4} \\left(-\\frac{1}{\\sqrt{3}}-4 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(7/(math.sqrt(3))), -4*math.sqrt(3), (13/(math.sqrt(3))), -(7/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{8}{3}, \\frac{16}{3}, 4, 18}$.\n", - "Output Answer": [ - "$\\frac{576}{125}$" - ], - "Output Program": [ - "import statistics\nvalues = (8/3), (16/3), 4, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, 1, 0, 2, 7, 6, -\\frac{17}{2}} \\setminus {2, 5, -5, -\\frac{17}{2}}$.\n", - "Output Answer": [ - "${0, 1, 6, 7, 8}$" - ], - "Output Program": [ - "fst = set((8, 1, 0, 2, 7, 6, -(17/2),))\nsnd = set((2, 5, -5, -(17/2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 2, 3, 3, 7, -4, 0, 1}$.\n", - "Output Answer": [ - "$\\frac{7}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 2, 3, 3, 7, -4, 0, 1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, -8, 8}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{-1} 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, -8, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5 \\log (2), -4 \\sqrt{3}, 1, 4}$.\n", - "Output Answer": [ - "$4+4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.log(2), -4*math.sqrt(3), 1, 4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${512, 6561, 81, 2401}$.\n", - "Output Answer": [ - "$756 \\sqrt[4]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 512, 6561, 81, 2401\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.135,0.004,0.134,0.003,0.713\\}$ and $\\{0.164,0.366,0.105,0.02,0.187\\}$.", - "Output Answer": [ - "$0.79$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.135, 0.004, 0.134, 0.003, 0.713\ndistribution2 = 0.164, 0.366, 0.105, 0.02, 0.187\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 8, 8, 1, 8, 0, 9, 8, -4, 9, 0, 0, 9, 1, -4, 8, 9, -4, 1, 1, 0, 0}$.\n", - "Output Answer": [ - "$\\{1,8,0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 8, 8, 1, 8, 0, 9, 8, -4, 9, 0, 0, 9, 1, -4, 8, 9, -4, 1, 1, 0, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -8}$.\n", - "Output Answer": [ - "$8 i \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.1 x^3-2.3 x^2+0.7 x-1.2$ where $x \\sim $ \\text{NormalDistribution}[-0.5,2.6]\n", - "Output Answer": [ - "$3.88$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.5, 2.6)\nprint(E(-2.1*x**3-2.3*x**2+0.7*x-1.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x-0.7$ where $x \\sim $ \\text{PoissonDistribution}[0.6]\n", - "Output Answer": [ - "$0.98$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.6)\nprint(E(2.8*x-0.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -2, -8, 8, -2, 2}$.\n", - "Output Answer": [ - "$-\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -2, -8, 8, -2, 2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{\\pi }}, 0, \\frac{8}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{8}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, 0, -\\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(13/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (8/(math.sqrt(math.pi))), (8/(math.sqrt(math.pi))), 0, (8/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (8/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (8/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), 0, -(13/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.056,0.009,0.091,0.139,0.326,0.049,0.094,0.205\\}$ and $\\{0.27,0.04,0.012,0.054,0.027,0.097,0.02,0.172\\}$.", - "Output Answer": [ - "$0.88$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.056, 0.009, 0.091, 0.139, 0.326, 0.049, 0.094, 0.205\ndistribution2 = 0.27, 0.04, 0.012, 0.054, 0.027, 0.097, 0.02, 0.172\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{5}, -\\frac{13}{5}, -\\frac{13}{5}, \\frac{23}{5}, -\\frac{13}{5}, \\frac{23}{5}, \\frac{18}{5}, \\frac{23}{5}, \\frac{23}{5}, \\frac{23}{5}, -\\frac{13}{5}, \\frac{23}{5}, -\\frac{13}{5}, \\frac{23}{5}, \\frac{23}{5}, \\frac{18}{5}, \\frac{18}{5}, -\\frac{13}{5}, \\frac{18}{5}, -\\frac{13}{5}, \\frac{23}{5}, \\frac{23}{5}, \\frac{18}{5}, \\frac{23}{5}, \\frac{18}{5}, \\frac{18}{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{23}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(13/5), -(13/5), -(13/5), (23/5), -(13/5), (23/5), (18/5), (23/5), (23/5), (23/5), -(13/5), (23/5), -(13/5), (23/5), (23/5), (18/5), (18/5), -(13/5), (18/5), -(13/5), (23/5), (23/5), (18/5), (23/5), (18/5), (18/5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-8, -2, -3, -9, -3, -1, \\frac{13}{3}, \\frac{16}{\\sqrt{\\pi }}, \\frac{4}{e}, 0, 4 \\sqrt{2}, 6, -\\frac{48}{5}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, -2, -3, -9, -3, -1, (13/3), (16/(math.sqrt(math.pi))), (4/math.e), 0, 4*math.sqrt(2), 6, -(48/5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -1, 2, 10, -5, 8, -10}$.\n", - "Output Answer": [ - "$-\\frac{3}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -1, 2, 10, -5, 8, -10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x-1.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$-1.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(-4.1*x-1.7))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, \\frac{14}{\\sqrt{5}}, \\frac{33}{5}, 8, -5, -0.6, 3, \\frac{42}{5}} \\setminus {-\\frac{19}{\\sqrt{5}}, 8, \\frac{33}{5}, -5, -6, -2}$.\n", - "Output Answer": [ - "${-0.6, 3, \\frac{14}{\\sqrt{5}}, \\frac{42}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, (14/(math.sqrt(5))), (33/5), 8, -5, -0.6, 3, (42/5),))\nsnd = set((-(19/(math.sqrt(5))), 8, (33/5), -5, -6, -2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 15, 20}$.\n", - "Output Answer": [ - "$\\frac{360}{29}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 15, 20\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^2-4.2 x-1.1$ where $x \\sim $ \\text{ExponentialDistribution}[0.1]\n", - "Output Answer": [ - "$36.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.1)\nprint(E(0.4*x**2-4.2*x-1.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{3}, \\frac{38}{3}, \\frac{19}{3}, 20}$.\n", - "Output Answer": [ - "$\\frac{34960}{3647}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/3), (38/3), (19/3), 20\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.169,0.279,0.078\\}$ and $\\{0.123,0.159,0.295\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.169, 0.279, 0.078\ndistribution2 = 0.123, 0.159, 0.295\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\frac{13}{\\sqrt{3}}, -2, 9, 3 e} \\setminus {\\frac{13}{\\sqrt{3}}, 9, -2, 8}$.\n", - "Output Answer": [ - "${0, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, (13/(math.sqrt(3))), -2, 9, 3*math.e,))\nsnd = set(((13/(math.sqrt(3))), 9, -2, 8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -3 \\sqrt{5}, -5, \\frac{18}{\\pi }, 1, -4 \\sqrt{2}, -\\frac{4}{5}, -9, \\frac{11}{\\pi }}$.\n", - "Output Answer": [ - "$9+\\frac{18}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -3*math.sqrt(5), -5, (18/math.pi), 1, -4*math.sqrt(2), -(4/5), -9, (11/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x^2-4. x-8.2$ where $x \\sim $ \\text{NormalDistribution}[-0.3,1.1]\n", - "Output Answer": [ - "$-3.49$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.3, 1.1)\nprint(E(2.7*x**2-4.*x-8.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.536,0.073,0.223\\}$ and $\\{0.558,0.248,0.07\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.536, 0.073, 0.223\ndistribution2 = 0.558, 0.248, 0.07\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 3 \\sqrt{2}, -5, -9.58, -4, -6, -\\frac{5}{e}, -\\frac{48}{5}} \\cup {-4, -\\frac{5}{e}, 10, -1, -7, -6, -9.58, 3 \\sqrt{2}, -\\frac{39}{5}, \\frac{5}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{48}{5}, -9.58, -\\frac{39}{5}, -7, -6, -5, -4, -\\frac{5}{e}, -1, \\frac{5}{\\sqrt{3}}, 3 \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 3*math.sqrt(2), -5, -9.58, -4, -6, -(5/math.e), -(48/5),))\nsnd = set((-4, -(5/math.e), 10, -1, -7, -6, -9.58, 3*math.sqrt(2), -(39/5), (5/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6 \\sqrt{2}, 4, 2 e, -8 \\log (2), -5, -\\frac{7}{\\sqrt{3}}, -3 \\sqrt{3}, 6, \\frac{31}{7}, 5 \\sqrt{2}, -\\frac{13}{\\sqrt{\\pi }}, -7, 0, -2, -\\frac{12}{e}}$.", - "Output Answer": [ - "$-\\frac{7}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6*math.sqrt(2), 4, 2*math.e, -8*math.log(2), -5, -(7/(math.sqrt(3))), -3*math.sqrt(3), 6, (31/7), 5*math.sqrt(2), -(13/(math.sqrt(math.pi))), -7, 0, -2, -(12/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.061,0.161,0.316,0.168,0.201,0.044\\}$ and $\\{0.361,0.17,0.083,0.002,0.009,0.361\\}$.", - "Output Answer": [ - "$1.7$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.061, 0.161, 0.316, 0.168, 0.201, 0.044\ndistribution2 = 0.361, 0.17, 0.083, 0.002, 0.009, 0.361\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-10, 0, 1.8}$.\n", - "Output Answer": [ - "${-10, 0, 1.8}$" - ], - "Output Program": [ - "values = -10, 0, 1.8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, -3, 12, -10}$.\n", - "Output Answer": [ - "$\\frac{373}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, -3, 12, -10\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${7, \\frac{17}{\\sqrt{3}}, -\\frac{13}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\pi }, 7, \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, (17/(math.sqrt(3))), -(13/math.pi)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{5}{\\pi }, -1, \\frac{19}{\\sqrt{5}}, 5}$.\n", - "Output Answer": [ - "$1+\\frac{19}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/math.pi), -1, (19/(math.sqrt(5))), 5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, 5, -9, -1, 0, -9, -5, -5, 5, -1, -1, -1, 0, -9, 0, 0, -1, -5, 5, -5, -9, -1, -9, 5}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, 5, -9, -1, 0, -9, -5, -5, 5, -1, -1, -1, 0, -9, 0, 0, -1, -5, 5, -5, -9, -1, -9, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -4, -3} \\setminus {-4, -8, -1, 6 \\sqrt{2}, 7}$.\n", - "Output Answer": [ - "${-3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -4, -3,))\nsnd = set((-4, -8, -1, 6*math.sqrt(2), 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-6.2, \\frac{15}{\\pi }, 3, 0, \\frac{21}{4}, 8} \\cup {-6.2, 8, -\\frac{13}{2}, 0, 4, \\frac{15}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{13}{2}, -6.2, 0, 3, 4, \\frac{15}{\\pi }, \\frac{21}{4}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6.2, (15/math.pi), 3, 0, (21/4), 8,))\nsnd = set((-6.2, 8, -(13/2), 0, 4, (15/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.111,0.028,0.266,0.071,0.289\\}$ and $\\{0.171,0.039,0.024,0.131,0.263\\}$.", - "Output Answer": [ - "$0.54$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.111, 0.028, 0.266, 0.071, 0.289\ndistribution2 = 0.171, 0.039, 0.024, 0.131, 0.263\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.179,0.084,0.086,0.139,0.101,0.186,0.068,0.038\\}$ and $\\{0.064,0.06,0.001,0.412,0.317,0.089,0.052,0.005\\}$.", - "Output Answer": [ - "$0.76$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.179, 0.084, 0.086, 0.139, 0.101, 0.186, 0.068, 0.038\ndistribution2 = 0.064, 0.06, 0.001, 0.412, 0.317, 0.089, 0.052, 0.005\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.096,0.181,0.036,0.206,0.15,0.136,0.162\\}$ and $\\{0.091,0.189,0.122,0.077,0.109,0.146,0.146\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.096, 0.181, 0.036, 0.206, 0.15, 0.136, 0.162\ndistribution2 = 0.091, 0.189, 0.122, 0.077, 0.109, 0.146, 0.146\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 3, 20, 11}$.\n", - "Output Answer": [ - "$\\frac{18480}{2851}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 3, 20, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, 11}$.\n", - "Output Answer": [ - "$\\frac{21}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{13}{e}, -\\frac{25}{e}}$.\n", - "Output Answer": [ - "$-\\frac{19}{e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(13/math.e), -(25/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{55}{7}, 8, 8, -3 \\sqrt{3}, -\\frac{17}{\\sqrt{3}}, -8}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{3}}, -8, -\\frac{55}{7}, -3 \\sqrt{3}, 8, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(55/7), 8, 8, -3*math.sqrt(3), -(17/(math.sqrt(3))), -8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\sqrt{2}, 2, -9, -6, \\frac{1}{e}, 8, 1, -5 \\log (2), 0} \\cup {4, -e, -5 \\log (2), 2, 8, 2 \\sqrt{2}, 1, 0, -\\frac{9}{e}}$.\n", - "Output Answer": [ - "${-9, -6, -5 \\log (2), -\\frac{9}{e}, -e, 0, \\frac{1}{e}, 1, 2, 2 \\sqrt{2}, 4, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(2), 2, -9, -6, (1/math.e), 8, 1, -5*math.log(2), 0,))\nsnd = set((4, -math.e, -5*math.log(2), 2, 8, 2*math.sqrt(2), 1, 0, -(9/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 5, 10, 5, 1, 5, 10, 1, 5, -3, 1, -3, -3, 10, 10, -3, 1, 5, -3, 10, 10, 1, -3, -3, 10, 10, 10, 5, 5, 10}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 5, 10, 5, 1, 5, 10, 1, 5, -3, 1, -3, -3, 10, 10, -3, 1, 5, -3, 10, 10, 1, -3, -3, 10, 10, 10, 5, 5, 10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-4, -\\frac{9}{2}, -5, -\\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{\\pi }}, -5, -\\frac{9}{2}, -4}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -(9/2), -5, -(13/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, \\frac{7}{2}, \\frac{7}{2}}$.\n", - "Output Answer": [ - "$\\frac{399}{83}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, (7/2), (7/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.8 x-2.9$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$-5.57$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(-4.8*x-2.9))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${7, -\\frac{9}{\\sqrt{2}}, 4, -9.7, \\frac{29}{\\pi }} \\setminus {4, \\frac{10}{\\pi }, -\\frac{13}{\\sqrt{2}}, 3, -9.7, 7}$.\n", - "Output Answer": [ - "${-\\frac{9}{\\sqrt{2}}, \\frac{29}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -(9/(math.sqrt(2))), 4, -9.7, (29/math.pi),))\nsnd = set((4, (10/math.pi), -(13/(math.sqrt(2))), 3, -9.7, 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{3}, \\frac{28}{3}, \\frac{5}{3}, \\frac{35}{3}}$.\n", - "Output Answer": [ - "$\\frac{112}{39}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/3), (28/3), (5/3), (35/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-4, -6} \\setminus {-6, \\frac{11}{2}, -1, 2, 5 \\sqrt{3}, -5, 6.475}$.\n", - "Output Answer": [ - "${-4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -6,))\nsnd = set((-6, (11/2), -1, 2, 5*math.sqrt(3), -5, 6.475,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.131,0.088,0.119,0.101,0.122,0.115,0.177,0.02\\}$ and $\\{0.137,0.261,0.071,0.043,0.08,0.213,0.056,0.068\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.131, 0.088, 0.119, 0.101, 0.122, 0.115, 0.177, 0.02\ndistribution2 = 0.137, 0.261, 0.071, 0.043, 0.08, 0.213, 0.056, 0.068\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{33}{7}, -\\frac{52}{7}, -\\frac{9}{7}, \\frac{22}{7}, \\frac{5}{7}, -7}$.\n", - "Output Answer": [ - "$-\\frac{58}{21}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(33/7), -(52/7), -(9/7), (22/7), (5/7), -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 19, 9, 18}$.\n", - "Output Answer": [ - "$\\frac{1824}{157}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 19, 9, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.179,0.142,0.206,0.211\\}$ and $\\{0.269,0.272,0.066,0.147\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.179, 0.142, 0.206, 0.211\ndistribution2 = 0.269, 0.272, 0.066, 0.147\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -9, 5, -9, \\frac{9}{2}, 9, -\\sqrt{2}, 8, 0, \\frac{41}{7}, 9, -\\frac{18}{\\pi }, 2, 3, -\\frac{13}{4}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -9, 5, -9, (9/2), 9, -math.sqrt(2), 8, 0, (41/7), 9, -(18/math.pi), 2, 3, -(13/4)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\log (2), -12 \\log (2), -12 \\log (2), -5 \\log (2), -12 \\log (2), -3 \\log (2), -\\log (2), -\\log (2), 3 \\log (2), -3 \\log (2), -\\log (2), 3 \\log (2), 3 \\log (2), -12 \\log (2), -12 \\log (2), -\\log (2), -3 \\log (2), -5 \\log (2), -\\log (2), -5 \\log (2), -\\log (2), -12 \\log (2), 4 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-12 \\log (2),-\\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.log(2), -12*math.log(2), -12*math.log(2), -5*math.log(2), -12*math.log(2), -3*math.log(2), -math.log(2), -math.log(2), 3*math.log(2), -3*math.log(2), -math.log(2), 3*math.log(2), 3*math.log(2), -12*math.log(2), -12*math.log(2), -math.log(2), -3*math.log(2), -5*math.log(2), -math.log(2), -5*math.log(2), -math.log(2), -12*math.log(2), 4*math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -8, -9, 8, 8, 5, 1, -9, -9, 5, -9, 8, 8, 5, 1, -9, -8, 8, 5, 1, 8, -8, 1, 1, 1, 1, 5}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -8, -9, 8, 8, 5, 1, -9, -9, 5, -9, 8, 8, 5, 1, -9, -8, 8, 5, 1, 8, -8, 1, 1, 1, 1, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -\\frac{2}{3}, -\\frac{2}{5}}$.\n", - "Output Answer": [ - "$\\frac{2}{3}$" - ], - "Output Program": [ - "values = 0, -(2/3), -(2/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{25}{4}, -1, 3, 9, -\\frac{14}{3}} \\cup {\\frac{8}{3}, \\frac{25}{4}, 8, 9}$.\n", - "Output Answer": [ - "${-\\frac{14}{3}, -1, \\frac{8}{3}, 3, \\frac{25}{4}, 8, 9}$" - ], - "Output Program": [ - "fst = set(((25/4), -1, 3, 9, -(14/3),))\nsnd = set(((8/3), (25/4), 8, 9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, 8, 0, -6}$.\n", - "Output Answer": [ - "$\\sqrt{65}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 8, 0, -6\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{11}{\\sqrt{3}}, -\\frac{12}{\\pi }, -4, -2 \\pi, 7, -2.73, \\frac{7}{5}, \\frac{5}{e}}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{3}}, -2 \\pi, -4, -\\frac{12}{\\pi }, -2.73, \\frac{7}{5}, \\frac{5}{e}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/(math.sqrt(3))), -(12/math.pi), -4, -2*math.pi, 7, -2.73, (7/5), (5/math.e)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-27, 4, 81, 4096, -10}$.\n", - "Output Answer": [ - "$24\\ 3^{2/5} \\sqrt[5]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -27, 4, 81, 4096, -10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 4096, 9, -1}$.\n", - "Output Answer": [ - "$(40+40 i) \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 4096, 9, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -\\frac{10}{\\sqrt{3}}, -2, 4}$.\n", - "Output Answer": [ - "$5+\\frac{10}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -(10/(math.sqrt(3))), -2, 4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5 \\sqrt{2}, -2 \\sqrt{2}, 0} \\cup {\\frac{22}{3}, 3 \\sqrt{2}, -2 \\sqrt{2}, -\\frac{20}{\\pi }, 0}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -\\frac{20}{\\pi }, -2 \\sqrt{2}, 0, 3 \\sqrt{2}, \\frac{22}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(2), -2*math.sqrt(2), 0,))\nsnd = set(((22/3), 3*math.sqrt(2), -2*math.sqrt(2), -(20/math.pi), 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, 8, 9, 3, -11, 1}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{527}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 8, 9, 3, -11, 1\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -6, 6, -7, 6, -8, 3}$.\n", - "Output Answer": [ - "$-\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -6, 6, -7, 6, -8, 3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 17, 10}$.\n", - "Output Answer": [ - "$\\frac{306}{23}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 17, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, -7}$.\n", - "Output Answer": [ - "$\\frac{121}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, 8, 8.87}$.\n", - "Output Answer": [ - "${0, 8, 8.87}$" - ], - "Output Program": [ - "values = 0, 8, 8.87\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${1, 2 \\sqrt{3}, 6}$.\n", - "Output Answer": [ - "${1, 2 \\sqrt{3}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 2*math.sqrt(3), 6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{7}{\\sqrt{5}}, -5 \\sqrt{2}, -2, -\\frac{25}{3}, -\\frac{3}{2}, -\\frac{16}{\\sqrt{3}}, \\frac{27}{e}} \\setminus {-2, -\\frac{3}{2}, \\frac{8}{\\sqrt{3}}, \\frac{7}{\\sqrt{5}}, \\frac{16}{e}}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -\\frac{25}{3}, -5 \\sqrt{2}, \\frac{27}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/(math.sqrt(5))), -5*math.sqrt(2), -2, -(25/3), -(3/2), -(16/(math.sqrt(3))), (27/math.e),))\nsnd = set((-2, -(3/2), (8/(math.sqrt(3))), (7/(math.sqrt(5))), (16/math.e),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-4, 4, -4 \\sqrt{2}, -9.11, 9, -8, 2, \\frac{15}{e}} \\cup {0, -9.11, -4, -4 \\sqrt{2}, 2, \\frac{15}{e}, 9}$.\n", - "Output Answer": [ - "${-9.11, -8, -4 \\sqrt{2}, -4, 0, 2, 4, \\frac{15}{e}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 4, -4*math.sqrt(2), -9.11, 9, -8, 2, (15/math.e),))\nsnd = set((0, -9.11, -4, -4*math.sqrt(2), 2, (15/math.e), 9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -\\frac{43}{7}, \\sqrt{5}, 6, -7, -5, -\\frac{47}{5}} \\cup {-8, 6, -5, 0, -\\frac{47}{5}, -7, 4, -\\frac{43}{7}}$.\n", - "Output Answer": [ - "${-\\frac{47}{5}, -8, -7, -\\frac{43}{7}, -5, 0, \\sqrt{5}, 4, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -(43/7), math.sqrt(5), 6, -7, -5, -(47/5),))\nsnd = set((-8, 6, -5, 0, -(47/5), -7, 4, -(43/7),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 10, 2, 10, 2, -6, 10, 2, 6, -6, 2, -6, 6, 6, -6, 10, -6, 2, 10, 2, 10, 10, 6, -6}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 10, 2, 10, 2, -6, 10, 2, 6, -6, 2, -6, 6, 6, -6, 10, -6, 2, 10, 2, 10, 10, 6, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x+5.4$ where $x \\sim $ \\text{NormalDistribution}[1.2,1.9]\n", - "Output Answer": [ - "$6.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.2, 1.9)\nprint(E(1.*x+5.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${1, -\\frac{19}{3}}$.", - "Output Answer": [ - "$-\\frac{8}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, -(19/3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.245,0.155,0.065,0.082,0.162,0.212\\}$ and $\\{0.247,0.435,0.016,0.097,0.093,0.062\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.245, 0.155, 0.065, 0.082, 0.162, 0.212\ndistribution2 = 0.247, 0.435, 0.016, 0.097, 0.093, 0.062\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.269,0.236,0.179,0.11,0.036\\}$ and $\\{0.203,0.024,0.144,0.169,0.052\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.269, 0.236, 0.179, 0.11, 0.036\ndistribution2 = 0.203, 0.024, 0.144, 0.169, 0.052\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-13 \\log (2), -12 \\log (2), -11 \\log (2)}$.\n", - "Output Answer": [ - "$-12 \\log (2)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -13*math.log(2), -12*math.log(2), -11*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, \\frac{7}{\\pi }, -4, 7, -\\frac{12}{\\pi }, 2 \\sqrt{5}, \\frac{4}{\\sqrt{\\pi }}, -8, -3, -6 \\sqrt{2}, -3, -\\frac{14}{e}}$.\n", - "Output Answer": [ - "$7+6 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, (7/math.pi), -4, 7, -(12/math.pi), 2*math.sqrt(5), (4/(math.sqrt(math.pi))), -8, -3, -6*math.sqrt(2), -3, -(14/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, -8, -3, 4, -\\frac{25}{3}} \\cup {-8, 2, \\frac{8}{3}, -\\frac{7}{\\sqrt{2}}, -6, 4}$.\n", - "Output Answer": [ - "${-\\frac{25}{3}, -8, -6, -\\frac{7}{\\sqrt{2}}, -3, 2, \\frac{8}{3}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -8, -3, 4, -(25/3),))\nsnd = set((-8, 2, (8/3), -(7/(math.sqrt(2))), -6, 4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -1, 0, 9, -1, -1, -1, 5, -5, 9, -5, 0, 9, 5, -5, -5, -7, 8, -5, -7, -7, -5}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -1, 0, 9, -1, -1, -1, 5, -5, 9, -5, 0, 9, 5, -5, -5, -7, 8, -5, -7, -7, -5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{9}{4}, -8, 3 e, -9.24, 5.6, 9, -2} \\cup {-2, -8, -9.6, 9, -9.24}$.\n", - "Output Answer": [ - "${-9.6, -9.24, -8, -\\frac{9}{4}, -2, 5.6, 3 e, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(9/4), -8, 3*math.e, -9.24, 5.6, 9, -2,))\nsnd = set((-2, -8, -9.6, 9, -9.24,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4, -4, \\frac{1}{\\sqrt{2}}, 2, -\\sqrt{5}, -1, 3 e, -\\frac{25}{e}, 13 \\log (2), \\pi, \\frac{10}{7}, 8, -12 \\log (2)}$.", - "Output Answer": [ - "$\\frac{10}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -4, (1/(math.sqrt(2))), 2, -math.sqrt(5), -1, 3*math.e, -(25/math.e), 13*math.log(2), math.pi, (10/7), 8, -12*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${5, -9, 10}$.\n", - "Output Answer": [ - "$\\sqrt{97}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, -9, 10\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{39}{2}, 16, 10, 15}$.\n", - "Output Answer": [ - "$\\frac{2496}{175}$" - ], - "Output Program": [ - "import statistics\nvalues = (39/2), 16, 10, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${2 \\pi, 3 \\pi, 0, -3 \\pi, \\pi} \\cap {0, 3 \\pi, 2 \\pi, \\pi, -3 \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "${-3 \\pi, 0, \\pi, 2 \\pi, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.pi, 3*math.pi, 0, -3*math.pi, math.pi,))\nsnd = set((0, 3*math.pi, 2*math.pi, math.pi, -3*math.pi, -2*math.pi,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2, -6, -10, \\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-10, -6, -2, \\frac{1}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -6, -10, (1/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 12, 13, 18}$.\n", - "Output Answer": [ - "$\\frac{9360}{661}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 12, 13, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -\\frac{17}{3}, 2, \\frac{3}{\\sqrt{2}}, \\frac{9}{\\sqrt{2}}, \\frac{6}{5}, \\sqrt{5}, 0, -\\frac{16}{\\sqrt{\\pi }}, -5, 5 \\sqrt{3}, -\\frac{4}{\\pi }, 6, -\\frac{13}{3}}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -(17/3), 2, (3/(math.sqrt(2))), (9/(math.sqrt(2))), (6/5), math.sqrt(5), 0, -(16/(math.sqrt(math.pi))), -5, 5*math.sqrt(3), -(4/math.pi), 6, -(13/3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -2, -5, 4.3, -7 \\log (2), 4 e, 7, 6.67} \\cup {-4, 8, -7, 7, 6.67, -2.95, 3 e, 4.3, -4 \\log (2)}$.\n", - "Output Answer": [ - "${-7, -5, -7 \\log (2), -4, -3, -2.95, -4 \\log (2), -2, 4.3, 6.67, 7, 8, 3 e, 4 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -2, -5, 4.3, -7*math.log(2), 4*math.e, 7, 6.67,))\nsnd = set((-4, 8, -7, 7, 6.67, -2.95, 3*math.e, 4.3, -4*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, 4 \\sqrt{5}, \\frac{65}{7}, -9, 5, -9.1, -8} \\setminus {-3.9, 8, 4 \\sqrt{5}, -8}$.\n", - "Output Answer": [ - "${-9.1, -9, 5, \\frac{65}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 4*math.sqrt(5), (65/7), -9, 5, -9.1, -8,))\nsnd = set((-3.9, 8, 4*math.sqrt(5), -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{5}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -\\sqrt{2}, -\\frac{7}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -\\sqrt{2}, \\frac{5}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, 3 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -\\sqrt{2}, \\frac{3}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, \\frac{11}{\\sqrt{2}}, 3 \\sqrt{2}, 3 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, -\\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{5}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (5/(math.sqrt(2))), -(7/(math.sqrt(2))), (5/(math.sqrt(2))), (3/(math.sqrt(2))), -(3/(math.sqrt(2))), (3/(math.sqrt(2))), -math.sqrt(2), -(7/(math.sqrt(2))), (3/(math.sqrt(2))), -math.sqrt(2), (5/(math.sqrt(2))), (5/(math.sqrt(2))), (11/(math.sqrt(2))), -(3/(math.sqrt(2))), -(3/(math.sqrt(2))), 3*math.sqrt(2), -(7/(math.sqrt(2))), (3/(math.sqrt(2))), -math.sqrt(2), (3/(math.sqrt(2))), -(1/(math.sqrt(2))), (5/(math.sqrt(2))), (5/(math.sqrt(2))), (11/(math.sqrt(2))), 3*math.sqrt(2), 3*math.sqrt(2), (3/(math.sqrt(2))), (5/(math.sqrt(2))), -math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -3, -9, -9, -9, 3, -8, -9, -3, -2, -9, -8, -9, -8, -2, 4, -9, -8, 3, -3, -3, 3, -3, -8, -3, -9, -2}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -3, -9, -9, -9, 3, -8, -9, -3, -2, -9, -8, -9, -8, -2, 4, -9, -8, 3, -3, -3, 3, -3, -8, -3, -9, -2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, 2 \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), math.sqrt(5), math.sqrt(5), 2*math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -7, -6 \\log (2), -7, -5}$.", - "Output Answer": [ - "$-7$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -7, -6*math.log(2), -7, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-4, -9.18, -\\frac{18}{e}, \\frac{21}{\\pi }} \\cup {-\\frac{18}{e}, -9.18, -4, \\frac{25}{\\pi }}$.\n", - "Output Answer": [ - "${-9.18, -\\frac{18}{e}, -4, \\frac{21}{\\pi }, \\frac{25}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, -9.18, -(18/math.e), (21/math.pi),))\nsnd = set((-(18/math.e), -9.18, -4, (25/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x^2-2.1 x+2.3$ where $x \\sim $ \\text{NormalDistribution}[-0.1,2.3]\n", - "Output Answer": [ - "$8.87$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.1, 2.3)\nprint(E(1.2*x**2-2.1*x+2.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.072,0.152,0.013,0.133,0.219,0.046,0.144,0.029,0.076,0.073\\}$ and $\\{0.061,0.137,0.075,0.086,0.191,0.123,0.021,0.041,0.163,0.094\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.072, 0.152, 0.013, 0.133, 0.219, 0.046, 0.144, 0.029, 0.076, 0.073\ndistribution2 = 0.061, 0.137, 0.075, 0.086, 0.191, 0.123, 0.021, 0.041, 0.163, 0.094\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\log (2), \\frac{12}{\\sqrt{5}}, 4, \\frac{15}{e}, 10, 9, -9, -9, \\frac{3}{\\sqrt{2}}, -3 \\sqrt{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+\\frac{3}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.log(2), (12/(math.sqrt(5))), 4, (15/math.e), 10, 9, -9, -9, (3/(math.sqrt(2))), -3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, \\frac{13}{3}}$.\n", - "Output Answer": [ - "$\\frac{65}{14}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, (13/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, -7.483, 5, \\sqrt{3}, -2 \\sqrt{2}, -\\frac{7}{3}, 9} \\setminus {4, -10, 3, \\frac{23}{5}}$.\n", - "Output Answer": [ - "${-7.483, -2 \\sqrt{2}, -\\frac{7}{3}, \\sqrt{3}, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -7.483, 5, math.sqrt(3), -2*math.sqrt(2), -(7/3), 9,))\nsnd = set((4, -10, 3, (23/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 14, 12, 13}$.\n", - "Output Answer": [ - "$\\frac{4368}{617}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 14, 12, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{20}{\\pi }, -3, -2, \\frac{9}{\\sqrt{\\pi }}, 8, -\\frac{25}{\\pi }, e}$.\n", - "Output Answer": [ - "${-\\frac{25}{\\pi }, -\\frac{20}{\\pi }, -3, -2, e, \\frac{9}{\\sqrt{\\pi }}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(20/math.pi), -3, -2, (9/(math.sqrt(math.pi))), 8, -(25/math.pi), math.e\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.6 x^2+2.7 x-1.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.7]\n", - "Output Answer": [ - "$8.59$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.7)\nprint(E(1.6*x**2+2.7*x-1.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{1}{\\sqrt{3}}, 4 \\sqrt{3}, -4 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, -\\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{7}{3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (1/(math.sqrt(3))), 4*math.sqrt(3), -4*math.sqrt(3), (13/(math.sqrt(3))), -(8/(math.sqrt(3))), (8/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -6, -8, -9, -3, -2, -7}$.\n", - "Output Answer": [ - "$-\\frac{37}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -6, -8, -9, -3, -2, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.104,0.043,0.104,0.056,0.214,0.059,0.209,0.106,0.044\\}$ and $\\{0.223,0.117,0.018,0.008,0.036,0.089,0.095,0.001,0.143\\}$.", - "Output Answer": [ - "$0.96$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.104, 0.043, 0.104, 0.056, 0.214, 0.059, 0.209, 0.106, 0.044\ndistribution2 = 0.223, 0.117, 0.018, 0.008, 0.036, 0.089, 0.095, 0.001, 0.143\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -4, 9, 4, -9}$.\n", - "Output Answer": [ - "$-\\frac{2}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -4, 9, 4, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, -14, -4}$.\n", - "Output Answer": [ - "$\\frac{100}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -14, -4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, -4 \\sqrt{3}, 3.1} \\setminus {3.1, 7, 2 e, -\\frac{7}{\\sqrt{\\pi }}, 2, -4 \\sqrt{3}, -1, -4}$.\n", - "Output Answer": [ - "${4}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -4*math.sqrt(3), 3.1,))\nsnd = set((3.1, 7, 2*math.e, -(7/(math.sqrt(math.pi))), 2, -4*math.sqrt(3), -1, -4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 9, 18, 12}$.\n", - "Output Answer": [ - "$\\frac{16}{3}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 9, 18, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, \\frac{24}{e}}$.\n", - "Output Answer": [ - "${6, \\frac{24}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (24/math.e)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.175,0.064,0.282,0.064,0.141,0.117\\}$ and $\\{0.313,0.047,0.114,0.256,0.062,0.067\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.175, 0.064, 0.282, 0.064, 0.141, 0.117\ndistribution2 = 0.313, 0.047, 0.114, 0.256, 0.062, 0.067\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, 3, 9, -\\frac{16}{\\sqrt{3}}, \\frac{40}{7}, -7, -\\frac{11}{2}, 6, 8, -\\frac{1}{2}, \\frac{27}{7}}$.\n", - "Output Answer": [ - "$9+\\frac{16}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 3, 9, -(16/(math.sqrt(3))), (40/7), -7, -(11/2), 6, 8, -(1/2), (27/7)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{\\sqrt{\\pi }}, 8, 7, 4, 10}$.", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/(math.sqrt(math.pi))), 8, 7, 4, 10\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.175,0.366,0.032,0.067,0.078,0.013,0.035,0.119\\}$ and $\\{0.15,0.16,0.038,0.048,0.017,0.188,0.108,0.228\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.175, 0.366, 0.032, 0.067, 0.078, 0.013, 0.035, 0.119\ndistribution2 = 0.15, 0.16, 0.038, 0.048, 0.017, 0.188, 0.108, 0.228\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, 6, 9, -9, -7}$.\n", - "Output Answer": [ - "$-\\frac{11}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, 6, 9, -9, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, -2, 216, 4}$.\n", - "Output Answer": [ - "$(14+14 i) 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, -2, 216, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5, 4.5, -4 \\sqrt{2}, \\sqrt{5}, 4, \\frac{47}{7}, 0} \\setminus {\\sqrt{5}, -4 \\sqrt{5}, 4.5, -\\frac{20}{3}, -\\frac{51}{7}, 4, -4 \\sqrt{2}, -1, 0}$.\n", - "Output Answer": [ - "${5, \\frac{47}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, 4.5, -4*math.sqrt(2), math.sqrt(5), 4, (47/7), 0,))\nsnd = set((math.sqrt(5), -4*math.sqrt(5), 4.5, -(20/3), -(51/7), 4, -4*math.sqrt(2), -1, 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -14, -14, -5}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{241}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -14, -14, -5\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, 2, 6, 3 \\sqrt{3}, -\\frac{10}{7}, 5, 6, 8, 3}$.", - "Output Answer": [ - "$3 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 2, 6, 3*math.sqrt(3), -(10/7), 5, 6, 8, 3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, \\frac{9}{2}, \\frac{3}{2}, \\frac{9}{2}, 7, 7}$.\n", - "Output Answer": [ - "$\\frac{35}{12}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, (9/2), (3/2), (9/2), 7, 7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.8 x^2-4.2 x+1.4$ where $x \\sim $ \\text{PoissonDistribution}[2.6]\n", - "Output Answer": [ - "$-54.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.6)\nprint(E(-4.8*x**2-4.2*x+1.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-10, 0, \\frac{15}{7}, 7, 6, 10, 0, 4, 2, \\frac{7}{\\sqrt{2}}, -\\frac{1}{7}}$.", - "Output Answer": [ - "$\\frac{15}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, 0, (15/7), 7, 6, 10, 0, 4, 2, (7/(math.sqrt(2))), -(1/7)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.4 x^3+0.4 x^2+2.8 x+4.5$ where $x \\sim $ \\text{BetaDistribution}[0.8,1.3]\n", - "Output Answer": [ - "$4.99$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.8, 1.3)\nprint(E(-4.4*x**3+0.4*x**2+2.8*x+4.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x+0.1$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(0.9*x+0.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x+5.7$ where $x \\sim $ \\text{BetaDistribution}[0.7,1.6]\n", - "Output Answer": [ - "$6.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.7, 1.6)\nprint(E(4.*x+5.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{2}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{2}{\\sqrt{5}}, -\\frac{14}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{2}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{2}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(2/(math.sqrt(5))), -(12/(math.sqrt(5))), (17/(math.sqrt(5))), (17/(math.sqrt(5))), -(14/(math.sqrt(5))), -(14/(math.sqrt(5))), -(2/(math.sqrt(5))), -(2/(math.sqrt(5))), (17/(math.sqrt(5))), (17/(math.sqrt(5))), (17/(math.sqrt(5))), -math.sqrt(5), -(2/(math.sqrt(5))), -(14/(math.sqrt(5))), -math.sqrt(5), -(2/(math.sqrt(5))), -(12/(math.sqrt(5))), -(2/(math.sqrt(5))), -(12/(math.sqrt(5))), -(2/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{12}{\\sqrt{\\pi }}, \\frac{4}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, \\frac{10}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{14}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{7}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(12/(math.sqrt(math.pi))), (4/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), (10/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (14/(math.sqrt(math.pi))), (7/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 2401, 6, 81}$.\n", - "Output Answer": [ - "$21 \\sqrt[4]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 2401, 6, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.9 x^2-4.9 x+1.3$ where $x \\sim $ \\text{BetaDistribution}[1.4,1.6]\n", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.4, 1.6)\nprint(E(3.9*x**2-4.9*x+1.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.189,0.182,0.258,0.155,0.104\\}$ and $\\{0.254,0.166,0.077,0.193,0.085\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.189, 0.182, 0.258, 0.155, 0.104\ndistribution2 = 0.254, 0.166, 0.077, 0.193, 0.085\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{14}{\\sqrt{\\pi }}, 3, 9, 1, -\\frac{1}{2}, 3 \\sqrt{2}, 0, 1, \\sqrt{3}, -10 \\log (2), -2 \\sqrt{3}, -9, -\\frac{10}{\\pi }, -4, -4}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(14/(math.sqrt(math.pi))), 3, 9, 1, -(1/2), 3*math.sqrt(2), 0, 1, math.sqrt(3), -10*math.log(2), -2*math.sqrt(3), -9, -(10/math.pi), -4, -4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 e, -e, 3 e, 3 e, e, 2 e, 0, e}$.\n", - "Output Answer": [ - "$\\frac{13 e}{8}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.e, -math.e, 3*math.e, 3*math.e, math.e, 2*math.e, 0, math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -7 \\sqrt{2}, 8, -6 \\log (2), 1} \\cup {1, 8, -7, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -7, -6 \\log (2), 1, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -7*math.sqrt(2), 8, -6*math.log(2), 1,))\nsnd = set((1, 8, -7, -7*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 0, -9, 6}$.\n", - "Output Answer": [ - "$\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 0, -9, 6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{4}{\\sqrt{3}}, 2, 10, 3 e, -8, 4} \\setminus {2, -3 e, -7, 10, -8}$.\n", - "Output Answer": [ - "${-\\frac{4}{\\sqrt{3}}, 4, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/(math.sqrt(3))), 2, 10, 3*math.e, -8, 4,))\nsnd = set((2, -3*math.e, -7, 10, -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.037,0.05,0.004,0.075,0.324,0.219,0.009,0.044,0.057,0.116\\}$ and $\\{0.028,0.056,0.091,0.054,0.104,0.095,0.089,0.152,0.092,0.118\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.037, 0.05, 0.004, 0.075, 0.324, 0.219, 0.009, 0.044, 0.057, 0.116\ndistribution2 = 0.028, 0.056, 0.091, 0.054, 0.104, 0.095, 0.089, 0.152, 0.092, 0.118\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -9, -5, -9, 2, -9, 2, -5, -9, 1, 1, 2, 1, 1, -9, 1, 1, 1, 2, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -9, -5, -9, 2, -9, 2, -5, -9, 1, 1, 2, 1, 1, -9, 1, 1, 1, 2, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.05,0.043,0.111,0.085,0.039,0.113,0.155,0.093,0.076\\}$ and $\\{0.103,0.097,0.266,0.094,0.038,0.134,0.122,0.041,0.022\\}$.", - "Output Answer": [ - "$0.2$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.05, 0.043, 0.111, 0.085, 0.039, 0.113, 0.155, 0.093, 0.076\ndistribution2 = 0.103, 0.097, 0.266, 0.094, 0.038, 0.134, 0.122, 0.041, 0.022\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\pi, \\frac{17}{5}, -8, \\frac{19}{e}, -3 \\sqrt{3}, -e} \\setminus {2, -8, 2 \\pi, -\\frac{22}{3}, \\frac{17}{5}, -2 e}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -\\pi, -e, \\frac{19}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, (17/5), -8, (19/math.e), -3*math.sqrt(3), -math.e,))\nsnd = set((2, -8, 2*math.pi, -(22/3), (17/5), -2*math.e,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{7}{\\pi }, -\\frac{46}{7}, \\frac{1}{2}, 2.2, -3, 6, 4} \\cup {2.2, 4, 6, -7 \\sqrt{2}, \\frac{7}{\\pi }, -\\frac{3}{2}, -3}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -\\frac{46}{7}, -3, -\\frac{3}{2}, \\frac{1}{2}, 2.2, \\frac{7}{\\pi }, 4, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/math.pi), -(46/7), (1/2), 2.2, -3, 6, 4,))\nsnd = set((2.2, 4, 6, -7*math.sqrt(2), (7/math.pi), -(3/2), -3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 6, 8}$.\n", - "Output Answer": [ - "$\\frac{72}{13}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 6, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.6 x^2-0.4 x-0.6$ where $x \\sim $ \\text{NormalDistribution}[-1.8,2.7]\n", - "Output Answer": [ - "$-6.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 2.7)\nprint(E(-0.6*x**2-0.4*x-0.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${10, 3, -\\frac{9}{2}, 7, -\\pi, -4, -6} \\cup {-\\frac{9}{2}, 7, 3, 10, -4, -6, -2 \\pi, 9}$.\n", - "Output Answer": [ - "${-2 \\pi, -6, -\\frac{9}{2}, -4, -\\pi, 3, 7, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 3, -(9/2), 7, -math.pi, -4, -6,))\nsnd = set((-(9/2), 7, 3, 10, -4, -6, -2*math.pi, 9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -9, -3, 9 \\log (2), \\sqrt{5}, 5 \\log (2), 3 \\pi, -\\frac{25}{e}, -\\frac{23}{3}, -\\frac{4}{\\sqrt{3}}, 8}$.\n", - "Output Answer": [ - "$\\frac{25}{e}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -9, -3, 9*math.log(2), math.sqrt(5), 5*math.log(2), 3*math.pi, -(25/math.e), -(23/3), -(4/(math.sqrt(3))), 8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{3}{e}, \\frac{19}{e}, -\\frac{3}{e}, \\frac{12}{e}, 0, -\\frac{1}{e}, \\frac{17}{e}}$.\n", - "Output Answer": [ - "$\\frac{41}{7 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(3/math.e), (19/math.e), -(3/math.e), (12/math.e), 0, -(1/math.e), (17/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 3, 7, -9, 7, -9, -9, -7, 3, -5, -9, -9, -7, 7, 7, 7, -9, -5, 7, -7, -7, 3, 3, -9, -9, -5, -7}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 3, 7, -9, 7, -9, -9, -7, 3, -5, -9, -9, -7, 7, 7, 7, -9, -5, 7, -7, -7, 3, 3, -9, -9, -5, -7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{2 \\sqrt{5}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.sqrt(5), 4*math.sqrt(5), math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\sqrt{5}, 2 \\sqrt{5}, 3 \\sqrt{5}, -2 \\pi, 4, -9} \\setminus {4, 2 \\sqrt{5}, 0, 3 \\sqrt{5}, -2 \\pi}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), 2*math.sqrt(5), 3*math.sqrt(5), -2*math.pi, 4, -9,))\nsnd = set((4, 2*math.sqrt(5), 0, 3*math.sqrt(5), -2*math.pi,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.289,0.413,0.103\\}$ and $\\{0.001,0.043,0.746\\}$.", - "Output Answer": [ - "$2.92$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.289, 0.413, 0.103\ndistribution2 = 0.001, 0.043, 0.746\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-343, 1, -343, 9, -3}$.\n", - "Output Answer": [ - "$7 \\sqrt[5]{-7} 3^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -343, 1, -343, 9, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.2 x^2-3.1 x+0.7$ where $x \\sim $ \\text{NormalDistribution}[2.,1.6]\n", - "Output Answer": [ - "$15.49$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 2., 1.6)\nprint(E(3.2*x**2-3.1*x+0.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -1, 0, 3, -4, -\\pi}$.\n", - "Output Answer": [ - "$10$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -1, 0, 3, -4, -math.pi\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{\\sqrt{2}}, \\frac{12}{\\sqrt{5}}, 6}$.\n", - "Output Answer": [ - "$\\frac{11}{\\sqrt{2}}-\\frac{12}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = (11/(math.sqrt(2))), (12/(math.sqrt(5))), 6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2 e, \\frac{24}{5}, -1, 2.86, 5}$.\n", - "Output Answer": [ - "${-1, 2.86, \\frac{24}{5}, 5, 2 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, (24/5), -1, 2.86, 5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.155,0.148,0.161,0.064,0.009,0.033,0.038,0.077,0.084,0.199\\}$ and $\\{0.001,0.119,0.107,0.362,0.148,0.042,0.008,0.053,0.079,0.058\\}$.", - "Output Answer": [ - "$1.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.155, 0.148, 0.161, 0.064, 0.009, 0.033, 0.038, 0.077, 0.084, 0.199\ndistribution2 = 0.001, 0.119, 0.107, 0.362, 0.148, 0.042, 0.008, 0.053, 0.079, 0.058\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\pi, \\pi, -3 \\pi, -2 \\pi, 3 \\pi, 2 \\pi} \\cap {-\\pi, 3 \\pi, \\pi, 0, -3 \\pi, 2 \\pi}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\pi, \\pi, 2 \\pi, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.pi, math.pi, -3*math.pi, -2*math.pi, 3*math.pi, 2*math.pi,))\nsnd = set((-math.pi, 3*math.pi, math.pi, 0, -3*math.pi, 2*math.pi,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\pi, \\frac{23}{7}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{23}{7}-\\pi \\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.pi, (23/7)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 1, -9, -2, -1, 1, -1, 6, -1, -9, -5, -9, -5, 6, -1, -5, -1, -2, 6, -1, -1, -5, 6, -5, 6, -9}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 1, -9, -2, -1, 1, -1, 6, -1, -9, -5, -9, -5, 6, -1, -5, -1, -2, 6, -1, -1, -5, 6, -5, 6, -9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3 e, -\\frac{3}{\\sqrt{2}}, -8, 8, 7, \\frac{19}{\\sqrt{5}}, -\\frac{19}{4}, -1, -10, 2, 3 e, -\\frac{16}{5}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\frac{3}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.e, -(3/(math.sqrt(2))), -8, 8, 7, (19/(math.sqrt(5))), -(19/4), -1, -10, 2, 3*math.e, -(16/5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, 2, 14, 13, -12}$.\n", - "Output Answer": [ - "$\\frac{1697}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 2, 14, 13, -12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, \\frac{53}{3}, 9}$.\n", - "Output Answer": [ - "$\\frac{11448}{1117}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, (53/3), 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, 6, \\frac{39}{7}, -\\frac{46}{5}, -5, -2, 2 \\sqrt{5}, -8, \\frac{8}{\\sqrt{5}}, 1, -\\frac{9}{7}, \\frac{26}{e}}$.\n", - "Output Answer": [ - "$\\frac{96}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 6, (39/7), -(46/5), -5, -2, 2*math.sqrt(5), -8, (8/(math.sqrt(5))), 1, -(9/7), (26/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, -9, -10, 1, 1, 1, 1, 1, -9, -10, -9, 1, 6, -9, -9, -10, -9, 1, 6, -9, 6, -9, 1, -10, -10, -9, -9, -9, 6, -9}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, -9, -10, 1, 1, 1, 1, 1, -9, -10, -9, 1, 6, -9, -9, -10, -9, 1, 6, -9, 6, -9, 1, -10, -10, -9, -9, -9, 6, -9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.09,0.1,0.163,0.093,0.294,0.132\\}$ and $\\{0.346,0.15,0.011,0.046,0.043,0.06\\}$.", - "Output Answer": [ - "$0.88$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.09, 0.1, 0.163, 0.093, 0.294, 0.132\ndistribution2 = 0.346, 0.15, 0.011, 0.046, 0.043, 0.06\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -2, 8, -1}$.\n", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -2, 8, -1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 13}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${1, 7, -11}$.\n", - "Output Answer": [ - "$2 \\sqrt{21}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 1, 7, -11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${117649, -216, 8, 3, 117649, -1024}$.\n", - "Output Answer": [ - "$196\\ 6^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 117649, -216, 8, 3, 117649, -1024\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, 1000, 1, -5, 100000, 46656}$.\n", - "Output Answer": [ - "$60 \\sqrt[6]{-1} 2^{2/3} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, 1000, 1, -5, 100000, 46656\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.8 x^2-4.3 x+0.7$ where $x \\sim $ \\text{BetaDistribution}[0.2,0.5]\n", - "Output Answer": [ - "$-1.29$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.2, 0.5)\nprint(E(-3.8*x**2-4.3*x+0.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 6, \\frac{14}{3}, 9, \\frac{7}{\\sqrt{2}}, -1, 5, \\sqrt{5}, -2 \\log (2), 0, \\frac{4}{5}, -3}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 6, (14/3), 9, (7/(math.sqrt(2))), -1, 5, math.sqrt(5), -2*math.log(2), 0, (4/5), -3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 1, \\frac{37}{3}, \\frac{10}{3}}$.\n", - "Output Answer": [ - "$\\frac{4440}{1607}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 1, (37/3), (10/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 25, 25}$.\n", - "Output Answer": [ - "$5 \\sqrt[3]{5} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 25, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-3.25, -\\frac{3}{\\sqrt{2}}, -8} \\setminus {-\\frac{6}{5}, -4.67, -8}$.\n", - "Output Answer": [ - "${-3.25, -\\frac{3}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3.25, -(3/(math.sqrt(2))), -8,))\nsnd = set((-(6/5), -4.67, -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, 7, 3.2, -2, \\frac{28}{5}, \\frac{21}{5}, -4} \\cup {7, -\\frac{42}{5}, -6.8, 6, -2, -\\frac{44}{5}, -4}$.\n", - "Output Answer": [ - "${-\\frac{44}{5}, -\\frac{42}{5}, -6.8, -4, -2, 3.2, 4, \\frac{21}{5}, \\frac{28}{5}, 6, 7}$" - ], - "Output Program": [ - "fst = set((4, 7, 3.2, -2, (28/5), (21/5), -4,))\nsnd = set((7, -(42/5), -6.8, 6, -2, -(44/5), -4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5, 9, -9, -5, 4, -\\frac{1}{2}, -6, 2} \\cup {4, 2, -9, \\frac{7}{2}, -5, 9, -6}$.\n", - "Output Answer": [ - "${-9, -6, -5, -\\frac{1}{2}, 2, \\frac{7}{2}, 4, 5, 9}$" - ], - "Output Program": [ - "fst = set((5, 9, -9, -5, 4, -(1/2), -6, 2,))\nsnd = set((4, 2, -9, (7/2), -5, 9, -6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-1, -0.43, -\\frac{39}{5}, -\\frac{10}{\\sqrt{3}}, -2, -\\sqrt{5}, 3 \\pi, \\frac{5}{2}, 3 \\sqrt{3}} \\cup {-0.851, -2, -\\frac{39}{5}, 0, -5, 3 \\sqrt{3}, -3 \\sqrt{5}, 2, -\\frac{11}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{39}{5}, -3 \\sqrt{5}, -\\frac{11}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -5, -\\sqrt{5}, -2, -1, -0.851, -0.43, 0, 2, \\frac{5}{2}, 3 \\sqrt{3}, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -0.43, -(39/5), -(10/(math.sqrt(3))), -2, -math.sqrt(5), 3*math.pi, (5/2), 3*math.sqrt(3),))\nsnd = set((-0.851, -2, -(39/5), 0, -5, 3*math.sqrt(3), -3*math.sqrt(5), 2, -(11/(math.sqrt(3))),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{7}, -\\frac{27}{7}, -6, \\frac{3}{7}, -\\frac{11}{7}, \\frac{9}{7}}$.\n", - "Output Answer": [ - "$-\\frac{23}{14}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(1/7), -(27/7), -6, (3/7), -(11/7), (9/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.082,0.147,0.127,0.122,0.087,0.057,0.05,0.144,0.068\\}$ and $\\{0.043,0.159,0.118,0.128,0.04,0.023,0.061,0.208,0.149\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.082, 0.147, 0.127, 0.122, 0.087, 0.057, 0.05, 0.144, 0.068\ndistribution2 = 0.043, 0.159, 0.118, 0.128, 0.04, 0.023, 0.061, 0.208, 0.149\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.129,0.046,0.108,0.139,0.138,0.227,0.108\\}$ and $\\{0.032,0.197,0.036,0.025,0.308,0.233,0.083\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.129, 0.046, 0.108, 0.139, 0.138, 0.227, 0.108\ndistribution2 = 0.032, 0.197, 0.036, 0.025, 0.308, 0.233, 0.083\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 3, -1, 4096}$.\n", - "Output Answer": [ - "$8 \\sqrt[4]{-21}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 3, -1, 4096\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -2 \\sqrt{2}}$.\n", - "Output Answer": [ - "$2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -2*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, -9, -8, -\\frac{5}{\\pi }, 9, -4 \\log (2), -\\frac{11}{2}, -\\frac{4}{\\sqrt{5}}, 5, -\\frac{18}{\\pi }, -9, -4, -3, 7}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -9, -8, -(5/math.pi), 9, -4*math.log(2), -(11/2), -(4/(math.sqrt(5))), 5, -(18/math.pi), -9, -4, -3, 7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3, 64, 10, 4096, 59049, -7776}$.\n", - "Output Answer": [ - "$144\\ 3^{2/3} \\sqrt[6]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 64, 10, 4096, 59049, -7776\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 \\sqrt{5}, -\\frac{6}{\\sqrt{5}}, -4 \\sqrt{5}, -\\frac{16}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -4 \\sqrt{5}, -\\frac{6}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{6}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{6}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}, -\\frac{16}{\\sqrt{5}}, -4 \\sqrt{5}, -\\frac{6}{\\sqrt{5}}, -4 \\sqrt{5}, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{5},-\\frac{16}{\\sqrt{5}},-\\frac{22}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.sqrt(5), -(6/(math.sqrt(5))), -4*math.sqrt(5), -(16/(math.sqrt(5))), -(22/(math.sqrt(5))), -(16/(math.sqrt(5))), -4*math.sqrt(5), -(6/(math.sqrt(5))), -(16/(math.sqrt(5))), -(6/(math.sqrt(5))), -(22/(math.sqrt(5))), -(16/(math.sqrt(5))), -(22/(math.sqrt(5))), -(16/(math.sqrt(5))), -(22/(math.sqrt(5))), -(22/(math.sqrt(5))), -(6/(math.sqrt(5))), -(22/(math.sqrt(5))), -(16/(math.sqrt(5))), -4*math.sqrt(5), -(6/(math.sqrt(5))), -4*math.sqrt(5), -4*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{14}{\\sqrt{5}}, 0, 6.3, -5, -\\frac{7}{\\sqrt{2}}} \\setminus {3, -5, -\\frac{14}{\\sqrt{3}}, -\\frac{7}{\\sqrt{2}}, \\frac{2}{\\sqrt{5}}, 7}$.\n", - "Output Answer": [ - "${0, \\frac{14}{\\sqrt{5}}, 6.3}$" - ], - "Output Program": [ - "import math\n\nfst = set(((14/(math.sqrt(5))), 0, 6.3, -5, -(7/(math.sqrt(2))),))\nsnd = set((3, -5, -(14/(math.sqrt(3))), -(7/(math.sqrt(2))), (2/(math.sqrt(5))), 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 7, -\\frac{31}{\\pi }, -\\frac{18}{\\sqrt{5}}, -6 \\sqrt{2}, -\\frac{19}{4}, 10, \\frac{43}{7}, 7, -7, 2, -10, -8, 6, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 7, -(31/math.pi), -(18/(math.sqrt(5))), -6*math.sqrt(2), -(19/4), 10, (43/7), 7, -7, 2, -10, -8, 6, 4*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.5 x^2+4. x+0.$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.7]\n", - "Output Answer": [ - "$-14.45$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.7)\nprint(E(-2.5*x**2+4.*x+0.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-13, -5, -7, -1}$.\n", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, -5, -7, -1\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, -10, -3, -5, 12}$.\n", - "Output Answer": [ - "$\\frac{677}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -10, -3, -5, 12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{12}{\\sqrt{\\pi }}, -\\frac{9}{\\sqrt{\\pi }}, -\\frac{2}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, -\\frac{15}{\\sqrt{\\pi }}, -\\frac{18}{\\sqrt{\\pi }}, 0, -\\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{27}{8 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (12/(math.sqrt(math.pi))), -(9/(math.sqrt(math.pi))), -(2/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), -(15/(math.sqrt(math.pi))), -(18/(math.sqrt(math.pi))), 0, -(4/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.319,0.046,0.097,0.064,0.066,0.224\\}$ and $\\{0.128,0.007,0.199,0.179,0.098,0.127\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.319, 0.046, 0.097, 0.064, 0.066, 0.224\ndistribution2 = 0.128, 0.007, 0.199, 0.179, 0.098, 0.127\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-3.93 < -0.6 x-4.9 < 1.61$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5].", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(P((-3.93 < -0.6*x-4.9) & (-0.6*x-4.9 < 1.61)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, -11}$.\n", - "Output Answer": [ - "$\\frac{9}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -11\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2, 5, 7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${2, 5, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 5, 7*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 e, 3 e, e, -e, e, 3 e, 3 e, 2 e, 3 e, 3 e, 3 e, e, 3 e, -e, -3 e, e, 3 e, -3 e, -e, e, 2 e, 3 e, -3 e, e, -3 e, -e, -e, -3 e, -e, -3 e}$.\n", - "Output Answer": [ - "$\\{3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.e, 3*math.e, math.e, -math.e, math.e, 3*math.e, 3*math.e, 2*math.e, 3*math.e, 3*math.e, 3*math.e, math.e, 3*math.e, -math.e, -3*math.e, math.e, 3*math.e, -3*math.e, -math.e, math.e, 2*math.e, 3*math.e, -3*math.e, math.e, -3*math.e, -math.e, -math.e, -3*math.e, -math.e, -3*math.e\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2, 9, -7, -9, -2, -\\frac{32}{5}, 5}$.\n", - "Output Answer": [ - "${-9, -7, -\\frac{32}{5}, -2, 2, 5, 9}$" - ], - "Output Program": [ - "values = 2, 9, -7, -9, -2, -(32/5), 5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, \\frac{1}{4}, -4 \\sqrt{2}, \\pi, -2 e, 3 \\sqrt{5}, 1, -4, 0, 8, -\\frac{13}{\\sqrt{2}}, 9}$.\n", - "Output Answer": [ - "$9+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, (1/4), -4*math.sqrt(2), math.pi, -2*math.e, 3*math.sqrt(5), 1, -4, 0, 8, -(13/(math.sqrt(2))), 9\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 8, 7, 4, 15, -11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{374}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 8, 7, 4, 15, -11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{2}, -2, -7, -3 \\sqrt{3}, 0} \\setminus {8, -2, 0, 2 \\sqrt{3}, -3}$.\n", - "Output Answer": [ - "${-7, -3 \\sqrt{3}, 2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(2), -2, -7, -3*math.sqrt(3), 0,))\nsnd = set((8, -2, 0, 2*math.sqrt(3), -3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5, -11 \\log (2)}$.", - "Output Answer": [ - "$\\frac{1}{2} (5-11 \\log (2))$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, -11*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{17}{2}, -2 \\sqrt{5}, \\frac{27}{4}, \\frac{19}{e}, 3, -3, 2 e, -\\frac{66}{7}, 10}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(17/2), -2*math.sqrt(5), (27/4), (19/math.e), 3, -3, 2*math.e, -(66/7), 10\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{11}{\\sqrt{3}}, 3 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$-\\frac{\\sqrt{3}}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (11/(math.sqrt(3))), 3*math.sqrt(3), -(10/(math.sqrt(3))), -(16/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.09,0.14,0.041,0.035,0.072,0.185,0.058,0.188\\}$ and $\\{0.112,0.035,0.161,0.058,0.282,0.068,0.055,0.043\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.09, 0.14, 0.041, 0.035, 0.072, 0.185, 0.058, 0.188\ndistribution2 = 0.112, 0.035, 0.161, 0.058, 0.282, 0.068, 0.055, 0.043\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3. x-3.8$ where $x \\sim $ \\text{NormalDistribution}[-1.9,2.9]\n", - "Output Answer": [ - "$1.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.9, 2.9)\nprint(E(-3.*x-3.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 2, 9, 343}$.\n", - "Output Answer": [ - "$9 \\sqrt[4]{2} \\sqrt{3} 7^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 2, 9, 343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 8, 18, 1}$.\n", - "Output Answer": [ - "$\\frac{2016}{631}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 8, 18, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{37}{2}, 7}$.\n", - "Output Answer": [ - "$\\frac{10101}{922}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (37/2), 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2 \\pi, -10, 9, -7, -\\frac{17}{5}, \\frac{11}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-10, -7, -\\frac{17}{5}, \\frac{11}{\\sqrt{\\pi }}, 2 \\pi, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.pi, -10, 9, -7, -(17/5), (11/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -3, -\\frac{5}{2}, \\frac{30}{\\pi }, 4 \\sqrt{3}, -9, 7} \\setminus {-8, -9, 7}$.\n", - "Output Answer": [ - "${-3, -\\frac{5}{2}, -1, 4 \\sqrt{3}, \\frac{30}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -3, -(5/2), (30/math.pi), 4*math.sqrt(3), -9, 7,))\nsnd = set((-8, -9, 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -7, 3, -9, -3, 10, 1}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -7, 3, -9, -3, 10, 1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5, -\\sqrt{5}, 9, -10, 5 \\sqrt{3}, -7} \\cup {-5, -\\frac{19}{7}, -3 \\sqrt{5}, 5 \\sqrt{3}, 3, -\\frac{29}{\\pi }, -7}$.\n", - "Output Answer": [ - "${-10, -\\frac{29}{\\pi }, -7, -3 \\sqrt{5}, -5, -\\frac{19}{7}, -\\sqrt{5}, 3, 5 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -math.sqrt(5), 9, -10, 5*math.sqrt(3), -7,))\nsnd = set((-5, -(19/7), -3*math.sqrt(5), 5*math.sqrt(3), 3, -(29/math.pi), -7,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{19}{e}, -\\frac{24}{e}, 9, -3 \\sqrt{3}, \\frac{19}{\\pi }} \\cup {-\\frac{19}{e}, \\frac{19}{\\pi }, 4, -\\frac{3}{e}, 9, 0}$.\n", - "Output Answer": [ - "${-\\frac{24}{e}, -\\frac{19}{e}, -3 \\sqrt{3}, -\\frac{3}{e}, 0, 4, \\frac{19}{\\pi }, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(19/math.e), -(24/math.e), 9, -3*math.sqrt(3), (19/math.pi),))\nsnd = set((-(19/math.e), (19/math.pi), 4, -(3/math.e), 9, 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -2, 0}$.\n", - "Output Answer": [ - "$-\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -2, 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{16}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -5 \\sqrt{3}, -3 \\sqrt{3}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(\\frac{28}{\\sqrt{3}}-10 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (16/(math.sqrt(3))), (4/(math.sqrt(3))), (8/(math.sqrt(3))), -5*math.sqrt(3), -3*math.sqrt(3), -2*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.5 x+1.2$ where $x \\sim $ \\text{BetaDistribution}[0.1,0.3]\n", - "Output Answer": [ - "$2.32$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.1, 0.3)\nprint(E(4.5*x+1.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.093,0.15,0.002,0.202,0.166,0.05,0.129\\}$ and $\\{0.305,0.074,0.236,0.073,0.118,0.093,0.013\\}$.", - "Output Answer": [ - "$0.79$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.093, 0.15, 0.002, 0.202, 0.166, 0.05, 0.129\ndistribution2 = 0.305, 0.074, 0.236, 0.073, 0.118, 0.093, 0.013\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{2}, 6 \\log (2), 8, 5, -7, 3, 0, -3, 8 \\log (2), 10} \\setminus {4, -2, 3, 7}$.\n", - "Output Answer": [ - "${-7, -3, 0, 6 \\log (2), 5, 8 \\log (2), 5 \\sqrt{2}, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(2), 6*math.log(2), 8, 5, -7, 3, 0, -3, 8*math.log(2), 10,))\nsnd = set((4, -2, 3, 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, -15, 9}$.\n", - "Output Answer": [ - "$\\frac{628}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -15, 9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -\\frac{3}{5}, -6, 6, \\frac{2}{7}, 9} \\setminus {-\\frac{15}{2}, -6, \\frac{2}{7}, \\frac{21}{4}, -10}$.\n", - "Output Answer": [ - "${-1, -\\frac{3}{5}, 6, 9}$" - ], - "Output Program": [ - "fst = set((-1, -(3/5), -6, 6, (2/7), 9,))\nsnd = set((-(15/2), -6, (2/7), (21/4), -10,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${1, -12 \\log (2), -8, 7, 8.4, 3 \\sqrt{5}} \\setminus {-8, -11 \\log (2), 7, 8.4, 5, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-12 \\log (2), 1}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -12*math.log(2), -8, 7, 8.4, 3*math.sqrt(5),))\nsnd = set((-8, -11*math.log(2), 7, 8.4, 5, 3*math.sqrt(5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.2 x^2-1.2 x-4.1$ where $x \\sim $ \\text{PoissonDistribution}[3.7]\n", - "Output Answer": [ - "$64.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.7)\nprint(E(4.2*x**2-1.2*x-4.1))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\log (2), \\frac{40}{7}, -\\frac{11}{3}, -e, \\frac{29}{5}} \\cup {\\frac{40}{7}, -e, -3 \\log (2), \\frac{23}{3}, \\frac{29}{5}, -\\frac{10}{3}}$.\n", - "Output Answer": [ - "${-\\frac{11}{3}, -\\frac{10}{3}, -e, -3 \\log (2), \\frac{40}{7}, \\frac{29}{5}, \\frac{23}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.log(2), (40/7), -(11/3), -math.e, (29/5),))\nsnd = set(((40/7), -math.e, -3*math.log(2), (23/3), (29/5), -(10/3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5, -7 \\sqrt{2}, 2, 8, 1} \\setminus {-4, \\frac{17}{2}, 2, -9, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5, 1, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, -7*math.sqrt(2), 2, 8, 1,))\nsnd = set((-4, (17/2), 2, -9, -7*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.9 x-0.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$-2.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(-2.9*x-0.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{9}{\\sqrt{5}}, \\frac{19}{\\sqrt{5}}, -\\frac{2}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{26}{3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (9/(math.sqrt(5))), (19/(math.sqrt(5))), -(2/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, -\\frac{11}{2}, \\frac{8}{\\sqrt{3}}, -2 \\pi, -3, -5} \\setminus {-5, -2 \\pi, 3 \\sqrt{5}, -5 \\sqrt{2}, 0, 3, -\\frac{4}{\\sqrt{3}}, -4}$.\n", - "Output Answer": [ - "${-\\frac{11}{2}, -3, \\frac{8}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -(11/2), (8/(math.sqrt(3))), -2*math.pi, -3, -5,))\nsnd = set((-5, -2*math.pi, 3*math.sqrt(5), -5*math.sqrt(2), 0, 3, -(4/(math.sqrt(3))), -4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x-1.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$-1.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(-1.1*x-1.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 16, 7}$.\n", - "Output Answer": [ - "$\\frac{1008}{181}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 16, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 3 \\sqrt{5}, -2, 1, 4, -5} \\cup {8, 4, -5, 1, -9, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-9, -5, -2, 1, 4, 3 \\sqrt{5}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 3*math.sqrt(5), -2, 1, 4, -5,))\nsnd = set((8, 4, -5, 1, -9, 3*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, -4 \\log (2), -6 \\sqrt{3}} \\cup {-4 \\log (2), -6 \\sqrt{3}, -2}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -4 \\log (2), -2, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -4*math.log(2), -6*math.sqrt(3),))\nsnd = set((-4*math.log(2), -6*math.sqrt(3), -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.132,0.082,0.056,0.134,0.055,0.371\\}$ and $\\{0.151,0.131,0.023,0.006,0.152,0.491\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.132, 0.082, 0.056, 0.134, 0.055, 0.371\ndistribution2 = 0.151, 0.131, 0.023, 0.006, 0.152, 0.491\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{20}{\\pi }, \\sqrt{2}, 4 \\sqrt{2}, -8.48, -\\frac{1}{7}, 0}$.\n", - "Output Answer": [ - "${-8.48, -\\frac{20}{\\pi }, -\\frac{1}{7}, 0, \\sqrt{2}, 4 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(20/math.pi), math.sqrt(2), 4*math.sqrt(2), -8.48, -(1/7), 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\sqrt{5}, \\frac{9}{\\sqrt{2}}, -\\frac{2}{\\pi }, 5, 0, -3, 9, -8, -\\frac{27}{e}} \\cup {-7 \\sqrt{2}, 0, -7, 1, -\\frac{27}{e}, -8, -\\frac{31}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{27}{e}, -7 \\sqrt{2}, -\\frac{31}{\\pi }, -8, -7, -3, -\\frac{2}{\\pi }, 0, 1, 2 \\sqrt{5}, 5, \\frac{9}{\\sqrt{2}}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(5), (9/(math.sqrt(2))), -(2/math.pi), 5, 0, -3, 9, -8, -(27/math.e),))\nsnd = set((-7*math.sqrt(2), 0, -7, 1, -(27/math.e), -8, -(31/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.187,0.027,0.112,0.035,0.157,0.06,0.06,0.053,0.274\\}$ and $\\{0.164,0.069,0.149,0.136,0.128,0.048,0.05,0.112,0.091\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.187, 0.027, 0.112, 0.035, 0.157, 0.06, 0.06, 0.053, 0.274\ndistribution2 = 0.164, 0.069, 0.149, 0.136, 0.128, 0.048, 0.05, 0.112, 0.091\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 19, 16}$.\n", - "Output Answer": [ - "$\\frac{3952}{253}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 19, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x^3-3. x^2-0.6 x+1.2$ where $x \\sim $ \\text{NormalDistribution}[-1.2,2.5]\n", - "Output Answer": [ - "$-50.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.2, 2.5)\nprint(E(1.2*x**3-3.*x**2-0.6*x+1.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.7 x-4.9$ where $x \\sim $ \\text{PoissonDistribution}[3.6]\n", - "Output Answer": [ - "$-11.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.6)\nprint(E(-1.7*x-4.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\pi, \\pi, -\\pi, \\pi, -2 \\pi, \\pi, 0}$.\n", - "Output Answer": [ - "$-\\frac{\\pi }{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.pi, math.pi, -math.pi, math.pi, -2*math.pi, math.pi, 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${13, 3, 7}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{19}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 13, 3, 7\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -9, -2}$.\n", - "Output Answer": [ - "$\\sqrt[3]{2} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -9, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $1.7 x+2.9 < 1.5 x^2-1.2 x-0.8$ where $x \\sim $ \\text{NormalDistribution}[-1.9,2.5].", - "Output Answer": [ - "$0.69$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.9, 2.5)\nprint(P((1.7*x+2.9 < 1.5*x**2-1.2*x-0.8)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, 6, 0, \\frac{16}{7}, -1, -6, 3, -3 \\sqrt{5}, \\pi, -7}$.", - "Output Answer": [ - "$\\frac{8}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 6, 0, (16/7), -1, -6, 3, -3*math.sqrt(5), math.pi, -7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.068,0.194,0.109,0.039,0.118,0.146,0.047,0.029,0.029,0.135\\}$ and $\\{0.033,0.06,0.127,0.108,0.135,0.021,0.012,0.221,0.032,0.234\\}$.", - "Output Answer": [ - "$0.53$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.068, 0.194, 0.109, 0.039, 0.118, 0.146, 0.047, 0.029, 0.029, 0.135\ndistribution2 = 0.033, 0.06, 0.127, 0.108, 0.135, 0.021, 0.012, 0.221, 0.032, 0.234\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, 7, 6}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{73}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, 7, 6\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, 1, 10, -9, -10, 1, 1, -9, -3, -6, -9, 10, 1, 1, -9, -6, -3, 1, -9, -6, -9, 1, -6, -9, -9, 10}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, 1, 10, -9, -10, 1, 1, -9, -3, -6, -9, 10, 1, 1, -9, -6, -3, 1, -9, -6, -9, 1, -6, -9, -9, 10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x-1.5$ where $x \\sim $ \\text{NormalDistribution}[-1.3,2.8]\n", - "Output Answer": [ - "$-5.01$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.3, 2.8)\nprint(E(2.7*x-1.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{19}{3}, \\frac{14}{3}, \\frac{14}{3}, -\\frac{22}{3}, 3, \\frac{19}{3}, -\\frac{22}{3}, 3, -\\frac{11}{3}, -\\frac{22}{3}, -\\frac{11}{3}, -\\frac{11}{3}, \\frac{10}{3}, \\frac{19}{3}, \\frac{10}{3}, \\frac{10}{3}, 3, -\\frac{22}{3}, \\frac{10}{3}, -\\frac{11}{3}, -\\frac{22}{3}, \\frac{19}{3}, 3, \\frac{14}{3}, \\frac{14}{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{22}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (19/3), (14/3), (14/3), -(22/3), 3, (19/3), -(22/3), 3, -(11/3), -(22/3), -(11/3), -(11/3), (10/3), (19/3), (10/3), (10/3), 3, -(22/3), (10/3), -(11/3), -(22/3), (19/3), 3, (14/3), (14/3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.156,0.032,0.027,0.087,0.17,0.139,0.195,0.033,0.101\\}$ and $\\{0.087,0.134,0.12,0.077,0.138,0.154,0.075,0.056,0.036,0.098\\}$.", - "Output Answer": [ - "$0.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.156, 0.032, 0.027, 0.087, 0.17, 0.139, 0.195, 0.033, 0.101\ndistribution2 = 0.087, 0.134, 0.12, 0.077, 0.138, 0.154, 0.075, 0.056, 0.036, 0.098\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{19}{e}, \\frac{26}{e}, \\frac{19}{e}, \\frac{9}{e}, -\\frac{16}{e}, \\frac{26}{e}, \\frac{1}{e}}$.\n", - "Output Answer": [ - "$\\frac{12}{e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (19/math.e), (26/math.e), (19/math.e), (9/math.e), -(16/math.e), (26/math.e), (1/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{6}{\\pi }, \\frac{6}{\\pi }, -\\frac{25}{\\pi }, \\frac{21}{\\pi }, \\frac{3}{\\pi }, -\\frac{16}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{17}{6 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(6/math.pi), (6/math.pi), -(25/math.pi), (21/math.pi), (3/math.pi), -(16/math.pi)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0., \\frac{17}{e}, -9, -\\frac{19}{2}, -4 \\log (2)} \\setminus {\\frac{17}{e}, -8, -\\frac{19}{2}}$.\n", - "Output Answer": [ - "${-9, -4 \\log (2), 0.}$" - ], - "Output Program": [ - "import math\n\nfst = set((0., (17/math.e), -9, -(19/2), -4*math.log(2),))\nsnd = set(((17/math.e), -8, -(19/2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, -3, -9, -6, -\\frac{17}{\\sqrt{\\pi }}, 6.64, -7, \\pi}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{\\pi }}, -9, -7, -6, -3, \\pi, 5, 6.64}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -3, -9, -6, -(17/(math.sqrt(math.pi))), 6.64, -7, math.pi\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, -6, 3, -1, -2, 6}$.\n", - "Output Answer": [ - "$\\frac{268}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -6, 3, -1, -2, 6\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${e, 3 e, 0, e, e, 3 e, 3 e, 3 e, 3 e, 3 e, 0, 2 e, 2 e, 0, 2 e, e, 0, 2 e, 2 e, 3 e, 2 e, 2 e, 2 e, 0, 2 e}$.\n", - "Output Answer": [ - "$\\{2 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.e, 3*math.e, 0, math.e, math.e, 3*math.e, 3*math.e, 3*math.e, 3*math.e, 3*math.e, 0, 2*math.e, 2*math.e, 0, 2*math.e, math.e, 0, 2*math.e, 2*math.e, 3*math.e, 2*math.e, 2*math.e, 2*math.e, 0, 2*math.e\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.08,0.023,0.081,0.084,0.033,0.182,0.118,0.08,0.115,0.104\\}$ and $\\{0.191,0.069,0.091,0.094,0.192,0.071,0.078,0.049,0.115,0.018\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.08, 0.023, 0.081, 0.084, 0.033, 0.182, 0.118, 0.08, 0.115, 0.104\ndistribution2 = 0.191, 0.069, 0.091, 0.094, 0.192, 0.071, 0.078, 0.049, 0.115, 0.018\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{5}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, -\\frac{5}{\\sqrt{2}}, 0, -5 \\sqrt{2}, -2 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (5/(math.sqrt(2))), -(9/(math.sqrt(2))), -(5/(math.sqrt(2))), 0, -5*math.sqrt(2), -2*math.sqrt(2), (3/(math.sqrt(2))), -6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${6, \\frac{26}{5}, \\frac{16}{\\sqrt{\\pi }}, \\frac{7}{\\sqrt{2}}} \\setminus {0, -\\frac{41}{5}, -6, -3}$.\n", - "Output Answer": [ - "${\\frac{7}{\\sqrt{2}}, \\frac{26}{5}, 6, \\frac{16}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, (26/5), (16/(math.sqrt(math.pi))), (7/(math.sqrt(2))),))\nsnd = set((0, -(41/5), -6, -3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\sqrt{2}, 6, -4 \\sqrt{5}}$.", - "Output Answer": [ - "$\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = math.sqrt(2), 6, -4*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.079,0.135,0.04,0.144,0.107,0.157,0.027,0.114,0.067\\}$ and $\\{0.09,0.139,0.106,0.136,0.123,0.032,0.045,0.163,0.069\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.079, 0.135, 0.04, 0.144, 0.107, 0.157, 0.027, 0.114, 0.067\ndistribution2 = 0.09, 0.139, 0.106, 0.136, 0.123, 0.032, 0.045, 0.163, 0.069\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, 7, -\\pi, -2.9, 0, -1, 5} \\setminus {\\frac{22}{\\sqrt{5}}, -8, -2.9, \\frac{20}{3}, 7}$.\n", - "Output Answer": [ - "${-\\pi, -1, 0, 5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 7, -math.pi, -2.9, 0, -1, 5,))\nsnd = set(((22/(math.sqrt(5))), -8, -2.9, (20/3), 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8, 6 \\sqrt{2}, \\frac{21}{\\pi }, -3 \\sqrt{5}, 6}$.\n", - "Output Answer": [ - "${-8, -3 \\sqrt{5}, 6, \\frac{21}{\\pi }, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 6*math.sqrt(2), (21/math.pi), -3*math.sqrt(5), 6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\sqrt{3}, 8, -5, -\\frac{4}{e}, -2 e, 6, 3 \\sqrt{2}, 3}$.\n", - "Output Answer": [ - "${-2 e, -5, -\\sqrt{3}, -\\frac{4}{e}, 3, 3 \\sqrt{2}, 6, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(3), 8, -5, -(4/math.e), -2*math.e, 6, 3*math.sqrt(2), 3\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{5}, 8, -4, 6, -9 \\log (2), -4, -4, \\frac{9}{\\pi }}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(5), 8, -4, 6, -9*math.log(2), -4, -4, (9/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.107,0.109,0.029,0.122,0.055,0.067,0.104,0.056,0.146,0.096\\}$ and $\\{0.141,0.045,0.163,0.054,0.119,0.061,0.075,0.036,0.056,0.17\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.107, 0.109, 0.029, 0.122, 0.055, 0.067, 0.104, 0.056, 0.146, 0.096\ndistribution2 = 0.141, 0.045, 0.163, 0.054, 0.119, 0.061, 0.075, 0.036, 0.056, 0.17\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x-2.6$ where $x \\sim $ \\text{BetaDistribution}[0.4,0.4]\n", - "Output Answer": [ - "$-1.65$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.4, 0.4)\nprint(E(1.9*x-2.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-4.2, 8, -5, 10, -\\frac{30}{7}, \\frac{14}{\\pi }, -1} \\setminus {-7, -6, -5, -\\frac{30}{7}}$.\n", - "Output Answer": [ - "${-4.2, -1, \\frac{14}{\\pi }, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4.2, 8, -5, 10, -(30/7), (14/math.pi), -1,))\nsnd = set((-7, -6, -5, -(30/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-243, 8, 27, 125, -59049}$.\n", - "Output Answer": [ - "$27\\ 30^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -243, 8, 27, 125, -59049\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-5 \\sqrt{2}, -\\sqrt{2}, 2 \\sqrt{2}, \\sqrt{2}, 0, -4 \\sqrt{2}, -3 \\sqrt{2}, 6 \\sqrt{2}, 5 \\sqrt{2}} \\cap {-6 \\sqrt{2}, 2 \\sqrt{2}, 6 \\sqrt{2}, 0, -3 \\sqrt{2}, 4 \\sqrt{2}, -\\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, -\\sqrt{2}, 0, 2 \\sqrt{2}, 5 \\sqrt{2}, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(2), -math.sqrt(2), 2*math.sqrt(2), math.sqrt(2), 0, -4*math.sqrt(2), -3*math.sqrt(2), 6*math.sqrt(2), 5*math.sqrt(2),))\nsnd = set((-6*math.sqrt(2), 2*math.sqrt(2), 6*math.sqrt(2), 0, -3*math.sqrt(2), 4*math.sqrt(2), -math.sqrt(2), 5*math.sqrt(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, -5, -2 \\sqrt{2}, -10, 4 \\sqrt{5}} \\setminus {-3, 4 \\sqrt{5}, -5}$.\n", - "Output Answer": [ - "${-10, -2 \\sqrt{2}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -5, -2*math.sqrt(2), -10, 4*math.sqrt(5),))\nsnd = set((-3, 4*math.sqrt(5), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.176,0.058,0.049,0.19,0.126,0.24\\}$ and $\\{0.118,0.207,0.089,0.151,0.155,0.164\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.176, 0.058, 0.049, 0.19, 0.126, 0.24\ndistribution2 = 0.118, 0.207, 0.089, 0.151, 0.155, 0.164\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{25}{\\pi }, -10, \\frac{34}{5}, -8, -7, \\sqrt{5}, -3}$.", - "Output Answer": [ - "$-7$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(25/math.pi), -10, (34/5), -8, -7, math.sqrt(5), -3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, \\frac{3}{\\sqrt{2}}, -3, -2 \\pi, -7, -\\frac{2}{7}}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, -3, -\\frac{2}{7}, 0, \\frac{3}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, (3/(math.sqrt(2))), -3, -2*math.pi, -7, -(2/7)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, e, 3 e, 2, 10, 2, -9, -4, 9, -3, -9, -\\sqrt{5}, -\\frac{11}{\\sqrt{3}}, 2}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = -9, math.e, 3*math.e, 2, 10, 2, -9, -4, 9, -3, -9, -math.sqrt(5), -(11/(math.sqrt(3))), 2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, -8, 125, 625}$.\n", - "Output Answer": [ - "$(5+5 i) \\sqrt[4]{2} 5^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -8, 125, 625\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-3, -5 \\sqrt{2}, 7, -13 \\log (2)}$.\n", - "Output Answer": [ - "${-13 \\log (2), -5 \\sqrt{2}, -3, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -5*math.sqrt(2), 7, -13*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{33}{7}, -3, 6.933, -9}$.\n", - "Output Answer": [ - "${-9, -\\frac{33}{7}, -3, 6.933}$" - ], - "Output Program": [ - "values = -(33/7), -3, 6.933, -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{17}{2}, -5}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, -5}$" - ], - "Output Program": [ - "values = -(17/2), -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, 81, 16807, 1, 16}$.\n", - "Output Answer": [ - "$42 \\sqrt[5]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 81, 16807, 1, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.059,0.087,0.188,0.028,0.108,0.252,0.082,0.082,0.017\\}$ and $\\{0.122,0.093,0.019,0.029,0.145,0.227,0.123,0.045,0.147\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.059, 0.087, 0.188, 0.028, 0.108, 0.252, 0.082, 0.082, 0.017\ndistribution2 = 0.122, 0.093, 0.019, 0.029, 0.145, 0.227, 0.123, 0.045, 0.147\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-5 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, -2, 9, e, -\\frac{18}{7}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -\\frac{18}{7}, -2, -\\frac{1}{\\sqrt{2}}, e, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.sqrt(2), -(1/(math.sqrt(2))), -2, 9, math.e, -(18/7)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 8, 9, 5, \\frac{9}{\\sqrt{\\pi }}} \\setminus {8, -6, \\frac{9}{\\sqrt{\\pi }}, 6 \\sqrt{2}, -4, \\frac{28}{\\pi }}$.\n", - "Output Answer": [ - "${5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 8, 9, 5, (9/(math.sqrt(math.pi))),))\nsnd = set((8, -6, (9/(math.sqrt(math.pi))), 6*math.sqrt(2), -4, (28/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -3 \\pi, -\\pi, 0, 0, 2 \\pi, 0, -\\pi, 0, 2 \\pi, 0, -3 \\pi, -\\pi, 2 \\pi, 2 \\pi, -3 \\pi, 0, -\\pi, 2 \\pi, 0, -3 \\pi, 2 \\pi, -\\pi, 0, -3 \\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, -3*math.pi, -math.pi, 0, 0, 2*math.pi, 0, -math.pi, 0, 2*math.pi, 0, -3*math.pi, -math.pi, 2*math.pi, 2*math.pi, -3*math.pi, 0, -math.pi, 2*math.pi, 0, -3*math.pi, 2*math.pi, -math.pi, 0, -3*math.pi, 2*math.pi\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{2}, -7 \\sqrt{2}, -2 \\sqrt{2}, -5 \\sqrt{2}, -3 \\sqrt{2}, -5 \\sqrt{2}, -2 \\sqrt{2}, -7 \\sqrt{2}, -\\sqrt{2}, -3 \\sqrt{2}, -6 \\sqrt{2}, -2 \\sqrt{2}, -\\sqrt{2}, -5 \\sqrt{2}, 5 \\sqrt{2}, -3 \\sqrt{2}, 5 \\sqrt{2}, -6 \\sqrt{2}, -5 \\sqrt{2}, -2 \\sqrt{2}, -6 \\sqrt{2}, -2 \\sqrt{2}, -5 \\sqrt{2}, -6 \\sqrt{2}, -7 \\sqrt{2}, -6 \\sqrt{2}, -5 \\sqrt{2}, -6 \\sqrt{2}, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-5 \\sqrt{2},-6 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(2), -7*math.sqrt(2), -2*math.sqrt(2), -5*math.sqrt(2), -3*math.sqrt(2), -5*math.sqrt(2), -2*math.sqrt(2), -7*math.sqrt(2), -math.sqrt(2), -3*math.sqrt(2), -6*math.sqrt(2), -2*math.sqrt(2), -math.sqrt(2), -5*math.sqrt(2), 5*math.sqrt(2), -3*math.sqrt(2), 5*math.sqrt(2), -6*math.sqrt(2), -5*math.sqrt(2), -2*math.sqrt(2), -6*math.sqrt(2), -2*math.sqrt(2), -5*math.sqrt(2), -6*math.sqrt(2), -7*math.sqrt(2), -6*math.sqrt(2), -5*math.sqrt(2), -6*math.sqrt(2), 5*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 10, 7, 10, 1, -7}$.\n", - "Output Answer": [ - "$\\frac{25}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 10, 7, 10, 1, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${10, -7, -4, 2, -3, 0, -7}$.\n", - "Output Answer": [ - "$-\\frac{9}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 10, -7, -4, 2, -3, 0, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{14}{5}, -2, \\frac{14}{5}, -2, -2, \\frac{14}{5}, -\\frac{14}{5}, \\frac{14}{5}, -2, -8, \\frac{14}{5}, \\frac{14}{5}, -\\frac{14}{5}, -2, \\frac{14}{5}, -8, -\\frac{14}{5}, -8, \\frac{14}{5}, \\frac{14}{5}, -2}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{14}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(14/5), -2, (14/5), -2, -2, (14/5), -(14/5), (14/5), -2, -8, (14/5), (14/5), -(14/5), -2, (14/5), -8, -(14/5), -8, (14/5), (14/5), -2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.2 x-1.3$ where $x \\sim $ \\text{PoissonDistribution}[1.7]\n", - "Output Answer": [ - "$-1.64$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.7)\nprint(E(-0.2*x-1.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-2, 15, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{457}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 15, -9\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.4 x-4.5$ where $x \\sim $ \\text{NormalDistribution}[-0.9,2.1]\n", - "Output Answer": [ - "$-2.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.9, 2.1)\nprint(E(-2.4*x-4.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, \\frac{20}{e}}$.\n", - "Output Answer": [ - "$\\frac{20}{e}-6$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (20/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\sqrt{5}, 0, 2 e, -4, 2 e, \\frac{17}{2}, -3, 4 \\sqrt{5}, 0, \\frac{5}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{5}{2 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.sqrt(5), 0, 2*math.e, -4, 2*math.e, (17/2), -3, 4*math.sqrt(5), 0, (5/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x-1.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$1.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(3.1*x-1.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 3 \\sqrt{5}, \\frac{7}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{17}{\\sqrt{5}}, -\\frac{17}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, 0, 0, -\\frac{12}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}, 0, \\frac{7}{\\sqrt{5}}, -\\frac{17}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, \\frac{8}{\\sqrt{5}}, -\\frac{9}{\\sqrt{5}}, -\\frac{21}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{9}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{9}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 3*math.sqrt(5), (7/(math.sqrt(5))), -(9/(math.sqrt(5))), -(17/(math.sqrt(5))), -(17/(math.sqrt(5))), -(9/(math.sqrt(5))), -(21/(math.sqrt(5))), -(9/(math.sqrt(5))), 0, 0, -(12/(math.sqrt(5))), -(21/(math.sqrt(5))), 0, (7/(math.sqrt(5))), -(17/(math.sqrt(5))), -(9/(math.sqrt(5))), (8/(math.sqrt(5))), -(9/(math.sqrt(5))), -(21/(math.sqrt(5))), 3*math.sqrt(5), -(9/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.03,0.042,0.152,0.067,0.181,0.111,0.096,0.143,0.053\\}$ and $\\{0.128,0.087,0.108,0.195,0.044,0.051,0.117,0.108,0.122\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.03, 0.042, 0.152, 0.067, 0.181, 0.111, 0.096, 0.143, 0.053\ndistribution2 = 0.128, 0.087, 0.108, 0.195, 0.044, 0.051, 0.117, 0.108, 0.122\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{2}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, 3 \\sqrt{3}, \\frac{17}{\\sqrt{3}}, -5 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, \\frac{17}{\\sqrt{3}}, -5 \\sqrt{3}, -5 \\sqrt{3}, \\frac{17}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, -\\frac{2}{\\sqrt{3}}, -5 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, -5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, \\frac{17}{\\sqrt{3}}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-5 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(2/(math.sqrt(3))), (17/(math.sqrt(3))), -(17/(math.sqrt(3))), (4/(math.sqrt(3))), -(2/(math.sqrt(3))), -(2/(math.sqrt(3))), 3*math.sqrt(3), (17/(math.sqrt(3))), -5*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), (17/(math.sqrt(3))), -5*math.sqrt(3), -5*math.sqrt(3), (17/(math.sqrt(3))), (11/(math.sqrt(3))), -(2/(math.sqrt(3))), -5*math.sqrt(3), (4/(math.sqrt(3))), -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), (17/(math.sqrt(3))), -5*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{18}{5}, \\frac{23}{e}, 10, 4, \\frac{12}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{68}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(18/5), (23/math.e), 10, 4, (12/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 7776, 81, 64, 6561}$.\n", - "Output Answer": [ - "$216\\ 3^{2/5} 5^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 7776, 81, 64, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8, 2, 7, 5 \\sqrt{2}, -\\pi}$.\n", - "Output Answer": [ - "${-8, -\\pi, 2, 7, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 2, 7, 5*math.sqrt(2), -math.pi\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-1.12 < 2.6 x^2+4.7 x-0.8 < 2.72$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7].", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(P((-1.12 < 2.6*x**2+4.7*x-0.8) & (2.6*x**2+4.7*x-0.8 < 2.72)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 7, -5, 8, 8, -5, 8}$.\n", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 7, -5, 8, 8, -5, 8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.3 x-3.$ where $x \\sim $ \\text{ExponentialDistribution}[0.3]\n", - "Output Answer": [ - "$4.67$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.3)\nprint(E(2.3*x-3.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 49, 8}$.\n", - "Output Answer": [ - "$2\\ 21^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 49, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\pi, 9, 4 \\sqrt{3}}$.", - "Output Answer": [ - "$4 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.pi, 9, 4*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 15, 3, 11}$.\n", - "Output Answer": [ - "$\\frac{1870}{257}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 15, 3, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4 \\sqrt{3}, -2 \\sqrt{3}, -4 \\sqrt{3}, -\\sqrt{3}, -6 \\sqrt{3}, 6 \\sqrt{3}, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{4 \\sqrt{3}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 4*math.sqrt(3), -2*math.sqrt(3), -4*math.sqrt(3), -math.sqrt(3), -6*math.sqrt(3), 6*math.sqrt(3), -math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.5 x+4.$ where $x \\sim $ \\text{BetaDistribution}[1.8,0.4]\n", - "Output Answer": [ - "$6.86$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.8, 0.4)\nprint(E(3.5*x+4.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{2}{\\sqrt{3}}, 0}$.\n", - "Output Answer": [ - "${-\\frac{2}{\\sqrt{3}}, 0}$" - ], - "Output Program": [ - "import math\n\nvalues = -(2/(math.sqrt(3))), 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x^3+3.9 x^2-0.7 x+5.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.6]\n", - "Output Answer": [ - "$1.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.6)\nprint(E(-4.1*x**3+3.9*x**2-0.7*x+5.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -8, -5, 4 \\sqrt{3}, 7, -\\frac{11}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -8, -5, 4*math.sqrt(3), 7, -(11/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${15, -9, 13, 5, -7}$.\n", - "Output Answer": [ - "$\\frac{614}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -9, 13, 5, -7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.129,0.106,0.024,0.201,0.061,0.14,0.018,0.018,0.119,0.141\\}$ and $\\{0.047,0.142,0.029,0.044,0.112,0.11,0.113,0.024,0.13,0.077\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.129, 0.106, 0.024, 0.201, 0.061, 0.14, 0.018, 0.018, 0.119, 0.141\ndistribution2 = 0.047, 0.142, 0.029, 0.044, 0.112, 0.11, 0.113, 0.024, 0.13, 0.077\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x^3+2.2 x^2+3.1 x+0.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$9.42$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(2.7*x**3+2.2*x**2+3.1*x+0.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${243, -7776, 100000, 1000000, 4, -216}$.\n", - "Output Answer": [ - "$360 \\sqrt{2} \\sqrt[6]{3} 5^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 243, -7776, 100000, 1000000, 4, -216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -1, 9, 8, 9, 10, 0}$.\n", - "Output Answer": [ - "$\\frac{41}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -1, 9, 8, 9, 10, 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, -3, e, 2 \\sqrt{2}, -8, 6 \\sqrt{2}, -\\pi, -\\frac{37}{4}, -\\frac{48}{5}, 1, -5}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -3, math.e, 2*math.sqrt(2), -8, 6*math.sqrt(2), -math.pi, -(37/4), -(48/5), 1, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 1296, 8, 8}$.\n", - "Output Answer": [ - "$36 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 1296, 8, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5 \\sqrt{3}, \\sqrt{5}, -1, 4, 7, -4, -10, -2 \\pi} \\setminus {-6, 4, -\\frac{16}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-10, -5 \\sqrt{3}, -2 \\pi, -4, -1, \\sqrt{5}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(3), math.sqrt(5), -1, 4, 7, -4, -10, -2*math.pi,))\nsnd = set((-6, 4, -(16/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, \\frac{31}{2}, 9}$.\n", - "Output Answer": [ - "$\\frac{3348}{475}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, (31/2), 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.172,0.156,0.073,0.159,0.133\\}$ and $\\{0.048,0.136,0.008,0.461,0.029\\}$.", - "Output Answer": [ - "$0.61$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.172, 0.156, 0.073, 0.159, 0.133\ndistribution2 = 0.048, 0.136, 0.008, 0.461, 0.029\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, -11, 4}$.\n", - "Output Answer": [ - "$5 \\sqrt{\\frac{7}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -11, 4\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\pi, -\\pi, -2 \\pi, 2 \\pi, -2 \\pi, \\pi, 2 \\pi, -2 \\pi, -2 \\pi, 2 \\pi, -2 \\pi, \\pi, 2 \\pi, \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, 2 \\pi, 3 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, 2 \\pi, -2 \\pi, 2 \\pi, -\\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$\\{-2 \\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.pi, -math.pi, -2*math.pi, 2*math.pi, -2*math.pi, math.pi, 2*math.pi, -2*math.pi, -2*math.pi, 2*math.pi, -2*math.pi, math.pi, 2*math.pi, math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, 2*math.pi, 3*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, 2*math.pi, -2*math.pi, 2*math.pi, -math.pi, -2*math.pi\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, -\\frac{25}{4}, 3 \\pi, -\\frac{15}{2}, -9, 1}$.", - "Output Answer": [ - "$-\\frac{21}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -(25/4), 3*math.pi, -(15/2), -9, 1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x^3-4.4 x^2-3.1 x+3.9$ where $x \\sim $ \\text{BetaDistribution}[2.,1.4]\n", - "Output Answer": [ - "$0.94$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 2., 1.4)\nprint(E(2.1*x**3-4.4*x**2-3.1*x+3.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{9}{2}, -4, 10 \\log (2), 5, \\pi, 5, \\frac{1}{\\sqrt{3}}, -1, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$4+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/2), -4, 10*math.log(2), 5, math.pi, 5, (1/(math.sqrt(3))), -1, 4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-2, 8, -15, -9, -10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{793}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 8, -15, -9, -10\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4, -5 \\sqrt{2}, 0, \\frac{16}{\\sqrt{\\pi }}, 2 \\sqrt{3}, -\\pi, \\frac{16}{3}, -\\frac{3}{4}}$.", - "Output Answer": [ - "$\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -5*math.sqrt(2), 0, (16/(math.sqrt(math.pi))), 2*math.sqrt(3), -math.pi, (16/3), -(3/4)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 9, 1, \\frac{22}{\\pi }, -\\frac{15}{4}, -\\frac{22}{e}, -\\frac{14}{\\sqrt{5}}, -\\frac{11}{\\sqrt{\\pi }}, 5, -1, 5, \\frac{23}{3}, -7, -1}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 9, 1, (22/math.pi), -(15/4), -(22/math.e), -(14/(math.sqrt(5))), -(11/(math.sqrt(math.pi))), 5, -1, 5, (23/3), -7, -1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, -\\frac{3}{\\pi }, 7, 10, \\pi, 0} \\setminus {-3, 2, 7, 0, 3, \\pi, 10, -\\frac{6}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{3}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -(3/math.pi), 7, 10, math.pi, 0,))\nsnd = set((-3, 2, 7, 0, 3, math.pi, 10, -(6/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 8, -9}$.\n", - "Output Answer": [ - "$109$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 8, -9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 2 \\sqrt{3}, -3, 2, -5 \\sqrt{2}, 9.582} \\setminus {2 \\sqrt{3}, 2, -3, -5 \\sqrt{2}, -3 e, -10, -1.417}$.\n", - "Output Answer": [ - "${-8, 9.582}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, 2*math.sqrt(3), -3, 2, -5*math.sqrt(2), 9.582,))\nsnd = set((2*math.sqrt(3), 2, -3, -5*math.sqrt(2), -3*math.e, -10, -1.417,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.125,0.173,0.14,0.093,0.082,0.078,0.12,0.072,0.052\\}$ and $\\{0.062,0.043,0.233,0.036,0.211,0.016,0.109,0.128,0.049\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.125, 0.173, 0.14, 0.093, 0.082, 0.078, 0.12, 0.072, 0.052\ndistribution2 = 0.062, 0.043, 0.233, 0.036, 0.211, 0.016, 0.109, 0.128, 0.049\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{2}, 2, 10, \\frac{29}{2}}$.\n", - "Output Answer": [ - "$\\frac{13340}{2521}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/2), 2, 10, (29/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${729, 16, 1, 7}$.\n", - "Output Answer": [ - "$6 \\sqrt{3} \\sqrt[4]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 729, 16, 1, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 2, 4, 9}$.\n", - "Output Answer": [ - "$(1+i) \\sqrt[4]{2} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 2, 4, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{9}{2}, 6, -\\frac{3}{\\pi }, -\\frac{13}{\\sqrt{5}}, \\frac{12}{5}, 9, -2 \\sqrt{3}, -10, 5, 0, 2, -6, -2, 7}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (9/2), 6, -(3/math.pi), -(13/(math.sqrt(5))), (12/5), 9, -2*math.sqrt(3), -10, 5, 0, 2, -6, -2, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8.591, -\\frac{19}{3}, -5, -4.93, -1, -2, \\sqrt{5}, -\\frac{2}{7}} \\cup {8.801, -5, 8.42, -1, \\frac{32}{7}, 6, -\\frac{19}{3}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{19}{3}, -5, -4.93, -2, -1, -\\frac{2}{7}, \\sqrt{5}, 2 \\sqrt{5}, \\frac{32}{7}, 6, 8.42, 8.591, 8.801}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.591, -(19/3), -5, -4.93, -1, -2, math.sqrt(5), -(2/7),))\nsnd = set((8.801, -5, 8.42, -1, (32/7), 6, -(19/3), 2*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.7 x^2-4.4 x+3.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.9]\n", - "Output Answer": [ - "$-12.79$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.9)\nprint(E(-4.7*x**2-4.4*x+3.7))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2.9, -\\frac{3}{\\pi }, \\frac{10}{\\sqrt{\\pi }}, 9, -\\frac{4}{\\sqrt{3}}, 3, 0, \\frac{42}{5}, \\frac{16}{3}} \\setminus {9, -\\frac{13}{\\pi }, -\\frac{4}{\\sqrt{3}}, -\\frac{49}{5}, -2.9}$.\n", - "Output Answer": [ - "${-\\frac{3}{\\pi }, 0, 3, \\frac{16}{3}, \\frac{10}{\\sqrt{\\pi }}, \\frac{42}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2.9, -(3/math.pi), (10/(math.sqrt(math.pi))), 9, -(4/(math.sqrt(3))), 3, 0, (42/5), (16/3),))\nsnd = set((9, -(13/math.pi), -(4/(math.sqrt(3))), -(49/5), -2.9,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7 \\sqrt{2}, -2, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7*math.sqrt(2), -2, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -9, 4, 10, -9, 4, 4, 1, -9, -9, 1, -9, -9, 10, 1, -9, 3, 3, 3, 1}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -9, 4, 10, -9, 4, 4, 1, -9, -9, 1, -9, -9, 10, 1, -9, 3, 3, 3, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\sqrt{3}, -5 \\sqrt{3}, 3 \\sqrt{3}, -2 \\sqrt{3}, 4 \\sqrt{3}, -6 \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{4}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.sqrt(3), -5*math.sqrt(3), 3*math.sqrt(3), -2*math.sqrt(3), 4*math.sqrt(3), -6*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.354,0.225,0.186\\}$ and $\\{0.181,0.551,0.116\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.354, 0.225, 0.186\ndistribution2 = 0.181, 0.551, 0.116\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{2}, 4 \\sqrt{2}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{2 \\sqrt{2}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(2), 4*math.sqrt(2), -6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${1, 4, 8, 0, -10, \\frac{12}{5}, -10, \\frac{54}{7}, 0, \\frac{2}{\\sqrt{3}}, 2, -5 \\sqrt{3}, \\frac{2}{\\pi }, 2 \\pi}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(1+\\frac{2}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 4, 8, 0, -10, (12/5), -10, (54/7), 0, (2/(math.sqrt(3))), 2, -5*math.sqrt(3), (2/math.pi), 2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, -9}$.\n", - "Output Answer": [ - "$\\frac{19}{\\sqrt{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -9\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, -64, -1}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{-7}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -64, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${15, -1, 8, -14, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1753}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 15, -1, 8, -14, -15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x^2-3. x-3.5$ where $x \\sim $ \\text{PoissonDistribution}[1.8]\n", - "Output Answer": [ - "$4.71$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.8)\nprint(E(2.7*x**2-3.*x-3.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.211,0.121,0.124,0.19,0.113\\}$ and $\\{0.213,0.136,0.289,0.103,0.135\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.211, 0.121, 0.124, 0.19, 0.113\ndistribution2 = 0.213, 0.136, 0.289, 0.103, 0.135\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, 13, -4}$.\n", - "Output Answer": [ - "$\\frac{373}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 13, -4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 2, -8, -8}$.\n", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 2, -8, -8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\pi, -8, -3, 0, -3, 0}$.\n", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.pi, -8, -3, 0, -3, 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, -12, 5, -13, -13}$.\n", - "Output Answer": [ - "$\\frac{301}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -12, 5, -13, -13\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -1, 8, 4, -\\frac{33}{4}, -\\frac{9}{\\sqrt{2}}} \\cup {12 \\log (2), -\\frac{19}{e}, -\\frac{9}{\\sqrt{2}}, 9, 4, \\frac{39}{4}, -1, 8}$.\n", - "Output Answer": [ - "${-\\frac{33}{4}, -7, -\\frac{19}{e}, -\\frac{9}{\\sqrt{2}}, -1, 4, 8, 12 \\log (2), 9, \\frac{39}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -1, 8, 4, -(33/4), -(9/(math.sqrt(2))),))\nsnd = set((12*math.log(2), -(19/math.e), -(9/(math.sqrt(2))), 9, 4, (39/4), -1, 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-8, 10, 0}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{61}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 10, 0\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -2}$.\n", - "Output Answer": [ - "$4 i \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.055,0.161,0.098,0.079,0.107,0.094,0.197,0.065\\}$ and $\\{0.066,0.068,0.219,0.148,0.119,0.193,0.054,0.065\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.055, 0.161, 0.098, 0.079, 0.107, 0.094, 0.197, 0.065\ndistribution2 = 0.066, 0.068, 0.219, 0.148, 0.119, 0.193, 0.054, 0.065\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-10, -4, -2, 7, -9}$.\n", - "Output Answer": [ - "${-10, -9, -4, -2, 7}$" - ], - "Output Program": [ - "values = -10, -4, -2, 7, -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\pi, 6, 1, 6, 2 \\sqrt{5}, -\\frac{2}{\\sqrt{\\pi }}, -8, 0}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.pi, 6, 1, 6, 2*math.sqrt(5), -(2/(math.sqrt(math.pi))), -8, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -10, -1, 2, -10, 3}$.\n", - "Output Answer": [ - "$\\frac{508}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -10, -1, 2, -10, 3\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, 0, -2, 0}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "values = -9, 0, -2, 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, 0, -4, -3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{142}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 0, -4, -3\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.3 x^3-0.9 x^2+3.8 x-3.2$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$2.78$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(4.3*x**3-0.9*x**2+3.8*x-3.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 81, 243, 81, 36}$.\n", - "Output Answer": [ - "$27\\ 2^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 81, 243, 81, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.247,0.289,0.296\\}$ and $\\{0.024,0.123,0.231\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.247, 0.289, 0.296\ndistribution2 = 0.024, 0.123, 0.231\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 5 \\sqrt{3}, -8.8, \\frac{1}{3}, 6, \\frac{16}{5}, \\frac{15}{2}, 0} \\cup {\\sqrt{3}, -8.8, -1, 6, -3, \\frac{1}{3}, -8}$.\n", - "Output Answer": [ - "${-8.8, -8, -3, -1, 0, \\frac{1}{3}, \\sqrt{3}, \\frac{16}{5}, 6, \\frac{15}{2}, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 5*math.sqrt(3), -8.8, (1/3), 6, (16/5), (15/2), 0,))\nsnd = set((math.sqrt(3), -8.8, -1, 6, -3, (1/3), -8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.7 x^2+1.3 x-4.2$ where $x \\sim $ \\text{PoissonDistribution}[2.6]\n", - "Output Answer": [ - "$-16.73$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.6)\nprint(E(-1.7*x**2+1.3*x-4.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, -8, -9, -\\frac{5}{2}, -3 \\sqrt{5}}$.", - "Output Answer": [ - "$-3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, -8, -9, -(5/2), -3*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5.6, -5, 8.1, -2 e} \\setminus {-8, 6, 7, -8.1, 8.1, -6}$.\n", - "Output Answer": [ - "${-5.6, -2 e, -5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.6, -5, 8.1, -2*math.e,))\nsnd = set((-8, 6, 7, -8.1, 8.1, -6,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${3, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "${3, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 4*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.001,0.196,0.109,0.346,0.093,0.061\\}$ and $\\{0.104,0.16,0.152,0.198,0.265,0.022\\}$.", - "Output Answer": [ - "$0.31$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.001, 0.196, 0.109, 0.346, 0.093, 0.061\ndistribution2 = 0.104, 0.16, 0.152, 0.198, 0.265, 0.022\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 0, -5, -6, -3, -10, 2, \\frac{29}{3}, -4 \\sqrt{2}}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, 0, -5, -6, -3, -10, 2, (29/3), -4*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -7, 5, 6, 5, 3, 6, 8, -7, 5, 5, -7, 8, -7, 5, 6, 8, -7, 5, 5, 2, 3, 8, 8}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -7, 5, 6, 5, 3, 6, 8, -7, 5, 5, -7, 8, -7, 5, 6, 8, -7, 5, 5, 2, 3, 8, 8\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{13}{\\sqrt{5}}, \\frac{16}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{29}{2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (13/(math.sqrt(5))), (16/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 3, 4, 4, 4, 5, 3, -9, 4, 4, 3, 4, 4, 4, 4, 3, -9, 5, 7, 7, 4, 3, 4, 4, 4, 4, 3, 4, 7, 9}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 3, 4, 4, 4, 5, 3, -9, 4, 4, 3, 4, 4, 4, 4, 3, -9, 5, 7, 7, 4, 3, 4, 4, 4, 4, 3, 4, 7, 9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{11}{\\sqrt{\\pi }}, -\\frac{6}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{6}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, \\frac{16}{\\sqrt{\\pi }}, -\\frac{6}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, \\frac{18}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{6}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{11}{\\sqrt{\\pi }},-\\frac{12}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(11/(math.sqrt(math.pi))), -(6/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(6/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), (16/(math.sqrt(math.pi))), -(6/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), (18/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(6/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -10, -4, e, \\frac{31}{4}, 10 \\log (2), \\frac{13}{\\sqrt{2}}, 0, \\frac{25}{3}, 0}$.\n", - "Output Answer": [ - "$10+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -10, -4, math.e, (31/4), 10*math.log(2), (13/(math.sqrt(2))), 0, (25/3), 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{\\sqrt{\\pi }}, 9, \\frac{30}{7}, -9, -6, -\\frac{10}{\\pi }, -2, 1}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (13/(math.sqrt(math.pi))), 9, (30/7), -9, -6, -(10/math.pi), -2, 1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${7 \\log (2), -5}$.\n", - "Output Answer": [ - "${-5, 7 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 7*math.log(2), -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, -9, -5, -9, -\\frac{1}{4}, -6, -9, -5}$.\n", - "Output Answer": [ - "${-9, -9, -9, -6, -5, -5, -\\frac{1}{4}, 5}$" - ], - "Output Program": [ - "values = 5, -9, -5, -9, -(1/4), -6, -9, -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{6}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, \\frac{13}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(6/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), (13/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, -8, -3, -7, 1, 8, -2, -1} \\cap {0, -9, 8, -7, -1, -3, 2, 5, -5}$.\n", - "Output Answer": [ - "${-9, -7, -3, -1, 8}$" - ], - "Output Program": [ - "fst = set((-9, -8, -3, -7, 1, 8, -2, -1,))\nsnd = set((0, -9, 8, -7, -1, -3, 2, 5, -5,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{14}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{20}{\\pi }, 10} \\setminus {-\\frac{13}{\\sqrt{\\pi }}, -8, -9, -2, -\\frac{2}{5}}$.\n", - "Output Answer": [ - "${-\\frac{14}{\\sqrt{\\pi }}, -\\frac{20}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(14/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(20/math.pi), 10,))\nsnd = set((-(13/(math.sqrt(math.pi))), -8, -9, -2, -(2/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${0, 12, 5, 6}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{97}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 12, 5, 6\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.8 x^2+0.3 x+5.$ where $x \\sim $ \\text{NormalDistribution}[-1.9,1.9]\n", - "Output Answer": [ - "$17.43$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.9, 1.9)\nprint(E(1.8*x**2+0.3*x+5.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 7, 10, 13}$.\n", - "Output Answer": [ - "$\\frac{69160}{6439}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 7, 10, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{16}{3}, \\frac{16}{3}, -\\frac{16}{3}, -\\frac{16}{3}, -\\frac{16}{3}, -2, -2, -\\frac{16}{3}, -4, -\\frac{22}{3}, -\\frac{22}{3}, -\\frac{22}{3}, -2, -2, -4, \\frac{16}{3}, -2, -2, -\\frac{16}{3}, -\\frac{22}{3}, -\\frac{16}{3}, -\\frac{22}{3}, -\\frac{16}{3}, -\\frac{16}{3}, -\\frac{22}{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{16}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (16/3), (16/3), -(16/3), -(16/3), -(16/3), -2, -2, -(16/3), -4, -(22/3), -(22/3), -(22/3), -2, -2, -4, (16/3), -2, -2, -(16/3), -(22/3), -(16/3), -(22/3), -(16/3), -(16/3), -(22/3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.1 x-3.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$-14.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(-2.1*x-3.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-1, \\frac{9}{2}, \\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "${-1, \\frac{9}{2}, \\frac{22}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, (9/2), (22/math.pi)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${9, -5, -1, -8, 5, -9 \\log (2)} \\cup {1, -8, 5, -9 \\log (2), -1}$.\n", - "Output Answer": [ - "${-8, -9 \\log (2), -5, -1, 1, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -5, -1, -8, 5, -9*math.log(2),))\nsnd = set((1, -8, 5, -9*math.log(2), -1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 13}$.\n", - "Output Answer": [ - "$\\frac{52}{15}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.086,0.051,0.05,0.107,0.121,0.082,0.099,0.059,0.046,0.06\\}$ and $\\{0.083,0.038,0.11,0.106,0.028,0.223,0.061,0.075,0.039,0.06\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.086, 0.051, 0.05, 0.107, 0.121, 0.082, 0.099, 0.059, 0.046, 0.06\ndistribution2 = 0.083, 0.038, 0.11, 0.106, 0.028, 0.223, 0.061, 0.075, 0.039, 0.06\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{29}{7}, -\\frac{9}{7}, -\\frac{10}{7}, 2, -\\frac{48}{7}, 7, 3}$.\n", - "Output Answer": [ - "$-\\frac{12}{49}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(29/7), -(9/7), -(10/7), 2, -(48/7), 7, 3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-16807, 256, 7776, 4096, -2}$.\n", - "Output Answer": [ - "$672 \\sqrt[5]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -16807, 256, 7776, 4096, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 15, 9, 1}$.\n", - "Output Answer": [ - "$\\frac{720}{257}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 15, 9, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, 4, 2 \\pi, -9} \\setminus {7, -8.2, 2 \\pi, -7, 5.85, \\frac{1}{4}}$.\n", - "Output Answer": [ - "${-9, 2, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 4, 2*math.pi, -9,))\nsnd = set((7, -8.2, 2*math.pi, -7, 5.85, (1/4),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-10, 9, -5, -5, -7}$.\n", - "Output Answer": [ - "${-10, -7, -5, -5, 9}$" - ], - "Output Program": [ - "values = -10, 9, -5, -5, -7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5.5, 0, 6, 7, -\\frac{9}{\\sqrt{2}}, -\\frac{11}{\\sqrt{2}}} \\setminus {3, -\\frac{11}{\\sqrt{2}}, 6, 4 \\sqrt{5}, 0}$.\n", - "Output Answer": [ - "${-\\frac{9}{\\sqrt{2}}, 5.5, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.5, 0, 6, 7, -(9/(math.sqrt(2))), -(11/(math.sqrt(2))),))\nsnd = set((3, -(11/(math.sqrt(2))), 6, 4*math.sqrt(5), 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, 7, -1, 9, 10, -6}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 7, -1, 9, 10, -6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, 6 \\log (2), 5, -7, 10, 0}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 6*math.log(2), 5, -7, 10, 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${9, -\\frac{31}{\\pi }, \\frac{9}{\\sqrt{\\pi }}} \\setminus {-\\frac{5}{2}, -\\frac{31}{\\pi }, -e, 9, \\frac{5}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${\\frac{9}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -(31/math.pi), (9/(math.sqrt(math.pi))),))\nsnd = set((-(5/2), -(31/math.pi), -math.e, 9, (5/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-9, -2, -4, -10, 6}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{206}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -2, -4, -10, 6\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.1,0.395,0.129,0.232\\}$ and $\\{0.463,0.106,0.004,0.408\\}$.", - "Output Answer": [ - "$0.93$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.1, 0.395, 0.129, 0.232\ndistribution2 = 0.463, 0.106, 0.004, 0.408\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.044,0.289,0.264,0.288\\}$ and $\\{0.151,0.167,0.148,0.167\\}$.", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.044, 0.289, 0.264, 0.288\ndistribution2 = 0.151, 0.167, 0.148, 0.167\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, 3, -4, 6, 5, 1, 10}$.\n", - "Output Answer": [ - "$\\frac{19}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, 3, -4, 6, 5, 1, 10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{\\sqrt{\\pi }}, \\frac{5}{\\sqrt{3}}, 8, -3, 1, 2 \\pi, 8, -2, 0, -\\sqrt{3}, -6, 3, 9, -8, -1}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(math.pi))), (5/(math.sqrt(3))), 8, -3, 1, 2*math.pi, 8, -2, 0, -math.sqrt(3), -6, 3, 9, -8, -1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{17}{\\sqrt{\\pi }}, 7}$.\n", - "Output Answer": [ - "${7, \\frac{17}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (17/(math.sqrt(math.pi))), 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.075,0.116,0.083,0.086,0.19,0.158,0.054,0.027,0.035,0.111\\}$ and $\\{0.148,0.003,0.042,0.054,0.057,0.342,0.087,0.136,0.046,0.011\\}$.", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.075, 0.116, 0.083, 0.086, 0.19, 0.158, 0.054, 0.027, 0.035, 0.111\ndistribution2 = 0.148, 0.003, 0.042, 0.054, 0.057, 0.342, 0.087, 0.136, 0.046, 0.011\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 16, 19, 17}$.\n", - "Output Answer": [ - "$\\frac{20672}{2191}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 16, 19, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-729, 16, -1}$.\n", - "Output Answer": [ - "$18 \\sqrt[3]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -729, 16, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${e, -5 \\sqrt{2}, -7.522, 7, 8, 7 \\log (2), 2, -\\frac{11}{\\pi }} \\cup {2, -4.3, \\frac{9}{\\sqrt{2}}, -5, e, 9, -7.522, 7 \\log (2)}$.\n", - "Output Answer": [ - "${-7.522, -5 \\sqrt{2}, -5, -4.3, -\\frac{11}{\\pi }, 2, e, 7 \\log (2), \\frac{9}{\\sqrt{2}}, 7, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.e, -5*math.sqrt(2), -7.522, 7, 8, 7*math.log(2), 2, -(11/math.pi),))\nsnd = set((2, -4.3, (9/(math.sqrt(2))), -5, math.e, 9, -7.522, 7*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{\\sqrt{3}}, -\\frac{9}{\\sqrt{2}}, 2, -\\frac{19}{\\sqrt{5}}, -2, 14 \\log (2), -2, -4, 9, 6, -7}$.\n", - "Output Answer": [ - "$\\frac{19}{\\sqrt{5}}+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(3))), -(9/(math.sqrt(2))), 2, -(19/(math.sqrt(5))), -2, 14*math.log(2), -2, -4, 9, 6, -7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, 13, 11, 9, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{71}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 13, 11, 9, 8\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, \\frac{37}{2}, 9, \\frac{31}{2}}$.\n", - "Output Answer": [ - "$\\frac{196137}{13843}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, (37/2), 9, (31/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-2, 1, 64}$.\n", - "Output Answer": [ - "$4 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 1, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, -6, -1, 7, -\\frac{11}{\\sqrt{5}}, 3 \\sqrt{3}, -\\frac{8}{\\sqrt{\\pi }}, -6, -\\frac{7}{2}, \\frac{16}{\\pi }, \\frac{8}{3}, 7 \\sqrt{2}, -4}$.\n", - "Output Answer": [ - "$6+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -6, -1, 7, -(11/(math.sqrt(5))), 3*math.sqrt(3), -(8/(math.sqrt(math.pi))), -6, -(7/2), (16/math.pi), (8/3), 7*math.sqrt(2), -4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 5, -9, 6, 2, 5, -1, -5}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 5, -9, 6, 2, 5, -1, -5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4 \\sqrt{5}, -3, \\frac{8}{3}, -4, 5, \\pi, 3} \\cup {-9, -\\frac{5}{3}, 4 \\sqrt{5}, 9, 3, -10, \\pi}$.\n", - "Output Answer": [ - "${-10, -9, -4, -3, -\\frac{5}{3}, \\frac{8}{3}, 3, \\pi, 5, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), -3, (8/3), -4, 5, math.pi, 3,))\nsnd = set((-9, -(5/3), 4*math.sqrt(5), 9, 3, -10, math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{3}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, \\sqrt{2}, \\sqrt{2}, -6 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, -\\frac{13}{\\sqrt{2}}, \\sqrt{2}, -6 \\sqrt{2}, \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, 0, -\\frac{3}{\\sqrt{2}}, \\sqrt{2}, -6 \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, \\sqrt{2}, 0, -\\frac{13}{\\sqrt{2}}, -6 \\sqrt{2}, \\sqrt{2}, -\\frac{13}{\\sqrt{2}}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(3/(math.sqrt(2))), -(3/(math.sqrt(2))), math.sqrt(2), math.sqrt(2), -6*math.sqrt(2), math.sqrt(2), math.sqrt(2), math.sqrt(2), -(3/(math.sqrt(2))), math.sqrt(2), -(3/(math.sqrt(2))), -(13/(math.sqrt(2))), math.sqrt(2), -6*math.sqrt(2), math.sqrt(2), -(3/(math.sqrt(2))), 0, -(3/(math.sqrt(2))), math.sqrt(2), -6*math.sqrt(2), -(13/(math.sqrt(2))), math.sqrt(2), 0, -(13/(math.sqrt(2))), -6*math.sqrt(2), math.sqrt(2), -(13/(math.sqrt(2))), -6*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.083,0.088,0.06,0.058,0.135,0.202,0.037,0.084,0.082,0.064\\}$ and $\\{0.164,0.108,0.051,0.107,0.06,0.016,0.05,0.035,0.133,0.023\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.083, 0.088, 0.06, 0.058, 0.135, 0.202, 0.037, 0.084, 0.082, 0.064\ndistribution2 = 0.164, 0.108, 0.051, 0.107, 0.06, 0.016, 0.05, 0.035, 0.133, 0.023\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\sqrt{5}, -2 \\sqrt{5}, -3 \\sqrt{5}, -2 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, -2 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, 0, -3 \\sqrt{5}, 0, -2 \\sqrt{5}, 0, -3 \\sqrt{5}, -2 \\sqrt{5}, -3 \\sqrt{5}, -3 \\sqrt{5}, 0, 0, 0, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.sqrt(5), -2*math.sqrt(5), -3*math.sqrt(5), -2*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), -2*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), 0, -3*math.sqrt(5), 0, -2*math.sqrt(5), 0, -3*math.sqrt(5), -2*math.sqrt(5), -3*math.sqrt(5), -3*math.sqrt(5), 0, 0, 0, -3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${7, 0.99, 3, 5, -\\pi, -\\frac{4}{5}, -6} \\cup {-\\frac{4}{5}, \\frac{68}{7}, 0.99, -\\pi, 3, -6, 4}$.\n", - "Output Answer": [ - "${-6, -\\pi, -\\frac{4}{5}, 0.99, 3, 4, 5, 7, \\frac{68}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, 0.99, 3, 5, -math.pi, -(4/5), -6,))\nsnd = set((-(4/5), (68/7), 0.99, -math.pi, 3, -6, 4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, \\frac{6}{7}, -\\frac{8}{\\sqrt{3}}, -8}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 9, (6/7), -(8/(math.sqrt(3))), -8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{14}{\\sqrt{5}}, 8}$.\n", - "Output Answer": [ - "${\\frac{14}{\\sqrt{5}}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = (14/(math.sqrt(5))), 8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, \\pi, -4, 4 e, 4 \\sqrt{2}} \\setminus {-3 \\pi, 7, 4 e, -\\frac{3}{\\sqrt{2}}, 4 \\sqrt{2}, -4}$.\n", - "Output Answer": [ - "${0, \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, math.pi, -4, 4*math.e, 4*math.sqrt(2),))\nsnd = set((-3*math.pi, 7, 4*math.e, -(3/(math.sqrt(2))), 4*math.sqrt(2), -4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -7, -12, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{514}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -7, -12, -15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-4, 3 \\sqrt{5}, 7 \\sqrt{2}, -9}$.\n", - "Output Answer": [ - "${-9, -4, 3 \\sqrt{5}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4, 3*math.sqrt(5), 7*math.sqrt(2), -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 18}$.\n", - "Output Answer": [ - "$\\frac{396}{29}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${0, -9, -4, -3, 8, -7, -5} \\cap {-4, 8, 9, 0, 10, 3, -2, 2}$.\n", - "Output Answer": [ - "${-4, 0, 8}$" - ], - "Output Program": [ - "fst = set((0, -9, -4, -3, 8, -7, -5,))\nsnd = set((-4, 8, 9, 0, 10, 3, -2, 2,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{\\sqrt{3}}, 8, -5, 4, -8}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(3))), 8, -5, 4, -8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-7, 9.435, 0, 7, 3 e, -10, -\\frac{22}{5}}$.\n", - "Output Answer": [ - "${-10, -7, -\\frac{22}{5}, 0, 7, 3 e, 9.435}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 9.435, 0, 7, 3*math.e, -10, -(22/5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2.002, -9, -8, -5., -2, 4, 9} \\setminus {-\\frac{11}{\\sqrt{3}}, -4, 4 \\sqrt{3}, -2}$.\n", - "Output Answer": [ - "${-9, -8, -5., -2.002, 4, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2.002, -9, -8, -5., -2, 4, 9,))\nsnd = set((-(11/(math.sqrt(3))), -4, 4*math.sqrt(3), -2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 9, -\\frac{13}{\\pi }, -\\frac{8}{\\sqrt{5}}, -\\frac{23}{\\pi }, 7, -\\frac{17}{2}, -\\frac{8}{\\sqrt{5}}, 0, 6}$.\n", - "Output Answer": [ - "$\\frac{35}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 9, -(13/math.pi), -(8/(math.sqrt(5))), -(23/math.pi), 7, -(17/2), -(8/(math.sqrt(5))), 0, 6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-6 \\sqrt{2}, -6.925, 7, -5, -\\frac{11}{\\sqrt{2}}, -\\frac{20}{e}, 0} \\cup {-6.925, -\\frac{20}{e}, 0, 4 \\sqrt{5}, -6 \\sqrt{2}, \\frac{3}{5}, -5, -\\frac{11}{\\sqrt{2}}, 7}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -\\frac{11}{\\sqrt{2}}, -\\frac{20}{e}, -6.925, -5, 0, \\frac{3}{5}, 7, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6*math.sqrt(2), -6.925, 7, -5, -(11/(math.sqrt(2))), -(20/math.e), 0,))\nsnd = set((-6.925, -(20/math.e), 0, 4*math.sqrt(5), -6*math.sqrt(2), (3/5), -5, -(11/(math.sqrt(2))), 7,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{7}{3}, \\frac{22}{3}, 12, 6}$.\n", - "Output Answer": [ - "$\\frac{1232}{251}$" - ], - "Output Program": [ - "import statistics\nvalues = (7/3), (22/3), 12, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-0.9 < -1.2 x^2+1. x-0.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.5].", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.5)\nprint(P((-0.9 < -1.2*x**2+1.*x-0.7)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.4 x^3-3.2 x^2-4.2 x-1.1$ where $x \\sim $ \\text{NormalDistribution}[1.8,1.2]\n", - "Output Answer": [ - "$22.63$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.8, 1.2)\nprint(E(3.4*x**3-3.2*x**2-4.2*x-1.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, 625, 2, -2}$.\n", - "Output Answer": [ - "$10 \\sqrt[4]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 625, 2, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4, 4}$.\n", - "Output Answer": [ - "${4, 4}$" - ], - "Output Program": [ - "values = 4, 4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, -2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, -2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.093,0.493,0.234,0.038\\}$ and $\\{0.187,0.094,0.376,0.05\\}$.", - "Output Answer": [ - "$0.54$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.093, 0.493, 0.234, 0.038\ndistribution2 = 0.187, 0.094, 0.376, 0.05\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${1, -\\frac{13}{e}, 3 \\pi, \\sqrt{5}, -1, 0, -3 e, 2 \\sqrt{3}, 7, 8, -2 \\pi}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, -(13/math.e), 3*math.pi, math.sqrt(5), -1, 0, -3*math.e, 2*math.sqrt(3), 7, 8, -2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -3, 3, -10, -5 \\sqrt{2}, 10, -\\frac{8}{\\sqrt{\\pi }}, -\\pi, \\frac{9}{\\sqrt{2}}, \\frac{1}{\\sqrt{\\pi }}, 9, 3}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -4, -3, 3, -10, -5*math.sqrt(2), 10, -(8/(math.sqrt(math.pi))), -math.pi, (9/(math.sqrt(2))), (1/(math.sqrt(math.pi))), 9, 3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${6.6, \\frac{15}{\\pi }, -\\frac{20}{e}, -6, 4 \\sqrt{5}} \\cup {\\frac{15}{\\pi }, 4 \\sqrt{5}, -9.5, -\\frac{20}{e}, -6}$.\n", - "Output Answer": [ - "${-9.5, -\\frac{20}{e}, -6, \\frac{15}{\\pi }, 6.6, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6.6, (15/math.pi), -(20/math.e), -6, 4*math.sqrt(5),))\nsnd = set(((15/math.pi), 4*math.sqrt(5), -9.5, -(20/math.e), -6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.143,0.728,0.045\\}$ and $\\{0.07,0.313,0.33\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.143, 0.728, 0.045\ndistribution2 = 0.07, 0.313, 0.33\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 64, 4, 1000000, 16, -32}$.\n", - "Output Answer": [ - "$40 \\sqrt[6]{-1} 2^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 64, 4, 1000000, 16, -32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, 3, 14}$.\n", - "Output Answer": [ - "$91$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 3, 14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${3125, 25, 4096, 5, -16807}$.\n", - "Output Answer": [ - "$140 \\sqrt[5]{-1} 2^{2/5} 5^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 3125, 25, 4096, 5, -16807\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{21}{2}, \\frac{13}{2}, \\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\frac{15561}{1838}$" - ], - "Output Program": [ - "import statistics\nvalues = (21/2), (13/2), (19/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, \\frac{25}{2}, 13}$.\n", - "Output Answer": [ - "$\\frac{975}{376}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, (25/2), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.043,0.058,0.173,0.326,0.171,0.017,0.058,0.037\\}$ and $\\{0.439,0.031,0.194,0.077,0.031,0.011,0.128,0.032\\}$.", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.043, 0.058, 0.173, 0.326, 0.171, 0.017, 0.058, 0.037\ndistribution2 = 0.439, 0.031, 0.194, 0.077, 0.031, 0.011, 0.128, 0.032\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${10, \\frac{1}{\\sqrt{\\pi }}, \\frac{9}{4}, \\frac{6}{e}, \\frac{18}{\\pi }} \\setminus {-\\frac{7}{\\pi }, \\frac{16}{\\sqrt{\\pi }}, \\frac{6}{e}, 4}$.\n", - "Output Answer": [ - "${\\frac{1}{\\sqrt{\\pi }}, \\frac{9}{4}, \\frac{18}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, (1/(math.sqrt(math.pi))), (9/4), (6/math.e), (18/math.pi),))\nsnd = set((-(7/math.pi), (16/(math.sqrt(math.pi))), (6/math.e), 4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3, -5 \\sqrt{2}, -3, -9, -5 \\sqrt{3}, 0, -7} \\cup {0, -5 \\sqrt{3}, 3, -7, -\\frac{33}{7}, -\\frac{18}{7}, -9, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -5 \\sqrt{2}, -7, -\\frac{33}{7}, -3, -\\frac{18}{7}, 0, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -5*math.sqrt(2), -3, -9, -5*math.sqrt(3), 0, -7,))\nsnd = set((0, -5*math.sqrt(3), 3, -7, -(33/7), -(18/7), -9, -5*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, 7, \\frac{7}{2}, 9, -2 \\sqrt{2}, 0, 3, 11 \\log (2), \\frac{15}{\\sqrt{\\pi }}, 3, 4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$9+2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 7, (7/2), 9, -2*math.sqrt(2), 0, 3, 11*math.log(2), (15/(math.sqrt(math.pi))), 3, 4*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{13}{\\pi }, 5, 8, 4.068, 0, 7, -3 \\pi, -9} \\cup {4.068, -\\frac{13}{\\pi }, 7, -9, \\frac{42}{5}, -\\pi, 0, \\frac{29}{3}}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -\\frac{13}{\\pi }, -\\pi, 0, 4.068, 5, 7, 8, \\frac{42}{5}, \\frac{29}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(13/math.pi), 5, 8, 4.068, 0, 7, -3*math.pi, -9,))\nsnd = set((4.068, -(13/math.pi), 7, -9, (42/5), -math.pi, 0, (29/3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5, -5, -\\frac{14}{\\pi }, 9, -9} \\setminus {5, 1, 1.2, \\frac{25}{\\pi }, 7}$.\n", - "Output Answer": [ - "${-9, -5, -\\frac{14}{\\pi }, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -5, -(14/math.pi), 9, -9,))\nsnd = set((5, 1, 1.2, (25/math.pi), 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{24}{\\pi }, 0, -5, 0}$.\n", - "Output Answer": [ - "$5+\\frac{24}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = (24/math.pi), 0, -5, 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x^2+4.8 x-4.4$ where $x \\sim $ \\text{NormalDistribution}[0.8,2.1]\n", - "Output Answer": [ - "$-18.24$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.8, 2.1)\nprint(E(-3.5*x**2+4.8*x-4.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{2}, \\sqrt{2}, 2 \\sqrt{2}, 5 \\sqrt{2}, 6 \\sqrt{2}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{19}{3 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(2), math.sqrt(2), 2*math.sqrt(2), 5*math.sqrt(2), 6*math.sqrt(2), 6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, \\frac{15}{2}, 13, 18}$.\n", - "Output Answer": [ - "$\\frac{18720}{1829}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, (15/2), 13, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{47}{7}, -\\frac{66}{7}, \\frac{55}{7}, -\\frac{5}{7}, \\frac{29}{7}}$.\n", - "Output Answer": [ - "$\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (47/7), -(66/7), (55/7), -(5/7), (29/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{5}{4}, \\frac{21}{4}, -5, -\\frac{33}{4}, 7, -\\frac{13}{4}}$.\n", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (5/4), (21/4), -5, -(33/4), 7, -(13/4)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.136,0.127,0.35,0.111,0.139\\}$ and $\\{0.205,0.121,0.11,0.253,0.153\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.136, 0.127, 0.35, 0.111, 0.139\ndistribution2 = 0.205, 0.121, 0.11, 0.253, 0.153\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.145,0.112,0.121,0.292,0.089,0.208\\}$ and $\\{0.758,0.003,0.093,0.025,0.078,0.026\\}$.", - "Output Answer": [ - "$1.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.145, 0.112, 0.121, 0.292, 0.089, 0.208\ndistribution2 = 0.758, 0.003, 0.093, 0.025, 0.078, 0.026\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.073,0.354,0.109,0.111,0.135\\}$ and $\\{0.004,0.024,0.806,0.027,0.063\\}$.", - "Output Answer": [ - "$1.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.073, 0.354, 0.109, 0.111, 0.135\ndistribution2 = 0.004, 0.024, 0.806, 0.027, 0.063\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x^2+4.3 x-3.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$-1.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(-1.1*x**2+4.3*x-3.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-7, -\\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-7, -\\frac{4}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -(4/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4, \\frac{18}{\\sqrt{5}}, 10, -2.3, -2, 0, -\\frac{17}{5}}$.\n", - "Output Answer": [ - "${-\\frac{17}{5}, -2.3, -2, 0, 4, \\frac{18}{\\sqrt{5}}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, (18/(math.sqrt(5))), 10, -2.3, -2, 0, -(17/5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9, -7, 3, 8, 6, 2, -8, 1, -6} \\cap {6, 5, 8, 3, -4, -9, -7, 2, 1}$.\n", - "Output Answer": [ - "${-9, -7, 1, 2, 3, 6, 8}$" - ], - "Output Program": [ - "fst = set((-9, -7, 3, 8, 6, 2, -8, 1, -6,))\nsnd = set((6, 5, 8, 3, -4, -9, -7, 2, 1,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, -10, -8, -3 e, -\\frac{37}{5}, -\\frac{13}{2}, -\\frac{15}{e}, -5 \\sqrt{3}, -2 e, -\\frac{32}{5}, \\frac{33}{7}} \\cup {\\frac{17}{e}, -\\frac{31}{5}, 2, -10, -5 \\sqrt{3}, \\frac{33}{7}, 4, -8, 3, -3 e, -2 e}$.\n", - "Output Answer": [ - "${-10, -5 \\sqrt{3}, -3 e, -8, -\\frac{37}{5}, -\\frac{13}{2}, -\\frac{32}{5}, -\\frac{31}{5}, -\\frac{15}{e}, -2 e, 2, 3, 4, \\frac{33}{7}, \\frac{17}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -10, -8, -3*math.e, -(37/5), -(13/2), -(15/math.e), -5*math.sqrt(3), -2*math.e, -(32/5), (33/7),))\nsnd = set(((17/math.e), -(31/5), 2, -10, -5*math.sqrt(3), (33/7), 4, -8, 3, -3*math.e, -2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, -9}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{4}{3}, 2, -\\frac{22}{3}, \\frac{19}{3}, -2, -3, -\\frac{13}{3}, -\\frac{29}{3}}$.\n", - "Output Answer": [ - "$-\\frac{29}{12}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(4/3), 2, -(22/3), (19/3), -2, -3, -(13/3), -(29/3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, 13, 8}$.\n", - "Output Answer": [ - "$\\sqrt{7}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 13, 8\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, -8, -15, -7, 5, 11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{179}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -8, -15, -7, 5, 11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{13}{\\sqrt{2}}, -4, -\\frac{2}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{19}{3}, -\\frac{8}{5}, -2, 8}$.\n", - "Output Answer": [ - "$\\frac{19}{3}+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/(math.sqrt(2))), -4, -(2/(math.sqrt(3))), 2*math.sqrt(3), -(19/3), -(8/5), -2, 8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -7, 6, 9, 6, 3, 4, 4, 5, 5, 5, 0, 6, 3, 5, 5, 9, 3, 3, 3, 9, 3, -7, 9, 4, -7, 0, 6, 5}$.\n", - "Output Answer": [ - "$\\{3,5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -7, 6, 9, 6, 3, 4, 4, 5, 5, 5, 0, 6, 3, 5, 5, 9, 3, 3, 3, 9, 3, -7, 9, 4, -7, 0, 6, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{20}{3}, 2, \\frac{47}{3}}$.\n", - "Output Answer": [ - "$\\frac{2820}{671}$" - ], - "Output Program": [ - "import statistics\nvalues = (20/3), 2, (47/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -\\frac{14}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{5}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 0, -(14/(math.sqrt(math.pi))), -(1/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, -1, 6, 2, \\frac{16}{\\pi }, 4 e, \\frac{19}{2}, 1, -\\frac{18}{\\sqrt{\\pi }}, -1, -7, 2 \\pi, \\pi, -\\frac{11}{4}, \\frac{1}{2}}$.\n", - "Output Answer": [ - "$4 e+\\frac{18}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -1, 6, 2, (16/math.pi), 4*math.e, (19/2), 1, -(18/(math.sqrt(math.pi))), -1, -7, 2*math.pi, math.pi, -(11/4), (1/2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5 \\sqrt{3}, 2 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, 5 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 0, 5 \\sqrt{3}, \\frac{16}{\\sqrt{3}}, 2 \\sqrt{3}, 2 \\sqrt{3}, 0, \\frac{16}{\\sqrt{3}}, 5 \\sqrt{3}, 0, 5 \\sqrt{3}, 0, 2 \\sqrt{3}, \\frac{16}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{5 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 5*math.sqrt(3), 2*math.sqrt(3), (4/(math.sqrt(3))), 5*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 0, 5*math.sqrt(3), (16/(math.sqrt(3))), 2*math.sqrt(3), 2*math.sqrt(3), 0, (16/(math.sqrt(3))), 5*math.sqrt(3), 0, 5*math.sqrt(3), 0, 2*math.sqrt(3), (16/(math.sqrt(3))), 5*math.sqrt(3), (4/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, -64, 16}$.\n", - "Output Answer": [ - "$80 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, -64, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.028,0.146,0.224,0.113,0.376\\}$ and $\\{0.327,0.049,0.198,0.112,0.027\\}$.", - "Output Answer": [ - "$1.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.028, 0.146, 0.224, 0.113, 0.376\ndistribution2 = 0.327, 0.049, 0.198, 0.112, 0.027\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 8, 6561, 7}$.\n", - "Output Answer": [ - "$18\\ 2^{3/4} \\sqrt[4]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 8, 6561, 7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -\\frac{5}{e}, -2, \\sqrt{5}, -8, -\\frac{2}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-\\frac{5}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -(5/math.e), -2, math.sqrt(5), -8, -(2/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5., -7, 12 \\log (2), 6 \\log (2), 0, -\\frac{29}{3}, 4.4, 4 \\sqrt{3}, -\\sqrt{3}, -0.5, -8} \\cup {-8, -\\sqrt{3}, 4 \\sqrt{3}, 4.4, -7, \\frac{14}{3}, -9.7, 12 \\log (2), -5., -2 \\log (2), 0}$.\n", - "Output Answer": [ - "${-9.7, -\\frac{29}{3}, -8, -7, -5., -\\sqrt{3}, -2 \\log (2), -0.5, 0, 6 \\log (2), 4.4, \\frac{14}{3}, 4 \\sqrt{3}, 12 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5., -7, 12*math.log(2), 6*math.log(2), 0, -(29/3), 4.4, 4*math.sqrt(3), -math.sqrt(3), -0.5, -8,))\nsnd = set((-8, -math.sqrt(3), 4*math.sqrt(3), 4.4, -7, (14/3), -9.7, 12*math.log(2), -5., -2*math.log(2), 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.086,0.443,0.157,0.06,0.202\\}$ and $\\{0.242,0.15,0.001,0.02,0.321\\}$.", - "Output Answer": [ - "$0.96$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.086, 0.443, 0.157, 0.06, 0.202\ndistribution2 = 0.242, 0.15, 0.001, 0.02, 0.321\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 8, 9, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{301}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 8, 9, -9\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 6 \\sqrt{2}, \\frac{11}{\\sqrt{5}}, -\\frac{7}{2}, -\\frac{14}{\\sqrt{3}}, 2 e} \\setminus {6 \\sqrt{2}, 2, 7, -1.5, 2 e}$.\n", - "Output Answer": [ - "${-\\frac{14}{\\sqrt{3}}, -6, -\\frac{7}{2}, \\frac{11}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 6*math.sqrt(2), (11/(math.sqrt(5))), -(7/2), -(14/(math.sqrt(3))), 2*math.e,))\nsnd = set((6*math.sqrt(2), 2, 7, -1.5, 2*math.e,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${7, 0, -2.8, 1, 9, -2, \\frac{27}{5}, -10, -1} \\cup {\\frac{34}{5}, 9, 1, -6, -2.8, -2, -9, 5, -1, 0}$.\n", - "Output Answer": [ - "${-10, -9, -6, -2.8, -2, -1, 0, 1, 5, \\frac{27}{5}, \\frac{34}{5}, 7, 9}$" - ], - "Output Program": [ - "fst = set((7, 0, -2.8, 1, 9, -2, (27/5), -10, -1,))\nsnd = set(((34/5), 9, 1, -6, -2.8, -2, -9, 5, -1, 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-7, 1, -5, \\frac{16}{7}} \\cup {1, \\frac{16}{7}, 6, -5}$.\n", - "Output Answer": [ - "${-7, -5, 1, \\frac{16}{7}, 6}$" - ], - "Output Program": [ - "fst = set((-7, 1, -5, (16/7),))\nsnd = set((1, (16/7), 6, -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, -11, 14, -7}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{382}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -11, 14, -7\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, \\frac{13}{2}}$.", - "Output Answer": [ - "$\\frac{13}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, (13/2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-9, -3, -8, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{3}{2}, 5, -1, -7, -6, -1, 4, 8}$.", - "Output Answer": [ - "$-\\frac{9}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -9, -3, -8, -(7/(math.sqrt(math.pi))), -(3/2), 5, -1, -7, -6, -1, 4, 8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{7}, -3, \\frac{31}{\\pi }, -6} \\setminus {9, -7, -3}$.\n", - "Output Answer": [ - "${-6, \\frac{13}{7}, \\frac{31}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/7), -3, (31/math.pi), -6,))\nsnd = set((9, -7, -3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6 \\log (2), 7 \\log (2), 13 \\log (2), 12 \\log (2), -9 \\log (2), 11 \\log (2), -2 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{26 \\log (2)}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -6*math.log(2), 7*math.log(2), 13*math.log(2), 12*math.log(2), -9*math.log(2), 11*math.log(2), -2*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 0, -\\frac{3}{\\pi }, 7, \\frac{20}{3}, -6, -4 e, -\\frac{10}{e}, 9, -3 \\sqrt{5}, -3 \\sqrt{2}, 2}$.\n", - "Output Answer": [ - "$9+4 e$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 0, -(3/math.pi), 7, (20/3), -6, -4*math.e, -(10/math.e), 9, -3*math.sqrt(5), -3*math.sqrt(2), 2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 11, 10}$.\n", - "Output Answer": [ - "$\\frac{165}{38}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 11, 10\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{5}, 2, -7, \\sqrt{2}, -4 \\sqrt{3}, 6, -6, \\frac{11}{\\sqrt{2}}, 9, 7, 7, 5, 3 \\sqrt{3}, -10}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(5), 2, -7, math.sqrt(2), -4*math.sqrt(3), 6, -6, (11/(math.sqrt(2))), 9, 7, 7, 5, 3*math.sqrt(3), -10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, \\frac{20}{3}, 9, \\frac{35}{3}}$.\n", - "Output Answer": [ - "$\\frac{10080}{1189}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, (20/3), 9, (35/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${10, \\frac{37}{7}, -1, -\\frac{1}{5}, 1.07} \\cup {1.07, -\\frac{11}{5}, -1, \\frac{37}{7}, -7}$.\n", - "Output Answer": [ - "${-7, -\\frac{11}{5}, -1, -\\frac{1}{5}, 1.07, \\frac{37}{7}, 10}$" - ], - "Output Program": [ - "fst = set((10, (37/7), -1, -(1/5), 1.07,))\nsnd = set((1.07, -(11/5), -1, (37/7), -7,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{15}{2}, -\\frac{5}{2}, -\\frac{5}{2}, -\\frac{1}{2}, \\frac{15}{2}, \\frac{15}{2}, -\\frac{5}{2}, -\\frac{1}{2}, -\\frac{5}{2}, \\frac{17}{2}, \\frac{27}{4}, \\frac{17}{2}, \\frac{15}{2}, \\frac{15}{2}, -\\frac{1}{2}, 8, -\\frac{5}{2}, -\\frac{5}{2}, \\frac{27}{4}, -\\frac{1}{2}, \\frac{27}{4}, \\frac{15}{2}, -\\frac{1}{2}, -\\frac{5}{2}, \\frac{17}{2}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{5}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (15/2), -(5/2), -(5/2), -(1/2), (15/2), (15/2), -(5/2), -(1/2), -(5/2), (17/2), (27/4), (17/2), (15/2), (15/2), -(1/2), 8, -(5/2), -(5/2), (27/4), -(1/2), (27/4), (15/2), -(1/2), -(5/2), (17/2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, 3, 14, -1}$.\n", - "Output Answer": [ - "$\\frac{497}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 3, 14, -1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{24}{7}, 3, -1, -\\frac{16}{\\sqrt{5}}, -9, 3 \\sqrt{5}, 10, 8, 1, -\\frac{1}{4}, -8, -\\frac{1}{e}, 8, -\\frac{25}{e}}$.\n", - "Output Answer": [ - "$10+\\frac{25}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -(24/7), 3, -1, -(16/(math.sqrt(5))), -9, 3*math.sqrt(5), 10, 8, 1, -(1/4), -8, -(1/math.e), 8, -(25/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -7776, 1, 64, 100000}$.\n", - "Output Answer": [ - "$120 \\sqrt[5]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -7776, 1, 64, 100000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, -\\frac{37}{4}, -6}$.\n", - "Output Answer": [ - "$\\frac{53}{4}$" - ], - "Output Program": [ - "values = 4, -(37/4), -6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.258,0.35,0.183,0.145\\}$ and $\\{0.201,0.302,0.295,0.152\\}$.", - "Output Answer": [ - "$0.04$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.258, 0.35, 0.183, 0.145\ndistribution2 = 0.201, 0.302, 0.295, 0.152\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5.31, 2 \\sqrt{2}, \\frac{30}{\\pi }, 10, 6} \\setminus {7.31, 8 \\log (2), \\frac{30}{\\pi }, 2 \\sqrt{2}, 6, 6 \\log (2), 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-5.31, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.31, 2*math.sqrt(2), (30/math.pi), 10, 6,))\nsnd = set((7.31, 8*math.log(2), (30/math.pi), 2*math.sqrt(2), 6, 6*math.log(2), 6*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.7 x^3+0.9 x^2-2.5 x-0.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$6.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(2.7*x**3+0.9*x**2-2.5*x-0.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-7, 12, 0, -13, -12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{213}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, 12, 0, -13, -12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{5}{2}, -3, \\frac{18}{e}, -6, \\frac{45}{7}, \\frac{13}{\\sqrt{5}}, \\pi, -2, 0, 0}$.\n", - "Output Answer": [ - "$6+\\frac{18}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/2), -3, (18/math.e), -6, (45/7), (13/(math.sqrt(5))), math.pi, -2, 0, 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 4, \\frac{47}{7}, 2.39} \\setminus {7.14, 4, -6, -2, -7 \\sqrt{2}, 3}$.\n", - "Output Answer": [ - "${2.39, \\frac{47}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 4, (47/7), 2.39,))\nsnd = set((7.14, 4, -6, -2, -7*math.sqrt(2), 3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, 8, 8, 8, -5, -4, 5, -5, 8, 8, -4, -5, -4, -4, -5, 8, -5, -5, 5, -5, 8, -4, 5, -4, -5, -5, 5, -4}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, 8, 8, 8, -5, -4, 5, -5, 8, 8, -4, -5, -4, -4, -5, 8, -5, -5, 5, -5, 8, -4, 5, -4, -5, -5, 5, -4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, 3 \\pi, -\\frac{28}{3}, \\frac{31}{\\pi }, 5, -1.364, 8, 4} \\cup {-4, -\\frac{28}{3}, 6, 2, \\frac{31}{\\pi }, -1.364}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -4, -1.364, 2, 4, 5, 6, 8, 3 \\pi, \\frac{31}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 3*math.pi, -(28/3), (31/math.pi), 5, -1.364, 8, 4,))\nsnd = set((-4, -(28/3), 6, 2, (31/math.pi), -1.364,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5, -9, -2, 0, 4} \\cup {-2, -9, 4, -3 e}$.\n", - "Output Answer": [ - "${-9, -3 e, -2, 0, 4, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -9, -2, 0, 4,))\nsnd = set((-2, -9, 4, -3*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{3}{2}, -\\frac{17}{2}}$.\n", - "Output Answer": [ - "$-\\frac{7}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (3/2), -(17/2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2.47, -6, -\\pi, 2, 9, -\\frac{6}{\\sqrt{\\pi }}} \\setminus {-8, -2.47, -6, 0, \\frac{25}{3}}$.\n", - "Output Answer": [ - "${-\\frac{6}{\\sqrt{\\pi }}, -\\pi, 2, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2.47, -6, -math.pi, 2, 9, -(6/(math.sqrt(math.pi))),))\nsnd = set((-8, -2.47, -6, 0, (25/3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -8, -2, \\frac{13}{\\sqrt{3}}, -3, -5, 3} \\setminus {-\\sqrt{3}, 2 \\sqrt{3}, -5}$.\n", - "Output Answer": [ - "${-8, -3, -2, 0, 3, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -8, -2, (13/(math.sqrt(3))), -3, -5, 3,))\nsnd = set((-math.sqrt(3), 2*math.sqrt(3), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, 3, -2, -7, 3 \\sqrt{3}, 5, 7.1, -\\frac{10}{\\pi }, -\\frac{27}{e}} \\cup {3, 4 \\sqrt{3}, -\\frac{27}{e}, 7.1, -3, 0, -\\frac{10}{\\pi }, -8, -2}$.\n", - "Output Answer": [ - "${-\\frac{27}{e}, -8, -7, -\\frac{10}{\\pi }, -3, -2, 0, 3, 5, 3 \\sqrt{3}, 4 \\sqrt{3}, 7.1}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 3, -2, -7, 3*math.sqrt(3), 5, 7.1, -(10/math.pi), -(27/math.e),))\nsnd = set((3, 4*math.sqrt(3), -(27/math.e), 7.1, -3, 0, -(10/math.pi), -8, -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, -1, 2, -2, -4, -\\frac{18}{e}, \\frac{13}{3}, -\\frac{44}{5}, \\frac{7}{\\sqrt{2}}, -9, \\frac{34}{5}, -6, 6 \\sqrt{3}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, -1, 2, -2, -4, -(18/math.e), (13/3), -(44/5), (7/(math.sqrt(2))), -9, (34/5), -6, 6*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${5, 7, 9, -15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{371}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, 7, 9, -15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -10, -5, 0, 5, 2, -7, 9}$.\n", - "Output Answer": [ - "$-\\frac{9}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -10, -5, 0, 5, 2, -7, 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-5, -11, 8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{283}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -11, 8\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.008,0.031,0.286,0.027,0.044,0.046,0.09,0.235,0.029\\}$ and $\\{0.08,0.035,0.118,0.055,0.044,0.01,0.092,0.06,0.428\\}$.", - "Output Answer": [ - "$0.8$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.008, 0.031, 0.286, 0.027, 0.044, 0.046, 0.09, 0.235, 0.029\ndistribution2 = 0.08, 0.035, 0.118, 0.055, 0.044, 0.01, 0.092, 0.06, 0.428\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8, \\frac{18}{\\pi }, \\frac{28}{3}, -7} \\cup {-7, \\frac{18}{\\pi }, 8}$.\n", - "Output Answer": [ - "${-7, \\frac{18}{\\pi }, 8, \\frac{28}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, (18/math.pi), (28/3), -7,))\nsnd = set((-7, (18/math.pi), 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{25}{e}, 3 \\sqrt{5}, -9, 0, -4, -8, 7, 7, -6}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(25/math.e), 3*math.sqrt(5), -9, 0, -4, -8, 7, 7, -6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4 \\sqrt{5}, 3, 0, \\frac{7}{\\sqrt{5}}, -\\frac{1}{7}} \\setminus {4 \\sqrt{5}, -9, -\\frac{1}{7}, 0, -6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${3, \\frac{7}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), 3, 0, (7/(math.sqrt(5))), -(1/7),))\nsnd = set((4*math.sqrt(5), -9, -(1/7), 0, -6*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-10, -7 \\log (2), 7, 12 \\log (2), \\frac{1}{2}, \\frac{9}{2}, 3, -1, -6} \\cup {-8, 3, -10, -\\frac{7}{4}, -3, 12 \\log (2), 7, -11 \\log (2)}$.\n", - "Output Answer": [ - "${-10, -8, -11 \\log (2), -6, -7 \\log (2), -3, -\\frac{7}{4}, -1, \\frac{1}{2}, 3, \\frac{9}{2}, 7, 12 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, -7*math.log(2), 7, 12*math.log(2), (1/2), (9/2), 3, -1, -6,))\nsnd = set((-8, 3, -10, -(7/4), -3, 12*math.log(2), 7, -11*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^2+0.6 x-2.5$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.5]\n", - "Output Answer": [ - "$-20.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.5)\nprint(E(-3.9*x**2+0.6*x-2.5))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -5, 2.66, -\\frac{7}{\\sqrt{2}}, -7} \\setminus {-\\frac{7}{\\sqrt{2}}, -5 \\sqrt{3}, 2.66, 9, 2, 1, -\\frac{16}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-7, -6, -5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -5, 2.66, -(7/(math.sqrt(2))), -7,))\nsnd = set((-(7/(math.sqrt(2))), -5*math.sqrt(3), 2.66, 9, 2, 1, -(16/(math.sqrt(math.pi))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -13 \\log (2), \\frac{32}{5}, \\frac{9}{2}, -1, -3} \\setminus {-2, -5, -13 \\log (2), 0, -3, -1}$.\n", - "Output Answer": [ - "${\\frac{9}{2}, \\frac{32}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -13*math.log(2), (32/5), (9/2), -1, -3,))\nsnd = set((-2, -5, -13*math.log(2), 0, -3, -1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{6}{\\sqrt{\\pi }}, \\sqrt{2}, 2}$.\n", - "Output Answer": [ - "$2+\\frac{6}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(6/(math.sqrt(math.pi))), math.sqrt(2), 2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 3 \\sqrt{5}, -\\frac{7}{\\sqrt{2}}, 9, \\frac{20}{7}, -2 \\sqrt{2}} \\setminus {-2 \\sqrt{2}, -8, 2 \\sqrt{2}, -7 \\sqrt{2}, -5}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{2}}, \\frac{20}{7}, 3 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 3*math.sqrt(5), -(7/(math.sqrt(2))), 9, (20/7), -2*math.sqrt(2),))\nsnd = set((-2*math.sqrt(2), -8, 2*math.sqrt(2), -7*math.sqrt(2), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{29}{2}, 2, 3}$.\n", - "Output Answer": [ - "$\\frac{522}{157}$" - ], - "Output Program": [ - "import statistics\nvalues = (29/2), 2, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.7 x^3-2.6 x^2+2.3 x-3.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$-6.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(-1.7*x**3-2.6*x**2+2.3*x-3.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${262144, 46656, 9, 16, 25, 1}$.\n", - "Output Answer": [ - "$48\\ 2^{2/3} \\sqrt[3]{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 262144, 46656, 9, 16, 25, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, 6, -9, -6, -8, -8, -8, 2}$.\n", - "Output Answer": [ - "$-\\frac{9}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, 6, -9, -6, -8, -8, -8, 2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{15}{\\pi }, -\\frac{24}{\\pi }, \\frac{21}{\\pi }, -\\frac{24}{\\pi }, \\frac{15}{\\pi }, \\frac{23}{\\pi }, \\frac{15}{\\pi }, \\frac{21}{\\pi }, \\frac{23}{\\pi }, -\\frac{24}{\\pi }, \\frac{21}{\\pi }, -\\frac{24}{\\pi }, \\frac{15}{\\pi }, \\frac{23}{\\pi }, \\frac{15}{\\pi }, \\frac{21}{\\pi }, -\\frac{24}{\\pi }, \\frac{15}{\\pi }, -\\frac{24}{\\pi }, \\frac{21}{\\pi }, \\frac{15}{\\pi }, \\frac{15}{\\pi }, -\\frac{24}{\\pi }, \\frac{21}{\\pi }, \\frac{15}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{15}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (15/math.pi), -(24/math.pi), (21/math.pi), -(24/math.pi), (15/math.pi), (23/math.pi), (15/math.pi), (21/math.pi), (23/math.pi), -(24/math.pi), (21/math.pi), -(24/math.pi), (15/math.pi), (23/math.pi), (15/math.pi), (21/math.pi), -(24/math.pi), (15/math.pi), -(24/math.pi), (21/math.pi), (15/math.pi), (15/math.pi), -(24/math.pi), (21/math.pi), (15/math.pi)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{9}{\\sqrt{2}}, -3 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, -4 \\sqrt{2}, -3 \\sqrt{2}, -4 \\sqrt{2}, -\\frac{9}{\\sqrt{2}}, -3 \\sqrt{2}, 0, -\\frac{3}{\\sqrt{2}}, -3 \\sqrt{2}, -\\frac{7}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}, -3 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -\\frac{3}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, -\\frac{7}{\\sqrt{2}}, 0, -\\frac{7}{\\sqrt{2}}, -3 \\sqrt{2}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(9/(math.sqrt(2))), -3*math.sqrt(2), -(7/(math.sqrt(2))), -(9/(math.sqrt(2))), -4*math.sqrt(2), -3*math.sqrt(2), -4*math.sqrt(2), -(9/(math.sqrt(2))), -3*math.sqrt(2), 0, -(3/(math.sqrt(2))), -3*math.sqrt(2), -(7/(math.sqrt(2))), -(3/(math.sqrt(2))), -3*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -(3/(math.sqrt(2))), -(7/(math.sqrt(2))), -(9/(math.sqrt(2))), -(7/(math.sqrt(2))), 0, -(7/(math.sqrt(2))), -3*math.sqrt(2), -3*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{18}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}, -\\frac{22}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$-\\frac{17}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(18/(math.sqrt(5))), -(11/(math.sqrt(5))), -(22/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{5}, 2 \\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2 \\sqrt{2}-\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(5), 2*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3 e, -6, -\\frac{13}{\\sqrt{3}}, 9, -2 e, \\frac{1}{\\sqrt{\\pi }}, 3, \\frac{11}{\\sqrt{2}}, 3 \\log (2), -13 \\log (2), -\\frac{18}{e}, -1, -5}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.e, -6, -(13/(math.sqrt(3))), 9, -2*math.e, (1/(math.sqrt(math.pi))), 3, (11/(math.sqrt(2))), 3*math.log(2), -13*math.log(2), -(18/math.e), -1, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{5}, -8, 4 \\sqrt{2}, -3, -9} \\setminus {2 \\sqrt{5}, 4 \\sqrt{2}, 9, -7}$.\n", - "Output Answer": [ - "${-9, -8, -3}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(5), -8, 4*math.sqrt(2), -3, -9,))\nsnd = set((2*math.sqrt(5), 4*math.sqrt(2), 9, -7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.065,0.023,0.13,0.498,0.051,0.007\\}$ and $\\{0.268,0.139,0.074,0.077,0.091,0.255\\}$.", - "Output Answer": [ - "$1.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.065, 0.023, 0.13, 0.498, 0.051, 0.007\ndistribution2 = 0.268, 0.139, 0.074, 0.077, 0.091, 0.255\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 19, \\frac{13}{2}}$.\n", - "Output Answer": [ - "$\\frac{5187}{604}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 19, (13/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{5}{2}, -8, -\\frac{28}{\\pi }, 7 \\sqrt{2}, -1, -3 e, -10, 8, -5, 0} \\cup {-\\frac{11}{\\sqrt{2}}, -5, -\\frac{28}{\\pi }, 5, 2, \\frac{5}{2}, 6, -8, -3 e, -10}$.\n", - "Output Answer": [ - "${-10, -\\frac{28}{\\pi }, -3 e, -8, -\\frac{11}{\\sqrt{2}}, -5, -1, 0, 2, \\frac{5}{2}, 5, 6, 8, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((5/2), -8, -(28/math.pi), 7*math.sqrt(2), -1, -3*math.e, -10, 8, -5, 0,))\nsnd = set((-(11/(math.sqrt(2))), -5, -(28/math.pi), 5, 2, (5/2), 6, -8, -3*math.e, -10,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 125, 3125, 9, 81, 32768}$.\n", - "Output Answer": [ - "$120 \\sqrt{2} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 125, 3125, 9, 81, 32768\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, -1, 7, 0, 5} \\setminus {3, -\\frac{20}{7}, -4, 5}$.\n", - "Output Answer": [ - "${-1, 0, 2, 7}$" - ], - "Output Program": [ - "fst = set((2, -1, 7, 0, 5,))\nsnd = set((3, -(20/7), -4, 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{1}{\\sqrt{\\pi }}, -\\frac{9}{\\sqrt{2}}, -8, 7 \\log (2), -2, 0, 8, -5}$.\n", - "Output Answer": [ - "${-8, -\\frac{9}{\\sqrt{2}}, -5, -2, -\\frac{1}{\\sqrt{\\pi }}, 0, 7 \\log (2), 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(1/(math.sqrt(math.pi))), -(9/(math.sqrt(2))), -8, 7*math.log(2), -2, 0, 8, -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{11}{\\pi }, \\frac{4}{\\pi }, \\frac{9}{\\pi }, \\frac{4}{\\pi }, -\\frac{7}{\\pi }, \\frac{9}{\\pi }, \\frac{9}{\\pi }, \\frac{4}{\\pi }, -\\frac{7}{\\pi }, \\frac{9}{\\pi }, -\\frac{11}{\\pi }, \\frac{9}{\\pi }, \\frac{9}{\\pi }, -\\frac{7}{\\pi }, -\\frac{7}{\\pi }, \\frac{4}{\\pi }, -\\frac{7}{\\pi }, \\frac{4}{\\pi }, -\\frac{7}{\\pi }, -\\frac{7}{\\pi }, -\\frac{11}{\\pi }, -\\frac{11}{\\pi }, -\\frac{11}{\\pi }, \\frac{4}{\\pi }, \\frac{4}{\\pi }, -\\frac{7}{\\pi }, -\\frac{11}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{7}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(11/math.pi), (4/math.pi), (9/math.pi), (4/math.pi), -(7/math.pi), (9/math.pi), (9/math.pi), (4/math.pi), -(7/math.pi), (9/math.pi), -(11/math.pi), (9/math.pi), (9/math.pi), -(7/math.pi), -(7/math.pi), (4/math.pi), -(7/math.pi), (4/math.pi), -(7/math.pi), -(7/math.pi), -(11/math.pi), -(11/math.pi), -(11/math.pi), (4/math.pi), (4/math.pi), -(7/math.pi), -(11/math.pi)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-8, 2, 7, 1, -6, 10, -7, -3, -5, -4} \\cap {-5, 8, -8, 5, 10, 7, 1, -7, 3}$.\n", - "Output Answer": [ - "${-8, -7, -5, 1, 7, 10}$" - ], - "Output Program": [ - "fst = set((-8, 2, 7, 1, -6, 10, -7, -3, -5, -4,))\nsnd = set((-5, 8, -8, 5, 10, 7, 1, -7, 3,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{17}{4}, -7, -\\frac{14}{e}, -\\frac{7}{\\sqrt{3}}, -5}$.\n", - "Output Answer": [ - "${-7, -\\frac{14}{e}, -5, -\\frac{7}{\\sqrt{3}}, \\frac{17}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = (17/4), -7, -(14/math.e), -(7/(math.sqrt(3))), -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{2}, 7 \\sqrt{2}, -3 \\sqrt{2}, 0, -\\sqrt{2}, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(2), 7*math.sqrt(2), -3*math.sqrt(2), 0, -math.sqrt(2), -5*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{2}, -\\sqrt{2}, -\\frac{3}{\\sqrt{2}}, -5 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -\\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\frac{1}{6} \\left(-\\frac{11}{\\sqrt{2}}-7 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(2), -math.sqrt(2), -(3/(math.sqrt(2))), -5*math.sqrt(2), -(5/(math.sqrt(2))), -(3/(math.sqrt(2)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3.76, 5, 1, 5 \\log (2), -10, \\frac{59}{7}} \\cup {5, \\frac{59}{7}, 5 \\log (2), -2, 3.76, 9, 0, -\\frac{26}{7}}$.\n", - "Output Answer": [ - "${-10, -\\frac{26}{7}, -2, 0, 1, 5 \\log (2), 3.76, 5, \\frac{59}{7}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3.76, 5, 1, 5*math.log(2), -10, (59/7),))\nsnd = set((5, (59/7), 5*math.log(2), -2, 3.76, 9, 0, -(26/7),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x^2-1.1 x+2.8$ where $x \\sim $ \\text{PoissonDistribution}[2.7]\n", - "Output Answer": [ - "$30.8$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.7)\nprint(E(3.1*x**2-1.1*x+2.8))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -2 \\pi, -2, -6} \\setminus {\\frac{25}{e}, 0, -3 \\pi, -9, -2, 2}$.\n", - "Output Answer": [ - "${-2 \\pi, -6}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -2*math.pi, -2, -6,))\nsnd = set(((25/math.e), 0, -3*math.pi, -9, -2, 2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x-0.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.8]\n", - "Output Answer": [ - "$1.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.8)\nprint(E(4.*x-0.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x^2-0.8 x+4.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$0.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(-2.*x**2-0.8*x+4.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-3.61 < 4.6 x+2.9 < 0.22$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.].", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(P((-3.61 < 4.6*x+2.9) & (4.6*x+2.9 < 0.22)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^2+1.8 x+3.8$ where $x \\sim $ \\text{BetaDistribution}[0.6,1.6]\n", - "Output Answer": [ - "$4.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.6, 1.6)\nprint(E(0.4*x**2+1.8*x+3.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3. x-0.4$ where $x \\sim $ \\text{PoissonDistribution}[2.8]\n", - "Output Answer": [ - "$8.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.8)\nprint(E(3.*x-0.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 5, 9, 1, 1, 5, 9, 9, -8, 6, 1, 6, -8, 1, -8, 5, 1, 5, 5, 6, 9, 9, -8, -8, -8, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 5, 9, 1, 1, 5, 9, 9, -8, 6, 1, 6, -8, 1, -8, 5, 1, 5, 5, 6, 9, 9, -8, -8, -8, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 25, 16, -2}$.\n", - "Output Answer": [ - "$2 \\sqrt[4]{-2} \\sqrt{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 25, 16, -2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${1, -4, e, -3, -\\frac{1}{\\sqrt{2}}, \\frac{9}{\\pi }, 8, -10} \\cup {-9, -3, -e, -1, \\frac{9}{\\pi }, -4}$.\n", - "Output Answer": [ - "${-10, -9, -4, -3, -e, -1, -\\frac{1}{\\sqrt{2}}, 1, e, \\frac{9}{\\pi }, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -4, math.e, -3, -(1/(math.sqrt(2))), (9/math.pi), 8, -10,))\nsnd = set((-9, -3, -math.e, -1, (9/math.pi), -4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.223,0.139,0.098,0.126,0.194,0.182\\}$ and $\\{0.169,0.023,0.208,0.236,0.077,0.126\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.223, 0.139, 0.098, 0.126, 0.194, 0.182\ndistribution2 = 0.169, 0.023, 0.208, 0.236, 0.077, 0.126\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, -8, 343, 4096, 5, 49}$.\n", - "Output Answer": [ - "$4 \\sqrt[6]{-5} \\sqrt{2} \\sqrt[3]{3} 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -8, 343, 4096, 5, 49\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 4, 6, 3, 15}$.\n", - "Output Answer": [ - "$\\frac{85}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 4, 6, 3, 15\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{5}, -\\frac{17}{2}, \\frac{15}{e}, -\\frac{11}{\\sqrt{\\pi }}, -4}$.\n", - "Output Answer": [ - "$\\frac{17}{2}+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(5), -(17/2), (15/math.e), -(11/(math.sqrt(math.pi))), -4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x^2+3.1 x-0.4$ where $x \\sim $ \\text{NormalDistribution}[0.2,1.3]\n", - "Output Answer": [ - "$8.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.2, 1.3)\nprint(E(4.6*x**2+3.1*x-0.4))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, 6, 4.82, -6, -1, 7 \\log (2), -8, -3} \\cup {2, -1, -5, 7 \\log (2), -7.17, 9, 0, -\\pi, -9}$.\n", - "Output Answer": [ - "${-9, -8, -7.17, -6, -5, -\\pi, -3, -1, 0, 2, 4.82, 7 \\log (2), 6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 6, 4.82, -6, -1, 7*math.log(2), -8, -3,))\nsnd = set((2, -1, -5, 7*math.log(2), -7.17, 9, 0, -math.pi, -9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, -8, -4 \\sqrt{5}, 7, 1, -6, 4} \\setminus {2, 4, -8}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -6, 1, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -8, -4*math.sqrt(5), 7, 1, -6, 4,))\nsnd = set((2, 4, -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^2-1. x-2.7$ where $x \\sim $ \\text{NormalDistribution}[0.3,2.8]\n", - "Output Answer": [ - "$7.31$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.3, 2.8)\nprint(E(1.3*x**2-1.*x-2.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{36}{7}, 8, \\frac{11}{2}, -9, 7, -\\sqrt{2}, -\\frac{11}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{36}{7}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (36/7), 8, (11/2), -9, 7, -math.sqrt(2), -(11/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4, 5, -2, -8, -3, -6, -3}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 5, -2, -8, -3, -6, -3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -10, 5, 6, -6, \\frac{4}{\\pi }} \\cup {-10, 7, 4, 8, -6, \\frac{4}{\\pi }}$.\n", - "Output Answer": [ - "${-10, -6, \\frac{4}{\\pi }, 4, 5, 6, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -10, 5, 6, -6, (4/math.pi),))\nsnd = set((-10, 7, 4, 8, -6, (4/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-4 \\sqrt{5}, -5 \\sqrt{2}, -3, 7, 1, 8, -11 \\log (2), -1, 5} \\cup {-\\sqrt{5}, 8, -11 \\log (2), -2, -6, 2, -5 \\sqrt{2}, 1, \\frac{14}{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -11 \\log (2), -5 \\sqrt{2}, -6, -3, -\\sqrt{5}, -2, -1, 1, 2, \\frac{14}{3}, 5, 7, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), -5*math.sqrt(2), -3, 7, 1, 8, -11*math.log(2), -1, 5,))\nsnd = set((-math.sqrt(5), 8, -11*math.log(2), -2, -6, 2, -5*math.sqrt(2), 1, (14/3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4096, -4, 625, 216}$.\n", - "Output Answer": [ - "$(40+40 i) 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 4096, -4, 625, 216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\sqrt{5}, \\sqrt{5}}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.sqrt(5), math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, -7, -4}$.\n", - "Output Answer": [ - "$9$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -7, -4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${9, 14 \\log (2), -6, -7, 2, -2, 8, 7} \\cup {13 \\log (2), 8, 1, -7, -3, -\\frac{17}{2}, 9, -2}$.\n", - "Output Answer": [ - "${-\\frac{17}{2}, -7, -6, -3, -2, 1, 2, 7, 8, 9, 13 \\log (2), 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 14*math.log(2), -6, -7, 2, -2, 8, 7,))\nsnd = set((13*math.log(2), 8, 1, -7, -3, -(17/2), 9, -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 5, 343, 1}$.\n", - "Output Answer": [ - "$10 \\sqrt[4]{5} 7^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 5, 343, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, 7 \\sqrt{2}, 6, -4, \\frac{4}{7}, \\frac{13}{4}, \\frac{16}{5}} \\cup {7 \\sqrt{2}, -4, \\frac{4}{7}, \\frac{16}{5}, 2, 6, -5}$.\n", - "Output Answer": [ - "${-5, -4, \\frac{4}{7}, 2, \\frac{16}{5}, \\frac{13}{4}, 6, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, 7*math.sqrt(2), 6, -4, (4/7), (13/4), (16/5),))\nsnd = set((7*math.sqrt(2), -4, (4/7), (16/5), 2, 6, -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4, 4, -4, -6, 2, 5, -8, 5, 4}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 4, -4, -6, 2, 5, -8, 5, 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\log (2), 13 \\log (2), 13 \\log (2), -9 \\log (2), 13 \\log (2), \\log (2), -4 \\log (2), \\log (2), 13 \\log (2), 13 \\log (2), \\log (2), -4 \\log (2), -9 \\log (2), 13 \\log (2), 13 \\log (2), 13 \\log (2), -7 \\log (2), -9 \\log (2), -9 \\log (2), -7 \\log (2), -4 \\log (2)}$.\n", - "Output Answer": [ - "$\\{13 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.log(2), 13*math.log(2), 13*math.log(2), -9*math.log(2), 13*math.log(2), math.log(2), -4*math.log(2), math.log(2), 13*math.log(2), 13*math.log(2), math.log(2), -4*math.log(2), -9*math.log(2), 13*math.log(2), 13*math.log(2), 13*math.log(2), -7*math.log(2), -9*math.log(2), -9*math.log(2), -7*math.log(2), -4*math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, -7 \\sqrt{2}, -4, -9, -8, -\\frac{14}{5}, \\pi} \\setminus {\\pi, -7 \\sqrt{2}, -\\frac{14}{5}, 1}$.\n", - "Output Answer": [ - "${-9, -8, -4, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -7*math.sqrt(2), -4, -9, -8, -(14/5), math.pi,))\nsnd = set((math.pi, -7*math.sqrt(2), -(14/5), 1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 100000, -10, 2401, 729}$.\n", - "Output Answer": [ - "$210 \\sqrt[5]{-30} 7^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 100000, -10, 2401, 729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\sqrt{3}, -\\sqrt{3}, 3 \\sqrt{3}, -2 \\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, -4 \\sqrt{3}, -\\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}, -\\sqrt{3}, -4 \\sqrt{3}, 4 \\sqrt{3}, -2 \\sqrt{3}, 3 \\sqrt{3}, -4 \\sqrt{3}, 4 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, 3 \\sqrt{3}, -\\sqrt{3}, 4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.sqrt(3), -math.sqrt(3), 3*math.sqrt(3), -2*math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), -4*math.sqrt(3), -math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3), -math.sqrt(3), -4*math.sqrt(3), 4*math.sqrt(3), -2*math.sqrt(3), 3*math.sqrt(3), -4*math.sqrt(3), 4*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), 3*math.sqrt(3), -math.sqrt(3), 4*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{4}{\\sqrt{3}}, \\frac{22}{e}, 2 \\sqrt{2}, \\frac{21}{5}, -3.79, 7 \\sqrt{2}} \\setminus {-9, \\frac{27}{5}, \\frac{22}{e}, -\\frac{4}{\\sqrt{3}}, -8.53, \\frac{13}{\\sqrt{2}}, \\frac{1}{\\pi }}$.\n", - "Output Answer": [ - "${-3.79, 2 \\sqrt{2}, \\frac{21}{5}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/(math.sqrt(3))), (22/math.e), 2*math.sqrt(2), (21/5), -3.79, 7*math.sqrt(2),))\nsnd = set((-9, (27/5), (22/math.e), -(4/(math.sqrt(3))), -8.53, (13/(math.sqrt(2))), (1/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, 7, -11, -8}$.\n", - "Output Answer": [ - "$\\frac{329}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, 7, -11, -8\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 4, 3, -1, -14, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{278}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 4, 3, -1, -14, 15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, 7, 10, \\frac{34}{7}, 10, -1, 3, 3 e}$.\n", - "Output Answer": [ - "${-1, 3, \\frac{34}{7}, 6, 7, 3 e, 10, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 7, 10, (34/7), 10, -1, 3, 3*math.e\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{11}{4}, -\\frac{10}{e}, -4 \\sqrt{5}, -6 \\sqrt{2}} \\cup {-\\frac{10}{e}, -4 \\sqrt{5}, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -6 \\sqrt{2}, -5 \\sqrt{2}, -\\frac{10}{e}, -\\frac{11}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(11/4), -(10/math.e), -4*math.sqrt(5), -6*math.sqrt(2),))\nsnd = set((-(10/math.e), -4*math.sqrt(5), -5*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, 9}$.\n", - "Output Answer": [ - "${0, 9}$" - ], - "Output Program": [ - "values = 0, 9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${10, -6, 9, 6, -3, e}$.", - "Output Answer": [ - "$\\frac{6+e}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 10, -6, 9, 6, -3, math.e\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, 5, -10}$.\n", - "Output Answer": [ - "$\\frac{199}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 5, -10\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 1296, -64, 256, 64}$.\n", - "Output Answer": [ - "$32 \\sqrt[5]{-2} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 1296, -64, 256, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-11 \\log (2), 9, -\\frac{11}{\\sqrt{2}}, -\\frac{16}{\\sqrt{3}}, -7, 0} \\setminus {-7, 4.247, -5, 0}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{3}}, -\\frac{11}{\\sqrt{2}}, -11 \\log (2), 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-11*math.log(2), 9, -(11/(math.sqrt(2))), -(16/(math.sqrt(3))), -7, 0,))\nsnd = set((-7, 4.247, -5, 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${9, 6, -4, -2}$.\n", - "Output Answer": [ - "$\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 9, 6, -4, -2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, -8, -9, -3 \\sqrt{5}, -4, 4, 0, -\\frac{42}{5}, \\sqrt{5}} \\setminus {3, 7, \\frac{21}{5}, -5, -4}$.\n", - "Output Answer": [ - "${-9, -\\frac{42}{5}, -8, -3 \\sqrt{5}, 0, \\sqrt{5}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -8, -9, -3*math.sqrt(5), -4, 4, 0, -(42/5), math.sqrt(5),))\nsnd = set((3, 7, (21/5), -5, -4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 20, 14, 12}$.\n", - "Output Answer": [ - "$\\frac{840}{113}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 20, 14, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3. x-3.7$ where $x \\sim $ \\text{BetaDistribution}[0.5,0.5]\n", - "Output Answer": [ - "$-5.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.5, 0.5)\nprint(E(-3.*x-3.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, 5 \\sqrt{2}, 6, 3 \\pi, 10, 0, \\frac{11}{3}, \\frac{12}{\\sqrt{\\pi }}, -\\frac{8}{\\sqrt{\\pi }}, 2}$.", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 5*math.sqrt(2), 6, 3*math.pi, 10, 0, (11/3), (12/(math.sqrt(math.pi))), -(8/(math.sqrt(math.pi))), 2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{25}{4}, 6, 5, -9, \\frac{47}{5}, -2 \\sqrt{2}, -\\frac{5}{\\sqrt{\\pi }}, \\frac{12}{\\pi }, -9, -9}$.\n", - "Output Answer": [ - "$\\frac{92}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(25/4), 6, 5, -9, (47/5), -2*math.sqrt(2), -(5/(math.sqrt(math.pi))), (12/math.pi), -9, -9\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, \\frac{9}{2}, -\\sqrt{3}, -\\frac{11}{2}, 4, -5}$.\n", - "Output Answer": [ - "${-\\frac{11}{2}, -5, -\\sqrt{3}, 4, \\frac{9}{2}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (9/2), -math.sqrt(3), -(11/2), 4, -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $1.16 < 2.6 x+0.5 < 2.51$ where $x \\sim $ \\text{NormalDistribution}[1.5,1.].", - "Output Answer": [ - "$0.13$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.5, 1.)\nprint(P((1.16 < 2.6*x+0.5) & (2.6*x+0.5 < 2.51)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, 3 \\sqrt{3}, 6, 2, 6, -\\frac{53}{7}}$.\n", - "Output Answer": [ - "$\\frac{95}{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 3*math.sqrt(3), 6, 2, 6, -(53/7)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, -2, -7, -2}$.\n", - "Output Answer": [ - "$\\frac{178}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -2, -7, -2\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.1 x-1.9$ where $x \\sim $ \\text{NormalDistribution}[-1.1,2.9]\n", - "Output Answer": [ - "$-4.21$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.1, 2.9)\nprint(E(2.1*x-1.9))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5.2, 0, \\frac{20}{\\pi }, \\frac{13}{\\sqrt{2}}, -9, -7, 1} \\cup {-7, 7, -5., 3 \\sqrt{2}, -5, -\\frac{2}{\\pi }, \\frac{20}{\\pi }}$.\n", - "Output Answer": [ - "${-9, -7, -5., -5, -\\frac{2}{\\pi }, 0, 1, 3 \\sqrt{2}, 5.2, \\frac{20}{\\pi }, 7, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5.2, 0, (20/math.pi), (13/(math.sqrt(2))), -9, -7, 1,))\nsnd = set((-7, 7, -5., 3*math.sqrt(2), -5, -(2/math.pi), (20/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${10, \\frac{7}{\\sqrt{3}}, 9, \\sqrt{5}, -4, -3 e, 6}$.", - "Output Answer": [ - "$\\frac{7}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 10, (7/(math.sqrt(3))), 9, math.sqrt(5), -4, -3*math.e, 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 14, 4, 7}$.\n", - "Output Answer": [ - "$\\frac{336}{67}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 14, 4, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.089,0.022,0.087,0.166,0.074,0.028,0.098,0.149,0.14,0.035\\}$ and $\\{0.238,0.075,0.031,0.092,0.079,0.068,0.064,0.014,0.102,0.201\\}$.", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.089, 0.022, 0.087, 0.166, 0.074, 0.028, 0.098, 0.149, 0.14, 0.035\ndistribution2 = 0.238, 0.075, 0.031, 0.092, 0.079, 0.068, 0.064, 0.014, 0.102, 0.201\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, -5, 1} \\setminus {\\frac{16}{\\sqrt{\\pi }}, 2, -9, 0.45, 10, -5}$.\n", - "Output Answer": [ - "${1}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -5, 1,))\nsnd = set(((16/(math.sqrt(math.pi))), 2, -9, 0.45, 10, -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.105,0.055,0.071,0.121,0.053,0.114,0.045,0.212,0.093,0.03\\}$ and $\\{0.043,0.076,0.127,0.086,0.112,0.219,0.042,0.03,0.028,0.144\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.105, 0.055, 0.071, 0.121, 0.053, 0.114, 0.045, 0.212, 0.093, 0.03\ndistribution2 = 0.043, 0.076, 0.127, 0.086, 0.112, 0.219, 0.042, 0.03, 0.028, 0.144\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, -9, -9}$.\n", - "Output Answer": [ - "$\\frac{49}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, -9, -9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2, 1.5, \\frac{11}{\\sqrt{5}}, -2 \\sqrt{2}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -2 \\sqrt{2}, 1.5, 2, \\frac{11}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, 1.5, (11/(math.sqrt(5))), -2*math.sqrt(2), -4*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, -8, \\pi, \\frac{15}{4}, 0, -5, 3}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, -8, math.pi, (15/4), 0, -5, 3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{45}{7}, -10, 6, -\\sqrt{3}, 2.72, -3, 1.759} \\setminus {-3, -9.646, 6, -10, -\\frac{24}{5}, \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\sqrt{3}, 1.759, 2.72, \\frac{45}{7}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((45/7), -10, 6, -math.sqrt(3), 2.72, -3, 1.759,))\nsnd = set((-3, -9.646, 6, -10, -(24/5), math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 4, -\\frac{17}{\\sqrt{3}}, -7, -\\frac{2}{e}, -\\sqrt{3}} \\setminus {-7, 1, -\\sqrt{3}, -2.9, -5, 4 \\sqrt{3}, 2, -\\frac{12}{e}}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{3}}, -\\frac{2}{e}, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 4, -(17/(math.sqrt(3))), -7, -(2/math.e), -math.sqrt(3),))\nsnd = set((-7, 1, -math.sqrt(3), -2.9, -5, 4*math.sqrt(3), 2, -(12/math.e),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, 4, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{43}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 4, -2\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-8, 1, 4, -2.834, 6} \\setminus {1, 7.449, 5, 4, 6, -8}$.\n", - "Output Answer": [ - "${-2.834}$" - ], - "Output Program": [ - "fst = set((-8, 1, 4, -2.834, 6,))\nsnd = set((1, 7.449, 5, 4, 6, -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-6, 0, -9, -5, 4, 3, -3, -10, 5, -7, 8, -4} \\cap {5, -3, -1, 4, -2, -9, -7, 10, 7, 3, -5, 0, -10, 9}$.\n", - "Output Answer": [ - "${-10, -9, -7, -5, -3, 0, 3, 4, 5}$" - ], - "Output Program": [ - "fst = set((-6, 0, -9, -5, 4, 3, -3, -10, 5, -7, 8, -4,))\nsnd = set((5, -3, -1, 4, -2, -9, -7, 10, 7, 3, -5, 0, -10, 9,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{1}{3}, -6, -5, 8, 2, 0, -4} \\cup {\\frac{1}{3}, 8, 4, -4, 2, 0}$.\n", - "Output Answer": [ - "${-6, -5, -4, 0, \\frac{1}{3}, 2, 4, 8}$" - ], - "Output Program": [ - "fst = set(((1/3), -6, -5, 8, 2, 0, -4,))\nsnd = set(((1/3), 8, 4, -4, 2, 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -3, 1, -9}$.\n", - "Output Answer": [ - "$-\\frac{15}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -3, 1, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, 6561, 4096, -7776, 256}$.\n", - "Output Answer": [ - "$288\\ 3^{3/5} \\sqrt[5]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 6561, 4096, -7776, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 0, 4, 4, -9, 4, -9, 0, 0, 0, -4, -9, 0, 0, -4, -8, 6, -9, 0, 0, -4, 4, -8, -9, 0, 4, -8, -8, -4, 4}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 0, 4, 4, -9, 4, -9, 0, 0, 0, -4, -9, 0, 0, -4, -8, 6, -9, 0, 0, -4, 4, -8, -9, 0, 4, -8, -8, -4, 4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, -14, 15, -10, -14}$.\n", - "Output Answer": [ - "$\\frac{1567}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, -14, 15, -10, -14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x^2-1.7 x+1.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$10.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(4.7*x**2-1.7*x+1.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${5, 3, 14}$.\n", - "Output Answer": [ - "$\\frac{103}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, 3, 14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, -9, -12, -12, -2}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{177}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -9, -12, -12, -2\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 12, 16}$.\n", - "Output Answer": [ - "$\\frac{48}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 12, 16\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, -\\frac{17}{2}, -\\frac{15}{\\sqrt{\\pi }}, 0, \\frac{4}{3}, -\\sqrt{5}, -6.537} \\setminus {0, -\\frac{15}{\\sqrt{\\pi }}, -2, -\\frac{17}{2}, 4, -\\sqrt{5}, -6.537}$.\n", - "Output Answer": [ - "${\\frac{4}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -(17/2), -(15/(math.sqrt(math.pi))), 0, (4/3), -math.sqrt(5), -6.537,))\nsnd = set((0, -(15/(math.sqrt(math.pi))), -2, -(17/2), 4, -math.sqrt(5), -6.537,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{12}{e}, 5, 2.3, -2, 10, -3, 3, -\\frac{8}{e}} \\cup {-\\frac{8}{e}, \\frac{12}{e}, 4, -3, 5, 7, 2.3}$.\n", - "Output Answer": [ - "${-3, -\\frac{8}{e}, -2, 2.3, 3, 4, \\frac{12}{e}, 5, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set(((12/math.e), 5, 2.3, -2, 10, -3, 3, -(8/math.e),))\nsnd = set((-(8/math.e), (12/math.e), 4, -3, 5, 7, 2.3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{25}{\\pi }, -4, -6, -8 \\log (2), 4 \\sqrt{5}, 4, \\frac{13}{\\sqrt{3}}, -2, -2 e, -6, -\\frac{7}{3}, \\frac{19}{5}, 9, -6 \\sqrt{2}, -\\frac{2}{\\sqrt{5}}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (25/math.pi), -4, -6, -8*math.log(2), 4*math.sqrt(5), 4, (13/(math.sqrt(3))), -2, -2*math.e, -6, -(7/3), (19/5), 9, -6*math.sqrt(2), -(2/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, -\\frac{37}{7}, \\frac{6}{\\sqrt{\\pi }}, 7, -8, 1} \\setminus {1, 8, -\\sqrt{2}, -\\frac{37}{7}, -2, -10, 0}$.\n", - "Output Answer": [ - "${-8, \\frac{6}{\\sqrt{\\pi }}, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -(37/7), (6/(math.sqrt(math.pi))), 7, -8, 1,))\nsnd = set((1, 8, -math.sqrt(2), -(37/7), -2, -10, 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-e, -6 \\sqrt{2}, 4, 7, \\frac{7}{5}, -\\frac{8}{\\sqrt{\\pi }}, 4 \\sqrt{2}} \\setminus {-3, \\frac{7}{5}, 4 \\sqrt{2}, \\frac{17}{\\sqrt{\\pi }}, -e, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{8}{\\sqrt{\\pi }}, 4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.e, -6*math.sqrt(2), 4, 7, (7/5), -(8/(math.sqrt(math.pi))), 4*math.sqrt(2),))\nsnd = set((-3, (7/5), 4*math.sqrt(2), (17/(math.sqrt(math.pi))), -math.e, -6*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 13, 2, 7}$.\n", - "Output Answer": [ - "$\\frac{1820}{373}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 13, 2, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.4 x-3.4$ where $x \\sim $ \\text{PoissonDistribution}[3.4]\n", - "Output Answer": [ - "$-4.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.4)\nprint(E(-0.4*x-3.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, -3 \\sqrt{3}, \\frac{21}{4}, \\frac{23}{3}, -9, -7}$.\n", - "Output Answer": [ - "$\\frac{50}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -3*math.sqrt(3), (21/4), (23/3), -9, -7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2, 9.17}$.\n", - "Output Answer": [ - "${-2, 9.17}$" - ], - "Output Program": [ - "values = -2, 9.17\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-7, -3 e, -4 \\sqrt{3}, -5, \\frac{7}{e}} \\setminus {-4 \\sqrt{3}, -2, 5, -\\frac{2}{e}}$.\n", - "Output Answer": [ - "${-3 e, -7, -5, \\frac{7}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, -3*math.e, -4*math.sqrt(3), -5, (7/math.e),))\nsnd = set((-4*math.sqrt(3), -2, 5, -(2/math.e),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{15}{2}, -3, 0, 0, -6.975, 0}$.\n", - "Output Answer": [ - "${-6.975, -3, 0, 0, 0, \\frac{15}{2}}$" - ], - "Output Program": [ - "values = (15/2), -3, 0, 0, -6.975, 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4 \\sqrt{3}, 0, 5, -8, -7, -6, -4, \\frac{30}{\\pi }, \\pi} \\cup {2 e, -4, 10, 0, 4 \\sqrt{3}, 2, 4, 5, -3}$.\n", - "Output Answer": [ - "${-8, -7, -6, -4, -3, 0, 2, \\pi, 4, 5, 2 e, 4 \\sqrt{3}, \\frac{30}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(3), 0, 5, -8, -7, -6, -4, (30/math.pi), math.pi,))\nsnd = set((2*math.e, -4, 10, 0, 4*math.sqrt(3), 2, 4, 5, -3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.9 x^2+2.3 x+0.3$ where $x \\sim $ \\text{NormalDistribution}[1.1,2.2]\n", - "Output Answer": [ - "$-14.72$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.1, 2.2)\nprint(E(-2.9*x**2+2.3*x+0.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, 9, -5}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 9, -5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{20}{e}, \\frac{16}{e}}$.\n", - "Output Answer": [ - "$\\frac{18}{e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (20/math.e), (16/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${1, -1, -6, -9, -e, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-9, -6, -e, -1, 1, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -1, -6, -9, -math.e, 2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-216, -216, 64}$.\n", - "Output Answer": [ - "$144$" - ], - "Output Program": [ - "import math\n\nvalues = -216, -216, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 343, 1000000, 729, 49, 531441}$.\n", - "Output Answer": [ - "$270\\ 7^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 343, 1000000, 729, 49, 531441\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.155,0.268,0.11,0.215\\}$ and $\\{0.132,0.219,0.136,0.113,0.058\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.155, 0.268, 0.11, 0.215\ndistribution2 = 0.132, 0.219, 0.136, 0.113, 0.058\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.088,0.213,0.102,0.054,0.19,0.212,0.086\\}$ and $\\{0.05,0.066,0.045,0.12,0.209,0.182,0.091\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.088, 0.213, 0.102, 0.054, 0.19, 0.212, 0.086\ndistribution2 = 0.05, 0.066, 0.045, 0.12, 0.209, 0.182, 0.091\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, -4, 1}$.\n", - "Output Answer": [ - "$\\sqrt[3]{-7} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -4, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 3 \\sqrt{3}, -2 e, -6, 7, -\\frac{15}{2}, 6, -4, 0, -7, \\frac{28}{\\pi }}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 3*math.sqrt(3), -2*math.e, -6, 7, -(15/2), 6, -4, 0, -7, (28/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{19}{\\pi }, 4, 8, -\\frac{16}{7}, -10, 3 \\pi, -9, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "$10+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = (19/math.pi), 4, 8, -(16/7), -10, 3*math.pi, -9, -(15/2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, \\frac{27}{5}, -10, 5, -\\frac{31}{5}, \\frac{4}{5}, 5, -\\frac{39}{5}, \\frac{27}{5}, \\frac{34}{5}, 5, -10, -10, \\frac{27}{5}, \\frac{34}{5}, -\\frac{31}{5}, \\frac{34}{5}, \\frac{34}{5}, \\frac{4}{5}, 5, \\frac{4}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-10,5,\\frac{34}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, (27/5), -10, 5, -(31/5), (4/5), 5, -(39/5), (27/5), (34/5), 5, -10, -10, (27/5), (34/5), -(31/5), (34/5), (34/5), (4/5), 5, (4/5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, 4, 5 \\log (2), -\\frac{1}{\\sqrt{5}}, 2 \\pi, 2, -10, -8, -\\frac{16}{e}, 0, 3, 0, 10}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, 4, 5*math.log(2), -(1/(math.sqrt(5))), 2*math.pi, 2, -10, -8, -(16/math.e), 0, 3, 0, 10\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-10 \\log (2), -2, 8, -3, \\frac{7}{2}} \\cup {-\\log (2), \\frac{7}{2}, -3, 8, -2}$.\n", - "Output Answer": [ - "${-10 \\log (2), -3, -2, -\\log (2), \\frac{7}{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10*math.log(2), -2, 8, -3, (7/2),))\nsnd = set((-math.log(2), (7/2), -3, 8, -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${12 \\log (2), \\log (2), 12 \\log (2), -6 \\log (2), -7 \\log (2), 12 \\log (2), -6 \\log (2), -3 \\log (2), \\log (2), -3 \\log (2), -11 \\log (2), -5 \\log (2), -11 \\log (2), -8 \\log (2), -7 \\log (2), -11 \\log (2), -7 \\log (2), -5 \\log (2), -11 \\log (2), -7 \\log (2), -8 \\log (2), \\log (2)}$.\n", - "Output Answer": [ - "$\\{-7 \\log (2),-11 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 12*math.log(2), math.log(2), 12*math.log(2), -6*math.log(2), -7*math.log(2), 12*math.log(2), -6*math.log(2), -3*math.log(2), math.log(2), -3*math.log(2), -11*math.log(2), -5*math.log(2), -11*math.log(2), -8*math.log(2), -7*math.log(2), -11*math.log(2), -7*math.log(2), -5*math.log(2), -11*math.log(2), -7*math.log(2), -8*math.log(2), math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, -2, 15, -15, 3}$.\n", - "Output Answer": [ - "$\\frac{1293}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, -2, 15, -15, 3\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, -2, 2, -2, -1, 2, -2, -5, -1, -2, 2, 8, 2, -1, -5, 2, -1, -2, -1, 8, -1, -1, 2, -5, 2, -2, -1, 8, 8, 2}$.\n", - "Output Answer": [ - "$\\{2,-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, -2, 2, -2, -1, 2, -2, -5, -1, -2, 2, 8, 2, -1, -5, 2, -1, -2, -1, 8, -1, -1, 2, -5, 2, -2, -1, 8, 8, 2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, 0, -8.8, 2 e, -3, -5 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-8.8, -5 \\sqrt{2}, -3, 0, 2 e, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 0, -8.8, 2*math.e, -3, -5*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 8, 18}$.\n", - "Output Answer": [ - "$\\frac{1512}{127}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 8, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, \\frac{11}{2}, \\frac{1}{2}, -3, \\frac{11}{2}, -\\frac{19}{4}, \\frac{11}{2}, \\frac{5}{4}, -9, -\\frac{19}{4}, \\frac{5}{4}, -\\frac{19}{4}, -3, \\frac{1}{2}, -9, \\frac{11}{2}, \\frac{1}{2}, -9, -9, -\\frac{19}{4}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{11}{2},-\\frac{19}{4},-9\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, (11/2), (1/2), -3, (11/2), -(19/4), (11/2), (5/4), -9, -(19/4), (5/4), -(19/4), -3, (1/2), -9, (11/2), (1/2), -9, -9, -(19/4)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${5, 1024, -512, 531441, -32, 216}$.\n", - "Output Answer": [ - "$144 \\sqrt[6]{5} \\sqrt{6}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 1024, -512, 531441, -32, 216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.121,0.609,0.094\\}$ and $\\{0.127,0.422,0.165\\}$.", - "Output Answer": [ - "$0.06$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.121, 0.609, 0.094\ndistribution2 = 0.127, 0.422, 0.165\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-9.74, 0.38, -7.71, -8.63, 7.41} \\cap {-9.06, 0.38, 8.2, 0.88, 9.65}$.\n", - "Output Answer": [ - "${0.38}$" - ], - "Output Program": [ - "fst = set((-9.74, 0.38, -7.71, -8.63, 7.41,))\nsnd = set((-9.06, 0.38, 8.2, 0.88, 9.65,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, -11, -9, 13}$.\n", - "Output Answer": [ - "$\\frac{475}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -11, -9, 13\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, \\frac{52}{7}, 3 \\pi, 3, -7, -5, 9, 7, -4, -\\frac{21}{\\sqrt{5}}, -\\frac{6}{\\sqrt{\\pi }}, -\\frac{1}{3}, -5}$.\n", - "Output Answer": [ - "$\\frac{21}{\\sqrt{5}}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 3, (52/7), 3*math.pi, 3, -7, -5, 9, 7, -4, -(21/(math.sqrt(5))), -(6/(math.sqrt(math.pi))), -(1/3), -5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-10, -3, -9}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "values = -10, -3, -9\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 6, -4, 6, -8, -5, 6, -5, -6, -8, -5, -4, -6, 2, 6, -8, 2, 6, -4, 2, -6, -8, 6, -5, -4, -6, 6, 6}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 6, -4, 6, -8, -5, 6, -5, -6, -8, -5, -4, -6, 2, 6, -8, 2, 6, -4, 2, -6, -8, 6, -5, -4, -6, 6, 6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -8, 9, 1, 1, 1, 6, -8, 1, -8, 6, 6, 1, 9, 1, 1, -8, -8, -8, -8, 6, -8, 1, -8, 6, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -8, 9, 1, 1, 1, 6, -8, 1, -8, 6, 6, 1, 9, 1, 1, -8, -8, -8, -8, 6, -8, 1, -8, 6, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4 \\sqrt{5}, 9, -3., -\\frac{11}{2}, 6} \\cup {7, 4 \\sqrt{5}, -9, 9, -\\frac{11}{2}, 7.5}$.\n", - "Output Answer": [ - "${-9, -\\frac{11}{2}, -3., 6, 7, 7.5, 4 \\sqrt{5}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(5), 9, -3., -(11/2), 6,))\nsnd = set((7, 4*math.sqrt(5), -9, 9, -(11/2), 7.5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -\\frac{7}{2}, 2, -1, -6}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "values = -9, -(7/2), 2, -1, -6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 2, 343, 16}$.\n", - "Output Answer": [ - "$14 \\sqrt[4]{2} 7^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 2, 343, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -\\frac{7}{3}, \\frac{11}{\\sqrt{\\pi }}, 9, -\\frac{11}{\\sqrt{3}}, \\frac{44}{5}, 6, 2, -\\frac{8}{e}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -(7/3), (11/(math.sqrt(math.pi))), 9, -(11/(math.sqrt(3))), (44/5), 6, 2, -(8/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x+1.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$1.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(3.8*x+1.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{25}{4}, \\frac{33}{4}, -\\frac{27}{4}, 1}$.\n", - "Output Answer": [ - "$-\\frac{15}{16}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(25/4), (33/4), -(27/4), 1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, -4, 10, -9}$.\n", - "Output Answer": [ - "$\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, -4, 10, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.159,0.104,0.178,0.05,0.092,0.334\\}$ and $\\{0.72,0.017,0.077,0.06,0.013,0.111\\}$.", - "Output Answer": [ - "$0.78$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.159, 0.104, 0.178, 0.05, 0.092, 0.334\ndistribution2 = 0.72, 0.017, 0.077, 0.06, 0.013, 0.111\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.067,0.087,0.104,0.085,0.059,0.171,0.084,0.129,0.088\\}$ and $\\{0.127,0.052,0.041,0.057,0.038,0.044,0.291,0.165,0.049\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.067, 0.087, 0.104, 0.085, 0.059, 0.171, 0.084, 0.129, 0.088\ndistribution2 = 0.127, 0.052, 0.041, 0.057, 0.038, 0.044, 0.291, 0.165, 0.049\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.044,0.12,0.009,0.267,0.041,0.103,0.041,0.089,0.253\\}$ and $\\{0.078,0.115,0.088,0.088,0.081,0.136,0.056,0.176,0.115\\}$.", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.044, 0.12, 0.009, 0.267, 0.041, 0.103, 0.041, 0.089, 0.253\ndistribution2 = 0.078, 0.115, 0.088, 0.088, 0.081, 0.136, 0.056, 0.176, 0.115\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -\\frac{22}{3}, -\\frac{20}{3}}$.\n", - "Output Answer": [ - "$-7$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -(22/3), -(20/3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{5}{\\sqrt{\\pi }}, 0, -4}$.\n", - "Output Answer": [ - "${-4, 0, \\frac{5}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/(math.sqrt(math.pi))), 0, -4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.164,0.239,0.148,0.288\\}$ and $\\{0.277,0.111,0.23,0.176\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.164, 0.239, 0.148, 0.288\ndistribution2 = 0.277, 0.111, 0.23, 0.176\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-5.21 < 1.6 x-2.3 < 0.04$ where $x \\sim $ \\text{NormalDistribution}[-1.3,2.6].", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.3, 2.6)\nprint(P((-5.21 < 1.6*x-2.3) & (1.6*x-2.3 < 0.04)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, -7, 4}$.\n", - "Output Answer": [ - "$\\frac{247}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -7, 4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, 0, 7, -9}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{185}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 0, 7, -9\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.3 x^2+2.7 x-1.4$ where $x \\sim $ \\text{NormalDistribution}[-1.5,2.7]\n", - "Output Answer": [ - "$6.95$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.5, 2.7)\nprint(E(1.3*x**2+2.7*x-1.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 18, 19}$.\n", - "Output Answer": [ - "$\\frac{4104}{319}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 18, 19\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -9, -\\log (2), 2, -5, 7} \\cup {-\\log (2), 7, -1, 6, 2}$.\n", - "Output Answer": [ - "${-9, -5, -1, -\\log (2), 2, 4, 6, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -9, -math.log(2), 2, -5, 7,))\nsnd = set((-math.log(2), 7, -1, 6, 2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, -7, 6, 9} \\setminus {6, 4, -8}$.\n", - "Output Answer": [ - "${-7, 9}$" - ], - "Output Program": [ - "fst = set((4, -7, 6, 9,))\nsnd = set((6, 4, -8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x+1.6$ where $x \\sim $ \\text{BetaDistribution}[1.,0.4]\n", - "Output Answer": [ - "$4.89$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 0.4)\nprint(E(4.6*x+1.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4, 10, -\\frac{15}{2}, -7 \\sqrt{2}, -\\frac{4}{\\pi }, 7, \\frac{7}{\\sqrt{\\pi }}, 3 \\pi, -\\frac{15}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$-\\frac{4}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, 10, -(15/2), -7*math.sqrt(2), -(4/math.pi), 7, (7/(math.sqrt(math.pi))), 3*math.pi, -(15/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -4, -1, -2 \\pi, 3, -1, 5, \\frac{41}{7}, \\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\frac{19}{2}+2 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -4, -1, -2*math.pi, 3, -1, 5, (41/7), (19/2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.09,0.056,0.469,0.065,0.062,0.002,0.125\\}$ and $\\{0.06,0.109,0.11,0.132,0.069,0.21,0.07\\}$.", - "Output Answer": [ - "$0.66$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.09, 0.056, 0.469, 0.065, 0.062, 0.002, 0.125\ndistribution2 = 0.06, 0.109, 0.11, 0.132, 0.069, 0.21, 0.07\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.065,0.104,0.16,0.027,0.083,0.144,0.051,0.083,0.036\\}$ and $\\{0.148,0.054,0.053,0.178,0.083,0.115,0.084,0.152,0.082\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.065, 0.104, 0.16, 0.027, 0.083, 0.144, 0.051, 0.083, 0.036\ndistribution2 = 0.148, 0.054, 0.053, 0.178, 0.083, 0.115, 0.084, 0.152, 0.082\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, \\frac{28}{5}, -\\frac{17}{e}, -5, \\sqrt{2}, 3, 6, 5, 5}$.\n", - "Output Answer": [ - "$7+\\frac{17}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, (28/5), -(17/math.e), -5, math.sqrt(2), 3, 6, 5, 5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -9, 4, 2, -7} \\setminus {10, -5 \\log (2), -7, -8, -2, 2}$.\n", - "Output Answer": [ - "${-9, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -9, 4, 2, -7,))\nsnd = set((10, -5*math.log(2), -7, -8, -2, 2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\sqrt{3}, -4 \\sqrt{3}, -2 \\sqrt{3}, -6 \\sqrt{3}, \\sqrt{3}, -5 \\sqrt{3}, -3 \\sqrt{3}, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{11 \\sqrt{3}}{4}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.sqrt(3), -4*math.sqrt(3), -2*math.sqrt(3), -6*math.sqrt(3), math.sqrt(3), -5*math.sqrt(3), -3*math.sqrt(3), -math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, 5, 4, 8, 13, 1}$.\n", - "Output Answer": [ - "$\\frac{603}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 5, 4, 8, 13, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${5, -8 \\log (2), 6, -8, 4, -3 \\pi, 8} \\cup {-8, -\\pi, 8, 6, 5, -4, 11 \\log (2)}$.\n", - "Output Answer": [ - "${-3 \\pi, -8, -8 \\log (2), -4, -\\pi, 4, 5, 6, 11 \\log (2), 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -8*math.log(2), 6, -8, 4, -3*math.pi, 8,))\nsnd = set((-8, -math.pi, 8, 6, 5, -4, 11*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{\\sqrt{5}}, 5} \\setminus {-2, -\\frac{6}{\\sqrt{5}}, 0, -5.06, e, 5}$.\n", - "Output Answer": [ - "${\\frac{13}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/(math.sqrt(5))), 5,))\nsnd = set((-2, -(6/(math.sqrt(5))), 0, -5.06, math.e, 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-9.257, 4}$.\n", - "Output Answer": [ - "${-9.257, 4}$" - ], - "Output Program": [ - "values = -9.257, 4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.139,0.708,0.005\\}$ and $\\{0.172,0.616,0.173\\}$.", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.139, 0.708, 0.005\ndistribution2 = 0.172, 0.616, 0.173\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-7, 3, \\frac{20}{3}, e, \\frac{26}{3}, -7, 5 \\sqrt{2}, 0, 2, 8, -8}$.", - "Output Answer": [ - "$e$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, 3, (20/3), math.e, (26/3), -7, 5*math.sqrt(2), 0, 2, 8, -8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.07,0.034,0.13,0.027,0.397,0.137,0.126\\}$ and $\\{0.161,0.054,0.02,0.097,0.077,0.165,0.33\\}$.", - "Output Answer": [ - "$0.68$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.07, 0.034, 0.13, 0.027, 0.397, 0.137, 0.126\ndistribution2 = 0.161, 0.054, 0.02, 0.097, 0.077, 0.165, 0.33\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${14, 4, 1}$.\n", - "Output Answer": [ - "$\\frac{139}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 4, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7 \\sqrt{2}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{5}{\\sqrt{2}}, \\pi, \\frac{5}{e}, 9, 3, \\frac{24}{7}, \\sqrt{3}, -3}$.\n", - "Output Answer": [ - "$9+7 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -7*math.sqrt(2), -(13/(math.sqrt(math.pi))), (5/(math.sqrt(2))), math.pi, (5/math.e), 9, 3, (24/7), math.sqrt(3), -3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${7 \\sqrt{2}, -e, 7} \\setminus {7 \\sqrt{2}, -\\frac{20}{3}, -8, -e, 7, -4}$.\n", - "Output Answer": [ - "${}$" - ], - "Output Program": [ - "import math\n\nfst = set((7*math.sqrt(2), -math.e, 7,))\nsnd = set((7*math.sqrt(2), -(20/3), -8, -math.e, 7, -4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{23}{4}, -\\frac{16}{e}, -2, -8, \\sqrt{5}, 2}$.", - "Output Answer": [ - "$-\\frac{31}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(23/4), -(16/math.e), -2, -8, math.sqrt(5), 2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -5, 5, 5, 0, 0, 5, 5, 0, 5, 0, 0, 5, 5, 0, 0, 0, 0, 5, 5, -5, 1, -5, -5, 5, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -5, 5, 5, 0, 0, 5, 5, 0, 5, 0, 0, 5, 5, 0, 0, 0, 0, 5, 5, -5, 1, -5, -5, 5, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-7, 0, -9, -\\sqrt{3}, 7, \\frac{48}{5}, 4., -4.35} \\setminus {-4.35, -\\frac{19}{3}, \\sqrt{3}, 0, 3 \\sqrt{3}, 4.}$.\n", - "Output Answer": [ - "${-9, -7, -\\sqrt{3}, 7, \\frac{48}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7, 0, -9, -math.sqrt(3), 7, (48/5), 4., -4.35,))\nsnd = set((-4.35, -(19/3), math.sqrt(3), 0, 3*math.sqrt(3), 4.,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8.65, 6, -6, 8, 7, \\frac{1}{\\sqrt{5}}, 14 \\log (2)}$.\n", - "Output Answer": [ - "${-8.65, -6, \\frac{1}{\\sqrt{5}}, 6, 7, 8, 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -8.65, 6, -6, 8, 7, (1/(math.sqrt(5))), 14*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${9, 4, -0.7, 7, 3 \\sqrt{3}, -10, -3, 0, -9, -\\frac{41}{5}} \\cup {-2, \\frac{11}{4}, 4 \\sqrt{3}, -3, -\\frac{41}{5}, -2 \\sqrt{3}, 2, 7, 9, 0}$.\n", - "Output Answer": [ - "${-10, -9, -\\frac{41}{5}, -2 \\sqrt{3}, -3, -2, -0.7, 0, 2, \\frac{11}{4}, 4, 3 \\sqrt{3}, 4 \\sqrt{3}, 7, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 4, -0.7, 7, 3*math.sqrt(3), -10, -3, 0, -9, -(41/5),))\nsnd = set((-2, (11/4), 4*math.sqrt(3), -3, -(41/5), -2*math.sqrt(3), 2, 7, 9, 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-10, -9, 3 e, -2, 4, -\\frac{25}{e}, 0, -3, -8, 8}$.", - "Output Answer": [ - "$-\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, -9, 3*math.e, -2, 4, -(25/math.e), 0, -3, -8, 8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.097,0.035,0.121,0.226,0.044,0.041,0.116,0.13,0.072\\}$ and $\\{0.244,0.166,0.06,0.053,0.119,0.038,0.181,0.043,0.052\\}$.", - "Output Answer": [ - "$0.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.097, 0.035, 0.121, 0.226, 0.044, 0.041, 0.116, 0.13, 0.072\ndistribution2 = 0.244, 0.166, 0.06, 0.053, 0.119, 0.038, 0.181, 0.043, 0.052\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, -6.624, -4, 0, -\\frac{13}{\\sqrt{5}}, 8}$.\n", - "Output Answer": [ - "${-6.624, -\\frac{13}{\\sqrt{5}}, -4, 0, 8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -6.624, -4, 0, -(13/(math.sqrt(5))), 8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, 12, -10, 5, 10}$.\n", - "Output Answer": [ - "$8 \\sqrt{\\frac{11}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 12, -10, 5, 10\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, 19, 10, 12}$.\n", - "Output Answer": [ - "$\\frac{31920}{2453}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, 19, 10, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0.9, \\frac{9}{2}, -6, 0} \\setminus {-\\sqrt{3}, -2., -3, -\\frac{7}{4}, -\\frac{26}{3}}$.\n", - "Output Answer": [ - "${-6, 0, 0.9, \\frac{9}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0.9, (9/2), -6, 0,))\nsnd = set((-math.sqrt(3), -2., -3, -(7/4), -(26/3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, 3, -4 \\sqrt{5}, -e, -6, 1, -8, -2, -8, 4}$.\n", - "Output Answer": [ - "$4+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 3, -4*math.sqrt(5), -math.e, -6, 1, -8, -2, -8, 4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -2, 9}$.\n", - "Output Answer": [ - "$37$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -2, 9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-2, -216, -8, 1, -1, -1000}$.\n", - "Output Answer": [ - "$2 \\sqrt[6]{-1} 2^{2/3} \\sqrt{15}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -216, -8, 1, -1, -1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, -4, \\frac{13}{3}, 4, 10, \\frac{6}{5}} \\cup {10, \\frac{3}{5}, -4, -9, -2, \\frac{13}{3}}$.\n", - "Output Answer": [ - "${-9, -4, -2, \\frac{3}{5}, \\frac{6}{5}, 4, \\frac{13}{3}, 10}$" - ], - "Output Program": [ - "fst = set((-9, -4, (13/3), 4, 10, (6/5),))\nsnd = set((10, (3/5), -4, -9, -2, (13/3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -\\frac{12}{\\sqrt{\\pi }}, \\frac{46}{5}, -8, -\\frac{39}{5}, -9}$.\n", - "Output Answer": [ - "$\\frac{91}{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -(12/(math.sqrt(math.pi))), (46/5), -8, -(39/5), -9\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.225,0.186,0.1,0.338\\}$ and $\\{0.275,0.148,0.401,0.091\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.225, 0.186, 0.1, 0.338\ndistribution2 = 0.275, 0.148, 0.401, 0.091\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-1, \\frac{14}{\\pi }, -2 \\sqrt{5}, 10, 2, -1, -9, 2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, -2 \\sqrt{5}, -1, -1, 2, 2 \\sqrt{3}, \\frac{14}{\\pi }, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, (14/math.pi), -2*math.sqrt(5), 10, 2, -1, -9, 2*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, 8, 0, 0.53, -4} \\setminus {-4, 0, -3, 2}$.\n", - "Output Answer": [ - "${0.53, 8}$" - ], - "Output Program": [ - "fst = set((2, 8, 0, 0.53, -4,))\nsnd = set((-4, 0, -3, 2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-14 \\log (2), 8 \\log (2), 9 \\log (2), -8 \\log (2), -14 \\log (2), 9 \\log (2), 0, -8 \\log (2), -14 \\log (2), -14 \\log (2), -14 \\log (2), 8 \\log (2), 0, 8 \\log (2), 0, -8 \\log (2), -8 \\log (2), 0, 8 \\log (2), -14 \\log (2), 9 \\log (2), 9 \\log (2), 0, -8 \\log (2), 9 \\log (2), -14 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-14 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -14*math.log(2), 8*math.log(2), 9*math.log(2), -8*math.log(2), -14*math.log(2), 9*math.log(2), 0, -8*math.log(2), -14*math.log(2), -14*math.log(2), -14*math.log(2), 8*math.log(2), 0, 8*math.log(2), 0, -8*math.log(2), -8*math.log(2), 0, 8*math.log(2), -14*math.log(2), 9*math.log(2), 9*math.log(2), 0, -8*math.log(2), 9*math.log(2), -14*math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, 3, 2, -15, 8}$.\n", - "Output Answer": [ - "$\\frac{1017}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, 3, 2, -15, 8\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.113,0.107,0.111,0.051,0.249,0.186\\}$ and $\\{0.281,0.132,0.089,0.129,0.101,0.245\\}$.", - "Output Answer": [ - "$0.21$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.113, 0.107, 0.111, 0.051, 0.249, 0.186\ndistribution2 = 0.281, 0.132, 0.089, 0.129, 0.101, 0.245\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 7, 0, 7, 4, 7, 5, 5, 5, 5, 7, 0, 0, 7, 0, 5, 5, 7, 0, 0, 4, 0, 0, 4, 7, 5, 4}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 7, 0, 7, 4, 7, 5, 5, 5, 5, 7, 0, 0, 7, 0, 5, 5, 7, 0, 0, 4, 0, 0, 4, 7, 5, 4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, -2, -4, \\frac{8}{\\sqrt{3}}, -5, \\frac{23}{7}, 2 \\log (2)} \\cup {\\frac{9}{\\sqrt{2}}, 0, -4, 6, 2 \\log (2), -2, \\sqrt{3}, -\\frac{47}{7}, -5}$.\n", - "Output Answer": [ - "${-\\frac{47}{7}, -5, -4, -2, 0, 2 \\log (2), \\sqrt{3}, \\frac{23}{7}, \\frac{8}{\\sqrt{3}}, 6, \\frac{9}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -2, -4, (8/(math.sqrt(3))), -5, (23/7), 2*math.log(2),))\nsnd = set(((9/(math.sqrt(2))), 0, -4, 6, 2*math.log(2), -2, math.sqrt(3), -(47/7), -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.084,0.12,0.199,0.131,0.111,0.023,0.124,0.022,0.06,0.043\\}$ and $\\{0.122,0.097,0.018,0.063,0.12,0.139,0.133,0.026,0.044,0.059\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.084, 0.12, 0.199, 0.131, 0.111, 0.023, 0.124, 0.022, 0.06, 0.043\ndistribution2 = 0.122, 0.097, 0.018, 0.063, 0.12, 0.139, 0.133, 0.026, 0.044, 0.059\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${7, 6, -9}$.\n", - "Output Answer": [ - "${-9, 6, 7}$" - ], - "Output Program": [ - "values = 7, 6, -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{3}, \\sqrt{2}, -3 \\sqrt{2}, -1, -5 \\sqrt{2}, 3} \\setminus {3, -7, -5 \\sqrt{2}, 2 \\sqrt{3}, -8, -1}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(3), math.sqrt(2), -3*math.sqrt(2), -1, -5*math.sqrt(2), 3,))\nsnd = set((3, -7, -5*math.sqrt(2), 2*math.sqrt(3), -8, -1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, 25, 81, 2}$.\n", - "Output Answer": [ - "$3 \\sqrt[4]{-2} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, 25, 81, 2\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, 7, -7, -4, 10, -7, 1, -6}$.\n", - "Output Answer": [ - "$-\\frac{1}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, 7, -7, -4, 10, -7, 1, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, 81, 5, -4}$.\n", - "Output Answer": [ - "$6 \\sqrt[4]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 81, 5, -4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2 e, -5 \\sqrt{3}, 3, 0, -8, 6 \\sqrt{2}, 1, -6}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -8, -6, 0, 1, 3, 2 e, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, -5*math.sqrt(3), 3, 0, -8, 6*math.sqrt(2), 1, -6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${9, \\sqrt{5}, 0, -7, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, math.sqrt(5), 0, -7, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{14}{\\pi }, -3, 8, 5}$.\n", - "Output Answer": [ - "${-3, \\frac{14}{\\pi }, 5, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = (14/math.pi), -3, 8, 5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^2+0.2 x+2.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.8]\n", - "Output Answer": [ - "$-3.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.8)\nprint(E(-1.9*x**2+0.2*x+2.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${10 \\log (2), 9, 10, -1, \\frac{22}{3}, -\\frac{2}{\\sqrt{5}}, \\frac{17}{3}, -6, -\\frac{3}{4}, -4, -\\frac{17}{7}}$.", - "Output Answer": [ - "$-\\frac{3}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 10*math.log(2), 9, 10, -1, (22/3), -(2/(math.sqrt(5))), (17/3), -6, -(3/4), -4, -(17/7)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -3 \\sqrt{5}, 5 \\sqrt{3}, 1, 5}$.\n", - "Output Answer": [ - "$9+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -3*math.sqrt(5), 5*math.sqrt(3), 1, 5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $2.8 x+0.7 < -2.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.].", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(P((2.8*x+0.7 < -2.6)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x^3-0.4 x^2-3.7 x-4.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.]\n", - "Output Answer": [ - "$-5.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.)\nprint(E(-4.1*x**3-0.4*x**2-3.7*x-4.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 11, 7, 12}$.\n", - "Output Answer": [ - "$\\frac{18480}{1927}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 11, 7, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -6, 3, 11, -15, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{2194}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -6, 3, 11, -15, 15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-8, 10, -2, 8}$.\n", - "Output Answer": [ - "$72$" - ], - "Output Program": [ - "import statistics\n\nvalues = -8, 10, -2, 8\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, -14, 7}$.\n", - "Output Answer": [ - "$\\frac{571}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -14, 7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, 12}$.\n", - "Output Answer": [ - "$162$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, 12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${7, -4 \\sqrt{5}, 1, \\frac{39}{4}, 10, -4, -\\frac{4}{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -4, -\\frac{4}{5}, 1, 7, \\frac{39}{4}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -4*math.sqrt(5), 1, (39/4), 10, -4, -(4/5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.101,0.051,0.216,0.096,0.088,0.091,0.067,0.15,0.026\\}$ and $\\{0.173,0.115,0.166,0.051,0.09,0.075,0.12,0.069,0.072\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.101, 0.051, 0.216, 0.096, 0.088, 0.091, 0.067, 0.15, 0.026\ndistribution2 = 0.173, 0.115, 0.166, 0.051, 0.09, 0.075, 0.12, 0.069, 0.072\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${6, -\\frac{5}{2}, 2 e, -4, 4, -6, -2 \\log (2), -9, -1, -3 \\sqrt{3}} \\cup {2, 6, -8, -\\frac{5}{2}, 5 \\sqrt{3}, -2 \\log (2), -9, 8, 2 e}$.\n", - "Output Answer": [ - "${-9, -8, -6, -3 \\sqrt{3}, -4, -\\frac{5}{2}, -2 \\log (2), -1, 2, 4, 2 e, 6, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -(5/2), 2*math.e, -4, 4, -6, -2*math.log(2), -9, -1, -3*math.sqrt(3),))\nsnd = set((2, 6, -8, -(5/2), 5*math.sqrt(3), -2*math.log(2), -9, 8, 2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2 e, \\frac{11}{2}, -9.3} \\setminus {-\\frac{37}{7}, -9.3, 0}$.\n", - "Output Answer": [ - "${-2 e, \\frac{11}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.e, (11/2), -9.3,))\nsnd = set((-(37/7), -9.3, 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{9}{5}, -1, \\frac{13}{\\pi }, -\\frac{7}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{3}}, -1, \\frac{9}{5}, \\frac{13}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/5), -1, (13/math.pi), -(7/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{18}{e}, \\frac{12}{e}}$.\n", - "Output Answer": [ - "$\\frac{15}{e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (18/math.e), (12/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{3}{2}, 1, \\frac{7}{\\pi }, -4.4, -\\frac{9}{4}, -5, -8.8, -6} \\cup {4.1, \\frac{29}{4}, -1, -\\frac{1}{\\pi }, -2, -4.4, 1}$.\n", - "Output Answer": [ - "${-8.8, -6, -5, -4.4, -\\frac{9}{4}, -2, -\\frac{3}{2}, -1, -\\frac{1}{\\pi }, 1, \\frac{7}{\\pi }, 4.1, \\frac{29}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(3/2), 1, (7/math.pi), -4.4, -(9/4), -5, -8.8, -6,))\nsnd = set((4.1, (29/4), -1, -(1/math.pi), -2, -4.4, 1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -3, 9, 3, 8, 10}$.\n", - "Output Answer": [ - "$\\frac{19}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -3, 9, 3, 8, 10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 4, 1}$.\n", - "Output Answer": [ - "$\\frac{36}{17}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 4, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3.2, 8, 3 \\sqrt{2}} \\cup {3.2, 3 \\sqrt{2}, -5}$.\n", - "Output Answer": [ - "${-5, 3.2, 3 \\sqrt{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((3.2, 8, 3*math.sqrt(2),))\nsnd = set((3.2, 3*math.sqrt(2), -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{10 \\sqrt{2}}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{7}{\\sqrt{\\pi }}, 4, 0, -2, \\frac{5}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "import math\n\nvalues = (7/(math.sqrt(math.pi))), 4, 0, -2, (5/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3.78, -9, \\frac{13}{3}, 0, -\\frac{27}{5}} \\cup {-9, 0, -\\frac{46}{5}, -2.67, \\frac{13}{3}}$.\n", - "Output Answer": [ - "${-\\frac{46}{5}, -9, -\\frac{27}{5}, -3.78, -2.67, 0, \\frac{13}{3}}$" - ], - "Output Program": [ - "fst = set((-3.78, -9, (13/3), 0, -(27/5),))\nsnd = set((-9, 0, -(46/5), -2.67, (13/3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.177,0.344,0.464\\}$ and $\\{0.279,0.435,0.116\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.177, 0.344, 0.464\ndistribution2 = 0.279, 0.435, 0.116\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, -1, 4096, 1, -7, 8}$.\n", - "Output Answer": [ - "$4 \\sqrt{2} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -1, 4096, 1, -7, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-3.1, -\\frac{19}{\\pi }, -9, 0, -3, 8}$.\n", - "Output Answer": [ - "${-9, -\\frac{19}{\\pi }, -3.1, -3, 0, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -3.1, -(19/math.pi), -9, 0, -3, 8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, -4 \\sqrt{5}, \\frac{18}{\\sqrt{5}}, -5, 6, -\\frac{61}{7}, 13 \\log (2), -1, -7, \\frac{3}{e}, -8, -3 \\pi, -\\frac{14}{3}}$.\n", - "Output Answer": [ - "$3 \\pi +13 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -4*math.sqrt(5), (18/(math.sqrt(5))), -5, 6, -(61/7), 13*math.log(2), -1, -7, (3/math.e), -8, -3*math.pi, -(14/3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, \\frac{19}{e}, -9, 8, \\sqrt{2}, 2}$.\n", - "Output Answer": [ - "${-9, \\sqrt{2}, 2, 6, \\frac{19}{e}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (19/math.e), -9, 8, math.sqrt(2), 2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.6 x-1.5$ where $x \\sim $ \\text{PoissonDistribution}[3.9]\n", - "Output Answer": [ - "$-11.64$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.9)\nprint(E(-2.6*x-1.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-7, \\frac{24}{e}, -\\frac{24}{e}, \\frac{29}{5}, 7, 0, \\frac{14}{3}, -4, -\\pi, 1, 8, \\frac{26}{\\pi }, -6}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, (24/math.e), -(24/math.e), (29/5), 7, 0, (14/3), -4, -math.pi, 1, 8, (26/math.pi), -6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -\\frac{13}{\\sqrt{3}}, 4, 6, 2 \\sqrt{5}, \\frac{14}{\\pi }, -4, -5, 10, -8, 5, -\\frac{11}{7}, 6}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -(13/(math.sqrt(3))), 4, 6, 2*math.sqrt(5), (14/math.pi), -4, -5, 10, -8, 5, -(11/7), 6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${11, 9, 14, 11}$.\n", - "Output Answer": [ - "$\\frac{5544}{505}$" - ], - "Output Program": [ - "import statistics\nvalues = 11, 9, 14, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.057,0.17,0.113,0.158,0.062,0.074,0.063,0.061,0.14\\}$ and $\\{0.038,0.104,0.238,0.215,0.033,0.127,0.088,0.033,0.071\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.057, 0.17, 0.113, 0.158, 0.062, 0.074, 0.063, 0.061, 0.14\ndistribution2 = 0.038, 0.104, 0.238, 0.215, 0.033, 0.127, 0.088, 0.033, 0.071\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\sqrt{3}, -\\frac{39}{4}, 9}$.", - "Output Answer": [ - "$-\\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -math.sqrt(3), -(39/4), 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${7, \\frac{3}{\\sqrt{2}}, -3.8, 10, \\sqrt{5}, 3.43, -9, -4, 8} \\setminus {6, -3.8, 3.43, 0, \\frac{3}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-9, -4, \\sqrt{5}, 7, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, (3/(math.sqrt(2))), -3.8, 10, math.sqrt(5), 3.43, -9, -4, 8,))\nsnd = set((6, -3.8, 3.43, 0, (3/(math.sqrt(2))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, -15}$.\n", - "Output Answer": [ - "$\\frac{169}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, -15\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2, 1, -4, -\\frac{16}{3}}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 1, -4, -(16/3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\log (2), -\\frac{13}{\\sqrt{2}}, 0, 4 \\sqrt{2}, 8, 3 \\sqrt{3}, 2} \\cup {-6, -\\log (2), -5, 3 \\sqrt{3}, \\frac{11}{\\sqrt{2}}, 4 \\sqrt{2}, 8, 1, 5}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -6, -5, -\\log (2), 0, 1, 2, 5, 3 \\sqrt{3}, 4 \\sqrt{2}, \\frac{11}{\\sqrt{2}}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.log(2), -(13/(math.sqrt(2))), 0, 4*math.sqrt(2), 8, 3*math.sqrt(3), 2,))\nsnd = set((-6, -math.log(2), -5, 3*math.sqrt(3), (11/(math.sqrt(2))), 4*math.sqrt(2), 8, 1, 5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, \\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -4*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.1 x^2+0.6 x-5.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-6.51$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(-2.1*x**2+0.6*x-5.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.121,0.277,0.132\\}$ and $\\{0.083,0.157,0.275\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.121, 0.277, 0.132\ndistribution2 = 0.083, 0.157, 0.275\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, \\frac{47}{7}, -3 \\sqrt{3}, -6 \\sqrt{2}, -4 e, 4, -8, -\\frac{3}{2}, -3, -\\frac{34}{7}, 2, -\\frac{24}{\\pi }, 0}$.\n", - "Output Answer": [ - "$\\frac{47}{7}+4 e$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (47/7), -3*math.sqrt(3), -6*math.sqrt(2), -4*math.e, 4, -8, -(3/2), -3, -(34/7), 2, -(24/math.pi), 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{22}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, \\sqrt{5}, \\frac{7}{\\sqrt{5}}, \\frac{17}{\\sqrt{5}}, \\frac{9}{\\sqrt{5}}, -\\frac{1}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{7} \\left(\\frac{42}{\\sqrt{5}}+\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (22/(math.sqrt(5))), -(12/(math.sqrt(5))), math.sqrt(5), (7/(math.sqrt(5))), (17/(math.sqrt(5))), (9/(math.sqrt(5))), -(1/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${512, 25, 16}$.\n", - "Output Answer": [ - "$16 \\sqrt[3]{2} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 512, 25, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{11}{\\sqrt{2}}, 4 \\sqrt{3}, 10, \\frac{1}{\\sqrt{5}}, -3 \\sqrt{5}, 3, -4 \\log (2)}$.\n", - "Output Answer": [ - "$10+3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = (11/(math.sqrt(2))), 4*math.sqrt(3), 10, (1/(math.sqrt(5))), -3*math.sqrt(5), 3, -4*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.057,0.133,0.06,0.32,0.136,0.011,0.084,0.047,0.035,0.062\\}$ and $\\{0.095,0.125,0.056,0.127,0.058,0.149,0.117,0.048,0.111,0.093\\}$.", - "Output Answer": [ - "$0.32$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.057, 0.133, 0.06, 0.32, 0.136, 0.011, 0.084, 0.047, 0.035, 0.062\ndistribution2 = 0.095, 0.125, 0.056, 0.127, 0.058, 0.149, 0.117, 0.048, 0.111, 0.093\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4, 8, -1, -5, -6, 5, -9, 3, -3} \\cap {10, -5, 7, -7, 8, 1, -8, 2, -1}$.\n", - "Output Answer": [ - "${-5, -1, 8}$" - ], - "Output Program": [ - "fst = set((-4, 8, -1, -5, -6, 5, -9, 3, -3,))\nsnd = set((10, -5, 7, -7, 8, 1, -8, 2, -1,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -1, -4, -9, -9, -4, 3}$.\n", - "Output Answer": [ - "$-\\frac{29}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -1, -4, -9, -9, -4, 3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.272,0.248,0.134,0.246\\}$ and $\\{0.208,0.207,0.231,0.117\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.272, 0.248, 0.134, 0.246\ndistribution2 = 0.208, 0.207, 0.231, 0.117\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{25}{4}, -\\frac{8}{\\sqrt{3}}, 7, -4, -\\frac{17}{\\sqrt{\\pi }}, 7, \\frac{25}{e}}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{\\pi }}, -\\frac{25}{4}, -\\frac{8}{\\sqrt{3}}, -4, 7, 7, \\frac{25}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(25/4), -(8/(math.sqrt(3))), 7, -4, -(17/(math.sqrt(math.pi))), 7, (25/math.e)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, -\\frac{5}{\\sqrt{3}}, 2, \\frac{22}{5}}$.\n", - "Output Answer": [ - "$10+\\frac{5}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -(5/(math.sqrt(3))), 2, (22/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 4, 4, 7, 7, 10, 10, -4, -4, 10, 4, 10, 4, 10, 10, 4, 4, 7, -4, -4, -4, 7, 7, 10, -4, -4, 4, 10}$.\n", - "Output Answer": [ - "$\\{4,10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 4, 4, 7, 7, 10, 10, -4, -4, 10, 4, 10, 4, 10, 10, 4, 4, 7, -4, -4, -4, 7, 7, 10, -4, -4, 4, 10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${8, \\frac{23}{\\pi }, -3}$.\n", - "Output Answer": [ - "${-3, \\frac{23}{\\pi }, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, (23/math.pi), -3\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 1, 8}$.\n", - "Output Answer": [ - "$\\frac{408}{161}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 1, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.131,0.193,0.145,0.133,0.279\\}$ and $\\{0.001,0.205,0.031,0.137,0.51\\}$.", - "Output Answer": [ - "$0.77$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.131, 0.193, 0.145, 0.133, 0.279\ndistribution2 = 0.001, 0.205, 0.031, 0.137, 0.51\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x+3.7$ where $x \\sim $ \\text{NormalDistribution}[-0.5,2.2]\n", - "Output Answer": [ - "$2.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.5, 2.2)\nprint(E(2.6*x+3.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -7, -3, -7, -7, -7}$.\n", - "Output Answer": [ - "$-\\frac{17}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -7, -3, -7, -7, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{4}{\\sqrt{5}}, -2 \\sqrt{2}, -9, \\frac{9}{\\sqrt{5}}} \\setminus {-2 \\sqrt{2}, \\frac{12}{\\sqrt{5}}, 8, \\frac{9}{\\sqrt{5}}, -9, 0}$.\n", - "Output Answer": [ - "${-\\frac{4}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/(math.sqrt(5))), -2*math.sqrt(2), -9, (9/(math.sqrt(5))),))\nsnd = set((-2*math.sqrt(2), (12/(math.sqrt(5))), 8, (9/(math.sqrt(5))), -9, 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${2, -9, -7, -10, -\\frac{7}{3}, 7, -9, -5 \\sqrt{2}, -2, -11 \\log (2), \\frac{26}{3}, -3 \\sqrt{3}, \\frac{24}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{56}{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -9, -7, -10, -(7/3), 7, -9, -5*math.sqrt(2), -2, -11*math.log(2), (26/3), -3*math.sqrt(3), (24/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 13, 17, 20}$.\n", - "Output Answer": [ - "$\\frac{17680}{5241}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 13, 17, 20\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{27}{\\pi }, -5, 5.2} \\cup {0.8, -5, -\\frac{27}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{27}{\\pi }, -5, 0.8, 5.2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(27/math.pi), -5, 5.2,))\nsnd = set((0.8, -5, -(27/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-1, 9, 5, 5, -3 e, -9, -8, -\\frac{18}{\\sqrt{\\pi }}, \\frac{12}{7}, -\\frac{5}{\\sqrt{3}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-1-\\frac{5}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, 9, 5, 5, -3*math.e, -9, -8, -(18/(math.sqrt(math.pi))), (12/7), -(5/(math.sqrt(3)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, -2 \\sqrt{5}, 3 \\sqrt{5}, -\\sqrt{5}, 3 \\sqrt{5}, 3 \\sqrt{5}, 2 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -2 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}, -2 \\sqrt{5}, -\\sqrt{5}, 3 \\sqrt{5}, -\\sqrt{5}, 3 \\sqrt{5}, 3 \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{5}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), -2*math.sqrt(5), 3*math.sqrt(5), -math.sqrt(5), 3*math.sqrt(5), 3*math.sqrt(5), 2*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -2*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5), -2*math.sqrt(5), -math.sqrt(5), 3*math.sqrt(5), -math.sqrt(5), 3*math.sqrt(5), 3*math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), -math.sqrt(5), -math.sqrt(5), -2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -5, -3, -7, -7, 4, -7, -7, -3, -3, 4, -7, -3, -5, 4, -3, -3, 4, -5, 4, -5, 4, -7, -7, -7, -3, -5, -7, 4, -5}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -5, -3, -7, -7, 4, -7, -7, -3, -3, 4, -7, -3, -5, 4, -3, -3, 4, -5, 4, -5, 4, -7, -7, -7, -3, -5, -7, 4, -5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-4, -6, -3, 0, -10} \\cap {9, 6, 0, -10, -2}$.\n", - "Output Answer": [ - "${-10, 0}$" - ], - "Output Program": [ - "fst = set((-4, -6, -3, 0, -10,))\nsnd = set((9, 6, 0, -10, -2,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -1, 0, -7, -6}$.\n", - "Output Answer": [ - "$-\\frac{19}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -1, 0, -7, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-6, 2, 4, 2 \\sqrt{3}, -4.8, \\frac{18}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-6, -4.8, 2, 2 \\sqrt{3}, 4, \\frac{18}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 2, 4, 2*math.sqrt(3), -4.8, (18/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.029,0.123,0.094,0.014,0.086,0.087,0.11,0.066,0.077,0.244\\}$ and $\\{0.047,0.046,0.143,0.114,0.044,0.09,0.148,0.084,0.031,0.096\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.029, 0.123, 0.094, 0.014, 0.086, 0.087, 0.11, 0.066, 0.077, 0.244\ndistribution2 = 0.047, 0.046, 0.143, 0.114, 0.044, 0.09, 0.148, 0.084, 0.031, 0.096\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2, -5, 6, \\frac{31}{5}, 2, -\\pi, 2 \\pi}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2, -5, 6, (31/5), 2, -math.pi, 2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3, 9, -4 \\log (2), \\frac{15}{e}, -2, -4 \\sqrt{2}, 2 e, -\\frac{14}{3}, 5 \\sqrt{3}, 2 \\pi} \\cup {5 \\sqrt{3}, \\frac{11}{e}, 2 \\pi, -1, 2 \\sqrt{2}, 9, 3 e, 5, 3}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -\\frac{14}{3}, -4 \\log (2), -2, -1, 2 \\sqrt{2}, 3, \\frac{11}{e}, 5, 2 e, \\frac{15}{e}, 2 \\pi, 3 e, 5 \\sqrt{3}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 9, -4*math.log(2), (15/math.e), -2, -4*math.sqrt(2), 2*math.e, -(14/3), 5*math.sqrt(3), 2*math.pi,))\nsnd = set((5*math.sqrt(3), (11/math.e), 2*math.pi, -1, 2*math.sqrt(2), 9, 3*math.e, 5, 3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.168,0.069,0.13,0.098,0.073,0.089,0.208,0.097\\}$ and $\\{0.094,0.154,0.104,0.127,0.099,0.141,0.132,0.036\\}$.", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.168, 0.069, 0.13, 0.098, 0.073, 0.089, 0.208, 0.097\ndistribution2 = 0.094, 0.154, 0.104, 0.127, 0.099, 0.141, 0.132, 0.036\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{8}{5}, 7, 6, e, -\\frac{15}{7}, 6, -\\frac{28}{\\pi }, -8, \\frac{21}{\\sqrt{5}}, -10 \\log (2), -7}$.", - "Output Answer": [ - "$\\frac{8}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (8/5), 7, 6, math.e, -(15/7), 6, -(28/math.pi), -8, (21/(math.sqrt(5))), -10*math.log(2), -7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-11, 13, 5, 12, -12}$.\n", - "Output Answer": [ - "$\\frac{1483}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, 13, 5, 12, -12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-5, 9.034, 4 \\sqrt{2}, -9} \\setminus {-6, 4.711, -9, 4 \\sqrt{2}, -7}$.\n", - "Output Answer": [ - "${-5, 9.034}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5, 9.034, 4*math.sqrt(2), -9,))\nsnd = set((-6, 4.711, -9, 4*math.sqrt(2), -7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{14}{\\sqrt{5}}, 3, -\\frac{6}{e}} \\setminus {-3 \\sqrt{5}, 3, -\\frac{4}{\\sqrt{5}}, -3}$.\n", - "Output Answer": [ - "${-\\frac{6}{e}, \\frac{14}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((14/(math.sqrt(5))), 3, -(6/math.e),))\nsnd = set((-3*math.sqrt(5), 3, -(4/(math.sqrt(5))), -3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 10000, 10000, 59049, -4, -32768}$.\n", - "Output Answer": [ - "$240\\ 2^{5/6} 3^{2/3} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 10000, 10000, 59049, -4, -32768\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 8, -1, 6, 10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{35}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 8, -1, 6, 10\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\sqrt{5}, -1, 1} \\setminus {1, -4 \\sqrt{5}, -6, 5, -5.865}$.\n", - "Output Answer": [ - "${-1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(5), -1, 1,))\nsnd = set((1, -4*math.sqrt(5), -6, 5, -5.865,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-6, 1, 100, -7, -1024, 64}$.\n", - "Output Answer": [ - "$8 \\sqrt[6]{-42} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 1, 100, -7, -1024, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, 4, -8, -\\frac{4}{7}, 1, -6, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$8+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 4, -8, -(4/7), 1, -6, 2*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-8, \\frac{8}{3}, 0, 8} \\cup {\\frac{5}{3}, -10, \\frac{8}{3}, -8}$.\n", - "Output Answer": [ - "${-10, -8, 0, \\frac{5}{3}, \\frac{8}{3}, 8}$" - ], - "Output Program": [ - "fst = set((-8, (8/3), 0, 8,))\nsnd = set(((5/3), -10, (8/3), -8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{14}{e}, -\\frac{67}{7}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{67}{7}-\\frac{14}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(14/math.e), -(67/7)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\sqrt{2}, 0, -4 \\sqrt{2}, -4 \\sqrt{2}, -2 \\sqrt{2}, 3 \\sqrt{2}, -2 \\sqrt{2}, 3 \\sqrt{2}, 0, 6 \\sqrt{2}, 3 \\sqrt{2}, 3 \\sqrt{2}, 0, -2 \\sqrt{2}, -2 \\sqrt{2}, -4 \\sqrt{2}, 3 \\sqrt{2}, 3 \\sqrt{2}, -2 \\sqrt{2}, \\sqrt{2}, -2 \\sqrt{2}, -3 \\sqrt{2}, -2 \\sqrt{2}, -2 \\sqrt{2}, -2 \\sqrt{2}, \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-2 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.sqrt(2), 0, -4*math.sqrt(2), -4*math.sqrt(2), -2*math.sqrt(2), 3*math.sqrt(2), -2*math.sqrt(2), 3*math.sqrt(2), 0, 6*math.sqrt(2), 3*math.sqrt(2), 3*math.sqrt(2), 0, -2*math.sqrt(2), -2*math.sqrt(2), -4*math.sqrt(2), 3*math.sqrt(2), 3*math.sqrt(2), -2*math.sqrt(2), math.sqrt(2), -2*math.sqrt(2), -3*math.sqrt(2), -2*math.sqrt(2), -2*math.sqrt(2), -2*math.sqrt(2), math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${9, -5, 6, -3} \\setminus {8, \\frac{3}{\\pi }, -5, \\sqrt{3}, -3, -\\frac{15}{\\sqrt{\\pi }}, -1.4}$.\n", - "Output Answer": [ - "${6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -5, 6, -3,))\nsnd = set((8, (3/math.pi), -5, math.sqrt(3), -3, -(15/(math.sqrt(math.pi))), -1.4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 10, 36}$.\n", - "Output Answer": [ - "$4\\ 3^{2/3} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 10, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 9, 5, 2, 9, 5, 5, 2, -6, 5, -6, 9, -6, -6, 9, -6, -6, 9, 2, 5, 5, 5, -6, 5, -6, -6, 9, 2}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 9, 5, 2, 9, 5, 5, 2, -6, 5, -6, 9, -6, -6, 9, -6, -6, 9, 2, 5, 5, 5, -6, 5, -6, -6, 9, 2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, 6, -15, 5, -12, 11}$.\n", - "Output Answer": [ - "$3 \\sqrt{\\frac{123}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 6, -15, 5, -12, 11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${0, 2, -3, -7, -8, 6, 3, -6} \\cap {0, -9, -5, -8, 1, -2, 6, -4, -3}$.\n", - "Output Answer": [ - "${-8, -3, 0, 6}$" - ], - "Output Program": [ - "fst = set((0, 2, -3, -7, -8, 6, 3, -6,))\nsnd = set((0, -9, -5, -8, 1, -2, 6, -4, -3,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{6}{\\pi }, 9, 0}$.\n", - "Output Answer": [ - "${-\\frac{6}{\\pi }, 0, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -(6/math.pi), 9, 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-10, 1, -6, -2, 9, -7, 6, \\sqrt{3}} \\cup {4, \\sqrt{3}, 0, -4, -10, 1, \\frac{3}{\\sqrt{2}}, 9, 2}$.\n", - "Output Answer": [ - "${-10, -7, -6, -4, -2, 0, 1, \\sqrt{3}, 2, \\frac{3}{\\sqrt{2}}, 4, 6, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, 1, -6, -2, 9, -7, 6, math.sqrt(3),))\nsnd = set((4, math.sqrt(3), 0, -4, -10, 1, (3/(math.sqrt(2))), 9, 2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-5, 5 \\sqrt{2}, 4, -5, -4, -5, 8 \\log (2), 8, -7, 6}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, 5*math.sqrt(2), 4, -5, -4, -5, 8*math.log(2), 8, -7, 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, 3, 7, 10, 7, -11}$.\n", - "Output Answer": [ - "$\\frac{1661}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 3, 7, 10, 7, -11\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, 125, -1}$.\n", - "Output Answer": [ - "$5 \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 125, -1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, -9, -10, -12, 11}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{897}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -9, -10, -12, 11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 4, -2}$.\n", - "Output Answer": [ - "$\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 4, -2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{17}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{17}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (17/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x+0.5$ where $x \\sim $ \\text{ExponentialDistribution}[0.5]\n", - "Output Answer": [ - "$6.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.5)\nprint(E(2.8*x+0.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -5, 5, 5, 5, 9, -5, 5, -6, 2, -2, -5, 5, 9, -2, -6, -5, 9, 0, 2, -5, 2, -5}$.\n", - "Output Answer": [ - "$\\{-5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -5, 5, 5, 5, 9, -5, 5, -6, 2, -2, -5, 5, 9, -2, -6, -5, 9, 0, 2, -5, 2, -5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, -\\frac{4}{\\sqrt{5}}, \\frac{11}{\\sqrt{2}}, -\\sqrt{5}, -3}$.\n", - "Output Answer": [ - "$3+\\frac{11}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2, -(4/(math.sqrt(5))), (11/(math.sqrt(2))), -math.sqrt(5), -3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, -7, 256, 16807, 1000000, 64}$.\n", - "Output Answer": [ - "$560 \\sqrt[6]{-1} \\sqrt[3]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, -7, 256, 16807, 1000000, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 6, 6, 6, \\frac{13}{2}, -\\frac{19}{2}, 6, -\\frac{7}{2}, 10, 10, \\frac{13}{2}, -\\frac{7}{2}, 10, -\\frac{7}{2}, -\\frac{19}{2}, -\\frac{19}{2}, -\\frac{19}{2}, 6, 6, 6, -\\frac{19}{2}, 10, -\\frac{19}{2}, 6, 6, 10, 6, 6, 10, -\\frac{7}{2}}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 6, 6, 6, (13/2), -(19/2), 6, -(7/2), 10, 10, (13/2), -(7/2), 10, -(7/2), -(19/2), -(19/2), -(19/2), 6, 6, 6, -(19/2), 10, -(19/2), 6, 6, 10, 6, 6, 10, -(7/2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${5, 3, 9, -10, 1, -2, -8} \\cap {9, 3, 1, -8, 4, 5, -7, -10}$.\n", - "Output Answer": [ - "${-10, -8, 1, 3, 5, 9}$" - ], - "Output Program": [ - "fst = set((5, 3, 9, -10, 1, -2, -8,))\nsnd = set((9, 3, 1, -8, 4, 5, -7, -10,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-9.14, -5, 9, 0, \\frac{3}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-9.14, -5, 0, \\frac{3}{\\sqrt{5}}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -9.14, -5, 9, 0, (3/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, 5, 5, -2}$.\n", - "Output Answer": [ - "$11$" - ], - "Output Program": [ - "values = 9, 5, 5, -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.072,0.096,0.114,0.173,0.067,0.065,0.08,0.168,0.052\\}$ and $\\{0.252,0.041,0.215,0.071,0.086,0.147,0.013,0.074,0.076\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.072, 0.096, 0.114, 0.173, 0.067, 0.065, 0.08, 0.168, 0.052\ndistribution2 = 0.252, 0.041, 0.215, 0.071, 0.086, 0.147, 0.013, 0.074, 0.076\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4096, 4096, 100000, 216, 32}$.\n", - "Output Answer": [ - "$640\\ 2^{2/5} 3^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4096, 4096, 100000, 216, 32\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{20}{\\pi }, -e, \\frac{19}{\\sqrt{5}}, -5, -5, -6, -9, \\frac{37}{5}, 7}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(20/math.pi), -math.e, (19/(math.sqrt(5))), -5, -5, -6, -9, (37/5), 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{13}{\\sqrt{2}}, 4 \\sqrt{2}, \\frac{5}{\\sqrt{2}}, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "$-\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(13/(math.sqrt(2))), 4*math.sqrt(2), (5/(math.sqrt(2))), -6*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{22}{3}, -9, 5, -4.4, -2 \\sqrt{3}} \\setminus {3, -2, -1, \\frac{19}{e}, -4.4, \\frac{22}{3}, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set(((22/3), -9, 5, -4.4, -2*math.sqrt(3),))\nsnd = set((3, -2, -1, (19/math.e), -4.4, (22/3), -2*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, -4, \\frac{4}{\\pi }, -\\frac{7}{\\sqrt{5}}, -3 e, -3, \\sqrt{2}, -\\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-3-\\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, -4, (4/math.pi), -(7/(math.sqrt(5))), -3*math.e, -3, math.sqrt(2), -math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{5}, -5, \\frac{13}{2}, -4, 7, 1, -\\frac{1}{\\sqrt{2}}, \\frac{12}{e}, -8}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), -5, (13/2), -4, 7, 1, -(1/(math.sqrt(2))), (12/math.e), -8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $0.52 < 4.8 x-1.9 < 3.04$ where $x \\sim $ \\text{PoissonDistribution}[1.1].", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.1)\nprint(P((0.52 < 4.8*x-1.9) & (4.8*x-1.9 < 3.04)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{7}{4}, 3, -\\frac{17}{2}, 7, -\\frac{3}{\\sqrt{2}}, -\\frac{8}{\\sqrt{\\pi }}, 7, -4 \\sqrt{5}, 5, 1, -\\frac{17}{\\sqrt{3}}, -\\frac{3}{\\sqrt{2}}, -3}$.", - "Output Answer": [ - "$-\\frac{3}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(7/4), 3, -(17/2), 7, -(3/(math.sqrt(2))), -(8/(math.sqrt(math.pi))), 7, -4*math.sqrt(5), 5, 1, -(17/(math.sqrt(3))), -(3/(math.sqrt(2))), -3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-2, 1, 1, -5}$.\n", - "Output Answer": [ - "$\\frac{33}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -2, 1, 1, -5\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3, 5, -9, -\\frac{3}{\\sqrt{2}}, 9, -6, 1.91} \\cup {0, 5, 7, -\\frac{3}{5}, -7, 8, -10, -\\frac{3}{\\sqrt{2}}, 3}$.\n", - "Output Answer": [ - "${-10, -9, -7, -6, -\\frac{3}{\\sqrt{2}}, -\\frac{3}{5}, 0, 1.91, 3, 5, 7, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 5, -9, -(3/(math.sqrt(2))), 9, -6, 1.91,))\nsnd = set((0, 5, 7, -(3/5), -7, 8, -10, -(3/(math.sqrt(2))), 3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{2}, -4, -6 \\sqrt{3}, \\frac{25}{e}, 5, 1}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(2), -4, -6*math.sqrt(3), (25/math.e), 5, 1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10, -4, -7, 3, 3, 3, 10, 1, -7, 1, 10, 10, 3, 10, 1, -4, 3, -8, 3, -8, 10, 1, 10, -8, -8}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 10, -4, -7, 3, 3, 3, 10, 1, -7, 1, 10, 10, 3, 10, 1, -4, 3, -8, 3, -8, 10, 1, 10, -8, -8\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\pi, -\\frac{10}{\\pi }, 5, -6, -7 \\sqrt{2}}$.", - "Output Answer": [ - "$-6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.pi, -(10/math.pi), 5, -6, -7*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.285,0.207,0.018,0.03,0.121\\}$ and $\\{0.188,0.089,0.208,0.143,0.174\\}$.", - "Output Answer": [ - "$0.43$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.285, 0.207, 0.018, 0.03, 0.121\ndistribution2 = 0.188, 0.089, 0.208, 0.143, 0.174\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x-1.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.6]\n", - "Output Answer": [ - "$-1.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.6)\nprint(E(2.5*x-1.7))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{13}{\\sqrt{\\pi }}, -2, -\\frac{11}{\\sqrt{\\pi }}, \\frac{12}{e}, \\frac{49}{5}, -7, -1} \\setminus {-2, -7, -\\frac{11}{\\sqrt{\\pi }}, 6, -3 \\pi, -1}$.\n", - "Output Answer": [ - "${\\frac{12}{e}, \\frac{13}{\\sqrt{\\pi }}, \\frac{49}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/(math.sqrt(math.pi))), -2, -(11/(math.sqrt(math.pi))), (12/math.e), (49/5), -7, -1,))\nsnd = set((-2, -7, -(11/(math.sqrt(math.pi))), 6, -3*math.pi, -1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, \\frac{13}{\\pi }, -9, -8, 2, 8, -1, 1, -2, \\frac{40}{7}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 7, (13/math.pi), -9, -8, 2, 8, -1, 1, -2, (40/7)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{12}{e}, \\frac{6}{e}, \\frac{24}{e}, -\\frac{4}{e}, 0}$.\n", - "Output Answer": [ - "$\\frac{38}{5 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (12/math.e), (6/math.e), (24/math.e), -(4/math.e), 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, -2, 5, 6, 6, -6, 6, 5, -6, -6, 6, -6, 6, -2, 6, -6, 5, -2, -6, -2, 6, -6, 6, -2, -6, 5, 6, 6, -6}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, -2, 5, 6, 6, -6, 6, 5, -6, -6, 6, -6, 6, -2, 6, -6, 5, -2, -6, -2, 6, -6, 6, -2, -6, 5, 6, 6, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, 8, -3, -4} \\setminus {8, 4, 4.78, -3, 2, -7}$.\n", - "Output Answer": [ - "${-4}$" - ], - "Output Program": [ - "fst = set((4, 8, -3, -4,))\nsnd = set((8, 4, 4.78, -3, 2, -7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{64}{7}, \\frac{64}{7}, -\\frac{29}{7}, -\\frac{31}{7}, -\\frac{31}{7}, \\frac{64}{7}, -7, -\\frac{31}{7}, -\\frac{31}{7}, 1, -\\frac{31}{7}, -\\frac{31}{7}, -\\frac{61}{7}, -\\frac{31}{7}, -\\frac{61}{7}, -\\frac{61}{7}, \\frac{64}{7}, -\\frac{31}{7}, -\\frac{29}{7}, 1, -\\frac{31}{7}, -\\frac{29}{7}, -\\frac{29}{7}, -7}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{31}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (64/7), (64/7), -(29/7), -(31/7), -(31/7), (64/7), -7, -(31/7), -(31/7), 1, -(31/7), -(31/7), -(61/7), -(31/7), -(61/7), -(61/7), (64/7), -(31/7), -(29/7), 1, -(31/7), -(29/7), -(29/7), -7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${8, 4, 0, 0, -\\frac{17}{\\sqrt{5}}, 7, -13 \\log (2), 2, -3 \\sqrt{2}, 5, -6, e, -11 \\log (2)}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 4, 0, 0, -(17/(math.sqrt(5))), 7, -13*math.log(2), 2, -3*math.sqrt(2), 5, -6, math.e, -11*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${1, 2, -5, 5 \\sqrt{3}, 6}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 2, -5, 5*math.sqrt(3), 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.162,0.278,0.247\\}$ and $\\{0.206,0.133,0.314\\}$.", - "Output Answer": [ - "$0.1$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.162, 0.278, 0.247\ndistribution2 = 0.206, 0.133, 0.314\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{4}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, 0, 0}$.\n", - "Output Answer": [ - "$-\\frac{1}{3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (4/(math.sqrt(3))), (11/(math.sqrt(3))), -(13/(math.sqrt(3))), -(4/(math.sqrt(3))), 0, 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{13}{3}, 8, -4}$.", - "Output Answer": [ - "$\\frac{13}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = (13/3), 8, -4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-8.8, -1, 9.05, \\frac{52}{7}, \\frac{1}{3}, 0} \\setminus {-1, \\frac{1}{3}, 9.05, -6, 1.5, \\frac{52}{7}}$.\n", - "Output Answer": [ - "${-8.8, 0}$" - ], - "Output Program": [ - "fst = set((-8.8, -1, 9.05, (52/7), (1/3), 0,))\nsnd = set((-1, (1/3), 9.05, -6, 1.5, (52/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.2 x^2+4.7 x-3.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.9]\n", - "Output Answer": [ - "$-19.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.9)\nprint(E(-2.2*x**2+4.7*x-3.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, \\frac{23}{2}, 6}$.\n", - "Output Answer": [ - "$\\frac{1035}{122}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, (23/2), 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.265,0.337,0.158\\}$ and $\\{0.249,0.49,0.149\\}$.", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.265, 0.337, 0.158\ndistribution2 = 0.249, 0.49, 0.149\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3 e, -1, 4, -4, 8, -5 \\sqrt{3}, -\\frac{12}{\\sqrt{\\pi }}, -3 \\pi}$.\n", - "Output Answer": [ - "$3 e+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.e, -1, 4, -4, 8, -5*math.sqrt(3), -(12/(math.sqrt(math.pi))), -3*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.127,0.253,0.371,0.051\\}$ and $\\{0.402,0.272,0.06,0.106\\}$.", - "Output Answer": [ - "$0.64$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.127, 0.253, 0.371, 0.051\ndistribution2 = 0.402, 0.272, 0.06, 0.106\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x^3+3.8 x^2-0.8 x+1.1$ where $x \\sim $ \\text{BetaDistribution}[0.7,0.9]\n", - "Output Answer": [ - "$1.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.7, 0.9)\nprint(E(0.4*x**3+3.8*x**2-0.8*x+1.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -6, -1, -7, -4}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "values = -1, -6, -1, -7, -4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-27, 625, 2401, 4}$.\n", - "Output Answer": [ - "$(35+35 i) 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -27, 625, 2401, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 13, 11, \\frac{19}{3}}$.\n", - "Output Answer": [ - "$\\frac{130416}{13337}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 13, 11, (19/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -2, -1}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -2, -1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, 5, 2, -\\frac{2}{\\sqrt{3}}, -3 \\sqrt{5}, \\frac{27}{e}, -3 e, \\frac{7}{\\sqrt{3}}} \\setminus {-3 \\sqrt{5}, \\frac{7}{\\sqrt{3}}, -\\frac{4}{e}, 0, -\\frac{2}{\\sqrt{3}}, 2, 2 e}$.\n", - "Output Answer": [ - "${-3 e, 5, \\frac{27}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 5, 2, -(2/(math.sqrt(3))), -3*math.sqrt(5), (27/math.e), -3*math.e, (7/(math.sqrt(3))),))\nsnd = set((-3*math.sqrt(5), (7/(math.sqrt(3))), -(4/math.e), 0, -(2/(math.sqrt(3))), 2, 2*math.e,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -9, 6, -3, -3, -3, -1, 0, -9, -3, -3, -1, -2, -3, -9, -3, 6, -1, -3, -9, -2, -3, 0}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -9, 6, -3, -3, -3, -1, 0, -9, -3, -3, -1, -2, -3, -9, -3, 6, -1, -3, -9, -2, -3, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 12}$.\n", - "Output Answer": [ - "$\\frac{72}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\sqrt{2}, -3 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, 4 \\sqrt{2}, \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, -3 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, 4 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{\\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.sqrt(2), -3*math.sqrt(2), math.sqrt(2), math.sqrt(2), 4*math.sqrt(2), math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), math.sqrt(2), math.sqrt(2), -3*math.sqrt(2), math.sqrt(2), math.sqrt(2), math.sqrt(2), 4*math.sqrt(2), math.sqrt(2), math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.037,0.041,0.138,0.052,0.105,0.371\\}$ and $\\{0.129,0.142,0.101,0.161,0.258,0.114\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.037, 0.041, 0.138, 0.052, 0.105, 0.371\ndistribution2 = 0.129, 0.142, 0.101, 0.161, 0.258, 0.114\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${7, -1, 12, 14, 7}$.\n", - "Output Answer": [ - "$\\frac{337}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, -1, 12, 14, 7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -7, 0, -4, 0, 1, 1, 1, -4, -5, 0, 1, -7, -4, 3, -4, -7, 1, -4, -5, 1, -4, 1, 0, 1, 0, 0, 3, 0}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -7, 0, -4, 0, 1, 1, 1, -4, -5, 0, 1, -7, -4, 3, -4, -7, 1, -4, -5, 1, -4, 1, 0, 1, 0, 0, 3, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.037,0.267,0.083,0.041,0.124,0.13,0.047,0.022\\}$ and $\\{0.278,0.058,0.111,0.271,0.122,0.009,0.009,0.021,0.078\\}$.", - "Output Answer": [ - "$1.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.037, 0.267, 0.083, 0.041, 0.124, 0.13, 0.047, 0.022\ndistribution2 = 0.278, 0.058, 0.111, 0.271, 0.122, 0.009, 0.009, 0.021, 0.078\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{14}{3}, 8, 5 \\sqrt{2}, -7, 3, -2.9, -\\frac{7}{2}, -\\frac{1}{3}, 6, -6.309} \\cup {3, 8, -\\frac{1}{3}, -7, -6.5, -\\frac{1}{4}, -1, -6.309}$.\n", - "Output Answer": [ - "${-7, -6.5, -6.309, -\\frac{14}{3}, -\\frac{7}{2}, -2.9, -1, -\\frac{1}{3}, -\\frac{1}{4}, 3, 6, 5 \\sqrt{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(14/3), 8, 5*math.sqrt(2), -7, 3, -2.9, -(7/2), -(1/3), 6, -6.309,))\nsnd = set((3, 8, -(1/3), -7, -6.5, -(1/4), -1, -6.309,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 5, -9, -4, -2, 4, -8, 9}$.\n", - "Output Answer": [ - "$\\frac{1}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 5, -9, -4, -2, 4, -8, 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, -\\sqrt{5}, -3 \\sqrt{5}, 4 \\sqrt{5}, -3 \\sqrt{5}, 2 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, 4 \\sqrt{5}, -\\sqrt{5}, 2 \\sqrt{5}, \\sqrt{5}, 2 \\sqrt{5}, -3 \\sqrt{5}, 2 \\sqrt{5}, 4 \\sqrt{5}, 2 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), -math.sqrt(5), -3*math.sqrt(5), 4*math.sqrt(5), -3*math.sqrt(5), 2*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), 4*math.sqrt(5), -math.sqrt(5), 2*math.sqrt(5), math.sqrt(5), 2*math.sqrt(5), -3*math.sqrt(5), 2*math.sqrt(5), 4*math.sqrt(5), 2*math.sqrt(5), 2*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.7 x-0.5$ where $x \\sim $ \\text{NormalDistribution}[0.3,0.7]\n", - "Output Answer": [ - "$-1.61$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.3, 0.7)\nprint(E(-3.7*x-0.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4. x-2.$ where $x \\sim $ \\text{BetaDistribution}[0.3,0.7]\n", - "Output Answer": [ - "$-3.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 0.7)\nprint(E(-4.*x-2.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${8, 1, -\\frac{10}{\\pi }, \\frac{17}{5}, -3, -\\sqrt{2}, 4 \\sqrt{3}, -7, 3, -2 \\sqrt{3}, 2, \\frac{17}{3}, -9, 2, -\\frac{12}{\\sqrt{5}}}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 1, -(10/math.pi), (17/5), -3, -math.sqrt(2), 4*math.sqrt(3), -7, 3, -2*math.sqrt(3), 2, (17/3), -9, 2, -(12/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, 8, 8, -7, 8, -4, 7, -7, -7, -10, -4, -7, 8, 7, 8, 4, 4, 8, -4, -10, -10, 7, 7, 8, -1, 7, -5, 8, -5, -5}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, 8, 8, -7, 8, -4, 7, -7, -7, -10, -4, -7, 8, 7, 8, 4, 4, 8, -4, -10, -10, 7, 7, 8, -1, 7, -5, 8, -5, -5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2 \\pi, -2 e, 6.2, -8, 3, -6, \\frac{9}{5}, -10 \\log (2)} \\cup {-8, -2 e, 9.6, -10 \\log (2), 8, 3}$.\n", - "Output Answer": [ - "${-8, -10 \\log (2), -6, -2 e, \\frac{9}{5}, 3, 6.2, 2 \\pi, 8, 9.6}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.pi, -2*math.e, 6.2, -8, 3, -6, (9/5), -10*math.log(2),))\nsnd = set((-8, -2*math.e, 9.6, -10*math.log(2), 8, 3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{16}{\\sqrt{5}}, \\frac{6}{\\sqrt{5}}, 2 \\sqrt{5}, 2 \\sqrt{5}, -\\frac{4}{\\sqrt{5}}, -\\frac{8}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (16/(math.sqrt(5))), (6/(math.sqrt(5))), 2*math.sqrt(5), 2*math.sqrt(5), -(4/(math.sqrt(5))), -(8/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-3.02 < 2.4 x^2-3.7 x-2. < -0.12$ where $x \\sim $ \\text{NormalDistribution}[-1.4,2.].", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.4, 2.)\nprint(P((-3.02 < 2.4*x**2-3.7*x-2.) & (2.4*x**2-3.7*x-2. < -0.12)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{3}{2}, 19, 13, \\frac{3}{2}}$.\n", - "Output Answer": [ - "$\\frac{741}{271}$" - ], - "Output Program": [ - "import statistics\nvalues = (3/2), 19, 13, (3/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{5}{4}, \\frac{26}{7}, -3} \\setminus {9, \\frac{5}{4}, -\\frac{24}{7}, 0, 8.7}$.\n", - "Output Answer": [ - "${-3, \\frac{26}{7}}$" - ], - "Output Program": [ - "fst = set(((5/4), (26/7), -3,))\nsnd = set((9, (5/4), -(24/7), 0, 8.7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, \\sqrt{2}}$.\n", - "Output Answer": [ - "$3-\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\pi, 2 \\pi, 3 \\pi, -2 \\pi, \\pi, 0, 3 \\pi}$.\n", - "Output Answer": [ - "$\\frac{5 \\pi }{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.pi, 2*math.pi, 3*math.pi, -2*math.pi, math.pi, 0, 3*math.pi\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${7, 531441, -16807, 1, 36, -9}$.\n", - "Output Answer": [ - "$63 \\sqrt[3]{2} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 531441, -16807, 1, 36, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 2401, 1, 16}$.\n", - "Output Answer": [ - "$98$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 2401, 1, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{51}{7}, \\frac{41}{7}, -\\frac{32}{7}, \\frac{48}{7}, -\\frac{3}{7}, \\frac{5}{7}}$.\n", - "Output Answer": [ - "$\\frac{55}{21}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (51/7), (41/7), -(32/7), (48/7), -(3/7), (5/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2 \\sqrt{3}, 3, -1, -\\frac{1}{\\sqrt{3}}, 4 \\sqrt{5}} \\setminus {-\\frac{7}{\\sqrt{2}}, 1, -1, 4 \\sqrt{5}, -\\frac{1}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "${3}$" - ], - "Output Program": [ - "import math\n\nfst = set((2*math.sqrt(3), 3, -1, -(1/(math.sqrt(3))), 4*math.sqrt(5),))\nsnd = set((-(7/(math.sqrt(2))), 1, -1, 4*math.sqrt(5), -(1/(math.sqrt(3))), 2*math.sqrt(3), -(22/math.pi),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\log (2), 10 \\log (2), -3 \\log (2), 10 \\log (2), -3 \\log (2), -14 \\log (2), -3 \\log (2), -3 \\log (2), -3 \\log (2), 9 \\log (2), -3 \\log (2), -3 \\log (2), -14 \\log (2), -14 \\log (2), -3 \\log (2), -3 \\log (2), -14 \\log (2), -3 \\log (2), -14 \\log (2), 10 \\log (2), -3 \\log (2), -14 \\log (2), -14 \\log (2), 10 \\log (2), -3 \\log (2), -3 \\log (2), 9 \\log (2), -14 \\log (2), -3 \\log (2), 10 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-3 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.log(2), 10*math.log(2), -3*math.log(2), 10*math.log(2), -3*math.log(2), -14*math.log(2), -3*math.log(2), -3*math.log(2), -3*math.log(2), 9*math.log(2), -3*math.log(2), -3*math.log(2), -14*math.log(2), -14*math.log(2), -3*math.log(2), -3*math.log(2), -14*math.log(2), -3*math.log(2), -14*math.log(2), 10*math.log(2), -3*math.log(2), -14*math.log(2), -14*math.log(2), 10*math.log(2), -3*math.log(2), -3*math.log(2), 9*math.log(2), -14*math.log(2), -3*math.log(2), 10*math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{13}{2}, -\\frac{13}{2}, 7, 5, -4}$.\n", - "Output Answer": [ - "$\\frac{8}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (13/2), -(13/2), 7, 5, -4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, \\frac{50}{3}, \\frac{28}{3}}$.\n", - "Output Answer": [ - "$\\frac{525}{73}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, (50/3), (28/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5, 1, -10, 6, -\\frac{29}{7}} \\setminus {0, -10}$.\n", - "Output Answer": [ - "${-\\frac{29}{7}, 1, 5, 6}$" - ], - "Output Program": [ - "fst = set((5, 1, -10, 6, -(29/7),))\nsnd = set((0, -10,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, -1, -3125, -1024, -216, -9}$.\n", - "Output Answer": [ - "$4\\ 2^{2/3} 15^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -1, -3125, -1024, -216, -9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2 \\sqrt{2}, -8, -10, 4, -10, 3, \\frac{8}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-10, -10, -8, -2 \\sqrt{2}, 3, 4, \\frac{8}{\\sqrt{\\pi }}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(2), -8, -10, 4, -10, 3, (8/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, -10, 6}$.\n", - "Output Answer": [ - "$3 \\sqrt[3]{-5} 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -10, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 15, 12, -7}$.\n", - "Output Answer": [ - "$\\frac{1315}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 15, 12, -7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{2}, 3, 10, -10, 2.521, 10, -6}$.\n", - "Output Answer": [ - "${-10, -6, \\frac{1}{2}, 2.521, 3, 10, 10}$" - ], - "Output Program": [ - "values = (1/2), 3, 10, -10, 2.521, 10, -6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 20, 3, 4}$.\n", - "Output Answer": [ - "$\\frac{40}{7}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 20, 3, 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, 3, -9 \\log (2), \\frac{39}{5}, -1, \\frac{5}{\\sqrt{2}}, 10, -\\frac{1}{\\sqrt{3}}, \\frac{13}{3}, -4 \\sqrt{2}, \\frac{1}{3}, -3}$.\n", - "Output Answer": [ - "$10+9 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 3, -9*math.log(2), (39/5), -1, (5/(math.sqrt(2))), 10, -(1/(math.sqrt(3))), (13/3), -4*math.sqrt(2), (1/3), -3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-4 \\sqrt{2}, 8, 4, 4, -\\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -\\sqrt{5}, 4, 4, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(2), 8, 4, 4, -math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-6.57, \\log (2), 0, 2} \\cup {-13 \\log (2), 6, 0, -6.57}$.\n", - "Output Answer": [ - "${-13 \\log (2), -6.57, 0, \\log (2), 2, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6.57, math.log(2), 0, 2,))\nsnd = set((-13*math.log(2), 6, 0, -6.57,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.196,0.034,0.072,0.131,0.014,0.065,0.115,0.027,0.106\\}$ and $\\{0.155,0.072,0.16,0.105,0.139,0.145,0.042,0.062,0.068\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.196, 0.034, 0.072, 0.131, 0.014, 0.065, 0.115, 0.027, 0.106\ndistribution2 = 0.155, 0.072, 0.16, 0.105, 0.139, 0.145, 0.042, 0.062, 0.068\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -10, 3, -10, 6, -10, -10, 6, -10, 6, -10, 6, -10, -10, -6, -10, -10, 3, -10, 3, -6, -10, 6}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -10, 3, -10, 6, -10, -10, 6, -10, 6, -10, 6, -10, -10, -6, -10, -10, 3, -10, 3, -6, -10, 6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.048,0.037,0.49,0.132,0.007,0.051,0.021,0.058\\}$ and $\\{0.079,0.096,0.046,0.079,0.273,0.048,0.111,0.115\\}$.", - "Output Answer": [ - "$1.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.048, 0.037, 0.49, 0.132, 0.007, 0.051, 0.021, 0.058\ndistribution2 = 0.079, 0.096, 0.046, 0.079, 0.273, 0.048, 0.111, 0.115\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-1, -10, \\frac{7}{2}, -\\frac{2}{\\sqrt{5}}, -\\frac{46}{5}, -1, -9}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -1, -10, (7/2), -(2/(math.sqrt(5))), -(46/5), -1, -9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2, 6, 3.2}$.\n", - "Output Answer": [ - "${2, 3.2, 6}$" - ], - "Output Program": [ - "values = 2, 6, 3.2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4, 2, -4, \\frac{17}{4}, -\\frac{28}{3}, -\\frac{21}{\\pi }, 5}$.\n", - "Output Answer": [ - "${-\\frac{28}{3}, -\\frac{21}{\\pi }, -4, 2, 4, \\frac{17}{4}, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 2, -4, (17/4), -(28/3), -(21/math.pi), 5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, -3.957} \\cup {2 e, -3.957, 0}$.\n", - "Output Answer": [ - "${-3.957, 0, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -3.957,))\nsnd = set((2*math.e, -3.957, 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, -7, -7, -6, -7, 2, -6, 9, 9, 9, 9, 2, 2, 9, 9, -7, -6, -6, -7, 2, -6, -7, -7, 9, 2, -6, 2}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, -7, -7, -6, -7, 2, -6, 9, 9, 9, 9, 2, 2, 9, 9, -7, -6, -6, -7, 2, -6, -7, -7, 9, 2, -6, 2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.6 x-1.9$ where $x \\sim $ \\text{NormalDistribution}[-1.8,2.2]\n", - "Output Answer": [ - "$-6.58$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.8, 2.2)\nprint(E(2.6*x-1.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-5, \\frac{5}{\\sqrt{3}}, -\\frac{9}{4}, -1, -8, -\\frac{2}{3}, 6}$.\n", - "Output Answer": [ - "${-8, -5, -\\frac{9}{4}, -1, -\\frac{2}{3}, \\frac{5}{\\sqrt{3}}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, (5/(math.sqrt(3))), -(9/4), -1, -8, -(2/3), 6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.7 x^3+1.2 x^2+2.9 x-3.7$ where $x \\sim $ \\text{NormalDistribution}[0.2,0.5]\n", - "Output Answer": [ - "$-2.88$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.2, 0.5)\nprint(E(-0.7*x**3+1.2*x**2+2.9*x-3.7))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${1, 3, 7, 5, -10, -8, -1} \\cap {4, 3, 5, -1, 2, -10}$.\n", - "Output Answer": [ - "${-10, -1, 3, 5}$" - ], - "Output Program": [ - "fst = set((1, 3, 7, 5, -10, -8, -1,))\nsnd = set((4, 3, 5, -1, 2, -10,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2., -6, -4 \\sqrt{3}, \\frac{38}{7}, 4, -4, \\frac{19}{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -6, -4, 2., 4, \\frac{38}{7}, \\frac{19}{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2., -6, -4*math.sqrt(3), (38/7), 4, -4, (19/3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.4 x^2+4.6 x+1.6$ where $x \\sim $ \\text{NormalDistribution}[0.2,1.4]\n", - "Output Answer": [ - "$-0.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.2, 1.4)\nprint(E(-1.4*x**2+4.6*x+1.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-3.97 < 1.9 x+4.7 < 5.71$ where $x \\sim $ \\text{NormalDistribution}[1.1,2.5].", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.1, 2.5)\nprint(P((-3.97 < 1.9*x+4.7) & (1.9*x+4.7 < 5.71)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.1 x^2-2.7 x+1.5$ where $x \\sim $ \\text{NormalDistribution}[0.7,2.8]\n", - "Output Answer": [ - "$-9.55$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.7, 2.8)\nprint(E(-1.1*x**2-2.7*x+1.5))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, 9, 6, -8, -4 \\sqrt{3}} \\setminus {0, -8, \\frac{17}{5}, 6, -4 \\sqrt{3}, 2}$.\n", - "Output Answer": [ - "${9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 9, 6, -8, -4*math.sqrt(3),))\nsnd = set((0, -8, (17/5), 6, -4*math.sqrt(3), 2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-8, -0.462, -3, -2, -\\frac{4}{\\sqrt{3}}, \\frac{2}{\\pi }, -6} \\cup {-2, \\frac{2}{\\pi }, -\\frac{4}{\\sqrt{3}}, -3, \\frac{19}{2}, -8, -0.462}$.\n", - "Output Answer": [ - "${-8, -6, -3, -\\frac{4}{\\sqrt{3}}, -2, -0.462, \\frac{2}{\\pi }, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -0.462, -3, -2, -(4/(math.sqrt(3))), (2/math.pi), -6,))\nsnd = set((-2, (2/math.pi), -(4/(math.sqrt(3))), -3, (19/2), -8, -0.462,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.133,0.261,0.111,0.12\\}$ and $\\{0.253,0.187,0.184,0.009\\}$.", - "Output Answer": [ - "$0.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.133, 0.261, 0.111, 0.12\ndistribution2 = 0.253, 0.187, 0.184, 0.009\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\sqrt{5}, -\\frac{5}{\\sqrt{3}}, \\frac{9}{2}, 0, -7, -4}$.\n", - "Output Answer": [ - "${-7, -4, -\\frac{5}{\\sqrt{3}}, -\\sqrt{5}, 0, \\frac{9}{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(5), -(5/(math.sqrt(3))), (9/2), 0, -7, -4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7, 8, -7, -7, 8, -1, -1, 8, 8, -7, 6, 8, -9, -7, -7, 8, 6, 6, -2, -1, 8, 6, 8, -9, 8, -7, -1}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -7, 8, -7, -7, 8, -1, -1, 8, 8, -7, 6, 8, -9, -7, -7, 8, 6, 6, -2, -1, 8, 6, 8, -9, 8, -7, -1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${10, 7.76, -3.4, 3, -1} \\setminus {5.6, 6, 10, 7.76, -8, 3, \\frac{50}{7}}$.\n", - "Output Answer": [ - "${-3.4, -1}$" - ], - "Output Program": [ - "fst = set((10, 7.76, -3.4, 3, -1,))\nsnd = set((5.6, 6, 10, 7.76, -8, 3, (50/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 9, -1, -6, 4, 9}$.\n", - "Output Answer": [ - "$\\frac{7}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 9, -1, -6, 4, 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -64, 64}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -64, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{\\sqrt{3}}, \\frac{15}{e}, 9, 1, 9, -\\frac{4}{3}}$.\n", - "Output Answer": [ - "$9+\\frac{13}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(3))), (15/math.e), 9, 1, 9, -(4/3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x-2.9$ where $x \\sim $ \\text{BetaDistribution}[0.9,0.6]\n", - "Output Answer": [ - "$-0.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.9, 0.6)\nprint(E(3.7*x-2.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{29}{3}, -5, 0, -\\frac{19}{3}, 0, -\\frac{2}{3}, 0, -7}$.\n", - "Output Answer": [ - "$-\\frac{43}{12}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(29/3), -5, 0, -(19/3), 0, -(2/3), 0, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, 6, 3 \\sqrt{3}, -4 \\sqrt{2}, 7.988, 10}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, 0, 3 \\sqrt{3}, 6, 7.988, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, 6, 3*math.sqrt(3), -4*math.sqrt(2), 7.988, 10\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-27, 81, 64, 81}$.\n", - "Output Answer": [ - "$(18+18 i) 3^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -27, 81, 64, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -14, 15, 7, 14, -3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1379}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -14, 15, 7, 14, -3\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.234,0.136,0.116,0.183,0.206\\}$ and $\\{0.471,0.059,0.231,0.18,0.057\\}$.", - "Output Answer": [ - "$0.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.234, 0.136, 0.116, 0.183, 0.206\ndistribution2 = 0.471, 0.059, 0.231, 0.18, 0.057\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -8, -4, 1, 4, -2, 10, -8}$.\n", - "Output Answer": [ - "$-\\frac{11}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -8, -4, 1, 4, -2, 10, -8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\sqrt{5}, 1, 5, 4 \\sqrt{3}, -\\frac{11}{\\sqrt{\\pi }}, -6 \\sqrt{2}, -\\frac{11}{2}, -\\sqrt{3}} \\setminus {\\frac{8}{\\sqrt{\\pi }}, -1, 0, 4 \\sqrt{3}, -\\frac{11}{\\sqrt{\\pi }}, -\\sqrt{5}, -\\frac{5}{2}, 1}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -\\frac{11}{2}, -\\sqrt{3}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-math.sqrt(5), 1, 5, 4*math.sqrt(3), -(11/(math.sqrt(math.pi))), -6*math.sqrt(2), -(11/2), -math.sqrt(3),))\nsnd = set(((8/(math.sqrt(math.pi))), -1, 0, 4*math.sqrt(3), -(11/(math.sqrt(math.pi))), -math.sqrt(5), -(5/2), 1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -1, 9}$.\n", - "Output Answer": [ - "$\\frac{2}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -1, 9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\sqrt{3}, 8, 4 \\sqrt{3}, -\\frac{29}{\\pi }} \\cup {-\\frac{29}{\\pi }, 5 \\sqrt{3}, -3 \\sqrt{3}, 8}$.\n", - "Output Answer": [ - "${-\\frac{29}{\\pi }, -3 \\sqrt{3}, 4 \\sqrt{3}, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.sqrt(3), 8, 4*math.sqrt(3), -(29/math.pi),))\nsnd = set((-(29/math.pi), 5*math.sqrt(3), -3*math.sqrt(3), 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.4 x^2+4.8 x+8.6$ where $x \\sim $ \\text{NormalDistribution}[1.2,2.6]\n", - "Output Answer": [ - "$50.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.2, 2.6)\nprint(E(4.4*x**2+4.8*x+8.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, 4 \\sqrt{5}, 7, -4, \\frac{3}{\\sqrt{\\pi }}, -4, -3, -9, -3, 8, -2 \\sqrt{3}, \\frac{1}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$9+4 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 4*math.sqrt(5), 7, -4, (3/(math.sqrt(math.pi))), -4, -3, -9, -3, 8, -2*math.sqrt(3), (1/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, -8, -\\frac{5}{2}, 8}$.\n", - "Output Answer": [ - "$-\\frac{23}{8}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, -8, -(5/2), 8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{38}{7}, -\\frac{17}{7}, \\frac{4}{7}, -\\frac{27}{7}, \\frac{52}{7}, -\\frac{46}{7}, \\frac{69}{7}, -\\frac{51}{7}, -\\frac{16}{7}, -\\frac{1}{7}, \\frac{32}{7}} \\cap {-\\frac{34}{7}, -\\frac{1}{7}, -\\frac{40}{7}, -\\frac{58}{7}, 0, \\frac{39}{7}, -\\frac{19}{7}, \\frac{12}{7}, -\\frac{47}{7}, -\\frac{67}{7}, \\frac{15}{7}, \\frac{64}{7}}$.\n", - "Output Answer": [ - "${-\\frac{1}{7}}$" - ], - "Output Program": [ - "fst = set((-(38/7), -(17/7), (4/7), -(27/7), (52/7), -(46/7), (69/7), -(51/7), -(16/7), -(1/7), (32/7),))\nsnd = set((-(34/7), -(1/7), -(40/7), -(58/7), 0, (39/7), -(19/7), (12/7), -(47/7), -(67/7), (15/7), (64/7),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{40}{3}, 4, 20}$.\n", - "Output Answer": [ - "$8$" - ], - "Output Program": [ - "import statistics\nvalues = (40/3), 4, 20\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{32}{3}, \\frac{26}{3}, 15}$.\n", - "Output Answer": [ - "$\\frac{18720}{1721}$" - ], - "Output Program": [ - "import statistics\nvalues = (32/3), (26/3), 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 3, 4}$.\n", - "Output Answer": [ - "$\\frac{7}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 3, 4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.5 x^2+1.4 x+1.1$ where $x \\sim $ \\text{NormalDistribution}[-1.7,2.5]\n", - "Output Answer": [ - "$30.71$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.7, 2.5)\nprint(E(3.5*x**2+1.4*x+1.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-1, -8, -4 \\sqrt{2}, 10, 5, -3}$.\n", - "Output Answer": [ - "${-8, -4 \\sqrt{2}, -3, -1, 5, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -8, -4*math.sqrt(2), 10, 5, -3\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3 \\sqrt{3}, -2, -5 \\sqrt{2}} \\setminus {-3 \\sqrt{3}, 6, -\\frac{11}{2}, -2}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, 3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3*math.sqrt(3), -2, -5*math.sqrt(2),))\nsnd = set((-3*math.sqrt(3), 6, -(11/2), -2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, -2, -\\sqrt{3}, \\frac{29}{5}, -9, -5, -3, 1} \\cup {-3, 7, 9, -1, \\frac{29}{5}, -2, -9, 0, 8}$.\n", - "Output Answer": [ - "${-9, -5, -3, -2, -\\sqrt{3}, -1, 0, 1, 2, \\frac{29}{5}, 7, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -2, -math.sqrt(3), (29/5), -9, -5, -3, 1,))\nsnd = set((-3, 7, 9, -1, (29/5), -2, -9, 0, 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, -10, 5, 10}$.\n", - "Output Answer": [ - "$-\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, -10, 5, 10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, -\\frac{13}{4}, -7, -2, \\frac{10}{\\pi }, 1, 1, -6, -1, -5, -3, -\\frac{9}{\\pi }, -6}$.", - "Output Answer": [ - "$-\\frac{9}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -(13/4), -7, -2, (10/math.pi), 1, 1, -6, -1, -5, -3, -(9/math.pi), -6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{8}{3}, 2 \\sqrt{2}, -\\frac{54}{7}, 0, \\frac{19}{2}, 4} \\setminus {9, 1, 0, 6, 4, \\frac{19}{2}}$.\n", - "Output Answer": [ - "${-\\frac{54}{7}, \\frac{8}{3}, 2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((8/3), 2*math.sqrt(2), -(54/7), 0, (19/2), 4,))\nsnd = set((9, 1, 0, 6, 4, (19/2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{7}{\\sqrt{3}}, -1, -4, -3 \\pi, -2, 0, \\frac{17}{\\pi }, 2, \\frac{16}{3}} \\setminus {0, -2, -7, 4, \\frac{2}{3}, -\\frac{7}{\\sqrt{3}}, -1}$.\n", - "Output Answer": [ - "${-3 \\pi, -4, 2, \\frac{16}{3}, \\frac{17}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(7/(math.sqrt(3))), -1, -4, -3*math.pi, -2, 0, (17/math.pi), 2, (16/3),))\nsnd = set((0, -2, -7, 4, (2/3), -(7/(math.sqrt(3))), -1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -7, -\\pi, -6, -\\frac{16}{\\sqrt{5}}, \\frac{15}{\\sqrt{\\pi }}, \\frac{13}{\\sqrt{5}}, \\frac{16}{\\sqrt{\\pi }}, 3 \\pi, 2}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{5}}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -7, -math.pi, -6, -(16/(math.sqrt(5))), (15/(math.sqrt(math.pi))), (13/(math.sqrt(5))), (16/(math.sqrt(math.pi))), 3*math.pi, 2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -\\frac{7}{2}, -\\frac{17}{2}, -6, -\\frac{3}{2}, -\\frac{17}{2}}$.\n", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -(7/2), -(17/2), -6, -(3/2), -(17/2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, 1, 4, \\frac{13}{3}, -5.039, \\frac{10}{3}, 2, \\pi, 6, \\frac{39}{7}, 5 \\sqrt{2}} \\cup {-5.039, 2, 10, -2 \\sqrt{5}, 5 \\sqrt{2}, \\frac{13}{3}, -\\frac{8}{3}, -\\pi, -5, 1}$.\n", - "Output Answer": [ - "${-5.039, -5, -2 \\sqrt{5}, -\\pi, -\\frac{8}{3}, 0, 1, 2, \\pi, \\frac{10}{3}, 4, \\frac{13}{3}, \\frac{39}{7}, 6, 5 \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 1, 4, (13/3), -5.039, (10/3), 2, math.pi, 6, (39/7), 5*math.sqrt(2),))\nsnd = set((-5.039, 2, 10, -2*math.sqrt(5), 5*math.sqrt(2), (13/3), -(8/3), -math.pi, -5, 1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${8, 1, \\frac{11}{7}, \\frac{1}{2}, \\frac{10}{\\sqrt{\\pi }}, -7, -3 \\pi, -4, -2 \\log (2), 5, -\\frac{9}{2}}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 1, (11/7), (1/2), (10/(math.sqrt(math.pi))), -7, -3*math.pi, -4, -2*math.log(2), 5, -(9/2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-4.58 < -4.8 x^2+4.8 x+3.6 < 1.34$ where $x \\sim $ \\text{NormalDistribution}[-1.1,1.8].", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.1, 1.8)\nprint(P((-4.58 < -4.8*x**2+4.8*x+3.6) & (-4.8*x**2+4.8*x+3.6 < 1.34)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, -4, 7, -12}$.\n", - "Output Answer": [ - "$\\frac{875}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -4, 7, -12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.206,0.133,0.072,0.034,0.022,0.02,0.132,0.016,0.303,0.037\\}$ and $\\{0.041,0.059,0.04,0.323,0.095,0.123,0.085,0.074,0.039,0.069\\}$.", - "Output Answer": [ - "$0.97$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.206, 0.133, 0.072, 0.034, 0.022, 0.02, 0.132, 0.016, 0.303, 0.037\ndistribution2 = 0.041, 0.059, 0.04, 0.323, 0.095, 0.123, 0.085, 0.074, 0.039, 0.069\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${9, -3 e, -3 \\sqrt{2}, 8} \\cup {7, 9, -3 \\sqrt{2}, -3 e, -7.6, 8}$.\n", - "Output Answer": [ - "${-3 e, -7.6, -3 \\sqrt{2}, 7, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, -3*math.e, -3*math.sqrt(2), 8,))\nsnd = set((7, 9, -3*math.sqrt(2), -3*math.e, -7.6, 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-32768, -64, 46656, 729, 10000, -7776}$.\n", - "Output Answer": [ - "$576 \\sqrt[6]{-1} 3^{5/6} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = -32768, -64, 46656, 729, 10000, -7776\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.246,0.327,0.041,0.164\\}$ and $\\{0.156,0.09,0.104,0.345\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.246, 0.327, 0.041, 0.164\ndistribution2 = 0.156, 0.09, 0.104, 0.345\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10, -1, -1, 10, -6, 10, 10, 9, 1, -6, 1, 10, -6, 10, 10, 9, -6, -6, 9, -1, -6, -6, 1, 1, 9, 1, 9, -1}$.\n", - "Output Answer": [ - "$\\{10,-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 10, -1, -1, 10, -6, 10, 10, 9, 1, -6, 1, 10, -6, 10, 10, 9, -6, -6, 9, -1, -6, -6, 1, 1, 9, 1, 9, -1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-2.11 < 4.1 x-1.3 < 1.55$ where $x \\sim $ \\text{NormalDistribution}[-0.5,1.3].", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.5, 1.3)\nprint(P((-2.11 < 4.1*x-1.3) & (4.1*x-1.3 < 1.55)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, -4, 1, 8}$.", - "Output Answer": [ - "$\\frac{3}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -4, 1, 8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-10, -4, 4, -2, 6, 9, -1, 3, 2} \\cap {6, 7, 5, -7, 1, -5, -9, -10, 4, 9, 2}$.\n", - "Output Answer": [ - "${-10, 2, 4, 6, 9}$" - ], - "Output Program": [ - "fst = set((-10, -4, 4, -2, 6, 9, -1, 3, 2,))\nsnd = set((6, 7, 5, -7, 1, -5, -9, -10, 4, 9, 2,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{4}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(4/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-4 \\sqrt{5}, 4 \\sqrt{3}, -5, -9, -\\sqrt{2}, -2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{5}, -5, -2 \\sqrt{5}, -\\sqrt{2}, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(5), 4*math.sqrt(3), -5, -9, -math.sqrt(2), -2*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.3 x^2-3.9 x-1.3$ where $x \\sim $ \\text{NormalDistribution}[0.1,2.1]\n", - "Output Answer": [ - "$-3.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.1, 2.1)\nprint(E(-0.3*x**2-3.9*x-1.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x-7.3$ where $x \\sim $ \\text{ExponentialDistribution}[2.]\n", - "Output Answer": [ - "$-5.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 2.)\nprint(E(4.6*x-7.3))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, \\frac{29}{3}, -4 \\sqrt{3}, \\frac{9}{\\sqrt{5}}, 8} \\setminus {-6, 8, \\frac{25}{3}, -3}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, 4, \\frac{9}{\\sqrt{5}}, \\frac{29}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, (29/3), -4*math.sqrt(3), (9/(math.sqrt(5))), 8,))\nsnd = set((-6, 8, (25/3), -3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, 9, \\frac{10}{\\sqrt{\\pi }}, -9, -6}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, 9, (10/(math.sqrt(math.pi))), -9, -6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{\\sqrt{\\pi }}, 7, -2 \\sqrt{2}, 5 \\sqrt{3}, 0, -\\frac{7}{\\sqrt{\\pi }}, 1, -\\sqrt{2}, \\frac{5}{2}, -2 \\sqrt{5}, 3, 2 \\pi}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/(math.sqrt(math.pi))), 7, -2*math.sqrt(2), 5*math.sqrt(3), 0, -(7/(math.sqrt(math.pi))), 1, -math.sqrt(2), (5/2), -2*math.sqrt(5), 3, 2*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, 0, 10, 2}$.\n", - "Output Answer": [ - "$\\frac{1307}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 0, 10, 2\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 \\log (2), 3 \\log (2), 2 \\log (2), -\\log (2), 7 \\log (2), 3 \\log (2), 7 \\log (2), 3 \\log (2), 3 \\log (2), 7 \\log (2), 3 \\log (2), 3 \\log (2), -\\log (2), 2 \\log (2), 3 \\log (2), 3 \\log (2), 3 \\log (2), 2 \\log (2), 2 \\log (2), -4 \\log (2), -4 \\log (2), 7 \\log (2), 3 \\log (2), 2 \\log (2), 7 \\log (2), 3 \\log (2)}$.\n", - "Output Answer": [ - "$\\{3 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.log(2), 3*math.log(2), 2*math.log(2), -math.log(2), 7*math.log(2), 3*math.log(2), 7*math.log(2), 3*math.log(2), 3*math.log(2), 7*math.log(2), 3*math.log(2), 3*math.log(2), -math.log(2), 2*math.log(2), 3*math.log(2), 3*math.log(2), 3*math.log(2), 2*math.log(2), 2*math.log(2), -4*math.log(2), -4*math.log(2), 7*math.log(2), 3*math.log(2), 2*math.log(2), 7*math.log(2), 3*math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{44}{5}, -2 \\sqrt{5}, 0, \\frac{38}{7}, 6.79, -2.9, -4}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, -4, -2.9, 0, \\frac{38}{7}, 6.79, \\frac{44}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = (44/5), -2*math.sqrt(5), 0, (38/7), 6.79, -2.9, -4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{14}{\\sqrt{3}}, 3, 3, -3}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (14/(math.sqrt(3))), 3, 3, -3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 6561, 100, 1000}$.\n", - "Output Answer": [ - "$90 \\sqrt{7} \\sqrt[4]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 6561, 100, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, -\\frac{17}{e}, \\frac{20}{\\pi }, -8., -\\frac{17}{\\sqrt{3}}, \\frac{3}{\\sqrt{2}}, 10} \\setminus {-\\frac{17}{e}, -\\frac{2}{\\sqrt{3}}, 0, -4, -8.}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{3}}, \\frac{3}{\\sqrt{2}}, \\frac{20}{\\pi }, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, -(17/math.e), (20/math.pi), -8., -(17/(math.sqrt(3))), (3/(math.sqrt(2))), 10,))\nsnd = set((-(17/math.e), -(2/(math.sqrt(3))), 0, -4, -8.,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{5}, 4 \\sqrt{5}, -4, -9, -1, 2, 5 \\sqrt{3}, 5, -6, -4 \\sqrt{3}, -9, 4, -\\frac{18}{e}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(5), 4*math.sqrt(5), -4, -9, -1, 2, 5*math.sqrt(3), 5, -6, -4*math.sqrt(3), -9, 4, -(18/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.239,0.071,0.087,0.056,0.048,0.111,0.073,0.093,0.129\\}$ and $\\{0.048,0.073,0.013,0.088,0.072,0.056,0.138,0.187,0.196\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.239, 0.071, 0.087, 0.056, 0.048, 0.111, 0.073, 0.093, 0.129\ndistribution2 = 0.048, 0.073, 0.013, 0.088, 0.072, 0.056, 0.138, 0.187, 0.196\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -7, 3}$.\n", - "Output Answer": [ - "$\\frac{175}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -7, 3\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x^2-3.9 x+2.2$ where $x \\sim $ \\text{PoissonDistribution}[3.3]\n", - "Output Answer": [ - "$23.39$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.3)\nprint(E(2.4*x**2-3.9*x+2.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.161,0.282,0.282,0.047\\}$ and $\\{0.149,0.215,0.409,0.152\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.161, 0.282, 0.282, 0.047\ndistribution2 = 0.149, 0.215, 0.409, 0.152\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 \\sqrt{3}, \\sqrt{3}, 2 \\sqrt{3}, 0, 3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\frac{8 \\sqrt{3}}{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.sqrt(3), math.sqrt(3), 2*math.sqrt(3), 0, 3*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${512, 9, -1, 25, 64}$.\n", - "Output Answer": [ - "$8 \\sqrt[5]{-1} 15^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 512, 9, -1, 25, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${6, \\frac{12}{e}, -8, -9, -3} \\cup {7, \\frac{22}{e}, -7, -9, -8}$.\n", - "Output Answer": [ - "${-9, -8, -7, -3, \\frac{12}{e}, 6, 7, \\frac{22}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, (12/math.e), -8, -9, -3,))\nsnd = set((7, (22/math.e), -7, -9, -8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{6}{\\sqrt{\\pi }}, -1, -5 \\log (2), -\\frac{19}{3}, -3 \\log (2), \\frac{7}{2}, -3 \\log (2), 2, \\pi, -3 \\sqrt{2}, 7 \\log (2), -7, 7, -4 \\sqrt{2}, 0}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (6/(math.sqrt(math.pi))), -1, -5*math.log(2), -(19/3), -3*math.log(2), (7/2), -3*math.log(2), 2, math.pi, -3*math.sqrt(2), 7*math.log(2), -7, 7, -4*math.sqrt(2), 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{33}{2}, 12, 15}$.\n", - "Output Answer": [ - "$\\frac{1980}{139}$" - ], - "Output Program": [ - "import statistics\nvalues = (33/2), 12, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.004,0.258,0.029,0.131,0.121,0.146,0.082,0.13\\}$ and $\\{0.097,0.219,0.023,0.309,0.031,0.006,0.048,0.081\\}$.", - "Output Answer": [ - "$0.63$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.004, 0.258, 0.029, 0.131, 0.121, 0.146, 0.082, 0.13\ndistribution2 = 0.097, 0.219, 0.023, 0.309, 0.031, 0.006, 0.048, 0.081\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, 7, 6.25, -3, \\frac{9}{\\sqrt{5}}} \\setminus {\\frac{9}{\\sqrt{5}}, 9.57, 7, 0, -3, -5, 3}$.\n", - "Output Answer": [ - "${6.25}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 7, 6.25, -3, (9/(math.sqrt(5))),))\nsnd = set(((9/(math.sqrt(5))), 9.57, 7, 0, -3, -5, 3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.031,0.253,0.146,0.124,0.027,0.124,0.176,0.072\\}$ and $\\{0.085,0.059,0.114,0.175,0.144,0.066,0.119,0.175\\}$.", - "Output Answer": [ - "$0.37$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.031, 0.253, 0.146, 0.124, 0.027, 0.124, 0.176, 0.072\ndistribution2 = 0.085, 0.059, 0.114, 0.175, 0.144, 0.066, 0.119, 0.175\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4, -5}$.\n", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "values = -4, -5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-4, \\sqrt{5}, \\frac{31}{\\pi }, 6 \\sqrt{2}, -9, -5.38, -10, 3} \\cup {-9, -4, 2.27, 3 \\sqrt{5}, -\\frac{19}{e}, -4 \\sqrt{3}, \\frac{19}{\\pi }, 3 \\sqrt{2}, -10}$.\n", - "Output Answer": [ - "${-10, -9, -\\frac{19}{e}, -4 \\sqrt{3}, -5.38, -4, \\sqrt{5}, 2.27, 3, 3 \\sqrt{2}, \\frac{19}{\\pi }, 3 \\sqrt{5}, 6 \\sqrt{2}, \\frac{31}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, math.sqrt(5), (31/math.pi), 6*math.sqrt(2), -9, -5.38, -10, 3,))\nsnd = set((-9, -4, 2.27, 3*math.sqrt(5), -(19/math.e), -4*math.sqrt(3), (19/math.pi), 3*math.sqrt(2), -10,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-0.082, -3, 0, 2, 4 \\sqrt{5}, 7} \\cup {-0.082, -1, 4 \\sqrt{5}, -\\frac{20}{3}, -6, 0}$.\n", - "Output Answer": [ - "${-\\frac{20}{3}, -6, -3, -1, -0.082, 0, 2, 7, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.082, -3, 0, 2, 4*math.sqrt(5), 7,))\nsnd = set((-0.082, -1, 4*math.sqrt(5), -(20/3), -6, 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${3, 18, 16, 6}$.\n", - "Output Answer": [ - "$\\frac{576}{89}$" - ], - "Output Program": [ - "import statistics\nvalues = 3, 18, 16, 6\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 36, 81, 9, -125}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-2} 15^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 36, 81, 9, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, 8, 2 e, -3, -\\frac{14}{\\sqrt{5}}, \\frac{34}{5}, -6, -\\frac{1}{\\sqrt{\\pi }}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2 e-\\frac{1}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, 8, 2*math.e, -3, -(14/(math.sqrt(5))), (34/5), -6, -(1/(math.sqrt(math.pi)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${8, -5, 14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{283}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -5, 14\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, 2, 0, -5, -6, -1, -7}$.\n", - "Output Answer": [ - "$-\\frac{17}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, 2, 0, -5, -6, -1, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 17, 11, 18}$.\n", - "Output Answer": [ - "$\\frac{26928}{1943}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 17, 11, 18\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{9}{5}, -\\frac{8}{5}, 4, \\frac{13}{5}, -\\frac{41}{5}, -\\frac{18}{5}, \\frac{39}{5}, \\frac{13}{5}, -\\frac{9}{5}, -\\frac{18}{5}, 4, -\\frac{9}{5}, \\frac{39}{5}, 4, \\frac{39}{5}, -\\frac{41}{5}, \\frac{13}{5}, -\\frac{9}{5}, -\\frac{41}{5}, -\\frac{9}{5}, -\\frac{41}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{9}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(9/5), -(8/5), 4, (13/5), -(41/5), -(18/5), (39/5), (13/5), -(9/5), -(18/5), 4, -(9/5), (39/5), 4, (39/5), -(41/5), (13/5), -(9/5), -(41/5), -(9/5), -(41/5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x^2+4.2 x-4.9$ where $x \\sim $ \\text{NormalDistribution}[1.7,1.4]\n", - "Output Answer": [ - "$19.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.7, 1.4)\nprint(E(3.6*x**2+4.2*x-4.9))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, -\\frac{10}{\\pi }, -4, 3, -4 \\sqrt{2}, 8} \\setminus {-7, -4, -8, \\frac{28}{3}, 4 \\sqrt{5}, -\\sqrt{5}, -3}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -\\frac{10}{\\pi }, 0, 3, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -(10/math.pi), -4, 3, -4*math.sqrt(2), 8,))\nsnd = set((-7, -4, -8, (28/3), 4*math.sqrt(5), -math.sqrt(5), -3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6 \\sqrt{3}, -5 \\sqrt{3}, 5 \\sqrt{3}, -2 \\sqrt{3}, 2 \\sqrt{3}, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$-\\frac{11}{2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -6*math.sqrt(3), -5*math.sqrt(3), 5*math.sqrt(3), -2*math.sqrt(3), 2*math.sqrt(3), -5*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, 13, 13}$.\n", - "Output Answer": [ - "$\\frac{400}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, 13, 13\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.198,0.027,0.007,0.052,0.036,0.021,0.128,0.153,0.044,0.101\\}$ and $\\{0.171,0.189,0.04,0.104,0.116,0.073,0.051,0.083,0.089,0.03\\}$.", - "Output Answer": [ - "$0.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.198, 0.027, 0.007, 0.052, 0.036, 0.021, 0.128, 0.153, 0.044, 0.101\ndistribution2 = 0.171, 0.189, 0.04, 0.104, 0.116, 0.073, 0.051, 0.083, 0.089, 0.03\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.14,0.143,0.196,0.072,0.027,0.027,0.134,0.076,0.04,0.049\\}$ and $\\{0.109,0.119,0.017,0.095,0.015,0.12,0.037,0.111,0.153,0.08\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.14, 0.143, 0.196, 0.072, 0.027, 0.027, 0.134, 0.076, 0.04, 0.049\ndistribution2 = 0.109, 0.119, 0.017, 0.095, 0.015, 0.12, 0.037, 0.111, 0.153, 0.08\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -8, -9, 10, -1, 6, -1, -9, -6, -6, -8, 6, -6, -6, 6, -5, -8, 10, -6, -1, 6, -5, -9, 2, 10}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -8, -9, 10, -1, 6, -1, -9, -6, -6, -8, 6, -6, -6, 6, -5, -8, 10, -6, -1, 6, -5, -9, 2, 10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, 2401, -59049, -7, 8}$.\n", - "Output Answer": [ - "$126 \\sqrt[5]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 2401, -59049, -7, 8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -3, -3, -9}$.\n", - "Output Answer": [ - "$-\\frac{15}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -3, -3, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{14}{5}, 4 \\sqrt{5}, -e, \\frac{3}{\\pi }, -7, 4, 4 \\log (2), -2} \\cup {2 e, 4 \\sqrt{5}, -6 \\log (2), \\frac{48}{5}, 0, -2, \\frac{3}{\\pi }, -7}$.\n", - "Output Answer": [ - "${-7, -6 \\log (2), -\\frac{14}{5}, -e, -2, 0, \\frac{3}{\\pi }, 4 \\log (2), 4, 2 e, 4 \\sqrt{5}, \\frac{48}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(14/5), 4*math.sqrt(5), -math.e, (3/math.pi), -7, 4, 4*math.log(2), -2,))\nsnd = set((2*math.e, 4*math.sqrt(5), -6*math.log(2), (48/5), 0, -2, (3/math.pi), -7,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{7}{\\sqrt{5}}, 0, \\frac{2}{\\sqrt{5}}, -\\sqrt{5}, \\frac{2}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, -3 \\sqrt{5}, \\frac{2}{\\sqrt{5}}, 0, -3 \\sqrt{5}, \\frac{11}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, -3 \\sqrt{5}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, \\frac{2}{\\sqrt{5}}, \\frac{11}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{2}{\\sqrt{5}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (7/(math.sqrt(5))), 0, (2/(math.sqrt(5))), -math.sqrt(5), (2/(math.sqrt(5))), (7/(math.sqrt(5))), (2/(math.sqrt(5))), (2/(math.sqrt(5))), (7/(math.sqrt(5))), (2/(math.sqrt(5))), (11/(math.sqrt(5))), -3*math.sqrt(5), (2/(math.sqrt(5))), 0, -3*math.sqrt(5), (11/(math.sqrt(5))), (11/(math.sqrt(5))), (7/(math.sqrt(5))), (2/(math.sqrt(5))), -3*math.sqrt(5), (7/(math.sqrt(5))), (7/(math.sqrt(5))), (7/(math.sqrt(5))), (2/(math.sqrt(5))), (11/(math.sqrt(5)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2 \\sqrt{3}, -\\frac{17}{\\pi }, -2.64, -2, -4 \\sqrt{5}} \\setminus {-4 \\sqrt{5}, -9, -5 \\sqrt{2}, -6.28, -\\frac{17}{\\pi }, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-2.64, -2}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(3), -(17/math.pi), -2.64, -2, -4*math.sqrt(5),))\nsnd = set((-4*math.sqrt(5), -9, -5*math.sqrt(2), -6.28, -(17/math.pi), -2*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${2, 4, 15}$.\n", - "Output Answer": [ - "$49$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, 4, 15\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.177,0.04,0.1,0.107,0.181,0.215\\}$ and $\\{0.387,0.063,0.01,0.104,0.041,0.328\\}$.", - "Output Answer": [ - "$0.44$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.177, 0.04, 0.1, 0.107, 0.181, 0.215\ndistribution2 = 0.387, 0.063, 0.01, 0.104, 0.041, 0.328\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8, 10, -2}$.\n", - "Output Answer": [ - "${-8, -2, 10}$" - ], - "Output Program": [ - "values = -8, 10, -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-9, -2 \\sqrt{5}, -8, -7, 3.8, -2, -9, \\frac{43}{5}}$.\n", - "Output Answer": [ - "${-9, -9, -8, -7, -2 \\sqrt{5}, -2, 3.8, \\frac{43}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -2*math.sqrt(5), -8, -7, 3.8, -2, -9, (43/5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 1, 729, 4096, 729, 16}$.\n", - "Output Answer": [ - "$72$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 1, 729, 4096, 729, 16\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-7, -2}$.\n", - "Output Answer": [ - "${-7, -2}$" - ], - "Output Program": [ - "values = -7, -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, 2, 11, 10, -4, 0}$.\n", - "Output Answer": [ - "$\\frac{1349}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, 2, 11, 10, -4, 0\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-3 \\pi, 1, -10, 4, -\\frac{11}{\\sqrt{2}}} \\setminus {-3 \\pi, 3 \\sqrt{2}, 9, 3}$.\n", - "Output Answer": [ - "${-10, -\\frac{11}{\\sqrt{2}}, 1, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.pi, 1, -10, 4, -(11/(math.sqrt(2))),))\nsnd = set((-3*math.pi, 3*math.sqrt(2), 9, 3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -10, -5, 3, 3, 4, -2, \\frac{7}{\\sqrt{5}}, \\sqrt{3}, \\frac{17}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{3}}, 2, 2, 10}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -10, -5, 3, 3, 4, -2, (7/(math.sqrt(5))), math.sqrt(3), (17/(math.sqrt(math.pi))), -(10/(math.sqrt(3))), 2, 2, 10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x+1.$ where $x \\sim $ \\text{BetaDistribution}[1.7,0.6]\n", - "Output Answer": [ - "$1.74$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 0.6)\nprint(E(1.*x+1.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, 6, 8, 5, 5}$.\n", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "values = 9, 6, 8, 5, 5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 14, 12, 5}$.\n", - "Output Answer": [ - "$\\frac{1680}{233}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 14, 12, 5\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{1}{2}, \\frac{15}{2}, 1}$.\n", - "Output Answer": [ - "$\\frac{45}{47}$" - ], - "Output Program": [ - "import statistics\nvalues = (1/2), (15/2), 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.037,0.023,0.261,0.184,0.086,0.05,0.081,0.086,0.1,0.016\\}$ and $\\{0.017,0.144,0.086,0.027,0.109,0.242,0.02,0.074,0.011,0.164\\}$.", - "Output Answer": [ - "$0.88$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.037, 0.023, 0.261, 0.184, 0.086, 0.05, 0.081, 0.086, 0.1, 0.016\ndistribution2 = 0.017, 0.144, 0.086, 0.027, 0.109, 0.242, 0.02, 0.074, 0.011, 0.164\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, \\frac{37}{2}, 3}$.\n", - "Output Answer": [ - "$\\frac{1665}{326}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, (37/2), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-8, -64, 64, -27}$.\n", - "Output Answer": [ - "$8 \\sqrt[4]{-1} 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -64, 64, -27\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${9, 6, -15, -8}$.\n", - "Output Answer": [ - "$130$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 6, -15, -8\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 0.8, 0, \\frac{37}{4}, 1, -3 \\log (2), -3 \\pi, -5} \\cup {2 \\pi, 1, -5, -9, 0.8, -\\frac{19}{4}, 4 \\sqrt{2}, \\log (2), -2}$.\n", - "Output Answer": [ - "${-3 \\pi, -9, -5, -\\frac{19}{4}, -3 \\log (2), -2, 0, \\log (2), 0.8, 1, 4 \\sqrt{2}, 2 \\pi, \\frac{37}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 0.8, 0, (37/4), 1, -3*math.log(2), -3*math.pi, -5,))\nsnd = set((2*math.pi, 1, -5, -9, 0.8, -(19/4), 4*math.sqrt(2), math.log(2), -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, 0, -2 \\pi, 2, -6, 2 \\pi, 1, -\\frac{2}{\\sqrt{\\pi }}, 5, 10, -\\frac{16}{\\sqrt{\\pi }}, -\\sqrt{3}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, 0, -2*math.pi, 2, -6, 2*math.pi, 1, -(2/(math.sqrt(math.pi))), 5, 10, -(16/(math.sqrt(math.pi))), -math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1. x^2+3.1 x-3.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.4]\n", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.4)\nprint(E(1.*x**2+3.1*x-3.9))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-6, -1, -5, -2, -9, -8, -7, 8, 2, -3} \\cap {-1, -3, 4, -2, 9, 1, 2, -9, -8}$.\n", - "Output Answer": [ - "${-9, -8, -3, -2, -1, 2}$" - ], - "Output Program": [ - "fst = set((-6, -1, -5, -2, -9, -8, -7, 8, 2, -3,))\nsnd = set((-1, -3, 4, -2, 9, 1, 2, -9, -8,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x-3.7$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$-3.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(3.6*x-3.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -4 \\sqrt{3}, -3 \\sqrt{3}, 0, \\sqrt{3}, -5 \\sqrt{3}, \\sqrt{3}, 0, 0, -5 \\sqrt{3}, 5 \\sqrt{3}, -4 \\sqrt{3}, -5 \\sqrt{3}, -3 \\sqrt{3}, 5 \\sqrt{3}, 0, -3 \\sqrt{3}, 5 \\sqrt{3}, \\sqrt{3}, -3 \\sqrt{3}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, -4*math.sqrt(3), -3*math.sqrt(3), 0, math.sqrt(3), -5*math.sqrt(3), math.sqrt(3), 0, 0, -5*math.sqrt(3), 5*math.sqrt(3), -4*math.sqrt(3), -5*math.sqrt(3), -3*math.sqrt(3), 5*math.sqrt(3), 0, -3*math.sqrt(3), 5*math.sqrt(3), math.sqrt(3), -3*math.sqrt(3), -4*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2, 4 \\sqrt{3}, -2 e, -4, -2 \\sqrt{3}, \\frac{28}{5}, -3 e, 2, 0, 3, -2}$.\n", - "Output Answer": [ - "$4 \\sqrt{3}+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -2, 4*math.sqrt(3), -2*math.e, -4, -2*math.sqrt(3), (28/5), -3*math.e, 2, 0, 3, -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${243, 81, 729, 100, 6561}$.\n", - "Output Answer": [ - "$81\\ 3^{3/5} 10^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 243, 81, 729, 100, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.4 x+1.7$ where $x \\sim $ \\text{NormalDistribution}[-0.8,1.7]\n", - "Output Answer": [ - "$1.38$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 1.7)\nprint(E(0.4*x+1.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{\\sqrt{2}}, 5, -4, 4, 4, -6.24}$.\n", - "Output Answer": [ - "${-6.24, -4, \\frac{1}{\\sqrt{2}}, 4, 4, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = (1/(math.sqrt(2))), 5, -4, 4, 4, -6.24\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.7 x^2+2.6 x-3.8$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$-15.17$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(-4.7*x**2+2.6*x-3.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -32768, 6561, 9, 64}$.\n", - "Output Answer": [ - "$144 \\sqrt[5]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -32768, 6561, 9, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.142,0.446,0.102,0.039,0.063,0.038\\}$ and $\\{0.074,0.122,0.032,0.219,0.075,0.262\\}$.", - "Output Answer": [ - "$0.71$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.142, 0.446, 0.102, 0.039, 0.063, 0.038\ndistribution2 = 0.074, 0.122, 0.032, 0.219, 0.075, 0.262\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 1, \\frac{21}{2}, 15}$.\n", - "Output Answer": [ - "$\\frac{2520}{767}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 1, (21/2), 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 14, 1, 1}$.\n", - "Output Answer": [ - "$\\frac{126}{67}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 14, 1, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 11}$.\n", - "Output Answer": [ - "$2 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{9}{2}, -2 \\sqrt{5}, -3, 7, -8, 2, \\frac{26}{5}, -\\frac{13}{\\sqrt{3}}, 4 e, 6, 0, -\\frac{14}{3}, 0}$.\n", - "Output Answer": [ - "$8+4 e$" - ], - "Output Program": [ - "import math\n\nvalues = -(9/2), -2*math.sqrt(5), -3, 7, -8, 2, (26/5), -(13/(math.sqrt(3))), 4*math.e, 6, 0, -(14/3), 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${8, 9}$.", - "Output Answer": [ - "$\\frac{17}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${12, -5, -8, 8, -1, -14}$.\n", - "Output Answer": [ - "$\\frac{290}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -5, -8, 8, -1, -14\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{36}{7}, -4, -11 \\log (2), -3} \\setminus {-11 \\log (2), -3, 4, -9}$.\n", - "Output Answer": [ - "${-\\frac{36}{7}, -4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(36/7), -4, -11*math.log(2), -3,))\nsnd = set((-11*math.log(2), -3, 4, -9,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, -2, -3, -6}$.\n", - "Output Answer": [ - "$-\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, -2, -3, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.116,0.086,0.018,0.047,0.051,0.161,0.154,0.084,0.248\\}$ and $\\{0.079,0.084,0.079,0.136,0.166,0.119,0.049,0.137,0.086\\}$.", - "Output Answer": [ - "$0.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.116, 0.086, 0.018, 0.047, 0.051, 0.161, 0.154, 0.084, 0.248\ndistribution2 = 0.079, 0.084, 0.079, 0.136, 0.166, 0.119, 0.049, 0.137, 0.086\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, 0, 9, 1} \\cup {e, 4, 5, 1}$.\n", - "Output Answer": [ - "${0, 1, e, 4, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 0, 9, 1,))\nsnd = set((math.e, 4, 5, 1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8.66, 6.785}$.\n", - "Output Answer": [ - "${-8.66, 6.785}$" - ], - "Output Program": [ - "values = -8.66, 6.785\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\log (2), 2 \\log (2), -8 \\log (2), -4 \\log (2), 12 \\log (2), 11 \\log (2), -10 \\log (2), -4 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{\\log (2)}{4}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.log(2), 2*math.log(2), -8*math.log(2), -4*math.log(2), 12*math.log(2), 11*math.log(2), -10*math.log(2), -4*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 4, 15, 15}$.\n", - "Output Answer": [ - "$\\frac{240}{29}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 4, 15, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, 2, -5, -2, 9, 9, 6}$.\n", - "Output Answer": [ - "$\\frac{22}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, 2, -5, -2, 9, 9, 6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-e, -3 e, 0, -3 e, -3 e, -e, 3 e, -e, 0, 0, 3 e, -e, -3 e, 3 e, -3 e, 0, -3 e, -3 e, -3 e, 0}$.\n", - "Output Answer": [ - "$\\{-3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.e, -3*math.e, 0, -3*math.e, -3*math.e, -math.e, 3*math.e, -math.e, 0, 0, 3*math.e, -math.e, -3*math.e, 3*math.e, -3*math.e, 0, -3*math.e, -3*math.e, -3*math.e, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.038,0.048,0.088,0.154,0.206,0.129,0.164,0.047,0.055\\}$ and $\\{0.085,0.174,0.077,0.071,0.057,0.025,0.176,0.16,0.12\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.038, 0.048, 0.088, 0.154, 0.206, 0.129, 0.164, 0.047, 0.055\ndistribution2 = 0.085, 0.174, 0.077, 0.071, 0.057, 0.025, 0.176, 0.16, 0.12\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, -2, 6, -1}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{515}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -2, 6, -1\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{17}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{17}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{6}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (17/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), -(13/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (17/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, 9, -10, -15, -11}$.\n", - "Output Answer": [ - "$\\frac{1297}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, 9, -10, -15, -11\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-1.17 < 1. x^2+4.1 x-2.3 < 3.85$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8].", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(P((-1.17 < 1.*x**2+4.1*x-2.3) & (1.*x**2+4.1*x-2.3 < 3.85)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{13}{2}, -\\frac{17}{2}, \\frac{15}{4}}$.\n", - "Output Answer": [ - "$-\\frac{15}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(13/2), -(17/2), (15/4)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.014,0.176,0.349,0.044,0.297,0.004\\}$ and $\\{0.078,0.177,0.161,0.122,0.143,0.211\\}$.", - "Output Answer": [ - "$0.46$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.014, 0.176, 0.349, 0.044, 0.297, 0.004\ndistribution2 = 0.078, 0.177, 0.161, 0.122, 0.143, 0.211\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-1.71 < -1. x-1. < 0.13$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1].", - "Output Answer": [ - "$0.56$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(P((-1.71 < -1.*x-1.) & (-1.*x-1. < 0.13)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4 \\sqrt{2}, -2, \\frac{3}{\\sqrt{2}}, -\\frac{8}{5}, 8, 3, -7, 5, 5, -\\frac{26}{7}, 10, \\frac{11}{2}, -2, -2, -3 \\sqrt{3}}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 4*math.sqrt(2), -2, (3/(math.sqrt(2))), -(8/5), 8, 3, -7, 5, 5, -(26/7), 10, (11/2), -2, -2, -3*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 8, 5, 17}$.\n", - "Output Answer": [ - "$\\frac{8160}{953}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 8, 5, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, -11, 7}$.\n", - "Output Answer": [ - "$\\sqrt{129}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -11, 7\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{36}{5}, \\sqrt{5}, 2 \\sqrt{5}, -4, \\frac{13}{\\sqrt{\\pi }}, -\\frac{17}{2}, 2}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(36/5), math.sqrt(5), 2*math.sqrt(5), -4, (13/(math.sqrt(math.pi))), -(17/2), 2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3 \\sqrt{3}, 5, \\frac{1}{\\sqrt{3}}, \\frac{8}{5}, 2 e}$.", - "Output Answer": [ - "$\\frac{8}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3*math.sqrt(3), 5, (1/(math.sqrt(3))), (8/5), 2*math.e\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 \\sqrt{3}, -3, -\\frac{58}{7}, 5, -3, 5, -3 \\sqrt{5}, 3, \\frac{13}{\\sqrt{2}}, 2 e}$.\n", - "Output Answer": [ - "$\\frac{58}{7}+\\frac{13}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.sqrt(3), -3, -(58/7), 5, -3, 5, -3*math.sqrt(5), 3, (13/(math.sqrt(2))), 2*math.e\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${10, 7, \\frac{14}{3}, -6.901, 3, -2 \\pi} \\setminus {3, 6.912, 6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-6.901, -2 \\pi, \\frac{14}{3}, 7, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 7, (14/3), -6.901, 3, -2*math.pi,))\nsnd = set((3, 6.912, 6*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.126,0.202,0.054,0.213,0.168\\}$ and $\\{0.013,0.013,0.009,0.103,0.862\\}$.", - "Output Answer": [ - "$1.34$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.126, 0.202, 0.054, 0.213, 0.168\ndistribution2 = 0.013, 0.013, 0.009, 0.103, 0.862\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.9 x^3+1.1 x^2-1.8 x-0.2$ where $x \\sim $ \\text{PoissonDistribution}[3.1]\n", - "Output Answer": [ - "$-109.07$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.1)\nprint(E(-1.9*x**3+1.1*x**2-1.8*x-0.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{19}{4}, 6, -\\frac{1}{2}, -\\frac{15}{2}, -4, -\\frac{39}{4}, -\\frac{37}{4}}$.\n", - "Output Answer": [ - "$-\\frac{17}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(19/4), 6, -(1/2), -(15/2), -4, -(39/4), -(37/4)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.9 x^2+3.3 x-2.8$ where $x \\sim $ \\text{PoissonDistribution}[2.6]\n", - "Output Answer": [ - "$-40.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 2.6)\nprint(E(-4.9*x**2+3.3*x-2.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3 \\sqrt{2}, 5 \\sqrt{2}, \\sqrt{2}, 5 \\sqrt{2}, \\sqrt{2}, 5 \\sqrt{2}, 5 \\sqrt{2}, 4 \\sqrt{2}, 2 \\sqrt{2}, 5 \\sqrt{2}, \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, 5 \\sqrt{2}, -3 \\sqrt{2}, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -3*math.sqrt(2), 5*math.sqrt(2), math.sqrt(2), 5*math.sqrt(2), math.sqrt(2), 5*math.sqrt(2), 5*math.sqrt(2), 4*math.sqrt(2), 2*math.sqrt(2), 5*math.sqrt(2), math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), 5*math.sqrt(2), -3*math.sqrt(2), 4*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5 \\log (2), 1, 0, \\frac{27}{4}, 7, \\frac{51}{7}}$.\n", - "Output Answer": [ - "$\\frac{51}{7}+5 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -5*math.log(2), 1, 0, (27/4), 7, (51/7)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${4 \\sqrt{2}, \\sqrt{2}, -4 \\sqrt{2}, 2 \\sqrt{2}, 6 \\sqrt{2}, -2 \\sqrt{2}, 7 \\sqrt{2}} \\cap {2 \\sqrt{2}, 4 \\sqrt{2}, -3 \\sqrt{2}, 5 \\sqrt{2}, \\sqrt{2}, 0, 7 \\sqrt{2}}$.\n", - "Output Answer": [ - "${\\sqrt{2}, 2 \\sqrt{2}, 4 \\sqrt{2}, 7 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4*math.sqrt(2), math.sqrt(2), -4*math.sqrt(2), 2*math.sqrt(2), 6*math.sqrt(2), -2*math.sqrt(2), 7*math.sqrt(2),))\nsnd = set((2*math.sqrt(2), 4*math.sqrt(2), -3*math.sqrt(2), 5*math.sqrt(2), math.sqrt(2), 0, 7*math.sqrt(2),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 e, 3 e, -2 e, -3 e}$.\n", - "Output Answer": [ - "$-\\frac{5 e}{4}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.e, 3*math.e, -2*math.e, -3*math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -3, -7, -7, 9, -3, -9, 1, 9, -7, 1, -3, 1, 9, -2, 9, -3, 1, -9, -7, -2, -7, -7, -7, 9, -3}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -3, -7, -7, 9, -3, -9, 1, 9, -7, 1, -3, 1, 9, -2, 9, -3, 1, -9, -7, -2, -7, -7, -7, 9, -3\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\sqrt{3}, 5 \\sqrt{3}, \\sqrt{3}, 5 \\sqrt{3}, 4 \\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}, 4 \\sqrt{3}, \\sqrt{3}, \\sqrt{3}, 5 \\sqrt{3}, 3 \\sqrt{3}, 4 \\sqrt{3}, -\\sqrt{3}, 5 \\sqrt{3}, \\sqrt{3}, 3 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, \\sqrt{3}, -\\sqrt{3}, 5 \\sqrt{3}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{5 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.sqrt(3), 5*math.sqrt(3), math.sqrt(3), 5*math.sqrt(3), 4*math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3), 4*math.sqrt(3), math.sqrt(3), math.sqrt(3), 5*math.sqrt(3), 3*math.sqrt(3), 4*math.sqrt(3), -math.sqrt(3), 5*math.sqrt(3), math.sqrt(3), 3*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), math.sqrt(3), -math.sqrt(3), 5*math.sqrt(3), 5*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{8}{3}, 20, \\frac{59}{3}}$.\n", - "Output Answer": [ - "$\\frac{7080}{1123}$" - ], - "Output Program": [ - "import statistics\nvalues = (8/3), 20, (59/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, -5, 216}$.\n", - "Output Answer": [ - "$6 \\sqrt[3]{-5} 3^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -5, 216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{6}{e}, \\frac{26}{e}, -\\frac{18}{e}, -\\frac{19}{e}, \\frac{24}{e}, \\frac{25}{e}, -\\frac{11}{e}, -\\frac{27}{e}}$.\n", - "Output Answer": [ - "$\\frac{3}{4 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (6/math.e), (26/math.e), -(18/math.e), -(19/math.e), (24/math.e), (25/math.e), -(11/math.e), -(27/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, 15, -6, -4, 10}$.\n", - "Output Answer": [ - "$\\frac{191}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 15, -6, -4, 10\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, -125, 1, 4, -2, 46656}$.\n", - "Output Answer": [ - "$12 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, -125, 1, 4, -2, 46656\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2, -3, -\\frac{29}{\\pi }, -7, -6 \\sqrt{2}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-\\frac{29}{\\pi }, -6 \\sqrt{2}, -7, -3, 2, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2, -3, -(29/math.pi), -7, -6*math.sqrt(2), 3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{31}{5}, -7, 6, -4.8, -6, \\frac{7}{2}, 7, -9}$.\n", - "Output Answer": [ - "${-9, -7, -6, -4.8, \\frac{7}{2}, 6, \\frac{31}{5}, 7}$" - ], - "Output Program": [ - "values = (31/5), -7, 6, -4.8, -6, (7/2), 7, -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${7, 2, -9, 2, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{763}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 2, -9, 2, 15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-7 \\sqrt{2}, 6, \\frac{13}{5}, -8, -2, \\frac{19}{4}, -\\frac{24}{7}, -3, 7}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7*math.sqrt(2), 6, (13/5), -8, -2, (19/4), -(24/7), -3, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.055,0.092,0.225,0.082,0.047,0.266,0.136\\}$ and $\\{0.044,0.084,0.316,0.081,0.149,0.072,0.234\\}$.", - "Output Answer": [ - "$0.26$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.055, 0.092, 0.225, 0.082, 0.047, 0.266, 0.136\ndistribution2 = 0.044, 0.084, 0.316, 0.081, 0.149, 0.072, 0.234\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-7 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -6.97, -4, -7 \\log (2), 9} \\cup {-\\frac{5}{\\sqrt{2}}, -1, -7 \\log (2), -7 \\sqrt{2}, -6.97, 9}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -6.97, -7 \\log (2), -4, -\\frac{5}{\\sqrt{2}}, -1, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-7*math.sqrt(2), -(5/(math.sqrt(2))), -6.97, -4, -7*math.log(2), 9,))\nsnd = set((-(5/(math.sqrt(2))), -1, -7*math.log(2), -7*math.sqrt(2), -6.97, 9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{5}{\\sqrt{\\pi }}, 0}$.\n", - "Output Answer": [ - "$\\frac{5}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(5/(math.sqrt(math.pi))), 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 0, -3, 7}$.\n", - "Output Answer": [ - "$\\frac{1}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 0, -3, 7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 27, 8, 729, 10}$.\n", - "Output Answer": [ - "$3 \\sqrt[5]{5} 6^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 27, 8, 729, 10\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, 6, 8, 12}$.\n", - "Output Answer": [ - "$\\frac{3 \\sqrt{65}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 6, 8, 12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{1}{2}, 0, \\frac{5}{2}, 9 \\log (2), \\frac{5}{3}, -10, -8, 6} \\cup {-5, 6, -4, \\frac{11}{2}, 0, -10, -\\frac{28}{3}, 9 \\log (2)}$.\n", - "Output Answer": [ - "${-10, -\\frac{28}{3}, -8, -5, -4, 0, \\frac{1}{2}, \\frac{5}{3}, \\frac{5}{2}, \\frac{11}{2}, 6, 9 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/2), 0, (5/2), 9*math.log(2), (5/3), -10, -8, 6,))\nsnd = set((-5, 6, -4, (11/2), 0, -10, -(28/3), 9*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.1 x^2-2. x-0.9$ where $x \\sim $ \\text{PoissonDistribution}[1.5]\n", - "Output Answer": [ - "$-3.52$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.5)\nprint(E(0.1*x**2-2.*x-0.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 7, 2, 14}$.\n", - "Output Answer": [ - "$\\frac{14}{3}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 7, 2, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.2 x-0.4$ where $x \\sim $ \\text{BetaDistribution}[1.5,1.5]\n", - "Output Answer": [ - "$1.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.5, 1.5)\nprint(E(4.2*x-0.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -5 \\log (2), 7}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -5*math.log(2), 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${8, 6, 1, -8, -6, -3 \\sqrt{3}, -\\frac{4}{\\sqrt{5}}, 3 \\sqrt{5}, -\\frac{10}{\\sqrt{3}}, 0, \\log (2)}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 6, 1, -8, -6, -3*math.sqrt(3), -(4/(math.sqrt(5))), 3*math.sqrt(5), -(10/(math.sqrt(3))), 0, math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x^2+5. x-4.3$ where $x \\sim $ \\text{BetaDistribution}[0.3,0.4]\n", - "Output Answer": [ - "$-1.96$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 0.4)\nprint(E(0.6*x**2+5.*x-4.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.083,0.22,0.236,0.042,0.159,0.005,0.098,0.109\\}$ and $\\{0.062,0.092,0.038,0.143,0.281,0.088,0.158,0.049\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.083, 0.22, 0.236, 0.042, 0.159, 0.005, 0.098, 0.109\ndistribution2 = 0.062, 0.092, 0.038, 0.143, 0.281, 0.088, 0.158, 0.049\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-32768, 81, 1024, 216, 10000}$.\n", - "Output Answer": [ - "$192 \\sqrt[5]{-1} 5^{4/5} 6^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -32768, 81, 1024, 216, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.2 x^3-0.8 x^2-1.9 x-4.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.7]\n", - "Output Answer": [ - "$-5.68$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.7)\nprint(E(-0.2*x**3-0.8*x**2-1.9*x-4.9))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{20}{e}, -\\frac{7}{e}, \\frac{6}{e}, \\frac{17}{e}, -\\frac{19}{e}, \\frac{26}{e}, -\\frac{14}{e}, -\\frac{21}{e}, -\\frac{5}{e}, \\frac{10}{e}, -\\frac{6}{e}} \\cap {\\frac{8}{e}, \\frac{16}{e}, -\\frac{8}{e}, -\\frac{7}{e}, \\frac{19}{e}, -\\frac{22}{e}, -\\frac{23}{e}, -\\frac{17}{e}, -\\frac{1}{e}, \\frac{7}{e}, -\\frac{26}{e}}$.\n", - "Output Answer": [ - "${-\\frac{7}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(20/math.e), -(7/math.e), (6/math.e), (17/math.e), -(19/math.e), (26/math.e), -(14/math.e), -(21/math.e), -(5/math.e), (10/math.e), -(6/math.e),))\nsnd = set(((8/math.e), (16/math.e), -(8/math.e), -(7/math.e), (19/math.e), -(22/math.e), -(23/math.e), -(17/math.e), -(1/math.e), (7/math.e), -(26/math.e),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-0.2, -8.78, 3, -8, -\\frac{12}{5}, -4} \\cup {-9.8, 3, -\\frac{39}{5}, -4, -2 \\pi, -8.78}$.\n", - "Output Answer": [ - "${-9.8, -8.78, -8, -\\frac{39}{5}, -2 \\pi, -4, -\\frac{12}{5}, -0.2, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.2, -8.78, 3, -8, -(12/5), -4,))\nsnd = set((-9.8, 3, -(39/5), -4, -2*math.pi, -8.78,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{16}{\\sqrt{\\pi }}, 2, \\frac{2}{\\pi }, 6, 3 \\sqrt{3}, -7, -9, -9.52}$.\n", - "Output Answer": [ - "${-9.52, -\\frac{16}{\\sqrt{\\pi }}, -9, -7, \\frac{2}{\\pi }, 2, 3 \\sqrt{3}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -(16/(math.sqrt(math.pi))), 2, (2/math.pi), 6, 3*math.sqrt(3), -7, -9, -9.52\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.2 x-4.5$ where $x \\sim $ \\text{NormalDistribution}[-1.2,0.9]\n", - "Output Answer": [ - "$-4.74$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.2, 0.9)\nprint(E(0.2*x-4.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, 1, 5, -6, 5, 5, -6, -5, -6, 6, -3, -2, -3, -6, 1, -5, 5, -6, 1, 5}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, 1, 5, -6, 5, 5, -6, -5, -6, 6, -3, -2, -3, -6, 1, -5, 5, -6, 1, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-32, -8, 16, 32, -1, 25}$.\n", - "Output Answer": [ - "$4 \\sqrt[6]{-1} 2^{5/6} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -32, -8, 16, 32, -1, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{8}{7}, -\\frac{66}{7}, -\\frac{23}{7}, \\frac{47}{7}, -\\frac{61}{7}, \\frac{2}{7}}$.\n", - "Output Answer": [ - "$-\\frac{31}{14}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (8/7), -(66/7), -(23/7), (47/7), -(61/7), (2/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, \\frac{58}{7}, -\\frac{50}{7}, \\frac{22}{7}, -\\frac{9}{7}, -\\frac{34}{7}, \\frac{23}{7}}$.\n", - "Output Answer": [ - "$-\\frac{11}{49}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, (58/7), -(50/7), (22/7), -(9/7), -(34/7), (23/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -2 e, 9, -2, 9, \\frac{5}{2}}$.\n", - "Output Answer": [ - "$9+2 e$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -2*math.e, 9, -2, 9, (5/2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{3}{2}, \\frac{2}{\\sqrt{\\pi }}, 9, -8}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{3}{2}+\\frac{2}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (3/2), (2/(math.sqrt(math.pi))), 9, -8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^2-4.1 x-4.5$ where $x \\sim $ \\text{BetaDistribution}[0.6,0.6]\n", - "Output Answer": [ - "$-7.97$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.6, 0.6)\nprint(E(-3.9*x**2-4.1*x-4.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -5, 4, 4, -5, 1, 4, 1, 6, -5, 1, 1, 6, 6, 4, 6, -5, 1, 1, 4, -5, 6, -5, 6, 1, -5, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -5, 4, 4, -5, 1, 4, 1, 6, -5, 1, 1, 6, 6, 4, 6, -5, 1, 1, 4, -5, 6, -5, 6, 1, -5, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.8 x^3-0.8 x^2+4.2 x+0.4$ where $x \\sim $ \\text{NormalDistribution}[-0.8,2.]\n", - "Output Answer": [ - "$41.87$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.8, 2.)\nprint(E(-4.8*x**3-0.8*x**2+4.2*x+0.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{5}{4}, 3 \\sqrt{5}, -4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, \\frac{5}{4}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = (5/4), 3*math.sqrt(5), -4*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -\\frac{9}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, 0, -\\frac{9}{\\sqrt{2}}, 0, \\frac{5}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, 0, -\\frac{7}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, \\frac{5}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, -\\frac{9}{\\sqrt{2}}, 0, 0, 0, -\\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, -(9/(math.sqrt(2))), (7/(math.sqrt(2))), (7/(math.sqrt(2))), (7/(math.sqrt(2))), 0, -(9/(math.sqrt(2))), 0, (5/(math.sqrt(2))), (5/(math.sqrt(2))), 0, -(7/(math.sqrt(2))), -(9/(math.sqrt(2))), (5/(math.sqrt(2))), (7/(math.sqrt(2))), -(9/(math.sqrt(2))), 0, 0, 0, -(9/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-7 \\sqrt{2}, \\frac{19}{e}, -1}$.\n", - "Output Answer": [ - "${-7 \\sqrt{2}, -1, \\frac{19}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7*math.sqrt(2), (19/math.e), -1\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, -2, -15, 4}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{197}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -2, -15, 4\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${19, 14, 5, 17}$.\n", - "Output Answer": [ - "$\\frac{90440}{8657}$" - ], - "Output Program": [ - "import statistics\nvalues = 19, 14, 5, 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{17}{7}, -2 \\pi, 1, 9, -\\frac{29}{5}, \\frac{13}{e}, -9, 2 \\sqrt{3}, -4 \\sqrt{5}, 0, -\\frac{3}{7}, -10, \\frac{8}{\\pi }}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (17/7), -2*math.pi, 1, 9, -(29/5), (13/math.e), -9, 2*math.sqrt(3), -4*math.sqrt(5), 0, -(3/7), -10, (8/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, -12, -5, 6}$.\n", - "Output Answer": [ - "$\\frac{835}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -12, -5, 6\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, 262144, 1, -27, 49, 46656}$.\n", - "Output Answer": [ - "$96 \\sqrt[6]{-1} \\sqrt{3} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, 262144, 1, -27, 49, 46656\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.2 x^2-2.6 x-1.4$ where $x \\sim $ \\text{BetaDistribution}[0.3,2.]\n", - "Output Answer": [ - "$-1.75$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.3, 2.)\nprint(E(-0.2*x**2-2.6*x-1.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{11}{e}, -6, 8, \\frac{24}{\\pi }, \\frac{22}{\\sqrt{5}}, -9, 4, -2 \\pi}$.\n", - "Output Answer": [ - "$9+\\frac{22}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(11/math.e), -6, 8, (24/math.pi), (22/(math.sqrt(5))), -9, 4, -2*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\pi, -9, -2, -9, -4, -9, -9, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$9+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, math.pi, -9, -2, -9, -4, -9, -9, 5*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 3, 4, 6, 6, -2, 3, -2, 9, -2, 4, -2, 3, 4, 4, -2, 6, 3, 10, 4, 3, 9, 6, 8}$.\n", - "Output Answer": [ - "$\\{3,4,-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 3, 4, 6, 6, -2, 3, -2, 9, -2, 4, -2, 3, 4, 4, -2, 6, 3, 10, 4, 3, 9, 6, 8\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.519,0.027,0.397\\}$ and $\\{0.243,0.206,0.216\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.519, 0.027, 0.397\ndistribution2 = 0.243, 0.206, 0.216\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, -8, 2, 3, -3, 4, 2, 2, 4, 3, 3, 4, 4, -3, -8, 5, 4, -3, 3, 5, 4, -3, 2, -8, -8, 2, 3, 5, 4}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, -8, 2, 3, -3, 4, 2, 2, 4, 3, 3, 4, 4, -3, -8, 5, 4, -3, 3, 5, 4, -3, 2, -8, -8, 2, 3, 5, 4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${64, -1000, 59049, -8, -1, 4}$.\n", - "Output Answer": [ - "$12 \\sqrt[6]{-1} \\sqrt[3]{2} 3^{2/3} \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = 64, -1000, 59049, -8, -1, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-125, 1000, 1000}$.\n", - "Output Answer": [ - "$500 \\sqrt[3]{-1}$" - ], - "Output Program": [ - "import math\n\nvalues = -125, 1000, 1000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${1, 2, 3, 1, \\frac{8}{e}}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, 2, 3, 1, (8/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-6, -7, -9, 9, -5} \\cap {-9, 5, 4, -8}$.\n", - "Output Answer": [ - "${-9}$" - ], - "Output Program": [ - "fst = set((-6, -7, -9, 9, -5,))\nsnd = set((-9, 5, 4, -8,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{39}{4}, -14 \\log (2), 2, -\\frac{10}{\\sqrt{3}}, -10}$.\n", - "Output Answer": [ - "${-10, -\\frac{39}{4}, -14 \\log (2), -\\frac{10}{\\sqrt{3}}, 2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(39/4), -14*math.log(2), 2, -(10/(math.sqrt(3))), -10\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.13,0.241,0.24,0.363\\}$ and $\\{0.156,0.156,0.179,0.36\\}$.", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.13, 0.241, 0.24, 0.363\ndistribution2 = 0.156, 0.156, 0.179, 0.36\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\pi, \\frac{11}{4}, 2 \\sqrt{2}, 6, 8, -8, -1} \\cup {-7, 8, -8, 2 \\sqrt{2}, -5, -3 \\pi}$.\n", - "Output Answer": [ - "${-3 \\pi, -8, -7, -5, -1, \\frac{11}{4}, 2 \\sqrt{2}, 6, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.pi, (11/4), 2*math.sqrt(2), 6, 8, -8, -1,))\nsnd = set((-7, 8, -8, 2*math.sqrt(2), -5, -3*math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-3 \\sqrt{3}, -\\frac{17}{e}, -2, 9.7}$.\n", - "Output Answer": [ - "${-\\frac{17}{e}, -3 \\sqrt{3}, -2, 9.7}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(3), -(17/math.e), -2, 9.7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{21}{e}, \\frac{3}{e}, -\\frac{6}{e}, -\\frac{5}{e}, -\\frac{14}{e}}$.\n", - "Output Answer": [ - "$-\\frac{43}{5 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(21/math.e), (3/math.e), -(6/math.e), -(5/math.e), -(14/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{13}{7}, -1, -\\frac{64}{7}, -\\frac{38}{7}, \\frac{67}{7}, \\frac{24}{7}, -\\frac{2}{7}, 0}$.\n", - "Output Answer": [ - "$-\\frac{33}{56}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(13/7), -1, -(64/7), -(38/7), (67/7), (24/7), -(2/7), 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -10, 9, -4, -10, 9, -10, 4, 9, 9, -5, -10, -4, 9, -4, 6, -5, -4, -5, 6, -10, 6, 9}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -10, 9, -4, -10, 9, -10, 4, 9, 9, -5, -10, -4, 9, -4, 6, -5, -4, -5, 6, -10, 6, 9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, 7, -512}$.\n", - "Output Answer": [ - "$80 \\sqrt[3]{-7}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, 7, -512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-9, 3, 0, 1, 3, -\\frac{12}{5}, -3, 10}$.\n", - "Output Answer": [ - "${-9, -3, -\\frac{12}{5}, 0, 1, 3, 3, 10}$" - ], - "Output Program": [ - "values = -9, 3, 0, 1, 3, -(12/5), -3, 10\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${8, 3 e, -2}$.\n", - "Output Answer": [ - "${-2, 8, 3 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 3*math.e, -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{7}{3}, 6, \\frac{31}{3}}$.\n", - "Output Answer": [ - "$\\frac{3906}{901}$" - ], - "Output Program": [ - "import statistics\nvalues = (7/3), 6, (31/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-10, -14, -3, -2}$.\n", - "Output Answer": [ - "$\\frac{395}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -14, -3, -2\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, -\\log (2), 5, -9, 6, -4, -8, \\frac{6}{\\sqrt{\\pi }}, -9, -6}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -math.log(2), 5, -9, 6, -4, -8, (6/(math.sqrt(math.pi))), -9, -6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-10, 3 \\pi, \\frac{16}{\\sqrt{3}}, -7, -\\frac{4}{\\pi }, 2 \\log (2), -\\frac{17}{\\sqrt{5}}} \\setminus {-6 \\log (2), -5, \\frac{9}{\\pi }, 3 \\pi}$.\n", - "Output Answer": [ - "${-10, -\\frac{17}{\\sqrt{5}}, -7, -\\frac{4}{\\pi }, 2 \\log (2), \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, 3*math.pi, (16/(math.sqrt(3))), -7, -(4/math.pi), 2*math.log(2), -(17/(math.sqrt(5))),))\nsnd = set((-6*math.log(2), -5, (9/math.pi), 3*math.pi,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{23}{4}, -4, 2 \\log (2)}$.\n", - "Output Answer": [ - "${-4, 2 \\log (2), \\frac{23}{4}}$" - ], - "Output Program": [ - "import math\n\nvalues = (23/4), -4, 2*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4, 0, 4, 4, -7, 0, -7, -7, 0, -7, -7, -7, -7, -7, 0, -7, -7, 0, 8, 4, 8, 0, -7, 8, -7, -7, -7, 8, 0}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 4, 0, 4, 4, -7, 0, -7, -7, 0, -7, -7, -7, -7, -7, 0, -7, -7, 0, 8, 4, 8, 0, -7, 8, -7, -7, -7, 8, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 17, 3, 8}$.\n", - "Output Answer": [ - "$\\frac{4896}{769}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 17, 3, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x^3+3.6 x^2-4.1 x+5.9$ where $x \\sim $ \\text{ExponentialDistribution}[1.]\n", - "Output Answer": [ - "$14.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(E(0.9*x**3+3.6*x**2-4.1*x+5.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{3}, \\frac{14}{3}}$.\n", - "Output Answer": [ - "$\\frac{140}{57}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/3), (14/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3, -5, 1, \\frac{4}{\\pi }, -4 \\log (2), -6, 4, -4} \\cup {-4, \\frac{29}{\\pi }, -5, -6, -7, 3, -4 \\log (2)}$.\n", - "Output Answer": [ - "${-7, -6, -5, -4, -4 \\log (2), 1, \\frac{4}{\\pi }, 3, 4, \\frac{29}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -5, 1, (4/math.pi), -4*math.log(2), -6, 4, -4,))\nsnd = set((-4, (29/math.pi), -5, -6, -7, 3, -4*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, -1000, 81, -125}$.\n", - "Output Answer": [ - "$15\\ 2^{3/4} \\sqrt{35}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, -1000, 81, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.8 x^3+1.2 x^2+4.3 x+0.6$ where $x \\sim $ \\text{BetaDistribution}[1.6,1.3]\n", - "Output Answer": [ - "$4.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 1.3)\nprint(E(3.8*x**3+1.2*x**2+4.3*x+0.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-10, -\\frac{12}{\\sqrt{5}}, 0, 9., -\\frac{25}{3}} \\setminus {-\\frac{12}{\\sqrt{5}}, -3.07, 0, -10, 9.}$.\n", - "Output Answer": [ - "${-\\frac{25}{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-10, -(12/(math.sqrt(5))), 0, 9., -(25/3),))\nsnd = set((-(12/(math.sqrt(5))), -3.07, 0, -10, 9.,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, 10, -7, 0, -6, -2}$.\n", - "Output Answer": [ - "$-\\frac{13}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, 10, -7, 0, -6, -2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -4, \\frac{9}{\\sqrt{2}}, 7, -2 e, -5 \\sqrt{3}} \\cup {5, 5 \\sqrt{3}, \\frac{9}{\\sqrt{2}}, 8, -2 e, -8, 4}$.\n", - "Output Answer": [ - "${-5 \\sqrt{3}, -8, -2 e, -4, 4, 5, \\frac{9}{\\sqrt{2}}, 7, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -4, (9/(math.sqrt(2))), 7, -2*math.e, -5*math.sqrt(3),))\nsnd = set((5, 5*math.sqrt(3), (9/(math.sqrt(2))), 8, -2*math.e, -8, 4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{26}{\\pi }, \\frac{6}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{16}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (26/math.pi), (6/math.pi)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, -\\frac{1}{\\sqrt{3}}, 8, -10, -7, 4}$.\n", - "Output Answer": [ - "${-10, -7, -\\frac{1}{\\sqrt{3}}, 4, 8, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -(1/(math.sqrt(3))), 8, -10, -7, 4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 4096, -3, 1000, 117649, 81}$.\n", - "Output Answer": [ - "$84 \\sqrt[6]{-3} \\sqrt{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 4096, -3, 1000, 117649, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6.3, -5, -\\frac{21}{e}, -2.256, 0.12} \\setminus {-\\frac{21}{e}, 0.12, -6.3, 9.959, 0, 3}$.\n", - "Output Answer": [ - "${-5, -2.256}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6.3, -5, -(21/math.e), -2.256, 0.12,))\nsnd = set((-(21/math.e), 0.12, -6.3, 9.959, 0, 3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{8}{e}, \\frac{15}{e}, -\\frac{8}{e}, -\\frac{8}{e}, \\frac{15}{e}, \\frac{3}{e}, \\frac{3}{e}, -\\frac{13}{e}, \\frac{3}{e}, \\frac{15}{e}, \\frac{3}{e}, \\frac{3}{e}, \\frac{3}{e}, \\frac{3}{e}, -\\frac{13}{e}, -\\frac{13}{e}, \\frac{15}{e}, \\frac{3}{e}, \\frac{15}{e}, \\frac{3}{e}, -\\frac{8}{e}, -\\frac{8}{e}, -\\frac{8}{e}, \\frac{3}{e}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{3}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(8/math.e), (15/math.e), -(8/math.e), -(8/math.e), (15/math.e), (3/math.e), (3/math.e), -(13/math.e), (3/math.e), (15/math.e), (3/math.e), (3/math.e), (3/math.e), (3/math.e), -(13/math.e), -(13/math.e), (15/math.e), (3/math.e), (15/math.e), (3/math.e), -(8/math.e), -(8/math.e), -(8/math.e), (3/math.e)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${9, 3, -2, -\\frac{4}{\\pi }, \\frac{19}{4}, 0} \\setminus {-2, -3, -8, -\\frac{6}{\\sqrt{5}}, 7.83, -\\frac{4}{\\pi }, 3, \\frac{19}{4}}$.\n", - "Output Answer": [ - "${0, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 3, -2, -(4/math.pi), (19/4), 0,))\nsnd = set((-2, -3, -8, -(6/(math.sqrt(5))), 7.83, -(4/math.pi), 3, (19/4),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{29}{4}, 7, 8} \\setminus {\\pi, -3, \\frac{35}{4}, -5, 7}$.\n", - "Output Answer": [ - "${-\\frac{29}{4}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(29/4), 7, 8,))\nsnd = set((math.pi, -3, (35/4), -5, 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${6, \\frac{18}{5}, -6 \\log (2), -3, -\\frac{3}{e}} \\cup {14 \\log (2), 6, -3, \\frac{18}{5}, \\frac{27}{e}}$.\n", - "Output Answer": [ - "${-6 \\log (2), -3, -\\frac{3}{e}, \\frac{18}{5}, 6, 14 \\log (2), \\frac{27}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, (18/5), -6*math.log(2), -3, -(3/math.e),))\nsnd = set((14*math.log(2), 6, -3, (18/5), (27/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 7, -6}$.\n", - "Output Answer": [ - "$-\\frac{5}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 7, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 1, -3125, -8, 81}$.\n", - "Output Answer": [ - "$5\\ 2^{3/5} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 1, -3125, -8, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5, -1, -10, -5, -1, -1, -10, -1, -10, -10, -10, -1, -1, -10, -5, -5, -5, -6, -6, -5, -5, -10, -10, -1, -6, -1, -6}$.\n", - "Output Answer": [ - "$\\{-1,-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -5, -1, -10, -5, -1, -1, -10, -1, -10, -10, -10, -1, -1, -10, -5, -5, -5, -6, -6, -5, -5, -10, -10, -1, -6, -1, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, 10, 15, 11}$.\n", - "Output Answer": [ - "$\\frac{257}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, 10, 15, 11\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, 6, -4, -4, -7, -7, -7, 8, 6, 6, 6, -7, 5, 8, 5, 8, 6, -4, 8, -4, -7, 6, 8, 5, -7, 5, 5, -4}$.\n", - "Output Answer": [ - "$\\{6,-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, 6, -4, -4, -7, -7, -7, 8, 6, 6, 6, -7, 5, 8, 5, 8, 6, -4, 8, -4, -7, 6, 8, 5, -7, 5, 5, -4\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{21}{\\pi }, -\\frac{6}{\\pi }, -\\frac{22}{\\pi }, \\frac{12}{\\pi }, -\\frac{23}{\\pi }, -\\frac{6}{\\pi }, -\\frac{19}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{43}{7 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (21/math.pi), -(6/math.pi), -(22/math.pi), (12/math.pi), -(23/math.pi), -(6/math.pi), -(19/math.pi)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{43}{3}, \\frac{59}{3}, \\frac{5}{3}, \\frac{50}{3}}$.\n", - "Output Answer": [ - "$\\frac{507400}{99021}$" - ], - "Output Program": [ - "import statistics\nvalues = (43/3), (59/3), (5/3), (50/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9 \\log (2), -2}$.\n", - "Output Answer": [ - "$9 \\log (2)-2$" - ], - "Output Program": [ - "import math\n\nvalues = -9*math.log(2), -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, -9, -14, -10}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{314}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, -9, -14, -10\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-6.8, \\sqrt{5}, 1, -\\frac{10}{\\sqrt{3}}, 9.3, -5} \\cup {-2, -4 \\sqrt{5}, 1, -3 \\sqrt{3}, 9.8, 0, 9.3, -5}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -6.8, -\\frac{10}{\\sqrt{3}}, -3 \\sqrt{3}, -5, -2, 0, 1, \\sqrt{5}, 9.3, 9.8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6.8, math.sqrt(5), 1, -(10/(math.sqrt(3))), 9.3, -5,))\nsnd = set((-2, -4*math.sqrt(5), 1, -3*math.sqrt(3), 9.8, 0, 9.3, -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.233,0.337,0.1,0.041,0.241\\}$ and $\\{0.639,0.038,0.184,0.123,0.009\\}$.", - "Output Answer": [ - "$1.29$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.233, 0.337, 0.1, 0.041, 0.241\ndistribution2 = 0.639, 0.038, 0.184, 0.123, 0.009\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6, \\frac{3}{\\sqrt{2}}, 7, \\frac{16}{\\sqrt{3}}, e, -7, 4 \\sqrt{2}, 5, -\\frac{1}{3}, \\frac{11}{2}, -7, 3, -\\frac{9}{\\sqrt{2}}, -2}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{3}{\\sqrt{2}}+e\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, (3/(math.sqrt(2))), 7, (16/(math.sqrt(3))), math.e, -7, 4*math.sqrt(2), 5, -(1/3), (11/2), -7, 3, -(9/(math.sqrt(2))), -2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, 1, 0, 9, 8} \\setminus {-\\frac{25}{\\pi }, 1, 8, 9, -10, 4, 0}$.\n", - "Output Answer": [ - "${}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 1, 0, 9, 8,))\nsnd = set((-(25/math.pi), 1, 8, 9, -10, 4, 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, 11, -9, 5, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{411}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 11, -9, 5, 12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, 2, -\\frac{3}{\\sqrt{\\pi }}, -4, -1, -9, 4 \\sqrt{2}, -10, 7, -\\frac{3}{4}, 3, \\frac{19}{5}}$.", - "Output Answer": [ - "$\\frac{5}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, 2, -(3/(math.sqrt(math.pi))), -4, -1, -9, 4*math.sqrt(2), -10, 7, -(3/4), 3, (19/5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1000, -6, 25}$.\n", - "Output Answer": [ - "$10\\ 5^{2/3} \\sqrt[3]{6}$" - ], - "Output Program": [ - "import math\n\nvalues = -1000, -6, 25\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3 \\pi, 2 \\pi, 2 \\pi}$.\n", - "Output Answer": [ - "$\\frac{7 \\pi }{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 3*math.pi, 2*math.pi, 2*math.pi\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, 2, 0, \\frac{13}{2}, 3 \\sqrt{2}, -2, \\frac{9}{4}, 4, 3, -1, -4 e, 1, \\frac{12}{\\sqrt{\\pi }}, 3 \\sqrt{5}, -\\frac{15}{\\pi }}$.\n", - "Output Answer": [ - "$9+4 e$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 2, 0, (13/2), 3*math.sqrt(2), -2, (9/4), 4, 3, -1, -4*math.e, 1, (12/(math.sqrt(math.pi))), 3*math.sqrt(5), -(15/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, 9, -4, 2, 0, 10}$.\n", - "Output Answer": [ - "$\\frac{23}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, 9, -4, 2, 0, 10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x^2+2.5 x-1.7$ where $x \\sim $ \\text{ExponentialDistribution}[0.3]\n", - "Output Answer": [ - "$-53.37$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.3)\nprint(E(-2.7*x**2+2.5*x-1.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, 5, 15, -8}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{509}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 5, 15, -8\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, 1, \\frac{35}{2}}$.\n", - "Output Answer": [ - "$\\frac{35}{24}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, 1, (35/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, \\frac{4}{\\pi }, 6, 10, 0, \\sqrt{2}, -\\frac{4}{3}, 4, 9, -6, 4, -1, -5 \\sqrt{3}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$10+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, (4/math.pi), 6, 10, 0, math.sqrt(2), -(4/3), 4, 9, -6, 4, -1, -5*math.sqrt(3), 3*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2 \\pi, -5, -7, 4}$.\n", - "Output Answer": [ - "${-7, -2 \\pi, -5, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.pi, -5, -7, 4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $5.38 < 3.1 x+1.6 < 7.37$ where $x \\sim $ \\text{ExponentialDistribution}[0.4].", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(P((5.38 < 3.1*x+1.6) & (3.1*x+1.6 < 7.37)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{10}{e}, -\\frac{23}{e}, -\\frac{12}{e}, -\\frac{12}{e}, -\\frac{12}{e}, -\\frac{12}{e}, -\\frac{10}{e}, -\\frac{10}{e}, -\\frac{18}{e}, -\\frac{18}{e}, -\\frac{23}{e}, -\\frac{23}{e}, -\\frac{18}{e}, -\\frac{23}{e}, -\\frac{23}{e}, -\\frac{18}{e}, -\\frac{12}{e}, -\\frac{23}{e}, -\\frac{10}{e}, -\\frac{12}{e}, -\\frac{10}{e}, -\\frac{12}{e}, -\\frac{10}{e}, -\\frac{10}{e}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{10}{e},-\\frac{12}{e}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(10/math.e), -(23/math.e), -(12/math.e), -(12/math.e), -(12/math.e), -(12/math.e), -(10/math.e), -(10/math.e), -(18/math.e), -(18/math.e), -(23/math.e), -(23/math.e), -(18/math.e), -(23/math.e), -(23/math.e), -(18/math.e), -(12/math.e), -(23/math.e), -(10/math.e), -(12/math.e), -(10/math.e), -(12/math.e), -(10/math.e), -(10/math.e)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, -15, -15, 15, 15, -9}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{5957}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -15, -15, 15, 15, -9\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-2.29 < -0.6 x^2+3.5 x-1.9 < 4.45$ where $x \\sim $ \\text{LaplaceDistribution}[0,2.].", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 2.)\nprint(P((-2.29 < -0.6*x**2+3.5*x-1.9) & (-0.6*x**2+3.5*x-1.9 < 4.45)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 2 \\sqrt{2}, -6 \\sqrt{2}, -6 \\sqrt{2}, -3 \\sqrt{2}, -4 \\sqrt{2}, 0, -2 \\sqrt{2}, -3 \\sqrt{2}, -4 \\sqrt{2}, 0, -4 \\sqrt{2}, -3 \\sqrt{2}, 3 \\sqrt{2}, 3 \\sqrt{2}, 3 \\sqrt{2}, 2 \\sqrt{2}, -6 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, 3 \\sqrt{2}, -6 \\sqrt{2}, -2 \\sqrt{2}, 2 \\sqrt{2}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{-3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 2*math.sqrt(2), -6*math.sqrt(2), -6*math.sqrt(2), -3*math.sqrt(2), -4*math.sqrt(2), 0, -2*math.sqrt(2), -3*math.sqrt(2), -4*math.sqrt(2), 0, -4*math.sqrt(2), -3*math.sqrt(2), 3*math.sqrt(2), 3*math.sqrt(2), 3*math.sqrt(2), 2*math.sqrt(2), -6*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), 3*math.sqrt(2), -6*math.sqrt(2), -2*math.sqrt(2), 2*math.sqrt(2), -3*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6 \\sqrt{2}, 5 \\sqrt{3}, 2 \\sqrt{3}, 3}$.\n", - "Output Answer": [ - "${3, 2 \\sqrt{3}, 6 \\sqrt{2}, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 6*math.sqrt(2), 5*math.sqrt(3), 2*math.sqrt(3), 3\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x^3+5. x^2+1.3 x+4.8$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$154.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(0.9*x**3+5.*x**2+1.3*x+4.8))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6 \\log (2), 8, -2 \\sqrt{3}, -8, -8 \\log (2), 8, -\\sqrt{5}, -2, -\\frac{6}{\\sqrt{\\pi }}, 3, -9, \\frac{44}{7}, \\frac{31}{5}}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6*math.log(2), 8, -2*math.sqrt(3), -8, -8*math.log(2), 8, -math.sqrt(5), -2, -(6/(math.sqrt(math.pi))), 3, -9, (44/7), (31/5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, 3 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, 0, 0, 4 \\sqrt{5}, -4 \\sqrt{5}, 0, 0, -4 \\sqrt{5}, 0, 4 \\sqrt{5}, 4 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, -4 \\sqrt{5}, 0, 0, -4 \\sqrt{5}, -4 \\sqrt{5}, 4 \\sqrt{5}, 3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-4 \\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), 3*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), 0, 0, 4*math.sqrt(5), -4*math.sqrt(5), 0, 0, -4*math.sqrt(5), 0, 4*math.sqrt(5), 4*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), -4*math.sqrt(5), 0, 0, -4*math.sqrt(5), -4*math.sqrt(5), 4*math.sqrt(5), 3*math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, -6, 1, -7}$.\n", - "Output Answer": [ - "$-\\frac{5}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, -6, 1, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-3, 6, -1, \\frac{24}{e}, -8} \\setminus {-1, 0, -8, -3, -2, 9, \\frac{24}{e}}$.\n", - "Output Answer": [ - "${6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 6, -1, (24/math.e), -8,))\nsnd = set((-1, 0, -8, -3, -2, 9, (24/math.e),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 14, -10, 2, -13, -12}$.\n", - "Output Answer": [ - "$\\frac{1642}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 14, -10, 2, -13, -12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, \\frac{13}{2}, 2, \\frac{3}{2}}$.\n", - "Output Answer": [ - "$\\frac{273}{95}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, (13/2), 2, (3/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.8 x-0.1$ where $x \\sim $ \\text{NormalDistribution}[0.,1.]\n", - "Output Answer": [ - "$-0.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0., 1.)\nprint(E(-1.8*x-0.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, -15, 11, 12}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{937}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -15, 11, 12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, -7, 1, -8, -6, 4}$.\n", - "Output Answer": [ - "$\\frac{346}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -7, 1, -8, -6, 4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{15}{e}, -8, 0, \\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-8, -\\frac{15}{e}, 0, \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/math.e), -8, 0, (17/(math.sqrt(3)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{7}{2}, -\\frac{26}{\\pi }, -6, -4, -3, 2, 3 \\sqrt{3}, 4.8, \\frac{7}{\\sqrt{2}}, -6 \\sqrt{3}} \\cup {-6, -1, \\frac{7}{2}, 4 \\sqrt{3}, -3, -6 \\sqrt{3}, 1, \\frac{7}{\\pi }, 1.5, 6}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -\\frac{26}{\\pi }, -6, -4, -3, -1, 1, 1.5, 2, \\frac{7}{\\pi }, \\frac{7}{2}, 4.8, \\frac{7}{\\sqrt{2}}, 3 \\sqrt{3}, 6, 4 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((7/2), -(26/math.pi), -6, -4, -3, 2, 3*math.sqrt(3), 4.8, (7/(math.sqrt(2))), -6*math.sqrt(3),))\nsnd = set((-6, -1, (7/2), 4*math.sqrt(3), -3, -6*math.sqrt(3), 1, (7/math.pi), 1.5, 6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.2 x^2+0.2 x+7.$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$-0.44$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(-2.2*x**2+0.2*x+7.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{7}{\\sqrt{\\pi }}, 2 e, 4, -\\pi, -\\frac{16}{e}}$.\n", - "Output Answer": [ - "${-\\frac{16}{e}, -\\pi, \\frac{7}{\\sqrt{\\pi }}, 4, 2 e}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/(math.sqrt(math.pi))), 2*math.e, 4, -math.pi, -(16/math.e)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.8 x^2+1.1 x-0.4$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.8]\n", - "Output Answer": [ - "$-5.58$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.8)\nprint(E(-0.8*x**2+1.1*x-0.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, 5, 2, 7}$.\n", - "Output Answer": [ - "$\\sqrt{26}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 5, 2, 7\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.056,0.118,0.058,0.116,0.089,0.195,0.08,0.114,0.02,0.079\\}$ and $\\{0.173,0.166,0.182,0.006,0.019,0.026,0.002,0.353,0.002,0.061\\}$.", - "Output Answer": [ - "$1.08$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.056, 0.118, 0.058, 0.116, 0.089, 0.195, 0.08, 0.114, 0.02, 0.079\ndistribution2 = 0.173, 0.166, 0.182, 0.006, 0.019, 0.026, 0.002, 0.353, 0.002, 0.061\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.022,0.289,0.309,0.03,0.064,0.261,0.013\\}$ and $\\{0.145,0.164,0.008,0.11,0.375,0.012,0.147\\}$.", - "Output Answer": [ - "$1.87$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.022, 0.289, 0.309, 0.03, 0.064, 0.261, 0.013\ndistribution2 = 0.145, 0.164, 0.008, 0.11, 0.375, 0.012, 0.147\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${12, -13, 3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{481}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 12, -13, 3\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -2, -7, -9, -2, -2, -2, -7, -2, 6, 4, -2, -9, -2, -2, -4, 6, 4, -4, 4, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -2, -7, -9, -2, -2, -2, -7, -2, 6, 4, -2, -9, -2, -2, -4, 6, 4, -4, 4, -2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, 10, 8}$.\n", - "Output Answer": [ - "$\\frac{1560}{157}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, 10, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3 \\pi, 6, \\frac{31}{4}, 0.3} \\cup {-3 \\pi, 4, -\\frac{11}{2}, 0.3}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\frac{11}{2}, 0.3, 4, 6, \\frac{31}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.pi, 6, (31/4), 0.3,))\nsnd = set((-3*math.pi, 4, -(11/2), 0.3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5, \\frac{13}{\\sqrt{3}}, -8, -5 \\sqrt{3}, -\\frac{39}{4}, \\frac{13}{3}} \\setminus {-5 \\log (2), 8, \\frac{13}{3}, -\\frac{13}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{39}{4}, -5 \\sqrt{3}, -8, 5, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, (13/(math.sqrt(3))), -8, -5*math.sqrt(3), -(39/4), (13/3),))\nsnd = set((-5*math.log(2), 8, (13/3), -(13/(math.sqrt(3))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x-1.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.7]\n", - "Output Answer": [ - "$-0.48$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.7)\nprint(E(1.4*x-1.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-8, -\\frac{27}{e}, 4, 7, -3 \\log (2), 2, -5, -\\frac{4}{\\sqrt{\\pi }}, 6 \\log (2), \\frac{7}{5}, -3, -7 \\sqrt{2}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{4}{\\sqrt{\\pi }}-3 \\log (2)\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, -(27/math.e), 4, 7, -3*math.log(2), 2, -5, -(4/(math.sqrt(math.pi))), 6*math.log(2), (7/5), -3, -7*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\pi, -\\pi, -\\pi, -3 \\pi, 3 \\pi, 3 \\pi, -3 \\pi, -\\pi, 3 \\pi, -\\pi, -3 \\pi, -\\pi, -\\pi, 0, -\\pi, 3 \\pi, 0, -3 \\pi, 3 \\pi, -\\pi, 3 \\pi, 3 \\pi, 0, 3 \\pi, -\\pi, -\\pi, 0, 3 \\pi, -3 \\pi, -\\pi}$.\n", - "Output Answer": [ - "$\\{-\\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.pi, -math.pi, -math.pi, -3*math.pi, 3*math.pi, 3*math.pi, -3*math.pi, -math.pi, 3*math.pi, -math.pi, -3*math.pi, -math.pi, -math.pi, 0, -math.pi, 3*math.pi, 0, -3*math.pi, 3*math.pi, -math.pi, 3*math.pi, 3*math.pi, 0, 3*math.pi, -math.pi, -math.pi, 0, 3*math.pi, -3*math.pi, -math.pi\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${1, \\frac{11}{2}, 16, 9}$.\n", - "Output Answer": [ - "$\\frac{6336}{2147}$" - ], - "Output Program": [ - "import statistics\nvalues = 1, (11/2), 16, 9\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, 5, -4, 6, -4, 6, 5, -9, -4, -7, 5, 9, -4, -4, -7, 6, -7, 5, 6, 6, 5}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, 5, -4, 6, -4, 6, 5, -9, -4, -7, 5, 9, -4, -4, -7, 6, -7, 5, 6, 6, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{20}{3}, 3 \\sqrt{3}, 9, -4 \\sqrt{2}, -9.47} \\cup {-4 \\sqrt{2}, -\\frac{17}{3}, 8, -3 \\sqrt{3}, -9.47, -8}$.\n", - "Output Answer": [ - "${-9.47, -8, -\\frac{20}{3}, -\\frac{17}{3}, -4 \\sqrt{2}, -3 \\sqrt{3}, 3 \\sqrt{3}, 8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(20/3), 3*math.sqrt(3), 9, -4*math.sqrt(2), -9.47,))\nsnd = set((-4*math.sqrt(2), -(17/3), 8, -3*math.sqrt(3), -9.47, -8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -9, 7, -1, 8, 0, -5, -5}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -9, 7, -1, 8, 0, -5, -5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.036,0.04,0.575,0.057,0.013,0.069,0.008\\}$ and $\\{0.067,0.189,0.068,0.174,0.06,0.086,0.282\\}$.", - "Output Answer": [ - "$1.42$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.036, 0.04, 0.575, 0.057, 0.013, 0.069, 0.008\ndistribution2 = 0.067, 0.189, 0.068, 0.174, 0.06, 0.086, 0.282\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{9}{\\sqrt{5}}, -\\frac{9}{2}, \\frac{5}{e}, 0, 8, -\\frac{5}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "${-\\frac{9}{2}, -\\frac{9}{\\sqrt{5}}, -\\frac{5}{\\sqrt{2}}, 0, \\frac{5}{e}, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -(9/(math.sqrt(5))), -(9/2), (5/math.e), 0, 8, -(5/(math.sqrt(2)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{28}{3}, -\\frac{14}{3}, 3, -6, -5, 6 \\sqrt{3}}$.", - "Output Answer": [ - "$-\\frac{29}{6}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(28/3), -(14/3), 3, -6, -5, 6*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2.741, -5, \\frac{26}{3}, -5.745, -0.47, 2, 5, \\frac{11}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-5.745, -5, -2.741, -0.47, 2, \\frac{11}{\\sqrt{5}}, 5, \\frac{26}{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -2.741, -5, (26/3), -5.745, -0.47, 2, 5, (11/(math.sqrt(5)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 0, 8, 2, -5}$.\n", - "Output Answer": [ - "$\\frac{9}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 0, 8, 2, -5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -13, 12, 12}$.\n", - "Output Answer": [ - "$\\frac{5 \\sqrt{\\frac{67}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -13, 12, 12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{4}{\\pi }, \\frac{13}{\\pi }, -\\frac{16}{\\pi }, -\\frac{17}{\\pi }, \\frac{20}{\\pi }, 0, \\frac{1}{\\pi }, -\\frac{19}{\\pi }, -\\frac{27}{\\pi }} \\cap {0, -\\frac{17}{\\pi }, \\frac{31}{\\pi }, \\frac{1}{\\pi }, -\\frac{19}{\\pi }, -\\frac{22}{\\pi }, \\frac{20}{\\pi }, -\\frac{7}{\\pi }, -\\frac{11}{\\pi }, -\\frac{13}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{19}{\\pi }, -\\frac{17}{\\pi }, 0, \\frac{1}{\\pi }, \\frac{20}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(4/math.pi), (13/math.pi), -(16/math.pi), -(17/math.pi), (20/math.pi), 0, (1/math.pi), -(19/math.pi), -(27/math.pi),))\nsnd = set((0, -(17/math.pi), (31/math.pi), (1/math.pi), -(19/math.pi), -(22/math.pi), (20/math.pi), -(7/math.pi), -(11/math.pi), -(13/math.pi),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-7, -4, -1, -8} \\cup {10, -1, -4}$.\n", - "Output Answer": [ - "${-8, -7, -4, -1, 10}$" - ], - "Output Program": [ - "fst = set((-7, -4, -1, -8,))\nsnd = set((10, -1, -4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.197,0.402,0.143\\}$ and $\\{0.599,0.014,0.138\\}$.", - "Output Answer": [ - "$1.54$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.197, 0.402, 0.143\ndistribution2 = 0.599, 0.014, 0.138\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.079,0.075,0.099,0.117,0.032,0.044,0.07,0.219,0.142\\}$ and $\\{0.138,0.045,0.057,0.093,0.171,0.053,0.08,0.136,0.144\\}$.", - "Output Answer": [ - "$0.17$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.079, 0.075, 0.099, 0.117, 0.032, 0.044, 0.07, 0.219, 0.142\ndistribution2 = 0.138, 0.045, 0.057, 0.093, 0.171, 0.053, 0.08, 0.136, 0.144\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-2 \\sqrt{2}, 3, 3 \\sqrt{2}, e, 2, 1}$.\n", - "Output Answer": [ - "$5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(2), 3, 3*math.sqrt(2), math.e, 2, 1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, -11, 3, -1}$.\n", - "Output Answer": [ - "$\\frac{104}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -11, 3, -1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\sqrt{3}, \\frac{3}{\\sqrt{5}}, 5, 9, -7, -2, \\frac{15}{4}, -5, 7, -2, -2}$.\n", - "Output Answer": [ - "$16$" - ], - "Output Program": [ - "import math\n\nvalues = 5, math.sqrt(3), (3/(math.sqrt(5))), 5, 9, -7, -2, (15/4), -5, 7, -2, -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 49, 81, 64, 46656, 10000}$.\n", - "Output Answer": [ - "$12 \\sqrt[3]{7} 30^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 49, 81, 64, 46656, 10000\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-11 \\log (2), -5 \\log (2), -12 \\log (2), -3 \\log (2), 12 \\log (2), -7 \\log (2), 4 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{22 \\log (2)}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -11*math.log(2), -5*math.log(2), -12*math.log(2), -3*math.log(2), 12*math.log(2), -7*math.log(2), 4*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, 0, -\\frac{7}{3}, -\\frac{14}{3}, -\\frac{14}{3}, 0, -1, -\\frac{14}{3}, 0, \\frac{25}{3}, -1, -\\frac{7}{3}, \\frac{25}{3}, -\\frac{14}{3}, \\frac{25}{3}, -\\frac{7}{3}, 0, -1, 0, \\frac{25}{3}, -\\frac{7}{3}, -\\frac{7}{3}, \\frac{25}{3}, -\\frac{7}{3}, -\\frac{14}{3}, -\\frac{7}{3}, -\\frac{14}{3}, -\\frac{7}{3}, -1, -\\frac{14}{3}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{7}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, 0, -(7/3), -(14/3), -(14/3), 0, -1, -(14/3), 0, (25/3), -1, -(7/3), (25/3), -(14/3), (25/3), -(7/3), 0, -1, 0, (25/3), -(7/3), -(7/3), (25/3), -(7/3), -(14/3), -(7/3), -(14/3), -(7/3), -1, -(14/3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{8}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, 2 \\sqrt{3}, 2 \\sqrt{3}, -\\sqrt{3}, \\frac{8}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -\\sqrt{3}, -\\frac{16}{\\sqrt{3}}, -\\frac{16}{\\sqrt{3}}, 2 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, -\\sqrt{3}, 2 \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, -\\sqrt{3}, 2 \\sqrt{3}, \\frac{8}{\\sqrt{3}}, -\\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, 2 \\sqrt{3}, -\\frac{16}{\\sqrt{3}}, -\\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{2 \\sqrt{3}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (8/(math.sqrt(3))), -(16/(math.sqrt(3))), 2*math.sqrt(3), 2*math.sqrt(3), -math.sqrt(3), (8/(math.sqrt(3))), (8/(math.sqrt(3))), -(16/(math.sqrt(3))), (8/(math.sqrt(3))), -(10/(math.sqrt(3))), -math.sqrt(3), -(16/(math.sqrt(3))), -(16/(math.sqrt(3))), 2*math.sqrt(3), -(10/(math.sqrt(3))), -math.sqrt(3), 2*math.sqrt(3), -(10/(math.sqrt(3))), -math.sqrt(3), 2*math.sqrt(3), (8/(math.sqrt(3))), -math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), 2*math.sqrt(3), -(16/(math.sqrt(3))), -math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-15, 12, -9, 3, -14}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1373}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, 12, -9, 3, -14\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{19}{\\sqrt{5}}, 6 \\log (2), -\\frac{4}{5}, -5 \\sqrt{2}, 0, 0}$.\n", - "Output Answer": [ - "${-\\frac{19}{\\sqrt{5}}, -5 \\sqrt{2}, -\\frac{4}{5}, 0, 0, 6 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/(math.sqrt(5))), 6*math.log(2), -(4/5), -5*math.sqrt(2), 0, 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{22}{3}, -\\frac{28}{3}, -1, \\frac{7}{3}, \\frac{25}{3}, 7}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -(22/3), -(28/3), -1, (7/3), (25/3), 7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${8, 9, 9, 5, 1, 8, 8, 9, 8, 5, 9, 9, 5, 9, 5, 5, 5, 8, 5, 1, 5, 5, 1, 5, 5, 9, 9, 5, 9, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 8, 9, 9, 5, 1, 8, 8, 9, 8, 5, 9, 9, 5, 9, 5, 5, 5, 8, 5, 1, 5, 5, 1, 5, 5, 9, 9, 5, 9, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 0, -\\frac{13}{2}, -2, 8.86, -5, \\frac{22}{\\pi }, -1} \\cup {-2, -1, 9, -9, -\\frac{1}{\\pi }, -3, 5.288, -2 \\sqrt{2}, -\\frac{13}{2}, -\\pi}$.\n", - "Output Answer": [ - "${-9, -\\frac{13}{2}, -5, -\\pi, -3, -2 \\sqrt{2}, -2, -1, -\\frac{1}{\\pi }, 0, 5.288, \\frac{22}{\\pi }, 8.86, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 0, -(13/2), -2, 8.86, -5, (22/math.pi), -1,))\nsnd = set((-2, -1, 9, -9, -(1/math.pi), -3, 5.288, -2*math.sqrt(2), -(13/2), -math.pi,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\pi, 4, -1, 5, 9.39, 0, -4.81} \\cup {-6, 0, -9.82, 5, -6 \\sqrt{3}, 9.39}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -9.82, -6, -4.81, -1, 0, \\pi, 4, 5, 9.39}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.pi, 4, -1, 5, 9.39, 0, -4.81,))\nsnd = set((-6, 0, -9.82, 5, -6*math.sqrt(3), 9.39,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${1, 3 \\sqrt{3}, \\frac{5}{\\sqrt{2}}, 8, \\frac{26}{\\pi }, -6 \\sqrt{3}} \\setminus {8, -2 \\sqrt{3}, \\frac{24}{\\pi }, 5, -6 \\sqrt{3}}$.\n", - "Output Answer": [ - "${1, \\frac{5}{\\sqrt{2}}, 3 \\sqrt{3}, \\frac{26}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, 3*math.sqrt(3), (5/(math.sqrt(2))), 8, (26/math.pi), -6*math.sqrt(3),))\nsnd = set((8, -2*math.sqrt(3), (24/math.pi), 5, -6*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{10}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, \\frac{13}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, \\frac{1}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{12}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(10/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), (13/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), -(12/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), (1/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, 5, 4, -\\frac{60}{7}, 9} \\cup {2 \\pi, 4, 5, -7, -\\frac{60}{7}, 9}$.\n", - "Output Answer": [ - "${-\\frac{60}{7}, -7, 0, 4, 5, 2 \\pi, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 5, 4, -(60/7), 9,))\nsnd = set((2*math.pi, 4, 5, -7, -(60/7), 9,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{7}{3}, 5}$.\n", - "Output Answer": [ - "${\\frac{7}{3}, 5}$" - ], - "Output Program": [ - "values = (7/3), 5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, 8, -6, 9, 6, -5}$.\n", - "Output Answer": [ - "$\\frac{1649}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 8, -6, 9, 6, -5\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{19}{2}, 2 e, -2, 5 \\sqrt{3}, \\frac{11}{\\sqrt{5}}, -4, \\frac{68}{7}}$.\n", - "Output Answer": [ - "$\\frac{269}{14}$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/2), 2*math.e, -2, 5*math.sqrt(3), (11/(math.sqrt(5))), -4, (68/7)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -1, 5, -\\frac{43}{7}, 10} \\setminus {8, 5.427, -\\frac{16}{5}}$.\n", - "Output Answer": [ - "${-\\frac{43}{7}, -3, -1, 5, 10}$" - ], - "Output Program": [ - "fst = set((-3, -1, 5, -(43/7), 10,))\nsnd = set((8, 5.427, -(16/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.002,0.118,0.217,0.599\\}$ and $\\{0.083,0.029,0.515,0.306\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.002, 0.118, 0.217, 0.599\ndistribution2 = 0.083, 0.029, 0.515, 0.306\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${4 \\sqrt{2}, -6 \\sqrt{2}, 4 \\sqrt{2}, 0, -3 \\sqrt{2}, 4 \\sqrt{2}, 0, -6 \\sqrt{2}, -6 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, 0, 0, 0, 4 \\sqrt{2}, 0, 4 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, 4 \\sqrt{2}, -6 \\sqrt{2}, 0, -6 \\sqrt{2}, -3 \\sqrt{2}, -3 \\sqrt{2}, 0, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{4 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 4*math.sqrt(2), -6*math.sqrt(2), 4*math.sqrt(2), 0, -3*math.sqrt(2), 4*math.sqrt(2), 0, -6*math.sqrt(2), -6*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), 0, 0, 0, 4*math.sqrt(2), 0, 4*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), 4*math.sqrt(2), -6*math.sqrt(2), 0, -6*math.sqrt(2), -3*math.sqrt(2), -3*math.sqrt(2), 0, -3*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 10, 2, 9, -9, 6, 10, -9, 10, 2, 9, 2, 6, 10, 10, 10, 6, 6, -9, 2, 10}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 10, 2, 9, -9, 6, 10, -9, 10, 2, 9, 2, 6, 10, 10, 10, 6, 6, -9, 2, 10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -6, -5, \\frac{39}{4}, 2, -\\frac{30}{\\pi }, -1, \\sqrt{5}, -\\frac{12}{\\sqrt{\\pi }}, \\frac{45}{7}, 7, 0, 1}$.\n", - "Output Answer": [ - "$\\frac{39}{4}+\\frac{30}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = -5, -6, -5, (39/4), 2, -(30/math.pi), -1, math.sqrt(5), -(12/(math.sqrt(math.pi))), (45/7), 7, 0, 1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.9 x+1.3$ where $x \\sim $ \\text{ExponentialDistribution}[1.3]\n", - "Output Answer": [ - "$1.99$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(E(0.9*x+1.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${9, 1, 5, 1, -9}$.\n", - "Output Answer": [ - "$4 \\sqrt{\\frac{14}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 9, 1, 5, 1, -9\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{6}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{6}{\\sqrt{\\pi }}, -\\frac{7}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{9}{\\sqrt{\\pi }}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (6/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (6/(math.sqrt(math.pi))), -(7/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.272,0.072,0.15,0.259\\}$ and $\\{0.167,0.165,0.219,0.27\\}$.", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.272, 0.072, 0.15, 0.259\ndistribution2 = 0.167, 0.165, 0.219, 0.27\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9.645, -\\frac{12}{5}, \\frac{4}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{\\pi }}, 10, -\\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{\\pi }}, -\\frac{12}{5}, -\\sqrt{3}, \\frac{4}{\\sqrt{\\pi }}, 9.645, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 9.645, -(12/5), (4/(math.sqrt(math.pi))), -(11/(math.sqrt(math.pi))), 10, -math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{23}{e}, -3}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{23}{e}-3\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (23/math.e), -3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, 8, 4, 7, -\\pi, \\frac{17}{3}, -5, -4, -7}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 8, 4, 7, -math.pi, (17/3), -5, -4, -7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\sqrt{3}, -9, 4, -4, 1, -\\frac{14}{e}, -\\frac{14}{\\pi }}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import math\n\nvalues = math.sqrt(3), -9, 4, -4, 1, -(14/math.e), -(14/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-6.9, 2 e, -3, -2, 0, e} \\cup {-6.9, 10, -9, -2, e, 2 e}$.\n", - "Output Answer": [ - "${-9, -6.9, -3, -2, 0, e, 2 e, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6.9, 2*math.e, -3, -2, 0, math.e,))\nsnd = set((-6.9, 10, -9, -2, math.e, 2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, -1, -2, 8, 8, -2, 8, 8, 8, -2, -2, -1, 8, 8, -2, -2, 8, -2, -1, -2, -2, -2, 8, -2, -2, -1, -2}$.\n", - "Output Answer": [ - "$\\{-2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, -1, -2, 8, 8, -2, 8, 8, 8, -2, -2, -1, 8, 8, -2, -2, 8, -2, -1, -2, -2, -2, 8, -2, -2, -1, -2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{38}{5}, -6}$.\n", - "Output Answer": [ - "${-6, \\frac{38}{5}}$" - ], - "Output Program": [ - "values = (38/5), -6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-6, 5, 0, -2, -\\frac{24}{5}, -\\frac{23}{e}, 1, -\\frac{5}{3}} \\cup {3, 5 \\sqrt{3}, -8, -\\frac{17}{e}, -2, 5, -\\frac{24}{5}, -6}$.\n", - "Output Answer": [ - "${-\\frac{23}{e}, -8, -\\frac{17}{e}, -6, -\\frac{24}{5}, -2, -\\frac{5}{3}, 0, 1, 3, 5, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 5, 0, -2, -(24/5), -(23/math.e), 1, -(5/3),))\nsnd = set((3, 5*math.sqrt(3), -8, -(17/math.e), -2, 5, -(24/5), -6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, \\frac{14}{5}, -1, 3 \\pi, \\pi, -5, 1, -\\frac{31}{7}, -\\frac{1}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$5+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -5, (14/5), -1, 3*math.pi, math.pi, -5, 1, -(31/7), -(1/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, 2 \\pi, \\frac{11}{\\sqrt{3}}, 0, -5, 4}$.\n", - "Output Answer": [ - "$5+\\frac{11}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, 2*math.pi, (11/(math.sqrt(3))), 0, -5, 4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{18}{5}, \\frac{25}{e}, -6} \\setminus {0, -6, -\\frac{18}{5}, -\\frac{29}{3}, -5}$.\n", - "Output Answer": [ - "${\\frac{25}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(18/5), (25/math.e), -6,))\nsnd = set((0, -6, -(18/5), -(29/3), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-5, \\frac{17}{\\pi }, \\sqrt{5}, -1, 4, -2 \\sqrt{2}, -10}$.\n", - "Output Answer": [ - "${-10, -5, -2 \\sqrt{2}, -1, \\sqrt{5}, 4, \\frac{17}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, (17/math.pi), math.sqrt(5), -1, 4, -2*math.sqrt(2), -10\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, -4, 9}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -4, 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${625, -59049, 125, 243, 1}$.\n", - "Output Answer": [ - "$135 \\sqrt[5]{-1} 5^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 625, -59049, 125, 243, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{13}{2}, -8}$.\n", - "Output Answer": [ - "${-8, -\\frac{13}{2}}$" - ], - "Output Program": [ - "values = -(13/2), -8\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.7 x^2-1.2 x-1.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.4]\n", - "Output Answer": [ - "$-3.07$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.4)\nprint(E(-0.7*x**2-1.2*x-1.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-10 \\log (2), -2 \\pi, -\\frac{43}{5}, -\\frac{8}{\\sqrt{3}}, 0, 5, 8, 7, 0, -9, 3, -8, 4}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10*math.log(2), -2*math.pi, -(43/5), -(8/(math.sqrt(3))), 0, 5, 8, 7, 0, -9, 3, -8, 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{5}, 4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+2 \\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(5), 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, 8, -1, -3, \\frac{37}{4}, -5 \\sqrt{2}, 4, -7 \\log (2), -1, -1, 0, 0, 5 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\frac{37}{4}+5 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, 8, -1, -3, (37/4), -5*math.sqrt(2), 4, -7*math.log(2), -1, -1, 0, 0, 5*math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 5, -2, 5, 5, -2, 5, -2, 5, 5, 5, -2, -2, -2, -2, 5, 5, -2, 5, 5, -1, -1, -1, 5, -1, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 5, -2, 5, 5, -2, 5, -2, 5, 5, 5, -2, -2, -2, -2, 5, 5, -2, 5, 5, -1, -1, -1, 5, -1, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{5}{\\sqrt{2}}, -\\frac{12}{\\sqrt{\\pi }}, -\\frac{1}{2}} \\setminus {-\\frac{9}{2}, 0.56, \\frac{17}{5}, -\\frac{5}{\\sqrt{2}}, -9}$.\n", - "Output Answer": [ - "${-\\frac{12}{\\sqrt{\\pi }}, -\\frac{1}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(5/(math.sqrt(2))), -(12/(math.sqrt(math.pi))), -(1/2),))\nsnd = set((-(9/2), 0.56, (17/5), -(5/(math.sqrt(2))), -9,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-0.78 < 4.5 x-1.1 < -0.03$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8].", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(P((-0.78 < 4.5*x-1.1) & (4.5*x-1.1 < -0.03)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.053,0.003,0.249,0.072,0.115,0.025,0.1,0.151,0.053,0.151\\}$ and $\\{0.069,0.062,0.023,0.032,0.104,0.03,0.132,0.261,0.042,0.224\\}$.", - "Output Answer": [ - "$0.5$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.053, 0.003, 0.249, 0.072, 0.115, 0.025, 0.1, 0.151, 0.053, 0.151\ndistribution2 = 0.069, 0.062, 0.023, 0.032, 0.104, 0.03, 0.132, 0.261, 0.042, 0.224\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-0.1, -\\frac{7}{\\pi }, 8, -5, 2, -3 \\sqrt{5}, 7} \\setminus {\\frac{10}{\\pi }, 9, 7}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -5, -\\frac{7}{\\pi }, -0.1, 2, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.1, -(7/math.pi), 8, -5, 2, -3*math.sqrt(5), 7,))\nsnd = set(((10/math.pi), 9, 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, 0, -4 \\sqrt{3}, -4 \\sqrt{3}, 0, 5 \\sqrt{3}, 0, 0, 0, 0, 0, 5 \\sqrt{3}, 2 \\sqrt{3}, 4 \\sqrt{3}, 0, 5 \\sqrt{3}, 0, -4 \\sqrt{3}, 5 \\sqrt{3}, 0, 0}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, 0, -4*math.sqrt(3), -4*math.sqrt(3), 0, 5*math.sqrt(3), 0, 0, 0, 0, 0, 5*math.sqrt(3), 2*math.sqrt(3), 4*math.sqrt(3), 0, 5*math.sqrt(3), 0, -4*math.sqrt(3), 5*math.sqrt(3), 0, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 0, 3}$.\n", - "Output Answer": [ - "$6$" - ], - "Output Program": [ - "values = 6, 0, 3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{23}{5}, -\\frac{8}{5}, -1, -\\frac{8}{5}, -10, -\\frac{36}{5}, \\frac{4}{5}, -\\frac{23}{5}, -\\frac{8}{5}, \\frac{4}{5}, -\\frac{1}{5}, -\\frac{29}{5}, -\\frac{36}{5}, -\\frac{8}{5}, -10, -1, -\\frac{29}{5}, -\\frac{1}{5}, -\\frac{1}{5}, -10, -\\frac{8}{5}, -\\frac{23}{5}, -\\frac{8}{5}, -10, -10, -1, -\\frac{1}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{8}{5}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(23/5), -(8/5), -1, -(8/5), -10, -(36/5), (4/5), -(23/5), -(8/5), (4/5), -(1/5), -(29/5), -(36/5), -(8/5), -10, -1, -(29/5), -(1/5), -(1/5), -10, -(8/5), -(23/5), -(8/5), -10, -10, -1, -(1/5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6561, 100, 1, 10000, 4}$.\n", - "Output Answer": [ - "$30 \\sqrt[5]{5} 6^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 6561, 100, 1, 10000, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{49}{3}, \\frac{7}{3}}$.\n", - "Output Answer": [ - "$\\frac{49}{12}$" - ], - "Output Program": [ - "import statistics\nvalues = (49/3), (7/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3, 9, -16807, 49, -10, -7}$.\n", - "Output Answer": [ - "$7 \\sqrt{3} \\sqrt[3]{7} \\sqrt[6]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 9, -16807, 49, -10, -7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\log (2), 7 \\log (2), 6 \\log (2), -10 \\log (2), 5 \\log (2), 11 \\log (2), -13 \\log (2)}$.\n", - "Output Answer": [ - "$\\frac{5 \\log (2)}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -math.log(2), 7*math.log(2), 6*math.log(2), -10*math.log(2), 5*math.log(2), 11*math.log(2), -13*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, \\frac{1}{\\sqrt{3}}, 2, \\frac{7}{\\sqrt{5}}, 2, -2 e, 2, 0, \\frac{13}{\\sqrt{\\pi }}, -12 \\log (2), -9, 0, -3 \\sqrt{2}, \\frac{8}{\\sqrt{5}}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$9+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, (1/(math.sqrt(3))), 2, (7/(math.sqrt(5))), 2, -2*math.e, 2, 0, (13/(math.sqrt(math.pi))), -12*math.log(2), -9, 0, -3*math.sqrt(2), (8/(math.sqrt(5))), -3*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{14}{\\sqrt{5}}, -9, 2, -3, 1, 9, -\\frac{6}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -(14/(math.sqrt(5))), -9, 2, -3, 1, 9, -(6/(math.sqrt(math.pi)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\sqrt{5}, 3 \\sqrt{5}, 4 \\sqrt{5}, 0, \\sqrt{5}, 0, 0, 0, -\\sqrt{5}, -\\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, 0, \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, 4 \\sqrt{5}, 3 \\sqrt{5}, \\sqrt{5}, 3 \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, 0, -\\sqrt{5}, 3 \\sqrt{5}, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\sqrt{5},\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -math.sqrt(5), 3*math.sqrt(5), 4*math.sqrt(5), 0, math.sqrt(5), 0, 0, 0, -math.sqrt(5), -math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), 0, math.sqrt(5), math.sqrt(5), -math.sqrt(5), 4*math.sqrt(5), 3*math.sqrt(5), math.sqrt(5), 3*math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), math.sqrt(5), -math.sqrt(5), 0, -math.sqrt(5), 3*math.sqrt(5), -math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 11, 5, 13}$.\n", - "Output Answer": [ - "$\\frac{22880}{2819}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 11, 5, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, 36}$.\n", - "Output Answer": [ - "$18 i$" - ], - "Output Program": [ - "import math\n\nvalues = -9, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 0, 2, -1, 5, -3 e, \\frac{1}{\\sqrt{2}}, 4, -3 e}$.\n", - "Output Answer": [ - "$6+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 0, 2, -1, 5, -3*math.e, (1/(math.sqrt(2))), 4, -3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 0, -5, \\frac{9}{\\pi }, 7, 2, -1, 8}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 0, -5, (9/math.pi), 7, 2, -1, 8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4, 4, -2 \\pi}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4, 4, -2*math.pi\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-\\frac{23}{5}, -\\frac{49}{5}, \\frac{46}{5}, 8, \\frac{36}{5}, 3, \\frac{12}{5}} \\cap {-5, \\frac{49}{5}, \\frac{8}{5}, -\\frac{3}{5}, \\frac{46}{5}, 5}$.\n", - "Output Answer": [ - "${\\frac{46}{5}}$" - ], - "Output Program": [ - "fst = set((-(23/5), -(49/5), (46/5), 8, (36/5), 3, (12/5),))\nsnd = set((-5, (49/5), (8/5), -(3/5), (46/5), 5,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5.2, 6, -\\frac{12}{\\sqrt{\\pi }}, -6, -9, -14 \\log (2), 0, 7}$.\n", - "Output Answer": [ - "${-14 \\log (2), -9, -\\frac{12}{\\sqrt{\\pi }}, -6, 0, 5.2, 6, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = 5.2, 6, -(12/(math.sqrt(math.pi))), -6, -9, -14*math.log(2), 0, 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-14 \\log (2), -\\frac{17}{\\sqrt{\\pi }}, \\frac{29}{3}, -7, 3, \\frac{19}{\\pi }, 1, -3, 1, 2, -4, 0, -\\frac{11}{4}}$.\n", - "Output Answer": [ - "$\\frac{29}{3}+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -14*math.log(2), -(17/(math.sqrt(math.pi))), (29/3), -7, 3, (19/math.pi), 1, -3, 1, 2, -4, 0, -(11/4)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-9, -9, -4, -7, -\\frac{16}{\\sqrt{\\pi }}, 2, -\\frac{15}{\\sqrt{\\pi }}, 3 \\pi, -5, \\frac{1}{\\sqrt{5}}, 0, 6, 5}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{\\pi }}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -9, -4, -7, -(16/(math.sqrt(math.pi))), 2, -(15/(math.sqrt(math.pi))), 3*math.pi, -5, (1/(math.sqrt(5))), 0, 6, 5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\pi, -9, 3 \\sqrt{3}, \\frac{4}{\\pi }, \\pi, -7, 0, -5, 7}$.", - "Output Answer": [ - "$\\frac{4}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.pi, -9, 3*math.sqrt(3), (4/math.pi), math.pi, -7, 0, -5, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4, -8, -1, -4 \\sqrt{2}, -\\frac{16}{\\sqrt{3}}, 0, -3, -6, 2 \\sqrt{5}, -8}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-3-4 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, -8, -1, -4*math.sqrt(2), -(16/(math.sqrt(3))), 0, -3, -6, 2*math.sqrt(5), -8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.189,0.027,0.131,0.104,0.044,0.225\\}$ and $\\{0.29,0.231,0.01,0.101,0.039,0.221\\}$.", - "Output Answer": [ - "$0.51$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.189, 0.027, 0.131, 0.104, 0.044, 0.225\ndistribution2 = 0.29, 0.231, 0.01, 0.101, 0.039, 0.221\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x^2-2.3 x+0.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$3.5$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(2.5*x**2-2.3*x+0.3))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{26}{7}, 0.67, -\\frac{3}{\\sqrt{2}}, -3, \\frac{8}{\\sqrt{3}}, 5, -\\frac{43}{7}, 8, -\\frac{22}{5}} \\cup {-\\frac{4}{7}, -3, -\\frac{44}{7}, 0, -\\frac{22}{5}, 0.67, -\\frac{4}{\\sqrt{3}}, 5}$.\n", - "Output Answer": [ - "${-\\frac{44}{7}, -\\frac{43}{7}, -\\frac{22}{5}, -3, -\\frac{4}{\\sqrt{3}}, -\\frac{3}{\\sqrt{2}}, -\\frac{4}{7}, 0, 0.67, \\frac{26}{7}, \\frac{8}{\\sqrt{3}}, 5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set(((26/7), 0.67, -(3/(math.sqrt(2))), -3, (8/(math.sqrt(3))), 5, -(43/7), 8, -(22/5),))\nsnd = set((-(4/7), -3, -(44/7), 0, -(22/5), 0.67, -(4/(math.sqrt(3))), 5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{5}, -5, 3, -2 \\sqrt{3}, 4, -8, -\\frac{1}{\\sqrt{5}}, 9, 0}$.", - "Output Answer": [ - "$-\\frac{1}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(5), -5, 3, -2*math.sqrt(3), 4, -8, -(1/(math.sqrt(5))), 9, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.158,0.324,0.252\\}$ and $\\{0.211,0.254,0.187\\}$.", - "Output Answer": [ - "$0.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.158, 0.324, 0.252\ndistribution2 = 0.211, 0.254, 0.187\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-3, -7, -4.45, -6.471, -\\frac{1}{\\sqrt{\\pi }}, -\\frac{10}{\\sqrt{\\pi }}, 2} \\setminus {5.71, -\\frac{1}{\\sqrt{\\pi }}, -7, -\\frac{10}{\\sqrt{\\pi }}, 6.076, -6.37, 2}$.\n", - "Output Answer": [ - "${-6.471, -4.45, -3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -7, -4.45, -6.471, -(1/(math.sqrt(math.pi))), -(10/(math.sqrt(math.pi))), 2,))\nsnd = set((5.71, -(1/(math.sqrt(math.pi))), -7, -(10/(math.sqrt(math.pi))), 6.076, -6.37, 2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-10, 9, -7.6, 1.272, 4.41, -\\frac{39}{7}, -7, 0, -9.105, -\\frac{29}{4}} \\cup {0, 6.93, -2, 1.272, 9, -4, -7}$.\n", - "Output Answer": [ - "${-10, -9.105, -7.6, -\\frac{29}{4}, -7, -\\frac{39}{7}, -4, -2, 0, 1.272, 4.41, 6.93, 9}$" - ], - "Output Program": [ - "fst = set((-10, 9, -7.6, 1.272, 4.41, -(39/7), -7, 0, -9.105, -(29/4),))\nsnd = set((0, 6.93, -2, 1.272, 9, -4, -7,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{23}{3}, \\frac{11}{3}, \\frac{19}{3}, 12}$.\n", - "Output Answer": [ - "$\\frac{230736}{37171}$" - ], - "Output Program": [ - "import statistics\nvalues = (23/3), (11/3), (19/3), 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.058,0.109,0.089,0.074,0.122,0.138,0.098,0.096,0.052,0.144\\}$ and $\\{0.174,0.086,0.066,0.146,0.12,0.044,0.049,0.056,0.107,0.066\\}$.", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.058, 0.109, 0.089, 0.074, 0.122, 0.138, 0.098, 0.096, 0.052, 0.144\ndistribution2 = 0.174, 0.086, 0.066, 0.146, 0.12, 0.044, 0.049, 0.056, 0.107, 0.066\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -9, 8, -6}$.\n", - "Output Answer": [ - "$-\\frac{7}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -9, 8, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{2}, 0, 0, -7 \\sqrt{2}, 3 \\sqrt{2}, -7 \\sqrt{2}, 0, 7 \\sqrt{2}, 7 \\sqrt{2}, -\\sqrt{2}, -6 \\sqrt{2}, -\\sqrt{2}, 3 \\sqrt{2}, 0, 4 \\sqrt{2}, -\\sqrt{2}, 7 \\sqrt{2}, 0, 0, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\{0\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(2), 0, 0, -7*math.sqrt(2), 3*math.sqrt(2), -7*math.sqrt(2), 0, 7*math.sqrt(2), 7*math.sqrt(2), -math.sqrt(2), -6*math.sqrt(2), -math.sqrt(2), 3*math.sqrt(2), 0, 4*math.sqrt(2), -math.sqrt(2), 7*math.sqrt(2), 0, 0, -7*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-14, 11, -7}$.\n", - "Output Answer": [ - "$\\frac{499}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, 11, -7\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{19}{7}, 7.1, 6 \\sqrt{2}, 2 \\sqrt{2}, 8, -5, 8.59} \\cup {5, 8, 0, -4 \\sqrt{2}, 2.1, -\\frac{19}{7}, 2 \\sqrt{2}, 0.26}$.\n", - "Output Answer": [ - "${-4 \\sqrt{2}, -5, -\\frac{19}{7}, 0, 0.26, 2.1, 2 \\sqrt{2}, 5, 7.1, 8, 6 \\sqrt{2}, 8.59}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(19/7), 7.1, 6*math.sqrt(2), 2*math.sqrt(2), 8, -5, 8.59,))\nsnd = set((5, 8, 0, -4*math.sqrt(2), 2.1, -(19/7), 2*math.sqrt(2), 0.26,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, -7, 0, -3, -3, 8, -2, -3, -7, 0, -7, 1, -7, -2, -7, 0, -7, -7, 1, 0, -7, -2, 0}$.\n", - "Output Answer": [ - "$\\{-7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, -7, 0, -3, -3, 8, -2, -3, -7, 0, -7, 1, -7, -2, -7, 0, -7, -7, 1, 0, -7, -2, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, 3 e, 5, 7, -8} \\setminus {-1, e, 6, -6, 7}$.\n", - "Output Answer": [ - "${-8, 5, 8, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 3*math.e, 5, 7, -8,))\nsnd = set((-1, math.e, 6, -6, 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{3}{2}, 1, 6, \\frac{22}{\\sqrt{5}}, 2 e, \\frac{1}{2}, -1, 4} \\setminus {1, -1, 6, \\frac{3}{2}}$.\n", - "Output Answer": [ - "${\\frac{1}{2}, 4, 2 e, \\frac{22}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((3/2), 1, 6, (22/(math.sqrt(5))), 2*math.e, (1/2), -1, 4,))\nsnd = set((1, -1, 6, (3/2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${81, 531441, -7, 64, -64, 729}$.\n", - "Output Answer": [ - "$108\\ 3^{2/3} \\sqrt[6]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 81, 531441, -7, 64, -64, 729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8, -7, -\\frac{14}{5}, -5, -\\frac{14}{e}, 8, 2, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-8, -7, -\\frac{14}{e}, -5, -2 \\sqrt{3}, -\\frac{14}{5}, 2, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -7, -(14/5), -5, -(14/math.e), 8, 2, -2*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${10, 15, 14}$.\n", - "Output Answer": [ - "$\\frac{63}{5}$" - ], - "Output Program": [ - "import statistics\nvalues = 10, 15, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2 \\sqrt{5}, -8, -\\frac{6}{\\sqrt{\\pi }}, 9}$.\n", - "Output Answer": [ - "${-8, -2 \\sqrt{5}, -\\frac{6}{\\sqrt{\\pi }}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -2*math.sqrt(5), -8, -(6/(math.sqrt(math.pi))), 9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0.15, -4, -2 \\sqrt{3}, 6, 5 \\sqrt{3}} \\cup {-3 \\sqrt{3}, 6, -4, 0.15, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -3 \\sqrt{3}, -4, -2 \\sqrt{3}, 0.15, 6, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0.15, -4, -2*math.sqrt(3), 6, 5*math.sqrt(3),))\nsnd = set((-3*math.sqrt(3), 6, -4, 0.15, -4*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.5 x-0.2$ where $x \\sim $ \\text{BetaDistribution}[0.4,1.7]\n", - "Output Answer": [ - "$-0.87$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.4, 1.7)\nprint(E(-3.5*x-0.2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, 5, \\frac{14}{\\sqrt{3}}, -3 \\sqrt{5}, -2 e, \\frac{11}{\\sqrt{5}}} \\setminus {8, -6, -3 \\sqrt{5}, \\frac{14}{\\sqrt{3}}, e, 5}$.\n", - "Output Answer": [ - "${-2 e, \\frac{11}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 5, (14/(math.sqrt(3))), -3*math.sqrt(5), -2*math.e, (11/(math.sqrt(5))),))\nsnd = set((8, -6, -3*math.sqrt(5), (14/(math.sqrt(3))), math.e, 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.12,0.157,0.172,0.099,0.081,0.086,0.129,0.144\\}$ and $\\{0.056,0.054,0.087,0.157,0.163,0.275,0.064,0.042\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.12, 0.157, 0.172, 0.099, 0.081, 0.086, 0.129, 0.144\ndistribution2 = 0.056, 0.054, 0.087, 0.157, 0.163, 0.275, 0.064, 0.042\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8, \\frac{13}{e}, -5, 6, -\\frac{8}{\\sqrt{3}}, 6 \\sqrt{2}, -\\sqrt{5}, 1.6, -2 e} \\cup {8, -5, 6, -5 \\sqrt{2}, -\\frac{8}{\\sqrt{3}}, 1.6, -2 \\sqrt{5}, \\frac{8}{e}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -2 e, -5, -\\frac{8}{\\sqrt{3}}, -2 \\sqrt{5}, -\\sqrt{5}, 1.6, \\frac{8}{e}, \\frac{13}{e}, 6, 8, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, (13/math.e), -5, 6, -(8/(math.sqrt(3))), 6*math.sqrt(2), -math.sqrt(5), 1.6, -2*math.e,))\nsnd = set((8, -5, 6, -5*math.sqrt(2), -(8/(math.sqrt(3))), 1.6, -2*math.sqrt(5), (8/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5 \\sqrt{3}, 10, -2} \\setminus {4, 8, -10, 10, \\frac{6}{5}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-2}$" - ], - "Output Program": [ - "import math\n\nfst = set((5*math.sqrt(3), 10, -2,))\nsnd = set((4, 8, -10, 10, (6/5), 5*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 19, \\frac{49}{3}, 4}$.\n", - "Output Answer": [ - "$\\frac{11172}{1249}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 19, (49/3), 4\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.6 x^2+2.6 x-1.7$ where $x \\sim $ \\text{PoissonDistribution}[3.5]\n", - "Output Answer": [ - "$-65.05$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.5)\nprint(E(-4.6*x**2+2.6*x-1.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.032,0.051,0.001,0.115,0.001,0.41,0.129,0.133\\}$ and $\\{0.05,0.077,0.245,0.054,0.061,0.09,0.085,0.219\\}$.", - "Output Answer": [ - "$0.76$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.032, 0.051, 0.001, 0.115, 0.001, 0.41, 0.129, 0.133\ndistribution2 = 0.05, 0.077, 0.245, 0.054, 0.061, 0.09, 0.085, 0.219\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{19}{2}, \\frac{42}{5}, -\\frac{19}{\\pi }, \\frac{1}{\\sqrt{3}}, -13 \\log (2), -7, -14 \\log (2), \\frac{14}{\\sqrt{3}}, -\\frac{6}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{42}{5}+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/2), (42/5), -(19/math.pi), (1/(math.sqrt(3))), -13*math.log(2), -7, -14*math.log(2), (14/(math.sqrt(3))), -(6/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 2, -2, -6, -6, -3, 7, -9}$.\n", - "Output Answer": [ - "$-\\frac{13}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 2, -2, -6, -6, -3, 7, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x+3.4$ where $x \\sim $ \\text{NormalDistribution}[2.,2.4]\n", - "Output Answer": [ - "$8.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 2., 2.4)\nprint(E(2.5*x+3.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-729, 3, 25, 1, -8}$.\n", - "Output Answer": [ - "$3\\ 2^{3/5} 15^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -729, 3, 25, 1, -8\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-0.332, 0, 4} \\setminus {-4, 2, -10, -3, -3 e, -5}$.\n", - "Output Answer": [ - "${-0.332, 0, 4}$" - ], - "Output Program": [ - "import math\n\nfst = set((-0.332, 0, 4,))\nsnd = set((-4, 2, -10, -3, -3*math.e, -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -5, 9, -\\frac{7}{\\sqrt{3}}, 3 \\pi}$.\n", - "Output Answer": [ - "$5+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -5, 9, -(7/(math.sqrt(3))), 3*math.pi\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-2 \\sqrt{2}, -8, -4, 4}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-4-2 \\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -2*math.sqrt(2), -8, -4, 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, 7, -1.42, -3 \\sqrt{2}, 7.01, -\\frac{15}{2}, -2} \\cup {5, 6.031, -2.2, -3 \\sqrt{2}, -9, -\\frac{15}{2}}$.\n", - "Output Answer": [ - "${-9, -\\frac{15}{2}, -3 \\sqrt{2}, -2.2, -2, -1.42, 4, 5, 6.031, 7, 7.01}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, 7, -1.42, -3*math.sqrt(2), 7.01, -(15/2), -2,))\nsnd = set((5, 6.031, -2.2, -3*math.sqrt(2), -9, -(15/2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.228,0.492,0.001,0.198\\}$ and $\\{0.223,0.139,0.415,0.095\\}$.", - "Output Answer": [ - "$0.78$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.228, 0.492, 0.001, 0.198\ndistribution2 = 0.223, 0.139, 0.415, 0.095\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 10, 10, 1, 3, 10, 3, 3, 1, 8, 1, 3, 3, 8, 9, 10, 1, 10, 10, 1, 8, 8, -6, 9, 3, 10, 10, 9}$.\n", - "Output Answer": [ - "$\\{10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 10, 10, 1, 3, 10, 3, 3, 1, 8, 1, 3, 3, 8, 9, 10, 1, 10, 10, 1, 8, 8, -6, 9, 3, 10, 10, 9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${4, -1, 5, 7, -3 \\sqrt{3}, 6 \\sqrt{2}} \\setminus {\\frac{11}{2}, \\frac{11}{e}, 5}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -1, 4, 7, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -1, 5, 7, -3*math.sqrt(3), 6*math.sqrt(2),))\nsnd = set(((11/2), (11/math.e), 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{43}{3}, \\frac{5}{3}, 18, 2}$.\n", - "Output Answer": [ - "$\\frac{7740}{2371}$" - ], - "Output Program": [ - "import statistics\nvalues = (43/3), (5/3), 18, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 1, 0, 5, 1, -8, 5, 5, 1, 0, 5, 0, -8, -8, 1, -3, 5, -8, -8, 0, -3, 5}$.\n", - "Output Answer": [ - "$\\{-8,5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 1, 0, 5, 1, -8, 5, 5, 1, 0, 5, 0, -8, -8, 1, -3, 5, -8, -8, 0, -3, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${14, \\frac{31}{2}, \\frac{21}{2}}$.\n", - "Output Answer": [ - "$\\frac{558}{43}$" - ], - "Output Program": [ - "import statistics\nvalues = 14, (31/2), (21/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 12, 13, 8}$.\n", - "Output Answer": [ - "$\\frac{3744}{319}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 12, 13, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-2.91 < 3.6 x+0.2 < -0.22$ where $x \\sim $ \\text{NormalDistribution}[-0.2,1.9].", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.2, 1.9)\nprint(P((-2.91 < 3.6*x+0.2) & (3.6*x+0.2 < -0.22)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{11}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, -3, -9, 4, 9, \\frac{14}{5}, -\\sqrt{2}, 8, 3 \\sqrt{3}, -3, -\\frac{13}{\\sqrt{5}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{14}{5}+\\frac{1}{\\sqrt{2}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (11/(math.sqrt(2))), (1/(math.sqrt(2))), -3, -9, 4, 9, (14/5), -math.sqrt(2), 8, 3*math.sqrt(3), -3, -(13/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${216, -4, 1, -3}$.\n", - "Output Answer": [ - "$6 \\sqrt[4]{2}$" - ], - "Output Program": [ - "import math\n\nvalues = 216, -4, 1, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\log (2), 12 \\log (2), -9 \\log (2), 4 \\log (2), 9 \\log (2), -\\log (2)}$.\n", - "Output Answer": [ - "$\\frac{8 \\log (2)}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.log(2), 12*math.log(2), -9*math.log(2), 4*math.log(2), 9*math.log(2), -math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, 6, 10}$.\n", - "Output Answer": [ - "$\\frac{4}{\\sqrt{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 6, 10\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-14, -1, -3, 2, -14, -12}$.\n", - "Output Answer": [ - "$\\frac{16}{\\sqrt{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -14, -1, -3, 2, -14, -12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.106,0.023,0.008,0.154,0.278,0.17,0.057,0.182\\}$ and $\\{0.062,0.295,0.135,0.066,0.129,0.038,0.033,0.154\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.106, 0.023, 0.008, 0.154, 0.278, 0.17, 0.057, 0.182\ndistribution2 = 0.062, 0.295, 0.135, 0.066, 0.129, 0.038, 0.033, 0.154\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${1.6, -5, 1, 4, -7, 0} \\cup {-7, 4, -2 \\sqrt{5}, -5, 1.6, \\frac{17}{5}, 5.178}$.\n", - "Output Answer": [ - "${-7, -5, -2 \\sqrt{5}, 0, 1, 1.6, \\frac{17}{5}, 4, 5.178}$" - ], - "Output Program": [ - "import math\n\nfst = set((1.6, -5, 1, 4, -7, 0,))\nsnd = set((-7, 4, -2*math.sqrt(5), -5, 1.6, (17/5), 5.178,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{59}{3}, \\frac{17}{3}}$.\n", - "Output Answer": [ - "$\\frac{1003}{114}$" - ], - "Output Program": [ - "import statistics\nvalues = (59/3), (17/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.8 x-0.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$-0.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(1.8*x-0.9))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${10, -8, 6, 6, 8, 6, 6, 6, 10, -8, 1, 1, -10, -8, 1, 8, -10, -10, 10, 1}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 10, -8, 6, 6, 8, 6, 6, 6, 10, -8, 1, 1, -10, -8, 1, 8, -10, -10, 10, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{\\sqrt{3}}, 0, 8, -\\pi, -\\frac{1}{\\sqrt{\\pi }}, -\\frac{13}{2}, -\\frac{3}{2}, -6, 5, \\frac{17}{2}, -9, -\\frac{36}{5}, -\\frac{21}{4}, -6, -\\frac{13}{7}}$.\n", - "Output Answer": [ - "$\\frac{35}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(3))), 0, 8, -math.pi, -(1/(math.sqrt(math.pi))), -(13/2), -(3/2), -6, 5, (17/2), -9, -(36/5), -(21/4), -6, -(13/7)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{6}{\\sqrt{\\pi }}, 4, -5, 0, -2 e, -e} \\setminus {7, 4, e, \\frac{19}{5}, -e, \\frac{6}{\\sqrt{\\pi }}, -5}$.\n", - "Output Answer": [ - "${-2 e, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set(((6/(math.sqrt(math.pi))), 4, -5, 0, -2*math.e, -math.e,))\nsnd = set((7, 4, math.e, (19/5), -math.e, (6/(math.sqrt(math.pi))), -5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${262144, -2, 16, 729, 216, 64}$.\n", - "Output Answer": [ - "$96 \\sqrt[6]{-1} \\sqrt[3]{2} \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 262144, -2, 16, 729, 216, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{3}, 5 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, -5 \\sqrt{3}, -5 \\sqrt{3}, 5 \\sqrt{3}, -5 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, 5 \\sqrt{3}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -5 \\sqrt{3}, 5 \\sqrt{3}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.sqrt(3), -5*math.sqrt(3), -5*math.sqrt(3), 5*math.sqrt(3), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), 5*math.sqrt(3), (4/(math.sqrt(3))), (4/(math.sqrt(3))), 5*math.sqrt(3), (4/(math.sqrt(3))), -5*math.sqrt(3), -5*math.sqrt(3), 5*math.sqrt(3), -5*math.sqrt(3), (4/(math.sqrt(3))), (4/(math.sqrt(3))), 5*math.sqrt(3), (4/(math.sqrt(3))), (4/(math.sqrt(3))), -5*math.sqrt(3), 5*math.sqrt(3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{3}{\\pi }, -\\sqrt{5}, -1, -3 \\sqrt{5}, -\\frac{4}{\\pi }, -5} \\cup {\\frac{21}{\\pi }, 4, -\\sqrt{5}, -8, -\\frac{4}{\\pi }, -5, -2 \\sqrt{5}, -3 \\sqrt{5}, 0}$.\n", - "Output Answer": [ - "${-8, -3 \\sqrt{5}, -5, -2 \\sqrt{5}, -\\sqrt{5}, -\\frac{4}{\\pi }, -1, -\\frac{3}{\\pi }, 0, 4, \\frac{21}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(3/math.pi), -math.sqrt(5), -1, -3*math.sqrt(5), -(4/math.pi), -5,))\nsnd = set(((21/math.pi), 4, -math.sqrt(5), -8, -(4/math.pi), -5, -2*math.sqrt(5), -3*math.sqrt(5), 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -4, 0, 3}$.\n", - "Output Answer": [ - "$-\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -4, 0, 3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, -8, \\frac{26}{e}, -\\frac{16}{3}, -4, 0, -3 \\log (2), 3, -8, -1}$.\n", - "Output Answer": [ - "$8+\\frac{26}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, -8, (26/math.e), -(16/3), -4, 0, -3*math.log(2), 3, -8, -1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3 \\pi, \\pi, \\pi, 2 \\pi, 0}$.\n", - "Output Answer": [ - "$\\frac{\\pi }{5}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -3*math.pi, math.pi, math.pi, 2*math.pi, 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5 \\sqrt{2}, 0, -7.64, -2, -4} \\cup {-3 \\sqrt{2}, 5.56, 0, -4, -2}$.\n", - "Output Answer": [ - "${-7.64, -5 \\sqrt{2}, -3 \\sqrt{2}, -4, -2, 0, 5.56}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5*math.sqrt(2), 0, -7.64, -2, -4,))\nsnd = set((-3*math.sqrt(2), 5.56, 0, -4, -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x+4.6$ where $x \\sim $ \\text{ExponentialDistribution}[0.4]\n", - "Output Answer": [ - "$16.35$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.4)\nprint(E(4.7*x+4.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{26}{5}, \\frac{19}{\\sqrt{5}}, -6, -8, -6 \\sqrt{2}} \\setminus {-7, -8, 9, \\frac{19}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -6, \\frac{26}{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((26/5), (19/(math.sqrt(5))), -6, -8, -6*math.sqrt(2),))\nsnd = set((-7, -8, 9, (19/(math.sqrt(5))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, -11, 8}$.\n", - "Output Answer": [ - "$\\sqrt{91}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -11, 8\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${4, 14, 11, 5, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{317}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 14, 11, 5, 0\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{41}{7}, -3 \\sqrt{2}, -\\frac{8}{\\sqrt{3}}, -\\frac{6}{\\sqrt{\\pi }}, -3 \\sqrt{3}}$.", - "Output Answer": [ - "$-\\frac{8}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(41/7), -3*math.sqrt(2), -(8/(math.sqrt(3))), -(6/(math.sqrt(math.pi))), -3*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5, \\frac{13}{\\sqrt{\\pi }}, 4 \\sqrt{5}, -\\frac{21}{\\pi }, -1, -3 e} \\setminus {4, 8, 5, -e}$.\n", - "Output Answer": [ - "${-3 e, -\\frac{21}{\\pi }, -1, \\frac{13}{\\sqrt{\\pi }}, 4 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, (13/(math.sqrt(math.pi))), 4*math.sqrt(5), -(21/math.pi), -1, -3*math.e,))\nsnd = set((4, 8, 5, -math.e,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2.511, 3, \\frac{14}{\\sqrt{3}}, 0, -9, -2 \\sqrt{2}, -8} \\setminus {-2, -7.671, -8, 3}$.\n", - "Output Answer": [ - "${-9, -2 \\sqrt{2}, 0, 2.511, \\frac{14}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((2.511, 3, (14/(math.sqrt(3))), 0, -9, -2*math.sqrt(2), -8,))\nsnd = set((-2, -7.671, -8, 3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.091,0.902,0.007\\}$ and $\\{0.235,0.203,0.25\\}$.", - "Output Answer": [ - "$0.86$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.091, 0.902, 0.007\ndistribution2 = 0.235, 0.203, 0.25\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-4 \\sqrt{3}, 0, 1, 3, 0, -4, 7, 6}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -4*math.sqrt(3), 0, 1, 3, 0, -4, 7, 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${6, 49, 6}$.\n", - "Output Answer": [ - "$42^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 49, 6\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.4 x^2+4.9 x+3.5$ where $x \\sim $ \\text{BetaDistribution}[0.9,1.9]\n", - "Output Answer": [ - "$4.85$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 0.9, 1.9)\nprint(E(-1.4*x**2+4.9*x+3.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, 14, -4, -12}$.\n", - "Output Answer": [ - "$\\frac{1435}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, 14, -4, -12\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-3, -\\frac{14}{\\sqrt{5}}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-3-\\frac{14}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -3, -(14/(math.sqrt(5)))\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\sqrt{5}, 3, 0, -7, 2 \\pi, -9, -7, 2, 0, -\\frac{7}{3}, 2, -\\frac{24}{\\pi }}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.sqrt(5), 3, 0, -7, 2*math.pi, -9, -7, 2, 0, -(7/3), 2, -(24/math.pi)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, 3, -10, 10 \\log (2), -10, -4, \\frac{5}{3}, 8, \\frac{1}{\\sqrt{\\pi }}, -6, -4 \\sqrt{2}, -\\frac{9}{e}, -\\frac{25}{3}, -\\frac{20}{\\pi }}$.\n", - "Output Answer": [ - "$20$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 3, -10, 10*math.log(2), -10, -4, (5/3), 8, (1/(math.sqrt(math.pi))), -6, -4*math.sqrt(2), -(9/math.e), -(25/3), -(20/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.484,0.003,0.195,0.191,0.04,0.021,0.039\\}$ and $\\{0.105,0.094,0.088,0.128,0.182,0.171,0.13\\}$.", - "Output Answer": [ - "$0.75$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.484, 0.003, 0.195, 0.191, 0.04, 0.021, 0.039\ndistribution2 = 0.105, 0.094, 0.088, 0.128, 0.182, 0.171, 0.13\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, 81, 81, -32768, 64}$.\n", - "Output Answer": [ - "$48 \\sqrt[5]{-1} 6^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, 81, 81, -32768, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.341,0.088,0.409\\}$ and $\\{0.152,0.542,0.172\\}$.", - "Output Answer": [ - "$0.59$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.341, 0.088, 0.409\ndistribution2 = 0.152, 0.542, 0.172\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.073,0.059,0.082,0.205,0.003,0.236,0.154,0.141\\}$ and $\\{0.128,0.002,0.017,0.089,0.081,0.182,0.085,0.148\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.073, 0.059, 0.082, 0.205, 0.003, 0.236, 0.154, 0.141\ndistribution2 = 0.128, 0.002, 0.017, 0.089, 0.081, 0.182, 0.085, 0.148\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-10, -6, 8, 3, 9, 7, 5} \\cap {9, 3, 2, -8, -6, 7, -7}$.\n", - "Output Answer": [ - "${-6, 3, 7, 9}$" - ], - "Output Program": [ - "fst = set((-10, -6, 8, 3, 9, 7, 5,))\nsnd = set((9, 3, 2, -8, -6, 7, -7,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, -8, -1, -5, 11, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{1606}{15}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, -8, -1, -5, 11, 15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-7, -2.42, -4 \\sqrt{3}, -6, -\\sqrt{5}, -9.5, -2 \\pi}$.\n", - "Output Answer": [ - "${-9.5, -7, -4 \\sqrt{3}, -2 \\pi, -6, -2.42, -\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -2.42, -4*math.sqrt(3), -6, -math.sqrt(5), -9.5, -2*math.pi\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, -9, -9, 4, 2, 4, 2, 4, 4, 4, 2, 4, -9, -9, 4, 2, -9, 2, 4, -6, -6, 4, 4, 4, 2}$.\n", - "Output Answer": [ - "$\\{4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, -9, -9, 4, 2, 4, 2, 4, 4, 4, 2, 4, -9, -9, 4, 2, -9, 2, 4, -6, -6, 4, 4, 4, 2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.7 x^2+1.8 x-1.3$ where $x \\sim $ \\text{NormalDistribution}[1.,2.3]\n", - "Output Answer": [ - "$-22.77$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1., 2.3)\nprint(E(-3.7*x**2+1.8*x-1.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-7, 5, 2, 4, -4, 6, 4, -3 e}$.\n", - "Output Answer": [ - "${-3 e, -7, -4, 2, 4, 4, 5, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 5, 2, 4, -4, 6, 4, -3*math.e\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7 \\sqrt{2}, -7, 0, 4, 8, 3 \\sqrt{3}, -3 e, -5, -2 \\sqrt{5}, -7, -7, 4 \\sqrt{3}, -2 \\sqrt{2}}$.", - "Output Answer": [ - "$-2 \\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7*math.sqrt(2), -7, 0, 4, 8, 3*math.sqrt(3), -3*math.e, -5, -2*math.sqrt(5), -7, -7, 4*math.sqrt(3), -2*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{5}{\\sqrt{2}}, 3 \\sqrt{2}, -\\frac{5}{\\sqrt{2}}, -2, 4 \\sqrt{5}, -\\frac{17}{4}, -10, 2 \\pi, 8, \\frac{42}{5}, -7, -3, \\frac{5}{4}, -\\frac{19}{4}}$.", - "Output Answer": [ - "$-\\frac{3}{8}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (5/(math.sqrt(2))), 3*math.sqrt(2), -(5/(math.sqrt(2))), -2, 4*math.sqrt(5), -(17/4), -10, 2*math.pi, 8, (42/5), -7, -3, (5/4), -(19/4)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\sqrt{5}, \\frac{22}{7}, -5, -\\frac{15}{e}}$.\n", - "Output Answer": [ - "${-\\frac{15}{e}, -5, -\\sqrt{5}, \\frac{22}{7}}$" - ], - "Output Program": [ - "import math\n\nvalues = -math.sqrt(5), (22/7), -5, -(15/math.e)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, -\\frac{39}{4}, 1, -4.5} \\cup {1, -9.4, -\\frac{17}{2}, 2}$.\n", - "Output Answer": [ - "${-\\frac{39}{4}, -9.4, -\\frac{17}{2}, -4.5, 1, 2}$" - ], - "Output Program": [ - "fst = set((2, -(39/4), 1, -4.5,))\nsnd = set((1, -9.4, -(17/2), 2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, \\frac{6}{\\sqrt{\\pi }}, 0, 0, -10, -2 \\sqrt{3}, \\frac{25}{e}, -\\frac{19}{7}, \\frac{9}{\\sqrt{2}}, 2 \\sqrt{3}, -2}$.\n", - "Output Answer": [ - "$10+\\frac{25}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 3, (6/(math.sqrt(math.pi))), 0, 0, -10, -2*math.sqrt(3), (25/math.e), -(19/7), (9/(math.sqrt(2))), 2*math.sqrt(3), -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -6, -6, 6, 14, -8}$.\n", - "Output Answer": [ - "$\\frac{398}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -6, -6, 6, 14, -8\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{25}{3}, \\frac{50}{3}, 6, \\frac{38}{3}}$.\n", - "Output Answer": [ - "$\\frac{11400}{1213}$" - ], - "Output Program": [ - "import statistics\nvalues = (25/3), (50/3), 6, (38/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${2, -8}$.\n", - "Output Answer": [ - "$5 \\sqrt{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 2, -8\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${7, -7, -4, 0, 4, 6, 5, -2} \\cap {10, -5, 1, 7, 0, -4, 9}$.\n", - "Output Answer": [ - "${-4, 0, 7}$" - ], - "Output Program": [ - "fst = set((7, -7, -4, 0, 4, 6, 5, -2,))\nsnd = set((10, -5, 1, 7, 0, -4, 9,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, -3, -15, -7, -9}$.\n", - "Output Answer": [ - "$\\frac{226}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -3, -15, -7, -9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 11, 12, 13}$.\n", - "Output Answer": [ - "$\\frac{20592}{1865}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 11, 12, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-10, 14, 11, -14, 13, 15}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{5201}{30}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -10, 14, 11, -14, 13, 15\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${5, 7, -2, 3, -\\frac{9}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$7+\\frac{9}{\\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, 7, -2, 3, -(9/(math.sqrt(2)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, -4, 3, -6, -5, 3, 1}$.\n", - "Output Answer": [ - "$-\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, -4, 3, -6, -5, 3, 1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-1, 3, -3, -10}$.\n", - "Output Answer": [ - "$\\frac{355}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 3, -3, -10\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, -5, -4, 5, -1}$.\n", - "Output Answer": [ - "$\\frac{167}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, -5, -4, 5, -1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${8, 2.26, -6, -3 e, \\frac{17}{\\pi }, 7} \\setminus {-e, -6, \\frac{17}{\\pi }, 2.26, 8}$.\n", - "Output Answer": [ - "${-3 e, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, 2.26, -6, -3*math.e, (17/math.pi), 7,))\nsnd = set((-math.e, -6, (17/math.pi), 2.26, 8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{13}{2}, -1.5, -2, \\log (2), 3, -3 \\pi, 1} \\cup {0, -1.5, 3, -7 \\log (2), 5, -7, -5}$.\n", - "Output Answer": [ - "${-3 \\pi, -7, -5, -7 \\log (2), -2, -1.5, 0, \\log (2), 1, 3, 5, \\frac{13}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/2), -1.5, -2, math.log(2), 3, -3*math.pi, 1,))\nsnd = set((0, -1.5, 3, -7*math.log(2), 5, -7, -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4 \\sqrt{3}, -9, 4, -4, 7, 9}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(4+4 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4*math.sqrt(3), -9, 4, -4, 7, 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -6, -8, 3, 10, -8, -8, -9}$.\n", - "Output Answer": [ - "$-\\frac{17}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -6, -8, 3, 10, -8, -8, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${1, -5 \\sqrt{3}, 7 \\sqrt{2}, 6, \\sqrt{2}, 3, 0, -3, -2, 1, -\\frac{7}{\\sqrt{2}}, -3, \\frac{2}{3}}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, -5*math.sqrt(3), 7*math.sqrt(2), 6, math.sqrt(2), 3, 0, -3, -2, 1, -(7/(math.sqrt(2))), -3, (2/3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, -9, 5 \\sqrt{3}, 2 \\pi, -\\frac{37}{5}, -2, 3 \\sqrt{2}}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, -9, 5*math.sqrt(3), 2*math.pi, -(37/5), -2, 3*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5 \\sqrt{2}, -3 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\sqrt{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 5*math.sqrt(2), -3*math.sqrt(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{11}{2}, -8, -\\frac{19}{\\pi }, 4, 0}$.", - "Output Answer": [ - "$-\\frac{11}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(11/2), -8, -(19/math.pi), 4, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, -3, -5, -6, 7}$.\n", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, -3, -5, -6, 7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, -3, -3, 4, -\\frac{19}{e}, -2 \\sqrt{3}, -\\frac{8}{7}, -\\frac{1}{\\sqrt{2}}, 8, -\\frac{7}{\\pi }, -6 \\sqrt{2}, \\frac{19}{3}, -6, -9}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-3-\\frac{7}{\\pi }\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, -3, -3, 4, -(19/math.e), -2*math.sqrt(3), -(8/7), -(1/(math.sqrt(2))), 8, -(7/math.pi), -6*math.sqrt(2), (19/3), -6, -9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{31}{3}, \\frac{4}{3}, 17}$.\n", - "Output Answer": [ - "$\\frac{6324}{1909}$" - ], - "Output Program": [ - "import statistics\nvalues = (31/3), (4/3), 17\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, 3, 6, 0, -3, -6, -6, 6, 6, 6, 6, 0, -6, 3, 6, 6, 6, -6, 1, 0, 6, 6, 6, 3, -6, -6, 1}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, 3, 6, 0, -3, -6, -6, 6, 6, 6, 6, 0, -6, 3, 6, 6, 6, -6, 1, 0, 6, 6, 6, 3, -6, -6, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.111,0.111,0.126,0.069,0.152,0.11,0.03,0.04,0.096\\}$ and $\\{0.417,0.031,0.016,0.175,0.014,0.124,0.004,0.102,0.104\\}$.", - "Output Answer": [ - "$0.81$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.111, 0.111, 0.126, 0.069, 0.152, 0.11, 0.03, 0.04, 0.096\ndistribution2 = 0.417, 0.031, 0.016, 0.175, 0.014, 0.124, 0.004, 0.102, 0.104\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9, 6, \\pi, 0, \\frac{15}{2}, -6, -4 \\sqrt{3}} \\cup {\\frac{17}{2}, -4, -4 \\sqrt{3}, -9, 0, 6, 2}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{3}, -6, -4, 0, 2, \\pi, 6, \\frac{15}{2}, \\frac{17}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 6, math.pi, 0, (15/2), -6, -4*math.sqrt(3),))\nsnd = set(((17/2), -4, -4*math.sqrt(3), -9, 0, 6, 2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, \\sqrt{5}, 0, \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, -4 \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, 0, \\sqrt{5}, \\sqrt{5}, 4 \\sqrt{5}, \\sqrt{5}, -\\sqrt{5}, -4 \\sqrt{5}, \\sqrt{5}, -4 \\sqrt{5}, 0, -\\sqrt{5}}$.\n", - "Output Answer": [ - "$\\left\\{\\sqrt{5}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 0, math.sqrt(5), math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), math.sqrt(5), 0, math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), -4*math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), 0, math.sqrt(5), math.sqrt(5), 4*math.sqrt(5), math.sqrt(5), -math.sqrt(5), -4*math.sqrt(5), math.sqrt(5), -4*math.sqrt(5), 0, -math.sqrt(5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, -3, -5, 3}$.\n", - "Output Answer": [ - "$\\frac{43}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, -3, -5, 3\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, 2 \\sqrt{3}, 2 \\pi, \\frac{16}{3}, -4 \\sqrt{3}, 2, 7, -7 \\sqrt{2}, -2 \\pi, -\\frac{19}{3}, 10, -5, 7, \\frac{1}{e}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2+\\frac{1}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 0, 2*math.sqrt(3), 2*math.pi, (16/3), -4*math.sqrt(3), 2, 7, -7*math.sqrt(2), -2*math.pi, -(19/3), 10, -5, 7, (1/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-9, 0, \\frac{17}{\\sqrt{5}}, -10} \\setminus {0, \\pi, 2, 2 \\sqrt{3}, -10, -\\frac{16}{\\sqrt{5}}, -9}$.\n", - "Output Answer": [ - "${\\frac{17}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, 0, (17/(math.sqrt(5))), -10,))\nsnd = set((0, math.pi, 2, 2*math.sqrt(3), -10, -(16/(math.sqrt(5))), -9,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-2 \\sqrt{5}, -4, 3 \\sqrt{3}} \\cup {-4, 3 \\sqrt{3}, 0}$.\n", - "Output Answer": [ - "${-2 \\sqrt{5}, -4, 0, 3 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.sqrt(5), -4, 3*math.sqrt(3),))\nsnd = set((-4, 3*math.sqrt(3), 0,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${10, -4 e, 5 \\sqrt{3}, 10, 1, 1}$.\n", - "Output Answer": [ - "$10+4 e$" - ], - "Output Program": [ - "import math\n\nvalues = 10, -4*math.e, 5*math.sqrt(3), 10, 1, 1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 e, 2 e, 2 e}$.\n", - "Output Answer": [ - "$2 e$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.e, 2*math.e, 2*math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, 0, -10, -10, -8, 0, 0, -8, -1, -10, -10, -8, 8, -1, -8, -10, -10, 0, -1, 0}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, 0, -10, -10, -8, 0, 0, -8, -1, -10, -10, -8, 8, -1, -8, -10, -10, 0, -1, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8, 3 \\sqrt{5}, \\frac{18}{5}, -8 \\log (2)}$.\n", - "Output Answer": [ - "${-8, -8 \\log (2), \\frac{18}{5}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -8, 3*math.sqrt(5), (18/5), -8*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.127,0.398,0.273\\}$ and $\\{0.558,0.314,0.019\\}$.", - "Output Answer": [ - "$0.9$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.127, 0.398, 0.273\ndistribution2 = 0.558, 0.314, 0.019\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-5, 8, -\\frac{11}{\\sqrt{3}}, -4 \\sqrt{3}, -7}$.\n", - "Output Answer": [ - "${-7, -4 \\sqrt{3}, -\\frac{11}{\\sqrt{3}}, -5, 8}$" - ], - "Output Program": [ - "import math\n\nvalues = -5, 8, -(11/(math.sqrt(3))), -4*math.sqrt(3), -7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -2, -6, 1, -6, -2, 1, 3, -2, 8, 1, 1, 1, 1, 1, 8, -6, 5, -6, 3, -6, -2, -2}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -2, -6, 1, -6, -2, 1, 3, -2, 8, 1, 1, 1, 1, 1, 8, -6, 5, -6, 3, -6, -2, -2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, \\sqrt{5}, 7, 8, -\\frac{33}{5}, -7, \\frac{16}{\\sqrt{\\pi }}, 13 \\log (2)}$.\n", - "Output Answer": [ - "$7+\\frac{16}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, math.sqrt(5), 7, 8, -(33/5), -7, (16/(math.sqrt(math.pi))), 13*math.log(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.4 x+9.$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$21.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(2.4*x+9.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${9, \\frac{42}{5}}$.\n", - "Output Answer": [ - "$\\frac{3}{5}$" - ], - "Output Program": [ - "values = 9, (42/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${9, -2, 9, -2, 9, -5, -5, 9, 9, 9, -2, -5, -2, 9, -9, -9, -2, -2, -5, -5, -5, 9}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 9, -2, 9, -2, 9, -5, -5, 9, 9, 9, -2, -5, -2, 9, -9, -9, -2, -2, -5, -5, -5, 9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, -2 \\sqrt{2}, -3.2} \\setminus {3, 3 \\pi, -6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3.2, -2 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -2*math.sqrt(2), -3.2,))\nsnd = set((3, 3*math.pi, -6*math.sqrt(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{3}{\\pi }, \\frac{13}{3}, -2, 3, \\frac{9}{\\sqrt{2}}, 5 \\sqrt{3}, -12 \\log (2), -\\pi} \\cup {\\frac{9}{\\sqrt{2}}, -5 \\log (2), 5 \\sqrt{3}, -2, -8, -\\pi, -\\frac{8}{3}, 7}$.\n", - "Output Answer": [ - "${-12 \\log (2), -8, -5 \\log (2), -\\pi, -\\frac{8}{3}, -2, \\frac{3}{\\pi }, 3, \\frac{13}{3}, \\frac{9}{\\sqrt{2}}, 7, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((3/math.pi), (13/3), -2, 3, (9/(math.sqrt(2))), 5*math.sqrt(3), -12*math.log(2), -math.pi,))\nsnd = set(((9/(math.sqrt(2))), -5*math.log(2), 5*math.sqrt(3), -2, -8, -math.pi, -(8/3), 7,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${9, 6, 4, 13}$.\n", - "Output Answer": [ - "$\\frac{1872}{283}$" - ], - "Output Program": [ - "import statistics\nvalues = 9, 6, 4, 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-8, -2 \\pi, -1, 4, 0, 2, -4, -9} \\cup {-2 \\pi, -9, -4, -7, 4, -10, 0, 2 \\pi, 8}$.\n", - "Output Answer": [ - "${-10, -9, -8, -7, -2 \\pi, -4, -1, 0, 2, 4, 2 \\pi, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -2*math.pi, -1, 4, 0, 2, -4, -9,))\nsnd = set((-2*math.pi, -9, -4, -7, 4, -10, 0, 2*math.pi, 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{44}{5}, -\\frac{39}{5}, 4, 5, -\\frac{39}{5}, \\frac{7}{5}, -\\frac{16}{5}}$.\n", - "Output Answer": [ - "$\\frac{2}{35}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (44/5), -(39/5), 4, 5, -(39/5), (7/5), -(16/5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-7, 0, -3, 4 \\sqrt{3}}$.", - "Output Answer": [ - "$-\\frac{3}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -7, 0, -3, 4*math.sqrt(3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${0, -1, -5, 7, -2}$.\n", - "Output Answer": [ - "$-\\frac{1}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 0, -1, -5, 7, -2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${11 \\log (2), 11 \\log (2), 9 \\log (2), \\log (2), \\log (2), 12 \\log (2), \\log (2), \\log (2), 12 \\log (2), 11 \\log (2), 11 \\log (2), \\log (2), 11 \\log (2), 9 \\log (2), \\log (2), 12 \\log (2), 11 \\log (2), 9 \\log (2), \\log (2), \\log (2), 11 \\log (2), 9 \\log (2), 11 \\log (2), 11 \\log (2), \\log (2), \\log (2)}$.\n", - "Output Answer": [ - "$\\{\\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 11*math.log(2), 11*math.log(2), 9*math.log(2), math.log(2), math.log(2), 12*math.log(2), math.log(2), math.log(2), 12*math.log(2), 11*math.log(2), 11*math.log(2), math.log(2), 11*math.log(2), 9*math.log(2), math.log(2), 12*math.log(2), 11*math.log(2), 9*math.log(2), math.log(2), math.log(2), 11*math.log(2), 9*math.log(2), 11*math.log(2), 11*math.log(2), math.log(2), math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-13, -6, -8}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, -6, -8\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${7, 14, 1}$.\n", - "Output Answer": [ - "$\\frac{42}{17}$" - ], - "Output Program": [ - "import statistics\nvalues = 7, 14, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.192,0.085,0.068,0.116,0.059,0.133,0.113,0.063,0.059,0.104\\}$ and $\\{0.047,0.117,0.224,0.066,0.054,0.065,0.097,0.014,0.141,0.035\\}$.", - "Output Answer": [ - "$0.36$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.192, 0.085, 0.068, 0.116, 0.059, 0.133, 0.113, 0.063, 0.059, 0.104\ndistribution2 = 0.047, 0.117, 0.224, 0.066, 0.054, 0.065, 0.097, 0.014, 0.141, 0.035\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5 \\sqrt{2}, -8.4, 6, 0, -13 \\log (2)}$.\n", - "Output Answer": [ - "${-13 \\log (2), -8.4, 0, 6, 5 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5*math.sqrt(2), -8.4, 6, 0, -13*math.log(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, -7, 1, 1, -8, 0, -6, -7, -8, -7, -6, -3, 0, 0, -6, -6, 1, -6, -3, -7, 1, -10, -3, 1, -3, -10, -7, 0, -7, 1}$.\n", - "Output Answer": [ - "$\\{1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, -7, 1, 1, -8, 0, -6, -7, -8, -7, -6, -3, 0, 0, -6, -6, 1, -6, -3, -7, 1, -10, -3, 1, -3, -10, -7, 0, -7, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${6, -5, -3, -7, 5}$.\n", - "Output Answer": [ - "$-\\frac{4}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 6, -5, -3, -7, 5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 0, 5, -3 \\sqrt{3}, -3, 3, -6, -1, -2 \\sqrt{2}, -2, \\sqrt{2}}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 0, 5, -3*math.sqrt(3), -3, 3, -6, -1, -2*math.sqrt(2), -2, math.sqrt(2)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3 e, -\\frac{32}{7}, 1, 5 \\sqrt{3}, -\\frac{11}{\\sqrt{5}}, 8, -6, 2 \\log (2), \\frac{19}{e}, \\frac{47}{7}}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{47}{7}+2 \\log (2)\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.e, -(32/7), 1, 5*math.sqrt(3), -(11/(math.sqrt(5))), 8, -6, 2*math.log(2), (19/math.e), (47/7)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-8, -10, 0.89, 2, \\frac{8}{\\pi }, -3, 3 \\pi} \\setminus {-4, \\frac{11}{\\pi }, 2 \\pi, -8, -\\frac{28}{5}}$.\n", - "Output Answer": [ - "${-10, -3, 0.89, 2, \\frac{8}{\\pi }, 3 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, -10, 0.89, 2, (8/math.pi), -3, 3*math.pi,))\nsnd = set((-4, (11/math.pi), 2*math.pi, -8, -(28/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -7, \\frac{11}{2}, 6, \\frac{11}{2}, \\frac{9}{2}, \\frac{9}{2}, 5, 6, 6, \\frac{9}{2}, \\frac{9}{2}, -1, \\frac{9}{2}, -1, \\frac{9}{2}, \\frac{11}{2}, \\frac{9}{2}, 6, -7, \\frac{11}{2}, -1}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{9}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -7, (11/2), 6, (11/2), (9/2), (9/2), 5, 6, 6, (9/2), (9/2), -1, (9/2), -1, (9/2), (11/2), (9/2), 6, -7, (11/2), -1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${36, 3125, 49, 1, 64}$.\n", - "Output Answer": [ - "$10\\ 2^{3/5} 21^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 36, 3125, 49, 1, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -6, -8}$.\n", - "Output Answer": [ - "$-\\frac{16}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -6, -8\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{32}{7}, 3 \\pi, \\frac{3}{\\sqrt{\\pi }}, -\\frac{11}{\\pi }, 5, 3 \\sqrt{2}, 9, 9, 8, \\frac{14}{\\sqrt{\\pi }}, -5, 7, -7 \\log (2)}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(32/7), 3*math.pi, (3/(math.sqrt(math.pi))), -(11/math.pi), 5, 3*math.sqrt(2), 9, 9, 8, (14/(math.sqrt(math.pi))), -5, 7, -7*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}, \\frac{1}{\\sqrt{3}}, -\\frac{14}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{1}{\\sqrt{3}}, -3 \\sqrt{3}, \\frac{1}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, -\\frac{5}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}, \\frac{13}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, -\\frac{14}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{13}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(13/(math.sqrt(3))), -(13/(math.sqrt(3))), -(5/(math.sqrt(3))), (1/(math.sqrt(3))), -(14/(math.sqrt(3))), -(13/(math.sqrt(3))), (1/(math.sqrt(3))), -3*math.sqrt(3), (1/(math.sqrt(3))), -(13/(math.sqrt(3))), (13/(math.sqrt(3))), -(5/(math.sqrt(3))), (11/(math.sqrt(3))), -(13/(math.sqrt(3))), (11/(math.sqrt(3))), (17/(math.sqrt(3))), (13/(math.sqrt(3))), (11/(math.sqrt(3))), (11/(math.sqrt(3))), -(14/(math.sqrt(3))), (17/(math.sqrt(3))), (17/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.078,0.087,0.097,0.111,0.134,0.194,0.074,0.178\\}$ and $\\{0.004,0.033,0.664,0.01,0.011,0.008,0.09,0.109\\}$.", - "Output Answer": [ - "$1.47$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.078, 0.087, 0.097, 0.111, 0.134, 0.194, 0.074, 0.178\ndistribution2 = 0.004, 0.033, 0.664, 0.01, 0.011, 0.008, 0.09, 0.109\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{16}{\\sqrt{3}}, \\frac{7}{\\sqrt{5}}, -3 \\sqrt{2}, \\frac{32}{5}, 7, 4 \\sqrt{3}, 8, 5 \\sqrt{3}, 7, 0, 6}$.", - "Output Answer": [ - "$\\frac{32}{5}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(16/(math.sqrt(3))), (7/(math.sqrt(5))), -3*math.sqrt(2), (32/5), 7, 4*math.sqrt(3), 8, 5*math.sqrt(3), 7, 0, 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.312,0.086,0.238,0.108,0.044,0.131\\}$ and $\\{0.06,0.124,0.175,0.157,0.115,0.306\\}$.", - "Output Answer": [ - "$0.41$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.312, 0.086, 0.238, 0.108, 0.044, 0.131\ndistribution2 = 0.06, 0.124, 0.175, 0.157, 0.115, 0.306\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -\\pi, -\\pi, -2 \\pi, -2 \\pi, -\\pi, -2 \\pi, -2 \\pi, -\\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -2 \\pi, -\\pi, -2 \\pi}$.\n", - "Output Answer": [ - "$\\{-2 \\pi \\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -math.pi, -math.pi, -2*math.pi, -2*math.pi, -math.pi, -2*math.pi, -2*math.pi, -math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -2*math.pi, -math.pi, -2*math.pi\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6, 3, -\\frac{18}{\\sqrt{5}}, -5}$.", - "Output Answer": [ - "$-\\frac{11}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, 3, -(18/(math.sqrt(5))), -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, 1, 16, 2, 64}$.\n", - "Output Answer": [ - "$8\\ 5^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, 1, 16, 2, 64\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{17}{\\sqrt{3}}, 5, -5, 9} \\setminus {-5, \\frac{7}{\\sqrt{3}}, -6, 1.88}$.\n", - "Output Answer": [ - "${-\\frac{17}{\\sqrt{3}}, 5, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(17/(math.sqrt(3))), 5, -5, 9,))\nsnd = set((-5, (7/(math.sqrt(3))), -6, 1.88,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${3, -\\frac{17}{e}, -10, \\frac{2}{\\sqrt{3}}, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "$13$" - ], - "Output Program": [ - "import math\n\nvalues = 3, -(17/math.e), -10, (2/(math.sqrt(3))), -3*math.sqrt(5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, -5, -3, 5, -10, -4, 1} \\cap {-3, -2, 2, -5, -4, 1, 5, 0}$.\n", - "Output Answer": [ - "${-5, -4, -3, 1, 5}$" - ], - "Output Program": [ - "fst = set((3, -5, -3, 5, -10, -4, 1,))\nsnd = set((-3, -2, 2, -5, -4, 1, 5, 0,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-6, -2, \\frac{16}{\\sqrt{5}}, 4.04, -3, 5, \\frac{6}{e}} \\setminus {\\frac{8}{7}, -5, 4.04, \\frac{16}{\\sqrt{5}}, -2}$.\n", - "Output Answer": [ - "${-6, -3, \\frac{6}{e}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, -2, (16/(math.sqrt(5))), 4.04, -3, 5, (6/math.e),))\nsnd = set(((8/7), -5, 4.04, (16/(math.sqrt(5))), -2,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.9 x^2+4.9 x-8.4$ where $x \\sim $ \\text{PoissonDistribution}[1.4]\n", - "Output Answer": [ - "$14.92$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.4)\nprint(E(4.9*x**2+4.9*x-8.4))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${14, -12, 11, 10, 4}$.\n", - "Output Answer": [ - "$7 \\sqrt{\\frac{11}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, -12, 11, 10, 4\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-12 \\log (2), -0.17, -1, 10 \\log (2), \\frac{9}{e}, -e, -2.56}$.\n", - "Output Answer": [ - "${-12 \\log (2), -e, -2.56, -1, -0.17, \\frac{9}{e}, 10 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = -12*math.log(2), -0.17, -1, 10*math.log(2), (9/math.e), -math.e, -2.56\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 5, -2, -11 \\log (2), \\frac{17}{4}, \\frac{8}{\\sqrt{\\pi }}, -\\frac{20}{3}, -6, -3 \\log (2), -3 e}$.\n", - "Output Answer": [ - "$8+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 5, -2, -11*math.log(2), (17/4), (8/(math.sqrt(math.pi))), -(20/3), -6, -3*math.log(2), -3*math.e\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, -6, -5, -\\frac{12}{e}, -9, -\\frac{13}{4}, -5 \\sqrt{3}, \\frac{43}{7}, 3 \\sqrt{2}, -2, -\\frac{52}{7}, 8}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{13}{4}-\\frac{12}{e}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, -6, -5, -(12/math.e), -9, -(13/4), -5*math.sqrt(3), (43/7), 3*math.sqrt(2), -2, -(52/7), 8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${3, 6, 1, -2, -4, 8, 0, 4, 10, -10} \\cap {9, -4, 6, 0, -8, -10, 3, 5, 8}$.\n", - "Output Answer": [ - "${-10, -4, 0, 3, 6, 8}$" - ], - "Output Program": [ - "fst = set((3, 6, 1, -2, -4, 8, 0, 4, 10, -10,))\nsnd = set((9, -4, 6, 0, -8, -10, 3, 5, 8,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.126,0.178,0.326,0.317\\}$ and $\\{0.167,0.029,0.602,0.002\\}$.", - "Output Answer": [ - "$1.62$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.126, 0.178, 0.326, 0.317\ndistribution2 = 0.167, 0.029, 0.602, 0.002\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-8, -8, 4, 4, -1, 4, -8, -8, 5, -1, 10, 4, -8, 5, -8, 5, 10, 10, -1, -8, -1, 5, 4, -8, -1, 10}$.\n", - "Output Answer": [ - "$\\{-8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -8, -8, 4, 4, -1, 4, -8, -8, 5, -1, 10, 4, -8, 5, -8, 5, 10, 10, -1, -8, -1, 5, 4, -8, -1, 10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{3}{2}, 5, -2 \\sqrt{3}, -3, 3, -4, -9, -\\frac{2}{\\sqrt{\\pi }}, 0, 0}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-\\frac{3}{2}-\\frac{2}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(3/2), 5, -2*math.sqrt(3), -3, 3, -4, -9, -(2/(math.sqrt(math.pi))), 0, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, \\frac{25}{2}, \\frac{29}{2}, 3}$.\n", - "Output Answer": [ - "$\\frac{52200}{7019}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, (25/2), (29/2), 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, 3, 1, -7, \\pi, -1, -e} \\cup {-2 e, 1, 3, -7, \\pi, -1, 2 e}$.\n", - "Output Answer": [ - "${-7, -2 e, -e, -1, 0, 1, 3, \\pi, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 3, 1, -7, math.pi, -1, -math.e,))\nsnd = set((-2*math.e, 1, 3, -7, math.pi, -1, 2*math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${2 \\log (2), \\frac{17}{\\sqrt{3}}, 1, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, 1, 2 \\log (2), \\frac{17}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.log(2), (17/(math.sqrt(3))), 1, -3*math.sqrt(5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{33}{2}, 13}$.\n", - "Output Answer": [ - "$\\frac{858}{59}$" - ], - "Output Program": [ - "import statistics\nvalues = (33/2), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{25}{e}, \\frac{26}{e}}$.\n", - "Output Answer": [ - "$\\frac{1}{2 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(25/math.e), (26/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-4, 7, 2, -1, -7.32, 2}$.\n", - "Output Answer": [ - "${-7.32, -4, -1, 2, 2, 7}$" - ], - "Output Program": [ - "values = -4, 7, 2, -1, -7.32, 2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 9, 1, 11}$.\n", - "Output Answer": [ - "$\\frac{792}{337}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 9, 1, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-e, 7, 2}$.\n", - "Output Answer": [ - "$7+e$" - ], - "Output Program": [ - "import math\n\nvalues = -math.e, 7, 2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${3, -1, 0, -9}$.\n", - "Output Answer": [ - "$-\\frac{7}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 3, -1, 0, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{10}{7}, 6 \\sqrt{2}, 4.76, -4 \\log (2), 6, 0}$.\n", - "Output Answer": [ - "${-4 \\log (2), -\\frac{10}{7}, 0, 4.76, 6, 6 \\sqrt{2}}$" - ], - "Output Program": [ - "import math\n\nvalues = -(10/7), 6*math.sqrt(2), 4.76, -4*math.log(2), 6, 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, 5, 5, 1, 3, 1, 3, 5, 1, 3, 3, 3, 7, 0, 1, 3, 0, 3, 6, 3, 3, 7}$.\n", - "Output Answer": [ - "$\\{3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, 5, 5, 1, 3, 1, 3, 5, 1, 3, 3, 3, 7, 0, 1, 3, 0, 3, 6, 3, 3, 7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4, \\frac{67}{7}, -4 \\log (2), 1, -5 \\sqrt{3}, -\\frac{10}{\\sqrt{\\pi }}, 5, \\frac{22}{\\sqrt{5}}, 2 \\sqrt{5}, -\\frac{8}{\\sqrt{3}}, 8, 9, -2, 8, \\frac{17}{7}}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, (67/7), -4*math.log(2), 1, -5*math.sqrt(3), -(10/(math.sqrt(math.pi))), 5, (22/(math.sqrt(5))), 2*math.sqrt(5), -(8/(math.sqrt(3))), 8, 9, -2, 8, (17/7)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 25, 64, 512}$.\n", - "Output Answer": [ - "$8\\ 2^{3/4} \\sqrt{15}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 25, 64, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.18,0.126,0.125,0.014,0.055,0.061,0.046,0.138,0.104,0.078\\}$ and $\\{0.159,0.121,0.043,0.088,0.038,0.138,0.045,0.094,0.119,0.097\\}$.", - "Output Answer": [ - "$0.15$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.18, 0.126, 0.125, 0.014, 0.055, 0.061, 0.046, 0.138, 0.104, 0.078\ndistribution2 = 0.159, 0.121, 0.043, 0.088, 0.038, 0.138, 0.045, 0.094, 0.119, 0.097\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.297,0.063,0.205,0.09\\}$ and $\\{0.124,0.271,0.309,0.173\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.297, 0.063, 0.205, 0.09\ndistribution2 = 0.124, 0.271, 0.309, 0.173\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, -\\frac{11}{\\sqrt{5}}, -2 \\sqrt{2}, 8}$.\n", - "Output Answer": [ - "$8+\\frac{11}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 7, -(11/(math.sqrt(5))), -2*math.sqrt(2), 8\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-2.84, 7, -4 e, 3 \\sqrt{2}, -6, 10, -5}$.\n", - "Output Answer": [ - "${-4 e, -6, -5, -2.84, 3 \\sqrt{2}, 7, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -2.84, 7, -4*math.e, 3*math.sqrt(2), -6, 10, -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, -12, -10, -1, 1}$.\n", - "Output Answer": [ - "$\\frac{493}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -12, -10, -1, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-4, 9.89, \\frac{25}{7}, 3.3, 1} \\setminus {9, 1, -\\frac{23}{7}}$.\n", - "Output Answer": [ - "${-4, 3.3, \\frac{25}{7}, 9.89}$" - ], - "Output Program": [ - "fst = set((-4, 9.89, (25/7), 3.3, 1,))\nsnd = set((9, 1, -(23/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $0.6 x-6.$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.8]\n", - "Output Answer": [ - "$-6.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.8)\nprint(E(0.6*x-6.))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${7.225, -5, -e, -9, -\\sqrt{3}, 2, 3, -3, -\\frac{6}{\\pi }, -\\frac{59}{7}, 10} \\cup {-7.51, 3, -\\frac{6}{\\pi }, -3, -e, 9, -9, -\\sqrt{3}}$.\n", - "Output Answer": [ - "${-9, -\\frac{59}{7}, -7.51, -5, -3, -e, -\\frac{6}{\\pi }, -\\sqrt{3}, 2, 3, 7.225, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((7.225, -5, -math.e, -9, -math.sqrt(3), 2, 3, -3, -(6/math.pi), -(59/7), 10,))\nsnd = set((-7.51, 3, -(6/math.pi), -3, -math.e, 9, -9, -math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{13}{\\sqrt{2}}, 4 \\sqrt{5}, 8, \\frac{13}{\\sqrt{3}}, \\frac{2}{7}, -6, -e, -14 \\log (2), 0, 9} \\cup {4 \\sqrt{3}, -6, \\frac{13}{\\sqrt{2}}, \\sqrt{5}, 4 \\sqrt{5}, -9, -\\frac{45}{7}, -3 e, 8}$.\n", - "Output Answer": [ - "${-14 \\log (2), -9, -3 e, -\\frac{45}{7}, -6, -e, 0, \\frac{2}{7}, \\sqrt{5}, 4 \\sqrt{3}, \\frac{13}{\\sqrt{3}}, 8, 4 \\sqrt{5}, 9, \\frac{13}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((13/(math.sqrt(2))), 4*math.sqrt(5), 8, (13/(math.sqrt(3))), (2/7), -6, -math.e, -14*math.log(2), 0, 9,))\nsnd = set((4*math.sqrt(3), -6, (13/(math.sqrt(2))), math.sqrt(5), 4*math.sqrt(5), -9, -(45/7), -3*math.e, 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, -2, 3, 6, 0}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{107}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, -2, 3, 6, 0\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{43}{7}, \\frac{2}{7}, \\frac{30}{7}, \\frac{43}{7}, -\\frac{20}{7}, \\frac{17}{7}, \\frac{30}{7}, \\frac{17}{7}, \\frac{30}{7}, \\frac{43}{7}, \\frac{2}{7}, \\frac{2}{7}, \\frac{2}{7}, \\frac{17}{7}, \\frac{17}{7}, \\frac{17}{7}, \\frac{2}{7}, -3, \\frac{17}{7}, \\frac{30}{7}, \\frac{43}{7}, \\frac{43}{7}, -\\frac{31}{7}, \\frac{2}{7}, \\frac{43}{7}, \\frac{2}{7}, \\frac{30}{7}, -\\frac{31}{7}, \\frac{30}{7}, \\frac{43}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{43}{7},\\frac{2}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (43/7), (2/7), (30/7), (43/7), -(20/7), (17/7), (30/7), (17/7), (30/7), (43/7), (2/7), (2/7), (2/7), (17/7), (17/7), (17/7), (2/7), -3, (17/7), (30/7), (43/7), (43/7), -(31/7), (2/7), (43/7), (2/7), (30/7), -(31/7), (30/7), (43/7)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, -\\frac{7}{\\sqrt{5}}, -7, -3, -3, 6}$.\n", - "Output Answer": [ - "${-7, -\\frac{7}{\\sqrt{5}}, -3, -3, 0, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -(7/(math.sqrt(5))), -7, -3, -3, 6\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${10, 0, -4 \\sqrt{3}, -2, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{3}, -4 \\sqrt{3}, -2, 0, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 10, 0, -4*math.sqrt(3), -2, -4*math.sqrt(3)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{12}{e}, -\\frac{2}{e}, \\frac{4}{e}}$.\n", - "Output Answer": [ - "$\\frac{14}{3 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (12/math.e), -(2/math.e), (4/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-8, -4, \\frac{10}{3}, -7, 0, e, \\frac{23}{3}, 3 e, \\frac{18}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$8+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -8, -4, (10/3), -7, 0, math.e, (23/3), 3*math.e, (18/(math.sqrt(5)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.008,0.114,0.005,0.054,0.004,0.007,0.092,0.264,0.41,0.004\\}$ and $\\{0.174,0.067,0.064,0.094,0.046,0.203,0.072,0.053,0.089,0.073\\}$.", - "Output Answer": [ - "$1.03$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.008, 0.114, 0.005, 0.054, 0.004, 0.007, 0.092, 0.264, 0.41, 0.004\ndistribution2 = 0.174, 0.067, 0.064, 0.094, 0.046, 0.203, 0.072, 0.053, 0.089, 0.073\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.1 x^2+3.3 x-4.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$5.88$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(3.1*x**2+3.3*x-4.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.06,0.012,0.146,0.019,0.249,0.02,0.006,0.017,0.024,0.065\\}$ and $\\{0.03,0.014,0.155,0.017,0.245,0.088,0.15,0.164,0.084,0.05\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.06, 0.012, 0.146, 0.019, 0.249, 0.02, 0.006, 0.017, 0.024, 0.065\ndistribution2 = 0.03, 0.014, 0.155, 0.017, 0.245, 0.088, 0.15, 0.164, 0.084, 0.05\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $0.85 < -1.3 x^2+0.4 x+2. < 2.84$ where $x \\sim $ \\text{PoissonDistribution}[1.].", - "Output Answer": [ - "$0.74$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.)\nprint(P((0.85 < -1.3*x**2+0.4*x+2.) & (-1.3*x**2+0.4*x+2. < 2.84)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${11, 8, 11}$.\n", - "Output Answer": [ - "$\\sqrt{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 8, 11\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, 1, 7, -2, 10}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "values = 0, 1, 7, -2, 10\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{16}{e}, 2.95, -\\frac{1}{\\sqrt{3}}, \\frac{9}{e}} \\cup {\\frac{16}{e}, \\frac{9}{e}, -\\frac{7}{\\sqrt{3}}, 2.95}$.\n", - "Output Answer": [ - "${-\\frac{7}{\\sqrt{3}}, -\\frac{1}{\\sqrt{3}}, 2.95, \\frac{9}{e}, \\frac{16}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((16/math.e), 2.95, -(1/(math.sqrt(3))), (9/math.e),))\nsnd = set(((16/math.e), (9/math.e), -(7/(math.sqrt(3))), 2.95,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.158,0.379,0.028\\}$ and $\\{0.261,0.286,0.366\\}$.", - "Output Answer": [ - "$0.4$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.158, 0.379, 0.028\ndistribution2 = 0.261, 0.286, 0.366\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2, 4, -10}$.\n", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 2, 4, -10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.082,0.114,0.593\\}$ and $\\{0.071,0.442,0.117\\}$.", - "Output Answer": [ - "$0.81$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.082, 0.114, 0.593\ndistribution2 = 0.071, 0.442, 0.117\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3, -2, -\\frac{7}{e}, 4, -5 \\sqrt{2}, 6} \\cup {-3, 4, 1, -5 \\sqrt{2}, 0, -\\frac{7}{e}}$.\n", - "Output Answer": [ - "${-5 \\sqrt{2}, -3, -\\frac{7}{e}, -2, 0, 1, 4, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, -2, -(7/math.e), 4, -5*math.sqrt(2), 6,))\nsnd = set((-3, 4, 1, -5*math.sqrt(2), 0, -(7/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{14}{\\pi }, -\\frac{19}{2}, 7, 4, \\frac{11}{\\sqrt{\\pi }}, -8, -7, 3 \\sqrt{3}, -3}$.", - "Output Answer": [ - "$-3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(14/math.pi), -(19/2), 7, 4, (11/(math.sqrt(math.pi))), -8, -7, 3*math.sqrt(3), -3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4, 8, 9, -3, 3}$.", - "Output Answer": [ - "$4$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, 8, 9, -3, 3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.1 x-1.6$ where $x \\sim $ \\text{PoissonDistribution}[1.2]\n", - "Output Answer": [ - "$-0.28$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.2)\nprint(E(1.1*x-1.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-1, \\frac{5}{\\sqrt{3}}, 7, -3 \\pi, -3 \\sqrt{3}} \\cup {7, -6, 2 \\sqrt{3}, 4, \\frac{5}{\\sqrt{3}}, -3 \\pi, 0, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\pi, -5 \\sqrt{3}, -6, -3 \\sqrt{3}, -1, 0, \\frac{5}{\\sqrt{3}}, 2 \\sqrt{3}, 4, 7}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, (5/(math.sqrt(3))), 7, -3*math.pi, -3*math.sqrt(3),))\nsnd = set((7, -6, 2*math.sqrt(3), 4, (5/(math.sqrt(3))), -3*math.pi, 0, -5*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${2, 7, 5, -8} \\cup {-1, -\\frac{22}{5}, 7, -8.48, 4, 5, -8}$.\n", - "Output Answer": [ - "${-8.48, -8, -\\frac{22}{5}, -1, 2, 4, 5, 7}$" - ], - "Output Program": [ - "fst = set((2, 7, 5, -8,))\nsnd = set((-1, -(22/5), 7, -8.48, 4, 5, -8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-9, -0.95, 0} \\setminus {10, -0.95, \\frac{16}{\\sqrt{3}}, -8.88, 5, -9}$.\n", - "Output Answer": [ - "${0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9, -0.95, 0,))\nsnd = set((10, -0.95, (16/(math.sqrt(3))), -8.88, 5, -9,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 e, -3 e, -2 e}$.\n", - "Output Answer": [ - "$-\\frac{7 e}{3}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.e, -3*math.e, -2*math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{19}{2}, 9, 9, \\frac{2}{e}, 8 \\log (2), 6, -2 e, 5, -\\frac{1}{\\sqrt{3}}, 4}$.", - "Output Answer": [ - "$\\frac{9}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(19/2), 9, 9, (2/math.e), 8*math.log(2), 6, -2*math.e, 5, -(1/(math.sqrt(3))), 4\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${0, 10 \\log (2), 8, 2 \\sqrt{5}, -4} \\setminus {3, 2.8, 0, 2 \\sqrt{5}, 3 \\log (2)}$.\n", - "Output Answer": [ - "${-4, 10 \\log (2), 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 10*math.log(2), 8, 2*math.sqrt(5), -4,))\nsnd = set((3, 2.8, 0, 2*math.sqrt(5), 3*math.log(2),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${10000, -4, -10, -7776, -729}$.\n", - "Output Answer": [ - "$180\\ 2^{2/5} \\sqrt[5]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 10000, -4, -10, -7776, -729\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${6, -3, 6, 0, 0, 1, 0, 6, 1, -9, 0, -9, -9, -9, -9, 0, -3, 6, -3, 1, 1, -9}$.\n", - "Output Answer": [ - "$\\{-9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 6, -3, 6, 0, 0, 1, 0, 6, 1, -9, 0, -9, -9, -9, -9, 0, -3, 6, -3, 1, 1, -9\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-8.94, 5, 1.3, 1, -\\frac{12}{\\pi }, 0, -5, -5}$.\n", - "Output Answer": [ - "${-8.94, -5, -5, -\\frac{12}{\\pi }, 0, 1, 1.3, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = -8.94, 5, 1.3, 1, -(12/math.pi), 0, -5, -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.389,0.154,0.317,0.099\\}$ and $\\{0.122,0.214,0.171,0.367\\}$.", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.389, 0.154, 0.317, 0.099\ndistribution2 = 0.122, 0.214, 0.171, 0.367\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4. x^2+3.3 x+0.7$ where $x \\sim $ \\text{PoissonDistribution}[3.]\n", - "Output Answer": [ - "$-37.4$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.)\nprint(E(-4.*x**2+3.3*x+0.7))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${2, -3, 5} \\setminus {-\\frac{9}{5}, -3 e, 5, 3, -7.09}$.\n", - "Output Answer": [ - "${-3, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((2, -3, 5,))\nsnd = set((-(9/5), -3*math.e, 5, 3, -7.09,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.146,0.116,0.066,0.037,0.114,0.107,0.03,0.125,0.062\\}$ and $\\{0.191,0.271,0.089,0.066,0.038,0.074,0.06,0.12,0.047\\}$.", - "Output Answer": [ - "$0.16$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.146, 0.116, 0.066, 0.037, 0.114, 0.107, 0.03, 0.125, 0.062\ndistribution2 = 0.191, 0.271, 0.089, 0.066, 0.038, 0.074, 0.06, 0.12, 0.047\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3 \\sqrt{2}, 3 \\sqrt{2}, -7 \\sqrt{2}, -4 \\sqrt{2}, -\\sqrt{2}, -4 \\sqrt{2}, 3 \\sqrt{2}, \\sqrt{2}, \\sqrt{2}, -7 \\sqrt{2}, -4 \\sqrt{2}, 7 \\sqrt{2}, \\sqrt{2}, -\\sqrt{2}, -\\sqrt{2}, 3 \\sqrt{2}, 3 \\sqrt{2}, -7 \\sqrt{2}, \\sqrt{2}, 3 \\sqrt{2}, -7 \\sqrt{2}, 3 \\sqrt{2}, -4 \\sqrt{2}, -7 \\sqrt{2}}$.\n", - "Output Answer": [ - "$\\left\\{3 \\sqrt{2}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 3*math.sqrt(2), 3*math.sqrt(2), -7*math.sqrt(2), -4*math.sqrt(2), -math.sqrt(2), -4*math.sqrt(2), 3*math.sqrt(2), math.sqrt(2), math.sqrt(2), -7*math.sqrt(2), -4*math.sqrt(2), 7*math.sqrt(2), math.sqrt(2), -math.sqrt(2), -math.sqrt(2), 3*math.sqrt(2), 3*math.sqrt(2), -7*math.sqrt(2), math.sqrt(2), 3*math.sqrt(2), -7*math.sqrt(2), 3*math.sqrt(2), -4*math.sqrt(2), -7*math.sqrt(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{27}{5}, 0, \\frac{21}{5}, 5, -8, \\sqrt{5}, 10, 0, 0}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(27/5), 0, (21/5), 5, -8, math.sqrt(5), 10, 0, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 12 \\log (2), -3 \\log (2), 0, -3 \\sqrt{3}, \\frac{43}{5}, -8, 6, 4 \\sqrt{2}, 5, 7, 9, -\\frac{2}{3}}$.", - "Output Answer": [ - "$5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 12*math.log(2), -3*math.log(2), 0, -3*math.sqrt(3), (43/5), -8, 6, 4*math.sqrt(2), 5, 7, 9, -(2/3)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.142,0.149,0.151,0.045,0.109,0.196,0.065\\}$ and $\\{0.091,0.169,0.248,0.037,0.1,0.13,0.176\\}$.", - "Output Answer": [ - "$0.11$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.142, 0.149, 0.151, 0.045, 0.109, 0.196, 0.065\ndistribution2 = 0.091, 0.169, 0.248, 0.037, 0.1, 0.13, 0.176\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\sqrt{2}, 6 \\sqrt{2}, \\frac{7}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, \\sqrt{2}, \\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, \\frac{7}{\\sqrt{2}}, \\sqrt{2}, -\\frac{1}{\\sqrt{2}}, -\\frac{1}{\\sqrt{2}}, \\sqrt{2}, 6 \\sqrt{2}, 6 \\sqrt{2}, -\\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{\\sqrt{2},-\\frac{1}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = math.sqrt(2), 6*math.sqrt(2), (7/(math.sqrt(2))), -(1/(math.sqrt(2))), (1/(math.sqrt(2))), (1/(math.sqrt(2))), math.sqrt(2), -(1/(math.sqrt(2))), math.sqrt(2), (1/(math.sqrt(2))), (1/(math.sqrt(2))), (7/(math.sqrt(2))), (7/(math.sqrt(2))), math.sqrt(2), -(1/(math.sqrt(2))), (7/(math.sqrt(2))), math.sqrt(2), -(1/(math.sqrt(2))), -(1/(math.sqrt(2))), math.sqrt(2), 6*math.sqrt(2), 6*math.sqrt(2), -(1/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${125, -64, -7}$.\n", - "Output Answer": [ - "$20 \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 125, -64, -7\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.272,0.171,0.058,0.141,0.23,0.037\\}$ and $\\{0.138,0.204,0.252,0.109,0.047,0.019\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.272, 0.171, 0.058, 0.141, 0.23, 0.037\ndistribution2 = 0.138, 0.204, 0.252, 0.109, 0.047, 0.019\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, -2, 11, -3, 4}$.\n", - "Output Answer": [ - "$\\frac{457}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, -2, 11, -3, 4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 12, 16, 8}$.\n", - "Output Answer": [ - "$\\frac{192}{25}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 12, 16, 8\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{2}{7}, 2, \\frac{25}{7}, \\frac{48}{7}, \\frac{25}{7}, 2, \\frac{43}{7}, \\frac{25}{7}, \\frac{2}{7}, \\frac{2}{7}, \\frac{2}{7}, \\frac{2}{7}, \\frac{25}{7}, \\frac{2}{7}, \\frac{2}{7}, \\frac{2}{7}, \\frac{2}{7}, 2, \\frac{43}{7}, \\frac{2}{7}, 2, \\frac{25}{7}, \\frac{25}{7}, \\frac{48}{7}, \\frac{48}{7}, \\frac{24}{7}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{2}{7}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = (2/7), 2, (25/7), (48/7), (25/7), 2, (43/7), (25/7), (2/7), (2/7), (2/7), (2/7), (25/7), (2/7), (2/7), (2/7), (2/7), 2, (43/7), (2/7), 2, (25/7), (25/7), (48/7), (48/7), (24/7)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-10, 5, -10, 8, 10, 5}$.\n", - "Output Answer": [ - "$\\frac{4}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -10, 5, -10, 8, 10, 5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.395,0.103,0.065,0.05,0.213,0.115\\}$ and $\\{0.153,0.168,0.281,0.092,0.105,0.163\\}$.", - "Output Answer": [ - "$0.35$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.395, 0.103, 0.065, 0.05, 0.213, 0.115\ndistribution2 = 0.153, 0.168, 0.281, 0.092, 0.105, 0.163\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-4 \\sqrt{2}, 8, \\frac{12}{7}, -9, -4, 1} \\setminus {-4, 2, 9, -2, -\\sqrt{2}, \\frac{12}{7}}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{2}, 1, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4*math.sqrt(2), 8, (12/7), -9, -4, 1,))\nsnd = set((-4, 2, 9, -2, -math.sqrt(2), (12/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -1, -\\sqrt{5}, -1.795, -5, 1, 0, -e} \\cup {-4, -3 \\sqrt{5}, -1, 3 e, -1.795, 4, 1}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -5, -4, -e, -\\sqrt{5}, -1.795, -1, 0, 1, 4, 3 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -1, -math.sqrt(5), -1.795, -5, 1, 0, -math.e,))\nsnd = set((-4, -3*math.sqrt(5), -1, 3*math.e, -1.795, 4, 1,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{16}{\\pi }, -\\frac{24}{\\pi }, -\\frac{18}{\\pi }, \\frac{22}{\\pi }, \\frac{11}{\\pi }, -\\frac{18}{\\pi }, \\frac{21}{\\pi }, \\frac{7}{\\pi }, \\frac{11}{\\pi }, -\\frac{18}{\\pi }, \\frac{11}{\\pi }, \\frac{11}{\\pi }, \\frac{22}{\\pi }, \\frac{22}{\\pi }, -\\frac{24}{\\pi }, \\frac{7}{\\pi }, \\frac{22}{\\pi }, \\frac{21}{\\pi }, \\frac{22}{\\pi }, -\\frac{18}{\\pi }, \\frac{11}{\\pi }, \\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{22}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(16/math.pi), -(24/math.pi), -(18/math.pi), (22/math.pi), (11/math.pi), -(18/math.pi), (21/math.pi), (7/math.pi), (11/math.pi), -(18/math.pi), (11/math.pi), (11/math.pi), (22/math.pi), (22/math.pi), -(24/math.pi), (7/math.pi), (22/math.pi), (21/math.pi), (22/math.pi), -(18/math.pi), (11/math.pi), (22/math.pi)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${3 \\pi, 10, \\frac{20}{e}, 3 \\sqrt{2}, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${3 \\sqrt{2}, \\frac{20}{e}, 6 \\sqrt{2}, 3 \\pi, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.pi, 10, (20/math.e), 3*math.sqrt(2), 6*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-7, 64, 8, 4, 117649, 100}$.\n", - "Output Answer": [ - "$28 \\sqrt[6]{-14} \\sqrt[3]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -7, 64, 8, 4, 117649, 100\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, -4 \\log (2), -2, -1, -3}$.\n", - "Output Answer": [ - "${-3, -4 \\log (2), -2, -1, 5}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -4*math.log(2), -2, -1, -3\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{1}{\\sqrt{2}}, -9, 7, -1}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{1}{\\sqrt{2}}-1\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (1/(math.sqrt(2))), -9, 7, -1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.189,0.308,0.046,0.13,0.132\\}$ and $\\{0.065,0.15,0.161,0.319,0.281\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.189, 0.308, 0.046, 0.13, 0.132\ndistribution2 = 0.065, 0.15, 0.161, 0.319, 0.281\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $1.08 < 3.7 x-1.4 < 2.98$ where $x \\sim $ \\text{PoissonDistribution}[0.5].", - "Output Answer": [ - "$0.3$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.5)\nprint(P((1.08 < 3.7*x-1.4) & (3.7*x-1.4 < 2.98)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${8, -15, -5, 15}$.\n", - "Output Answer": [ - "$\\frac{2147}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 8, -15, -5, 15\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-1, 6, \\frac{1}{2}, -4, 1, 10}$.\n", - "Output Answer": [ - "$\\frac{25}{12}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -1, 6, (1/2), -4, 1, 10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\log (2), -\\frac{11}{\\sqrt{3}}, 5 \\sqrt{3}, -9, -6} \\setminus {-9, 3 \\sqrt{5}, 5 \\sqrt{3}, -6, -2 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-\\frac{11}{\\sqrt{3}}, \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.log(2), -(11/(math.sqrt(3))), 5*math.sqrt(3), -9, -6,))\nsnd = set((-9, 3*math.sqrt(5), 5*math.sqrt(3), -6, -2*math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8.49, 9, -3 \\sqrt{5}, \\frac{14}{\\sqrt{3}}, -2.7, -\\frac{15}{4}} \\cup {3, 8.49, \\frac{14}{\\sqrt{3}}, -2.7, -3 \\sqrt{5}, -\\frac{15}{4}, 10}$.\n", - "Output Answer": [ - "${-3 \\sqrt{5}, -\\frac{15}{4}, -2.7, 3, \\frac{14}{\\sqrt{3}}, 8.49, 9, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((8.49, 9, -3*math.sqrt(5), (14/(math.sqrt(3))), -2.7, -(15/4),))\nsnd = set((3, 8.49, (14/(math.sqrt(3))), -2.7, -3*math.sqrt(5), -(15/4), 10,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 25, 16, 216}$.\n", - "Output Answer": [ - "$2\\ 6^{3/4} \\sqrt{35}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 25, 16, 216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.202,0.051,0.039,0.199,0.15,0.11,0.131,0.047\\}$ and $\\{0.051,0.103,0.104,0.061,0.144,0.135,0.151,0.2\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.202, 0.051, 0.039, 0.199, 0.15, 0.11, 0.131, 0.047\ndistribution2 = 0.051, 0.103, 0.104, 0.061, 0.144, 0.135, 0.151, 0.2\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${\\sqrt{5}, 0, 2 \\sqrt{5}, 3 \\sqrt{5}, 4 \\sqrt{5}, -3 \\sqrt{5}, -2 \\sqrt{5}, -4 \\sqrt{5}} \\cap {0, -3 \\sqrt{5}, -4 \\sqrt{5}, 3 \\sqrt{5}, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -3 \\sqrt{5}, 0, 2 \\sqrt{5}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(5), 0, 2*math.sqrt(5), 3*math.sqrt(5), 4*math.sqrt(5), -3*math.sqrt(5), -2*math.sqrt(5), -4*math.sqrt(5),))\nsnd = set((0, -3*math.sqrt(5), -4*math.sqrt(5), 3*math.sqrt(5), 2*math.sqrt(5),))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, -6, -9, 7, -10, -1, \\frac{47}{5}, \\frac{22}{\\pi }}$.\n", - "Output Answer": [ - "${-10, -9, -6, -1, 0, 7, \\frac{22}{\\pi }, \\frac{47}{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -6, -9, 7, -10, -1, (47/5), (22/math.pi)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${5, 0, 6, -9, 6, 6, -1, 6, -1, 0, -9, 0, -9, -9, 6, 0, -1, 6, -1, 0}$.\n", - "Output Answer": [ - "$\\{6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 5, 0, 6, -9, 6, 6, -1, 6, -1, 0, -9, 0, -9, -9, 6, 0, -1, 6, -1, 0\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{4}{\\sqrt{3}}, -9, -1, 8, \\frac{23}{e}, 7, -5} \\cup {-9, -1, 7, \\frac{4}{\\sqrt{3}}, -6, 8, \\frac{23}{e}}$.\n", - "Output Answer": [ - "${-9, -6, -5, -1, \\frac{4}{\\sqrt{3}}, 7, 8, \\frac{23}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((4/(math.sqrt(3))), -9, -1, 8, (23/math.e), 7, -5,))\nsnd = set((-9, -1, 7, (4/(math.sqrt(3))), -6, 8, (23/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${9.92, -5, 5, -2, -8, 2, \\frac{2}{e}, 6 \\sqrt{2}, -\\frac{43}{5}, 0} \\cup {\\frac{15}{e}, 5, -5, -\\frac{43}{5}, 9, 0, 8, -2}$.\n", - "Output Answer": [ - "${-\\frac{43}{5}, -8, -5, -2, 0, \\frac{2}{e}, 2, 5, \\frac{15}{e}, 8, 6 \\sqrt{2}, 9, 9.92}$" - ], - "Output Program": [ - "import math\n\nfst = set((9.92, -5, 5, -2, -8, 2, (2/math.e), 6*math.sqrt(2), -(43/5), 0,))\nsnd = set(((15/math.e), 5, -5, -(43/5), 9, 0, 8, -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${1, -6.4, -\\frac{11}{2}, \\frac{7}{\\sqrt{2}}, -9, -\\frac{27}{4}} \\cup {\\frac{7}{\\sqrt{2}}, -\\frac{27}{4}, -9, -10, 4.2, \\frac{27}{4}}$.\n", - "Output Answer": [ - "${-10, -9, -\\frac{27}{4}, -6.4, -\\frac{11}{2}, 1, 4.2, \\frac{7}{\\sqrt{2}}, \\frac{27}{4}}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, -6.4, -(11/2), (7/(math.sqrt(2))), -9, -(27/4),))\nsnd = set(((7/(math.sqrt(2))), -(27/4), -9, -10, 4.2, (27/4),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-5 \\sqrt{2}, 3 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, 3 \\sqrt{2}, 3 \\sqrt{2}, 3 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -5 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, 3 \\sqrt{2}, -5 \\sqrt{2}, -5 \\sqrt{2}, \\frac{3}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\frac{1}{\\sqrt{2}}, \\frac{3}{\\sqrt{2}}, -5 \\sqrt{2}, 3 \\sqrt{2}, \\frac{1}{\\sqrt{2}}, -5 \\sqrt{2}, \\frac{1}{\\sqrt{2}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{1}{\\sqrt{2}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -5*math.sqrt(2), 3*math.sqrt(2), (3/(math.sqrt(2))), (3/(math.sqrt(2))), (1/(math.sqrt(2))), (3/(math.sqrt(2))), 3*math.sqrt(2), 3*math.sqrt(2), 3*math.sqrt(2), (1/(math.sqrt(2))), -5*math.sqrt(2), (1/(math.sqrt(2))), (1/(math.sqrt(2))), 3*math.sqrt(2), -5*math.sqrt(2), -5*math.sqrt(2), (3/(math.sqrt(2))), (1/(math.sqrt(2))), (1/(math.sqrt(2))), (3/(math.sqrt(2))), -5*math.sqrt(2), 3*math.sqrt(2), (1/(math.sqrt(2))), -5*math.sqrt(2), (1/(math.sqrt(2)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, 1, 5, \\frac{9}{5}, -\\frac{42}{5}, 5}$.", - "Output Answer": [ - "$\\frac{7}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 1, 5, (9/5), -(42/5), 5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-10, 10, 0, -\\frac{28}{5}, 6 \\sqrt{2}, -9, 1, -9}$.\n", - "Output Answer": [ - "${-10, -9, -9, -\\frac{28}{5}, 0, 1, 6 \\sqrt{2}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = -10, 10, 0, -(28/5), 6*math.sqrt(2), -9, 1, -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, -5, 14, -7, -11, 11}$.\n", - "Output Answer": [ - "$\\frac{3509}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, -5, 14, -7, -11, 11\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, 3 \\log (2), \\frac{17}{e}, \\frac{20}{e}, 4, \\sqrt{5}} \\setminus {-1, 2 \\sqrt{5}, \\frac{20}{e}, 4}$.\n", - "Output Answer": [ - "${3 \\log (2), \\sqrt{5}, 3, \\frac{17}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, 3*math.log(2), (17/math.e), (20/math.e), 4, math.sqrt(5),))\nsnd = set((-1, 2*math.sqrt(5), (20/math.e), 4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${243, 4, 32, 15625, 49, 9}$.\n", - "Output Answer": [ - "$30 \\sqrt[6]{6} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 243, 4, 32, 15625, 49, 9\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${2401, 16, -6, 1, 81}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-1} 7^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 2401, 16, -6, 1, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 5 \\sqrt{3}, 4, -4, -6, 4 \\sqrt{3}, 7 \\log (2), -\\frac{44}{5}, -7, 4, -6, -\\frac{2}{\\sqrt{5}}, -\\frac{18}{\\pi }, 10 \\log (2), -1}$.\n", - "Output Answer": [ - "$\\frac{44}{5}+5 \\sqrt{3}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 5*math.sqrt(3), 4, -4, -6, 4*math.sqrt(3), 7*math.log(2), -(44/5), -7, 4, -6, -(2/(math.sqrt(5))), -(18/math.pi), 10*math.log(2), -1\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{1}{\\sqrt{5}}, -\\frac{12}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}, -\\sqrt{5}, -\\frac{18}{\\sqrt{5}}, -\\frac{4}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}, \\frac{21}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{8} \\left(-\\frac{2}{\\sqrt{5}}-\\sqrt{5}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (1/(math.sqrt(5))), -(12/(math.sqrt(5))), -(11/(math.sqrt(5))), -math.sqrt(5), -(18/(math.sqrt(5))), -(4/(math.sqrt(5))), (21/(math.sqrt(5))), (21/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.266,0.209,0.123,0.042,0.107,0.038,0.159\\}$ and $\\{0.133,0.055,0.154,0.188,0.125,0.045,0.102\\}$.", - "Output Answer": [ - "$0.28$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.266, 0.209, 0.123, 0.042, 0.107, 0.038, 0.159\ndistribution2 = 0.133, 0.055, 0.154, 0.188, 0.125, 0.045, 0.102\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{9}{2}, -4, -\\frac{26}{3}, -\\frac{16}{3}, 0, \\sqrt{3}, 8, 10, -5}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(9/2), -4, -(26/3), -(16/3), 0, math.sqrt(3), 8, 10, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{23}{e}, \\frac{13}{\\sqrt{3}}, 3 \\sqrt{3}, -\\frac{35}{4}, -\\frac{43}{5}, 5} \\setminus {-\\frac{13}{2}, -\\frac{35}{4}, -6, \\frac{1}{e}}$.\n", - "Output Answer": [ - "${-\\frac{43}{5}, -\\frac{23}{e}, 5, 3 \\sqrt{3}, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(23/math.e), (13/(math.sqrt(3))), 3*math.sqrt(3), -(35/4), -(43/5), 5,))\nsnd = set((-(13/2), -(35/4), -6, (1/math.e),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{26}{\\pi }, -\\frac{47}{5}, 3, -5, -2, \\sqrt{3}, 0} \\setminus {-9, 0, -2, \\frac{26}{\\pi }, \\sqrt{3}, -\\frac{47}{5}}$.\n", - "Output Answer": [ - "${-5, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set(((26/math.pi), -(47/5), 3, -5, -2, math.sqrt(3), 0,))\nsnd = set((-9, 0, -2, (26/math.pi), math.sqrt(3), -(47/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x-6.2$ where $x \\sim $ \\text{PoissonDistribution}[1.2]\n", - "Output Answer": [ - "$-4.52$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.2)\nprint(E(1.4*x-6.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.122,0.12,0.114,0.013,0.116,0.01,0.012,0.226,0.004,0.249\\}$ and $\\{0.112,0.068,0.085,0.157,0.044,0.072,0.14,0.063,0.05,0.083\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.122, 0.12, 0.114, 0.013, 0.116, 0.01, 0.012, 0.226, 0.004, 0.249\ndistribution2 = 0.112, 0.068, 0.085, 0.157, 0.044, 0.072, 0.14, 0.063, 0.05, 0.083\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{39}{7}, -\\frac{53}{7}, -5, \\frac{25}{7}, -\\frac{37}{7}, \\frac{16}{7}, -\\frac{27}{7}}$.\n", - "Output Answer": [ - "$-\\frac{72}{49}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (39/7), -(53/7), -5, (25/7), -(37/7), (16/7), -(27/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-4, 3, 9, -7, \\frac{6}{\\pi }, \\frac{26}{e}} \\setminus {-8, -5, \\frac{6}{\\pi }, -4, 3}$.\n", - "Output Answer": [ - "${-7, 9, \\frac{26}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-4, 3, 9, -7, (6/math.pi), (26/math.e),))\nsnd = set((-8, -5, (6/math.pi), -4, 3,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, -\\frac{16}{\\sqrt{\\pi }}, -2, -12 \\log (2), \\frac{26}{5}, 2, \\frac{8}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -12 \\log (2), -2, 2, \\frac{8}{\\pi }, \\frac{26}{5}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -(16/(math.sqrt(math.pi))), -2, -12*math.log(2), (26/5), 2, (8/math.pi)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-5.996, 6, 10 \\log (2), -9, -\\frac{11}{4}, 9., 0, 7, 1} \\cup {9., \\frac{29}{4}, 6, 0, -9, -4, 10 \\log (2), 7, -5.996}$.\n", - "Output Answer": [ - "${-9, -5.996, -4, -\\frac{11}{4}, 0, 1, 6, 10 \\log (2), 7, \\frac{29}{4}, 9.}$" - ], - "Output Program": [ - "import math\n\nfst = set((-5.996, 6, 10*math.log(2), -9, -(11/4), 9., 0, 7, 1,))\nsnd = set((9., (29/4), 6, 0, -9, -4, 10*math.log(2), 7, -5.996,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 15, 11, 11}$.\n", - "Output Answer": [ - "$\\frac{330}{37}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 15, 11, 11\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${13 \\log (2), -2, -9 \\log (2), 9, 2, 7, 3 \\pi, -\\frac{6}{7}, 8, -\\sqrt{3}, 3, -\\frac{17}{2}, -8, -4, 3}$.\n", - "Output Answer": [ - "$\\frac{17}{2}+3 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = 13*math.log(2), -2, -9*math.log(2), 9, 2, 7, 3*math.pi, -(6/7), 8, -math.sqrt(3), 3, -(17/2), -8, -4, 3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${20, 16, \\frac{25}{2}}$.\n", - "Output Answer": [ - "$\\frac{1200}{77}$" - ], - "Output Program": [ - "import statistics\nvalues = 20, 16, (25/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, 2, -1, 9, \\frac{16}{\\sqrt{\\pi }}, -4, -8, -\\sqrt{5}, \\frac{13}{3}, 4 \\sqrt{3}, \\frac{5}{2}, 4 \\log (2)}$.", - "Output Answer": [ - "$\\frac{9}{4}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, 2, -1, 9, (16/(math.sqrt(math.pi))), -4, -8, -math.sqrt(5), (13/3), 4*math.sqrt(3), (5/2), 4*math.log(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-\\frac{2}{\\sqrt{3}}, -\\frac{62}{7}, \\frac{25}{\\pi }, -6, -\\sqrt{3}, -2 \\sqrt{3}} \\setminus {-2 \\sqrt{3}, -7, -\\sqrt{3}, -\\frac{2}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "${-\\frac{62}{7}, -6, \\frac{25}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(2/(math.sqrt(3))), -(62/7), (25/math.pi), -6, -math.sqrt(3), -2*math.sqrt(3),))\nsnd = set((-2*math.sqrt(3), -7, -math.sqrt(3), -(2/(math.sqrt(3))),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.7 x-4.5$ where $x \\sim $ \\text{PoissonDistribution}[3.2]\n", - "Output Answer": [ - "$7.34$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.2)\nprint(E(3.7*x-4.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.9 x^2+2.9 x+3.6$ where $x \\sim $ \\text{ExponentialDistribution}[1.3]\n", - "Output Answer": [ - "$8.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.3)\nprint(E(1.9*x**2+2.9*x+3.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -9, 3}$.\n", - "Output Answer": [ - "$-\\frac{13}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -9, 3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${2 e, -e, 3 e, -e}$.\n", - "Output Answer": [ - "$\\frac{3 e}{4}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 2*math.e, -math.e, 3*math.e, -math.e\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-12, -11, -9, 1}$.\n", - "Output Answer": [ - "$\\frac{427}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -11, -9, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${2 e, 0}$.\n", - "Output Answer": [ - "$2 e$" - ], - "Output Program": [ - "import math\n\nvalues = 2*math.e, 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, 2, \\frac{23}{2}}$.\n", - "Output Answer": [ - "$\\frac{828}{185}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, 2, (23/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{59}{3}, \\frac{10}{3}}$.\n", - "Output Answer": [ - "$\\frac{1180}{207}$" - ], - "Output Program": [ - "import statistics\nvalues = (59/3), (10/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-3, 243, -3, 16807, 81}$.\n", - "Output Answer": [ - "$63 \\sqrt[5]{3}$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 243, -3, 16807, 81\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, -6, 512}$.\n", - "Output Answer": [ - "$8 \\sqrt[3]{-6} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, -6, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -8, 1, -4, -4, -7, -6}$.\n", - "Output Answer": [ - "$-\\frac{33}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -8, 1, -4, -4, -7, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${4, 4, -5, -5, -7, 6}$.\n", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 4, 4, -5, -5, -7, 6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{21}{e}, -4, 8, -8, \\frac{20}{7}} \\cup {8, -4, -\\frac{49}{5}, -\\frac{21}{e}, \\frac{20}{7}}$.\n", - "Output Answer": [ - "${-\\frac{49}{5}, -8, -\\frac{21}{e}, -4, \\frac{20}{7}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(21/math.e), -4, 8, -8, (20/7),))\nsnd = set((8, -4, -(49/5), -(21/math.e), (20/7),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x^2-0.9 x-2.3$ where $x \\sim $ \\text{ExponentialDistribution}[0.2]\n", - "Output Answer": [ - "$53.2$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 0.2)\nprint(E(1.2*x**2-0.9*x-2.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.8 x^2-1.1 x-5.$ where $x \\sim $ \\text{PoissonDistribution}[3.9]\n", - "Output Answer": [ - "$44.22$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.9)\nprint(E(2.8*x**2-1.1*x-5.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-9, 1, 4, 6, -9, 1, -6}$.\n", - "Output Answer": [ - "$-\\frac{12}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -9, 1, 4, 6, -9, 1, -6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${4, 2, 11, 3}$.\n", - "Output Answer": [ - "$\\frac{528}{155}$" - ], - "Output Program": [ - "import statistics\nvalues = 4, 2, 11, 3\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.139,0.096,0.301,0.135,0.168,0.023\\}$ and $\\{0.113,0.025,0.201,0.095,0.083,0.283\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.139, 0.096, 0.301, 0.135, 0.168, 0.023\ndistribution2 = 0.113, 0.025, 0.201, 0.095, 0.083, 0.283\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, 5, -8, 5, 2, 0, 2, 2, 5, 5, 5, 2, 0, -8, 5, 5, 5, 0, -8, 5, 2, -8, 5}$.\n", - "Output Answer": [ - "$\\{5\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, 5, -8, 5, 2, 0, 2, 2, 5, 5, 5, 2, 0, -8, 5, 5, 5, 0, -8, 5, 2, -8, 5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\sqrt{3}, -3 \\sqrt{2}, -6, -2, 0, 2} \\setminus {1, 0, 6, -6, -2, -8, \\sqrt{3}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{2}, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set((math.sqrt(3), -3*math.sqrt(2), -6, -2, 0, 2,))\nsnd = set((1, 0, 6, -6, -2, -8, math.sqrt(3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.4 x^2+2.7 x-5.2$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-9.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-1.4*x**2+2.7*x-5.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{5}{4}, 9, 7 \\log (2), -8, 9, 4, 6, 6}$.\n", - "Output Answer": [ - "$17$" - ], - "Output Program": [ - "import math\n\nvalues = (5/4), 9, 7*math.log(2), -8, 9, 4, 6, 6\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{28}{3}, \\frac{11}{3}, 11, \\frac{59}{3}}$.\n", - "Output Answer": [ - "$\\frac{72688}{9479}$" - ], - "Output Program": [ - "import statistics\nvalues = (28/3), (11/3), 11, (59/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.5 x+4.3$ where $x \\sim $ \\text{BetaDistribution}[1.7,1.4]\n", - "Output Answer": [ - "$5.67$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.7, 1.4)\nprint(E(2.5*x+4.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{2}, e, -\\frac{14}{\\sqrt{5}}, -5, -3, \\frac{14}{\\sqrt{3}}, \\frac{9}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{14}{\\sqrt{3}}+\\frac{14}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(2), math.e, -(14/(math.sqrt(5))), -5, -3, (14/(math.sqrt(3))), (9/math.pi)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 4096, -16807, -512, 1, 4}$.\n", - "Output Answer": [ - "$8\\ 14^{5/6}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 4096, -16807, -512, 1, 4\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${6, -2, -\\frac{12}{5}, \\frac{14}{5}, \\frac{1}{\\sqrt{5}}, -\\frac{19}{\\pi }, 1, \\frac{26}{e}, -3, 6 \\sqrt{2}, \\frac{27}{4}, -6, \\frac{26}{7}, -8, 9}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 6, -2, -(12/5), (14/5), (1/(math.sqrt(5))), -(19/math.pi), 1, (26/math.e), -3, 6*math.sqrt(2), (27/4), -6, (26/7), -8, 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.09,0.106,0.083,0.081,0.008,0.134,0.19,0.214\\}$ and $\\{0.05,0.024,0.12,0.177,0.116,0.128,0.134,0.13\\}$.", - "Output Answer": [ - "$0.27$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.09, 0.106, 0.083, 0.081, 0.008, 0.134, 0.19, 0.214\ndistribution2 = 0.05, 0.024, 0.12, 0.177, 0.116, 0.128, 0.134, 0.13\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.2 x+1.9$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$1.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(1.2*x+1.9))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -2, 2, \\frac{11}{2}, \\frac{3}{4}, 6 \\log (2), 3, -\\frac{7}{2}, -\\frac{22}{5}} \\cup {2, \\frac{7}{2}, 5 \\log (2), 4, -5, 3, \\frac{11}{2}, \\frac{3}{4}, -\\frac{23}{5}}$.\n", - "Output Answer": [ - "${-5, -\\frac{23}{5}, -\\frac{22}{5}, -\\frac{7}{2}, -2, \\frac{3}{4}, 2, 3, 5 \\log (2), \\frac{7}{2}, 4, 6 \\log (2), \\frac{11}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -2, 2, (11/2), (3/4), 6*math.log(2), 3, -(7/2), -(22/5),))\nsnd = set((2, (7/2), 5*math.log(2), 4, -5, 3, (11/2), (3/4), -(23/5),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${3, -10, 2, 2, -1}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{287}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, -10, 2, 2, -1\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${6, 6, -\\frac{22}{3}, 3, 2 \\sqrt{3}, \\frac{52}{7}, -\\frac{26}{e}, -\\frac{54}{7}, -3, 2 \\log (2), 4, 9, \\frac{1}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$9+\\frac{26}{e}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 6, -(22/3), 3, 2*math.sqrt(3), (52/7), -(26/math.e), -(54/7), -3, 2*math.log(2), 4, 9, (1/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, -\\frac{3}{\\pi }, 7, -6.8, 6 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-6.8, -\\frac{3}{\\pi }, 7, 6 \\sqrt{2}, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, -(3/math.pi), 7, -6.8, 6*math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.182,0.146,0.031,0.263,0.015,0.082\\}$ and $\\{0.228,0.403,0.077,0.016,0.1,0.035,0.102\\}$.", - "Output Answer": [ - "$0.38$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.182, 0.146, 0.031, 0.263, 0.015, 0.082\ndistribution2 = 0.228, 0.403, 0.077, 0.016, 0.1, 0.035, 0.102\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2, -2, -5, 1, 2}$.\n", - "Output Answer": [ - "$-\\frac{6}{5}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -2, -2, -5, 1, 2\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, 8, -7, -10, -4, -3, -10}$.\n", - "Output Answer": [ - "$-\\frac{29}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, 8, -7, -10, -4, -3, -10\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, 8, 12, 11, -3, 1}$.\n", - "Output Answer": [ - "$\\frac{1193}{30}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, 8, 12, 11, -3, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-10, \\frac{1}{2}}$.\n", - "Output Answer": [ - "${-10, \\frac{1}{2}}$" - ], - "Output Program": [ - "values = -10, (1/2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, \\frac{19}{2}, 13}$.\n", - "Output Answer": [ - "$\\frac{11115}{922}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, (19/2), 13\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-0.2 x^2-3.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.5]\n", - "Output Answer": [ - "$-3.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.5)\nprint(E(-0.2*x**2-3.6))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-6, 0, -1, -1}$.\n", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -6, 0, -1, -1\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\pi, 1, -4, 8, 3, \\frac{2}{\\sqrt{3}}, -2, 2}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(2+\\frac{2}{\\sqrt{3}}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.pi, 1, -4, 8, 3, (2/(math.sqrt(3))), -2, 2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7 \\sqrt{2}, 0, \\frac{3}{5}, -3}$.", - "Output Answer": [ - "$\\frac{3}{10}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7*math.sqrt(2), 0, (3/5), -3\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-5, -\\frac{47}{5}}$.\n", - "Output Answer": [ - "$\\frac{22}{5}$" - ], - "Output Program": [ - "values = -5, -(47/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{2}{\\sqrt{5}}, 4 \\sqrt{5}, \\frac{13}{\\sqrt{5}}, -\\frac{1}{\\sqrt{5}}, -\\frac{13}{\\sqrt{5}}}$.\n", - "Output Answer": [ - "$\\frac{1}{5} \\left(4 \\sqrt{5}-\\frac{3}{\\sqrt{5}}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(2/(math.sqrt(5))), 4*math.sqrt(5), (13/(math.sqrt(5))), -(1/(math.sqrt(5))), -(13/(math.sqrt(5)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${3 \\log (2), -2}$.\n", - "Output Answer": [ - "${-2, 3 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nvalues = 3*math.log(2), -2\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${1, \\frac{25}{3}, \\frac{4}{3}, -\\frac{11}{3}, -\\frac{1}{3}, -\\frac{1}{3}, -\\frac{1}{3}, \\frac{14}{3}, \\frac{4}{3}, -\\frac{11}{3}, \\frac{25}{3}, \\frac{25}{3}, -\\frac{1}{3}, 1, -\\frac{11}{3}, -\\frac{1}{3}, \\frac{14}{3}, 1, \\frac{4}{3}, \\frac{4}{3}, \\frac{25}{3}, -\\frac{1}{3}, \\frac{25}{3}, -\\frac{11}{3}, \\frac{8}{3}, \\frac{14}{3}, \\frac{8}{3}, -\\frac{11}{3}, 1, \\frac{25}{3}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{25}{3},-\\frac{1}{3}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 1, (25/3), (4/3), -(11/3), -(1/3), -(1/3), -(1/3), (14/3), (4/3), -(11/3), (25/3), (25/3), -(1/3), 1, -(11/3), -(1/3), (14/3), 1, (4/3), (4/3), (25/3), -(1/3), (25/3), -(11/3), (8/3), (14/3), (8/3), -(11/3), 1, (25/3)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-6, 6, 9, -6, \\frac{6}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "${-6, -6, \\frac{6}{\\sqrt{\\pi }}, 6, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 6, 9, -6, (6/(math.sqrt(math.pi)))\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.235,0.209,0.255,0.038,0.033,0.137,0.01\\}$ and $\\{0.09,0.094,0.253,0.133,0.021,0.19,0.056\\}$.", - "Output Answer": [ - "$0.24$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.235, 0.209, 0.255, 0.038, 0.033, 0.137, 0.01\ndistribution2 = 0.09, 0.094, 0.253, 0.133, 0.021, 0.19, 0.056\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, -7, -1, -2, 0}$.\n", - "Output Answer": [ - "$\\frac{97}{10}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, -7, -1, -2, 0\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{9}{\\sqrt{2}}, 0, -\\frac{9}{\\pi }, -\\sqrt{2}, 4 \\sqrt{3}, 7}$.\n", - "Output Answer": [ - "${-\\frac{9}{\\pi }, -\\sqrt{2}, 0, \\frac{9}{\\sqrt{2}}, 4 \\sqrt{3}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/(math.sqrt(2))), 0, -(9/math.pi), -math.sqrt(2), 4*math.sqrt(3), 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.125,0.413,0.048\\}$ and $\\{0.405,0.089,0.359\\}$.", - "Output Answer": [ - "$1.04$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.125, 0.413, 0.048\ndistribution2 = 0.405, 0.089, 0.359\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x^2-1.1 x+5.3$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.3]\n", - "Output Answer": [ - "$10.03$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.3)\nprint(E(1.4*x**2-1.1*x+5.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-4, 10, 3, 3, -2, 3}$.\n", - "Output Answer": [ - "$\\frac{13}{6}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -4, 10, 3, 3, -2, 3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${1, \\frac{9}{\\sqrt{5}}, 5 \\sqrt{3}, 2 e, 8, 4, -1}$.\n", - "Output Answer": [ - "${-1, 1, 4, \\frac{9}{\\sqrt{5}}, 2 e, 8, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, (9/(math.sqrt(5))), 5*math.sqrt(3), 2*math.e, 8, 4, -1\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-8, \\frac{16}{3}, -2 \\sqrt{2}, \\frac{2}{5}, -\\frac{21}{\\pi }, -2 \\pi, -6 \\sqrt{2}} \\cup {-2 \\pi, \\frac{16}{3}, 8, -6 \\sqrt{2}, \\frac{6}{\\pi }}$.\n", - "Output Answer": [ - "${-6 \\sqrt{2}, -8, -\\frac{21}{\\pi }, -2 \\pi, -2 \\sqrt{2}, \\frac{2}{5}, \\frac{6}{\\pi }, \\frac{16}{3}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-8, (16/3), -2*math.sqrt(2), (2/5), -(21/math.pi), -2*math.pi, -6*math.sqrt(2),))\nsnd = set((-2*math.pi, (16/3), 8, -6*math.sqrt(2), (6/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, 256, -8, 625, 256}$.\n", - "Output Answer": [ - "$80 \\sqrt[5]{-1} 10^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, 256, -8, 625, 256\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.26,0.016,0.075,0.299,0.15\\}$ and $\\{0.042,0.048,0.274,0.001,0.252\\}$.", - "Output Answer": [ - "$2.22$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.26, 0.016, 0.075, 0.299, 0.15\ndistribution2 = 0.042, 0.048, 0.274, 0.001, 0.252\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{27}{\\pi }, -4, -3, 5, 8, 0} \\cup {-9, -6, 4, 5, -\\frac{29}{\\pi }, -5, -4}$.\n", - "Output Answer": [ - "${-\\frac{29}{\\pi }, -9, -\\frac{27}{\\pi }, -6, -5, -4, -3, 0, 4, 5, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(27/math.pi), -4, -3, 5, 8, 0,))\nsnd = set((-9, -6, 4, 5, -(29/math.pi), -5, -4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${6.19, 8, -\\frac{32}{5}, 6, 9, -4, 7} \\cup {-2, -\\frac{32}{5}, -9, -3, 6.19, 7, 6}$.\n", - "Output Answer": [ - "${-9, -\\frac{32}{5}, -4, -3, -2, 6, 6.19, 7, 8, 9}$" - ], - "Output Program": [ - "fst = set((6.19, 8, -(32/5), 6, 9, -4, 7,))\nsnd = set((-2, -(32/5), -9, -3, 6.19, 7, 6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{25}{2}, \\frac{7}{2}, 12, \\frac{19}{2}}$.\n", - "Output Answer": [ - "$\\frac{159600}{22117}$" - ], - "Output Program": [ - "import statistics\nvalues = (25/2), (7/2), 12, (19/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.047,0.176,0.023,0.016,0.066,0.045,0.09,0.091,0.209,0.217\\}$ and $\\{0.116,0.095,0.081,0.019,0.021,0.114,0.033,0.342,0.038,0.069\\}$.", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.047, 0.176, 0.023, 0.016, 0.066, 0.045, 0.09, 0.091, 0.209, 0.217\ndistribution2 = 0.116, 0.095, 0.081, 0.019, 0.021, 0.114, 0.033, 0.342, 0.038, 0.069\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${13, \\frac{25}{2}}$.\n", - "Output Answer": [ - "$\\frac{650}{51}$" - ], - "Output Program": [ - "import statistics\nvalues = 13, (25/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -13, 9, 0}$.\n", - "Output Answer": [ - "$\\frac{1075}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -13, 9, 0\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${2, 13, 3, 12}$.\n", - "Output Answer": [ - "$\\frac{624}{155}$" - ], - "Output Program": [ - "import statistics\nvalues = 2, 13, 3, 12\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, -3, -8, -7, 0, -9, 9, \\frac{5}{\\sqrt{2}}, 3 \\sqrt{3}, \\frac{23}{7}, \\frac{21}{\\pi }, 10, 3}$.\n", - "Output Answer": [ - "$19$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -3, -8, -7, 0, -9, 9, (5/(math.sqrt(2))), 3*math.sqrt(3), (23/7), (21/math.pi), 10, 3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.1,0.469,0.296,0.029,0.076\\}$ and $\\{0.175,0.268,0.131,0.109,0.1\\}$.", - "Output Answer": [ - "$0.19$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.1, 0.469, 0.296, 0.029, 0.076\ndistribution2 = 0.175, 0.268, 0.131, 0.109, 0.1\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${8, 17, 6, 1}$.\n", - "Output Answer": [ - "$\\frac{1632}{551}$" - ], - "Output Program": [ - "import statistics\nvalues = 8, 17, 6, 1\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-7, 5, 7}$.\n", - "Output Answer": [ - "${-7, 5, 7}$" - ], - "Output Program": [ - "values = -7, 5, 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${6, -\\frac{15}{\\sqrt{\\pi }}, \\frac{24}{5}, -\\frac{13}{\\sqrt{5}}, -3} \\setminus {-3, \\frac{9}{\\sqrt{\\pi }}, 6, \\frac{24}{5}}$.\n", - "Output Answer": [ - "${-\\frac{15}{\\sqrt{\\pi }}, -\\frac{13}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nfst = set((6, -(15/(math.sqrt(math.pi))), (24/5), -(13/(math.sqrt(5))), -3,))\nsnd = set((-3, (9/(math.sqrt(math.pi))), 6, (24/5),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-1, 4, 0, -\\frac{24}{e}, -10, -2 \\sqrt{5}, 5} \\setminus {-2 \\sqrt{5}, -10, 5, -\\frac{24}{e}, 4}$.\n", - "Output Answer": [ - "${-1, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 4, 0, -(24/math.e), -10, -2*math.sqrt(5), 5,))\nsnd = set((-2*math.sqrt(5), -10, 5, -(24/math.e), 4,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.6 x-0.1$ where $x \\sim $ \\text{NormalDistribution}[2.,2.1]\n", - "Output Answer": [ - "$9.1$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 2., 2.1)\nprint(E(4.6*x-0.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${17, 5, 14}$.\n", - "Output Answer": [ - "$\\frac{1190}{131}$" - ], - "Output Program": [ - "import statistics\nvalues = 17, 5, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{19}{e}, \\frac{27}{e}, \\frac{3}{e}, -\\frac{18}{e}, \\frac{1}{e}, \\frac{13}{e}}$.\n", - "Output Answer": [ - "$\\frac{7}{6 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(19/math.e), (27/math.e), (3/math.e), -(18/math.e), (1/math.e), (13/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${9, 36, 1000000, 2, 625, 6561}$.\n", - "Output Answer": [ - "$90 \\sqrt{2} 5^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 9, 36, 1000000, 2, 625, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{1}{2}, 10, -6, -4, -2 e}$.", - "Output Answer": [ - "$-4$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (1/2), 10, -6, -4, -2*math.e\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, -\\pi, 6, 0, \\frac{21}{\\pi }, 6.9, -\\frac{4}{\\sqrt{5}}, 3 e}$.\n", - "Output Answer": [ - "${-\\pi, -\\frac{4}{\\sqrt{5}}, 0, 6, 6, \\frac{21}{\\pi }, 6.9, 3 e}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, -math.pi, 6, 0, (21/math.pi), 6.9, -(4/(math.sqrt(5))), 3*math.e\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${7, -\\frac{44}{5}}$.\n", - "Output Answer": [ - "${-\\frac{44}{5}, 7}$" - ], - "Output Program": [ - "values = 7, -(44/5)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3 \\pi, 1, 2, -6, -2, -5, 1, 2, -1, -9, 1, 0}$.", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3*math.pi, 1, 2, -6, -2, -5, 1, 2, -1, -9, 1, 0\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-2, 10, 1, -2, 2, 2, 10, -2, 10, 2, 1, 2, -2, -8, 10, 2, -2, -8, 10, 10, -8, 1, 1, 2, -8, -7, -2}$.\n", - "Output Answer": [ - "$\\{-2,10,2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -2, 10, 1, -2, 2, 2, 10, -2, 10, 2, 1, 2, -2, -8, 10, 2, -2, -8, 10, 10, -8, 1, 1, 2, -8, -7, -2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{3}{2}, -\\frac{17}{\\sqrt{5}}, -2, 3, -\\frac{39}{5}, -\\frac{23}{3}, -5, 2 \\sqrt{5}, -\\frac{4}{e}}$.\n", - "Output Answer": [ - "$\\frac{39}{5}+2 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -(3/2), -(17/(math.sqrt(5))), -2, 3, -(39/5), -(23/3), -5, 2*math.sqrt(5), -(4/math.e)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{19}{5}, -3, -3, -3, \\frac{4}{5}, \\frac{7}{5}, -3, \\frac{28}{5}, \\frac{4}{5}, -\\frac{19}{5}, -\\frac{19}{5}, -1, \\frac{28}{5}, -1, \\frac{4}{5}, -\\frac{19}{5}, -\\frac{19}{5}, \\frac{4}{5}, -\\frac{19}{5}, \\frac{28}{5}, -3, -3, \\frac{37}{5}, \\frac{37}{5}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{19}{5},-3\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(19/5), -3, -3, -3, (4/5), (7/5), -3, (28/5), (4/5), -(19/5), -(19/5), -1, (28/5), -1, (4/5), -(19/5), -(19/5), (4/5), -(19/5), (28/5), -3, -3, (37/5), (37/5)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${5, 10, 2 \\sqrt{2}, 2 \\sqrt{5}, \\frac{7}{\\pi }, 2, 5, -4, -6, 3, 6}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 5, 10, 2*math.sqrt(2), 2*math.sqrt(5), (7/math.pi), 2, 5, -4, -6, 3, 6\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${100, -32, 16, -59049, -216, 6561}$.\n", - "Output Answer": [ - "$108 \\sqrt[6]{-1} \\sqrt{3} \\sqrt[3]{10}$" - ], - "Output Program": [ - "import math\n\nvalues = 100, -32, 16, -59049, -216, 6561\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2.7 x^2-0.7 x-4.3$ where $x \\sim $ \\text{NormalDistribution}[-0.3,1.9]\n", - "Output Answer": [ - "$-14.08$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.3, 1.9)\nprint(E(-2.7*x**2-0.7*x-4.3))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{5}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, -\\frac{10}{\\sqrt{3}}, \\frac{17}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (5/(math.sqrt(3))), -(10/(math.sqrt(3))), -(10/(math.sqrt(3))), (17/(math.sqrt(3))), (10/(math.sqrt(3))), -4*math.sqrt(3)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-1, 10, -1, -5}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{499}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -1, 10, -1, -5\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-12, -4, -6}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{13}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -12, -4, -6\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{9}{e}, -1}$.\n", - "Output Answer": [ - "${-1, \\frac{9}{e}}$" - ], - "Output Program": [ - "import math\n\nvalues = (9/math.e), -1\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4. x^3+0.9 x^2+4.1 x-2.5$ where $x \\sim $ \\text{NormalDistribution}[1.9,0.8]\n", - "Output Answer": [ - "$51.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.9, 0.8)\nprint(E(4.*x**3+0.9*x**2+4.1*x-2.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, 4, 2, \\frac{5}{2}}$.\n", - "Output Answer": [ - "${2, \\frac{5}{2}, 4, 5}$" - ], - "Output Program": [ - "values = 5, 4, 2, (5/2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{11}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{16}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{2}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{11}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (11/(math.sqrt(3))), (10/(math.sqrt(3))), (16/(math.sqrt(3))), (11/(math.sqrt(3))), (16/(math.sqrt(3))), (11/(math.sqrt(3))), (2/(math.sqrt(3))), (10/(math.sqrt(3))), (2/(math.sqrt(3))), (11/(math.sqrt(3))), (16/(math.sqrt(3))), (11/(math.sqrt(3))), (11/(math.sqrt(3))), (11/(math.sqrt(3))), (16/(math.sqrt(3))), (16/(math.sqrt(3))), (11/(math.sqrt(3))), (16/(math.sqrt(3))), (10/(math.sqrt(3))), (2/(math.sqrt(3))), (10/(math.sqrt(3))), (10/(math.sqrt(3))), (11/(math.sqrt(3))), (2/(math.sqrt(3))), (10/(math.sqrt(3))), (10/(math.sqrt(3))), (2/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{23}{4}, 9, -2 e, 9, 4}$.\n", - "Output Answer": [ - "${-2 e, 4, \\frac{23}{4}, 9, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = (23/4), 9, -2*math.e, 9, 4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, \\frac{1}{5}, \\frac{24}{5}, \\frac{16}{5}, -\\frac{28}{5}, -\\frac{23}{5}, \\frac{22}{5}}$.\n", - "Output Answer": [ - "$\\frac{47}{35}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, (1/5), (24/5), (16/5), -(28/5), -(23/5), (22/5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $2.2 x+0.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,0.6]\n", - "Output Answer": [ - "$0.6$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 0.6)\nprint(E(2.2*x+0.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3, 14 \\log (2), -14 \\log (2), -3 \\sqrt{2}, 9, -13 \\log (2)} \\cup {-4, -3 \\sqrt{2}, 13 \\log (2), -13 \\log (2), 4, 14 \\log (2)}$.\n", - "Output Answer": [ - "${-14 \\log (2), -13 \\log (2), -3 \\sqrt{2}, -4, -3, 4, 9, 13 \\log (2), 14 \\log (2)}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3, 14*math.log(2), -14*math.log(2), -3*math.sqrt(2), 9, -13*math.log(2),))\nsnd = set((-4, -3*math.sqrt(2), 13*math.log(2), -13*math.log(2), 4, 14*math.log(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.9 x^2-3.1 x+3.5$ where $x \\sim $ \\text{NormalDistribution}[-0.6,2.6]\n", - "Output Answer": [ - "$-22.41$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -0.6, 2.6)\nprint(E(-3.9*x**2-3.1*x+3.5))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-2, 2 \\sqrt{3}, 5, -8} \\setminus {1, 10, -2, -4 \\sqrt{3}, 8}$.\n", - "Output Answer": [ - "${-8, 2 \\sqrt{3}, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, 2*math.sqrt(3), 5, -8,))\nsnd = set((1, 10, -2, -4*math.sqrt(3), 8,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-6 \\sqrt{2}, -5, -4 \\sqrt{5}, -3, 2 \\pi, -\\frac{10}{\\pi }, \\frac{4}{7}}$.\n", - "Output Answer": [ - "${-4 \\sqrt{5}, -6 \\sqrt{2}, -5, -\\frac{10}{\\pi }, -3, \\frac{4}{7}, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nvalues = -6*math.sqrt(2), -5, -4*math.sqrt(5), -3, 2*math.pi, -(10/math.pi), (4/7)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.203,0.099,0.376,0.076\\}$ and $\\{0.065,0.24,0.092,0.458\\}$.", - "Output Answer": [ - "$0.84$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.203, 0.099, 0.376, 0.076\ndistribution2 = 0.065, 0.24, 0.092, 0.458\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${14, 8, -9}$.\n", - "Output Answer": [ - "$\\frac{427}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 14, 8, -9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.152,0.107,0.232,0.168,0.038,0.139,0.047\\}$ and $\\{0.128,0.164,0.147,0.252,0.09,0.081,0.018\\}$.", - "Output Answer": [ - "$0.12$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.152, 0.107, 0.232, 0.168, 0.038, 0.139, 0.047\ndistribution2 = 0.128, 0.164, 0.147, 0.252, 0.09, 0.081, 0.018\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{58}{3}, \\frac{58}{3}, \\frac{13}{3}, \\frac{50}{3}}$.\n", - "Output Answer": [ - "$\\frac{75400}{7431}$" - ], - "Output Program": [ - "import statistics\nvalues = (58/3), (58/3), (13/3), (50/3)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, 4, -5.2, 3, 0}$.\n", - "Output Answer": [ - "${-5.2, 0, 3, 4, 5}$" - ], - "Output Program": [ - "values = 5, 4, -5.2, 3, 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${9, -2 e, -\\frac{3}{e}, -\\frac{9}{4}, \\frac{3}{\\sqrt{\\pi }}, 8, \\frac{25}{\\pi }, -1, -\\frac{3}{2}}$.", - "Output Answer": [ - "$-1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -2*math.e, -(3/math.e), -(9/4), (3/(math.sqrt(math.pi))), 8, (25/math.pi), -1, -(3/2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${3, -2, 3, 3, 3, 8, 8, -2, 8, 8, 8, 8, 8, 8, 8, 8, 3, 8, -2, 3, -2, -2, 8, 3, 8, 8, 3, -2}$.\n", - "Output Answer": [ - "$\\{8\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 3, -2, 3, 3, 3, 8, 8, -2, 8, 8, 8, 8, 8, 8, 8, 8, 3, 8, -2, 3, -2, -2, 8, 3, 8, 8, 3, -2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{1}{2}, \\frac{5}{\\sqrt{2}}, -2}$.", - "Output Answer": [ - "$-\\frac{1}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(1/2), (5/(math.sqrt(2))), -2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${5, -6, 8, \\frac{14}{e}, 3, \\frac{19}{\\sqrt{5}}, -9}$.\n", - "Output Answer": [ - "${-9, -6, 3, 5, \\frac{14}{e}, 8, \\frac{19}{\\sqrt{5}}}$" - ], - "Output Program": [ - "import math\n\nvalues = 5, -6, 8, (14/math.e), 3, (19/(math.sqrt(5))), -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-5, -5, 0, 9, -6, -3, -3}$.\n", - "Output Answer": [ - "$-\\frac{13}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -5, -5, 0, 9, -6, -3, -3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-1, -1, 1, 4, 5}$.\n", - "Output Answer": [ - "$2^{2/5} \\sqrt[5]{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -1, -1, 1, 4, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 64, 1, 64, 8, 1}$.\n", - "Output Answer": [ - "$4 \\sqrt{2} \\sqrt[3]{7}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 64, 1, 64, 8, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.1,0.037,0.281,0.139,0.055,0.032,0.11,0.019,0.142\\}$ and $\\{0.152,0.201,0.201,0.046,0.016,0.107,0.025,0.127,0.089\\}$.", - "Output Answer": [ - "$0.45$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.1, 0.037, 0.281, 0.139, 0.055, 0.032, 0.11, 0.019, 0.142\ndistribution2 = 0.152, 0.201, 0.201, 0.046, 0.016, 0.107, 0.025, 0.127, 0.089\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${\\frac{32}{7}, 2 \\sqrt{3}, 7, 0} \\setminus {-3 \\log (2), -12 \\log (2), \\frac{32}{7}, 7, -7, -3 \\sqrt{2}, 8, -\\frac{14}{\\sqrt{3}}, \\frac{26}{\\pi }, 0}$.\n", - "Output Answer": [ - "${2 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((32/7), 2*math.sqrt(3), 7, 0,))\nsnd = set((-3*math.log(2), -12*math.log(2), (32/7), 7, -7, -3*math.sqrt(2), 8, -(14/(math.sqrt(3))), (26/math.pi), 0,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{19}{2}, 8, 3 e, \\frac{21}{\\pi }, 0, -3 e, 2 \\pi} \\cup {0, 2 \\pi, \\frac{19}{2}, \\frac{21}{\\pi }, 8}$.\n", - "Output Answer": [ - "${-\\frac{19}{2}, -3 e, 0, 2 \\pi, \\frac{21}{\\pi }, 8, 3 e, \\frac{19}{2}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(19/2), 8, 3*math.e, (21/math.pi), 0, -3*math.e, 2*math.pi,))\nsnd = set((0, 2*math.pi, (19/2), (21/math.pi), 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-6, -6, -6, -1, -9, 9, -10, -6, -6, -6, 9, -1, 3, 9, -10, 3, -9, -9, 3, -6, -10, 9, -1, -9, -6, 9, -9, -9, -10, -1}$.\n", - "Output Answer": [ - "$\\{-6\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -6, -6, -6, -1, -9, 9, -10, -6, -6, -6, 9, -1, 3, 9, -10, 3, -9, -9, 3, -6, -10, 9, -1, -9, -6, 9, -9, -9, -10, -1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-9, -8, 6561, -3}$.\n", - "Output Answer": [ - "$9 \\sqrt[4]{-1} 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -9, -8, 6561, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, 10, \\frac{52}{7}, -5 \\sqrt{2}, -\\frac{29}{5}}$.", - "Output Answer": [ - "$3$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 10, (52/7), -5*math.sqrt(2), -(29/5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${15, 17, 14, 14}$.\n", - "Output Answer": [ - "$\\frac{7140}{479}$" - ], - "Output Program": [ - "import statistics\nvalues = 15, 17, 14, 14\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${4, -3, -3, -10}$.\n", - "Output Answer": [ - "$\\frac{98}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 4, -3, -3, -10\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{5}{\\sqrt{\\pi }}, -\\frac{4}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$-\\frac{9}{2 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(5/(math.sqrt(math.pi))), -(4/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-7 \\log (2), -7 \\log (2), 9 \\log (2), 14 \\log (2), -10 \\log (2), -10 \\log (2), -10 \\log (2), 14 \\log (2), 14 \\log (2), -10 \\log (2), -2 \\log (2), -7 \\log (2), -2 \\log (2), 14 \\log (2), -7 \\log (2), 14 \\log (2), -2 \\log (2), 9 \\log (2), -2 \\log (2), -7 \\log (2), -2 \\log (2), -7 \\log (2), 9 \\log (2), 9 \\log (2), -7 \\log (2), 14 \\log (2), 9 \\log (2), 9 \\log (2), -2 \\log (2)}$.\n", - "Output Answer": [ - "$\\{-7 \\log (2)\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -7*math.log(2), -7*math.log(2), 9*math.log(2), 14*math.log(2), -10*math.log(2), -10*math.log(2), -10*math.log(2), 14*math.log(2), 14*math.log(2), -10*math.log(2), -2*math.log(2), -7*math.log(2), -2*math.log(2), 14*math.log(2), -7*math.log(2), 14*math.log(2), -2*math.log(2), 9*math.log(2), -2*math.log(2), -7*math.log(2), -2*math.log(2), -7*math.log(2), 9*math.log(2), 9*math.log(2), -7*math.log(2), 14*math.log(2), 9*math.log(2), 9*math.log(2), -2*math.log(2)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-3, 7, 3, -3, -3, -3, 3, -6, -3, 8, -3, 7, 8, 7, -6, 7, -8, -3, 3, 3, 3, -3, -3, -3, -8, 8, 7}$.\n", - "Output Answer": [ - "$\\{-3\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -3, 7, 3, -3, -3, -3, 3, -6, -3, 8, -3, 7, 8, 7, -6, 7, -8, -3, 3, 3, 3, -3, -3, -3, -8, 8, 7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 16, 1296, 1}$.\n", - "Output Answer": [ - "$12\\ 2^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 16, 1296, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $0.06 < 2.7 x+2.4 < 2.08$ where $x \\sim $ \\text{NormalDistribution}[1.5,0.8].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.5, 0.8)\nprint(P((0.06 < 2.7*x+2.4) & (2.7*x+2.4 < 2.08)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 216, -512}$.\n", - "Output Answer": [ - "$96 \\sqrt[3]{-2}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 216, -512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${7, 7, 7, 4}$.\n", - "Output Answer": [ - "$\\frac{25}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 7, 7, 7, 4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-9 \\log (2), -\\frac{2}{e}, -4 \\sqrt{3}, -4 \\log (2), -2, 2, 4} \\cup {-10 \\log (2), -\\frac{2}{e}, -6 \\log (2), 2, -2, 6}$.\n", - "Output Answer": [ - "${-10 \\log (2), -4 \\sqrt{3}, -9 \\log (2), -6 \\log (2), -4 \\log (2), -2, -\\frac{2}{e}, 2, 4, 6}$" - ], - "Output Program": [ - "import math\n\nfst = set((-9*math.log(2), -(2/math.e), -4*math.sqrt(3), -4*math.log(2), -2, 2, 4,))\nsnd = set((-10*math.log(2), -(2/math.e), -6*math.log(2), 2, -2, 6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${1, 5, -10, -5, 8, 4, 3, 10} \\cap {8, 3, 7, 4, -10, 1, -9, 6}$.\n", - "Output Answer": [ - "${-10, 1, 3, 4, 8}$" - ], - "Output Program": [ - "fst = set((1, 5, -10, -5, 8, 4, 3, 10,))\nsnd = set((8, 3, 7, 4, -10, 1, -9, 6,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{2}{7}, -\\frac{31}{7}}$.\n", - "Output Answer": [ - "$-\\frac{29}{14}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (2/7), -(31/7)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${7, -1.431, 3, -\\frac{16}{e}, -\\frac{2}{7}} \\setminus {1, \\frac{14}{e}, -\\frac{2}{7}, 0, -1.431, 3, 7}$.\n", - "Output Answer": [ - "${-\\frac{16}{e}}$" - ], - "Output Program": [ - "import math\n\nfst = set((7, -1.431, 3, -(16/math.e), -(2/7),))\nsnd = set((1, (14/math.e), -(2/7), 0, -1.431, 3, 7,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, 3, -\\frac{11}{\\pi }, -\\sqrt{2}, 7, -5, 1, -9, -6, -2, 8, -\\frac{24}{\\pi }, \\frac{10}{3}, -7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(-2-\\sqrt{2}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, 3, -(11/math.pi), -math.sqrt(2), 7, -5, 1, -9, -6, -2, 8, -(24/math.pi), (10/3), -7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $1.1 < 4.9 x^2+1. x-0.2 < 3.28$ where $x \\sim $ \\text{ExponentialDistribution}[1.].", - "Output Answer": [ - "$0.18$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.)\nprint(P((1.1 < 4.9*x**2+1.*x-0.2) & (4.9*x**2+1.*x-0.2 < 3.28)))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-2 \\pi, 0, \\pi, 2 \\pi, -\\pi} \\cap {\\pi, -\\pi, 3 \\pi, 2 \\pi, -2 \\pi}$.\n", - "Output Answer": [ - "${-2 \\pi, -\\pi, \\pi, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2*math.pi, 0, math.pi, 2*math.pi, -math.pi,))\nsnd = set((math.pi, -math.pi, 3*math.pi, 2*math.pi, -2*math.pi,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-10, -9, -2 \\pi, 1, -1, -7, -\\frac{17}{e}}$.", - "Output Answer": [ - "$-2 \\pi$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -10, -9, -2*math.pi, 1, -1, -7, -(17/math.e)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-1.7 x-3.8$ where $x \\sim $ \\text{PoissonDistribution}[0.6]\n", - "Output Answer": [ - "$-4.82$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 0.6)\nprint(E(-1.7*x-3.8))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-1, 2 \\pi, 2, \\frac{2}{e}, -\\frac{45}{7}} \\cup {\\frac{2}{7}, \\pi, -1, \\frac{2}{e}}$.\n", - "Output Answer": [ - "${-\\frac{45}{7}, -1, \\frac{2}{7}, \\frac{2}{e}, 2, \\pi, 2 \\pi}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, 2*math.pi, 2, (2/math.e), -(45/7),))\nsnd = set(((2/7), math.pi, -1, (2/math.e),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${8, 16, 8, 625, 1296}$.\n", - "Output Answer": [ - "$4\\ 30^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 16, 8, 625, 1296\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5, 10, 10, 5}$.\n", - "Output Answer": [ - "$\\frac{15}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 5, 10, 10, 5\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{2}{\\sqrt{5}}, \\frac{7}{\\sqrt{5}}, 4 \\sqrt{5}, -\\frac{7}{\\sqrt{5}}, \\frac{4}{\\sqrt{5}}, -\\frac{11}{\\sqrt{5}}, 0}$.\n", - "Output Answer": [ - "$\\frac{3 \\sqrt{5}}{7}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (2/(math.sqrt(5))), (7/(math.sqrt(5))), 4*math.sqrt(5), -(7/(math.sqrt(5))), (4/(math.sqrt(5))), -(11/(math.sqrt(5))), 0\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x^2+1.8 x+4.6$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.1]\n", - "Output Answer": [ - "$-5.32$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.1)\nprint(E(-4.1*x**2+1.8*x+4.6))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${1, \\frac{16}{\\sqrt{\\pi }}, -\\frac{18}{e}, \\frac{31}{4}, \\frac{3}{\\sqrt{\\pi }}, \\sqrt{3}, 10, 6, -6} \\setminus {0, 6, -\\frac{7}{4}, -\\frac{18}{e}}$.\n", - "Output Answer": [ - "${-6, 1, \\frac{3}{\\sqrt{\\pi }}, \\sqrt{3}, \\frac{31}{4}, \\frac{16}{\\sqrt{\\pi }}, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((1, (16/(math.sqrt(math.pi))), -(18/math.e), (31/4), (3/(math.sqrt(math.pi))), math.sqrt(3), 10, 6, -6,))\nsnd = set((0, 6, -(7/4), -(18/math.e),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${7, \\frac{10}{\\sqrt{3}}, -\\frac{1}{\\pi }, -\\frac{18}{e}, -3 \\pi, \\frac{19}{5}, 1, -\\frac{8}{\\sqrt{\\pi }}, -2 \\sqrt{2}}$.", - "Output Answer": [ - "$-\\frac{1}{\\pi }$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 7, (10/(math.sqrt(3))), -(1/math.pi), -(18/math.e), -3*math.pi, (19/5), 1, -(8/(math.sqrt(math.pi))), -2*math.sqrt(2)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, -10, -9, 6, -10, -10, 9, -6, 6, 6, 6, -9, -9, 4, -10, -10, 4, 4, -6, -6, 9, -10, -6, 6, -10, 9, 6, 9, -10}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, -10, -9, 6, -10, -10, 9, -6, 6, 6, 6, -9, -9, 4, -10, -10, 4, 4, -6, -6, 9, -10, -6, 6, -10, 9, 6, 9, -10\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${4, \\frac{5}{4}, 5 \\sqrt{3}, -\\frac{13}{\\sqrt{3}}, -\\sqrt{5}, 0, -7, -9, \\frac{25}{3}, -9, 9}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 4, (5/4), 5*math.sqrt(3), -(13/(math.sqrt(3))), -math.sqrt(5), 0, -7, -9, (25/3), -9, 9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3. x+2.2$ where $x \\sim $ \\text{ExponentialDistribution}[1.1]\n", - "Output Answer": [ - "$4.93$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.1)\nprint(E(3.*x+2.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-4, 3, -6, 8.5}$.\n", - "Output Answer": [ - "${-6, -4, 3, 8.5}$" - ], - "Output Program": [ - "values = -4, 3, -6, 8.5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${3, 4.4, 0, 4, -9, -8, -4, 6, -2} \\cup {3, -8, 4.4, -9, 5, -2, 6, -6}$.\n", - "Output Answer": [ - "${-9, -8, -6, -4, -2, 0, 3, 4, 4.4, 5, 6}$" - ], - "Output Program": [ - "fst = set((3, 4.4, 0, 4, -9, -8, -4, 6, -2,))\nsnd = set((3, -8, 4.4, -9, 5, -2, 6, -6,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 e, -6, 0, 2, 7}$.", - "Output Answer": [ - "$2$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.e, -6, 0, 2, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${8, \\frac{16}{3}, 2 \\sqrt{5}, -\\frac{45}{7}, 10, -7.059} \\cup {-\\frac{45}{7}, -3.579, 2 \\sqrt{5}, \\frac{16}{3}, 7, -\\frac{13}{2}, 8}$.\n", - "Output Answer": [ - "${-7.059, -\\frac{13}{2}, -\\frac{45}{7}, -3.579, 2 \\sqrt{5}, \\frac{16}{3}, 7, 8, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((8, (16/3), 2*math.sqrt(5), -(45/7), 10, -7.059,))\nsnd = set((-(45/7), -3.579, 2*math.sqrt(5), (16/3), 7, -(13/2), 8,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${7, 1, 10, 15, 3}$.\n", - "Output Answer": [ - "$\\frac{156}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 7, 1, 10, 15, 3\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${10, -12, -4, -14}$.\n", - "Output Answer": [ - "$2 \\sqrt{\\frac{89}{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 10, -12, -4, -14\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{11}{\\sqrt{3}}, -3, -4, -7}$.\n", - "Output Answer": [ - "${-7, -4, -3, \\frac{11}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (11/(math.sqrt(3))), -3, -4, -7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 6, -125}$.\n", - "Output Answer": [ - "$5 \\sqrt[3]{-6} 7^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 6, -125\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${3, -\\frac{13}{\\sqrt{2}}, -4 \\log (2), -2.9, \\frac{3}{2}} \\setminus {-4 \\sqrt{2}, 2, -2.9, 4, \\frac{3}{2}, -13 \\log (2), -\\frac{2}{3}}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -4 \\log (2), 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((3, -(13/(math.sqrt(2))), -4*math.log(2), -2.9, (3/2),))\nsnd = set((-4*math.sqrt(2), 2, -2.9, 4, (3/2), -13*math.log(2), -(2/3),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${7, \\frac{14}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{14}{\\sqrt{3}}-7$" - ], - "Output Program": [ - "import math\n\nvalues = 7, (14/(math.sqrt(3)))\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{7}{4}, 7, -\\frac{5}{\\sqrt{2}}, 3 \\log (2), 9}$.\n", - "Output Answer": [ - "${-\\frac{5}{\\sqrt{2}}, \\frac{7}{4}, 3 \\log (2), 7, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = (7/4), 7, -(5/(math.sqrt(2))), 3*math.log(2), 9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-2. x^2-0.4 x+3.$ where $x \\sim $ \\text{BetaDistribution}[1.,1.5]\n", - "Output Answer": [ - "$2.38$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 1.5)\nprint(E(-2.*x**2-0.4*x+3.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-7, 1, 4, 6, -5}$.\n", - "Output Answer": [ - "${-7, -5, 1, 4, 6}$" - ], - "Output Program": [ - "values = -7, 1, 4, 6, -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{1}{\\sqrt{3}}, \\sqrt{2}, 3 e, -2}$.\n", - "Output Answer": [ - "$2+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -(1/(math.sqrt(3))), math.sqrt(2), 3*math.e, -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.012,0.203,0.01,0.158,0.001,0.609\\}$ and $\\{0.19,0.146,0.097,0.198,0.115,0.114\\}$.", - "Output Answer": [ - "$0.85$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.012, 0.203, 0.01, 0.158, 0.001, 0.609\ndistribution2 = 0.19, 0.146, 0.097, 0.198, 0.115, 0.114\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-1.04, 0, -5.5, -1, -\\frac{22}{3}} \\cup {-5.5, -1, -0.92, -\\frac{22}{3}, 0, \\frac{3}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{22}{3}, -5.5, -1.04, -1, -0.92, 0, \\frac{3}{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1.04, 0, -5.5, -1, -(22/3),))\nsnd = set((-5.5, -1, -0.92, -(22/3), 0, (3/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 14 \\log (2), 4, -10, -4, \\frac{1}{\\sqrt{3}}, -3, -4 \\sqrt{3}}$.\n", - "Output Answer": [ - "$10+14 \\log (2)$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 14*math.log(2), 4, -10, -4, (1/(math.sqrt(3))), -3, -4*math.sqrt(3)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${4, -8, -216}$.\n", - "Output Answer": [ - "$12\\ 2^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -8, -216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-3.3 x^2-1.9 x+1.7$ where $x \\sim $ \\text{NormalDistribution}[-1.1,2.6]\n", - "Output Answer": [ - "$-22.51$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', -1.1, 2.6)\nprint(E(-3.3*x**2-1.9*x+1.7))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{12}{\\pi }, -\\frac{1}{\\pi }, \\frac{25}{\\pi }, \\frac{5}{\\pi }, -\\frac{26}{\\pi }, \\frac{26}{\\pi }, -\\frac{1}{\\pi }}$.\n", - "Output Answer": [ - "$\\frac{16}{7 \\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(12/math.pi), -(1/math.pi), (25/math.pi), (5/math.pi), -(26/math.pi), (26/math.pi), -(1/math.pi)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${0, -4, 1, -5}$.", - "Output Answer": [ - "$-2$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -4, 1, -5\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-16807, 25, 1296, 49, 343}$.\n", - "Output Answer": [ - "$49 \\sqrt[5]{-1} 5^{2/5} 6^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -16807, 25, 1296, 49, 343\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{19}{7}, -\\frac{38}{5}, -6, e, -6, 0, 6 \\sqrt{3}, 3 \\sqrt{3}, 4 \\sqrt{5}, 12 \\log (2), \\frac{20}{e}, 0, 3 e, -3 e, -4}$.\n", - "Output Answer": [ - "$6 \\sqrt{3}+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = -(19/7), -(38/5), -6, math.e, -6, 0, 6*math.sqrt(3), 3*math.sqrt(3), 4*math.sqrt(5), 12*math.log(2), (20/math.e), 0, 3*math.e, -3*math.e, -4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -\\frac{19}{2}, \\frac{7}{2}}$.\n", - "Output Answer": [ - "$-\\frac{13}{3}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -(19/2), (7/2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2 e, -e, 3 e, 2 e, -3 e, -e, 2 e, -3 e, 3 e, 3 e, 3 e, 3 e, -3 e, -3 e, 3 e, 3 e, 3 e, 2 e, 2 e, -e, 2 e, -3 e, 3 e, -3 e, 2 e, 3 e, 3 e}$.\n", - "Output Answer": [ - "$\\{3 e\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = 2*math.e, -math.e, 3*math.e, 2*math.e, -3*math.e, -math.e, 2*math.e, -3*math.e, 3*math.e, 3*math.e, 3*math.e, 3*math.e, -3*math.e, -3*math.e, 3*math.e, 3*math.e, 3*math.e, 2*math.e, 2*math.e, -math.e, 2*math.e, -3*math.e, 3*math.e, -3*math.e, 2*math.e, 3*math.e, 3*math.e\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.5 x-1.$ where $x \\sim $ \\text{LaplaceDistribution}[0,1.2]\n", - "Output Answer": [ - "$-1.$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Laplace('x', 0, 1.2)\nprint(E(-4.5*x-1.))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{1}{\\sqrt{2}}, -2, -10, -4 \\sqrt{3}, -2, -7.}$.\n", - "Output Answer": [ - "${-10, -7., -4 \\sqrt{3}, -2, -2, \\frac{1}{\\sqrt{2}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (1/(math.sqrt(2))), -2, -10, -4*math.sqrt(3), -2, -7.\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, -5, -6 \\sqrt{3}, -5 \\sqrt{2}, -1} \\cup {-5 \\sqrt{2}, -5, 2 e, -5 \\sqrt{3}}$.\n", - "Output Answer": [ - "${-6 \\sqrt{3}, -5 \\sqrt{3}, -5 \\sqrt{2}, -5, -1, 0, 2 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, -5, -6*math.sqrt(3), -5*math.sqrt(2), -1,))\nsnd = set((-5*math.sqrt(2), -5, 2*math.e, -5*math.sqrt(3),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3, 4, -\\frac{3}{e}, 0}$.\n", - "Output Answer": [ - "$7$" - ], - "Output Program": [ - "import math\n\nvalues = -3, 4, -(3/math.e), 0\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-6, 3, 3 \\pi, 2, 3 \\pi, 2, -2 \\pi, 2 \\pi, \\frac{43}{5}}$.\n", - "Output Answer": [ - "$5 \\pi$" - ], - "Output Program": [ - "import math\n\nvalues = -6, 3, 3*math.pi, 2, 3*math.pi, 2, -2*math.pi, 2*math.pi, (43/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{24}{\\pi }, \\frac{8}{\\pi }}$.\n", - "Output Answer": [ - "$-\\frac{8}{\\pi }$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(24/math.pi), (8/math.pi)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-\\frac{18}{\\pi }, \\sqrt{5}, 5, -7.4, 0, 6, 1} \\cup {7, \\sqrt{5}, 1, -5 \\sqrt{2}, -4, 8.1, -\\frac{18}{\\pi }, -2}$.\n", - "Output Answer": [ - "${-7.4, -5 \\sqrt{2}, -\\frac{18}{\\pi }, -4, -2, 0, 1, \\sqrt{5}, 5, 6, 7, 8.1}$" - ], - "Output Program": [ - "import math\n\nfst = set((-(18/math.pi), math.sqrt(5), 5, -7.4, 0, 6, 1,))\nsnd = set((7, math.sqrt(5), 1, -5*math.sqrt(2), -4, 8.1, -(18/math.pi), -2,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7, -1, -6, -2 \\sqrt{3}, 10, 9, 7, 9, -5, -8, -\\frac{2}{5}}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -7, -1, -6, -2*math.sqrt(3), 10, 9, 7, 9, -5, -8, -(2/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{7}{\\sqrt{\\pi }}, -\\frac{1}{\\sqrt{3}}, \\frac{5}{\\sqrt{\\pi }}, \\frac{1}{\\pi }, \\frac{17}{e}, -3 \\sqrt{5}, -9, 9, -3}$.\n", - "Output Answer": [ - "$18$" - ], - "Output Program": [ - "import math\n\nvalues = -(7/(math.sqrt(math.pi))), -(1/(math.sqrt(3))), (5/(math.sqrt(math.pi))), (1/math.pi), (17/math.e), -3*math.sqrt(5), -9, 9, -3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $1.28 < 3.3 x-3.2 < 4.31$ where $x \\sim $ \\text{PoissonDistribution}[1.3].", - "Output Answer": [ - "$0.23$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 1.3)\nprint(P((1.28 < 3.3*x-3.2) & (3.3*x-3.2 < 4.31)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, -10, 1, -10, 2, 1, 1, 2, 1, 2, 6, 6, 1, 1, 2, -10, 2, -10, -10, -10, 2}$.\n", - "Output Answer": [ - "$\\{-10\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, -10, 1, -10, 2, 1, 1, 2, 1, 2, 6, 6, 1, 1, 2, -10, 2, -10, -10, -10, 2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -2, -6, 3, 2 \\sqrt{5}, -3, -7, -\\frac{44}{5}} \\cup {-6, -2, -4, -\\frac{44}{5}, -3 \\sqrt{5}, 3, -3}$.\n", - "Output Answer": [ - "${-\\frac{44}{5}, -7, -3 \\sqrt{5}, -6, -4, -3, -2, 3, 4, 2 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((4, -2, -6, 3, 2*math.sqrt(5), -3, -7, -(44/5),))\nsnd = set((-6, -2, -4, -(44/5), -3*math.sqrt(5), 3, -3,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $4.7 x-3.1$ where $x \\sim $ \\text{PoissonDistribution}[3.8]\n", - "Output Answer": [ - "$14.76$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.8)\nprint(E(4.7*x-3.1))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.044,0.105,0.036,0.194,0.097,0.039,0.029,0.117,0.049,0.171\\}$ and $\\{0.067,0.075,0.114,0.037,0.106,0.057,0.08,0.057,0.124,0.135\\}$.", - "Output Answer": [ - "$0.33$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.044, 0.105, 0.036, 0.194, 0.097, 0.039, 0.029, 0.117, 0.049, 0.171\ndistribution2 = 0.067, 0.075, 0.114, 0.037, 0.106, 0.057, 0.08, 0.057, 0.124, 0.135\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, -2, -9, -8, 5}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{85}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -2, -9, -8, 5\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-\\frac{4}{3}, -\\sqrt{5}, 3 \\pi, -\\frac{26}{3}, 4 \\sqrt{5}}$.", - "Output Answer": [ - "$-\\frac{4}{3}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -(4/3), -math.sqrt(5), 3*math.pi, -(26/3), 4*math.sqrt(5)\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.5 x^2-4. x-3.4$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$-2.96$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(3.5*x**2-4.*x-3.4))\n" - ], - "split": "test" - }, - { - "Input": "Find the intersection of the following sets, namely ${-3 \\pi, -2 \\pi, -\\pi, \\pi, 0, 2 \\pi} \\cap {3 \\pi, -\\pi, 0, -2 \\pi, -3 \\pi}$.\n", - "Output Answer": [ - "${-3 \\pi, -2 \\pi, -\\pi, 0}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3*math.pi, -2*math.pi, -math.pi, math.pi, 0, 2*math.pi,))\nsnd = set((3*math.pi, -math.pi, 0, -2*math.pi, -3*math.pi,))\nprint(fst.intersection(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{13}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, -\\frac{4}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{13}{\\sqrt{3}}, \\frac{10}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{4}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(13/(math.sqrt(3))), (10/(math.sqrt(3))), -(4/(math.sqrt(3))), (4/(math.sqrt(3))), -(4/(math.sqrt(3))), (4/(math.sqrt(3))), (10/(math.sqrt(3))), -(4/(math.sqrt(3))), (10/(math.sqrt(3))), (4/(math.sqrt(3))), -(4/(math.sqrt(3))), -(4/(math.sqrt(3))), -(4/(math.sqrt(3))), (4/(math.sqrt(3))), (10/(math.sqrt(3))), -(4/(math.sqrt(3))), (4/(math.sqrt(3))), -(4/(math.sqrt(3))), (10/(math.sqrt(3))), (10/(math.sqrt(3))), -(13/(math.sqrt(3))), (4/(math.sqrt(3))), -(13/(math.sqrt(3))), -(4/(math.sqrt(3))), (10/(math.sqrt(3))), (4/(math.sqrt(3))), -(13/(math.sqrt(3))), (10/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1, 256, 9, -343, 243}$.\n", - "Output Answer": [ - "$6 \\sqrt[5]{-1} 3^{2/5} 14^{3/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 1, 256, 9, -343, 243\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-15, -7, -6, -3}$.\n", - "Output Answer": [ - "$\\frac{105}{4}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -15, -7, -6, -3\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-\\frac{13}{\\sqrt{\\pi }}, 8, 4, \\frac{4}{7}, 2}$.\n", - "Output Answer": [ - "$8+\\frac{13}{\\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nvalues = -(13/(math.sqrt(math.pi))), 8, 4, (4/7), 2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, 1, \\sqrt{2}}$.\n", - "Output Answer": [ - "${1, \\sqrt{2}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, 1, math.sqrt(2)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${4, -3, \\frac{9}{\\sqrt{2}}, 9, 5, -2}$.\n", - "Output Answer": [ - "$12$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -3, (9/(math.sqrt(2))), 9, 5, -2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${4, -3 \\sqrt{5}, 0, -9, -1.227, -3, -3, 0}$.\n", - "Output Answer": [ - "${-9, -3 \\sqrt{5}, -3, -3, -1.227, 0, 0, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = 4, -3*math.sqrt(5), 0, -9, -1.227, -3, -3, 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${6, 8, 2}$.\n", - "Output Answer": [ - "$\\frac{72}{19}$" - ], - "Output Program": [ - "import statistics\nvalues = 6, 8, 2\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $3.6 x+1.5$ where $x \\sim $ \\text{ExponentialDistribution}[1.5]\n", - "Output Answer": [ - "$3.9$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Exponential('x', 1.5)\nprint(E(3.6*x+1.5))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${3, 14, 8}$.\n", - "Output Answer": [ - "$\\frac{91}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 3, 14, 8\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${8, 4, -4, -5, -2, -4, -7}$.\n", - "Output Answer": [ - "$-\\frac{10}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = 8, 4, -4, -5, -2, -4, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, 1, 0.8, -7, -9, -5 \\sqrt{3}, 3 \\sqrt{2}} \\cup {-9, 8, 3 \\sqrt{2}, 0.9, -\\frac{6}{5}, 0, -5 \\sqrt{3}, -7}$.\n", - "Output Answer": [ - "${-9, -5 \\sqrt{3}, -7, -\\frac{6}{5}, 0, 0.8, 0.9, 1, 3 \\sqrt{2}, 8}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 1, 0.8, -7, -9, -5*math.sqrt(3), 3*math.sqrt(2),))\nsnd = set((-9, 8, 3*math.sqrt(2), 0.9, -(6/5), 0, -5*math.sqrt(3), -7,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2 \\sqrt{3}, 2, -6, -9, 3, 4 e}$.", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2*math.sqrt(3), 2, -6, -9, 3, 4*math.e\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${18, 7, 19, 15}$.\n", - "Output Answer": [ - "$\\frac{47880}{3803}$" - ], - "Output Program": [ - "import statistics\nvalues = 18, 7, 19, 15\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${5 \\sqrt{3}, -\\sqrt{3}, -\\sqrt{3}, \\frac{5}{\\sqrt{3}}, \\frac{11}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\frac{1}{5} \\left(\\frac{16}{\\sqrt{3}}+3 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = 5*math.sqrt(3), -math.sqrt(3), -math.sqrt(3), (5/(math.sqrt(3))), (11/(math.sqrt(3)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{1}{7}, 2, -2 \\sqrt{2}, -5, -3, -1} \\cup {-1, \\frac{1}{7}, -2 \\sqrt{2}, -3, 2, -5}$.\n", - "Output Answer": [ - "${-5, -3, -2 \\sqrt{2}, -1, \\frac{1}{7}, 2}$" - ], - "Output Program": [ - "import math\n\nfst = set(((1/7), 2, -2*math.sqrt(2), -5, -3, -1,))\nsnd = set((-1, (1/7), -2*math.sqrt(2), -3, 2, -5,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, 49, -100000, -100000, 512}$.\n", - "Output Answer": [ - "$400\\ 2^{3/5} 7^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, 49, -100000, -100000, 512\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${5, 4, 20, 7}$.\n", - "Output Answer": [ - "$\\frac{56}{9}$" - ], - "Output Program": [ - "import statistics\nvalues = 5, 4, 20, 7\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, -6, 4, -2, 9, 6, -4, 6}$.\n", - "Output Answer": [ - "$\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, -6, 4, -2, 9, 6, -4, 6\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${12, \\frac{31}{2}}$.\n", - "Output Answer": [ - "$\\frac{744}{55}$" - ], - "Output Program": [ - "import statistics\nvalues = 12, (31/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-6, 13, 13}$.\n", - "Output Answer": [ - "$\\frac{361}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -6, 13, 13\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${\\frac{8}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{14}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{8}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, -\\frac{17}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}, \\frac{4}{\\sqrt{3}}}$.\n", - "Output Answer": [ - "$\\left\\{\\frac{4}{\\sqrt{3}}\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = (8/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (8/(math.sqrt(3))), (14/(math.sqrt(3))), (4/(math.sqrt(3))), (14/(math.sqrt(3))), (14/(math.sqrt(3))), (4/(math.sqrt(3))), (8/(math.sqrt(3))), (14/(math.sqrt(3))), (4/(math.sqrt(3))), (14/(math.sqrt(3))), (14/(math.sqrt(3))), (4/(math.sqrt(3))), (14/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (14/(math.sqrt(3))), (4/(math.sqrt(3))), (8/(math.sqrt(3))), (4/(math.sqrt(3))), -(17/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3))), -(17/(math.sqrt(3))), (4/(math.sqrt(3))), (4/(math.sqrt(3)))\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.167,0.049,0.167,0.099,0.044,0.128,0.005,0.092,0.1,0.008\\}$ and $\\{0.037,0.034,0.096,0.038,0.148,0.098,0.195,0.112,0.04,0.09\\}$.", - "Output Answer": [ - "$0.58$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.167, 0.049, 0.167, 0.099, 0.044, 0.128, 0.005, 0.092, 0.1, 0.008\ndistribution2 = 0.037, 0.034, 0.096, 0.038, 0.148, 0.098, 0.195, 0.112, 0.04, 0.09\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{6}{\\pi }, -2.25, 1, -\\frac{16}{\\sqrt{\\pi }}, -5}$.\n", - "Output Answer": [ - "${-\\frac{16}{\\sqrt{\\pi }}, -5, -2.25, -\\frac{6}{\\pi }, 1}$" - ], - "Output Program": [ - "import math\n\nvalues = -(6/math.pi), -2.25, 1, -(16/(math.sqrt(math.pi))), -5\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-1, -8, \\frac{37}{7}}$.\n", - "Output Answer": [ - "$\\frac{93}{7}$" - ], - "Output Program": [ - "values = -1, -8, (37/7)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${27, -243, -6, 1, -59049}$.\n", - "Output Answer": [ - "$27 \\sqrt[5]{-2} 3^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 27, -243, -6, 1, -59049\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{17}{2}, 3, \\frac{5}{2}, \\frac{11}{2}, -\\frac{3}{2}, -3, -2, -9}$.\n", - "Output Answer": [ - "$\\frac{1}{2}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = (17/2), 3, (5/2), (11/2), -(3/2), -3, -2, -9\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-7 \\sqrt{2}, -\\frac{14}{\\sqrt{3}}, -\\frac{21}{5}, 8, -3, \\frac{17}{\\sqrt{3}}, 7, -14 \\log (2), \\sqrt{5}, 7}$.\n", - "Output Answer": [ - "$7 \\sqrt{2}+\\frac{17}{\\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nvalues = -7*math.sqrt(2), -(14/(math.sqrt(3))), -(21/5), 8, -3, (17/(math.sqrt(3))), 7, -14*math.log(2), math.sqrt(5), 7\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-2.206, 9, -4, -8} \\cup {9, -8.245, -8, -4}$.\n", - "Output Answer": [ - "${-8.245, -8, -4, -2.206, 9}$" - ], - "Output Program": [ - "fst = set((-2.206, 9, -4, -8,))\nsnd = set((9, -8.245, -8, -4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -\\frac{10}{\\sqrt{\\pi }}, 5, 3} \\setminus {5, 9, -\\frac{10}{\\sqrt{\\pi }}, 1, -2, -1}$.\n", - "Output Answer": [ - "${3}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -(10/(math.sqrt(math.pi))), 5, 3,))\nsnd = set((5, 9, -(10/(math.sqrt(math.pi))), 1, -2, -1,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${\\frac{16}{\\sqrt{3}}, 2, -9, \\frac{8}{\\pi }, 6, 0, \\frac{3}{5}} \\cup {\\frac{2}{\\sqrt{3}}, \\frac{17}{5}, \\frac{19}{5}, -9, -5, 3, \\frac{8}{\\pi }}$.\n", - "Output Answer": [ - "${-9, -5, 0, \\frac{3}{5}, \\frac{2}{\\sqrt{3}}, 2, \\frac{8}{\\pi }, 3, \\frac{17}{5}, \\frac{19}{5}, 6, \\frac{16}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nfst = set(((16/(math.sqrt(3))), 2, -9, (8/math.pi), 6, 0, (3/5),))\nsnd = set(((2/(math.sqrt(3))), (17/5), (19/5), -9, -5, 3, (8/math.pi),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $1.32 < -0.5 x^2-3.3 x-4. < 2.69$ where $x \\sim $ \\text{NormalDistribution}[1.4,2.1].", - "Output Answer": [ - "$0.02$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 1.4, 2.1)\nprint(P((1.32 < -0.5*x**2-3.3*x-4.) & (-0.5*x**2-3.3*x-4. < 2.69)))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${5, -\\frac{69}{7}, -5.34, -2.204, 3, -2 \\pi, -6, \\sqrt{5}} \\setminus {5, -5.34, \\sqrt{5}, 0, -6, 4, -8, -\\frac{69}{7}}$.\n", - "Output Answer": [ - "${-2 \\pi, -2.204, 3}$" - ], - "Output Program": [ - "import math\n\nfst = set((5, -(69/7), -5.34, -2.204, 3, -2*math.pi, -6, math.sqrt(5),))\nsnd = set((5, -5.34, math.sqrt(5), 0, -6, 4, -8, -(69/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $1.4 x^2+0.6 x-2.2$ where $x \\sim $ \\text{BetaDistribution}[1.6,0.6]\n", - "Output Answer": [ - "$-0.94$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1.6, 0.6)\nprint(E(1.4*x**2+0.6*x-2.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${3, 7, -2 e, 2}$.", - "Output Answer": [ - "$\\frac{5}{2}$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 3, 7, -2*math.e, 2\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{13}{\\pi }, \\frac{16}{\\sqrt{\\pi }}, 10, \\frac{25}{\\pi }, 4, -9, -9}$.\n", - "Output Answer": [ - "${-9, -9, 4, \\frac{13}{\\pi }, \\frac{25}{\\pi }, \\frac{16}{\\sqrt{\\pi }}, 10}$" - ], - "Output Program": [ - "import math\n\nvalues = (13/math.pi), (16/(math.sqrt(math.pi))), 10, (25/math.pi), 4, -9, -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.078,0.031,0.317,0.015,0.265,0.081,0.041,0.044\\}$ and $\\{0.181,0.114,0.03,0.128,0.087,0.103,0.198,0.065\\}$.", - "Output Answer": [ - "$0.96$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.078, 0.031, 0.317, 0.015, 0.265, 0.081, 0.041, 0.044\ndistribution2 = 0.181, 0.114, 0.03, 0.128, 0.087, 0.103, 0.198, 0.065\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-3, -12, 1}$.\n", - "Output Answer": [ - "$\\frac{133}{3}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -12, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${0, 2 \\sqrt{2}, -\\frac{1}{\\pi }, 3 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{3}, -2 \\sqrt{5}, -1} \\cup {0, 4, \\frac{2}{\\pi }, -\\sqrt{5}, 3 \\sqrt{5}, -3 \\sqrt{3}, -2 \\sqrt{5}, 4 \\sqrt{2}}$.\n", - "Output Answer": [ - "${-3 \\sqrt{3}, -2 \\sqrt{5}, -\\sqrt{5}, -\\sqrt{3}, -1, -\\frac{1}{\\pi }, 0, \\frac{2}{\\pi }, 2 \\sqrt{2}, 4, 4 \\sqrt{2}, 3 \\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfst = set((0, 2*math.sqrt(2), -(1/math.pi), 3*math.sqrt(5), -math.sqrt(5), -math.sqrt(3), -2*math.sqrt(5), -1,))\nsnd = set((0, 4, (2/math.pi), -math.sqrt(5), 3*math.sqrt(5), -3*math.sqrt(3), -2*math.sqrt(5), 4*math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-13, -1, 13, -6}$.\n", - "Output Answer": [ - "$\\frac{\\sqrt{\\frac{1451}{3}}}{2}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -13, -1, 13, -6\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-7, -15, -3, -14, -2, 1}$.\n", - "Output Answer": [ - "$\\frac{652}{15}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -7, -15, -3, -14, -2, 1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-3 \\sqrt{5}, 1, 2 \\sqrt{3}, -6, 1, -3 \\sqrt{5}, -2, -3}$.\n", - "Output Answer": [ - "$2 \\sqrt{3}+3 \\sqrt{5}$" - ], - "Output Program": [ - "import math\n\nvalues = -3*math.sqrt(5), 1, 2*math.sqrt(3), -6, 1, -3*math.sqrt(5), -2, -3\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.042,0.145,0.041,0.096,0.184,0.091,0.108,0.113,0.07\\}$ and $\\{0.144,0.203,0.282,0.081,0.041,0.098,0.064,0.02,0.03\\}$.", - "Output Answer": [ - "$0.55$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.042, 0.145, 0.041, 0.096, 0.184, 0.091, 0.108, 0.113, 0.07\ndistribution2 = 0.144, 0.203, 0.282, 0.081, 0.041, 0.098, 0.064, 0.02, 0.03\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.276,0.339,0.12,0.22\\}$ and $\\{0.123,0.3,0.136,0.176\\}$.", - "Output Answer": [ - "$0.05$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.276, 0.339, 0.12, 0.22\ndistribution2 = 0.123, 0.3, 0.136, 0.176\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${9, 7, 9, \\frac{47}{7}, -9}$.\n", - "Output Answer": [ - "${-9, \\frac{47}{7}, 7, 9, 9}$" - ], - "Output Program": [ - "values = 9, 7, 9, (47/7), -9\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-1, -6, 9, -3 \\pi, -\\frac{13}{3}, -\\frac{23}{4}} \\setminus {5 \\sqrt{2}, 2 \\pi, 8, -4, -\\frac{13}{3}, -1, 5, -6}$.\n", - "Output Answer": [ - "${-3 \\pi, -\\frac{23}{4}, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, -6, 9, -3*math.pi, -(13/3), -(23/4),))\nsnd = set((5*math.sqrt(2), 2*math.pi, 8, -4, -(13/3), -1, 5, -6,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${0, \\frac{1}{\\sqrt{3}}, -3 \\log (2), \\frac{30}{\\pi }, 3, 7, -2 e, -5 \\sqrt{3}, -\\frac{16}{5}}$.\n", - "Output Answer": [ - "$5 \\sqrt{3}+\\frac{30}{\\pi }$" - ], - "Output Program": [ - "import math\n\nvalues = 0, (1/(math.sqrt(3))), -3*math.log(2), (30/math.pi), 3, 7, -2*math.e, -5*math.sqrt(3), -(16/5)\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-3.425, 1, 5, 10, -5, 6 \\sqrt{3}, 0} \\cup {8, -3.425, 5, 10, 6 \\sqrt{3}, 0, e}$.\n", - "Output Answer": [ - "${-5, -3.425, 0, 1, e, 5, 8, 10, 6 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-3.425, 1, 5, 10, -5, 6*math.sqrt(3), 0,))\nsnd = set((8, -3.425, 5, 10, 6*math.sqrt(3), 0, math.e,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${0, -9, -3, -4}$.\n", - "Output Answer": [ - "$14$" - ], - "Output Program": [ - "import statistics\n\nvalues = 0, -9, -3, -4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{15}{e}, \\pi, 6.472, 4}$.\n", - "Output Answer": [ - "${-\\frac{15}{e}, \\pi, 4, 6.472}$" - ], - "Output Program": [ - "import math\n\nvalues = -(15/math.e), math.pi, 6.472, 4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{24}{\\pi }, -3 \\sqrt{2}, 7}$.\n", - "Output Answer": [ - "${-\\frac{24}{\\pi }, -3 \\sqrt{2}, 7}$" - ], - "Output Program": [ - "import math\n\nvalues = -(24/math.pi), -3*math.sqrt(2), 7\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-8, 0, -4 \\sqrt{3}, 7, 1}$.", - "Output Answer": [ - "$0$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -8, 0, -4*math.sqrt(3), 7, 1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${16, -1, -7776, 2401, 1}$.\n", - "Output Answer": [ - "$6\\ 14^{4/5}$" - ], - "Output Program": [ - "import math\n\nvalues = 16, -1, -7776, 2401, 1\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${-4 \\sqrt{3}, 2 \\sqrt{2}, 5, -4, \\frac{19}{2}, -10, 2 \\pi, -7, -1, -\\frac{10}{\\sqrt{3}}, -2, 5}$.\n", - "Output Answer": [ - "$\\frac{39}{2}$" - ], - "Output Program": [ - "import math\n\nvalues = -4*math.sqrt(3), 2*math.sqrt(2), 5, -4, (19/2), -10, 2*math.pi, -7, -1, -(10/(math.sqrt(3))), -2, 5\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-0.16 < 0.9 x+3.2 < 1.41$ where $x \\sim $ \\text{NormalDistribution}[0.7,2.3].", - "Output Answer": [ - "$0.09$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.7, 2.3)\nprint(P((-0.16 < 0.9*x+3.2) & (0.9*x+3.2 < 1.41)))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${6, \\frac{28}{5}, -2, -\\frac{13}{\\sqrt{2}}, 3.416, \\frac{9}{\\pi }}$.\n", - "Output Answer": [ - "${-\\frac{13}{\\sqrt{2}}, -2, \\frac{9}{\\pi }, 3.416, \\frac{28}{5}, 6}$" - ], - "Output Program": [ - "import math\n\nvalues = 6, (28/5), -2, -(13/(math.sqrt(2))), 3.416, (9/math.pi)\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${49, 25, -216}$.\n", - "Output Answer": [ - "$6 \\sqrt[3]{-1} 35^{2/3}$" - ], - "Output Program": [ - "import math\n\nvalues = 49, 25, -216\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${-1, \\frac{47}{7}, 9, -5, -6, -\\frac{58}{7}} \\setminus {4, \\frac{29}{7}, -5, -\\frac{1}{e}, 10, -6, \\frac{47}{7}}$.\n", - "Output Answer": [ - "${-\\frac{58}{7}, -1, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, (47/7), 9, -5, -6, -(58/7),))\nsnd = set((4, (29/7), -5, -(1/math.e), 10, -6, (47/7),))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${6, 13, 12, 12, 2, 12}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{199}{10}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 6, 13, 12, 12, 2, 12\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-9, 2, 8, 4}$.\n", - "Output Answer": [ - "$\\frac{635}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -9, 2, 8, 4\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-\\frac{1}{\\sqrt{\\pi }}, \\frac{9}{\\sqrt{\\pi }}, \\frac{2}{\\sqrt{\\pi }}, -\\frac{16}{\\sqrt{\\pi }}, \\frac{15}{\\sqrt{\\pi }}, \\frac{12}{\\sqrt{\\pi }}}$.\n", - "Output Answer": [ - "$\\frac{7}{2 \\sqrt{\\pi }}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -(1/(math.sqrt(math.pi))), (9/(math.sqrt(math.pi))), (2/(math.sqrt(math.pi))), -(16/(math.sqrt(math.pi))), (15/(math.sqrt(math.pi))), (12/(math.sqrt(math.pi)))\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${8, 5, -\\frac{1}{\\sqrt{2}}, 10, -\\frac{6}{7}, 4, -5, -4}$.\n", - "Output Answer": [ - "$15$" - ], - "Output Program": [ - "import math\n\nvalues = 8, 5, -(1/(math.sqrt(2))), 10, -(6/7), 4, -5, -4\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${8, 9, -5 \\sqrt{2}, -\\frac{7}{2}, 4 \\sqrt{3}, 1, \\frac{68}{7}, 3, \\frac{10}{3}, \\frac{67}{7}, 7, -7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(\\frac{10}{3}+4 \\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 8, 9, -5*math.sqrt(2), -(7/2), 4*math.sqrt(3), 1, (68/7), 3, (10/3), (67/7), 7, -7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-3, -1, 2, -7}$.\n", - "Output Answer": [ - "$-\\frac{9}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -3, -1, 2, -7\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\sqrt{5}, \\sqrt{5}, 0, 0, 2 \\sqrt{5}}$.\n", - "Output Answer": [ - "$\\frac{4}{\\sqrt{5}}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = math.sqrt(5), math.sqrt(5), 0, 0, 2*math.sqrt(5)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${1000, 1296, 1296, 5}$.\n", - "Output Answer": [ - "$180\\ 2^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = 1000, 1296, 1296, 5\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${0, -4.08, -9, -4 \\sqrt{3}, 9, 0}$.\n", - "Output Answer": [ - "${-9, -4 \\sqrt{3}, -4.08, 0, 0, 9}$" - ], - "Output Program": [ - "import math\n\nvalues = 0, -4.08, -9, -4*math.sqrt(3), 9, 0\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-9, 9, -10, -9, -10, 9, 9, -10, -9, -10, 2, 2, 2, 1, 2, -5, 1, -10, -9, 2, 2, 1, 1, -10, -5, 2, 2, -9, 1}$.\n", - "Output Answer": [ - "$\\{2\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -9, 9, -10, -9, -10, 9, 9, -10, -9, -10, 2, 2, 2, 1, 2, -5, 1, -10, -9, 2, 2, 1, 1, -10, -5, 2, 2, -9, 1\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.1 x^2+3.9 x-3.2$ where $x \\sim $ \\text{PoissonDistribution}[3.]\n", - "Output Answer": [ - "$-40.7$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Poisson('x', 3.)\nprint(E(-4.1*x**2+3.9*x-3.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-11, -12, 5, 14, 7, 6}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{223}{2}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -11, -12, 5, 14, 7, 6\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-16807, 256, -7776, -8, 36}$.\n", - "Output Answer": [ - "$168 \\sqrt[5]{-1} 2^{3/5} 3^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -16807, 256, -7776, -8, 36\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-2, -\\sqrt{2}, 5, 4, -e, 1} \\cup {1, -\\frac{22}{3}, -2, 4, -2 e, -\\sqrt{2}}$.\n", - "Output Answer": [ - "${-\\frac{22}{3}, -2 e, -e, -2, -\\sqrt{2}, 1, 4, 5}$" - ], - "Output Program": [ - "import math\n\nfst = set((-2, -math.sqrt(2), 5, 4, -math.e, 1,))\nsnd = set((1, -(22/3), -2, 4, -2*math.e, -math.sqrt(2),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-5, 15, 12, -13, -1}$.\n", - "Output Answer": [ - "$\\frac{689}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -5, 15, 12, -13, -1\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${-3, -8, -3}$.\n", - "Output Answer": [ - "$\\frac{5}{\\sqrt{3}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -3, -8, -3\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-1, \\frac{5}{2}, -\\frac{23}{4}, 0, 4 e, \\frac{39}{4}, -4 e, -2} \\cup {-4 e, \\frac{5}{2}, 4 e, -2, -8, 1, 8, -4}$.\n", - "Output Answer": [ - "${-4 e, -8, -\\frac{23}{4}, -4, -2, -1, 0, 1, \\frac{5}{2}, 8, \\frac{39}{4}, 4 e}$" - ], - "Output Program": [ - "import math\n\nfst = set((-1, (5/2), -(23/4), 0, 4*math.e, (39/4), -4*math.e, -2,))\nsnd = set((-4*math.e, (5/2), 4*math.e, -2, -8, 1, 8, -4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${2, 0, -5, 9, 9, \\frac{17}{2}, -4, -1, -5, 2 e, -10, e, 1}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 2, 0, -5, 9, 9, (17/2), -4, -1, -5, 2*math.e, -10, math.e, 1\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${-4, 14, 0, 2, -9}$.\n", - "Output Answer": [ - "$\\frac{369}{5}$" - ], - "Output Program": [ - "import statistics\n\nvalues = -4, 14, 0, 2, -9\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${9, 0, 8, \\frac{11}{\\sqrt{5}}, -5, -4 e} \\setminus {\\frac{11}{\\sqrt{5}}, -6, 6, -5, 0, -4 e}$.\n", - "Output Answer": [ - "${8, 9}$" - ], - "Output Program": [ - "import math\n\nfst = set((9, 0, 8, (11/(math.sqrt(5))), -5, -4*math.e,))\nsnd = set(((11/(math.sqrt(5))), -6, 6, -5, 0, -4*math.e,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${\\frac{26}{e}, -\\frac{26}{e}, -\\frac{21}{e}, -\\frac{26}{e}, -\\frac{18}{e}, -\\frac{26}{e}, \\frac{13}{e}}$.\n", - "Output Answer": [ - "$-\\frac{78}{7 e}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = (26/math.e), -(26/math.e), -(21/math.e), -(26/math.e), -(18/math.e), -(26/math.e), (13/math.e)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-7, 1, 5, 4}$.\n", - "Output Answer": [ - "$\\frac{3}{4}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -7, 1, 5, 4\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nFind the probability that $-1.71 < 5. x^2-2.1 x-2. < -0.49$ where $x \\sim $ \\text{NormalDistribution}[0.3,1.5].", - "Output Answer": [ - "$0.14$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Normal('x', 0.3, 1.5)\nprint(P((-1.71 < 5.*x**2-2.1*x-2.) & (5.*x**2-2.1*x-2. < -0.49)))\n" - ], - "split": "test" - }, - { - "Input": "Find the difference between two sets, namely ${10, 4, 5, 3, 4 \\sqrt{3}, 2} \\setminus {-9, 1, 4 \\sqrt{3}, 3, 5}$.\n", - "Output Answer": [ - "${2, 4, 10}$" - ], - "Output Program": [ - "import math\n\nfst = set((10, 4, 5, 3, 4*math.sqrt(3), 2,))\nsnd = set((-9, 1, 4*math.sqrt(3), 3, 5,))\nprint(fst - snd)\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${0, -6, 0, -6, 7, -9, 7, 0, 7, -6, 7, 7, -6, 0, 7, -9, 7, -9, 0, 0, 7, 7, -6, 7}$.\n", - "Output Answer": [ - "$\\{7\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 0, -6, 0, -6, 7, -9, 7, 0, 7, -6, 7, 7, -6, 0, 7, -9, 7, -9, 0, 0, 7, 7, -6, 7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.292,0.301,0.046,0.281\\}$ and $\\{0.015,0.437,0.07,0.477\\}$.", - "Output Answer": [ - "$0.72$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.292, 0.301, 0.046, 0.281\ndistribution2 = 0.015, 0.437, 0.07, 0.477\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-1, -1, -8, 0, -5, -1, -1, 0, -8, -4, -4, -8, -4, -8, -8, -1, -5, 0, -1, -4, -8, -8, -1, 0, -4, -4, -1, -5}$.\n", - "Output Answer": [ - "$\\{-1\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -1, -1, -8, 0, -5, -1, -1, 0, -8, -4, -4, -8, -4, -8, -8, -1, -5, 0, -1, -4, -8, -8, -1, 0, -4, -4, -1, -5\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${-6, 6, -\\sqrt{5}, -9, 5 \\sqrt{3}, 2 \\sqrt{5}} \\cup {-\\sqrt{5}, 6, -5, -9, -3 \\sqrt{5}}$.\n", - "Output Answer": [ - "${-9, -3 \\sqrt{5}, -6, -5, -\\sqrt{5}, 2 \\sqrt{5}, 6, 5 \\sqrt{3}}$" - ], - "Output Program": [ - "import math\n\nfst = set((-6, 6, -math.sqrt(5), -9, 5*math.sqrt(3), 2*math.sqrt(5),))\nsnd = set((-math.sqrt(5), 6, -5, -9, -3*math.sqrt(5),))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${\\frac{19}{4}, \\frac{8}{\\sqrt{5}}, \\sqrt{3}, 3, 10, -2, -\\frac{13}{\\sqrt{3}}, 4, 0, -\\frac{9}{2}, -7, 3 e, 1, -10}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(1+\\sqrt{3}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = (19/4), (8/(math.sqrt(5))), math.sqrt(3), 3, 10, -2, -(13/(math.sqrt(3))), 4, 0, -(9/2), -7, 3*math.e, 1, -10\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the range of ${\\frac{9}{5}, -1, -9, -9, -5, -4, 3 e, -\\frac{12}{\\sqrt{\\pi }}, 1, 2}$.\n", - "Output Answer": [ - "$9+3 e$" - ], - "Output Program": [ - "import math\n\nvalues = (9/5), -1, -9, -9, -5, -4, 3*math.e, -(12/(math.sqrt(math.pi))), 1, 2\nprint(max(values) - min(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-8, -3, -5, -10, -6, -2, 3}$.\n", - "Output Answer": [ - "$-\\frac{31}{7}$" - ], - "Output Program": [ - "from statistics import mean\nvalues = -8, -3, -5, -10, -6, -2, 3\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-5, -\\frac{2}{e}, -5, -8}$.", - "Output Answer": [ - "$-5$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -5, -(2/math.e), -5, -8\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample standard deviation of ${5, 4, 15, 3, -3}$.\n", - "Output Answer": [ - "$\\sqrt{\\frac{211}{5}}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 5, 4, 15, 3, -3\nprint(statistics.stdev(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-512, 1, 3, 16807, -3}$.\n", - "Output Answer": [ - "$14\\ 2^{4/5} 3^{2/5}$" - ], - "Output Program": [ - "import math\n\nvalues = -512, 1, 3, 16807, -3\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mean of ${-2 \\log (2), -9 \\log (2), 6 \\log (2), \\log (2), -11 \\log (2), -14 \\log (2), -5 \\log (2), -10 \\log (2)}$.\n", - "Output Answer": [ - "$-\\frac{11 \\log (2)}{2}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mean\nvalues = -2*math.log(2), -9*math.log(2), 6*math.log(2), math.log(2), -11*math.log(2), -14*math.log(2), -5*math.log(2), -10*math.log(2)\nprint(mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${-6, -9, -9, -6, -\\frac{15}{4}, 0, -6, \\frac{15}{\\sqrt{\\pi }}, -\\frac{11}{\\sqrt{2}}, 5, -7, -9}$.", - "Output Answer": [ - "$-6$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = -6, -9, -9, -6, -(15/4), 0, -6, (15/(math.sqrt(math.pi))), -(11/(math.sqrt(2))), 5, -7, -9\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.057,0.103,0.209,0.263,0.109,0.081\\}$ and $\\{0.056,0.023,0.093,0.208,0.366,0.016\\}$.", - "Output Answer": [ - "$0.39$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.057, 0.103, 0.209, 0.263, 0.109, 0.081\ndistribution2 = 0.056, 0.023, 0.093, 0.208, 0.366, 0.016\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${\\frac{19}{5}, \\frac{13}{\\sqrt{3}}, -2.92, -4, -9, 3, 6.727, -9.313}$.\n", - "Output Answer": [ - "${-9.313, -9, -4, -2.92, 3, \\frac{19}{5}, 6.727, \\frac{13}{\\sqrt{3}}}$" - ], - "Output Program": [ - "import math\n\nvalues = (19/5), (13/(math.sqrt(3))), -2.92, -4, -9, 3, 6.727, -9.313\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Find the union of the following sets, namely ${4, -9, 2.363, 7, 0, -6, 6} \\cup {0, 2.363, 7, 6, -2.42, 4}$.\n", - "Output Answer": [ - "${-9, -6, -2.42, 0, 2.363, 4, 6, 7}$" - ], - "Output Program": [ - "fst = set((4, -9, 2.363, 7, 0, -6, 6,))\nsnd = set((0, 2.363, 7, 6, -2.42, 4,))\nprint(fst.union(snd))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${2, 7, -4, 2, 0, -4, 0, -4, -4, -4, 5, 2, 0, 7, 7, 5, 2, 5, -4, 2}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = 2, 7, -4, 2, 0, -4, 0, -4, -4, -4, 5, 2, 0, 7, 7, 5, 2, 5, -4, 2\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nSort ${-\\frac{10}{\\sqrt{\\pi }}, -9, 4}$.\n", - "Output Answer": [ - "${-9, -\\frac{10}{\\sqrt{\\pi }}, 4}$" - ], - "Output Program": [ - "import math\n\nvalues = -(10/(math.sqrt(math.pi))), -9, 4\nprint(sorted(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nDetermine the KL Divergence between the empirical distributions $\\{0.529,0.16,0.113,0.043,0.026,0.014\\}$ and $\\{0.229,0.087,0.046,0.2,0.1,0.228\\}$.", - "Output Answer": [ - "$0.57$" - ], - "Output Program": [ - "from scipy.stats import entropy\n\ndistribution1 = 0.529, 0.16, 0.113, 0.043, 0.026, 0.014\ndistribution2 = 0.229, 0.087, 0.046, 0.2, 0.1, 0.228\nprint(entropy(distribution1, qk=distribution2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${9, -1, \\sqrt{3}, -\\frac{10}{\\sqrt{3}}, 1, -8, 7}$.", - "Output Answer": [ - "$1$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 9, -1, math.sqrt(3), -(10/(math.sqrt(3))), 1, -8, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the geometric mean of ${-64, 1296, 216, 2401}$.\n", - "Output Answer": [ - "$(84+84 i) 6^{3/4}$" - ], - "Output Program": [ - "import math\n\nvalues = -64, 1296, 216, 2401\ngeometric_mean = math.prod(values) ** (1 / len(values))\nprint(geometric_mean)\n\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nFind the expectation of $-4.4 x-4.2$ where $x \\sim $ \\text{BetaDistribution}[1.,0.6]\n", - "Output Answer": [ - "$-6.95$" - ], - "Output Program": [ - "from sympy import *\nfrom sympy.stats import *\n\nx = Beta('x', 1., 0.6)\nprint(E(-4.4*x-4.2))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{14}{\\pi }, \\frac{26}{\\pi }, -\\frac{14}{\\pi }, -\\frac{16}{\\pi }, -\\frac{16}{\\pi }, -\\frac{24}{\\pi }, -\\frac{26}{\\pi }, -\\frac{26}{\\pi }, \\frac{26}{\\pi }, -\\frac{24}{\\pi }, -\\frac{26}{\\pi }, \\frac{26}{\\pi }, -\\frac{16}{\\pi }, -\\frac{26}{\\pi }, -\\frac{24}{\\pi }, -\\frac{14}{\\pi }, -\\frac{26}{\\pi }, -\\frac{14}{\\pi }, \\frac{26}{\\pi }, -\\frac{26}{\\pi }, -\\frac{16}{\\pi }, -\\frac{14}{\\pi }, -\\frac{14}{\\pi }, -\\frac{16}{\\pi }, -\\frac{16}{\\pi }}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{14}{\\pi },-\\frac{16}{\\pi },-\\frac{26}{\\pi }\\right\\}$" - ], - "Output Program": [ - "import math\n\nfrom statistics import mode\n\nvalues = -(14/math.pi), (26/math.pi), -(14/math.pi), -(16/math.pi), -(16/math.pi), -(24/math.pi), -(26/math.pi), -(26/math.pi), (26/math.pi), -(24/math.pi), -(26/math.pi), (26/math.pi), -(16/math.pi), -(26/math.pi), -(24/math.pi), -(14/math.pi), -(26/math.pi), -(14/math.pi), (26/math.pi), -(26/math.pi), -(16/math.pi), -(14/math.pi), -(14/math.pi), -(16/math.pi), -(16/math.pi)\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the sample variance of ${11, 5, 3, 0}$.\n", - "Output Answer": [ - "$\\frac{259}{12}$" - ], - "Output Program": [ - "import statistics\n\nvalues = 11, 5, 3, 0\nprint(statistics.variance(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\nCompute the median of ${1, \\frac{10}{e}, -6, \\frac{6}{\\sqrt{\\pi }}, 4, -4, -4, 2 e, 1, 7}$.", - "Output Answer": [ - "$\\frac{1}{2} \\left(1+\\frac{6}{\\sqrt{\\pi }}\\right)$" - ], - "Output Program": [ - "import math\n\nimport statistics\n\nvalues = 1, (10/math.e), -6, (6/(math.sqrt(math.pi))), 4, -4, -4, 2*math.e, 1, 7\nprint(statistics.median(values)) \n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-\\frac{5}{2}, -\\frac{5}{2}, -\\frac{5}{2}, -\\frac{5}{2}, \\frac{1}{2}, -\\frac{5}{2}, 7, -\\frac{5}{2}, 7, \\frac{1}{2}, \\frac{1}{2}, 7, -\\frac{5}{2}, -\\frac{5}{2}, -\\frac{5}{2}, -\\frac{5}{2}, -\\frac{5}{2}, 5, -\\frac{5}{2}, 5, -\\frac{5}{2}, 7}$.\n", - "Output Answer": [ - "$\\left\\{-\\frac{5}{2}\\right\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -(5/2), -(5/2), -(5/2), -(5/2), (1/2), -(5/2), 7, -(5/2), 7, (1/2), (1/2), 7, -(5/2), -(5/2), -(5/2), -(5/2), -(5/2), 5, -(5/2), 5, -(5/2), 7\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-10, 9, 9, -9, 9, 9, -9, 9, -9, -10, -10, -9, -6, -6, 9, 9, 9, -9, 9, -9, 9, -6}$.\n", - "Output Answer": [ - "$\\{9\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -10, 9, 9, -9, 9, 9, -9, 9, -9, -10, -10, -9, -6, -6, 9, 9, 9, -9, 9, -9, 9, -6\nprint(mode(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the harmonic mean of ${\\frac{5}{2}, 18, \\frac{25}{2}}$.\n", - "Output Answer": [ - "$\\frac{1350}{241}$" - ], - "Output Program": [ - "import statistics\nvalues = (5/2), 18, (25/2)\nprint(statistics.harmonic_mean(values))\n" - ], - "split": "test" - }, - { - "Input": "Problem:\n\nCompute the mode of ${-4, -2, 8, -4, 8, 2, 6, -5, -2, -10, -5, -2, -4, 2, -5, -4, 8, -4, 8, -10, -4, -4, -10, 2, -10, 6}$.\n", - "Output Answer": [ - "$\\{-4\\}$" - ], - "Output Program": [ - "from statistics import mode\n\nvalues = -4, -2, 8, -4, 8, 2, 6, -5, -2, -10, -5, -2, -4, 2, -5, -4, 8, -4, 8, -10, -4, -4, -10, 2, -10, 6\nprint(mode(values))\n" - ], - "split": "test" - } - ] -} \ No newline at end of file