Let's say I have two lists $L_1=\{a_1,...,a_5\}$ and $L_2=\{b_1,...,b_10\}$. Is there an easy way to make new lists from convex combinations of these two lists' entries? Let me be more specific:
1 Suppose the two lists $L_1,L_2$ are of equal length $n$; how do I create a new list whose entries are linear combinations of the entries in $L_1,L_2$? I first defined $f(x)=wx$ and $g(x)=(1-w)x$ and then used Map[(# + Map[f, list1]) &, {Map[g, list2]}]
. This works but it's not very neat, is there another way? (Let's call such a hypothetical neat function $u$.)
2 Now let's go back to the lists of unequal length. I wanna be able to apply $u$ to sublists of $L_1$ and $L_2$ of length at most five. One could of course delete entries from the lists in question and then apply $u$, but I'm thinking there's gotta be a better way, but how? That is to say, how do I make a function where I can specify to map the first two entries of each list to a 2-list (producing the list $\{wa_1+(1-w)b_1,wa_2+(1-w)b_2\}$), or to map the second and third entries of each list to a 2-list? (producing the list $\{wa_2+(1-w)b_2,wa_3+(1-w)b_3\}$). On this one I'm completely lost.
Thanks in advance :)
EDIT: With h[x_,y_]:=wx+(1-w)y
, Apply[h,{list1,list2}]
answers question 1.