# Packing binomial functions in a list

I would like to pack binomial functions with different parameters in a list. Here the binomial functions are defined as follows:

px[x_, k_, n_] := 1 - \!$$\*UnderoverscriptBox[\(\[Sum]$$, $$i = 0$$, $$k$$]$$Binomial[n, i] x^i\ \((1 - x)$$^$$(n - i)$$\)\)

py[y_, k_, n_] := \!$$\*UnderoverscriptBox[\(\[Sum]$$, $$i = 0$$, $$k$$]$$Binomial[n, i] y^\((n - i)$$\ $$(1 - y)$$^i\)\)


When n is given, I need to find a list

{(1/2)(px[x, k, n]+py[y, k, n]):k=0,1,...,n-1}


For example if n=2

{(1/2)(px[x, 0, 2]+py[y, 0, 2]),(1/2)(px[x, 1, 2]+py[y, 1, 2])}


and for n=3

{(1/2)(px[x, 0, 3]+py[y, 0, 3]),(1/2)(px[x, 1, 3]+py[y, 1, 3],(1/2)(px[x, 2, 3]+py[y, 2, 3])}


etc.

How can Mathematica do this automatically for me when I just give the value of $$n$$? So I am looking forwards to obtaining a list of functions, each of which is dependent on two variables $$x$$ and $$y$$

• It might be better to ask your questions one at a time – mikado Sep 27 '18 at 22:06
• @mikado I agree but I just had the idea that both questions are quite related and if one can answer the second one, which is actually the one that I am looking for, he/she would also be able to answer the first one. – Seyhmus Güngören Sep 27 '18 at 22:09
• BernsteinBasis[] is built-in, so you could just do e.g. py[y_, k_, n_] := Sum[BernsteinBasis[n, i, y], {i, 0, k}]. – J. M. is in limbo Sep 28 '18 at 0:42
• @J.M.issomewhatokay. And where can I use this? I am not able to create the lists still.. Maybe I must separate this question into two. – Seyhmus Güngören Sep 28 '18 at 14:13
• The question is now separated in to two and other part can be found here: mathematica.stackexchange.com/questions/182773/… – Seyhmus Güngören Sep 28 '18 at 14:41