mm-1051 === Subject: What keywords that I should search for references for this kind of problems - vector comparison? Set partitions? I have two vectors of 1 by 3 dimension and each cell can only take value of either 0 or 1. For example, vector A can be (0,1,1), (1,0,1) or (1,1,0) and vector B can be (0,1,1), (1,0,1) or (1,1,0). My question is that how many ways (permutations?) that vector B is greater than vector A? I need the definition of comparing vectors. In my example above, (1,1,0) > (0,1,1) and (1,0,1) > (0,1,1). Therefore, there are two situations that vector B > vector A. Couple you please tell me what keywords (vector comparison, set partition, combinatorial, etc) that I should use to search for the references of this kind of problem? John === Subject: Re: Packaging modules in Maple 8 > IÕm trying to package 3 separate modules all as one package, can anyone tell > me how I could go about doing this?? > IÕd rather not just put them all into one module, and the package that; IÕm > looking for an alternative method. I donÕt think there is any other method. The practice of embedding modules in other modules, even 4 levels deep, is well established in MapleÕs own code. Why would you rather not do it? === Subject: Re: Packaging modules in Maple 8 It just seems like an ugly way to do things. I was hoping I could just write a wrapper module and say something like include modules a,b,c. but if thatÕs the only way to do it, I guess IÕll just deal with it. > IÕm trying to package 3 separate modules all as one package, can anyone tell > me how I could go about doing this?? > IÕd rather not just put them all into one module, and the package that; IÕm > looking for an alternative method. > I donÕt think there is any other method. The practice of embedding > modules in other modules, even 4 levels deep, is well established in > MapleÕs own code. Why would you rather not do it? === Subject: Re: Packaging modules in Maple 8 > It just seems like an ugly way to do things. I was hoping I could just write > a wrapper module and say something like include modules a,b,c. You can do that. Maple uses `read` for `include`. Suppose that the Maple code of modules a, b, and c are stored in ***plain text*** files moda.mpl, modb.mpl, and modc.mpl. The make your wrapper abc:= module() export a, b, c; option package; read moda.mpl; read modb.mpl; read modc.mpl; end module: savelib(`abc`); Or, you can have the code for the three modules in a single file. It works just like `include` in other languages. === Subject: Re: Packaging modules in Maple 8 from this point. - Chris === Subject: Re: Packaging modules in Maple 8 > It just seems like an ugly way to do things. I was hoping I could just write > a wrapper module and say something like include modules a,b,c. Well, you can do it that way, too, as in the following example, > a1:=module() export e; e:=x->x^2 end module: > b1:=module() export e; e:=x->x^3 end module: > c1:=module() export f; f:=x->x^4 end module: > A:=module() export a,b,c; > option package; > a,b,c:=eval(a1),eval(b1),eval(c1) end module: > my:=F:/temp/my: > mkdir(my); > march(ÔcreateÕ,my,100); > libname:=my,libname: > savelibname:=my: > savelib(A); > restart; > my:=F:/temp/my: > libname:=my,libname: > with(A): > a:-e(2); 4 > b:-e(2); 8 > with(c): > f(2); 16 Alec Mihailovs http://webpages.shepherd.edu/amihailo/ > but if thatÕs the only way to do it, I guess IÕll just deal with it. > IÕm trying to package 3 separate modules all as one package, can anyone > tell > me how I could go about doing this?? > IÕd rather not just put them all into one module, and the package that; > IÕm > looking for an alternative method. > I donÕt think there is any other method. The practice of embedding > modules in other modules, even 4 levels deep, is well established in > MapleÕs own code. Why would you rather not do it? === Subject: Factoring multivariate polynmials I am one of the developers of the Parma UniversityÕs Recurrence Relation Solver, PURRS for short, a C++ library for the (possibly approximate) solution of recurrence relations, in particular recurrence relations that are arise frequently in complexity analysis. Now I must face the problem to factorize polynomials. For the univariate polynomials I found very useful the NTL library, but it does not do anything with multivariate polynomials. In Mathematica, instead, there are implemented algorithms in order to factorize multivariate polynomials. Could you signal to me some references about these algorithms? I think to have understood that the algorithms for multivariate polynomials are based on the algorithms for univariate polynomials, is it true? the algorithms for multivariate polynomials? Tatiana Zolo === Subject: Re: Factoring multivariate polynmials There are programs to factor polynomials in several variables in the open source literature for several systems, including Maxima / Macsyma. It is complicated to do right. For your problem solving of recurrence relations in complexity analysis, there may actually be only a few polynomial factorizations that you need to cover almost all cases in practice, so you might just have a table lookup. Or you could call a packaged system for the cases you need to solve, for example, by linking to one of the on-line versions of computer algebra programs. e.g. maxima on franz.comÕs web site. accessible reference is KnuthÕs volume 2, Art of Computer Programming. RJF > I am one of the developers of the Parma UniversityÕs Recurrence Relation > Solver, PURRS for short, a C++ library for the (possibly approximate) > solution of recurrence relations, in particular recurrence relations that are > arise frequently in complexity analysis. > Now I must face the problem to factorize polynomials. > For the univariate polynomials I found very useful the NTL library, > but it does not do anything with multivariate polynomials. > In Mathematica, instead, there are implemented algorithms in order to > factorize multivariate polynomials. > Could you signal to me some references about these algorithms? > I think to have understood that the algorithms for multivariate > polynomials are based on the algorithms for univariate polynomials, > is it true? > the algorithms for multivariate polynomials? > Tatiana Zolo === Subject: ANN: Mona - Symbolic Analog Circuit Analyzer Press Release Mona - Symbolic Analog Circuit Analyzer MonaÕs unique symbolic capability allows for users to obtain expressions for voltages and currents in terms of other circuit variables. This functionality is extremely useful yet not available in other so-called circuit simulators. Students specially will appreciate the insightful knowledge obtained by using this feature. Mona provides a very intuitive and easy to use schematics capture editor where users can draw any linear analog circuit from any textbook. The editor provides support for element rotation as well as multi-segment wires. This is the first such application to have these features in a handheld device. Carlos Bazzarella, CEO of Poliplus Software comments Mona continues our push to show the world what kinds of powerful applications are possible on a handheld device today. These devices can and should be used for a lot more than simple applications. Poliplus Software is a leader in the development of powerful applications for handheld devices and will continue to release noticeable applications in the near future. For a complete list of features (with lots of screen shots) and more information go to: http://www.poliplus.com/handheldproducts.htm About Poliplus Software Poliplus Software is an innovative developer of non-trivial, feature rich applications for handheld devices. Polipluscomprehensive suite of applications in the fields of Mathematics, Science and Engineering add tremendous value to handheld devices. All of our products are developed in 100% pure Java using various standard profiles including MIDP, PersonalJava, JavaSE and JavaEE. For more information please visit www.poliplus.com. -30- Contact: Rafael Bazzarella Poliplus Software rbazza@poliplus.com === Subject: Re: ANN: Mona - Symbolic Analog Circuit Analyzer > MonaÕs unique symbolic capability allows for users to obtain > expressions for voltages and currents in terms of other circuit > variables. This functionality is extremely useful yet not available > in other so-called circuit simulators. Students specially will > appreciate the insightful knowledge obtained by using this feature. I am sure Mona is a very nice and useful program, but it is not completely unique. There is also a circuit package for Maple. Syrup package for Maple 6 This Maple 6 package, developed by Joe Riel, generates and solves the node equations for electric circuits symbolically, i.e. finds the currents through each element and voltages of each node. The syntax of entering circuit descriptions follows closely that of SPICE. http://www.mapleapps.com/powertools/syrup/Syrup.shtml -- Niels L Ellegaard http://dirac.ruc.dk/~gnalle/ === Subject: Tricky Integral I have a definite integral to solve for a research problem which has stumped me. Can anyone please advise of a way of solving this. Integrate[Exp[-(x-(Sin[t]+Cos[t]))^2],{t,0,Pi/2}] The above expression written as in Mathematica but does not produce a solution. Can it be simplified to solve or is a numerical result all that can be obtained ? Any suggestions on a way to attack this would be gratefully appreciated. Paul. === Subject: Re: Tricky Integral > I have a definite integral to solve for a research problem which has > stumped me. Can anyone please advise of a way of solving this. > Integrate[Exp[-(x-(Sin[t]+Cos[t]))^2],{t,0,Pi/2}] > The above expression written as in Mathematica but does not produce a > solution. Can it be simplified to solve or is a numerical result all > that can be obtained ? > Any suggestions on a way to attack this would be gratefully > appreciated. > Paul. Can you accept a Taylor series representation? Multiply by exp(x^2) to make the integrand have form exp(x*f(t)+g(t))] and taylor expand this about x=0 to any order required. Now integrate each resulting term numerically in t from 0 to %pi/2. Multiply this series back by exp(-x^2) to get the correct result. For |x|>1, the exp(-x^2) makes the result extremely small. For x closer to 0, the Taylor series should converge rapidly enough to be useful. === Subject: Re: Tricky Integral In sci.math.symbolic, Paul Calverley : > I have a definite integral to solve for a research problem which has > stumped me. Can anyone please advise of a way of solving this. > Integrate[Exp[-(x-(Sin[t]+Cos[t]))^2],{t,0,Pi/2}] > The above expression written as in Mathematica but does not produce a > solution. Can it be simplified to solve or is a numerical result all > that can be obtained ? > Any suggestions on a way to attack this would be gratefully > appreciated. > Paul. WhatÕs that Ôxdoing in there? Try factoring it out: Exp(-x) * Integrate[Exp[(Sin[t]+Cos[t])^2],{t,0,Pi/2}] Also, sin(t) + cos(t) = sqrt(2) * sin(t + pi/4). Exp(-x) * Integrate[Exp[2 * (Sin[t])^2],{t,Pi/4,3*Pi/4}] or 2 * Exp(-x) * Integrate[Exp[2 * (Sin[t])^2],{t,Pi/4,Pi/2}] by noting that sin(t) is symmetric around pi/2. These are admittedly simple (I donÕt know Mathematica) but might work. -- #191, ewill3@earthlink.net ItÕs still legal to go .sigless. === Subject: Re: Tricky Integral > In sci.math.symbolic, Paul Calverley > > : > > I have a definite integral to solve for a research problem which has > stumped me. Can anyone please advise of a way of solving this. > > Integrate[Exp[-(x-(Sin[t]+Cos[t]))^2],{t,0,Pi/2}] > > The above expression written as in Mathematica but does not produce a > solution. Can it be simplified to solve or is a numerical result all > that can be obtained ? > Any suggestions on a way to attack this would be gratefully > appreciated. > > Paul. > > WhatÕs that Ôxdoing in there? Try factoring it out: > Exp(-x) * Integrate[Exp[(Sin[t]+Cos[t])^2],{t,0,Pi/2}] Problem is, of course, that the x is INSIDE the square. --Ron Bruck === Subject: Re: Tricky Integral In sci.math.symbolic, Ronald Bruck >> In sci.math.symbolic, Paul Calverley >> >> : >> >> I have a definite integral to solve for a research problem which has >> stumped me. Can anyone please advise of a way of solving this. >> >> Integrate[Exp[-(x-(Sin[t]+Cos[t]))^2],{t,0,Pi/2}] >> >> The above expression written as in Mathematica but does not produce a >> solution. Can it be simplified to solve or is a numerical result all >> that can be obtained ? >> Any suggestions on a way to attack this would be gratefully >> appreciated. >> >> Paul. >> >> WhatÕs that Ôxdoing in there? Try factoring it out: >> Exp(-x) * Integrate[Exp[(Sin[t]+Cos[t])^2],{t,0,Pi/2}] > Problem is, of course, that the x is INSIDE the square. Whoops, so it is! Of course you can still expand and factor the Exp(-x^2) part out; the rest then becomes a product of exp(2 * sqrt(2) * sin(t + pi/4)) and exp(2 * sin(t + pi/4)^2). Admittedly, integrating products can get ugly, though. Good luck. (You may need it with that integrand. :-) ) > --Ron Bruck -- #191, ewill3@earthlink.net -- damn, when was I in college again? :-) ItÕs still legal to go .sigless. === Subject: Re: Tricky Integral to apply integration by parts and it is complicated. I donÕt know the antiderivative of Exp[-xsin(t)] which is required when using int. by parts. I will keep up the search. I could always get a numerical result from MATHCAD... > In sci.math.symbolic, Ronald Bruck > >In sci.math.symbolic, Paul Calverley > >: >> >>I have a definite integral to solve for a research problem which has >>stumped me. Can anyone please advise of a way of solving this. >> >>Integrate[Exp[-(x-(Sin[t]+Cos[t]))^2],{t,0,Pi/2}] >> >>The above expression written as in Mathematica but does not produce a >>solution. Can it be simplified to solve or is a numerical result all >>that can be obtained ? >>Any suggestions on a way to attack this would be gratefully >>appreciated. >> >>Paul. >> >WhatÕs that Ôxdoing in there? Try factoring it out: >Exp(-x) * Integrate[Exp[(Sin[t]+Cos[t])^2],{t,0,Pi/2}] >>Problem is, of course, that the x is INSIDE the square. > Whoops, so it is! Of course you can still expand and > factor the Exp(-x^2) part out; the rest then becomes a > product of exp(2 * sqrt(2) * sin(t + pi/4)) and exp(2 * > sin(t + pi/4)^2). Admittedly, integrating products can > get ugly, though. > Good luck. (You may need it with that integrand. :-) ) >>--Ron Bruck === Subject: Re: Tricky Integral > I have a definite integral to solve for a research problem which has > stumped me. Can anyone please advise of a way of solving this. > Integrate[Exp[-(x-(Sin[t]+Cos[t]))^2],{t,0,Pi/2}] > The above expression written as in Mathematica but does not produce a > solution. Can it be simplified to solve or is a numerical result all > that can be obtained ? > Any suggestions on a way to attack this would be gratefully > appreciated. > Paul. When x=0 if you integrate 0 to Pi you get something in terms of a Bessel function I_0 ... For general x even that doesnÕt work. === Subject: Re: Tricky Integral x is a variable that ranges from (say) -10 to 40. So I need a solution to the integral as an expression in terms of x. >>I have a definite integral to solve for a research problem which has >>stumped me. Can anyone please advise of a way of solving this. x is just a >>variable. >>Integrate[Exp[-(x-(Sin[t]+Cos[t]))^2],{t,0,Pi/2}] >>The above expression written as in Mathematica but does not produce a >>solution. Can it be simplified to solve or is a numerical result all >>that can be obtained ? >>Any suggestions on a way to attack this would be gratefully >>appreciated. >>Paul. > When x=0 if you integrate 0 to Pi you get something in terms of a > Bessel function I_0 ... For general x even that doesnÕt work. === Subject: Re: Helping Johnny to find his ideal woman (a problem in Set Theory, and Mathematica)y >The following is a Set Theory Problem, that I have attempted to solve >using the standard, Mathematica set theoretic tools (i.e. Union, Intersection, >and Complement). This is NOT an assignment, nor task due of any sort. >IÕm simply curious about the manner in which a problem like this can be solved, >using Mathematica, not knowing if the above mentioned tools are enough to solve >it, or if fancier tools are needed. >Here is the problem: >Johnny is looking for his ideal girfriend, which (according to him; and not mea >to favor any preconceived biases) must be red-haired, green-eyed, slender, and >tall. >He knows four women: Adele, Betty, Carol, and Doris. >Here is a list of caveats: >0. Only one of the four women has all four characteristics that Johnny requires >1. Only three of the women are both green-eyed and slender. >2. Only two of the women are both red-haired and tall. >3. Only two of the women are both slender and tall. >4. Only one of the women is both green-eyed and red haired. >5. Adele and Betty have the same color eyes. >6. Betty and Carol have the same color hair. >7. Carol and Doris have different builds. >8. Doris and Adele are the same height. >Which one of the four women satisfies all of JohnnyÕs requirements? >Your assistance in solving this problem using the Mathematica software >will be greatly appreciated! This kind of problem can be addressed with Groebner bases in Z/2Z. Mathematica certainly provides this. First youÕve got to translate the constraints into boolean expressions. IÕve assumed the precise statements to be X and only x instead of just Only x in each item. Here is the resulting input (in meditor syntax): groebner({ // defining equations r[a]^2+r[a], g[a]^2+g[a], s[a]^2+s[a], t[a]^2+t[a], r[b]^2+r[b], g[b]^2+g[b], s[b]^2+s[b], t[b]^2+t[b], r[c]^2+r[c], g[c]^2+g[c], s[c]^2+s[c], t[c]^2+t[c], r[d]^2+r[d], g[d]^2+g[d], s[d]^2+s[d], t[d]^2+t[d], // contraint 0. // only one r[a]*g[a]*s[a]*t[a]*((r[b]*g[b]*s[b]*t[b]+1)*(r[c]*g[c]*s[c]* t[c]+1)*(r[d]*g [d]*s[d]*t[d]+1)+1), r[b]*g[b]*s[b]*t[b]*((r[c]*g[c]*s[c]*t[c]+1)*(r[d]*g[d]*s[d]* t[d]+1)*(r[a]*g [a]*s[a]*t[a]+1)+1), r[c]*g[c]*s[c]*t[c]*((r[d]*g[d]*s[d]*t[d]+1)*(r[a]*g[a]*s[a]* t[a]+1)*(r[b]*g [b]*s[b]*t[b]+1)+1), r[d]*g[d]*s[d]*t[d]*((r[a]*g[a]*s[a]*t[a]+1)*(r[b]*g[b]*s[b]* t[b]+1)*(r[c]*g [c]*s[c]*t[c]+1)+1), // at least one (r[a]*g[a]*s[a]*t[a]+1)*(r[b]*g[b]*s[b]*t[b]+1)*(r[c]*g[c]*s[ c]*t[c]+1)*(r[d ]*g[d]*s[d]*t[d]+1), // contraint 1. // only three g[a]*s[a]*g[b]*s[b]*g[c]*s[c]*g[d]*s[d], // at least three (g[a]*s[a]+1)*(g[b]*s[b]*g[c]*s[c]*g[d]*s[d]+1), (g[b]*s[b]+1)*(g[c]*s[c]*g[d]*s[d]*g[a]*s[a]+1), (g[c]*s[c]+1)*(g[d]*s[d]*g[a]*s[a]*g[b]*s[b]+1), (g[d]*s[d]+1)*(g[a]*s[a]*g[b]*s[b]*g[c]*s[c]+1), // contraint 2. // only two r[a]*t[a]*r[b]*t[b]*((r[c]*t[c]+1)*(r[d]*t[d]+1)+1), r[a]*t[a]*r[c]*t[c]*((r[b]*t[b]+1)*(r[d]*t[d]+1)+1), r[a]*t[a]*r[d]*t[d]*((r[b]*t[b]+1)*(r[c]*t[c]+1)+1), r[b]*t[b]*r[c]*t[c]*((r[a]*t[a]+1)*(r[d]*t[d]+1)+1), r[b]*t[b]*r[d]*t[d]*((r[a]*t[a]+1)*(r[c]*t[c]+1)+1), r[c]*t[c]*r[d]*t[d]*((r[a]*t[a]+1)*(r[b]*t[b]+1)+1), // at least two (r[a]*t[a]+1)*(r[b]*t[b]+1)*(r[c]*t[c]*r[d]*t[d]+1), (r[a]*t[a]+1)*(r[c]*t[c]+1)*(r[b]*t[b]*r[d]*t[d]+1), (r[a]*t[a]+1)*(r[d]*t[d]+1)*(r[b]*t[b]*r[c]*t[c]+1), (r[b]*t[b]+1)*(r[c]*t[c]+1)*(r[a]*t[a]*r[d]*t[d]+1), (r[b]*t[b]+1)*(r[d]*t[d]+1)*(r[a]*t[a]*r[c]*t[c]+1), (r[c]*t[c]+1)*(r[d]*t[d]+1)*(r[a]*t[a]*r[b]*t[b]+1), // contraint 3. // only two s[a]*t[a]*s[b]*t[b]*((s[c]*t[c]+1)*(s[d]*t[d]+1)+1), s[a]*t[a]*s[c]*t[c]*((s[b]*t[b]+1)*(s[d]*t[d]+1)+1), s[a]*t[a]*s[d]*t[d]*((s[b]*t[b]+1)*(s[c]*t[c]+1)+1), s[b]*t[b]*s[c]*t[c]*((s[a]*t[a]+1)*(s[d]*t[d]+1)+1), s[b]*t[b]*s[d]*t[d]*((s[a]*t[a]+1)*(s[c]*t[c]+1)+1), s[c]*t[c]*s[d]*t[d]*((s[a]*t[a]+1)*(s[b]*t[b]+1)+1), // at least two (s[a]*t[a]+1)*(s[b]*t[b]+1)*(s[c]*t[c]*s[d]*t[d]+1), (s[a]*t[a]+1)*(s[c]*t[c]+1)*(s[b]*t[b]*s[d]*t[d]+1), (s[a]*t[a]+1)*(s[d]*t[d]+1)*(s[b]*t[b]*s[c]*t[c]+1), (s[b]*t[b]+1)*(s[c]*t[c]+1)*(s[a]*t[a]*s[d]*t[d]+1), (s[b]*t[b]+1)*(s[d]*t[d]+1)*(s[a]*t[a]*s[c]*t[c]+1), (s[c]*t[c]+1)*(s[d]*t[d]+1)*(s[a]*t[a]*s[b]*t[b]+1), // contraint 4. // only one r[a]*g[a]*((r[b]*g[b]+1)*(r[c]*g[c]+1)*(r[d]*g[d]+1)+1), r[b]*g[b]*((r[c]*g[c]+1)*(r[d]*g[d]+1)*(r[a]*g[a]+1)+1), r[c]*g[c]*((r[d]*g[d]+1)*(r[a]*g[a]+1)*(r[b]*g[b]+1)+1), r[d]*g[d]*((r[a]*g[a]+1)*(r[b]*g[b]+1)*(r[c]*g[c]+1)+1), // at least one (r[a]*g[a]+1)*(r[b]*g[b]+1)*(r[c]*g[c]+1)*(r[d]*g[d]+1), // contraint 5. g[a]+g[b], // contraint 6. r[b]+r[c], // contraint 7. s[c]+s[d]+1, // contraint 8. t[d]+t[a]}, {r[a],g[a],s[a],t[a], r[b],g[b],s[b],t[b], r[c],g[c],s[c],t[c], r[d],g[d],s[d],t[d]},lex,2) (Note : meditor needs the comments to be removed manually.) Here is the result: groebner({1+r[a], 1+g[a], 1+s[a], 1+t[a], r[b], 1+g[b], 1+s[b], t[b]+t[b]^2, r[c], 1+g[c], 1+s[c], 1+t[b]+t[c], 1+r[d], g[d], s[d], 1+t[d]}, {r[a], g[a], s[a], t[a], r[b], g[b], s[b], t[b], r[c], g[c], s[c], t[c], r[d], g[d], s[d], t[d]}, lex, 2) It follows that Adele is the one. We see that the system isnÕt completely constrained so that Betty and Carol have an unspecified height (they have to have different heights each, though). This makes me think of the following anecdote : I couldnÕt understand genetics until I finally catched on that dominant genes can be seen as ones, recessive genes as zeroes, and the phenotype of an individual as a logical or between the alleles from the parents. Raphael === Subject: A nasty limit IÕm trying to find the following limit: lim 2^n n->infinity ---------- n^log(n) I know that the answer is infinity, but I have no idea why. IÕve tried everything I can think of and have gotten absolutely nowhere. === Subject: Re: A nasty limit > IÕm trying to find the following limit: > lim 2^n > n->infinity ---------- > n^log(n) > I know that the answer is infinity, but I have no idea why. IÕve tried > everything I can think of and have gotten absolutely nowhere. Write the ratio as R = exp[n * log 2] / exp[ (log n)^2 ] = exp[ n*log2 - (log n)^2] which grows faster, n or (log n)^2 ? -- Julian V. Noble Professor Emeritus of Physics ^^^^^^^^ http://galileo.phys.virginia.edu/~jvn/ Science knows only one commandment: contribute to science. -- Bertolt Brecht, Galileo. === Subject: Re: A nasty limit I had posted it using roughly the same method. > IÕm trying to find the following limit: > lim 2^n > n->infinity ---------- > n^log(n) > I know that the answer is infinity, but I have no idea why. IÕve tried > everything I can think of and have gotten absolutely nowhere. > Write the ratio as > R = exp[n * log 2] / exp[ (log n)^2 ] = exp[ n*log2 - (log n)^2] > which grows faster, n or (log n)^2 ? > -- > Julian V. Noble > Professor Emeritus of Physics > ^^^^^^^^ > http://galileo.phys.virginia.edu/~jvn/ > Science knows only one commandment: contribute to science. > -- Bertolt Brecht, Galileo.