# Finding constraints using Mathematica

**URL:** <https://community.wolfram.com/t/finding-constraints-using-mathematica/16693>\
**Category:** Questions\
**Tags:** algebra, calculus, equation-solving\
**Created:** [September 7, 2020, 11:10pm UTC](https://community.wolfram.com/t/finding-constraints-using-mathematica/16693 "2020-09-07T23:10:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![upasanadutta](https://avatars.discourse-cdn.com/v4/letter/u/e68b1a/32.png) [@upasanadutta](https://community.wolfram.com/u/upasanadutta)\
**Post date:** [September 7, 2020, 11:10pm UTC](https://community.wolfram.com/t/finding-constraints-using-mathematica/16693/1 "2020-09-07T23:10:19Z")

</div>

I have a fraction frac1 as below

```
frac1 = (-2 a + 2 b - 2 d + 4 a gamma - 4 b gamma + 4 d gamma) / (-3 a + 2 b - 3 d + 6 a gamma - 6 b gamma + 6 d gamma)

```

All the 4 variables in the fraction, a, b, d, and gamma, can only take values from 0 through 1 (inclusive). I want to find what relationship should a, b and d satisfy (for example, a + 3d \< 6b, etc) such that the fraction frac1 always assumes values less than or equal to 0.6 for every value of gamma (from 0 through 1). In other words, how should a, b, and d be related so that there exists no value of gamma from 0 through 1 that makes the value of frac1 exceed 0.6?

I have been trying hard to find the correct command for this in Mathematica, but I’m really stuck. Any help is appreciated!!

 ![frac1.jpeg](https://global.discourse-cdn.com/wolfram/original/3X/a/7/a74a7835c516bd117ad4711da45f6cd2b2717dda.jpeg)

---

<div class="post-metadata">

**Author:** ![dontdont9](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dontdont9](https://community.wolfram.com/u/dontdont9)\
**Post date:** [September 8, 2020, 12:21am UTC](https://community.wolfram.com/t/finding-constraints-using-mathematica/16693/2 "2020-09-08T00:21:01Z")

</div>

Try

```
Reduce[{0<=a<=1,0<=b<=1,0<=d<=1,0<=gamma<=1,(-2a+2b-2d+4a gamma-4b gamma+4d gamma)/
  (-3a+2b-3d+6a gamma-6b gamma+6d gamma)<6/10},{a,b,d,gamma}]

```

Please check all this very carefully to understand how it works and see if I have made any mistakes.

---

<div class="post-metadata">

**Author:** ![upasanadutta](https://avatars.discourse-cdn.com/v4/letter/u/e68b1a/32.png) [@upasanadutta](https://community.wolfram.com/u/upasanadutta)\
**Post date:** [September 8, 2020, 12:25am UTC](https://community.wolfram.com/t/finding-constraints-using-mathematica/16693/3 "2020-09-08T00:25:18Z")

</div>

The values the 4 variables can take are not just 0 or 1. They can take any value between 0 and 1, like 0.001, 0.002,… 0.999 etc. So there are actually a large number of alternatives here.

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [September 8, 2020, 1:58pm UTC](https://community.wolfram.com/t/finding-constraints-using-mathematica/16693/4 "2020-09-08T13:58:04Z")

</div>

The `Reduce` code from @BillNelson explicitly allows for variables to take on all values between 0 and 1 inclusive.
