What I was thinking so far is this:
A=[1,6];
B1=[1,2];
B6=[1,2,3,4,5,6];
wi1=[0,10];
wi6=[0,10,11,12,13,14];
Bi1=[0.1,0.9];
Bi6=[0.1,0.2,0.3,0.4,0.5,0.6];
But as to the actual equation, and how to run it through, I am lost. I have a feeling that a loop or two is involved, but I do not know how to apply that at all.