Sunidhi Bansal has Published 1100 Articles

Probability that the pieces of a broken stick form a n sided polygon in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:23:38

93 Views

We are given with the stick of any length and that stick can be broken randomly into n pieces which can be of type integer or floating point and the task is to find whether the broken pieces can form a n sided polygon.We can calculate the probability by applying ... Read More

Probability of reaching a point with 2 or 3 steps at a time in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:22:16

182 Views

A person “A” is walking from a starting position X = 0, the task is to find the probability to reach exactly X = num, if he/she can either take 2 or 3 steps. Probability for step length 2 i.e. P, the probability for the step length 3 is 1 ... Read More

Probability of rain on N+1th day in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:20:33

100 Views

Given with an array containing 0’s and 1’s where 0’s represents no rain and 1’s represent rainy day. The task is to calculate the probability of rain on N+1th day.To calculate the probability of rain on N+1th day we can apply the formulaTotal number of rainy days in the set ... Read More

Probability of getting more value in third dice throw in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:18:10

66 Views

Given three players A, B, C throwing dice, we have to find the probability of the C throwing the dice and the number scored by C is higher than both A and B.To check the probability of getting more value, we have to keep in mind that the value of ... Read More

Program for weighted mean of natural numbers in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:16:26

797 Views

Given with an array of natural numbers and one more array containing the weights of the corresponding natural numbers and the task is to calculate the weighted mean of natural numbers.There is a formula which is used for calculating the weighted mean of natural numbers.$$\overline{x}=\frac{\displaystyle\sum\limits_{i=1}^n (x_{i*}w_{i})}{\displaystyle\sum\limits_{i=1}^n w_{i}}$$Where, x is the ... Read More

Program to check if water tank overflows when n solid balls are dipped in the water tank in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:13:55

183 Views

Given with the radius and height of cylindrical water tank, ‘n’ number of spherical solid balls with the radius and the volume of water in the tank and the task is to check whether the tank will overflow or not when balls are dipped in the tank.Formula to calculate the ... Read More

Program to check if an Array is Palindrome or not using STL in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:12:04

2K+ Views

Given an array arr[n] of n integers, the task is to find whether array is a palindrome or not. We have to do the stated task using STL in C++.In C++ there is a feature of STL(Standard Template Library), it is a set of C++ template classes which are used ... Read More

Program to check if three points are collinear in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:09:33

2K+ Views

Given with three different valued points and the task is to check whether the points are collinear or not.Points are said to be collinear if they lie on the same line and they are not collinear if they are on the different lines. Given below is the figure of collinear ... Read More

Program to check whether the given number is Buzz Number or not in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:07:45

1K+ Views

Given with a number ‘n’ and the task is to determine whether the given positive integer is a buzz number or not and display the result as an output.What is Buzz Number?For being a buzz number there are two conditions either of which must be true −Number should end with ... Read More

Program to check whether a number is Proth number or not in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 13-Aug-2020 07:05:54

601 Views

Given with a number ‘n’ and the task is to determine whether the given positive integer is a proth or not and display the result as an output.What is Proth Number?A proth number is given by$$N=k\cdot\:2^{n}+1$$Where, n is a positive integer and k is a odd positive integerThe first few ... Read More

Advertisements