# Truncated Geometric Distribution

#### masood

I have equation for truncated increasing geometric distribution given as
$pr=\frac{ (1-\alpha) \alpha^{CW}} { 1- \alpha^{CW} }. \alpha^{-r}$ with $r=1, ....., CW$. $\alpha$ is parameter we can set between 0 and 1.

Here probability of picking r=1 is very low and r=CW is very high. How can I derive an equation from this equation that should give me values generated between r= 1 and CW with given distribution.
I should get values like this if r=1 to 10. CW=10
10,10,9,9,6,1,6,10,10,3,4 (following geometric distribution from equation provided).

#### Walagaster

I am confused by your notation. Is $pr$ supposed to be a discrete probability function, normally written $p(r)$ or $P(R=r)$ for some random variable $R$? And why not use standard notation $n$ and $N$ instead of $r$ and $CW$ for positive integers? Then, what value is $\alpha$ in your calculations? And if it is a probability function, why are you getting answers greater than $1$? I can't even tell what you are calculating.

#### masood

Thanks for the feedback. $pr$ is actually $p(r)$. i had $r$ and $CW$ in the equation given so i used them here. The values gretar than one belong to gemoteric variable $r$ who should satisfy this equation. I need equation to get $r$.

#### Walagaster

Making your equation a bit more readable $$p(n) = \frac {(1-\alpha)\alpha^N}{1-\alpha^N}\alpha^{-n},~n = 1\dots N$$
Are you just asking what $n$ gives a particular $p(n)$? If so, just rewrite your equation as$$\alpha^n =\frac 1 {p(n)}\cdot \frac {(1-\alpha)\alpha^N}{1-\alpha^N}$$
and take the natural log of both sides and solve for $n$. You probably won't get exact integers because of rounding in the calculations.