# Tag: Probability

## Generate Random Input from an Array according to given Probabilities

Write an algorithm to generate any one of the given N numbers according to given probabilities. Get great deals at Amazon

## Find Index of Maximum Occurring Element with Equal Probability

Given a collection of integers, develop an algorithm to find the index of maximum occurring element with equal probability.

## Generate Fair Results from a Biased Coin

In this post, we will discuss how to generate fair results from a biased coin which prefer one side of the coin over another, and returns TAILS with p probability and HEADS with (1-p) probability

## Generate numbers from 1 to 7 with equal probability using specified function

Write an algorithm to generate numbers from 1 to 7 with equal probability using a specified function which produces random numbers between 1 to 5 with equal probability.

## Generate Desired Random Numbers With Equal Probability

Write an algorithm to generate random numbers from 1 to 12 with equal probability using a given function which generates random numbers from 1 to 6 with equal probability.

## Return 0, 1 and 2 with equal probability using the specified function

Write an algorithm to generate 0, 1 and 2 with equal probability using a specified function which either produces 0 or 1 with 50% probability each.

## Get 0 and 1 with equal Probability using specified function

Write an algorithm to get 0 and 1 with equal probability using a function which generates random numbers from 1 to 5 with equal probability.

## Find Probability that a Person is Alive after Taking N steps on an Island

Given an island in the form of square matrix and a point inside the matrix where a person is standing. The person is allowed to move one step in any direction (right, left, top, down) on the matrix. If he steps outside the matrix, he dies. Calculate the probability that he is alive after he …

## Generate 0 and 1 with 75% and 25% Probability

Write an algorithm to generate 0 and 1 with 75% and 25% probability respectively using a specified function which produces either 0 or 1 each with 50% probability.