作者yueayase (scrya)
看板Math
标题Re: [中学] 对数
时间Mon Feb 20 16:31:40 2023
※ 引述《magic704226 (梅姬?没鸡?傻傻分不清楚)》之铭言:
: The complexity of a problem is O(log10n) and the computer
: executes 1 million instructions per second.
: How long does it take to run the program if the number
: of operations is 10,000?
: a. 1 microsecond
: b. 2 microseconds
: c. 3 microseconds
: d. 4 microseconds
: 答案是 4 microsecond
: 令 log(k*10*1000000)
: k=1/(10^6)
: 10000代入之後就卡住了
The complexity of a problem is O(log10n)的n通常就是instruction的数量
所以log 10000 = 4 表示10000个指令需要4个单位的执行时间
10
the computer executes 1 million instructions per second
6 -6
也就是1秒可执行10 个指令 => 1个指令需要10 秒
-6
所以这10000个指令需要 4*10 秒,即4 microseconds
-6
(所以是log N *10 sec for N instructions)
10
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.47.64.252 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Math/M.1676881902.A.914.html