???Weather Patterns
来源:互联网 发布:查看足球球员数据 编辑:程序博客网 时间:2024/06/10 18:25
Consider a system which is described at any time as being in one of a set of N distinct states, 1,2,3,...,N. We denote the time instants associated with state changes as t=1,2,..., and the actual state at time t as aij=p=[si=j ∣ si−1=i],1≤i,j≤N. For the special case of a discrete, first order, Markovchain, the probabilistic description for the current state (at time t) and the predecessor state is st. Furthermore we only consider those processes being independent of time, thereby leading to the set of state transition probability aijof the form: with the properties aij≥0 and ∑i=1NAij=1. The stochastic process can be called an observable Markovmodel. Now, let us consider the problem of a simple 4-state Markov model of weather. We assume that once a day (e.g., at noon), the weather is observed as being one of the following:
State 1: snow
State 2: rain
State 3: cloudy
State 4: sunny
The matrix A of state transition probabilities is:
A={aij}=⎩⎪⎪⎨⎪⎪⎧a11a21a31a41a12a22a32a42a13a23a33a43a14a24a34a44⎭⎪⎪⎬⎪⎪⎫
Given the model, several interestingquestions about weather patterns over time can be asked (and answered). We canask the question: what is the probability (according to the given model) thatthe weather for the next kdays willbe? Another interesting question we can ask: given that the model is in a knownstate, what is the expected number of consecutive days to stay in that state?Let us define the observation sequence Oas O={s1,s2,s3,...,sk}, and the probability of the observation sequence O given the model is defined as p(O∣model). Also, let the expected number of consecutive days to stayin state i be Ei. Assume that the initial state probabilities p[s1=i]=1,1≤i≤N. Bothp(O∣model) and Ei are real numbers.
Input Format
Line 1~4 for the state transition probabilities. Line 5 for the observation sequence O1, and line 6 for the observation sequence O2. Line 7 and line 8 for the states of interest to find the expected number of consecutive days to stay in these states.
Line 1: a11 a12 a13 a14
Line 2: a21 a22 a23 a34
Line 3: a31 a32 a33 a34
Line 4: a41 a42 a43 a44
Line 5: s1 s2 s3 ... sk
Line 6: s1 s2 s3 ... sl
Line 7: i
Line 8: j
Output Format
Line 1 and line 2 are used to show the probabilities of the observation sequences O1 and O2 respectively. Line 3and line 4 are for the expected number of consecutive days to stay in states i and j respectively.
Line 1: p[O1∣model]
Line 2: p[O2∣model]
Line 3: Ei
Line 4: Ej
Please be reminded that the floating number should accurate to 10−8.
样例输入
0.4 0.3 0.2 0.10.3 0.3 0.3 0.10.1 0.1 0.6 0.20.1 0.2 0.2 0.54 4 3 2 2 1 1 3 32 1 1 1 3 3 434
样例输出
0.000043200.001152002.500000002.00000000
题目来源
2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
参见点击打开链接
- Weather Patterns
- ???Weather Patterns
- 计蒜客 Weather Patterns 2017icpc南宁赛区
- weather
- weather
- Weather
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 A. Weather Patterns
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 A Weather Patterns(阅读理解)
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 A Weather Patterns
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 A. Weather Patterns(阅读题)
- patterns
- patterns
- patterns
- weather glossary
- Weather Report
- googole weather
- weather jp
- Weather Forecast
- Codeforces 864E Fire【排序+背包dp】
- 设计算法将线性表中的元素分为两部分,要求左边都是奇数,右边都是偶数,时间复杂度O(n),空间复杂度O(1)
- 9.21日常总结
- 流程发起人
- 一次HTTP请求中的缓存
- ???Weather Patterns
- Jedis连接池实例
- VMProtect1.09分析
- 汇编语言程序设计知识点(第一章:进制转换)
- 三消游戏算法图文详解
- SSH免密登陆
- Git学习第三天
- Java实训课8
- Java paint与paintComponent的区别与联系