• Keine Ergebnisse gefunden

Introduction to Mathematical Software Exercise 5

N/A
N/A
Protected

Academic year: 2022

Aktie "Introduction to Mathematical Software Exercise 5"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Introduction to

Mathematical Software Exercise 5

PD Dr. Ulf Lorenz Winter Term 2011/2012

Dipl.-Math. Thomas Opfer Week: 05.12.2011 - 09.12.2011

Problem 1 Matrices

99?

Calculate determinant and inverse of the following matrices:

A=

1 4 7 8 2 5 6 9 3

B=

1 2 3 4 5 6 7 8 9

Problem 2 Procedures

99?

Write a procedure that sums up all natural numbers from 1 tonwhich have at least four different prime factors.

Hint:The commandsfactorsetandnopsmight be helpful.

Example: Input: 4321, Output: 724245.

Problem 3 Decimal Expansion of Rational Numbers

9??

Complete exercise 3 from exercise sheet 4.

Problem 4 Fibonacci Numbers

???

Implement procedures that calculate thei-th Fibonacci number a) recursively,

b) iteratively,

c) using matrix exponentation, d) using the formula of Moivre-Binet.

Compare running times and possible input sizes.

Problem 5 An Application: Image Processing

???

Complete the image processing exercise from exercise sheets 2-4.

1

Referenzen

ÄHNLICHE DOKUMENTE

The lecture defined ordinal addition and multiplication by constructing new well-orders from

[r]

1.. a) Type the Hello World program (Example 2 on page 18 of part 1 of the Lecture Slides) into the editor window and save the program as hello.c in the exercise1 folder that you

In this exercise, we implement Euclid’s algorithm for finding the greatest common divisor of two natural numbers that you have come across in your linear algebra class. This will

Modify the greatest common divisor program that you have implemented in Exercise 2.1 such that the actual computation of the gcd is done in a function.. The function should accept

In the last lecture, you saw the implementation of a class for representing larger integers, BiggerInt, with an implemen- tation of the BiggerInt *add class member function.. a)

In the naïve approach we iteratively find the largest power of 2 which is less than or equal to the number we want to convert, place a 1 at the corresponding position of the

The algorithm is very inefficient as the number of recursive calls to Fib(n) grows exponentially in n. It is much more efficient to compute the Fibonacci numbers iteratively, as