@pavaulbaut and pankaj man u people have sone serious knowledge well starting off , i am not able to figure out how u poeple are majking those recursions (T(1)......) , if u could plz tell how areu generalizing it it willbe a great helpwell regarding the 1 st qustion the code is right as it is only asked bout the probabiltywelll @ pankaj chawla , how did u deduce that formula (1*1(n+1)........) , couldnt get it well thanks guys for the help u really sorted out my problemscheers