Aditya Chatterjee's Blog, page 209
May 20, 2020
How to formulate a linear programming problem?
In this article, we will explore into sample problems and formulate it as a linear programming problem. We have considered three problems:
Product Mix Problem
Transportation Problem
Flow Capacity Problem
Before we look into linear programming, let us have a quick look at Mathematical progamming, which is a superset of linear programming.
Mathematical Programming
Mathematical Programming is used to find the best solution to a problem that requires a set of decisions about how to best use a set...
May 19, 2020
Handling Exceptions in Java
In some cases, it might happen that the method that you are calling goes wrong or generates an exception. An exception is an undesirable or unforeseen occasion, which happens during the execution of a program and disturbs the typical progression of the program's guidelines. Exception Handling is a way to deal with this possibility.
An exception is an object of type Exception. The process of creating such an object and handing it to the runtime system is known as "throwing" an exception....
Super keyword Reference in Java
This article at OpenGenus explains the use of super keyword in Java. Also, we will discuss how it can be used for several purposes with various examples.
Super keyword is used to call the Constructor of the Parent Class. It is required when we need to pass some arguments to Parent Class and complete object instantiation. Recall that this keyword has two meanings: to denote a reference to the implicit parameter and to call another Constructor of the same class. Likewise, the super keyword has...
May 18, 2020
Journey to becoming the Most Active GitHubber in India
Success isnt always about Greatness, its about consistency. Consistent, hard work gains success. Greatness will come. - Dwayne Johnson
Like most of the engineering students, I was stuck between what was taught in the university and what was being practiced in the industry. The huge gap between the two widens even further for software industry where trends and technology changes on a very rapid pace.
I would like to stress a fact before I proceed to talk about the #301DaysofCode challenge,...
Minimum number of increment or decrement (by 1) operations to make array in increasing order
Given an array of size N. Find the minimum number of increment or decrement operations to make the array in increasing order. In each move, we can add or subtract 1 to any element in the array.
This problem can be solved in O(N x R) time where N is the number of elements and R is the range of the elements. This is achieved using Dynamic Programming.
Examples:
Input : a = { 5, 6, 6, 3 } Output : 3 Explanation : Modified array is { 5, 6, 6, 6 } Input : a = { 1, 2, 2, 3 } Output : 0 Explanation...Minimum number of increment (by 1) operations to make array in increasing order
Given an array of size N . Find the number of increment (by 1) operations required to make the array in increasing order. In each move, we can add 1 to any element in the array.
This can be solved in linear time O(N) using a Mathematical Algorithm.
Examples:
Input : a = { 5, 6, 6, 3 } Output : 6 Explanation : Modified array is { 5, 6, 7, 8 } Input : a = { 1, 2, 3 } Output : 0 Input : a = { 1, 4, 3 } Output : 2 Explanation : Modified array is { 1, 4, 5 } IntuitionLets take two numbers p and...
May 17, 2020
Activation Functions in Machine Learning: A Breakdown

The goal of this article at OpenGenus, is to simplify Math-heavy and counter-intuitive topic of Activation Functions in Machine Learning that can trip up newcomers to this exciting field!
We have covered the basics of Activation functions intuitively, its significance/ importance and its different types like Sigmoid Function, tanh Function and ReLU function.
A Brief Intro to Neural NeworksThe functions we shall be talking about are used often in the creation of Artificial Neural Networks...
Online C Code Compiler using Flask
In this article, we have explored how we can develop an online C Programming language compiler using Flask (a Python web framework). It can be extended to support any programming language. The basic idea is to store the text form the textarea into a file on the server machine and compile and execute the file on the server machine and return the output/error (if any) to the user.
Flow of applicationNow we will learn about how the dataflow occurs in the application. As you can see in the...
May 16, 2020
Basics of std::multiset in C++
std::multiset is associative type of STL container. It comes under set header. These header contains two types of class templates:
a) set - store unique elements only.
b) multiset - accept duplicate elements also.
We have explored the basics of multiset container in C++ in depth. We have covered initialize, accessing elements, member functions, modifiers like emplace, its iterators, observers and much more.
Features :a) Upon insertion of elements, they always follows strict weak...
May 15, 2020
Handling date and time in Python using datetime module

In Python, date and time are not represented as specific data types, but a special module called datetime module can be imported in order to work with date and time as objects.
InstallationThis is an inbuilt module, hence it does not require any specific installation.
How it worksThe classes in this module are used for manipulating dates and times. These classes provide a number of functions which can be used to work with them. As these are datetime objects in Python, when you manipulate...



