It's Saturday, so time for some fun physics. This non-trivial question is often asked in international physics contests and requires a bit of out of the box thinking. Let's imagine a perfectly symmetrical pencil in terms of density, whose tip - just one atom thick of graphite - lies on a perfectly smooth surface. We want it to be perfectly still and perfectly upright to balance on the surface. The real world isn't perfect of course, but these sort of assumptions are important to make the problem tractable since we can describe the system's behavior through equations that can predict what happens next, like will the pencil balance or not? Well, first of all the pencil balancing act fails almost immediately depending on far you want to go with "perfect" model assumptions. One single photon hitting the pencil is enough to unbalance the graphite rod. Then there are tidal forces exerted by the moon and the sun. Then of course, given Earth's gravity, only one atom thick tip can't sustain the weight of a pencil and would break. For graphite, the thinnest tip you could use to withstand the weight of a pencil is 0.01 millimeters, which is amazingly sharp by not nearly atomic.
Even if we cool to absolute zero, vacuum and put the pencil in a pitch black room, in the end, it would all boil down to quantum mechanics toppling our pencil. A clever Physics Stackexchange user called Floris sums it up for us:
Momentum and position form a conjugate pair. ΔxΔp≥ℏ.
Angular momentum and angular position form one too. ΔLΔΘ≥ℏ
This doesn't guarantee that angular momentum and angular position will be non-zero. It is an uncertainty - The actual values can be anything, including 0.
But it does prevent you from arranging them both so the pencil stays upright. Furthermore, if you ask what the probability of finding both values very close to 0, you find that it is very small. In the limit, infinitely improbable.
If it turns out that L=Θ=ℏ√, and you plug in reasonable values for the mass and length of the pencil, you will find it falls over in a few seconds.
Another very in-depth explanation of the one-atom-thick pencil problem can be found at The Virtuosi.