The number of 3 digit numbers of the form xyz such that $x
The number of 3 digit numbers of the form $xyz$ such that $x<y$ and $z\leq y$ is N such that n is a 3 digit number of the form $abc$ then find $a+c-b$     
My approach:
Case 1:
$x<y$
$z<y$
$x,y,z\neq 0$
Choosing 3 digits out of 9 numbers: $\binom 93$, greatest of them will always be $y$, hence ways of arranging is (exchanging x and z) $2\cdot\binom 93=54$. 
Case 2:
$x,y$ can't be $0$. Taking $z=0$, number of ways of selecting the other 2 digits are $\binom 92=36$. There is only one way to arrange them.      
case 3:
$y=z$,
_99, values for $x=8$
_88, values for $x=7$
_77, values for $x=6$
.
.
.
_11, values for $x=0$
Total possibilities=$8+7+6+\cdots+1=36$       
Hence total permutations=$54+36+36=126$     
This gives $a+c-b=5$ which is not the right answer. Why is this logic wrong?

A trial and error method looks better here.
Note that, here $$1\le x \le 8$$ $$\max(x,z) \le y\le 9$$ $$0\le z\le 9$$
Now, for $x=1$, and for all $z$, $y$ can take $8+8+8+7+6+5+4+3+2+1=52$ values.
Again, for $x=2$, and for all $z$, $y$ can take $7+7+7+7+6+5+4+3+2+1=49$ values.
So, it can be checked that, in general for $x=r$ when $1\le r \le 8$, and for all $z$, $y$ can take $(r+2)\cdot (9-r)+(8-r)+\ldots + 1= (r+2)\cdot (9-r)+\sum_{i=1}^{(8-r)} i$ values.
The value of N $$=\sum_{r=1}^8 (r+2)\cdot (9-r)+(8-r)+\ldots + 1$$ $$=\sum_{r=1}^8 (r+2)\cdot (9-r)+\sum_{r=1}^8 \sum_{i=1}^{(8-r)} i$$
$$=\sum_{r=1}^8 (7r+18-r^2)+\sum_{r=1}^8 \frac{(8-r)(8-r+1)}{2}$$
Hope this helps you.
