Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks.
Hint, rewrite your equation as b^3=X. Then b = cubic root of X.
Then you loop through all integer values for a, and output when b is an integer. However, a corollary of Fermat's theorem might have something to say on how many solutions there are. I'm not too sure on number theory. In R there are an infinite number of solutions....
The thing is, a and b HAVE to be integers. I guess I won't solve it since no one has so far
The full thing to calculate is 33 = a^3 + b^3 + c^3 (people are now at trying solutions involving integers on scale of 10^14) but I thought if I simplified it to 6 = a^3 + b^3 it could potentially be easier and my computer could handle it
Can't you do a triple nested for loop? Cube each iteration of the loop and sum possible combinations (i, j, k plus or minus). If that number is 33 then you have a result that works.
There is probably some optimization you can do so you're not counting repeats as well, but forcing C to be three isn't going to help you find all the solutions.
The question to ask would be do you need any solution or all the solutions?
So you (arbitrarily?) chose c=3 and decided to try to solve it? Maybe there's no solution for a,b or c = 3. But I understand it's a combinatorial problem. The easiest way of looping is the solution I outlined above, but if people are looking for a gigantic solutions, chances are that there is either no solution (which can probably be deduced as a corrolary from something to do with Fermat's last theorem). Either that, or there is a proof that there is a solution, but nobody has found it yet.
Just out of interest's sake: why 33? Seems like a pretty arbitrary constant?
The thing is, a and b HAVE to be integers. I guess I won't solve it since no one has so far
The full thing to calculate is 33 = a^3 + b^3 + c^3 (people are now at trying solutions involving integers on scale of 10^14) but I thought if I simplified it to 6 = a^3 + b^3 it could potentially be easier and my computer could handle it
I'm pretty sure there is no solution for 6 = a^3 + b^3 for integers a and b.
Reason for the case where a is positive and b is negative or vice versa:
It's obvious that the distance between 2 rows gets larger each time. So if we don't find a solution in the first few rows, by the time the distance is greater than 6, we can't find a solution at all. Which happens to be the case rather quickly. That's because once we have a^3 calculated, we need a -(b^3) that is exactly 6 smaller than a^3. But if the closest -(b^3) is already 37 less than a^3, the further away ones certainly won't do.
To extend on this: if you were to replace the 6 with an arbitrary x, you could just start enumerating all the possible values for a^3 until the distance between two such values becomes larger than x. Then you just do a fairly simple search for a pair that is exactly x apart.
For example if x was 26, we would get the above list. 64 is already too large (distance to 27 is 37) so we stop there. Then we start at the 27 and look among the smaller numbers for the right match, which is the 1. So 26 = 3^3 + (-1)^3. If the 27 wouldn't work out, we would work our way down. Though obviously that would be pointless in this case.
With a and b having the same sign, things should work out similarly. We can restrict that to a, b and x all being positive because of logic and reasons. So now you enumerate all a^3 until the result is larger than x and look for a match. Since everything is positive, no larger numbers can work out.
Now, if you're trying to solve 33 = a^3 + b^3 + c^3, or even worse x = a^3 + b^3 + c^3, then scratch all of the above. With just a and b we were able to determine a simple criterion for when to stop iterating. That same criterion won't work for a, b and c. Maybe there's another upper limit, but it would likely be much higher.
The thing is, a and b HAVE to be integers. I guess I won't solve it since no one has so far
The full thing to calculate is 33 = a^3 + b^3 + c^3 (people are now at trying solutions involving integers on scale of 10^14) but I thought if I simplified it to 6 = a^3 + b^3 it could potentially be easier and my computer could handle it
I'm pretty sure there is no solution for 6 = a^3 + b^3 for integers a and b.
Reason for the case where a is positive and b is negative or vice versa:
It's obvious that the distance between 2 rows gets larger each time. So if we don't find a solution in the first few rows, by the time the distance is greater than 6, we can't find a solution at all. Which happens to be the case rather quickly. That's because once we have a^3 calculated, we need a -(b^3) that is exactly 6 smaller than a^3. But if the closest -(b^3) is already 37 less than a^3, the further away ones certainly won't do.
To extend on this: if you were to replace the 6 with an arbitrary x, you could just start enumerating all the possible values for a^3 until the distance between two such values becomes larger than x. Then you just do a fairly simple search for a pair that is exactly x apart.
For example if x was 26, we would get the above list. 64 is already too large (distance to 27 is 37) so we stop there. Then we start at the 27 and look among the smaller numbers for the right match, which is the 1. So 26 = 3^3 + (-1)^3. If the 27 wouldn't work out, we would work our way down. Though obviously that would be pointless in this case.
With a and b having the same sign, things should work out similarly. We can restrict that to a, b and x all being positive because of logic and reasons. So now you enumerate all a^3 until the result is larger than x and look for a match. Since everything is positive, no larger numbers can work out.
Excellent point. So for c=3 there is no solution! Well proved! Now manit0u can move on to c=4, 5, ...
On April 02 2016 01:25 spinesheath wrote: Now, if you're trying to solve 33 = a^3 + b^3 + c^3, or even worse x = a^3 + b^3 + c^3, then scratch all of the above. With just a and b we were able to determine a simple criterion for when to stop iterating. That same criterion won't work for a, b and c. Maybe there's another upper limit, but it would likely be much higher.
There is no upper limit because the third value is arbitrary. If I set c to be -100 then the difference would need to be 1000033, but there is nothing stopping me from setting c to 1000 or 10000 to make the difference even larger.
On April 02 2016 01:25 spinesheath wrote: Now, if you're trying to solve 33 = a^3 + b^3 + c^3, or even worse x = a^3 + b^3 + c^3, then scratch all of the above. With just a and b we were able to determine a simple criterion for when to stop iterating. That same criterion won't work for a, b and c. Maybe there's another upper limit, but it would likely be much higher.
There is no upper limit because the third value is arbitrary. If I set c to be 100 then the difference would need to be 1000033, but there is nothing stopping me from setting c to 1000 or 10000 to make the difference even larger.
But can you find a and b such that their cubes they add up to a value that is "in the right range" of c^3? Maybe the numbers grow apart too much and you just can't possibly hit that sweet spot. I can't reason for either way off the top of my head.
On April 02 2016 01:25 spinesheath wrote: Now, if you're trying to solve 33 = a^3 + b^3 + c^3, or even worse x = a^3 + b^3 + c^3, then scratch all of the above. With just a and b we were able to determine a simple criterion for when to stop iterating. That same criterion won't work for a, b and c. Maybe there's another upper limit, but it would likely be much higher.
There is no upper limit because the third value is arbitrary. If I set c to be 100 then the difference would need to be 1000033, but there is nothing stopping me from setting c to 1000 or 10000 to make the difference even larger.
But can you find a and b such that their cubes they add up to a value that is "in the right range" of c^3? Maybe the numbers grow apart too much and you just can't possibly hit that sweet spot. I can't reason for either way off the top of my head.
You should be able to make a good guess about values you need to check, but I don't think that is going to manage the size of the problem enough to matter. The trivial example of this being whether the third variable will be positive or negative, but you could do a lot better than that.
The complexity of the problem comes from the fact that you have an arbitrary list of integers to check. Reducing the values you need to check for each integer on that list isn't going to help you that much.
On April 02 2016 02:46 Manit0u wrote: I always get spooked by such stuff...
That parametric solution for 1... why go to such lengths when you can just use 1 = 1^3 + x^3 + (-x)^3 and still get infinitely many solutions? The same holds true for every single k^3 = k^3 + x^3 + (-x)^3.
Anyways, even though he didn't say so specifically, we can safely assume that there is no easy way to find an upper limit for the 33 case. Or else someone would already have found a solution.
Integer math is surprisingly hard, even though the numbers seem so much simpler than real numbers. In fact many problems are a lot easier if you're looking for solutions in the real numbers instead of integer solutions.
Long story short: if you want to solve this, you should probably head to university and delve into the field of discrete mathematics. It seems like people with way more experience and knowledge in the field than us combined have tried to find a solution.
On April 02 2016 02:46 Manit0u wrote: I always get spooked by such stuff...
That parametric solution for 1... why go to such lengths when you can just use 1 = 1^3 + x^3 + (-x)^3 and still get infinitely many solutions? The same holds true for every single k^3 = k^3 + x^3 + (-x)^3.
Anyways, even though he didn't say so specifically, we can safely assume that there is no easy way to find an upper limit for the 33 case. Or else someone would already have found a solution.
Integer math is surprisingly hard, even though the numbers seem so much simpler than real numbers. In fact many problems are a lot easier if you're looking for solutions in the real numbers instead of integer solutions.
Long story short: if you want to solve this, you should probably head to university and delve into the field of discrete mathematics. It seems like people with way more experience and knowledge in the field than us combined have tried to find a solution.
Yeah, I misread the the second note in the video. Thought it said "Pause and try it yourself" like the first one, but in fact it said "Definitely don't pause and try it yourself!"