# Vector, Row Column and Array

**URL:** <https://discourse.julialang.org/t/vector-row-column-and-array/86095>\
**Category:** General Usage\
**Tags:** question, arrays\
**Created:** [August 21, 2022, 4:45pm UTC](https://discourse.julialang.org/t/vector-row-column-and-array/86095 "2022-08-21T16:45:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tfinke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tfinke/32/38995_2.png) [@tfinke](https://discourse.julialang.org/u/tfinke)\
**Post date:** [August 21, 2022, 4:45pm UTC](https://discourse.julialang.org/t/vector-row-column-and-array/86095/1 "2022-08-21T16:45:02Z")

</div>

Hi all,

suppose the following code:

```julia
a = [2, 3, 4]
z = [5, 7, 9]

b = a .+ 1
c = (a .+ 1)'
d = a' .+ 1

s = (a' .+ 1) * z
t = (a .+ 1)' * z
u = b' * z
v = c * z
w = d * z

```

The last five lines all calculate the dot product. The value always is 88. But

- `s` and `w` are of type Vector
- `t`, `u` and `v` are scalars

I suppose that these different resulting types are intended. Is there an easy explanation for this behavior?  
Espacially it was confusing for me, that the types of `s` and `t` differ. From the math point of view, they should not - or am I mistakening?

Thanks for explanation and best regards

Torsten

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [August 21, 2022, 5:35pm UTC](https://discourse.julialang.org/t/vector-row-column-and-array/86095/2 "2022-08-21T17:35:14Z")

</div>

I recommend [JuliaCon 2017 | Taking Vector Transposes Seriously | Jiahao Chen - YouTube](https://www.youtube.com/watch?v=C2RO34b_oPM). Vectors and co-vectors are complicated.

---

<div class="post-metadata">

**Author:** ![tfinke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tfinke/32/38995_2.png) [@tfinke](https://discourse.julialang.org/u/tfinke)\
**Post date:** [August 22, 2022, 10:44am UTC](https://discourse.julialang.org/t/vector-row-column-and-array/86095/3 "2022-08-22T10:44:02Z")

</div>

thanks for that hint. Great talk!

Indeed vectors are kind of brain twisting, but if ones thinks through carefully, it works. In my case I managed to get code working for scalar arguments as well as for vectors. Several times ad had to transpose twice. Looks strange at first but is consequent.
