Select[Tuples[{1, 1/2}, {4, 4}], Total [#] == 15]
I want to select all tuples in the result returned by Tuples
that have total of their elements equal to 15. The answer I got was only {}
. Why?
There was an excelent answer with an illustration, but I would like to point out the specific mistakes:
&
Total[#]
by default only sums on the first level, but you need more.