Any maths / statistics whizzes here? Any maths / statistics whizzes here? - Page 4
Page 4 of 8 FirstFirst ... 23456 ... LastLast
Posts 31 to 40 of 72
  1. #31

    Godlike

    jamesbrown is a fount of knowledge

    jamesbrown's Avatar
    Join Date
    Dec 2011
    Posts
    9,536

    Default

    Quote Originally Posted by scooterscot View Post
    wasn't me chief - used r for donkeys, since uni days, along with SPSS and sometimes matlab

    I'm not a risk analyst, I'm an engineer.
    Were you at uni in 2014?



    https://www.contractoruk.com/forums/...ml#post2002494

  2. #32

    Godlike

    jamesbrown is a fount of knowledge

    jamesbrown's Avatar
    Join Date
    Dec 2011
    Posts
    9,536

    Default

    Quote Originally Posted by scooterscot View Post
    And? Never googled it before, so what?
    Keep digging, scootie.

    https://www.contractoruk.com/forums/...ml#post2002528

    Your cretinism is about to break the internet.

  3. #33

    Godlike

    jamesbrown is a fount of knowledge

    jamesbrown's Avatar
    Join Date
    Dec 2011
    Posts
    9,536

    Default

    Quote Originally Posted by scooterscot View Post
    You know full well r is just an extension of s, which is what we used back then - gwd

  4. #34

    Permie Swiss (pending)

    NotAllThere is always on top

    NotAllThere's Avatar
    Join Date
    Aug 2007
    Location
    Far away from HMRC
    Posts
    24,126

    Default

    Quote Originally Posted by scooterscot View Post
    R I use for simulations - you use what you know.
    Show us the code, or it didn't happen.
    Down with racism. Long live miscegenation!

  5. #35

    Better than AtW

    sasguru - scorchio!


    Join Date
    Jul 2005
    Posts
    36,631

    Default

    Dunno if I understood the prob but here's some R code which gives the average weeks in the order of 1850-ish.

    Code:
    nums <- c(rep(0, 1000))
    
    for (j in 1:1000){
      
      count <- 0
      people <- c(rep(FALSE, 1000))
      while (TRUE) {
        
        count <- count + 1
        
        k <-  sample(1:1000,4,replace=F)
        for (i in 1:4){
          people[k[i]] <- TRUE
        }
        
        if (all(people)) {break}
      }
        nums[j] <- count
      
    }
    
    print(mean(nums))
    Edit: Actually more like 1860-ish which kind of matches NAT.
    Edit2: Assumes sampling with replacement
    NATEdit3: Add code tags around it to make it a bit more readable.
    Last edited by sasguru; 19th April 2020 at 11:20.
    Hard Brexit now!
    #prayfornodeal

  6. #36

    More fingers than teeth

    OwlHoot is a fount of knowledge

    OwlHoot's Avatar
    Join Date
    Jul 2005
    Posts
    14,857

    Default

    Quote Originally Posted by DealorNoDeal View Post
    I tweaked a program I'm working on, for random walks in asset prices, to test this out.

    1000 people
    Each week 0.4% (4 people), selected at random, do the thing.

    Running 1000 trials...

    After 250 weeks, 633 people have done the thing at least once
    After 500 weeks, 865 people
    After 1000 weeks, 982 people

    To reach 1000 people, with a reasonable confidence level, I had to extend the number of weeks to 4000.
    I think jamesbrown had the soundest algebraic approach.

    The probability, P, of any given person not doing the "thing" after n weeks is given by P = (1 - 1/250)^n

    Equating that to, say, 1/250 and taking logs gives n = 1377 (to the nearest integer). But you could choose any (small) value to represent the near certainty of any given person doing "it", and the values of n increase rapidly as P tends to zero.
    Last edited by OwlHoot; 19th April 2020 at 14:02.
    Work in the public sector? Read the IR35 FAQ here

  7. #37

    More fingers than teeth

    OwlHoot is a fount of knowledge

    OwlHoot's Avatar
    Join Date
    Jul 2005
    Posts
    14,857

    Default

    Quote Originally Posted by scooterscot View Post

    The solution may be solved using a deterministic approach, you've got everything you need. No need for a probabilistic approach, assuming inputs are not changing with each new week.
    Well the OP didn't mention probability, true, but that was inferred as he mentioned thinking "It isn't as simple as 1000 / 0.04".

    Also, no mention was made of whether or not this "thing" can be done more than once. So we don't necessarily have all we need.

    But, say there were N people in a prison and the "thing" was getting shot by a sadistic guard who chose 0.04 of the inmates at random to shoot each day. Even then there is some ambiguity, because as ladymuck pointed out in so many words (I think? ) we aren't told whether the number shot is 0.04 * N each day or 0.04 of the surviving prison population, which is decreasing daily.
    Last edited by OwlHoot; 19th April 2020 at 18:04.
    Work in the public sector? Read the IR35 FAQ here

  8. #38

    Better than AtW

    sasguru - scorchio!


    Join Date
    Jul 2005
    Posts
    36,631

    Default

    Quote Originally Posted by scooterscot View Post
    The solution may be solved using a deterministic approach, you've got everything you need. No need for a probabilistic approach, assuming inputs are not changing with each new week.
    Feck off, you fraud.
    Hard Brexit now!
    #prayfornodeal

  9. #39

    More time posting than coding

    Lost It has more data than eek


    Join Date
    Jan 2016
    Location
    Hayling Island
    Posts
    385

    Default

    There's Lies.

    There's damned Lies.

    Then there's Statistics.

  10. #40

    I live on CUK

    Old Greg is always on top

    Old Greg's Avatar
    Join Date
    Mar 2007
    Location
    The Tombliboo Bush
    Posts
    28,675

    Default

    Quote Originally Posted by Lost It View Post
    There's Lies.

    There's damned Lies.

    Then there's Statistics.
    Then there's Pooperscooper.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •