Skip to content
    Open navbar menu
    Sign UpLog In

    Community

    #java
    Cubicle
    Profile picture for polymathematicspolymathematics
    Seance AI
    Profile picture for aestudioaestudio
    voicePerfect
    Profile picture for MartinBowlingMartinBowling
    Explore the Community HubSubmit a Deployment
    Community Hub
    Submit Deployment
    TOP TAGS
    #python
    #javascript
    #ai
    #apps
    #html
    #fun
    #game
    #simple
    #python3
    #java
    #cpp
    #bash
    #Css
    #c
    KaiYi3
    KaiYi3
    published a Repl
    3 months ago
    0
    Expected Value Coin Flip
    Expected Value Coin FlipOn average, how many coin tosses to form the subsequence HHHHHTTTTT? If I used HHHHHHHHHH instead, would the answer change? Use this program to find out :) This program runs at around O(2^n * n * t) time, where n is the length of the string and t is the number of times you test this. Do not allow 2^n * n * t to exceed 10^9.
    Copyright © 2024 Replit, Inc. All rights reserved.
    • twitter
    • tiktok
    • instagram
    • facebook

    Replit

    Programming languages

    • Python
    • JavaScript
    • TypeScript
    • Node.js
    • Nix
    • HTML, CSS, JS
    • C++
    • Golang