标签:factor 规模 ble run ogr answer 实验 log hat
question:
Give a formula to predict the running time of a program for a problem of size N when doubling experiments have shown that the doubling factor is 2^b and the running time for problems of size N0 is T.
answer:
//这个实验是每次问题规模增加一倍,即 * 2
所以由题知问题规模每增加一倍,时间增加2^b倍
T(N0) = T;
T(2 * N0) = 2^b T;
T(2^2 * N0) = 2^b * 2^b T = 2^(2b) T;
......
T(2^r N0) = 2^(r*b) T;
换元(令N = 2^r N0), 则 r = log2 (N/N0);
所以T(N) = 2^[(log2 (N/N0)) * b] T;
标签:factor 规模 ble run ogr answer 实验 log hat
原文地址:https://www.cnblogs.com/w-j-c/p/9128555.html