Skip to content

mayurtakawale88/EgyptianFractons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Egyptian Fractions

Egyptian fractions, were mentioned in the Rhind Papyrus of 500BC as an “ancient method” and are thought to date to the time of the pyramids; they survived in use until the 17th or 18th century. Leonardo de Pisa’s famous book Liber Abaci of 1215AD, which introduced to European mathematicians the concept of zero, the Hindu-Arabic system of numeration, and the famous rabbit sequence (Leonardo’s nickname was Fibonacci).

An Egyptian fraction was written as a sum of unit fractions, meaning the numerator is always 1; further, no two denominators can be the same. As easy way to create an Egyptian fraction is to repeatedly take the largest unit fraction that will fit, subtract to find what remains, and repeat until the remainder is a unit fraction. For instance, 7 divided by 15 is less than 1/2 but more than 1/3, so the first unit fraction is 1/3 and the first remainder is 2/15. Then 2/15 is less than 1/7 but more than 1/8, so the second unit fraction is 1/8 and the second remainder is 1/120. That’s in unit form, so we are finished: 7 ÷ 15 = 1/3 + 1/8 + 1/120. There are other algorithms for finding Egyptian fractions, but there is no algorithm that guarantees a maximum number of terms or a minimum largest denominator; for instance, the greedy algorithm leads to 5 ÷ 121 = 1/25 + 1/757 + 1/763309 + 1/873960180913 + 1/1527612795642093418846225, but a simpler rendering of the same number is 1/33 + 1/121 + 1/363.

Your task is to write a program that calculates the ratio of two numbers as an Egyptian fraction

Set up instructions

  1. Clone this project in your webserver's root directory

User manual for command line execution

1. Open your terminal

2. Go to your workspce using below command
 ``` 
     CD /path_to_your/clone_directory 
 ```

3. Execute the program
 ``` 
     php  index.php {{numerator}} {{denominator}}
     Note :- To find Egyption Fraction of 5/121, replace {{numerator}} with 5 and {{denominator}} with 121
 ```

User manual for Browser execution

1. Open your Browser

2. Visit below url
 ``` 
     http://your_domain_name/EgyptianFractons/index.php?numerator={{numerator}}&denominator={{denominator}}
      Note :- To find Egyption Fraction of 5/121, replace {{numerator}} with 5 and {{denominator}} with 121
 ```

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages