Results 1 to 19 of 19

Thread: I Failed Maths

Hybrid View

  1. #1
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width