Avatar

bloby

@compooter-blob

i like random stuff
The Dot Product

Currently, my favorite mathematical operation is the dot product (in data vectors).

A computational/data vector in mathematics is essentially a list of numbers (different from their cousins, the geometric vectors which are defined a bit differently). In linear algebra, we define some interesting operations with vectors.

The first one is the vector addition, in which the sum of the vectors is just the pairwise sum of their elements: [1, 2, 3, 4, 5] + [1, 0, 2, 0, -1] = [2, 2, 5, 4, 4].

The second one, is the vector-constant multiplication, in which we multiply each entry of the vector by a constant: 10 * [1.5, 2, 3, 4] = [15, 20, 30, 40].

And well, it would be natural for us to define a vector-vector multiplication, similar to the addition. However, we have reserved the • symbol for a much more interesting (and in my opinion, useful) operation: The Dot Product

The dot product of two vectors x and y is a number, and it is the sum of the product of their pairwise entries, in other words:

x * y = x[0] y[0] + x[1] y[1] + ... x[n] y[n]

One may wonder: but why? The reason is because a LOT of stuff in mathematics is in this x0 y0 + ... + xn yn form. For instance:

  • Sum of all elements of a vector x: x[0] + x[1] + ... + x[n] = x[0] * 1 + x[1] * 1 + ... = x * [1, 1, 1 ..., 1]. Just do the dot product of the vector with one that has all ones
  • Sum of the first and last element: x * [1, 0, ..., 0, 1]
  • First element minus last element: x * [1, 0, ..., 0, -1]
  • Sum of the even indexed elements: x * [1, 0, 1, 0, ...]
  • Even indexed - Odd indexed: x * [1, -1, 1, -1, ..., ]
  • Last element in the vector: x * [0, 0, ..., 1]
  • Mean of the values in the vector: x * [1/n, 1/n, ..., 1/n]

and a lot more. Because of this variety of possible usages, it is currently my favorite math operation. There are also generalizations such as the inner product and matrix-vector multiplication, but that's something for another day

Reason to learn assembly #1

You will be able to better understand the program output of your compiler (specially if using C, C++ or Rust). Because in the end people using those languages want all the tasty performance their code can achieve, knowing assembly can be pretty useful for evaluating the scope of some optimizations. "Do I really need to do this optmization or does the compiler know it already?", "Does the compiler know how to inline this lambda?", "Is the compiler smart enough to get rid of this loop for me when I enable this thing?" and so on

Not only that, but you will be able to have some intuition when comparing the performance of similar code by its assembly code.

A really cool tool abot the subject is called Compiler Explorer and it basically lets you easily analyse the output of your code online

Double date!!!! 💞💞

They are all just a buncha goofballs :) This took me so long idk what to do with my life now that its finished 😔

hustleinatrap

save for yourself and for future generations

Avatar
illzie

reblog to save a life

Avatar

For any lovelies with graduations coming up 💕

Avatar
fuck-rand

You all deserve to look bomb as hell at your graduation 😘

Avatar
sisteresme666

Aww, that’s so cute :)

this video starts circulating every year around graduation season and it makes me really happy

Avatar
ravenreyamidala

Super useful tip for people with large heads too!! Thanks :D

hi its been a minute! finally got a chance to sit down again and draw these guys again (its been months. head in my hands), and for fun I wanted to draw them in the style of my upcoming junior film, Killer Cupid! goobertown USA real

Avatar

i just made this for myself, but multiple people have told me they find it really useful so i thought id share it!

The thing with statistics - via

Avatar
an-gremlin

Numbers don’t lie but people can sure as fuck pick and choose the numbers they give you and phrase things to make them sound like they mean things they don’t

learn fucking stats or at least how they can hurt

As a wise man once said: There are lies, damned lies, and statistics.