MathGroup Archive 2000

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

Search the Archive

Re: Inner product can be modified?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21464] Re: [mg21445] Inner product can be modified?
  • From: Ken Levasseur <Kenneth_Levasseur at uml.edu>
  • Date: Tue, 11 Jan 2000 04:17:45 -0500 (EST)
  • Organization: UMass Lowell Mathematical Sciences
  • References: <200001100856.DAA21012@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Denis:

In developing a series of abstract algebra packages (AbstractAlgebra -
http://www.central.edu/homepages/hibbarda/EAAM/eaam.html). I found 
Inner quite useful.  For example, if X={X1, X2, ...,Xn} is a list of
sets, the test to determine whether a={a1,a2,...,an} is in the cartesian
product of the sets is   Inner[MemberQ[#1,#2]&,X,a,And]  

Here's a specific example:
In[1]:=
X = Map[Range[1, #] &, Range[2, 5]]
Out[1]=
{{1, 2}, {1, 2, 3}, {1, 2, 3, 4}, {1, 2, 3, 4, 5}}
In[2]:=
randompoint := Table[Random[Integer, {1, 5}], {4}]
candidates = Table[randompoint, {10}]
Out[3]=
{{5, 4, 4, 2}, {5, 4, 5, 2}, {2, 3, 1, 2}, {3, 5, 1, 4}, {3, 4, 5, 5},
{2, 2, 
    1, 3}, {2, 1, 1, 3}, {5, 3, 2, 3}, {1, 2, 1, 4}, {4, 1, 3, 1}}
In[4]:=
Select[candidates, Inner[MemberQ[#1, #2] &, X, #, And] &]
Out[4]=
{{2, 3, 1, 2}, {2, 2, 1, 3}, {2, 1, 1, 3}, {1, 2, 1, 4}}

A similar function, to determine whether an n-tuple, a,  is a unit in
the direct product of rings would be Inner[UnitQ[#1,#2]&,X,a,And], where
X would be {R1,R2,...,Rn} and each Ri is what we call a Ringoid.


Ken Levasseur
Math. Sciences
UMass Lowell

Denis Cousineau wrote:
> 
> Hi,
> 
> I've seen in the documentation that the command
>   Inner[]
> can be modified so that it is not necessarily the
> sum (Plus) that is executed on the elements.
> 
> Is is done frequently in mathematics? I discover that
> I needed to do that in my own application, but though
> I was doing a crazy thing, so if other did, I would
> like to know.
> 
> What kind of application requires a different aggregate
> operation than Plus?
> Is is well-known?
> Do you have an easy-to-access reference where this
> is done?
> 
> Thank you for your help.
> Denis
> 
> P.S. mail and post reply appreciated.
> --
> 
> Denis Cousineau, Postdoc           *****************************
> Cognitive psychology               *                           *
> Indiana University                 * Etudiant devant l'eternel *
> Psychology Building                *                           *
> Bloomington, 47405                 *****************************
> 
> Office: (812) 856-5217             Fax:    (812) 855-1086
> E-mail: decousin at indiana.edu       http://Prelude.PSY.UMontreal.CA/~cousined


  • Prev by Date: Re: how to run in background in unix platform?
  • Next by Date: Re: Simplification During Integration
  • Previous by thread: Re: Inner product can be modified?
  • Next by thread: Re: Controlling how Mathematica fits data