Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with python coding.... need to have the following work in my code(below) Currently, the first 2 (I1 and I2 works) the operations ( +

Help with python coding....

need to have the following work in my code(below)

Currently, the first 2 (I1 and I2 works) the operations ( + - * / )need work

image text in transcribed

image text in transcribed

-----------code--------------Using python 3.6

import numpy as np

import matplotlib.pyplot as plt

from scipy import *

from pylab import *

import sys

import scipy.integrate as si

from scipy.integrate import quad

class Interval:

def __init__(self,a, b=None):

if b==None:

self.b=a

self.a=a

self.b=b

m=[self.a,self.b]

def add(a,b,c,d):

m=[a+c,b+d]

def sub(a,b,c,d):

m=[a-d,b-c]

def mul(a,b,c,d):

m=[min(a*c,a*d,b*c,b*d),max(a*c,a*d,b*c,b*d)]

def div(a,b,c,d):

m=[min(a/c,a/d,b/c,b/d),max(a/c,a/d,b/c,b/d)]

def __repr__(self):

return'['+str(self.a)+','+str(self.b)+']'

def __str__(self):

return'['+str(self.a)+','+str(self.b)+']'

11= Interval (1,4) # [1,4] 12 interval (-2, -1) # [-2, -1] Il I2 I1 I2 I1 I2 I1 I2 # # [-1, 3] [2, 6] Please note: Use truediv_for the division

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

What is Working Capital ? Explain its types.

Answered: 1 week ago

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago