MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Number of monomials

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87043] Re: Number of monomials
  • From: Albert Retey <awnl at arcor.net>
  • Date: Sun, 30 Mar 2008 01:15:18 -0500 (EST)
  • References: <fsd6lf$9fn$1@smc.vnet.net> <fsg6rh$jae$1@smc.vnet.net> <200803280816.DAA04771@smc.vnet.net> <fsl28k$gak$1@smc.vnet.net>

Artur wrote:
> In[1]:=Length[f[1]+f[2]+f[3]]
> Out[1]:=3
> OK!
> In[2]:=Length[f[1]+f[2]]
> Out[2]:=2
> OK!
> In[3]:=Length[f[1]]
> Out[3]:=0
> ???????????

It does not happen for me:

In[10]:= ClearAll[f]
In[11]:= Length[f[1]+f[2]+f[3]]
Out[11]= 3
In[12]:= Length[f[1]+f[2]]
Out[12]= 2
In[13]:= Length[f[1]]
Out[13]= 1

> Who understand let share with me, please!

my guess is that there are definitions for f:

In[7]:= f[x_]:=a^x
In[8]:= Length[f[1]+f[2]]
Out[8]= 2
In[9]:= Length[f[1]]
Out[9]= 0

You also should have a look at the FullForm of your expressions, which 
will probably give you a clue about what's going on:

ClearAll[f]
In[14]:= FullForm[f[1]+f[2]]
Out[14]//FullForm= Plus[f[1],f[2]]
In[15]:= FullForm[f[1]]
Out[15]//FullForm= f[1]
In[16]:= FullForm[a]
Out[16]//FullForm= a



hth,

albert


  • Prev by Date: Re: Number of monomials
  • Next by Date: Global setting of Graphics options for plot, listplot, listlogplot...
  • Previous by thread: Re: Number of monomials
  • Next by thread: Re: Number of monomials