library(shiny)

ui <- fluidPage(
  sliderInput("n", 
              label = "n", 
              value = 10, min = 1, max = 25),
  sliderInput("p", 
              label = "p", 
              value = 0.2, min = 0, max = 1),
  plotOutput("pdfPlot")
  )

server <- function(input, output) {
  output$pdfPlot <- renderPlot({
    plot(0:input$n, dbinom(0:input$n, input$n, input$p), 
         type = "h",
         xlab = "Anzahl Treffer",
         ylab = "Wahrscheinlichkeit"
        )
    })
}

shinyApp(ui = ui, server = server)