File:StratifiedPoints.gif
Summary
| Description | 
 English:  (*The stratification process redistributes the random elements into a \
 relatively homogeneous group and then samples randomly. Every element \ in the original set is uniquely reassigned to one stratum.*) \ tinyColor[color_, point_] := {PointSize[Small], color, Point[point]} colorChoose[point_] := tinyColor[Blue, point] Clear[r, n]; r = 100; n = r^2; darts = RandomReal[{0, 1}, {n, 2}]; coloredDarts = ParallelMap[colorChoose, darts]; Clear[smoothedDarts, tempPoints] subGrouper = Table[i, {i, 0, r - 1}]; shiftyGuy = Flatten[Tuples[subGrouper, 2]]; tempPoints = Partition[(shiftyGuy + Flatten[darts])*(1/r), 2]; smoothedDarts = RandomSample[tempPoints, n]; Export["~/Desktop/stratifiedPoints.gif", Table[ListPlot[Part[smoothedDarts, 1 ;; max], AspectRatio -> 1, 
  PlotStyle -> {PointSize[Small], Blue}, 
  PlotRange -> {{0, 1}, {0, 1}}, 
  PlotLabel -> 
   TraditionalForm[max "Randomly Selected Stratified Points"], 
  Frame -> True, ImageSize -> {400, 400}], {max, 100, Length[darts], 
  Length[darts]/100}], 
 "DisplayDurations" -> ConstantArray[1, 9]~Join~{3}] | 
| Date | |
| Source | Own work | 
| Author | Caitlin Jo Ramsey | 
| Camera location |   | View this and other nearby images on: OpenStreetMap | 
|---|
(*This mathematical image was created with Mathematica. The stratification process redistributes the random elements into a \ relatively homogeneous group and then samples randomly. Every element \ in the original set is uniquely reassigned to one stratum. Source code for this image is available below.*) \ tinyColor[color_, point_] := {PointSize[Small], color, Point[point]} colorChoose[point_] := tinyColor[Blue, point]
Clear[r, n]; r = 100; n = r^2; darts = RandomReal[{0, 1}, {n, 2}]; coloredDarts = ParallelMap[colorChoose, darts];
Clear[smoothedDarts, tempPoints] subGrouper = Table[i, {i, 0, r - 1}]; shiftyGuy = Flatten[Tuples[subGrouper, 2]]; tempPoints = Partition[(shiftyGuy + Flatten[darts])*(1/r), 2];
smoothedDarts = RandomSample[tempPoints, n];
Export["~/Desktop/stratifiedPoints.gif",
Table[ListPlot[Part[smoothedDarts, 1 ;; max], AspectRatio -> 1, 
  PlotStyle -> {PointSize[Small], Blue}, 
  PlotRange -> {{0, 1}, {0, 1}}, 
  PlotLabel -> 
   TraditionalForm[max "Randomly Selected Stratified Points"], 
  Frame -> True, ImageSize -> {400, 400}], {max, 100, Length[darts], 
  Length[darts]/100}], 
"DisplayDurations" -> ConstantArray[1, 9]~Join~{3}]
Licensing
- You are free:
- to share – to copy, distribute and transmit the work
 - to remix – to adapt the work
 
 - Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
 - share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.