Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6820967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:29:20+00:00 2026-05-26T21:29:20+00:00

Related to my previous question , just wonder how to solve a system of

  • 0

Related to my previous question, just wonder how to solve a system of linear equations with non-negative integral solutions, for example:

c11*x+c12*y+c13*z=d1
c21*x+c22*y+c23*z=d2

Thanks a lot!

Edit

I meant efficiently. For example, I could have used FrobeniusSolve to get two solution lists and try to find the intersection. But sometimes, the individual solution list is probably hugely large. Or try to verify each individual solution returned by one FrobeniusSolve to see whether they satisfy all the remaining equations, but that suffers from the same drawback.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:29:21+00:00Added an answer on May 26, 2026 at 9:29 pm

    Reduce is able to solve these types of problems.

    To answer the specific case in your comment above:

    In[1]:= solns =  Reduce[x1 + 2 x2 + 5 x3 + 7 x4 == 40 &&
                            x1 + x2 + 2 x3 + x4 == 20 &&
                            x1 > 0 && x2 > 0 && x3 > 0 && x4 > 0, 
                           {x1, x2, x3, x4}, Integers]
    
    Out[1]= (x1 == 6 && x2 == 11 && x3 == 1 && x4 == 1) ||
            (x1 == 7 && x2 == 8 && x3 == 2 && x4 == 1) ||
            (x1 == 8 && x2 == 5 && x3 == 3 && x4 == 1) ||
            (x1 == 9 && x2 == 2 && x3 == 4 && x4 == 1) ||
            (x1 == 11 && x2 == 5 && x3 == 1 && x4 == 2) ||
            (x1 == 12 && x2 == 2 && x3 == 2 && x4 == 2)
    

    Edit:

    You can check that this is the same solution you get by solving the two equations separately and taking the intersection of their solutions:

    In[2]:= a = Reduce[x1 + 2 x2 + 5 x3 + 7 x4 == 40 && 
                       x1 > 0 && x2 > 0 && x3 > 0 && x4 > 0, 
                      {x1, x2, x3, x4}, Integers];
    
            b = Reduce[x1 + x2 + 2 x3 + x4 == 20 && 
                       x1 > 0 && x2 > 0 && x3 > 0 && x4 > 0, 
                      {x1, x2, x3, x4}, Integers];
    
    In[4]:= solns == Intersection[a, b]
    
    Out[4]= True
    

    And you can extract the solutions by, e.g.,
    turning the solutions into a list of replacement rules
    and applying to the variables:

    In[5]:= {x1, x2, x3, x4} /. {ToRules[solns]}
    
    Out[5]= {{6, 11, 1, 1}, {7, 8, 2, 1}, {8, 5, 3, 1}, 
             {9, 2, 4, 1}, {11, 5, 1, 2}, {12, 2, 2, 2}}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a little related to my previous question Solaris: Mounting a file system
Related to my previous question , I have a string on the following format:
This is related to my previous question I'm solving UVA's Edit Step Ladders and
This question is related to a previous question of mine That's my current code
This is related to my previous question More than 1 Left joins in MSAccess
Very much related to my previous question , but I found this to be
This is related to my previous question here . I want 4 divs (absolute
This question is related to my previous question How to generate Cartesian Coordinate (x,y)
This question is related to my previous question . The storyline: I have an
This is related to my previous question , but a different one. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.