Échantillonnez des points à partir des régions
RandomPoint échantillonne un ensemble de points pseudo-aléatoires de manière homogène dans une région donnée.
In[1]:=

Graphics[{Polygon[CirclePoints[5]], White, 
  Point[RandomPoint[Polygon[CirclePoints[5]], 200]]}, 
 ImageSize -> Medium]Out[1]=

Les points d'échantillonnage dans une région Lissajous implicite.
In[2]:=

\[ScriptCapitalR] = 
  ImplicitRegion[-1 + (-1 + 18 x^2 - 48 x^4 + 32 x^6)^2 + (-1 + 
       18 y^2 - 48 y^4 + 32 y^6)^2 <= 0, {x, y}];In[3]:=

Graphics[{PointSize[Tiny], 
  Point[RandomPoint[\[ScriptCapitalR], 10^4]]}, ImageSize -> Medium]Out[3]=

Les points d'échantillonnage à partir d'un Text primitif.
In[4]:=

mr = DiscretizeGraphics[Text[Style["\[CapitalSigma]", Bold]], _Text, 
   MaxCellMeasure -> 0.1];In[5]:=

Graphics[{PointSize[Tiny], Point[RandomPoint[mr, 10000]]}, 
 ImageSize -> Medium]Out[5]=

Utilisez la méthode de Monte Carlo pour vous rapprocher d'une intégrale avec un domaine dans une région paramétrique.
In[6]:=

region = ParametricRegion[{{s, s t}, s^2 + t^2 <= 1}, {s, t}];Afficher l'entrée complète de Wolfram Language
Out[7]=

La fonction à intégrer au domaine.
In[8]:=

f[{x_, y_}] := x^3 - 2 x^2 y + 4 x^6 - y^5;
val = NIntegrate[f[{x, y}], {x, y} \[Element] region]Out[8]=

Visualisez la convergence de la statistique de Monte Carlo lorsque la taille de l'échantillon augmente.
Afficher l'entrée complète de Wolfram Language
Out[9]=























 
  
  
  
  
  
  
 