大学时候学物理实验的时候接触过线性回归,现在忘记了...还得重新拾起来。学习不扎实耽误了多少时光... sigh

Suppose that you time a program as a function of N and produce
the following table. N seconds
-------------------
64 0.000
128 0.001
256 0.010
512 0.083
1024 0.698
2048 5.742
4096 48.346
8192 401.315
16384 3366.172 Estimate the order of growth of the running time as a function of N.
Assume that the running time obeys a power law T(N) ~ a N^b. For your
answer, enter the constant b. Your answer will be marked as correct
if it is within 1% of the target answer - we recommend using
two digits after the decimal separator, e.g., 2.34.

已知一组数据,N和seconds, 求T(n)中的b。

方法是两边先取对数,这样造成 log(T(n)) = log(a) + b * log(n), 这样就完成了一个斜率b的线性函数。我们用一般的线性回归就可以解出b和a。

Reference:

https://en.wikipedia.org/wiki/Regression_analysis

最新文章

  1. HTML5入门(---------------HTML——基本骨架--------------)
  2. 数据结构图文解析之:栈的简介及C++模板实现
  3. 同态加密-Homomorphic encryption
  4. EditorWindow简单双击效果
  5. java 笔记(2) —— 内部类的作用
  6. 学习jsp(3)
  7. 215. Kth Largest Element in an Array
  8. 不要停留在表面,MVC 3 我们要深入一些
  9. java代码整理---正则表达式
  10. T-SQL语言基础
  11. HDNOIP201206施工方案
  12. 在Raspberry上使用小度WIFI
  13. Arcengine 开发,FeatureClass新增feature时“The Geometry has no z-value”或"The Geometry has null z-value"的解决方案
  14. CentOS 7 服务器配置--安装Mysql
  15. 《ASP.NET Core In Action》读书笔记系列四 创建ASP.NET Core 应用步骤及相应CLI命令
  16. 工具 - 怎么看微信h5的源码?
  17. .Net文件压缩
  18. python网页爬虫小项目开发
  19. 你所不了解的javascript操作DOM的细节知识点(一)
  20. 10个非常炫酷的jQuery相册动画赏析

热门文章

  1. CS小分队第一阶段冲刺站立会议(5月10日)
  2. struts2标签详解
  3. 监听文本框输入开发仿新浪微博限制输入字数的textarea插件
  4. 遗传学详解及Matlab算法实现
  5. android开发 无预览定时拍照
  6. 【Search Insert Position 】cpp
  7. 02.JSP的3个编译指令
  8. PS4 Razor GPU
  9. linux下安装vsftp
  10. mongodb 主从服务器