Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

An exact simplification challenge - 13

0 views
Skip to first unread message

Vladimir Bondarenko

unread,
Apr 29, 2007, 6:39:49 AM4/29/07
to
Hello all symbolic calculation buffs,

Neither Maple nor Mathematica nor MuPAD is
able to simplify this expression directly...
within several hours at Core 2 duo ;)

product(cos(Pi*2^j/1023), j= 0..9)/
product(cos(Pi*2^j/1025), j= 0..9);

Is there a simplification wizard who can
to display a set of a CAS commands leading
to the exact answer?


Best wishes,

Vladimir Bondarenko

VM and GEMM architect
Co-founder, CEO, Mathematical Director

http://www.cybertester.com/ Cyber Tester, LLC
http://maple.bug-list.org/ Maple Bugs Encyclopaedia
http://www.CAS-testing.org/ CAS Testing

CW

unread,
Apr 29, 2007, 8:39:10 AM4/29/07
to
Prove

Product(cos(Pi*2^j/(2^k*2-1)), j= 0..k)/Product(cos(Pi*2^j/(2^k*2+1)),
j= 0..k)=-1;

Chris

Vladimir Bondarenko

unread,
Apr 29, 2007, 10:34:01 AM4/29/07
to
On Apr 29, 5:39 am, CW <sylvest...@ns.sympatico.ca> writes:

CW> -1

You are 100% right. I never had any doubt about your
personal math gift.

Also this concrete example is far from being kinda the
summit of Art of Computation. This concrete one is quite
obvious to a math-skilled human being.

Please note, however, that as I have emphasized repeatedly,
the Cyber Tester's challenges are NOT about human beings,
not about your or my resourcefulness, but about modern- and
next-generation computer algebra systems' potential to deal
with some objects in a *straightforward* way -- so that other
relatively math unskilled persons could use CASs' powers to
resolve the toughest industrial, educational and research
challenges coming.

By requesting to publish the explicit human-based solutions
we hope to create, to accumulate a solid stock of patterns
to be possibly used along with regular algorithms to handle
various math tasks automatically.

So the question remains,

VB> Is there a simplification wizard who can
VB> to display a set of a CAS commands leading
VB> to the exact answer?

Axel Vogt

unread,
Apr 29, 2007, 11:12:45 AM4/29/07
to
restart; kernelopts(version);
Maple 11.00, IBM INTEL NT, Feb 16 2007 Build ID 277223

Product(cos(Pi*2^j/1023), j= 0..9)/ Product(cos(Pi*2^j/1025), j= 0..9):
p:=value(%):
convert(p, sin):
simplify(%);
-1

Vladimir Bondarenko

unread,
Apr 29, 2007, 11:19:17 AM4/29/07
to
On Apr 29, 8:12 am, Axel Vogt <&...@axelvogt.de> writes:

AV> p:=value(%):
AV> convert(p, sin):
AV> simplify(%);
AV> -1

Sir, I can summarize your answer in a single word,

An idyll ;)

dimitris

unread,
Apr 29, 2007, 1:41:56 PM4/29/07
to
I tried a lot of things but I was not able to simplify your
trigonometric expression
to -1 with Mathematica.

I really look forward to seeing how someone can show what do you want,
with Mathematica.
In the meantime I am very impressed by the usefulness of Maple's
function convert.

Dimitris

Ο/Η Vladimir Bondarenko έγραψε:

Thomas Mautsch

unread,
Apr 29, 2007, 7:12:01 PM4/29/07
to
In news:<1177868516....@e65g2000hsc.googlegroups.com>
schrieb dimitris <dimm...@yahoo.com>:
[ ... ]

>> On Apr 29, 8:12 am, Axel Vogt <&...@axelvogt.de> writes:
[ ... ]

>> > Product(cos(Pi*2^j/1023), j= 0..9)/ Product(cos(Pi*2^j/1025), j= 0..9):
>> > p:=value(%):
>> > convert(p, sin):
>> > simplify(%);
>> > -1
[ ... ]

> I tried a lot of things but I was not able to simplify your
> trigonometric expression
> to -1 with Mathematica.

Does Mathematica have a function like Maple's "combine",
which combines products of trigonometric functions into sums?

Because

product(cos(Pi*2^j/1023), j= 0..9)/product(cos(Pi*2^j/1025), j= 0..9):
combine(%);
simplify(%);

also works in Maple...

CW

unread,
Apr 29, 2007, 7:46:46 PM4/29/07
to
Some code :

restart;
assume(d,integer,k,integer,2^k,integer);
print(Product(cos(Pi*2^j/1023), j= 0..9)/
Product(cos(Pi*2^j/1025), j= 0..9));
temp:=Product(cos(Pi*2^j/(2^k*2-1)), j= 0..k)/
Product(cos(Pi*2^j/(2^k*2+1)), j= 0..k);
EQ2:=Product(cos(Pi/d*2^j),j = 0 .. k) =
-2^(-k-1)*exp(I*Pi/d)*(-(exp(I*Pi/d)^2)^(2^k)+(exp(I*Pi/d)^2)^(-2^k))/(exp(I*Pi/d)^2-1);
print(`Substitute EQ2 into temp`);
temp:=subs(subs(d=2^k*2-1,EQ2),subs(d=2^k*2+1,EQ2),temp):
print('`Convert`',indets(temp,specfunc(anything,exp))):
temp:=(eval@subs)(exp=proc(x) exp(I*Pi)^(x/(I*Pi))
end,expand(temp,power)):
SIMP:=proc(E)
subs(map((x->x)=(x->op([1,1],x)^(op([1,2],x)*op(2,x))),select(evalb@proc(E)
is(op(2,E),integer)=true end,indets(E,(anything^anything)^anything))),E)
end:
SIMP2:=proc(E)
subs(map(proc(E) E=proc(E) local p; if type(E,`+`) then mul((-1)^p,p=E)
else (-1)^E fi end(frontend(convert,[op(2,E),parfrac,2^k]))
end,indets(E,(-1)^anything)),E);
end:
print(`Reduce & distribute exponents`);
Product(cos(Pi*2^j/(2^k*2-1)), j= 0..k)/
Product(cos(Pi*2^j/(2^k*2+1)), j= 0..k)=
(normal@SIMP2)(factor(combine(SIMP(temp),power)));

Chris

Joe Riel

unread,
Apr 29, 2007, 9:15:54 PM4/29/07
to
Axel Vogt <&@axelvogt.de> writes:

Very nice. This technique works quite well for the generalized expression:

f := n -> mul(cos(Pi*2^j/(2^n-1)),j=0..n-1)/mul(cos(Pi*2^j/(2^n+1)),j=0..n-1):

simplify(convert(f(200),sin));
-1

--
Joe Riel

Thomas Mautsch

unread,
Apr 30, 2007, 5:08:39 PM4/30/07
to
In news:<87ps5m1...@san.rr.com> schrieb Joe Riel <jo...@san.rr.com>:
> Axel Vogt <&@axelvogt.de> writes:
[ ... ]

>> Product(cos(Pi*2^j/1023), j= 0..9)/ Product(cos(Pi*2^j/1025), j= 0..9):
>> p:=value(%):
>> convert(p, sin):
>> simplify(%);
>
> Very nice. This technique works quite well for the generalized expression:
>
> f := n ->
> mul(cos(Pi*2^j/(2^n-1)),j=0..n-1)/mul(cos(Pi*2^j/(2^n+1)),j=0..n-1):
> simplify(convert(f(200),sin));

But that's about the *only* kind of product/quotient of cosines
for which this 'technique' works. -
This is so because "convert(cos(x),sin);" produces

sin(2 x)
1/2 --------
sin(x)

and all of the resulting sine terms in the products cancel.
You could even have used

eval(convert(f(200),sin));

instead of "simplify(...)" and gotten the same result.

dimitris

unread,
May 1, 2007, 4:35:21 PM5/1/07
to Axel Vogt
I was quite impressed from your solution BUT...note it doesn't work
for all the upper limits!

We agree that for the possitive values of the upper limit of the
iterator the expression
is actually equal to -1; doesn't we?

So...

>Product(cos(Pi*2^j/1023), j= 0..9)/ Product(cos(Pi*2^j/1025), j=0..10):


> p:=value(%);
> convert(p, sin);
> simplify(%);

> evalf(%);


Pi 2 Pi 4 Pi 8 Pi 16 Pi 32 Pi
p := cos(----) cos(----) cos(----) cos(----) cos(-----) cos(-----)
1023 1023 1023 1023 1023 1023

64 Pi 128 Pi 256 Pi 511 Pi / /
cos(-----) cos(------) cos(------) cos(------) / |
1023 1023 1023 1023 / \

Pi 2 2 Pi 4 Pi 8 Pi 16 Pi
cos(----) cos(----) cos(----) cos(----) cos(-----)
1025 1025 1025 1025 1025

32 Pi 64 Pi 128 Pi 256 Pi 512 Pi \
cos(-----) cos(-----) cos(------) cos(------) cos(------)|
1025 1025 1025 1025 1025 /


512 Pi 1022 Pi Pi 2
2 sin(------) sin(-------) sin(----)
1023 1023 1025
--------------------------------------------
Pi 511 Pi 2 Pi 1024 Pi
sin(----) sin(------) sin(----) sin(-------)
1023 1023 1025 1025


Pi
2 sin(----)
1025
-----------
2 Pi
sin(----)
1025

1.000004697

which is correct.

BUT...

> Product(cos(Pi*2^j/1023), j= 0..9)/ Product(cos(Pi*2^j/1025), j=0..17):


> p:=value(%);
> convert(p, sin);
> simplify(%);

> evalf(%);

Pi 2 Pi 4 Pi 8 Pi 16 Pi 32 Pi
p := cos(----) cos(----) cos(----) cos(----) cos(-----) cos(-----)
1023 1023 1023 1023 1023 1023

64 Pi 128 Pi 256 Pi 511 Pi / /
cos(-----) cos(------) cos(------) cos(------) / |
1023 1023 1023 1023 / \

Pi 2 2 Pi 2 4 Pi 2 8 Pi 2 16 Pi 2
cos(----) cos(----) cos(----) cos(----) cos(-----)
1025 1025 1025 1025 1025

32 Pi 2 64 Pi 2 128 Pi 2 256 Pi 512 Pi \
cos(-----) cos(-----) cos(------) cos(------) cos(------)|
1025 1025 1025 1025 1025 /


512 Pi 1022 Pi Pi 2
256 sin(------) sin(-------) sin(----)
1023 1023 1025
----------------------------------------------
Pi 511 Pi 256 Pi 1024 Pi
sin(----) sin(------) sin(------) sin(-------)
1023 1023 1025 1025


Pi
256 sin(----)
1025
-------------
256 Pi
sin(------)
1025

1.110486595

Dimitris

Ο/Η Axel Vogt έγραψε:

Joe Riel

unread,
May 1, 2007, 5:16:47 PM5/1/07
to
dimitris <dimm...@yahoo.com> writes:

> I was quite impressed from your solution BUT...note it doesn't work
> for all the upper limits!
>
> We agree that for the possitive values of the upper limit of the
> iterator the expression
> is actually equal to -1; doesn't we?
>

> BUT...
>
>> Product(cos(Pi*2^j/1023), j= 0..9)/ Product(cos(Pi*2^j/1025), j=0..17):

You cannot arbitrarily change the expression. The general form is

Product(cos(Pi*2^j/(2^n-1))/cos(Pi*2^j/(2^n+1)), j=0..n-1);

To demonstrate that, you can do the following

fj1 := cos(Pi*2^j/(2^n-1))/cos(Pi*2^j/(2^n+1));
fj2 := eval(convert(fj1, sin));

for m from 0 to 4 do
F[m] := eval(convert(mul(subs(j=k,fj2), k=0..m),sin));
end do;

# From that we can do the following:

m := 'm':
F[m] := subs(2^(4+1)=2^(m+1), F[4]);

# we want m=n-1
F[n-1] := eval(F[m], m=n-1);

subs([2^n=K+1, 2^n+1=J, 2^n-1=K], F[n-1]);
simplify(%);
subs(K = J-2, %);
simplify(%);

-1

Note that it fails for n = 0, 1.

--
Joe Riel

0 new messages