<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="HTMLFiles/pmathml.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "HTMLFiles/xhtml1-transitional.dtd">

<!-- This HTML document was created by converting a Mathematica notebook using Export. -->


<html xmlns="http://www.w3.org/1999/xhtml" class="Notebook">

<head >
<title>
  mmalaskut.nb
</title>

<link href="HTMLFiles/Default.css" rel="stylesheet" type="text/css" />
</head>

<body>

<p><a href="../liite/mmalaskut.nb" target="liite">mmalaskut.nb</a></p>

<p class="Title">
 Vektorien laskutoimituksia Mathematicassa
</p>



<p class="Text">
 Mathematicassa vektorien yhteenlasku ja kertominen skalaarilla suoritetaan seuraavasti.
</p>



<p class="CellLabel">
 In[1]:=
</p>



<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mrow>
   <mi>a</mi>
   <mo>=</mo>
   <mrow>
    <mo>{</mo>
    <mrow>
     <mn>1</mn>
     <mo>,</mo>
     <mn>2</mn>
     <mo>,</mo>
     <mn>3</mn>
    </mrow>
    <mo>}</mo>
   </mrow>
  </mrow>
  <mo>;</mo>
 </mrow>
</math>
</p>

<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mrow>
   <mi>b</mi>
   <mo>=</mo>
   <mrow>
    <mo>{</mo>
    <mrow>
     <mn>4</mn>
     <mo>,</mo>
     <mn>5</mn>
     <mo>,</mo>
     <mn>6</mn>
    </mrow>
    <mo>}</mo>
   </mrow>
  </mrow>
  <mo>;</mo>
 </mrow>
</math>
</p>

<p class="CellLabel">
 In[3]:=
</p>



<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mi>a</mi>
  <mo>+</mo>
  <mi>b</mi>
 </mrow>
</math>
</p>

<p class="CellLabel">
 Out[3]=
</p>



<p class="Output">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mo>{</mo>
  <mrow>
   <mn>5</mn>
   <mo>,</mo>
   <mn>7</mn>
   <mo>,</mo>
   <mn>9</mn>
  </mrow>
  <mo>}</mo>
 </mrow>
</math>
</p>

<p class="CellLabel">
 In[4]:=
</p>



<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mn>3</mn>
  <mo>*</mo>
  <mi>a</mi>
 </mrow>
</math>
</p>

<p class="CellLabel">
 Out[4]=
</p>



<p class="Output">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mo>{</mo>
  <mrow>
   <mn>3</mn>
   <mo>,</mo>
   <mn>6</mn>
   <mo>,</mo>
   <mn>9</mn>
  </mrow>
  <mo>}</mo>
 </mrow>
</math>
</p>

<p class="Text">
 Pistetulo:
</p>



<p class="CellLabel">
 In[5]:=
</p>



<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mi>a</mi>
  <mo>.</mo>
  <mi>b</mi>
 </mrow>
</math>
</p>

<p class="CellLabel">
 Out[5]=
</p>



<p class="Output">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mn>32</mn>
</math>
</p>

<p class="Text">
 Ristitulo: 
</p>



<p class="CellLabel">
 In[6]:=
</p>



<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mi>Cross</mi>
  <mo>[</mo>
  <mrow>
   <mi>b</mi>
   <mo>,</mo>
   <mi>a</mi>
  </mrow>
  <mo>]</mo>
 </mrow>
</math>
</p>

<p class="CellLabel">
 Out[6]=
</p>



<p class="Output">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mo>{</mo>
  <mrow>
   <mn>3</mn>
   <mo>,</mo>
   <mrow>
    <mo>-</mo>
    <mn>6</mn>
   </mrow>
   <mo>,</mo>
   <mn>3</mn>
  </mrow>
  <mo>}</mo>
 </mrow>
</math>
</p>

<p class="Text">
 Seuraavissa yhteenlaskuissa 1 lis&auml;t&auml;&auml;n jokaiseen a:n alkioon eli 1:st&auml; k&auml;sitell&auml;&auml;n kuten vektoria {1,1,1}. Samoin muuttujaa <span><math xmlns='http://www.w3.org/1998/Math/MathML'
    mathematica:form='TraditionalForm'
    xmlns:mathematica='http://www.wolfram.com/XML/'>
 <mi>x</mi>
</math></span> k&auml;siitell&auml;&auml;n kuten kolmialkoista vektoria Aluksi poistetaan <span><math xmlns='http://www.w3.org/1998/Math/MathML'
    mathematica:form='TraditionalForm'
    xmlns:mathematica='http://www.wolfram.com/XML/'>
 <mi>x</mi>
</math></span>:ll&auml; mahdollisesti aiemmin annetut arvot.
</p>



<p class="CellLabel">
 In[7]:=
</p>



<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mi>Remove</mi>
  <mo>[</mo>
  <mi>x</mi>
  <mo>]</mo>
 </mrow>
</math>
</p>

<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mi>a</mi>
  <mo>+</mo>
  <mn>1</mn>
 </mrow>
</math>
</p>

<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mi>a</mi>
  <mo>+</mo>
  <mi>x</mi>
 </mrow>
</math>
</p>

<p class="CellLabel">
 Out[8]=
</p>



<p class="Output">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mo>{</mo>
  <mrow>
   <mn>2</mn>
   <mo>,</mo>
   <mn>3</mn>
   <mo>,</mo>
   <mn>4</mn>
  </mrow>
  <mo>}</mo>
 </mrow>
</math>
</p>

<p class="CellLabel">
 Out[9]=
</p>



<p class="Output">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mo>{</mo>
  <mrow>
   <mrow>
    <mn>1</mn>
    <mo>+</mo>
    <mi>x</mi>
   </mrow>
   <mo>,</mo>
   <mrow>
    <mn>2</mn>
    <mo>+</mo>
    <mi>x</mi>
   </mrow>
   <mo>,</mo>
   <mrow>
    <mn>3</mn>
    <mo>+</mo>
    <mi>x</mi>
   </mrow>
  </mrow>
  <mo>}</mo>
 </mrow>
</math>
</p>

<p class="Text">
 Jos j&auml;lkimm&auml;inen lasku toistetaan ja tehd&auml;&auml;n sijoitus, jossa muuttujalle <span><math xmlns='http://www.w3.org/1998/Math/MathML'
    mathematica:form='TraditionalForm'
    xmlns:mathematica='http://www.wolfram.com/XML/'>
 <mi>x</mi>
</math></span> annetaan arvo {4,5,6}, ei tulos v&auml;ltt&auml;m&auml;tt&auml; ole ennakko-odotuksen mukainen.
</p>



<p class="CellLabel">
 In[10]:=
</p>



<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mrow>
   <mi>a</mi>
   <mo>+</mo>
   <mi>x</mi>
  </mrow>
  <mtext> </mtext>
  <mo>/.</mo>
  <mtext> </mtext>
  <mrow>
   <mi>x</mi>
   <mo>-&gt;</mo>
   <mrow>
    <mo>{</mo>
    <mrow>
     <mn>4</mn>
     <mo>,</mo>
     <mn>5</mn>
     <mo>,</mo>
     <mn>6</mn>
    </mrow>
    <mo>}</mo>
   </mrow>
  </mrow>
 </mrow>
</math>
</p>

<p class="CellLabel">
 Out[10]=
</p>



<p class="Output">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mo>{</mo>
  <mrow>
   <mrow>
    <mo>{</mo>
    <mrow>
     <mn>5</mn>
     <mo>,</mo>
     <mn>6</mn>
     <mo>,</mo>
     <mn>7</mn>
    </mrow>
    <mo>}</mo>
   </mrow>
   <mo>,</mo>
   <mrow>
    <mo>{</mo>
    <mrow>
     <mn>6</mn>
     <mo>,</mo>
     <mn>7</mn>
     <mo>,</mo>
     <mn>8</mn>
    </mrow>
    <mo>}</mo>
   </mrow>
   <mo>,</mo>
   <mrow>
    <mo>{</mo>
    <mrow>
     <mn>7</mn>
     <mo>,</mo>
     <mn>8</mn>
     <mo>,</mo>
     <mn>9</mn>
    </mrow>
    <mo>}</mo>
   </mrow>
  </mrow>
  <mo>}</mo>
 </mrow>
</math>
</p>

<p class="Text">
 Toisessa j&auml;rjestyksess&auml; tehtyn&auml; lopputulos on erilainen.
</p>



<p class="CellLabel">
 In[11]:=
</p>



<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mrow>
   <mi>x</mi>
   <mo>=</mo>
   <mrow>
    <mo>{</mo>
    <mrow>
     <mn>4</mn>
     <mo>,</mo>
     <mn>5</mn>
     <mo>,</mo>
     <mn>6</mn>
    </mrow>
    <mo>}</mo>
   </mrow>
  </mrow>
  <mo>;</mo>
 </mrow>
</math>
</p>

<p class="Input">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mi>a</mi>
  <mo>+</mo>
  <mi>x</mi>
 </mrow>
</math>
</p>

<p class="CellLabel">
 Out[12]=
</p>



<p class="Output">
 <math xmlns='http://www.w3.org/1998/Math/MathML'>
 <mrow>
  <mo>{</mo>
  <mrow>
   <mn>5</mn>
   <mo>,</mo>
   <mn>7</mn>
   <mo>,</mo>
   <mn>9</mn>
  </mrow>
  <mo>}</mo>
 </mrow>
</math>
</p>
 
<p>Linkkej&#x00E4;</p>
<p>
<a href="vektori.xml">Vektori</a><br />
<a href="mmasyotto.xml">Vektorit ja matriisit Mathematicassa</a><br />
<a href="mmamalaskut.xml">Matriisien laskutoimituksia Mathematicassa</a><br />
<a href="mpllaskut.xml">Vektorien laskutoimituksia Maplessa</a><br />
&nbsp;&nbsp;&nbsp;&nbsp;Liite&nbsp;&nbsp;<a href="../liite/mmalaskut.nb" target="liite">Vektorien laskutoimituksia Mathematicassa</a><br />
<br  />
<br  />
Ossi Mauno 9.12.2004
</p>
 
<hr />
<p style='font-family: Helvetica; font-size: 8pt'>Created by
<a href="http://www.wolfram.com"><span style='font-style: italic'>Mathematica</span></a>
&nbsp;(December 9, 2004) </p>

</body>
</html>

