## 统计代写|算法设计代写Algorithm Design代考|Properties of Logarithms

As we have seen, stating $b^x=y$ is equivalent to saying that $x=\log _b y$. The $b$ term is known as the base of the logarithm. Three bases are of particular importance for mathematical and historical reasons:

• Base $b=2$ : The binary logarithm, usually denoted $\lg x$, is a base 2 logarithm. We have seen how this base arises whenever repeated halving (i.e., binary search) or doubling (i.e., nodes in trees) occurs. Most algorithmic applications of logarithms imply binary logarithms.
• Base $b=e:$ The natural logarithm, usually denoted $\ln x$, is a base $e=$ $2.71828 \ldots$ logarithm. The inverse of $\ln x$ is the exponential function $\exp (x)=e^x$ on your calculator. Thus, composing these functions gives us the identity function,
$$\exp (\ln x)=x \text { and } \ln (\exp x)=x$$
• Base $b=10$ : Less common today is the base-10 or common logarithm, usually denoted as $\log x$. This base was employed in slide rules and logarithm books in the days before pocket calculators.

We have already seen one important property of logarithms, namely that
$$\log _a(x y)=\log _a(x)+\log _a(y)$$
The other important fact to remember is that it is easy to convert a logarithm from one base to another. This is a consequence of the following formula:
$$\log _a b=\frac{\log _c b}{\log _c a}$$
Thus, changing the base of $\log b$ from base- $a$ to base- $c$ simply involves multiplying by $\log _c a$. It is easy to convert a common log function to a natural log function, and vice versa.

Two implications of these properties of logarithms are important to appreciate from an algorithmic perspective:

• The base of the logarithm has no real impact on the growth rate: Compare the following three values: $\log 2(1,000,000)=19.9316, \log _3(1,000,000)=$ $12.5754$, and $\log {100}(1,000,000)=3$. A big change in the base of the logarithm produces little difference in the value of the log. Changing the base of the $\log$ from $a$ to $c$ involves multiplying by $\log _c a$. This conversion factor is absorbed in the Big Oh notation whenever $a$ and $c$ are constants. Thus, we are usually justified in ignoring the base of the logarithm when analyzing algorithms.

## 统计代写|算法设计代写Algorithm Design代考|War Story: Mystery of the Pyramids

That look in his eyes should have warned me off even before he started talking.
“We want to use a parallel supercomputer for a numerical calculation up to $1,000,000,000$, but we need a faster algorithm to do it.”

I’d seen that distant look before. Eyes dulled from too much exposure to the raw horsepower of supercomputers – machines so fast that brute force seemed to eliminate the need for clever algorithms; at least until the problems got hard enough.

“I am working with a Nobel prize winner to use a computer on a famous problem in number theory. Are you familiar with Waring’s problem?”

I knew some number theory. “Sure. Waring’s problem asks whether every integer can be expressed at least one way as the sum of at most four integer squares. For example, $78=8^2+3^2+2^2+1^2=7^2+5^2+2^2$. I remember proving that four squares suffice to represent any integer in my undergraduate number theory class. Yes, it’s a famous problem but one that got solved 200 years ago.”
“No, we are interested in a different version of Waring’s problem. A pyramidal number is a number of the form $\left(m^3-m\right) / 6$, for $m \geq 2$. Thus, the first several pyramidal numbers are $1,4,10,20,35,56,84,120$, and 165 . The conjecture since 1928 is that every integer can be represented by the sum of at most five such pyramidal numbers. We want to use a supercomputer to prove this conjecture on all numbers from 1 to $1,000,000,000$.”

“Doing a billion of anything will take a substantial amount of time,” I warned. “The time you spend to compute the minimum representation of each number will be critical, since you are going to do it one billion times. Have you thought about what kind of an algorithm you are going to use?”

“We have already written our program and run it on a parallel supercomputer. It works very fast on smaller numbers. Still, it takes much too much time as soon as we get to 100,000 or so.”

“Terrific,” I thought. Our supercomputer junkie had discovered asymptotic growth. No doubt his algorithm ran in something like quadratic time, and went into vapor lock as soon as $n$ got large.
“We need a faster program in order to get to a billion. Can you help us? Of course, we can run it on our parallel supercomputer when you are ready.”

I am a sucker for this kind of challenge, finding fast algorithms to speed up programs. I agreed to think about it and got down to work.

## 统计代写|算法设计代写Algorithm Design代考|Properties of Logarithms

• 根据 $b=2$ :二进制对数，通常表示 $\lg x$ ，是以 2 为底的对数。我们已经看到，当重复减半 (即二分查 找) 或加倍 (即树中的节点) 发生时，这个基是如何出现的。对数的大多数算法应用都包含二进制对 数。
• 根据 $b=e$ :自然对数，通営表示 $\ln x$ ，是一个基 $e=2.71828 \ldots$ 对数。的倒数 $\ln x$ 是指数函数 $\exp (x)=e^x$ 在你的计算器上。因此，组合这些函数为我们提供了恒等函数，
$$\exp (\ln x)=x \text { and } \ln (\exp x)=x$$
• 根据 $b=10$ : 今天不太常见的是以 10 为底或常用对数，通常表示为 $\log x$. 在袖珍计算器出现之前，这 个基数被用于计算尺和对数簿中。
我们已经看到了对数的一个重要性质，即
$$\log _a(x y)=\log _a(x)+\log _a(y)$$
要记住的另一个重要事实是，很容易将一个对数从一个底转换为另一个底。这是以下公式的结果:
$$\log _a b=\frac{\log _c b}{\log _c a}$$
因此，改变基数 $\log b$ 从基地- $a$ 以基地 $-$ 简单地涉及乘以 $\log _c a$. 将普通对数函数转换为自然对数函数很容 易，反之亦然。
从算法的角度来看，对数的这些属性的两个含义很重要:
• 对数的底对增长率没有实际影响：比较以下三个值: $\$ \log 2(1,000,000)=19.9316,1 \log _3 3(1,000,000)=\$

## 统计代写|算法设计代写Algorithm Design代考|War Story: Mystery of the Pyramids

“我们希望使用并行超级计算机进行高达1,000,000,000，但我们需要一个更快的算法来做到这一点。”

“我正在与一位诺贝尔奖获得者合作，使用计算机解决数论中的一个著名问题。你熟悉沃林的问题吗？”

“不，我们对不同版本的 Waring 问题感兴趣。金字塔形数字是形式的数字(米3−米)/6， 为了米≥2. 因此，前几个金字塔数是1,4,10,20,35,56,84,120, 和 165 . 自 1928 年以来的猜想是，每个整数都可以用最多五个这样的金字塔形数字的总和来表示。我们想用一台超级计算机在从 1 到 1 的所有数字上证明这个猜想1,000,000,000.”

“做 10 亿件事情会花费大量时间，”我警告说。“你花在计算每个数字的最小表示上的时间将是至关重要的，因为你将要做 10 亿次。你有没有想过你要使用什么样的算法？”

“我们已经编写了程序并在并行超级计算机上运行它。它在较小的数字上运行得非常快。不过，一旦我们达到 100,000 左右，这需要太多时间。”

“太棒了，”我想。我们的超级计算机迷发现了渐近增长。毫无疑问，他的算法在类似二次时间的时间内运行，并在n变大了。
“我们需要一个更快的计划来达到十亿。你能帮助我们吗？当然，当您准备好时，我们可以在我们的并行超级计算机上运行它。”

myassignments-help数学代考价格说明

1、客户需提供物理代考的网址，相关账户，以及课程名称，Textbook等相关资料~客服会根据作业数量和持续时间给您定价~使收费透明，让您清楚的知道您的钱花在什么地方。

2、数学代写一般每篇报价约为600—1000rmb，费用根据持续时间、周作业量、成绩要求有所浮动(持续时间越长约便宜、周作业量越多约贵、成绩要求越高越贵)，报价后价格觉得合适，可以先付一周的款，我们帮你试做，满意后再继续，遇到Fail全额退款。

3、myassignments-help公司所有MATH作业代写服务支持付半款，全款，周付款，周付款一方面方便大家查阅自己的分数，一方面也方便大家资金周转，注意:每周固定周一时先预付下周的定金，不付定金不予继续做。物理代写一次性付清打9.5折。

Math作业代写、数学代写常见问题

myassignments-help擅长领域包含但不是全部: