d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Counting
Add Reply New Topic New Poll
Member
Posts: 9,805
Joined: Jul 8 2008
Gold: 9.00
Sep 11 2014 09:02pm
Find the number of 4-lists of the form (x1, x2, x3, x4) where each xi is a nonnegative
integer and x1 + x2 + x3 + 4 * x4 = 15.

i know the equation c[(n+r-1), r) but the 4 * x4 is throwing me off a bit, wouldnt that equation over count the the max value in this case for x4 would be 3?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 11 2014 09:38pm
since it's low enough, i'd just count the range of x4 separately since x4 can only be {0, 1, 2, 3}

eg: count x1 + x2 + x3 = {15 - 4*x4} for each x4 possibility above

there's prolly some trick, but whatever :P
Go Back To Homework Help Topic List
Add Reply New Topic New Poll