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:


*

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

*Will $S$ or the optimum value of $d$ depend on the hole diameter?

*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.
 A: If David's right, and this is a homework problem, I'll just give a few hints. Consider a hole at height d. Since there is a flow in the can, there is a streamline; draw it. Now apply Bernoulli's law to this streamline to find the velocity at the point of exit. Finally, using some Newtonian mechanics (parabolic flight etc.), calculate where the water lands on the ground.
Finally, think about the hole diameter after you've done the above steps.
[If it wasn't a homework problem or the above hints were not really useful, I'll be happy to elaborate.]
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. 
