staymathematicsDomain, weight refers toWeighted averageThe frequency of each number in, also known asWeightOr weight.
aboutMultibit numberThe value represented by "l" on a bit is calledPosition power. For example, tenBaseThe position right of the second position is 10, and the position right of the third position is 100;andBinaryThe bit weight of the second bit is 2, and the bit weight of the third bit is 4. For N-ary numbers,Integer partThe place weight of the ith place is N ^ (i-1), while the place weight of the jth place of the decimal part is N ^ - j
weightingaverageIt is the average of the data of different proportions, and the weighted average israw dataCalculated in reasonable proportion,
ifAmong them,appearTimes,appearTimes,appearTimes, then
be called,,…,The weighted average of.,,…,yes,,…,Weight value of.
Give 3 simple examples:
1. In the school canteen, x people eat three bowls, y people eat two bowls, and z people eat one bowl.How much does the average person eat?
(3×x + 2×y + 1×z)/(x + y + z)
Here, x, y and z are weight values respectively“weighting”It refers to the proportion of different variables in the population.
2. Your score in the quiz is 80 points, and your score in the final exam is 90 points. The teacher should calculate the total average score according to the proportion of 40% in the quiz and 60% in the final exam, so your average score is:
(80×40%+90×60%)/(40%+60%)=86
3. A person shoots ten times, among which two shots hit 10 rings, three shots hit 8 rings, four shots hit 7 rings, and one shot hit 9 rings. Then the average number of rings he shoots is:
(10×2+8×3+7×4+9×1)/10 = 8.1
Here, the four numbers 7, 8, 9, and 10 are the number of different rings shot by the shooter, but their frequencies are different, namely, 4, 3, 1, and 2. The higher the frequency of the data, the more important it is for the whole group of dataaverageThe greater the impact, in fact, frequency plays a role in weighing data, which is called weight or weight.
In the field of computer data structure, the weight value is the value on the path of two nodes in a tree or graph. This value indicates a cost, such as the length of the path from one node to another, the time spent, and the cost paid.
as forHuffman tree The weight value in can be understood as: a large weight value indicates a high probability of occurrence!
The weight value of a node is actually this nodesubtreeProportion in the whole tree
abcdFourleaf node The weight value of abcd is 7, 5, 2, 4, which is based on the actual situation. For example, the number of occurrence of four letters of abcd in a text is 7, 5, 2, 4The weight value of node a is 7, which means that node a occupies 7 in the system.In fact, it can also be transformed intopercentageBut it is troublesome. In fact, it is the same.
The weight value is that the router passes throughpath choice The algorithm generates a number for the path on the network.The router determines the best route according to this value.In general, the smaller the weight, the better the path.
The most commonly used weights of routers are:
Bandwidth: the data capacity of the link.
Delay: The time required to send data packets from the information source to the destination.
Load: The amount of activity on network resources, such as routers or links.
Reliability: usually refers to the error rate of each network link.
Hop count: the number of hops when a packet passes through the output port of a router.
Ticks: the data link delay counted by ticking the IBM PC clock (1/18 second, about 55 milliseconds).
Cost: refers to any value, usually bandwidth based, line based lease fees or other units, which are specified by the network administrator.