# Is there a way to use array of data as a function variable?

I have a data that looks something like.

{{1,1},{12,1},{7,9},{10,14}, ...... }


I want to see if there is an easy way to apply this array of data into a function like the following:

f:= Beta[1+a,1+b]Beta[12+a,1+b]Beta[7+a,9+b]........


so that I will not have to type them all in

• You could also consider Product[Apply[Beta, {a, b} + args], {args, list}]. Commented Jul 17, 2015 at 5:31

You mean like this?

Times @@ Map[ Beta[First[#] + a, Last[#] + b] &, {{1, 1}, {12, 1}, {7, 9}, {10, 14}}]

• This worked perfectly! thx! Commented Jul 27, 2015 at 21:44
f[a_, b_] :=
Fold[#1*Beta[#2[[1]] + a, #2[[2]] + b] &,
1, {{1, 1}, {12, 1}, {7, 9}, {10, 14}}]

f[a, b]


Beta[1 + a, 1 + b] Beta[7 + a, 9 + b] Beta[10 + a, 14 + b] Beta[12 + a, 1 + b]

Or this

d = {{1, 1}, {12, 1}, {7, 9}, {10, 14}};
Times@@Beta @@@ (# + {a, b} & /@ d)


Beta[1 + a, 1 + b] Beta[7 + a, 9 + b] Beta[10 + a, 14 + b] Beta[ 12 + a, 1 + b]

Or if you want a,b,d and Beta all to be parameters to a function f:

f[a_, b_, fn_, d_] := Times@@fn @@@ (# + {a, b} & /@ d)
f[h, i, Beta, {{1, 7}, {2, 8}, {4, 5}}]


Beta[1 + h, 7 + i] Beta[2 + h, 8 + i] Beta[4 + h, 5 + i]

• Forgot to multiply 'em all. ;) Commented Jul 17, 2015 at 5:30
• Damn, thank you :) Commented Jul 17, 2015 at 5:31

More ideas for you:

in = {{1, 1}, {12, 1}, {7, 9}, {10, 14}};

Times @@ Inner[Plus, in, {a, b}, Beta]

Times @@ (Beta[# + a, #2 + b] & @@@ in)

Times @@ MapThread[Beta, in\[Transpose] + {a, b}]