MathGroup Archive 2006

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

Search the Archive

Re: Norm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68004] Re: [mg67973] Norm
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Thu, 20 Jul 2006 06:04:45 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200607190921.FAA21393@smc.vnet.net>
  • Reply-to: murray at math.umass.edu
  • Sender: owner-wri-mathgroup at wolfram.com

Mathematically, the norm of a vector gives that vector's length.  And 
the distance between two vectors is the norm of the difference between 
the two vectors.  (What you call the "dash" is in fact a subtraction sign.)

So, assuming you want the ordinary (that is, Euclidean) distance, the 
desired result is given by

   Norm[{0, 1, 5, 1}]

and the result (in InputForm) is 3 Sqrt[3].

The final argument, 2, is superfluous in the case of the ordinary 
(Euclidean) norm, which is the 2-norm.

It would help when doing such things if you were familiar, first, with 
the underlying mathematical ideas and second, with the documentation 
that Mathematica itself provides.  For the latter, just evaluate

   ?Norm

and then to get further information click the hyperlink in the output 
produced (or in the first instance look up Norm directly in the 
HelpBrowser).




Clausenator at gmail.com wrote:
> Hi,
> I want to calculate a distance matrix, similar to (as poorly explained
> at) http://en.wikipedia.org/wiki/Distance_matrix
> 
> I found out about the Function "Norm" in mathematica 5.
> 
> Here is a little example. I want to calculate the distance between
> vectors {0,1} and {5,1}. The distance should be 5
> 
> Now,
> 
> Norm[{{0., 1.}, {5., 1.}}, 2]
> results 5.10293
> 
> Norm[{{0., 1.} - {5., 1.}}, 2]
> results 5.0
> 
> According to the documentation I have (Mathematica Help Browser, search
> for "Norm" under "Built-in Functions") the version with the comma is
> documented. I like the solution with the dash better.
> Which one is it? In other words, is there some Wolfram description or
> can you explain the difference?
> 
> Thanks for your help,
> Claus
> 
> 

-- 
Murray Eisenberg                     murray at 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


  • Follow-Ups:
    • Re: Re: Norm
      • From: Murray Eisenberg <murray@math.umass.edu>
  • References:
    • Norm
      • From: Clausenator@gmail.com
  • Prev by Date: Reconciling BinCounts and RangeCounts
  • Next by Date: Re: delayed rule evaluation order
  • Previous by thread: Re: Norm
  • Next by thread: Re: Re: Norm