0
$\begingroup$

I want to create a binary string of 0 and 1 , which will have x ones and y zeroes.
A valid binary string such that at any length i , 1<=i<=(x+y) ,sum of occurrences of 1 is greater than 0

For Ex  x=2 , y=1
110 // valid
101 // In valid because at 2 both occurrences are equal

Is there any direct formula for this ?

  • 2
    this is a variant of [Bertrand's Ballot Theorem](https://en.wikipedia.org/wiki/Bertrand's_ballot_theorem)2017-01-01
  • 0
    Do you mean "The number of occurrences of $1$ is greater than the number of occurrences of $0$"?2017-01-01
  • 0
    @ChristianBlatter yes at every point2017-01-01
  • 0
    @lulu it should be strictly greater than2017-01-01
  • 0
    Right, that's the usual condition for Bertrand's result.2017-01-01

0 Answers 0