| Assuming the execution time follows power rule, , the coefficient a can be found by taking empirical measurements of run time <math>\{t_1, t_2\}</math> at some problem-size points <math>\{n_1, n_2\}</math>, and calculating <math>t_2/t_1 = (n_2/n_1)^a</math> so that <math>a = \log(t_2/t_1) / \log(n_2/n_1)</math>. In other words, this measures the slope of the empirical line on the log–log plot of execution time vs. problem size, at some size point. If the order of growth indeed follows the power rule (and so the line on log–log plot is indeed a straight line), the empirical value of a will stay constant at different ranges, and if not, it will change (and the line is a curved line) - but still could serve for comparison of any two given algorithms as to their empirical local orders of growth behaviour. Applied to the above table: | | Assuming the execution time follows power rule, , the coefficient a can be found by taking empirical measurements of run time <math>\{t_1, t_2\}</math> at some problem-size points <math>\{n_1, n_2\}</math>, and calculating <math>t_2/t_1 = (n_2/n_1)^a</math> so that <math>a = \log(t_2/t_1) / \log(n_2/n_1)</math>. In other words, this measures the slope of the empirical line on the log–log plot of execution time vs. problem size, at some size point. If the order of growth indeed follows the power rule (and so the line on log–log plot is indeed a straight line), the empirical value of a will stay constant at different ranges, and if not, it will change (and the line is a curved line) - but still could serve for comparison of any two given algorithms as to their empirical local orders of growth behaviour. Applied to the above table: |
− | 假设执行时间服从幂规则,系数 a 可以通过对运行时数学 t1,t2 / math 在某些问题大小点上的数学 n1,n2 / math 进行经验测量,然后计算数学 t2 / t1(n2 / n1) ^ a / math,从而得到数学 a / log (t2 / t1) / log (n2 / n1) / math。换句话说,在某个尺寸点上,这可以度量执行时间与问题大小的对数-对数图上经验曲线的斜率。如果增长的次序确实遵循幂次规则(因此对数曲线确实是一条直线) ,那么 a 的经验值将在不同的范围内保持不变,如果不是,它将发生变化(而且这条直线是一条曲线)——但仍然可以用于比较任何两个给定算法的经验局部增长行为次序。应用于上表:
| + | 假设执行时间遵循幂律,通过对一些问题规模点<math>\{n_1, n_2\}</math>的运行时间<math>\{t_1, t_2\}</math>进行经验测量,并计算出𝑡<math>t_2/t_1 = (n_2/n_1)^a</math>,从而得到系数<math>a = \log(t_2/t_1) / \log(n_2/n_1)</math>。 |