You are not logged in.
This will help answer both of your vector problems:
http://en.wikipedia.org/wiki/Plane_%28mathematics%29#Define_a_plane_through_three_points
And the fact that it doesn't require more than 4 dimensions.
Good point mathsyperson, I should have been more clear.
saudi_boy, you're making the same mistake ganesh made above.
Sorry gyanshrestha, but x^x = a^a does not imply x = a. Consider: 0^0 = 1 = 1^1.
Also, (1/4)^(1/4) != 1/16. (1/4)^2 = 1/16.
Use the trigonometric identity
This identity alone will solve your problem.
Time to get familiar with one of my favorite laws, the Law of Sines. First, we need to find the 3rd angle of the triangle formed by connecting the balloon and the two spotters. Let's call spotter 1 point A, spotter 2 point B, and the balloon point C. We know that angle BAC = 76 degrees and angle ABC = 68 degrees. That means that angle ACB = 180 - (76 + 68) = 36 degrees.
Now, the Law of Sines states the for a triangle with angles A, B, C, and sides of length a, b, and c, where the side of length a is opposite of the angle A and similarly for the other 2, the following equation holds true:
Points A and B are 1.2 miles apart, which is equivalent to saying that side c is of length 1.2 miles. Using the Law of Sines we can calculate that the length of side a is 1.98 miles and side b is 1.89 miles. Now imagine a line going straight down from the balloon to the ground. Call the length of this line x. The value of x is the height of the balloon. This is going to split the bottom of the triangle, side c, into 2 different lines. Call the point where the vertical line and side c intersect point D. We now have two new, right triangles: ACD and BCD. What you want to do now is use the Pythagorean Theorem on both triangles to come up with a system of two equations and two variables and use them to solve for x.
ganesh, you're still making the same mistake. You're right that
but remember that
Identity, you also made a slight error.
Instead, we need to do this:
Ok, that's an easier question to answer. All straight lines can be written in the form
I didn't even think about that, but you're right. I hope he doesn't mind finding 4th powers of complex numbers.
I think you guys are making this too hard. All he has to do is solve for
using the equation given to him:Then once you find
you just substitute it back into the first polynomial to get it's value.Use the method mathysperson said:
Very cool, thanks Jane and Ricky
We can immediately rule out all integers from 0 to positive infinity. 0 can be ruled out by trial, and it can't be any positive integer since every coefficient is positive.
Looking at the negative integers we can rewrite the equation. All even powers will remain positive while all negative powers will become negative, so we can rewrite the equation as follows:
Using this new equation we will consider only positive integers for x, which is exactly equivalent to considering only negative integers of x for the original equation. Now, since the highest power is even we know that the equation will tend to positive infinity as x tends to positive infinity. What we do now is try, by trial and error, all integers from 1 up to the point that the equation is strictly increasing, at which point we'll be done.
Start with x = 1:
1 - 3 + 15 - 6 + 33 - 45 + 42 - 24 + 3 - 9 + 6 = 13
x = 2:
1024 - 1536 + 3840 - 768 + 2112 - 1440 + 672 - 192 + 12 - 18 + 6 = 3712
For x = 3, we'll look at prime factorizations. We'll further rewrite the equation as follows:
When x = 3 we can see that the first two terms will cancel out. The next two terms give us
, which is greater than 0. Combining the next two terms gives us , again greater than 0. The next two terms clearly give us a term greater than 0, since the positive term has both a higher power of 3 and a larger coefficient. The final 3 terms give us 27 - 27 + 6 = 6. Since we were able to combine all of the terms to give us either 0 or a positive number we know that the equation is greater than 0 for x = 3.We will use this same trick to show that all integer values of x greater than 3 result in a positive answer and thus are not roots.
Combine the first two terms to give us
. Note that this is equivalent to . For all x > 3 this is clearly greater than 0, since both x^9 and x - 3 are greater than 0.Combine the next two terms to give us
. This term is clearly greater than 0 since the positive term has both a larger coefficient and a larger power than the negative term.Combine the next 2 terms for
. Again, this is positive for all x > 3 since 3x^5 and 11x - 15 will both be positive.Combining the next 2 terms gives us
, which again has a positive term with both a larger power and a larger coefficient, so this is positive.Finally, combine the final 3 terms for
. The 6 is obviously positive, and for all x > 3 so will 3x and x - 3. Therefore, this final term is positive.Add it all up and we know that the equation is positive for all x > 0, which is equivalent to saying that the original equation is greater than 0 for all x < 0. Since we also know that 0 and x < 0 are not roots where x is an integer, we know that the equation has no integer roots.
Edit: Holy cow, your answer is way easier than mine. I don't quite understand how it works, though. Do you have a proof, or is this a well known theorem?
Find the point on the grid where the 2 lines would intersect and determine if that point is between the origin and the destination. Here's how I would do it in C:
bool func(double originx, double originy, double destx, double desty, double objx1, double objy1, double objx2, double objy2)
{
bool pathInf = false, wallInf = false;
if (destx == originx)
{
pathInf = true;
}
if (objx2 == objx1)
{
wallInf = true;
}
if (pathInf && wallInf)
{
if (originx != objx1)
{
return false;
}
if ( (originy <= objy1 && originy >= objy2) ||
(originy <= objy2 && originy >= objy1) ||
(desty <= objy1 && desty >= objy2) ||
(desty <= objy2 && desty >= objy1) )
{
return true;
}
return false;
}
double slopePath, slopeWall, interceptPath, interceptWall;
if (!pathInf)
{
slopePath = (desty - originy) / (destx - originx);
interceptPath = originy - (slopePath * originx);
}
if (!wallInf)
{
slopeWall = (objy2 - objy1) / (objx2 - objx1);
interceptWall = objy1 - (slopeWall * objx1);
}
if (!pathInf && !wallInf)
{
if (slopePath == slopeWall)
{
if (interceptPath != interceptWall)
{
return false;
}
else
{
if ( (originy <= objy1 && originy >= objy2) ||
(originy <= objy2 && originy >= objy1) ||
(desty <= objy1 && desty >= objy2) ||
(desty <= objy2 && desty >= objy1) )
{
return true;
}
return false;
}
}
else
{
double x = (interceptWall - interceptPath) / (slopePath - slopeWall);
if ( (x <= originx && x >= destx) ||
(x <= destx && x >= originx) )
{
return true;
}
return false;
}
}
if (pathInf)
{
if ( (originx <= objx1 && originx >= objx2) ||
(originx <= objx2 && originx >= objx1) )
{
return true;
}
return false;
}
else
{
if ( (objx1 <= originx && objx1 >= destx) ||
(objx1 <= destx && objx1 >= originx) )
{
return true;
}
return false;
}
}
This function will return true if the paths collide and false if they do not. Note that this function (should) determine if 2 line in the xy-plane will collide. I made no assumptions about the ability of the units in your game to move. For example, if your units can only move up/down and left/right then a lot of this code is unnecessary. If that's the case then you should be able to remove a lot of the code, particularly everything dealing with slope. If they are points that can move anywhere in the xy-plane, though, this should work.
Think of it like finding the volume of a cylinder. The base is a circle with a radius of 1.4 cm (the outer radius is useless information) and the cylinder has a height of 50 cm, because in 1 second the water travels 50 cm. Then do the same for part b, except that the height is 60s * 50cm/s.
No power of 10 is divisible by 7. 10's prime factorization is 2*5, so any power of 10, generally 10^n, is equal to 2^n * 5^n. Since 7 is prime and not a factor of 10, it will never be a factor of a power of 10.
As always, Wikipedia: http://en.wikipedia.org/wiki/Golden_ratio
First, you need to multiply your density function by the value it produces. In other words, you need to integrate x^4, not x^3.
I'm not that great at probability, so I'm using intuition from here on out. Wikipedia says that the expectation is the integral of x^4 from -infinity to infinity, but this produces an expected value of t^5 / 5, which is greater than t (the maximum value of x) for every t greater than the fourth root of 5. My guess is to set up 2 integrals equal to each other to find the middle value, like this:
From here we get the equation
Like I said, this is just a guess. It makes intuitive sense to me, but my intuition is usually wrong when it comes to probability.