# Evaluating list inside list in a table [closed]

I'm stuck with a List and Table command. I want to evaluate $$F[x,y]$$ and get all the possible configurations, knowing that x and y are lists. How I should evaluate this correctly in Mathematica? and thanks in advance!

F[x_, y_] :=Flatten[Table[{a, b, c, d}, {a, 1, 2}, {b, 0, x - a + 1}, {c, 1, 2}, {d, 1, y - 1}], 3]; x = {14, 9, 7, 5, 10}; y = {1, 3, 2, 4, 5};

• If you want all possible combinations of list elements what is typically useful is Outer, e.g.: Flatten[Outer[List, {1, 2}, x, {1, 2}, y], 3]. Does this give the output you want? – Andrzej Jun 7 at 18:46
• Andrzej, I think Flatten[Outer[F, x, y], 2] is another good answer to the problem. Why don't you add it? – Jack LaVigne Jun 8 at 15:01

I am assuming that you want integers as the input to the function F[x_,y_] and that you want to apply them to all combinations of the lists, x and y.
Continue on with your use of Table and apply it to x and y. Table is very powerful and can accept lists in addition to iteration parameters.
Table[F[x, y], {x, {14, 9, 7, 5, 10}}, {y, {1, 3, 2, 4, 5}}]

• Wrap the result with another Flatten. Flatten accepts a third argument indicating how many times it should be applied. Flatten[Table[F[x, y], {x, {14, 9}}, {y, {3}}], 2] – Jack LaVigne Jun 7 at 19:53