charlesguo25 0 Newbie Poster

How do you find average from the following code?

On average, how many stars would be displayed by the following algoithm?
On average, how many stars would be displayed if nNum was doubled?

static Random randNumGen = new Random();
public static void main(String[]args)
{
int nNum = 10;
printStar(nNum);
}
public static void printStar(int nNum)
{
if(randNumGen.nextInt(10) < 1)
nNum--;
if(nNum > 0)
{
System.out.print('*');
printStar(nNum);
}
}

And i believe the Big-O notation for this code is O(r^n), or am i wrong?

Thanks