A simple package which calculates the total probability and expected value of the outcome data type
Project description
Expected Value Package
This is a simple package which offers functions to calculate the expected value and the total probability for the outcome data type.
Importing
You can import the expected value package by:
from expected_value import expected_value
Using Expected Value
You can use the Expected Value command using:
o1 = outcome.Outcome("win", float(2), probability.Probability(.5))
o2 = outcome.Outcome("tie", float(10), probability.Probability(.1))
o3 = outcome.Outcome("lose", float(-1), probability.Probability(.4))
os = [o1, o2, o3]
print(expected_value(os))
which will output 1.6.
You can use the permutations (where order does matter) command using:
o1 = outcome.Outcome("win", float(2), probability.Probability(.5))
o2 = outcome.Outcome("tie", float(10), probability.Probability(.1))
o3 = outcome.Outcome("lose", float(-1), probability.Probability(.4))
os = [o1, o2, o3]
print(total_probability(os))
which will output 1.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file expected_value_tb-0.0.1.tar.gz
.
File metadata
- Download URL: expected_value_tb-0.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04e9912e28e662f2c80a65b15990eca4f386f62213f8818fdcb56695f8852542 |
|
MD5 | ea9f721975a57970ad08484c0b722769 |
|
BLAKE2b-256 | 3acfad6996a9e9a772de9f6756f5164598474d6f4e0d8e32c4d31b005809ed9b |
File details
Details for the file expected_value_tb-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: expected_value_tb-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db72b99ddc869a9f743d3c0c2b831ce22db076e3709f51bf0bbbb8a6a4c6bee7 |
|
MD5 | dea5b957cd3ed2ceeb6fdee6692bdebc |
|
BLAKE2b-256 | c17fbfe3d333de9ea0ead02c7e2b8465561bd3349a0fb0d4101575a2f88815cd |