# How do I input n-Dimensional random numbers into a function accepting n variables [closed]

Apologies if this is overly simple but I wasn't able to find an answer online.

## Question

Say I have a function defined as follows (and not two separate instances of random numbers),
f[x_,y_]:=x y


How can I input a set of 2 dimension random numbers into this function. Note that I want to generate a 2 dimension random number as follows,

RandomReal[{min, max}, {n, 2}]]


The problem is that RandomReal generates a list of lists as such

{{x_1,y_1},{x_2,y_3},...{x_n,y_n}}


And I cannot input this into the function. I also wanted to repeat this a bunch of times with a Table.

This is what I tried which obviously doesn't work,

Table[f[RandomReal[{min, max}, {n, 2}]]],{n,1,100}]


Thanks for any and all help!

• There's actually a shorthand syntax for this! you're looking for Table[f @@@ RandomReal[{min, max}, {n0, 2}], {n,1,100}], I think. in general f @@@ { {a,b,c, ... }, {d,e,f, ...}, ...} is {f[a,b,c, ...], f[d,e,f, ...], ...}. (assuming I'm interpreting what you want correctly, ofc) Jul 10, 2021 at 8:33
• Oh yes! That does work, thanks a lot. Jul 10, 2021 at 13:02
• You might also look into defining your function as Listable; however, thorimur's recommendation seems to be a more directly applied suggestion. Jul 11, 2021 at 15:02