Optimizing Execution Time for Linear Code in Mathematica with a P4 Processor

  • Thread starter Thread starter Amar.alchemy
  • Start date Start date
  • Tags Tags
    Mathematica Time
AI Thread Summary
The execution time for the provided Mathematica code on a P4 processor is significantly impacted by the large upper limit of the loop, which is 47,888,755,200. The code is linear, meaning its execution time scales with the number of iterations. A suggested approach is to test the code with a smaller range, such as 10,000 iterations, to estimate the execution time for the larger loop. By calculating the time taken for the smaller loop and scaling it accordingly, a more accurate estimate can be derived. The original code may take an impractical amount of time to execute due to the high iteration count.
Amar.alchemy
Messages
78
Reaction score
0
Kindly tell me how much time it may take to execute the below code in Mathematica software in a P4 Processor. Because I executed the below for nearly 5 mins but still it didn't display answer.

For[i = 1, i <= 47888755200, i++, If[i == 47888755100, Print]]
 
Mathematics news on Phys.org
Amar.alchemy said:
Kindly tell me how much time it may take to execute the below code in Mathematica software in a P4 Processor. Because I executed the below for nearly 5 mins but still it didn't display answer.

For[i = 1, i <= 47888755200, i++, If[i == 47888755100, Print]]


I think we can assume this code is linear. So, what you have to do is:
For[i = 1, i <= 10000, i++, If[i == x, Print]]

Where x is (10000/47888755100)*47888755200. Count the time with a function that gives you the time it takes, the time for your computation would be something like t0*47888755200/10000.


Greetz,
Littlepig
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top