Voting Power in a Presidential Election
Compare the Banzhaf power index of the states in the 1804 US presidential election with their population.
pick[_, votes_, needed_] /; needed > Total[votes] := False;
pick[{}, {}, _] := {{}};
pick[_, _, _ ? NonPositive] := {{}};
pick[states_, votes_, needed_] := Cases[Flatten[Table[Append[#, states[[i]]]& /@ pick[states[[i + 1 ;; ]], votes[[i + 1 ;; ]], needed - votes[[i]]], {i, 1, Length[states]}], 1], Except[False]]states1804 = {CT, DE, GA, KY, MD, MA, NH, NJ, NY, NC, OH, PA, RI, SC, TN, VT, VA};
votes1804 = {9, 3, 6, 8, 11, 19, 7, 8, 19, 14, 3, 20, 4, 10, 5, 6, 24};
bexpr = Or@@(And@@@pick[states1804, votes1804, 89]);
population = {255376, 67632, 198565, 295137, 357139, 442512, 196092, 224907, 736969, 509045, 119482, 685410, 72244, 373385, 168018, 179823, 835592};power = StructuralImportance[bexpr, states1804];labeler[_, {1, _}, ___] := None
labeler[_, {2, c_}, ___] := Placed[states1804[[c]], "RadialCallout"]PieChart[{Labeled[population, "Population", {0, 0}], Labeled[power, "Voting Power", {0, 0}]}, SectorSpacing -> 0.1, LabelingFunction -> labeler, ImagePadding -> 20, ImageSize -> 500]