Example:
In[1]:= N[3Pi+3/2,10]
Out[1]= 10.92477796
> identify(10.92477796);
3
- + 3 Pi
2
Is there a package with similar functionality for Mathematica?
Szabolcs
Dimitris
=CF/=C7 Szabolcs =DD=E3=F1=E1=F8=E5:
If so, I cannot recall the name of the function, so I don't know whether
the function made it into 6.0. The closest thing I can find is
RootApproximant, but that doesn't seem to "recognize" an expression
involving a transcendental number.
Szabolcs wrote:
> "Another computer algebra system" has a function, identify(), which
> attempts to guess the exact expression that evaluates to a particular
> numerical value.
>
> Example:
>
> In[1]:= N[3Pi+3/2,10]
>
> Out[1]= 10.92477796
>
> > identify(10.92477796);
> 3
> - + 3 Pi
> 2
>
> Is there a package with similar functionality for Mathematica?
>
> Szabolcs
>
--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
Hi,
The built-in function *Rationalize* and the add-on package
NumberTheory`Rationalize` should be the closest equivalent to the
function identify().
In[1]:=
x = N[3*Pi + 3/2]
Out[1]=
10.92477796076938
In[2]:=
Rationalize[x, 0]
Out[2]=
569958623/52171186
In[3]:=
x - %
Out[3]=
0.
In[4]:=
$Version
Out[4]=
"5.2 for Microsoft Windows (June 20, 2005)"
HTH,
Jean-Marc
A number we know nothing about...(??)
n = 6.283185307179586
Set the variable to something you would like to use. For me...
NumberToSearch = n;
Re-Enter this equation (Shift Enter), and then click the link.
Hyperlink["Click Here: Plouffe's Inverter",
StringReplace["http://bootes.math.uqam.ca/cgi-bin/ipcgi/lookup.\
pl?Submit=GO+&number=#&lookup_type=simple",
"#" :> ToString[Evaluate[NumberToSearch], InputForm,
NumberMarks -> False]]]
The above click shows it might be 2 Pi.
For your example, I took the full value:
n=10.92477796076938
This number didn't work. Sometimes it won't work if the number is large.
I don't know what "large" means, but the program really works with
fractions.
I decided to divided the number by 3.
NumberToSearch = 10.92477796076938/3
3.641592653589793
If I re-enter the Hyperlink, and click the link, the solution is Pi+1/2.
Multiply by 3 to get your equation.
Reference: http://pi.lacim.uqam.ca/eng/
--
HTH :>)
Dana DeLouis
Windows XP & Mathematica 6.0 & Help files 5.2 :>~
"Szabolcs" <szho...@gmail.com> wrote in message
news:f2eim0$t2f$1...@smc.vnet.net...
RealLookup[NumberToSearch_Real] := Module[
{
s1 = "Click Here: Plouffe's Inverter on: ",
s2 = ToString[NumberToSearch, InputForm, NumberMarks -> False],
link = "http://bootes.math.uqam.ca/c\
gi-bin/ipcgi/lookup.pl?Submit=GO+&number=#&lookup_type=simple"
},
Hyperlink[StringJoin[s1, s2], StringReplace[link, "#" :> s2]]
]
RealLookup[NumberToSearch_] :=
StringJoin["Number must be Real, not: ",
ToString[NumberToSearch, InputForm]]
RealLookup[2.*Pi]
<...Link here...>
n = 3*Pi + 3/2;
RealLookup[n/3.]
<...Link here...>
RealLookup[n/3]
"Number must be Real, not: (3/2 + 3*Pi)/3"
RealLookup["Dog"]
"Number must be Real, not: Dog"
--
HTH :>)
Dana DeLouis
Windows XP & Mathematica 6, and 5.2 Help. :>~
"Szabolcs" <szho...@gmail.com> wrote in message
news:f2eim0$t2f$1...@smc.vnet.net...
> "Another computer algebra system" has a function, identify(), which
> attempts to guess the exact expression that evaluates to a particular
> numerical value.
>
> Example:
>
> In[1]:= N[3Pi+3/2,10]
>
> Out[1]= 10.92477796
>
> > identify(10.92477796);
>
ToRadicals[RootApproximant[N[Sqrt[2] + Sqrt[3], 30]]]
Sqrt[5 + 2*Sqrt[6]]
This may not look so impressive until you check:
FullSimplify[Sqrt[2] + Sqrt[3] - Sqrt[5 + 2*Sqrt[6]]]
0
Anyway, doing this for algebraic numbers has a solid mathematical
basis: the so called LLL Lattice Reduction) algorithm. I don=92t know, =
however, of any mathematical basis for "recognizing" transcendentals, =
except by means of stored values or some other "ad hoc" approach
(essentially "sophisticated guessing")
Andrzej Kozlowski
On 17 May 2007, at 18:59, Murray Eisenberg wrote:
> As I remember, at IMS'06 (Avignon) Stephen Wolfram (via remote link-=
> up)
> played with a function to do just that. Did I remember correctly?
>
> If so, I cannot recall the name of the function, so I don't know
> whether
> the function made it into 6.0. The closest thing I can find is
> RootApproximant, but that doesn't seem to "recognize" an expression
> involving a transcendental number.
>
> Szabolcs wrote:
>> "Another computer algebra system" has a function, identify(), which
>> attempts to guess the exact expression that evaluates to a particular
>> numerical value.
>>
>> Example:
>>
>> In[1]:= N[3Pi+3/2,10]
>>
>> Out[1]= 10.92477796
>>
>>> identify(10.92477796);
>> 3
>> - + 3 Pi
>> 2
>>
>> Is there a package with similar functionality for Mathematica?
>>
>> Szabolcs
>>
>
Thanks for everyone who replied! I learned a lot today.
I did not find the package by Ted Ersek, but I found another one by Eric
Weisstein:
http://library.wolfram.com/infocenter/MathSource/5087/
The relevant file is Simplify.m
Interesting functions are ToExact and TranscendentalRecognize.
In another thread someone mentioned a website which can be used for
similar purposes:
http://pi.lacim.uqam.ca/eng/
--
A common approach is to use a predefined basis of transcendentals, e.g
certain powers of e, pi, gamma, and maybe some set of radicals of
"small" integers. One then seeks rational combinations of these that
give the input value to close approximation. This step typically uses
LLL or PSLQ.
Simple code to demonstrate the concept was presented in TMJ back in 1996
(and based on some email and maybe news group correspondence from late
1995). The reference is below.
Transcendental Recognition. In: Tricks of the Trade, Paul Abbott editor.
The Mathematica Journal 6(2):29-30 (1996).
To obtain electronically go to:
http://www.mathematica-journal.com/issue/v6i2/
Scroll to Tricks of the Trade (under Tutorials), click to download the
notebook, go to "Trancendental Recognition" section.
I'll mention that a perusal of documentation suggests the identify()
function for the most part uses this approach.
Daniel Lichtblau
Wolfram Research
Thanks again for all the replies!
I think that I need to explain that I sent this message before I
received the replies from Dana DeLouis and Roman, but for some reason it
arrived with a delay of 2 days.
It is because of the line break in the URL. Make sure that after you
paste it, you remove the spaces which got inserted between ...
"ipcgi/lookup." and "pl?Submit" ...
Szabolcs