## Wednesday, February 3, 2010

### Fox 240

Now this asks little more than geometry.
Note that the random process described in the question is discrete.
Ladybugs "appear" in next vertices at the same time.

1. B - is my answer.

2. Such a simple problem, and the correct answer isn't even listed as an option!

F) 3*sqrt(2)/4

Hint: Checkerboard

-DM

3. Probability of each distance case:

* Distance 0: 25%
* Distance 1: 0%
* Distance sqrt(2): 75%
* Distance sqrt(3): 0%

Average distance = 3*sqrt(2)/4 = approx. 1.061

4. The Perl source code of my simulation program is shown below.

#!/usr/local/bin/perl

\$N = 1000;
\$f = 100/\$N;
\$sum = 0;
%sums = (0, 0, 0, 0);
(\$x1, \$y1, \$z1) = (0, 0, 1);
(\$x2, \$y2, \$z2) = (1, 1, 1);
%vectors = (
"0,0,0", [[1,0,0],[0,1,0],[0,0,1]],
"0,0,1", [[1,0,0],[0,1,0],[0,0,-1]],
"0,1,0", [[1,0,0],[0,-1,0],[0,0,1]],
"0,1,1", [[1,0,0],[0,-1,0],[0,0,-1]],
"1,0,0", [[-1,0,0],[0,1,0],[0,0,1]],
"1,0,1", [[-1,0,0],[0,1,0],[0,0,-1]],
"1,1,0", [[-1,0,0],[0,-1,0],[0,0,1]],
"1,1,1", [[-1,0,0],[0,-1,0],[0,0,-1]]);

MAIN: {
my \$d;
for (\$i=0; \$i<\$N; \$i++) {
\$d = abs(\$x1-\$x2)+abs(\$y1-\$y2)+abs(\$z1-\$z2);
\$sums[\$d]++;
\$sum += sqrt((\$x1-\$x2)**2 + (\$y1-\$y2)**2 + (\$z1-\$z2)**2);
(\$x1,\$y1,\$z1) = &get_next(\$x1,\$y1,\$z1);
(\$x2,\$y2,\$z2) = &get_next(\$x2,\$y2,\$z2);
}
printf("Average distance: %.2f\n", \$sum/\$N);
printf("(0: %.0f%) (1: %.0f%) (sqrt(2): %.0f%) (sqrt(3): %.0f%)\n",
\$sums[0]*\$f, \$sums[1]*\$f, \$sums[2]*\$f, \$sums[3]*\$f);
}
sub get_next() {
my (\$x,\$y,\$z) = @_;
my (\$dx,\$dy,\$dz);
my \$index = int(rand(3));
my \$key;

\$key = sprintf("%d,%d,%d", \$x, \$y, \$z);
\$x += \$vectors{\$key}->[0][\$index];
\$y += \$vectors{\$key}->[1][\$index];
\$z += \$vectors{\$key}->[2][\$index];

return(\$x,\$y,\$z);
}

5. Do not use all of these Private Money Lender here.They are located in Nigeria, Ghana Turkey, France and Israel.My name is Mrs.Ramirez Cecilia, I am from Philippines. Have you been looking for a loan?Do you need an urgent personal or business loan?contact Fast Legitimate Loan Approval he help me with a loan of \$78.000 some days ago after been scammed of \$19,000 from a woman claiming to be a loan lender from Nigeria but i thank God today that i got my loan worth \$78.000.Feel free to contact the company for a genuine financial call/whats-App Contact Number +918929509036 Email:(fastloanoffer34@gmail.com)