|
-
Aug 16th, 2005, 06:32 AM
#1
Thread Starter
New Member
I Failed Maths
Any help to my current dilemma would be gratefully received.
I have the following scenario:
Profit Odds Horse A -66.26 1.70
Horse B +48.73 1.86
Horse C +82.73 11.50
Horse D +6.73 7.00
Horse E -47.27 18.00
I have to work out what the next bet on each horse would be so that the profit is equal for each and every horse. The problem is they are all interdependent so when I bet 20 on horse A it reduces the profit on all the other horses by 20 (Horse B becomes 28.73, Horse C 62.73 etc). As a result I keep going round in circles.
I thought this would be easy but I am stuck. Can anyone point me in the right direction.
Many Thanks,
Scott
-
Aug 17th, 2005, 05:55 AM
#2
PowerPoster
Re: I Failed Maths
Hi,
I may be dumb about this but I need more information!
Are all the horses in the same race so that you want to back all the horses and come out winning?
Are the horses in separate races and you are relying on picking the winner in each race?
Are you making the book on a race and want to make sure you make a profit whichever horse wins?
I don't understand your "Odds" column. In the UK we would show odds as:
7 to 1 against (bet 1 to win 7 + your stake return)
7 to 1 on (bet 7 to win 1 + your stake return)
Evens ( bet any amount to win the same amount + your stake return)
Also, you do not show how much you have bet on each horse.
(You had better hurry up or the race will be over )
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 17th, 2005, 06:41 AM
#3
Thread Starter
New Member
Re: I Failed Maths
(You had better hurry up or the race will be over  )
Nice one, made me smile!
Taxes,
No, you are not dumb, I just have trouble making my self clear. Forgive me if this is too long but I will try to give as much information as possible.
Firstly the odds are decimalised and net of the stake. In my example 7.0 should actually be 8.0 which equates to 7 to 1.
The horses are all in the same race and I want to make a profit regardless of which horse wins (or conversely minimise my losses regardless of which horse wins). So yes I would like to make a "book".
The amount bet so far on each horse is implied by the profit column. I don't know the individual bets just the cumulative outcome of all bets, which are shown in the profit column.
I appreciate your reply. If you need any more information I will post a reply as soon as I am able.
Even if you can't solve it, I would appreciate any help or advice of where on the web to look and under what topic to look.
Many thanks,
Scott
-
Aug 17th, 2005, 04:10 PM
#4
PowerPoster
Re: I Failed Maths
Hi,
From what you now say I assume you are making a book on the race. i.e. you are acting as though you are accepting bets on the race.
Consider this. First you need to work out how much minimum profit you want to make. You need to work out the amount you stand to lose on each horse if it wins. Then You need to work out how much you win on each horse if it loses. You can then adjust the odds to reflect the profit you want. To do that you have to keep a running record of the amount of bets placed at what odds.. You will have to keep a record of each bet anyway, so use a two dimension array to keep the values: something like arrBets(100,4)
Each line represented by the first dimension will contain all the required information on one ber. The second dimension elements will contain:
arrBets(0,0) Contains the Horse ID
arrBets(0,1) ,, Punter ID
arrBets(0,2) ,, Amount of the bet
arrBets(0,3) ,, Odds applicable
arrBets(0,4) ,, Amount to be paid out (Winnings + Stake)
You can then use that array to calculate the amounts you require to know.
e.g.
In arrHorse(8,1) (Assumes 9 horses with ID's from 0 to 8
arrHorse(0,0) Contains the total bet on the horse
arrHorse(0,1) Contains the total to be paid out if the horse wins
arrHorse(0,2) Contains the latest odds
Dim iCount As Integer
For iCount = 0 to 100
arrHorse(arrBets(iCount,0),0) +=arrBets(iCount,2)
arrHorse(arrBets(iCount,0),1) +=arrBets(iCount,4)
iTotalBets +=arrBets(iCount,2)
Next iCount
For iCount = 0 to 8
iNetProfit=iTotalBets-arrHorse(0,1)-arrHorse(0,1)
MessageBox.Show("Net Profit if winner is Horse No. " & iCount.ToString & " is " & iNetProfit.ToString
Next iCount
See if you can progress from there. 
Come to think of it, it would be easier to do this using Excel, assuming you are conversant with automation. You can do this from within VB.NET.
OOPS!! I see you are using VB4. I'm afraid I can't be any help with that.
Last edited by taxes; Aug 17th, 2005 at 06:00 PM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 18th, 2005, 03:48 AM
#5
Thread Starter
New Member
Re: I Failed Maths
Cheers for the reply Taxes. Gives me a new angle to think about.
I am doing this in excel and ideally I am looking to program a formula that would return the best possible outcome regardless of which horse won.
-
Aug 18th, 2005, 07:08 AM
#6
PowerPoster
Re: I Failed Maths
Hi
If you are using VBA in Excell then I'm afraid I can't help.
If you mean you want to use ONLY a spreadsheet then you could do that but it would be rather clumsy. You would have to have each bet recorded in a separate cell, also each potential winnings including stake.
But using Excell, whichever way, will simplify the calculation of the results you want.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 18th, 2005, 09:40 AM
#7
PowerPoster
Re: I Failed Maths
Hi,
I've tried out some ideas on this in Excell. You can do everything you need in the spreadsheet except the calculation and allocation of the potential winnings on each bet/horse. You will need some VB (or VBA) code to accomplish that.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 18th, 2005, 11:18 AM
#8
Thread Starter
New Member
Re: I Failed Maths
Hi Taxes,
Can you e-mail me your spreadsheet? It might give me a few ideas I haven't thought about.
Cheers for your help in this anyway.
Regards,
Scott
Last edited by TGM1; Aug 18th, 2005 at 11:19 AM.
Reason: Corrected spelling
-
Aug 18th, 2005, 04:41 PM
#9
PowerPoster
Re: I Failed Maths
Hi,
Are you going to fix everyone's odds at the starting price or are you going to use ante-post betting? If the latter, you are going to need a lot more VBA
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 19th, 2005, 03:49 AM
#10
Thread Starter
New Member
Re: I Failed Maths
Hi Taxes,
I've already got most of the code in place. If I can get this solved to a simple formula then I can code it in.
Cheers,
Scott
-
Aug 19th, 2005, 05:49 AM
#11
PowerPoster
Re: I Failed Maths
HI,
I don't think there will be a simple formula. You will have to do it by iteration and if you are taking the bets you won't be able to guarantee your position unless you decide on the amount of the next bet. Briefly, your spreadsheet will have columns for the Horse ID; Total Staked (on each horse); Amount to be paid if horse wins (excluding the stake); Existing Odds (the Total Payments liable divided by the amount staked); Future Bet; Future Target Winnings.
The odds for the first bet on each horse will be an intelligent guess (if 8 horses, give each horse odds of 8-1 unless you want to allow for favourites.)
Thereafter you can calculate the effect of an additional, say, £5. bet on each horse and adjust the odds on each horse to reflect that effect. As far as I know it is not an exact science and is done by iteration. Perhaps someone else knows differently. If you were very good at maths, then I suspect that you could use the process called Integration, which is a complicated way to do iteration.
Before I can go any further, I would need tha answers to my previous post.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 21st, 2005, 05:42 AM
#12
Thread Starter
New Member
Re: I Failed Maths
Hi Taxes,
In answer to your previous post, all odds would be fixed at the starting price.
Cheers, Scott
-
Aug 21st, 2005, 01:06 PM
#13
PowerPoster
Re: I Failed Maths
Hi,
Oh.. Then all of a sudden it becomes easy. At any time add up all your stakes and subtract the amount of profit you want to make. The result is the amount you are willing to pay out. We will call it "P".
For each horse, subtract the amount of money staked on that horse from P (call the result "N") and divide N by the amount of money staked on that horse. The resulting figure is the odds for that horse.
You can do that very easily in Excell without using any VBA or you can do it easily in VB
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 22nd, 2005, 05:14 AM
#14
Thread Starter
New Member
Re: I Failed Maths
Using Excel I have worked out that the best possible outcome is a £3.81 loss on each horse.
-
Aug 22nd, 2005, 05:47 AM
#15
PowerPoster
Re: I Failed Maths
Hi,
Send me your excel file and I will see what I can do with it
[email protected]
EDIT.
Let me have your e-mail address and I will send you my attempt. You cand decide how much profit you want to make on each race.
Just enter the amount bet on each horse and fill in the amount of profit you want to make.
You could add a column in line with each horse to accept the next bet but you would need some VBA code to add it to the Total Staked on that horse.
Last edited by taxes; Aug 22nd, 2005 at 06:06 AM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 22nd, 2005, 06:11 AM
#16
Thread Starter
New Member
Re: I Failed Maths
Hi Taxes,
I've just sent you the file.
Cheers,
Scott
-
Aug 22nd, 2005, 08:36 AM
#17
PowerPoster
Re: I Failed Maths
HI,
Got it but am having difficulty in following your logic. It seems too complicated. Have a look at my effort. (Sent to you now)
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Aug 23rd, 2005, 06:21 AM
#18
Thread Starter
New Member
Re: I Failed Maths
Hi Taxes,
I think that's it!
Many thanks,
Scott
-
Aug 23rd, 2005, 10:14 AM
#19
PowerPoster
Re: I Failed Maths
Hi,
You're welcome.
I'm just glad you did not want antepost betting
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|