MATLAB code to Geometric Random Variable

  • #1

Homework Statement



Generate Geometric RV with Porbabilty of succcess 0.1 using only rand()


Homework Equations



rand()
geometric rv P=(1-p)^(k-1) * p where p=0.1, k is number of trial in which we get 1st success


The Attempt at a Solution



rand(n)
 

Answers and Replies

  • #2
berkeman
Mentor
60,880
11,270

Homework Statement



Generate Geometric RV with Porbabilty of succcess 0.1 using only rand()


Homework Equations



rand()
geometric rv P=(1-p)^(k-1) * p where p=0.1, k is number of trial in which we get 1st success


The Attempt at a Solution



rand(n)

Can you explain your attempt at a solution?
 

Related Threads on MATLAB code to Geometric Random Variable

Replies
3
Views
8K
Replies
0
Views
4K
Replies
5
Views
743
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
7
Views
15K
  • Last Post
Replies
14
Views
4K
  • Last Post
Replies
1
Views
10K
Replies
4
Views
8K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
0
Views
5K
Top