Question: refer the attached python file assignment _ 2 . py ( make sure to NOT change the name of this file ) . Follow the
refer the attached python file assignmentpy make sure to NOT change the name of this file
Follow the instructions and replace all TODO comments in the scaffolding code.
Do NOT change the function signature provided in the scaffolding code, but you can add as many functions as you want to help you complete the task.
Test your code as much as you can to make certain it is correct.
Create a write up with formatted code and screenshots of your output.
The code must be formatted as text and not as an image.
Save the writeup as a PDF and submit it along with your python code file name assignmentpy as separate attachments before the due date
on canvas.
Failure to follow these instructions can disrupt the grading process, and
so it may result in substantial deductions to the overall score of the assignment of up to points for each instruction.
Running flake optional
flake is a tool that can be used with Python to check your code for formatting and other potential issues. It can also provide information on the complexity of your code following McCabes cyclomatic complexity metric. This information is helpful for writing cleaner and more efficient code.
Examples of running flake from the command line:
flake pathtoyourfile for warnings and errors
flakemaxcomplexity pathtoyourfile for complexity
Note: running flake is optional and will not affect your grade.
Problem :
The Sun is the source of most of the energy that drives the biological and physical processes in the world around usin oceans and on land it fuels plant growth that forms the base of the food chain, and in the atmosphere, it warms air which drives our weather.
The rate of energy coming from the Sun changes slightly every second. However, NASA scientist want to focus on the most significant energy increase period in a day, so that they may get better understanding about the Sun. They have collected the measurement of the energy level in a range of time, starting from Your task is to design a program finding the most significant energy increases period from their daily observation.
For example, they observed a sequence of energy level as follows,
Your program should return since from element at index to element at index gives the most significant energy increase. Note that the indices start from zero.
In cases where each period shows a decrease over the previous period, then the most significant increase is the period of least decrease. For example, when given your solution should return
You need to implement a Python program to solve this problem using:
A The bruteforce method QnMax Points: B The recursive method QnlognMax Points: C The iterative method QnMax Points:
Sample Input
Sample Output
NOTE: If there is a tie between two periods for the most increase, then either solution is accepted. For example, given your solution should return either one, but not both, of the following: or
Problem :
Given a n n matrix A and a positive integer k compute S Ak
The input contains the following
A matrix A containing n n nonnegative integers each less than
You can assume that n and is a power of eg
A positive integer k k
You need to do the following tasks:
A Implement a function to multiply two matrices using Strassen Matrix
Multiplication method Qnlog :
Compute S using the function from A above such that the number of
times the above function is called is QkMax Points:
Compute S using the function from A above and the Divide & Conquer Approach such that the number of times the above function is called is
Qlog k
Sample Input
Sample Output
assignment.py
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
