Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
GfG 160: Daily DSA
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Sign In
▲
Similar Topics
DSA
22.5k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
C++
4.2k+ articles
C++ Programs
2.4k+ articles
Greedy
2k+ articles
Algorithms
2k+ articles
Linked List
1.1k+ articles
Pattern Searching
610+ articles
Analysis of Algorithms
360+ articles
DSA
>
Algorithms
>
Randomized
Randomized
68 posts
Popular Articles
Recent Articles
Number guessing game in C
Last Updated: 01 July 2022
Given an integer N. A number guessing game is a simple guessing game where a user is supposed to guess a number between 0 and N in a maximum
...read more
Randomized
Technical Scripter
C Language
Numbers
C Programs
Technical Scripter 2020
DSA
Generating OTP (One time Password) in PHP
Last Updated: 10 October 2018
Now these days, OTP (one time password) is mandatory in almost each and every service. A developer can generate OTP in many ways but the cha
...read more
Algorithms
Randomized
Web Technologies
PHP
PHP Programs
DSA
Mid-Square hashing
Last Updated: 20 March 2024
Mid-Square hashing is a hashing technique in which unique keys are generated. In this technique, a seed value is taken and it is squared. Th
...read more
Randomized
DSA
Similar Topics
DSA
22.5k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
C++
4.2k+ articles
C++ Programs
2.4k+ articles
Greedy
2k+ articles
Algorithms
2k+ articles
Linked List
1.1k+ articles
Pattern Searching
610+ articles
Analysis of Algorithms
360+ articles
Expectation or expected value of an array
Last Updated: 06 August 2024
Expectation or expected value of any group of numbers in probability is the long-run average value of repetitions of the experiment it repre
...read more
Mathematical
Randomized
DSA
Randomized Binary Search Algorithm
Last Updated: 25 January 2022
We are given a sorted array A[] of n elements. We need to find if x is present in A or not.In binary search we always used middle element, h
...read more
Algorithms
Divide and Conquer
Searching
Randomized
DSA
Generate 0 and 1 with 25% and 75% probability
Last Updated: 01 July 2022
Given a function rand50() that returns 0 or 1 with equal probability, write a function that returns 1 with 75% probability and 0 with 25% pr
...read more
Randomized
DSA
Randomized Algorithms | Set 0 (Mathematical Background)
Last Updated: 07 March 2023
Conditional Probability Conditional probability P(A | B) indicates the probability of even 'A' happening given that the even B happened.[Tex
...read more
Randomized
DSA
Select a Random Node from a Singly Linked List
Last Updated: 13 April 2023
Given a singly linked list, select a random node from the linked list (the probability of picking a node should be 1/N if there are N nodes
...read more
Linked List
Randomized
DSA
Introduction and implementation of Karger's algorithm for Minimum Cut
Last Updated: 19 April 2024
Given an undirected and unweighted graph, find the smallest cut (smallest number of edges that disconnects the graph into two components).
...read more
Graph
Randomized
graph-connectivity
DSA
Expected Number of Trials until Success
Last Updated: 01 June 2023
Consider the following famous puzzle.In a country, all families want a boy. They keep having babies till a boy is born. What is the expected
...read more
Mathematical
Randomized
harmonic progression
DSA
Linearity of Expectation
Last Updated: 01 June 2023
Prerequisite: Random Variable This post is about mathematical concepts like expectation, linearity of expectation. It covers one of the requ
...read more
Mathematical
Randomized
DSA
Random number generator in arbitrary probability distribution fashion
Last Updated: 11 September 2023
Given n numbers, each with some frequency of occurrence. Return a random number with probability proportional to its frequency of occurrence
...read more
Mathematical
Randomized
prefix-sum
DSA
Select a random number from stream, with O(1) space
Last Updated: 20 April 2023
Given a stream of numbers, generate a random number from the stream. You are allowed to use only O(1) space and the input is in the form of
...read more
Random Algorithms
Mathematical
Randomized
array-stream
DSA
Make a fair coin from a biased coin
Last Updated: 10 September 2021
You are given a function foo() that represents a biased coin. When foo() is called, it returns 0 with 60% probability, and 1 with 40% probab
...read more
Mathematical
Randomized
DSA
Generate integer from 1 to 7 with equal probability
Last Updated: 27 August 2022
Given a function foo() that returns integers from 1 to 5 with equal probability, write a function that returns integers from 1 to 7 with equ
...read more
Mathematical
Randomized
DSA
First
1
2
3
4
5
>>
Last
First
1
2
3
4
5
>>
Last
First
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !