989 views
0 votes
0 votes
An n-bit binary string is selected uniformly at random.For a k $\geq$ 1,what is the probability of selecting an n-bit string in which there is a substring of length at least k in which each bit is a 1?

2 Answers

0 votes
0 votes
For an n bit binary string there are 2 options for each of the bit i.e each bit can be either 1 or 0. So for an n bit binary no. total no of combinations is :2^n. Now we have to find the probability that out of these there is a substring of length at least k which contains all 1's So that implies for atleast k values we dont have any choice they all are ones where as for the rest n-k bits we have a choice. So the no of substrings for them in this case is : 2^(n-k)

Probability:2^(n-k)/2^n=1/2^k.

I guess this is the ans for this ques.

Related questions

0 votes
0 votes
1 answer
2
Sanjay Sharma asked Mar 9, 2017
1,639 views
How many bit strings of length n contains 1)at least 2) at most 3) exactly r 1's
1 votes
1 votes
1 answer
4
radha gogia asked Jul 8, 2016
1,194 views
0 / \ 5 7 / \ / \ 6 4 1 3 \ 9Tree given in the form: (node value(left subtree)(right subtree))For tree given above: (0(5(6()())(4()(9()())))(7(1()())(3()())))Input forma...