Fill in the blanks in python ## This week we are again solving the n-th entry in
Fantastic news! We've Found the answer you've been seeking!
Question:
Fill in the blanks in python
Transcribed Image Text:
## This week we are again solving the n-th entry in a linear recurrence relation, but this time using characteristic polynomials and what we learned in class. ## Recurrence relations of a n = c_1 * a_{n-1} +c_2 a_{n-2} + ... are stored as [c_1,c_2,...] ## initial values, starting from a_0 are stored as [a_0,a_1,...] ## smart calculate linear recurrence (n, Recurrence Relation, Initial Values) calculates an given the recurrence relation and initial values. You may assume for this this function that the length of the lists are the same. ## In python (and sage), given a function f(x) of x, if you want to evaluate it at say x-3, you do f(x) (x-3). For example, (x^2-1) (x-2) will give you 3. ## If you have L, a list of functions of x, and if you want to get a list where you evaluate them at say x=3, you can do [z(x=3) for z in L] ## once you are done, ## 1. run find char poly([2,3,4,0,1]) ## 2. run building blocks (x 6 + 2*x*5 - 15*x*4 - 40*x*3 + 40*x*2 + 192*x + 144) ## 3. run create_coeff_matrix([3^x, 3^x*x, (-2) x, (-2)^x*x, (-2)^x*x^2, (-2) x*x*3]) ## 4. run smart_calculate_linear_recurrence (100,[1,1],[1,1]) ## 5. run smart_calculate_linear_recurrence (1000, [-2,15,40,-40,-192,-1441, [1,1,1,1,1,1]) def find char poly (Recurrence_Relation): 3*x^3 - 4*x^2- 1 n = len (Recurrence_Relation) poly = ##FILL for i in range (n): poly - ##FILL return poly #Given a recurrence relation, outputs the characteristic polynomial using x as a variable. For example, if the input is [2,3,4,0,1], then the output should be x*5 - 2*x^4 - def find_roots (poly): return poly.roots () ## This week we are again solving the n-th entry in a linear recurrence relation, but this time using characteristic polynomials and what we learned in class. ## Recurrence relations of a n = c_1 * a_{n-1} +c_2 a_{n-2} + ... are stored as [c_1,c_2,...] ## initial values, starting from a_0 are stored as [a_0,a_1,...] ## smart calculate linear recurrence (n, Recurrence Relation, Initial Values) calculates an given the recurrence relation and initial values. You may assume for this this function that the length of the lists are the same. ## In python (and sage), given a function f(x) of x, if you want to evaluate it at say x-3, you do f(x) (x-3). For example, (x^2-1) (x-2) will give you 3. ## If you have L, a list of functions of x, and if you want to get a list where you evaluate them at say x=3, you can do [z(x=3) for z in L] ## once you are done, ## 1. run find char poly([2,3,4,0,1]) ## 2. run building blocks (x 6 + 2*x*5 - 15*x*4 - 40*x*3 + 40*x*2 + 192*x + 144) ## 3. run create_coeff_matrix([3^x, 3^x*x, (-2) x, (-2)^x*x, (-2)^x*x^2, (-2) x*x*3]) ## 4. run smart_calculate_linear_recurrence (100,[1,1],[1,1]) ## 5. run smart_calculate_linear_recurrence (1000, [-2,15,40,-40,-192,-1441, [1,1,1,1,1,1]) def find char poly (Recurrence_Relation): 3*x^3 - 4*x^2- 1 n = len (Recurrence_Relation) poly = ##FILL for i in range (n): poly - ##FILL return poly #Given a recurrence relation, outputs the characteristic polynomial using x as a variable. For example, if the input is [2,3,4,0,1], then the output should be x*5 - 2*x^4 - def find_roots (poly): return poly.roots ()
Expert Answer:
Answer rating: 100% (QA)
Using random numbers in C would give new results for each ... View the full answer
Related Book For
Discovering Advanced Algebra An Investigative Approach
ISBN: 978-1559539845
1st edition
Authors: Jerald Murdock, Ellen Kamischke, Eric Kamischke
Posted Date:
Students also viewed these mathematics questions
-
This Week we are studying Purchases, A/P, and Cash Payments and I need assistance with the below: What is a schedule of accounts payable? How is this useful for companies to review and how often do...
-
For a 2 x 2 linear DE system we can make a quick handsketch of the elliptical trajectories as follows. (a) All the elliptical trajectories are concentric and similar, so we can get all the key...
-
3 x 3 grid solve example 1, choosing h = 3 and starting values 100, 100,.
-
In a given week, 12 babies are born in hospital. Assume that this sample came from an underlying normal population. The length of each baby is routinely measured and is listed below (in cm): 49, 50,...
-
Complete this chemical reaction. +
-
Consider a flat plate with a chord length (from leading to trailing edge) of \(1 \mathrm{~m}\). The free-stream flow properties are \(M_{1}=3, p_{1}=1 \mathrm{~atm}\), and \(T_{1}=270 \mathrm{~K}\)....
-
Pedros Parts Ltds statement of financial position (extract only) on 30 June 2023 is set out below. Required (a) Calculate the current and quick ratios. (b) A loan agreement entered into by the...
-
Harrison Company makes two products and uses a traditional costing system in which a single plantwide predetermined overhead rate is computed based on direct labor-hours. Data for the two products...
-
Consider the soil profile shown in Figure E3-2. The moist unit weight of the top sand layer is 20.0 kN/m. Capillary rise is present above the groundwater table. The saturated unit weights of clay 1...
-
A representative section from a composite lamina is shown in figure 2.19 along with the transverse stress and strain distributions across the fiber and matrix materials in the section. The composite...
-
Problem 4 (30 points) Assume you know the following initial ion concentrations and charges: Intracellular Extracellular Na* Ch Proteins(-) separately. 100 mM 20 mM 80 mm, 80 mEq Na Ch Proteins(-) 100...
-
How would Coca-Cola use business intelligence to monitor Pepsi Colas operations in Argentina? What sources of data need to be gathered? How would they be analyzed?
-
Which of the following is a question that companies should answer when preparing the business case for an IT investment? a. How much will it cost? b. What are the risks? c. What are the alternatives?...
-
Which of the following does not describe a step in the Balanced Scorecard management process? a. Formulate the strategy b. Translate the strategy into strategic objectives c. Link objectives to...
-
Which of the following is not a type of business process in the Balanced Scorecard framework? a. Operations management b. Customer management c. Innovation d. Regulatory and social e. All of these...
-
What is one reason a Balanced Scorecard might be considered balanced? a. It includes four perspectives. b. It includes both leading and lagging performance indicators. c. It includes a large base. d....
-
what major change in the constitutional law did the Supreme court make in Mapp v. Ohio? and what three justification did Justice Clark offer for the result that the court reached in that case- explain
-
Design a circuit which negative the content of any register and store it in the same register.
-
Find the equation that describes a parabola containing the points (3.6, 0.764), (5, 1.436), and (5.8, - 2.404).
-
Two seismic monitoring stations recorded the vibrations of an earthquake. The second monitoring station is 50 mi due east of the first. The epicenter was determined to be 30 mi from the first station...
-
In Lesson 9.5, you explored the number of points of intersection of two conic sections. You saw that, for example, a hyperbola and an ellipse can intersect 0, 1, 2, 3, or 4 times. However, points of...
-
What is the difference between real objects and virtual objects? Give an example for each.
-
Give a superclass for the following three classes: car, airplane, tank.
-
How do business classes differ from utility classes? Provide one example for each.
Study smarter with the SolutionInn App