h（x）= x2 + xx3-x-1

Toeplitz矩阵A∈Fn×n是一个矩阵，其条目沿对角线是恒定的，例如：

A =（321432543）

（f0，…，fn-1）↦（f（α0），…，f（αn-1））？

p = 9001的输入矩阵：大小10，大小100，大小1000，大小10000

A =（123401131），b =（012）

Homework 5

This homework covers the material from lectures 17 to 21

Due date: April 12th.

LaTeX template for homework 5, in case you want to write it in LaTeX.

Required Exercises

Remember that you are only required to turn in 5 out of the 6 exercises below.

Problem 1 – Fast Modular Composition (20 points)

Let

$g=h={x}^{3}+2{x}^{2}+3x+4$

and

$f={x}^{4}-1$

be polynomials over

${\mathbb{F}}_{5}\left[x\right]$

. Use the fast modular composition algorithm to compute

$g\left(h\right)modf$

.

Problem 2 – proving that

${\omega }_{det}={\omega }_{mult}$

(20 points)

Given a matrix

$A\in {\mathbb{F}}^{N×N}$

where

$N={2}^{k}$

, prove that one can compute

$det\left(A\right)$

in time

$O\left({n}^{\omega }\right)$

, where

$\omega$

is the matrix multiplication exponent. You can assume that any matrix that you need to invert in the process is invertible.

Optional question: how would you remove the assumption given above?

Problem 3 – linear recurrence relations and minimal polynomials (20 points)

1. Determine a recurrence relation and sufficiently many initial values of the sequence
$\left({a}_{i}{\right)}_{i\in \mathbb{N}}\in {\mathbb{Q}}^{\mathbb{N}}$

if

$h\left(x\right)=\sum _{i\ge 0}{a}_{i}{x}^{i}$

is

$h\left(x\right)=\frac{{x}^{2}+x}{{x}^{3}-x-1}$

1. Compute the minimal polynomial of the sequence
$1,3,4,7,11,18,29,47,\dots$

of rational numbers, given that the recursion order is at most 4. Give the next 5 elements of the sequence.

Problem 4 – using linear recurrent relations to decide singularity (20 points)

Let

$A\in {\mathbb{Q}}^{n×n}$

be a square matrix. Give a probabilistic “black box” algorithm which performs at most

$O\left(c\left(A\right)\cdot n+{n}^{2}\right)$

field operations and decides whether

$A$

is singular. Your algorithm should return the correct answer with probability at least

$2/3$

.

Problem 5 – Toeplitz matrices (20 points)

A Toeplitz matrix

$A\in {\mathbb{F}}^{n×n}$

is a matrix whose entries are constant along the diagonals, for instance:

$A=\left(\begin{array}{ccc}3& 2& 1\\ 4& 3& 2\\ 5& 4& 3\end{array}\right)$

1. Prove that you can multiply an
$n×n$

Toeplitz matrix by an

$n×1$

vector in

$O\left(M\left(n\right)\right)$

operations, where recall that

$M\left(n\right)$

is the number of operations needed to multiply two polynomials of degree

$\le n$

.

2. Prove that given
$\beta \in \mathbb{F}$

, you can compute

${\beta }^{0},{\beta }^{1},{\beta }^{4},{\beta }^{9},\dots ,{\beta }^{\left(n-1{\right)}^{2}}$

in

$O\left(n\right)$

operations in

$\mathbb{F}$

.

Hint: think of

$\left(i+1{\right)}^{2}-{i}^{2}$

1. Given a polynomial
$f\left(x\right)\in \mathbb{F}\left[x\right]$

with degree

$

, and

$\alpha \in \mathbb{F}$

, let us now see how to compute

$f\left({\alpha }^{0}\right),f\left({\alpha }^{1}\right),\dots ,f\left({\alpha }^{n-1}\right)$

, assuming that we know

$\beta \in \mathbb{F}$

such that

${\beta }^{2}=\alpha$

(that is, a square root of

$\alpha$

).

Let

$f\left(x\right)={f}_{0}+{f}_{1}x+\dots +{f}_{n-1}{x}^{n-1}$

What is the matrix of the operation

$\left({f}_{0},\dots ,{f}_{n-1}\right)↦\left(f\left({\alpha }^{0}\right),\dots ,f\left({\alpha }^{n-1}\right)\right)?$

Describe this matrix by showing what the

$\left(i,j\right)$

entry of this matrix is.

1. Using the fact that
$ij=\frac{\left(i+j{\right)}^{2}-{i}^{2}-{j}^{2}}{2}$

, rewrite the matrix from the previous part as a product of 3 matrices, involving a particular Toepliz matrix.

Suggestion: write this down for

$n=3$

first

1. Show that you can compute
$f\left({\alpha }^{0}\right),f\left({\alpha }^{1}\right),\dots ,f\left({\alpha }^{n-1}\right)$

in

$O\left(M\left(n\right)\right)$

operations.

Problem 6 – Wiedemann’s algorithm (20 points)

Implement, in Maple or Macaulay2, the Wiedemann algorithm (as we saw in class) for solving a sparse linear system. As input, the algorithm will take:

• an integer
$n$

(size of the matrix),

• a prime integer
$p$

(we work in

${\mathbb{F}}_{p}$

),

• $n$

integers in

$0,\dots ,p-1$

(this is the right-hand vector

$b$

)

• a sequence of triples
$i,j,{a}_{i,j}$

, with

$i,j\in 1,...,n$

and

${a}_{i,j}\in 0,...,p-1$

(these are the non-zero entries in the matrix

$A$

).

The output is a vector

$x$

such that

$Ax=b.$

The algorithm is randomized, but if something goes wrong, you can detect it; in this case, return “error”, or throw an exception, or something along these lines. We will give input matrices, with the same format as above. Your code should pass the inputs of size up to

$10$

and

$100$

with

$p=9001$

; the input matrix with coefficients modulo p = 2 is more challenging (there is a good chance the algorithm will fail).

Input matrices for

$p=9001$

: size 10, size 100, size 1000, size 10000

Input matrices for

$p=2$

(do it at your own risk): size 50

You have to implement the algorithm for discovering a recurrence for a given sequence, but you do not have to reimplement polynomial multiplication or division. Remember, all computations must be done modulo

$p$

.

Practice Problems

You are not required to submit the solution to these problems, but highly encouraged to attempt them for your own knowledge sake. 🙂

Problem 1

Let your base field be

${\mathbb{F}}_{5}$

and consider

Compute

${A}^{-1}b$

using Wiedemann’s algorithm.

EasyDue™ 支持PayPal, AliPay, WechatPay, Taobao等各种付款方式!

E-mail: easydue@outlook.com  微信:easydue

EasyDue™是一个服务全球中国留学生的专业代写公司