Skip to content

Instantly share code, notes, and snippets.

@ruescasd
Created September 6, 2017 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruescasd/04355fcff5570d5468dde656ad0c7a01 to your computer and use it in GitHub Desktop.
Save ruescasd/04355fcff5570d5468dde656ad0c7a01 to your computer and use it in GitHub Desktop.
# election two categories of voters:
# 20 voters with weight 1, 2 voters with weight 10
# 10x + y = 20
# x <= 2, y <= 20
# three solution points: (2, 0), (1, 10), (0, 20)
# particular solution (origin):
# [0 20]
# basis
# [1 -10]
# to derive the monomials:
# monomial form
# origin term + basis term
# origin term = origin value / (number of voters * number of points)
# basis term = basis value / (number of voters * number of points)
# x monomials: 0/6 + 1/6x: [[1/6,[1]]]
# y monomials: 20/60 - 10x/60: [[20/60,[0]], [-10/60,[1]]]
3 3
20 -10 -1
2 -1 0
20 0 -1
linearity 1 1
nonnegative 2 1 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment