Michael Sisco - MATLAB Cody - MATLAB Central

Michael Sisco

8001
Rank
4
Badges
765
Score
51 – 99 of 99

Michael Sisco submitted a Comment to Problem 54054. Determine Center of Mass for a Set of Floating Spheres

Your result for test #4 is clearly wrong. Simply add up the masses with positive elevation and the masses with negative elevation, and you'll see that the CoM must be below the xy plane.

on 7 Mar 2022

Michael Sisco submitted a Comment to Problem 53094. Easy Sequences 51: Positive Gaussian Primes

I just re-ran the solution and this time it worked. I must have gotten a slow core the first time I ran it. ;-)

on 25 Dec 2021

Michael Sisco received Leader badge for Solution 7297960

on 25 Dec 2021

Michael Sisco submitted a Comment to Problem 53094. Easy Sequences 51: Positive Gaussian Primes

I have a solution that works and the entire test suite can run in 18 seconds on my laptop, but takes a little over 45 seconds to run on the server, so the server times out on the test cases. I'm stumped trying to figure out how I can optimize this code any further.

on 25 Dec 2021

Michael Sisco submitted a Comment to Problem 53725. Easy Sequences 56: Counting "Ugly" Numbers

Hello Ramon, First, I'm not sure you can say that the values you are using are more precise than log(2), for example. log(2) should return a value that is precise to within the precision of the machine. In fact, if I type in log(2)-0.6931471805599453094172321214582 on my machine, the result is identically 0. I agree that precomputing these values once will make the code more efficient, but not more precise. As for switching the log(5) and log(2) order, again you are correct that this will make the code more efficient, but in this case I think it makes it less accurate. Let me explain. I hope I'm not giving away too much of the answer with my comment. At the point where you are trying to calculate the max exponent for 3, you are subtracting a multiple of log(5) from a large value, and then dividing by log(3). Because log(5) is larger than log(3), you are increasing the likelihood that this calculation will result in a rounding error. In my algorithm, I'm subtracting a multiple of log(2) from a large value, and then dividing by log(3). Because log(2) is smaller than log(3), the likelihood of a rounding error is less (but still probably not 0). As proof, try to set a breakpoint in your code at the point where your 5-exponent is 170. I think you'll find that the calculated maximum exponent for 3 is 84, when it should actually be 85. As I had guessed in my original comment, your algorithm is missing 3^85*5^170.

on 19 Dec 2021

Michael Sisco submitted a Comment to Problem 53725. Easy Sequences 56: Counting "Ugly" Numbers

I think your test suite is still incorrect. In test 7, you report regCount(75,85) as 6815143. It is actually 6815144. I suspect that you're failing to count 3^85*5^170, which happens to exactly equal 75^85. Since the problem statement says to count all ugly numbers less than or equal to n^e, this value should be counted.

on 19 Dec 2021

Michael Sisco received Solver badge for Solution 7266990

on 16 Dec 2021

51 – 99 of 99
Go to top of page