11:41 46% D o AT&T; instructure-uploads.s3.amazonaws.com Problem statement For t
ID: 3576259 • Letter: 1
Question
11:41 46% D o AT&T; instructure-uploads.s3.amazonaws.com Problem statement For this program, you will implement a converter that translates rational fractions to Egyptian fractions according to the Fibonacci's algorithm (described later on). Egyptian fraction notation was developed in ancient Egypt, -2000 BC, and one of the uses o Egyptian fraction was to handle fractional payment in business. An Egyptian fraction is a finite series ofdistinct unit fractions, where each fraction in the expression has a numerator equal to 1 and a denominator that is a positive integer. All denominators differ from each other. The value of an expression of this type is a positive rationaL number nd Example 5/8 1/2 1/8 5/8 is the rational fraction 1/2 1/8 is an Egyptian fraction Egyptian fractions can help in dividing ber of objects into equal shares, something that is very difficult to achieve with rational number notation. For example, if 8 friends decide to share 5 pizzas, the rational fraction does not offer any insight as to how to divide the pizzas other than to indicate that 5 pizzas need be split into 8 parts. The Egyptian fraction, however, indicates that each person gets half a pizza plus another eighth of a pizza, e.g. by splitting 4 pizzas into 8 halves, and the remaining pizza into 8 eighths. that hav been discussed in class so far. If you are unsure about using a certain Python construct, ask your instructor before you implement your project using it. Your project should make use of while and for-in- range loops where appropriate. One of the methods to solve the problem of fraction conversion was proposed in the Middle Ages by Leonardo of Pisa (known as Fibonacci). Fibonacci's method goes as follows: check if the rational fraction (ND) is already a unit fraction, and if it isn't, then split the numerator (N) into a sum of divisors of the denominator (D), This possible whenever the denominatoris a practical number. An integer number D is a practical number 0an excluding D itself. For example, if the given number is 8 then the factors of 8 are 1, 2 and 4 (note 8 is not included in the list). Now, the given number 8 is practical ifany number between land (8-1) 7 can be expressed as a sum of subset of integers {1,2,4). So practical number because 7 1 +2 +4 6 2 +4
Explanation / Answer
from numpy import matrix from numpy import linalg A = matrix( [[1,2,3],[11,12,13],[21,22,23]]) # Creates a matrix. x = matrix( [[1],[2],[3]] ) # Creates a matrix (like a column vector). y = matrix( [[1,2,3]] ) # Creates a matrix (like a row vector). print A.T # Transpose of A. print A*x # Matrix multiplication of A and x. print A.I # Inverse of A. print linalg.solve(A, x) # Solve the linear equation system.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.