博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
递归算法中的递归公式_算术序列的递归公式
阅读量:2530 次
发布时间:2019-05-11

本文共 2518 字,大约阅读时间需要 8 分钟。

递归算法中的递归公式

什么是算术序列? (What is an Arithmetic Sequence?)

A sequence is list of numbers where the same operation(s) is done to one number in order to get the next. Arithmetic sequences specifically refer to sequences constructed by adding or subtracting a value – called the common difference to get the next term.

序列是数字列表,其中对一个数字执行相同的操作以获得下一个数字。 算术序列特别是指通过加或减一个值(称为共同差 )而获得下一项所构造的序列。

In order to efficiently talk about a sequence, we use a formula that builds the sequence when a list of indices are put in. Typically, these formulas are given one-letter names, followed by a parameter in parentheses, and the expression that builds the sequence on the right hand side.

为了有效地讨论序列,我们使用了一个公式,该公式将在放置索引列表时构建该序列。通常,这些公式被赋予一个字母的名称,后跟括号中的参数,以及用于构建序列的表达式。序列在右侧。

a(n) = n + 1

a(n) = n + 1

Above is an example of a formula for an arithmetic sequence.

上面是算术序列公式的示例。

例子 (Examples)

Sequence: 1, 2, 3, 4, … | Formula: a(n) = n + 13

顺序:1、2、3、4…| 公式:a(n)= n + 13

Sequence: 8, 13, 18, … | Formula: b(n) = 5n - 2

顺序:8、13、18,…| 公式:b(n)= 5n-2

递归公式 (A Recursive Formula)

Note: Mathematicians start counting at 1, so by convention, n=1 is the first term. So we must define what the first term is. Then we have to figure out and include the common difference.

注意:数学家从1开始计数,因此按照惯例, n=1是第一项。 因此,我们必须定义第一个术语是什么。 然后我们必须找出并包括共同点。

Taking a look at the examples again,

再看看这些例子,

Sequence: 1, 2, 3, 4, … | Formula: a(n) = n + 1 | Recursive formula: a(n) = a(n-1) + 1, a(1) = 1

顺序:1、2、3、4…| 公式:a(n)= n +1 | 递归公式:a(n)= a(n-1)+ 1,a(1)= 1

Sequence: 3, 8, 13, 18, … |Formula: b(n) = 5n - 2 | Recursive formula: b(n) = b(n-1) + 5, b(1) = 3

序列:3、8、13、18,... |公式:b(n)= 5n-2 | 递归公式:b(n)= b(n-1)+ 5,b(1)= 3

查找公式(给以第一项的序列) (Finding the Formula (given a sequence with the first term))

1. Figure out the common difference    Pick a term in the sequence and subtract the term that comes before it.         2. Construct the formula    The formula has the form: `a(n) = a(n-1) + [common difference], a(1) = [first term]`

查找公式(给出没有第一项的序列) (Finding the Formula (given a sequence without the first term))

1. Figure out the common difference    Pick a term in the sequence and subtract the term that comes before it. 2. Find the first term    i. Pick a term in the sequence, call it `k` and call its index `h`    ii. first term = k - (h-1)*(common difference)3. Construct the formula    The formula has the form: `a(n) = a(n-1) + [common difference], a(1) = [first term]`

更多信息: (More Information:)

For more information on this topic, visit

有关此主题的更多信息,请访问

翻译自:

递归算法中的递归公式

转载地址:http://vozzd.baihongyu.com/

你可能感兴趣的文章
(转)在分层架构下寻找java web漏洞
查看>>
mac下多线程实现处理
查看>>
C++ ifstream ofstream
查看>>
跟初学者学习IbatisNet第四篇
查看>>
seL4环境配置
查看>>
Git报错:insufficient permission for adding an object to repository database .git/objects
查看>>
ajax跨域,携带cookie
查看>>
BZOJ 1600: [Usaco2008 Oct]建造栅栏( dp )
查看>>
洛谷 CF937A Olympiad
查看>>
Codeforces Round #445 C. Petya and Catacombs【思维/题意】
查看>>
用MATLAB同时作多幅图
查看>>
python中map的排序以及取出map中取最大最小值
查看>>
ROR 第一章 从零到部署--第一个程序
查看>>
<form>标签
查看>>
vue去掉地址栏# 方法
查看>>
Lambda03 方法引用、类型判断、变量引用
查看>>
was集群下基于接口分布式架构和开发经验谈
查看>>
MySQL学习——MySQL数据库概述与基础
查看>>
ES索引模板
查看>>
HDU2112 HDU Today 最短路+字符串哈希
查看>>