mming
[mailto:programming-boun...@forums.jsoftware.com]
On Behalf Of Martin Kreuzer Sent: Friday,
March 11, 2016 7:30 AM To:
programm...@jsoftware.com Subject: Re:
[Jprogramming] Numerator and Denominator btw
(and as expected) D.E. Knuth, The Art of
Computer Programming, 2nd, vol 2, pages 339 ff
uses
Would this be helpful?
,v,.($v)#1
0 1 1 1 2 1 3 1
Linda
-Original Message-
From: Programming [mailto:programming-boun...@forums.jsoftware.com] On Behalf
Of Martin Kreuzer
Sent: Friday, March 11, 2016 7:30 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] Numerator and
btw (and as expected)
D.E. Knuth, The Art of Computer Programming, 2nd, vol 2, pages 339 ff
uses this convention as a shorthand to describe a regular continued fraction:
/ x1, x2, ...,xn /
like in these examples
8/29 = / 3, 1, 1, 1, 2 /
e = 2 + / 1, 2, 1, 1, 4, 1, 1, 6, 1,... /
-M
At 2016-03-10
[ a0 ; a1 a2 a3 ... ] ?
Usage seems to vary - the ";" appears to be optional, but if used, it can
be thought of as the integer part:
a0 + 1 % (a1 + 1 % ( a2 + 1 % (a3 +... ) ) )
The notation may be extended to use a comma (",") to indicate repeated
groups, so, dropping the ";"
rt2 = [1 2 2 2
Your question is too hard for me. If I wanted to look into it, I would
start with paragraph 3.10 Theorems on Continued Fractions on page 10 of the
Handbook of Mathematical Functions edited by Abramowitz and Stegun. The
matrix theorem shown there may help.
What does your notation [ a0 ; a1 a2 a3
So how do you add [a0; a1 a2 a3 ...] and [b0; b1 b2 b3 b4]
to yield [c0;c1 c2 c3 c4...] using just their encodings as cfs?
For example, 3r11 + 1r2 = 17r22 ;
or, as c.f. [1;5 2] + [0;2] = [1;1 2 7]
How would you do the latter directly?
Mike
On 10/03/2016 17:18, Kip Murray wrote:
J Continued
J Continued Fractions
Let us consider the continued fraction
1 + 2 % 3 + 4 % 5 + 6 % 7 + …
This represents the infinite list
1 , (1+2%3), (1 + 2%3 + 4 % 5), …
I follow the convention that each term after the first ends with a
denominator.
We can calculate 1 + 2 % 3 + 4 % 5 using. +`% / 1 2 3
Thanks, Bo.
I was going to reply saying "yes, but what about doing arithmetic with cf?"
But I see there are methods for addition etc with such representations.
They're
fairly formidable, and I don't quite see yet how to control the
precision of such
operations. Unlike p-adics, they're not
The standard approach to get rational approximations to irrational numbers is
that of continued fractions.
Den 0:23 torsdag den 10. marts 2016 skrev Mike Day
:
I'm not at all sure that you'll find this relevant, but here goes,
anyway:
I recently solved Euler problem 541 which conc
I'm not at all sure that you'll find this relevant, but here goes,
anyway:
I recently solved Euler problem 541 which concerns harmonic numbers:
https://projecteuler.net/problem=541
I started out, in J of course, with rationals, but the size of the
problem is
against at least my naive appli
The best rational approximations to a number can be obtained from its
continued fraction representation. Simply truncating the continued
fraction gives a smaller list of approximants which are accurate
relative to the size of their denominators, and truncating and possibly
reducing the last number
Rational numbers have always fascinated me. I wanted to build a gear train
for a science fair where the gears form a loop where the gear train does
not mesh. But only after many thousands of revolutions. Then a sign on the
front asking people to break the gears by turning the crank.
Long ago the H
That seems a bit underspecified, or open-ended, at the moment.
For example, pi could be 1p1 (or o.1) or pi could be any of a number
of algorithms: https://en.wikipedia.org/wiki/Category:Pi_algorithms
Meanwhile, there's also the precision aspect - that could also be
specified in a variety of ways.
How about rounding to a rational of some precision like pi rounded to 22r7 ?
On Mar 9, 2016 8:52 AM, "Kip Murray" wrote:
> Thanks, Roger and Raul. Not understanding GCD +. I had a Rube Goldberg
> solution involving Format ": and Do ". --Kip
>
> On Wednesday, March 9, 2016, Roger Hui wrot
Thanks, Roger and Raul. Not understanding GCD +. I had a Rube Goldberg
solution involving Format ": and Do ". --Kip
On Wednesday, March 9, 2016, Roger Hui wrote:
> den and num illustrate different ways of computing the same thing,
> hopefully in so doing improves understanding. If you w
den and num illustrate different ways of computing the same thing,
hopefully in so doing improves understanding. If you want speed 2&x: is
going to be faster.
Also, watch this:
2 x: o. 1
1285290289249 409120605684
x: o. 1
1285290289249r409120605684
2 x:!.0 o. 1
884279719003555 28147497
Roger, are these (among) recommended and preferred methods for
recovering num & den, or do they just show an elegant way of
avoiding 2 x: ?
Thanks,
Mike
On 09/03/2016 04:32, Roger Hui wrote:
x=: %/?2$10^8x
x
69904549r40669028
den=: [: % 1 +. ]
num=: * den
den x
40669028
ubject: Re: [Jprogramming] Numerator and Denominator
x=: %/?2$10^8x
x
69904549r40669028
den=: [: % 1 +. ]
num=: * den
den x
40669028
num x
69904549
On Tue, Mar 8, 2016 at 7:28 PM, Kip Murray wrote:
> That's great! It's still a nice puzzle to write your own. --Ki
x=: %/?2$10^8x
x
69904549r40669028
den=: [: % 1 +. ]
num=: * den
den x
40669028
num x
69904549
On Tue, Mar 8, 2016 at 7:28 PM, Kip Murray wrote:
> That's great! It's still a nice puzzle to write your own. --Kip
>
> On Tuesday, March 8, 2016, Raul Miller wrote:
>
> >
Oh... well... if it's a puzzle and you don't want the built in, I
suppose you could do this:
s
p
o
i
l
e
r
s
p
a
c
e
.
.
.
nd=: (%, %@])1&+.
--
Raul
On Tue, Mar 8, 2016 at 10:28 PM, Kip Murray wrote:
> That's great! It's still a nice puzzle to write your own. --Kip
>
> O
That's great! It's still a nice puzzle to write your own. --Kip
On Tuesday, March 8, 2016, Raul Miller wrote:
>2 x: 6r4
> 3 2
>
> --
> Raul
>
>
> On Tue, Mar 8, 2016 at 10:04 PM, Kip Murray > wrote:
> > How do you find the numerator and denominator in lowest terms of a
> rational
> > frac
2 x: 6r4
3 2
--
Raul
On Tue, Mar 8, 2016 at 10:04 PM, Kip Murray wrote:
> How do you find the numerator and denominator in lowest terms of a rational
> fraction? For example,
>
> nd 6r4
> 3 2
>
> --Kip Murray
>
>
>
> --
> Sent from Gmail Mobile
> --
How do you find the numerator and denominator in lowest terms of a rational
fraction? For example,
nd 6r4
3 2
--Kip Murray
--
Sent from Gmail Mobile
--
For information about J forums see http://www.jsoftware.com/forums.
23 matches
Mail list logo