How far will water squirt out from a hole in a can?

Say you have a bottle of water filled up to a height H. A small hole is drilled in its side at a height d, so that water squirts out. The squirting water travels in an arc as it falls, covering some horizontal distance S away from the bottle before it hits the table top that the bottle sits on. Multi-part question to try to understand this completely:

1. At what height d should the hole be placed so that its horizontal travel distance S is maximized?

2. Will S or the optimum value of d depend on the hole diameter?

3. Does the answer change if you assume that the hole presents zero impedance to the water flow? This might not make sense to ask, or it might be equivalent to asking what happens in the limit of a very large-sized hole (see #2). Not sure.

Thanks to anyone who can help!

-
This isn't a homework question, is it? If not, I'm a little curious about what your motivation is for asking the question. I feel like it might improve the quality of the answers if we know why you want to know about this. – David Z Mar 4 '11 at 6:57
No, it's not a homework assignment. This was a project in a science fair I judged and I wanted to check with others if I was right in my assessment of it. My solution method is to say J=sigP, where J=rhov_h is the water flux from the hole and v_h the horizontal velocity. P=rhog*(H-d) is the pressure at the hole position. Then the time to hit the ground goes as sqrt(d), so you end up just maximizing S = Ksqrt(d)*(H-d) for a constant K, with the result being d=H/3. But I'm not sure if there's a better solution method using conservation of energy, or if the hole diameter matters. – user1743 Mar 4 '11 at 14:13
– Dale May 7 '13 at 19:57

Edit: I can't figure out all of your notation, but basically it's the correct idea (up to a prefactor, if I'm not mistaken). One thing that people in fluid dynamics tend to do, is to isolate the influence of gravity from pressure. The streamline runs from the top of the can (with P = atmospheric pressure = 0) to the side of the can, where it's also in contact with the air, so at the same pressure, P = 0. You then know that $v^2/2 + gz$ is constant along the streamline, where z is your vertical coordinate. By integrating, you find that $v = \sqrt(2g(H-d))$ (since on the fluid surface, the water has zero velocity). Indeed you find that $S \propto \sqrt{}[d(H-d)]$, which however is maximal at $d = H/2.$ In terms of hole diameter: we should question whether our assumptions on the flow have been correct. Implicitly, we've taken it to be steady, without divergence, rotation and viscosity. The viscosity one is the most dangerous, since a typical size of viscous flow is given by $\frac{\nu}{v},$ where $\nu$ is a liquid's viscosity. Depending on the liquid you put in and its height/velocity, you can find yourself in a viscous regime, which might alter the flow and violate our assumptions.