Reductions fractions.
11-28-2017, 11:31 AM
Post: #1
 ggauny@live.fr Senior Member Posts: 502 Joined: Nov 2014
Reductions fractions.
Hi,

I would like find for example :

Reduce this fractions to the same denominator 1/3 and 4/9. I calculate
the lcm what it is 9 and I multiplication the 1/3 by 3. This me give 3/9.

Then the answer is 3/9 and 4/9.

Of course I know to do by hand but

Well in the prime I know "comdenom" but this dont' give this answer and
we have use arithmetic operator.

For example SIMPLIFY (42/12,12/16,36/24) give [7/2 3/4 3/2], is it a command
may be I am ignoring it, that give the same for fractions ?

cmd(1/3,4/9)----->[3/9 4/9]

cmd(5/9,7/4,6/11)----->[220/396 693/396 216/396]

Thank.

Gérard.
11-28-2017, 02:18 PM
Post: #2
 Carlos295pz Senior Member Posts: 363 Joined: Sep 2015
RE: Reductions fractions.
I'm not sure if there is such a command, but an alternative is to help with variables in the CAS.

Viga C | TD | FB
11-28-2017, 02:23 PM (This post was last modified: 11-28-2017 02:28 PM by DrD.)
Post: #3
 DrD Senior Member Posts: 1,132 Joined: Feb 2014
RE: Reductions fractions.
With a list of fractions stored in LO:

Here's the equivalent numerators:
EXECON("&1/gcd(L0)",L0);

Each one times the common divisor:
gcd(L0);

-Dale-
11-28-2017, 03:06 PM
Post: #4
 ggauny@live.fr Senior Member Posts: 502 Joined: Nov 2014
RE: Reductions fractions.
Hi,

Thank to you both.

Gérard.
11-28-2017, 03:38 PM
Post: #5
 Carlos295pz Senior Member Posts: 363 Joined: Sep 2015
RE: Reductions fractions.
(11-28-2017 02:23 PM)DrD Wrote:  Here's the equivalent numerators:
EXECON("&1/gcd(L0)",L0);

Each one times the common divisor:
gcd(L0);

Divisor: EVAL(1/gcd(exact(L0)))
Numerator list: EXECON("&1/EVAL(gcd(exact(L0)))",L0)

Viga C | TD | FB
11-28-2017, 03:46 PM
Post: #6
 ggauny@live.fr Senior Member Posts: 502 Joined: Nov 2014
RE: Reductions fractions.
Hi,

Thank to you both.

But surely I misunderstand with Carlos.

Gérard.
11-28-2017, 03:52 PM
Post: #7
 Carlos295pz Senior Member Posts: 363 Joined: Sep 2015
RE: Reductions fractions.
The idea is to use variables that do not have assigned data, it is possible that in your calculator x, xx have a value, you can use other variables. I used those because they are the ones I can type faster.

Viga C | TD | FB
11-28-2017, 04:12 PM
Post: #8
 ggauny@live.fr Senior Member Posts: 502 Joined: Nov 2014
RE: Reductions fractions.
Thank once again it run with m, mm for example.

Gérard.
11-28-2017, 04:56 PM
Post: #9
 ggauny@live.fr Senior Member Posts: 502 Joined: Nov 2014
RE: Reductions fractions.
Hi,

I appreciate Carlos and Dale for the elegant formulas
and because I best understand some commands.

Gérard.
11-28-2017, 06:13 PM
Post: #10
 Didier Lachieze Senior Member Posts: 1,221 Joined: Dec 2013
RE: Reductions fractions.
Divisor: EVAL(1/gcd(exact(L0)))
Numerator list: EXECON("&1/EVAL(gcd(exact(L0)))",L0)

For the numerator you can simply do: L0/EVAL(gcd(exact(L0)))
11-28-2017, 07:03 PM
Post: #11
 ggauny@live.fr Senior Member Posts: 502 Joined: Nov 2014
RE: Reductions fractions.
Hi,

I see a little thing I no understand, sometime there is decimal

I give example in attachement. Even I try mani things it is no change.

It is not important you know.

Gérard.
11-28-2017, 07:54 PM
Post: #12
 chromos Member Posts: 188 Joined: Jun 2015
RE: Reductions fractions.
(11-28-2017 06:13 PM)Didier Lachieze Wrote:  For the numerator you can simply do: L0/EVAL(gcd(exact(L0)))

Or even L0/gcd(exact(L0))

Geocaching Coords Solver, Number of triangles Puzzle
11-28-2017, 09:47 PM (This post was last modified: 11-28-2017 10:12 PM by StephenG1CMZ.)
Post: #13
 StephenG1CMZ Senior Member Posts: 845 Joined: May 2015
RE: Reductions fractions.
(11-28-2017 07:03 PM)ggauny@live.fr Wrote:  Hi,

I see a little thing I no understand, sometime there is decimal

I give example in attachement. Even I try mani things it is no change.

It is not important you know.

This gets rid of the unwanted real:
Code:
 EXPORT TRYG() BEGIN   LOCAL LL={5/9,7/4,6/11};  LOCAL DD:=1/gcd(exact(LL));  LOCAL NN:=LL*DD;    RETURN {approx(DD),NN};// numerators or  RETURN {approx(DD),exact(NN/DD)}; // fractions END;
But the fractions are not nice: x/1/1/396 instead of x/396.

Stephen Lewkowicz (G1CMZ)... USA's changing goals
In 1960s, delivering a man to the Moon...
In 2020s, delivering a vote to the electors.
11-29-2017, 09:17 AM (This post was last modified: 11-29-2017 09:21 AM by ggauny@live.fr.)
Post: #14
 ggauny@live.fr Senior Member Posts: 502 Joined: Nov 2014
RE: Reductions fractions.
Hi,

Taking the idea of Chromos for numerators and applying
to denominator I obtain for example :

LO[1/40 5/24 7/36 12/25]------->[1/40 5/24 7/36 12/25]

LO/gcd(exact(LO))----->[45 375 350 864] //numerators

1/gcd(exact(LO))----->1800 //denominator commun

This avoid the influence of *EVAL* wich give sometimes undesired decimals.

Now I only have to find the good presentation like for example :

45/1800 375/1800 350/1800 864/1800

But this is a new challenge for me !

Thanks to all for help.

Gérard.
11-29-2017, 03:13 PM (This post was last modified: 11-29-2017 07:18 PM by ggauny@live.fr.)
Post: #15
 ggauny@live.fr Senior Member Posts: 502 Joined: Nov 2014
RE: Reductions fractions.
Hello,

In CAS program I use this little code :

Code:
 #cas RedFracsss(LO):= BEGIN    a:=gcd(exact(LO));    PRINT();    PRINT(LO/a);    PRINT(1/a); END; #end

In the CAS terminal we see [n, n1, n2......] the numerators
and just below the denominator.

Usefull to verify exercises of my greatgrandson wich learn fractions !

EDIT because little little boy is not good american, the right word is greatgrandson !

Gérard.
11-29-2017, 03:35 PM
Post: #16
 Carlos295pz Senior Member Posts: 363 Joined: Sep 2015
RE: Reductions fractions.
In Home program

Code:
EXPORT RedFracssh(l) BEGIN   LOCAL Div=gcd(exact(l));   PRINT;   PRINT(l/Div);   PRINT(EVAL(1/Div)); END;

Viga C | TD | FB
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)