Consider the following dot products. Thanks to tips from you guys i’ve managed to create the lists I need. Now all I need is a way to maximize the dot product shown below ( p:=a.as + b.bs ) under constrain that s:=a.an + b.bn <= 400 .
a = RandomSample[{0, 1, 0, 0, 0, 0}];
as = { 3, 1, 4, 5, 5, 8};
an = {100, 50, 100, 150, 50, 100};
ans = {a1, a2, a3, a4, a5, a6};
b = RandomSample[{0, 1, 1, 0, 0, 0, 0, 0}];
bs = {3, 5, 1, 6, 8, 5, 5, 10};
bn = {100, 200, 150, 50, 150, 200, 50, 150 };
bns = {b1, b2, b3, b4, b5, b6, b7, b8};
p := a.as + b.bs
s := a.an + b.bn
a.an + b.bn <= 400
I’ve tried the following
Maximize[{p , s <= 400}, p]
It returns
Maximize[{16, True}, 16]
saying 16 isn’t a valid variable.
i think my function definition if off?
Any help is greatly appreciated