text:
## 计算机代写|C++作业代写C++代考|Small Overhead, Big Benefits for C++

C++ 是一种高级语言，它是由Bjarne Stroustrup 于1979 年在贝尔实验室开始设计开发的。 C++ 进一步扩充和完善了C 语言，是一种面向对象的程序设计语言。 C++ 可运行于多种平台上，如Windows、MAC 操作系统以及UNIX 的各种版本。

statistics-lab™ 为您的留学生涯保驾护航 在代写C++方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写C++代写方面经验极为丰富，各种代写C++相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 计算机代写|C++作业代写C++代考|Big Benefits for C++

We do not mean to make too big a deal about performance loss, nor do we wish to deny it. For simple C++ code written in a “Fortran” style, with a single layer of wellbalanced parallel loops, the dynamic nature of TBB may not be needed at all. However, the limitations of such a coding style are an important factor in why TBB exists. TBB was designed to efficiently support nested, concurrent, and sequential composition of parallelism and to dynamically map this parallelism on to a target platform. Using a composable library like TBB, developers can build applications by combining components and libraries that contain parallelism without worrying that they will negatively interfere with each other. Importantly, TBB does not require us to restrict the parallelism we express to avoid performance problems. For large, complicated applications using $\mathrm{C}++$, TBB is therefore easy to recommend without disclaimers.
The TBB library has evolved over the years to not only adjust to new platforms but also to demands from developers that want a bit more control over the choices the library makes in mapping parallelism to the hardware. While TBB $1.0$ had very few performance controls for users, TBB 2019 has quite a few more – such as affinity controls,

constructs for work isolation, hooks that can be used to pin threads to cores, and so on. The developers of TBB worked hard to design these controls to provide just the right level of control without sacrificing composability.

The interfaces provided by the library are nicely layered – TBB provides high-level templates that suit the needs of most programmers, focusing on common cases. But it also provides low-level interfaces so we can drill down and create tailored solutions for our specific applications if needed. TBB has the best of both worlds. We typically rely on the default choices of the library to get great performance but can delve into the details if we need to.

## 计算机代写|C++作业代写C++代考|Evolving Support for Parallelism in TBB and C++

Both the TBB library and the $\mathrm{C}++$ language have evolved significantly since the introduction of the original TBB. In $2006, C_{++}$had no language support for parallel programming, and many libraries, including the Standard Template Library (STL), were not easily used in parallel programs because they were not thread-safe.

The $\mathrm{C}++$ language committee has been busy adding features for threading directly to the language and its accompanying Standard Template Library (STL). Figure 1-1 shows new and planned $\mathrm{C}_{++}$features that address parallelism. Even though we are big fans of TBB, we would in fact prefer if all of the fundamental support needed for parallelism is in the $\mathrm{C}++$ language itself. That would allow TBB to utilize a consistent foundation on which to build higher-level parallelism abstractions. The original versions of TBB had to address a lack of $\mathrm{C}++$ language support, and this is an area where the $\mathrm{C}++$ standard has grown significantly to fill the foundational voids

that TBB originally had no choice but to fill with features such as portable locks and atomics. Unfortunately, for $\mathrm{C}_{++}$developers, the standard still lacks features needed for full support of parallel programming. Fortunately, for readers of this book, this means that TBB is still relevant and essential for effective threading in $\mathrm{C}++$ and will likely stay relevant for many years to come.
It is very important to understand that we are not complaining about the $\mathrm{C}++$ standard process. Adding features to a language standard is best done very carefully, with careful review. The $\mathrm{C}++11$ standard committee, for instance, spent huge energy on a memory model. The significance of this for parallel programming is critical for every library that builds upon the standard. There are also limits to what a language standard should include, and what it should support. We believe that the tasking system and the flow graph system in TBB is not something that will directly become part of a language standard. Even if we are wrong, it is not something that will happen anytime soon.

## 计算机代写|C++作业代写C++代考|Recent C++ Additions for Parallelism

As shown in Figure 1-1, the $\mathrm{C}++11$ standard introduced some low-level, basic building blocks for threading, including std: : async, std:: future, and std:: thread. It also introduced atomic variables, mutual exclusion objects, and condition variables. These extensions require programmers to do a lot of coding to build up higher-level abstractions – but they do allow us to express basic parallelism directly in $\mathrm{C}++$. The C++11 standard was a clear improvement when it comes to threading, but it doesn’t provide us with the high-level features that make it easy to write portable, efficient parallel code. It also does not provide us with tasks or an underlying work-stealing task scheduler.
The $\mathrm{C}++17$ standard introduced features that raise the level of abstraction above these low-level building blocks, making it easier for us to express parallelism without having to worry about every low-level detail. As we discuss later in this book, there are still some significant limitations, and so these features are not yet sufficiently expressive or performant – there’s still a lot of work to do in the $\mathrm{C}++$ standard.

The most pertinent of these $\mathrm{C}++17$ additions are the execution policies that can be used with the Standard Template Library (STL) algorithms. These policies let us choose whether an algorithm can be safely parallelized, vectorized, parallelized and vectorized, or if it needs to retain its original sequenced semantics. We call an STL implementation that supports these policies a Parallel STL.

Looking into the future, there are proposals that might be included in a future $\mathrm{C}_{++}$ standard with even more parallelism features, such as resumable functions, executors, task blocks, parallel for loops, SIMD vector types, and additional execution policies for the STL algorithms.

## 计算机代写|C++作业代写C++代考|Big Benefits for C++

TBB 库多年来不断发展，不仅可以适应新平台，还可以满足开发人员的需求，这些开发人员希望更好地控制库在将并行性映射到硬件时所做的选择。虽然待定1.0对用户的性能控制很少，TBB 2019 有更多——比如亲和力控制，

## 计算机代写|C++作业代写C++代考|Evolving Support for Parallelism in TBB and C++

TBB 库和C++自最初的 TBB 引入以来，语言已经发生了显着变化。在2006,C++没有对并行编程的语言支持，包括标准模板库 (STL) 在内的许多库都不容易在并行程序中使用，因为它们不是线程安全的。

TBB 原本别无选择，只能填充便携式锁和原子锁等功能。不幸的是，对于C++开发人员，该标准仍然缺乏完全支持并行编程所需的功能。幸运的是，对于本书的读者来说，这意味着 TBB 对于有效的线程化仍然是相关的和必不可少的。C++并且可能会在未来很多年保持相关性。

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

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

## 计算机代写|C++作业代写C++代考|Gustafson’s Observations Regarding Amdahl’s Law

C++ 是一种高级语言，它是由Bjarne Stroustrup 于1979 年在贝尔实验室开始设计开发的。 C++ 进一步扩充和完善了C 语言，是一种面向对象的程序设计语言。 C++ 可运行于多种平台上，如Windows、MAC 操作系统以及UNIX 的各种版本。

statistics-lab™ 为您的留学生涯保驾护航 在代写C++方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写C++代写方面经验极为丰富，各种代写C++相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 计算机代写|C++作业代写C++代考|Gustafson’s Observations Regarding Amdahl’s Law

Amdahl’s Law views programs as fixed, while we make changes to the computer. But experience seems to indicate that as computers get new capabilities, applications change to take advantage of these features. Most of today’s applications would not run on computers from 10 years ago, and many would run poorly on machines that are just 5 years old. This observation is not limited to obvious applications such as video games; it applies also to office applications, web browsers, photography, and video editing software.

More than two decades after the appearance of Amdahl’s Law, John Gustafson, while at Sandia National Labs, took a different approach and suggested a reevaluation of Amdahl’s Law. Gustafson noted that parallelism is more useful when we observe that workloads grow over time. This means that as computers have become more powerful, we have asked them to do more work, rather than staying focused on an unchanging workload. For many problems, as the problem size grows, the work required for the parallel part of the problem grows faster than the part that cannot be parallelized (the serial part). Hence, as the problem size grows, the serial fraction decreases, and, according to Amdahl’s Law, the scalability improves. We can start with an application that looks like Figure P-10, but if the problem scales with the available parallelism, we are likely to see the advancements illustrated in Figure P-13. If the sequential parts still take the same amount of time to perform, they become less and less important as

a percentage of the whole. The algorithm eventually reaches the conclusion shown in Figure P-14. Performance grows at the same rate as the number of processors, which is called linear or order of $n$ scaling, denoted as $O(n)$.
Even in our example, the efficiency of the program is still greatly limited by the serial parts. The efficiency of using processors in our example is about $40 \%$ for large numbers of processors. On a supercomputer, this might be a terrible waste. On a system with multicore processors, one can hope that other work is running on the computer in parallel to use the processing power our application does not use. This new world has many complexities. In any case, it is still good to minimize serial code, whether we take the “glass half empty” view and favor Amdahl’s Law or we lean toward the “glass half full” view and favor Gustafson’s observations.

## 计算机代写|C++作业代写C++代考|Serial vs. Parallel Algorithms

One of the truths in programming is this: the best serial algorithm is seldom the best parallel algorithm, and the best parallel algorithm is seldom the best serial algorithm.
This means that trying to write a program that runs well on a system with one processor core, and also runs well on a system with a dual-core processor or quad-core processor, is harder than just writing a good serial program or a good parallel program.
Supercomputer programmers know from practice that the work required grows quickly as a function of the problem size. If the work grows faster than the sequential overhead (e.g., communication, synchronization), we can fix a program that scales poorly just by increasing the problem size. It’s not uncommon at all to take a program that won’t scale much beyond 100 processors and scale it nicely to 300 or more processors just by doubling the size of the problem.

If you know what a thread is, feel free to skip ahead to the section “Safety in the Presence of Concurrency.” It’s important to be comfortable with the concept of a thread, even though the goal of TBB is to abstract away thread management. Fundamentally, we will still be constructing a threaded program, and we will need to understand the implications of this underlying implementation.

All modern operating systems are multitasking operating systems that typically use a preemptive scheduler. Multitasking means that more than one program can be active at a time. We may take it for granted that we can have an e-mail program and a web browser program running at the same time. Yet, not that long ago, this was not the case. A preemptive scheduler means the operating system puts a limit on how long one program can use a processor core before it is forced to let another program use it. This is how the operating system makes it appear that our e-mail program and our web browser are running at the same time when only one processor core is actually doing the work. Generally, each program runs relatively independent of other programs. In particular, the memory where our program variables will reside is completely separate from the memory used by other processes. Our e-mail program cannot directly assign a new value to a variable in the web browser program. If our e-mail program can communicate with our web browser – for instance, to have it open a web page from a link we received in e-mail – it does so with some form of communication that takes much more time than a memory access.
This isolation of programs from each other has value and is a mainstay of computing today. Within a program, we can allow multiple threads of execution to exist in a single program. An operating system will refer to the program as a process, and the threads of execution as (operating system) threads.

All modern operating systems support the subdivision of processes into multiple threads of execution. Threads run independently, like processes, and no thread knows what other threads are running or where they are in the program unless they synchronize explicitly. The key difference between threads and processes is that the threads within a process share all the data of the process. Thus, a simple memory access can set a variable in another thread. We will refer to this as “shared mutable state” (changeable memory locations that are shared) – and we will decry the pain that sharing can cause in this book. Managing the sharing of data, is a multifaceted problem that we included in our list of enemies of parallel programming. We will revisit this challenge, and solutions, repeatedly in this book.

## 计算机代写|C++作业代写C++代考|Serial vs. Parallel Algorithms

This isolation of programs from each other has value and is a mainstay of computing today. Within a program, we can allow multiple threads of execution to exist in a single program. An operating system will refer to the program as a process, and the threads of execution as (operating system) threads.

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

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

## 计算机代写|C++作业代写C++代考|Achieving Parallelism

C++ 是一种高级语言，它是由Bjarne Stroustrup 于1979 年在贝尔实验室开始设计开发的。 C++ 进一步扩充和完善了C 语言，是一种面向对象的程序设计语言。 C++ 可运行于多种平台上，如Windows、MAC 操作系统以及UNIX 的各种版本。

statistics-lab™ 为您的留学生涯保驾护航 在代写C++方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写C++代写方面经验极为丰富，各种代写C++相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 计算机代写|C++作业代写C++代考|Achieving Parallelism

Coordinating people around the job of preparing and mailing the envelopes is easily expressed by the following two conceptual steps:

1. Assign people to tasks (and feel free to move them around to balance the workload).
2. Start with one person on each of the six tasks but be willing to split up a given task so that two or more people can work on it together.
The six tasks are folding, stuffing, sealing, addressing, stamping, and mailing. We also have six people (resources) to help with the work. That is exactly how TBB works best: we define tasks and data at a level we can explain and then split or combine data to match up with resources available to do the work.
The first step in writing a parallel program is to consider where the parallelism is. Many textbooks wrestle with task and data parallelism as though there were a clear choice. TBB allows any combination of the two that we express. If we are lucky, our program will have an abundant amount of data parallelism available for us to exploit. To simplify this work, TBB requires only that we specify tasks and how to split them. For a completely data-parallel task, in TBB we will define one task to which we give all the data. That task will then be split up automatically

to use the available hardware parallelism. The implicit synchronization (as opposed to synchronization we directly ask for with coding) will often eliminate the need for using locks to achieve synchronization. Referring back to our enemies list, and the fact that we hate locks, the implicit synchronization is a good thing. What do we mean by “implicit” synchronization? Usually, all we are saying is that synchronization occurred but we did not explicitly code a synchronization. At first, this should seem like a “cheat.” After all, synchronization still happened – and someone had to ask for it! In a sense, we are counting on these implicit synchronizations being more carefully planned and implemented. The more we can use the standard methods of TBB, and the less we explicitly write our own locking code, the better off we will be – in general.
By letting TBB manage the work, we hand over the responsibility for splitting up the work and synchronizing when needed. The synchronization done by the library for us, which we call implicit synchronization, in turn often eliminates the need for an explicit coding for synchronization (see Chapter 5 ).

We strongly suggest starting there, and only venturing into explicit synchronization (Chapter 5 ) when absolutely necessary or beneficial. We can say, from experience, even when such things seem to be necessary – they are not. You’ve been warned. If you are like us, you’ll ignore the warning occasionally and get burned. We have.

People have been exploring decomposition for decades, and some patterns have emerged. We’ll cover this more later when we discuss design patterns for parallel programming.

## 计算机代写|C++作业代写C++代考|Terminology: Scaling and Speedup

The scalability of a program is a measure of how much speedup the program gets as we add more computing capabilities. Speedup is the ratio of the time it takes to run a program without parallelism vs. the time it takes to run in parallel. A speedup of $4 \times$ indicates that the parallel program runs in a quarter of the time of the serial program. An example would be a serial program that takes 100 seconds to run on a one-processor machine and 25 seconds to run on a quad-core machine.

As a goal, we would expect that our program running on two processor cores should run faster than our program running on one processor core. Likewise, running on four processor cores should be faster than running on two cores.
Any program will have a point of diminishing returns for adding parallelism. It is not uncommon for performance to even drop, instead of simply leveling off, if we force the use of too many compute resources. The granularity at which we should stop subdividing a problem can be expressed as a grain size. TBB uses a notion of grain size to help limit the splitting of data to a reasonable level to avoid this problem of dropping in performance. Grain size is generally determined automatically, by an automatic partitioner within TBB, using a combination of heuristics for an initial guess and dynamic refinements as execution progresses. However, it is possible to explicitly manipulate the grain size settings if we want to do so. We will not encourage this in this book, because we seldom will do better in performance with explicit specifications than the automatic partitioner in TBB, it tends to be somewhat machine specific, and therefore explicitly setting grain size reduces performance portability.

As Thinking Parallel becomes intuitive, structuring problems to scale will become second nature.

## 计算机代写|C++作业代写C++代考|Amdahl’s Law

Renowned computer architect, Gene Amdahl, made observations regarding the maximum improvement to a computer system that can be expected when only a portion of the system is improved. His observations in 1967 have come to be known as Amdahl’s Law. It tells us that if we speed up everything in a program by $2 x$, we can expect the

resulting program to run $2 \times$ faster. However, if we improve the performance of only $2 / 5$ th of the program by $2 \times$, the overall system improves only by $1.25 \times$.
Amdahl’s Law is easy to visualize. Imagine a program, with five equal parts, that runs in 500 seconds, as shown in Figure P-10. If we can speed up two of the parts by $2 \times$ and $4 \times$, as shown in Figure P-11, the 500 seconds are reduced to only 400 (1.25 × speedup) and 350 seconds (1.4× speedup), respectively. More and more, we are seeing the limitations of the portions that are not speeding up through parallelism. No matter how many processor cores are available, the serial portions create a barrier at 300 seconds that will not be broken (see Figure P-12) leaving us with only $1.7 \times$ speedup. If we are limited to parallel programming in only $2 / 5$ th of our execution time, we can never get more than a $1.7 \times$ boost in performance！

## 计算机代写|C++作业代写C++代考|Achieving Parallelism

1. 将人员分配给任务（并随意调动他们以平衡工作量）。
2. 从一个人开始处理六项任务中的每一项，但愿意将给定的任务分开，以便两个或更多人可以一起工作。
这六项任务是折叠、填充、密封、寻址、盖章和邮寄。我们还有六个人（资源）来帮助工作。这正是 TBB 的最佳工作方式：我们在可以解释的级别定义任务和数据，然后拆分或组合数据以匹配可用于完成工作的资源。
编写并行程序的第一步是考虑并行性在哪里。许多教科书都在与任务和数据并行性作斗争，好像有一个明确的选择。TBB 允许我们表达的两者的任意组合。如果幸运的话，我们的程序将有大量的数据并行性可供我们利用。为了简化这项工作，TBB 只需要我们指定任务以及如何拆分它们。对于完全数据并行的任务，在 TBB 中，我们将定义一个任务，我们将向其提供所有数据。然后该任务将自动拆分

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

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

## 计算机代写|C++作业代写C++代考|Terminology: Data Parallelism

C++ 是一种高级语言，它是由Bjarne Stroustrup 于1979 年在贝尔实验室开始设计开发的。 C++ 进一步扩充和完善了C 语言，是一种面向对象的程序设计语言。 C++ 可运行于多种平台上，如Windows、MAC 操作系统以及UNIX 的各种版本。

statistics-lab™ 为您的留学生涯保驾护航 在代写C++方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写C++代写方面经验极为丰富，各种代写C++相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 计算机代写|C++作业代写C++代考|Terminology: Data Parallelism

Data parallelism (Figure $\mathrm{P}-3$ ) is easy to picture: take lots of data and apply the same transformation to each piece of the data. In Figure P-3, each letter in the data set is capitalized and becomes the corresponding uppercase letter. This simple example shows that given a data set and an operation that can be applied element by element, we can apply the same task in parallel to each element. Programmers writing code for supercomputers love this sort of problem and consider it so easy to do in parallel that it has been called embarrassingly parallel. A word of advice: if you have lots of data parallelism, do not be embarrassed – take advantage of it and be very happy. Consider i happy parallelism.

When comparing the effort to find work to do in parallel, an approach that focuses on data parallelism is limited by the amount of data we can grab to process. Approaches based on task parallelism alone are limited by the different task types we program. Whil both methods are valid and important, it is critical to find parallelism in the data that we process in order to have a truly scalable parallel program. Scalability means that our application can increase in performance as we add hardware (e.g., more processor cores) provided we have enough data. In the age of big data, it turns out that big data and parallel programming are made for each other. It seems that growth in data sizes is a reliable source of additional work. We will revisit this observation, a little later in this Preface, when we discuss Amdahl’s Law.

## 计算机代写|C++作业代写C++代考|Terminology: Pipelining

While task parallelism is harder to find than data parallelism, a specific type of task parallelism is worth highlighting: pipelining. In this kind of algorithm, many independent tasks need to be applied to a stream of data. Each item is processed by each stage, as shown by the letter A in (Figure P-4). A stream of data can be processed more quickly when we use a pipeline, because different items can pass through different stages at the same time, as shown in Figure P-5. In these examples, the time to get a result may not be faster (referred to as the latency measured as the time from input to output) but the throughput is greater because it is measured in terms of completions (output) per unit of time. Pipelines enable parallelism to increase throughput when compared with a sequential (serial) processing. A pipeline can also be more sophisticated: it can reroute data or skip steps for chosen items. TBB has specific support for simple pipelines (Chapter 2) and very complex pipelines (Chapter 3). Of course, each step in the pipeline can use data or task parallelism as well. The composability of TBB supports this seamlessly.

## 计算机代写|C++作业代写C++代考|Example of Exploiting Mixed Parallelism

Consider the task of folding, stuffing, sealing, addressing, stamping, and mailing letters. If we assemble a group of six people for the task of stuffing many envelopes, we can arrange each person to specialize in and perform their assigned task in a pipeline fashion (Figure P-6). This contrasts with data parallelism, where we divide up the supplies and give a batch of everything to each person (Figure P-7). Each person then does all the steps on their collection of materials.
Figure P- 7 is clearly the right choice if every person has to work in a different location far from each other. That is called coarse-grained parallelism because the interactions between the tasks are infrequent (they only come together to collect envelopes, then leave and do their task, including mailing). The other choice shown in Figure P-6 approximates what we call fine-grained parallelism because of the frequent interactions (every envelope is passed along to every worker in various steps of the operation).
Neither extreme tends to fit reality, although sometimes they may be close enough to be useful. In our example, it may turn out that addressing an envelope takes enough time to keep three people busy, whereas the first two steps and the last two steps require only one person on each pair of steps to keep up. Figure P-8 illustrates the steps with the corresponding size of the work to be done. We can conclude that if we assigned only one person to each step as we see done in Figure P-6, that we would be “starving” some people in this pipeline of work for things to do – they would be idle. You might say it would be hidden “underemployment.” Our solution, to achieve a reasonable balance in our pipeline (Figure P-9) is really a hybrid of data and task parallelism.

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

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

## 计算机代写|C++作业代写C++代考|Concurrent vs. Parallel

C++ 是一种高级语言，它是由Bjarne Stroustrup 于1979 年在贝尔实验室开始设计开发的。 C++ 进一步扩充和完善了C 语言，是一种面向对象的程序设计语言。 C++ 可运行于多种平台上，如Windows、MAC 操作系统以及UNIX 的各种版本。

statistics-lab™ 为您的留学生涯保驾护航 在代写C++方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写C++代写方面经验极为丰富，各种代写C++相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 计算机代写|C++作业代写C++代考|Concurrent vs. Parallel

It is worth noting that the terms concurrent and parallel are related, but subtly different. Concurrent simply means “happening during the same time span” whereas parallel is more specific and is taken to mean “happening at the same time (at least some of the time).” Concurrency is more like what a single person tries to do when multitasking, whereas parallel is akin to what multiple people can do together. Figure P-1 illustrates the concepts of concurrency vs. parallelism. When we create effective parallel programs, we are aiming to accomplish more than just concurrency. In general, speaking of concurrency will mean there is not an expectation for a great deal of activity to be truly parallel – which means that two workers are not necessarily getting more work done than one could in theory (see tasks A and B in Figure P-1). Since the work is not done sooner, concurrency does not improve the latency of a task (the delay to start a task). Using the term parallel conveys an expectation that we improve latency and throughput (work done in a given time). We explore this in more depth starting on page xxxv when we explore limits of parallelism and discuss the very important concepts of Amdahl’s Law.

## 计算机代写|C++作业代写C++代考|Enemies of Parallelism

Bearing in mind the enemies of parallel programming will help understand our advocacy for particular programming methods. Key parallel programming enemies include

• Locks: In parallel programming, locks or mutual exclusion objects (mutexes) are used to provide a thread with exclusive access to a resource – blocking other threads from simultaneously accessing the same resource. Locks are the most common explicit way to ensure parallel tasks update shared data in a coordinated fashion (as opposed to allowing pure chaos). We hate locks because they serialize part of our programs, limiting scaling. The sentiment “we hate locks” is on our minds throughout the book. We hope to instill this mantra in you as well, without losing sight of when we must synchronize properly. Hence, a word of caution: we actually do love locks when they are needed, because without them disaster will strike. This love/hate relationship with locks needs to be understood.
• Shared mutable state: Mutable is another word for “can be changed.” Shared mutable state happens any time we share data among multiple threads, and we allow it to change while being shared. Such sharing either reduces scaling when synchronization is needed and used correctly, or it leads to correctness issues (race conditions or deadlocks) when synchronization (e.g., a lock) is incorrectly applied. Realistically, we need shared mutable state when we write interesting applications. Thinking about careful handling of shared mutable state may be an easier way to understand the basis of our love/hate relationship with locks. In the end, we all end up “managing” shared mutable state and the mutual exclusion (including locks) to make it work as we wish.
• Not “Thinking Parallel”: Use of clever bandages and patches will not make up for a poorly thought out strategy for scalable algorithms. Knowing where the parallelism is available, and how it can be

exploited, should be considered before implementation. Trying to add parallelism to an application, after it is written, is fraught with peril. Some preexisting code may shift to use parallelism relatively well, but most code will benefit from considerable rethinking of algorithms.

• Forgetting that algorithms win: This may just be another way to say “Think Parallel.” The choice of algorithms has a profound effect on the scalability of applications. Our choice of algorithms determine how tasks can divide, data structures are accessed, and results are coalesced. The optimal algorithm is really the one which serves as the basis for optimal solution. An optimal solution is a combination of the appropriate algorithm, with the best matching parallel data structure, and the best way to schedule the computation over the data. The search for, and discovery of, algorithms which are better is seemingly unending for all of us as programmers. Now, as parallel programmers, we must add scalable to the definition of better for an algorithm.

## 计算机代写|C++作业代写C++代考|Terminology of Parallelism

The vocabulary of parallel programming is something we need to learn in order to converse with other parallel programmers. None of the concepts are particularly hard, but they are very important to internalize. A parallel programmer, like any programmer, spends years gaining a deep intuitive feel for their craft, despite the fundamentals being simple enough to explain.
We will discuss decomposition of work into parallel tasks, scaling terminology, correctness considerations, and the importance of locality due primarily to cache effects. When we think about our application, how do we find the parallelism?
At the highest level, parallelism exists either in the form of data to operate on in parallel, or in the form of tasks to execute in parallel. And they are not mutually exclusive. In a sense, all of the important parallelism is in data parallelism. Nevertheless, we will introduce both because it can be convenient to think of both. When we discuss scaling, and Amdahl’s Law, our intense bias to look for data parallelism will become more understandable.

## 计算机代写|C++作业代写C++代考|Enemies of Parallelism

• 锁：在并行编程中，锁或互斥对象（互斥体）用于为线程提供对资源的独占访问——阻止其他线程同时访问同一资源。锁是确保并行任务以协调的方式更新共享数据的最常见的显式方式（而不是允许纯粹的混乱）。我们讨厌锁，因为它们序列化了我们程序的一部分，限制了扩展。“我们讨厌锁”的情绪贯穿整本书。我们也希望将这个口头禅灌输给你，同时不要忽视我们何时必须正确同步。因此，请注意：我们实际上会在需要时使用爱锁，因为没有它们，灾难就会降临。需要了解这种与锁的爱/恨关系。
• 共享可变状态：可变是“可以更改”的另一个词。每当我们在多个线程之间共享数据时，都会发生共享可变状态，并且我们允许它在共享时更改。这种共享要么在需要和正确使用同步时减少缩放，要么在不正确地应用同步（例如，锁）时导致正确性问题（竞争条件或死锁）。实际上，当我们编写有趣的应用程序时，我们需要共享可变状态。仔细考虑共享可变状态的处理可能是一种更容易理解我们对锁的爱/恨关系的基础的方法。最后，我们最终都会“管理”共享可变状态和互斥（包括锁），以使其按我们的意愿工作。
• 不是“并行思考”：使用巧妙的绷带和补丁无法弥补可扩展算法的考虑不周的策略。了解并行性在哪里可用，以及如何实现

• 忘记算法获胜：这可能只是“并行思考”的另一种说法。算法的选择对应用程序的可扩展性有着深远的影响。我们对算法的选择决定了如何划分任务、访问数据结构以及合并结果。最优算法实际上是作为最优解的基础的算法。最佳解决方案是适当的算法、最佳匹配的并行数据结构以及调度数据计算的最佳方式的组合。对于我们所有的程序员来说，寻找和发现更好的算法似乎是永无止境的。现在，作为并行程序员，我们必须将可扩展性添加到更好的算法的定义中。

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

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

## 计算机代写|C++作业代写C++代考|Parallel Programming Does Not Have to Be Messy

C++ 是一种高级语言，它是由Bjarne Stroustrup 于1979 年在贝尔实验室开始设计开发的。 C++ 进一步扩充和完善了C 语言，是一种面向对象的程序设计语言。 C++ 可运行于多种平台上，如Windows、MAC 操作系统以及UNIX 的各种版本。

statistics-lab™ 为您的留学生涯保驾护航 在代写C++方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写C++代写方面经验极为丰富，各种代写C++相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 计算机代写|C++作业代写C++代考|Parallel Programming Does Not Have to Be Messy

TBB offers composability for parallel programming, and that changes everything. Composability means we can mix and match features of TBB without restriction. Most notably, this includes nesting. Therefore, it makes perfect sense to have a parallel_for inside a parallel_for loop. It is also okay for a parallel_for to call a subroutine, which then has a parallel_for within it.
Supporting composable nested parallelism turns out to be highly desirable because it exposes more opportunities for parallelism, and that results in more scalable applications. OpenMP, for instance, is not composable with respect to nesting because each level of nesting can easily cause significant overhead and consumption of resources leading to exhaustion and program termination. This is a huge problem when you consider that a library routine may contain parallel code, so we may experience issues using a non-composable technique if we call the library while already doing parallelism. No such problem exists with TBB, because it is composable. TBB solves this, in part, by letting use expose opportunities for parallelism (tasks) while TBB decides at runtime how to map them to hardware (threads).

This is the key benefit to coding in terms of tasks (available but nonmandatory parallelism (see “relaxed sequential semantics” in Chapter 2)) instead of threads (mandatory parallelism). If a parallel_for was considered mandatory, nesting would cause an explosion of threads which causes a whole host of resource issues which can easily (and often do) crash programs when not controlled. When parallel_for exposes

available nonmandatory parallelism, the runtime is free to use that information to match the capabilities of the machine in the most effective manner.
We have come to expect composability in our programming languages, but most parallel programming models have failed to preserve it (fortunately, TBB does preserve composability!). Consider “if” and “while” statements. The $\mathrm{C}$ and $\mathrm{C}++$ languages allow them to freely mix and nest as we desire. Imagine this was not so, and we lived in a world where a function called from within an if statement was forbidden to contain a while statement! Hopefully, any suggestion of such a restriction seems almost silly. TBB brings this type of composability to parallel programming by allowing parallel constructs to be freely mixed and nested without restrictions, and without causing issues.

## 计算机代写|C++作业代写C++代考|Scaling, Performance, and Quest for Performance

Perhaps the most important benefit of programming with TBB is that it helps create a performance portable application. We define performance portability as the characteristic that allows a program to maintain a similar “percentage of peak performance” across a variety of machines (different hardware, different operating systems, or both). We would like to achieve a high percentage of peak performance on many different machines without the need to change our code.
We would also like to see a $16 \times$ gain in performance on a 64 -core machine vs. a quad-core machine. For a variety of reasons, we will almost never see ideal speedup (never say never: sometimes, due to an increase in aggregate cache size we can see more than ideal speedup – a condition we call superlinear speedup).
WHAT IS SPEEDUP?
Speedup is formerly defined to be the time to run sequentially (not in parallel) divided by the time to run in parallel. If my program runs in 3 seconds normally, but in only 1 second on a quad-core processor, we would say it has a speedup of $3 \times$. Sometimes, we might speak of efficiency which is speedup divided by the number of processing cores. Our $3 \times$ would be $75 \%$ efficient at using the parallelism.
The ideal goal of a $16 \times$ gain in performance when moving from a quad-core machine to one with 64 cores is called linear scaling or perfect scaling.

## 计算机代写|C++作业代写C++代考|Introduction to Parallel Programming

To accomplish this, we need to keep all the cores busy as we grow their numbers – something that requires considerable available parallelism. We will dive more into this concept of “available parallelism” starting on page xxxvii when we discuss Amdahl’s Law and its implications.

For now, it is important to know that TBB supports high-performance programming and helps significantly with performance portability. The high-performance support comes because TBB introduces essentially no overhead which allows scaling to proceed without issue. Performance portability lets our application harness available parallelism as new machines offer more.
In our confident claims here, we are assuming a world where the slight additional overhead of dynamic task scheduling is the most effective at exposing the parallelism and exploiting it. This assumption has one fault: if we can program an application to perfectly match the hardware, without any dynamic adjustments, we may find a few percentage points gain in performance. Traditional High-Performance Computing (HPC) programming, the name given to programming the world’s largest computers for intense computations, has long had this characteristic in highly parallel scientific computations. HPC developer who utilize OpenMP with static scheduling, and find it does well with their performance, may find the dynamic nature of TBB to be a slight reduction in performance. Any advantage previously seen from such static scheduling is becoming rarer for a variety of reasons. All programming including HPC programming, is increasing in complexity in a way that demands support for nested and dynamic parallelism support. We see this in all aspects of HPC programming as well, including growth to multiphysics models, introduction of AI (artificial intelligence), and use of ML (machine learning) methods. One key driver of additional complexity is the increasing diversity of hardware, leading to heterogeneous compute capabilities within a single machine. TBB gives us powerful options for dealing with these complexities, including its flow graph features which we will dive into in Chapter $3 .$

## 计算机代写|C++作业代写C++代考|Parallel Programming Does Not Have to Be Messy

TBB 为并行编程提供了可组合性，这改变了一切。可组合性意味着我们可以不受限制地混合和匹配 TBB 的特性。最值得注意的是，这包括嵌套。因此，在 parallel_for 循环中包含一个 parallel_for 是非常有意义的。一个parallel_for 调用一个子例程也是可以的，子例程里面有一个parallel_for。

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

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

## 计算机代写|C++作业代写C++代考|Organization of the Book and Preface

C++ 是一种高级语言，它是由Bjarne Stroustrup 于1979 年在贝尔实验室开始设计开发的。 C++ 进一步扩充和完善了C 语言，是一种面向对象的程序设计语言。 C++ 可运行于多种平台上，如Windows、MAC 操作系统以及UNIX 的各种版本。

statistics-lab™ 为您的留学生涯保驾护航 在代写C++方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写C++代写方面经验极为丰富，各种代写C++相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 计算机代写|C++作业代写C++代考|Think Parallel

For those new to parallel programming, we offer this Preface to provide a foundation that will make the remainder of the book more useful, approachable, and self-contained. We have attempted to assume only a basic understanding of $C$ programming and introduce the key elements of $\mathrm{C}++$ that $\mathrm{TBB}$ relies upon and supports. We introduce parallel programming from a practical standpoint that emphasizes what makes parallel programs most effective. For experienced parallel programmers, we hope this Preface will be a quick read that provides a useful refresher on the key vocabulary and thinking that allow us to make the most of parallel computer hardware.

After reading this Preface, you should be able to explain what it means to “Think Parallel” in terms of decomposition, scaling, correctness, abstraction, and patterns. You will appreciate that locality is a key concern for all parallel programming. You will understand the philosophy of supporting task programming instead of thread programming – a revolutionary development in parallel programming supported by TBB. You will also understand the elements of $\mathrm{C}_{++}$programming that are needed above and beyond a knowledge of $\mathrm{C}$ in order to use TBB well.
The remainder of this Preface contains five parts:
(1) An explanation of the motivations behind TBB (begins on page xxi)
(2) An introduction to parallel programming (begins on page xxvi)
(3) An introduction to locality and caches – we call “Locality and the Revenge of the Caches” – the one aspect of hardware that we feel essential to comprehend for top performance with parallel programming (begins on page lii)
(4) An introduction to vectorization (SIMD) (begins on page $l x$ )
(5) An introduction to the features of $\mathrm{C}++$ (beyond those in the $\mathrm{C}$ language) which are supported or used by TBB (begins on page lxii)

## 计算机代写|C++作业代写C++代考|Motivations Behind Threading Building Blocks

TBB first appeared in 2006. It was the product of experts in parallel programming at Intel, many of whom had decades of experience in parallel programming models, including OpenMP. Many members of the TBB team had previously spent years helping drive OpenMP to the great success it enjoys by developing and supporting OpenMP implementations. Appendix A is dedicated to a deeper dive on the history of TBB and the core concepts that go into it, including the breakthrough concept of task-stealing schedulers.

Born in the early days of multicore processors, TBB quickly emerged as the most popular parallel programming model for $\mathrm{C}++$ programmers. TBB has evolved over its first decade to incorporate a rich set of additions that have made it an obvious choice for parallel programming for novices and experts alike. As an open source project, TBB has enjoyed feedback and contributions from around the world.

TBB promotes a revolutionary idea: parallel programming should enable the programmer to expose opportunities for parallelism without hesitation, and the underlying programming model implementation (TBB) should map that to the hardware at runtime.
Understanding the importance and value of TBB rests on understanding three things: (1) program using tasks, not threads; (2) parallel programming models do not need to be messy; and (3) how to obtain scaling, performance, and performance portability with portable low overhead parallel programming models such as TBB. We will dive into each of these three next because they are so important! It is safe to say that the importance of these were underestimated for a long time before emerging as cornerstones in our understanding of how to achieve effective, and structured, parallel programming.

Parallel programming should always be done in terms of tasks, not threads. We cite an authoritative and in-depth examination of this by Edward Lee at the end of this Preface. In 2006, he observed that “For concurrent programming to become mainstream, we must discard threads as a programming model.”
Parallel programming expressed with threads is an exercise in mapping an application to the specific number of parallel execution threads on the machine we happen to run upon. Parallel programming expressed with tasks is an exercise in exposing opportunities for parallelism and allowing a runtime (e.g., TBB runtime) to map tasks onto the hardware at runtime without complicating the logic of our application.

In contrast, tasks represent opportunities for parallelism. The ability to subdivide tasks can be exploited, as needed, to fill available threads when needed.

With these definitions in mind, a program written in terms of threads would have to map each algorithm onto specific systems of hardware and software. This is not only a distraction, it causes a whole host of issues that make parallel programming more difficult, less effective, and far less portable.

Whereas, a program written in terms of tasks allows a runtime mechanism, for example, the TBB runtime, to map tasks onto the hardware which is actually present at runtime. This removes the distraction of worrying about the number of actual hardware threads available on a system. More importantly, in practice this is the only method which opens up nested parallelism effectively. This is such an important capability, that we will revisit and emphasize the importance of nested parallelism in several chapters.

## 计算机代写|C++作业代写C++代考|Think Parallel

(1) 解释 TBB 背后的动机（从第 xxi 页开始）
(2) 并行编程介绍（从第 xxvi 页开始）
(3) 对局部性和缓存的介绍——我们称之为“局部性和缓存的复仇”——我们认为硬件的一个方面是我们认为对于实现并行编程的最佳性能至关重要的一个方面（从第 lii 页开始）
(4) 矢量化 (SIMD) 简介（从第 1 页开始）lX)
(5) 特点介绍C++（除了那些在CTBB 支持或使用的语言）（从第 lxii 页开始）

## 计算机代写|C++作业代写C++代考|Motivations Behind Threading Building Blocks

TBB 于 2006 年首次出现。它是英特尔并行编程专家的产物，其中许多人在包括 OpenMP 在内的并行编程模型方面拥有数十年的经验。TBB 团队的许多成员此前曾花费数年时间帮助推动 OpenMP 取得巨大成功，通过开发和支持 OpenMP 实施。附录 A 致力于深入探讨 TBB 的历史和其中的核心概念，包括任务窃取调度程序的突破性概念。

TBB 诞生于多核处理器的早期，迅速成为最流行的并行编程模型C++程序员。TBB 在其第一个十年中不断发展，包含了一组丰富的附加功能，使其成为新手和专家等并行编程的明显选择。作为一个开源项目，TBB 得到了来自世界各地的反馈和贡献。

TBB 提出了一个革命性的想法：并行编程应该使程序员能够毫不犹豫地展示并行性的机会，并且底层编程模型实现 (TBB) 应该在运行时将其映射到硬件。

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

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


text:
## Lecture 24. Sharp Sobolev inequalities

In this Lecture, we are interested in sharp Sobolev inequalities in positive curvature. Let $(\mathbb{M},g)$ be a complete and $n$-dimensional Riemannian manifold such that $\mathbf{Ricci} \ge \rho$ where $\rho > 0$. We assume $n > 2$. As we already know from Lecture 15 , we have $\mu (\mathbb{M}) < +\infty$, but as we already stressed we do not want to use Bonnet-Myers theorem, since one of our goals will be to recover it by using heat kernel techniques. Without loss of generality, and to simplify the constants, we assume that $\mu(\mathbb{M}) =1$. Our goal is to prove the following sharp result:

Theorem: For every $1 \le p \le \frac{2n}{n-2}$ and $f \in C^\infty_0(\mathbb{M})$,
$\frac{n \rho}{(n-1)(p-2)} \left( \left( \int_{\mathbb{M}} | f |^p d\mu\right)^{2/p}-\int_\mathbb{M} f^2 d\mu \right) \le \int_\mathbb{M} \Gamma(f) d\mu.$

Our proof follows an argument due to Bakry. We observe that for $p=1$, the inequality becomes
$\frac{n \rho}{(n-1)} \left( \int_\mathbb{M} f^2 d\mu - \left( \int_{\mathbb{M}} | f | d\mu\right)^{2} \right) \le \int_\mathbb{M} \Gamma(f) d\mu.$
which is the Poincare inequality with optimal Lichnerowicz constant. For $p=2$, we get the log-Sobolev inequality
$\frac{n \rho}{2(n-1)} \left( \int_\mathbb{M} f^2 \ln f^2 d\mu -\int_\mathbb{M} f^2 d\mu \ln\int_\mathbb{M} f^2 d\mu \right) \le \int_\mathbb{M} \Gamma(f) d\mu.$
We prove our Sobolev inequality in several steps.

Lemma: For every $1 \le p \le \frac{2n}{n-2}$, there exists a constant $C_p > 0$ such that for every $f \in C^\infty_0(\mathbb{M})$,
$C_p \left( \left( \int_{\mathbb{M}} | f |^p d\mu\right)^{2/p}-\int_\mathbb{M} f^2 d\mu \right) \le \int_\mathbb{M} \Gamma(f) d\mu.$

Proof: Using Jensen’s inequality, it is enough to prove the result for $p= \frac{2n}{n-2}$. We already proved the following Li-Yau inequality: For $f \in C^\infty_0(\mathbb{M})$, $f \neq 0$, $t > 0$, and $x \in \mathbb{M}$,
$\| \nabla \ln P_t f (x) \|^2 \le e^{-\frac{2\rho t}{3}} \frac{ L P_t f (x)}{P_t f (x)} +\frac{n\rho}{3} \frac{e^{-\frac{4\rho t}{3}}}{ 1-e^{-\frac{2\rho t}{3}}}.$
As a consequence we have
$\frac{ L P_t f (x)}{P_t f (x)} \ge- \frac{n\rho}{3} \frac{e^{-\frac{2\rho t}{3}}}{ 1-e^{-\frac{2\rho t}{3}}},$
which yields,
$\int_t^{+\infty} \partial_t \ln P_sf (x) ds \ge- \frac{n\rho}{3} \int_t^{+\infty} \frac{e^{-\frac{2\rho s}{3}}}{ 1-e^{-\frac{2\rho s}{3}}} ds.$
We obtain then
$P_tf(x) \le \left( \frac{1}{1-e^{-\frac{2\rho t}{3}} }\right)^{n/2} \int_\mathbb{M} f d\mu.$
This of course implies the following upper bound on the heat kernel,
$p(x,y,t) \le \left( \frac{1}{1-e^{-\frac{2\rho t}{3}} }\right)^{n/2}.$
Using Varopoulos theorem, we deduce therefore that there is constant $C_p'$ such that for every $f \in C^\infty_0(\mathbb{M})$,
$\| f \|^2_{p} \le C'_p \left( \| \sqrt{\Gamma(f)} \|^2_2 + \| f \|^2_2 \right).$
We now use the following inequality which is easy to see:
$\left( \int_{\mathbb{M}} | f |^p d\mu \right)^{2/p} \le \left( \int_{\mathbb{M}} f d\mu \right)^{2}+\left( \int_{\mathbb{M}} \left| f -\int_{\mathbb{M}} f d\mu \right|^p d\mu \right)^{2/p}$
This yields
$\left( \int_{\mathbb{M}} | f |^p d\mu \right)^{2/p} \le \left( \int_{\mathbb{M}} f d\mu \right)^{2} +(p-1)C'_p \left( \| \sqrt{\Gamma(f)} \|^2_2 + \left\| f-\int_{\mathbb{M}} f d\mu \right\|^2_2 \right)$.
We can now bound
$\left\| f-\int_{\mathbb{M}} f d\mu \right\|^2_2 \le \frac{1}{\lambda_1} \int_\mathbb{M} \Gamma(f) d\mu,$
using the Poincare inequality $\square$

We now want to prove that the optimal $C_p$ in the previous inequality satisfies $C_p \ge \frac{n \rho}{(n-1)(p-2)}$. We assume $p > 2$ and consider the functional
$\frac{\left( \int_{\mathbb{M}} | f |^p d\mu\right)^{2/p}-\int_\mathbb{M} f^2 d\mu}{ \int_\mathbb{M} \Gamma(f) d\mu}.$
Classical non linear variational principles on the functional provide then a positive non trivial solution of the equation
$C_p(f^{p-1}-f)=-Lf.$
Set $f=u^r$ where $r$ is a constant to be later chosen. By the chain rule for diffusion operators, we get
$C_p ( u^{r(p-1)}-u^r)=-ru^{r-1}Lu -r(r-1)u^{r-2} \Gamma(u).$
Multiplying by $u^{-r} \Gamma(u)$ and integrating yields
$C_p \left( \int_{\mathbb{M}} u^{r(p-2)} \Gamma(u) d\mu -\int_{\mathbb{M}} \Gamma (u) d\mu \right)=-r \int_{\mathbb{M}} \frac{Lu}{u} \Gamma(u) d\mu -r (r-1) \int_{\mathbb{M}} \frac{\Gamma(u)^2}{u^2} d\mu.$
Now, integrating by parts,
$\int_{\mathbb{M}} u^{r(p-2)} \Gamma(u) d\mu=-\frac{1}{r(p-2)+1} \int_{\mathbb{M}} u^{r(p-2)+1} Lu d\mu.$
On the other hand, multiplying
$C_p ( u^{r(p-1)}-u^r)=-ru^{r-1} -r(r-1)u^{r-2} \Gamma(u),$
by $u^{1-r} Lu$ and integrating with respect to $\mu$ yields
$C_p \left( \int_{\mathbb{M}} u^{r(p-2)+1} Lu d\mu - \int_{\mathbb{M}} uLu d\mu \right)=-r \int_{\mathbb{M}} (Lu)^2 d\mu -r(r-1) \int_{\mathbb{M}} \frac{Lu}{u} \Gamma(u) d\mu.$
Combining the previous computations gives
$C_p \left( r(p-2) +1\right) \int_{\mathbb{M}} u^{r(p-2)} \Gamma(u) d\mu = r \int_{\mathbb{M}} (Lu)^2 d\mu +r(r-1) \int_{\mathbb{M}} \frac{Lu}{u} \Gamma(u) d\mu +C_p \int_{\mathbb{M}} \Gamma(u) d\mu$
Hence, we have
$C_p (p-2) \int_{\mathbb{M}} \Gamma(u) d\mu= \int_{\mathbb{M}} (Lu)^2 d\mu + \int_{\mathbb{M}} \frac{Lu}{u} \Gamma(u) d\mu +(r-1) \left( r(p-2) +1\right) \int_{\mathbb{M}} \frac{\Gamma(u)^2}{u^2} d\mu$
We have from Bochner’s inequality,
$\Gamma_2 (u^s)\ge \frac{1}{n} ( L u^s)^2 +\rho \Gamma(u^s).$
Once again, $s$ is a parameter that will be later decided. Using the chain, to rewrite the previous inequality, leads after tedious computations to
$\Gamma_2(u) +(s-1) \frac{1}{u} \Gamma ( u , \Gamma(u)) +(s-1)^2 \frac{\Gamma(u)^2}{u^2} \ge \rho \Gamma(u) +\frac{1}{n} (Lu)^2 +\frac{2}{n} (s-1) \frac{1}{u} Lu \Gamma (u) +\frac{1}{n} (s-1)^2 \frac{1}{u^2} \Gamma(u)^2.$
After integration and integration by parts, we see that
$\rho \int_{\mathbb{M}} \Gamma(u) d\mu \le \left( 1 -\frac{1}{n} \right) \int_{\mathbb{M}} (Lu)^2 d\mu-s' \left( 1+\frac{2}{n} \right) \int_{\mathbb{M}} \frac{1}{u} Lu \Gamma (u) d\mu+s'\left( 1+s'\left( 1-\frac{1}{n} \right) \right) \int_{\mathbb{M}} \frac{\Gamma(u)^2}{u^2} d\mu,$
where $s'=s-1$. Combining the previous inequalities we can eliminate the term $\int_{\mathbb{M}} \frac{1}{u} Lu \Gamma (u) d\mu$. Chosing
$\frac{s'}{r}=(p-1) \frac{n-1}{n+2},$
we see that the coefficient in front of $\int_{\mathbb{M}} (Lu)^2 d\mu$ is zero and we are left with
$\left( C_p \frac{(p-2)(n-1)}{n} -\rho \right)\int_\mathbb{M} \Gamma(u) d\mu \ge K(s',r) \int_{\mathbb{M}} \frac{\Gamma(u)^2}{u^2} d\mu,$
for some constant $K(s',r)$ which is seen to be non-negative as soon as $2 < p \le \frac{2n}{n-2}$. We conclude
$C_p \frac{(p-2)(n-1)}{n} -\rho \ge 0.$

This entry was posted in Curvature dimension inequalities. Bookmark the permalink.

format: plain


text:
## Deckset 1.6.2-Mac OSX

Deckset 1.6.2 | Mac OSX | 59.60 MB

Deckset is a new, simple way to create presentations. Open your favourite text editor, write down your thoughts and Deckset will turn them into beautiful presentations. Focus on your ideas, not on designing slides. Deckset comes with ten amazing-looking themes that are designed to work for any audience, whether it's a business meeting or a tech conference.
FEATURES
- 15 themes for every occasion, ranging from playful to serious
- Automatic layout and advanced typographic features
- Present code samples with syntax highlighting and "scale to fit"
- Easily include images and videos
- Stunning image filters
- Speaker notes and rehearsal mode
- Everything's Markdown-edit your presentation using your favorite text editor
- Floating preview window
- Easily change aspect ratio to suit any projector
- Export to PDF
- Formula support as in-app purchase

What's new version 1.6.2
# Formula support has been fully overhauled ...and now comes for FREE!
We greatly improved how MathJax formulas are getting rendered on your slides. In fact, we were so happy with the improvements that we decided to no longer make formula support an In-App Purchase but include it with Deckset. Hope you like it!

# All-new export options
The export options used to be a little, well, sparse. But not anymore! You can now export your presentation with presenter notes, as well as export all your slides as images. Also, you can now export each stage of build steps-and there's more to come!

# Specify color swatch with theme selection
When we introduced the possibility to specify your theme choice in Markdown, we didn't think specifying the color swatch would be that important. But your feedback proved us otherwise. So this is now possible, yay! It would certainly be too much to ask from you to come up with the right names for all of those colors, so you can specify them by their index, e.g. "theme: Plain Jane, 1".

# Improved presenter notes
You can now format your presenter notes with Markdown and they get rendered accordingly in presentation mode.

# On stage a lot?
Use a Bluetooth mouse? You can now use the right mouse button to go back one slide. Whoop!

# Other improvements and bug fixes
- We managed to track down a somewhat esoteric bug, that prevented presenter mode from working properly on certain projectors at certain resolutions. Consider this bug squashed.
- Occasionally, links in your presentation caused Deckset to crash on export. This has been fixed!
- We made portrait videos behave nicely. Phew!

OS-MacOSX 10.9 or Later

http://www.decksetapp.com/


text:
## anonymous 5 years ago EVERYBODY LOOK HERE!!!!! what is -6.4 as a fraction

1. anonymous

Gracias Senor I am forever grateful!!!! U get fre medal and fan and...thats all i can give:(

2. karatechopper

-6 2/5

3. karatechopper

and i am a Senorita

4. anonymous

gracias senorita ;)

5. anonymous

-6.4 = -(6+0.4) = -(6+2/5) = -32/5

6. TuringTest

ok, you have my attention... rewrite this as$-\frac{6.4}{1}$now we want to get rid of the 0.4 on top, so we need to multiply it by something to make it go away. Whatever we multiply the top by though, we have to multiply the bottom by as well. A little thought and you will notice that $6.4\times5=32$so we will multiply top and bottom of our fraction by 5$-\frac{6.4}{1}\times\frac{5}{5}=-\frac{32}{5}$try to understand the process I used so you don't have to keep asking the same type of question.

7. karatechopper

:D

8. anonymous

ALL OF YOU HAVE MY ETERNAL LOVE!!!

9. Akshay_Budhkar

nothing wrong is what turing says.. its more than perfect.. just to add my toppings on that beautiful cake, i will multiply it with 10 instead of 5 then divide it with 2 :D Find that simpler and faster :D

10. TuringTest

true^ smarter, and therefor easier way :)

11. Akshay_Budhkar

:D

12. anonymous

Turing's was good because he saw that 5 was needed to multiply 6.4 in order to produce an integer. In fact, and integer multiple of 5 will do, picking 5 shows mad skillz

13. anonymous

so how woud u do 0.48

14. anonymous

any*

15. TuringTest

Let's do this one akshay's way:$0.48=\frac{0.48}{1}$the top will obviously be an integer if we multiply it by 100, because$0.48\times100=48$but that means we need to do the same to the bottom as well. So what do we get by multiplying the top and bottom by 100 ?

16. anonymous

um...0.480/100?

17. TuringTest

^the numerator is wrong.$0.48\times100=48$so$0.48=\frac{0.48}{1}\times\frac{100}{100}=?$

18. anonymous

karatechopper help me plzz!!

19. anonymous

ok so 48/100

20. TuringTest

remember that whenever we multiply a decimal by some power of ten, we move the decimal point to the right by the number of zeros after the one 100 has two zero's, so$0.48\times100$will work like |dw:1327025337117:dw|so now we have$0.48=\frac{48}{100}$notice that both the top and bottom are even, so we can divide them both by 2 (this was akshay's method) so what do we get by dividing the top and bottom of our fraction by 2?

21. anonymous

24/50

22. TuringTest

yes, and are top and bottom still both even?

23. anonymous

yes

24. TuringTest

so do it again

25. anonymous

12/25

26. TuringTest

good :) clearly 25 is not even, so no more dividing by 2 is possible so now ask yourself: is there ANY number that we can divide both top and bottom by that will leave us with integers on the top and bottom?

27. TuringTest

Well, you have apparently become bored of our discussion, so I will show you how you can know we are done: Assuming you know how to factor numbers, factor the top and bottom:$\frac{12}{25}=\frac{2\times2\times3}{5\times5}$since there are no /common factors/ on the top and bottom, this must be an irreducible fraction, so we are done.$0.48=\frac{12}{25}$

28. anonymous

sorry computer crashed

Find more explanations on OpenStudy


text:
CiteULike is a free online bibliography manager. Register and you can start organising your references online.
Tags

# Matching Vector Codes

SIAM J. Comput., Vol. 40, No. 4. (January 2011), pp. 1154-1178, doi:10.1137/100804322  Key: citeulike:11546050

## Likes (beta)

This copy of the article hasn't been liked by anyone yet.

### Abstract

An $(r,δ,ε)$-locally decodable code encodes a k-bit message x to an N-bit codeword $C(x)$, such that for every $i∈[k]$, the ith message bit can be recovered with probability $1-ε$, by a randomized decoding procedure that queries only r bits, even if the codeword $C(x)$ is corrupted in up to $δ N$ locations. Recently a new class of locally decodable codes (LDCs), based on families of vectors with restricted dot products, has been discovered. We refer to those codes as matching vector (MV) codes. Several families of $(r,δ,Θ(rδ))$-locally decodable MV codes have been obtained. While codes in those families were shorter than codes of earlier generations, they suffered from having large values of $ε=Ω(rδ)$, which meant that r-query MV codes could only handle error rates below $\frac1r$. Thus larger query complexity gave shorter length codes but at the price of less error tolerance. No MV codes of a superconstant number of queries capable of tolerating a constant fraction of errors were known to exist. In this paper we present a new view of matching vector codes and uncover certain similarities between MV codes and classical Reed–Muller (RM) codes. Our view allows us to obtain deeper insights into the power and limitations of MV codes. Specifically, we obtain the following: (1) We show that existing families of MV codes can be enhanced to tolerate a large constant fraction of errors, independent of the number of queries. Such enhancement comes at a price of a moderate increase in the number of queries. (2) Our construction yields the first families of MV codes of superconstant query complexity that can tolerate a constant fraction of errors. Our codes are shorter than RM LDCs for all values of $r≤\log k/(\log\log k)^c$, for some constant c. (3) We show that any MV code encodes messages of length k to codewords of length at least $k2^Ω(\sqrt\log k)$. Therefore MV codes do not improve upon RM LDCs for $r≥(\log k)^Ω(\sqrt\log k)$.

### Citations (CiTO)

No CiTO relationships defined


text:
Given an analytic function on the unit disk, are the coefficients of its series expansion bounded?

Let $D$ denote the unit disk in $\mathbb{C}$. Suppose I have an analytic function $f:D\to D$. Then I can write down its series expansion at, say, $z_0\in D$: $$f(z)=\sum_{n=0}^\infty a_n(z-z_0)^n\,.$$

Now, we know that $|f(z)|\le 1$, since $f(z)\in D$ for all $z\in D$. Does this imply that the coefficients $a_n$ are bounded? My instinct is to say yes, but I can't find a particularly convincing reason.

Thanks!

-
No, they aren't bounded other than at $z_0=0$. Cauchy's integral formula gives a bound $a_n=\frac1{2\pi}\oint_\gamma\frac {f(z)}{(z-z_0)^{n+1}}dz$. So, $\vert a_n\vert\le(2\pi)^{-1}(1-\vert z_0\vert)^{-n-1}$. For $z_0\not=0$ this grows in $n$. –  George Lowther Mar 26 '12 at 2:12
And taking $f(z)=c(1+z)\log(1+z)$ for example ($c$ is some constant to ensure that $f(z)\in D$), the coefficients will not be bounded if you expand about real $z_0 < 0$. –  George Lowther Mar 26 '12 at 2:20
@George: Thanks for this. I appreciate it. How did you come up with your example? –  Bey Mar 28 '12 at 1:01

The $\limsup$ formula for the radius of convergence implies that any power series with bounded coefficients has radius of convergence $R\ge 1$. So, a series with $R<1$ must have unbounded coefficients. The easiest way to make the radius of convergence small is to stick a singularity nearby.

Given $z_0\ne 0$, we pick a point $a$ just outside the closed unit disk, so that $|z_0-a|<1$. For example, $a=(1+|z_0|/2)z_0/|z_0|$ works. The function $f(z)=c/(z-a)$ is our example when $c$ is small enough, such as $c=|a|-1$. If you believe the arguments given above, you don't even have to look at the coefficients.

-


text:
# Maximum angular momentum for a photon inside the event horizon of a Schwarzschild black hole?

The Schwarzchild spacetime has Killing vectors that result in the existence of two conserved quantities for test particles, interpreted as energy per unit mass and angular momentum per unit mass. For a massless particle, these are both infinite, but we can talk about their finite ratio $L/E=r^2A^{-1}d\phi/dt$. Here the units are chosen so that the Schwarzschild radius is 1, and $A=1-1/r$.

For $r>1$, we have $|L/E| \le rA^{-1/2}$, for straightforward reasons that are easy to understand by analogy with Newtonian gravity. For larger values of $L/E$, due to the centrifugal barrier, we get trajectories that never penetrate to values of $r$ this small.

What's confusing me is how to find a bound on $|L/E|$ for $r<1$, i.e., for a photon inside the horizon. Suppose I set up a tangent vector in $t-r-\phi$ coordinates, arbitrarily setting the $r$ component to $-1$, which I can do because the choice of an affine parameter is arbitrary, making it possible to rescale a tangent vector by any factor. If I express the $\phi$ component in terms of the other variables, I get a tangent vector $(\dot{t},-1,r^{-2}A(L/E)\dot{t})$, where the dot represents differentiation with respect to the affine parameter. If I now take the norm of this vector and set it equal to zero, I get $\dot{t}^{-2} = A^2(1-r^{-2}A(L/E)^2)$, which fixes the other two components of the vector. The compoments come out real, because $A<0$.

This all seems to work fine, suggesting that there is no bound on $L/E$ for $r<1$. But that seems to be a contradiction, because we could use the geodesic equation to extrapolate backward, out through the horizon, and then we would have an arbitrarily large value of $L/E$ at $r>1$ -- where we already know that there is a bound. (Of course the Schwarzschild coordinates break down at the horizon, but there is nothing in principle to stop us from switching to some other chart as we pass through the horizon, then switching back.)

Can anyone help me figure out what's wrong with my analysis?

• For sufficiently large $L/E$ there should be some back-reaction: one cannot have a photon with so much angular momentum that the total black hole plus photon would be a super-extremal Kerr hole when viewed from the outside. But this seems to be a different kind of constraint than the one in the question. – Anders Sandberg Jul 18 '18 at 6:46

There is, indeed, no lower bound on $|L/E|$ for a photon inside the Schwarzschild black hole. To see that, we could simply note that it is possible to have photons with $E=0$ (and finite $L$) inside. The trajectory of such a photon in an equatorial plane would be given by constant Schwarzschild time $t=\mathrm{const}$ and equation $$0 = \frac{dr^2}{1-\frac{1}r}+r^2d\phi^2.$$ It is simply an equation for a cardioid that touches $r=1$. In the maximally extended manifold this trajectory starts in the past singularity, touches the horizon and ends in the future singularity. In spacetime diagram of Kruskal–Szekeres coordinates, the projection of this trajectory is simply vertical line passing through the origin ($X=0$ in wikipedia notation).
So the error of OP's analysis is the assumption that every null geodesic in the inside of Schwarzschild metric could be extended into $r>1$ region. In addition to the trajectory considered above, examples of nonextendable into $r>1$ region geodesics are given by null geodesics passing through the "antiworld" (the left half of K–S or Penrose diagram).
Incidentally, the equation $|L/E| \le rA^{-1/2}$ is not much of a "bound" for the outside trajectories by itself. By choosing the turning point of the trajectory very close to the horizon we could make $A$ arbitrarily small and thus the r.h.s. arbitrarily large. Trajectories that would saturate this bound only briefly emerge from the inside of black hole achieve some the maximum od radial coordinate slightly larger than $1$ and fall back inside.
• Thanks, this is very helpful. With hindsight, what I was really searching for was a characterization of photons that could reach $r$ from null infinity. I'll have to think about this some more, and see if I can come up with a better characterization. – Ben Crowell Jul 18 '18 at 12:21


text:
# Tag Archives: mersenne prime

## It’s official: They’re prime

The numbers believed to be the 45th and 46th Mersenne primes have been proven to be prime. The 45th Mersenne prime is $2^{37156667} -1$ and the 46th is $2^{43112609} - 1$.Full text of these numbers is here and here.

Of course what you are really wanting to know is how my spreadsheet models worked out for predicting the number of digits in these primes. First, the data:

• Number of digits actually in $M_{45}$: 11,185,272
• Number of digits actually in $M_{46}$: 12,978,189

My exponential model ($d = 0.5867 e^{0.3897 n}$) was, unsurprisingly, way off — predicting a digit count of over 24.2 million for $M_{45}$ and over 35.8 million for $M_{46}$. But the sixth-degree polynomial — printed on the scatterplot at the post linked to above — was… well, see for yourself:

• Number of digits predicted by 6th-degree polynomial model for $M_{45}$: 11,819,349
• Number of digits predicted by 6th-degree polynomial model for $M_{46}$: 13,056,236

So my model was off by 634,077 digits — about 6% error — for $M_{45}$. But the difference was only  78,047 digits for $M_{46}$, which is only about 0.6% error. That’s not too bad, if you asked me.

There’s only one piece of bad news that prevents me from publishing this amazing digit-count predicting device, and you can spot it in the graph of the model:

So evidently the number of digits in $M_{n}$ will max out around $M_{49}$ and then the digit count will begin to decrease, until somebody discovers $M_{55}$, which will actually have no digits whatsoever. Um… no.

1 Comment

Filed under Crypto, Geekhood, Math

## Estimating the digits in a Mersenne prime — for dummies

At the end of this post, I made a totally naive guess that the recently discovered candidate to be the $M_{45}$, the 45th Mersenne prime, would have 10.5 million digits. There was absolutely no systematic basis for that guess, but I did suggest having an office pool for the number of digits, so what I lack in mathematical sophistication is made up for by my instinct for good nerd party games. On the other hand, Isabel at God Plays Dice predicted 14.5 million digits based on a number theoretic argument. Since I am merely a wannabe number theorist, I can’t compete with that sort of thing. But I can make up a mean Excel spreadsheet, so I figured I’d do a little data plotting and see what happened.

If you make a plot of the number of digits in $M_n$, the nth Mersenne prime, going all the way back to antiquity, here’s what you get:

The horizontal axis is n and the vertical axis is the number of digits in $M_n$.

Admit it — one look at this plot and you’re itching to add some trendlines. Here’s what you get when you add both an exponential trendline (perhaps the obvious choice given the shape) and a 6th-degree polynomial:

The exponential one has a higher $R^2$ value, but that’s perhaps misleading because of the really good fit for all those low-digit Mersenne primes that happened prior to around $M_{30}$. We’ll take that issue up in a moment. But for now, let’s put those trendline equations to work. The exponential trendline would predict that $M_{45}$ would have a digit count of

$0.5867 e^{0.3897 \times 45} = 0.5867 e^{17.5365} \approx 24,233,786$

which is obviously rather a lot more than either my prediction or Isabel’s; and if you put in $x=45$ into the 6th-degree polynomial, you get a digit count of 11819349, which is in the ballpark of both my rough estimate and Isabel’s estimate.

It doesn’t make much sense, though, to include all Mersenne primes, since Mersenne primes didn’t even cross the 100-digit mark until $M_{13}$ in 1952. A more accurate idea — if you can call this kind of reasoning accurate in the first place — would be to run the numbers starting at around $M_{20}$ and seeing what we get. I’ll save that for later, unless somebody wants to beat me to it.