Question:
In right triangle $ABC$, $\angle B = 90^\circ$, and $D$ and $E$ lie on $AC$ such that $\overline{BD}$ is a median and $\overline{BE}$ is an altitude.  If $BD=2\cdot DE$, compute $\frac{AB}{EC}$. [asy]

pair A,B,C,D,E;

A=(0,0); C=(2,0); B=(1.5,sqrt(3)/2); D=(1,0); E=(1.5,0);

draw(A--B--C--cycle); draw(B--D); draw(B--E);

label("$A$",A,SW); label("$B$",B,N); label("$C$",C,SE); label("$D$",D,S); label("$E$",E,S);

draw(rightanglemark(B,E,D,2));

[/asy]

Answer:
Let $\overline{DE}$ have length $x$, so $\overline{BD}$, the median, has length $2x$.  In a right triangle, the median to the hypotenuse has half the length of the hypotenuse, so $AD=DC=2x$ as well.  Then, \[EC=DC-DE=2x-x=x.\]We can find $BE$ by using the Pythagorean theorem on right triangle $\triangle BDE$, which gives \[BE=\sqrt{BD^2-DE^2}=\sqrt{(2x)^2-x^2}=x\sqrt{3}.\]We have $AE=AD+DE=2x+x=3x$.  Now, we use the Pythagorean theorem on right triangle $\triangle ABE$, which gives \[AB=\sqrt{AE^2+BE^2}=\sqrt{(3x)^2+(x\sqrt{3})^2}=2x\sqrt{3}.\](Triangles $\triangle BDE$ and $\triangle ABE$ have sides in a $1:\sqrt{3}:2$ ratio, so they are $30^\circ-60^\circ-90^\circ$ triangles; there are others, too.)

Finally, we have \[\frac{AB}{EC}=\frac{2x\sqrt{3}}{x}=\boxed{2\sqrt{3}}.\]