# Random number generator for Cauchy distribution

#### Ohlan

##### New Member
Hello!

I am new to STATA and for an statistics assignment we are required to use a random number generator to generate samples of 10, 100, 1,000 and 10,000 from the Cauchy distribution, and as many intermediate values of n as we have patience for. After spending a good hour looking for help online for how to use a Cauchy random number generator in STATA I am appealing to the forum, hoping one of you could help explain this to me.

Thank you very much!

#### Dragan

##### Super Moderator
Hello!

I am new to STATA and for an statistics assignment we are required to use a random number generator to generate samples of 10, 100, 1,000 and 10,000 from the Cauchy distribution, and as many intermediate values of n as we have patience for. After spending a good hour looking for help online for how to use a Cauchy random number generator in STATA I am appealing to the forum, hoping one of you could help explain this to me.

Thank you very much!
I am not familiar with STATA, but if you can find where to generate samples from the standard normal distribution (Z), then you can create a Cauchy distribution (C) by the following:

C = Z1 / Z2

where Z1 and Z2 are independent standard normal distributions.