Division of sequences in Wolfram Mathematica

Click For Summary
SUMMARY

The discussion focuses on dividing two sequences using Wolfram Mathematica. The sequences defined are f_n = 1/n and g_n = n^2, resulting in h_n = f_n/g_n. The user successfully implements this using the code: fn = Table[1/n, {n, 1, 6}]; gn = Table[n^2, {n, 1, 6}]; MapThread[Divide, {fn, gn}]. The output confirms the correct division, yielding the sequence h_n = {1, 1/8, 1/27, 1/64, 1/125, 1/216}.

PREREQUISITES
  • Familiarity with Wolfram Mathematica syntax
  • Understanding of sequences and series
  • Basic knowledge of mathematical operations in programming
  • Experience with the MapThread function in Mathematica
NEXT STEPS
  • Explore advanced sequence manipulation in Wolfram Mathematica
  • Learn about the Table function in Mathematica for generating sequences
  • Investigate the use of Map and MapThread for functional programming in Mathematica
  • Study mathematical functions and their applications in Wolfram Mathematica
USEFUL FOR

Mathematicians, educators, students, and anyone interested in computational mathematics using Wolfram Mathematica.

LagrangeEuler
Messages
711
Reaction score
22
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?
 
Physics news on Phys.org
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}
 
Tnx!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 21 ·
Replies
21
Views
6K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K