Question: as the title,this problem have confused me a whole day.If I have a region,how can I yield a random member in this region.The region such as `Triangle[{{0, 0}, {1, 2}, {2, 1}}]`or `(x>5&&x<9)||(x>11&&x<13)`

i want get a random member in the expected region.but the “FindInstance” will give me a same result in the scond time when i run it again.

my current solution is previously product some random member,then sift that expected that.but the way will result in a long time,because it has yield amounts of member that it don't meet the requestion.

Answer: 
Following the advice of @Guess who it is. to use <https://math.stackexchange.com/questions/18686/uniform-random-point-in-triangle>

```
randPt[tri_Triangle] :=
  Module[{a, b, c,
    r1 = Sqrt[RandomReal[]], r2 = RandomReal[]},
   {a, b, c} = Identity @@ tri;
   (1 - r1)*a + r1*(1 - r2)*b + r1*r2*c];

triangle = Triangle[RandomReal[{0, 5}, {3, 2}]]

```

> 
> Triangle[{{4.22625, 2.64524}, {0.95047, 2.79426}, {2.89314, 1.00168}}]
> 
> 
> 

```
Manipulate[
 Graphics[{
   LightGray, triangle,
   Red, AbsolutePointSize[3],
   Point[Table[randPt[triangle], {n}]]},
  Frame -> True],
 {{n, 500}, 100, 10000, 100, Appearance -> "Labeled"}]

```

![enter image description here](https://i.stack.imgur.com/JJ5n9.png)
The general 2D case was discussed in [this question](https://mathematica.stackexchange.com/q/57938/3066), but a more robust version can be written

```
randomFromRegion2D[
    region_ /; RegionDimension[region] == 2, 
    trials_Integer /: trials > 0] :=
  Module[{bounds, randPts},
    bounds = RegionBounds @ region;
    randPts = 
      Transpose @ 
        {RandomReal[bounds[[1]], trials], RandomReal[bounds[[2]], trials]};
    Select[randPts, RegionMember[region]]]

tri = Triangle[{{0, 0}, {1, 2}, {2, 1}}];
SeedRandom[1]; 
Graphics[{{GrayLevel[.75], tri}, Point @ randomFromRegion2D[tri, 1000]}]

```

![triangle](https://i.stack.imgur.com/DtVIY.png)

However, the OP also asked about 1D regions such a one characterized by 

```
(x > 5 && x < 9) || (x > 11 && x < 13)

```

I would like to discuss how handle such regions, which must be dealt with a little differently than 2D regions because the functions supporting regions in *Mathematica* insist that points in 1D regions be represented by a list containing a single numeric object. Thus, the 1D origin is `{0.}`.

The OP's 1D specification can be made into a *Mathematica* region by taking the union of two `Interval` objects.

```
rx = RegionUnion[Interval[{5, 9}], Interval[{11, 13}]]]

randomFromRegion1D[
    region_ /; RegionDimension[region] == 1, 
    trials_Integer /: trials > 0] :=
  Module[{bounds, randPts},
    bounds = RegionBounds @ region;
    randPts = RandomReal[bounds[[1]], {trials, 1}];
    Select[randPts, RegionMember[region]] // Flatten]

SeedRandom[1]; 
NumberLinePlot[randomFromRegion1D[rx, 50],
  Prolog -> {GrayLevel[.75], AbsoluteThickness[10], 
    Line[Transpose @ {rx[[1, 1]], {0, 0}}], 
    Line[Transpose @ {rx[[2, 1]], {0, 0}}]}]

```

![intervals](https://i.stack.imgur.com/aWOio.png)