Question: Tasks: Problem 1: you need to write three functions based on the three algorithms provided in the problem description below. Problem 2: you need to
Tasks: Problem 1: you need to write three functions based on the three algorithms provided in the problem description below. Problem 2: you need to write a function that accepts two lists of numbers of same lenght (representing, independent and dependent variables and , respectively) and returns the value of the intercept and the slope of a linear regression line.
The required equations and background are provided in the problem description below. You can find some worked out example of this problem using NumPy package. However, you can't use any package to complete this function.
Hint: Use loops to calculate mean, SSxx, and SSxy. Thinks to consider: You must not use any package other than pure Python (so, do not import anything) Follow the function recipe provided below to get bonus points
Problem 1 - Palindrome 1.1
The Problem: Determine whether a string is a palindrome. A palindrome is a string that is read the same from front-to-back and back-to-front.
Example: noon, racecar There are several different approaches to solve this problem, known as algorithm. An algorithm is a sequence of steps that accomplish a task. 1.2 Algorithms
Algorithm 1:
Reverse the string Compare the reversed string to the original string. For example: reverse of string noon is also noon so noon is a palindrome, but the reverse of string dented is detned they are different and therefore dented is not a palindrome.
Algorithm 2:
split the string into two halves (for odd number of length, omit the middle char) Reverse the second half Compare the first half to the reversed second half
Algorithm 3:
Compare the first char to the last char of the string Compare the 2 char to the 2 last char Continue until the middle of the string is reached Your Task: There might have other ways to solve this task, but you are supposed to write functions based on these three algorithms
**PLEASE USE PYTHON AND SHOW ALL CODE**
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
