Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smrfeld/whats-my-vote-worth
What's my vote worth? Your state's voting power in the electoral college.
https://github.com/smrfeld/whats-my-vote-worth
college css electoral flask html python voting
Last synced: 11 days ago
JSON representation
What's my vote worth? Your state's voting power in the electoral college.
- Host: GitHub
- URL: https://github.com/smrfeld/whats-my-vote-worth
- Owner: smrfeld
- License: mit
- Created: 2020-11-09T05:07:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T10:18:42.000Z (10 months ago)
- Last Synced: 2024-01-10T11:41:32.107Z (10 months ago)
- Topics: college, css, electoral, flask, html, python, voting
- Language: HTML
- Homepage: https://whats-my-vote-worth.oliver-ernst.com
- Size: 438 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# What's my vote worth?
Your state's voting power in the electoral college.
[View the live application here](http://whats-my-vote-worth.oliver-ernst.com)
## About
Created by: [Oliver K. Ernst](https://oliver-ernst.com) (2020)
Source code: [GitHub](https://github.com/smrfeld/whats-my-vote-worth)
Based on: [house-of-reps](https://github.com/smrfeld/house-of-reps)## Running locally
Install requirements:
```bash
pip install -r requirements.txt
```Run the application:
```bash
flask run
```## Explanation
This application allows you to explore what your vote is worth
in the electoral college system in the United States.
It uses **2020 census data** for the population of each state.For any given population of the states, the app ultimately computes the vote fraction defined as:
The first fraction here is the state's share of the electoral college votes:
If there were no electoral college, we can view this
as if each person could vote in the electoral college:and the vote fraction would be unity for every state:
In the electoral college system, each state has different vote fractions.
With the 2020 census populations, California has the lowest fraction: 0.84,
while Wyoming has the highest fraction: 3.2.
This means that every vote cast in California is worth c.a. 0.3 the vote of a voter in Wyoming,
or equivalently every voter in Wyoming has the power of 3.8 Californians in deciding the U.S. presidential race.In this application, you can also shift the populations from
one state to another to explore how the vote fraction changes.
For example, as the c.a. 40 million people in California are redistributed to the other states,
the number of house representatives decreases, such that the electoral college votes decreases,
such that the vote fraction grows - first to unity, and then beyond.The number of electoral college votes for each state is equal to:
* One for each senator (two for every state).
* One for each **voting** member of the house of representatives (territories and Washington DC only have **non-voting** members).
The number of voting representatives is currently fixed at 435.
* Three for Washington DC.For any given population distribution among the states,
it remains to determine [how many representatives are assigned to each state.](https://www.everycrsreport.com/reports/R41357.html)
This process is not trivial, using a priority list algorithm implemented in this application:
* Every state (excluding Washington DC) is assigned the mandatory minimum of 1 representative.
The total number of representatives assigned is now 50.
* While the total number of voting representatives assigned is less 435 (fixed limit):
* Calculate a priority for each state:
where the number of reps assigned refers to the **current** number of reps assigned.
* Assign the next representative to the state with the highest priority.
This calculation is performed every time the population distribution in the application is adjusted.
From this, the electoral votes and the vote fraction are determined.## Image source
U.S. map [source](https://commons.wikimedia.org/wiki/File:Blank_US_Map_(states_only).svg) released under [Creative Commons Attribution-Share Alike 3.0 Unported.](https://en.wikipedia.org/wiki/en:Creative_Commons).
## License
Distributed under MIT License:
Copyright 2020 Oliver K. Ernst
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.