[Question]
  [
[Prefix normal words](https://arxiv.org/abs/1805.12405) arise in the context of binary jumbled pattern matching. A binary word \$w\$ consisting of \$0\$s and \$1\$s is said to be *prefix normal* \* if, among all of its substrings, none contains more \$1\$s than the prefix of \$w\$ of the same length does. In other words, if \$w\$ contains \$n\$ \$1\$s then it is prefix normal if, for all \$m\le n\$, the shortest (or equal shortest) substring containing \$m\$ \$1\$s is a prefix.
For example, \$w=\color{red}{11010}\color{blue}{11011}00100\$ is not prefix normal because it has a substring of length 5 (highlighted in blue) that contains four \$1\$s, whereas its prefix of length 5 (red) only contains three \$1\$s. If we flip the first \$0\$ to \$1\$, however, then the resulting word (\$111101101100100\$) is prefix normal.
### Task
Your task in this [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge is to write a program or function that decides whether a binary word is prefix normal.
You may take input in any sensible format (e.g. string, numeric, list of characters/digits), which extends to using any pair of characters/digits instead of \$0\$ and \$1\$ if you wish.
Output/return a consistent value for every input that is prefix normal and another consistent value for every input that is not.
### Test cases
**Prefix normal**
```
00000
1101010110
111101101100100
11101010110110011000
1110010110100111001000011
```
**Not prefix normal**
```
00001
1011011000
110101101100100
11010100001100001101
1110100100110101010010111
```
---
\* Strictly, *prefix normal with respect to \$1\$*.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jellylanguage), ~~9~~ 7 bytes
```
ṡJ§Ṁ€⁼Ä
```
[Try It Online!](https://jht.hyper-neutrino.xyz/tio#WyIiLCLhuaFKwqfhuYDigqzigbzDhCIsIj3igJ0xw4cpWSIsIiIsWyInMDAwMDAnLCcxMTAxMDEwMTEwJywnMTExMTAxMTAxMTAwMTAwJywnMTExMDEwMTAxMTAxMTAwMTEwMDAnLCcxMTEwMDEwMTEwMTAwMTExMDAxMDAwMDExJywnMDAwMDEnLCcxMDExMDExMDAwJywnMTEwMTAxMTAxMTAwMTAwJywnMTEwMTAxMDAwMDExMDAwMDExMDEnLCcxMTEwMTAwMTAwMTEwMTAxMDEwMDEwMTExJyJdXQ==)
-2 bytes thanks to Unrelated String
```
ṡJ§Ṁ€⁼Ä  Main Link
ṡ        Take overlapping slices of length(s)
 J       [1, 2, ..., length]
  §      Take the sum of each slice of each length
   Ṁ€    Is the maximum sum for each length
     ⁼   Equal to
      Ä  The cumulative sum of the original list?
```
[Answer]
# [Haskell](https://www.haskell.org/), 57 bytes
```
g x=x!x
p!s=p==[]||sum p>=sum s&&init p!tail s&&g(init p)
```
[Try it online!](https://tio.run/##fVBBCsMgELz7is0lJCBFH2B/0BeIFA8hlapIteAhf7dJTWpMSxGVnZ3Z2d2b9PdB65RGiCw2EbnGM8cYF9PknwbcmS2fb1tlVQDXBKn0Eo5dBvoUBh88MOCc4PUIBIA5xXQOyqX7BC3g@mZaRTmod0R6NCoVipDgOkM2LMs@wFblaPNjjj/tkp1v1WQRfs9GqonqIpsXFQIhI5Wdl2yku1yhcw9lw2ns4b389AI "Haskell – Try It Online")
---
# [Haskell](https://www.haskell.org/), 66 bytes
A bit longer, but actually runs in reasonable time.
```
g x|k<-[1..length x]=and[h x>=h(drop n x)|h<-(sum.).take<$>k,n<-k]
```
[Try it online!](https://tio.run/##fVBBDoMgELz7ij30oAkSuKM/6AsIaUgkYlBqCk08@HdqqhaxTUMgy@zOzO5q6Yzq@xBamGbDSk4x7pVtvYZJVNI2fAnqSufN4z6ChamYNStz9xxwgb00il1qgywrjQheOe@gAs4J2o7IABCniC6feOkxQSO4vWtZUnJiHwrp2SgqRCJBaYbs2Er7ALvK2ebHHH/aJQffpMlI/J6NJBOlIrsXFSLLBtnZZcmDHK83yMdHZz1uC3gvP7wA "Haskell – Try It Online")
[Answer]
# JavaScript (ES6), 57 bytes
Expects an array of binary digits. Returns *false* for prefix normal, or *true* for not prefix normal.
```
a=>a.map(v=>a=v-~a).some((p,i,a)=>a.some(q=>q-a[~i--]>p))
```
[Try it online!](https://tio.run/##TY4xb8MgEIV3fgXKEk6KEcwV3tqxS8Ykw9XBKRUGDI6lqGr@umsIqQpI9@6944MvnDF10YSpcf6sl14tqFrkAwY2r0LNzR2BJz9oxsLO7BByXPpRtWODh7tpmlMbAJaox6uJmm37tAUeNZ7fjNX7m@uYAD75/RSNu7AVF6yZ2OboNsB7H1@x@2SJqpZ@E0qtnihSRQ@c83QqP3m/Dh86wsuadt4lbzW3/sJ6hgDkBxaRF5FSlC2zlEWsZ3VK/8yKJUU1q5etx2hWpBTyN/5E/@cVnKioEtVHHjBRB/IV@Qs "JavaScript (Node.js) – Try It Online")
### How?
We first compute the cumulative sums of the incremented input values:
```
a.map(v => a = v - ~a)
```
(Using `a = v - ~a` allows us to re-use `a[]` to compute the sum, which is two bytes shorter than allocating a specific variable. That's the only reason why the values are incremented.)
For instance:
```
   1, 0, 1, 1, 0, 1, 1, 0, 0, 0
=> 2, 1, 2, 2, 1, 2, 2, 1, 1, 1
=> 2, 3, 5, 7, 8,10,12,13,14,15
```
We then test whether there's some pair \$(i,j)\$ with \$j>i\$ such that \$a\_j-a\_{j-i-1}>a\_i\$.
```
.some((p, i, a) => a.some(q => q - a[~i--] > p))
//                             ^      ^      ^
//                           a[j]  a[j-i-1]  a[i]
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~54...44~~ 41 bytes
```
(l=Most@l+#-(t={##2})&@@t)&/@(t=l=#)0&
```
[Try it online!](https://tio.run/##TY1NCsIwEIX3OYUkUFq0mLiPBMSlINRd6SKUVgPpD80sBLFn8DKeyyPEJk3FTGBevnnz0ki4VY0EVUpbcxtrfuoMCL0maQz8QcjumURCQBJtxQQ0J8nn9aaRPQ@qhZyk@1qQIhqzUrbjpTve@6EyRnWtONzkIEuoBiMymMzXrNcKckzdQYxRX8xJ5sV0J@Lfy8wjRgMMzKHZ6hTyDf3sS/R/no@jIcqPwidzGA0Gt8LwZoURLuwX "Wolfram Language (Mathematica) – Try It Online")
`` is `VectorGreaterEqual`.
```
(l=Most@l+#-(t={##2})&@@t)&/@(t=l=#)        get all prefix differences by:
                             (t=l=#)          l: difference list, t: input list
                           /@                 over input length:
(l=Most@l                )&                     drop last element of l
         +#-   {##2} &@@t                       foreach, add next in prefix, subtract next in substring
                                                      e.g. (a+b+c)-(b+c+d) -> (a+b+c)-(b+c+d)+d-e
            (t=     )                           shift t left
                                    0      all nonnegative?
```
\*strictly speaking, each element of `l` is also offset by corresponding input element . I suspect this doesn't matter - a [brute force test](https://tio.run/##jYuxDsIgFEVn@AtDQkp8RuxqSRhcHJo4uBGGF1MqCW2NxYnw7Ui6uDqec@6dMD6HCaN/YClO9X42TVD9skYd9uzQRJUYa7PgWkfBj7rG6pgQtpOcjn8d5O9RLouh5Pb2c52fKdmQXJ1xGndq1AhbMwhVQGVrKYGEcP@8wrCaJOGUIdhsKaQArcy2fAE "Wolfram Language (Mathematica) – Try It Online") of strings up to length 17 showed no differences - but I don't have a proof as to why.  
If it does make a difference, +1 byte using `(l=Most@l+#-{t=##2}&@t)&/@(l=0{t=##})0&` instead. [Try it online!](https://tio.run/##TY3fCsIgGMXvfYpQkKJG2v1CiC6DYN2NXcjYmrB/6HcRxPYMvUzP1SMsdS5S4Tv@zvHYSKiKRoLK5VTG07qOL50BUW9J9ISYkMNABWzoXliHeTJsPq83o9NVqxZSEh1LIUhGxySX7Xjrzo9eF8aorhWnSmqZQ6GNSMCm70lfK0gxcwtxzvzmTnIv7LHE3xfPI84CDMyhOeoU8gP94kv1f5@vY6HKW@GTuYyFgHvC8W6FEc6mLw "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~9~~ 8 bytes
```
ẆẈṀƙ§Ɗ⁼Ä
```
[Try it online!](https://tio.run/##y0rNyan8///hrraHuzoe7mw4NvPQ8mNdjxr3HG75b/uoYa7h4XbNyP//1Q1AQF1H3dDQAAwNIRxDMBOIgGJQEZg8WNDQAC4MFQUJQpSDWEA5MAOkBqYJYQ2qyWCDDaCGgiXhFkKMNYAqAWkzVAcA "Jelly – Try It Online")
It feels like something less naive should be shorter yet, but I haven't had any luck.
```
Ẇ           Get every substring of the input.
    §       Sum each substring,
   ƙ Ɗ      group the sums by
 Ẉ          the lengths of the corresponding substrings,
  Ṁ         and take the largest element of each group.
      ⁼Ä    Is the resulting list equal to the cumulative sums of the input?
```
[Answer]
# [Risky](https://github.com/Radvylf/risky), 31 [bytes](https://github.com/Radvylf/risky#format)
```
*00_{?*_1_+!?{_?+0_{?*_1_+_?*_1__[___{_0*__1*_1:____{_0{__1*_1
```
Input is a single argument which is a list of 0's and 1's; output is 1 if prefix normal, 0 if not. [Try it online!](https://radvylf.github.io/risky?p=WyIqMDBfez8qXzFfKyE_e18_KzBfez8qXzFfK18_Kl8xX19bX19fe18wKl9fMSpfMTpfX19fe18we19fMSpfMSIsIltbMSwxLDAsMSwwLDEsMSwwLDEsMSwwLDAsMSwwLDBdXSIsMF0)
### Explanation
This is a bit long, so I'll explain it in two halves.
```
00_{?*_1_+!?{_?+0_{?*_1_+_?*_1
    ?                           Input list
   {                            List of all sublists
     *_1                        Repeat once (no-op)
  _                             Same value (no-op)
        _                       Map this function to each of the sublists
                                (first arg is each sublist, second arg is original input):
          !?                     Length of first arg
            {                    Take prefix of that length from
             _?                  Second arg
         +                       Sum
 0                              Transpose (adds a level of nesting to a flat list)
               +                Concatenate that list with the following:
                  {?             List of all sublists of input list
                    *_1          Repeat once (no-op)
                 _               Same value (no-op)
                       _         Map this function to each sublist:
                         _?       First arg
                           *_1    Repeat 1 time (no-op)
                        +         Sum
0                               Transpose
```
At this point, we have a list of pairs \$(n\_l^0, n\_l^i)\$, where \$n\_l^i\$ is the number of ones in the \$i^{th}\$ sublist of length \$l\$ and \$n\_l^0\$ is the number of ones in the first sublist of length \$l\$. We now want to check if for every pair, \$n\_l^0 \geq n\_l^i\$. Equivalently, \$min(n\_l^0, n\_l^i) = n\_l^i\$.
```
__[___{_0*__1*_1:____{_0{__1*_1
_                                Map this function to each pair (first arg is each pair,
                                 second arg is original input):
    __                            List of both args
      {_0                         Get 0th element (the pair)
   _                              Same value (no-op)
         *__1*_1                  Repeat 1 time (no-op)
  [                               Minimum
                :                 Equals
                   __              List of both args
                     {_0           Get 0th element (the pair)
                  _                Same value (no-op)
                        {          Get element of the pair at index
                         __1*_1    1 (the second element)
                 _                 Same value (no-op)
 _                                Same value (no-op)
```
We now have a list containing 0 for every sublist with more ones than the equal-length prefix, and 1 for every other sublist. The `*` at the beginning of the code takes the product of this list, yielding 0 for inputs with any such substrings and 1 for inputs without any.
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 49 bytes
```
((1)|0)+(?<=(?!(?>(?<-1>(?<-2>1)|0)*)(?(2)^))^.*)
```
[Try it online!](https://tio.run/##TY2xDsMgDER3/iJDJZsqlZ05jcf8BWqHDlkyRB377wRfnCqA4Hh3HNvnu6zveqP5VYmUf8J3svFJ1pFNTfWKfZjgZSajgQtzeWSuVXwkVcFUlwrRViO4nx6QSsBgjo6oq4Qj/eNn9bUPdRJVsOKTo0wi4E90Bw "Retina 0.8.2 – Try It Online") Outputs `0` for prefix normal, `1` for not normal. Explanation:
```
((1)|0)+
```
Match some `1`s and `0`s, keeping count of the `1`s and the total number of digits (very slightly golfier as we need a group for the `+`), ...
```
(?<=...^.*)
```
... then, at the beginning of the string, ...
```
(?>(?<-1>(?<-2>1)|0)*)
```
... try to consume all of the `1`s, matching up to the same number of digits...
```
(?!...(?(2)^))
```
... and fail if there were enough `1`s, showing that the prefix is normal.
Note that if there are two disjoint substrings with too many `1`s then I think the substring containing both substrings will also have too many `1`s and will therefore be found first, but I can't prove that.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 9 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Œε∍OyO@}P
```
Input as a list of 0s/1s.
[Try it online](https://tio.run/##yy9OTMpM/f//6KRzWx919PpX@jvUBvz/H22oA4EGKKQBhIwFAA) or [verify all test cases](https://tio.run/##S0oszvifnFiiYKeQnJ@SqpdfnJiUmapgY6Pg6u/GZa@k8KhtkoKS/f@jk85tfdTR61/p71Ab8F@HCyTLVZ6RmZOqUJSamKKQmceVks@loKCfX1CiDzEESqGZa6OgAlabl/o/2kAHCmO5og11DIEsBDaEixoiRKAkRA1CHk0fkipDFPMRehG6DHRQZQxgYkA9cB5YP7rp6K7G5T4DJLtQXIXQheYTAxT3o5oAswWoBwA).
**Explanation:**
```
Œ        # Get all sublists of the (implicit) input-list
 ε       # Map over each sublist:
  ∍      #  Shorten the (implicit) input-list to a length equal to this sublist-length
   O     #  Sum this prefix
    yO   #  Sum the sublist as well
      @  #  Check that the prefix-sum is larger than or equal to the sublist-sum
 }P      # After the map: pop and take the product to check if all were truthy
         # (after which it is output implicitly as result)
```
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 14 [bytes](https://github.com/abrudz/SBCS)
```
∧/∘∊+\≥⍳∘≢+/¨⊂
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT////1HHcv1HHTMedXRpxzzqXPqodzOI17lIW//QikddTf/THrVNeNTb96hvqqf/o67mQ@uNH7VNBPKCg5yBZIiHZ/D/NAUDGORKUzAEQgMkbAgXNUSIQEmIGoQ8mj4kVYYo5iP0InQZoMkYwMS41HXVuRBuNASbgW4DustxudEAyT4UlyF0ofnGAMUPqCbAbDEEAA "APL (Dyalog Unicode) – Try It Online")
A tacit function taking a vector of `0`'s and `1`'s
`⊂` The input vector enclosed in a singleton list.  
`⍳∘≢` indices of the input (1 .. length input)  
`¨` For each of the numbers on the left and the input vector on the right:  
`+/` sums of all sublists of the right argument of the length given by the left argument.  
`+\` sums of prefixes of the input.  
`≥` for each prefix sum, is it larger or equal than each of the sublist sum of sublists of the same size.  
`∊` flatten nested list.  
`∧/` reduce with boolean *and*.
Example with input `1 0 0 1 1`:
```
┌──┬─────────┬──────────┐
│+\│⍳∘≢+/¨⊂  │+\≥⍳∘≢+/¨⊂│
├──┼─────────┼──────────┤
│1 │1 0 0 1 1│1 1 1 1 1 │
├──┼─────────┼──────────┤
│1 │1 0 1 2  │1 1 1 0   │
├──┼─────────┼──────────┤
│1 │1 1 2    │1 1 0     │
├──┼─────────┼──────────┤
│2 │2 2      │1 1       │
├──┼─────────┼──────────┤
│3 │3        │1         │
└──┴─────────┴──────────┘
```
[Answer]
# [Scala](http://www.scala-lang.org/), 74 bytes
```
s=>1 to s.size forall(l=>s.sliding(l).map(_.sum).forall(_<=s.take(l).sum))
```
[Try it online!](https://tio.run/##dVLBbsIwDL3zFV7FIZGgaq6IVNqmHXbZJjhO05SVlHWEpiQBoSG@vXOSgmDr2iZy/Z6fLdu2EEq0@uNLFg5ejCyr/ZM2a6HuP2WxArl3sl5YuG0aOAwAdkJB4ZEJzOXm9bF2bzy/01pJUQNvLc8ZOA02tdW3hFIboRRRPEeHqhZVvSSKpmvRkPfUbtc07RjvU25TJ1bSwx6gbczVXFQE3OckWAVAkvkngXEOzmzlKDoZy8LLehAW/PghoQ8@RQYGy/o5HcUzopC3fhODNzhLoew5/CSe/YUuU/@Lx2Td3aPfFRbhrPth7IKJRDrAC5sOhFi5mTszAiPtVjkK0/FVt2mYd5wCUrH5MaCbntNo4zzRwCWggVqVQMJyeG0KnJ@1oxRggqp2qiY2KbQxuHITGHrxZbWTFoaRnkS1I0isuSf0YTZ7nl0FxjgYHm6idQQi9w3Ky8VJlJ5UB/4c2x8 "Scala – Try It Online")
Strategy is as follows:
* for all possible prefix lengths (`1 to s.size forall{...}`) check the following
	+ compute the number of 1's within each sliding window of current prefix length (`s.sliding(l).map(_.sum)`)
	+ check whether all these sliding windows contain no more 1's than the first window/initial prefix (`.forall(_<=s.take(l).sum)`)
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~70~~ 60 bytes
```
->s,r=0..s.size{r.any?{|i|r.any?{|j|s[j,i].sum>s[0,i].sum}}}
```
[Try it online!](https://tio.run/##nY/BCoMwDIbvfYquh6ngSnsV5m57gt1ERieKlbqJ0YOzPruz1Q7ZcW0hyZ8/5GvbP4a5OM@nGML2zCgFCvKdjy0Vz@EyaqldVmlIqlCmFPo6hoRt6TRNc9N3gMmt7btyiAhKCDOHhAgTzpm93JXcFstb1K/mPFbmbNfYdCOvIyYjKKW5yMpRg0bYbj8UNBNK@Qt@o2Tne15Aa9H4x6h73WUQTAgZHyFruAoFuRqwg@XrQsewZ/@Ftaxs47Tt3S9WUraZzOifsHj@AA "Ruby – Try It Online")
* Saved 9 Bytes thanks to @Dingus suggestions !  
any? replaces first map  
We reuse entire range L=0..s.size instead of just the length
* Saved another 1 again by @Dingus  
Compares directly the sums of prefix and current range being checked
* Takes an array `s` of 0/1 and return `false` if it is prefix normal, `true` if not.
```
(1..L=s.size).map{|i|  - every length by*
(X= ... )        - we save in X:
  (0..L).map{|j|   * every index: all substrings of same length
  s[j,i].sum}      * sum 1's in slice of length i at j
.max>X[0]     - any > of 1st element?
}.any?}          - any true?
```
[Answer]
# [R](https://www.r-project.org/), 92 bytes
Or **[R](https://www.r-project.org/)>=4.1, 78 bytes** by replacing two `function` appearances with `\`s.
```
function(s,n=sum(s|1)){for(i in 1:n)F=F|which.max(sapply(0:n,function(j)sum(s[1:i+j])))-1;F}
```
[Try it online!](https://tio.run/##hY/BC4IwFMbv/RXiaY809qCDGLsK3btFBxGGk5zilIrsb19uziBwte0w@H7f977Xac40H2TRi0YSFUmmhpqoEQGevOmICIQMMJWQsWy8laIod3V@Jypv2@uD0FRGH3MF1nrGVGyrCwDEeMhempOh58mpOcqehNScEOJ9ApsvAZHaix4VrTa9CfIhS4KlkPo5hxlqDjS/NdgqqynLnB/L/Klr21LX1NL@teau1HlMsIP1Gw "R – Try It Online")
Takes a vector of integers. Outputs `FALSE` for prefix normal and `TRUE` for non-prefix normal word.
---
Solution shorter in [R](https://www.r-project.org/)>=4.1:
# [R](https://www.r-project.org/), 98 bytes
Or **[R](https://www.r-project.org/)>=4.1, 77 bytes** by replacing three `function` appearances with `\`s.
```
function(s,n=sum(s|1),g=sapply)any(g(1:n,function(i)which.max(g(0:n,function(j)sum(s[1:i+j])))-1))
```
[Try it online!](https://tio.run/##hY9BCoMwEEX3PYarDNWSgS5E8ADduytdiBCN1ChNpBV699SMsbRg2iSLwHv5@XOzIrdiVJWRvWI6VrkeO6afCHGd63IYrhOUamI1w0zFb1HCvZFVc@jKx4z4J2qBEs6YyX17AYAEAaxgoxFp0Z@UYRF3K4LkmMLuCyBy2higSGw@sxRS1gSykIc9rzlrCXS3LZnIZsr6z49h/tSlttw3JTs81tKV@zcu2Mv2BQ "R – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~19~~ 18 bytes
```
⊙θΦκ‹Σ…θ⁻⊕κλΣ✂θλ⊕κ
```
[Try it online!](https://tio.run/##VYpNCsIwEIWvkuUUIiRrV1IoCApCT1DGgYZOp5qkQk8/dtBN3@L98D4ch4zLwKqPnKTCRTZ4e9clrpRh8u5GpUC/ztBuyNSOy8v@e5K1wFUw00xS6QlT4x03uxnbc0Iyjr07Qn@dVWOMIcSwu@VvBGt6@vAX "Charcoal – Try It Online") Link is to verbose version of code. Outputs `-` for not normal, nothing for prefix normal. Explanation:
```
 θ                  Input string
⊙ Φκ                Any substring satisfies
      …θ⁻⊕κλ        Leading prefix
     Σ              Sum of digits
    ‹               Less than
             ✂θλ⊕κ  Current substring
            Σ       Sum of digits
                   Implicitly print
```
[Answer]
# [Core Maude](http://maude.cs.illinois.edu/w/index.php/The_Maude_System), 186 bytes
```
mod P is pr NAT-LIST . var L P F X Y Z :[Nat]. ops n c : Nat ~> Nat . ceq
n(L)= F if P X 2 Y F Z := L 2 L /\ size(P)= size(F)/\ c(F)> c(P). eq c(X 1 Y)=
s c(X Y). eq c(L)= 0[owise]. endm
```
The answer is obtained by reducing the `n` function with the input bitstring as a Maude `NatList` of `0`s and `1`s. If the term is irreducible (result is an “error expression” of kind `[NatList]`), then the bitstring is prefix normal, otherwise (result of sort `NeNatList`, `Nat`, etc.) it is not.
### Example Session
```
             \||||||||||||||||||/
           --- Welcome to Maude ---
             /||||||||||||||||||\
         Maude 3.1 built: Oct 12 2020 20:12:31
         Copyright 1997-2020 SRI International
           Sun Oct 17 22:18:44 2021
Maude> mod P is pr NAT-LIST . var L P F X Y Z :[Nat]. ops n c : Nat ~> Nat . ceq 
> n(L)= F if P X 2 Y F Z := L 2 L /\ size(P)= size(F)/\ c(F)> c(P). eq c(X 1 Y)= 
> s c(X Y). eq c(L)= 0[owise]. endm
Maude> red n(0 0 0 0) .
result [NatList]: n(0 0 0 0)
Maude> red n(1 1 0 1 0 1 0 1 1 0) .
result [NatList]: n(1 1 0 1 0 1 0 1 1 0)
Maude> red n(1 1 1 1 0 1 1 0 1 1 0 0 1 0 0) .
result [NatList]: n(1 1 1 1 0 1 1 0 1 1 0 0 1 0 0)
Maude> red n(1 1 1 0 1 0 1 0 1 1 0 1 1 0 0 1 1 0 0 0) .
result [NatList]: n(1 1 1 0 1 0 1 0 1 1 0 1 1 0 0 1 1 0 0 0)
Maude> red n(1 1 1 0 0 1 0 1 1 0 1 0 0 1 1 1 0 0 1 0 0 0 0 1 1) .
result [NatList]: n(1 1 1 0 0 1 0 1 1 0 1 0 0 1 1 1 0 0 1 0 0 0 0 1 1)
Maude> red n(0 0 0 0 1) .
result NzNat: 1
Maude> red n(1 0 1 1 0 1 1 0 0 0) .
result NeNatList: 1 1
Maude> red n(1 1 0 1 0 1 1 0 1 1 0 0 1 0 0) .
result NeNatList: 1 1 0 1 1
Maude> red n(1 1 0 1 0 1 0 0 0 0 1 1 0 0 0 0 1 1 0 1) .
result NeNatList: 1 1 0 0 0 0 1 1 0 1
Maude> red n(1 1 1 0 1 0 0 1 0 0 1 1 0 1 0 1 0 1 0 0 1 0 1 1 1) .
result NeNatList: 1 0 1 0 0 1 0 1 1 1
Maude> quit
Bye.
```
### Ungolfed
```
mod P is
    pr NAT-LIST .
    var L P F X Y Z : [Nat] .
    ops n c : Nat ~> Nat .
    ceq n(L) = F if P X 2 Y F Z := L 2 L /\ size(P) = size(F) /\ c(F) > c(P) .
    eq c(X 1 Y) = s c(X Y) .
    eq c(L) = 0 [owise] .
endm
```
We use Maude's strong pattern matching and conditional equations to try every possible prefix and sublist. The `c` function counts the number of `1`s in a list.
Interesting note: If the input term is reducible, the result will be a witness sublist with more `1`s than the prefix of the same length. It did not cost any extra bytes to do so.
The `[owise]` attribute does not *seem* to be needed in the current Maude 3.1 interpreter (the interpreter seems to prefer earlier equations over later ones), but Maude's definition of an “admissible functional module” requires it. Otherwise we could save 6 bytes by omitting it.
[Answer]
# [Python 3](https://docs.python.org/3/), ~~91~~ 79 bytes
```
lambda s:any(sum(s[:i-j])<sum(s[j:i])for i in range(len(s)+1)for j in range(i))
```
Take as input a list of integers.
Return `False` for prefix normal and `True` for prefix not normal
Thanks `@UnrelatedString` for -12 bytes using list of integers instead of strings
[Try it online!](https://tio.run/##jVJBDoIwELz3FRtOrZak1RsRP4LE1AhaAoVQPPB6VCBQSokmTdPd7czObLZqm2epjl0aXrpcFLe7AB0I1WL9KrCOAulnMTkNQRbImKRlDRKkglqoR4LzRGFN9rzPZ3NeEtI1iW6uqqwLkYcRihiF@cQURZwC7yPr5os6tyrGYwItv7sZVzjuEGPxWnxsKcjMz9UPWYzQ6H3LPx9bbsnbmM8f/tlKssOwxeeeHnONy9nBlDX6n9bEWIIAQVVL1WBJwQvPHoX0uycIDVnP93YHRtbYH/juDQ "Python 3 – Try It Online")
]