MATLAB code to Geometric Random Variable

Click For Summary
SUMMARY

The discussion focuses on generating a Geometric Random Variable (RV) with a success probability of 0.1 using MATLAB's built-in function rand(). The formula for the Geometric RV is defined as P = (1-p)^(k-1) * p, where p equals 0.1 and k represents the trial number at which the first success occurs. Participants share their attempts to implement this using rand(n) to simulate the required random variable.

PREREQUISITES
  • Understanding of Geometric Random Variables
  • Familiarity with MATLAB programming
  • Knowledge of the rand() function in MATLAB
  • Basic probability concepts
NEXT STEPS
  • Research how to implement random variable simulations in MATLAB
  • Learn about the properties of Geometric distributions
  • Explore advanced MATLAB functions for statistical simulations
  • Investigate the implications of varying success probabilities in Geometric RVs
USEFUL FOR

Students in statistics or probability courses, MATLAB users interested in random variable simulations, and anyone looking to understand Geometric distributions in practical applications.

neeraj.patel1
Messages
3
Reaction score
0

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)
 
Physics news on Phys.org
neeraj.patel1 said:

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?
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
913
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 3 ·
Replies
3
Views
9K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
13
Views
2K
Replies
5
Views
5K