Suppose that there are $n$ dwarfs, $D_1,\dots,D_n$, and they enter in reverse order (i.e., $D_n$ first and $D_1$ last). I claim that the probability that $D_k$ gets his own bed is $\frac{k}{k+1}$ for every $k
When $D_k$ enters the room, there are $k$ beds still free. Since each dwarf except $D_n$ takes his own bed if it’s available, the beds belonging to $D_{k+1},\dots,D_{n-1}$ must all be occupied, and the free beds must be $k$ of the $k+1$ beds belonging to $D_1,\dots,D_k$, and $D_n$. When a dwarf picks a bed at random, the beds are in effect indistinguishable, so each of the $k+1$ beds belonging to these $k+1$ dwarfs is equally likely to be the one that’s already occupied. In particular, the probability that $D_k$’s bed is already occupied is $\frac1{k+1}$, so the probability that he gets his own bed is $\frac{k}{k+1}$.