Qing North School dp graph theory Camp Travel day4

 

Still zhx speak.

We talked about probability and expectation:

Expectations: The average size of the event results. Denoted by E (x).

The product of E (x) = probability of each outcome and its size.
For example, note the number of points for throwing a dice x
E(x)=1*(1/6)+2*(1/6)+3*(1/6)+4*(1/6)+5*(1/6)+6*(1/6)=7/2
If c is a constant, then:
E(x+c)=E(x)+c,E(c*x)=c*E(x)。
If you remember the result of two events respectively x, y, so they naturally satisfy the following properties:
E (x + y) = E (x) + E (y)
For example: E (+ language scores in math) = E (language scores) + E (math)
If two events are independent, E (x * y) = E (x) * E (y)
E (language scores in math *) = E (language scores) * E (math)
Among them, the first property in any case meet the second event must meet the independence!
 
Probability and expectation calculations
Calculation of probability and expected to have a common computing skills:
If all program events generated are equally probable, then some probability can be converted to the desired
A counting problem, and then divided by the total number of programs can be calculated.
The probability of the event meet demand condition A, is converted to counting the number of compliance problems A scheme; if
Evaluating the value of a certain expected value, then converted to the count value of the sum of the problems all programs.
emmmmm. . . For chestnut qwq
Expected probability may also be calculated by means of equations.
There are four cards that read 0,1,2,3, and each pulled out a back, repeatedly pumping, 0 out of date. ask
Expectations extracted number of times.
Set number of extraction is x, then: x = 1 + x * 3/4
x=4。
 
On the topic:

 

 
 

 

 

For the probability of each side, walked to

Then the probability of each point shall be

So the answer is:

 

 

 

The slope optimization:

 

Universal Code apply: d +

Farewell Zhao and Xu qwq. End of the morning spicy.

 

Afternoon, welcome Yang Siqi .

A put poj (p-European access) to read fairy poj (p Euro hook) of.

Graph Theory:

 

 side:

老师准备的很认真,开始知识很基础(shui)。

点权:赋给点的数值。

边权:赋给边的数值。

负权:边的权值为负。

有向无环图:dag(大哥)。

树:不用解释。。

完全图:任意两个点间都有一条直接相连的边。

竞赛图:有向边(版本)坂本的完全图

基环树:在树(n个节点,n-1条边)的基础上,任意加一条边(n个节点,n个边),有且仅有一个简单环。

仙人掌:存在环,但是任意一个边不属于两个环的图

邻接矩阵存图:

链式前向星(邻接表存图)

安利自己博客

图的遍历:

二叉树遍历:

思路:构建最短路图并统计入度,如果入度大于1,就不影响。等于一,一定会影响。

裸拓扑排序。跑的时候判个环就行

 

 上最短路:

分为全局(floyd)最短路,单源(dij,spfa)最短路。

dij:

spfa:

今天就这样了,后半天还挺水的。。。。。

完结。

Guess you like

Origin www.cnblogs.com/lbssxz/p/11328998.html