Current location - Education and Training Encyclopedia - Graduation thesis - Computer simulation problem
Computer simulation problem
Category: Computer/Network

Problem description:

Shooting hit rate problem

In one of our border areas, the enemy destroyed us with a battery (including two guns). In order to avoid our attack, the enemy disguised his position and often changed the shooting location. After long-term observation, it is found that our command post's instructions to enemy targets are 50% accurate, while our firepower unit, under the correct instructions, has a shooting effect of 1/3, which can damage an enemy gun. The shooting effect of 1/6 can completely destroy the enemy. Now calculate the results of our 20 attacks on the enemy, determine the effective shooting ratio and the average value of destroying enemy artillery.

Find the expression form of mathematical model, simulation calculation method, program and calculation result.

Analysis:

50%*( 1/3) is the probability of destroying only one enemy artillery, and then *20 is the average number of times (3.33 times).

50%*( 1/6) is the probability of destroying a gun platoon, and then *20 is the average total number of times of destruction (1.67 times).

The probability of complete fire is 50%+50% * (1-1/3-1/6), and *20 is the average (15 times).

Tip: Based on this, programming can set the 65438th +0 and the 2nd probability as variables A and B, the accuracy is P, and the number of transmissions is N, and then write the functions of the required results respectively, so all of them are set as variables to improve the code reuse rate.

You can contact QQ: * * * * * * * *, or I can simply "guide", please indicate: the dynasty knows.