Member Search

Problem Statement

After years of research and development, your firm has developed a new product; one so fantasic that everyone will have to have one once they realize how great it is. Unfortunately for you, a competing company is also bringing a similar product to market. There is no reason for anyone to have both your product and your competitor's and market research suggests that people slightly prefer your competitor's product, so you will need to out-manuever them if you want to be successful.

Lucky for you, your competitor thinks their product is so amazing that they don't need to advertise. If you play your cards right, you may be able to turn a handy profit yet.

In this problem, you need to dynamically determine where to locate ads to maximize your profit. Each person will be located at a point in two dimensions. A simulation will then occur over a number of time steps. At the beginning of each time step, you may place advertisements at particular locations, which will have an effect for that timestep only. Each person will be influenced by three factors: the prior preference for your competitor's product, the influence of your advertising, and the influence of other people who have already purchased one product or the other.

More specifically, a person P will start with a weight wP = competitor < 0. For every other person who has purchased a product, the distance d from that person to P will be computed. The weight will then be adjusted up or down by C*(d+500)-2 (up if the person uses your product, down if he uses your competitor's). Next, for each advertisement you place, the distance d from that ad to P will be computed and the weight will be increased by D*(d+500)-2. At each time step, each person P will select a value xP as -ln(1/r-1), where r is a uniform random variable in (0,1). Each person with a difference between xP and wP greater than 8 will be selected. If xP is smaller than wP, the person will buy your product, otherwise the person will buy your competitor's product. The result of all this is that the higher the magnitude of a person's weight, the more likely that person is to buy a product in the next timestep. For instance, a person with a weight of 0 will buy your product with probability 3.4E-4 and your competitor's with the same probability, while a person with weight 2 will buy your product with probability 2.5E-3 and your competitors with probability 4.54E-5.

The initial locations of the N people will be chosen from K normal distributions, each with a weight si chosen as r2, where r is a uniform random variable in (0,1). Each distribution will have independently chosen standard deviations in the x and y directions from the range (200,1200), along with means chosen independently in (0,10000) for each coordinate. A person will be chosen from distribution i with probability proportional to si.

You will first be given the locations of all the people in the simulation, along with some of the parameters of the simulation, and you should return an int (which will be ignored). The update method will then be called repeatedly, telling you which people bought which products. Element i of index gives the 0-based index into x and y, and element i of product tells which one they purchased (1 for your's, -1 for your competitor's). You should then return your advertising scheme for the next time step. Each element of the returned String[]'s should be formatted as "<x> <y>". The first time the update function is called, the arrays will have size 0, as no one has bought either product before the start of the simulation.

For each ad you place in each timestep, a cost $adCost will be incurred. For each person that buys your product, you will make a profit of $1. Your goal, naturally, is to maximize your overall profit. Your overall score will simply be the average of you profit on all the test cases.

Notes

If no one buys any product during one step of the simulation, the simulation will be rerun for that timestep, until at least one person purchases a product.

-

Negative scores will be increased to 0.

-

If you place more than N/adCost ads, the simulation will terminate, and you will receive a 0.

-

While you can test the examples in the visualizer by entering the seeds 1..10, you may also download the locations of the people from http://www.topcoder.com/contest/problem/Advertising/ex0, http://www.topcoder.com/contest/problem/Advertising/ex1 ...

This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.