RandomInstance
RandomInstance[expr]
finds a random instance of an expression such as a geometric scene or biomolecular sequence.
RandomInstance[expr,n]
finds n instances.
Details and Options
- When expr is a GeometricScene, RandomInstance gives a GeometricScene or a list of GeometricScene objects.
- When expr is a BioSequence, RandomInstance gives a BioSequence or a list of BioSequence objects.
- RandomInstance makes assumptions by default. For example, it assumes points appearing in a GeometricScene are in general position and that regions appearing in a GeometricScene are nondegenerate.
- The following options can be given:
-
RandomSeeding Automatic how to seed randomness
Examples
open allclose allBasic Examples (2)
Represent a symbolic geometric scene containing a triangle with points a, b, c and a 30° angle:
RandomInstance finds a particular instance of the scene:
Rules giving coordinates for the points have been filled in:
Scope (1)
Options (1)
RandomSeeding (1)
By default, RandomInstance finds different solutions each time:
Use RandomSeedingseed to use an explicit integer or string as a seed:
Properties & Relations (1)
Use RandomInstance to find random polygons:
This can also be done with RandomPolygon:
Text
Wolfram Research (2019), RandomInstance, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomInstance.html (updated 2020).
CMS
Wolfram Language. 2019. "RandomInstance." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/RandomInstance.html.
APA
Wolfram Language. (2019). RandomInstance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RandomInstance.html