0135: "Substitute"
Moderators: Moderators General, Prelates, Magistrates
The Answer
Someone linked this comic to another blog and it just kept wearing me down every time I read that blog, so I came up with the answers.
1) You will get 37.5m in 6.217s before you're eaten. The raptor doesn't even have time to get to his max speed.
2) You need to steer 18.6 degrees to either side of the wounded raptor. You have 4.32 seconds to live before two raptors grab you. This assumes that raptors take no time to turn to follow you. The problem states they do follow you instead of just figuring out how to intercept you. It also assumes both able and wounded raptors accelerate at 4m/s/s as in problem 1, and that turning doesn't affect it. If the turn time of a raptor is nonzero, you could cleverly run at the wounded raptor and try to get it spinning before the other two found you.
Here's a python program that solves it. It's kind of brute force because I forgot how to do the calculus. I was lazy. I just kept narrowing the angle range until I found the answer. I hope this message board doesn't strip the whitespace... indentation is meaningful in python!
1) You will get 37.5m in 6.217s before you're eaten. The raptor doesn't even have time to get to his max speed.
2) You need to steer 18.6 degrees to either side of the wounded raptor. You have 4.32 seconds to live before two raptors grab you. This assumes that raptors take no time to turn to follow you. The problem states they do follow you instead of just figuring out how to intercept you. It also assumes both able and wounded raptors accelerate at 4m/s/s as in problem 1, and that turning doesn't affect it. If the turn time of a raptor is nonzero, you could cleverly run at the wounded raptor and try to get it spinning before the other two found you.
Here's a python program that solves it. It's kind of brute force because I forgot how to do the calculus. I was lazy. I just kept narrowing the angle range until I found the answer. I hope this message board doesn't strip the whitespace... indentation is meaningful in python!
Code: Select all
import math
x = 'x'
y = 'y'
v = 'v'
a = 'a'
maxv = 'maxv'
ang = 'ang'
dt = 0.01
def target(alpha,beta):
dist = math.sqrt((alpha[x]beta[x])**2+(alpha[y]beta[y])**2)
if alpha[x] == beta[x]:
if alpha[y] > beta[y]:
gamma = 3.0*math.pi/2.0
else:
gamma = math.pi/2.0
else:
gamma = math.atan((alpha[y]beta[y])/(alpha[x]beta[x]))
if alpha[x] > beta[x]:
gamma = math.pigamma
return (dist,gamma)
def move(mob):
global x, y, v, a, maxv, ang, dt
mob[x] += mob[v]*dt*math.cos(mob[ang])
mob[y] += mob[v]*dt*math.sin(mob[ang])
def flee(deg):
global x, y, v, a, maxv, ang, dt
dist0 = 20.0
t = 0.0
r1 = { x: dist0, y: 0.0, v: 0.0, a: 4.0, maxv: 10.0, ang:0.0 }
r2 = { x: dist0*math.cos(2.0*math.pi/3.0), y: dist0*math.sin(2.0*math.pi/3.0), v:0.0, a:4.0, maxv: 25.0, ang:0.0 }
you = { x: 0.0, y: 0.0, v:6.0, a:0.0, maxv:6.0, ang:2.0*math.pi*deg/360.0 }
for nada in range(10000):
t += dt
move(you)
dist, gamma = target(r1,you)
if dist < r1[v]*dt:
#print 'Caught by wounded raptor at %f seconds' % t
break
r1[v] += r1[a]*dt
if r1[v] > r1[maxv]: r1[v] = r1[maxv]
r1[ang] = gamma
move(r1)
dist, gamma = target(r2,you)
if dist < r2[v]*dt:
#print 'Caught by able raptor at %f seconds' % t
break
r2[v] += r2[a]*dt
if r2[v] > r2[maxv]: r2[v] = r2[maxv]
r2[ang] = gamma
move(r2)
return t
for delta in range(18600,18700):
print delta/1000.0,flee(delta/1000.0)
I saw someone else had solved this, evidently by making the triangle 20m a side, not with all the raptors 20m from the victim. Plugging that in, I get a best angle of 28.5 degrees to the left or right of the wounded raptor, to survive 3.626 seconds.
Not sure why we ended up with different numbers!
I'll have to make some pretty pictures to make sure everything is okay.
Not sure why we ended up with different numbers!
I'll have to make some pretty pictures to make sure everything is okay.
And to put this to bed, I had an error in the way I used the ATAN function which screwed things up. The answer I have is 57.2 degrees off the wounded raptor, which agrees with those of the previous team. Or close enough at any rate.
It was pretty clear when I hooked my program to a plot program; the wounded raptor turned in a circle first. Well, it was more wounded than we thought!
It was pretty clear when I hooked my program to a plot program; the wounded raptor turned in a circle first. Well, it was more wounded than we thought!
xkcd wrote:zombiereagan wrote:beyond the need for a good dinosaur movie is the need for a sweet dinosaur killing video game. The first two Dino Hunter's were a good time but the 3rd one was terrible and i need my raptor hunting fix. Or rather i want to test my wits against a pack of intelligent raptors rather than just blast them with my autoaim as they appear on screen.
I've always wanted the game where you play as the dinosaurs, but only if done well. Like, where they do a good job of making you feel like you're actually a dinosaur, and not just watching one move in response to your commands. Like Oni was with martial arts, when compared to the six minutes of BloodRayne I played..
There's a game coming out called ParaWorld, which is an RTS featuring dinosaurs. With frickin' laser beams attached. If that dosen't excite you you may very well be dead.
http://pc.ign.com/objects/682/682114.html
 nogenius
 Seemed like a good idea at the time
 Posts: 4217
 Joined: Wed May 17, 2006 6:32 pm UTC
 Location: empty set \0
 Contact:
Bot, were you even reading that?
I don't sing, I just shout. All. On. One. Note.
Official ironmen you are free, champions officially
The Mighty Thesaurus wrote:Why? It does nothing to address dance music's core problem: the fact that it sucks.

 Posts: 1
 Joined: Fri Dec 15, 2006 1:58 am UTC
I gave up trying to solve this the elegant way, so I simulated it with a C program. In my solution I assume that the raptors are *always* running toward your current location. In other words they haven't precomputed the optimal intercept course based on your current heading.
OK  My solution is 32.784 degrees front the horizontal (left or right). This lets you live for 3.104 seconds.
BTW  There are a number of solutions posted here that reckon you can live longer that 4.3 seconds. Which is just plain wrong. The LAST raptor to catch you will be the one you are running directly away from. Since you start 11.547 m away it is very similar to question one. It will take this raptor 4.3 seconds to catch you.
Here is the code:
( BTW  I ran it a few times to home in on the solution space between 32 and 33 degrees  wider the search if you want but it'll take a LOT longer to run. )
#include <math.h>
double dist(double x1,double y1,double x2,double y2) {
return sqrt((x2x1)*(x2x1)+(y2y1)*(y2y1));
}
double slope(double x1,double y1,double x2,double y2) {
return(atan((y2y1)/(x2x1)));
}
void main(int argc,char **argv) {
struct {
double x;
double y;
double speed;
double new_speed;
double dist;
} a,b,c,you;
double dist_a, dist_b,dist_c;
double raptor_accel=4.0;
double you_dir=30.0;
double interval=0.001;
double time=0.0000;
double grad;
double pi = 3.1415926535897932384626433832795;
int i;
double best_dir=0;
double best_time=0.0;
char best_got;
char got;
for (you_dir=32;you_dir<33;you_dir += 0.001) {
you.x = you.y = 0.0;
a.x = 0; a.y = 11.547005383792515290182975610039;
b.x = 10;b.y = 5.7735026918962576450914878050196;
c.x = 10;c.y=5.7735026918962576450914878050196;
a.dist = b.dist = c.dist = you.dist = 0.0;
a.speed = b.speed = c.speed = 0.0;
a.new_speed = b.new_speed = c.new_speed = 0.0;
you.speed = 6.0;
time = 0;
while (1) {
dist_a = dist(a.x,a.y,you.x,you.y);
dist_b = dist(b.x,b.y,you.x,you.y);
dist_c = dist(c.x,c.y,you.x,you.y);
/*
printf("you at at (%f,%f) travelled %f\n",you.x,you.y,you.dist);
printf("raptor a at (%f,%f) ( distance %f)  travelled %f\n",a.x,a.y,dist_a,a.dist);
printf("raptor b at (%f,%f) ( distance %f)  travelled %f\n",b.x,b.y,dist_b,b.dist);
printf("raptor c at (%f,%f) ( distance %f)  travelled %f\n",c.x,c.y,dist_c,c.dist);
*/
if (dist_a == 0.0 ) {
printf("Raptor a got you in %f secs!\n",time);
break;
}
if (dist_b == 0.0 ) {
printf("Raptor b got you in %f secs!\n",time);
break;
}
if (dist_c == 0.0 ) {
printf("Raptor c got you in %f secs!\n",time);
break;
}
time += interval;
/* You Move first */
you.x += you.speed*interval*cos(pi*you_dir/180);
you.y += you.speed*interval*sin(pi*you_dir/180);
you.dist +=you.speed*interval;
/* Accelerate the raptors */
a.new_speed += raptor_accel*interval;
b.new_speed += raptor_accel*interval;
c.new_speed = b.new_speed;
if (a.new_speed > 10.0 )
a.new_speed = 10.0;
if (b.new_speed > 25.0 )
c.new_speed = b.new_speed = 25.0;
/*
printf("a raptor_speed is now %f\n",a.new_speed);
printf("b and c raptor_speed is now %f\n",b.new_speed);
*/
/* Raptor a moves */
if ( a.speed*interval > dist_a ) {
/*
printf("Raptor a will get you within this interval time is %f secs!\n",time);
*/
got = 'a';
break;
}
grad = slope(a.x,a.y,you.x,you.y);
a.x += (a.new_speed+a.speed)/2*interval*cos(grad);
a.y += (a.new_speed+a.speed)/2*interval*sin(grad);
a.dist += (a.new_speed+a.speed)/2*interval;
a.speed = a.new_speed;
/* Raptor b moves */
if ( b.speed *interval > dist_b ) {
/*
printf("Raptor b will get you within this interval time is %f secs!\n",time);
*/
got = 'b';
break;
}
grad = slope(b.x,b.y,you.x,you.y);
b.x += (b.new_speed+b.speed)/2*interval*cos(grad);
b.y += (b.new_speed+b.speed)/2*interval*sin(grad);
b.dist += (b.new_speed+b.speed)/2*interval;
b.speed = b.new_speed;
/* Raptor c moves */
if ( c.speed*interval > dist_c ) {
/*
printf("Raptor c will get you within this interval time is %f secs!\n",time);
*/
got = 'c';
break;
}
grad = slope(c.x,c.y,you.x,you.y);
if ( c.x > you.x ) {
c.x = (c.new_speed+c.speed)/2*interval*cos(grad);
c.y = (c.new_speed+c.speed)/2*interval*sin(grad);
}
else {
c.x += (c.new_speed+c.speed)/2*interval*cos(grad);
c.y += (c.new_speed+c.speed)/2*interval*sin(grad);
}
c.dist += (c.new_speed+c.speed)/2*interval;
c.speed = c.new_speed;
}
if ( time > best_time ) {
best_time = time;
best_dir = you_dir;
best_got = got;
}
}
printf("Best time is %f best dir is %f got by raptor %c\n",best_time,best_dir,best_got);
}
OK  My solution is 32.784 degrees front the horizontal (left or right). This lets you live for 3.104 seconds.
BTW  There are a number of solutions posted here that reckon you can live longer that 4.3 seconds. Which is just plain wrong. The LAST raptor to catch you will be the one you are running directly away from. Since you start 11.547 m away it is very similar to question one. It will take this raptor 4.3 seconds to catch you.
Here is the code:
( BTW  I ran it a few times to home in on the solution space between 32 and 33 degrees  wider the search if you want but it'll take a LOT longer to run. )
#include <math.h>
double dist(double x1,double y1,double x2,double y2) {
return sqrt((x2x1)*(x2x1)+(y2y1)*(y2y1));
}
double slope(double x1,double y1,double x2,double y2) {
return(atan((y2y1)/(x2x1)));
}
void main(int argc,char **argv) {
struct {
double x;
double y;
double speed;
double new_speed;
double dist;
} a,b,c,you;
double dist_a, dist_b,dist_c;
double raptor_accel=4.0;
double you_dir=30.0;
double interval=0.001;
double time=0.0000;
double grad;
double pi = 3.1415926535897932384626433832795;
int i;
double best_dir=0;
double best_time=0.0;
char best_got;
char got;
for (you_dir=32;you_dir<33;you_dir += 0.001) {
you.x = you.y = 0.0;
a.x = 0; a.y = 11.547005383792515290182975610039;
b.x = 10;b.y = 5.7735026918962576450914878050196;
c.x = 10;c.y=5.7735026918962576450914878050196;
a.dist = b.dist = c.dist = you.dist = 0.0;
a.speed = b.speed = c.speed = 0.0;
a.new_speed = b.new_speed = c.new_speed = 0.0;
you.speed = 6.0;
time = 0;
while (1) {
dist_a = dist(a.x,a.y,you.x,you.y);
dist_b = dist(b.x,b.y,you.x,you.y);
dist_c = dist(c.x,c.y,you.x,you.y);
/*
printf("you at at (%f,%f) travelled %f\n",you.x,you.y,you.dist);
printf("raptor a at (%f,%f) ( distance %f)  travelled %f\n",a.x,a.y,dist_a,a.dist);
printf("raptor b at (%f,%f) ( distance %f)  travelled %f\n",b.x,b.y,dist_b,b.dist);
printf("raptor c at (%f,%f) ( distance %f)  travelled %f\n",c.x,c.y,dist_c,c.dist);
*/
if (dist_a == 0.0 ) {
printf("Raptor a got you in %f secs!\n",time);
break;
}
if (dist_b == 0.0 ) {
printf("Raptor b got you in %f secs!\n",time);
break;
}
if (dist_c == 0.0 ) {
printf("Raptor c got you in %f secs!\n",time);
break;
}
time += interval;
/* You Move first */
you.x += you.speed*interval*cos(pi*you_dir/180);
you.y += you.speed*interval*sin(pi*you_dir/180);
you.dist +=you.speed*interval;
/* Accelerate the raptors */
a.new_speed += raptor_accel*interval;
b.new_speed += raptor_accel*interval;
c.new_speed = b.new_speed;
if (a.new_speed > 10.0 )
a.new_speed = 10.0;
if (b.new_speed > 25.0 )
c.new_speed = b.new_speed = 25.0;
/*
printf("a raptor_speed is now %f\n",a.new_speed);
printf("b and c raptor_speed is now %f\n",b.new_speed);
*/
/* Raptor a moves */
if ( a.speed*interval > dist_a ) {
/*
printf("Raptor a will get you within this interval time is %f secs!\n",time);
*/
got = 'a';
break;
}
grad = slope(a.x,a.y,you.x,you.y);
a.x += (a.new_speed+a.speed)/2*interval*cos(grad);
a.y += (a.new_speed+a.speed)/2*interval*sin(grad);
a.dist += (a.new_speed+a.speed)/2*interval;
a.speed = a.new_speed;
/* Raptor b moves */
if ( b.speed *interval > dist_b ) {
/*
printf("Raptor b will get you within this interval time is %f secs!\n",time);
*/
got = 'b';
break;
}
grad = slope(b.x,b.y,you.x,you.y);
b.x += (b.new_speed+b.speed)/2*interval*cos(grad);
b.y += (b.new_speed+b.speed)/2*interval*sin(grad);
b.dist += (b.new_speed+b.speed)/2*interval;
b.speed = b.new_speed;
/* Raptor c moves */
if ( c.speed*interval > dist_c ) {
/*
printf("Raptor c will get you within this interval time is %f secs!\n",time);
*/
got = 'c';
break;
}
grad = slope(c.x,c.y,you.x,you.y);
if ( c.x > you.x ) {
c.x = (c.new_speed+c.speed)/2*interval*cos(grad);
c.y = (c.new_speed+c.speed)/2*interval*sin(grad);
}
else {
c.x += (c.new_speed+c.speed)/2*interval*cos(grad);
c.y += (c.new_speed+c.speed)/2*interval*sin(grad);
}
c.dist += (c.new_speed+c.speed)/2*interval;
c.speed = c.new_speed;
}
if ( time > best_time ) {
best_time = time;
best_dir = you_dir;
best_got = got;
}
}
printf("Best time is %f best dir is %f got by raptor %c\n",best_time,best_dir,best_got);
}
Assuming that the person runs in a straight line, I get the solution as t=3.08 seconds.
There's a discussion in this forum for the more general case, when the raptor has a finite acceleration, and when it changes its path depending on the where the person is running. (Which is more realistic, as the raptors we know are hyper intelligent)
There's a discussion in this forum for the more general case, when the raptor has a finite acceleration, and when it changes its path depending on the where the person is running. (Which is more realistic, as the raptors we know are hyper intelligent)
 joeframbach
 Posts: 1478
 Joined: Sun Nov 05, 2006 12:49 am UTC
 Location: The City of Steel
 Contact:
I used the comic for the Computer Science department's "CS Day" Poster Competition here at Pitt. Here's what I turned in: http://www.pitt.edu/~jrf27/cs1515/poster/jrf27.pdf
It's a 2'x3' pdf. The competition isn't judged until next friday (the 23rd), but I'll let you guys know how it goes.
Also, C source code here: http://www.pitt.edu/~jrf27/cs1515/poster/raptor.c
Questions, Comments, Concerns, Complaints?
It's a 2'x3' pdf. The competition isn't judged until next friday (the 23rd), but I'll let you guys know how it goes.
Also, C source code here: http://www.pitt.edu/~jrf27/cs1515/poster/raptor.c
Questions, Comments, Concerns, Complaints?
xxv/♂/♫
 Verysillyman
 "Do me! Do me!"
 Posts: 1442
 Joined: Sat Aug 19, 2006 11:25 am UTC
 Location: Drinks Cabinet.
 Contact:
On question 2, are we to assume the two raptors without limb injuries can move at the speed listed in question 1 (25 m/s)?
Also, why are the raptors in question 3 limited to 10 m/s instead of 25 m/s as in question 1? Are they hurt too?
Also, why are the raptors in question 3 limited to 10 m/s instead of 25 m/s as in question 1? Are they hurt too?
J. Starlight  Your friendly, blue husky pup.
"Furries? In my forum?!"
It's more likely than you think.
"Furries? In my forum?!"
It's more likely than you think.
Narsil wrote:There's a game coming out called ParaWorld, which is an RTS featuring dinosaurs. With frickin' laser beams attached. If that dosen't excite you you may very well be dead.
http://pc.ign.com/objects/682/682114.html
( looks at screenshots )
So uhh yeah... definitely just had a nerdgasm.
Insignificant Deification wrote:Because, sometimes, you've gotta have a taste of vulva
Jazzerus wrote:And if they are hurt, would it be possible to further hurt them in attempt to gain more distance before being eaten?
Yeah that was my theory when I first read the comic: Run directly towards the wounded raptor, getting him to accelerate towards you and giving time for the other two to close the distance between you and to accelerate themselves. Then, at the last possible second you sidestep and run around the wounded raptor, putting him between you and the other two raptors. Hopefully the three raptors will collide, allowing you to escape, or at least make it back to your shotgun so you can take a couple of them out with you.
Insignificant Deification wrote:Because, sometimes, you've gotta have a taste of vulva

 Posts: 2
 Joined: Tue Sep 25, 2007 5:51 pm UTC
Re: The Answer
Tipa wrote:Someone linked this comic to another blog and it just kept wearing me down every time I read that blog, so I came up with the answers.
1) You will get 37.5m in 6.217s before you're eaten. The raptor doesn't even have time to get to his max speed.
You're quite close, but I disagree  while you can run 37.3m in 6.217s, the raptor reaches his maximum speed at 5.8 seconds  25(m/s) / 4(m/s^2) = 5.8s.
You'll cover 34.8m in that time, and the raptor travels 2*5.8^2 = 67.28 in that time. That leaves you with a meager 7.52m lead at t=5.8s. The raptor is traveling 25m/s and you at 6m/s. The raptor is gaining on you at 19m/s and closes the 7.52m in 7.52/19 = 0.3957s.
All told, you ran for 5.8s + 0.396s = 6.196s before getting eaten.
Our answers were basically the same, but I wanted to point out that the raptor does indeed reach her maximum speed. Clever girl.
Re: "Substitute" discussion
Just thought some people here might be interested... my fiance is teaching a Calculus course this semester... he decided to give a quiz. =)
Re: "Substitute" discussion
Am I the only one who noticed that in problem 1, a raptor's top speed is said to be 25 m/s, in problem 2, a wounded raptor is said to run at 10 m/s, while in problem 3, it's said that raptors in general run at 10 m/s.
Or maybe I was the only one with enough time on his hands to pay attention that closely.
Or maybe I was the only one with enough time on his hands to pay attention that closely.
Re: "Substitute" discussion
You just made a brilliant example of treadomancy.
But for my first post to be a useful comment, I guess raptors don't run as fast in an enclosed space. Could you run as fast in a small corridor as you would in an open field? And, maybe that those in the field are Alphamale, wich are the biggest and meanest of all raptor.
Domokun!
But for my first post to be a useful comment, I guess raptors don't run as fast in an enclosed space. Could you run as fast in a small corridor as you would in an open field? And, maybe that those in the field are Alphamale, wich are the biggest and meanest of all raptor.
Domokun!
DOMOKUN

 Posts: 524
 Joined: Wed Oct 17, 2007 4:29 am UTC
 Location: Perth, Western Australia
Re: "Substitute" discussion
HMBeast wrote:Am I the only one who noticed that in problem 1, a raptor's top speed is said to be 25 m/s, in problem 2, a wounded raptor is said to run at 10 m/s, while in problem 3, it's said that raptors in general run at 10 m/s.
Six posts above yours:
Jazzerus wrote:Also, why are the raptors in question 3 limited to 10 m/s instead of 25 m/s as in question 1? Are they hurt too?

 Posts: 3
 Joined: Sun Mar 16, 2008 2:59 am UTC
Re:
ArbiterOne wrote:Tell me if this is right. I tried to 'intuit' my way through this.
Since the system is symmetrical, there are two correct angles.
The angle you need to run is between the wounded raptor and a nonwounded raptor (either side). Now, my guess would be that it would be:Code: Select all
angle between raptors * ( speed of wounded raptor / (speed of wounded raptor + speed of nonwounded raptor) )
120 * ( 10 / (10 + 25) )
~= 34.285 degrees
or 274.285 degrees
... is there actually a canonical answer to this?
POST THE MAP so we can do question 3!
isnt the answer 24 degrees or 336 degrees because: there is an angle of 60 degrees between the wounded raptor (10ms^1) and a healthy raptor (25ms^1), thus, logic would dictate that 10/25 = x/60 , thus x = 24 and 24 degrees is the answer. (as well as 336 degrees which is on the other side of the raptor [36024=336])
 joeframbach
 Posts: 1478
 Joined: Sun Nov 05, 2006 12:49 am UTC
 Location: The City of Steel
 Contact:
Re: Re:
el stubbso wrote:ArbiterOne wrote:Tell me if this is right. I tried to 'intuit' my way through this.
Since the system is symmetrical, there are two correct angles.
The angle you need to run is between the wounded raptor and a nonwounded raptor (either side). Now, my guess would be that it would be:Code: Select all
angle between raptors * ( speed of wounded raptor / (speed of wounded raptor + speed of nonwounded raptor) )
120 * ( 10 / (10 + 25) )
~= 34.285 degrees
or 274.285 degrees
... is there actually a canonical answer to this?
POST THE MAP so we can do question 3!
isnt the answer 24 degrees or 336 degrees because: there is an angle of 60 degrees between the wounded raptor (10ms^1) and a healthy raptor (25ms^1), thus, logic would dictate that 10/25 = x/60 , thus x = 24 and 24 degrees is the answer. (as well as 336 degrees which is on the other side of the raptor [36024=336])
That would be true if the raptors traveled in a straight line. They will always run toward you, so as a result, they travel on a nonstraight curve.
Watch the video on Matt's website: http://www.mbeckler.org/velociraptors/video_with_trails.avi
xxv/♂/♫
Re: "Substitute" discussion
Here's my graph of the solution...
In the first quadrant, it corresponds to an angle of 0.56 rad or 32.1 deg.
After looking at Mr. Frambach's poster, it looks like I did something very similar to what he did, only in java. You know, using differentials to step through the raptor's path until it is close enough to the human to eat it.
Anyway, fun problem to solve
Edit: just noticed Mr. Frambach had code posted up there... mine's a lot less involved, but it does require a slight modification when you change quadrants (because of the sign of the slope).
In the first quadrant, it corresponds to an angle of 0.56 rad or 32.1 deg.
After looking at Mr. Frambach's poster, it looks like I did something very similar to what he did, only in java. You know, using differentials to step through the raptor's path until it is close enough to the human to eat it.
Anyway, fun problem to solve
Edit: just noticed Mr. Frambach had code posted up there... mine's a lot less involved, but it does require a slight modification when you change quadrants (because of the sign of the slope).
 Jekka_Lynn
 Posts: 10
 Joined: Fri Apr 18, 2008 6:40 pm UTC
 Location: Canada
 Contact:
Re: "Substitute" discussion
Lol, I keep forgetting how big of nerds my fiance and my best friend really are but this comic proved it once again. They took a minute to read it, laugh and just appreciate it as a good comic....Then spent the next 1520 minutes trying to work out all the questions in their heads. They then demanded the rest of question # 3 and when i didn't have it. Pouted and demanded I get it and the correct answers to the 1st 2....
*Edit...oops spelling mistakes
*Edit...oops spelling mistakes
I'm NOT SHORT!!!!!
Spoiler:
Re: "Substitute" discussion
As a probable answer to the problem with raptors moving at 10 m/s in 3, It is obvious that since raptors are not built for indoor chasing, they move signifigantly slower because they have to deal with walls, furniture, doors, etc.
Re: "Substitute" discussion
Hmmm...yes...
To test this, we are going to need to make a new Jurassic Park, and create an indoor raptor obstacle course.
To test this, we are going to need to make a new Jurassic Park, and create an indoor raptor obstacle course.
Re: "Substitute" discussion
Hello everyone,
I'm one of them "long time reader/first time poster" types. I posed the second question in the quiz as a question to some students as a joke, then decided that I should actually solve it. Looking around the internet and these boards, it seems that the problem is pretty effectively solved when you assume the raptors constantly turn to face you as you run. I decided to modify the problem such that the raptors are intelligent enough to lead you such that they move in a straight line.
I analyzed the problem two ways: assuming instant accelerations and accelerations as given in the problem. The results are summarized in a pdf (explaining the approach) and an excel sheet (with the work):
pdf
xls
The results are as follows:
If the raptors instantly accelerate to their top speeds:
The maximum possible lifetime of .54 seconds occurs when you run straight at the wounded raptor (the healthy raptors still grab you).
The minimum possible lifetime of .37 seconds occurs when you run straight at either of the healthy raptors.
If the raptors accelerate as described in the problem:
The maximum possible lifetime of 2.68 seconds occurs when you run directly between any two of the raptors (so if 0 radians points straight at a raptor, choose pi/3, pi, or 5pi/3 radians)  the fact that one is wounded makes no difference!
The minimum possible lifetime of 1.34 seconds occurs when you run directly at any of the three raptors  again, the fact that one is wounded makes no difference.
This is because the raptors accelerate at the same rate; the wounded one stops accelerating faster, (after 2.5 seconds as opposed to 6.25 seconds), but almost all of the action has occurred by then  the maximum possible lifetime of 2.68 seconds means that the healthy raptors continue to accelerate for all of .13 seconds. This just isn't enough to make any appreciable difference.
Anyway, I just thought I'd add my contribution to the discussion. Comments are welcome!
I'm one of them "long time reader/first time poster" types. I posed the second question in the quiz as a question to some students as a joke, then decided that I should actually solve it. Looking around the internet and these boards, it seems that the problem is pretty effectively solved when you assume the raptors constantly turn to face you as you run. I decided to modify the problem such that the raptors are intelligent enough to lead you such that they move in a straight line.
I analyzed the problem two ways: assuming instant accelerations and accelerations as given in the problem. The results are summarized in a pdf (explaining the approach) and an excel sheet (with the work):
xls
The results are as follows:
If the raptors instantly accelerate to their top speeds:
The maximum possible lifetime of .54 seconds occurs when you run straight at the wounded raptor (the healthy raptors still grab you).
The minimum possible lifetime of .37 seconds occurs when you run straight at either of the healthy raptors.
If the raptors accelerate as described in the problem:
The maximum possible lifetime of 2.68 seconds occurs when you run directly between any two of the raptors (so if 0 radians points straight at a raptor, choose pi/3, pi, or 5pi/3 radians)  the fact that one is wounded makes no difference!
The minimum possible lifetime of 1.34 seconds occurs when you run directly at any of the three raptors  again, the fact that one is wounded makes no difference.
This is because the raptors accelerate at the same rate; the wounded one stops accelerating faster, (after 2.5 seconds as opposed to 6.25 seconds), but almost all of the action has occurred by then  the maximum possible lifetime of 2.68 seconds means that the healthy raptors continue to accelerate for all of .13 seconds. This just isn't enough to make any appreciable difference.
Anyway, I just thought I'd add my contribution to the discussion. Comments are welcome!
Re: "Substitute" discussion
Lujan wrote:Hello everyone,
I'm one of them "long time reader/first time poster" types. I posed the second question in the quiz as a question to some students as a joke, then decided that I should actually solve it. Looking around the internet and these boards, it seems that the problem is pretty effectively solved when you assume the raptors constantly turn to face you as you run. I decided to modify the problem such that the raptors are intelligent enough to lead you such that they move in a straight line.
I analyzed the problem two ways: assuming instant accelerations and accelerations as given in the problem. The results are summarized in a pdf (explaining the approach) and an excel sheet (with the work):
xls
The results are as follows:
If the raptors instantly accelerate to their top speeds:
The maximum possible lifetime of .54 seconds occurs when you run straight at the wounded raptor (the healthy raptors still grab you).
The minimum possible lifetime of .37 seconds occurs when you run straight at either of the healthy raptors.
If the raptors accelerate as described in the problem:
The maximum possible lifetime of 2.68 seconds occurs when you run directly between any two of the raptors (so if 0 radians points straight at a raptor, choose pi/3, pi, or 5pi/3 radians)  the fact that one is wounded makes no difference!
The minimum possible lifetime of 1.34 seconds occurs when you run directly at any of the three raptors  again, the fact that one is wounded makes no difference.
This is because the raptors accelerate at the same rate; the wounded one stops accelerating faster, (after 2.5 seconds as opposed to 6.25 seconds), but almost all of the action has occurred by then  the maximum possible lifetime of 2.68 seconds means that the healthy raptors continue to accelerate for all of .13 seconds. This just isn't enough to make any appreciable difference.
Anyway, I just thought I'd add my contribution to the discussion. Comments are welcome!
fun! i tried something like this before i decided it would be easier to just write a program. what class did you assign this to?
Re: "Substitute" discussion
It was a introductory physics course in mechanics. I made it clear that I was joking, though, and that solving the question was actually pretty hard.

 Posts: 1
 Joined: Fri Jun 27, 2008 11:16 pm UTC
Re: "Substitute" discussion
>_>
I... kinda joined the forums specifically to post in this topic. That feels kinda weird.
I've read through xkcd a couple times now, but this time through I got intrigued by this comic in particular, and decided to think through the problem, by which I mean, go to the forums and read up on the work OTHER people did. That makes it easier, after all. I saw mat_the_w's java sim, and was decently satisfied with the results, until the thought occurred to me that he wasn't in any way dealing with the inertia of the approaching velociraptor. So, looking at his diagram, the fact that the bottomright velociraptor was accelerating to the left, and then later to the right, is not represented by a net loss of energy.
Of course I had to change this. Granted, it appears in the assumptions for the simulation as "allowing the raptors to turn instantly," but I think that's not doing justice to the problem.
The problem is, even after a brief debugging session, that if the raptors don't lead off at all, as in the simulation as given, they may NEVER get closer than about three meters (or whatever the unit he's using is), but rather keep overshooting and having to turn around. When I set the "eaten" threshold to 3.25, the victim lasts about 7.5 seconds (with a heading of 1.04 radians, 59.58 degrees north of east), or about twice as long as Matt's simulation results, rather than taking infinite time. Looking at an image result of one of the "good" (successfully caught) runs (not the best run, I don't know how to get that one in particular), it was the raptor that started furthest away which caught the victim, because he didn't overshoot.
Food for thought.
Anyway, I'll keep toying with it, and try to get some visual results for you guys. For the record, these are the notable changes to Matt's code:
(prepost edit: looking at my code made me wonder what would happen if I took out the at^2 part of the position updater. It reduced lifespan to 7.12 seconds at .02 radians = 1.15 degrees north of east. I have no idea what, if anything, that means.)
I... kinda joined the forums specifically to post in this topic. That feels kinda weird.
I've read through xkcd a couple times now, but this time through I got intrigued by this comic in particular, and decided to think through the problem, by which I mean, go to the forums and read up on the work OTHER people did. That makes it easier, after all. I saw mat_the_w's java sim, and was decently satisfied with the results, until the thought occurred to me that he wasn't in any way dealing with the inertia of the approaching velociraptor. So, looking at his diagram, the fact that the bottomright velociraptor was accelerating to the left, and then later to the right, is not represented by a net loss of energy.
Of course I had to change this. Granted, it appears in the assumptions for the simulation as "allowing the raptors to turn instantly," but I think that's not doing justice to the problem.
The problem is, even after a brief debugging session, that if the raptors don't lead off at all, as in the simulation as given, they may NEVER get closer than about three meters (or whatever the unit he's using is), but rather keep overshooting and having to turn around. When I set the "eaten" threshold to 3.25, the victim lasts about 7.5 seconds (with a heading of 1.04 radians, 59.58 degrees north of east), or about twice as long as Matt's simulation results, rather than taking infinite time. Looking at an image result of one of the "good" (successfully caught) runs (not the best run, I don't know how to get that one in particular), it was the raptor that started furthest away which caught the victim, because he didn't overshoot.
Food for thought.
Anyway, I'll keep toying with it, and try to get some visual results for you guys. For the record, these are the notable changes to Matt's code:
Code: Select all
(Raptor.java::public class Raptor)
public boolean updatePosition(double dt, Movable target)
{
//After consulting the XKCD author, we have decided to remember only a linear velocity, and allow very speedy turns for the velociraptors. Perhaps this isn't a very good approximation, but for now, we'll allow the raptors to accellerate at the given rate until they reach max velocity.
double dx = target.getX()  this.getX();
double dy = target.getY()  this.getY();
double distance = Math.sqrt(dx * dx + dy * dy);
//start mod
double direction = Math.atan2(dy, dx);
double ax = ACCELERATION * dt * Math.cos(direction);
double ay = ACCELERATION * dt * Math.sin(direction);
double facing, speed;
//End mod
//This is the "caught" distance, which is also modified
if (distance < 3.25)
{
return true;
}
//start mod
currentXVelocity += ax;
currentYVelocity += ay;
speed = Math.sqrt(currentXVelocity*currentXVelocity+currentYVelocity*currentYVelocity);
if(speed > v){
facing = Math.atan2(currentYVelocity, currentXVelocity);
currentXVelocity = v * Math.cos(facing);
currentYVelocity = v * Math.sin(facing);
}
x += currentXVelocity * dt + ax * dt * dt; // x = x0 + v0*t + a*t^2
y += currentYVelocity * dt + ay * dt * dt; // y = y0 + v0*t + a*t^2
//end mod
return false;
}
(prepost edit: looking at my code made me wonder what would happen if I took out the at^2 part of the position updater. It reduced lifespan to 7.12 seconds at .02 radians = 1.15 degrees north of east. I have no idea what, if anything, that means.)
Re: The Answer
jasonsewall wrote:You're quite close, but I disagree  while you can run 37.3m in 6.217s, the raptor reaches his maximum speed at 5.8 seconds  25(m/s) / 4(m/s^2) = 5.8s.
Unfortunitly, this only works if 4 * 5.8 =/= 23.2
For most people, 25/4 = 6.25 (and the first poster's answer is spot on)
(I'm sorry, is this post allowable? I get the feeling I'm wrong to dredge it up or soemthing.)
 Elvish Pillager
 Posts: 1000
 Joined: Mon Aug 04, 2008 9:58 pm UTC
 Location: Everywhere you think, nowhere you can possibly imagine.
 Contact:
Re: "Substitute" discussion
There's something wrong with the "Raptors run directly towards you at whatever speed they're going" model, and here's why: Let's say a raptor is moving at a little less than 6 m/s, and it's one meter away from me. Now, I can travel two or three meters in less than a second, so the raptor's speed doesn't appreciably increase  I can set up the situation so that it won't exceed 6 m/s in that time. The interesting thing is that as long as it's moving slower than me, it can never catch me unless I run directly onto it  so I can run 180 degrees around it, in less than a second. Under the naive model, the raptor would have just switched  in under a second  from almost 6 m/s in one direction to almost 6 m/s in the other, which clearly violates its 4 m/s^2 acceleration limit.
At this point I would calculate the optimal strategy and duration of survival for the threeraptors problem, using a true maximum of 4 m/s^2 acceleration in any direction for the raptors. The reason I do not: If we assume, as we have been assuming, that both you and the raptors can be represented by a single point each, then, as long as my acceleration is the tiniest fraction greater than that of all the raptors, I can avoid them indefinitely.
I invite anyone to calculate the minimum distance a raptor with 4 m/s^2 maximum acceleration must be able to reach its prey at in order to be able to catch a human who can instantly change it speed to 6 m/s in any direction, given optimal play from both the raptor and the human. (I'd do it myself, but it's getting late here.)
At this point I would calculate the optimal strategy and duration of survival for the threeraptors problem, using a true maximum of 4 m/s^2 acceleration in any direction for the raptors. The reason I do not: If we assume, as we have been assuming, that both you and the raptors can be represented by a single point each, then, as long as my acceleration is the tiniest fraction greater than that of all the raptors, I can avoid them indefinitely.
I invite anyone to calculate the minimum distance a raptor with 4 m/s^2 maximum acceleration must be able to reach its prey at in order to be able to catch a human who can instantly change it speed to 6 m/s in any direction, given optimal play from both the raptor and the human. (I'd do it myself, but it's getting late here.)
Also known as Eli Dupree. Check out elidupree.com for my comics, games, and other work.
GENERATION A(g_{64}, g_{64}): Social experiment. Take the busy beaver function of the generation number and add it to your signature.
GENERATION A(g_{64}, g_{64}): Social experiment. Take the busy beaver function of the generation number and add it to your signature.
Re: "Substitute" discussion
Elvish Pillager wrote:There's something wrong with the "Raptors run directly towards you at whatever speed they're going" model, and here's why: Let's say a raptor is moving at a little less than 6 m/s, and it's one meter away from me. Now, I can travel two or three meters in less than a second, so the raptor's speed doesn't appreciably increase  I can set up the situation so that it won't exceed 6 m/s in that time. The interesting thing is that as long as it's moving slower than me, it can never catch me unless I run directly onto it  so I can run 180 degrees around it, in less than a second. Under the naive model, the raptor would have just switched  in under a second  from almost 6 m/s in one direction to almost 6 m/s in the other, which clearly violates its 4 m/s^2 acceleration limit.
At this point I would calculate the optimal strategy and duration of survival for the threeraptors problem, using a true maximum of 4 m/s^2 acceleration in any direction for the raptors. The reason I do not: If we assume, as we have been assuming, that both you and the raptors can be represented by a single point each, then, as long as my acceleration is the tiniest fraction greater than that of all the raptors, I can avoid them indefinitely.
I invite anyone to calculate the minimum distance a raptor with 4 m/s^2 maximum acceleration must be able to reach its prey at in order to be able to catch a human who can instantly change it speed to 6 m/s in any direction, given optimal play from both the raptor and the human. (I'd do it myself, but it's getting late here.)
If the raptor was traveling at some speed, stopped, and then accelerated to some speed going in the other direction, it could violate the 4 m/s/s rule. However, In the example you gave, the raptor would be making a spiral motion as it tried to track the person. That means it will experience both radial and tangential acceleration, and all of the "rule violation" can be attributed to the radial portion. To my eye the question only asserts restrictions on the tangential (or linear) acceleration  it "accelerates up to its top speed." Speed is a scalar, which to me rules out the inherently vectorial considerations of rotational motion. The initial motion of the raptor is going to have very little curvature, and it seems logical that the test writer didn't think there would be a lot of dodging like you describe  "at what angle should you run" as opposed to "what path should you take."
Now, that's not to say that considering motion like you suggest isn't worthwhile; I'm just trying to back up my claim that the 4 m/s/s refers only to the tangential/linear acceleration. Strictly speaking, then, we don't know what restrictions apply to the radial acceleration, and we should either let it be instantaneous, as is the norm, or put in our own restrictions. If we did that, though, we might as well put in restrictions on the human  and that would further change the problem.
 Angua
 Don't call her Delphine.
 Posts: 5235
 Joined: Tue Sep 16, 2008 12:42 pm UTC
 Location: UK/[St. Kitts and] Nevis Occasionally, I migrate to the US for a bit
Re:
Narsil wrote:There's a game coming out called ParaWorld, which is an RTS featuring dinosaurs. With frickin' laser beams attached. If that dosen't excite you you may very well be dead.
http://pc.ign.com/objects/682/682114.html
Does it have TRex's in F14s?
'Look, sir, I know Angua. She's not the useless type. She doesn't stand there and scream helplessly. She makes other people do that.'
GNU Terry Pratchett

 Posts: 1
 Joined: Mon Oct 27, 2008 4:47 am UTC
Re: "Substitute" discussion
I seem to be getting different answers.
1. 4*t1 = 25 t1=25/4=6.25s If the raptor reaches you before 6.25s, you ignore its top speed.
40+6t = 4t^2, 4t^26t40=0, t=4 Since the raptor reached you at 4 seconds, you are dead.
2. If all raptors run at the same speed, then, in radians, you should run at Pi/22Pi/3+(2Pi/3)/2=Pi*(3/64/6+2/6)=Pi/6 = 30 degrees. Then add 360/3=120 to 30 to get, 30, 150, and 270. (Assuming 0 degrees is the standard +x axis of course.) Since the top raptor has a top speed of 10 m/s, your best course of action is actually running at either 30 or 150 until it reaches its top speed in about 2 seconds, and then constantly changing your direction more towards 90. Since I don't know what a 20m equilateral triangle means (distance to center? perimeter? length of a side?) I can't compute the seemingly painful functional equation for one specific direction.
3. Not enough information. No map provided.
If I were attacked by raptors, I wouldn't want this "teacher" to be with me, unless you can impress raptors with math of course.
1. 4*t1 = 25 t1=25/4=6.25s If the raptor reaches you before 6.25s, you ignore its top speed.
40+6t = 4t^2, 4t^26t40=0, t=4 Since the raptor reached you at 4 seconds, you are dead.
2. If all raptors run at the same speed, then, in radians, you should run at Pi/22Pi/3+(2Pi/3)/2=Pi*(3/64/6+2/6)=Pi/6 = 30 degrees. Then add 360/3=120 to 30 to get, 30, 150, and 270. (Assuming 0 degrees is the standard +x axis of course.) Since the top raptor has a top speed of 10 m/s, your best course of action is actually running at either 30 or 150 until it reaches its top speed in about 2 seconds, and then constantly changing your direction more towards 90. Since I don't know what a 20m equilateral triangle means (distance to center? perimeter? length of a side?) I can't compute the seemingly painful functional equation for one specific direction.
3. Not enough information. No map provided.
If I were attacked by raptors, I wouldn't want this "teacher" to be with me, unless you can impress raptors with math of course.

 Posts: 1
 Joined: Mon May 18, 2009 3:05 pm UTC
THE REST OF THE TEST
What are the remaining test questions from http://www.xkcd.com/135/ ?
I would honestly like to give the test in full to some people and only three questions aren't much. A full version for the true paranoids should be released.
I would honestly like to give the test in full to some people and only three questions aren't much. A full version for the true paranoids should be released.
Re: THE REST OF THE TEST
I sent it to my math teacher, she loved it!
http://www.mbeckler.org/velociraptors/v ... ptors.html
That would be the answers...
I DO think Mr. Munroe should do more!
http://www.mbeckler.org/velociraptors/v ... ptors.html
That would be the answers...
I DO think Mr. Munroe should do more!
Cut your clothes to fit your body, and not the other way around!
http://thestuffiread.blogspot.com Book Blog http://www.travian.co.uk/?uc=uk5_48953 Want to play Travian? Sign up here!
http://thestuffiread.blogspot.com Book Blog http://www.travian.co.uk/?uc=uk5_48953 Want to play Travian? Sign up here!

 Posts: 2
 Joined: Fri May 22, 2009 6:35 am UTC
Re: THE REST OF THE TEST
I had the first question as a bonus question on a quiz a couple years ago. I gave the most correct answer of all, "Not far enough."
Return to “Individual XKCD Comic Threads”
Who is online
Users browsing this forum: mashnut and 10 guests