Linear Transformations: A 20 SBD coding contest announcement! [EXTENSION UPDATE!]

in #steemstem7 years ago (edited)

In my last article, I touched upon the concept of linear transformation when explaining the concept of eigen vectors and eigen values. The core of linear transform is matrix multiplications. The article is here: Eigen Values and Eigen Vectors: Visually Explained!

So today, I am announcing a contest for anyone with an access to a computer and a programming language installed in it to try out. This coding competition is very easy to be honest. I am making this very easy so that most people can participate in it.

Problem to be solved

Consider a 2D set of XY coordinate points. Like say numbers -10 to 10(with a suitable resolution of your choice) in X and Y dimensions. Now this XY coordinate set will be your input data. Now define a 2 X 2 matrix which I will call A. Say A =[1 0.5; 0.5 1].

A=

1    0.5
0.5    1

Apply this matrix A on the input 2D coordinates. This is the linear transformation here. This is simply a matrix multiplication of matrix A on each coordinate. Like illustrated below:

What you will be doing is performing these multiplications(efficiently) to each coordinate in the input 2D space to get the set of transformed output 2D space. And then you should plot your input versus output. Also, you may want to superimpose the eigen vectors weighted with eigen values onto your transformed space in visualization. If you have doubts about that, read my previous post here.

This wikipedia article has lot of examples. Also this video by 3blue1brown of youtube has one of the most beautiful illustrations regarding linear transformations:

Task

Write your own code (by making it more general and fancy) in any programming language. It would be easier if you use any of the coding languages mentioned below:

  • Python
  • Matlab
  • Julia
  • Mathematica

But in case you want to use something else that too is fine.

And post your code and results as comments to this post. Make it as fancy as possible. You may want to superimpose the eigen vectors weighted with eigen values on the transformed space. If you want to create gif animations or videos which can illustrate this concept best, it would be great! You can also use any online coding services like repl.it etc for doing your coding.

Sample Code (Updated!)

I will post a very basic Matlab code in coming days, if people here struggle to come up with even basic solutions. This will help people who are not familiar with programming to participate in the contest. The link below:

Link

The input and output of the code is given below:

Input

Output

The transformation matrix considered is
A=

1    0.5
0.5    1

Grading Policy (Total: 7 points)

Elegant and readable code(with comments etc): maximum 2.5 points
Beautiful visualizations(figures): maximum 2.5 points
For those who do gifs/animations: maximum 2 points

The prize

There will be 5 winners.
First prize: 8 SBD
Second prize: 6 SBD
And the next three accounts will get 2 SBD each.

If the entries are less than 5, I will divide the remaining total prize money among people who attempted. If any ties happen, I will consider who posted first in deciding the winners.

Deadline: April 12th (updating the extension from April 8th)

STATUS: OPEN

Minor changes in the contest rules like deadline extension can happen.

Acknowledgement

I thank @reggaemuffin for explaining things to me regarding how a programming contest should be done. And he is sponsoring half the prize money! Thanks @reggaemuffin ! I want to thank @suesa too for directing me towards @reggaemuffin for guidance.

So let the contest begin!

References [Books for further reading]

[1]: Introduction to Linear Algebra, Fifth Edition (2016) by Gilbert Strang
[2]: Coding The Matrix: Linear Algebra Through Computer Science Applications by Philip N. Klein


If you like this post, please upvote and resteem it.

Below is my recent posts, you may find it interesting:
Eigen Values and Eigen Vectors: Visually Explained!
A google trends analysis on "COW": India versus Pakistan


Join #steemSTEM

Join the active science community #steemSTEM at discord: https://discord.gg/BZXkmWw

And to steemSTEM beginners:

You can ask for help in our discord page. There are people ready to help you there.


gif courtesy: @rocking-dave


All images without image sources are my creations :)

Follow me @dexterdev


 ____ _______  ______ _________ ____ ______    
/  _ /  __\  \//__ __/  __/  __/  _ /  __/ \ |\
| | \|  \  \  /  / \ |  \ |  \/| | \|  \ | | //
| |_/|  /_ /  \  | | |  /_|    | |_/|  /_| \// 
\____\____/__/\\ \_/ \____\_/\_\____\____\__/
Sort:  

Hahaha, I think am out of the game, @mathowl is a mathematician. Let leave it to him and others . However, I got it resteemed

Your resteem was unsuccesful, because the post is like older than 7 days. :P

Loading...


😂😂Ah, man, @dexterdev, you're taking me back to my school days when I had to study mathematics and stuff, maths is like kryptonite to me. And even though this ain't maths, it looks like it, numbers and equation/algebraic stuff, the mere sight of it weighs me down. Lol. And I thought sbd being attached to it would change a thing! SMH

Do participate and share it. I meant resteem if possible. I am extending the date. 😃

OK, cool.


Your contest was added to Steemit Contest Compilation for current week (02.04-08.04)

I love you @artz!

Ps: No homo
😁

Oh I wish I will find the time to participate ...!
In any ways, this is resteemed and I wish you lots of participation!

Thankyou for resteeming. :)

Is the transformation matrix fixed? Or is it an input variable?

If it is not fixed are you assuming that the transformation matrix is square?

In the example transformation matrix is fixed. But if you want to write a general program, where A can be varied, its very welcome. Extra effort has more marks. :) Did I clear your doubt?

Your A is a symmetric matrix. So computations for it can be performed much quicker than for (most) non-symmetric matrices.

In addition, if you want to perform linear operation on the arrows that you presented in the input section then the input needs to consist out of pairs where one co-ordinate indicates the arrow starting point and the other co-ordinate indicates the arrow endpoint

That was an example. I agree to your comment. I have done another example here which is not symmetric. By the way we are talking about 2D or 3D cases only. :P

Now a day python is best platform and well marketing tool in technology....

What is your point here? Are you commenting for the sake of commenting? Tell something relevant here. Don't spam! A friendly advise: there are some whales who will flag comments like this. So be careful when doing this in future in other posts.