OZmium Sports Betting and Horse Racing Forums

OZmium Sports Betting and Horse Racing Forums (http://forums.ozmium.com.au/index.php)
-   Horse Race Betting Systems (http://forums.ozmium.com.au/forumdisplay.php?f=10)
-   -   Calculating Quinella bets (http://forums.ozmium.com.au/showthread.php?t=18225)

Michal 29th October 2008 08:04 AM

Calculating Quinella bets
 
Hi,

I always thought of my self as inteligent, well untill today LOL. Im trying to write a program that calculates the cost of quinella and I cant figure out the formula.

could someone help me work out this
1
1,2,3,4,5,6,7

1,2,
1,2,3,4,5,6,7

1,2,3
1,2,3,4,5,6,7

1,2,3,4
1,2,3,4,5,6,7

1,2,3,4,5,
1,2,3,4,5,6,7

1,2,3,4,5,6
1,2,3,4,5,6,7

1,2,3,4,5,6,7
1,2,3,4,5,6,7

they are supposed to cost

$6
$11
$15
$18
$20
$21
$21


I cant figure out the correct algorithm that will produce these outcomes. I also feel quite stupid at the moment :)

Thanks

Michal

Michal 29th October 2008 08:38 AM

Hi ,


Figured it out myself I had to write a little thingy others might like it

Qx = number of selections in top row
Qy = number of selections in second row

TempQcost = 0
QCost = 0

For QCalc = 1 To Qx

TempQcost = 1 * Qy - 1
QCost = QCost + TempQcost
Qy = Qy - 1

Next QCalc

That is it, once the calculation comes out of the loop the Quinella (QCost) is calculated correctly I think.

I also feel quite smart again :)

Michal


All times are GMT +10. The time now is 05:51 AM.

Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.