Saturday, November 4, 2017

Program of Random Function baised with 50% for 0 and 1 and 75% for 1 and 25% for 0 in java

Hey guys , Today one of my friend asked me a question regarding the function which will return the baised probability of 75% of 1 I thought lets share the answer with you guys as well

So below is my solution of the problem and my approach.


  • First will write one function which will return 50% probability of getting 0 and 1
  • After that will create one function which call 50% function of 2 times.
  • Will return the OR of the the response.

Below is the program 

Thanks for reading


Post a Comment