Good afternoon !
I have the following function of the variable n :
P(n) = 1-(1-p)^n
- p is a parameter in the interval [0 , 1]
I'm wanting to plot this one dimentional function with several values of p , within the same plot :
p=seq(0 , 1 , 0.1 )
So i tried for p=0.1 and p=0.9 :
p=0.1
n <- seq(0, 100, 8) ; y <- 1-(1-p)^n
plot(n , y ,pch= 21,type = "o", col = "red", xlab = "n-values", ylab = "P(n) values ", main = "P(n)= 1-(1-p)^n ")
p=0.9
lines(n , 1-(1-p)^n , type="o", pch=16 , col="blue")
legend(60 , 0.4, c("p=0.1","p=0.9"), cex=0.7, col=c("red", "blue"),pch=c(21, 16))
This gives :
The problem :
I'm searching an elegant way to plot this function for all values of p=seq(0,1,0.1) within the same plot . I'm wanting to delete the extrapolation effect ( I'm wanting to delete the
pchsymbols at all , the graph sould contains the curves with different colors and without the effect of extrapoling segments ).I wish my question is clear.
Thank you for help in advance !
