text:
# Difference between revisions of "Chance News 47"

## Quotations

It is remarkable that a science which began with the consideration of games of chance should have become the most important object of human knowledge.

Pierre Simon Laplace
Théorie Analytique des Probabilités, 1812,

## Forsooths

The following Forsooth is from the May 2009 RSS News

France

The state statistics agency estimates that
there are 3.8 million employed workers of
foreign origin in France, representing 8.4
per cent of the total workforce of 25.4
million.

The Times

12 February 2009

Their visual acuity is only fractionally – not geometrically – better than that of the common primates from which they were engineered.
Dean Koontz, Seize the Night, 1999

Submitted by Margaret Cibes

When do you draw the line? When do you take action to avoid that logarithmic point where things take off exponentially?
Burkhard Bilger, "Swamp Things,"
The New Yorker, April 20, 2009

Submitted by Margaret Cibes

Today is President Barack Obama's 100th day in office. How would you grade his performance thus far?

http://www.dartmouth.edu/~chance/forwiki/pie.jpg

Of the 33223 voters in this online, voluntary poll, President Obama received a grade of "F" from 79% of the participants, that is, 26317 voters. The colors in the pie chart represent a grade of "A+", "A", "A-," etc., until the color gray, which refers to the grade of "F".

Submitted by Paul Alper

With the (CT) state economy in the tank, this is the year of givebacks. .... (S)tate Rep. Terry Backer ... says the general public often is not aware that state legislators earn a base salary of $28,000 per year for a part-time job with a pay rate that has been frozen for nine years. On principle, Backer says he does not want to give up a day's pay to be in solidarity with the state employee unions. "I would rather take the$40 and donate it to the food pantry in my town than do some baloney solidarity thing," Backer said.
Christopher Keating, "State Legislators Debate Givebacks Of Their Own"
The Hartford Courant, May 15, 2009

Submitted by Margaret Cibes

## Elections

Andrew Gelman has an interesting article regarding the statistics of elections. He starts with

“Presidential elections have been closer in the past few decades than they were for most of American history. Here's a list of all the U.S. presidential elections that were decided by less than 1% of the vote:

1880
1884
1888
1960
1968
2000

Funny, huh? Other close ones were 1844 (decided by 1.5% of the vote), 1876 (3%), 1916 (3%), 1976 (2%), 2004 (2.5%).

Four straight close elections in the 1870s-80s, five close elections since 1960, and almost none at any other time.”

Perhaps more interesting is his take on House and Senate elections:

http://www.dartmouth.edu/~chance/forwiki/elections1.gif

In the companion piece written with Nate Silver, the graphic concerning the House is made more evident here:

http://www.dartmouth.edu/~chance/forwiki/elections2.gif

From the graph, “the rate of close elections in the House has declined steadily over the century. If you count closeness in terms of absolute votes rather than percentages, then close elections become even rarer, due to the increasing population. In the first few decades of the twentieth century, there were typically over thirty House seats each election year that were decided by less than 1000 votes; in recent decades it's only been about five in each election year.”

Another way of putting it: “Consider that, in the past decade, there were 2,175 elections to the United States House of Representatives held on Election Days 2000, 2002, 2004, 2006 and 2008. Among these, there were 41 instances — about 1.9 percent — in which the Democratic and Republican candidates each received 49 percent to 51 percent of the vote (our calculations exclude votes cast for minor parties). In the 1990s, by contrast, there were 65 such close elections. And their number increases the further one goes back in time: 88 examples in the 1950s, 108 in the 1930s, 129 in the 1910s.”

Discussion

1. A contention mentioned in the NYT article for this bifurcation of opinion is: “as the economy has become more virtual, individuals can now choose where to live on an ideological rather than an occupational basis: a liberal computer programmer in Texas can settle in blue Austin, and a conservative one in the ruby-red suburbs of Houston.” Argue for and against this assertion of coupling ideology and occupational mobility.

2. Gelman and Silver end their NYT article with “Elections like those in New York’s 20th district or in Minnesota, as contentious as they are, actually hark back to a less divisive era in American politics.” Explain the seeming paradox of a close race indicating less divisiveness.

3. As of this posting, the Minnesota senate seat is unfilled despite a manual recount, a canvassing board followed by a so-called election contest and awaits the results of the appeal to the Minnesota Supreme Court—possibly further. See When Does ‘Close Become Too-Close-to-Call? for an analysis of error rates and how likely it is that the real winner would be Norm Coleman instead of Al Franken who currently leads by 312 votes out of about 2.9 million cast. The Minnesota Supreme Court will hear oral arguments on June 1, 2009.

Submitted by Paul Alper

## Bayes theorem in the news

In a letter to the editor of the Miller-McCune magazine, headed "For those of You Who Paid Attention in Statistics Class" [1], Professor Howard Wainer, of The Wharton School, writes about the "mathematical reality ... that so long as only a very small minority of people commit crimes and the criminal justice system is fair ... there will always be a very large proportion of innocent people convicted." He provides a hypothetical example, with calculations based on Bayes theorem.

Some interesting challenges to his assumptions, both from the editor and online bloggers, are included [2]. Professor Wainer's response to an editor's comment includes the following medical example.

Each year in the U.S., 186,000 women are diagnosed, correctly, with breast cancer. Mammograms identify breast cancers correctly 85 percent of the time. But 33.5 million women each year have a mammogram and when there is no cancer it only identifies such with 90 percent accuracy. Thus if you have a mammogram and it results in a positive (you have cancer) result, the probability that you have cancer is: 186,000/(186,000+3.35 million) = 4%.
So if you have a mammogram and it says you are cancer free, believe it. If it says you have cancer, don't believe it.
The only way to fix this [is to] reduce the denominator. Women less than 50 (probably less than 60) without family history of cancer should not have mammograms.

Discussion

1. Consider Professor Wainer's calculation of the probability (4%) of having cancer given a positive mammogram result. Do you agree with the numbers used?

2. Consider Professor Wainer's advice to a person who receives a diagnosis of being cancer free. What is the probability of being cancer free if one receives a negative mammogram result? Do you agree with his advice?

3. Comment on Professor Wainer's advice for "women less than 50."

Submitted by Margaret Cibes

## More on cell phones

"Cell Phones Risky During Pregnancy?
by Daniel J. DeNoon, WebMD [3]

UCLA researcher Jorn Olsen reported to WebMD that:

Kids whose mothers used cell phones while pregnant had a 54% higher risk of behavior problems -- emotional problems, hyperactivity, conduct problems, and peer problems. Kids who used cell phones themselves had an 18% higher risk of behavior problems. And kids with both exposures had an 80% higher risk of behavior problems.

The researchers are said to have been surprised by the strength of the effect, which "did not go away," even after controlling for smoking, social issues, alcohol use, and mothers' psychiatric diagnoses. According to Olsen, "This study just raises suspicion. It does not indicate a strong association, but calls for caution in using cell phones during pregnancy and early childhood."

Olsen says that more research is needed, as does a wireless telephone industry trade group representative, Joseph E. Farren, who tells WebMD that "The overwhelming majority of studies that have been published in scientific journals around the globe show that wireless phones do not pose a health risk."

The study was reported in the July issue of the journal Epidemiology.

Submitted by Margaret Cibes

## Financial planning via Monte Carlo simulation

Odds-On Imperfection: Monte Carlo Simulation by Eleanor Laise, The Wall Street Journal, May 2, 2009 [4]

The article discusses how Monte Carlo methods used by many financial planning firms and individuals have consistently underestimated the odds of extreme market events. While use of this mathematical tool "attracts clients and boosts fee income," it appears to have given investors "a false sense of security."

Here is how a typical Monte Carlo retirement-planning tool might work: The user enters information about his age, earnings, assets, retirement-plan contributions, investment mix and other details. The calculator crunches the numbers on hundreds or thousands of potential market scenarios, guided by assumptions about inflation, volatility and other parameters.

It then spits out a "success rate," which shows the percentage of market scenarios in which the investor had money remaining at the end of his estimated life span. In many cases, the consequences of failure – say, running out of money at age 80 – aren't laid out.

Many providers of the tools argue that it is a significant improvement over the traditional retirement-planning approach, which typically involves assuming some set market return, say 8% for U.S. stocks, year after year, an assumption considered unrealistic by academics and financial pros.

Three factors that affect the outcome of a simulation are identified. One is the choice of assumptions for the scenarios. A second is the relatively small number of scenarios ordinarily run on a model (hundreds or thousands, instead of hundreds of thousands).

A third is the shape of the distribution of market returns: Should it be bell-shaped or "fat-tailed"? A Morningstar Inc. analyst has reported that "While a bell-curve model indicates there is almost no chance of a greater than 13% monthly decline in the Standard & Poor's 500-stock index, such declines have happened at least 10 times since 1926." A number of financial analysts are "considering offering clients Monte Carlo scenarios that incorporate fatter-tailed distributions." A graph is provided of the "fat-tailed" distribution of a hypothetical retiree's anticipated market return. [5].

Submitted by Margaret Cibes

## Friendship

Except for Voltaire who famously (albeit, possibly apocryphally) said, “Lord, protect me from my friends; I can take care of my enemies,” few doubt the benefits of having friends.

From Tara Parker-Pope we find some surprising side effects of friendship. She suggests looking at an Australian study which “found that older people with a large circle of friends were 22 percent less likely to die during the study period than those with fewer friends.” Further, “last year, Harvard researchers reported that strong social ties could promote brain health as we age.”

She also refers to a 2006 study of nearly 3000 nurses with breast cancer which “found that women without close friends were four times as likely to die from the disease as women with 10 or more friends. And notably, proximity and the amount of contact with a friend wasn’t associated with survival. Just having friends was protective.” She closes her article with a quote from the director of the center for gerontology at Virginia Tech: “People with stronger friendship networks feel like there is someone they can turn to. Friendship is an undervalued resource. The consistent message of these studies is that friends make your life better.”

### Discussion

1. Parker-Pope also mentioned researchers here who “studied 34 students at the University of Virginia, taking them to the base of a steep hill and fitting them with a weighted backpack. They were then asked to estimate the steepness of the hill. Some participants stood next to friends during the exercise, while others were alone. The students who stood with friends gave lower estimates of the steepness of the hill. And the longer the friends had known each other, the less steep the hill appeared.” In fact, three of the 34 were excluded because they were deemed outliers. The participants estimated the slant via three different methods as can be seen in the figure below:

http://www.dartmouth.edu/~chance/forwiki/Fig.3.jpg

The haptic measurement "required adjusting a tilt board with a palm rest to be parallel to the hill, importantly, without looking at one's hand." As can seen from the above figure, it appears to more accurate than either the verbal, merely a guess, or the visual which a (presumably crude) disk-like device acted as an aide.

The researchers performed a two-way ANOVA (sex and social support) separately for each of the three measuring methods. They reported the value of each F(1,27) to determine a p-value for each method to see if Friend compared to Alone is statistically significant. So, why the number 27? From merely looking at the figure, which of the three methods for determining slant would appear to be unrelated to friendship?

2. The above study took place in Virginia. In Plymouth, England the researchers did a similar slant study but this time instead of friendship directly, imagining of support was tested as can be seen from the following figure:

http://www.dartmouth.edu/~chance/forwiki/Fig.4.jpg

This study had 36 participants and similarly to the first study, they did a two-way ANOVA (sex and imagery of support) leading to F(2,30) for each slant measuring technique. So, why the 2 and the 30? From merely looking at the figure, which of the three methods for determining slant would appear to be unrelated to imagery of support?

3. In either study, visual or verbal on average markedly overstate the slant of the hill. What does that suggest about people's ability to judge a task?

4. The researchers admit that for either study, "Participants in this study were not randomly assigned." Why would this pose a problem?

5. To give Voltaire his due, Parker-Pope points out that "A large 2007 study showed an increase of nearly 60 percent in the risk for obesity among people whose friends gained weight."

Submitted by Paul Alper

## Helping Doctors and Patients Make Sense of Health Statistics

Gerd Gigerenzer, Wolfgang Gaissmaier, Elke Kurz-Milcke, Lisa M. Schwartz, and Steven Woloshin Psychological Science in the Public Interest Volume 8, Number 2 November 2007

Milton Eisner, Health Statistian at the National Cancer Institute wrote: "Please be sure this excellent, provocative article is mentioned in Chance News".

The articles begins with a Summary which indicates what they will show in the rest of the article.

Many doctors, patients, journalists, and politicians

alike do not understand what health statistics mean or draw wrong conclusions without noticing. Collective statistical illiteracy refers to the widespread inability to understand the meaning of numbers. For instance, many citizens are unaware that higher survival rates with cancer screening do not imply longer life, or that the statement that mammography screening reduces the risk of dying from breast cancer by 25% in fact means that 1 less woman out of 1,000 will die of the disease. We provide evidence that statistical illiteracy (a) is common to patients, journalists, and physicians; (b) is created by nontransparent framing of information that is sometimes an unintentional result of lack of understanding but can also be a result of intentional efforts to manipulate or persuade people; and (c) can have serious consequences for health.

The causes of statistical illiteracy should not be attributed to cognitive biases alone, but to the emotional nature of the doctor–patient relationship and conflicts of interest in the healthcare system. The classic doctor–patient relation is based on (the physician’s) paternalism and (the patient’s) trust in authority, which make statistical literacy seem unnecessary; so does the traditional combination of determinism (physicians who seek causes, not chances) and the illusion of certainty (patients who seek certainty when there is none).We show that information pamphlets, Web sites, leaflets distributed to doctors by the pharmaceutical industry, and even medical journals often report evidence in nontransparent forms that suggest big benefits of featured interventions and small harms. Without understanding the numbers involved, the public is susceptible to political and commercial manipulation of their anxieties and hopes, which undermines the goals of informed consent and shared decision making.

What can be done? We discuss the importance of teaching statistical thinking and transparent representations in primary and secondary education as well as in medical school. Yet this requires familiarizing children early on with the concept of probability and teaching statistical literacy as the art of solving real-world problems rather than applying formulas to toy problems about coins and dice. A major precondition for statistical literacy is transparent risk communication. We recommend using frequency statements instead of single-event probabilities, absolute risks instead of relative risks, mortality rates instead of survival rates, and natural frequencies instead of conditional probabilities. Psychological research on transparent visual and numerical forms of risk communication, as well as training of physicians in their use, is called for.

Statistical literacy is a necessary precondition for an educated citizenship in a technological democracy. Understanding risks and asking critical questions can also shape the emotional climate in a society so that hopes and anxieties are no longer as easily manipulated from outside and citizens can develop a better-informed and more relaxed

attitude toward their health.

The authors then explain why they have these concerns using studies they and others have carried out. Here is an example relevent to Chance News:

Do Journalists Help the Public to Understand Health Statistics?

The press has a powerful influence on public perceptions of

health and health care; much of what people—including many physicians—know and believe about medicine comes from the print and broadcast media. Yet journalism schools tend to teach everything except understanding numbers. Journalists generally receive no training in how to interpret or present medical research (Kees, 2002). A survey of health reporters at daily newspapers in five Midwestern states (70% response rate) found that over 80% had no training in covering health news or interpreting health statistics (Voss, 2002). Not surprisingly, few (15%) found it easy to interpret statistical data, and under a third found it easy to put health news in context. This finding is similar to that of a survey by the Freedom Forum, in which nearly half of the science writers agreed that ‘‘reporters have no idea how to interpret scientific results’’ (Hartz & Chappell, 1997).

The American Association for the Advancement of Science (AAAS) asked more than 1,000 reporters and public information officers what science news stories are most interesting to reporters, their supervisors, or news consumers (AAAS, 2006). The top science topic in the U.S. media is medicine and health, followed by stem cells and cloning, and psychology and neuroscience. In Europe, where national and local newspapers devote many more pages to covering science, topic number one is also medicine and health, followed by environment and climate change. Thus, a minimum statistical literacy in health would do journalists and their readers an excellent service.

Problems with the quality of press coverage, particularly in the reporting of health statistics about medical research, have been documented (Moynihan et al., 2000; Ransohoff & Harris, 1997; Rowe, Frewer, & Sjoberg, 2000; Schwartz, Woloshin, & Welch, 1999a). The most fundamental of these include failing to report any numbers, framing numbers in a nontransparent way to attract readers’ attention, and failing to report important cautions about study limitations.

No Numbers

http://www.dartmouth.edu/~chance/forwiki/table6.jpeg

As shown in Table 6, one disturbing problem with how the media report on new medications is the failure to provide quantitative data on how well the medications work. In the United States, Norway, and Canada, benefits were quantified in only 7%, 21%, and 20% of news stories about newly approved prescription medications, respectively. In place of data, many such news stories present anecdotes, often in the form of patients describing miraculous responses to a new drug. The situation is similar when it comes to the harms of medications: Typically less than half of stories name a specific side effect and even fewer

actually quantify it.

Nontransparent Numbers

Table 6 also demonstrates that when the benefits of a medication are quantified, they are commonly reported using only a relative risk reduction format without providing a base rate. Reporting relative risk reductions without clearly specifying the base rates is bad practice because it leads readers to overestimate the magnitude of the benefit. Consider one medication that lowers risk of disease from 20% to 10% and another that lowers it from 0.0002% to 0.0001%. Both yield a 50% relative risk reduction, yet they differ dramatically in clinical importance.

Sometimes there is another level of confusion: It is not clear whether a ‘‘percent lower’’ expression (e.g., ‘‘Drug X lowers the risk of heart attack by 10%’’) refers to a relative or an absolute risk reduction. To avoid this confusion, some writers express absolute risk reductions as ‘‘percentage points’’ (e.g., ‘‘Drug X reduced the risk of heart attack by 10 percentage points’’). This approach may be too subtle for many readers. The frequency format may make this distinction clearer (e.g., ‘‘For every 100 people who take drug X, 10 fewer will have a heart attack over 10 years’’). But the most important way to clarify risk reductions is to present the fundamental information about the absolute risks in each group (e.g., ‘‘Drug X lowered the risk of heart attack by 10 in 100: from 20 in 100 to 10 in 100 over 10 years’’).>br>

Harms are mentioned in only about one third of reports on newly approved medications, and they are rarely if ever quantified. While benefits are often presented in a nontransparent format, harms are often stated in a way that minimizes their salience. This is most dramatic in direct-to-consumer advertisements, which often display the relative risk reduction from the medication in prominent, large letters (without the base rate), but present harms in long lists in very fine print. TV ads typically give consumers more time to absorb information about benefits (typically qualitative claims about the drug, like ‘‘It worked for me’’) than about side effects, resulting in better recall of purported benefits (Kaphingst,DeJong, Rudd,&Daltroy, 2004; Kaphingst, Rudd, DeJong, & Daltroy, 2005). A second technique is to report benefits in relative risks (big numbers) and harms in absolute risks (small numbers). This asymmetry magnifies benefits and minimizes harm. A simple solution (again) is to present both benefits and harms in the same format—in absolute risks.

No Cautions

All studies have limitations. If the press is to help the public understand the inherent uncertainties in medical research, they should state the major limitations and important caveats. Unfortunately, this happens only rarely. In a content analysis of the high-profile media coverage of research presented at five scientific meetings (Woloshin&Schwartz, 2006b), few stories included cautions about studies with inherent limitations. For example only 10% of stories about uncontrolled studies noted that it was impossible to know if the outcome really related to the exposure.

These problems are a result not only of journalists’ lack of proper training but also of press releases themselves, including those from medical schools. Press releases are the most direct way that medical journals communicate with the media, and ideally they provide journalists with an opportunity to get their facts right. Unfortunately, however, press releases suffer from many of the same problems noted above with media coverage of medical news (Woloshin & Schwartz, 2002). They often fail to quantify the main effect (35% of releases), present relative risks without base rates (45% of those reporting on differences between study groups), and make no note of study limitations (77%). Although medical journals work hard to ensure that articles represent study findings fairly and acknowledge important limitations, their hard work is hence partially undone by the time research findings reach the news media. Better press releases could change this, helping journalists write better stories.

A few newspapers have begun to promote correct and transparent reporting in place of confusion and sensationalism. And there are a number of efforts to teach journalists how to understand what the numbers mean. In Germany, for example, one of us (GG) has trained some 100 German science writers, and in the United States there are MIT’s Medical Evidence Boot Camp and the Medicine in the Media program sponsored by the National Institutes of Health and the Dartmouth Institute for Health Policy and Clinical Practice’s Center for Medicine and the Media (where two of us, LS and SW, teach journalists from around the world.

Submitted by Laurie Snell

## Too many data analyses spoil the design

Data, Not Design, Is King in the Age of Google Miguel Helft, The New York Times, May 9, 2009.

If you are a web designer, it is very easy to get solid data on your design choices.

"The Web, of course, offers designers and innovators an unprecedented and powerful mechanism to test their ideas. They can mock something up, throw it up online, and get immediate feedback from users. Better yet, they can mock up multiple designs and test them quickly. Then, they can repeat the process until they home in on the design that seems to be most popular."

But one designer is rebelling against this data oriented approach. Douglas Bowman has quit his job at Google because they collected too much data.

Mr. Bowman's main complaint is that in Google's engineering-driven culture, data trumps everything else. When he would come up with a design decision, no matter how minute, he was asked to back it up with data. Before he could decide whether a line on a Web page should be three, four or five pixels wide, for example, he had to put up test versions of all three pages on the Web. Different groups of users would see different versions, and their clicking behavior, or the amount of time they spent on a page, would help pick a winner. 'Data eventually becomes a crutch for every decision, paralyzing the company and preventing it from making any daring design decisions,' Mr. Bowman wrote.

Google, of course, sees things differently.

"'We let the math and the data govern how things look and feel,' Marissa Mayer, the company’s vice president of search products and user experience, said in a recent television interview."

Some design experts agree with Mr. Bowman.

"'Getting virtually real-time feedback from users is incredibly powerful,' said Debra Dunn, an associate professor at the Stanford Institute of Design. 'But the feedback is not very rich in terms of the flavor, the texture and the nuance, which I think is a legitimate gripe among many designers.' Adhering too rigidly to a design philosophy guided by 'Web analytics,' Ms. Dunn said, 'makes it very difficult to take bold leaps.'

There is also support for Google's perspective.

"It is hard to criticize the results of Google's data-centric approach. The company is hugely successful. If a certain hue of blue causes users to click on ads at even a marginally higher rate, it can translate into millions of dollars flowing to the company’s bottom line."

The article goes on to discuss why the customer is not always right. Customer's do not always articulate clearly what they really want.

Everyone agrees, though, that some data collection is important.

"None of this means that input from users is unimportant. Indeed, Ms. Dunn, Mr. Brown and others say designers must find a multitude of ways to understand users’ needs at a deeper level. 'It is more from engaging with users, watching what they do, understanding their pain points, that you get big leaps in design,' Ms. Dunn said."

### Questions

1. If the customer is not always right, what is the value of data collection?

2. What would be a good way to decide when to collect data and when to trust the instincts of the web designers?

3. Are there other areas besides web design where too much data collection can be a problem?

Submitted by Steve Simon

## Sports spending

NCAA report: College sports spending keeps skyrocketing

by Steve Wieberg and Steve Berkowitz, USA TODAY, April 29, 2009 [6]

According to a 2009 NCAA report, "Major college [athletics] programs increased their operating budgets by nearly 11% annually" over a 3-year span. The authors contrast this figure with a reported 4.9% average annual increase in universities' overall spending.

A 2005 version of the athletics spending study found

For every additional dollar spent, ... programs realized only an additional dollar in athletics revenue. And no correlation was found between increased spending and win-loss records.

The 2009 study estimates

An extra \$1 million spent on football increases winning percentage by 1.8 percentage points and the chances of a top 25 finish in the Associated Press media poll by 5 percentage points .... In basketball, the study similarly finds "a significant relationship" between non-salary expenditures and both winning percentage and the probability of reaching the NCAA tournament.

The study finds no connection between coaches' salaries and winning. "The only category of spending that has a statistically significant effect on performance," the authors say, "is 'team expenditures' ." — recruiting, equipment and other "game-day expenses."

Submitted by Margaret Cibes

## Better to play at home?

"The Toughest Place to Win in Sports"
by Darren Everson, The Wall Street Journal, March 4, 2009 [7]

The author reports that major men's college basketball teams have a winning percentage of .340 for away games.

Somewhere on Earth there may be a sport in which this figure is lower. But it isn't the NBA, NHL, American or Australian football, English or Argentine soccer, Major League Baseball, Japanese baseball, Dominican winter baseball, or any of two dozen other sports leagues.

According to Syracuse coach Jim Boeheim, "Only the top, top teams in the country can win on the road." The author cites a number of reasons for this, including the following.

One old theory is that this figure is skewed by all the games early in the year where the prominent schools invite weak opponents to their arenas .... But even if one ... counts only intraconference play, the resulting .380 road-winning figure is still below every other major U.S. team sport. In 2007, road teams in the Southeastern Conference lost 75% of their conference games – an only slightly worse record than this year's 68% rate, the second-highest of any Division I conference.
Another myth: that teams perform worse in enemy arenas because the unfamiliar sightlines affect their shooting. If that's true, then it would likely affect the women, too, who play in the same buildings. But the women's Division I road winning percentage this season is .378 – significantly above that of the men.

An "Interactive Graphic" link provides road winning percentages for various sports leagues.

Submitted by Margaret Cibes

## No sampling for 2010 Census

"Obama's pick rules out use of sampling in 2010 Census"
USA TODAY, May 5, 2009 [8]

President Obama's pick to lead the Census Bureau on Friday ruled out the use of statistical sampling in the 2010 head count, seeking to allay GOP concerns that he might be swayed to put politics over science.
On Friday, [Robert] Groves said he would not pursue statistical adjustment next year because it is now legally barred for the use of apportioning House seats.
He did not commit on the question of restricting use of sampling in surveys after 2010.
The Supreme Court ruled in 1999 that the wording of the federal law barred broad uses of statistical sampling to apportion House seats. Justices, however, indicated that adjustments could be made to the population count when redrawing congressional boundaries and distributing federal money.

A blogger [9] commented:

I have never been counted and I have been a legal citizen all my life. We will see if I get counted next year to see if this is an effective count. I am probably counted in the +/- 14 percent "margin of error".

Submitted by Margaret Cibes


text:
# How do you prove cos(x)tan(X) + sin(x)cot(x) = sin(x) + cos^2(x)?

Jul 25, 2018

#### Explanation:

We know that,

$\diamond \tan \theta = \sin \frac{\theta}{\cos} \theta \mathmr{and} \cot \theta = \cos \frac{\theta}{\sin} \theta$

Given that

cosxtancolor(red)(x)+sinxcotx=sinx+color(red)(cos^2x

We take ,

$L H S = \cos x \tan x + \sin x \cot x$

$\textcolor{w h i t e}{L H S} = \cos x \left(\sin \frac{x}{\cos} x\right) + \sin x \left(\cos \frac{x}{\sin} x\right)$

$\textcolor{w h i t e}{L H S} = \sin x + \cos x \ne \sin x + {\cos}^{2} x$

So, $L H S \ne R H S$

Hence, we cannot prove the above result.

format: plain


text:
# on browsing getting directories list

• Can you please tell why ?

• I'm guessing you put it in public_html and Apache or nginx is serving it like it would any other set of files by default.

• @PitaJ

1. What should i do ?
2. Where should I put my files then

I am using centos 7 os ,
and Apache : server

• Did you follow the installation docs?

• @PitaJ yes offcourse

• @PitaJ
When I am doing curl http://localhost:4567/ on putty
I am getting nodebb html page

but when i am running nodebb through my subdomain , I am getting a list of directories of nodebb .

For doing configuration of reverse proxy : I have followed this link
https://docs.nodebb.org/configuring/proxies/apache/

Any advice , stuck from last 24 hours .
Not able to find solution

• @PitaJ
I have written this code in separate subdomain.conf
location where i saved this file : /etc/apache2/conf.d/includes

<VirtualHost *:80>
ServerName www.sub-domain.com
ServerAlias sub-domain.com

# Rewrite any http traffic to the main url https site
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^[^\/]*\/(.*) https://www.sub-domain.com/$1 [R=301,L] </IfModule> </VirtualHost> <VirtualHost *:443> Protocols h2 http/1.1 ServerName www.sub-domain.com SSLEngine on SSLCertificateFile /path/to/cert.pem SSLCertificateKeyFile /path/to/privkey.pem SSLCertificateChainFile /path/to/chain.pem # Basic security headers Header always set X-Content-Type-Options "nosniff" Header always set X-Xss-Protection "1; mode=block" # NodeBB header RequestHeader set X-Forwarded-Proto "https" # Static file cache <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css)$">
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 14 days"
</IfModule>
</FilesMatch>

ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

# Custom Error Document when NodeBB is offline
ProxyPass /error-documents !
ErrorDocument 503 /error-documents/503.html
Alias /error-documents /path/to/nodebb/public

# Websocket passthrough
RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/socket.io            [NC]
RewriteCond %{QUERY_STRING} transport=websocket    [NC]
RewriteRule /(.*)           ws://localhost:4567/$1 [P,L] ProxyPass / http://localhost:4567/ ProxyPassReverse / http://localhost:4567/ # Log stuff #ErrorLog${APACHE_LOG_DIR}/www-example-error.log
#CustomLog \${APACHE_LOG_DIR}/www-example-access.log combined
</VirtualHost>

But still I am not able to do it
what mistake i am doing ?

• @PitaJ

I am able to open nodebb on : http://sample.sub-domain.com:4567
but not https://sample.sub-domain.com

• Okay see all that is great information to have. Are you invested in using Apache and your reverse proxy? If not, I'd recommend using nginx. It's what all the developers use here.

• @PitaJ
I have already paid for the following services :
1. Os : centos 7
2. Apache2 (EasyApache4 software in hostgator)

• First of all, if you paid for Apache, I have to ask why, because it's freely available software.

If you can't get Apache working I'm sorry, but I can't help you because I don't know much about it. I suggest you ask for help on an Apache-specific forum.

Nginx is also open source and free to use, so if it is really that important to you I suggest using that.

• @PitaJ

I did a fresh install of nodebb using nodebb documentation available at https://docs.nodebb.org/installing/os/centos/

Along the process after running ./nodebb setup

So i fill all the details after which i run ./nodebb start

Then i see nodebb page .
it reroute to same login page and admin portal is not getting opened

Following are the results :
1.After browsing http:/subdomain.com:4567

4.After clicking admin , why it is rerouting to login page and why it's not opening admin dashboard

• Are there any errors client or server side? What is the URL value in config.json? If it doesn't match where you're logging in, that will cause issues.

• @PitaJ
Thanks a lot
Now everything is working fine

Previously I was running nodebb version v.10.1 for last 1 year but when I try upgrading it to latest version
(before which i did mongodump first which results in making dump folder with two subfolders named admin and nodebb),

it kept me asking to install sharp first, which cannot be installed on centos 6 . So I changed my server to centos 7 .

Now the status is my new nodebb with latest version is running without my data
How can i use mongodump , so i can populate my new nodebb version with backup data ( most important )

• @Abhinov-Singh-0 what you're looking for is the opposite of mongodump: mongorestore

• @PitaJ
Yes sorry , you are right,
mistyped it by mistake

Now the status is my new nodebb with latest version is running without my data
How can i use mongorestore , so i can populate my new nodebb version with backup data ( most important )

• @PitaJ
Do i need to do mongorestore before installing nodebb or can we do it after installing nodebb also ?

• You can do it after installing, it will replace all the data.

4

4

3

3

1
| |


text:
# Inconsistency in two equations for Planck law given by professor

I know there are a variety of questions about this topic but I have been searching the internet for a long time and couldn't find a proper answer. The question is simple:

I saw the following formula in my professor's notes for Planck's formula:

$$I(\nu,T) = \dfrac{2\pi h \nu^3}{c^2} \dfrac{h\nu}{e^{h\nu/kT}-1} .$$

However, wherever I look I have seen it in a form such that:

$$I(\nu,T) = \dfrac{2\pi h \nu^3}{c^2} \dfrac{1}{e^{h\nu/kT}-1} .$$

Simply without a $$h\nu$$ term. Why? What is the difference exactly? Was my professor just make a mistake?

• I don’t recognize the first formula. My guess is that it’s a mistake. I suggest asking your professor. – G. Smith Sep 17 at 23:06
• I will, as soon as possible. Then I will update it. – Ekrem Sep 18 at 21:04
• What is $I$ in the first place? Intensity of what? Power? Energy per frequency? – Cham Oct 4 at 17:15


text:
# Speciation and release kinetics of the fission products Mo, Cs, Ba and I from nuclear fuels in severe accident conditions

Abstract : A speciation and release kinetics study of the gaseous fission products freed from nuclear fuels in conditions of severe accident (temperature range 1300°C – 2500°C) as a function of the applied thermodynamic conditions is carried out using the experimental feedback collected at CEA within the VERCORS and VERDON programs. The nature of the major species involved are deduced from the analysis of the specific features of the Cs-Mo-Ba-I-O chemical system in the composition range of irradiated nuclear fuels. Stable gaseous Cs and Ba molybdate species, i.e. $Cs_2Mo_2O_7$ (g) and $BaMoO_4 (g)$, clearly predominates in oxidising conditions, which contributes to increase significantly the released fraction of molybdenum as compared to reducing conditions. An analytical model accounting for thermo-chemistry in the release rate of chemically reactive elements is applied to estimate the release of Cs, I, Mo and Ba in severe accident conditions. Good agreement is achieved with on-line measurements
Mots-clés :
Document type :
Conference papers
Domain :

https://hal-cea.archives-ouvertes.fr/cea-02400191
Contributor : Bibliothèque CADARACHE Connect in order to contact the contributor
Submitted on : Monday, December 9, 2019 - 3:08:47 PM
Last modification on : Wednesday, March 3, 2021 - 3:32:02 PM
Long-term archiving on: : Tuesday, March 10, 2020 - 11:00:12 PM

### File

201800001674.pdf
Files produced by the author(s)

### Identifiers

• HAL Id : cea-02400191, version 1

### Citation

Ch. Riglet-Martial, J. Sercombe, Yves Pontillon. Speciation and release kinetics of the fission products Mo, Cs, Ba and I from nuclear fuels in severe accident conditions. WRFPM 2018, Sep 2018, Prague, Czech Republic. ⟨cea-02400191⟩

Record views


text:
# NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

## Easy Java Simulations (2001- ) => electromagnetism => Topic started by: ahmedelshfie on April 12, 2010, 02:17:41 am

 Title: A loop rotating in a magnetic field (How electric power generator works! Post by: ahmedelshfie on April 12, 2010, 02:17:41 am This applet created by Prof HwangModified by my self I add tow bars for (sc) and (time) Original project:A loop rotating in a magnetic field (How electric power generator works!) (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=915msg4942;topicseen#msg4942) Title: Re: A loop rotating in a magnetic field (How electric power generator works! Post by: ahmedelshfie on April 21, 2010, 02:42:23 am When a loop rotating in a uniform magnetic field.The magnetic flux is changing which will induce electric field along the loop (produce voltage).If the loop is rotating with constant angular velocity \omega . (The angle is \omega t)The magnetic flux in the loop will be $\Psi =\int \vec{B}\cdot d\vec{A}= B A cos(\omega t)$So the induced emf $= -\frac {d\Psi}{dt}=B A \omega sin(\omega t)$The following simulation show how it works dynamically. Title: Re: A loop rotating in a magnetic field (How electric power generator works! Post by: Fu-Kwun Hwang on April 21, 2010, 10:06:44 am You need to add TeX equation between $to be displayed as equation.I have added dollar sign for the above posted message for you! Title: Re: A loop rotating in a magnetic field (How electric power generator works! Post by: ahmedelshfie on April 21, 2010, 12:21:11 pm Yes prof,, i had the text information and equations from topic http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=912.0So i think I'm make wrong right ??? Title: Re: A loop rotating in a magnetic field (How electric power generator works! Post by: Fu-Kwun Hwang on April 21, 2010, 04:50:40 pm You need to add dollar sign for those equations.Otherwise, those equation would not be convert to image.The following is what you have copied.Code:This simulation shows a current loop in uniform magnetic field.The black arrows show the force due to magnetic field on the loop.\vec{F}= q \vec{v} \times \vec{B} or \vec{F}= I \int d\vec{\ell} \times \vec{B}The magnetic field in in the +Z direction if Bz>0.Then ,torque for the loop is calculated from definition \vec{\tau}=\vec{r}\times\vec{F}Because the current flow in the same counter-clockwise direction.The force on the loop change sign during each helf cycle.If we current reverse direction during each helf cycle, the following device can turn into a motor.A voltage source is needed in the loop to drive the current. Title: Re: A loop rotating in a magnetic field (How electric power generator works! Post by: ahmedelshfie on April 21, 2010, 10:51:46 pm I understand prof so when i would typing any equations i add$ between equationsFor convert to picture right Title: Re: A loop rotating in a magnetic field (How electric power generator works! Post by: Fu-Kwun Hwang on April 22, 2010, 02:48:25 pm Yes!  :D Title: Re: A loop rotating in a magnetic field (How electric power generator works! Post by: ahmedelshfie on April 22, 2010, 05:19:06 pm Yes prof  :)


text:
# Contact

You can contact me directly via email. My email is [ paulo [AT] pauloleca [d0t] xyz ]. I don’t use social media in general, but sometimes I use Discord to chat on a few servers.

You can also see my Gitlab/Hub for current projects.

Everything I do and write on the internet is free, so if you are feeling generous and want to help me out, you can Donate via PayPal any amount you want.


text:
# Equivalence of geometric and algebraic definitions of conic sections

I have not been able to find a proof that the following definitions are equivalent anywhere, thought maybe someone could give me an idea:

1. A parabola is defined geometrically as the intersection of a cone and a plane passing under the vertex of a cone that does not form a closed loop and is defined algebraically as the locus of points equidistant from a focus and a directrix.
2. An ellipse is defined geometrically as the intersection of a cone and a plane that passes under the vertex and forms a closed loop and is defined algebraically as the locus of points the sum of whose distances from two foci is a constant.
3. A hyperbola is defined geometrically as the intersection of a double cone and a plane that does not pass under the vertex and is defined algebraically as the locus of points that have a constant difference between the distances to two foci.

Picture of the geometric definitions:

• Rather than "the locus of points equidistant from two foci" you should say "the locus of points that have a constant sum of the distances to two foci". The set of points equidistance from the two foci is a line that is the perpendicular bisector of the segment connecting the two foci. ${}\qquad{}$ – Michael Hardy Dec 13 '14 at 0:24
• @MichaelHardy ya you're right sorry – Elliot Gorokhovsky Dec 13 '14 at 0:25

Both spheres in this picture touch but do not cross the cone, and both touch but do not cross the cutting plane. The points at which the spheres touch the plane are claimed to be the two foci. The distance from $P_1$ to $P$ must be equal to that from $F_1$ to $P$ because both of the lines intersecting at $P$ are tangent to the same sphere at $P_1$ and $F_1$ respectively. Similarly the distance from $P_2$ to $P$ equals that from $F_2$ to $P$. It remains only to see that the distance from $P_1$ to $P_2$ remains constant as $P$ moves along the curve.


text:
# 12.2 The hyperbola  (Page 9/13)

 Page 9 / 13

$\frac{{\left(y-6\right)}^{2}}{36}-\frac{{\left(x+1\right)}^{2}}{16}=1$

$\frac{{\left(x-2\right)}^{2}}{49}-\frac{{\left(y+7\right)}^{2}}{49}=1$

$\frac{{\left(x-2\right)}^{2}}{{7}^{2}}-\frac{{\left(y+7\right)}^{2}}{{7}^{2}}=1;\text{\hspace{0.17em}}$ vertices: $\text{\hspace{0.17em}}\left(9,-7\right),\left(-5,-7\right);\text{\hspace{0.17em}}$ foci: $\text{\hspace{0.17em}}\left(2+7\sqrt{2},-7\right),\left(2-7\sqrt{2},-7\right);\text{\hspace{0.17em}}$ asymptotes: $\text{\hspace{0.17em}}y=x-9,y=-x-5$

$4{x}^{2}-8x-9{y}^{2}-72y+112=0$

$-9{x}^{2}-54x+9{y}^{2}-54y+81=0$

$\frac{{\left(x+3\right)}^{2}}{{3}^{2}}-\frac{{\left(y-3\right)}^{2}}{{3}^{2}}=1;\text{\hspace{0.17em}}$ vertices: $\text{\hspace{0.17em}}\left(0,3\right),\left(-6,3\right);\text{\hspace{0.17em}}$ foci: $\text{\hspace{0.17em}}\left(-3+3\sqrt{2},1\right),\left(-3-3\sqrt{2},1\right);\text{\hspace{0.17em}}$ asymptotes: $\text{\hspace{0.17em}}y=x+6,y=-x$

$4{x}^{2}-24x-36{y}^{2}-360y+864=0$

$-4{x}^{2}+24x+16{y}^{2}-128y+156=0$

$\frac{{\left(y-4\right)}^{2}}{{2}^{2}}-\frac{{\left(x-3\right)}^{2}}{{4}^{2}}=1;\text{\hspace{0.17em}}$ vertices: $\text{\hspace{0.17em}}\left(3,6\right),\left(3,2\right);\text{\hspace{0.17em}}$ foci: $\text{\hspace{0.17em}}\left(3,4+2\sqrt{5}\right),\left(3,4-2\sqrt{5}\right);\text{\hspace{0.17em}}$ asymptotes: $\text{\hspace{0.17em}}y=\frac{1}{2}\left(x-3\right)+4,y=-\frac{1}{2}\left(x-3\right)+4$

$-4{x}^{2}+40x+25{y}^{2}-100y+100=0$

${x}^{2}+2x-100{y}^{2}-1000y+2401=0$

$\frac{{\left(y+5\right)}^{2}}{{7}^{2}}-\frac{{\left(x+1\right)}^{2}}{{70}^{2}}=1;\text{\hspace{0.17em}}$ vertices: $\text{\hspace{0.17em}}\left(-1,2\right),\left(-1,-12\right);\text{\hspace{0.17em}}$ foci: $\text{\hspace{0.17em}}\left(-1,-5+7\sqrt{101}\right),\left(-1,-5-7\sqrt{101}\right);\text{\hspace{0.17em}}$ asymptotes: $\text{\hspace{0.17em}}y=\frac{1}{10}\left(x+1\right)-5,y=-\frac{1}{10}\left(x+1\right)-5$

$-9{x}^{2}+72x+16{y}^{2}+16y+4=0$

$4{x}^{2}+24x-25{y}^{2}+200y-464=0$

$\frac{{\left(x+3\right)}^{2}}{{5}^{2}}-\frac{{\left(y-4\right)}^{2}}{{2}^{2}}=1;\text{\hspace{0.17em}}$ vertices: $\text{\hspace{0.17em}}\left(2,4\right),\left(-8,4\right);\text{\hspace{0.17em}}$ foci: $\text{\hspace{0.17em}}\left(-3+\sqrt{29},4\right),\left(-3-\sqrt{29},4\right);\text{\hspace{0.17em}}$ asymptotes: $\text{\hspace{0.17em}}y=\frac{2}{5}\left(x+3\right)+4,y=-\frac{2}{5}\left(x+3\right)+4$

For the following exercises, find the equations of the asymptotes for each hyperbola.

$\frac{{y}^{2}}{{3}^{2}}-\frac{{x}^{2}}{{3}^{2}}=1$

$\frac{{\left(x-3\right)}^{2}}{{5}^{2}}-\frac{{\left(y+4\right)}^{2}}{{2}^{2}}=1$

$y=\frac{2}{5}\left(x-3\right)-4,y=-\frac{2}{5}\left(x-3\right)-4$

$\frac{{\left(y-3\right)}^{2}}{{3}^{2}}-\frac{{\left(x+5\right)}^{2}}{{6}^{2}}=1$

$9{x}^{2}-18x-16{y}^{2}+32y-151=0$

$y=\frac{3}{4}\left(x-1\right)+1,y=-\frac{3}{4}\left(x-1\right)+1$

$16{y}^{2}+96y-4{x}^{2}+16x+112=0$

## Graphical

For the following exercises, sketch a graph of the hyperbola, labeling vertices and foci.

$\frac{{x}^{2}}{49}-\frac{{y}^{2}}{16}=1$

$\frac{{x}^{2}}{64}-\frac{{y}^{2}}{4}=1$

$\frac{{y}^{2}}{9}-\frac{{x}^{2}}{25}=1$

$81{x}^{2}-9{y}^{2}=1$

$\frac{{\left(y+5\right)}^{2}}{9}-\frac{{\left(x-4\right)}^{2}}{25}=1$

$\frac{{\left(x-2\right)}^{2}}{8}-\frac{{\left(y+3\right)}^{2}}{27}=1$

$\frac{{\left(y-3\right)}^{2}}{9}-\frac{{\left(x-3\right)}^{2}}{9}=1$

$-4{x}^{2}-8x+16{y}^{2}-32y-52=0$

${x}^{2}-8x-25{y}^{2}-100y-109=0$

$-{x}^{2}+8x+4{y}^{2}-40y+88=0$

$64{x}^{2}+128x-9{y}^{2}-72y-656=0$

$16{x}^{2}+64x-4{y}^{2}-8y-4=0$

$-100{x}^{2}+1000x+{y}^{2}-10y-2575=0$

$4{x}^{2}+16x-4{y}^{2}+16y+16=0$

For the following exercises, given information about the graph of the hyperbola, find its equation.

Vertices at $\text{\hspace{0.17em}}\left(3,0\right)\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}\left(-3,0\right)\text{\hspace{0.17em}}$ and one focus at $\text{\hspace{0.17em}}\left(5,0\right).$

$\frac{{x}^{2}}{9}-\frac{{y}^{2}}{16}=1$

Vertices at $\text{\hspace{0.17em}}\left(0,6\right)\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}\left(0,-6\right)\text{\hspace{0.17em}}$ and one focus at $\text{\hspace{0.17em}}\left(0,-8\right).$

Vertices at $\text{\hspace{0.17em}}\left(1,1\right)\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}\left(11,1\right)\text{\hspace{0.17em}}$ and one focus at $\text{\hspace{0.17em}}\left(12,1\right).$

$\frac{{\left(x-6\right)}^{2}}{25}-\frac{{\left(y-1\right)}^{2}}{11}=1$

Center: $\text{\hspace{0.17em}}\left(0,0\right);$ vertex: $\text{\hspace{0.17em}}\left(0,-13\right);$ one focus: $\text{\hspace{0.17em}}\left(0,\sqrt{313}\right).$

Center: $\text{\hspace{0.17em}}\left(4,2\right);$ vertex: $\text{\hspace{0.17em}}\left(9,2\right);$ one focus: $\text{\hspace{0.17em}}\left(4+\sqrt{26},2\right).$

$\frac{{\left(x-4\right)}^{2}}{25}-\frac{{\left(y-2\right)}^{2}}{1}=1$

Center: $\text{\hspace{0.17em}}\left(3,5\right);\text{\hspace{0.17em}}$ vertex: $\text{\hspace{0.17em}}\left(3,11\right);\text{\hspace{0.17em}}$ one focus: $\text{\hspace{0.17em}}\left(3,5+2\sqrt{10}\right).$

For the following exercises, given the graph of the hyperbola, find its equation.

$\frac{{y}^{2}}{16}-\frac{{x}^{2}}{25}=1$

$\frac{{y}^{2}}{9}-\frac{{\left(x+1\right)}^{2}}{9}=1$

$\frac{{\left(x+3\right)}^{2}}{25}-\frac{{\left(y+3\right)}^{2}}{25}=1$

## Extensions

For the following exercises, express the equation for the hyperbola as two functions, with $\text{\hspace{0.17em}}y\text{\hspace{0.17em}}$ as a function of $\text{\hspace{0.17em}}x.\text{\hspace{0.17em}}$ Express as simply as possible. Use a graphing calculator to sketch the graph of the two functions on the same axes.

$\frac{{x}^{2}}{4}-\frac{{y}^{2}}{9}=1$

$\frac{{y}^{2}}{9}-\frac{{x}^{2}}{1}=1$

$y\left(x\right)=3\sqrt{{x}^{2}+1},y\left(x\right)=-3\sqrt{{x}^{2}+1}$

$\frac{{\left(x-2\right)}^{2}}{16}-\frac{{\left(y+3\right)}^{2}}{25}=1$

$-4{x}^{2}-16x+{y}^{2}-2y-19=0$

$y\left(x\right)=1+2\sqrt{{x}^{2}+4x+5},y\left(x\right)=1-2\sqrt{{x}^{2}+4x+5}$

$4{x}^{2}-24x-{y}^{2}-4y+16=0$

## Real-world applications

For the following exercises, a hedge is to be constructed in the shape of a hyperbola near a fountain at the center of the yard. Find the equation of the hyperbola and sketch the graph.

The hedge will follow the asymptotes and its closest distance to the center fountain is 5 yards.

$\frac{{x}^{2}}{25}-\frac{{y}^{2}}{25}=1$

The hedge will follow the asymptotes and its closest distance to the center fountain is 6 yards.

The hedge will follow the asymptotes $\text{\hspace{0.17em}}y=\frac{1}{2}x\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}y=-\frac{1}{2}x,$ and its closest distance to the center fountain is 10 yards.

$\frac{{x}^{2}}{100}-\frac{{y}^{2}}{25}=1$

The hedge will follow the asymptotes $\text{\hspace{0.17em}}y=\frac{2}{3}x\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}y=-\frac{2}{3}x,$ and its closest distance to the center fountain is 12 yards.

The hedge will follow the asymptotes and its closest distance to the center fountain is 20 yards.

$\frac{{x}^{2}}{400}-\frac{{y}^{2}}{225}=1$

For the following exercises, assume an object enters our solar system and we want to graph its path on a coordinate system with the sun at the origin and the x-axis as the axis of symmetry for the object's path. Give the equation of the flight path of each object using the given information.

The object enters along a path approximated by the line $\text{\hspace{0.17em}}y=x-2\text{\hspace{0.17em}}$ and passes within 1 au (astronomical unit) of the sun at its closest approach, so that the sun is one focus of the hyperbola. It then departs the solar system along a path approximated by the line $\text{\hspace{0.17em}}y=-x+2.\text{\hspace{0.17em}}$

The object enters along a path approximated by the line $\text{\hspace{0.17em}}y=2x-2\text{\hspace{0.17em}}$ and passes within 0.5 au of the sun at its closest approach, so the sun is one focus of the hyperbola. It then departs the solar system along a path approximated by the line $\text{\hspace{0.17em}}y=-2x+2.\text{\hspace{0.17em}}$

$\frac{{\left(x-1\right)}^{2}}{0.25}-\frac{{y}^{2}}{0.75}=1$

The object enters along a path approximated by the line $\text{\hspace{0.17em}}y=0.5x+2\text{\hspace{0.17em}}$ and passes within 1 au of the sun at its closest approach, so the sun is one focus of the hyperbola. It then departs the solar system along a path approximated by the line $\text{\hspace{0.17em}}y=-0.5x-2.\text{\hspace{0.17em}}$

The object enters along a path approximated by the line $\text{\hspace{0.17em}}y=\frac{1}{3}x-1\text{\hspace{0.17em}}$ and passes within 1 au of the sun at its closest approach, so the sun is one focus of the hyperbola. It then departs the solar system along a path approximated by the line

$\frac{{\left(x-3\right)}^{2}}{4}-\frac{{y}^{2}}{5}=1$

The object It enters along a path approximated by the line $\text{\hspace{0.17em}}y=3x-9\text{\hspace{0.17em}}$ and passes within 1 au of the sun at its closest approach, so the sun is one focus of the hyperbola. It then departs the solar system along a path approximated by the line $\text{\hspace{0.17em}}y=-3x+9.\text{\hspace{0.17em}}$

find the sum of 28th term of the AP 3+10+17+---------
I think you should say "28 terms" instead of "28th term"
Vedant
if sequence sn is a such that sn>0 for all n and lim sn=0than prove that lim (s1 s2............ sn) ke hole power n =n
write down the polynomial function with root 1/3,2,-3 with solution
if A and B are subspaces of V prove that (A+B)/B=A/(A-B)
write down the value of each of the following in surd form a)cos(-65°) b)sin(-180°)c)tan(225°)d)tan(135°)
Prove that (sinA/1-cosA - 1-cosA/sinA) (cosA/1-sinA - 1-sinA/cosA) = 4
what is the answer to dividing negative index
In a triangle ABC prove that. (b+c)cosA+(c+a)cosB+(a+b)cisC=a+b+c.
give me the waec 2019 questions
the polar co-ordinate of the point (-1, -1)
prove the identites sin x ( 1+ tan x )+ cos x ( 1+ cot x )= sec x + cosec x
tanh`(x-iy) =A+iB, find A and B
B=Ai-itan(hx-hiy)
Rukmini
Give me the reciprocal of even number
Aliyu
The reciprocal of an even number is a proper fraction
Jamilu
what is the addition of 101011 with 101010
If those numbers are binary, it's 1010101. If they are base 10, it's 202021.
Jack
extra power 4 minus 5 x cube + 7 x square minus 5 x + 1 equal to zero
the gradient function of a curve is 2x+4 and the curve passes through point (1,4) find the equation of the curve


text:
# Animation nodes: bake Cycles Material Output to keyframes - possible?

In an older Question I found an answer, what is possible to bake with AN. One in the list was: Cycles Matrial Output (2 Years ago)

I’ve a Plane with Emission-Node as Material, which changes Color and Strength randomly over time.

When I try to Set Keyframes, there is a problem (I believe):

In Set Keyframes-Node you need an object for reference to the data-path (custom-channel), but the material-datapath is not linked to a specific object (bpy.data.materials["feuerlicht"].node_tree.nodes["Emission"].inputs[1].default_value).

Set Keyframes node tells me

Could not set keyframe

And when I look to python code, it seems, that I need an object for keyframe-setting:

obj.keyframe_insert('location', frame=1)

Or, as I found:

material.node_tree.keyframe_insert(datapath, frame=1)

But the material is not a separate object I can choose in then set keyframe-node, or?

I changed from Area-light to this plane-emission-thing to get it baked, I thought.

Is it possible to get Cycles-Material-changes baked to keyframes in AN?

• Hi and welcome! Please add the link to the post you've found to your question. Also I recommend take the tour to learn about how this site works: blender.stackexchange.com/tour Dec 10, 2020 at 18:38
• Hi, thank you. I've edited the post with the link. Dec 11, 2020 at 12:15
• so, I think there does not exist a node for this. I made a quick and dirty script for this: Dec 13, 2020 at 9:29

After further search I think there is no node for this. Now I did it with a quick an dirty script-node:

    # inputs:
# Enable = boolean
# SetKeyframes = boolean
# RemoveUnwanted = boolean
# MaterialName = text
# pframe = integer

import bpy

mat = None

if Enable:
for tmat in bpy.data.materials:
if tmat.name == MaterialName:
mat = tmat
if mat != None:
print ('material found')
emitStr = mat.node_tree.nodes['Emission'].inputs[1]
if RemoveUnwanted:
try:
emitStr.keyframe_delete( 'default_value', frame=pframe)
except:
None
if SetKeyframes:
emitStr.keyframe_insert( 'default_value', frame=pframe)

else:


text:
## 34.7 The fppf topology

Let $S$ be a scheme. We would like to define the fppf-topology1 on the category of schemes over $S$. According to our general principle we first introduce the notion of an fppf-covering.

Definition 34.7.1. Let $T$ be a scheme. An fppf covering of $T$ is a family of morphisms $\{ f_ i : T_ i \to T\} _{i \in I}$ of schemes such that each $f_ i$ is flat, locally of finite presentation and such that $T = \bigcup f_ i(T_ i)$.

Lemma 34.7.2. Any syntomic covering is an fppf covering, and a fortiori, any smooth, étale, or Zariski covering is an fppf covering.

Proof. This is clear from the definitions, the fact that a syntomic morphism is flat and locally of finite presentation, see Morphisms, Lemmas 29.30.6 and 29.30.7, and Lemma 34.6.2. $\square$

Next, we show that this notion satisfies the conditions of Sites, Definition 7.6.2.

Lemma 34.7.3. Let $T$ be a scheme.

1. If $T' \to T$ is an isomorphism then $\{ T' \to T\}$ is an fppf covering of $T$.

2. If $\{ T_ i \to T\} _{i\in I}$ is an fppf covering and for each $i$ we have an fppf covering $\{ T_{ij} \to T_ i\} _{j\in J_ i}$, then $\{ T_{ij} \to T\} _{i \in I, j\in J_ i}$ is an fppf covering.

3. If $\{ T_ i \to T\} _{i\in I}$ is an fppf covering and $T' \to T$ is a morphism of schemes then $\{ T' \times _ T T_ i \to T'\} _{i\in I}$ is an fppf covering.

Proof. The first assertion is clear. The second follows as the composition of flat morphisms is flat (see Morphisms, Lemma 29.25.6) and the composition of morphisms of finite presentation is of finite presentation (see Morphisms, Lemma 29.21.3). The third follows as the base change of a flat morphism is flat (see Morphisms, Lemma 29.25.8) and the base change of a morphism of finite presentation is of finite presentation (see Morphisms, Lemma 29.21.4). Moreover, the base change of a surjective family of morphisms is surjective (proof omitted). $\square$

Lemma 34.7.4. Let $T$ be an affine scheme. Let $\{ T_ i \to T\} _{i \in I}$ be an fppf covering of $T$. Then there exists an fppf covering $\{ U_ j \to T\} _{j = 1, \ldots , m}$ which is a refinement of $\{ T_ i \to T\} _{i \in I}$ such that each $U_ j$ is an affine scheme. Moreover, we may choose each $U_ j$ to be open affine in one of the $T_ i$.

Proof. This follows directly from the definitions using that a morphism which is flat and locally of finite presentation is open, see Morphisms, Lemma 29.25.10. $\square$

Thus we define the corresponding standard coverings of affines as follows.

Definition 34.7.5. Let $T$ be an affine scheme. A standard fppf covering of $T$ is a family $\{ f_ j : U_ j \to T\} _{j = 1, \ldots , m}$ with each $U_ j$ is affine, flat and of finite presentation over $T$ and $T = \bigcup f_ j(U_ j)$.

Definition 34.7.6. A big fppf site is any site $\mathit{Sch}_{fppf}$ as in Sites, Definition 7.6.2 constructed as follows:

1. Choose any set of schemes $S_0$, and any set of fppf coverings $\text{Cov}_0$ among these schemes.

2. As underlying category take any category $\mathit{Sch}_\alpha$ constructed as in Sets, Lemma 3.9.2 starting with the set $S_0$.

3. Choose any set of coverings as in Sets, Lemma 3.11.1 starting with the category $\mathit{Sch}_\alpha$ and the class of fppf coverings, and the set $\text{Cov}_0$ chosen above.

See the remarks following Definition 34.3.5 for motivation and explanation regarding the definition of big sites.

Before we continue with the introduction of the big fppf site of a scheme $S$, let us point out that the topology on a big fppf site $\mathit{Sch}_{fppf}$ is in some sense induced from the fppf topology on the category of all schemes.

Lemma 34.7.7. Let $\mathit{Sch}_{fppf}$ be a big fppf site as in Definition 34.7.6. Let $T \in \mathop{\mathrm{Ob}}\nolimits (\mathit{Sch}_{fppf})$. Let $\{ T_ i \to T\} _{i \in I}$ be an arbitrary fppf covering of $T$.

1. There exists a covering $\{ U_ j \to T\} _{j \in J}$ of $T$ in the site $\mathit{Sch}_{fppf}$ which refines $\{ T_ i \to T\} _{i \in I}$.

2. If $\{ T_ i \to T\} _{i \in I}$ is a standard fppf covering, then it is tautologically equivalent to a covering of $\mathit{Sch}_{fppf}$.

3. If $\{ T_ i \to T\} _{i \in I}$ is a Zariski covering, then it is tautologically equivalent to a covering of $\mathit{Sch}_{fppf}$.

Proof. For each $i$ choose an affine open covering $T_ i = \bigcup _{j \in J_ i} T_{ij}$ such that each $T_{ij}$ maps into an affine open subscheme of $T$. By Lemma 34.7.3 the refinement $\{ T_{ij} \to T\} _{i \in I, j \in J_ i}$ is an fppf covering of $T$ as well. Hence we may assume each $T_ i$ is affine, and maps into an affine open $W_ i$ of $T$. Applying Sets, Lemma 3.9.9 we see that $W_ i$ is isomorphic to an object of $\mathit{Sch}_{fppf}$. But then $T_ i$ as a finite type scheme over $W_ i$ is isomorphic to an object $V_ i$ of $\mathit{Sch}_{fppf}$ by a second application of Sets, Lemma 3.9.9. The covering $\{ V_ i \to T\} _{i \in I}$ refines $\{ T_ i \to T\} _{i \in I}$ (because they are isomorphic). Moreover, $\{ V_ i \to T\} _{i \in I}$ is combinatorially equivalent to a covering $\{ U_ j \to T\} _{j \in J}$ of $T$ in the site $\mathit{Sch}_{fppf}$ by Sets, Lemma 3.9.9. The covering $\{ U_ j \to T\} _{j \in J}$ is a refinement as in (1). In the situation of (2), (3) each of the schemes $T_ i$ is isomorphic to an object of $\mathit{Sch}_{fppf}$ by Sets, Lemma 3.9.9, and another application of Sets, Lemma 3.11.1 gives what we want. $\square$

Definition 34.7.8. Let $S$ be a scheme. Let $\mathit{Sch}_{fppf}$ be a big fppf site containing $S$.

1. The big fppf site of $S$, denoted $(\mathit{Sch}/S)_{fppf}$, is the site $\mathit{Sch}_{fppf}/S$ introduced in Sites, Section 7.25.

2. The big affine fppf site of $S$, denoted $(\textit{Aff}/S)_{fppf}$, is the full subcategory of $(\mathit{Sch}/S)_{fppf}$ whose objects are affine $U/S$. A covering of $(\textit{Aff}/S)_{fppf}$ is any covering $\{ U_ i \to U\}$ of $(\mathit{Sch}/S)_{fppf}$ which is a standard fppf covering.

It is not completely clear that the big affine fppf site is a site. We check this now.

Lemma 34.7.9. Let $S$ be a scheme. Let $\mathit{Sch}_{fppf}$ be a big fppf site containing $S$. Then $(\textit{Aff}/S)_{fppf}$ is a site.

Proof. Let us show that $(\textit{Aff}/S)_{fppf}$ is a site. Reasoning as in the proof of Lemma 34.4.9 it suffices to show that the collection of standard fppf coverings of affines satisfies properties (1), (2) and (3) of Sites, Definition 7.6.2. This is clear since for example, given a standard fppf covering $\{ T_ i \to T\} _{i\in I}$ and for each $i$ we have a standard fppf covering $\{ T_{ij} \to T_ i\} _{j\in J_ i}$, then $\{ T_{ij} \to T\} _{i \in I, j\in J_ i}$ is a standard fppf covering because $\bigcup _{i\in I} J_ i$ is finite and each $T_{ij}$ is affine. $\square$

Lemma 34.7.10. Let $S$ be a scheme. Let $\mathit{Sch}_{fppf}$ be a big fppf site containing $S$. The underlying categories of the sites $\mathit{Sch}_{fppf}$, $(\mathit{Sch}/S)_{fppf}$, and $(\textit{Aff}/S)_{fppf}$ have fibre products. In each case the obvious functor into the category $\mathit{Sch}$ of all schemes commutes with taking fibre products. The category $(\mathit{Sch}/S)_{fppf}$ has a final object, namely $S/S$.

Proof. For $\mathit{Sch}_{fppf}$ it is true by construction, see Sets, Lemma 3.9.9. Suppose we have $U \to S$, $V \to U$, $W \to U$ morphisms of schemes with $U, V, W \in \mathop{\mathrm{Ob}}\nolimits (\mathit{Sch}_{fppf})$. The fibre product $V \times _ U W$ in $\mathit{Sch}_{fppf}$ is a fibre product in $\mathit{Sch}$ and is the fibre product of $V/S$ with $W/S$ over $U/S$ in the category of all schemes over $S$, and hence also a fibre product in $(\mathit{Sch}/S)_{fppf}$. This proves the result for $(\mathit{Sch}/S)_{fppf}$. If $U, V, W$ are affine, so is $V \times _ U W$ and hence the result for $(\textit{Aff}/S)_{fppf}$. $\square$

Next, we check that the big affine site defines the same topos as the big site.

Lemma 34.7.11. Let $S$ be a scheme. Let $\mathit{Sch}_{fppf}$ be a big fppf site containing $S$. The functor $(\textit{Aff}/S)_{fppf} \to (\mathit{Sch}/S)_{fppf}$ is cocontinuous and induces an equivalence of topoi from $\mathop{\mathit{Sh}}\nolimits ((\textit{Aff}/S)_{fppf})$ to $\mathop{\mathit{Sh}}\nolimits ((\mathit{Sch}/S)_{fppf})$.

Proof. The notion of a special cocontinuous functor is introduced in Sites, Definition 7.29.2. Thus we have to verify assumptions (1) – (5) of Sites, Lemma 7.29.1. Denote the inclusion functor $u : (\textit{Aff}/S)_{fppf} \to (\mathit{Sch}/S)_{fppf}$. Being cocontinuous just means that any fppf covering of $T/S$, $T$ affine, can be refined by a standard fppf covering of $T$. This is the content of Lemma 34.7.4. Hence (1) holds. We see $u$ is continuous simply because a standard fppf covering is a fppf covering. Hence (2) holds. Parts (3) and (4) follow immediately from the fact that $u$ is fully faithful. And finally condition (5) follows from the fact that every scheme has an affine open covering. $\square$

Next, we establish some relationships between the topoi associated to these sites.

Lemma 34.7.12. Let $\mathit{Sch}_{fppf}$ be a big fppf site. Let $f : T \to S$ be a morphism in $\mathit{Sch}_{fppf}$. The functor

$u : (\mathit{Sch}/T)_{fppf} \longrightarrow (\mathit{Sch}/S)_{fppf}, \quad V/T \longmapsto V/S$

is cocontinuous, and has a continuous right adjoint

$v : (\mathit{Sch}/S)_{fppf} \longrightarrow (\mathit{Sch}/T)_{fppf}, \quad (U \to S) \longmapsto (U \times _ S T \to T).$

They induce the same morphism of topoi

$f_{big} : \mathop{\mathit{Sh}}\nolimits ((\mathit{Sch}/T)_{fppf}) \longrightarrow \mathop{\mathit{Sh}}\nolimits ((\mathit{Sch}/S)_{fppf})$

We have $f_{big}^{-1}(\mathcal{G})(U/T) = \mathcal{G}(U/S)$. We have $f_{big, *}(\mathcal{F})(U/S) = \mathcal{F}(U \times _ S T/T)$. Also, $f_{big}^{-1}$ has a left adjoint $f_{big!}$ which commutes with fibre products and equalizers.

Proof. The functor $u$ is cocontinuous, continuous, and commutes with fibre products and equalizers. Hence Sites, Lemmas 7.21.5 and 7.21.6 apply and we deduce the formula for $f_{big}^{-1}$ and the existence of $f_{big!}$. Moreover, the functor $v$ is a right adjoint because given $U/T$ and $V/S$ we have $\mathop{Mor}\nolimits _ S(u(U), V) = \mathop{Mor}\nolimits _ T(U, V \times _ S T)$ as desired. Thus we may apply Sites, Lemmas 7.22.1 and 7.22.2 to get the formula for $f_{big, *}$. $\square$

Lemma 34.7.13. Given schemes $X$, $Y$, $Y$ in $(\mathit{Sch}/S)_{fppf}$ and morphisms $f : X \to Y$, $g : Y \to Z$ we have $g_{big} \circ f_{big} = (g \circ f)_{big}$.

Proof. This follows from the simple description of pushforward and pullback for the functors on the big sites from Lemma 34.7.12. $\square$

[1] The letters fppf stand for “fidèlement plat de présentation finie”.

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).


text:
# Find dy/dx if y = .. and u = ..

I'm not absolutely sure on how I can deal with this problem with this problem:

Find $\dfrac{dy}{dx}$ if $y = 2u^2 - 3u$ and $u = 4x - 1$

I am trying to use the chain rule on it.. $$\dfrac{dy}{dx} = \dfrac{dy}{du} \dfrac{du}{dx}$$

My work so far: $$\dfrac{d}{du}(2u^2-3u) * \dfrac{d}{dx}(4x-1) = (4u-3)(4)$$

However I am not absolutely sure I am doing it right.. and I don't have the answer in my book.

Thanks for help, it's appreciated !

EDIT: typos.

-
Note that $\frac{dy}{dx}$ should be given in terms of $x$ and not in terms of $u$. If only there was some way of seeing $u$ as a function of $x$...... – Arthur Fischer Mar 11 '12 at 18:42

What you did is correct, so the final step of yours

$$(4u-3)(4) = 4(4(4x-1)-3) = 16(4x-1)-12 = 64x-16-12 = 64x-28$$

-

You are correct. But, then you should substitute $u=4x-1$ back in at the end to get

$$4(4x-1)(4).$$

-

You can also simplify $$y = 2u^2 - 3u = 2(4x-1)^2-3(4x-1) = 32x^2-28x+5$$ Then $$\frac{dy}{dx} = 64 x - 28$$

-
Wow.. our teacher didnt taught us this way of doing it.. it's really simple and it works for every similar problems I have so far... – Nex Mar 11 '12 at 18:58
@Nex it will only work if substitution will leave you with $y = f(x)$ and no $u$'s. Also, your teacher probably wants you to practice the chain rule. – user2468 Mar 11 '12 at 19:00
@Nex: Expansion is only practical if the exponents are relatively small. Imagine trying it for $y=u^{10} +1$. – Patrick Mar 11 '12 at 20:48


text:
Vector Implementation C++

I have attempted to implement a similar version of the STL Vector; several functions are missing but I'd like a few words of advice on whether I am indeed on the right track or whether I should change my approach.

My objective is to understand how the vector works from behind the scenes and not to replace or use it for my own applications. I would like to eventually continue this process for all the STL containers.

namespace mystl
{
template <typename T>
class Vector
{
private:
std::unique_ptr<T[]> values;
std::size_t m_size;
std::size_t m_capacity;
unsigned int m_capacity_inc;

protected:
std::unique_ptr<T[]> get_values();
public:
/* Type definitions */
typedef T* iterator;
typedef const T* const const_iterator;

/* default constructor */
explicit Vector();
/* filling constructor*/
explicit Vector(std::size_t num, const T& val = T());
/* Copy constructor needs to use move since copy is a deleted function in unique_ptr*/
explicit Vector(const Vector<T>& v);
/* Move constructor */
explicit Vector(Vector<T>&& v);
/* Initializer list constructor */
explicit Vector(std::initializer_list<T> l);

/* iterator functions */
iterator begin();
iterator end();

/* capacity info functions */
std::size_t size() const;
std::size_t capacity() const;
bool empty() const;

/* modifier functions*/
void push_back(T t);
void pop_back();
void clear();

void resize(std::size_t new_size);

/* element access*/
T& operator[](int index)
{
return values[index];
}
};

/* move constructor */
template <typename T>
Vector<T>::Vector(Vector<T>&& v)
{
m_capacity = v.capacity();
m_size = v.size();
m_capacity_inc = m_capacity / 2;
values = (v.get_values());

v.clear();
}

/* initializer list constructor */
template <typename T>
Vector<T>::Vector(std::initializer_list<T> l)
{
m_size = 0;
m_capacity = l.size();
m_capacity_inc = m_size / 2;
values = std::make_unique<T[]>(m_capacity);
for (auto val : l)
{
push_back(val);
}
}

/* check is vector is empty */
template <typename T>
bool Vector<T>::empty() const
{
return m_size == 0;
}

/* returns pointer to first vector element */
template <typename T>
typename Vector<T>::iterator Vector<T>::begin()
{
return values.get();
}

/* returns pointer to last vector element */
template <typename T>
typename Vector<T>::iterator Vector<T>::end()
{
return values.get() + m_size;
}

/* size private member getter */
template <typename T>
std::size_t Vector<T>::size() const
{
return m_size;
}

/* capacity private member getter */
template <typename T>
std::size_t Vector<T>::capacity() const
{
return m_capacity;
}

/* pushes new value to the end of the vector*/
template <typename T>
void Vector<T>::push_back(T t)
{
if (m_size >= m_capacity)
{
/* size has reached capacity so we must reallocate a new, larger array */
m_capacity = m_capacity + m_capacity_inc;
/* double the capacity increase size */
m_capacity_inc = m_capacity_inc << 1;
/* allocate the new memory for the vector*/
std::unique_ptr<T[]> new_vec = std::make_unique<T[]>(m_capacity);
/* copy the old values to the new array */
for (std::size_t index = 0; index < m_size; ++index)
{
new_vec[index] = values[index];
}
/* move ownership of the new array to the current vector pointer */
values = std::move(new_vec);
}
/* input the new value and increase the size; */
values[m_size++] = t;
}

/* removes the last item and deletes the memory area related to that object and decreases the size. capacity is not affected.*/
template <typename T>
void Vector<T>::pop_back()
{
(values)[m_size - 1].~T();
--m_size;
}

/* clear function resets capacity info and deallocates memory.*/
template <typename T>
void Vector<T>::clear()
{
m_size = 0;
m_capacity = 0;
m_capacity_inc = 1;
values.reset();
}

/* resizes the container to the argument size. if the new size is less than the old size, values after the new_size are set as the default value of the
type of the template object */
template<typename T>
void Vector<T>::resize(std::size_t new_size)
{
auto new_array = std::make_unique<T[]>(new_size);
m_capacity = new_size;
m_capacity_inc = new_size;
int array_end = m_size < new_size ? m_size : new_size;

for (auto i = 0; i < array_end; i++)
{
new_array = values[i];
}

values = std::move(new_array);
m_size = new_size;

}

/* a protected function that returns the container array. */
template <typename T>
std::unique_ptr<T[]> Vector<T>::get_values()
{
/* returns an l value reference */
return std::move(values);
}

/* default vector constructor, with an empty array allocated of 0 size. */
template <typename T>
Vector<T>::Vector()
{
m_size = 0;
m_capacity = 0;
m_capacity_inc = 1;
values = std::make_unique<T[]>(m_capacity);
}

/* constructs container with size and capacity of the argument, with all values initiated with the value argument */
template <typename T>
Vector<T>::Vector(std::size_t num, const T& val)
{
/* allocate memory */
m_size = m_capacity = num;
m_capacity_inc = num / 2;
values = std::make_unique<T[]>(num);

/* initialize values */
for (std::size_t i = 0; i < m_size; ++i)
{
values[i] = val;
}
}

/* copy constructor: copies the capacity information and values from the argument vector*/
template <typename T>
Vector<T>::Vector(const Vector<T>& v)
{
m_capacity = v.m_capacity;
m_size = v.size();
m_capacity_inc = m_capacity / 2;
values = std::make_unique<T[]>(m_capacity);

for (auto i = 0; i < m_size; ++i)
{
values[i] = v.values[i];
}
}
}

I have omitted several functions which I will continue to implement - such as shrink_to_fit, reverse iterators, emplacers, operator overlaods.

Allocation in my case is being performed using smart pointers - should I opt to use the same allocator functionality implemented by the native vector or would that be an exercise in futility?

• Welcome to Code Review! GOod job on your first quesiton. – SirPython Jan 10 '16 at 19:18
• Good question. Unfortunately, the short answer (IMO) is no, you're not headed in the right direction, at least in some respects. In particular, using new[] (even when/if hidden inside make_unique) can't work correctly. To make it work correctly, you want to allocate raw memory with operator new, then use placement new to create objects in that memory. As it is now, you're creating actual objects in the unused part of the memory, which isn't allowed. – Jerry Coffin Jan 10 '16 at 22:30
• Very good of you to state your goal in coding this. – greybeard Jan 11 '16 at 8:52

Placement New

Your main problem (as described by Jerry Coffin in the comments) is that you are creating objects when you should not be.

If we look at your copy constructor:

Vector<T>::Vector(const Vector<T>& v)
{
// Here you are allocating several objects of type T
// This actually calls the default constructor of T
values = std::make_unique<T[]>(m_capacity);
//     Two problems with this:
//       1) Not all types have default constructors.
//       2) In the loop below you are then calling the assignment operator.
//          Which means you are doing twice the work you need to do.

for (auto i = 0; i < m_size; ++i)
{
values[i] = v.values[i];
}
}

Next lets look at re-size

void Vector<T>::resize(std::size_t new_size)
{
// The problem here.
// If you re-size to double the number of elements (say an extra 'n')
//    You are creating n elements that you don't need.
//    Especially if the constructor of T is expensive of uses
//    precious resources you don't want to do that. You do want to reserve
//    the space but you don't actually want to construct the object
//    until the size is correct
//
//    And then you want to construct the object in place not call the
//    constructor then perform a copy construction on top of that.
auto new_array = std::make_unique<T[]>(new_size);
}

This is where placement new comes in.

 // Create your buffer where the data is going to be placed.
// But do not do any work on construction.
char*  data = new char[sizeof(T) * countOfObjects];

// If you want to copy data into the buffer you use placement new.
T*  dst = reinterpret_cast<T*>(data);
for(auto i = 0;i < src.size(); ++i) {
new (dst + i) T(src[i]);    // Copy construct using placement new.
}

Memory Management

Normally there are two ways to do memory management. Smart pointers and containers. These are complimentary methods and you don't usually mix them together.

So I would expect a vector to do its own memory management and not delegate this work to a smart pointer (though you can).

• In this context is char* data = new char[sizeof(T) * countOfObjects]; equivalent to static_cast<T*>(::operator new(sizeof(T) * countofObjects))? Both allocate that many Bytes without creating/placing the T objects there. Am I correct? Great answer. – Nik-Lz Oct 27 at 10:05
• @Nik-Lz Yes. But also note that both guarantee correct alignment for objects of type T – Martin York Oct 27 at 17:27
• How so? They don't specify alignment. It's just chars/bytes. Wouldn't we have to prepend with alignas(T)? – Nik-Lz Oct 27 at 18:11
• @Nik-Lz: The new-array-expression (i.e. new Type[size]) is a call to ::operator new[]. See Section: 8.5.2.4 New Paragraph 11 to see the alignment properties of ::operator new[] then see Section 6.6.5 Alignment Paragraph 5 to see the guarantees that provide. See the comments at the bottom of this page: lokiastari.com/blog/2016/02/27/vector/index.html – Martin York Oct 28 at 0:45

I think it is well written for the most part. I see only a handful of things that you could change:

Use the standard algorithms

They make your code safer, shorter and convey intent more clearly.

/* initialize values */
for (std::size_t i = 0; i < m_size; ++i)
{
values[i] = val;
}

The above is std::fill():

std::fill(values, values + m_size, val);

for (auto i = 0; i < m_size; ++i)
{
values[i] = v.values[i];
}

That's std::copy():

std::copy(values, values + m_size, v.values);

Focus on adding an iterator class

If you're going to extend this further, I'd suggest now adding real iterator types. Right now you're using plain pointers, which provide no error checking or type safety. Implementing iterators for the vector should be a good exercise. Be sure to also add global begin/end overloads for the Vector iterators so that you can use your vector type in a range-based for.

• Some parts of your code are excessively commented. The main case being inside push_back. Too obvious and verbose comments that just describe what each line is doing are distracting from the actual code. Let the code speak for itself.

• Why is get_values protected? I don't suppose any other class inherits from Vector, so the expected access level is private.

• You need a const overload of operator [], otherwise is is impossible to access elements on a const Vector<T>. Same for begin/end Declare overloads that are const and return const_iterator. You should also provide the new cbegin/cend/ pair.

• Take a look at std::vector::push_back. It comes in two flavors, one taking a const reference and one taking a && move-ref. This avoids unnecessary copies when you're storing large expensive to copy objects. Also consider emplace_back.

• Your clear() deallocates memory, but that might be quite inefficient. In most usage scenarios, when you clear a vector you're just prepping to reuse the vector with a new collection, so if clear releases the memory you'd have to allocate again. Even though if the new collection is smaller, avoiding reallocations is still worth most of the time to avoid memory fragmentation overhead. Make clear() just destroy the objects, while shrink_to_fit() releases the memory.

• I think you made a good choice by using unique_ptr for the baking store. Of course that, as Jerry mentioned in a comment, using make_unique (or even new T[]) creates default constructed objects, and that's not the behavior of std::vector. When you reserve with the standard vector, the new memory is left uninitialized. But I don't suppose that's a major concern in your case. Using a unique_ptr is better than raw new/delete, any day of the week.

• Annotate the non-throwing methods with noexcept. Optional, but recommended in modern C++.


text: Journal Home Page Cumulative Index List of all Volumes Complete Contentsof this Volume Previous Article Journal of Convex Analysis 26 (2019), No. 4, 1145--1174Copyright Heldermann Verlag 2019 Positive Solutions for Nonlinear Robin Problems with Concave Terms Leszek Gasinski Dept. of Mathematics, Pedagogical University, 30-084 Cracow, Poland leszek.gasinski@up.krakow.pl Nikolaos S. Papageorgiou Dept. of Mathematics, National Technical University, Zografou Campus, Athens 15780, Greece npapg@math.ntua.gr Krzysztof Winowski Fac. of Mathematics and Computer Science, Jagiellonian University, 30-348 Cracow, Poland [Abstract-pdf] We consider a parametric Robin problem driven by the $p$-Laplacian plus a potential. In the reaction we have the combined effects of a parametric concave term and of a $(p \!-\! 1)$-linear perturbation. We consider the case of uniform nonresonance with respect to the principal eigenvalue $\widehat{\lambda}_1>0$ and the case of nonuniform nonresonance with respect to $\widehat{\lambda}_1>0$. For both cases we prove a bifurcation-type theorem describing the dependence on the parameter $\lambda>0$ of the set of positive solutions. We also establish the existence of a smallest positive solution $\widehat{u}^*_{\lambda}$ for every admissible parameter $\lambda>0$ and determine the monotonicity and continuity properties of the map $\lambda\longmapsto\widehat{u}_{\lambda}^*$. Keywords: p-Laplacian, concave nonlinearity, uniform nonresonance, nonuniform nonresonance, bifurcation-type theorem, minimal positive solution. MSC: 35J20, 35J60 [ Fulltext-pdf  (202  KB)] for subscribers only.


text:
# zbMATH — the first resource for mathematics

The spike response model: A framework to predict neuronal spike trains. (English) Zbl 1049.92009
Kaynak, Okyay (ed.) et al., Artificial neural networks and neural information processing — ICANN/ICONIP 2003. Joint international conference ICANN/ICONIP 2003, Istanbul, Turkey, 26–29, 2003. Proceedings. Berlin: Springer (ISBN 3-540-40408-2/pbk). Lect. Notes Comput. Sci. 2714, 846-853 (2003).
Summary: We propose a simple method to map a generic threshold model, namely the Spike Response Model, to artificial data of neuronal activity using a minimal amount of a priori information. Here, data are generated by a detailed mathematical model of neuronal activity. The model neuron is driven with in-vivo-like current injected, and we test to which extent it is possible to predict the spike train of the detailed neuron model from that of the Spike Response Model.
In particular, we look at the number of spikes correctly predicted within a biologically relevant time window. We find that the Spike Response Model achieves prediction of up to 80% of the spikes with correct timing ($$\pm2$$ms). Other characteristics of activity, such as mean rate and coefficient of variation of spike trains, are predicted in the correct range as well.
For the entire collection see [Zbl 1029.00055].

##### MSC:
 92C20 Neural biology
Full Text:


text:
# Chapter 6 - Systems of Equations and Inequalities - 6-6 Systems of Linear Inequalities - Practice and Problem-Solving Exercises - Page 399: 10

#### Work Step by Step

The graph was made using graphing software. Red line: $-3x-2y\geq6$ Black line: $y < 2x+4$ Overlap of the two lines is the solution set for the system

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
# Are we alone in the Universe? The Drake Equation

Previous “Habitable Planets” – Next “Astrobiology
There is on average one planet orbiting every star in the Universe (Swift et al., 2013; Cassan et al., 2012). If this sounds exciting, you might wanna read the previous post in this series. Our Galaxy (the Milky Way) is an immense disk of gas and stars with a diameter of about 100 000 light years, hosting about 100 billion stars and, therefore, also about 100 billion planets. Take a deep breath. Now, it turns out the Milky Way is just one of 100 billion galaxies that populate our Universe, a colossal expanding stretch of spacetime with an age of 13.7 billion years. The math is trivial: There are about 10 000 000 000 000 000 000 000 = $$10^{22}$$ planets out there. This number is extremely large. Apparently larger than the number of grains of sand found in every beach and every desert on Earth.

But how many of these planets host life? And in particular, how many planets host intelligent life we might be able to communicate with?

In order to estimate the number of technological civilizations that might exist among the stars, in 1961 Frank Drake proposed the following simple equation:

The Drake equation: it estimates the number $$N$$ of civilizations in The Milky Way Galaxy whose electromagnetic emissions are detectable. Interactive version here.


text: 5 added 19 characters in body edited Mar 15 '17 at 6:43 aaag 1,11755 silver badges1818 bronze badges Let us assume that required element is equally likelyequally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means requiresrequired element is in ith position and vice-versa. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let us assume that required element is equally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let us assume that required element is equally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means required element is in ith position and vice-versa. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer 4 added 75 characters in body edited Mar 15 '17 at 6:37 aaag 1,11755 silver badges1818 bronze badges Let us assume that required element is equally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$$$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$$$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$$$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let $$x _i$$ be a random variable. $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let us assume that required element is equally likely to be in any position between $$1$$ and $$n$$. Let $$x _i$$ be a random variable. Random variable $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$\mathbb{E}(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\mathbb{E}(x) = \frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer 3 added 75 characters in body edited Mar 15 '17 at 6:30 aaag 1,11755 silver badges1818 bronze badges Let $$x _i$$ be a random variable. $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let $$x _i$$ be a random variable. $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer Let $$x _i$$ be a random variable. $$x_i = 1$$ means requires element is in ith position. Now probability that required element is in position between $$1$$ and $$n$$ is $$Pr[x_i = 1] = \frac{1}{n}$$ Now Expected value is given by $$E(x) = 1 \times\frac{1}{n} + 2 \times \frac{1}{n} + 3 \times \frac{1}{n} +\cdots + n \times\frac{1}{n}$$ which can be written as $$\frac{n(n+1)}{2n} = \frac{(n+1)}{2}$$ which is a required answer 2 added 35 characters in body edited Mar 15 '17 at 6:17 aaag 1,11755 silver badges1818 bronze badges 1 answered Mar 15 '17 at 6:07 aaag 1,11755 silver badges1818 bronze badges


text:
### Still have math questions?

Trigonometry
Question

A building contractor is building a backyard playground and wishes to put down rubber mulch to provide safety from falls. The contractor wishes to put the mulch in $$0$$ of $$1$$ pit in the shape of a rectangular solid $$25$$ feet long, $$19$$ feet wide, and $$9$$ inches deep.

a) Determine the volume, in cubic feet, of mulch the contractor will need. When appropriate, use the $$\pi$$ key on your calculator.

b) If mulch costs $$\ 11$$ per cubic foot, what will the cost of mulch be?

a) The volume is $$\square ft ^ { 3 }$$ .

(Type an integer or decimal.)


text:
This is update 4 to my original post about predicting the NBA playoffs with R. With the Thunder beating the Spurs and the Heat losing to the Celtics, the algorithm went 1-1 on predictions, making it 5-3 so far.

Making some improvements

I have been posting for some time about incorporating more data into the models, and I finally got around to it. It is a common truism in data science that more (high-quality) data almost always leads to a better model, and it is no exception here. The fact that the 2011-2012 season was strike-shortened also meant that only relying on data from this season really limited the potential of the algorithm.

I decided to start slowly, and incorporate data from both the 2010-2011 season, and the 2011-2012 season. Due to the aforementioned strike, this actually increases the data available by 128% overall. I made no other tweaks to the algorithm in this time, so this is a good test of how much value additional data on its own can add.

The new accuracy value across both seasons is 65.6%, which means that it is predicting 1.91 times as many winners as losers. Here is the confusion matrix:

Differences between seasons

I thought it would be interesting to look at p-values between different season statistics to see if there were any significant differences between the 2010-2011 season and the 2011-2012 season. A big deal is always made about how the lockout affected different statistics, but I haven’t seen any analysis on it yet.

We can easily do a t-test on each column of the data frame with all of the per team statistics:

p_vals<-foreach(i=7:ncol(frame_2011)) %do%
{
t.test(frame_2011[,i],frame_2012[,i])\$p.value
}

We end up with a table of each calculated statistic the p-values associated with each one. A p-value indicates if there is a statistically significant difference between two distributions. In this case, we might be looking to see whether there is a statistically significant difference between rebounding in the 2010-2011 season, and the 2011-2012 season. The test gave back some interesting results. Here are some of them:

1. There was a very significant difference in the number of players who fouled out between the two seasons. In 2012, far fewer players fouled out than in 2011. Also, less personal fouls were assessed overall, which also dropped the number of free throws attempted.

2. Starters played significantly more unique positions in 2012. For example, if the starting lineup consists of a C, a PF, an SF, an SG/SF, and a PG, there are 5 unique positions. On the other hand, if it consists of a PF, a PF, an SF/SG, an SF/SG, and a PG, that is only 3 unique positions. I am not sure why this increased between seasons, but maybe it indicates the rise of more true centers? Maybe a different way of keeping track of positions?

3. 3 point percentage went down significantly from 2010-2011 to 2011-2012. Less practice time? Not clear why this happened.

4. Rebounding went up overall, as did defensive rebounding.

5. Starters played less minutes in 2011-2012 than in 2010-2011.

Predictions for Tonight

And finally, the algorithm is predicting Boston to win tonight: