in Combinatory retagged by
326 views
2 votes
2 votes
How many integral solutions exist for the system of equations x+y+z =15 where 0<=x,y,z<=10 ?

 Ans given is 620. I am getting 91

Could someone point out the flaw in the below logic?

Mehod Used : There are 10 stars and 3 bins with multi choose 17C2  = 136

Invalid Solutions (Any of them assigned  >=11 ) 3C1 * N( x+y+z = 4) => 3*6C2 = 15 *3 =45

136-45=91
in Combinatory retagged by
by
326 views

1 Answer

1 vote
1 vote
Hey your answer is correct : 91 is the correct anser ( No need to worry )

I already checked it with c++ code

#include<bits/stdc++.h>
using namespace std;
int main(){
               int res = 0;
               for(int x = 0 ; x <= 10 ; ++x ){
                  for(int y = 0 ; y <= 10 ; ++y ){
                     for(int z = 0 ; z <= 10 ; ++z ){
                       if(x + y + z  == 15 )
                        ++res;
                     }
                  }
               }

               cout << res;
}

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true