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: Your case 1 needs supplementing with case 1a) $x=z$, which gives $\binom 92$ additional cases, with the larger choice $=y$ and the smaller $=x=z$ -- another $36$ cases.
Then $$\overset{\text{case 1}}{2\cdot \binom 93} + \overset{\text{case 1a}}{\binom 92} + \overset{\text{case 2}}{\binom 92} + \overset{\text{case 3}}{\binom 92}
= 2\cdot 84 +3\cdot 36 = 168+108 = 276$$
giving your final calculation of $2+6-7 = 1$
A: 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.
