Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Find the Number of Reflexive Relations on a Set using C++
In this article, we will explain the approaches to find the number of reflexive relations on a set. In this problem, we are given with number n, and on a set of n natural numbers, we must determine the number of reflexive relations.Reflexive Relation − A relation in a set A is called reflexive if ( a, a ) belongs to R for every 'a' belongs to set A. For example −Input : x = 1 Output : 1 Explanation : set = { 1 }, reflexive relations on A * A : { { 1 } } Input ...
Read MoreWhat is Conceptual Clustering?
Conceptual clustering is a form of clustering in machine learning that, given a set of unlabeled objects, makes a classification design over the objects. Unlike conventional clustering, which generally identifies groups of like objects, conceptual clustering goes one step further by also discovering characteristic definitions for each group, where each group defines a concept or class.Therefore, conceptual clustering is a two-step process − clustering is implemented first, followed by characterization. Thus, clustering quality is not solely a service of single objects. Most techniques of conceptual clustering adopt a statistical method that uses probability measurements in deciding the concepts or clusters.Probabilistic ...
Read MoreFind the Number of quadruples where the first three terms are in AP and last three terms are in GP using C++
In this article, we will describe every possible approach to find the number of quadruples in which the first 3 terms are in A.P., and the last 3 are in G.P. First, we will explain the basic definition of arithmetic progression(A.P.) and geometric progression (G.P.).Arithmetic progression(A.P.) − It is a sequence of numbers in which the common difference (d) is the same or constant that means a difference of two consecutive numbers is constant. For example: 1, 3, 5, 7, 9 | d = 2Geometric Progression(G.P.) − It is a sequence of numbers in which the common ratios (r) are ...
Read MoreFind the Number of Quadrilaterals Possible from the Given Points using C++
A quadrilateral forms a polygon with four vertices and four edges in Euclidean plane geometry. The name 4-gon etc. Included in other names of quadrilaterals and sometimes they are also known as a square, display style, etc.In this article, we will explain the approaches to finding the number of quadrilaterals possible from the given points. In this problem, we need to find out how many possible quadrilaterals are possible to create with the provided four points ( x, y ) in the cartesian plane. So here is the example for the given problem −Input : A( -2, 8 ), B( ...
Read MoreComparing 'cubic' and 'linear' 1-D interpolation using SciPy library
Below python script will compare the ‘cubic’ and ‘linear’ interpolation on same data using SciPy library −ExampleFirst let’s generate some data to implement interpolation on that −import numpy as np from scipy.interpolate import interp1d import matplotlib.pyplot as plt A = np.linspace(0, 10, num=11, endpoint=True) B = np.cos(-A**2/9.0) print (A, B)OutputThe above script will generate the following points between 0 and 4 − [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.] [ 1. 0.99383351 0.90284967 0.54030231 -0.20550672 -0.93454613 -0.65364362 0.6683999 0.67640492 -0.91113026 0.11527995]Now, let’s plot these points as follows −plt.plot(A, B, '.') plt.show()Now, based on fixed data ...
Read MoreFind the Number of Primes In A Subarray using C++
In this article we will describe the ways to find the number of primes in a subarray. We have an array of positive numbers arr[] and q queries having two integers that denote our range {l, R} we need to find the number of primes in the given range. So below is an example of the given problem −Input : arr[] = {1, 2, 3, 4, 5, 6}, q = 1, L = 0, R = 3 Output : 2 In the given range the primes are {2, 3}. Input : arr[] = {2, 3, 5, 8 ...
Read MoreFind the Number of Prime Pairs in an Array using C++
In this article, we will explain everything about finding the number of prime pairs in an array using C++. We have an array arr[] of integers, and we need to find all the possible prime pairs present in it. So here is the example for the problem −Input : arr[ ] = { 1, 2, 3, 5, 7, 9 } Output : 6 From the given array, prime pairs are (2, 3), (2, 5), (2, 7), (3, 5), (3, 7), (5, 7) Input : arr[] = {1, 4, 5, 9, 11} Output : 1Approaches to Find ...
Read MoreWhat are the types of Constraint-Based Cluster Analysis?
Constraint-based clustering finds clusters that satisfy user-stated preferences or constraints. It is based on the nature of the constraints, constraint-based clustering can adopt instead of different approaches. There are several categories of constraints which are as follows −Constraints on individual objects − It can define constraints on the objects to be clustered. In a real estate application, for instance, one can like to spatially cluster only those luxury mansions worth over a million dollars. This constraint confines the collection of objects to be clustered. It can simply be managed by preprocessing (e.g., implementing selection using an SQL query), after which ...
Read MoreCalculating the Hamming distance using SciPy
Hamming distance calculates the distance between two binary vectors. Mostly we find the binary strings when we use one-hot encoding on categorical columns of data. In one-hot encoding the integer variable is removed and a new binary variable will be added for each unique integer value. For example, if a column had the categories say ‘Length’, ‘Width’, and ‘Breadth’. We might one-hot encode each example as a bitstring with one bit for each column as follows −Length = [1, 0, 0]Width = [0, 1, 0]Breadth = [0, 0, 1]The Hamming distance between any of the two categories mentioned above, can ...
Read MoreWhat is Expectation-Maximization?
The EM (Expectation-Maximization) algorithm is a famous iterative refinement algorithm that can be used for discovering parameter estimates. It can be considered as an extension of the k-means paradigm, which creates an object to the cluster with which it is most similar, depending on the cluster mean.EM creates each object to a cluster according to a weight defining the probability of membership. In other term, there are no strict boundaries among clusters. Thus, new means are evaluated based on weighted measures.EM begins with an original estimate or “guess” of the parameters of the combination model (collectively defined as the parameter ...
Read More