simulate dice with fair coin flip [closed] - simulation

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Given a fair coin (0/1), how do you simulate fair dice(0 to 5)
Obvious answer I know is toss 3 times, treat each toss as a bit to produce (2^3 = 0 to 7)
If result == 7, discard and repeat.
Well, theoretically worst case big-O of this is really bad (another question in itself, something to do with monte-carlo algos). Lets keep this soln on shelf.
So now my question is,
Is there/can there be n number of coin toss that can guarantee simulation of dice ?
Of course if exists would like to know minimum number of tosses. :)
In absence of a number that is both divisible by three and 2^n, I couldnt think of any way to solve this. :(

Related

Understanding term deterministic and non random [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
I am confused about a situation which is presented on the following slide:
Last sentences says that:
It is important to note that deterministic does not mean that
xt is non-random. What does this mean? If A and B are random variable, then x must be random right?
I think the point may be that nature may choose randomly among different paths, but once you know which path has been chosen you can predict future values of x_t on the path from past values x_{t-1}, etc. So e.g. nature may flip a coin to choose between the following two paths: x_t=0 for all t, and x_t=1 for all t. Then if you don't know the path, x_t is indeed random. But once you know x_{t-1}, you know x_t.

How to Test conditional independence between random variables using available samples? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How can I test for the independence between two random variable given another one(i.e. whether P(A|C)=P(A|C,B) or not?) using available samples. in other words, I just have 1000 samplesf for 3 random variables generated by bntoolbox on Matlab and now I wanna test for CI between arbitrary random variables.
I've read something about Fisher's method but honestly don't understand it.
Thanks is advance.

homework: Simplify f=Σ(8,12,13,14)+dΣ(3,7,9,10) [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was doing this question of boolean algebra, Simplify f=Σ(8,12,13,14)+dΣ(3,7,9,10) using karnaugh map.. can anyone please tell me what is d in this question? I know its a stupid question but i couldn't find it on google. And please tell me what this question means? i mean like straight away simplifying without the d expression is okay but what does the d expression signify in here ?
d stands for 'don't care'. Cells 3,7,8,10 do not affect the value of F.
This helps because you might be able to get a simpler expression if you ignore those cells.

Large Carmichael Number Data [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I need a list of Large Carmichael numbers( 10 to 100 digits ). Is there any website which provides such data. It would be more helpful if i can get a list of large odd composite numbers and primes as well.
Did you already try The On-Line Encyclopedia of Integer Sequences? Carmichael numbers are sequence A002997, and from there you can find a link to a Table of n, a(n) for n = 1..10000.
Here's the first 33: http://oeis.org/search?q=carmichael&language=english&go=Search.
This is generally a good site for sequences.

Quicksort (JAVA) [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Lets say you have an array of size n with randomly generated elements and you want to use quicksort to sort the array. For large enough n (say 1,000,000), in order to speed up quicksort, it would make sense to stop recursing when the array gets small enough, and use insertion sort instead. In such an implementation, the base case for Quicksort is some value base > 1. What would the optimal base value to choose and why?
Think about the time complexity of quicksort (average and worst case) and the time complexity of other sort that might do better for small n.
Try starting with Wikipedia - it has good starting info about comparing the two algorithms. When you have a more specific question, feel free to come back.