Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

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