Egyptian Multiplication and SDLList class

The ancient Egyptians knew how to work with fractions but saw beauty in

representing fractions as a sum of distinct unit fractions (fractions

whose numerator equals 1). For example, the ancient Egyptians would

represent the fraction ľ as

1/4 + 1/5 + 1/6 + 1/20 + 1/21 + 1/30 + 1/420

This can be accomplished by starting with an SDLList<BigInteger>

consisting of three fours [4, 4, 4] which represents Ľ + Ľ + Ľ. Note that

it is necessary to store only the denominators. The idea is to remove a

duplicate integer x from the SDLList and replace it by adding the integers

x+1 and x(x+1). [Word of warning: you will have to use the methods add()

and multiply() from BigInteger]. Why does this process work? The reason is

1/x = 1/(x+1) + 1/[x(x+1)].

Let’s complete this example. By showing the contents of the SDLList after

each duplicate is removed.

[4, 4, 4] remove 4 add 5 and 20

[4, 4, 5, 20] remove 4 add 5 and 20

[4, 5, 5, 20, 20] remove 5 add 6 and 30

[4, 5, 6, 20, 20, 30] remove 20 add 21 and 420

[4, 5, 6, 20, 21, 30, 420] each entry is distinct

The EgyptianFraction class should have instance variables

private SDLList<BigInteger> representation;

private BigInteger numerator;

private BigInteger denominator;

You will need methods to

1) detect duplicate items in the


2) remove a duplicate from the SDLList

3) print the representation of an

Egyptian Fraction,

as well as, a constructor that initializes the SDLList based on the

inputted fraction.

Habilidades: Java

Ver mais: representation of integers, n equals, integers and, how to work integers, BigInteger, biginteger class java, unit work, unit class, add biginteger java biginteger class, java fraction, add multiply java, 420, need class, java detect, 318, word replace, fraction java, class work, remove duplicate, class based java, equals, representation, add detect, ancient egyptian, multiplication

Acerca do Empregador:
( 0 comentários ) Delhi, India

ID do Projeto: #529161

7 freelancers estão ofertando em média $97 para este trabalho


Hello sir, This is a very easy algorithmic problem.I can do the job with your full satisfaction.I can start right now. Thanks.

$30 USD em 1 dia
(14 Comentários)

I can do this project, please check PM

$50 USD in 2 dias
(5 Comentários)

Hello. Please check the PM. Thanks.

$100 USD em 1 dia
(3 Comentários)

Hi, I am having 4.5 yrs of exp. in java/j2ee related technologies. I can develop this for you. Looking forward to hear from you. Thanks, Venkat Reddy

$150 USD in 3 dias
(0 Comentários)

HSBC money transfer or western union

$200 USD in 7 dias
(0 Comentários)

I will complete this task within 20 days

$150 USD in 20 dias
(0 Comentários)

Can start right now

$50 USD in 0 dias
(0 Comentários)

Very nice problem. I'm a maths grad student and can do it easily. The 10 days timeline is just padding for any eventuality. I will moat likely finish it early.

$50 USD in 10 dias
(0 Comentários)