You are not logged in.

- Topics: Active | Unanswered

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

They take the same time.

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

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

Go to 100000, I am getting a marked difference then.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

Ah, I see it.

So, Table is slower at getting 10 random numbers than RandomVariate?

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

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

Yes, Random Variate is much faster. You try to avoid loops in M coding. Table is like a loop.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

Hm, so, this should be faster than both:

`Count[RandomVariate[DiscreteUniformDistribution[{0, 1}], {100000, 10}], {___, 1, 1, 1, 1, ___}]`

right?

*Last edited by anonimnystefy (2013-05-03 00:00:15)*

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

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

Yes, I agree. But no simulation is even faster.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

That is true.

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

First one in post #42 was the man until...

How fast is this?

```
1 - (RecurrenceTable[{a[n] ==
a[n - 1] + a[n - 2] + a[n - 3] + a[n - 4], a[1] == 2,
a[2] == 4, a[3] == 8, a[4] == 15}, a, {n, 1, 10}] // Last)/1024
```

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

Could you explain it a bit?

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

It is time for you to see something.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

Sure. What is it I am to see?

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

Something wonderful. I got that from 2010 the movie.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

I haven't watched it. Or at least I do not remember watching it.

What is it?

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

A great movie that modern people have not seen.

Do you know who --------- is?

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

I do not.

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

This is my favorite:

[link removed by administrator]

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

I still do not understand how you got that recurrence.

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

Experimental math of course! Did you read the link I sent you to?

Since you have seen it I am removing the link.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

I read it and still do not understand the recurrence. But, if it is true then there is a closed form.

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

Solving that would be ugly beyond belief. Also, the recurrence and Fellers formula are sufficient for such a small problem.

The recurrence can be derived from the Markov chains but I do not remember how.

I derived them by counting up each a[k] individually and relying on the known fact for two coins in a row. M did the rest. Proof in the experimental sense was established using the methods of numerical analysis.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

Sorry. I thought I saw a pattern that wasn't really there.

When can we get new problems in the Exercises threads? A friend of mine would like to see one which is not yet solved.

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

One from me? As soon as I solve something of worth and interest.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

Ok.

Here lies the reader who will never open this book. He is forever dead.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 90,658

Who is your friend, may I ask?

**In mathematics, you don't understand things. You just get used to them.**

Offline

**anonimnystefy****Real Member**- From: The Foundation
- Registered: 2011-05-23
- Posts: 15,658

He is on the forum under the name danilodjokic997.

Here lies the reader who will never open this book. He is forever dead.

Offline