[Question]
  [
## Flavortext
The [Bystander Effect](https://en.wikipedia.org/wiki/Bystander_effect) is a phenomenon where individuals are less likely to help a victim if other people are present. The idea is that as there are more people around, the individual burden is less, and each individual thinks "someone else will help them", which results in the counterintuitive fact that fewer people will help when there are more people.
(This is why if you're in public and something bad happens and you / someone else needs help, you should address random individuals ("you in the red shirt") to help specifically rather than "someone please help" to bypass this psychological phenomenon)
Let's take a very simplified interpretation of this theory and assume everyone has a numerical threshold for helping.
## Specification
A list of people will be given, each with a threshold to help. The threat level is 1. A person will help if and only if the threat level divided by the number of people in the crowd is greater than equal to their threshold. When a person decides to help, they leave the crowd. This means that the individual threat, which is the threat level (1) divided by the size of the crowd, is now higher as a result because the crowd is smaller.
The total threat level (1) never changes, for simplicity.
How many people end up helping?
## Input
You are given a list of floating point numbers in any reasonable format. This list will be non-empty, and every number will be in the inclusive range from 0 to 1. You may assume the list is sorted in either order you would like.
## Output
You are to output a single integer, indicating how many of the individuals decide to help.
## Example
Consider the test case `0.2, 0.2, 0.3, 0.6, 0.8`. The crowd has five people, so the threat to each individual is 0.2. Therefore, the first two people will help. Now, the crowd is `0.3, 0.6, 0.8`. Since there are only three people, the threat to each individual is now 0.3. Therefore, the third person will now decide to help. The crowd is now `0.6, 0.8`, so the individual threat is 0.5, and nobody decides to help anymore. Therefore, the final result is `3`.
## Test Cases
```
1                        -> 1
0.5, 0.8                 -> 2 # 0.8 initially won't help, but will when 0.5 leaves
0.2, 0.2                 -> 2 # both will help initially
0.2, 0.2, 0.3, 0.6, 0.8  -> 3 # 0.2 and 0.2 leaving prompts 0.3 to help, but the other two won't help
0, 0.25, 0.33, 0.5, 1    -> 5 # all of them help only after the previous person left, starting with 0
0, 0.25, 0.34, 0.34, 1   -> 2 # 0 and 0.25 help, but 0.34 is just a bit too indifferent to help, which means 1 will never help either
0.5, 0.5, 0.5            -> 0 # nobody helps. RIP
```
## Reference Implementation
[This implementation](https://tio.run/##jZExb4MwEIXn@FecmEBFlDTNUikdO3aouqEMTjiC1YttgaOUX0/vgiEZuxiM33v@7uGH0Dq7GUePzhPCDsj0IT1rnzbkdMjBWH8JaVb0ngw/s0ypFslj17O4VCq0HerA72ulrq3hjCnqTa2Mrc0RRVft1apxHYfV@JuDuJ3lHaC9nLHTAdPJlbFtZRqIqc9AaOcjeN9Fp4jm9EJ7j7ZOb9GZHMx4T8IkYQuHgIjXd8aGNPl0B1cPgNQjXA0RiLNIJOTA1/@oWfjdIjSOyF2NPcX57g6GNT0chyMPneRQTefVDWgPy9gybiTZ8xVL4VVs43/9wDQPx1kXHiMX2C88a2PvoML00CL/vyj8MFYTdNhfKIgo9pZDEtluH2ouZBxLWENZvGx52bzysv0D) (Python) shows the final answer at the very end. It also breaks down the process stage-by-stage.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~9 8~~ 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
(Saved 1 when the assumption of sorted input was allowed, and another realising there was no need to floor the inverses.)
```
İ<Jṣ1ṪL
```
A monadic Link accepting a list of floating-point numbers in \$[0,1]\$ sorted in descending order that yields an integer.
**[Try it online!](https://tio.run/##y0rNyan8///IBhuvhzsXGz7cucrn////0YY6CgZ6xiYI0sgUSMYCAA "Jelly – Try It Online")** Or see the [test-suite](https://tio.run/##y0rNyan8///IBhuvhzsXGz7cucrn/@H2R01r/v@PjjaM5dKJNtCz0FEw0DOFsI1AbCMkcTMQYQwWhUsZgjWAJSAyIDZcwtgEQUJlYgE "Jelly – Try It Online").
### How?
Effectively this evaluates how many people need to be in the crowd to stop each person helping, identifies crowd sizes that would be too big for anyone to help if those most likely to help have been removed, then counts those in excess of the biggest of those crowd sizes.
```
İ<Jṣ1ṪL - Link: list of thresholds, T  e.g. [1, 0.34, .34, .25, 0]
İ       - inverse (T)                       [1, 2.94, 2.94. 4, inf]
  J     - range of length (T)               [1, 2, 3, 4, 5]
 <      - less than?                        [0, 0, 1, 0, 0]
   ṣ1   - split at ones                     [[0, 0], [0, 0]]
     Ṫ  - tail                              [0, 0]
      L - length                            2
```
---
Equivalently:
```
İ<JṚÄċ0
   Ṛ    - reverse                           [0, 0, 1, 0, 0]
    Ä   - cumulative sums                   [0, 0, 1, 1, 1]
     ċ0 - count zeros                       2
```
[Answer]
# [J](http://jsoftware.com/), 13 bytes
*-2 thanks to Jonah!*
```
-&#(#~%<#)^:_
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/ddWUNZTrVG2UNeOs4v9rcqUmZ@QraFinaSoYIrEN9EyB2AJFxAiEMUWA2BiIzdDVKxiCZEHGGIPkTXHImYCJ/wA "J – Try It Online")
```
-&#(#~%<#)^:_
   (     )^:_ until result does not change
      %<#     (1 % element) smaller than length of the list
    #~        filter out other elements
-&#           length(original list) - length(filtered out list)
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
Lİ<SɗƬạLṪ
```
[Try it online!](https://tio.run/##y0rNyan8/9/nyAab4JPTj615uGuhz8Odq/4fbn/UtCby///oaMNYHYVoAz1THQUDPQsI2wjENkJmgwhjEGGGUKajYAiWA@s0BsuaYpEwgZBItkCI2FgA "Jelly – Try It Online")
Does not assume sorted input. :/
Since shrinking the crowd never makes anyone not help, this calculates the new crowd size from the previous one until nobody new leaves.
```
     Ƭ       Loop until a fixed point, starting from
L            the length of the input:
  <Sɗ        how many elements of the input are strictly greater than
 İ           the reciprocal?
      ạL     Subtract each intermediate result from the length of the input,
        Ṫ    and return the last one.
```
Uses `Ƭ ... Ṫ` instead of `ÐL` because `ÐL` passes the previous left argument as the right argument rather than reuse the original right argument, given a dyad.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
×JỊẠÐƤS
```
[Try it online!](https://tio.run/##y0rNyan8///wdK@Hu7se7lpweMKxJcH/H@5cFHq4XfP//2jDWB2FaAM9Ux0FAz0LCNsIxDZCZoMIYxBhhlCmo2AIlgPrNAbLmmKRMIGQsTrRQDvAKBYA "Jelly – Try It Online")
Assumes the input is sorted descendingly (thanks to [@caird](https://codegolf.stackexchange.com/users/66833/caird-coinheringaahing)). 8 bytes without that assumption:
### [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
JU×ṢỊẠƤS
```
[Try it online!](https://tio.run/##y0rNyan8/98r9PD0hzsXPdzd9XDXgmNLgv8fbn/UtOb//2jDWB2FaAM9Ux0FAz0LCNsIxDZCZoMIYxBhhlCmo2AIlgPrNAbLmmKRMIGQsTrRQDvAKBYA "Jelly – Try It Online")
The idea here is that if we consider the sorted list, once anyone doesn't go, nobody after them will go either. Furthermore, considering an individual, they will only go if everyone *before* them went, so their individual condition for helping is `1/reversed_index > threshold`, i.e. `threshold * reversed_index < 1`.
Thus:
```
JU       ' [len(l)..1], i.e. reversed index
  ×Ṣ     ' times the sorted values
    Ị    ' <=1
     ẠƤ  ' map 'all' over prefices, results in 1s over the prefix of helpers
       S ' sum
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~16~~ 13 bytes
```
ＩＬ⊟⪪⭆Ａ›×ι⊕κ¹1
```
[Try it online!](https://tio.run/##LYo9C8IwFAB3f0XGF4ilVRCho0MXLRncSodQHiaQD01e9OfHRFyO47hNq7gFZUv5aGORwRwIpoiKMMLdOExwM9647ODFBbuif5CuWn3gnDOZk4YsmAzPVsedjMYTXFQi@M@5fmMpy9J3Z8H67tRwbDj8sK5l/7Zf "Charcoal – Try It Online") Link is to verbose version of code. Requires input sorted in descending order. Edit: Saved 3 bytes after following @DominicvanEssen's advice. Explanation:
```
     Ａ          Input array
    ⭆           Map over elements and join
          κ     Current index
         ⊕      Incremented
       ×        Multiplied by
        ι       Current value
      ›         Is greater than
           ¹    Literal `1`
   ⪪            Split on
            1   Literal string `1`
  ⊟             Pop last element
 Ｌ              Length
Ｉ               Cast to string
                Implicitly print
```
[Answer]
# JavaScript (ES6), 39 bytes
Essentially the same answer as below but it assumes that the input is sorted from lowest to highest, which is now allowed.
```
a=>(n=a.length)-(a.map(k=>n-=k*n<=1),n)
```
[Try it online!](https://tio.run/##lc6xDsIgEAbg3adgBFNoAWscpC9iHC6VVi0ejW18fRSiHWxj4g1/bvhy91/hAUN9v/QjR3@yoTEBTEXRgHAW2/HMOAVxg552pkJuujXujWQZslB7HLyzwvmWNvQgyeIcGSN5TuTqixeizEghdstczbmKXP3JY@gY2/TszfWMJ5wK6cRfq5yul7/45pNyKhOe "JavaScript (Node.js) – Try It Online")
---
# JavaScript (ES6), 46 bytes
```
a=>(n=a.sort().length)-(a.map(k=>n-=k*n<=1),n)
```
[Try it online!](https://tio.run/##lc7BDoIwDAbgu0@x42rGYEOMB8uLGA8LAirYEUZ8/ZlNw0FIjD38p6/tfzdP46rxNkwJ2UvtG/QGS05opLPjxEH2NbXTFRJu5MMMvMOSEuy2dEQFgsBXlpzta9nbljf8pNjqnAFYmjK1@eKZLATL5GGd6yXXges/eYg8xD4@@/B8wQVT0cdOedwo5uvFD75751zGvwA "JavaScript (Node.js) – Try It Online")
### Commented
```
a =>               // a[] = input
  ( n = a.sort()   // sort the input; although the sort is in lexicographical
                   // order, it's OK for floats in [0, 1]
        .length    // initialize n to the length of the array
  ) - (            //
    a.map(k =>     // for each value k in a[]:
      n -=         //   decrement n if:
        k * n <= 1 //     k * n is less than or equal to 1
    ),             // end of map()
    n              // subtract the new value of n from the original value
  )                //
```
[Answer]
# [R](https://www.r-project.org/), ~~56~~ 44 bytes
*Edit: saved 12 bytes after looking at [Jonathan Allan's answer](https://codegolf.stackexchange.com/a/223733/95126): please upvote that!*
```
function(c,d=sum(c|1))match(T,1/c<d:1,d+1)-1
```
[Try it online!](https://tio.run/##hVJfa4MwEH/vpzjYw5TZztg5xlj3vrcx9l6ixiVDc2LOSmHfvbtESmW0XR7uBHO/f5f@oHHcttLut6Npmq1WTbc51IMtyaCNyqTauKGNyh8Rx62kUkefibgvX6pnkVR3Il6KMwBRGQk4f@IYbmD5CmJxdixd5Qmkq6dLYxk3/9tYQ0Y2zR5GtLcEfjyBYiDwaDBqZfleDo2SO@UucWWeK7vGVSDpCdIPnWivI/qy9uVxMnNEXAf1GUhbhe7VGfsFXY9tR85PAeHMDGkFrED1QCPOrF6gD@QhwHWg508xM5RzY/GAtQduJ0toOURZk@dgtq5XO4ODg071Di1LrCkBR7Inr3Q0nEf6P/3DsYo/uzt6z2cu/U0wDr4HRyChMGwckcOuTF2rXlk6pTJqU2polbSOscNmrNqx@GBGGR/W1ac1lTPrTrlZLLDaByy3go@398XhFw "R – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 34 bytes
```
LengthWhile[#,l=Tr[1^#];1>=l--#&]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b73yc1L70kIzwjMyc1WlknxzakKNowTjnW2tDONkdXV1ktVu1/QFFmXkm0sq5dmoNyrFpdcHJiXl01V7VhrQ5XtYGeqY6CgZ4FhG0EYhshs0GEMYgwQygDS4C1GYOlgExDdAkTGIlsC4So5ar9DwA "Wolfram Language (Mathematica) – Try It Online")
Requires input to be sorted, least to greatest.
---
Iteratively, 35 bytes:
```
0//.x_:>Tr@UnitStep[x#-Tr[1^#]#+1]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b730BfX68i3soupMghNC@zJLgktSC6Qlk3pCjaME45VlnbMFbtf0BRZl5JtLKuXZqDcqxaXXByYl5dNVe1Ya0OV7WBnqmOgoGeBYRtBGIbIbNBhDGIMEMoA0uAtRmDpYBMQ3QJExiJbAuEqOWq/Q8A "Wolfram Language (Mathematica) – Try It Online")
No sorting requirements.
[Answer]
# [Haskell](https://www.haskell.org/), 33 bytes
```
f(x:y)|sum(x<$x:y)<=1=1+f y
f _=0
```
[Try it online!](https://tio.run/##dZFBj5swEIXv@RWj7EoBQSiQpqqisKdeKvVQ9bpaVaaMF7fGRngIQep/T8dOsptWXQ6DwfPefM9uhfuFWp9OMjru5vi3G7vouL/3631VVEUiYV5I@F7lp04oUzV2ARCp1Mb7texEHzWD7aGMM9cLE72rVutVnElHL993q3h///CM9EUZZK1GgmM1oGii5eMySVSSLJ@W8W73@MmOtcanS88MFfgu8AP7QRmKJAurOT2mc8z/PM6pgDee9QMUizzbppBnH/@3W8Jd2FJGkRJazzBZsyJoUfcp1CPBpLSGqUXDfVtmEgd0bFl6y/Ity9pSe1Z6o1f3F6EvG18@XNBYuAksJQjThLefpcwzx7ZdT84rgOwNGrUIPAgHoMnegC/yMCOk3oQpvCwueFuewihgpdd3Z0BrOLmQ5K3YtB/woOzooMfBWcMkklJwJAbyQJPidPlfU95fa3Fzrtck2xtm3wXKwc/REQioFcewlk@oUVLigIZeM06t@tFCh8I49g3HafDAjIEZlY9@vd1z@ecqcqYwtrbNHCQug2@fv/4B "Haskell – Try It Online")
The relevant function is `f`, which takes as input the list of tolerances in increasing order.
## How?
The only trick I think it's worth showcasing is the `sum(x<$x:y)` part. Its job is to compute `x*length(x:y)`, but:
1. it's 2 bytes shorter, and
2. since `x` is a `Double` and `length` returns an `Int`, Haskell would complain if we tried to multiply them together; to fix this issue, the monstrosity we would need is `x*toEnum(length$x:y)`, which is 9 bytes longer than `sum(x<$x:y)`.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
×Ị¥ÐḟL$ÐLLạL
```
[Try it online!](https://tio.run/##y0rNyan8///w9Ie7uw4tPTzh4Y75PiqHJ/j4PNy10Of/4fZHTWv@/482jNVRiDbQM9VRMNCzgLCNQGwjZDaIMAYRZghlOgqGYDmwTmOwrCkWCRMIGQsA "Jelly – Try It Online")
```
×Ị¥ÐḟL$ƬẈ.ịI
```
[Try it online!](https://tio.run/##y0rNyan8///w9Ie7uw4tPTzh4Y75PirH1jzc1aH3cHe35//D7Y@a1vz/H20Yq6MQbaBnqqNgoGcBYRuB2EbIbBBhDCLMEMp0FAzBcmCdxmBZUywSJhAyFgA "Jelly – Try It Online")
```
×Ị¥ÐḟL$ƬẈạLṪ
```
[Try it online!](https://tio.run/##y0rNyan8///w9Ie7uw4tPTzh4Y75PirH1jzc1fFw10KfhztX/T/c/qhpzf//0YaxOgrRBnqmOgoGehYQthGIbYTMBhHGIMIMoUxHwRAsB9ZpDJY1xSJhAiFjAQ "Jelly – Try It Online")
Go upvote [Jonathan Allan's](https://codegolf.stackexchange.com/a/223733/66833) or [Unrelated String's](https://codegolf.stackexchange.com/a/223734/66833) answers, they're much better.
## How they work
```
×Ị¥ÐḟL$ÐLLạL - Main link. Takes a list L on the left
      $ÐL    - Repeat the previous 2 links until it reaches a fixed point:
     L       -   Yield the length of the list
  ¥Ðḟ        -   Remove elements which return false under the previous 2 links:
 Ị           -     They are less than or equal to 1 when
×            -     multiplied by the length
         L   - Get the length of the fixed point
           L - Get the length of L
          ạ  - Absolute difference
×Ị¥ÐḟL$ƬẈ.ịI - Main link. Takes a list L on the left
      $Ƭ     - Repeat the previous 2 links until it reaches a fixed point. Return all steps:
     L       -   Yield the length of the list
  ¥Ðḟ        -   Remove elements which return false under the previous 2 links:
 Ị           -     They are less than or equal to 1 when
×            -     multiplied by the length
        Ẉ    - Lengths of each step
         .ị  - Get the first and last
           I - Subtract them
×Ị¥ÐḟL$ƬẈạLṪ - Main link. Takes a list L on the left
      $Ƭ     - Repeat the previous 2 links until it reaches a fixed point. Return all steps:
     L       -   Yield the length of the list
  ¥Ðḟ        -   Remove elements which return false under the previous 2 links:
 Ị           -     They are less than or equal to 1 when
×            -     multiplied by the length
        Ẉ    - Lengths of each step
          L  - Length of L
         ạ   - Absolute differences
           Ṫ - Get the last one
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~72~~ \$\cdots\$ ~~43~~ 42 bytes
Saved 7 bytes thanks to the man himself [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld)!!!  
Saved ~~3~~ 4 bytes thanks to [dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper)!!!
```
f=lambda l:l>[]>1>=len(l)*l.pop()and-~f(l)
```
[Try it online!](https://tio.run/##bY/BTsQgEIbvfYpJTAMY2mxZ12ya0Kfw1vRQ26nbiJQAa9SDT@DNq77cvkgFVqMHCfnzZ/5vZsA8@8OixXoBwzLO@q6Go5@K/TpJ1T/cjj2oWjVt11SNVKipYpeqNIuhrNdj8TqFwurReQcSaFt1HNpNueOwKfdnL6IXf32UbZTrX4xDlbLUuU3p7p/g6qwdy/DJ4OBxjGsDIdINfYETLBsOONyjjSE5fb4RDuT08U5YNi0WPEeYNbzMhqaXc/gZxuoMwol/mahbbChRzy0@onUob@wRGUuEsbP2QHIHRQNBc0cgh8BCmPa9vEUpXcfWLw "Python 2 – Try It Online")
Assumes the input is sorted from highest to lowest.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 13 bytes
```
>Lİ$x@ƊÐLL_@L
```
```
>Lİ$x@ƊÐLL_@L
>Lİ$          arg is greater than 1/len(arg)
    x@        filter (finds people left)
       ÐL     apply until converged
         L_@L length of argument minus length
```
[Try it online!](https://tio.run/##y0rNyan8/9/O58gGlQqHY12HJ/j4xDv4/D/c/qhpjfv//9HRhrE6CtEGeqY6CgZ6FhC2EYhthMwGEcYgwgyhTEfBECwH1mkMljXFImECIWNjAQ "Jelly – Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 15 bytes
```
l-Qu.xf<c1lGTGY
```
[Test suite](http://pythtemp.herokuapp.com/?code=l-Qu.xf%3Cc1lGTGY&test_suite=1&test_suite_input=1%0A0.5%2C+0.8%0A0.2%2C+0.2%0A0.2%2C+0.2%2C+0.3%2C+0.6%2C+0.8%0A0%2C+0.25%2C+0.33%2C+0.5%2C+1%0A0%2C+0.25%2C+0.34%2C+0.34%2C+1%0A0.5%2C+0.5%2C+0.5&debug=0)
Explanation:
```
l-Qu.xf<c1lGTGY  | Full program
l-Qu.xf<c1lGTGYQ | with implicit variables
-----------------+------------------------------------------------------------------------------
      f      G   | filter the list G for elements T such that
        c1lG     | 1 / length of G
       <    T    | is less than T
    .x        Y  | unless an error is thrown in which case return the empty list
   u           Q | repeat the above until a previous result is repeated, starting with the input
l-Q              | length of input with the elements of the resulting list removed
```
]