text:
Skip to main content

2.2: Quantification of Uncertainty via Probability Models

• Anonymous
• LibreTexts

Learning Objectives

• In this section, you will learn how to quantify the relative frequency of occurrences of uncertain events by using probability models.
• You will learn about the measures of frequency, severity, likelihood, statistical distributions, and expected values.
• You will use examples to compute these values.

As we consider uncertainty, we use rigorous quantitative studies of chance, the recognition of its empirical regularity in uncertain situations. Many of these methods are used to quantify the occurrence of uncertain events that represent intellectual milestones. As we create models based upon probability and statistics, you will likely recognize that probability and statistics touch nearly every field of study today. As we have internalized the predictive regularity of repeated chance events, our entire worldview has changed. For example, we have convinced ourselves of the odds of getting heads in a coin flip so much that it’s hard to imagine otherwise. We’re used to seeing statements such as “average life of 1,000 hours” on a package of light bulbs. We understand such a phrase because we can think of the length of life of a light bulb as being uncertain but statistically predictable. We routinely hear such statements as “The chance of rain tomorrow is 20 percent.” It’s hard for us to imagine that only a few centuries ago people did not believe even in the existence of chance occurrences or random events or in accidents, much less explore any method of quantifying seemingly chance events. Up until very recently, people have believed that God controlled every minute detail of the universe. This belief rules out any kind of conceptualization of chance as a regular or predictable phenomenon. For example, until recently the cost of buying a life annuity that paid buyers $100 per month for life was the same for a thirty-year-old as it was for a seventy-year-old. It didn’t matter that empirically, the “life expectancy” of a thirty-year-old was four times longer than that of a seventy-year-old.The government of William III of England, for example, offered annuities of 14 percent regardless of whether the annuitant was 30 or 70 percent; (Karl Pearson, The History of Statistics In the 17th and 18th Centuries against the Changing Background of Intellectual, Scientific and Religious Thought (London: Charles Griffin & Co., 1978), 134. After all, people believed that a person’s particular time of death was “God’s will.” No one believed that the length of someone’s life could be judged or predicted statistically by any noticed or exhibited regularity across people. In spite of the advancements in mathematics and science since the beginning of civilization, remarkably, the development of measures of relative frequency of occurrence of uncertain events did not occur until the 1600s. This birth of the “modern” ideas of chance occurred when a problem was posed to mathematician Blaisé Pascal by a frequent gambler. As often occurs, the problem turned out to be less important in the long run than the solution developed to solve the problem. The problem posed was: If two people are gambling and the game is interrupted and discontinued before either one of the two has won, what is a fair way to split the pot of money on the table? Clearly the person ahead at that time had a better chance of winning the game and should have gotten more. The player in the lead would receive the larger portion of the pot of money. However, the person losing could come from behind and win. It could happen and such a possibility should not be excluded. How should the pot be split fairly? Pascal formulated an approach to this problem and, in a series of letters with Pierre de Fermat, developed an approach to the problem that entailed writing down all possible outcomes that could possibly occur and then counting the number of times the first gambler won. The proportion of times that the first gambler won (calculated as the number of times the gambler won divided by the total number of possible outcomes) was taken to be the proportion of the pot that the first gambler could fairly claim. In the process of formulating this solution, Pascal and Fermat more generally developed a framework to quantify the relative frequency of uncertain outcomes, which is now known as probability. They created the mathematical notion of expected value of an uncertain event. They were the first to model the exhibited regularity of chance or uncertain events and apply it to solve a practical problem. In fact, their solution pointed to many other potential applications to problems in law, economics, and other fields. From Pascal and Fermat’s work, it became clear that to manage future risks under uncertainty, we need to have some idea about not only the possible outcomes or states of the world but also how likely each outcome is to occur. We need a model, or in other words, a symbolic representation of the possible outcomes and their likelihoods or relative frequencies. A Historical Prelude to the Quantification of Uncertainty Via Probabilities Historically, the development of measures of chance (probability) only began in the mid-1600s. Why in the middle ages, and not with the Greeks? The answer, in part, is that the Greeks and their predecessors did not have the mathematical concepts. Nor, more importantly, did the Greeks have the psychological perspective to even contemplate these notions, much less develop them into a cogent theory capable of reproduction and expansion. First, the Greeks did not have the mathematical notational system necessary to contemplate a formal approach to risk. They lacked, for example, the simple and complete symbolic system including a zero and an equal sign useful for computation, a contribution that was subsequently developed by the Arabs and later adopted by the Western world. The use of Roman numerals might have been sufficient for counting, and perhaps sufficient for geometry, but certainly it was not conducive to complex calculations. The equal sign was not in common use until the late middle ages. Imagine doing calculations (even such simple computations as dividing fractions or solving an equation) in Roman numerals without an equal sign, a zero element, or a decimal point! But mathematicians and scientists settled these impediments a thousand years before the advent of probability. Why did risk analysis not emerge with the advent of a more complete numbering system just as sophisticated calculations in astronomy, engineering, and physics did? The answer is more psychological than mathematical and goes to the heart of why we consider risk as both a psychological and a numerical concept in this book. To the Greeks (and to the millennia of others who followed them), the heavens, divinely created, were believed to be static and perfect and governed by regularity and rules of perfection—circles, spheres, the six perfect geometric solids, and so forth. The earthly sphere, on the other hand, was the source of imperfection and chaos. The Greeks accepted that they would find no sense in studying the chaotic events of Earth. The ancient Greeks found the path to truth in contemplating the perfection of the heavens and other perfect unspoiled or uncorrupted entities. Why would a god (or gods) powerful enough to know and create everything intentionally create a world using a less than perfect model? The Greeks, and others who followed, believed pure reasoning, not empirical, observation would lead to knowledge. Studying regularity in the chaotic earthly sphere was worst than a futile waste of time; it distracted attention from important contemplations actually likely to impart true knowledge. It took a radical change in mindset to start to contemplate regularity in events in the earthly domain. We are all creatures of our age, and we could not pose the necessary questions to develop a theory of probability and risk until we shook off these shackles of the mind. Until the age of reason, when church reforms and a growing merchant class (who pragmatically examined and counted things empirically) created a tremendous growth in trade, we remained trapped in the old ways of thinking. As long as society was static and stationary, with villages this year being essentially the same as they were last year or a decade or century before, there was little need to pose or solve these problems. M. G. Kendall captures this succinctly when he noted that “mathematics never leads thought, but only expresses it.”* The western world was simply not yet ready to try to quantify risk or event likelihood (probability) or to contemplate uncertainty. If all things are believed to be governed by an omnipotent god, then regularity is not to be trusted, perhaps it can even be considered deceptive, and variation is irrelevant and illusive, being merely reflective of God’s will. Moreover, the fact that things like dice and drawing of lots were simultaneously used by magicians, by gamblers, and by religious figures for divination did not provide any impetus toward looking for regularity in earthly endeavors. * M. G. Kendall, “The Beginnings of a Probability Calculus,” in Studies in the History of Statistics and Probability, vol. 1, ed. E. S. Pearson and Sir Maurice Kendall (London: Charles Griffin & Co., 1970), 30. Measurement Techniques for Frequency, Severity, and Probability Distribution Measures for Quantifying Uncertain Events When we can see the pattern of the losses and/or gains experienced in the past, we hope that the same pattern will continue in the future. In some cases, we want to be able to modify the past results in a logical way like inflating them for the time value of money discussed in "4: Evolving Risk Management - Fundamental Tools". If the patterns of gains and losses continue, our predictions of future losses or gains will be informative. Similarly, we may develop a pattern of losses based on theoretical or physical constructs (such as hurricane forecasting models based on physics or likelihood of obtaining a head in a flip of a coin based on theoretical models of equal likelihood of a head and a tail). Likelihood is the notion of how often a certain event will occur. Inaccuracies in our abilities to create a correct distribution arise from our inability to predict futures outcomes accurately. The distribution is the display of the events on a map that tells us the likelihood that the event or events will occur. In some ways, it resembles a picture of the likelihood and regularity of events that occur. Let’s now turn to creating models and measures of the outcomes and their frequency. Measures of Frequency and Severity Table 2.1 and Table 2.2 show the compilation of the number of claims and their dollar amounts for homes that were burnt during a five-year period in two different locations labeled Location A and Location B. We have information about the total number of claims per year and the amount of the fire losses in dollars for each year. Each location has the same number of homes (1,000 homes). Each location has a total of 51 claims for the five-year period, an average (or mean) of 10.2 claims per year, which is the frequency. The average dollar amount of losses per claim for the whole period is also the same for each location,$6,166.67, which is the definition of severity.

Table 2.1 Claims and Fire Losses for Group of Homes in Location A
Year Number of Fire Claims Number of Fire Losses ($) Average Loss per Claim ($)
1 11 16,500.00 1,500.00
2 9 40,000.00 4,444.44
3 7 30,000.00 4,285.71
4 10 123,000.00 12,300.00
5 14 105,000.00 7,500.00
Total 51.00 314,500.00 6,166.67
Mean 10.20 62,900.00 6,166.67
Average Frequency = 10.20
Average Severity = 6,166.67 for the 5-year period

Table 2.2 Claims and Fire Losses ($) for Homes in Location B Year Number of Fire Claims Fire Losses Average Loss per Claim ($)
1 15 16,500.00 1,100.00
2 5 40,000.00 8,000.00
3 12 30,000.00 2,500.00
4 10 123,000.00 12,300.00
5 9 105,000.00 11,666.67
Total 51.00 314,500.00 6,166.67
Mean 10.20 62,900.00 6,166.67
Average frequency = 10.20
Average severity = 6,166.67 for the 5-year period

As shown in Table 2.1 and Table 2.2, the total number of fire claims for the two locations A and B is the same, as is the total dollar amount of losses shown. You might recall from earlier, the number of claims per year is called the frequency. The average frequency of claims for locations A and B is 10.2 per year. The size of the loss in terms of dollars lost per claim is called severity, as we noted previously. The average dollars lost per claim per year in each location is $6,166.67. The most important measures for risk managers when they address potential losses that arise from uncertainty are usually those associated with frequency and severity of losses during a specified period of time. The use of frequency and severity data is very important to both insurers and firm managers concerned with judging the risk of various endeavors. Risk managers try to employ activities (physical construction, backup systems, financial hedging, insurance, etc.) to decrease the frequency or severity (or both) of potential losses. In "4: Evolving Risk Management - Fundamental Tools", we will see frequency data and severity data represented. Typically, the risk manager will relate the number of incidents under investigation to a base, such as the number of employees if examining the frequency and severity of workplace injuries. In the examples in Table 2.1 and Table 2.2, the severity is related to the number of fire claims in the five-year period per 1,000 homes. It is important to note that in these tables the precise distribution (frequencies and dollar losses) over the years for the claims per year arising in Location A is different from distribution for Location B. This will be discussed later in this chapter. Next, we discuss the concept of frequency in terms of probability or likelihood. Frequency and Probability Returning back to the quantification of the notion of uncertainty, we first observe that our intuitive usage of the word probability can have two different meanings or forms as related to statements of uncertain outcomes. This is exemplified by two different statements:See Patrick Brockett and Arnold Levine Brockett, Statistics, Probability and Their Applications (W. B. Saunders Publishing Co., 1984), 62. 1. “If I sail west from Europe, I have a 50 percent chance that I will fall off the edge of the earth.” 2. “If I flip a coin, I have a 50 percent chance that it will land on heads.” Conceptually, these represent two distinct types of probability statements. The first is a statement about probability as a degree of belief about whether an event will occur and how firmly this belief is held. The second is a statement about how often a head would be expected to show up in repeated flips of a coin. The important difference is that the first statement’s validity or truth will be stated. We can clear up the statement’s veracity for all by sailing across the globe. The second statement, however, still remains unsettled. Even after the first coin flip, we still have a 50 percent chance that the next flip will result in a head. The second provides a different interpretation of “probability,” namely, as a relative frequency of occurrence in repeated trials. This relative frequency conceptualization of probability is most relevant for risk management. One wants to learn from past events about the likelihood of future occurrences. The discoverers of probability theory adopted the relative frequency approach to formalizing the likelihood of chance events. Pascal and Fermat ushered in a major conceptual breakthrough: the concept that, in repeated games of chance (or in many other situations encountered in nature) involving uncertainty, fixed relative frequencies of occurrence of the individual possible outcomes arose. These relative frequencies were both stable over time and individuals could calculate them by simply counting the number of ways that the outcome could occur divided by the total number of equally likely possible outcomes. In addition, empirically the relative frequency of occurrence of events in a long sequence of repeated trials (e.g., repeated gambling games) corresponded with the theoretical calculation of the number of ways an event could occur divided by the total number of possible outcomes. This is the model of equally likely outcomes or relative frequency definition of probability. It was a very distinct departure from the previous conceptualization of uncertainty that had all events controlled by God with no humanly discernable pattern. In the Pascal-Fermat framework, prediction became a matter of counting that could be done by anyone. Probability and prediction had become a tool of the people! Figure $$\PageIndex{1}$$ provides an example representing all possible outcomes in the throw of two colored dice along with their associated probabilities. Figure $$\PageIndex{1}$$ lists the probabilities for the number of dots facing upward (2, 3, 4, etc.) in a roll of two colored dice. We can calculate the probability for any one of these numbers (2, 3, 4, etc.) by adding up the number of outcomes (rolls of two dice) that result in this number of dots facing up divided by the total number of possibilities. For example, a roll of thirty-six possibilities total when we roll two dice (count them). The probability of rolling a 2 is 1/36 (we can only roll a 2 one way, namely, when both dice have a 1 facing up). The probability of rolling a 7 is $$\frac{6}{36}$$=$$\frac{1}{6}$$ (since rolls can fall any of six ways to roll a 7—1 and 6 twice, 2 and 5 twice, 3 and 4 twice). For any other choice of number of dots facing upward, we can get the probability by just adding the number of ways the event can occur divided by thirty-six. The probability of rolling a 7 or an 11 (5 and 6 twice) on a throw of the dice, for instance, is $$\frac{6+2}{36}$$=$$\frac{2}{9}$$. The notions of “equally likely outcomes” and the calculation of probabilities as the ratio of “the number of ways in which an event could occur, divided by the total number of equally likely outcomes” is seminal and instructive. But, it did not include situations in which the number of possible outcomes was (at least conceptually) unbounded or infinite or not equally likely.Nor was the logic of the notion of equally likely outcomes readily understood at the time. For example, the famous mathematician D’Alembert made the following mistake when calculating the probability of a head appearing in two flips of a coin (Karl Pearson, The History of Statistics in the 17th and 18th Centuries against the Changing Background of Intellectual, Scientific and Religious Thought [London: Charles Griffin & Co., 1978], 552). D’Alembert said the head could come up on the first flip, which would settle that matter, or a tail could come up on the first flip followed by either a head or a tail on the second flip. There are three outcomes, two of which have a head, and so he claimed the likelihood of getting a head in two flips is $$\frac{2}{3}$$. Evidently, he did not take the time to actually flip coins to see that the probability was $$\frac{3}{4}$$, since the possible equally likely outcomes are actually (H,T), (H,H), (T,H), (T,T) with three pairs of flips resulting in a head. The error is that the outcomes stated in D’Alembert’s solution are not equally likely using his outcomes H, (T,H), (T,T), so his denominator is wrong. The moral of this story is that postulated theoretical models should always be tested against empirical data whenever possible to uncover any possible errors. We needed an extension. Noticing that the probability of an event, any event, provided that extension. Further, extending the theory to nonequally likely possible outcomes arose by noticing that the probability of an event—any event—occurring could be calculated as the relative frequency of an event occurring in a long run of trials in which the event may or may not occur. Thus, different events could have different, nonequal chances of occurring in a long repetition of scenarios involving the possible occurrences of the events. Table 2.3 provides an example of this. We can extend the theory yet further to a situation in which the number of possible outcomes is potentially infinite. But what about a situation in which no easily definable bound on the number of possible outcomes can be found? We can address this situation by again using the relative frequency interpretation of probability as well. When we have a continuum of possible outcomes (e.g., if an outcome is time, we can view it as a continuous variable outcome), then a curve of relative frequency is created. Thus, the probability of an outcome falling between two numbers x and y is the area under the frequency curve between x and y. The total area under the curve is one reflecting that it’s 100 percent certain that some outcome will occur. The so-called normal distribution or bell-shaped curve from statistics provides us with an example of such a continuous probability distribution curve. The bell-shaped curve represents a situation wherein a continuum of possible outcomes arises. Figure $$\PageIndex{2}$$ provides such a bell-shaped curve for the profitability of implementing a new research and development project. It may have profit or loss. To find the probability of any range of profitability values for this research and development project, we find the area under the curve in Figure $$\PageIndex{2}$$ between the desired range of profitability values. For example, the distribution in Figure $$\PageIndex{2}$$ was constructed to have what is called a normal distribution with the hump over the point$30 million and a measure of spread of $23 million. This spread represents the standard deviation that we will discuss in the next section. We can calculate the area under the curve above$0, which will be the probability that we will make a profit by implementing the research and development project. We do this by reference to a normal distribution table of values available in any statistics book. The area under the curve is 0.904, meaning that we have approximately a 90 percent change (probability of 0.9) that the project will result in a profit.

In practice, we build probability distribution tables or probability curves such as those in Figure $$\PageIndex{1}$$, Figure $$\PageIndex{2}$$, and Table 2.3 using estimates of the likelihood (probability) of various different states of nature based on either historical relative frequency of occurrence or theoretical data. For example, empirical data may come from repeated observations in similar situations such as with historically constructed life or mortality tables. Theoretical data may come from a physics or engineering assessment of failure likelihood for a bridge or nuclear power plant containment vessel. In some situations, however, we can determine the likelihoods subjectively or by expert opinion. For example, assessments of political overthrows of governments are used for pricing political risk insurance needed by corporations doing business in emerging markets. Regardless of the source of the likelihoods, we can obtain an assessment of the probabilities or relative frequencies of the future occurrence of each conceivable event. The resulting collection of possible events together with their respective probabilities of occurrence is called a probability distribution, an example of which is shown in Table 2.3.

Measures of Outcome Value: Severity of Loss, Value of Gain

We have developed a quantified measure of the likelihood of the various uncertain outcomes that a firm or individual might face—these are also called probabilities. We can now turn to address the consequences of the uncertainty. The consequences of uncertainty are most often a vital issue financially. The reason that uncertainty is unsettling is not the uncertainty itself but rather the various different outcomes that can impact strategic plans, profitability, quality of life, and other important aspects of our life or the viability of a company. Therefore, we need to assess how we are impacted in each state of the world. For each outcome, we associate a value reflecting how we are affected by being in this state of the world.

As an example, consider a retail firm entering a new market with a newly created product. They may make a lot of money by taking advantage of “first-mover” status. They may lose money if the product is not accepted sufficiently by the marketplace. In addition, although they have tried to anticipate any problems, they may be faced with potential product liability. While they naturally try to make their products as safe as possible, they have to regard the potential liability because of the limited experience with the product. They may be able to assess the likelihood of a lawsuit as well as the consequences (losses) that might result from having to defend such lawsuits. The uncertainty of the consequences makes this endeavor risky and the potential for gain that motivates the company’s entry into the new market. How does one calculate these gains and losses? We already demonstrated some calculations in the examples above in Table 2.1 and Table 2.2 for the claims and fire losses for homes in locations A and B. These examples concentrated on the consequences of the uncertainty about fires. Another way to compute the same type of consequences is provided in the example in Table 2.3 for the probability distribution for this new market entry. We look for an assessment of the financial consequences of the entry into the market as well. This example looks at a few possible outcomes, not only the fire losses outcome. These outcomes can have positive or negative consequences. Therefore, we use the opportunity terminology here rather than only the loss possibilities.

Table 2.3 Opportunity and Loss Assessment Consequences of New Product Market Entry
State of Nature Probability Assessment of Likelihood of State Financial Consequences of Being in This State (in Millions of Dollars)
Subject to a loss in a product liability lawsuit .01 −10.2
Market acceptance is limited and temporary .10 −.50
Some market acceptance but no great consumer demand .40 .10
Good market acceptance and sales performance .40 1
Great market demand and sales performance .09 8

As you can see, it’s not the uncertainty of the states themselves that causes decision makers to ponder the advisability of market entry of a new product. It’s the consequences of the different outcomes that cause deliberation. The firm could lose $10.2 million or gain$8 million. If we knew which state would materialize, the decision would be simple. We address the issue of how we combine the probability assessment with the value of the gain or loss for the purpose of assessing the risk (consequences of uncertainty) in the next section.

Combining Probability and Outcome Value Together to Get an Overall Assessment of the Impact of an Uncertain Endeavor

Early probability developers asked how we could combine the various probabilities and outcome values together to obtain a single number reflecting the “value” of the multitude of different outcomes and different consequences of these outcomes. They wanted a single number that summarized in some way the entire probability distribution. In the context of the gambling games of the time when the outcomes were the amount you won in each potential uncertain state of the world, they asserted that this value was the “fair value” of the gamble. We define fair value as the numerical average of the experience of all possible outcomes if you played the game over and over. This is also called the “expected value.” Expected value is calculated by multiplying each probability (or relative frequency) by its respective gain or loss.In some ways it is a shame that the term “expected value” has been used to describe this concept. A better term is “long run average value” or “mean value” since this particular value is really not to be expected in any real sense and may not even be a possibility to occur (e.g., the value calculated from Table 2.3 is 1.008, which is not even a possibility). Nevertheless, we are stuck with this terminology, and it does convey some conception of what we mean as long as we interpreted it as being the number expected as an average value in a long series of repetitions of the scenario being evaluated. It is also referred to as the mean value, or the average value. If X denotes the value that results in an uncertain situation, then the expected value (or average value or mean value) is often denoted by $$E(X)$$, sometimes also referred to by economists as $$E(U)$$—expected utility—and $$E(G)$$—expected gain. In the long run, the total experienced loss or gain divided by the number of repeated trials would be the sum of the probabilities times the experience in each state. In Table 2.3 the expected value is $$(.01)×(–10.2) + (.1) ×( −.50) + (.4) ×(.1) + (.4) ×(1) + (.09) ×(8) = 1.008$$. Thus, we would say the expected outcome of the uncertain situation described in Table 2.3 was $1.008 million, or$1,008,000.00. Similarly, the expected value of the number of points on the toss of a pair of dice calculated from example in Figure $$\PageIndex{1}$$ is $$2×((\frac{1}{36})+3×(\frac{2}{36})+4 ×(\frac{3}{36})+5×(\frac{4}{36})+6×(\frac{5}{36})+7×(\frac{6}{36})+8×(\frac{5}{36})+9×(\frac{4}{36})+10×(\frac{3}{36})+11×(\frac{2}{36})+12×(\frac{1}{36})= 7$$. In uncertain economic situations involving possible financial gains or losses, the mean value or average value or expected value is often used to express the expected returns.Other commonly used measures of profitability in an uncertain opportunity, other than the mean or expected value, are the mode (the most likely value) and the median (the number with half the numbers above it and half the numbers below it—the 50 percent mark). It represents the expected return from an endeavor; however, it does not express the risk involved in the uncertain scenario. We turn to this now.

Relating back to Table 2.1 and Table 2.2, for locations A and B of fire claim losses, the expected value of losses is the severity of fire claims, $6,166.67, and the expected number of claims is the frequency of occurrence, 10.2 claims per year. Key Takeaways In this section you learned about the quantification of uncertain outcomes via probability models. More specifically, you delved into methods of computing: • Severity as a measure of the consequence of uncertainty—it is the expected value or average value of the loss that arises in different states of the world. Severity can be obtained by adding all the loss values in a sample and dividing by the total sample size. • If we take a table of probabilities (probability distribution), the expected value is obtained by multiplying the probability of a particular loss occurring times the size of the loss and summing over all possibilities. • Frequency is the expected number of occurrences of the loss that arises in different states of the world. • Likelihood and probability distribution represent relative frequency of occurrence (frequency of occurrence of the event divided by the total frequency of all events) of different events in uncertain situations. Discussion Questions 1. A study of data losses incurred by companies due to hackers penetrating the Internet security of the firm found that 60 percent of the firms in the industry studied had experienced security breaches and that the average loss per security breach was$15,000.
1. What is the probability that a firm will not have a security breach?
2. One firm had two breaches in one year and is contemplating spending money to decrease the likelihood of a breach. Assuming that the next year would be the same as this year in terms of security breaches, how much should the firm be willing to pay to eliminate security breaches (i.e., what is the expected value of their loss)?
2. The following is the experience of Insurer A for the last three years:
Year Number of Exposures Number of Collision Claims Collision Losses ($) 1 10,000 375 350,000 2 10,000 330 250,000 3 10,000 420 400,000 1. What is the frequency of losses in year 1? 2. Calculate the probability of a loss in year 1. 3. Calculate the mean losses per year for the collision claims and losses. 4. Calculate the mean losses per exposure. 5. Calculate the mean losses per claim. 6. What is the frequency of the losses? 7. What is the severity of the losses? 3. The following is the experience of Insurer B for the last three years: Year Number of Exposures Number of Collision Claims Collision Losses ($)
1 20,000 975 650,000
2 20,000 730 850,000
3 20,000 820 900,000
1. Calculate the mean or average number of claims per year for the insurer over the three-year period.
2. Calculate the mean or average dollar value of collision losses per exposure for year 2.
3. Calculate the expected value (mean or average) of losses per claim over the three-year period.
4. For each of the three years, calculate the probability that an exposure unit will file a claim.
5. What is the average frequency of losses?
6. What is the average severity of the losses?
7. What is the standard deviation of the losses?
8. Calculate the coefficient of variation.

2.2: Quantification of Uncertainty via Probability Models is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Anonymous.

• Was this article helpful?


text:
# Need help in physics!!!

I would like to know some resources where I can learn all these different physics concepts that are on Brilliant. If you know any good books, websites, etc. just write them in the comments.

Note by Sharky Kesa
3 years, 11 months ago

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$...$$ or $...$ to ensure proper formatting.
2 \times 3 $$2 \times 3$$
2^{34} $$2^{34}$$
a_{i-1} $$a_{i-1}$$
\frac{2}{3} $$\frac{2}{3}$$
\sqrt{2} $$\sqrt{2}$$
\sum_{i=1}^3 $$\sum_{i=1}^3$$
\sin \theta $$\sin \theta$$
\boxed{123} $$\boxed{123}$$

Sort by:

To fall in love with Physics, watch the entire series by Walter Lewin on Mechanics, Electricity and Magnetism on the official MIT channel on youtube.

- 3 years, 11 months ago

For books I'd say you should read "Lectures on Physics by R.P.Feynman " ,or "Fundamentals of physics by Resnick,Halliday and Walker "

- 3 years, 11 months ago

Write a comment or ask a question... Aadreeto Physics is the best one.

- 3 years, 11 months ago

MIT OCW Walter Lewin lectures are the best! The scholar version is filled with testing and all!! Freedman and young or Halliday Resnick and walker can serve as text books!! But Walter Lewin is the best!

- 3 years, 11 months ago

University physics by freedman and young

- 3 years, 11 months ago

I would try to get hold of classical electromagnetism in a nutshell and the Feynman lectures.

Staff - 3 years, 11 months ago

- 3 years, 11 months ago

YES! ME TOO! It makes no sense!

- 3 years, 11 months ago

How are you so good at electricity and magnetism? I only managed to get to lvl 2 because of some basic concepts and multiple choice questions.

- 3 years, 11 months ago

Well... I took the pre-test and got Level 4 by guessing, and then (feeling cocky) proceeded to lose that level to a Level 2 problem. I don't even know what E+M is! :D

- 3 years, 11 months ago

Really, I started learning this year.

- 3 years, 11 months ago

Yo can refer "concept of physics" by HC Verma

- 3 years, 11 months ago

format: plain


text:
# Irreducible conic implies that the underlying matrix is invertible

I guess that it is true that a conic (2nd degree homogeneous equation in complex variables) is irreducible (i.e can't be factorized over polynomials) if and only if the underlying matrix of coefficients for that is invertible (i.e all its eigenvalues are non-zero).

• If the above statement is correct (or whatever is the nearest correct statement!) then I would like to understand its proof.

• Further is it/(if yes then how) true that there will always exist an unitary transformation to diagonalize that matrix?

• I think that this matrix can't be called a quadratic form or a bilinear form. Right?

• I guess when people talk of conics in $\mathbb{C}^3$ or $\mathbb{CP}^2$ they mean that this matrix has all entries in $\mathbb{R}$. Right?

-

A quadratic form is a homogeneous polynomial of degree two, with coefficients in some field. I will write the polynomial as $Q(x)$, where $x$ is vector of length $d$. By some version of Taylor's theorem $$Q(x+y) = Q(x) +Q(y) + x^T By$$ where $B$ is a $d\times d$ matrix and $x^T By$ is a bilinear form. Since $x+y=y+x$, the form is symmetric, so $x^TBy=y^TBx$ and therefore $B$ is symmetric. The set of points $x$ such that $Q(x)=0$ is a projective quadric, and when $d=3$ it is a projective conic. Over the reals and complexes, $B$ determines $Q$. (And $B$ is what you call the underlying matrix.)

Any proof you have for the real case that a conic is irreducible if $\det(B)\ne0$ will work in the complex case provided it does not use eigenvectors.

Now suppose our field is $\mathbb{C}$. Then $B$ is a complex symmetric matrix, but we can say very little about how to diagonalize a symmetric matrix over $\mathbb{C}$, we can only unitarily diagonalize a matrix if it is normal ($BB^*=B^*B$) and a complex symmetric matrix need not be normal.

We do not call the matrix $B$ a quadratic form, because it is a matrix and not a polynomial.

If people talk about a conic over $\mathbb{C}$, then we assume that the coefficients of the polynomial and the entries of $B$ may be complex. This is standard.

Using eigenvalues and eigenvectors makes it easier to work with quadratic forms over the reals. However this approach does not work over $\mathbb{C}$ or over finite fields.

(Edit. In response to the question below.) Since $Q(x)$ is quadratic, if it factors then it must be a product of two linear factors, so we can then write it as $(c^Tx)(d^Tx)$ (where $c$ and $d$ could be parallel). Now we can calculate $$Q(x+y) -Q(x) -Q(y) = (c^Tx)(d^Ty)+(d^Tx)(c^Ty).$$ If we set $B = cd^T+dc^T$ (which is the sum of two $d\times d$ matrices, then $$x^TBy = (x^Tc)(d^Ty) +(x^Td)(c^Ty) = (c^Tx)(d^Ty)+(d^Tx)(c^Ty).$$ So the matrix of the quadratic form is $cd^T+dc^T$. Since we are in three dimensions (over $\mathbb{C}$ or $\mathbb{R}$ it does not matter), there is a non-zero vector $h$ say such that $c^Th=d^Th=0$. Therefore $Bh=0$ and $B$ is not invertible.

For the other direction, if $\det(B)=0$ then $B$ has rank at most two. Now if $B$ has rank two and is symmetric we can write it as $B=cd^T+dc^T$ for two vectors $c$ and $d$. (This is proved in my book with Royle, it is reasonably standard linear algebra. There might be a way to simplify this but my dinner's calling...) Now since $$4Q(x) = Q(2x) =Q(x+x) = Q(x)+Q(x) +x^TBx$$ we see that $x^TBx=2Q(x)$. So $2Q(x)$ factors, because $x^TBx=2(c^Tx)(d^Tx)$.

This is probably a bit dense, but you can see that we are not using properties of the field, other than it does not have even characteristic.

-
Thanks for your reply! Can you explain how to show that the matrix $B$ is non-singular iff the original homogeneous polynomial $Q$ is irreducible? (...I would like to know this over $\mathbb{C}$...) Further given a conic in $\mathbb{CP}^2$ how does one be sure that it can be diagonalized? Let us say that I have two conics and in some basis $x'$ I have diagonalized (in $\mathbb{CP}^2$) one of them to $x'_1 ^2 + x'_2^2 + x'_3^2 = 0$ and similarly the other one in some basis $x''$ to $x''_1^2 + x''_2^2 + x''_3^2 = 0$. –  Anirbit Sep 19 '11 at 23:13
Now how does one show that these two conics are actually related by some element in $Aut(\mathbb{CP}^2)$ –  Anirbit Sep 19 '11 at 23:13
Thanks a lot for the help. Not everything you said above is familiar to me. And does the above argument also help in understanding that any two conics in $\mathbb{CP}^2$ (may be after reducing each to a sum of squares form) are $Aut(\mathbb{CP}^2)$ transforms of each other? –  Anirbit Sep 19 '11 at 23:34
Thanks a lot for the explanations. Lots of new things in linear algebra that I didn't know earlier! I will try to take a look at your book. Can you also clarify about the second part of my question (..about there being an automorphism of $\mathbb{CP}^2$ connecting the conics..) ? –  Anirbit Sep 20 '11 at 2:54


text:
## Problem 2. No Time to Paint

Contest has ended.

Bessie has recently received a painting set, and she wants to paint the long fence at one end of her pasture. The fence consists of $N$ consecutive 1-meter segments ($1\le N\le 10^5$). Bessie has 26 different colors available, which she labels with the letters 'A' through 'Z' in increasing order of darkness ('A' is a very light color, and 'Z' is very dark). She can therefore describe the desired color she wants to paint each fence segment as a length-$N$ string where each character is a letter.

Initially, all fence segments are uncolored. Bessie can color any contiguous range of segments with a single color in a single brush stroke as long as she never paints a lighter color over a darker color (she can only paint darker colors over lighter colors).

For example, an initially uncolored segment of length four can be colored as follows:

.... -> BBB. -> BBLL -> BQQL

Running short on time, Bessie thinks she may need to leave some consecutive range of fence segments unpainted! Currently, she is considering $Q$ candidate ranges ($1\le Q\le 10^5$), each described by by two integers $(a,b)$ with $1 \leq a \leq b \leq N$ giving the indices of endpoints of the range $a \ldots b$ of segments to be left unpainted.

For each candidate range, what is the minimum number of strokes needed to paint every fence segment outside those in the range with its desired color while leaving all fence segments inside the range uncolored? Note that Bessie does not actually do any painting during this process, so the answers for each candidate range are independent.

#### INPUT FORMAT (input arrives from the terminal / stdin):

The first line contains $N$ and $Q$.

The next line contains a string of length $N$ characters representing the desired color for each fence segment.

The next $Q$ lines each contain two space-separated integers $a$ and $b$ representing a candidate range to possibly leave unpainted.

#### OUTPUT FORMAT (print output to the terminal / stdout):

For each of the $Q$ candidates, output the answer on a new line.

#### SAMPLE INPUT:

8 2
ABBAABCB
3 6
1 4

#### SAMPLE OUTPUT:

4
3

In this example, excluding the sub-range corresponding to the desired pattern $\texttt{BAAB}$ requires four strokes to paint while excluding $\texttt{ABBA}$ requires only three.

.... -> AA.. -> ABBB -> ABCB

#### SCORING:

• Test cases 1-4 satisfy $N,Q\le 100$.
• Test cases 5-7 satisfy $N,Q\le 5000$.
• Test cases 8-13 satisfy no additional constraints.

Problem credits: Andi Qu and Brian Dean

Contest has ended. No further submissions allowed.


text:
# A 10 mA ammeter having 100 ohm resistance, is used to measure up to 1 A. The required shunt resistance is approximately

This question was previously asked in
TN TRB Electrical 2012 Paper
View all TN TRB EE Papers >
1. 1 Ω
2. 12 Ω
3. 50 Ω
4. 100 Ω

Option 1 : 1 Ω
Free
NTPC Diploma Trainee 2020: Full Mock Test
12079
120 Questions 120 Marks 120 Mins

## Detailed Solution

Concept:

For range extension of current measurement in moving coil instrument, a resistance is connected in parallel or shunt with coil resistance. Because for a constant value of voltage, resistance connected in parallel connection has a higher value of current flow compared to series connection.

The amount of shunt resistance to be added is given by:

$${R_{sh}} = \frac{{{R_m}}}{{\frac{I}{{{I_m}}} - 1}}$$

Rm = internal resistance of the coil

Rsh = Shunt resistance

I = total current

Im = Full-scale deflection current

Calculation:

Given Rm = 100 Ω, I = 10 mA, Im = 1 A

$${R_{sh}} = \frac{{{100}}}{{\frac{1}{{{10m}}} - 1}}$$

$${R_{sh}} = \frac{{{100}}}{{100 - 1}}=\frac{100}{99}$$

Rsh = 1.01 Ω

1) For range extension of voltage measurement in moving coil instrument, a resistance is connected in series with coil resistance.

2) Because for a constant value of current, resistance connected in series connection has a higher voltage drop compared to parallel or shunt connection.

The value of the series resistance is given by:

Rse = Rm(M – 1)

$${R_m} = \frac{{{V_m}}}{{{I_m}}}$$

M= multiplying factor = (Required full scale deflection)/(Initial full scale deflection)


text:
# Gradient, Jacobian, Hessian, Laplacian and all that

• Jan 24, 2016

In this article I will explain the different derivative operators used in calculus. Before we start looking into the operators let's first revise the different types of mathematical functions and the concept of derivatives.

In mathematics, a function is a mapping between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output.

If the mapping is from a scalar to another scalar then we call it a scalar function. $$f:\mathbb{R} \to \mathbb{R}$$ For example, the function $f(x)=x^2$ is a mapping from the set of real numbers to the set of non-negative real numbers $f:\mathbb{R} \to \mathbb{R}$.

If the mapping is from a vector to a scalar then the function is known as a multivariable or multivariate function. $$f:\mathbb{R}^n \to \mathbb{R},$$ where $n$ is the dimension of the input vector. For example, the function $f(X)=\sqrt{x_1^2+x_2^2}$ is a mapping from the set of 2-dimensional real vectors $X=[x_1,x_2]$ to the set of real numbers $f:\mathbb{R}^2 \to \mathbb{R}$.

If the mapping is from a vector (or a scalar) to another vector then the function is known as a vector function or a vector-valued function. $$f:\mathbb{R}^n \to \mathbb{R}^m,$$ where $n$ is the dimension of the input vector and $m$ is the dimension of the output vector. For example, a function taking the 3-dimensional position as input and giving the velocity of the object in 3-dimensions is a vector valued function $f:\mathbb{R}^3 \to \mathbb{R}^3$.

### Derivative

Now let's look at what the derivative of a function is. The derivative of a function is a measure of how much the value of a function $f(x)$ changes when we change the input $x$ to the function, $\frac{\textrm{change in f(x)}}{\textrm{change in x}}$. In the case of scalar functions the concept of derivative is very simple as there is only one variable whose value need to be changed and there is only one output for which we need to measure the change. The derivative of a scalar function is denoted as $$f^\prime (x)=\frac{d f(x)}{dx}$$ For example, the derivative of position with respect to time tells us how much the position of an object changes when we advance time and this is known as the velocity. We can also repeat the derivative operator and find the derivative of the derivative, for example, the derivative of the velocity with respect to time is known as the accelaration, which is another very useful physical quantity.

To generalize the notion of derivative to the multivariate functions we use the gradient operator. The gradient of a multivariate function is a vector with each component proportional to the derivative of the function with respect to that component. For example, if we have a three dimensional multivariate function, $f(x_1,x_2,x_3)$, then gradient is given by $$\nabla f = \left[\frac{\partial f(x_1,x_2,x_3)}{\partial x_1} \; , \; \frac{\partial f(x_1,x_2,x_3)}{\partial x_2} \; , \;\frac{\partial f(x_1,x_2,x_3)}{\partial x_3}\right]$$ Let's say the function $f(x_1,x_2,x_3)$ gives us the temperature of the point $[x_1,x_2,x_3]$ in a room. Now if we take a very small step in the $x_1$ direction, and note the change in temperature, then we get the derivative of $f$ with respect to direction $x_1$, $\frac{\partial f(x_1,x_2,x_3)}{\partial x_1}$ , let its value be 5. Now if we repeat it in the other two directions, we will find out how much the temperature changes in $x_2$ and $x_3$ directions, let their values be 15 and 0, respectively. Since the value of the function changes $3$ times more in the $x_2$ direction than that of $x_1$ direction, if we take a step in the $[5,15,0]$ direction, it will give us maximum change in the temperature $f(x_1,x_2,x_3)$. Thus the gradient vector gives us the magnitude and direction of maximum change of a multivariate function.

### Jacobian

The Jacobian operator is a generalization of the derivative operator to the vector-valued functions. As we have seen earlier, a vector-valued function is a mapping from $f:\mathbb{R}^n \to \mathbb{R}^m$, hence, now instead of having a scalar value of the function $f$, we will have a mapping $[x_1,x_2,\dotsc,x_n] \to [f_1,f_2,\dotsc,f_n]$. Thus, we now need the rate of change of each component of $f$ with respect to each component of the input variable $x$, this is exactly what is captured by a matrix called Jacobian matrix $J$ $$J = \begin{pmatrix} \frac{\partial f_1}{\partial x_1} & \frac{\partial f_1}{\partial x_2} & \cdots & \frac{\partial f_1}{\partial x_n} \\ \frac{\partial f_2}{\partial x_1} & \frac{\partial f_2}{\partial x_2} & \cdots & \frac{\partial f_2}{\partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial f_m}{\partial x_1} & \frac{\partial f_m}{\partial x_2} & \cdots & \frac{\partial f_m}{\partial x_n} \end{pmatrix}$$

### Hessian

The gradient is the first order derivative of a multivariate function. To find the second order derivative of a multivariate function, we define a matrix called a Hessian matrix given by $$H = \begin{pmatrix} \frac{\partial^2 f}{\partial x_1^2} & \frac{\partial^2 f}{\partial x_1\partial x_2} & \cdots & \frac{\partial^2 f}{\partial x_1\partial x_n} \\ \frac{\partial^2 f}{\partial x_2 \partial x_1} & \frac{\partial^2 f}{\partial x_2^2 } & \cdots & \frac{\partial^2 f}{\partial x_2 \partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial^2 f}{\partial x_n \partial x_1} & \frac{\partial^2 f}{\partial x_n \partial x_2} & \cdots & \frac{\partial^2 f}{\partial x_n^2} \end{pmatrix}$$

### Laplacian

The trace of the Hessian matrix is known as the Laplacian operator denoted by $\nabla^2$, $$\nabla^2 f = trace(H) = \frac{\partial^2 f}{\partial x_1^2} + \frac{\partial^2 f}{\partial x_2^2 }+ \cdots + \frac{\partial^2 f}{\partial x_n^2}$$


text:
# Update libraries to use nullable reference types and communicate nullable rules to callers

The addition of nullable reference types means you can declare whether or not a null value is allowed or expected for every variable. In addition, you can apply a number of attributes: AllowNull, DisallowNull, MaybeNull, NotNull, NotNullWhen, MaybeNullWhen, and NotNullIfNotNull to completely describe the null states of argument and return values. That provides a great experience as you write code. You get warnings if a non-nullable variable might be set to null. You get warnings if a nullable variable isn't null-checked before you dereference it. Updating your libraries can take time, but the payoffs are worth it. The more information you provide to the compiler about when a null value is allowed or prohibited, the better warnings users of your API will get. Let's start with a familiar example. Imagine your library has the following API to retrieve a resource string:

bool TryGetMessage(string key, out string message)

The preceding example follows the familiar Try* pattern in .NET. There are two reference arguments for this API: the key and the message parameter. This API has the following rules relating to the nullness of these arguments:

• Callers shouldn't pass null as the argument for key.
• Callers can pass a variable whose value is null as the argument for message.
• If the TryGetMessage method returns true, the value of message isn't null. If the return value is false, the value of message (and its null state) is null.

The rule for key can be completely expressed by the variable type: key should be a non-nullable reference type. The message parameter is more complex. It allows null as the argument, but guarantees that, on success, that out argument isn't null. For these scenarios, you need a richer vocabulary to describe the expectations.

Updating your library for nullable references requires more than sprinkling ? on some of the variables and type names. The preceding example shows that you need to examine your APIs and consider your expectations for each input argument. Consider the guarantees for the return value, and any out or ref arguments upon the method's return. Then communicate those rules to the compiler, and the compiler will provide warnings when callers don't abide by those rules.

This work takes time. Let's start with strategies to make your library or application nullable-aware, while balancing other requirements and deliverables. You'll see how to balance ongoing development enabling nullable reference types. You'll learn challenges for generic type definitions. You'll learn to apply attributes to describe pre- and post-conditions on individual APIs.

## Choose a strategy for nullable reference types

The first choice is whether nullable reference types should be on or off by default. You have two strategies:

• Enable nullable reference types for the entire project, and disable it in code that's not ready.
• Only enable nullable reference types for code that's been annotated for nullable reference types.

The first strategy works best when you're adding other features to the library as you update it for nullable reference types. All new development is nullable aware. As you update existing code, you enable nullable reference types in those classes.

Following this first strategy, you do the following:

1. Enable nullable reference types for the entire project by adding the <Nullable>enable</Nullable> element to your csproj files.
2. Add the #nullable disable pragma to every source file in your project.
3. As you work on each file, remove the pragma and address any warnings.

This first strategy has more up-front work to add the pragma to every file. The advantage is that every new code file added to the project will be nullable enabled. Any new work will be nullable aware; only existing code must be updated.

The second strategy works better if the library is generally stable, and the main focus of the development is to adopt nullable reference types. You turn on nullable reference types as you annotate APIs. When you've finished, you enable nullable reference types for the entire project.

Following this second strategy you do the following:

1. Add the #nullable enable pragma to the file you want to make nullable aware.
3. Continue these first two steps until you've made the entire library nullable aware.
4. Enable nullable types for the entire project by adding the <Nullable>enable</Nullable> element to your csproj files.
5. Remove the #nullable enable pragmas, as they're no longer needed.

This second strategy has less work up-front. The tradeoff is that the first task when you create a new file is to add the pragma and make it nullable aware. If any developers on your team forget, that new code is now in the backlog of work to make all code nullable aware.

Which of these strategies you pick depends on how much active development is taking place in your project. The more mature and stable your project, the better the second strategy. The more features being developed, the better the first strategy.

## Should nullable warnings introduce breaking changes?

Before you enable nullable reference types, variables are considered nullable oblivious. Once you enable nullable reference types, all those variables are non-nullable. The compiler will issue warnings if those variables aren't initialized to non-null values.

Another likely source of warnings is return values when the value hasn't been initialized.

The first step in addressing the compiler warnings is to use ? annotations on parameter and return types to indicate when arguments or return values may be null. When reference variables must not be null, the original declaration is correct. As you do this, your goal isn't just to fix warnings. The more important goal is to make the compiler understand your intent for potential null values. As you examine the warnings, you reach your next major decision for your library. Do you want to consider modifying API signatures to more clearly communicate your design intent? A better API signature for the TryGetMessage method examined earlier could be:

string? TryGetMessage(string key);

The return value indicates success or failure, and carries the value if the value was found. In many cases, changing API signatures can improve how they communicate null values.

However, for public libraries, or libraries with large user bases, you may prefer not introducing any API signature changes. For those cases, and other common patterns, you can apply attributes to more clearly define when an argument or return value may be null. Whether or not you consider changing the surface of your API, you'll likely find that type annotations alone aren't sufficient for describing null values for arguments or return values. In those instances, you can apply attributes to more clearly describe an API.

## Attributes extend type annotations

Several attributes have been added to express additional information about the null state of variables. All code you wrote before C# 8 introduced nullable reference types was null oblivious. That means any reference type variable may be null, but null checks aren't required. Once your code is nullable aware, those rules change. Reference types should never be the null value, and nullable reference types must be checked against null before being dereferenced.

The rules for your APIs are likely more complicated, as you saw with the TryGetValue API scenario. Many of your APIs have more complex rules for when variables can or can't be null. In these cases, you'll use attributes to express those rules. The attributes that describe the semantics of your API are found in the article on Attributes that impact nullable analysis.

## Generic definitions and nullability

Correctly communicating the null state of generic types and generic methods requires special care. This stems from the fact that a nullable value type and a nullable reference type are fundamentally different. An int? is a synonym for Nullable<int>, whereas string? is string with an attribute added by the compiler. The result is that the compiler can't generate correct code for T? without knowing if T is a class or a struct.

This doesn't mean you can't use a nullable type (either value type or reference type) as the type argument for a closed generic type. Both List<string?> and List<int?> are valid instantiations of List<T>.

What it does mean is that you can't use T? in a generic class or method declaration without constraints. For example, Enumerable.FirstOrDefault<TSource>(IEnumerable<TSource>) won't be changed to return T?. You can overcome this limitation by adding either the struct or class constraint. With either of those constraints, the compiler knows how to generate code for both T and T?.

You may want to restrict the types used for a generic type argument to be non-nullable types. You can do that by adding the notnull constraint on that type argument. When that constraint is applied, the type argument must not be a nullable type.

## Late-initialized properties, Data Transfer Objects and nullability

Indicating the nullability of properties that are late-initialized, meaning set after construction, may require special consideration to ensure that your class continues to correctly express the original design intent.

Types that contain late-initialized properties, such as Data Transfer Objects (DTOs), are often instantiated by an external library, like a database ORM (Object Relational Mapper), a deserializer, or some other component that automatically populates properties from another source.

Consider the following DTO class, prior to enabling nullable reference types, that represents a student:

class Student
{
[Required]
public string FirstName { get; set; }

[Required]
public string LastName { get; set; }

public string VehicleRegistration { get; set; }
}

The design intent (indicated in this case by the Required attribute) suggests that in this system, the FirstName and LastName properties are mandatory, and therefore not null.

The VehicleRegistration property is not mandatory, so may be null.

When you enable nullable reference types, you want to indicate on our DTO which of the properties may be nullable, consistent with your original intent:

class Student
{
[Required]
public string FirstName { get; set; }

[Required]
public string LastName { get; set; }

public string? VehicleRegistration { get; set; }
}

For this DTO, the only property that may be null is VehicleRegistration.

However, the compiler raises CS8618 warnings for both FirstName and LastName, indicating the non-nullable properties are uninitialized.

There are three options available to you that resolve the compiler warnings in a way that maintains the original intent. Any of these options are valid; you should choose the one that best suits your coding style and design requirements.

### Initialize in the constructor

The ideal way to resolve the uninitialized warnings is to initialize the properties in the constructor:

class Student
{
public Student(string firstName, string lastName)
{
FirstName = firstName;
LastName = lastName;
}

[Required]
public string FirstName { get; set; }

[Required]
public string LastName { get; set; }

public string? VehicleRegistration { get; set; }
}

This approach only works if the library that you use to instantiate the class supports passing parameters in the constructor.

In addition, a library may support passing some properties in the constructor, but not all. For example, EF Core supports constructor binding for normal column properties, but not navigation properties.

Check the documentation on the library that instantiates your class, to understand the extent to which it supports constructor binding.

### Property with nullable backing field

If constructor binding won't work for you, one way to deal with this problem is to have a non-nullable property with a nullable backing field:

private string? _firstName;

[Required]
public string FirstName
{
set => _firstName = value;
get => _firstName
?? throw new InvalidOperationException("Uninitialized " + nameof(FirstName))
}

In this scenario, if the FirstName property is accessed before it has been initialized, then the code throws an InvalidOperationException, because the API contract has been used incorrectly.

You should consider that some libraries may have special considerations when using backing fields. For example, EF Core may need to be configured to use backing fields correctly.

### Initialize the property to null

As a terser alternative to using a nullable backing field, or if the library that instantiates your class is not compatible with that approach, you can simply initialize the property to null directly, with the help of the null-forgiving operator (!):

[Required]
public string FirstName { get; set; } = null!;

[Required]
public string LastName { get; set; } = null!;

public string? VehicleRegistration { get; set; }

You will never observe an actual null value at runtime except as a result of a programming bug, by accessing the property before it has been properly initialized.


text:
IIT JAM Follow
December 24, 2021 9:42 pm 30 pts
40. Let G be a group with identity e. Let H be an abelian non-trivial proper subgroup of G with the property that H n gHg = {e} for all ge H. If K = {geG:gh = hg for all he H}, then (a) K is a proper subgroup of H (b) H is a proper subgroup of K (c) K = H (d) there exists no abelian subgroup LcG such that K is a proper subgroup of L
• 0 Likes
• Shares
• Navdeep goyal 1
C


text:
How to prove axiom of pairs from power set axiom and replacement?

This the exercise 2 of section 6 of chapter 1 of "Set Theory: An Introduction to Large Cardinals", by Frank R. Drake:

Show that A4 can be deduced from A3, and that A3 can be deduced from A9. Show that $\mathcal{P}(\mathcal{P}(\emptyset))$ has just two members, and hence that A5 can be deduced from A6 and A9.

The axioms are:

A1) Extensionality: $\forall z:(z\in x\Leftrightarrow z\in y)\Rightarrow x=y$

A2) Foundation: $\exists y:y\in x\Rightarrow\exists y:(y\in x \wedge \forall z:\neg(z\in x\wedge z\in y))$

A3) Separation: $\exists y:\forall x:(x\in y\Leftrightarrow (x\in a\wedge \varphi(x)\;))$

A4) Empty set: $\exists y:\forall x:\neg x\in y$

A5) Pairs: $\exists y:\forall x:(x\in y\Leftrightarrow x=a\vee x=b)$

A6) Power set: $\exists y:\forall x:(x\in y\Leftrightarrow \forall z:(z\in x\Rightarrow z\in a))$

A7) Union: $\exists y:\forall x:(x\in y\Leftrightarrow\exists z:(x\in z\wedge z\in a))$

A8) Infinity: $\exists w:(\exists y:(y\in w\wedge\forall x:\neg x\in y)\wedge\forall x:(x\in w\Rightarrow\exists z:(z\in w\wedge\forall u:(u\in z\Leftrightarrow u\in x\vee u=x))))$

A9) Replacement: $\forall x,y,z:(\psi(x,y)\wedge\psi(x,z)\Rightarrow y=z)\Rightarrow \exists b:\forall y:(y\in b\Leftrightarrow\exists x:(x\in a\wedge\psi(x,y)))$

A10) Choice: $\forall x:(x\in z\Rightarrow(\exists y:y\in x\wedge\forall y:(y\in z\Rightarrow x=y\vee \forall z:\neg(z\in x\wedge z\in y)))\Rightarrow \exists u:\forall x:(x\in z\Rightarrow\exists v:\forall y:(y\in z\wedge y\in x\Leftrightarrow y=v))$

Can somebody verify if my following solution is correct?

If A3, then there exists a set $a$ (because we assume there is something), and being $\varphi(x)$ the formula $x\neq x$, there is a set $y$ such that $\forall x:(x\in y\Leftrightarrow (x\in a\wedge x\neq x))$, so $\forall x:x\notin y$, therefore A4.

If A9, then for every formula $\varphi(x)$ with appropriate conditions, if $\psi(x,y)$ is the formula $x=y\wedge\varphi(y)$, then $\forall x,y,z:(\psi(x,y)\wedge\psi(x,z)\Rightarrow y=z)$, so there is a set $b$ such that $\forall y:(y\in b\Leftrightarrow\exists x:(x\in a\wedge\psi(x,y)))$, so $\forall y:(y\in b\Leftrightarrow\exists x:(x\in a\wedge x=y\wedge \varphi(y))$, so $\forall y:(y\in b\Leftrightarrow y\in a\wedge \varphi(y))$, therefore A3.

If A6 and A9, then A3 and A4, so there a set $e$ such that $\forall x:x\notin e$, and by A6 there is a set $p$ such that $\forall x:(x\in p\Leftrightarrow \forall z:(z\in x\Rightarrow z\in e))$, but $\forall z:(z\in e\Rightarrow z\in e)$, so $e\in p$, but $e\notin e$, so $e\neq p$, and again by A6 there is a set $q$ such that $\forall x:(x\in q\Leftrightarrow \forall z:(z\in x\Rightarrow z\in p))$, but $\forall z:z\notin e$, so $\forall z:(z\in e\Rightarrow z\in p)$, and $\forall z:(z\in p\Rightarrow z\in p)$, so that $e\in q$ and $p\in q$, so by A3 there is a set $a$ such that $\forall x:(x\in a\Leftrightarrow x\in q\wedge(x=e\vee x=p))$, so $\forall x:(x\in a\Leftrightarrow x=e\vee x=p)$ (the set $\mathcal{P}(\mathcal{P}(\emptyset))$ may be thought as the $a$), therefore, for any two sets $u$ and $v$, being $\psi(x,y)$ the formula $(x=e\wedge y=u)\vee(x=p\wedge y=v)$, then $\forall x,y,z:(\psi(x,y)\wedge\psi(x,z)\Rightarrow y=z)$, so there is a set $b$ such that $\forall y:(y\in b\Leftrightarrow\exists x:(x\in a\wedge\psi(x,y)))$, so $\forall y:(y\in b\Leftrightarrow\exists x:(x\in a\wedge((x=e\wedge y=u)\vee(x=p\wedge y=v))))$, so $\forall y:(y\in b\Leftrightarrow\exists x:((x=e\wedge y=u)\vee(x=p\wedge y=v)))$, so $\forall y:(y\in b\Leftrightarrow y=u\vee y=v)$; therefore A5.

• In K.Kunen's text on Set Theory, there is another axiom; A0) Existence : $\;\exists x\;(x=x).$ In order to develop as much of the theory as possible, that does not assume Infinity, we need,as you say, to assume A0, as all the other axioms begin with "$\forall$". – DanielWainfleet Jun 24 '18 at 5:39
• My edit was merely extra brackets in A3)...( to remove ambiguity) and some extra space ( type \; inside the dollar-signs).... BTW you can use \iff for $\iff$. – DanielWainfleet Jun 24 '18 at 5:47

The final part is not correct - but not by your fault: The claim itself is false. We do need A1 at some place. Indeed, all we know about $p:=\mathcal P(\emptyset)$ is that its elements are precisely those sets $x$ with $\forall z\colon(z\in x\Rightarrow z\in \emptyset)$, which simplifies to $\forall z\colon z\notin x$, in other words, $x$ is empty. But without A1, we cannot exclude that there are two (or more) empty sets. With two empty sets $\emptyset$ and $\emptyset'$, the$^1$ set $\mathcal P(\mathcal P(\emptyset))$ has at leat $\emptyset$, $\emptyset'$, $\{\emptyset\}$, $\{\emptyset'\}$, and $\{\emptyset,\emptyset'\}$ as elements.
$^1$ In the absence of A1, we cannot even speak of "the" power set (or other set defined by any of the axioms) any more, in much the same way as we normally cannot speak of "the" infinite set or "the" choice function.


text:
• Advertisement

• ### Popular Now

• 11
• 9
• 10
• 9
• 10
• Advertisement
• Advertisement
• Advertisement

# Whitespaces in text

This topic is 2685 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

Hello all.

Because the DrawText function caused lag even with drawing with a sprite, I switched to drawing with primitives.

Now, when a string contains those symbols (\n \r etc) it will not insert a whiteline (ENTER key) but it will also not display the symbol itself (\n).

What would be the easiest way to let those symbols work?

Greetings Ultimate-Tester

#### Share this post

##### Share on other sites
Advertisement
Quote:
 I switched to drawing with primitives. Now, when a string contains those symbols (\n \r etc) it will not insert a whiteline (ENTER key)

What is "it"? If you're drawing the text yourself (instead of using DrawText), just insert some blank space (for a space) before the next letter.

#### Share this post

##### Share on other sites
That depends on how you draw your text. Usually you parse the string into sprites, and don't generate sprites for whitespace characters.

#### Share this post

##### Share on other sites
I think you are confused with whitespaces and whitelines.
Its like this:

Hello :)
<= this is a whiteline
Hello :)

And as the string it would be like:

"Hello :)\n\n\nHello :)".

#### Share this post

##### Share on other sites
The same principal applies. You need to treat your string as a sequence of sprites and control characters. So "\r" means "Move back to the start of the line", "\n" means "Move down a line", " " means "Move forwards one character", "\t" means "Move forwards 4 spaces" and so on.

#### Share this post

##### Share on other sites
Yes I also know that, but thank you for telling again ;)

The point is that using sprintf or any look-a-like like vsnprintf which I'm using to overload, the \n dissappears (so if I draw hello\nworld, the output is helloworld)

How does the DrawText function handle these escape characters?

#### Share this post

##### Share on other sites
Quote:
 How does the DrawText function handle these escape characters?

You claim to already know this. As Evil Steve said, DrawText (or the underlying layout API) looks for characters that are control characters and adjusts the metrics used for glyph rendering accordingly. Whatever you've replaced DrawText with has to do the same. There are many ways to handle it -- the ideal way for your case will depend on how you draw the text now, specifically. Until you provide more information about that, nobody can provide you more detailed solutions.

#### Share this post

##### Share on other sites
Ok I see your point. I must make myself more clear:

When I use sprintf or any other variation, it will remove this "\n".
How can I now detect if theres a "\n" in the string while it's not there?

I already know that when this "\n" is detected it should move back to the start of the line and move down the height of the text + 2px (for a little spacer) but I just can't detect the "\n" symbol because it has been removed already.

Now my question about DrawText: How can this function handle this "\n" while it has been removed?

EDIT:

I fixed it :) Thank you guys. The problem was I was looking for \\n instead of \n. The \n doesn't get escaped and therefore is invisible, but IS there. The \\n does get escaped and remains visible because it doesn't get processed.

#### Share this post

##### Share on other sites
I have no idea what you are talking about. To my knowledge, sprintf() does not remove newline characters. I suspect you are confused about what it means for a character to be escaped. Can you post a minimal program demonstrating what you think is going on?
#include <cstdio>int main(){    const char *string = "Hello\t,\nWorld!\n\n";    char buffer[1024];    std::sprintf(buffer, "The string is:\n\t\'%s\'\nWasn\'t that fun?\n", string);    std::printf("%s", buffer);}

I don't see how these characters are "removed", from what you have said.

#### Share this post

##### Share on other sites
Yes I think I don't explain correctly what I mean:

When I draw a string that contains an escaped character like "\n", then you will never see the "\n" character because it has been escaped. Therefore, I was confused about how to detect if a string contains an escaped character. I was confused how to find an escaped character because you can't see it visually.

Now I know that the escape sign actually IS there but escaped (invisible) so that means that if you just search a string for "\n", then you will actually get results when a string contains this character. I was searching for "\\n" which means that it wouldn't dissappear because it is an escaped escaped character (lol?)

Anyways, the problem has been solved. I was just being stupid.

#### Share this post

##### Share on other sites

• Advertisement


text:
## Proceedings of the Japan Academy, Series A, Mathematical Sciences

### Analyticity of the closures of some Hodge theoretic subspaces

#### Abstract

In this paper, we prove a general theorem concerning the analyticity of the closure of a subspace defined by a family of variations of mixed Hodge structures, which includes the analyticity of the zero loci of degenerating normal functions. For the proof, we use a moduli of the valuative version of log mixed Hodge structures.

#### Article information

Source
Proc. Japan Acad. Ser. A Math. Sci., Volume 87, Number 9 (2011), 167-172.

Dates
First available in Project Euclid: 4 November 2011

https://projecteuclid.org/euclid.pja/1320417395

Digital Object Identifier
doi:10.3792/pjaa.87.167

Mathematical Reviews number (MathSciNet)
MR2863360

Zentralblatt MATH identifier
1252.14010

#### Citation

Kato, Kazuya; Nakayama, Chikara; Usui, Sampei. Analyticity of the closures of some Hodge theoretic subspaces. Proc. Japan Acad. Ser. A Math. Sci. 87 (2011), no. 9, 167--172. doi:10.3792/pjaa.87.167. https://projecteuclid.org/euclid.pja/1320417395

#### References

• P. Brosnan and G. Pearlstein, The zero locus of an admissible normal function, Ann. of Math. (2) 170 (2009), no. 2, 883–897.
• P. Brosnan and G. Pearlstein, Zero loci of admissible normal functions with torsion singularities, Duke Math. J. 150 (2009), no. 1, 77–100.
• P. Brosnan and G. Pearlstein, On the algebraicity of the zero locus of an admissible normal function, arXiv:0910.0628.
• P. Brosnan, G. Pearlstein and C. Schnell, The locus of Hodge classes in an admissible variation of mixed Hodge structure, C. R. Math. Acad. Sci. Paris 348 (2010), no. 11–12, 657–660.
• F. Charles, On the zero locus of normal functions and the étale Abel-Jacobi map, Int. Math. Res. Not. IMRN 2010, no. 12, 2283–2304.
• P. Deligne, Équations différentielles à points singuliers réguliers, Lecture Notes in Mathematics, Vol. 163, Springer, Berlin, 1970.
• P. A. Griffiths, Periods of integrals on algebraic manifolds. I. Construction and properties of the modular varieties, Amer. J. Math. 90 (1968), 568–626.
• M. Kashiwara, A study of variation of mixed Hodge structure, Publ. Res. Inst. Math. Sci. 22 (1986), no. 5, 991–1024.
• K. Kato, C. Nakayama and S. Usui, Moduli of log mixed Hodge structures, Proc. Japan Acad. Ser. A Math. Sci. 86 (2010), no. 7, 107–112.
• K. Kato, C. Nakayama and S. Usui, Néron models in log mixed Hodge theory by weak fans, Proc. Japan Acad. Ser. A Math. Sci. 86 (2010), no. 8, 143–148.
• K. Kato, C. Nakayama and S. Usui, Classifying spaces of degenerating mixed Hodge structures, II: Spaces of $\mathrm{SL}(2)$-orbits, Kyoto J. Math. 51 (2011), no. 1, Nagata Memorial Issue, 149–261.
• K. Kato, C. Nakayama and S. Usui, Classifying spaces of degenerating mixed Hodge structures, III: Spaces of nilpotent orbits.
• K. Kato and S. Usui, Classifying spaces of degenerating polarized Hodge structures, Annals of Mathematics Studies, 169, Princeton Univ. Press, Princeton, NJ, 2009.
• J. D. Lewis, A filtration on the Chow groups of a complex projective variety, Compositio Math. 128 (2001), no. 3, 299–322.
• M. Saito, Admissible normal functions, J. Algebraic Geom. 5 (1996), no. 2, 235–276.
• M. Saito, Hausdorff property of the Néron models of Green, Griffiths and Kerr, arXiv:0803.2771.
• W. Schmid, Variation of Hodge structure: The singularities of the period mapping, Invent. Math. 22 (1973), 211–319.
• C. Schnell, Complex analytic Néron models for arbitrary families of intermediate Jacobians, arXiv:0910.0662, to appear in Invent. Math.
• S. Usui, Variation of mixed Hodge structure arising from family of logarithmic deformations II: Classifying space, Duke Math. J. 51 (1984), no. 4, 851–875.


text:
## Osaka Journal of Mathematics

### Tilting complexes for group graded algebras, II

Andrei Marcus

#### Abstract

We construct derived equivalences between group graded symmetric algebras, starting from equivalences between their $1$-components obtained via a construction of J. Rickard. This applies to the verification of various cases of Broué's abelian defect group conjecture.

#### Article information

Source
Osaka J. Math., Volume 42, Number 2 (2005), 453-462.

Dates
First available in Project Euclid: 21 July 2006


text:
Title: Gevrey hypoellipticity for sums of squares of vector fields in $\R^2$ with quasi-homogeneous polynomial vanishing

Authors: David Tartakoff and Antonio Bove

Issue: Volume 64 (2015), Issue 2, 613-633

Abstract:


text:
# When does a rational function have infinitely many integer values for integer inputs?

Consider rational functions $F(x)=P(x)/Q(x)$ with $P(x),Q(x) \in \mathbb{Z}[x]$. I'd like to know when I can expect $F(k) \in \mathbb{Z}$ for infinitely many positive integers $k$. Of course this doesn't always happen ($P(x)=1, Q(x)=x, F(x)=1/x$). I am particulary interested in answering this for the rational function $F(x)=\frac{x^{2}+3}{x-1}$.

-
–  David Speyer Sep 7 '10 at 12:47
Heh, just finished doing that. –  Cam McLeman Sep 7 '10 at 13:08
In the second line, I think that you should delete $[x]$. –  John Bentin Sep 7 '10 at 13:11

If $F=P/Q$ is integral infinitely often then $F$ is a polynomial.

Write $$P(x)=f(x)Q(x)+R(x)$$ for some polynomial $R$ of degree strictly less than the degree of $Q$. If you have infinitely many integral $x$ so that $P/Q$ is integral then you get infinitely many $x$ so that $NR/Q$ is integral, where $N$ is the product of all denominators of the coefficients in $f$. However $R/Q\to 0$ as $x\to \pm \infty$ so $R\equiv 0$ and so $Q(x)$ is a divisor of $P(x)$.

Now, as pointed out by Mark Sapir below, not all polynomials with rational coefficients take on integer values infinitely often (at integers), but you can check this in all practical cases by seeing if $dF$ has a root $\pmod{d}$, where $d$ is the common denominator of the coefficients in $F$.

-
Not quite because $f$ may have rational coefficients. Example: $(2x+1)/3$. –  Mark Sapir Sep 7 '10 at 12:51
True, I just assumed $f$ had integral coefficients and it is obvious how to reduce to this case, just multiply the equation with the common denominator of the coefficients of $f$! –  Gjergji Zaimi Sep 7 '10 at 12:58
Still too fast and not quite correct. Example: $(2x+1)/2$. No integer values, but it is a polynomial (over rationals). –  Mark Sapir Sep 7 '10 at 13:05
I've always been bothered by this argument, because it seems a pain to have to use analysis (even in the very weak form that a rational function of negative degree tends to $0$) to prove a purely algebraic fact. (Insert obligatory Fundamental-Theorem-of-Algebra remark here.) Do you know if there is any way to avoid it? –  L Spice Sep 7 '10 at 14:18
I think the only thing remaining to be said is that if $F$ is a polynomial then it takes on integer values on a finite (possibly empty) union of arithmetic progressions. In particular, it is integral infinitely often or never at all; there's nothing in between. –  Gerry Myerson Sep 8 '10 at 0:09

$(x^2+3)/(x-1)=x+1+(4/(x-1))$ so this question, at least, is easy; you get an integer if and only if 4 is a multiple of $x-1$.

-
It seems odd to leave off the punchline that this happens only for x=2,3, or 5. –  Cam McLeman Sep 7 '10 at 13:11
Cam, also for $x = 0, -1, -3$, of course. –  L Spice Sep 7 '10 at 14:16
@L Spice: Doh. –  Cam McLeman Sep 7 '10 at 16:08
@Cam, I wanted to leave something for OP to do. @L Spice, OP asked for positive integer arguments, so -1 for 0, -1, and -3. –  Gerry Myerson Sep 8 '10 at 0:02
@Gerry, oops, sorry. I assume that negative points for a negative answer is a net positive somehow? –  L Spice Sep 11 '10 at 6:35


text:
Thomas' Calculus 13th Edition

The LHS can be written as $(x-0)^{2}+(y-0)^{2}$, which is the square of the distance of the point $(x,y)$ from the origin, $(0,0)$. So, the distance of all these points from the origin is equal to the square root of the RHS, which is 1. This set of points is a circle, centered at the origin, with radius 1. We call this circle the unit circle. --- Alternatively, we could have compared the given equation to Equation (1) in the text $(x-h)^{2}+(y-k)^{2}=r^{2}$ the standard equation for a circle of radius $r,$ centered at $(h,k)$, and arrived to the same answer: the unit circle.


text:
# If an arithmetic sequence has a 1st term of 3 and a 10th term of 21, what is the sum of the first...

## Question:

If an arithmetic sequence has a 1st term of 3 and a 10th term of 21, what is the sum of the first 10 terms?

## Arithmetic Succession:

An arithmetic sequence is characterized because the difference between one term and the previous one remains constant (called common difference). There is a pattern, so that the terms, starting from the second, are obtained by adding the common difference to the previous term.

Become a Study.com member to unlock this answer!

Data

{eq}a_1=3 \\ a_{10}=21 \\ n=10 \, \text{terms} {/eq}

The Sum of terms of an arithmetic sequence is given by the formula

{eq}S_n=\dfrac{a_...