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 3322168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:09:00+00:00 2026-05-17T23:09:00+00:00

I have the following inequalities on 21 variables: http://pastebin.com/raw.php?i=FTU970Em When I run Reduce[ineq,Integers] on

  • 0

I have the following inequalities on 21 variables:

http://pastebin.com/raw.php?i=FTU970Em

When I run “Reduce[ineq,Integers]” on this, Mathematica hangs for a
long time.

That makes sense: there are MANY sets of values for x[1]..x[21] that
satisfy the inequalities.

All I really want is bounds for each variable (eg, “2 <= x[i] <= 7”
for each i).

How can I get this efficiently w/ Mathematica? Is there a better
program for this?

Note: this is part of the larger project:

Partially re-create Risk-like game based on incomplete log files

The entire hideous list of inequalities: http://pastebin.com/CyX9f70J

Running “Reduce[ineq,Integers]” on the above yields “false”, so I’ve
probably incorrectly translated:
http://conquerclub.barrycarter.info/ONEOFF/7460216.html

  • 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-17T23:09:00+00:00Added an answer on May 17, 2026 at 11:09 pm

    It’s late enough that there are probably a number of slick reductions, but this works…

        ineq={...};
        pivotAt[set_, j_] := Select[set, And[
                Not[FreeQ[#, x[u_] /; u <= j]],
                    FreeQ[#, x[u_] /; u > j]
            ] &]
        triangularize[set_] := Module[{left, i, new},
            left = set;
            Reap[
                For[i = 0, i <= 21, i++,
                    new = pivotAt[left, i]; 
                    Sow[new];
                    left = Complement[left, new];
            ]][[2, 1]]
        ]
        Module[{
            tri,
            workingIntervals,
            partials, increment, i
            },
    
            tri = triangularize[ineq];
    
            workingIntervals[set_] := set /. {
                t_ <= c_ :> {t, Interval[{-\[Infinity], Max[c]}]},
                t_ == c_ :> {t, Interval[{Min[c], Max[c]}]},
                t_ >= c_ :> {t, Interval[{Max[c], \[Infinity]}]}};
    
            partials = {};
            increment[slice_] := 
                Rule[#[[1, 1]], IntervalIntersection @@ #[[All, 2]]] &[
                    workingIntervals[slice /. partials ] ];
            For[i = 1, i <= Length[tri], i++,
                partials = Join[partials, {increment[tri[[i]]]}];
            ];
            partials
        ]
    

    It’s permissive in that correlations between variables (“this high means that low”) are not accounted.

    — EDIT —

    The result of the above is, of course

    {x[0] -> Interval[{3, 3}], x[1] -> Interval[{1, 3}], 
     x[2] -> Interval[{1, 3}], x[3] -> Interval[{1, 3}], 
     x[4] -> Interval[{1, 3}], x[5] -> Interval[{1, 6}], 
     x[6] -> Interval[{1, 6}], x[7] -> Interval[{1, 6}], 
     x[8] -> Interval[{1, 6}], x[9] -> Interval[{1, 6}], 
     x[10] -> Interval[{1, 6}], x[11] -> Interval[{1, 6}], 
     x[12] -> Interval[{1, 6}], x[13] -> Interval[{1, 6}], 
     x[14] -> Interval[{1, 10}], x[15] -> Interval[{1, 10}], 
     x[16] -> Interval[{1, 10}], x[17] -> Interval[{1, 16}], 
     x[18] -> Interval[{1, 16}], x[19] -> Interval[{1, 16}], 
     x[20] -> Interval[{1, 16}], x[21] -> Interval[{1, 1}]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have following url structure http://www.mydomain.com/vpn-offers-p3.html this page should be redirect to http://www.mydomain.com/vpn-offers.php?st=60&page=3 here
I have following url: http://localhost.com/phpdemo/bid/tf/red ? This url redirects through This [ $route['tf/red?'] =
I have following scenario: The Android clients communicate with a PHP server via HTTP
I have following class. In this, Iris is another class with some attributes. public
I have following table it shows like this: ABC A B C 123 Hello
I have following function which is called continuously from run() of a Thread which
I have following query in my project, $values = array(test=>value) $this->_db->update(tablename,$values,array('id = ?'=> $data['id'],'wid
I have a few inequalities regarding {x,y} , that satisfies the following equations: x>=0
I have following script and it works fine with FF and Safari. function swapimage(cid)
I have following class public abstract class Rule { protected Rule() { Nodes =

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.