Homework Solution: (Please write R code script) Use ‘sample’ function to generate a random…

    (Please write R code script) Use ‘sample’ function to generate a random vector that follows a multinomial distribution with probability (0.2, 0.3, 0.5).

    Expert Answer

    exp<- sample(0:2, 10, replace = TRUE, prob = c(0.2,0.3,0.5))

    (Please transcribe R rule script) Use ‘sample’ power to beget a aimless vector that follows a multinomial arrangement with verisimilitude (0.2, 0.3, 0.5).

    Expert Solution

    exp<- scantling(0:2, 10, supply = TRUE, prob = c(0.2,0.3,0.5))
    exp

    =============
    See Output

    Thanks, suffer me apprehend if there is any doubts

    See Output using multinomial as well

    exp<- rmultinom(n=1, size=10, prob=c(0.2,0.3,0.5))
    exp
    ==========================================
    See Output using multinomial as well

    See Output using multinomial as well