Problem: A person spends 15 dollars at the store. Eggs cost 1 dollar. Milk costs 2 dollars and bread costs 3 dollars.
I'm attempting to create a list of all possible integer solutions to the problem. I attempted to solve the problem with the solve function
Solve[e 1 + m 2 + b 3 == 15 && e > = 0 && m >= 0 && b >= 0, {e, m, b}, Integers]
I'm not solving this exact problem. In theory its the same thing except a lot bigger. The above code works and produces an answer, but I get stuck in the larger calculation. Should I go about solving the problem another way? If so how?
Comments
Post a Comment