# How to flatten all brackets (i.e. to get separated elements as output)? [duplicate]

I have a = {1, 2, 3}, and want to obtain Multinomial[1, 2, 3], which is 60.

But when I input Multinomial[a], the input a is the entire list so I got {1, 1, 1}. That is, I need to separate a from a single list into separated elements so that I can input them correctly.

Multinomial[Flatten[a]] also doesn't work, since the last bracket can't be removed by Flatten. What can I do?

Thanks!

• Multinomial @@ a, which in full form would be Apply[Multinomial][a] or Apply[Multinomial, a]: look up Apply. Think of Apply as changing the head of an expression, in this case from List to Multinomial. Tangentially, the arguments to Multinomial should be a Sequence. – MarcoB Apr 30 '18 at 2:03
• For completeness, since you are changing the head, you could also use a /. List -> Multinomial However, solution provided by @MarcoB is preferrable. – Bob Hanlon Apr 30 '18 at 2:41
• Thanks. Tried all these methods and solved the problem. – H42 Apr 30 '18 at 4:20

list={1,2,3};

Multinomial@@list