Looking for FUNDAMENTOS DE COMPUTACION test answers and solutions? Browse our comprehensive collection of verified answers for FUNDAMENTOS DE COMPUTACION at online.upr.edu.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Given the following algorithm, matching each statement to the correct sequence for complexity analysis.
procedure Insertion_Sort(A): A is a list of n integers
1 for i = 1 to n-1 do
2 x = a_i
3 j = i − 1
4 while (j \geq 0) do
5 if x \geq a_j then
6 break
7 end if
8 a_{j+1} = a_j
9 j = j − 1
a end while
b a_{j+1} = x
c end for
d return A
Let A=[a_0, a_1, \cdots, a_{m-1}] be a list of
m distinct integers.
Let B=[b_0, b_1, \cdots, b_{n-1}] be a list of
n distinct integers.
Find the correct sequence of statements for an algorithm that returns the cardinality of A \cap B.
Consider a function f: R \to R,
f(x) = 3x+7.
Determine the correct sequence to prove the following statement.
f is surjective.
If a statement is not used in the proof, you have to choose "Not used".
Consider a function f: R \to R,
f(x) = 3x+7.
Determine the correct sequence to prove the following statement.
f is injective.
If a statement is not used in the proof, you have to choose "Not used".
Problem 6 in the 29th International Mathematical Olympiad (1988) is considered one of the hardest problems in IMO.
IMO-29 Probem 6: Let a and
b be positive integers such that
ab+1 divides
a^2+b^2. Show that
\frac{a^2+b^2}{ab+1} is the square of an integers.
To prove this problem, we first describe the problem using the techniques we have learned in this course.
1) Define a function f: N^2 \to Q with
f(x,y) = \frac{x^2+y^2}{xy+1}.
2) Let Z^+ be the domain of variables
a,
b, and
k, prove the following logic statement:
\forall a \forall b [(f(a,b) \in Z^+) \to (\exists k (f(a, b)=k^2))]
Next, choose the correct step for each statement in the formal proof.
Given the following recursive algorithm to calculate the summation of the square of the first nnn positive integers.
procedure square_sum( n )
1 if (n==1)
2 s = 1
3 else
4 s = (n*n) + square_sum(n-1)
5 end of if
6 return s
Let b∈R+b∈R+b \in R^+ and n∈Nn \in N. Determine the sequence of codes in an efficient recursive algorithm to return bnb^n
procedure power_bin(b, n)
What is the Big-O notation that can best describe the power_bin(b,n) algorithm?
What is the Big-O notation that can best describe the power(b,n) algorithm?
What is the Big-O notation that can best describe the merge sort algorithm when the input is a list of nnn elements?