1

enter image description here

I want to take some points randomly by the limits above, I had try to use FindInstance method but it always out (0,0) FindInstance[9 x + 7 y <= 56 && 7 x + 20 y <= 70, {x, y}, RandomSeeding -> Automatic]

Facet
  • 77
  • 4

1 Answers1

4

You can use ImplicitRegion and RandomPoint:

SeedRandom[1]
RandomPoint[ImplicitRegion[9 x + 7 y <= 56 && 7 x + 20 y <= 70,
   {{x, 5, Infinity}, {y, 0, Infinity}}], 10]

{{5.99903,0.202433},{5.13618,0.481529},{5.22954,0.613772},{5.08035,0.511267},{5.28252,0.815217},{5.48401,0.265592},{5.91503,0.0185986},{5.51682,0.497948},{6.19432,0.0188226},{5.25428,1.24232}}

Alternatively,

SeedRandom[1]
RandomPoint[ImplicitRegion[9 x + 7 y <= 56 && 7 x + 20 y <= 70 && x > 5 && y >= 0,
  {x, y}], 10]

same result

kglr
  • 394,356
  • 18
  • 477
  • 896