Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

expected_value_tb-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

expected_value_tb-0.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for expected_value_tb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 04e9912e28e662f2c80a65b15990eca4f386f62213f8818fdcb56695f8852542
MD5 ea9f721975a57970ad08484c0b722769
BLAKE2b-256 3acfad6996a9e9a772de9f6756f5164598474d6f4e0d8e32c4d31b005809ed9b

See more details on using hashes here.

File details

Details for the file expected_value_tb-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for expected_value_tb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db72b99ddc869a9f743d3c0c2b831ce22db076e3709f51bf0bbbb8a6a4c6bee7
MD5 dea5b957cd3ed2ceeb6fdee6692bdebc
BLAKE2b-256 c17fbfe3d333de9ea0ead02c7e2b8465561bd3349a0fb0d4101575a2f88815cd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page