Home » Ask & Discuss » Physics. » Mechanics « Back to Discussion



Mechanics

abhishek sinha's Avatar
Forum Expert
Joined: 18 Dec 2007
Post: 926
20 Jun 2008 21:27:20 IST
0 People liked this
0
456 View Post
A simple problem to solve - Feynmann
None

I know that it is not the right place to ask , still I need it badly


 



First of all please remember that this is not an IIT problem or challenge that I have posted earlier .




 


I am currently working on my thesis paper for my 2nd year engg. course . ( meant to be submitted as early as possible , e.g. by August )




 


Now , all the necessary algorithms and calculations have already been worked out by me but at one place I have got stuck ......................




 


To numerically simulate my algorithm , I need a solution of the following problem .




 


suppose x1, x2 , .....xm are variables that take integer values in the range 0 to ( k-1 ) ,




 


Now list all the possible solution of the eqn




 


                x1 + x2 + .............. + xm = k




 


I need a code ( or mere algorithm would also suffice ) that take the values of (k and m ) during runtime from the user and displays ALL the possible solutions on the screen .




 


Plz help me !!




 


Plz note that a brute force solution is also acceptable as I don't need to submit the program !!




 


The tricky business that is present here is to run a variable no of 'for' loops . Give it a try .




 


Share this article on:

Quick Reply


Reply

Some HTML allowed.
Keep your comments above the belt or risk having them deleted.
Signup for a avatar to have your pictures show up by your comment
If Members see a thread that violates the Posting Rules, bring it to the attention of the Moderator Team
Free Sign Up!

Preparing for IIT-JEE ?

Arihant Revision Package for IIT JEE - Books, Practice Tests + Rank Predictor


@ INR 1,995/-

For Quick Info

Name

Mobile No.

Find Posts by Topics

Physics.

Topics

Mathematics.

Chemistry.

Biology

Parents

Board

Fun Zone

Sponsored Ads