The Lucas numbers are very similar to the Fibonacci numbers and
are defined by a1=2, a2=1,...
The Lucas numbers are very similar to the Fibonacci numbers and
are defined by a1=2, a2=1, and
an+2=an+1+an. So the first five are 2,
1, 3, 4, 7 and it continues in that fashion.
Fibonacci numbers are defined by F0 = 0, F1 = 1 and Fn+2 = Fn+1
+ Fn for all n ∈ N ∪ {0}.
(1) Make and prove an (if and only if) conjecture about which
Fibonacci numbers are multiples of 3.
(2) Make a conjecture about which Fibonacci numbers are multiples
of 2020. (You do not need to prove your
conjecture.) How many base cases would a proof by induction of
your conjecture require?
0.3 The Fibonacci numbers Fn are defined by F1 = 1, F2 = 1 and
for n >2, Fn = F sub (n-1) + F sub (n-2). Find a formula for Fn
by solving the difference equation.
2. Write the hexadecimal numbers in the registers of $a0, $a1,
$a2, $a3 after the following codes running:
ori $a0, $0, 11
ori $a1, $0, 19
addi $a1, $a1, -7
slt $t2, $a1, $a0
beq $t2, $0, label
addi $a2, $a1, 0
sub $a3, $a1,$a0
j end_1
label: ori $a2, $a0, 0
add $a3, $a1, $a0
end_1: xor $t2, $a1, $a0
*Values in $a0, $a1, $a2, $a3 after the above instructions are
executed.
Let {an} be a sequence defined recursively by a1 = 1 and an+1 =
2√ 1 + an where n ∈ N
(b) Does {an} converge or diverge? Justify your answer, making
sure to cite appropriate hypotheses/theorem(s) used. Hint : Try
BMCT [WHY?].
(c) (Challenge) If {an} converges then find its limit. Make sure
to fully justify your answer.
Present an O(n) algorithm that sorts n positive integer numbers
a1, a2, . . . , an which are known to be bounded by n 2 (so ai ≤ n
2 , for every i = 1, . . . , n. Use the idea of Radix Sort
(discussed in class and presented in Section 8.3 in the textbook).
Illustrate your algorithm by showing on paper similar to Fig. 8.3,
page 198 in the textbook (make sure you indicate clearly...
The Fibonacci sequence is the series of numbers 0, 1, 1,
2, 3, 5, 8,.... Formally, it can be expressed as:
fib0 = 0
fib1 = 1
fibn = fibn-1 + fibn-2
Write a multithreaded C++ program that generates the
Fibonacci series using the pthread library. This program should
work as follows: The user will enter on the command line the number
of Fibonacci numbers that the program will generate. The program
will then create a separate thread that will...
Python: Using Jupyter Notebook
1. Write code to generate Fibonacci series.
Fibonacci numbers – 1, 1, 2, 3, 5, 8, …
2. Check if a number is an Armstrong number
A positive integer is called an Armstrong number of order n
if
abcd... = a^n + b^n + c^n + d^n + ...
In case of an Armstrong number of 3 digits, the sum of cubes of
each digits is equal to the number itself. For example:
153 = 1*1*1...
We say that an infinite sequence a0,a1,a2,a3,… of real
numbers has the limit L if for every strictly positive number ε,
there is a natural number n such that all the elements
an,an+1,an+2,… are within distance ε of the value L. In this case,
we write lim a = L.
Express the condition that lim a = L as a
formula of predicate logic. Your formula may use typical
mathematical functions like + and absolute value and mathematical
relations like...
1. Let A1, A2,..., An be mutually disjoint events. Show that
a) IP(A1UA2U...UAn) = IP(A1) + IP(A2) + ... + IP(An)
b) There exists at least one i with IP(Ai) less than equals to
1/n
2. Define conditional probability IP(E|F). Derive the Law of
total probability and use it to derive Bayes's Formula