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? Probability probability + – Sambit Kumar asked Sep 9, 2018 Sambit Kumar 989 views answer comment Share Follow See all 14 Comments See all 14 14 Comments reply Show 11 previous comments srestha commented Sep 9, 2018 reply Follow Share @Sambit I have only problem with the word consecutive Say I took an example 0011110000111111 Here if k=3 strings will be 111,1111,11111,111111 but how can we get such a logic in probability? 0 votes 0 votes Sambit Kumar commented Sep 10, 2018 reply Follow Share srestha question says different thing.read the question carefully 0 votes 0 votes srestha commented Sep 10, 2018 reply Follow Share where is difference @Sambit? string means it must have consecutive 1's 0 votes 0 votes Please log in or register to add a comment.
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. anjali007 answered Sep 9, 2018 anjali007 comment Share Follow See all 2 Comments See all 2 2 Comments reply Sambit Kumar commented Sep 9, 2018 reply Follow Share your calculation is based on a particular index i to i+k-1 index.So wrong approach. 0 votes 0 votes anjali007 commented Sep 9, 2018 i edited by anjali007 Sep 9, 2018 reply Follow Share it can be any substring in that string... 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes I think it can be solved like this :- Sandy Sharma answered Sep 9, 2018 Sandy Sharma comment Share Follow See 1 comment See all 1 1 comment reply Sambit Kumar commented Sep 9, 2018 reply Follow Share same strings are being intersected by each cases 0 votes 0 votes Please log in or register to add a comment.