Brain Teaser Solver

버전 1.1.0.0 (2.23 KB) 작성자: Rodolphe Sitter
Brain Teaser Solver: Compute the expected time to get a given sequence of independent outcomes.
다운로드 수: 1K
업데이트 날짜: 2009/3/30

라이선스 보기

The function OutcomeSequence.m solve brain teasers such as:

1. You toss a coin, what is the expected number of tosses for you to get the sequence 'Tails-Heads-Tails' ?

2. You throw a dice, what is the expected number of throws for you to get the sequence '1, 2, 3, 2, 1' ?

3. You randomly hit your keyboard, what is the expected number of keys you have to hit to get the sequence 'ABRACADABRA' ?

4. You play one poker game everyday. Assume you are likely to win 1 out of 4 games you play. What is the expected number of days you have to play to win 3 times in a row ?

Function details:
OutcomeSequence(Sequence, N_Outcomes)

Inputs:
- Sequence: sequence (row vector) of numbers representing the different possible outcomes. The occurrence times of those outcomes are assumed to be I.I.D. random variables, i.e. the outcomes occur independently of each other and are equally likely to happen.
- N_Outcomes: number of different possible (independent) outcomes.

Output:
- Expected_Time: expected time to get the input sequence of outcomes. This time would correspond to a number of tosses of a coin, throws of a dice and so on depending on the problem considered.

인용 양식

Rodolphe Sitter (2025). Brain Teaser Solver (https://kr.mathworks.com/matlabcentral/fileexchange/23478-brain-teaser-solver), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Strategy & Logic에 대해 자세히 알아보기
도움

도움 받은 파일: Kernel Smoothing Regression

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

more examples in comments

1.0.0.0