Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
RandomVariate
  • See Also
    • SeedRandom
    • BlockRandom
    • RandomChoice
    • RandomInteger
    • RandomReal
    • RandomComplex
    • RandomPoint
    • RandomGeoPosition
    • RandomFunction
    • RandomGraph
    • RandomImage
    • RandomInstance
  • Related Guides
    • Random Variables
    • Random Number Generation
    • Probability & Statistics
    • Matrix Distributions
    • Matrices and Linear Algebra
    • Probability & Statistics with Quantities
    • Scientific Models
    • Statistical Data Analysis
    • Random Graphs
    • Reliability
    • Actuarial Computation
    • See Also
      • SeedRandom
      • BlockRandom
      • RandomChoice
      • RandomInteger
      • RandomReal
      • RandomComplex
      • RandomPoint
      • RandomGeoPosition
      • RandomFunction
      • RandomGraph
      • RandomImage
      • RandomInstance
    • Related Guides
      • Random Variables
      • Random Number Generation
      • Probability & Statistics
      • Matrix Distributions
      • Matrices and Linear Algebra
      • Probability & Statistics with Quantities
      • Scientific Models
      • Statistical Data Analysis
      • Random Graphs
      • Reliability
      • Actuarial Computation

RandomVariate[dist]

gives a pseudorandom variate from the symbolic distribution dist.

RandomVariate[dist,n]

gives a list of n pseudorandom variates from the symbolic distribution dist.

RandomVariate[dist,{n1,n2,…}]

gives an n1× n2×… array of pseudorandom variates from the symbolic distribution dist.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Basic Uses  
Parametric Distributions  
Nonparametric Distributions  
Derived Distributions  
Options  
WorkingPrecision  
Applications  
Pictures of Random Data  
Distribution Properties  
Random Experiments  
Show More Show More
Estimation and Hypothesis Testing  
Quality  
Traffic  
Finance  
Other Applications  
Properties & Relations  
Possible Issues  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • SeedRandom
    • BlockRandom
    • RandomChoice
    • RandomInteger
    • RandomReal
    • RandomComplex
    • RandomPoint
    • RandomGeoPosition
    • RandomFunction
    • RandomGraph
    • RandomImage
    • RandomInstance
  • Related Guides
    • Random Variables
    • Random Number Generation
    • Probability & Statistics
    • Matrix Distributions
    • Matrices and Linear Algebra
    • Probability & Statistics with Quantities
    • Scientific Models
    • Statistical Data Analysis
    • Random Graphs
    • Reliability
    • Actuarial Computation
    • See Also
      • SeedRandom
      • BlockRandom
      • RandomChoice
      • RandomInteger
      • RandomReal
      • RandomComplex
      • RandomPoint
      • RandomGeoPosition
      • RandomFunction
      • RandomGraph
      • RandomImage
      • RandomInstance
    • Related Guides
      • Random Variables
      • Random Number Generation
      • Probability & Statistics
      • Matrix Distributions
      • Matrices and Linear Algebra
      • Probability & Statistics with Quantities
      • Scientific Models
      • Statistical Data Analysis
      • Random Graphs
      • Reliability
      • Actuarial Computation

RandomVariate

RandomVariate[dist]

gives a pseudorandom variate from the symbolic distribution dist.

RandomVariate[dist,n]

gives a list of n pseudorandom variates from the symbolic distribution dist.

RandomVariate[dist,{n1,n2,…}]

gives an n1× n2×… array of pseudorandom variates from the symbolic distribution dist.

Details and Options

  • RandomVariate can generate random variates for continuous, discrete, or mixed distributions specified as a symbolic distribution.
  • RandomVariate gives a different sequence of pseudorandom numbers whenever you run the Wolfram Language. You can start with a particular seed using SeedRandom.
  • With the setting WorkingPrecision->p, random numbers of precision p will be generated.

Examples

open all close all

Basic Examples  (5)

Simulate a continuous probability distribution:

Simulate a discrete probability distribution:

Simulate a multivariate continuous distribution:

Simulate a multivariate discrete distribution:

Generate random numbers from a mixture distribution:

Scope  (22)

Basic Uses  (5)

Use RandomVariate to generate arrays of different sizes and dimensions:

A vector:

A matrix:

A rank-3 tensor:

Generate high-precision random variates:

Use SeedRandom to get repeatable random values:

Generate random variates for a univariate continuous distribution:

Discrete univariate distribution:

Continuous multivariate distribution:

Discrete multivariate distribution:

Generate random variates for a quantity distribution:

Generate array of variates:

Generate random vectors:

Parametric Distributions  (4)

Generate random variates for univariate continuous distributions:

Generate random variates for univariate discrete distributions:

Generate random variates for multivariate continuous distributions:

Generate random variates for multivariate discrete distributions:

Nonparametric Distributions  (4)

Generate random variates for a univariate EmpiricalDistribution:

Using a multivariate empirical distribution:

Using a univariate HistogramDistribution:

A multivariate histogram distribution:

Using a univariate KernelMixtureDistribution:

Using censored data with SurvivalDistribution:

Derived Distributions  (9)

Generate random variates for a TransformedDistribution:

An equivalent way of generating the same random variates:

Generate random variates for a ProductDistribution:

An equivalent way of generating the same random variates:

Using a component mixture of normal distributions:

Parameter mixture of exponential distributions:

Compare the variance of the sample with the variance of the distribution:

Truncated normal distribution:

Censored exponential distribution:

Compare the kurtosis for the sample with the kurtosis for the distribution:

Marginal distribution:

Compute probabilities using the sample and the marginal distribution:

Copula distribution:

Compare the value of a moment for the sample with that for the copula distribution:

Formula distribution:

Options  (1)

WorkingPrecision  (1)

By default MachinePrecision random numbers are generated for continuous distributions:

Use the WorkingPrecision option to generate numbers with arbitrary precision:

Applications  (30)

Pictures of Random Data  (6)

Generate random data for a continuous distribution and compare its histogram to the PDF:

Generate random data for a discrete distribution and compare its histogram to the PDF:

Generate random data for a bivariate distribution and compare its histogram to the PDF:

Compare the plots of random data for continuous multivariate distributions:

Consider vectors with standard normal components:

The angle will follow a uniform distribution:

The norm will follow a Rayleigh distribution:

Consider three-dimensional vectors with standard normal components:

The angle in spherical coordinates follows a uniform distribution:

The norm will follow a distribution:

Distribution Properties  (5)

Verify the Poisson approximation to the binomial distribution using random variates:

Define a truncated triangular distribution:

Generate random numbers from this distribution:

Mean, variance, and kurtosis:

Moments:

Probabilities and expectations:

Simulate the distribution of a function of a random variable:

Compare the mean and variance of the sample with those for the distribution:

Generate random data from a normal distribution:

Define nonparametric distributions using this data:

Compare the mean and variance of these distributions:

Estimate an unknown slice distribution of a random process:

Slice distribution is unknown:

Generate a random sample of paths:

Visualize its probability density function:

Test if it fits a standard normal distribution:

Random Experiments  (4)

Simulate 10 throws of a fair six-sided die:

Simulate seven throws of a pair of fair six-sided dice:

A coin-tossing experiment consists of tossing a fair coin repeatedly until a head results. Simulate the process:

A radioactive material on average emits 3.2 -particles per second; show the distribution. Simulate a typical particle-count experiment for 10 minutes:

Simulate a symmetric random walk with values -1 and 1:

Estimation and Hypothesis Testing  (3)

Generate random data for a normal distribution:

Estimate the distribution parameters using the random data:

Generate high-precision random data for a component mixture distribution:

Estimate the mixture probabilities, assuming the component distributions are known:

Given a binormal sample, the -statistic follows a shifted FisherZDistribution:

Generate the distribution of -statistics for binormal samples of size :

Visually compare the -statistic distribution to a shifted FisherZDistribution:

DistributionFitTest confirms the result:

Quality  (3)

Suppose there are 5 defective items in a batch of 10 items, and 6 items are selected for testing. Simulate the number of defective items found:

Out of 10 bulbs produced, one is defective. Simulate the production of 100 bulbs:

Find the percentage of good bulbs:

Find the average number of good bulbs per batch of 100:

Find the probability that a randomly selected bulb is good:

A shipment of products is inspected in batches of 60 and each batch is inspected up to rejection when the 10^(th) defective item is found. What is the probability of a batch being rejected if 20% of the items are defective?

Alternatively, compute the same result by truncating the distribution:

Simulate the number of non-defective products in rejected batches:

Illustrate the ratio in each batch:

Find the average ratio of non-defective to defective products in rejected batches:

Traffic  (3)

The number of customers arriving at a service desk follows PoissonDistribution with mean 0.6, and the number of customers already in line before the service desk opens follows PoissonDistribution with mean 5. The number of customers served until there is no one in line follows PoissonConsulDistribution:

Plot the probability mass function:

Simulate numbers of customers served at 30 busy periods:

The average number of accidents in a city is 100 per day. Simulate the daily accidents:

The expected number of raindrops falling into a bucket in a five-second interval is 20. Simulate the raindrop count for each five-second interval:

Finance  (1)

Assuming daily logarithmic return of the stock market follows a stable distribution, simulate and visualize stock prices over a period of 5 years:

Other Applications  (5)

RandomVariate can generate complex numbers if necessary:

Evaluate an integral numerically using a Monte Carlo scheme:

Approximate with an interpolating function defined with uniformly distributed random nodes:

Interpolate between the nodes:

Find the value of the integral using the interpolating function:

Compare with the value obtained using the original function:

Sample a Gaussian symmetric matrix:

Fit WignerSemicircleDistribution to its eigenvalues:

Compare the histogram of the eigenvalues with the PDF:

The heights of females in the United States follow normal distribution with mean 64 inches and standard deviation of 2 inches, while the heights of males in the United States follow normal distribution with mean 70 inches and standard deviation of 2 inches. If the population ratio of males to females is 1:1, then the heights of the whole population have the following bimodal distribution:

Simulate the typical distribution of heights in a town of population 100:

Find the probability that a person is at least 73 inches tall:

A basketball player shoots free throws until he hits 4 of them. His probability of scoring in any one of them is 0.7. Simulate the process:

Find the number of shots the player is expected to shoot:

Properties & Relations  (17)

RandomInteger generates uniform discrete random variates:

RandomReal generates uniform continuous variates:

RandomChoice generates random choices with replacement from a list:

RandomSample generates random choice without replacement from a list:

RandomPrime generates a random prime number:

RandomImage generates a random image:

RandomGraph generates a random graph:

RandomFunction generates a path for a random process:

Use RandomVariate to generate a sample for a time slice of the process:

Test whether the mean or median is zero by using LocationTest:

Compare means or medians for several datasets using LocationEquivalenceTest:

Test whether two datasets have the same variance by using VarianceTest:

Test whether several datasets have the same variance by using VarianceEquivalenceTest:

Use DistributionFitTest to test goodness of fit between random data and a distribution:

Estimate distribution parameters from random data using EstimatedDistribution:

Estimate nonparametric distributions from random data:

Compare random data to distributions using statistical visualization functions:

Compare multiple distributions using statistical charts:

Plot histograms from random data:

Plot smooth kernel density estimates from data:

Possible Issues  (3)

The speed of random variate generation may depend on the distribution:

The WorkingPrecision option is ignored for discrete distributions:

The result from RandomVariate may include infinite quantities:

Using a different level of precision avoids the problem in this case:

See Also

SeedRandom  BlockRandom  RandomChoice  RandomInteger  RandomReal  RandomComplex  RandomPoint  RandomGeoPosition  RandomFunction  RandomGraph  RandomImage  RandomInstance

Function Repository: MetropolisHastingsSequence

Related Guides

    ▪
  • Random Variables
  • ▪
  • Random Number Generation
  • ▪
  • Probability & Statistics
  • ▪
  • Matrix Distributions
  • ▪
  • Matrices and Linear Algebra
  • ▪
  • Probability & Statistics with Quantities
  • ▪
  • Scientific Models
  • ▪
  • Statistical Data Analysis
  • ▪
  • Random Graphs
  • ▪
  • Reliability
  • ▪
  • Actuarial Computation

History

Introduced in 2010 (8.0)

Wolfram Research (2010), RandomVariate, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomVariate.html.

Text

Wolfram Research (2010), RandomVariate, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomVariate.html.

CMS

Wolfram Language. 2010. "RandomVariate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RandomVariate.html.

APA

Wolfram Language. (2010). RandomVariate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RandomVariate.html

BibTeX

@misc{reference.wolfram_2025_randomvariate, author="Wolfram Research", title="{RandomVariate}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/RandomVariate.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_randomvariate, organization={Wolfram Research}, title={RandomVariate}, year={2010}, url={https://reference.wolfram.com/language/ref/RandomVariate.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English