text:
# Weighted Hardy operators in the local generalized vanishing Morrey spaces

Weighted Hardy operators in the local generalized vanishing Morrey spaces In this paper we study $$p\rightarrow q$$ -boundedness of the multi-dimensional Hardy type operators in the vanishing local generalized Morrey spaces $$V\mathcal L ^{p,\varphi }_\mathrm{{loc}}(\mathbb R ^n,w)$$ defined by an almost increasing function $$\varphi (r)$$ and radial type weight $$w(|x|)$$ . We obtain sufficient conditions, in terms of some integral inequalities imposed on $$\varphi$$ and $$w$$ , for such a boundedness. In the case where the function $$\varphi (r)$$ and the weight are power functions, these conditions are also necessary. http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png Positivity Springer Journals

# Weighted Hardy operators in the local generalized vanishing Morrey spaces

, Volume 17 (3) – Sep 9, 2012
24 pages

/lp/springer_journal/weighted-hardy-operators-in-the-local-generalized-vanishing-morrey-kgCEIlPICi
Publisher
Springer Journals
Subject
Mathematics; Fourier Analysis; Operator Theory; Potential Theory; Calculus of Variations and Optimal Control; Optimization; Econometrics
ISSN
1385-1292
eISSN
1572-9281
D.O.I.
10.1007/s11117-012-0199-z
Publisher site
See Article on Publisher Site

### Abstract

In this paper we study $$p\rightarrow q$$ -boundedness of the multi-dimensional Hardy type operators in the vanishing local generalized Morrey spaces $$V\mathcal L ^{p,\varphi }_\mathrm{{loc}}(\mathbb R ^n,w)$$ defined by an almost increasing function $$\varphi (r)$$ and radial type weight $$w(|x|)$$ . We obtain sufficient conditions, in terms of some integral inequalities imposed on $$\varphi$$ and $$w$$ , for such a boundedness. In the case where the function $$\varphi (r)$$ and the weight are power functions, these conditions are also necessary.

### Journal

PositivitySpringer Journals

Published: Sep 9, 2012

## You’re reading a free preview. Subscribe to read the entire article.

### DeepDyve is your personal research library

It’s your single place to instantly
that matters to you.

over 18 million articles from more than
15,000 peer-reviewed journals.

All for just $49/month ### Explore the DeepDyve Library ### Search Query the DeepDyve database, plus search all of PubMed and Google Scholar seamlessly ### Organize Save any article or search result from DeepDyve, PubMed, and Google Scholar... all in one place. ### Access Get unlimited, online access to over 18 million full-text articles from more than 15,000 scientific journals. ### Your journals are on DeepDyve Read from thousands of the leading scholarly journals from SpringerNature, Elsevier, Wiley-Blackwell, Oxford University Press and more. All the latest content is available, no embargo periods. DeepDyve ### Freelancer DeepDyve ### Pro Price FREE$49/month
\$360/year

Save searches from
PubMed

Create lists to

Export lists, citations


text:
# Optimization of known function with respect to two unknown function arguments

I have a data set, composed of points $(x_i, y_i)$ for $i=1,N$. I also have a known function $F$, which maps these points $x_i$ to $y_i$ as such $F(x_i, a(x_i),b(x_i)) = y_i$, where $a(x_i)$ and $b(x_i)$ are unknown functions of $x_i$. What I'd like to do is run an optimization (ideally using Python packages) in order to determine the functions $a$ and $b$ such that the error is minimized and also such that the functions $a$ and $b$ are smooth.

One, possibly naive way of doing this is to bin my data with respect to the $x_i$ variable, and then solve the optimization problem $F(x_i, a,b) = y_i$ for the single values $a,b$ for all points within the bin. Then, using this discretized solution for $a,b$, perform a numerical fit which results in a smooth curve.

However, I'm wondering if this is the best way to go about it. Is there a method that I could use which would determine the $a,b$ values simultaneously while trying to create a smooth curve from them? Or even if there were, would the effect be the same as if I perform the naive binned-optimization as I've described above?

Your problem is ill posed in the sense that if a solution exists, it is not unique. To see this, let ($a_i^*$, $b_i^*$), denote a solution of the equation $F(x_i, a_i,b_i)=y_i$, $i\in\{1,\ldots,N\}$ (or the minimizers of an appropriate cost function if equality cannot be achieved). Then, any pair of functions $\{a^*(x)$, $b^*(x)\}$ such that $a^*(x_i)=a_i^*$, $b^*(x_i)=b_i^*$, for all $i\in\{1,\ldots,N\}$, is a solution to your problem. Clearly, the set of all possible solutions is uncountable, even with the additional requirement that they are 'smooth'.

In order to avoid this ambiguity in the solution, one approach is to impose additional conditions. For example, you could restrict the solution functions to belong to a finite dimensional (and 'smooth') space (e.g., the space of polynomials of order $n$). In that case, the (difficult) functional optimization problem is converted to the (much simpler) problem of determination of a finite set of variables.

• Yes, thank you for the clarity in what I'm looking for. Certainly I have no constraints on any aspect of the function outside the range of x_i, so I cannot have a unique solution. While I'm not yet sure what sort of basis set I should use to represent the functions a and b, that is a topic I know how to explore. Thanks again! – gammapoint Nov 22 '16 at 21:43

You could discretize the unknown functions $a$ and $b$, then formulate this as a least squares optimization problem with smoothing regularization. Specifically:

$$\min_{\mathbf{a}, \mathbf{b}} \frac{1}{2}\sum_{i=1}^N\left( f_i - F(x_i, \mathbf{m}_i^T \mathbf{a}, \mathbf{m}_i^T \mathbf{b}) \right)^2 + \frac{\alpha}{2} \mathbf{a}^T R \mathbf{a} + \frac{\alpha}{2} \mathbf{b}^T R \mathbf{b}$$

where

• $\mathbf{a}$ and $\mathbf{b}$ are coefficients of $a$ and $b$ with respect to some discrete set of basis functions $\{\phi_j\}_{j=1}^m$ (say, a piecewise linear basis of "hat" functions), $$a(x) = \sum_{j=1}^m \mathbf{a}_j \phi_j (x)$$
• $f_i$ is the $i$'th piece of data you are trying to fit,
• $\mathbf{m}_i^T := \begin{bmatrix}\phi(x_1) & \phi(x_2) & \dots & \phi(x_N)\end{bmatrix}$ is the "measure at $x_i$ vector" such that $$\mathbf{m}_i^T \mathbf{a} = a(x_i)$$
• R is a discrete form of the Laplacian with Neumann boundary conditions, plus some small multiple $\tau$ of the identity: $$R := \Delta_N + \tau I.$$

This could then be solved with the Gauss-Newton method, or L-BFGS, or something like that, (it is straightforward enough to figure out the derivative of the objective function by hand). In Python you could do the discretization with FEniCS, and the optimization with Scipy, though it will involve knowing a little about finite elements and a little about optimization.

• Thank you for your suggestion, Nick. Modifying the objective function to explicitly have a smoothing term is something I thought about vaguely, but didn't know exactly the best way to approach that. Your suggestion is useful in that regard, though I think I may go with a naive binning as I've stated in my question or with a particular basis set for the a and b functions as Stelios suggested. If those don't work for my application as needed, I'll revisit your thoughts. – gammapoint Nov 22 '16 at 21:49

format: plain


text:
Definitions

# Graham

[grey-uhm, gram]
Wallas, Graham, 1858-1932, English political scientist and psychologist. He joined (1886) the Fabian Society and was the author of one of the Fabian Essays. In 1914, Wallas became professor of political science at the Univ. of London. In his lectures and writings he studied the psychological factors in politics and advocated government by specially trained persons. Wallas wrote a biography of Francis Place (1898), Human Nature in Politics (1908), The Great Society (1914), Our Social Heritage (1921), and The Art of Thought (1926).

See study by M. J. Wiener (1971).

Greene, Graham (Henry Graham Greene), 1904-91, English novelist and playwright. Although most of his works combine elements of the detective story, the spy thriller, and the psychological drama, his novels are essentially parables of the damned. Greene's heroes realize their sins and achieve salvation only through great pain and soul-searching agony. A Roman Catholic convert (1926), he was intensely concerned with the moral problems of humans in relation to God. Some of his 26 novels have been ranked as thrillers, and Greene himself called such works as Stamboul Train (1932; U.S. title, Orient Express) and The Ministry of Fear (1943) "entertainments" to distinguish them from his more serious efforts. His major works, which include Brighton Rock (1938), The Power and the Glory (1940), The Heart of the Matter (1948), and The End of the Affair (1951), mark him as a novelist of high distinction.

Greene was a superb journalist, a sometime British spy, and a world traveler, often courting danger in various international wars and revolutions and participating in local high and low life in dozens of famous and obscure corners of Europe, Asia, Africa, and Latin America. Many of his novels are set in locations with which he had personal experience, sites often of topical journalistic interest: The Quiet American (1955) a prescient account of early American involvement in Vietnam; Our Man in Havana (1958), set in Cuba; A Burnt-Out Case (1961), in the Belgian Congo just before its independence; The Comedians (1966), in François Duvalier's Haiti; and The Captain and the Enemy (1980), in Panama. His fine sense of comedy is displayed in the short-story collection May We Borrow Your Husband? (1967) and the novel Travels with My Aunt (1969). Greene also wrote several plays, including The Living Room (1953) and The Potting Shed (1957), both thinly disguised religious dramas, and The Complaisant Lover (1959), a witty and intelligent play about marriage and infidelity. He also is noted for his essays, travel books, film criticism, and film scripts, including the mystery melodrama The Third Man (1950).

See his autobiographies (1971, 1980) and his posthumously published A World of My Own: A Dream Diary (1995); S. Hazzard, Greene on Capri: A Memoir (2000); R. Greene, ed., Graham Greene: A Life in Letters (2008); biographies by M. Shelden (1994) and N. Sherry (3 vol., 1989-2004); studies by H. J. Donaghy (1983), A. A. De Vitis (1986), and J. Meyers, ed. (1990).

Graham, Billy (William Franklin Graham), 1918-, American evangelist, b. Charlotte, N.C., grad. Wheaton College (B.A., 1943). Graham was ordained a minister in the Southern Baptist Church (1939), was the pastor of a Chicago church (his first and last pastorate), and in 1944 became an evangelist for the American Youth for Christ movement. In 1949 he received national attention for an extended evangelical campaign in Los Angeles. He subsequently made preaching tours (for which he popularized the term "crusade") in most major U.S. cities and in Europe, Africa, South America, Asia, Australia, and Russia. His reputation made him a favored guest among politicians and presidents. Graham, who in his preaching has consistently stressed personal conversion and scriptural authority, is identified with the conservative Protestant movement known as neo-evangelicalism (see fundamentalism) and is to a large degree responsible for establishing it as part of the American mainstream. He is also the co-founder of the journal Christianity Today. The Billy Graham Evangelical Association, founded in the early 1950s, publishes Decision magazine and produces programs for radio, television, and screen. Graham retired as head of the association in 2000; Franklin Graham, his son, succeeded him as its leader. Billy Graham held his final crusade in 2004.

See his autobiography, Just as I Am (1997); biographies by W. C. McLaughlin (1960), M. Frady (1979), and W. Martin (1991); study by S. P. Miller (2009).

Graham, George, 1674?-1751, English instrument maker. A clockmaker by trade, Graham designed clocks and watches that earned him membership in the Royal Society and were still manufactured into the present century. In 1725 he built a very accurate 8-ft (2.4-m) quadrant for the royal astronomer, Edmund Halley, at Greenwich; it was widely copied. His most important invention remains the micrometer screw, which enabled him to build zenith sections and calipers of unprecedented precision. Graham is buried in Westminster Abbey.
Graham, Katharine Meyer, 1917-2001, American publisher, b. New York City, grad. Univ. of Chicago (1938). She first worked as a copy girl at the Washington Post, which was owned by her father, Eugene Meyer; after college, she joined the San Francisco News. After she returned to the Post, she met and married (1940) Philip Graham, who joined the paper and later became publisher; she soon became a well-known Washington socialite. After her husband's suicide (1963), she took over The Washington Post Company and over the years greatly expanded it; the organization now includes television stations and cable systems among its holdings. As publisher (1969-79) of the Post, she transformed the newspaper, which had improved during her husband's tenure but was still relatively mediocre, into one of the country's finest and most influential journals. Concurrently, she transformed herself into one of Washington's most powerful figures. Graham became particularly well known for withstanding political pressure from the Nixon administration when she approved the printing of the Pentagon Papers and when she supported the Post's active pursuit of the Watergate story, for which it won a 1973 Pulitzer Prize. Her son, Donald E. Graham, succeeded her as publisher in 1979 and as chair of the board in 1993.

See her autobiography, Personal History (1997; Pulitzer Prize); H. Bray, Pillars of the Post (1980); C. M. Roberts, In the Shadow of Power (1989); C. Felsenthal, Power, Privilege, and the Post: The Katharine Graham Story (1993).

Graham, Martha, 1894-1991, American dancer, choreographer, and teacher, b. Pittsburgh. Her family moved from Allegheny, Pa., to Santa Barbara, Calif., when she was 14. After 1916, Graham attended the Denishawn School, Los Angeles; in 1920 she made her debut in Ted Shawn's Xochitl, which was created for her. She left the Denishawn company in 1923 to dance in musical revues and to make her independent debut (1926). Graham first appeared with her own group of dancers in 1929, began her tours after 1939, and became, according to many critics, the seminal figure in modern dance. Her choreography, which requires great discipline and flexibility to perform, is highly individual, stark, and angular. Her dances became more explosive and less abstract in the late 1930s and early 1940s, as she achieved her mature style.

Graham's dances often draw upon historical and mythological subjects. After World War II, she created works based increasingly on Freudian and Jungian themes and centered on the female figure. Her works include Primitive Mysteries (1931), Letter to the World (1940), Deaths and Entrances (1943), Appalachian Spring (1944), Cave of the Heart (1946), Seraphic Dialogue (1955), Phaedra (1962), and Archaic Hours (1969), created the year she retired from dancing. Because so many of her students themselves became choreographers and leaders of companies, her influence on modern dance is especially widespread. Her own troupe, the oldest dance company in the United States, faced problems a decade after her death. Internecine struggles caused the closure (2000-2002) of the Martha Graham Dance Center, but a legal decision in late 2002 allowed the company to regroup, and they began to perform her dances again in early 2003.

See her Notebooks (1973) and her autobiography, Blood Memory (1991); biography by D. McDonagh (1973); E. Stodelle, Deep Song (1984); A. de Mille, Martha: The Life and Work of Martha Graham (1991); R. Tracy, ed., Goddess: Martha Graham's Dancers Remember (1996).

Graham, Otto Everett, Jr.,1921-2003, American football player and coach, b. Waukegan, Ill. He was an All-American football and basketball player at Northwestern Univ. before he joined the Cleveland Browns in 1946 after serving in the Navy (1944-5) and briefly playing professional basketball. Playing at quarterback, Graham led the Browns to ten championship games and seven titles (1946-9 in the All-America Football Conference; 1950 and 1954-5 in the National Football League. An outstanding passer, he was a four-time NFL All-Pro player before he retired in 1955. He coached at the U.S. Coast Guard Academy (1959-66), where he was also athletic director (1959-66, 1970-85), and for the Washington Redskins (1966-8).
Graham, Philip Leslie, 1915-63, American publisher, b. S.Dak. After editing the Harvard Law Review, he served as a law clerk to his mentor, Supreme Court Justice Felix Frankfurter. In 1940 he married Katharine Meyer Graham, whose father, Eugene Meyer, owned the Washington Post. Meyer named him associate publisher of the Post in 1946, and publisher six months later. After Graham took charge, he gave the Post a new and more politically assertive direction and was considered by many to be an influential journalist. In 1961, the Post acquired Newsweek magazine. After the severely depressed Graham committed suicide in 1963, Katharine Graham took over the company.

See H. Bray, Pillars of the Post (1980); C. M. Roberts, In the Shadow of Power (1989).

Graham, Sylvester, 1794-1851, American reformer and Presbyterian minister, b. West Suffield, Conn. He advocated a vegetable diet as a cure for intemperance and the use of coarsely ground whole-wheat flour. Graham flour was named for him.
Graham, Thomas, 1805-69, Scottish chemist, best known for research in diffusion in both gases and liquids that led to his formulation of Graham's law. His discovery that certain substances (e.g., glue, gelatin, starch) pass through a membrane more slowly than others (inorganic salts, e.g., common salt, or sodium chloride) led him to draw a distinction between the two groups, calling the former (the slower) colloids and the latter crystalloids. In this connection he discovered dialysis. His work was the earliest in colloidal chemistry. His investigation of phosphoric acid led to the present chemical concept of polybasic acids.
Sutherland, Graham, 1903-80, English painter. Sutherland began his career as a painter at 35 and gained international acclaim with his paintings of war devastation. Among his major religious works are a tapestry for Coventry Cathedral and a series of paintings entitled Thorns. Realistically painted in sharp, cruel forms, they are symbolic of the Passion.

See studies by E. Sackville-West (1955) and D. Cooper (1962).

(born Aug. 24, 1903, London, Eng.—died Feb. 17, 1980, London) British painter. After studying art in London, he taught and practiced printmaking (1926–40) at the Chelsea School of Art. His early work was characterized by an exacting representationalism that evolved into Surrealism. He turned primarily to painting circa 1935 and served as official war artist 1940–45; his war paintings are an evocative record of desolation. His “thorn period” began with his Crucifixion (1946), considered to be one of the most important religious paintings of the 20th century. In such late works he incorporated anthropomorphic insect and plant forms, particularly thorns, which he transformed into powerful, frightening totemic images. Sutherland was known, too, for his expressionistic, penetrating portraits. He also designed the enormous tapestry (circa 1955–61) for the new Coventry Cathedral.

(born 1612—died May 21, 1650, Edinburgh, Scot.) Scottish general in the English Civil Wars. He served in the Covenanter army that invaded northern England (1640) but remained a royalist. Appointed lieutenant-general by Charles I (1644), he led his royalist army of Highlanders and Irish to victories in major battles in Scotland. After Charles's defeat in 1645, Montrose fled to the European continent. He returned to Scotland in 1650 with 1,200 men, but he was defeated, captured, and hanged.

Learn more about Montrose, James Graham, 5th earl and 1st marquess of with a free trial on Britannica.com.

(born May 11, 1894, Allegheny county, Penn., U.S.—died April 1, 1991, New York, N.Y.) U.S. dancer, teacher, choreographer, and foremost exponent of modern dance. She studied from 1916 with Ted Shawn at the Denishawn School of Dancing and Related Arts, then left in 1923 for New York, where she founded her own school in 1927 and a performing company in 1929. She choreographed more than 160 works, creating unique “dance plays” and using a variety of themes to express emotion and conflict. Many are based on American themes, including Appalachian Spring (1944); other works include Primitive Mysteries (1931), El Penitente (1940), Letter to the World (1940), Cave of the Heart (1946), Clytemnestra (1958), Phaedra (1962), and Frescoes (1978). She collaborated for many years with Louis Horst, her musical director, and with Isamu Noguchi, who designed many of her sets. She retired from dancing in 1970 but continued to teach and choreograph. Her technique became the first significant alternative to classical ballet, and her influence extended worldwide through her choreography and her students.

(born 1612—died May 21, 1650, Edinburgh, Scot.) Scottish general in the English Civil Wars. He served in the Covenanter army that invaded northern England (1640) but remained a royalist. Appointed lieutenant-general by Charles I (1644), he led his royalist army of Highlanders and Irish to victories in major battles in Scotland. After Charles's defeat in 1645, Montrose fled to the European continent. He returned to Scotland in 1650 with 1,200 men, but he was defeated, captured, and hanged.

Learn more about Montrose, James Graham, 5th earl and 1st marquess of with a free trial on Britannica.com.

(born Oct. 2, 1904, Berkhamsted, Hertfordshire, Eng.—died April 3, 1991, Vevey, Switz.) British author. After studying at the University of Oxford, he converted to Roman Catholicism in 1926. Beginning circa 1930 he worked principally as a freelance journalist for several decades, during which he traveled widely. Stamboul Train (1932; also h1d Orient Express; film, 1934) was the first of his “entertainments,” thrillers with considerable moral complexity and depth; others included A Gun for Sale (1936; also h1d This Gun for Hire; film, 1942), The Confidential Agent (1939; film, 1945), and The Third Man (1949; film, 1949). His finest novels—Brighton Rock (1938; film, 1948), The Power and the Glory (1940; film, 1962), The Heart of the Matter (1948; film, 1954), and The End of the Affair (1951; film, 1999)—all have distinctly religious themes. Several of his novels set in “third-world” nations on the brink of political upheaval were also adapted as films.

(born Dec. 6, 1921, Waukegan, Ill., U.S.—died Dec. 17, 2003, Sarasota, Fla.) U.S. gridiron football player and coach. He was a star tailback at Northwestern University, but he is best remembered as quarterback of the Cleveland Browns during a 10-year period (1946–55) in which they won 105 games, lost 17, and tied 5 in regular season play and won 7 of 10 championship games. Graham's career average yardage per pass (8.63) was still an NFL record at the beginning of the 21st century. His coaching career was mainly with the U.S. Coast Guard Academy (1959–66) and the Washington Redskins (1966–68). He was inducted into the Pro Football Hall of Fame in 1965.

(born May 11, 1894, Allegheny county, Penn., U.S.—died April 1, 1991, New York, N.Y.) U.S. dancer, teacher, choreographer, and foremost exponent of modern dance. She studied from 1916 with Ted Shawn at the Denishawn School of Dancing and Related Arts, then left in 1923 for New York, where she founded her own school in 1927 and a performing company in 1929. She choreographed more than 160 works, creating unique “dance plays” and using a variety of themes to express emotion and conflict. Many are based on American themes, including Appalachian Spring (1944); other works include Primitive Mysteries (1931), El Penitente (1940), Letter to the World (1940), Cave of the Heart (1946), Clytemnestra (1958), Phaedra (1962), and Frescoes (1978). She collaborated for many years with Louis Horst, her musical director, and with Isamu Noguchi, who designed many of her sets. She retired from dancing in 1970 but continued to teach and choreograph. Her technique became the first significant alternative to classical ballet, and her influence extended worldwide through her choreography and her students.

in full William Franklin Graham, Jr.

(born Nov. 7, 1918, Charlotte, N.C., U.S.) U.S. Christian evangelist. The son of a dairy farmer, he underwent a conversion experience at age 16 during a revival. After attending Bob Jones College and the Florida Bible Institute, he was ordained a Southern Baptist clergyman in 1940. He later earned a degree in anthropology from Wheaton College. He won numerous converts with his tent revivals and radio broadcasts, and by 1950 he had become fundamentalism's leading spokesman. He led a series of widely televised international revival crusades through the Billy Graham Evangelistic Association in Minneapolis, Minn., and he enjoyed close associations with a series of U.S. presidents. Graham and his wife, Ruth, were awarded the Congressional Gold Medal in 1996.

(born Aug. 24, 1903, London, Eng.—died Feb. 17, 1980, London) British painter. After studying art in London, he taught and practiced printmaking (1926–40) at the Chelsea School of Art. His early work was characterized by an exacting representationalism that evolved into Surrealism. He turned primarily to painting circa 1935 and served as official war artist 1940–45; his war paintings are an evocative record of desolation. His “thorn period” began with his Crucifixion (1946), considered to be one of the most important religious paintings of the 20th century. In such late works he incorporated anthropomorphic insect and plant forms, particularly thorns, which he transformed into powerful, frightening totemic images. Sutherland was known, too, for his expressionistic, penetrating portraits. He also designed the enormous tapestry (circa 1955–61) for the new Coventry Cathedral.

in full William Franklin Graham, Jr.

(born Nov. 7, 1918, Charlotte, N.C., U.S.) U.S. Christian evangelist. The son of a dairy farmer, he underwent a conversion experience at age 16 during a revival. After attending Bob Jones College and the Florida Bible Institute, he was ordained a Southern Baptist clergyman in 1940. He later earned a degree in anthropology from Wheaton College. He won numerous converts with his tent revivals and radio broadcasts, and by 1950 he had become fundamentalism's leading spokesman. He led a series of widely televised international revival crusades through the Billy Graham Evangelistic Association in Minneapolis, Minn., and he enjoyed close associations with a series of U.S. presidents. Graham and his wife, Ruth, were awarded the Congressional Gold Medal in 1996.

Alexander Graham Bell.

(born March 3, 1847, Edinburgh, Scot.—died Aug. 2, 1922, Beinn Bhreagh, Nova Scotia, Can.) Scottish-born U.S. audiologist and inventor. He moved to the U.S. in 1871 to teach the visible-speech system developed by his father, Alexander Melville Bell (1819–1905). He opened his own school in Boston for training teachers of the deaf (1872) and was influential in disseminating these methods. In 1876 he became the first person to transmit intelligible words through electric wire (“Watson, come here, I want you,” spoken to his assistant Thomas Watson). He patented the telephone the same year, and in 1877 he cofounded Bell Telephone Co. With the proceeds from France's Volta Prize, he founded Volta Laboratory in Washington, D.C., in 1880. His experiments there led to the invention of the photophone (which transmitted speech by light rays), the audiometer (which measured acuteness of hearing), the Graphophone (an early practical sound recorder), and working wax recording media, both flat and cylindrical, for the Graphophone. He was chiefly responsible for founding the journal Science, founded the American Association to Promote Teaching of Speech to the Deaf (1890), and continued his significant research on deafness throughout his life.

Alexander Graham Bell.

(born March 3, 1847, Edinburgh, Scot.—died Aug. 2, 1922, Beinn Bhreagh, Nova Scotia, Can.) Scottish-born U.S. audiologist and inventor. He moved to the U.S. in 1871 to teach the visible-speech system developed by his father, Alexander Melville Bell (1819–1905). He opened his own school in Boston for training teachers of the deaf (1872) and was influential in disseminating these methods. In 1876 he became the first person to transmit intelligible words through electric wire (“Watson, come here, I want you,” spoken to his assistant Thomas Watson). He patented the telephone the same year, and in 1877 he cofounded Bell Telephone Co. With the proceeds from France's Volta Prize, he founded Volta Laboratory in Washington, D.C., in 1880. His experiments there led to the invention of the photophone (which transmitted speech by light rays), the audiometer (which measured acuteness of hearing), the Graphophone (an early practical sound recorder), and working wax recording media, both flat and cylindrical, for the Graphophone. He was chiefly responsible for founding the journal Science, founded the American Association to Promote Teaching of Speech to the Deaf (1890), and continued his significant research on deafness throughout his life.

Graham's law, also known as Graham's law of effusion, was formulated by Scottish physical chemist, Thomas Graham. Graham found experimentally that the rate of effusion of a gas is inversely proportional to the square root of the mass of its particles. This formula can be written as:

$\left\{mbox\left\{Rate\right\}_1 over mbox\left\{Rate\right\}_2\right\}=sqrt\left\{M_2 over M_1\right\}$

where:

Rate1 is the rate of effusion of the first gas.
Rate2 is the rate of effusion for the second gas.
M1 is the molar mass of gas 1
M2 is the molar mass of gas 2.

Graham's law states that the rate of diffusion of a gas is inversely proportional to the square root of its molecular weight. Thus, if the molecular weight of one gas is four times that of another, it would diffuse through a porous plug or escape through a small pinhole in a vessel at half the rate of the other. A complete theoretical explanation of Graham's law was provided years later by the kinetic theory of gases. Graham's law provides a basis for separating isotopes by diffusion — a method that came to play a crucial role in the development of the atomic bomb.

Graham's law is most accurate for molecular effusion which involves the movement of one gas at a time through a hole. It is only approximate for diffusion of one gas in another or in air, as these processes involve the movement of more than one gas.

## History

Graham's research on the diffusion of gases was triggered by his reading about the observation of German chemist Johann Döbereiner that hydrogen gas diffused out of a small crack in a glass bottle faster than the surrounding air diffused in to replace it. Graham measured the rate of diffusion of gases through plaster plugs, through very fine tubes, and through small orifices. In this way he slowed down the process so that it could be studied quantitatively. He first stated the law as we know it today in 1831. Graham went on to study the diffusion of substances in solution and in the process made the discovery that some apparent solutions actually are suspensions of particles too large to pass through a parchment filter. He termed these materials colloids, a term that has come to denote an important class of finely divided materials.

At the time Graham did his work the concept of molecular weight was being established, in large part through measurements of gases. Italian physicist Amadeo Avogadro had suggested in 1811 that equal volumes of different gases contain equal numbers of molecules. Thus, the relative molecular weights of two gases are equal to the ratio of weights of equal volumes of the gases. Avogadro's insight together with other studies of gas behavior provided a basis for theoretical work by Scottish physicist James Clerk Maxwell who was trying to explain the properties of gases as collections of small particles moving through largely empty space.

Perhaps the greatest success of the kinetic theory of gases, as it came to be called, was the discovery that for gases, the temperature as measured on the Kelvin (absolute) temperature scale is directly proportional to the average kinetic energy of the gas molecules, where the kinetic energy of any object is equal to one-half its mass times the square of its velocity. Thus, to have equal kinetic energies, the velocities of two different molecules would have to be in inverse proportion to the square roots of their masses. Since the rate of diffusion is determined by the average molecular velocity, Graham's law for diffusion could be understood in terms of the molecular kinetic energies being equal at the same temperature.

## Example

Let gas 1 be H2 and gas 2 be O2.

$\left\{mbox\left\{Rate H\right\}_2 over mbox\left\{Rate O\right\}_2\right\}=\left\{sqrt\left\{32\right\} over sqrt\left\{2\right\}\right\}=\left\{sqrt\left\{16\right\} over sqrt\left\{1\right\}\right\}= frac\left\{4\right\}\left\{ 1\right\}$

Therefore, hydrogen molecules effuse four times as fast as those of oxygen.

Graham's Law can also be used to find the approximate molecular weight of a gas if one gas is a known species, and if there is a specific ratio between the rates of two gases (such as in the previous example). The equation can be solved for either one of the molecular weights provided the subscripts are consistent.

$\left\{M_2\right\}=\left\{M_1 mbox\left\{Rate\right\}_1^2 over mbox\left\{Rate\right\}_2^2\right\}$

Graham's law was the basis for separating 235U from 238U found in natural uraninite (uranium ore). The United States government built a gaseous diffusion plant at the then phenomenal cost of \$100 million in Clinton, Tennessee. In this plant, uranium from uranium ore was first converted to uranium hexafluoride and then forced repeatedly to diffuse through porous barriers, each time becoming a little more enriched in the slightly lighter 235U isotope.


text:
{{ item.displayTitle }}
navigate_next
No history yet!
Progress & Statistics equalizer Progress expand_more
Student
navigate_next
Teacher
navigate_next
{{ filterOption.label }}
{{ item.displayTitle }}
{{ item.subject.displayTitle }}
arrow_forward
{{ searchError }}
search
{{ courseTrack.displayTitle }}
{{ printedBook.courseTrack.name }} {{ printedBook.name }}

# Manipulating Rational Expressions

## Manipulating Rational Expressions 1.11 - Solution

a
By substituting $x=8$ into the rational expression we can find $R(8)$.
$R(x)=\dfrac{x+7}{x-7}$
$R({\color{#0000FF}{8}})=\dfrac{{\color{#0000FF}{8}}+7}{{\color{#0000FF}{8}}-7}$
$R(8)=\dfrac{15}{1}$
$R(8)=15$
For $x=8$, the rational expression has the value $15$.
b
The rational expression is undefined when the denominator equals zero, since division by zero is not allowed. The denominator is $x-7$, so the $x$-value that makes the denominator become equal $0$ must be $7$. We can justify this algebraically by setting the denominator equal to $0$ and solve for $x$.
$x-7=0$
$x=7$
c
Multiply both the numerator and the denominator by $7$.
$R(x)=\dfrac{x+7}{x-7}$
$R(x)=\dfrac{(x+7)\cdot 7}{(x-7)\cdot 7}$
$R(x)=\dfrac{x\cdot 7+7\cdot 7}{x\cdot 7-7\cdot 7}$
$R(x)=\dfrac{7x+49}{7x-49}$


text:
# Calculating power function for ANOVA

There are several functions in R to calculate the power of a test, for example, the pwr-functions of the pwr package.

My question is how we get this function for ANOVA (pwr.anova.test)?

I know that \begin{align} 1-\beta &= P(H1|H1) \\ &= P(F>F_{1-\alpha,k-1,N-k}) \\ &= 1-P(F\le F_{1-\alpha,k-1,N-k}) \\ &= 1-P(MQE/MQR\le F_{1-\alpha,k-1,N-k}) \\ ~ \\ &= 1-P\bigg(n k \bigg(\frac{^{\sum(\bar{x}_{i.}-\bar{x}_{..})^2}/_{(k-1)}} {^{\sum\sum(x_{ij}-\bar{x}_{i.})^2}/_{k(n-1)}} - f^2\!+\!f^2\bigg) \le F_{1-\alpha,k-1,N-k}\bigg) \\ ~ \\ ~ \\ &= 1-P\bigg(nk\bigg(\frac{^{\sum (\bar{x}_{i.}-\bar{x}_{..})^2}/_{(k-1)}} {^{\sum\sum(x_{ij}-\bar{x}_{i.}^2)}/_{k(n-1)}} - \frac{^{\sum(µ_i-µ)^2}/_k}{\sigma^2}\bigg)\le F_{1-\alpha,k-1,N-k}-nkf^2\bigg) \\ ~ \\ &= ???...??? \\ &= 1-P(F_{k-1,N-k}\le F_{1-\alpha,k-1,N-k}-knf^2) \\ &= \end{align}

  p.body =  pf(qf(\alpha, k-1, (n-1)*k, low=F), k-1, (n-1)k, k*n*f^2, low=F)

With $f^2$ the effect;
$knf^2$ the non-centrality parameter; and
$\sigma^2$ the error variance within groups;

But what does the function which has a $F_{k-1,N-k}$ distribution look like? It has to be the (variance between groups/df) / (variance within groups/df)$-knf^2$, but how can I write these so that I see the distribution? In my calculation I did not see it. I have never found the exact way how to get to this formula. Maybe you can help.

• I don't understand what you are asking (I'm not proficient in English but usually I easily understand mathematical and R questions) – Stéphane Laurent Dec 18 '13 at 18:30
• Your question is still not clear to me but I'm under the impression that from one hand you are interested in the noncentral F-distribution, but you have a strange notation ($-knf^2$ sounds like "minus" $knf^2$). See also the help of the F-distribution in R by typing ?df. – Stéphane Laurent Dec 18 '13 at 20:05
• I still don't understand. I can try to explain the power calculation in details, would it answer to your question ? – Stéphane Laurent Dec 19 '13 at 10:12
• Done. Now could you precise your question ? – Stéphane Laurent Dec 19 '13 at 11:13
• First of all, thanks a lot Stéphane. Thats what i mean, ok not exaktly but near. You said that $F \sim F_{m-l,n-m}$ thats clear but if we write $F=\frac{SS_T/(I-1)}{SS_E/((n-I)}$ like in link than we will get $F=\frac{\sum(\bar{x}_{i.}-\bar{x}_{..})^2/(k-1)}{\sum\sum(x_{ij}-\bar{x}_{i.})^2/k*(n-1)}$. Now if we look at the probability $1-P(F<=F_{k-1,n-k}) = 1-P(\frac{n*\sum(\bar{x}_{i.}-\bar{x}_{..})^2/(k-1)}{\sum\sum(x_{ij}-\bar{x}_{i.})^2/k*(n-1)}<=F_{k-1,n-k})$ Am I right so far? Now we can add $f^2$ and remove $f^2$ ($f^2$ the effect) – user36382 Dec 19 '13 at 12:13

## Power of F-tests for Gaussian linear models

### General $F$-test

Any Gaussian linear model can be written $\boxed{Y=\mu+\sigma G}$ where $G$ has the standard normal distribution on $\mathbb{R}^n$ and $\mu$ is assumed to belong to a linear subspace $W$ of $\mathbb{R}^n$. Usually, the theory of Gaussian linear models treat them with the $Y=X\beta+\sigma G$ writing, corresponding to $W=\text{Im}(X)$. There are good reasons for that but the underlying geometry is clearer with the $\boxed{Y=\mu+\sigma G}$ treatment.

The so-called "ANOVA test" is a particular test of a F-test for a null hypothesis $H_0\colon\{\mu \in U\}$ where $U\subset W$ is a linear subspace. Actually the F-test exactly coincides with the likelihood-ratio test in this situation, and it is based on the Fisher statistic $$F = \frac{{\Vert P_Z Y\Vert}^2/(m-\ell)}{{\Vert P_W^\perp Y\Vert}^2/(n-m)},$$ where $Z=U^\perp \cap W$ is the orthogonal complement of $U$ in $W$, and denoting $m=\dim(W)$ and $\ell=\dim(U)$.

Obviously $\boxed{P_Z Y = P_Z \mu + \sigma P_Z G}$ and $\boxed{P_W^\perp Y = \sigma P_W^\perp G}$.

When $H_0\colon\{\mu \in U\}$ is true then $P_Z \mu = 0$ and therefore $$F = \frac{{\Vert P_Z G\Vert}^2/(m-\ell)}{{\Vert P_W^\perp G\Vert}^2/(n-m)} \sim F_{m-\ell,n-m}$$ has the Fisher $F_{m-\ell,n-m}$ distribution. Consequently, from the classical relation between the Fisher distribution and the Beta distribution, $R^2 \sim {\cal B}(m-\ell, n-m)$.

In the general situation we have to deal with $P_Z Y = P_Z \mu + \sigma P_Z G$ when $P_Z\mu \neq 0$. In this general case one has ${\Vert P_Z Y\Vert}^2 \sim \sigma^2\chi^2_{m-\ell}(\lambda)$, where $\chi^2_{m-\ell}(\lambda)$ is the noncentral $\chi^2$ distribution with $m-\ell$ degrees of freedom and noncentrality parameter $\boxed{\lambda=\frac{{\Vert P_Z \mu\Vert}^2}{\sigma^2}}$, and then $\boxed{F \sim F_{m-\ell,n-m}(\lambda)}$ noncentral Fisher distribution. To compute $P_Z\mu$, note that $P_Z = P_W - P_U$ and $P_W\mu=\mu$, hence the only thing to compute is $P_U \mu$.

### Power of the $F$-test

The power of the $F$-test depends on the significance level $\alpha$ which is chosen by the user. The critical value $c$ of the test is the value for which $\Pr_0(F>c)=1-\alpha$ where $\Pr_0$ denotes the probability under the null $H_0$. The power is then $\Pr(F>c)=1-\alpha$ where $\Pr$ denotes the probability under the unknown parameters. As we have seen, $\Pr$ only depends on $\lambda$, $n$, $m$ and $l$.

### R code

The effect size in this situation is $\sqrt{\frac{\lambda}{n}}$, and it is more usual to take the effect size rather than the non-centrality parameter $\lambda$ as an input of the power. Thus I have written the following R function which returns the power using the effect size as an argument rather than the noncentrality parameter.

# alpha : significance level eff : effect size ; n : sample size ; m :
# number of parameters of the model ; l : number of parameters of the
# submodel H0 ;
Power <- function(alpha, eff, n, m, l) {
df1 <- m - l
df2 <- n - m
c <- qf(1 - alpha, df1, df2)
lambda <- eff^2 * n
pow <- pf(c, df1, df2, ncp = lambda, lower.tail = FALSE)
return(pow)
}

Example
Power(alpha = 5/100, eff = 0.5, n = 48, m = 5, l = 4)
## [1] 0.92303

### The case of ANOVA

The pwr.anova.test() function of the pwr package calculates power of ANOVA for the balanced case only. For example, when there are $3$ groups, $4$ observations per group, the power for $\alpha=5\%$ and for an effect size of $0.5$ is

library(pwr)
pwr.anova.test(3, 4, 0.5, 5/100)
##
##      Balanced one-way analysis of variance power calculation
##
##               k = 3
##               n = 4
##               f = 0.5
##       sig.level = 0.05
##           power = 0.24088
##
## NOTE: n is number in each group

With the general notations of the $F$-test, here $U$ is a one-dimensional subspace corresponding to the assumptions that all group means are equal. The space $W$ has the same dimension as there are groups, here $3$. Thus using my function one get the power as follows:

Power(alpha = 5/100, eff = 0.5, n = 12, m = 3, l = 1)
[1] 0.24088

• I have no clue what variables $P_Z$ and $P_W$ are. Please give definitions. – matus May 29 '17 at 9:46
• @matus $P_U$ is the projector on the vector space $U$. – Stéphane Laurent May 29 '17 at 10:33


text:
# How to produce a middle C on intel 8080?

This is a example problem in my book. Assuming pin 5 of port 4 is connected to an amplifier that drives a loudspeaker, the solution is given as,

The frequency of middle C is $$f=261.63\ \text{Hz}$$ So, the time period is, $$T=\frac1{f}=3822\ \mu s$$

The program to produce a square wave with that period is,

LOOP1:    OUT 4H     ;Send bit to speaker
MVI C,86H  ;Set count to 134
LOOP2:    DCR C      ;Count down
JNZ LOOP2  ;Test count
CMA        ;Reset bit 5
NOP        ;Fine tune
NOP        ;Fine tune
JMP LOOP1  ;Go for next half cycle

The number of T states is given as, OUT(10), MVI(7), DCR(4), JNZ(10 if true, else 7), CMA(4), NOP(4), JMP(10).

With a clock frequency of 1 MHz, LOOP2(for half cycles) runs for 1912 microseconds, which is close enough. LOOP1 should run again sending the complement of what was previously in bit 5 of port 4. But I think it doesn't.

When LOOP2 ends, the accumulator has 00H left over from C register. CMA changes the accumulator to FFH. NOP and JMP don't change the accumulator. So then the LOOP1 iterates for the next half cycle, OUT sents accumulator contents to port 4, i.e, FFH whose bit 5 is 1, everytime. So there is not a square wave, it's just a high signal. Then how does it produce a middle C?

• Nobody here uses the 8080 anymore, so you might have more luck if you get your question migrated to retrocomputing – PlasmaHH Oct 22 '18 at 6:46
• The code is correct, and will produce desired result at any wires connected to 8-bit data lines of port 4. Even does not care the initial value of A. What is "With a clock frequency of 1 Hz" - do you clock 8080 with 1 Hz clock? And what problem do you have, exactly? Can you read 8080 datasheet - in particular description and operation of its commands? – Anonymous Oct 22 '18 at 8:55
• I don't understand why you think the accumulator contains 0 after the timing loop ends; C is used as the counter, not the accumulator. – Jules Oct 22 '18 at 10:03
• "With a clock frequency of 1 Hz" - that seems rather slow. Did you mean "1 MHz"? – Bob Jarvis Oct 22 '18 at 11:10
• @Ayatana, that's simply not the case. Read righto.com/2013/07/… – Russell Borogove Oct 22 '18 at 16:20

DCR C decrements the C register and sets flags; it does not affect the accumulator (aka A register). The only instruction in this sequence which affects the accumulator is the CMA. Thus on each pass through LOOP1, the accumulator will be complemented - bit 5 high on one cycle and low on the next.

Many sources including the 8085 datasheet describe the 8080/8085 ALU as operating directly on the accumulator, but this is an oversimplification. As described in this Ken Shirriff article, the ALU has two temporary registers:

The ALU uses two temporary registers that are not directly visible to the programmer. The Accumulator Temporary register (ACT) holds the accumulator value while an ALU operation is performed. This allows the accumulator to be updated with the new value without causing a race condition. The second temporary register (TMP) holds the other argument for the ALU operation. The TMP register typically holds a value from memory or another register.

...

The ACT register has several important functions. First, it holds the input to the ALU. This allows the results from the ALU to be written back to the accumulator without disturbing the input, which would cause instability. Second, the ACT can hold constant values (e.g. for incrementing or decrementing, or decimal adjustment) without affecting the accumulator. Finally, the ACT allows ALU operations that don't use the accumulator.

For the DCR instructions, the ACT holds a constant, the TMP receives the current contents of the operand register, and an ADD operation is performed; for DCR C, the accumulator remains untouched:

The control lines allow the ACT register to be loaded with a variety of constants. The 0/fe_to_act control line loads either 0 or 0xfe into the ACT; the value is selected by the sel_0_fe control line. The value 0 has a variety of uses. ORing a value with 0 allows the value to pass through the ALU unchanged. If the carry is set, ADDing to 0 performs an increment. The value 0xfe (signed -2) is used only for the DCR (decrement by 1) instruction. You might think the value 0xff (signed -1) would be more appropriate, but if the carry is set, ADDing 0xfe decrements by 1. I think the motivation is so both increments and decrements have the carry set, and thus can use the same logic to control the carry.

Since the 8085 has a 16-bit increment/decrement circuit, you might wonder why the ALU is also used for increment/decrement. The main reason is that using the ALU allows the condition flags to be set by INR and DCR. In contrast, the 16-bit increment and decrement instructions (INX and DCX) use the incrementer/decrementer, and as a consequence the flags are not updated.

There is only a single set of flags in the 8080; DCR affects the Zero, Sign, Parity, and Aux-carry flags.

• The DCR C first copies the content of C register to accumulator, decrements it and then stores the data back into C register. Because the ALU can only work on accumulator. Also, JNZ is a ALU flag which only checks the accumulator. If DCR C didn't affect the accumulator, then, JNZ LOOP2 instruction will be run forever. – Ayatana Oct 22 '18 at 4:26
• I don’t believe that’s true — I’m not an 8080 expert by any means but the sources I’ve looked at don’t indicate that the accumulator is affected by DCR (except DCR A, of course). The flags are affected, however. An internal register in the ALU is changed but written back to C, not A. – Russell Borogove Oct 22 '18 at 4:35
• There’s only one set of flags. I believe that the ALU has internal registers separate from the accumulator A. I don’t see any hint in several different online 8080 instruction references that DCR C affects the contents of the A register. – Russell Borogove Oct 22 '18 at 4:47
• This article describes the 8080/8085 ALU in detail, showing two temporaries in addition to the A register. righto.com/2013/07/… — “The ACT register has several important functions. First, it holds the input to the ALU. This allows the results from the ALU to be written back to the accumulator without disturbing the input... Second, the ACT can hold constant values (e.g. for incrementing or decrementing, or decimal adjustment) without affecting the accumulator. Finally, the ACT allows ALU operations that don't use the accumulator. – Russell Borogove Oct 22 '18 at 5:10
• @Ayatana The status flags in the CPU store the results of the last executed arithmetic instruction; they can be evalutated (but not changed) via e.g. conditional jumps. Hence, JNZ means: "jump if the last executed arithmetic instruction did not result in 0". In your case, the last arithmetic instruction then was DCR C, so the flags are set according to the result of that instruction. When testing the flags, no other register besides the status register is involved. – JimmyB Oct 22 '18 at 10:16


text:
Can entropy be reversed?

### Platonic Payments

Paying is strange. Consider the following exchange:

Me: Hello unfamiliar person. I would like to give you some fiat currency in exchange for the goods and / or services you provide.

Clerk: Splendid! Let me just whip out this large, obnoxiously bright, unwieldy machine and get the banks involved in our newfound relationship.

Me: That sounds reasonable. Surely Jamie Dimon did not make enough money last fiscal year and deserves a cut of your vanishingly low margin retail business. Please take this cold, hard, magnetized piece of plastic. The design reflects my personality and pecuniary worth.

Clerk: I am obliged to thank you for handing me this trinket. Allow me to swipe it, the same way humans have read information off of cards for decades. You will also be required to sign a piece of paper because I honestly believe you may call your bank and vehemently deny purchasing this cup of black coffee.

Me: Perfectly understandable. I love the feeling of generating potential evidence for a court case every time I want to buy something. I also demand a paper record of this transaction because I do my taxes with a quill pen and slide rule.

Clerk: Yes quite common. Well, have a wonderful day, stranger I have interacted with but not touched. This large, black, computerized point of sale system symbolizes the technology-driven separation that grows between humans even when we interact in pers..

Next Customer: Hello unfamiliar person!

Paying isn’t too hard. Swiping plastic takes seconds. It’s just too weird. Here I propose the way I would prefer to pay, optimized for low friction and high humanity.

The handshake, like currency, has been around for millennia as a symbol of trust. Unlike currency though, the handshake requires no additional hardware, central banking system, or card. It does not allow for a precise and safe transference of wealth, but it could, with a little help from our friend the bitcoin.

This is an idea I call “platonic payments”.

To accept payments you wear a watch, or ideally it is integrated in to an existing watch like the Pebble. To pay you wear a ring, which contains a short-range rewritable RFID tag storing a single bitcoin address. The payee specifies the amount with two dials on the watch, one for dollars, one for cents. Both parties then shake hands, bringing the RFID ring within reading range of the detector, which uses the information to charge the payer’s bitcoin wallet. No fees. No slow hardware exchange. No cold plastic or large, expensive POS systems blaring light in an otherwise relaxing environment. I also think service establishments should just charge 20% tip by default.

Bitcoin addresses are nearly infinite and can be created, online or off, and disposed of at will. Thus an NFC chip in a smartphone could passively rewrite the tag with a fresh address every time you pick up your phone. The merchant software, either run on the watch or connected to a smartphone, would request the appropriate amount from the user’s bitcoin wallet with the public key. This is not built in to the bitcoin protocol but could be managed by a service like Coinbase, which could then verify the account is valid and securely transfer the private key.

This does face the problem of a change by both parties. However, if it started being built in to smartwatches and all users had to do was buy a cheap, stylish ring that barrier may lower. A payment method that didn’t force me to take anything out of my pockets or even carry a wallet, while increasing the humanity of a transaction sounds like a dream come true. I would even get my tag implanted so I wouldn’t have to wear the ring.

The other problem is the system still involves trust. Someone could skim your ring, grab the address, and post a request if they got close enough. Since each transaction involves a new address the hacker could only make one request, but it could be big. This could additionally be mitigated by only allowing transactions of a certain size or only keeping a small amount of money in this wallet, making skimming uneconomical.

Alternatively, Coinbase could ask the user to verify the transactions they made after the fact, but this would allow the payer to deny legitimate transactions. And that, is something I would love to test. If you knew you would get away with it, would you rob someone after shaking their hand?

### High Frequency Dating

The other day I realized there was something missing in my life, so I set out to find a solution. Online dating is in vogue, which makes sense. The internet already has no small part in satisfying most of my other needs. I was pleased to learn that the latest popular dating app, Tinder, now has an Android client. Besides forcing me to reactivate my Facebook account it seems simple enough. Unfortunately, I quickly realized that this was going to turn in to a massive time sink. Perhaps, I thought, I could optimize it?

I did some simple man in the middle packet sniffing to reverse engineer the Tinder API. It’s pretty simple. Send your location, grab a handful of images and user ids, and tell the server which ones you liked. I wrote a minimal python client in Ubuntu and began designing an algorithm to speed up the process a bit. The algorithm first segments the main image by finding all of the faces via OpenCV. If none are found the candidate is discarded. If multiple faces are found the end score will be the average of all of them. This seems to work since people tend to associate with those of similar levels of attractiveness. Facial attractiveness is surprisingly uncomplicated to quantify. Essentially, evolution has us seeking partners that are as “normal” as possible. Anything that is unusually big or small, any ratio that differs from $\phi$, or about 1.618, hurts the score. After the face(s) are identified in the image, a mask of 25 anthropometric proportion indices is overlaid and mean compliance is measured. This is also done with a custom OpenCV routine.

The client also has messaging capabilities. After a match is identified the algorithm sends a simple message “Can I have a dance?” inspired by Mos Def’s success with Ms. Fat Booty. If no response is received the candidate is discarded. If any response is received, it is ignored and a follow up message is sent ”Haha okay then how about we go to a fancy seafood restaurant?”, inspired by the classic meat-for-sex exchange that is common in the animal kingdom as well as among humans. The client uses NLTK to judge an affirmative or negative response. From here an Odesk virtual assistant coordinates dates. This also handles rescheduling but conflicts are not an issue as you will soon see.

Come date night a Double Robot loaded with over 10 hours of pre-recorded content of me rolls up to a restaurant automatically chosen from Yelp based on reviews, distance, cost, and whether or not another double of me has a date there at the time (awkward). Reservations are made via OpenTable’s API. Everything from witty, non-offensive stories to mildly embarrassing personal traits to compliments are recorded. According to the logs candidates are often taken aback at a robot showing up, but a sincere recording complimenting their shoes immediately puts them at ease. Mostly, though, it asks questions and listens. The algorithm aims for a 4:1 ratio of listening to presenting. Based on tone of voice computed by DSP, the system knows which topics to go deeper on and which to avoid, organized in a tree structure in memory. If things are going poorly the emergency “tell me about your cat” routine is run and the microphone is muted to prevent the Speech to Text processor from running useless cycles.

The check is paid via E La Carte and a car is called with Uber’s API. If the algorithm has not been meeting its heuristics the candidate is driven home and the robot self-destructs after uploading its data to the cloud so future iterations can learn from its mistakes. If it has been going well an AirBnB room is insta-booked and the Uber drives there. Once in the room a music playlist is algorithmically generated with Spotify and the candidate’s musical taste gleaned from their Facebook likes. At this moment an Instacart driver should be arriving with a \$10 bottle of wine and fresh strawberries and an Exec delivers a NeuroSky Mindwave 3 and a Vibease Smart Vibrator.

Both devices connect to the Double’s iPad via Bluetooth wirelessly and to the female directly. The female’s brainwaves are fed in to a Learning Vector Quantization Artificial Neural Network (FABIO). At first FABIO adjusts the parameters of the Vibease mostly at random, but partially based on previous experience. Based on feedback generated by the headset the system learns and adaptively adjusts the output parameters in order to maximize EEG amplitude. Unfortunately, the complex mathematical operations required by FABIO typically exhaust the Double’s battery in around 01:57-02:03 minutes, depending on the female. At this point the Double gruffly requests the female retrieve his charger. The robot records the candidate’s experience with a Go Pro 3 and securely uploads the video to a private Amazon S3 bucket.

At 09:07 in the morning an Uber is automatically called for the female and 3 days later she will receive a heartfelt e-card / receipt. The algorithm will also wish her happy birthday on Facebook and like the top 20% of her Instagram photos as they are posted and start getting a lot of other likes. This continues until her Facebook relationship status switches away from single.

Ahhh modern romance. Turing would be proud. Unfortunately I haven’t found the time to watch any of the videos since I’m too busy optimizing the algorithm.


text:
Memoization Decorator

Recently I had the opportunity to give a short 10 min presentation on Memoization Decorator at our local UtahPython Users Group meeting.

Memoization:

• Everytime a function is called, save the results in a cache (map).
• Next time the function is called with the exact same args, return the value from the cache instead of running the function.

The code for memoization decorator for python is here: http://wiki.python.org/moin/PythonDecoratorLibrary#Memoize

Example:

The typical recursive implementation of fibonacci calculation is pretty inefficient O(2^n).

```def fibonacci(num):
print 'fibonacci(%d)'%num
if num in (0,1):
return num
return fibonacci(num-1) + fibonacci(num-2)>>> math_funcs.fibonacci(4)   # 9 function calls
fibonacci(4)
fibonacci(3)
fibonacci(2)
fibonacci(1)
fibonacci(0)
fibonacci(1)
fibonacci(2)
fibonacci(1)
fibonacci(0)
3```

But the memoized version makes it ridiculously efficient O(n) with very little effort.

```import memoized
@memoized
def fibonacci(num):
print 'fibonacci(%d)'%num
if num in (0,1):
return num
return fibonacci(num-1) + fibonacci(num-2)

>>> math_funcs.mfibonacci(4)  # 5 function calls
fibonacci(4)
fibonacci(3)
fibonacci(2)
fibonacci(1)
fibonacci(0)
3```

We just converted an algorithm from Exponential Complexity to Linear Complexity by simply adding the memoization decorator.

Slides:

Presentation:

I generated the slides using LaTeX Beamer. But instead of writing raw LaTeX code I used reStructured Text (rst) and used rst2beamer script to generate the .tex file.

Source:

The rst file and tex files are available in Github.

https://github.com/amjith/User-Group-Presentations/tree/master/memoization_de...

Posted

Productive Meter

A few weeks ago I decided that I should suck it up and start learning how to develop for the web. After asking around, my faithful community brethren, I decided to learn Django from its docs

::Django documentation is awesome::

Around this time I came across this post about Waking up at 5am to code. I tried it a few times and it worked wonders. I've been working on a small project that can keep track of my productivity on the computer. The concept is really simple, just log the window that is on top and find a way to display that data in a meaningful way.

Today's 5am session got me to a milestone on my project. I am finally able to visaulize the time I spend using a decent looking graph. Which is a huge milestone for someone who learned how to display html tables 3 weeks ago.

Tools:

A huge thanks to my irc friends and random geeks who wrote awesome blog posts and SO answers on every problem I encountered.

I will be open-sourcing the app pretty soon. Stay tuned.

Posted

Too Many Classes Too Little Time

I'm taking a couple of the free online classes offered by Standford. One on Artifical Intelligence and one on Machine Learning

I haven't had so much fun since kindergarten. Actually that's not fair, I didn't enjoy kindergarten this much. I'm listening to the classes during my lunch, after work, during weekends. I'm working on my assignment with so much enthusiasm, I dread the day when this class ends.

Stanford just announced a slew of new online classes offered starting in Jan 2012. I was way too excited when I first read the description on them. Now I'm a little sad, becasue I want to take 8 out of the 11 courses that are being offered and I don't have enough time. :(

Woe is me.

ps: If you are not taking any of these classes you are missing out big time. Please do yourself a favor and sign up.

Posted

Picking 'k' items from a list of 'n' - Recursion

Let me preface this post by saying I suck at recursion. But it never stopped me from trying to master it. Here is my latest (successful) attempt at an algorithm that required recursion.

Background:

You can safely skip this section if you're not interested in the back story behind why I decided to code this up.

I was listening to KhanAcademy videos on probability. I was particularly intrigued by the combinatorics video. The formula to calculate the number of combinations of nCr was simple, but I wanted to print all the possible combinations of nCr.

Problem Statement:

Given 'ABCD' what are the possible outcomes if you pick 3 letters from it to form a combination without repetition (i.e. 'ABC' is the same as 'BAC').

At first I tried to solve this using an iterative method and gave up pretty quickly. It was clearly designed to be a recursive problem. After 4 hours of breaking my head I finally got a working algorithm using recursion. I was pretty adamant about not looking it up online but I seeked some help from IRC (Thanks jtolds).

Code:

```def combo(w, l):
lst = []
if l < 1:
return lst
for i in range(len(w)):
if l == 1:
lst.append(w[i])
for c in combo(w[i+1:], l-1):
lst.append(w[i] + c)
return lst```

Output:

```>>> combinations.combo('abcde',3)
['abc', 'abd', 'abe', 'acd', 'ace', 'ade', 'bcd', 'bce', 'bde', 'cde']```

Thoughts:

• It helps to think about recursion with the assumption that an answer for step n-1 already exists.
• If you are getting partial answers check the condition surrounding the return statement.
• Recursion is still not clear (or easy).

I have confirmed that this works for bigger data sets and am quite happy with this small victory.

Posted

Python Profiling

I did a presentation at our local Python User Group meeting tonight. It was well received, but shorter than I had expected. I should've added a lot more code examples.

We talked about usage of cProfile, pstats, runsnakerun and timeit.

Here are the slides from the presentations:

The slides were done using latex-beamer, but I wrote the slides in reStructuredText and used rst2beamer to create the tex file which was then converted to pdf using pdflatex.

The source code for the slides are available on github.

//   Posted

Programming - A Gateway Drug to Math

I decided to try my hand at the Stanford's AI Class. The pre-requisites mentioned Probability and Linear Algebra. So I started watching Probability videos on KhanAcademy

Sal Khan was teaching how to find the probability of 2 heads when you toss a coin 5 times.

A classic nCk problem:

$\small _nC_k = \frac{n!}{k!(n-k)!}$

The probability of getting 2 heads while tossing a coin 5 times is:

$P(2) = \frac{{_5C_2}}{2^5}$
But I wanted to find out the probability of getting at least 2 heads when I toss 5 coins.
Its really simple. All I had to do is P(2) + P(3) + P(4) + P(5).
But then computing$_nC_k$by hand (or a calculator) was painfully slow, let alone do it 4 times.
So I wrote two little functions in Python that will calculate factorial (yes I reinvented the wheel) and$_nC_k$
Nothing teaches you math faster than trying to write a program to do the math for you.
Writing a program is the same as teaching the computer how to do a certain task. The only way you can teach someone to do a task is to become a master at doing that task yourself.

Bonus: It also teaches you corner cases like 0! = 1 and $\small _5C_5 = 1$ that you wouldn't think of otherwise.
Tags
Posted

When was the last time I vented about C++? The answer for that is always:

"TOO LONG AGO".

The initial friction to setup a substantial project using C++ is unfucking bearable.

When we started code revamp at work recently, I decided to be a good citizen and decided to incorporate cpptest, a unit testing framework in our project.

It made me realize how unreasonably complicated Makefiles can be. After 3 hours of peeling away at the complexity I managed to add cpptest to the build dependency of the project.

Now time to write a few tests and check it out. I'm thinking "We are almost there".

FALSE!

Compilation gives me a gazillion error messages that make absolutely no sense. After about 30mins of StackOverflowing and Googling, I find out that its not enough to include string.h and map.h in my  header files, but I also need to namespace it. Of course there is no indication (not even a hint) of that in the error messages. So I add 'using namespace std' and get past it.

Awesome my first test is compiling successfully. Time to run this baby and declare victory.

Close! But no cigar.

The executable was unable to load the CppTest library during runtime. Argh!

I set my LD_LIBRARY_PATH env variable and now it's running. But I can't ask everyone in my team to do that, so I have to figure out how to statically link that library.

It's already 6pm and I'm hungry. That'll have to wait for another day.

TL;DR - C++ and Makefile can burn in a fire of thousand suns.
Posted

Rapid Prototyping in Python

I was recently assigned to a new project at work. Like any good software engineer I started writing the pseudocode for the modules. We use C++ at work to write our programs.

I quickly realized it's not easy to translate programming ideas to English statements without a syntactic structure. When I was whining about it to Vijay, he told me to try prototyping it in Python instead of writing pseudocode. Intrigued by this, I decided to write a prototype in Python to test how various modules will come together.

Surprisingly it took me a mere 2 hours to code up the prototype. I can't emphasize enough, how effortless it was in Python.

What makes Python an ideal choice for prototyping:

Dynamically typed language:

Python doesn't require you to declare the datatype of a variable. This lets you write a function that is generic enough to handle any kind of data. For eg:

```def max_val(a,b):
return a if a >b else b```

This function can take integers, floats, strings, a combination of any of those, or lists, dictionaries, tuples, whatever.

A list in Python need not be homogenous. This is a perfectly good list:

`[1, 'abc', [1,2,3]]`

This lets you pack data in unique ways on the fly which can later be translated to a class or a struct in a statically typed language like C++.

```class newDataType
{
int i;
String str;
Vector vInts;
};```

Rich Set to Data-Structures:

Built-in support for lists, dictionaries, sets, etc reduces the time involved in hunting for a library that provides you those basic data-structures.

Expressive and Succinct:

The algorithms that operate on the data-structures are intuitive and simple to use. The final code is more readable than a pseudocode.

For example: Lets check if a list has an element

```>>> lst = [1,2,3]    # Create a list
>>> res = 2 in lst   # Check if 2 is in 'lst'
True```

If we have to do it in C++.

```list lst;
lst.push_back(3);
lst.push_back(1);
lst.push_back(7);
list::iterator result = find(lst.begin(), lst.end(), 7);
bool res = (result != lst.end())```

Python Interpreter and Help System:

This is a huge plus. The presence of interpreter not only aids you in testing snippets of code, but it acts as an help system. Lets say we want to look up the functions that operate on a List.

```>>> dir([])
'__delslice__', '__doc__', '__eq__', '__format__', '__ge__',
'__getattribute__', '__getitem__', '__getslice__', '__gt__', '__hash__',
'__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__',
'__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',
'__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__',
'__setslice__', '__sizeof__', '__str__', '__subclasshook__', 'append',
'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']

>>> help([].sort)
Help on built-in function sort:

sort(...)
L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1```

• The type definition of the datastructures emerge as we code.
• The edge cases start to emerge when you prototype.
• A set of required supporting routines.
• A better estimation of the time required to complete a task.
Posted

New Laptop

I finally ordered a new Macbook air for myself. One of my friends remarked at the fact that this is the first brand new laptop that I've ordered for myself. Since I'm a bit of a Linux fanatic, I tend to restore old computers and install a linux distro and make them useable. So I always get old laptops for cheap for myself. But this time I decided it's time to checkout Mac OS X. So I'll be replacing my Netboook (yep!) with the Macbook air. Anyone need a Lenovo S10 netbook :). I will even do a clean-install of Ubuntu or your choice of Linux distro.

This new Macbook air will be my primary development machine. Let's hope it can take the abuse.

Posted

Falsetto dude and the Fat man

A typical conversation between my wife and I:

Playing Ne Me Quitte Pas by Nina Simone

Yoshi : Ow! What is that abomination?
Amjith: It's a french song sung by the great Nina Simone.
Yoshi : It's a woman? Sounded like a dude singing in falsetto.
Yoshi : I'm leaving the room if you don't change the song.
Amjith: FINE. You play something then.

Yoshi puts on Ave Maria by Pavarotti.

I wait for 2 mins.

Amjith: Hey! Your fat man seems to be yelling at Maria.

Yosh leaves the room and I sleep on the couch.

The End
Posted


text:
# How do you find the derivate for y = pisinx - 4cosx?

$y ' = \pi \cos \left(x\right) - 4 \left(- \sin \left(x\right)\right) = \pi \cos \left(x\right) + 4 \sin \left(x\right)$


text:
# Quotient Spaces and Homeomorphisms

1. Feb 27, 2013

### snesnerd

If I have the unit sphere and I mod out its equator, I get two spheres touching at one point. I have been thinking what the bijection between these could be but can not come up with one.

2. Feb 27, 2013

### WWGD

I assume you mean S2?

Then use the standard embedding as:

{(x,y,z): x2+y2+z2=1}

Send (x,y,z) to (x,y,0) to get an injection into the x-y axis. Do this for both the upper-
and lower hemisphere, and for the equator . Notice that the set {(x,y,0)}
in S2 will be fixed points.


text:
Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Cmd.GlobalKeymap

Description

The default keyboard layout.

I group cmds by their function. Overlapping keys will be detected and show up in the log as a warning on startup.

Some global cmds also have a command-key version, so you can invoke them even when kbd entry is on.

Track-specific cmds are bound in Track.

Global generic cmds:

1. State level operations, like load, save, undo. Set timestep mode, set edit mode. Play, stop. Move the selection.
2. Modify text independent attributes, like start position and duration. This includes copy and paste, remove, modify duration, nudge, ...

Track-specific cmds are looked up in Cmd.Track.

1. Track specific event operations, possibly affecting all events in the selection: transposition, etc. These are active regardless of EditMode, and are found in Cmd.*TrackKeymap.
2. Track specific event editing, which modifies a single event. E.g., input notes and note text, pitches in a certain scale, control values, etc. This is enabled by edit mode, and will shadow printable keys, depending on the track type and edit mode. Found in Cmd.*Track.
3. Kbd entry, if on, will hijack the letter keys and turn them into NoteOns.

Then there's midi recording: (TODO which is theoretical since it's not implemented)

In record mode, the block is played while recording midi msgs and their timestamps, which are later passed to the integrator to convert into events.

Synopsis

# Documentation

Cmds that don't use IO. Exported from the module for the responder.

Cmds that use IO. This should be a limited to the small set of cmds that need it.

This is not useful for execution since the cmds themselves have been stripped of their code, but it's still useful to find keymap collisions and print a global keymap. They're stripped to make them all the same type, so they can all go into the same CmdMap, so collision detection and documentation doesn't have to care about pure_cmds vs io_cmds.


text:
# Pricing digital options in discrete time

I am stuck in this exercise from my textbook:

Consider a one-period market model with $N+1$ assets: a bond, a stock and $N-1$ call options. The prices of the bond are $B_0=1$ and $B_1 = 1+r$, where $r$ is a constant. The prices of the stock are given by a constant $S_0$ and a random variable $S_1$ taking values in $\{0, 1, \ldots, N-1, N \}$ for a given integer $N \geq 4$. Finally, let the time-0 price of the call option with strike $K \in \{ 1, \ldots, N-1 \}$ be denoted by $C(K)$. Now we introduce a contingent claim with time-1 payout $\xi_1 = g(S_1)$, where $g$ is the function $$g(M) = \mathbf{1}_{ \{M = K_0 \} }, \quad 0 \leq K_0 \leq N.$$ Assuming that the market has no arbitrage, we want to find the time-0 price $\xi_0$ in the following cases: $$2 \leq K_0 \leq N-2 \, ; \quad K_0 = N-1 \, ; \quad K_0 = 0 .$$

Let $Y$ be the state price density of the market such that $Y_0 =1$. We know that $$\mathbb{E} [ YS_1 ] = S_0, \quad \mathbb{E} [ Y ( S_1 - K)^{+} ] = C(K), \text{ for } K \in \{1, \ldots, N-1 \}.$$

But how can we compute $$\xi_0 = \mathbb{E}[ Y \mathbf{1}_{ \{ S_1 = K_0 \} }] \quad ?$$

The claim payoff you describe, $g(M)$, looks to me like a tight butterfly spread that pays off only in one state of the world. Can't you just replicate that by short two calls with strike $K_0$ and long two calls, with strikes one either side at $K_0\pm 1$? Then the price of your option would be $C(K_0+1)+C(K_0-1)-2\cdot C(K_0)$.