Giter Club home page Giter Club logo

lottery-calculate's Introduction

彩票计算 - lottery calculate

设金额:

A=A胜,B=B胜,C=平局,M=总预算 

设赔率:

a=A胜,b=B胜,c=平局  

列方程式

如果A胜赢:

① Aa - A - B - C ≥ 0  =>>  A(a-1) ≥ B + C

如果B胜赢:

② Bb - A - B - C ≥ 0  =>>  B(b-1) ≥ A + C

如果平局:

③ Cc - A - B - C ≥ 0  =>>  C(c-1) ≥ A + B

总预算:

④ A + B + C = M

化简

将 ① - ② 得:

⑤ Aa ≥ Bb =>> A ≥ Bb/a  =>>  Aa/b ≥ B

将 ② - ③ 得:

⑥ Bb ≥ Cc =>> B ≥ Cc/b  =>>  Bb/c ≥ C

将 ③ - ① 得:

⑦ Cc ≥ Aa =>> C ≥ Aa/c  =>>  Cc/a ≥ A

最终解

将 ⑤ 与 ⑥ 组合得:

⑧ Aa ≥ Bb ≥ Cc

将 ⑤ 与 ⑦ 组合得:

⑨ Cc ≥ Aa ≥ Bb

将 ⑥ 与 ⑦ 组合得:

⑩ Bb ≥ Cc ≥ Aa

求各注的金额

A + Aa/b + Aa/c = M

Bb/a + B + Bb/c = M 

Cc/a + Cc/b + C = M 

资金分配方案

A = M/(1 + a/b + a/c)

B = M/(b/a + 1 + b/c)

C = M/(c/a + c/b + 1)

同理,如果只分配2个

M = A + B

确保无论下注哪个,都不会亏本
Aa - A - B ≥ 0  =>> Aa - M ≥ 0 =>> Aa ≥ M  
Bb - B - A ≥ 0  =>> Bb - M ≥ 0 =>> Bb ≥ M  

得:
M ≥ A ≥ M/a  
M ≥ B ≥ M/b  

设:a ≥ b  
则 M/a ≤ M/b  
所以 A ≤ B  


结果:
M/a ≤ M/b ≤ A ≤ B  
M/a ≤ M/b ≤ B ≤ M  

结论:赔率相对较大的,其下注金额相对较小

web

https://licat233.github.io/lottery-calculate/index.html

lottery-calculate's People

Contributors

licat233 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.