Algorithmically Finding the LCD (or decimal to fractions)

  • Context: Undergrad 
  • Thread starter Thread starter k_squared
  • Start date Start date
  • Tags Tags
    Fractions Lcd
Click For Summary

Discussion Overview

The discussion revolves around methods for converting decimals to fractions, specifically focusing on finding the least common denominator (LCD) efficiently. Participants explore both programming approaches and mathematical techniques for simplification.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant describes a program that converts decimals to fractions using a brute force method to find the LCD and seeks more efficient alternatives.
  • Another participant suggests a method of simplifying fractions by dividing the numerator and denominator by 2 and 5 until no longer possible, demonstrating this with the example of 0.88.
  • A participant expresses admiration for the simplification method and reflects on their own difficulty in recognizing such techniques intuitively.
  • Another participant notes that the fundamental theorem of arithmetic explains the simplification process, emphasizing the role of prime factorization in powers of ten.
  • A later reply mentions the Euclidean algorithm as a more efficient method for simplification, providing an example that reduces a complex decimal to a fraction in one step.

Areas of Agreement / Disagreement

Participants present multiple approaches to the problem, with no consensus on a single best method for finding the LCD or converting decimals to fractions. Various techniques are discussed, indicating a range of opinions and methods.

Contextual Notes

The discussion includes assumptions about the efficiency of different methods and the applicability of the Euclidean algorithm, which may depend on specific cases or definitions of simplification.

k_squared
Messages
62
Reaction score
0
I wrote a program to convert decimals into fractions. It basically puts the decimal over the proper power of ten, and simplifies (at least, for nonreapeating fractions.) However, it uses a brute force method to find the LCD, and as a matter of aesthetics, I never like brute force. Does anyone know of some more efficient ways do do that?
 
Mathematics news on Phys.org
Just divide by two until it won't go in any longer, then divide by 5 until it won't go in any longer.

0.88 -> 88/100 = 44/50 = 22/25. Two won't go into the denominator anymore, and 5 won't go into the numerator, so you're done.

This let's you simplify 0.00000000000001048576 in twenty steps instead of a million.
 
Awesome.
Neat how it works like that - I wish I had a knack for seeing that kinda thing off the top of my head.
 
k_squared said:
Awesome.
Neat how it works like that - I wish I had a knack for seeing that kinda thing off the top of my head.

It's just the fundamental theorem of arithmetic (aka "uniqueness of prime factorization") at work. The only prime factors of any positive power of ten (eg 10 100 1000 etc) are 2 and 5.
 
CRGreathouse said:
This let's you simplify 0.00000000000001048576 in twenty steps instead of a million.

The Euclidean algorithm will find this is ONE step, since 1048576 divides 10^20. The reduced fraction is 1/95367431640625.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 18 ·
Replies
18
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
6K