GithubHelp home page GithubHelp logo

100-prisoners-problem's Introduction

100-prisoners-problem

문제정의

100명의 죄수들은 1~100까지의 번호를 가지고 있음

1~100까지의 적힌 종이가 방 안에 들어있는 100개의 상자 안에 랜덤하게 들어가 있음

각 죄수는 방에 들어가 50개의 상자를 열 수 있음

50개를 열어 본 뒤 방을 떠나고, 방을 나온 사람은 소통 불가

100명의 죄수들이 모두 자신의 번호를 찾는다면 석방, 한 명이라도 못찾으면 모두 처형

죄수가 방에 들어가기 전까지 전략 회의 가능

솔루션: 결과적으로 승리 확률을 높이기 위해서는 자신의 번호에 해당하는 박스를 열고, 그 박스에 들어있는 내용의 순번을 따라 다음 박스를 열어보는 것이다. 이러한 과정은 결과적으로 모든 순번은 닫혀있도록 구성되어 있고, 내가 처음에 연 박스는 이 루프의 마지막 박스로부터 오게 될 것임으로 결과적으로 "본인 번호가 적힌 상자에서 시작한 것이 해당 번호가 적힌 쪽지가 존재하는 루프에 있다는 것을 보장" 한다. 즉 터무니없는 확률에서 약 30%대의 확률로 승률을 올릴 수 있다.

확률 도출

단순하게 1/2 확률로 모든 죄수가 우연하게 통과할 확률 : (1/2)^100

루프를 만들어서 모두 통과할 확률 : 1-(1/51+1/52+1/53+...+1/100) = 31.18%

루프로 해결하는 방식을 일반화한다면 약 30.7% 수렴

100-prisoners-problem's People

Contributors

allisonej avatar jmseo1216 avatar newwhy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.