Post Reply 
Reductions fractions.
11-28-2017, 11:31 AM
Post: #1
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.
Find all posts by this user
Quote this message in a reply
11-28-2017, 02:18 PM
Post: #2
RE: Reductions fractions.
I'm not sure if there is such a command, but an alternative is to help with variables in the CAS.

[Image: 38668473332_2b10a29318_o.png]

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
11-28-2017, 02:23 PM (This post was last modified: 11-28-2017 02:28 PM by DrD.)
Post: #3
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-
Find all posts by this user
Quote this message in a reply
11-28-2017, 03:06 PM
Post: #4
RE: Reductions fractions.
Hi,

Very helpfull !

Thank to you both.

Gérard.
Find all posts by this user
Quote this message in a reply
11-28-2017, 03:38 PM
Post: #5
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);

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

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
11-28-2017, 03:46 PM
Post: #6
RE: Reductions fractions.
Hi,

Very helpfull !

Thank to you both.


But surely I misunderstand with Carlos.

Gérard.
Find all posts by this user
Quote this message in a reply
11-28-2017, 03:52 PM
Post: #7
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
Visit this user's website Find all posts by this user
Quote this message in a reply
11-28-2017, 04:12 PM
Post: #8
RE: Reductions fractions.
Thank once again it run with m, mm for example.

Gérard.
Find all posts by this user
Quote this message in a reply
11-28-2017, 04:56 PM
Post: #9
RE: Reductions fractions.
Hi,

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

Gérard.
Find all posts by this user
Quote this message in a reply
11-28-2017, 06:13 PM
Post: #10
RE: Reductions fractions.
(11-28-2017 03:38 PM)Carlos295pz Wrote:  Adapted
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)))
Find all posts by this user
Quote this message in a reply
11-28-2017, 07:03 PM
Post: #11
RE: Reductions fractions.
Hi,

I see a little thing I no understand, sometime there is decimal
instead of integer.

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

It is not important you know.

Gérard.
Find all posts by this user
Quote this message in a reply
11-28-2017, 07:54 PM
Post: #12
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))

Prime, 15C CE
Find all posts by this user
Quote this message in a reply
11-28-2017, 09:47 PM (This post was last modified: 11-28-2017 10:12 PM by StephenG1CMZ.)
Post: #13
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
instead of integer.

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)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
11-29-2017, 09:17 AM (This post was last modified: 11-29-2017 09:21 AM by ggauny@live.fr.)
Post: #14
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.
Find all posts by this user
Quote this message in a reply
11-29-2017, 03:13 PM (This post was last modified: 11-29-2017 07:18 PM by ggauny@live.fr.)
Post: #15
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.
Find all posts by this user
Quote this message in a reply
11-29-2017, 03:35 PM
Post: #16
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
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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