東京大学 情報理工学系研究科 電子情報学専攻 2026年1月実施 専門 第3問
Author
瑞穂
Description
(1) Write the pseudo code of binary search, with no recursion.
(2) Calculate the result of 2 using (1)'s pseudo code, with δ (error) less than 0.01.
(3) Write the pseudo code of binary search, with recursion.
Given formular 2=1+1+1+...11, and series rn=1+1+rn−11,
(4) Prove (a) r2n≤2≤r2n+1, and (b) rn+1−rnrn+2−rn+1=2rn+3−1. Also calculate 2 with δ<0.001.
(5) Given function y=x2−2, calculate 2 via Newton method, and the initial point is x=2, δ<0.0001.
题目描述
(1) 写出非递归二分查找的伪代码。
(2) 使用 (1) 的伪代码计算 2,使误差 δ<0.01。原 Description 没有给出二分的初始区间,也没有定义 δ 采用绝对误差、区间宽度还是其他判据,因此这些边界不作补定。
(3) 写出递归二分查找的伪代码。
给定连分式与递推式
2=1+1+1+⋯11,rn=1+1+rn−11.
(4) 证明:
(a)r2n≤2≤r2n+1,
以及
(b)rn+1−rnrn+2−rn+1=2rn+3−1.
并计算满足 δ<0.001 的 2。原 Description 未给出递推初值、n 的起始范围,也未定义此处的 δ,故无法唯一确定数列的具体迭代边界;此处不臆造。
(5) 对函数 y=x2−2 使用牛顿法计算 2,初始点为 x=2,要求 δ<0.0001。原 Description 同样没有定义 δ 的具体误差判据。
- 二分查找:要求分别写出迭代与递归实现,并把区间折半思想用于在给定误差条件下逼近平方根。