Posted on Categories:Combinatorics, 数学代写, 组合学

# 数学代写|组合学代写Combinatorics代考|Motivation and Proof of the Theorem

avatest™

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数学代写|组合学代写Combinatorics代考|Motivation and Proof of the Theorem

Our proof of Theorem 8.1 will be by induction. Induction requires knowing the result (in this case
AC(n) ≥ log2 (n!)) beforehand. How would one ever come up with the result beforehand? A result like the Four Color Theorem (p. 158) might be conjectured after some experimentation, but one is unlikely to stumble upon Theorem 8.1 experimentally. We will “discover” it by relating sorting algorithms to decision trees, which lead easily to the inequality WC(n) ≥ log2 (n!). One might then test AC(n) ≥ log2 (n!) for small values of n, thus motivating Theorem 8.1. Someone versed in information theory might motivate the theorem as follows: “A comparison gives us one bit of information. Given k bits of information, we can distinguish among at most 2k different things. Since we must distinguish among n! different arrangements, we require that 2k ≥ n! and so k ≥ log2 (n!).”
(This is motivation, not a proof—it’s not even clear if it’s referring to worst case or average case behavior.) Let’s get on with things.
Suppose we are given a comparison based sorting algorithm. Since it is assumed to correctly sort n-lists, it must correctly sort lists in which all items are different. By simply renaming our items 1, 2, . . ., n, we can suppose that we are sorting lists which are permutations of n.
Our proof will make use of the decision tree associated with this sorting algorithm. We construct the tree as follows. Whenever we make a comparison in the course of the algorithm, our subsequent action depends on whether an inequality holds or fails to hold. Thus there are two possible decisions at each comparison and so each vertex in our decision tree has at most two sons.
Label each leaf of the tree with the permutations that led to that leaf and throw away any leaves that are not associated with any permutation. To do this, we start at the root with a permutation f of n and at each vertex in the tree we go left if the inequality we are checking holds and go right if it fails to hold. At the same time, we carry out whatever manipulations on the data in f that the algorithm requires. When we arrive at a leaf, the data in f will be sorted. Label the leaf with the f we started out with at the root, written in one line form. Do this for all n! permutations of n. For example, consider the following algorithm for sorting a permutation of 3.

1. If the entry in the first position exceeds the entry in the third position, switch them.
2. If the entry in the first position exceeds the entry in the second position, switch them.
3. If the entry in the second position exceeds the entry in the third position, switch them.

## 数学代写|组合学代写Combinatorics代考|Software Sorts

A merge sort algorithm was studied in Example 7.13 (p. 211). You should review it now.
All reasonably fast software sorts use a divide and conquer method for attacking the problem. As you may recall, divide and conquer means splitting the problem into a few smaller problems which are easier either because they are smaller or because they are simpler. In problems where divide and conquer is most successful, it is often the case that the smaller problems are simply instances of the same type of problem and they are handled by applying the algorithm recursively. To give you a bit better idea of what divide and conquer means, here is how the algorithms we’ll discuss use it. Some of this may not mean much to you until you’ve finished this section, so you may want to reread this list later. This is by no means an exhaustive list of the different types of software sorts.

Quicksort and merge sorts split the data and spend most of their time sorting the separate pieces. Thus they divide and conquer by producing two smaller sorting problems which are handled in a recursive manner.
Quicksort spends a little time dividing the data in such a way that recombining the two pieces after they are sorted is immediate. It divides the items into two collections so that all the items in the first collection should precede all the items in the second. The division is done “in place” by interchanging items that are in the wrong lists. Unless it is extremely unlucky, the two collections will have roughly the same number of elements. The two collections are then sorted separately.
Merge sorts reverse this: dividing is immediate and recombination takes a little time. In both cases, the “little time” required is proportional to the number of items being sorted because it requires a number of comparisons that is nearly equal to the number of items being sorted.

• An insertion sort builds up the sorted list by taking the items on the unsorted list one at a time and inserting them in a sorted list it is building. Divide and conquer can be used in the insertion process: To do a binary insertion sort, split the list into two nearly equal parts, decide which sublist should contain the new item, and iterate the process, using the sublist as the list.
• Suppose we are sorting a list of words (or numbers). Bucket sort focuses on one position in the words at a time. This is not usually a good divide and conquer approach because the task is not divided into just a few subproblems of roughly equal difficulty: On an n-long list with k characters per word, we focus in turn on each of the k positions. When n is large, k will be large, too.
It is easy to get a time estimate for the algorithm. The amount of time it takes to process one character position for all n words is proportional to n. Thus, the time to sort is proportional to nk. How fast a bucket sort is depends on how large k is compared to n.
• First, the items are arranged in a structure, called a “heap,” which is a rooted tree such that the smallest item in the tree is at the root and each of the sons of the root is also the root of a heap.
• Second, the items are removed from the heap one by one, starting with the top and preserving the heap structure.

## 数学代写|组合学代写Combinatorics代考|Motivation and Proof of the Theorem

AC(n)≥log2 (n!))一个人怎么能事先得出结果呢?像四色定理(第158页)这样的结果可以在一些实验之后推测出来，但是人们不可能在实验中偶然发现定理8.1。我们将通过将排序算法与决策树联系起来来“发现”它，这很容易导致不等式WC(n)≥log2 (n!)。对于n的小值，可以检验AC(n)≥log2 (n!)，从而推导出定理8.1。精通信息论的人可能会这样解释这个定理:“比较给了我们一点信息。给定k位信息，我们最多可以区分2k种不同的事物。因为我们必须区分n!不同的排列方式，我们要求2k≥n!所以k≥log2 (n!)
(这是动机，而不是证据——甚至不清楚它指的是最坏情况还是一般情况下的行为。)让我们开始工作吧。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。