Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Division of sequences in Wolfram Mathematica

  1. Oct 25, 2014 #1
    How to divide two sequences in Wolfam Mathematica? For example

    [tex]f_n=\frac{1}{n}=1,\frac{1}{2},\frac{1}{3},...[/tex] and [tex]g_n=n^2=1,4,9,...[/tex]

    I want to get [tex]h_n=1,\frac{1}{8},\frac{1}{27}...=\frac{f_n}{g_n}[/tex]

    How to do that in Wolfram Mathematica?
     
  2. jcsd
  3. Oct 27, 2014 #2
    In[1]:= fn = Table[1/n, {n, 1, 6}];
    gn = Table[n^2, {n, 1, 6}];
    MapThread[Divide, {fn, gn}]

    Out[3]= {1, 1/8, 1/27, 1/64, 1/125, 1/216}
     
  4. Nov 3, 2014 #3
    Tnx!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Division of sequences in Wolfram Mathematica
Loading...