JAVA Programming

The Fraction Tree It is possible to build a fraction tree in the following way. Starting with L = 1, on the Lth level of the tree, perform the following steps. 1. Place the fraction 0 1 on the left and 1 0 on the right. 2. Perform the following action L times, between each pair of fractions a1 b1 and a2 b2 on this level, insert the fraction a1+a2 b1+b2 . 3. Index the fractions on this level by starting 0 1 with index 0 and going up to 2L. 4. For each odd index 2i+ 1, your parent index on the line above is 2b i 2 c+ 1. All even indices are discarded from the tree. 1 1 1 2 1 3 1 4 2 5 2 3 3 5 3 4 2 1 3 2 4 3 5 3 3 1 5 2 4 1 It can be proved that every possible fraction eventually appears once and only once in this tree. Input to your program will be a “large” fraction M/N where M and N are large. (You may use the java.BigInteger package if you want.) Output from your program will be the first fraction a b in the tree such that a b ≈ q M N in the following sense: a b must be the first fraction in the tree such that |N a2 − M b2 | < b The output will be two lines, a and then b.

Don't use plagiarized sources. Get Your Custom Essay on
JAVA Programming
Get an essay WRITTEN FOR YOU, Plagiarism free, and by an EXPERT! Just from $10/Page
Order Essay
Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.