Hi, I’m Avnish

  • Building software at Autodesk, passionate about simplifying technical concepts.
  • I document my learnings on computer science and mathematics through articles.
  • Explore my personal projects or check my resume for professional experience.
  • Connect with me on GitHub or LinkedIn.
  • Subscribe to my RSS feed to be notified when I publish new articles.

Gaussian Elimination

Let’s consider a problem where we have to buy oranges and apples but under the following conditions. The difference between 2X the number of oranges and the number of apples should be 3. The sum of 4X the number of oranges and the number of apples should be 9. The difference between 5X the number of oranges and 3X the number of apples should be 7. System of Linear Equations These conditions could be modeled using the following equations ...

July 16, 2024 · 10 min · Avnish

Matrices

A matrix is a rank 2 tensor i.e. an array expanding in a maximum of two independent dimensions. Multiple vectors could be arranged in rows or columns to create a matrix. $$\vec{a} = \begin{bmatrix} 5 \\ 6 \\ 7 \end{bmatrix}\ \ \vec{b} = \begin{bmatrix} 7 \\ 9 \\ 10 \end{bmatrix}$$ $$\textbf{A} = \begin{bmatrix} \vec{a} & \vec{b} \end{bmatrix} = \begin{bmatrix} 5 & 7 \\ 6 & 9 \\ 7 & 10 \end{bmatrix}$$ $$\textbf{B} = \begin{bmatrix} \vec{a} \\ \vec{b} \end{bmatrix} = \begin{bmatrix} 5 & 6 & 7 \\ 7 & 9 & 10 \end{bmatrix}$$ ...

July 12, 2024 · 8 min · Avnish
A vector is an array of data expanding in one dimension.

Vectors

A vector could represent the magnitude of a quantity broken down into its various components, for example, the velocity of an object moving on a 2D plane could be represented using the vector $\vec{v} = \begin{bmatrix} 8 & 9 \end{bmatrix}$. On a 2D plane $8$ and $9$ could be called the horizontal and vertical components of the vector $\vec{v}$ respectively. But the words horizontal and vertical on a 2D or 3D plane are relative to the viewer (try rotating the figure above anti-clockwise). ...

July 10, 2024 · 4 min · Avnish
A tensor is an array of data expanding in multiple independent dimensions.

Tensors

In linear algebra, a tensor is an array of data expanding in multiple (or zero) independent dimensions. It is used to represent quantities/equations/functions with multiple components, for example, the equation $3x+2y=0$ could be represented with the tensor $[3\ 2\ 0]$ where each value in the tensor represents the different components of the equation. The number of independent dimensions of a tensor is called its rank. Vectors and matrices could be generalized with the term tensor. The following Venn diagram visualizes the connection between them. ...

July 3, 2024 · 4 min · Avnish

brag: A Command Line Tool for Building a Bragging Document

Inspired by Julia Evan’s blog Get your work recognized: write a brag document I created this tool to keep a record of my brags in Markdown Format and refer them later to create a formatted bragging document. A bragging or hype document is created to keep a record of achievements over time. This document/information extracted from this document could be shared with managers or used for self-reflection and improvement. I refer to it during my daily standups and weekly sync-up meetings. ...

March 19, 2024 · 9 min · Avnish
The reorderList function will return the head of the reordered linked list given a linked list as input

Reorder Linked Lists

Problem Statement We have to implement the reorderList function that takes the head node of a linked list as input and reorders its nodes in the format specified below. Given an input list like the following: $$Node_0 \rightarrow Node_1 \rightarrow Node_2 \rightarrow \dots \rightarrow Node_{(n-2)} \rightarrow Node_{(n-1)} \rightarrow Node_n$$ the reorderList function should reorder its nodes as: $$Node_0 \rightarrow Node_n \rightarrow Node_1 \rightarrow Node_{(n-1)} \rightarrow Node_2 \rightarrow Node_{(n-2)} \rightarrow \dots$$ ...

February 15, 2024 · 9 min · Avnish
The mergeTwoLists function will return the head of the merged linked list given two sorted linked lists as input

Merge Two Sorted Linked Lists

Problem Statement We have to implement the mergeTwoLists function that takes the head nodes of two sorted linked lists as input and returns the head node of the merged linked list as the output. Optimal Solution To merge both linked lists we can use the two-pointer approach by maintaining an iterator on both linked lists and comparing their values. The smaller value will be selected and inserted at the end of a new list. The result would be a merged sorted linked list. ...

January 29, 2024 · 4 min · Avnish
The reverseList function will return the head of the reversed linked list

Reversing Linked Lists

Problem Statement We have to implement the reverseList function that takes the head node of a linked list as an input and returns the head node of the reversed linked list in the output. Brute Force Solution If we iterate over the input linked list and insert its value at the beginning of a new list the result would be a reversed linked list. ...

January 26, 2024 · 4 min · Avnish
We can improve the time complexity of some solutions from quadratic to linear using the two-pointer approach

Two-Pointer Approach

To solve problems like Two Sums, Product Except Self, or Contains Duplicate we have to access multiple values at the same time from a sequential data structure (for example, a Linked List or an Array). The initial instinct while solving these problems is to use nested loops where each layer of the loop will maintain a different iterator on the data structure. But this approach does not scale well with the size of input as a single order of nested loops has $O(n^2)$ worst-case time complexity. ...

January 23, 2024 · 7 min · Avnish
Prompt LLMs directly from your code editor using Ollama integrations

Self Hosting LLMs using Ollama

Ollama provides an interface to self-host and interact with open-source LLMs (Large Language Models) using its binary or container image. Managing LLMs using Ollama is like managing container lifecycle using container engines like docker or podman. Ollama commands pull and run are used to download and execute LLMs respectively, just like the ones used to manage containers with podman or docker. Tags like 13b-python and 7b-code are used to manage different variations of an LLM. ...

January 12, 2024 · 8 min · Avnish