# Tag Archives: binomial coefficient

## Central binomial coefficient

Given an integer N, the task is to find the Central binomial coefficient. The first few Central binomial coefficients for N = 0, 1, 2,… Read More »

## Number of ways to color N-K blocks using given operation

Given N blocks out of which K are colored. These K colored blocks are denoted by an array arr[]. The task is to count the… Read More »

## Count non decreasing subarrays of size N from N Natural numbers

Given are N natural numbers, the task is to find the count of the subarrays of size N that can be formed using elements from… Read More »

## Number of words that can be made using exactly P consonants and Q vowels from the given string

Given a string str and two integers P and Q. The task is to find the total count of words that can be formed by… Read More »

## Number of ways of choosing K equal substrings of any length for every query

Given a string str and Q queries. Each query consists of an integer K. The task is to find the number of ways of choosing… Read More »

## Number of ways to go from one point to another in a grid

Given the NxN grid of horizontal and vertical roads. The task is to find out the number of ways that the person can go from… Read More »

## Ways to Remove Edges from a Complete Graph to make Odd Edges

Given a complete graph with N vertices, the task is to count the number of ways to remove edges such that the resulting graph has… Read More »

## Calculate nCr using Pascal’s Triangle

A useful application of Pascal’s triangle is the calculation of combinations. The formula to find nCr is n! / r! * (n – r)! which… Read More »

## Count the number of special permutations

Given two positive integers n and k, the task is to count the number of special permutations. A special permutation P is defined as a… Read More »

## Ways of selecting men and women from a group to make a team

Given four integers n, w, m and k where, m is the total number of men. w is the total number of women. n is… Read More »

## Ways of dividing a group into two halves such that two elements are in different groups

Given 2n girls and randomly divided into two subgroups each containing n girls. The task is to count the number of ways in which groups… Read More »

## Program to find the value of sin(nΘ)

Given the value of sin(Θ) and a variable n<=15. The task is to find the value of sin(nΘ) using propety of trignometric functions. Examples: Input:… Read More »

## Program to find the value of tan(nΘ)

Given a value of tan(Θ) and a variable n <=15. The task is to find the value of tan(nΘ) using property of trignometric functions. Examples:… Read More »

## Program to Find the value of cos(nΘ)

Given a value of cos(Θ) and a variable . The task is to find the value of cos(nΘ) using propety of trignomertric functions. Note: n… Read More »

## Eggs dropping puzzle (Binomial Coefficient and Binary Search Solution)

Given n eggs and k floors, find the minimum number of trials needed in worst case to find the floor below which all floors are… Read More »