Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

## #26 2013-03-07 23:57:54

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

Yes, I do.

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #27 2013-03-08 00:01:10

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

What took you so long with the book? He has another one too.

That is good work with the histogram. I need to do a chore I will be back in about a half hour.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #28 2013-03-08 00:03:55

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

Well, first I couldn't find a site that offers a *free* download. And then I forgot about searching.

Okay, see you then.

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #29 2013-03-08 00:18:29

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

Hi;

Okay, I got it. Lets start generating random numbers from non - uniform distributions!

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #30 2013-03-08 00:20:51

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

So, we need to transform a non-uniform into uniform ditributions, right?

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #31 2013-03-08 00:21:46

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

Nope, the other way. We are going to transform a uniform into another distribution.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #32 2013-03-08 00:26:46

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

Okay, but how?

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #33 2013-03-08 00:36:19

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

We want to generate random numbers that are from the PDF f(x) = 2x from 0 to 1.

Solve the equation

for x. You get 2 solutions:

We take the positive one. Can you get maxima to do everything so far?

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #34 2013-03-08 00:52:55

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

Yes. Should I plot a histogram for sqrt(random(1.0))?

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #35 2013-03-08 01:05:24

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

Hi;

Correct! Get 10000 of them. You should get something like the picture. Notice how neatly our random numbers fit under y = 2x ( the red line ).

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #36 2013-03-08 01:11:07

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

Yup. Got it.

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #37 2013-03-08 01:12:39

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

There is only only more trick for the original problem.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #38 2013-03-08 01:16:50

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

Which is?

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #39 2013-03-08 01:17:52

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

It is not from 0 to 1. So you will have to do a change of variable to get it into that interval.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #40 2013-03-08 01:21:37

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

What is not from 0 to 1?

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #41 2013-03-08 01:23:16

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

Look at the PDF in post #1. It  is from 1 to 2.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #42 2013-03-08 01:25:30

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

Okay, so, what should I do?

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #43 2013-03-08 01:28:13

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

Make the substitution of x = x + 1. That produces a PDF from 0 to 1. Now do everything the same. You will get a histogram like the one in post #1. The expectation will be 1 less because of the substitution.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #44 2013-03-08 01:32:05

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

I am confused now.

Where and when do I make that substitution?

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #45 2013-03-08 01:35:05

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

Now just do everything the same.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #46 2013-03-08 01:41:53

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

I get

for the CDF.

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #47 2013-03-08 01:48:47

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

Hi;

Yes, that is correct. But we do not need it.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #48 2013-03-08 01:50:11

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

What do we need?

Oh, and I get

for the inverse.

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #49 2013-03-08 01:53:06

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Simulations

The integral from 0 to x, repeat post #33

The inverse is in terms of y.

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

## #50 2013-03-08 01:57:12

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

### Re: Simulations

Well, since the PDF is 0 for x<0, the integral from 0 to x is exactly the CDF.

Yes, it is. But what range should I have for y?

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline