Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Final Exam 1 : procedure FUN ( n: integer ) 2 : s: = 0 3 : for i: = 1 to n do 4

Final Exam
1: procedure FUN(n: integer)
2:
s:=0
3:
for i:=1 to n do
4:
for j:=1 to 5n do
5:
S:=8+1
6:
end for
7:
end for
8:
for k:=1 to |n/6] do
9:
S=8+1
10:
end for
11:
return s
12: end procedure
1.(a) Determine whether or not (p ->+)^(9-> r) is logically equivalent to (PV a -> T.
(b) Express the negation of this statement so that all negation symbols immediately precede predi-
Vy@()->3a(P(c)^- R(ac))
2. Show that the following propositions imply that there is a person that likes bowling and darts (explain each step of your argument):
There is a person that likes playing video games.
If a person likes to nap, then they like to write.
It is not the case that there is a person that likes to write.
If a person does not like to nap, then they like bowling.
If a person likes playing video games, then they like darts.
3. Prove the following: Let n be an integer, then n is even if and only if 5n +8 is even.
4.(a) Compute a4 if an =4+|645] when n >0 and ao =4.
3
(b). Evaluate
(-1)*-1.4n.
5. Determine whether or not the following function is a bijection: f: R -> R where f(x)=3+6.
6. Give an algorithm (write the pseudocode) that takes in a list of n integers and returns the location of the first integer that is less than 5 in the list. If no such integers exists, the algorithm should return 0.
7. Give a big-O estimate on the size of the output s based on the size of the input n for the following algorithm (be sure to justify all inequalities for full credit):
8.(a) Convert 522 to base 6.
(b) Convert (E4AD9)16 to octal.
9. Solve the congruence 31x =3 mod 59 using the Euclidean algorithm.
10. Use induction to prove that 2 divides n +15n for all n >=1.
1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

2. Outline the business case for a diverse workforce.

Answered: 1 week ago