# 统计代写|算法设计代写Algorithm Design代考|CS161

## 统计代写|算法设计代写Algorithm Design代考|Logarithms and Their Applications

Logarithm is an anagram of algorithm, but that’s not why we need to know what logarithms are. You’ve seen the button on your calculator, but may have forgotten why it is there. A logarithm is simply an inverse exponential function. Saying $b^x=y$ is equivalent to saying that $x=\log _b y$. Further, this equivalence is the same as saying $b^{\log _b y}=y$.

Exponential functions grow at a distressingly fast rate, as anyone who has ever tried to pay off a credit card balance understands. Thus, inverse exponential functions (logarithms) grow refreshingly slowly. Logarithms arise in any process where things are repeatedly halved. We’ll now look at several examples.

Binary search is a good example of an $O(\log n)$ algorithm. To locate a particular person $p$ in a telephone book ${ }^2$ containing $n$ names, you start by comparing $p$ against the middle, or $(n / 2)$ nd name, say Monroe, Marilyn. Regardless of whether $p$ belongs before this middle name (Dean, James) or after it (Presley, Elvis), after just one comparison you can discard one half of all the names in the book. The number of steps the algorithm takes equals the number of times we can halve $n$ until only one name is left. By definition, this is exactly $\log _2 n$. Thus, twenty comparisons suffice to find any name in the million-name Manhattan phone book!

Binary search is one of the most powerful ideas in algorithm design. This power becomes apparent if we imagine trying to find a name in an unsorted telephone book.

## 统计代写|算法设计代写Algorithm Design代考|Logarithms and Criminal Justice

Figure $2.8$ will be our final example of logarithms in action. This table appears in the Federal Sentencing Guidelines, used by courts throughout the United States. These guidelines are an attempt to standardize criminal sentences, so that a felon convicted of a crime before one judge receives the same sentence that they would before a different judge. To accomplish this, the judges have prepared an intricate point function to score the depravity of each crime and map it to time-to-serve.

Figure $2.8$ gives the actual point function for fraud-a table mapping dollars stolen to points. Notice that the punishment increases by one level each time the amount of money stolen roughly doubles. That means that the level of punishment (which maps roughly linearly to the amount of time served) grows logarithmically with the amount of money stolen.

Think for a moment about the consequences of this. Many a corrupt CEO certainly has. It means that your total sentence grows extremely slowly with the amount of money you steal. Embezzling an additional $\$ 100,000$gets you 3 additional punishment levels if you’ve already stolen$\$10,000$, adds only 1 level if you’ve stolen $\$ 50,000$, and has no effect if you’ve stolen a million. The corresponding benefit of stealing really large amounts of money becomes even greater. The moral of logarithmic growth is clear: If you’re gonna do the crime, make it worth the time$!^\beta$Take-Home Lesson: Logarithms arise whenever things are repeatedly halved or doubled. ## 统计代写|算法设计代写Algorithm Design代考|Logarithms and Their Applications 对数是算法的变位词，但这不是我们需要知道对数是什么的原因。您已经看到计算器上的按钮，但可能已经忘记了它的存在原因。对数只是一个反指数函数。说bX=是相当于说X=日志b⁡是. 此外，这个等价与说b日志b⁡是=是. 指数函数以令人痛苦的速度增长，任何尝试过还清信用卡余额的人都知道。因此，反指数函数（对数）增长缓慢。对数出现在任何事物反复减半的过程中。我们现在来看几个例子。 二分搜索就是一个很好的例子○(日志⁡n)算法。定位特定的人p在电话簿中2包含n名字，你从比较开始p反对中间，或(n/2)nd名字，说梦露，玛丽莲。不管是否p属于这个中间名之前（Dean、James）或之后（Presley、Elvis），经过一次比较，你可以丢弃书中所有名字的一半。算法采取的步数等于我们可以减半的次数n直到只剩下一个名字。根据定义，这正是日志2⁡n. 因此，通过 20 次比较就足以在曼哈顿的百万人电话簿中找到任何名字！ 二分搜索是算法设计中最强大的思想之一。如果我们想象试图在未分类的电话簿中找到一个名字，这种能力就会变得很明显。 ## 统计代写|算法设计代写Algorithm Design代考|Logarithms and Criminal Justice 数字2.8将是我们对数的最后一个例子。该表出现在美国各地法院使用的联邦量刑指南中。这些准则旨在使刑事判决标准化，以便在一名法官面前被判有罪的重罪犯受到与在另一名法官面前相同的判决。为了做到这一点，法官们准备了一个复杂的点函数来对每起犯罪的堕落程度进行评分，并将其映射到服务时间。 数字2.8给出了欺诈的实际积分函数 – 一张将被盗美元映射到积分的表格。请注意，每当被盗的金额大约翻倍时，惩罚就会增加一个级别。这意味着惩罚程度（与服务时间大致呈线性关系）与被盗金额成对数增长。 想一想这件事的后果。许多腐败的首席执行官肯定有。这意味着你的总刑期随着你偷的钱的数量增长非常缓慢。挪用额外的$100,000如果你已经偷了，会给你 3 个额外的惩罚等级$10,000, 如果你偷了，只会增加 1 级$50,000，如果你偷了一百万，则无效。窃取大量金钱的相应好处变得更大。对数增长的寓意很明确：如果你要犯罪，就让它值得花时间!b

myassignments-help数学代考价格说明

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

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

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

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

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