Vocabulary/dotdot

From J Wiki
Jump to: navigation, search

>> <<   Back to: Vocabulary Thru to: Dictionary

u .. v Even Conjunction

Rank Infinity -- operates on x and y as a whole -- WHY IS THIS IMPORTANT?


u .: v Odd Conjunction

Rank Infinity -- operates on x and y as a whole -- WHY IS THIS IMPORTANT?



(u .. v) is the same as (u + u&v) % 2:

(u .: v) is the same as (u - u&v) % 2:

Important.png u .. v and u .: v are deprecated.


Replace the functions (seldom used) by their equivalent phrases above.
Future releases of J may reassign the words .. and .:


Common uses

1. Make a function out of u which is symmetrical about zero on the X-axis, using - for v

Even (..-) gives a symmetrical function, Odd (.:-) gives an antisymmetrical function.

   u=: ^   NB. exponential growth: sample unsymmetrical function

   ] X=: 5 %~ i:5
_1 _0.8 _0.6 _0.4 _0.2 0 0.2 0.4 0.6 0.8 1
   require 'plot'
   plot X; u X
Ux.jpg
   plot X; u ..- X
Uex.jpg
   plot X; u .:- X
Uox.jpg

2. Decompose a matrix into symmetric and antisymmetric parts, or Hermitian and aniHermitian parts, using |: for v

   ]a =. i. 3 3
0 1 2
3 4 5
6 7 8
   ]asymm =: ] .. |: a
0 2 4
2 4 6

4 6 8
   ]aantisymm =: ] .: |: a
0 _1 _2
1  0 _1
2  1  0
   asymm + aantisymm
0 1 2
3 4 5
6 7 8

For complex matrices let v be +@:|:, to take the adjoint.


Details

  1. . Any mathematical function can be uniquely decomposed as the sum of an even and an odd function.
  2. . Any matrix can be uniquely decomposed as the sum of a symmetric and an antisymmetric matrix.
  3. . Any matrix can be uniquely decomposed as the sum of a Hermitian and an antiHermitian matrix.