Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Basic Algorithm Help

  • 22-06-2012 10:24PM
    #1
    Registered Users, Registered Users 2 Posts: 204 ✭✭


    Hi guys,

    I wonder if anyone could any help me come up with a function for a program im writing?

    So essentially I have 3 groups of customers,

    1. Prefer to buy low priced Items
    3. Prefer to buy high priced Items
    2. Between 1 & 3

    I then have a list of items which can have any price, so I need to work out a % chance of the customer buying the item.

    Examples

    Customer category 1 - Item price €1 = High chance to buy
    Customer category 1 - Item price €100 = low chance to buy
    Customer category 3 - Item price €1 = Low chance to buy
    Customer category 3 - Item price €100 = High chance to buy

    They dont need to be based on the actual amounts, just that the lower the price the more chance customer category 1 will buy it, the higher the price the higher the chance customer category 3 will buy it and 2 being in the middle ground.

    Any help would be appreciated.

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 1,082 ✭✭✭Feathers


    RichieD wrote: »
    Hi guys,

    I wonder if anyone could any help me come up with a function for a program im writing?

    So essentially I have 3 groups of customers,

    1. Prefer to buy low priced Items
    3. Prefer to buy high priced Items
    2. Between 1 & 3

    I then have a list of items which can have any price, so I need to work out a % chance of the customer buying the item.

    Examples

    Customer category 1 - Item price €1 = High chance to buy
    Customer category 1 - Item price €100 = low chance to buy
    Customer category 3 - Item price €1 = Low chance to buy
    Customer category 3 - Item price €100 = High chance to buy

    They dont need to be based on the actual amounts, just that the lower the price the more chance customer category 1 will buy it, the higher the price the higher the chance customer category 3 will buy it and 2 being in the middle ground.

    Any help would be appreciated.

    Thanks

    Not sure if it is as simple as this, but from what you described above, could you not do something like:
    double likelyhoodToBuy;
    switch(customerType) {
        case Customer.CHEAP:    likelyhoodToBuy = 100 - (itemPrice * (100/1)); 
                                break;
        case Customer.MODERATE: likelyhoodToBuy = (itemPrice * (100/1)) / 2;
                                break;
        case Customer.LAVISH:   likelyhoodToBuy =  itemPrice * (100/1);
                                break;
    }
    
    return likelyhoodToBuy;
    
    


  • Registered Users, Registered Users 2 Posts: 1,717 ✭✭✭Raging_Ninja


    This seems like a bayesian analysis problem. The free online stanford AI course does something similar regarding spam detection, if you want to take a look you can find it here.


Advertisement