I'm trying to represent the following code in one equation, But I'm confused about that
a=[1,2,3]
b=[1,2]
for i in a:
temp = []
for j in b:
temp.append(i+j)
result=sum(temp)/len(b)
the result should not be as vector like first iteration the result will be 2.5 , the second 3.5 and third iteration the result will be 4.5
As a programmer. I would treat both a and b as two finite sets since their domains are finite.
Define set $a$ of length $n$ as $a(n) = a_n$ for $a=\{1,2,3\}$.
Define set $b$ of length $m$ as $b(m) = b_m$ for $b=\{1,2\}$.
Define an sequence of $c$ with length $n$: $$c_i=\frac{\sum_{i=0}^{n}\sum_{j=0}^{m} (a_i+b_j)}{m}$$
I dunno if this notation is mathematically acceptable though.