text:
## 21.1 Measuring Total Output

### Learning Objectives

1. Define gross domestic product and its four major spending components and illustrate the various flows using the circular flow model.
2. Distinguish between measuring GDP as the sum of the values of final goods and services and as the sum of values added at each stage of production.
3. Distinguish between gross domestic product and gross national product.

An economy produces a mind-boggling array of goods and services. In 2007, for example, Domino’s Pizza produced 400 million pizzas. The United States Steel Corporation, the nation’s largest steel company, produced 23.6 million tons of steel. Strong Brothers Lumber Co., a Colorado firm, produced 2.1 million board feet of lumber. The Louisiana State University football team drew 722,166 fans to its home games—and won the national championship. Leonor Montenegro, a pediatric nurse in Los Angeles, delivered 387 babies and took care of 233 additional patients. A list of all the goods and services produced in any year would be virtually endless.

So—what kind of year was 2007? We would not get very far trying to wade through a list of all the goods and services produced that year. It is helpful to have instead a single number that measures total output in the economy; that number is GDP.

## The Components of GDP

We can divide the goods and services produced during any period into four broad components, based on who buys them. These components of GDP are personal consumption (C), gross private domestic investment (I), government purchases (G), and net exports (Xn). Thus

Equation 21.1

$\small GDP = consumption \: (C) + private \: investment \: (I) + government \: purchases \: (G) + net \: exports \: (X_n)$

or

$GDP = C + I + G + X_n$

We will examine each of these components, and we will see how each fits into the pattern of macroeconomic activity. Before we begin, it will be helpful to distinguish between two types of variables: stocks and flows. A flow variable is a variable that is measured over a specific period of time. A stock variable is a variable that is independent of time. Income is an example of a flow variable. To say one’s income is, for example, \$1,000 is meaningless without a time dimension. Is it \$1,000 per hour? Per day? Per week? Per month? Until we know the time period, we have no idea what the income figure means. The balance in a checking account is an example of a stock variable. When we learn that the balance in a checking account is \$1,000, we know precisely what that means; we do not need a time dimension. We will see that stock and flow variables play very different roles in macroeconomic analysis.

## Personal Consumption

Personal consumption is a flow variable that measures the value of goods and services purchased by households during a time period. Purchases by households of groceries, health-care services, clothing, and automobiles—all are counted as consumption.

The production of consumer goods and services accounts for about 70% of total output. Because consumption is such a large part of GDP, economists seeking to understand the determinants of GDP must pay special attention to the determinants of consumption. In a later chapter we will explore these determinants and the impact of consumption on economic activity.

Personal consumption represents a demand for goods and services placed on firms by households. In the chapter on demand and supply, we saw how this demand could be presented in a circular flow model of the economy. Figure 21.1 “Personal Consumption in the Circular Flow” presents a circular flow model for an economy that produces only personal consumption goods and services. (We will add the other components of GDP to the circular flow as we discuss them.) Spending for these goods flows from households to firms; it is the arrow labeled “Personal consumption.” Firms produce these goods and services using factors of production: labor, capital, and natural resources. These factors are ultimately owned by households. The production of goods and services thus generates income to households; we see this income as the flow from firms to households labeled “Factor incomes” in the exhibit.

Figure 21.1 Personal Consumption in the Circular Flow

Personal consumption spending flows from households to firms. In return, consumer goods and services flow from firms to households. To produce the goods and services households demand, firms employ factors of production owned by households. There is thus a flow of factor services from households to firms, and a flow of payments of factor incomes from firms to households.

In exchange for payments that flow from households to firms, there is a flow of consumer goods and services from firms to households. This flow is shown in Figure 21.1 “Personal Consumption in the Circular Flow” as an arrow going from firms to households. When you buy a soda, for example, your payment to the store is part of the flow of personal consumption; the soda is part of the flow of consumer goods and services that goes from the store to a household—yours.

Similarly, the lower arrow in Figure 21.1 “Personal Consumption in the Circular Flow” shows the flow of factors of production—labor, capital, and natural resources—from households to firms. If you work for a firm, your labor is part of this flow. The wages you receive are part of the factor incomes that flow from firms to households.

There is a key difference in our interpretation of the circular flow picture in Figure 21.1 “Personal Consumption in the Circular Flow” from our analysis of the same model in the demand and supply chapter. There, our focus was microeconomics, which examines individual units of the economy. In thinking about the flow of consumption spending from households to firms, we emphasized demand and supply in particular markets—markets for such things as blue jeans, haircuts, and apartments. In thinking about the flow of income payments from firms to households, we focused on the demand and supply for particular factors of production, such as textile workers, barbers, and apartment buildings. Because our focus now is macroeconomics, the study of aggregates of economic activity, we will think in terms of the total of personal consumption and the total of payments to households.

## Private Investment

Gross private domestic investment is the value of all goods produced during a period for use in the production of other goods and services. Like personal consumption, gross private domestic investment is a flow variable. It is often simply referred to as “private investment.” A hammer produced for a carpenter is private investment. A printing press produced for a magazine publisher is private investment, as is a conveyor-belt system produced for a manufacturing firm. Capital includes all the goods that have been produced for use in producing other goods; it is a stock variable. Private investment is a flow variable that adds to the stock of capital during a period.

The term “investment” can generate confusion. In everyday conversation, we use the term “investment” to refer to uses of money to earn income. We say we have invested in a stock or invested in a bond. Economists, however, restrict “investment” to activities that increase the economy’s stock of capital. The purchase of a share of stock does not add to the capital stock; it is not investment in the economic meaning of the word. We refer to the exchange of financial assets, such as stocks or bonds, as financial investment to distinguish it from the creation of capital that occurs as the result of investment. Only when new capital is produced does investment occur. Confusing the economic concept of private investment with the concept of financial investment can cause misunderstanding of the way in which key components of the economy relate to one another.

Gross private domestic investment includes three flows that add to or maintain the nation’s capital stock: expenditures by business firms on new buildings, plants, tools, equipment, and software that will be used in the production of goods and services; expenditures on new residential housing; and changes in business inventories. Any addition to a firm’s inventories represents an addition to investment; a reduction subtracts from investment. For example, if a clothing store stocks 1,000 pairs of jeans, the jeans represent an addition to inventory and are part of gross private domestic investment. As the jeans are sold, they are subtracted from inventory and thus subtracted from investment.

By recording additions to inventories as investment and reductions from inventories as subtractions from investment, the accounting for GDP records production in the period in which it occurs. Suppose, for example, that Levi Strauss manufactures 1 million pairs of jeans late in 2007 and distributes them to stores at the end of December. The jeans will be added to inventory; they thus count as investment in 2007 and enter GDP for that year. Suppose they are sold in January 2008. They will be counted as consumption in GDP for 2008 but subtracted from inventory, and from investment. Thus, the production of the jeans will add to GDP in 2007, when they were produced. They will not count in 2008, save for any increase in the value of the jeans resulting from the services provided by the retail stores that sold them.

Private investment accounts for about 16% of GDP and at times even less. Despite its relatively small share of total economic activity, private investment plays a crucial role in the macroeconomy for two reasons:

1. Private investment represents a choice to forgo current consumption in order to add to the capital stock of the economy. Private investment therefore adds to the economy’s capacity to produce and shifts its production possibilities curve outward. Investment is thus one determinant of economic growth, which is explored in another chapter.
2. Private investment is a relatively volatile component of GDP; it can change dramatically from one year to the next. Fluctuations in GDP are often driven by fluctuations in private investment. We will examine the determinants of private investment in a chapter devoted to the study of investment.

Private investment represents a demand placed on firms for the production of capital goods. While it is a demand placed on firms, it flows from firms. In the circular flow model in Figure 21.2 “Private Investment in the Circular Flow”, we see a flow of investment going from firms to firms. The production of goods and services for consumption generates factor incomes to households; the production of capital goods for investment generates income to households as well.

Figure 21.2 Private Investment in the Circular Flow

Private investment constitutes a demand placed on firms by other firms. It also generates factor incomes for households. To simplify the diagram, only the spending flows are shown—the corresponding flows of goods and services have been omitted.

Figure 21.2 “Private Investment in the Circular Flow” shows only spending flows and omits the physical flows represented by the arrows in Figure 21.1 “Personal Consumption in the Circular Flow”. This simplification will make our analysis of the circular flow model easier. It will also focus our attention on spending flows, which are the flows we will be studying.

## Government Purchases

Government agencies at all levels purchase goods and services from firms. They purchase office equipment, vehicles, buildings, janitorial services, and so on. Many government agencies also produce goods and services. Police departments produce police protection. Public schools produce education. The National Aeronautics and Space Administration (NASA) produces space exploration.

Government purchases are the sum of purchases of goods and services from firms by government agencies plus the total value of output produced by government agencies themselves during a time period. Government purchases make up about 20% of GDP.

Government purchases are not the same thing as government spending. Much government spending takes the form of transfer payments, which are payments that do not require the recipient to produce a good or service in order to receive them. Transfer payments include Social Security and other types of assistance to retired people, welfare payments to poor people, and unemployment compensation to people who have lost their jobs. Transfer payments are certainly significant—they account for roughly half of all federal government spending in the United States. They do not count in a nation’s GDP, because they do not reflect the production of a good or service.

Government purchases represent a demand placed on firms, represented by the flow shown in Figure 21.3 “Government Purchases in the Circular Flow”. Like all the components of GDP, the production of goods and services for government agencies creates factor incomes for households.

Figure 21.3 Government Purchases in the Circular Flow

Purchases of goods and services by government agencies create demands on firms. As firms produce these goods and services, they create factor incomes for households.

## Net Exports

Sales of a country’s goods and services to buyers in the rest of the world during a particular time period represent its exports. A purchase by a Japanese buyer of a Ford Taurus produced in the United States is a U.S. export. Exports also include such transactions as the purchase of accounting services from a New York accounting firm by a shipping line based in Hong Kong or the purchase of a ticket to Disney World by a tourist from Argentina. Imports are purchases of foreign-produced goods and services by a country’s residents during a period. United States imports include such transactions as the purchase by Americans of cars produced in Japan or tomatoes grown in Mexico or a stay in a French hotel by a tourist from the United States. Subtracting imports from exports yields net exports.

Equation 21.2

$Exports \: (X) - imports \: (M) = net \: exports \: (X_n)$

In the third quarter of 2010, foreign buyers purchased \$1,847.0 billion worth of goods and services from the United States. In the same year, U.S. residents, firms, and government agencies purchased \$2,339.1 billion worth of goods and services from foreign countries. The difference between these two figures, −\$552.2 billion, represented the net exports of the U.S. economy in the third quarter of 2010. Net exports were negative because imports exceeded exports. Negative net exports constitute a trade deficit. The amount of the deficit is the amount by which imports exceed exports. When exports exceed imports there is a trade surplus. The magnitude of the surplus is the amount by which exports exceed imports.

The United States has recorded more deficits than surpluses since World War II, but the amounts have typically been relatively small, only a few billion dollars. The trade deficit began to soar, however, in the 1980s and again in the 2000s. We will examine the reasons for persistent trade deficits in another chapter. The rest of the world plays a key role in the domestic economy and, as we will see later in the book, there is nothing particularly good or bad about trade surpluses or deficits. Goods and services produced for export represent roughly 13% of GDP, and the goods and services the United States imports add significantly to our standard of living.

In the circular flow diagram in Figure 21.4 “Net Exports in the Circular Flow”, net exports are shown with an arrow connecting firms to the rest of the world. The balance between the flows of exports and imports is net exports. When there is a trade surplus, net exports are positive and add spending to the circular flow. A trade deficit implies negative net exports; spending flows from firms to the rest of the world.

Figure 21.4 Net Exports in the Circular Flow

Net exports represent the balance between exports and imports. Net exports can be positive or negative. If they are positive, net export spending flows from the rest of the world to firms. If they are negative, spending flows from firms to the rest of the world.

The production of goods and services for personal consumption, private investment, government purchases, and net exports makes up a nation’s GDP. Firms produce these goods and services in response to demands from households (personal consumption), from other firms (private investment), from government agencies (government purchases), and from the rest of the world (net exports). All of this production creates factor income for households. Figure 21.5 “Spending in the Circular Flow Model” shows the circular flow model for all the spending flows we have discussed. Each flow is numbered for use in the exercise at the end of this section.

Figure 21.5 Spending in the Circular Flow Model

GDP equals the sum of production by firms of goods and services for personal consumption (1), private investment (2), government purchases (3), and net exports (4). The circular flow model shows these flows and shows that the production of goods and services generates factor incomes (5) to households.

The circular flow model identifies some of the forces at work in the economy, forces that we will be studying in later chapters. For example, an increase in any of the flows that place demands on firms (personal consumption, private investment, government purchases, and exports) will induce firms to expand their production. This effect is characteristic of the expansion phase of the business cycle. An increase in production will require firms to employ more factors of production, which will create more income for households. Households are likely to respond with more consumption, which will induce still more production, more income, and still more consumption. Similarly, a reduction in any of the demands placed on firms will lead to a reduction in output, a reduction in firms’ use of factors of production, a reduction in household incomes, a reduction in income, and so on. This sequence of events is characteristic of the contraction phase of the business cycle. Much of our work in macroeconomics will involve an analysis of the forces that prompt such changes in demand and an examination of the economy’s response to them.

Figure 21.6 “Components of GDP, 2010 (Q3) in Billions of Dollars” shows the size of the components of GDP in 2010. We see that the production of goods and services for personal consumption accounted for about 70% of GDP. Imports exceeded exports, so net exports were negative.

Figure 21.6 Components of GDP, 2010 (Q3) in Billions of Dollars

Consumption makes up the largest share of GDP. Net exports were negative in 2010. Total GDP—the sum of personal consumption, private investment, government purchases, and net exports—equaled \$14,750.2 billion in 2010.

## Final Goods and Value Added

GDP is the total value of all final goods and services produced during a particular period valued at prices in that period. That is not the same as the total value of all goods and services produced during a period. This distinction gives us another method of estimating GDP in terms of output.

Suppose, for example, that a logger cuts some trees and sells the logs to a sawmill. The mill makes lumber and sells it to a construction firm, which builds a house. The market price for the lumber includes the value of the logs; the price of the house includes the value of the lumber. If we try to estimate GDP by adding the value of the logs, the lumber, and the house, we would be counting the lumber twice and the logs three times. This problem is called “double counting,” and the economists who compute GDP seek to avoid it.

In the case of logs used for lumber and lumber produced for a house, GDP would include the value of the house. The lumber and the logs would not be counted as additional production because they are intermediate goods that were produced for use in building the house.

Another approach to estimating the value of final production is to estimate for each stage of production the value added, the amount by which the value of a firm’s output exceeds the value of the goods and services the firm purchases from other firms. Table 21.1 “Final Value and Value Added” illustrates the use of value added in the production of a house.

Table 21.1 Final Value and Value Added

Good Produced by Purchased by Price Value Added
Logs Logger Sawmill \$12,000 \$12,000
Lumber Sawmill Construction firm \$25,000 \$13,000
House Construction firm Household \$125,000 \$100,000
Final Value \$125,000

If we sum the value added at each stage of the production of a good or service, we get the final value of the item. The example shown here involves the construction of a house, which is produced from lumber that is, in turn, produced from logs.

Suppose the logs produced by the logger are sold for \$12,000 to a mill, and that the mill sells the lumber it produces from these logs for \$25,000 to a construction firm. The construction firm uses the lumber to build a house, which it sells to a household for \$125,000. (To simplify the example, we will ignore inputs other than lumber that are used to build the house.) The value of the final product, the house, is \$125,000. The value added at each stage of production is estimated as follows:

1. The logger adds \$12,000 by cutting the logs.
2. The mill adds \$13,000 (\$25,000 − \$12,000) by cutting the logs into lumber.
3. The construction firm adds \$100,000 (\$125,000 − \$25,000) by using the lumber to build a house.

The sum of values added at each stage (\$12,000 + \$13,000 + \$100,000) equals the final value of the house, \$125,000.

The value of an economy’s output in any period can thus be estimated in either of two ways. The values of final goods and services produced can be added directly, or the values added at each stage in the production process can be added. The Commerce Department uses both approaches in its estimate of the nation’s GDP.

## GNP: An Alternative Measure of Output

While GDP represents the most commonly used measure of an economy’s output, economists sometimes use an alternative measure. Gross national product (GNP) is the total value of final goods and services produced during a particular period with factors of production owned by the residents of a particular country.

The difference between GDP and GNP is a subtle one. The GDP of a country equals the value of final output produced within the borders of that country; the GNP of a country equals the value of final output produced using factors owned by residents of the country. Most production in a country employs factors of production owned by residents of that country, so the two measures overlap. Differences between the two measures emerge when production in one country employs factors of production owned by residents of other countries.

Suppose, for example, that a resident of Bellingham, Washington, owns and operates a watch repair shop across the Canadian–U.S. border in Victoria, British Columbia. The value of watch repair services produced at the shop would be counted as part of Canada’s GDP because they are produced in Canada. That value would not, however, be part of U.S. GDP. But, because the watch repair services were produced using capital and labor provided by a resident of the United States, they would be counted as part of GNP in the United States and not as part of GNP in Canada.

Because most production fits in both a country’s GDP as well as its GNP, there is seldom much difference between the two measures. The relationship between GDP and GNP is given by

Equation 21.3

GDP + net income received from abroad by residents of a nation = GNP

In the third quarter of 2010, for example, GDP equaled \$14,750.2 billion. We add income receipts earned by residents of the United States from the rest of the world of \$706.0 billion and then subtract income payments that went from the United States to the rest of the world of \$516.1 billion to get GNP of \$14,940.0 billion for the third quarter of 2010. GNP is often used in international comparisons of income; we shall examine those later in this chapter.

### Key Takeaways

• GDP is the sum of final goods and services produced for consumption (C), private investment (I), government purchases (G), and net exports (Xn). Thus GDP = C + I + G + Xn.
• GDP can be viewed in the context of the circular flow model. Consumption goods and services are produced in response to demands from households; investment goods are produced in response to demands for new capital by firms; government purchases include goods and services purchased by government agencies; and net exports equal exports less imports.
• Total output can be measured two ways: as the sum of the values of final goods and services produced and as the sum of values added at each stage of production.
• GDP plus net income received from other countries equals GNP. GNP is the measure of output typically used to compare incomes generated by different economies.

### Try It!

Here is a two-part exercise.

1. Suppose you are given the following data for an economy:

 Personal consumption \$1,000 Home construction 100 Increase in inventories 40 Equipment purchases by firms 60 Government purchases 100 Social Security payments to households 40 Government welfare payments 100 Exports 50 Imports 150

Identify the number of the flow in Figure 21.5 “Spending in the Circular Flow Model” to which each of these items corresponds. What is the economy’s GDP?

2. Suppose a dairy farm produces raw milk, which it sells for \$1,000 to a dairy. The dairy produces cream, which it sells for \$3,000 to an ice cream manufacturer. The ice cream manufacturer uses the cream to make ice cream, which it sells for \$7,000 to a grocery store. The grocery store sells the ice cream to consumers for \$10,000. Compute the value added at each stage of production, and compare this figure to the final value of the product produced. Report your results in a table similar to that given in Table 21.1 “Final Value and Value Added”.

Figure 21.7

401(K) 2012 – Tax – CC BY-SA 2.0.

Outside the United States, the value added tax (VAT) has become commonplace. Governments of more than 120 countries use it as their primary means of raising revenue. While the concept of the VAT originated in France in the 1920s, no country adopted it until after World War II. In 1948, France became the first country in the world to use the VAT. In 1967, Brazil became the first country in the Western Hemisphere to do so. The VAT spread to other western European and Latin American countries in the 1970s and 1980s and then to countries in the Asia/Pacific region, central European and former Soviet Union area, and Africa in the 1990s and early 2000s.

What is the VAT? It is equivalent to a sales tax on final goods and services but is collected at each stage of production.

Take the example given in Table 21.1 “Final Value and Value Added”, which is a simplified illustration of a house built in three stages. If there were a sales tax of 10% on the house, the household buying it would pay \$137,500, of which the construction firm would keep \$125,000 of the total and turn \$12,500 over to the government.

With a 10% VAT, the sawmill would pay the logger \$13,200, of which the logger would keep \$12,000 and turn \$1,200 over to the government. The sawmill would sell the lumber to the construction firm for \$27,500—keeping \$26,200, which is the \$25,000 for the lumber itself and \$1,200 it already paid in tax. The government at this stage would get \$1,300, the difference between the \$2,500 the construction firm collected as tax and the \$1,200 the sawmill already paid in tax to the logger at the previous stage. The household would pay the construction firm \$137,500. Of that total, the construction firm would turn over to the government \$10,000, which is the difference between the \$12,500 it collected for the government in tax from the household and the \$2,500 in tax that it already paid when it bought the lumber from the sawmill. The table below shows that in the end, the tax revenue generated by a 10% VAT is the same as that generated by a 10% tax on final sales.

Why bother to tax in stages instead of just on final sales? One reason is simply record keeping, since it may be difficult to determine in practice if any particular sale is the final one. In the example, the construction firm does not need to know if it is selling the house to a household or to some intermediary business.

Also, the VAT may lead to higher revenue collected. For example, even if somehow the household buying the house avoided paying the tax, the government would still have collected some tax revenue at earlier stages of production. With a tax on retail sales, it would have collected nothing. The VAT has another advantage from the point of view of government agencies. It has the appearance at each stage of taking a smaller share. The individual amounts collected are not as obvious to taxpayers as a sales tax might be.

Logs \$12,000 \$12,000 \$1,200 − \$0 = \$1,200
Lumber \$25,000 \$13,000 \$2,500 − \$1,200 = \$1,300
House \$125,000 \$100,000 \$12,500 − \$2,500 = \$10,000
Total \$16,200 −\$3,700 = \$12,500

### Answer to Try It! Problem

1. GDP equals \$1,200 and is computed as follows (the numbers in parentheses correspond to the flows in Figure 21.5 “Spending in the Circular Flow Model”):

 Personal consumption (1) \$1,000 Private investment (2) 200 Housing 100 Equipment and software 60 Inventory change 40 Government purchases (3) 100 Net exports (4) −100 GDP \$1,200

Notice that neither welfare payments nor Social Security payments to households are included. These are transfer payments, which are not part of the government purchases component of GDP.

2. Here is the table of value added.

Good Produced by Purchased by Price Value Added
Raw milk Dairy farm Dairy \$1,000 \$1,000
Cream Dairy Ice cream maker 3,000 2,000
Ice cream Ice cream manufacturer Grocery store 7,000 4,000
Retail ice cream Grocery store Consumer 10,000 3,000
Final Value \$10,000

format: plain


text:
### Блог пользователя wrick

Автор wrick, история, 10 месяцев назад, ,

My rating has been in a free fall due to Scala solutions not running in Codeforces for the last couple of contests. Please see:

29977952

29890121

29874042

29999130

They work fine locally and they randomly fail with this error:

java.lang.NoClassDefFoundError: scala/collection/TraversableOnce$class at IO.<init>(_849A.scala:188) at IO.<init>(_849A.scala:189) at IO.<init>(_849A.scala:190) at CodeForcesApp$class.main(_849A.scala:16)
at _849A$.main(_849A.scala:1) at _849A.main(_849A.scala) Caused by: java.lang.ClassNotFoundException: scala.collection.TraversableOnce$class
at sun.misc.Launcher\$AppCla...

Can CodeForces please rerun my submissions and update the ratings?

•
• +3
•

 » 10 месяцев назад, # |   0 Auto comment: topic has been updated by wrick (previous revision, new revision, compare).
 » 9 месяцев назад, # |   0 Ouch, that must hurt...I believe asking to rejudge rating from several rounds back is a bit too much, but at the very least your results should be revoked.And I hope the runtime issue can be fixed before the next rounds. We should be able to use the language that is officially supported on CF.


text:
# Compound pendulum clarification?

I read in a book the following about compound pendulum and small displacements:

1. There are two points only for which the time period is minimum.

2. there are maximum 4 points for which the time period is same.

Why is this? Can someone please explain? I am familiar with maximum time period being when $k=l$.
In general, time period is $$T=2\pi \sqrt\frac{k^2+l^2}{lg}$$ for small angle approximation.

$k$=Radius of gyration about the centre of gravity, $l$=distance of point of suspension from Centre of Gravity, $g$=gravity

Hope you are familiar with differential calculus.

In order to get minimum time period differentiate time period w.r.t. $l$ and set it to $0$ Also check second derivative to be positive. That should give you $k=l$.

Note that locus of this will be a circle of radius $k$ and centre the centre of gravity. Maybe your book is talking about a rod where there will be $2$ points only as other points are not lying on it.

For maximum time period : Clearly this will happen as $l$ tends to $0$ and time period tends to infinity.

For points where time period is same: Simply put time period at length $a$ to be equal to that of length $b$.

You will get $2$ solutions: $a=b$ or $k^2 = ab$

As we want different points, we will ignore the first solution. There will be again infinite points satisfying this condition on a general body. But your textbook may be talking of a rod where there will be $4$ such points: $$\begin{array}{cc} a \; ,& -a \; ,& k^2/a \; ,& -k^2/a \end{array}$$ for a general non-zero a lying on rod.


text:
# structure node delete command

Syntax

structure node delete <range>

Delete all nodes in the range. FLAC3D will not allow nodes that are connected to structural elements to be deleted.


text:
# materialSpectra: compute standard material spectra In colorSpec: Color Calculations with Emphasis on Spectral Data

## Description

Compute neutral gray material constant reflectance/transmittance, and rectangular spectra. Also compute absorbance of the human lens, as a function of age.

## Usage

 1 2 3 4 neutralMaterial( gray=1, wavelength=380:780 ) rectangularMaterial( lambda, alpha=1, wavelength=380:780 ) lensAbsorbance( age=32, wavelength=400:700 )

## Arguments

 gray a numeric N-vector of gray levels, in the interval [0,1]. gray=1 represents the Perfect Reflecting Diffuser. lambda a numeric Nx2 matrix with wavelength pairs in the rows, or a vector that can be converted to such a matrix, by row. The two wavelengths are the two transition wavelengths of the returned spectrum, see Details. alpha a numeric N-vector of chromatic amplitudes in the interval [-1,1]. N must be equal to nrow(lambda). alpha can also be a single number, which is then replicated to length nrow(lambda). The chromatic amplitude is defined by Logvinenko and controls the size of both transitions, see Details. age a numeric N-vector of ages in years; all ages must be ≥ 20. wavelength a vector of wavelengths for the returned object

## Details

A rectangular spectrum, or rectangular metamer, is easiest to define when α=1 and λ_1 < λ_2. In this case it is a band-pass filter with transmittance=1 for λ \in [λ_1 , λ_2] and transmittance=0 otherwise. To create a long-pass filter, just set λ_2 to Inf, or any large wavelength outside the spectrum range; and similarly for a short-pass filter.
When 0<α<1 the spectrum is a weighted mixture of this band-pass filter with a perfect neutral gray filter with transmittance=0.5 at all λ, using α and 1-α as the two weights. The minimum transmittance is (1-α)/2 and the maximum is (1+α)/2, and their difference, the chromatic amplitude, is α. It is still a band-pass filter.
If α=0 the spectrum is a perfect neutral with transmittance=0.5.
To "flip" the spectrum to its complement (change band-pass to band-stop, etc.), change α to a negative number, or swap λ_1 and λ_2. If λ_1==λ_2 then the spectrum is undefined and a warning is issued (unless α=0).

## Value

neutralMaterial() returns a colorSpec object with quantity equal to 'reflectance'. The reflectance of each spectrum is constant and taken from gray. There are N spectra in the object - one for each gray level.

rectangularMaterial() returns a colorSpec object with quantity equal to 'transmitance'. The transmitance of each spectrum is a step function with 0, 1 or 2 transitions (jumps) defined by the corresponding row in lambda. If rownames(lambda) is not NULL, they are copied to specnames of the output. Otherwise the specnames are computed from the shape of the spectrum using these acronyms: LP (long-pass), SP (short-pass), BP (band-pass), BS (band-stop), and N (neutral, in case alpha==0).

lensAbsorbance() returns a colorSpec object with quantity equal to 'absorbance'. The absorbance model for the human lens is taken from Pokorny. There are N spectra in the object - one for each age (N=length(age)).

## Logvinenko

It is clear that there are 3 degrees-of-freedom in the spectra returned by rectangularMaterial(). Logvinenko shows that these spectra in fact form a 3D ball, which he calls the rectangle color atlas. He also shows that if a material responder satisfies the 2-transition condition, then these spectra uniquely generate all colors in the corresponding object color solid. For more on this, see the inversion vignette.

## Ostwald

Every spectrum returned by rectangularMaterial() is an Ostwald ideal spectrum. In Ostwald's terminology, the color content = chromatic amplitude = α. And the black content = white content = (1-α)/2. Note that the sum of these 3 contents is 1. However, Ostwald allows black content and white content to be unequal, as long as the sum of the 3 contents is 1, and all are non-negative. Thus there is one extra degree-of-freedom for Ostwald's ideal spectra, for a total of 4 degrees-of-freedom. If an additional argument (or arguments) were added to rectangularMaterial(), then it could return all Ostwald ideal spectra.

## References

Foss, Carl E. and Dorothy Nickerson and Walter C. Granville. Analysis of the Ostwald Color System. J. Opt. Soc. Am.. vol. 34. no. 7. pp. 361-381. July, 1944.

Logvinenko, A. D. An object-color space. Journal of Vision. 9(11):5, 1-23, (2009). https://jov.arvojournals.org/article.aspx?articleid=2203976. doi:10.1167/9.11.5.

Pokorny, Joel, Vivianne C. Smith, and Margaret Lutze. Aging of the Human Lens. Applied Optics. Vol. 26, No. 8. 15 April 1987. Table I. Page 1439.

lightSpectra, quantity(), specnames(), computeADL(), vignette inversion
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 # make a perfect reflecting diffuser (PRD) prd = neutralMaterial( 1 ) # make a perfect transmitting filter (PTF) ptf = prd quantity(ptf) = 'transmittance' # make a band-stop filter (for interval [500,550]) # with 1% transmittance in the band, and 99% outside the band bs = rectangularMaterial( c(500,550), -0.98, 400:700 ) bs = rectangularMaterial( c(550,500), 0.98, 400:700 ) # equivalent to previous line # compare transmittance at 3 ages: 20, 32, and 80 years plot( linearize(lensAbsorbance( c(20,32,80) )), col='black', lty=1:3 )


text:
# Vanishing spaces between words inside a QRcode

When the text of a QRcode comes from a \newcommand{\TextInsideQRcode}, the spaces between the words vanish. Is there a way to maintain the spaces between the words ?

 \documentclass[]{article}
\usepackage[]{qrcode}
\begin{document}

\qrcode[]{\TextInsideQRcode}%

\vglue1cm

\qrcode[]{When a similar verbatim text in directly entered into the qrcode command, the spaces between the words remain intact.}%

\end{document}

Please read section "2.3 Special characters" of the documentation for package qrcode. \qrcode reads the argument verbatim except for characters \, {, and } to allow macro expansion. These characters and the other special characters including spaces needs an "escaping" with the backslash, because their catcodes are already assigned at the time of the macro definition. The catcode changes in \qrcode come to late.
\newcommand*{\TextHello}{Hello\ world!}


text:
# How to find the sum of elements of an Array using STL in C++?

C++Server Side ProgrammingProgramming

Here we will see how to find the sum of all element of an array. So if the array is like [12, 45, 74, 32, 66, 96, 21, 32, 27], then sum will be: 405. So here we have to use the accumulate() function to solve this problem. This function description is present inside <numeric> header file.

## Example

Live Demo

#include<iostream>
#include<numeric>
using namespace std;
int main() {
int arr[] = {12, 45, 74, 32, 66, 96, 21, 32, 27};
int n = sizeof(arr) / sizeof(arr[0]);
cout << "Array is like: ";
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
cout << "\nSum of all elements: " << accumulate(arr, arr + n, 0);
}

## Output

Array is like: 12 45 74 32 66 96 21 32 27
Sum of all elements: 405
Published on 17-Dec-2019 17:40:47


text:
For Better Performance Please Use Chrome or Firefox Web Browser

# FC-Pure Injectivity and FC-Pure Flatness and Its Relationship to Two Famous Problems of Kothe and Kaplansky

Let S be a class of left R-modules.  An R-module M is said to be S-pure injective (resp. S-pure projective) if M has the injective (resp. projective) property respect to each S-pure exact sequence. Also, an R-module M is said to be S-pure flat if M has the flat property respect to each S-pure exact sequence. As  Puninski (1994), let us fix a few of the most common purities S of R-modules.

1. Purity. If S = { the class of all finitely presented left modules over R}, then we have the left Cohn’s purity. In this case, S-pure exact, S-pure projective, S-pure injective and S-pure flat are commonly called pure exact, pure projective, pure injective and pure flat, respectively
2. RD-purity. If S = {R/rR | r \in R} (R/rR is called cyclically presented), then we have the RD-purity. In this case, S-pure exact, S-pure projective, S-pure injective and S-pure flat are commonly called RD-exact (or relative divisible exact), RD-projective, RD-injective and RD-flat, respectively.
3. I-purity (or cyclically purity) . If S = {R^n/K | K is a cyclic submodule of the R-module R^n}, then we have I-purity or cyclically purity. In this case, S-pure exact, S-pure projective, S-pure injective and S-pure flat are commonly called I-pure exact, I-pure projective, I-pure injective and I-pure flat, respectively.
4. C-purity. If S = {R/I | I is a left ideal of R}, then we have the cyclically purity (or c-purity). In this case, S-pure exact, S-pure projective, S-pure injective and S-pure flat are commonly called C-pure exact, C-pure projective, C-pure pure injective and C-pure flat, respectively.
5. FC-purity. Let S = {R/I | I is a finitely generated left ideal of R}. In this case, since each element R/I of S is finitely presented cyclic R-module, we have the FC-purity (or finitely presented cyclically purity). Note that Puninski, use the phrase Warfield purity to mean FC-purity. In this case, S-pure exact, S-pure projective, S-pure injective and S-pure flat are commonly called FC-pure exact, FC-pure projective, FC-pure injective and FC-pure flat, respectively.

The question of which commutative rings have the property that every finitely generated module is a direct sum of cyclic modules has been around for many years. We will call these rings FGC rings. The problem originated in I. Kaplanskys papers. For several years, this is one of the major open problems in ring theory.  A deep and difficult study was made by Brandal, Shores-R. Wiegand, S. Wiegand, Wiegand  and V´amos , leading to a complete  solution of the problem in the commutative case. Also, it was shown by Kothe  and Cohen-Kaplansky: “a commutative ring R has the property that every modules is a direct sum of cyclic modules if and only if R is an Artinian principal ideal ring” (recently, a generalization of the Kothe-Cohen-Kaplansky theorem have been given by Behboodi et al. [Proc. Amer. Math. Soc.(2011)(to appear)]. for the non-commutative setting, when all idempotents of R are central). In general, the corresponding problems in the non-commutative case are still open; see [Non-associative algebra and its applications, Lecture Notes in Pure and Applied Mathematics 246 (2006), Appendix B: Unsolved Problems in the Theory of Rings and Modules. Pages 461-516] in which the following problems are considered.

G. Kothe’s Problem: Describe the rings over which each left (or each left, and each right)  module can be decomposed as a direct sum of cyclic modules

I. Kaplansky’s Problem (Reported by A. A. Tuganbaev): Describe the rings over which every finitely generated module can be decomposed as a direct sum of cyclic modules.

The goal of this proposal is to study the structures and  basic properties of FC-pure  injectivity,  FC-pure injective envelope,  I-pure injectivity, FC-pure flatness and I-pure flatness of modules. In particular, we will study the relationship between these notions and  the above two problems of  Kothe and  Kaplansky.  For instance, we prove the following relationship between FC-pure  injectivity and the Kothe and Kaplansky  problems:

Theorem A:   Every left R-module is FC-pure injective (projective) if and only if R is a left Kothe ring (i.e., every left R-module is a direct sum of cyclic modules).

Theorem B:   Every finitely generated left R-module is FC-pure injective (projective) if and only if R is a left FGC- ring (i.e., every finitely generated  left R-module is a direct sum of cyclic modules).

Related Papers:

1- M. Behboodi (Joint with A. Ghorbani, A. Moradzadeh-Dehkordi, and S.H. Shojaee)
On FC-purity and I-purity of modules and Kothe rings
Comm. Algebra 42 (2014), 2061-2081

2- M. Behboodi (Joint with A. Ghorbani, A. Moradzadeh-Dehkordi, and S. H. Shojaee)
C-pure projective modules
Comm. Algebra 41 (2013), 4559-4575

Select Research Type:
Non Resident Researcher (non-resident), School of Mathematics, INSTITUTE  FOR  RESEARCH  IN  FUNDAMENTAL SCIENCES, 2010-2011


text:
# The Quick Code Cleanup

The quick code cleanup is a process whereby you run through some or all of the files in a software project and tidy them up. Think about it as the regular tidying of your desk (or room) and filing things away – versus the rearranging and rewiring of a full code refactor. You can get a lot more done on a tidy desk.

Quick code cleanups can and do include some minor refactoring, but they are mostly about renaming items, reformatting code and commenting on or cleaning up messy sections. No features are added or changed.

So why do quick code cleanups? Because they save tremendous time as the project progresses. And the best part is, you do not need to do much thinking or need the zone (See the Four Hour Rule). For example, I just spent the last few hours doing a quick code cleanup while watching the US Open tennis!

Here are some of the things to do in a quick code cleanup:

Naming classes, functions and variables is hard. Knowing how they may be used or evolve is almost impossible beforehand. When you name new classes, functions or variables, you have an idea of how you think they will be used. But as the program evolves, these old names may no longer be sufficiently explanatory or correct.

In a quick code cleanup, you revisit naming after-the-fact, but close enough to remember your thinking, knowing how the elements are now being used. You will find that you have a much easier time finding and choosing better names in cleanup. It also means that, when writing new code, you can relax a bit knowing you’ll come back and rename the items you are unsure of.

It makes the code more understandable for later.

### Fix Lazy Formatting

While coding, we often forget to format our code properly. Or the IDE (I’m glaring at you, Xcode) helpfully generates its own code layouts for you.

In a quick code cleanup, you reformat the code to whatever standard you prefer, add white space, and rearrange the functions in files to make more sense. For example, I like to have functions that call each other closer to each other in the file so it’s easier to see them on the same screen. At coding time, I may not have written them or know which, at cleanup time I do. I also like to separate paragraphs of code with white space and comments, which I add in cleanup.

It makes the code a lot more readable and browsable for later.

### Explain Some Decisions

If you have ever been in a code review you’ll know that the most common question is “WTF were you thinking?”. We know what we were thinking when coding, and we remember that thinking for a short while. But we all forget that thinking over time as other thoughts take over.

In a quick code cleanup, you add comments where necessary to explain your thinking. Why did you design a class this way, or write something that way. Or how does this complex calculation work? What was I thinking at the time?

It makes the code a lot more maintainable for later.

### Early Cruft Removal

We all create classes and functions, use them for a while, and then replace them. We do not always remember to remove unreferenced classes or comment them out from the code base. Later on, when searching for how something went badly wrong, we get confused by this extra code. Is this the function called or another? This, to me, is how cruft starts.

In a quick code cleanup, while your mind is fresh, remove all classes and functions that are not being used. If you need them again later, you can get them back from source code control. If unsure whether something is being used, use search in your IDE to see if the function or class is referenced (or just comment it out and compile – if the compile passes, it is cruft).

It makes code smaller, simpler and less confusing for later.

### Basic Refactoring

Other than renaming classes and variables, a quick code cleanup also usually entails:

• Pulling up common and duplicated code into functions, or replacing long, complex, deep if clauses with function calls
• Hiding public variables behind setters and getters (one or both)
• Commenting out or deleting surplus debug statements
• Adding missing asserts to document your assumptions

It reduces the number of potential bugs for later.

## When to run a quick code cleanup?

I try to do this every few weeks on current projects, when the code is still fresh in my mind and when I have some time. This often coincides with a minor release or the few hours at the end of the week when I know I will not have enough time to enter the zone and work on a new feature.

The quick code cleanup may not seem to be a productive use of your time, but it pays off tremendously as the software grows in size and complexity. As the code-base expands, it yet remains understandable, readable, maintainable, simpler and with fewer bugs, enabling you to spend more time crafting new code and less time figuring out what the hell happened in the past and untangling a knotted mess.

You can start doing quick code cleanups anytime.

Follow the author as @hiltmon on Twitter and @hiltmon on App.Net. Mute #xpost on one.


text:
# Question efb13

There are many interesting aspects of the Dirac Equation, but I'd say the three most important points are:

1. It's a relativistic wave equation
2. It predicts the existence of antiparticles
3. It predicts the existence of spin

#### Explanation:

The Dirac Equation

[beta mc^2 + c(sum_(n=1)^3 alpha_n hat(p)_n)] psi (vec(r),t) = i ħ (del)/(del t) psi (vec(r),t) ,

proposed by Paul Dirac in 1928, is considered by many to be one of the most important equations of Physics, since it symbolizes the union of Quantum Mechanics and Special Relativity. In summary, it describes the way a particle that obeys the laws of Quantum Mechanics and behaves as time passes by.

For this reason, in order to have a basic understanding, we need to be acquainted with the basic principles of these two theories. So we must have some basic knowledge of those fields to understand the points above.

To understand the first point, we need to know that a relativistic wave equation is an equation for a wave function (a quantum mechanical description of matter) that obeys the relativistic energy relation $E = \pm \sqrt{{\left(m {c}^{2}\right)}^{2} + {\left(p c\right)}^{2}}$.

The first wave equation developed to describe matter in the quantum mechanical level was the Schrödinger equation

 [-1/(2m)(ħ)^2 grad^2 + V(vec(r))]psi(vec(r),t) = i ħ del/(del t) psi (vec(r),t),

where $i = \sqrt{- 1}$, ħ = h/(2 pi) is the reduced Planck constant, $m$ is the mass of the particle discribed by the wave function $\psi \left(\vec{r} , t\right)$, $\vec{r}$ is the position of this particle, $t$ is time, $V \left(\vec{r}\right)$ is the potential energy of the particle and ${\nabla}^{2} = \frac{{\partial}^{2}}{\partial {x}^{2}} + \frac{{\partial}^{2}}{\partial {y}^{2}} + \frac{{\partial}^{2}}{\partial {z}^{2}}$ is the Laplacian.

One of the basic results of Quantum Mechanics is that a measurement of the momentum of a particle is related (via an eigenvalue equation) to the momentum operator:

vec(hat(p)) = -i ħ vec(grad)

Then, if we take a look at the Schrödinger equation, we see that it can be written as:

 [1/(2m) hat(p)^2 + V(vec(r))]psi(vec(r),t) = i ħ del/(del t) psi (vec(r),t),

Remember that the expression for the kinectic energy in classical mechanics is $T = \frac{1}{2} m {v}^{2} = \frac{1}{2 m} {p}^{2}$, wich leaves us with the following expression for the total energy (see also the expression for the Hamiltonian):

$E = T + V = \frac{1}{2 m} {p}^{2} + V$

Taking one more look at the Schrödinger equation, we can rewrite it as:

hat(E) psi(vec(r),t) = i ħ del/(del t) psi (vec(r),t)

Thus, it makes sense to define the energy operator as:

hat(E) = i ħ del/(del t)

Now, we still need to get to the Dirac equation. For simplicity, we'll have to ignore the potential energy term, that is set $V = 0$ (that was also what Dirac did). If we decide to use the more common form of the relativistic energy relation, ${E}^{2} = {\left(m {c}^{2}\right)}^{2} + {\left(p c\right)}^{2}$, to reach a quantum and relativistic equation, we'll arive at the Klein Gordon equation, wich is an adequate description for bosons, but does not account for some of the behaviour of fermions.

So Dirac derived a new form of the relativistic energy relation:

$E = \vec{p} \cdot \vec{v} + \sqrt{1 - t i l \mathrm{de} {\left(\beta\right)}^{2}} \left(m {c}^{2}\right) = \vec{p} \cdot \vec{v} + {\beta}^{p} r i m e \left(m {c}^{2}\right) ,$

where $t i l \mathrm{de} {\left(\beta\right)}^{2} = {\left(\frac{v}{c}\right)}^{2}$ and ${\beta}^{p} r i m e = \sqrt{1 - t i l \mathrm{de} {\left(\beta\right)}^{2}}$.
This is just the old relation written in a different way, but for the quantum version of the theory, it has a fundamental difference: it's more similar to the Schrödinger equation since it has an energy term that is linear, and not quadratic (the Klein-Gordon equation has a quadratic term on the energy operator and has some problems with probability densities due to this).

Now we can try to arrive at the Dirac equation. We just need to plug in the energy operator defined above in place of $E$, the momentum operator in place of $\vec{p}$ and we need to represent $\vec{v}$ and ${\beta}^{p} r i m e$ in some way.

Dirac's insight was to define matrices ${\alpha}_{n}$, with $n \in \left\{1 , 2 , 3\right\}$, and $\beta$, and to make the substitutions ${v}_{n} \to c {\alpha}_{n}$, ${\beta}^{p} r i m e \to \beta$.
We reach this equation:

[beta mc^2 + c(sum_(n=1)^3 alpha_n hat(p)_n)] psi (vec(r),t) = i ħ (del)/(del t) psi (vec(r),t)

It turns out there are some requirements that these matrices must abide and the smallest matrices that do are some $4 \times 4$ ones that are very similar to the Pauli matrices, wich are related to the spin of the particles. Since we have $4 \times 4$ matrices in the equation, $\psi$ must be a vector in order for the equation to make sense:

$\psi \left(\vec{r} , t\right) = \left(\begin{matrix}{\psi}_{1} \left(\vec{r} t\right) \\ {\psi}_{2} \left(\vec{r} t\right) \\ {\psi}_{3} \left(\vec{r} t\right) \\ {\psi}_{4} \left(\vec{r} t\right)\end{matrix}\right)$

To make it easier on notation, we can define ${\gamma}^{0} = \beta$ and ${\gamma}^{n} = \beta {\alpha}_{n}$ and rewrite the equation (in covariant notation) as

i ħ gamma^(mu) del_(mu) psi = mc psi

or

${\gamma}^{\mu} {\hat{p}}_{\mu} - m c \psi = 0$

There is even a beautiful notation (called the Feynman slash notation) that, combined with natural units, that is ħ = 1 = c#, give us the following neat forms of the Dirac equation:

$\left(i \cancel{\partial} - m\right) \psi = 0$

$\left(i \cancel{\hat{p}} - m\right) \psi = 0$

It turns out that this vector quality of $\psi$ is profoundly related to the other two points introduced earlier: the existence of antiparticles and spin (matter of fact, we call this kind of wave function a spinor).

If we take a look at the equation $E = \pm \sqrt{{\left(m {c}^{2}\right)}^{2} + {\left(p c\right)}^{2}}$ we can see that, while $\sqrt{{\left(m {c}^{2}\right)}^{2} + {\left(p c\right)}^{2}}$ is always positive, we have positive and negative solutions to $E$. With a lot of (quite hard) calculations, we can see that 2 of the four components of $\psi$ are associated with positive energy solutions and the other 2 are associated with negative energy solutions.

Dirac's ideia was that all negative energy states were occupied in the vaccuum and to create positive energy states we'd need to supply energy to bump a negative state up to a positive energy level.
This ideia (known as the Dirac Sea) corresponds to pair production and we can relate 2 of the 4 components of $\psi$ with a particle, while the other 2 correspond to the antiparticle.

What's most remarkable about this is that antimater was first discovered experimentally in 1932 - 4 years after Dirac's prediction!

Finally, we take a look at spin. In Pauli's theory of spin, a wave function is actually a 2 component spinor, in wich the first component corresponds to the up state while the second one corresponds to the down state. Recall that we have 2 components of out 4 component spinor dedicated to particles and 2 dedicated to antiparticles.

As said before, the $\gamma$ matrices are related to the Pauli matrices. Matter of fact, they are higher dimensional versions of Pauli matrices with positive and negative signs organized in a way that particles and antiparticles have oposite spin relations!

So the Dirac equation not only links Special Relativity and Quantum Mechanics, it also explains a previously known effect (spin) and predicted correctly a previously unknown type of matter (antimatter), making it one of the greatest theoritical successes in Physics - and the reason Dirac won the 1938 Nobel Prize in Physics.


text:
#### Abstract Details

 Activity Number: 103 - New Developments on Statistical Machine Learning Type: Invited Date/Time: Monday, July 29, 2019 : 8:30 AM to 10:20 AM Sponsor: IMS Abstract #300506 Title: Statistical and Computational Guarantees of EM with Random Initialization Author(s): Harrison H. Zhou* and Yihong Wu Companies: Yale Uinversity and Yale University Keywords: EM ; Gaussian Mixtures; Estimation; Clustering; Optimality ; Convergence Abstract: This talk considers parameter estimation in the two-component symmetric Gaussian mixtures in $d$ dimensions with $n$ independent samples. We show that, even in the absence of any separation between components, with high probability, the EM algorithm converges to an estimate in at most $O(\sqrt{n} \log n)$ iterations, which is within $O((d/n)^{1/4} (\log n)^{3/4})$ in Euclidean distance to the true parameter, provided that $n=\Omega(d \log^2 d)$. This is within a logarithmic factor to the minimax optimal rate of $(d/n)^{1/4}$. The proof relies on establishing (a) a non-linear contraction behavior of the population EM mapping (b) concentration of the EM trajectory near the population version, to prove that random initialization works. This is in contrast to previous analysis in Daskalakis, Tzamos, and Zampetakis (2017) that requires sample splitting and restart the EM iteration after normalization, and Balakrishnan, Wainwright, and Yu (2017) that requires strong conditions on both the separation of the components and the quality of the initialization. Furthermore, we obtain the asymptotic efficient estimation when the signal is stronger than the minimax rate.

Authors who are presenting talks have a * after their name.


text:
# 3^x = 12x-9

3^x=12x-9

## The Attempt at a Solution

I really have no clue how to solve this one algebraically.
I graphed the two functions on a calculator and found the points of intersection
the answers are 3 and 1

Can someone show me how to solve this problem algebraically, step by step?

I believe you use logs?

thanks

## Answers and Replies

Related Precalculus Mathematics Homework Help News on Phys.org
eumyang
Homework Helper

Can someone show me how to solve this problem algebraically, step by step?
No, we're not allowed to do that. That's against forum rules.

I'm not sure it can be solved algebraically. The solution provided by Wolfram used the Lambert W-function, but I have to confess that I don't remember what that is.

$$3^x=3(4x-3)$$
When does the left side equal the right side?

Dick
Homework Helper

No, we're not allowed to do that. That's against forum rules.

I'm not sure it can be solved algebraically. The solution provided by Wolfram used the Lambert W-function, but I have to confess that I don't remember what that is.
The function f(x)=xe^x is a one-to-one function if you restrict the domain to x in [-1,infinity). So it has an inverse. The inverse is the Lambert W-function. It's just a name for a function you can't express algebraically.

thanks guys for the help,
sorry about asking for the step by step, I'm new here.

as for the Lambert w-function, is it something one learns in Calculus or something?
I'm only in precalculus.

Dick
Homework Helper

thanks guys for the help,
sorry about asking for the step by step, I'm new here.

as for the Lambert w-function, is it something one learns in Calculus or something?
I'm only in precalculus.
I think I learned about it in a course called Mathematical Physics which is postcalculus, where you study all sorts of special functions associated with differential equations. I don't think are supposed to solve the equation like that. Do just what you did. Sketch the graph and guess the roots.

You can solve this algebraically.

$$3^x = 3(4x-3)$$

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

See if you can go from there.

Mark44
Mentor

$$3^x = 3(4x-3)$$

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

See if you can go from there.
And this is helpful...how?

And this is helpful...how?
I am assuming that it is, in fact, impossible to solve algebraically?
I really don't see how moving everything around gets me closer to an answer.

Thanks for trying though, mjordan2nd, unless there really is a way to solve it by taking your route. Please feel free to give me a few more hints as to how this helps.

(I'm still learning here!)

Thanks

And this is helpful...how?
Ahh, I suppose you're right. My thinking was you could simply equate the top with the top and the bottom with the bottom. In this case equating the bottom with the bottom gives x = 3, which happens to work in this case, but doesn't have to. My fault.


text:
Discriminant analysis vs logistic regression

I found some pros of discriminant analysis and I’ve got questions about them. So:

When the classes are well-separated, the parameter estimates for
logistic regression are surprisingly unstable. Coefficients may go to
infinity. LDA doesn’t suffer from this problem.

If number of features is small and the distribution of the predictors
$X$ is approximately normal in each of the classes, the linear
discriminant model is again more stable than the logistic regression
model.

1. What is stability and why is it important? (If logistic regression provides a good fit that does its job, then why should I care about stability?)

LDA is popular when we have more than two response classes, because it
also provides low-dimensional views of the data.

1. I just don’t understand that. How does LDA provide low-dimensional views?
2. If you can name more pros or cons, that would be nice.

When the classes are well-separated, the parameter estimates for logistic regression are surprisingly unstable. Coefficients may go to infinity. LDA doesn’t suffer from this problem.

If there are covariate values that can predict the binary outcome perfectly then the algorithm of logistic regression, i.e. Fisher scoring, does not even converge. If you are using R or SAS you will get a warning that probabilities of zero and one were computed and that the algorithm has crashed. This is the extreme case of perfect separation but even if the data are only separated to a great degree and not perfectly, the maximum likelihood estimator might not exist and even if it does exist, the estimates are not reliable. The resulting fit is not good at all. There are many threads dealing with the problem of separation on this site so by all means take a look.

By contrast, one does not often encounter estimation problems with Fisher’s discriminant. It can still happen if either the between or within covariance matrix is singular but that is a rather rare instance. In fact, If there is complete or quasi-complete separation then all the better because the discriminant is more likely to be successful.

It is also worth mentioning that contrary to popular belief LDA is not based on any distribution assumptions. We only implicitly require equality of the population covariance matrices since a pooled estimator is used for the within covariance matrix. Under the additional assumptions of normality, equal prior probabilities and misclassification costs, the LDA is optimal in the sense that it minimizes the misclassification probability.

How does LDA provide low-dimensional views?

It’s easier to see that for the case of two populations and two variables. Here is a pictorial representation of how LDA works in that case. Remember that we are looking for linear combinations of the variables that maximize separability.

Hence the data are projected on the vector whose direction better achieves this separation. How we find that vector is an interesting problem of linear algebra, we basically maximize a Rayleigh quotient, but let’s leave that aside for now. If the data are projected on that vector, the dimension is reduced from two to one.

The general case of more than two populations and variables is dealt similarly. If the dimension is large, then more linear combinations are used to reduce it, the data are projected on planes or hyperplanes in that case. There is a limit to how many linear combinations one can find of course and this limit results from the original dimension of the data. If we denote the number of predictor variables by $$pp$$ and the number of populations by $$gg$$, it turns out that the number is at most $$min\min(g-1,p)$$.

If you can name more pros or cons, that would be nice.

The low-dimensional representantion does not come without drawbacks nevertheless, the most important one being of course the loss of information. This is less of a problem when the data are linearly separable but if they are not the loss of information might be substantial and the classifier will perform poorly.

There might also be cases where the equality of covariance matrices might not be a tenable assumption. You can employ a test to make sure but these tests are very sensitive to departures from normality so you need to make this additional assumption and also test for it. If it is found that the populations are normal with unequal covariance matrices a quadratic classification rule might be used (QDA) instead but I find that this is a rather awkward rule, not to mention counterintuitive in high dimensions.

Overall, the main advantage of the LDA is the existence of an explicit solution and its computational convenience which is not the case for more advanced classification techniques such as SVM or neural networks. The price we pay is the set of assumptions that go with it, namely linear separability and equality of covariance matrices.

Hope this helps.

EDIT: I suspect my claim that the LDA on the specific cases I mentioned does not require any distributional assumptions other than equality of the covariance matrices has cost me a downvote. This is no less true nevertheless so let me be more specific.

If we let $$\bar{\mathbf{x}}_i, \ i = 1,2\bar{\mathbf{x}}_i, \ i = 1,2$$ denote the means from the first and second population, and $$\mathbf{S}_{\text{pooled}}\mathbf{S}_{\text{pooled}}$$ denote the pooled covariance matrix, Fisher’s discriminant solves the problem

$$\max_{\mathbf{a}} \frac{ \left( \mathbf{a}^{T} \bar{\mathbf{x}}_1 – \mathbf{a}^{T} \bar{\mathbf{x}}_2 \right)^2}{\mathbf{a}^{T} \mathbf{S}_{\text{pooled}} \mathbf{a} } = \max_{\mathbf{a}} \frac{ \left( \mathbf{a}^{T} \mathbf{d} \right)^2}{\mathbf{a}^{T} \mathbf{S}_{\text{pooled}} \mathbf{a} } \max_{\mathbf{a}} \frac{ \left( \mathbf{a}^{T} \bar{\mathbf{x}}_1 - \mathbf{a}^{T} \bar{\mathbf{x}}_2 \right)^2}{\mathbf{a}^{T} \mathbf{S}_{\text{pooled}} \mathbf{a} } = \max_{\mathbf{a}} \frac{ \left( \mathbf{a}^{T} \mathbf{d} \right)^2}{\mathbf{a}^{T} \mathbf{S}_{\text{pooled}} \mathbf{a} }$$

The solution of this problem (up to a constant) can be shown to be

$$\mathbf{a} = \mathbf{S}_{\text{pooled}}^{-1} \mathbf{d} = \mathbf{S}_{\text{pooled}}^{-1} \left( \bar{\mathbf{x}}_1 – \bar{\mathbf{x}}_2 \right) \mathbf{a} = \mathbf{S}_{\text{pooled}}^{-1} \mathbf{d} = \mathbf{S}_{\text{pooled}}^{-1} \left( \bar{\mathbf{x}}_1 - \bar{\mathbf{x}}_2 \right)$$

This is equivalent to the LDA you derive under the assumption of normality, equal covariance matrices, misclassification costs and prior probabilities, right? Well yes, except now that we have not assumed normality.

There is nothing stopping you from using the discriminant above in all settings, even if the covariance matrices are not really equal. It might not be optimal in the sense of the expected cost of misclassification (ECM) but this is supervised learning so you can always evaluate its performance, using for instance the hold-out procedure.

References

Bishop, Christopher M. Neural networks for pattern recognition. Oxford university press, 1995.

Johnson, Richard Arnold, and Dean W. Wichern. Applied multivariate statistical analysis. Vol. 4. Englewood Cliffs, NJ: Prentice hall, 1992.


text:
# Roots of $x^n - 1$ in an algebraically closed field of prime characteristic

Let $F$ be an algebraically closed field of characteristic $p$ , and let $n$ be a positive integer.

Consider $g := x^n - 1 \in F[x]$

Is it true that $g$ has distinct roots in $F$ if and only if $p$ does not divides $n$ ?

Here is my argument, please could you tell me whether it is correct:

Note roots of g are distinct if and only if $\mathrm{hcf}(g,g') = 1$ .

Suppose $\beta \in F$ is a root of $g$ .

Now $\beta^n = 1$, so $\beta \neq 0$ .

Then $g'(\beta) = n \beta^{-1} = 0$ iff $p \mid n$

unless there is something wrong with how i am checking, i can't find any counterexamples for finite fields (where roots exist)

EDIT:

i think the statement is correct, at least i have found something which implies this in a book "Classical Galois Theory"

EDIT 2:

Noting $(a-b)^p = a^p - b^p$ in a field of characteristic p (what Dilip said)

then $$p \mid n \implies n = mp \implies x^n - 1 = (x^m-1)^p$$

and the polynomial on the RHS has only repeated roots. Can someone show me the other way?

• you seem to be concluding exactly backwards. – hunter Feb 10 '14 at 15:26
• $(a-b)^p = a^p-b^p$ in a field of characteristic $p$. What does this tell you about $x^n-1 = x^{mp}-1$? – Dilip Sarwate Feb 10 '14 at 15:29
• so are you saying we reduce it to the cases 1,2,3,...,p-1 ? – JC784 Feb 10 '14 at 15:39
• can someone tell me whether the proof is right or wrong, and explain the error to me please? – JC784 Feb 10 '14 at 15:46
• Noting $(a-b)^p = a^p - b^p$ in a field of characteristic p (what Dilip said) then $$p \mid n \implies n = mp \implies x^n - 1 = (x^m-1)^p$$ and the polynomial on the RHS has only repeated roots. Can someone show me the other way? – JC784 Feb 10 '14 at 18:37

Your argument shows that $g$ and $g'$ have a common root exactly when $p | n$, and as you observe, this implies that $g$ has a multiple root exactly when $p | n$. So your argument is correct.
Aside: This statement is very well-known. A useful adjective in this context is separable (which just means "has distinct roots"). You might have more luck finding this statement in textbooks if you look for discussions of when cyclotomic polynomials are separable. (The polynomial $x^n - 1$ has a factorization as a product of cyclotomic polynomials $\Phi_d(x)$, as $d$ ranges over the divisors of $n$, so $x^n - 1$ is separable iff all $\Phi_d(x)$ are separable for $d | n$. Now (almost?) every Galois theory text should have the statement that $\Phi_d(x)$ is separable iff $p \not\mid d$.)


text:
Given an address of the object, one can interact with it via LLDB. To do this, you need to import the corresponding module (like UIKit, or your app’s module) and then cast the address to a new variable using Swift’s unsafeBitCast like this:

(lldb) expr -l Swift -- import UIKit
(lldb) expr -l Swift -- let \$view = unsafeBitCast(0x7fb75d8349c0, to: UIView.self)

You may also be interested in this SO question. And especially, in the article referenced in one of the answers to the question.


text:
## Sending email messages

Please discuss general Delphi programming topics here.

### Sending email messages

Hello!
I am using this: http://delphi.about.com/od/internetintr ... 20304a.htm to make my own emailer. But the problem is that almost every SMTP need to autenciate(spell?). Like gmail or hotmail it will give me acces violation if I'm not using the right password and username.
I have found SMTP.Password and SMTP.Username. But when i but the correct options there it still gives me acces violation. Somebody have an answer at my problem. Were to fill in the User/password.
Btw, it's on SMTP.Send(MailMessage); it gives me acces violation.

/Thanks
Gullb3rg
Member

Posts: 4
Joined: October 26th, 2006, 3:31 pm

Are you sure you use the right stuff for it? you know, newest stuff... old indy had such problems. also did you simply copy& paste the code from site or have you worked on your own? have3 you read the documentation right? does the demo work fine? man, there are many more questions, and just one request: by sole description without a code we know shit about what's happening because there are at least 20 ways to do any stuff to do same thing.
Johnny_Bit
VIP Member

Posts: 455
Joined: June 15th, 2003, 9:56 am

The demo doesn't work either. And i have done it myself and haven't copy&paste, and i have read the doc many times. Here is the code:
Code: Select all
procedure TForm1.SendClick(Sender: TObject);begin  SMTP.Host := edHost.Text;  SMTP.Port := 25;  Mail.Recipients.EMailAddresses := edTo.Text;  Mail.From.Address := edFrom.Text;  Mail.Subject := edSubject.Text;  Mail.Body.Text := richMessage.Text;  if FileExists(edAttatch.Text) Then    TIdAttachment.Create(Mail.MessageParts, edAttatch.Text);  Try    SMTP.Connect(1000);    SMTP.Send(Mail);  Finally    if SMTP.Connected Then      SMTP.Disconnect;  end;end;
Gullb3rg
Member

Posts: 4
Joined: October 26th, 2006, 3:31 pm

have you tried service manually?
Johnny_Bit
VIP Member

Posts: 455
Joined: June 15th, 2003, 9:56 am

### smtp port...

Have you tried changing the port from 25? I think both yahoo and gmail use a different port. You will be able to get this information from their sites.

The other thing to consider is the authentication type for which information will be available on their sites.

I also recall that yahoo did not allow smtp (this can be confirmed on their web site).

Cheers
Elliot
eashton
Active Member

Posts: 8
Joined: January 24th, 2007, 7:16 pm


text:
# Search results

• ...) will be $\frac{v+\Delta v}{r}$ and since $T=\frac{2\pi}{\omega}$, we get [itex]T + \Delta t \approx \frac{2\pi r}{ v + \Delta v}</ma


text:
Magyar Information Contest Journal Articles

# Problem A. 617. (May 2014)

A. 617. Let $\displaystyle \mathcal{F}$ be a finite family of finite sets and let $\displaystyle A$ be an arbitrary finite set. We say that $\displaystyle \mathcal{F}$ shatters the set $\displaystyle A$ if for every $\displaystyle X\subseteq A$ there is a set $\displaystyle F\in \mathcal{F}$ such that $\displaystyle A\cap F=X$. Show that $\displaystyle \mathcal{F}$ shatters at least $\displaystyle |\mathcal{F}|$ sets.

(5 pont)

Deadline expired on June 10, 2014.

### Statistics:

 3 students sent a solution. 5 points: Williams Kada. 0 point: 2 students.

 Our web pages are supported by: Morgan Stanley


text:
# Calculus (Parts A and B done, just help with C)

The radius, r, of a sphere is increasing at a constant rate of 0.05 meters per second.
A. At the time when the radius of the sphere is 12 meters, what is the rate of increase in its volume?
B. At the time when the volume of the sphere is 36pi cubic meters, what is the rate of increase in its surface area?
C. Express the rate at which the volume of the sphere changes with respect to the surface area of the sphere (as a function of r).

Parts A and B I have figured out (A. = 28.8pi cubic meters per second; B. = 1.2pi squared meters per second) But I can't quite figure out C. How do I relate surface area and volume together into one equation???

1. 👍 0
2. 👎 0
3. 👁 1,940
1. V = (4/3)pi r^3
dV/dr = 4 pi r^2 which happens to be the area
so
dV/dt = 4 pi r^2 dr/dt

the differential change of volume is the surface area * dr

PS
I wonder how you did parts a and b without knowing that

1. 👍 0
2. 👎 0
2. I did notice this when I took the derivative for part A of the volume. But it seemed too simple to just plug in this value, I wanted to make sure that I was certain about the placement. Thank you!!!

1. 👍 0
2. 👎 0
3. dr/dt = .05
v = (4/3)pi r^3
dv/dt = (4/3)pi(3) r ^2 (dr/dt) <---- this step is where the mistake was. you needed to have differentiated the volume with respect to time. to do this use the power rule on the right side. the derivative of (4/3)pi r^3 is (4/3)pi(3) r ^2 (dr/dt). use the power rule to get this and multiply by radius differentiated with respect to time. (quick power rule for r^3: bring the 3 to the front and diminish the 3 by 1, giving you 3r^2)

then plug in dr/dt, or r(t) as what you wrote and get (4/3) pi (3)(12)^2 (.05) as your answer

= 28.8 pi
---------------------------------------...
B.
A = 4 pi r^2
V = 4/3 pi r^3
dr/dt = .05

you need to find the change in surface area (i used "A" as the variable) at the moment when the volume is 36 pi. The only other given number you have is dr/dt= .05

so you have the right volume but you need to find what the radius was when the volume equaled 36 pi.
you plug in 36 pi into the equation for volume where "V" is (to solve for "r"):

36 pi = (4/3) pi r^3

divide pi from each side.. 36= (4/3)r^3
multiply each side by (3/4) to get rid of the (4/3).... 27 = r^3
find the cube root of 27 and get.... r = 3

now you know what the radius is equal to at the moment when the volume is 36 pi.

differentiate the equation for surface area now with respect to time: A = 4 pi r^2
dA/dt = 4 pi 2 r (dr/dt)

plug in your value for r = 3 and (dr/dt)= .05

dA/dt = 4 pi 2 r (dr/dt)
dA/dt = 4 pi 2 (3)(.05)

= 1.2 pi

1. 👍 0
2. 👎 0
4. Given:
dr/dt = 0.05 m/s

V = 4/3 πr³
dV/dt = 4πr² (dr/dt)

A = 4πr²
dA/dt = 8πr (dr/dt)
- - - - - - - - - - - - - - -
First question:
What is dV/dt when r = 12?

dV/dt = 4π(12 m)² (0.05 m/s)
dV/dt = 28.8π m³/s
dV/dt ≈ 90.478 m³/s
- - - - - - - - - - - - - - -
Second question:
When V = 36π, what is dA/dt?

Using volume formula,
36π = 4/3 πr³
27 = r³
r = 3

dA/dt = 8π(3m) (0.05 m/s)
dA/dt = 1.2π m²/s
dA/dt ≈ 3.77
- - - - - - - - - - - - - - -
Third question:
Find dV/dt in terms of A(r) (and I'm assuming only in terms of A(r)).

A(r) = 4πr²
dV/dt = 4πr² (dr/dt)

Since you're given dr/dt = 0.05, plug it in:
dV/dt = 4πr² (0.05)

Also, since A(r) = 4πr², just replace this term in dV/dt with A(r):
dV/dt = 0.05 A(r)

1. 👍 0
2. 👎 0
5. The volume of sphere is increasing at the rate of 1200c.cm/sec. the rate increase in its surface area when the radius is 10cm is

1. 👍 0
2. 👎 0

## Similar Questions

1. ### math

The radius r of a sphere is increasing at the uniform rate of 0.3 inches per second. At the instant when the surface area S becomes 100pi square inches, what is the rate of increase, in cubic inches per second, in the volume V?

2. ### calculus

3. The radius r of a sphere is increasing at a constant rate of 0.04 centimeters per second. (Note: The volume of a sphere with radius r is v=4/3pir^3 ). a. At the time when the radius of the sphere is 10 cm, what is the rate of

3. ### calculus

The radius of a sphere is increasing at a rate of 2 mm/s. How fast is the volume increasing when the diameter is 80 mm? mm^3/s

4. ### Calculus

suppose that a tumor on a person's body is spherical in shape. if the radius of the tumor is 0.5cm the radius is increasing at the rate of 0.001cm per day. what is the rate of increasing volume of that tumor at that time?

1. ### Calculus

Use differentials to estimate the amount of paint needed to apply a coat of paint 0.02 cm thick to a sphere with diameter 40 meters. (Recall that the volume of a sphere of radius r is V=(4/3)πr^3. Notice that you are given that

2. ### Calculus

1. The radius of a sphere is expanding at a rate of 14 in/min. a) Determine the rate at which the volume is changing when the radius is 8 in. b) Determine the rate at which the surface area is changing when the radius is 8 in. 2.

3. ### 4 Calculus Related-Rates Problems

1. How fast does the radius of a spherical soap bubble change when you blow air into it at the rate of 15 cubic centimeters per second? Our known rate is dV/dt, the change in volume with respect to time, which is 15 cubic

4. ### calculus

Sand is poured at the rate of 10 m cube /min so as to form a conical pile whose altitude is always equal to the radius of its base a) How fast is the radius increasing when it is 5 meters? b) Find the rate at which the area of its

1. ### calculus

The radius of a spherical balloon is increasing at a rate of 2 centimeters per minute. How fast is the volume changing when the radius is 8 centimeters? Note: The volume of a sphere is given by 4(pi)r^3

2. ### college calculus

1) each side of a square is increasing at a rate of 6cm/s. At what rate is the area of the square is 16 cm^2? 2)the radius of a sphere is increasing at a rate of 4mm/s.How fast is the volume increasing when the diameter is 80mm?

3. ### Calculus

A sphere is increasing in volume at the rate of 3(pi) cm^3/sec. At what rate is the radius changing when the radius is 1/2 cm? The volume of a sphere is given by V=4/3(pi)r^2 A. pi cm/sec B. 3 cm/sec C. 2 cm/sec D. 1 cm/sec E. .5

4. ### Calculus

The area of a circular oil slick is increasing at a constant rate of 2 square miles per day. How fast is the radius increasing when the area is 4(pi) square miles (approximately 12.57 square miles)? So far I have that the area


text:
# Solution of a congruence problem in number theory

I was solving the following problem in number theory.

Given integers $k,l$ relatively prime to integer $n>3$ such that $kl\equiv1\pmod {n}$, where $n$ takes the form $n=4m,4m+1,4m+2$, and $4m+3$ for some positive integer $m$.

I was trying to find the value of $k$ for particular values of $l$ and $n$.

I assumed $l = 4$. Now, I need to find what values $k$ can attain to satisfy the above assumptions.

My attempt:

Since $l=4$ and it is relatively prime to $n$ then $n$ can not be $4m$ and $4m+2$. In my first case I considered $l=4$ and $n=4m+1$.

Now, since $k$ is relatively prime to $n$, $k$ will take values $4m$, $4m+2$, and few values of $4m+3$.

For example, I took the case where $l=4$, $n=4m+1$, and $k=4m$. This must satisfy $kl\equiv1\pmod {n}$. So I get

$$4(4m)\equiv1\pmod{(4m+1)}.$$

From here onwards, I am unable to proceed to solve and find the generalized value of $k$ for $l=4$ only for this problem. Can anyone help me in finding the solution? Thanks a lot for your help.

• What exactly is the problem? – Jaroslaw Matlak Jul 10 '18 at 13:16
• @JaroslawMatlak I need to find the value of $k$ for $l=4$ and $n=4m+1$ satisfying the congruence relation. – monalisa Jul 10 '18 at 13:23
• Try $k=9$. Have you tried the Chinese remainder theorem? – Jaroslaw Matlak Jul 10 '18 at 13:25
• Actually I am new to number theory. – monalisa Jul 10 '18 at 16:26
• If $k$ and $l$ are relatively prime, such that $k\cdot l\equiv 1\;\left(mod\;n\right)$, then $k\equiv l^{\;\varphi\left(n\right)-1}\;\left(mod\;n\right)$ where $\varphi\left(n\right)$ is the [totient function][1]. [1]: mathworld.wolfram.com/TotientFunction.html – Cleyton Muto Jul 18 '18 at 12:36

For $l = 4$, $(n, l) = 1$ requires that $2 \not\mid n$, i.e. $n \equiv 1, 3 \pmod{4}$. Because $(n, 4) = 1$, then$$4k \equiv 1 \pmod{n} \Longrightarrow k \equiv \frac{1}{4} \equiv \frac{1 + an}{4} \pmod{n},$$ where $a$ is an arbitrary integer. In particular,
1. If $n = 4m + 1 \equiv 1 \pmod{4}$, then$$0 \equiv 1 + an \equiv 1 + a \pmod{4} \Longrightarrow a \equiv -1 \equiv 3 \pmod{4},$$ thus$$k \equiv \frac{1 + 3n}{4} \equiv 3m + 1 \pmod{n}.$$
2. If $n = 4m + 3 \equiv 3 \pmod{4}$, then$$0 \equiv 1 + an \equiv 1 + 3a \pmod{4} \Longrightarrow a \equiv \frac{-1}{3} \equiv \frac{-1 + 4}{3} \equiv 1 \pmod{4},$$ thus$$k \equiv \frac{1 + n}{4} \equiv m + 1 \pmod{n}.$$
• +1. Look like a great answer to me. Examples : $$n=13, k=10, 4 \times 10 = 40 = 1 \mod 13$$ $$n=19, k=5, 4 \times 5 = 20 = 1 \mod 19$$ – gandalf61 Jul 13 '18 at 9:43
• Alex can you explain how you got the step $k \equiv \frac{1}{4} \equiv \frac{1 + an}{4} \pmod{n}$. Please . – monalisa Jul 23 '18 at 13:56


text:
# What is good practice when preparing a package for CTAN?

I'm thinking of submitting a package to CTAN, and would like some hints which will help keep the path as smooth as possible for me, the CTAN administators, and the final users.

Please tell me what I should take care with in doing this. In particular, the doubts I have are:

1. I'm not a top-drawer TeXnician, so I don't really understand .dtx and .ins files. Can I get by without them, and is it OK just to submit a zip file containing a flat folder?

2. I'll be preparing the package user documentation (by hand) as a PDF. Should I use a specific document class, or can I, for example, use `memoir`?

3. How important is it to provide the source LaTeX code for the documentation?

4. If I do provide the documentation source, should I "declare" the prerequisite packages for formatting the manual (as opposed to the prereqs for using the package) as prereqs for the package?

-
I've just seen How can I contribute to CTAN? so I'm probably duplicating, but as I have specific doubts, I'll leave the question for now. Please feel free to close, though. –  Brent.Longborough Aug 7 '11 at 19:22
It matters what you are uploading. If you are sending a font or font support package, for instance, I'd suggest that a doc with font tables would be useful to a person who visits your dir. But if you are uploading, say, a thesis style in LaTeX then just the files mycollege.sty, README, mycollege.tex, and mycollege.pdf, put together in a .zip, would be perfectly suitable. –  Jim Hefferon Feb 20 '12 at 0:46

The CTAN admins don't require compliance to the DTX format at all. Your code and documentation must simply be in a usable form. You should add a short `README` text file which describes the package well enough so that people can decide if they want install it.

1. DTX and INS files are not mandatory. You can just include the STY file and a TEX file for the documentation. If you want you can use the `sty2dtx` script (written by me) to convert a STY file into the DTX format.

2. You can use any class you want. However, it should still be compilable by other people.

3. CTAN itself will include documentation without sources, but e.g. TeX Live will not include it as long the source is not freely available ("Free documentation is as important as free software.")

4. Simply provide a full main file which loads all required packages like for any other LaTeX document. The package and its documentation document are kind of "independent". You should keep package requirements of the manual away from the actual package.

IMHO the large majority of people will simply use the PDF file from CTAN or their used TeX distribution and not try to compile it by themselves. However, people should still be able to do so. Then however, it is OK to not explicitly list all packages again somewhere. A normal formatted LaTeX document with the required `\usepackage` statements should be just fine. Of course people then need to install the required class and packages when they want to compile the documentation themselves. This is fine as long these are also on CTAN (and best in the main distribution).

There is also now my `ctanupload` script to automate the uploading process to CTAN.

-
Martin, thank you, just what I needed to give me confidence... –  Brent.Longborough Aug 7 '11 at 20:02
while there are not many constraints on what you provide, you'll get sniffy reactions if you use a "private" class and/or "private" packages for the documentation. doesn't often happen, but do remember... –  wasteofspace Aug 8 '11 at 21:45
the only way a private package in your doc is a problem is if it's not generally available; that situation makes your package "nosource", since it can't be re-typeset by someone else; nosource packages won't be included in tex live (and shouldn't be in miktex, but i'm not so sure about the rules there). some people include such a package with their upload, while others upload it separately and reference it. –  wasteofspace Nov 27 '11 at 15:28

There is one (minor) issue which might come in handy: choose the name of your documentation file (your pdf) in accordance with your package, i.e. `<package>.pdf`.

This allows others to call `texdoc <package>` and the command will launch the appropriate documentation file.

Furthermore, I think the CTAN guys appreciate hints about the format of your submission. For example, it is worth to note whether your .zip file contains a TDS directory structure or simply the files which make up your package - without much of a directory structure.

-
please do not tds structure your submissions; if you know what you're doing (a lot of people submitting tds-structured stuff obviously don't) make a .tds.zip file; that is automatically checkable, and is separately referenced from the catalogue entry for the package. (.tds.zip files also simplify life for the tex live team, aiui -- but they sometimes spot things that ctan's automatic checking hasn't picked up) –  wasteofspace Nov 27 '11 at 16:11
@anon you are right: the best-practise to "note whether the .zip contains TDS or not" is use the naming convention `.tds.zip` . In general, I would agree with your hint to avoid TDS structure. TDS is only appropriate (perhaps even a must-be) for huge projects (especially multi-platform-projects). –  Christian Feuersänger Nov 27 '11 at 16:58

I just want to add that the creation of a .dtx and .ins file is a REALLY SIMPLE issue, and is a very powerful tool to create in one step the documentation for your code.

Just open the terminal and type

``````texdoc dtxtut
``````

Enjoy!

-
Personally the `dtxtut` manual and the DTX format first confused me quite a bit and I didn't enjoyed it. ;-) Added the required documentation macros to each and every of your own macros is a pain if done manually (I then wrote `sty2dtx` for it). Also writing a good and comprehensive manual for your package is always a small challenge at the very least. –  Martin Scharrer Aug 8 '11 at 17:31
Also note that `texdoc` might not be available for every TeX installation (not sure about Windows for example; if installed it might not be in the PATH). Therefore I would always point to the manual itself, e.g. using something like "see the `dtxtut` document/manual". –  Martin Scharrer Aug 8 '11 at 17:33
Although `.dtx` format is helpful for documenting the code of a package, it becomes quite cumbersome to use at the same time for maintaining the user documentation, I think. –  Alan Munn Aug 8 '11 at 17:52
Sam, thank you for your encouragement to learn about the world of .dtx. The reason I've not taken the time to study it so far is that I haven't had a need to. I do respect it as "literate programming", though my lazier half tends to agree with Alan Munn. And then, there's so much else to get through!!! –  Brent.Longborough Aug 8 '11 at 19:51
I would completely agree with Alan and Martin in that a) `.dtx` is mainly useful as API documentation and b) that a comprehensive user's guide is always a small challenge at the very least. While it is certainly good to have both, I would encourage you to put all of your effort into the user's guide - and comment the rest using TeX comments into the source code. After all, you will probably have much more users than contributors. To be honest: I have never read the automatically generated API doc of any LaTeX package. If I needed to, I looked into the code (ok, in the `.dtx` if available). –  Christian Feuersänger Nov 29 '11 at 22:06

In addition to what Martin has replied (and I would reiterate the non-requirement of the `.dtx` format), a very useful utility is Scott Pakin's `ctanify` script, which packages your stuff into a format specifically designed for upload to CTAN and inclusion into TeXLive. The script works out of the box on Linux and OS X and under Cygwin for Windows.

For example, a fairly simple package or class would likely have the following components:

• `mypackage.sty` (the package itself)
• `mypackage.tex` (the package documentation source)
• `mypackage.pdf` (the compiled package documentation)
• `README` (a plain text README file (with no extension))

Using `ctanify` all I need to do is issue the following command (assuming I'm within the directory of the package):

``````ctanify mypackage.* *.tex=doc README
``````

and this will produce a `tar.gz` file containing copies of all the files, plus a `.tds.zip` version of the files with the `.sty` file in `/tex/latex/mypackage`, the documentation in `/doc/latex/mypackage`. This latter file is used for TeXLive.

Here's a breakdown of the arguments I gave to the command:

``````mypackage.* % will automatically deal with .sty, .cls, .pdf, .dtx and .ins
*.tex=doc % put all .tex files into the doc folder
README % include the README file (will go into the /doc folder)
``````

I've just described the simple use. Of course if your package or class has a more complicated set of files, the command would need to be modified appropriately. For example, if you have `.tex` files that are part of the package itself and not part of the documentation you wouldn't use `*.tex` but would specify `mypackage.tex=doc` for the documentation source and a separate specification for the other `.tex` files.

-
Alan, many thanks, a useful complement to Martin's answer –  Brent.Longborough Aug 7 '11 at 20:37
@Brent: Indeed, I use `ctanify` myself. It is very useful to produce the TDS ZIP file and the final tar.gz file. –  Martin Scharrer Aug 7 '11 at 20:58


text:
# You're reading: Posts Tagged: Numberphile

### Ditching the fifth axiom (video)

Watch geometer/topologist Caleb Ashley explain the parallel postulate on Numberphile.

### Carnival of Mathematics 145

Welcome to the 145th Carnival of Mathematics, hosted here at The Aperiodical.

If you’re not familiar with the Carnival of Mathematics, it’s a monthly blog post, hosted on some kind volunteer’s maths blog, rounding up their favourite mathematical blog posts (and submissions they’ve received through our form) from the past month, ish. If you think you’d like to host one on your blog, simply drop an email to katie@aperiodical.com and we can find an upcoming month you can do. On to the Carnival!

### New Mersenne prime discovered, and promptly printed out

Breaking news! On 19th January 2016, the Great Internet Mersenne Prime Search discovered a new largest prime number – we know 49 Mersenne primes, the largest of which is now $2^{74207281}-1$, a number containing over 22 million digits and full of primey goodness.

Internet Maths Person Matt Parker has responded to the news in spectacular style, by issuing a 14-minute long video explaining the discovery and its implications, as well as somehow scoring an interview with the actual discoverer of the new prime, Curtis Cooper.

### How I Wish I Could Celebrate Pi

People with an interest in date coincidences are probably already getting themselves slightly over-excited about the fact that this month will include what can only be described as Ultimate π Day. That is, on 14th March 2015, written under certain circumstances by some people as 3/14/15, we’ll be celebrating the closest that the date can conceivably get to the exact value of π (in that format).

Of course, sensible people would take this as an excuse to have a party, so here’s my top $\tau$ recommendations for having a π party on π day.

### 3.142: a π round-up

π pie by Robert Couse-Baker. Photo used under the CC-BY 2.0 licence.

‘Tis the season to celebrate the circle constant! Yes, that’s right: in some calendar systems using some date notation, the day and month coincide with the first three digits of π, and mathematicians all over the world are celebrating with thematic baked goods and the wearing of irrational t-shirts.

And the internet’s maths cohort isn’t far behind. Here’s a round-up (geddit – round?!) of some of our favourites. In case you were wondering, we at The Aperiodical hadn’t forgotten about π day – we’re just saving ourselves for next year, when we’ll celebrate the magnificent “3.14.15”, which will for once be more accurate to the value of π than π approximation day on 22/7. (Admittedly, for the last few years, 3.14.14 and so on have strictly been closer to π than 22/7. But this will be the first time you can include the year and feel like you’re doing it right.)

### John Conway on Numberphile!

Numberphile, the supremum over all YouTube channels, has scored a bit of a coup – Brady has sat down and recorded an interview with the famously Internet-reclusive John Conway.

In this first video (there’s a bonus one linked at the end of this one, and I hope there’ll be more) John talks about his love/hate relationship with his Game of Life.


text:
# Boolean spaces

## Definitions

A boolean space is …

Boolean spaces and their homomorphisms form a category $Boo Sp$.

## References

Revised on July 9, 2010 00:57:39 by Toby Bartels (173.60.119.197)