So, the last function I want to talk about is the sample function.

And the way, and the sample function allows you to draw randomly from a,

a specific set of objects that you specify.

So if you give it a vector of numbers,

it allows you to draw a random sample from that vector of numbers.

And so you can kind of create any arbitrary distribution that you want,

by specifying a vector of objects and then sampling from it.

So here for example, I'm going to sample from the integers one to ten.

So I pass the vector of integers of one through ten.

And I tell it that I want to sample randomly four of them,

without replacement.

So so I'm just choosing four random entries from one to ten, and

here I get 3, 4, 5, 7.

If I do it again, I get 3, 9, 8, 5.

So in this, ex, example, I,

I will, I won't get repeated numbers, because I'm not sampling with replacement.

I don't have to just sample numbers, I can sample letters if I wanted to,

so here I'm taking the letters.

A through z, and I'm just going to sample five of them without replacement, and

I just get q, b, e, x and p.

now, what happens if I don't specify anything,

I just give it the vector of objects.

So here I'm [INAUDIBLE] passing sample the vector one through ten, and if I

don't specify anything else, what it does, is it gives me a permutation of those.

So here the vector one through ten is just permuted in a random order.

If I call it again I get a, I get yet another permutation.