Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.4K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Permutations with deleting rows inside a table?

Posted 8 years ago

Hello.

f[sum_, quant_] := 
 Flatten[Permutations /@ 
   IntegerPartitions[sum, {quant}, Range[0, sum]], 1]
t = {10, 20};
Table[Join[Table[{n - j}, {i, j + 1}], 
  Table[{t[[1]], t[[2]]}, {i, j + 1}]*
   f[j, 2], {Total[Table[{t[[1]], t[[2]]}, {i, j + 1}]*f[j, 2], {2}]},
   2], {j, 2, 2}]

I want to generate the matrix of all possoble outcomes. The problem is I cannot add forth column with the sum of rows of second and third columns. I guess this is because my total go with {20,30,40} at the time I need {{20},{30},{40}} After all I want to delete all columns inside a table which do not satisfy the candition using something like that

Select[Table..., #[[4]] <= t[[1]](3-j) + t[[2]]-n-j &] 

Regards,

Alex

POSTED BY: Alex Graham
Anonymous User
Anonymous User
Posted 8 years ago
POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard