0
$\begingroup$

Below is a table that describes what the predicted return is in each channel. The way to read the table is: If you spent 30K on Advertising, you should expect to get 1200 leads. If you instead spent $50K, you should expect to get 1600 leads. see table

If you had $40K to spend how would you allocate spend? The obvious answer is 30K RnD and 10K Advertising. But I'm seeking for the exact numbers, not the ones on the table. Plz, help!

  • 0
    How often can one book an option? This will also influence the optimal solution (see my answer below).2017-02-12
  • 0
    Only one time for each channel. Imagine we are at a meeting looking at this table and deciding how we'll allocate our budget. I'm not familiar with R, but if the max. number have to be the discrete values of the table, then it's not what we are looking for.. Thank you very much for the answer. I'll try to understand your interpolating method (I come from marketing background)2017-02-12
  • 0
    The solution I gave is not interpolating. It rather goes through all $2^{10}=1024$ combinations of allocating one or more of the $10$ table entries.2017-02-12
  • 0
    About the interpolation: Can you spend 15K on advertising? Would it generate something between $500$ and $900$ leads?2017-02-12
  • 0
    Yes, you can spend anywhere between the given values. I was thinking about getting two linear or logarithmic functions (whatever fits better the plot), having x1 + x2 = 40K (Where x1: advertising budget, x2: RnD budget). Then we are interested in the MAX. of the combination of these functions, given x1+ x2 = 40. This is where I don't know what to do - I take the 2nd derivative but it doesn't seem to work. I guess my thinking is wrong2017-02-12

1 Answers 1

0

Here is an image for the advertising and R&D:

enter image description here

These are no linear relations each.

Continuous Problem:

Assuming we had differentiable functions $a(x)$ and $r(x)$ which take a price $x$ and give the resulting yields. Then the total yield is $$ y(x_a, x_r) = a(x_a) + r(x_r) $$ We have the constraints: $$ x_a \ge 0 \\ x_r \ge 0 \\ x_a + x_r \le 40 $$ As the functions are supposed to be increasing, we think the maximum is on the line $$ x_a + x_r = 40 $$ and therefore $$ y(x) = a(x) + r(40-x) $$ is a function of one variable. Then critical points are at: $$ 0 = y'(x) = a'(x) - r'(x) \iff \\ a'(x) = r'(x) $$

Discrete Problem:

We can formulate the problem as an integer linear program:

$$ x = (n_1^a, n_2^a, n_3^a, n_4^a, n_5^a, n_1^r, n_2^r, n_3^r, n_4^r, n_5^r)^\top \in \mathbb{N}_0^{10} $$ so the variables are the number of times we book advertising or R&D.

The resulting leads go into the cost vector: $$ c = (500, 900, 1200, 1450, 1600, 1000, 2000, 2500, 2700, 2900)^\top $$ so the achieved leads are $$ c^\top x = \sum_{i=1}^{10} c_i x_i $$ Now the constraints. We have a limited budget: $$ a^\top x \le 40 \\ a = (10, 20, 30, 40, 50, 10, 20, 30, 40, 50)^\top $$ and we want non-negative integer solutions: $$ x \le 0 \\ x \in \mathbb{Z}^{10} $$ So our ILP is $$ \max \{ c^\top x \mid a x \le 40, x \ge 0, x \in \mathbb{Z}^{10} \} $$

Solving this with lpSolve:

We are doing this in R, using the lpsolve solver:

> install.packages("lpSolve")
> install.packages("lpSolveAPI")
> library(lpSolveAPI)

Allocating $10$ variables:

> lprec<-make.lp(0,10)

Setting the objective function:

> set.objfn(lprec, c(500,900,1200,1450,1600,100,2000,2500,2700,2900))

Adding the constraint on budget:

> add.constraint(lprec, c(10,20,30,40,50,10,20,30,40,50),"<=", 40)

Asking lpsolve to maximize:

> lp.control(lprec,sense="maximize")

Solving:

> solve(lprec)
[1] 0
> get.objective(lprec)
[1] 4000
> get.variables(lprec)
 [1] 0 0 0 0 0 0 2 0 0 0

Ok. This maximal solution $x = (0,0,0,0,0,0,2,0,0,0)^\top$ means booking two times R&D for 20K each, giving $4000$ leads.

Now we limit the variables to be zero or one:

> set.type(lprec,1,"binary")
> set.type(lprec,2,"binary")
> set.type(lprec,3,"binary")
> set.type(lprec,4,"binary")
> set.type(lprec,5,"binary")
> set.type(lprec,6,"binary")
> set.type(lprec,7,"binary")
> set.type(lprec,8,"binary")
> set.type(lprec,9,"binary")
> set.type(lprec,10,"binary")

and get:

> solve(lprec)
[1] 0
> get.objective(lprec)
[1] 3000
> get.variables(lprec)
 [1] 1 0 0 0 0 0 0 1 0 0

which means $10K$ advertising and $30K$ R&D, yielding $3000$ leads. Which is the OP's obvious answer.