[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 136 KB, 660x495, 1554045636143.jpg [View same] [iqdb] [saucenao] [google]
11076520 No.11076520 [Reply] [Original]

we can represent fractions in their absolute version by dividing the numerator by the denominator, but is there an inverse operation in which one has a rational absolute value and finds its fraction representation? if not, why?

>> No.11076521

Just multiply by a sufficient power of 10 and reduce

>> No.11076526

>>11076521
how do i find the sufficient power of 10?

>> No.11076563 [DELETED] 

>>11076520
Let the rational value be of the form

a.bccc...

Where a, b, and c are strings of digits of lengths A, B, and C respectively.

a.bccc... = x
abc.ccc... = x*10^(B+C)
ab.ccc... = x*10^(B)
abc-ab = x*(10^(B+C)-10^B)
x = (abc-ab)/((10^(B+C)-10^B))

Example:

7.65423423423...

(765423-765)/(10^5-10^3)

42481/555

>> No.11076574

>>11076520
Let the rational value be of the form

a.bccc...

Where a, b, and c are strings of digits of lengths A, B, and C respectively.

a.bccc... = x
abc.ccc... = x*10^(B+C)
ab.ccc... = x*10^(B)
abc-ab = x*(10^(B+C)-10^B)
x = (abc-ab)/((10^(B+C)-10^B))

Example:

7.65423423423...

(765423-765)/(10^5-10^2)

42481/555

>> No.11076581
File: 43 KB, 1024x580, 1553440043089.jpg [View same] [iqdb] [saucenao] [google]
11076581

>>11076563
that's impressive, thank you for the thorough explanation! I guess this should be programmable given that c is repeated enough times that you'd know what is c and what is not

>> No.11076591

>>11076581
Well if you are using a computer how will you input the number if you don't know it repeats? It's not like you can type in a non repeating decimal.

>> No.11076656

>>11076591
what do you mean? I could parse the number and find the pattern that forms each string of digits. I don't know what would be the most efficient way of doing that but it would be possible, if the input number is long enough to cover c and its repetitions

>> No.11076669

>>11076656
What if you don't find a pattern after some amount of time? You will never find a pattern in pi.

>> No.11076746

>>11076669
yes, it would only work for rational numbers. sorry about the late reply