begin{code}
a = 625. #1/8 in
b = .0003051787894765625 #.00152594394838142 / 625
c=1350 #the radius of the earth
d=a/c #the height above ground level in feet at which the stream enters the beehive from below
e = 2. #the number of wagons of grain carried by each person
f = .0896667 #the probability that a particular grain will land on the ground, not the wagon.
g=1/(8*3.1415926) #the radius of the stream in feet
end{code}
The Juggalos know that if the beehive is located at d =0, then when it rains,
half the time the whole stream will flow underground and the
other half will overtop the beehive. When this happens, they have a
hose in the back of their 1973 Chevrolet Impala with the engine
running and the exhaust pipe still attached to the catalytic converter.
The Juggalos know that if they are lucky enough to be able to turn on
the water as soon as it starts raining, the flow will go underground
until it is stopped by a large rock or a very deep ditch.
begin{code}
function [X]=beehive(d,a,e,f) #function that returns a vector containing all the locations where beehives can be located and the grain yield
if e==1 #if each person only carries one wagon of grain and there are no extra supplies on hand
h=floor(sqrt((a-d)^2+f^2)); #the height above ground level in feet at which the stream enters the beehive from below
X = [h;d]; #the vector containing all the locations where beehives can be located and the grain yield for each
elseif e==2 #if each person carries two wagons of grain, the probability that a particular grain will land on the ground, not the wagon.
h=floor(sqrt((a-d)^2+f^2)); #the height above ground level in feet at which the stream enters the beehive from below
X = [h;d]; #the vector containing all the locations where beehives can be located and the grain yield for each
end
end{code}