Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Random Number Generator | R Loops Tutorial
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Control Flow in R

bookChallenge: Random Number Generator

Tehtävä

Swipe to start coding

Write a function that generates random numbers between 0 and 1 until one is greater than 0.95, returning the number of attempts needed.

  • Start a counter for the number of attempts.
  • Use a repeat loop to generate a random number between 0 and 1.
  • If the random number is greater than 0.95, exit the loop.
  • Return the total number of attempts.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 6
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: Random Number Generator

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

Write a function that generates random numbers between 0 and 1 until one is greater than 0.95, returning the number of attempts needed.

  • Start a counter for the number of attempts.
  • Use a repeat loop to generate a random number between 0 and 1.
  • If the random number is greater than 0.95, exit the loop.
  • Return the total number of attempts.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 6
single

single

some-alt