Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1. Using the general term an = 6n - 5, what is 315? Your Answer: ;] Answer Question 2 (3 points) Q2. Using the general
Q1. Using the general term an = 6n - 5, what is 315? Your Answer: ;] Answer Question 2 (3 points) Q2. Using the general term a = n2 - 13n, what is the 14th term? :1 Your Answer: Answer Question 3 (3 points) Q4. What is 315 for the arithmetic sequence with 31 = 16 and d = 5? Your Answer: Answer Question 4 (3 points) Q6. What is 314 for the geometric sequence with 31 = 9 and r = 2? Your Answer: Answer Q8. Suppose g1 = 4 and g2 = 1. The rest of the terms in a recursive sequence are given by the formula gn = n.gn-1 + 8n-2. Find the 7th term of the sequence, 87. Your Answer: AnswerQ9. Consider the following algorithm: sum = 0 for] in range(1,10): sum = sum + 0*] + 6) printlsum) What is printed as a result of executing this algorithm? You r Answer: Answer Question 2 (3 points) Q10. Consider the following algorithm: 81 = 2 82 = 5 for k in rangel3,8): Bk = (k-ll-gk-1 + Bk-z What is the last term, g3, of the recursive sequence generated as a result of executing this algorithm? You r Answer: l_l Answer Question 3 (3 points) Q20. Suppose a computer program has been initialized such that the following sets have been stored for use in any algorithm: A = {1, 2, 3, ..., 47} B = {-7, -6, -5, ..., 23} Consider the following algorithm, which represents one part of the whole computer program (comments may occur after the # symbol on any line and are not used in computations): #Part 1: computes A - B and its cardinality AminusB = set() for element in A: # this line runs through every element in A if notielement in B): #A - B is the set of elements that are in A and are not in B AminusB.add(element) # Add to AminusB every element in A if the element is also not in B n = len(AminusB) #lenO returns the number of elements in the array println) What value is printed as a result of executing this algorithm? Your Answer: Answer Q10A. Consider the following algorithm: 81 = 8 82 = 3 for k > 2: 8k = (k-1)-8k-1 - 8k-2 What is term g6 of the recursive sequence generated as a result of executing this algorithm? Your Answer: Answer Question 5 (3 points) Q9A. Consider the following algorithm: sum = 0 for j in range(1,16): sum = sum + (3*j - 6) print(sum) What is printed as a result of executing this algorithm? Your Answer:Question 1 (3 points) Q12. Fill in the missing element of B such that A = B. A = {7, 19, g, #, 2, 4, &, f, 13, 1, k} B = {#, 1, 7, __, k, 2, f, 19, g, 4, & } Your Answer: Answer Question 2 (3 points) Q13. Let A = {y E Z : 8
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started