Problem
I want to create an 'event' with probability of $\frac{1}{7}$ with a single dice as efficiently as possible (to roll the dice as little as possible).
To give you some better understanding of the question, if I would like an event with probability of $\frac{1}{9}$, I could easily do it in various ways. One way is to see whether the sum of two rolls is $5$. Another way is to roll the dice twice and see whether they are both not higher than $2$.
If I had to choose $\frac{1}{5}$, we can do this 'trick': success on drawing $1$, but if we draw $6$ just disregard it and roll again, until we draw a number which is not $6$. In that case the expected number of rolls is $\frac{6}{5}$.
So, one way to get probability of $\frac{1}{7}$ is basically the same, choosing $7$ predefined ordered pairs of 2 rolls to be the success set, and disregard any other combination (and to roll the dice twice again, if other combination occurs). In that case, the expected number of dice rolls needed is $\frac{72}{7}$ which seems pretty bad to me and makes we wonder... is there a better way?
Generalization
In general, if we have a $k$-sided dice what is the optimal way of obtaining an event with probability $\frac1m$ using the least expected dice rolls? And what if we want to simulate an $m$-side dice and not just one event?