This is our new challenge of the week. Previous challenges can be found here.
While infinite products are equivalent to infinite sums when you take the logarithm, here we are interested in off-the-beaten-path, intriguing facts related to some special infinite products representations. Some of the questions raised here are very difficult.
We are interested in strictly positive real numbers z with z < 1, and representations of z of the form
z = Product[ ( c(k) - 1 + d(k) ) / c(k) ]
where the product is over all k = 1, 2, 3... and
Let's define a(k) = c(k) - 1 + d(k) and x(k) as the product of the first k factors a(1) / c(1), ... , a(k) / c(k).
The binary coefficients d(k) that uniquely identify z, are recursively defined as follow::
if x(k) * { c(k+1) - 1 } / c(k+1) > z, then d(k+1) = 0, else d(k+1) = 1,
with a(1) = d(1) = x(1) = 1.
In short, the sequence x(k), starting with x(1) = 1, is decreasing and eventually (hopefully) converges to z as k tends to infinity.
Code to compute z's expansion as an infinite product
The following piece of code computes all the k's such that d(k) = 0, for a given z. The d(k)'s that are equal to 1 have no impact on the infinite product as the corresponding factors a(k) / c(k) are equal to 1.
$z=sqrt(2)/2; # for illustration purposes
$n=500000;
$x=1;
for ($k=1; $k<$n; $k++) {
$c=$k*$k;
if ( $z < $x * ($c-1) / $c) {
$x = $x * ($c-1) / $c;
print "$k > $c | $x\n";
}
}
This program prints k, c(k) and x(k) any time there is a change (a factor not equal to 1) in the product expansion of z. These values of k with d(k) = 0 are called jump points. As k tends to infinity, the (infinite) product x(k) tends to z.
Example
For z = SQRT(2) / 2 = 0.707106781186548, we get the successive approximations:
As k increases, x(k) gets closer and closer to the target z = .0.707106781186548.
The challenge
Here are several questions of increasing difficulty:
$z=sqrt(2)/2;
$n=5000000;
$x=0;
for ($k=1; $k<$n; $k++) {
$c=$k;
if ( $z > $x + 1/$c) {
$x = $x + 1/$c;
print "$k > $c | $x ($z)\n";
}
}
Top DSC Resources
Follow us on Twitter: @DataScienceCtrl | @AnalyticBridge
Tags:
© 2018 Data Science Central
Powered by
Badges | Report an Issue | Privacy Policy | Terms of Service