text:
Diagram of a social network of 7-8 year old children, mapped by asking each child to indicate two others they would like to sit next to in class. The majority of children have fewer connections than the average of those they are connected to.

The friendship paradox is the phenomenon first observed by the sociologist Scott L. Feld in 1991 that most people have fewer friends than their friends have, on average.[1] It can be explained as a form of sampling bias in which people with more friends are more likely to be in one's own friend group. In other words, one is less likely to be friends with someone who has very few friends. In contradiction to this, most people believe that they have more friends than their friends have.[2][3][4][5]

The same observation can be applied more generally to social networks defined by other relations than friendship: for instance, most people's sexual partners have had (on the average) a greater number of sexual partners than they have.[6][7]

The friendship paradox is an example of how network structure can significantly distort an individual's local observations.[8][9]

## Mathematical explanation

In spite of its apparently paradoxical nature, the phenomenon is real, and can be explained as a consequence of the general mathematical properties of social networks. The mathematics behind this are directly related to the arithmetic-geometric mean inequality and the Cauchy–Schwarz inequality.[10]

Formally, Feld assumes that a social network is represented by an undirected graph G = (V, E), where the set V of vertices corresponds to the people in the social network, and the set E of edges corresponds to the friendship relation between pairs of people. That is, he assumes that friendship is a symmetric relation: if x is a friend of y, then y is a friend of x. The friendship between x and y is therefore modeled by the edge {x, y}, and the number of friends an individual has corresponds to a vertex's degree. The average number of friends of a person in the social network is therefore given by the average of the degrees of the vertices in the graph. That is, if vertex v has d(v) edges touching it (representing a person who has d(v) friends), then the average number μ of friends of a random person in the graph is

${\displaystyle \mu ={\frac {\sum _{v\in V}d(v)}{|V|}}={\frac {2|E|}{|V|}}.}$

The average number of friends that a typical friend has can be modeled by choosing a random person (who has at least one friend), and then calculating how many friends their friends have on average. This amounts to choosing, uniformly at random, an edge of the graph (representing a pair of friends) and an endpoint of that edge (one of the friends), and again calculating the degree of the selected endpoint. The probability of a certain vertex ${\displaystyle v}$ to be chosen is

${\displaystyle {\frac {d(v)}{|E|}}{\frac {1}{2}}.}$

The first factor corresponds to how likely it is that the chosen edge contains the vertex, which increases when the vertex has more friends. The halving factor simply comes from the fact that each edge has two vertices. So the expected value of the number of friends of a (randomly chosen) friend is

${\displaystyle \sum _{v}\left({\frac {d(v)}{|E|}}{\frac {1}{2}}\right)d(v)={\frac {\sum _{v}d(v)^{2}}{2|E|}}.}$

We know from the definition of variance that

${\displaystyle {\frac {\sum _{v}d(v)^{2}}{|V|}}=\mu ^{2}+\sigma ^{2},}$

where ${\displaystyle \sigma ^{2}}$ is the variance of the degrees in the graph. This allows us to compute the desired expected value as

${\displaystyle {\frac {\sum _{v}d(v)^{2}}{2|E|}}={\frac {|V|}{2|E|}}(\mu ^{2}+\sigma ^{2})={\frac {\mu ^{2}+\sigma ^{2}}{\mu }}=\mu +{\frac {\sigma ^{2}}{\mu }}.}$

For a graph that has vertices of varying degrees (as is typical for social networks), ${\displaystyle {\sigma }^{2}}$ is strictly positive, which implies that the average degree of a friend is strictly greater than the average degree of a random node.

Another way of understanding how the first term came is as follows. For each friendship (u, v), a node u mentions that v is a friend and v has d(v) friends. There are d(v) such friends who mention this. Hence the square of d(v) term. We add this for all such friendships in the network from both the u's and v's perspective, which gives the numerator. The denominator is the number of total such friendships, which is twice the total edges in the network (one from the u's perspective and the other from the v's).

After this analysis, Feld goes on to make some more qualitative assumptions about the statistical correlation between the number of friends that two friends have, based on theories of social networks such as assortative mixing, and he analyzes what these assumptions imply about the number of people whose friends have more friends than they do. Based on this analysis, he concludes that in real social networks, most people are likely to have fewer friends than the average of their friends' numbers of friends. However, this conclusion is not a mathematical certainty; there exist undirected graphs (such as the graph formed by removing a single edge from a large complete graph) that are unlikely to arise as social networks but in which most vertices have higher degree than the average of their neighbors' degrees.

The Friendship Paradox may be restated in graph theory terms as “the average degree of a randomly selected node in a network is less than the average degree of neighbors of a randomly selected node”, but this leaves unspecified the exact mechanism of averaging (i.e., macro vs micro averaging). Let ${\displaystyle G=(V,E)}$ be an undirected graph with ${\displaystyle |V|=N}$ and ${\displaystyle |E|=M}$, having no isolated nodes. Let the set of neighbors of node ${\displaystyle u}$ be denoted ${\displaystyle \operatorname {nbr} (u)}$. The average degree is then ${\displaystyle \mu ={\frac {1}{N}}\sum _{u\in V}|\operatorname {nbr} (u)|={\frac {2M}{N}}\geq 1}$. Let the number of "friends of friends" of node ${\displaystyle u}$ be denoted ${\displaystyle \operatorname {FF} (u)=\sum _{v\in \operatorname {nbr} (u)}|\operatorname {nbr} (v)|}$. Note that this can count 2-hop neighbors multiple times, but so does Feld's analysis. We have ${\displaystyle \operatorname {FF} (u)\geq |\operatorname {nbr} (u)|\geq 1}$. Feld considered the following "micro average" quantity.

${\displaystyle {\text{MicroAvg}}={\frac {\sum _{u\in V}\operatorname {FF} (u)}{\sum _{u\in V}|\operatorname {nbr} (u)|}}}$

However, there is also the (equally legit) "macro average" quantity, given by

${\displaystyle {\text{MacroAvg}}={\frac {1}{N}}\sum _{u\in V}{\frac {\operatorname {FF} (u)}{|\operatorname {nbr} (u)|}}}$

The computation of MacroAvg can be expressed as the following pseudocode.

Algorithm MacroAvg

1. for each node ${\displaystyle u\in V}$
1. initialize ${\displaystyle Q(u)\leftarrow 0}$
2. for each edge ${\displaystyle \{u,v\}\in E}$
1. ${\displaystyle Q(u)\leftarrow Q(u)+{\frac {|\operatorname {nbr} (v)|}{|\operatorname {nbr} (u)|}}}$
2. ${\displaystyle Q(v)\leftarrow Q(v)+{\frac {|\operatorname {nbr} (u)|}{|\operatorname {nbr} (v)|}}}$
3. return ${\displaystyle {\frac {1}{N}}\sum _{u\in V}Q(u)}$
• "←" denotes assignment. For instance, "largestitem" means that the value of largest changes to the value of item.
• "return" terminates the algorithm and outputs the following value.

Each edge ${\displaystyle \{u,v\}}$ contributes to MacroAvg the quantity ${\displaystyle {\frac {|\operatorname {nbr} (v)|}{|\operatorname {nbr} (u)|}}+{\frac {|\operatorname {nbr} (u)|}{|\operatorname {nbr} (v)|}}\geq 2}$, because ${\displaystyle \min _{a,b>0}{\frac {a}{b}}+{\frac {b}{a}}=2}$. We thus get

${\displaystyle {\text{MacroAvg}}={\frac {1}{N}}\sum _{u\in V}Q(u)\geq {\frac {1}{N}}\cdot M\cdot 2={\frac {2M}{N}}=\mu }$.

Thus, we have both ${\displaystyle {\text{MicroAvg}}\geq \mu }$ and ${\displaystyle {\text{MacroAvg}}\geq \mu }$, but no inequality holds between them.[11]

## Applications

The analysis of the friendship paradox implies that the friends of randomly selected individuals are likely to have higher than average centrality. This observation has been used as a way to forecast and slow the course of epidemics, by using this random selection process to choose individuals to immunize or monitor for infection while avoiding the need for a complex computation of the centrality of all nodes in the network.[12][13][14] In a similar manner, in polling and election forecasting, friendship paradox has been exploited in order to reach and query well-connected individuals who may have knowledge about how a lot of the others are going to vote.[15]

A study in 2010 by Christakis and Fowler showed that flu outbreaks can be detected almost two weeks before traditional surveillance measures would do so by using the friendship paradox in monitoring the infection in a social network.[16] They found that using the friendship paradox to analyze the health of central friends is "an ideal way to predict outbreaks, but detailed information doesn't exist for most groups, and to produce it would be time-consuming and costly."[17]

Friendship paradox based sampling (i.e., sampling random friends) has been theoretically and empirically shown to outperform classical uniform sampling for the purpose of estimating the power-law degree distributions of scale-free networks.[18][19] This is because sampling the network uniformly will not collect enough samples from the characteristic heavy tail part of the power-law degree distribution to properly estimate it. However, sampling random friends incorporates more nodes from the tail of the degree distribution (i.e., more high degree nodes) into the sample. Hence, friendship paradox based sampling captures the characteristic heavy tail of a power-law degree distribution more accurately and reduces the bias and variance of the estimation.[19]

The "generalized friendship paradox" states that the friendship paradox applies to other characteristics as well. For example, one's co-authors are on average likely to be more prominent, with more publications, more citations and more collaborators,[20][21][22] or one's followers on Twitter have more followers.[23] The same effect has also been demonstrated for Subjective Well-Being by Bollen et al (2017),[24] who used a large-scale Twitter network and longitudinal data on subjective well-being for each individual in the network to demonstrate that both a Friendship and a "happiness" paradox can occur in online social networks.

## References

1. ^ Feld, Scott L. (1991), "Why your friends have more friends than you do", American Journal of Sociology, 96 (6): 1464–1477, doi:10.1086/229693, JSTOR 2781907, S2CID 56043992.
2. ^ Zuckerman, Ezra W.; Jost, John T. (2001), "What makes you think you're so popular? Self evaluation maintenance and the subjective side of the "friendship paradox"" (PDF), Social Psychology Quarterly, 64 (3): 207–223, doi:10.2307/3090112, JSTOR 3090112.
3. ^ McRaney, David (2012), You are Not So Smart, Oneworld Publications, p. 160, ISBN 978-1-78074-104-8
4. ^ Felmlee, Diane; Faris, Robert (2013), "Interaction in social networks", in DeLamater, John; Ward, Amanda (eds.), Handbook of Social Psychology (2nd ed.), Springer, pp. 439–464, ISBN 978-9400767720. See in particular "Friendship ties", p. 452.
5. ^ Lau, J. Y. F. (2011), An Introduction to Critical Thinking and Creativity: Think More, Think Better, John Wiley & Sons, p. 191, ISBN 978-1-118-03343-2
6. ^
7. ^
8. ^ Lerman, Kristina; Yan, Xiaoran; Wu, Xin-Zeng (2016-02-17). "The "Majority Illusion" in Social Networks". PLOS ONE. 11 (2): e0147617. arXiv:1506.03022. Bibcode:2016PLoSO..1147617L. doi:10.1371/journal.pone.0147617. ISSN 1932-6203. PMC 4757419. PMID 26886112.
9. ^ Alipourfard, Nazanin; Nettasinghe, Buddhika; Abeliuk, Andrés; Krishnamurthy, Vikram; Lerman, Kristina (2020-02-05). "Friendship paradox biases perceptions in directed networks". Nature Communications. 11 (1). doi:10.1038/s41467-020-14394-x. ISSN 2041-1723.
10. ^ Ben Sliman, Malek; Kohli, Rajeev (2019), "The extended directed friendship paradox", SSRN, doi:10.2139/ssrn.3395317, S2CID 219376223
11. ^ Gupta, Yash; Chakrabarti, Soumen (2021), Friends of friends (PDF)
12. ^ Cohen, Reuven; Havlin, Shlomo; ben-Avraham, Daniel (2003), "Efficient immunization strategies for computer networks and populations", Phys. Rev. Lett., 91 (24), 247901, arXiv:cond-mat/0207387, Bibcode:2003PhRvL..91x7901C, doi:10.1103/PhysRevLett.91.247901, PMID 14683159, S2CID 919625.
13. ^ Christakis, N. A.; Fowler, J. H. (2010), "Social network sensors for early detection of contagious outbreaks", PLOS ONE, 5 (9), e12948, arXiv:1004.4792, Bibcode:2010PLoSO...512948C, doi:10.1371/journal.pone.0012948, PMC 2939797, PMID 20856792.
14. ^ Wilson, Mark (November 2010), "Using the friendship paradox to sample a social network", Physics Today, 63 (11): 15–16, Bibcode:2010PhT....63k..15W, doi:10.1063/1.3518199.
15. ^ Nettasinghe, Buddhika; Krishnamurthy, Vikram (2019). ""What Do Your Friends Think?": Efficient Polling Methods for Networks Using Friendship Paradox". IEEE Transactions on Knowledge and Data Engineering: 1–1. doi:10.1109/tkde.2019.2940914. ISSN 1041-4347.
16. ^ Christakis, Nicholas A.; Fowler, James H. (September 15, 2010). "Social Network Sensors for Early Detection of Contagious Outbreaks". PLOS ONE. 5 (9): e12948. arXiv:1004.4792. Bibcode:2010PLoSO...512948C. doi:10.1371/journal.pone.0012948. PMC 2939797. PMID 20856792.
17. ^ Schnirring, Lisa (Sep 16, 2010). "Study: Friend 'sentinels' provide early flu warning". CIDRAP News.
18. ^ Eom, Young-Ho; Jo, Hang-Hyun (2015-05-11). "Tail-scope: Using friends to estimate heavy tails of degree distributions in large-scale complex networks". Scientific Reports. 5 (1). doi:10.1038/srep09752. ISSN 2045-2322.
19. ^ a b Nettasinghe, Buddhika; Krishnamurthy, Vikram (2021-05-19). "Maximum Likelihood Estimation of Power-law Degree Distributions via Friendship Paradox-based Sampling". ACM Transactions on Knowledge Discovery from Data. 15 (6): 1–28. doi:10.1145/3451166. ISSN 1556-4681.
20. ^ Eom, Young-Ho; Jo, Hang-Hyun (2014), "Generalized friendship paradox in complex networks: The case of scientific collaboration", Scientific Reports, 4, 4603, arXiv:1401.1458, Bibcode:2014NatSR...4E4603E, doi:10.1038/srep04603, PMC 3980335, PMID 24714092
21. ^ Grund, Thomas U. (2014), "Why Your Friends Are More Important And Special Than You Think" (PDF), Sociological Science, 1: 128–140, doi:10.15195/v1.a10
22. ^ Dickerson, Kelly (16 January 2014). "Why Your Friends Are Probably More Popular, Richer, and Happier Than You". Slate Magazine. The Slate Group. Retrieved 17 January 2014.
23. ^ Hodas, Nathan; Kooti, Farshad; Lerman, Kristina (May 2013). "Friendship Paradox Redux: Your Friends are More Interesting than You". arXiv:1304.3480 [cs.SI].
24. ^ Bollen, Johan; Goncalves, Bruno; Van de Leemput, Ingrid; Guanchen, Ruan (2017), "The happiness paradox: your friends are happier than you", EPJ Data Science, 6, arXiv:1602.02665, doi:10.1140/epjds/s13688-017-0100-1, S2CID 2044182


text:
# yield stress vs critical load stress

In Euler's bending theory, it's stated that the critical stress of a beam is always larger than the yield stress of the beam. I don't really undertstand the difference between them. Critical stress is defined as the stress that the maximum stress applied before the beam starts to buckle.

Does the yield stress here mean the stress which the beam start to deform plastically? Why shouldn't the yield stress be smaller than the critical stress?

When the object is subjected to stress, the beam will deform plastically before it starts to bend and break. So I think that yield stress is smaller than the critical stress.

I was going to put this as a comment but it felt like more of an answer.

Buckling is a fairly unique failure mode. When buckling, the compression force doesn't have to be as high as the yield strength. If a beam is slender enough, the compressive force can cause substantial bending in the beam.

This bending goes beyond the elastic range and causes the beam to fail, even though the applied force usually wouldn't make it fail according to direct equations.

The biggest reason that critical stress is lower than yield stress is that it is an assumption for Euler buckling. The equation might not work in the plastic range.

• do you mean The equation might not work outside the plastic range ?. – kelvinmacks Nov 29 '16 at 12:03
• under what circumstances critical stress is lower than yield stress? can you provide example and explain ? – kelvinmacks Nov 29 '16 at 12:07
• No, I mean the equation might not work outside of the elastic range. The equation was formulated for a beam that is loaded in compression below its yielding stress. If you use it for a beam that is beyond its yielding stress, there's no indication that it would be accurate. Critical stress is lower than yield stress any time you want to use this equation. If critical stress is higher than yield stress, the beam you are using isn't as slender, therefore buckling is not the only concern, since your load already goes outside of the elastic region. – JMac Nov 29 '16 at 12:24
• if the load already goes outside of the elastic region, the member will break by crushing instead of buckling? – kelvinmacks Nov 29 '16 at 12:53
• I'm not sure if crushing would be the right word. It would introduce permanent deformations in the beam, which would effect its strength and possibly orientation depending on the application. It could still buckle, but it would fail regardless of buckling. – JMac Nov 29 '16 at 13:14

I think you mean Euler Buckling Theory right? Buckling is a different mode of failure to yielding. The plastic strength of a member will usually be constant as it depends on the material. However the "buckling strength or Euler Strength" of a member depends on its slenderness as well as the material.

The image below illustrates this very well.

In Euler's bending theory, it's stated that the critical stress of a beam is always larger than the yield stress of the beam

seems just wrong, or you misunderstood the source you got it from.

Euler buckling has nothing to do with the yield stress. The theory assumes the material behavior is linear elastic, at least up to the load at which the bucking failure starts. (Euler's theory of buckling says nothing about what happens after it has started).

You can easily demonstrate that beam buckling can be purely elastic. Get a steel engineer's ruler (the longer the better, preferably 0.5 or 1 meter), or a thin wooden dowel or a sheet of thin plywood at least a meter long. Put one end on a flat surface and apply a load to the other end with your hands until it starts to buckle (i.e. bow outwards). Remove the load, and it will return to its initial straight configuration.

Of course if you continue to apply the load after it starts to buckle, it will continue to bow outwards until the material yields or fractures, but that post-buckling behaviour is not considered by Euler's theory.

• Or an even easier thing to buckle: spaghetti! – Wasabi Nov 30 '16 at 11:48
• so , after only the object buckle , then the object will yield and break ? – kelvinmacks Nov 30 '16 at 13:34

Buckling and yielding are completely different concepts.

Buckling occurs when an elastic structure does not move back to its initial position as long as the load is applied. Buckling is a purely elastic phenomenon. When elastic material is subjected to a small load, the deformation is usually small as well. This is different with buckling. Buckling requires a significant load in one direction, but then a very, very small load in a perpendicular direction can lead to destructive deformation (depending on the amount of deformation allowed by the system). Buckling is a stability problem, and the sample geometry is essential.

Yielding occurs when the behavior of the material itself changes (due to the high load). When a material yields, the relative position of the atoms change.

Edit: To realise the 'very, very small load' in perpendicular direction it is usually sufficient to apply the large load not perfectly in line with the stability axis. Since buckling is a stability problem, the large load leads to an instable system in the first place. In order to actually deform, some initial deformation in perpendicular direction is required which is then amplified.

I also slightly changed the first sentence of the buckling paragraph to account for Wasabi's comment.

• Buckling require 2 loads applied in different direction ? – kelvinmacks Nov 30 '16 at 12:00
• The first sentence of this answer is incorrect. Buckling is elastic: so long as it is restricted so as not to lead to excessively large deformations, a buckled element will return to its initial position once the load is released. Also, buckling does not require two loads. A single axial load that is applied an infinitesimal distance away from the element's centroid will cause it to buckle due to the infinitesimal bending moment created. This bending moment will cause an infinitesimal lateral deflection of the element, which due to second-order effects will be arbitrarily increased. – Wasabi Dec 1 '16 at 12:46
• @Wasabi, I agree that my first sentence on buckling was badly formulated. However, since buckling is a stability problem, some force that causes the instable system to move away from the equilibrium point is required. You can call that as you like, but usually this movement will be caused by the same force that causes instability, because usually that force will not be applied exactly along the axis where the system is strong. – Robin Dec 5 '16 at 7:38
• @Robin There's no extra force that causes an unstable system to move away from equilibrium. In Euler's buckling theory the force is applied to what should be a "stable" system. It's driven unstable by the fact that you can't realistically continuously apply a load to the exact centre of an object. There's always some uncertainty and variation over time (external factors mixed with the fact you'll never load something exactly on centre). Eulers Buckling theory is useful because you can always assume there is a non-ideal loading. – JMac Dec 5 '16 at 11:10
• @JMac It's driven unstable by the fact that you can't realistically continuously apply a load to the exact centre of an object. This is exactly what I wrote. – Robin Dec 6 '16 at 12:07

format: plain


text:
Elliptic flow of identified hadrons in Au+Au collisions at $\sqrt{s_{NN}}=$ 7.7--62.4 GeV

Abstract : Measurements of the elliptic flow, $v_{2}$, of identified hadrons ($\pi^{\pm}$, $K^{\pm}$, $K_{s}^{0}$, $p$, $\bar{p}$, $\phi$, $\Lambda$, $\bar{\Lambda}$, $\Xi^{-}$, $\bar{\Xi}^{+}$, $\Omega^{-}$, $\bar{\Omega}^{+}$) in Au+Au collisions at $\sqrt{s_{NN}}=$ 7.7, 11.5, 19.6, 27, 39 and 62.4 GeV are presented. The measurements were done at mid-rapidity using the Time Projection Chamber and the Time-of-Flight detectors of the STAR experiment during the Beam Energy Scan program at RHIC. A significant difference in the $v_{2}$ values for particles and the corresponding anti-particles was observed at all transverse momenta for the first time. The difference increases with decreasing center-of-mass energy, $\sqrt{s_{NN}}$ (or increasing baryon chemical potential, $\mu_{B}$) and is larger for the baryons as compared to the mesons. This implies that particles and anti-particles are no longer consistent with the universal number-of-constituent quark (NCQ) scaling of $v_{2}$ that was observed at $\sqrt{s_{NN}}=$ 200 GeV. However, for the group of particles NCQ scaling at $(m_{T}-m_{0})/n_{q}>$ 0.4 GeV/$c^{2}$ is not violated within $\pm$10%. The $v_{2}$ values for $\phi$ mesons at 7.7 and 11.5 GeV are approximately two standard deviations from the trend defined by the other hadrons at the highest measured $p_{T}$ values.
Document type :
Journal articles

http://hal.in2p3.fr/in2p3-00807107
Contributor : Sylvie Flores <>
Submitted on : Wednesday, April 3, 2013 - 7:25:18 AM
Last modification on : Thursday, February 7, 2019 - 2:58:02 PM

Citation

L. Adamczyk, W. Borowski, S. Kabana. Elliptic flow of identified hadrons in Au+Au collisions at $\sqrt{s_{NN}}=$ 7.7--62.4 GeV. Physical Review C, American Physical Society, 2013, 88, pp.014902. ⟨10.1103/PhysRevC.88.014902⟩. ⟨in2p3-00807107⟩

Record views


text:
# Question about finding smallest field given a primitive root of unity

I am having a bit of an issue with an example I was looking at. The question states: "What is the smallest field of characteristic 2 that contains a primitive 11th root of unity?". I am not familiar with how we would go about finding such a field, but my thought processes is going a bit like this:

1) By 'smallest field', I am thinking they mean a field of smallest order? Therefore I want to find the smallest ordered field, with characteristic 2, that contains a primitive 11th root of unity.

2) Having a primitive 11th root of unity means that there $\exists x \in \mathbb{F}_q$ such that $x^{11}=1$ and that $x^s\ne 1$ for $0\lt s \lt 11$. I am not quite sure how I would go about finding the $\mathbb{F}_1$ that contains this primitive root of unity, other than manually checking each $\mathbb{F}_q$, $q=2,3,...$.

3) The fact is given that the characteristic of $\mathbb{F}_q$ is $p=2$. I know that this means that in the field, $1+1=0$, I am not really sure how I would use this fact to find the field. Even so, other than $\mathbb{F}_2$, I am not sure what other fields would have this characteristic.

So yeah, I am a bit lost overall how I would go about attacking this problem (or similar ones - different characteristic, or different n-th roots).

Thanks for any guidance.

• If you take an irreducible polynomial $f$ in $\mathbb F_2[x]$, then the quotient $\mathbb F_2[x]/\langle f\rangle$ is a field extension of $\mathbb F_2$ of size $2^{\deg f}$. – Ravi Mar 2 '16 at 1:24
• Try and guess how you should choose $f$ so that you have an element $x$ in the extension satisfying the requirement that its $11$-th power is 1 and all smaller powers are not. – Ravi Mar 2 '16 at 1:26
• The nonzero elements of a field form a group under multiplication. The order of an element (of a finite group) divides the order of the group. That should get you started. – Gerry Myerson Mar 2 '16 at 1:53

For any prime $p$ and any $n \geq 1$, there is a (unique) field $\mathbb{F}_{p^n}$ of order $p^n$. You can construct such a field by taking the splitting field of $x^{p^n} - x$ over $\mathbb{F}_p = \mathbb{Z}/p\mathbb{Z}$, but the construction doesn't really matter for the question, just the fact that there is such a thing. (See here for more information on finite fields.)
Suppose $\zeta \in \mathbb{F}_{2^n}$ for some $n$, where $\zeta$ is a primitive $11^\text{th}$ root of $1$. As you point out, then $\zeta$ has order $11$ in the unit group ${\mathbb{F}_{2^n}}^\times$. Since $\mathbb{F}_{2^n}$ is a field, every element except for $0$ is a unit, so $|{\mathbb{F}_{2^n}}^\times| = 2^n - 1$. By Lagrange's Theorem, then $11 \mid 2^n - 1$, which provides a necessary condition. Since ${\mathbb{F}_{2^n}}^\times$ is a cyclic group then for each divisor $d$ of $2^n - 1$ there is an element of order $d$, so this condition is also sufficient.
Given $11 \mid 2^n - 1$, then $2^n - 1 = 11k$ for some $k \in \mathbb{Z}$, so $2^n \equiv 1 \pmod{11}$. Thus to determine the smallest such $n$, we simply have to compute the order of $2$ in $(\mathbb{Z}/11\mathbb{Z})^\times$. Since $|(\mathbb{Z}/11\mathbb{Z})^\times| = 10$, then $2^{10} \equiv 1 \pmod{11}$. To ensure that this is the smallest such $n$, we simply check that $2^{10/5} = 2^2 = 4 \not \equiv 1 \pmod{11}$ and $2^{10/2} = 2^5 = 32 \equiv -1 \not \equiv 1 \pmod{11}$.
• So basically, as long as I follow the process above, I can always find the smallest such field, assuming $p$ is prime, correct? – user3784030 Mar 2 '16 at 2:48
• Yes, this should work for any prime $p$ except for $11$, since $x^{11} - 1 = (x-1)^{11}$ in $\mathbb{Z}/11\mathbb{Z}$, so there is no such thing as a primitive $11^\text{th}$ root of unity mod $11$. – André 3000 Mar 2 '16 at 2:49


text:
## ABSTRACTS

pdf-version of this abstract

### Inverse limits as limits with respect to the Hausdorff metric

We show, using inverse limits of inverse sequences of compact metric spaces and upper semi-continuous multivalued bonding functions, that the inverse limit of any inverse sequence of compact metric spaces and surjective bonding maps is in fact the limit of a sequence of homeomorphic copies of the same spaces in certain ambient space with respect to the Hausdorff metric.
 Back to Home Page General Info Invited Speakers Participants with Links to Abstracts View Abstracts Submitted at Atlas


text:
# Does quantum yield of reaction factor in number of electrons needed?

Can someone tell me if quantum yield of a reaction factors in the number of electrons needed to create the particular species? If not, is there a metric that does?

For example, I have a 4 electron reduction which means that even if I have 100% efficiency, my quantum yield is

$$\frac{\text{# molecules reduced}}{\text{# photons absorbed}} = 0.25$$

Is there a better metric I can use so that 1.0 will be 100% efficiency?


text:
# Documentation¶

Dynet uses Doxygen for commenting the code and Sphinx for the general documentation.

If you’re only documenting features you don’t need to concern yourself with Sphinx, your doxygen comments will be integrated in the documentation automatically.

## Doxygen guidelines¶

Please document any publicly accessible function you write using the doxygen syntax. You can see examples in the training file. The most important thing is to use /* style comments and \command style commands.

For ease of access the documentation is divided into groups. For now the groups are optimizers and operations. If you implement a function that falls into one of these groups, add \ingroup [group name] at the beginning of your comment block.

If you want to create a group, use \defgroup [group-name] at the beginning of your file. Then create a file for this group in sphinx (see next section).

Important : You can use latex in doxygen comments with the syntax \f$\f$. For some reason since readthedocs updated their version of sphinx \f[ \f] doesn’t work anymore so don’t use it it breaks the build.

## Sphinx guidelines¶

The sphinx source files are located in doc/source. They describe the documentation’s organization using the reStructuredText Markup language.

Although reStructuredText is more powerful than Markdown it might feel less intuitive, especially when writing long documents. If needs be you can write your doc in Markdown and convert it using Pandoc.

For a tutorial on Sphinx see their tutorial.

Doxygen generated XML is integrated in sphinx files using the Breathe module. The only breathe command used now is doxygengroup. You shouldn’t used commands for individual classes/functions/structs without a good reason. Most information should be put in the doxygen comments.

## Building the docs¶

The documentation is automatically rebuilt by ReadTheDocs each time you push on Github.

If you want to build the documentation locally you’ll need to install doxygen, sphinx and breathe and then run build_doc.sh from the doc folder.


text:
# Pdf integration solutions by substitution problems and algebraic

## 39 Integration Using Algebraic Substitutions

Week7.pdf Integral Calculus Algebraic Substitution 1. Integrating algebraic fractions 1 mc-TY-algfrac1-2009-1 We will see that it is also necessary to draw upon a wide variety of other techniques such as completing the square, integration by substitution, using standard forms, and so on., 2/21/2017В В· This calculus video tutorial focuses on integration of inverse trigonometric functions using formulas and equations. Examples include techniques such as integrating by substitution, u вЂ¦.

### Techniques of Integration Substitution

Week7.pdf Integral Calculus Algebraic Substitution 1. Integrating algebraic fractions 1 mc-TY-algfrac1-2009-1 We will see that it is also necessary to draw upon a wide variety of other techniques such as completing the square, integration by substitution, using standard forms, and so on., Techniques of Integration: Substitution . Many integrals are hard to perform at first hand. A smart idea consists in cleaning'' them through an algebraic substitution which transforms the вЂ¦.

Math APВ®пёЋ Calculus AB Integration and accumulation of change Integrating using substitution. Integrating using substitution. рќ¶-substitution intro. рќ¶-substitution: definite integral of exponential function. Next lesson. Integrating functions using long division and completing the square. THE METHOD OF U-SUBSTITUTION The following problems involve the method of u-substitution. It is a method for finding antiderivatives. We will assume knowledge of the following well-known, basic indefinite integral formulas :

Substitution - free maths worksheets and other resources Here we have free maths worksheets relating to substituting into algebraic expressions. Click on pictures to see larger versions. Integration Integration by Substitution 2 - Harder Algebraic Substitution . We assume that you are familiar with the material in integration by substitution 1. Recall the Substitution Rule. To integrate if we replace by and by. This converts the original integral into a simpler one. We extend this idea to вЂ¦

Integrating algebraic fractions 1 mc-TY-algfrac1-2009-1 We will see that it is also necessary to draw upon a wide variety of other techniques such as completing the square, integration by substitution, using standard forms, and so on. 2. De nite Integration 3. The Area Under a Curve 4. Final Quiz Solutions to Exercises Solutions to Quizzes The full range of these pacagesk and some instructions, should they be required, can be obtained from our web page Mathematics Support Materials.

2/21/2017В В· This calculus video tutorial focuses on integration of inverse trigonometric functions using formulas and equations. Examples include techniques such as integrating by substitution, u вЂ¦ Integration Integration by Substitution 2 - Harder Algebraic Substitution . We assume that you are familiar with the material in integration by substitution 1. Recall the Substitution Rule. To integrate if we replace by and by. This converts the original integral into a simpler one. We extend this idea to вЂ¦

Integral Calculus Algebraic Substitution 1 Algebraic Substitution This module tackles topics on Substitution, trigonometric and algebraic. Course Module Objectives: At the end of this module, the learner should be able to: 1. Identify the rational integrand that will be substituted, whether it is algebraic or trigonometric 2. Substitute the z variables properly 3. 390 CHAPTER 6 Techniques of Integration EXAMPLE 2 Integration by Substitution Find SOLUTION Consider the substitution which produces To create 2xdxas part of the integral, multiply and divide by 2. Multiply and divide by 2. Substitute for x and dx. Power Rule Simplify. Substitute for u. You can check this result by differentiating.

390 CHAPTER 6 Techniques of Integration EXAMPLE 2 Integration by Substitution Find SOLUTION Consider the substitution which produces To create 2xdxas part of the integral, multiply and divide by 2. Multiply and divide by 2. Substitute for x and dx. Power Rule Simplify. Substitute for u. You can check this result by differentiating. "Integration by Substitution" (also called "u-Substitution" or "The Reverse Chain Rule") is a method to find an integral, but only when it can be set up in a special way. The first and most vital step is to be able to write our integral in this form

Each basic rule of integration that you have studied so far was derived from a corresponding differentiation rule. Even though you have learned all the necessary tools for differentiating exponential, logarithmic, trigonometric, and algebraic functions, your set of вЂ¦ "Integration by Substitution" (also called "u-Substitution" or "The Reverse Chain Rule") is a method to find an integral, but only when it can be set up in a special way. The first and most vital step is to be able to write our integral in this form

"Integration by Substitution" (also called "u-Substitution" or "The Reverse Chain Rule") is a method to find an integral, but only when it can be set up in a special way. The first and most vital step is to be able to write our integral in this form Math APВ®пёЋ Calculus AB Integration and accumulation of change Integrating using substitution. Integrating using substitution. рќ¶-substitution intro. рќ¶-substitution: definite integral of exponential function. Next lesson. Integrating functions using long division and completing the square.

10/25/2016В В· U-Substitution Integration, Indefinite & Definite Integral - Fractions & Trig Functions Calculus It contains plenty of examples and practice problems including fractions, square roots Integral Calculus Algebraic Substitution 1 Algebraic Substitution This module tackles topics on Substitution, trigonometric and algebraic. Course Module Objectives: At the end of this module, the learner should be able to: 1. Identify the rational integrand that will be substituted, whether it is algebraic or trigonometric 2. Substitute the z variables properly 3.

### Integration by substitution 2 Maths First Institute of

39 Integration Using Algebraic Substitutions. Chapter 3 - Techniques of Integration. Integration by Parts Techniques of Integration; Integration by Substitution Techniques of Integration. Algebraic Substitution Integration by Substitution. 1 - 3 Examples Algebraic Substitution; Trigonometric Substitution Techniques of Integration; Integration of Rational Fractions Techniques of, Techniques of Integration: Substitution . Many integrals are hard to perform at first hand. A smart idea consists in cleaning'' them through an algebraic substitution which transforms the вЂ¦.

1 3 Examples Algebraic Substitution Integral. "Integration by Substitution" (also called "u-Substitution" or "The Reverse Chain Rule") is a method to find an integral, but only when it can be set up in a special way. The first and most vital step is to be able to write our integral in this form, "Integration by Substitution" (also called "u-Substitution" or "The Reverse Chain Rule") is a method to find an integral, but only when it can be set up in a special way. The first and most vital step is to be able to write our integral in this form.

### Integration by Substitution mathsisfun.com

Substitution Free worksheets PowerPoints and other. 12/11/2018В В· Thus this notation allows us to use algebraic manipulation in solving integration problems. In addition, most integration problems come in the form of definite integrals of the form (I) $\int\limits_{a}^{b}{f\left( x \right)\,dx}$ and we work algebraically from that form. The source of the notation is undoubtedly the definite integral. Integration by substitution (7.2) Integration by substitution for definite integrals (7.4). 3. Area and the than one third of the problems will be on Chapter 7). If you'd like a pdf document containing the solutions go to the note page for the of practice problems for the Integration Techniques chapter of my Calculus II..

"Integration by Substitution" (also called "u-Substitution" or "The Reverse Chain Rule") is a method to find an integral, but only when it can be set up in a special way. The first and most vital step is to be able to write our integral in this form 10/25/2016В В· U-Substitution Integration, Indefinite & Definite Integral - Fractions & Trig Functions Calculus It contains plenty of examples and practice problems including fractions, square roots

Understanding Basic Calculus S.K. Chung. In most of the examples for such problems, more than one solutions are given. In Chapter 6, basic concepts and applications of integration are discussed. We use limit of sums in a speciп¬Ѓc The substitution method for integration corresponds to the Chain Rule 5.6 Supplement: Integration by Substitution or Algebraic Manipulation Note: Several of these examples come from your textbook Calculus Concepts: An Applied Approach to the Mathematics of Change, 4th ed., by LaTorre, Kenelly, Reed, Carpenter, Harris, and Biggers.

Integration Integration by Substitution 2 - Harder Algebraic Substitution . We assume that you are familiar with the material in integration by substitution 1. Recall the Substitution Rule. To integrate if we replace by and by. This converts the original integral into a simpler one. We extend this idea to вЂ¦ Integrating algebraic fractions 1 mc-TY-algfrac1-2009-1 We will see that it is also necessary to draw upon a wide variety of other techniques such as completing the square, integration by substitution, using standard forms, and so on.

Integration Integration by Substitution 2 - Harder Algebraic Substitution . We assume that you are familiar with the material in integration by substitution 1. Recall the Substitution Rule. To integrate if we replace by and by. This converts the original integral into a simpler one. We extend this idea to вЂ¦ second integration quiz with answers. series and review quiz with answers. series quiz with answers. Old Exam Questions with Answers 49 integration problems with answers. 43 problems on improper integrals with answers. 10 questions on geometric series, sequences, and l'HГґpital's rule with answers. 57 series problems with answers.

Substitution - free maths worksheets and other resources Here we have free maths worksheets relating to substituting into algebraic expressions. Click on pictures to see larger versions. 10/25/2016В В· U-Substitution Integration, Indefinite & Definite Integral - Fractions & Trig Functions Calculus It contains plenty of examples and practice problems including fractions, square roots

Techniques of Integration: Substitution . Many integrals are hard to perform at first hand. A smart idea consists in cleaning'' them through an algebraic substitution which transforms the вЂ¦ second integration quiz with answers. series and review quiz with answers. series quiz with answers. Old Exam Questions with Answers 49 integration problems with answers. 43 problems on improper integrals with answers. 10 questions on geometric series, sequences, and l'HГґpital's rule with answers. 57 series problems with answers.

Integral Calculus Algebraic Substitution 1 Algebraic Substitution This module tackles topics on Substitution, trigonometric and algebraic. Course Module Objectives: At the end of this module, the learner should be able to: 1. Identify the rational integrand that will be substituted, whether it is algebraic or trigonometric 2. Substitute the z variables properly 3. 12/11/2018В В· Thus this notation allows us to use algebraic manipulation in solving integration problems. In addition, most integration problems come in the form of definite integrals of the form (I) $\int\limits_{a}^{b}{f\left( x \right)\,dx}$ and we work algebraically from that form. The source of the notation is undoubtedly the definite integral.

Integration by substitution (7.2) Integration by substitution for definite integrals (7.4). 3. Area and the than one third of the problems will be on Chapter 7). If you'd like a pdf document containing the solutions go to the note page for the of practice problems for the Integration Techniques chapter of my Calculus II. Each basic rule of integration that you have studied so far was derived from a corresponding differentiation rule. Even though you have learned all the necessary tools for differentiating exponential, logarithmic, trigonometric, and algebraic functions, your set of вЂ¦

Algebraic Substitution Integration by Substitution In algebraic substitution we replace the variable of integration by a function of a new variable. A change in the variable on integration often reduces an integrand to an easier integrable form. 2. De nite Integration 3. The Area Under a Curve 4. Final Quiz Solutions to Exercises Solutions to Quizzes The full range of these pacagesk and some instructions, should they be required, can be obtained from our web page Mathematics Support Materials.

1 3 Examples Algebraic Substitution Integral. pdf. calculus ii solutions to practice problems. edith castillo. download with google download with facebook or download with email. calculus ii solutions to practice problems. download. calculus ii solutions to practice problems., 2. de nite integration 3. the area under a curve 4. final quiz solutions to exercises solutions to quizzes the full range of these pacagesk and some instructions, should they be required, can be obtained from our web page mathematics support materials.).

"Integration by Substitution" (also called "u-Substitution" or "The Reverse Chain Rule") is a method to find an integral, but only when it can be set up in a special way. The first and most vital step is to be able to write our integral in this form 12/11/2018В В· Thus this notation allows us to use algebraic manipulation in solving integration problems. In addition, most integration problems come in the form of definite integrals of the form (I) $\int\limits_{a}^{b}{f\left( x \right)\,dx}$ and we work algebraically from that form. The source of the notation is undoubtedly the definite integral.

Understanding Basic Calculus S.K. Chung. In most of the examples for such problems, more than one solutions are given. In Chapter 6, basic concepts and applications of integration are discussed. We use limit of sums in a speciп¬Ѓc The substitution method for integration corresponds to the Chain Rule Substitution - free maths worksheets and other resources Here we have free maths worksheets relating to substituting into algebraic expressions. Click on pictures to see larger versions.

Algebraic Substitution Integration by Substitution In algebraic substitution we replace the variable of integration by a function of a new variable. A change in the variable on integration often reduces an integrand to an easier integrable form. THE METHOD OF U-SUBSTITUTION The following problems involve the method of u-substitution. It is a method for finding antiderivatives. We will assume knowledge of the following well-known, basic indefinite integral formulas :

Chapter 3 - Techniques of Integration. Integration by Parts Techniques of Integration; Integration by Substitution Techniques of Integration. Algebraic Substitution Integration by Substitution. 1 - 3 Examples Algebraic Substitution; Trigonometric Substitution Techniques of Integration; Integration of Rational Fractions Techniques of Integration Integration by Substitution 2 - Harder Algebraic Substitution . We assume that you are familiar with the material in integration by substitution 1. Recall the Substitution Rule. To integrate if we replace by and by. This converts the original integral into a simpler one. We extend this idea to вЂ¦

Integrating algebraic fractions 1 mc-TY-algfrac1-2009-1 We will see that it is also necessary to draw upon a wide variety of other techniques such as completing the square, integration by substitution, using standard forms, and so on. вЂў Algebraic Substitutions вЂў Worked Problems on Integration Using Algebraic Substitutions вЂў Further Worked Problems on Integration Using Algebraic Substitutions вЂў Change of Limits 3 Algebraic Substitutions вЂў With algebraic substitutions, the substitution usually made is to let u be equal to f(x) such that f(u)du is a standard integral.

Techniques of Integration: Substitution . Many integrals are hard to perform at first hand. A smart idea consists in cleaning'' them through an algebraic substitution which transforms the вЂ¦ Understanding Basic Calculus S.K. Chung. In most of the examples for such problems, more than one solutions are given. In Chapter 6, basic concepts and applications of integration are discussed. We use limit of sums in a speciп¬Ѓc The substitution method for integration corresponds to the Chain Rule

Integration Integration by Substitution 2 - Harder Algebraic Substitution . We assume that you are familiar with the material in integration by substitution 1. Recall the Substitution Rule. To integrate if we replace by and by. This converts the original integral into a simpler one. We extend this idea to вЂ¦ Chapter 3 - Techniques of Integration. Integration by Parts Techniques of Integration; Integration by Substitution Techniques of Integration. Algebraic Substitution Integration by Substitution. 1 - 3 Examples Algebraic Substitution; Trigonometric Substitution Techniques of Integration; Integration of Rational Fractions Techniques of

Week7.pdf Integral Calculus Algebraic Substitution 1

Techniques of Integration Substitution. "integration by substitution" (also called "u-substitution" or "the reverse chain rule") is a method to find an integral, but only when it can be set up in a special way. the first and most vital step is to be able to write our integral in this form, 5.6 supplement: integration by substitution or algebraic manipulation note: several of these examples come from your textbook calculus concepts: an applied approach to the mathematics of change, 4th ed., by latorre, kenelly, reed, carpenter, harris, and biggers.).

Algebraic substitution integration

05 Integration using Algebraic Substitution Maths at. 390 chapter 6 techniques of integration example 2 integration by substitution find solution consider the substitution which produces to create 2xdxas part of the integral, multiply and divide by 2. multiply and divide by 2. substitute for x and dx. power rule simplify. substitute for u. you can check this result by differentiating., вђў algebraic substitutions вђў worked problems on integration using algebraic substitutions вђў further worked problems on integration using algebraic substitutions вђў change of limits 3 algebraic substitutions вђў with algebraic substitutions, the substitution usually made is to let u be equal to f(x) such that f(u)du is a standard integral.).

Week7.pdf Integral Calculus Algebraic Substitution 1

Algebraic Substitution Integration by Substitution. algebraic substitution integration by substitution in algebraic substitution we replace the variable of integration by a function of a new variable. a change in the variable on integration often reduces an integrand to an easier integrable form., more applications of integration, including centers of mass and work. these applications follow the general principles of finding areas and volumes of geometric objects. second, you will learn more advanced integration techniques, including integration by parts, trigonometric integrals, trigonometric substitution, and partial fractions.).

Algebraic Substitution Integration by Substitution

Substitution Free worksheets PowerPoints and other. u-substitution integration problems. letвђ™s do some problems and set up the $$u$$-sub. the trickiest thing is probably to know what to use as the $$u$$ (the inside function); this is typically an expression that you are raising to a power, taking a trig function of, and so on, when itвђ™s not just an вђњ$$x$$вђќ., вђў algebraic substitutions вђў worked problems on integration using algebraic substitutions вђў further worked problems on integration using algebraic substitutions вђў change of limits 3 algebraic substitutions вђў with algebraic substitutions, the substitution usually made is to let u be equal to f(x) such that f(u)du is a standard integral.).

pdf. CALCULUS II Solutions to Practice Problems. Edith Castillo. Download with Google Download with Facebook or download with email. CALCULUS II Solutions to Practice Problems. Download. CALCULUS II Solutions to Practice Problems. Chapter 3 - Techniques of Integration. Integration by Parts Techniques of Integration; Integration by Substitution Techniques of Integration. Algebraic Substitution Integration by Substitution. 1 - 3 Examples Algebraic Substitution; Trigonometric Substitution Techniques of Integration; Integration of Rational Fractions Techniques of

10/25/2016В В· U-Substitution Integration, Indefinite & Definite Integral - Fractions & Trig Functions Calculus It contains plenty of examples and practice problems including fractions, square roots Chapter 3 - Techniques of Integration. Integration by Parts Techniques of Integration; Integration by Substitution Techniques of Integration. Algebraic Substitution Integration by Substitution. 1 - 3 Examples Algebraic Substitution; Trigonometric Substitution Techniques of Integration; Integration of Rational Fractions Techniques of

Understanding Basic Calculus S.K. Chung. In most of the examples for such problems, more than one solutions are given. In Chapter 6, basic concepts and applications of integration are discussed. We use limit of sums in a speciп¬Ѓc The substitution method for integration corresponds to the Chain Rule second integration quiz with answers. series and review quiz with answers. series quiz with answers. Old Exam Questions with Answers 49 integration problems with answers. 43 problems on improper integrals with answers. 10 questions on geometric series, sequences, and l'HГґpital's rule with answers. 57 series problems with answers.

more applications of integration, including centers of mass and work. These applications follow the general principles of finding areas and volumes of geometric objects. Second, you will learn more advanced integration techniques, including integration by parts, trigonometric integrals, trigonometric substitution, and partial fractions. Integration by substitution (7.2) Integration by substitution for definite integrals (7.4). 3. Area and the than one third of the problems will be on Chapter 7). If you'd like a pdf document containing the solutions go to the note page for the of practice problems for the Integration Techniques chapter of my Calculus II.

"Integration by Substitution" (also called "u-Substitution" or "The Reverse Chain Rule") is a method to find an integral, but only when it can be set up in a special way. The first and most vital step is to be able to write our integral in this form U-Substitution Integration Problems. LetвЂ™s do some problems and set up the $$u$$-sub. The trickiest thing is probably to know what to use as the $$u$$ (the inside function); this is typically an expression that you are raising to a power, taking a trig function of, and so on, when itвЂ™s not just an вЂњ$$x$$вЂќ.

Integration Integration by Substitution 2 - Harder Algebraic Substitution . We assume that you are familiar with the material in integration by substitution 1. Recall the Substitution Rule. To integrate if we replace by and by. This converts the original integral into a simpler one. We extend this idea to вЂ¦ THE METHOD OF U-SUBSTITUTION The following problems involve the method of u-substitution. It is a method for finding antiderivatives. We will assume knowledge of the following well-known, basic indefinite integral formulas :

10/25/2016В В· U-Substitution Integration, Indefinite & Definite Integral - Fractions & Trig Functions Calculus It contains plenty of examples and practice problems including fractions, square roots Understanding Basic Calculus S.K. Chung. In most of the examples for such problems, more than one solutions are given. In Chapter 6, basic concepts and applications of integration are discussed. We use limit of sums in a speciп¬Ѓc The substitution method for integration corresponds to the Chain Rule

1 3 Examples Algebraic Substitution Integral


text:
# Revision history [back]

Hi, I tested the kmeas function with my data it is not giving any error ( i did not checked accuracy), But it is taking lng time… in fact very long. I have a suggestion not regarding the code but regarding the data you r data.

Now what I understand from you code is..

int dimensions = 950173;
int sampleCount = 128;

, Which means in your data you have 128 samples with each sample having a length of 950173? Practically it is very rare case and at such a higher dimension I personally don’t think any clustering algorithm works well.

If you really wanted to work on such a higher dimensionality, please use PCA to reduce the data to lower dimension or skip some of the features from your feature vector. I am sure you will get better results than operating on raw data.


text:
# Seeing if estimators are unbiased

I have the pdf

$$f(y ; \theta) = \frac{1}{\theta} \exp( \frac{-y}{\theta}), \ y > 0$$

and I'm supposed to determine if the following two estimators are unbiased or not: $\hat \theta = nY_{min}$ and $\hat \theta = \frac{1}{n}\sum_{i=1}^n Y_i$. I'm running into some problems because when I try to find the expected value of $Y_{min}$ and $Y_i$, the integral is undefined.

$Y_{min}$ is also exponentially distributed with mean parameter $\frac {\theta} {n}$
Therefore, $E[nY_{min}]=n\times\frac {\theta} {n} = \theta$. Similarly, $E[\frac{1}{n}\sum_{i=1}^n Y_i] = \frac{n \theta}{n}=\theta$


text:
# Prove in any interval there exists an irrational z

#### cmajor47

1. The problem statement, all variables and given/known data
Prove that in any interval there exists an irrational z.

2. Relevant equations

3. The attempt at a solution
My professor wrote this for me when trying to explain how to prove this:

$a \notin Q$, $\epsilon$ rational

$[r, s]\in a$

$l([r, s])<\frac{\epsilon}{2}$

$s-a<\frac{\epsilon}{2}$

$s-\frac{\epsilon}{2}<a$

$s-\frac{\epsilon}{2}+\epsilon<a+\epsilon$

$s<s+\epsilon<a+\epsilon$

I don't see why you use $[r, s]\in a$ or how my professor went from $s-\frac{\epsilon}{2}+\epsilon<a+\epsilon$ to $s<s+\epsilon<a+\epsilon$

I also don't know where to go from here to show what needs to be proved.
I'd really appreciate any help.

Related Calculus and Beyond Homework News on Phys.org

#### ystael

As people were saying in the previous thread, the problem appears to be that much of what you have written down is nonsense ($$[r, s] \in a$$, which is backward, and the dubious inequality deduction you mention).

What might be going on here is an attempt to make the following argument:
Given that there is a rational number in every interval, and the existence of one single irrational number $$a$$, prove that there is an irrational number in every interval.

($$a$$ might be $$\sqrt{2}$$, using the standard proof.)

Here is how this argument would go. Let $$(r,s)$$ be the interval in which we wish to find an irrational number. We try to do this by adding a rational number $$q$$ to $$a$$, because the sum of a rational and an irrational is irrational. So we need to find $$q$$ so that $$r < q + a < s$$. Clearly it suffices to have $$r - a < q < s - a$$, i.e., choose $$q$$ to be any rational number in $$(r - a, s - a)$$. We can do this by hypothesis, so the proof is done.

Does this make sense?

#### cmajor47

I think so. Is this proof correct:
Let $a\in$ Q, $\epsilon$ rational, where $\epsilon\in[r-a, s-a]$.
Then $r-a<\epsilon<s-a$, so $r<\epsilon+a<s$
So $\epsilon+a\in[r, s]$ and $\epsilon+a$ is irrational.
Therefore in any interval, there exists an irrational number.

#### jgens

Gold Member
But, since $a \in \mathbb{Q}$ and $\epsilon \in \mathbb{Q}$ clearly $a + \epsilon \in \mathbb{Q}$. Thus $a + \epsilon$ cannot be irrational.

#### cmajor47

Oops, meant to write $a\notin$ Q

"Prove in any interval there exists an irrational z"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving


text:
CHICIO CODING
Dirty clean code. Creative Stuff. Stuff.
CHICIO CODING
Dirty clean code. Creative Stuff. Stuff.

## Swift Closure: definition and syntax

In this post I will talk about Swift closure: what they are and their syntax.

As reported on the official Apple swift documentation closures are:

Closures are self-contained blocks of functionality that can be passed around and used in your code. They can capture and store references to any constants and variables from the context in which they are defined.

Closures are in many ways what blocks are in Objective-C (or lamba function in other languages). As it was for blocks, it is not easy to remember their syntax. This post is intended to be a reference for me (and you, readers ) about closure syntax. You could also take a look at [F$%&£&g closure syntax](http://fuckingclosuresyntax.com "F$%&£&g closure syntax").

Declared as a variable (valid also for let constants):

var closure: (parameters) -> returnType

Declared as an optional variable:

var closure: ((parameters) -> returnType)?

Declared as a type alias:

typealias ClosureType = (parameters) -> returnType

Declared as a function parameter and then call that function:

func myFunction(closure: (parameters) -> returnType)  {
...
}
...

/** You can explictly write the type of parameters. **/

//Call with round brackets.
myFunction(closure: { (parameters) -> returnType in
...
})

//Call without round brackets (only if closure is the last parameter).
myFunction { (parameters) -> returnType in
...
}

There is also the possibility to use a shorthand for the parameter: you can call them using \$ followed by the index of the argument in the call. Last but not least, you can capture self and avoid retain cycle using [unowned self] before the parameters. Go and show to the world the power of closure in Swift!!


text:
# Tag Info

6

Price level is the general level of prices in an economy. It is a variable that indicates what is the purchasing power of money (see Blanchard et al. Macroeconomics: a European Perspective). You can think of it as a variable that tells you what average prices are compared to some baseline. Price level is often measured using the consumer price index (CPI). ...

5

Material capital is any durable good that is used as a factor of production and, by virtue of being durable, it is gradually consumed in production over a maximum possible duration of a length that is determined by (i) how much a unit of capital is used and (ii) the depreciation rate of a unit of capital. Capital forms by labor and savings (which is in ...

5

My guess is that it is not a new factor of production, but simply a type of total factor productivity. This is because: factors of production are a stock, which produce services. What is the stock of AI? The stock of labour is easy to calculate. The stock of capital is more complex, but at least all capital goods (even robots) have a market price. As such, ...

5

If your aim is to maximize the production then your approach is correct. But if the aim is to find the optimal number of units of labor, then you should solve it as a profit maximization problem with a budget constraint. Then the problem should be as following Maximize the profit such that the total cost spent on production does not exceed the budget $$Max_{... 3 The following is from Thomas Piketty and Gabriel Zucman (2015, From Handbook of Income Distribution, Volume 2, Chapter 15, Part 15.5.3 which is hard to link to directly but get it here): Take a CES production function$$Y=F(K,L)=(a⋅K^{\frac{\sigma-1}{\sigma}}+(1−a)⋅L^{\frac{\sigma-1}{\sigma}})^{\frac{\sigma}{1-\sigma}}$$Me: \sigma is the elasticity of ... 3 k_t is your capital after investment, so if you subtract the capital you carried over from last period, k_{t-1}(1-\delta), you obtain the amount that must have been invested in order to have k_t of capital today. Remember that k is a stock variable, while i is a flow variable. This is why the flow i_t is the difference between the current and ... 3 This is a subtle issue. First let's present a numerical example to see the head-scratching riddle. Assume$$\alpha =1/2 \implies Y = K^{1/2}L^{1/2}$$and that the exogenously given input prices are$$r=1/8,\,\, w=4.$$The f.o.c are$$\begin{cases} \frac {Y}{2K} = 1/8 \\ \\ \frac{Y}{2L} = 4 \end{cases} \implies K/4 = 8L \implies \left(L/K\right)^* = 1/32$... 3 A clarification: The values$w,r$are not independent of input combinations: you have already solved for$K/L$. 1) Unless you assume that the price of the output is equal to 1, there is a minor mistake, as output prices affect factor prices. 2) If there is a profit maximizing pair$(K,L)$, then for all$\alpha \in \mathbb{R}_+(\alpha K,\alpha L)$will ... 3 In the short run, you cannot sell your capital. To do so would be a violation of "short run" and would instead be the "long run". Case 3 (and I would also contest Case 2) are outright forbidden by the definition of short run. I would note that your question has a lot of narrative to it - which is good in some cases, but you want to keep ... 3 You should interpret$P$as being the price of some bundle of goods people want to consume. Then if we have some monetary amount (in dollars, euro's or some other monetary unit of account), let's call it$M$, what does$M/P$mean? Note that:$P \times (M/P)=M$so$M/P$is the number of consumption bundles with price$P$you can buy with your$M$units of ... 3 My impression as a non-economist is that there has not been much interest in the 21st century in these debates and it is not taught to students. This is misconception but understandable one (I will get to the understandable part at the end). According to The New Palgrave Dictionary of Economics (Becker, 2017) - leading source for economic terminology - ... 2 From a Marxist perspective, capital is a social relation. Essentially, it is money that begets more money. As such, it only becomes more or less synonim with "means of production" once it takes over production, ie, once society becomes capitalist. In a feudal society, tools and land are not capital, albeit being means of production. The money of money ... 2 In the model with technological progress the capital per effective worker remains constant, implies that capital per worker grows at the rate of exogenous rate of technological progress. See Barro and Martin book, Chapter 1. 2 What I think you want to consider to be grouped with land, labour and capital is another factor to be considered with labor- technology (A.K.A "Knowledge*). The term "technology" here means an augmenting factor which is external to the present amount of labour. This can mean improved machinery to produce goods and services or alternatively, this can be ... 2 To add to @keepAlive's answer, even when natural resources are added typically stocks are used, at least in theoretical work. The flow of the used up resource is converted to a stock variable by assuming a fixed percentage of depletion each year (see for example Nordhaus Lethal model of 1992 here) 2 This is no different from any other markets... just for money. On the demand side of the goods, those who want money (those who sell bonds) say how much they're willing to pay in terms of bond yields. The supplier of the goods (bond buyers) come to the bond market and choose the product. Under a developed bond market, it's guaranteed that those who get the ... 2 Industrial capitalism, characterized by its use of heavy machinery and a much more pronounced division of labor. It is a system whereby industry and resources are owned by few for profit. In this capitalist system means of production were privately owned. Its is marked by the rise of monopolies and trusts dominating industry and other aspects of society. ... 2 First, important thing to note here is that$K/Y$is not the capital income to labor income ratio, but ratio of capital to total income (or output which is macro-economically equivalent to income).$K$is not an income derived from capital it is the stock of capital. Wars destroy the stock of capital so even though returns to capital$r\$ indeed increase ...

2

Different sides of the balance sheet. Capital represents long-dated instruments (infinite lifetime in the case of common equity) issued by a bank that are subordinated in a way to make them comparable to equity. (Can include instruments that are technically liabilities.) The existence of capital means that assets are greater than non-capital liabilities, i....

2

This is not really an economic terminology. Many words can have multiple meaning in common English. According to the Oxford dictionary: structure /ˈstrʌktʃə / ▸ noun 1 the arrangement of and relations between the parts or elements of something complex. ... 2 a building or other object constructed from several parts. In case of that article the first ...

2

Consider this... A bank's capital is used to finance the purchase of assets. Those assets are mostly loans made to households and businesses and governments. When a loan is made the bank is "buying" the future payments of the borrower. This suggests the whole right side of the balance sheet is capital because it takes the entire right side to finance the ...

2

The term FDI is generally reserved for foreign capital investment in domestic assets of the host country for business interests as opposed to hot flows which are generally aimed for quick capital gains. Examples of FDI would include take-overs of firms, collaboration/merger with a domestic company, entry into a new market, etc. Such investment give returns ...

2

You are concerned about... someting that can save the bank from bankruprtcy it problems occurs, when there is no money This is an accounting question as much as an economics question. What you are asking about is "solvency". assets minus liabilities equals equity The bank or any company is solvent by definition if equity is positive and ...

2

I think I get the answer but I am not 100% sure. Any comment would be welcome. I realized that this is related to the search-matching nature of the model (comparing to competitive labor market), so that if capital is not perfectly reversible the worker can bargain with the firm. Note that even with perfect reversibility, given the match-specific surplus, the ...

2

A derivative is a financial instrument whose value is dependent on an underlying asset. However it does not represent this asset nor does it hold any claim on the asset. At the end of the day, the only thing that happens with a derivative is that money is transferred between the agents that are involved in the derivatives contract. On the other hand, if you ...

2

Capital in economics normally means machines and tools used in production. However, confusingly the national accounting uses the accounting terminology where capital just means: Definition: Capital refers to the financial resources that businesses can use to fund their operations like cash, machinery, equipment and other resources (source). The accounting ...

1

In National Income Accounting, the capital stock is divided into structures and equipment. Equipment consists of machines, transport equipment, etc. Structures are buildings, bridges, etc. For definitions, see https://www.bea.gov/resources/learning-center/definitions-and-introduction-fixed-assets

1

One thing that could be made more explicit is that the capital is presumably for export employment and the existence of these employees will require additional local employment. Export employment is a job that produces a product for outside the city, local employment produces a good/service internal to the city. To use your example, if a car factory brings ...

1

It really depends on how far the factor/company is from state B. Obviously, it would be a big boon to state A. When a factory opens in a local economy many things does happened outside of job gains. Like increasing the Tax Base: local businesses increase their tax dollars stay within the local economy, helping to improve their community as a result. ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
Preprint A755/2014
Darboux-Halphen-Ramanujan Vector Field on a Moduli of Calabi-Yau Manifolds
Younes Nikdelan
Keywords: Darboux-Halphen-Ramanujan vector field | Hodge structure | Picard-Fuchs equation | Gauss-Manin connection

In this paper we obtain an ordinary differential
equation ${\sf H}$ from a  Picard-Fuchs equation  associated with a nowhere vanishing
holomorphic $n$-form. We work on a moduli space ${\sf T }$ constructed from  a Calabi-Yau manifold $W$ together
with a basis of the middle complex de Rham cohomology of $W$. We verify the existence of
a unique vector field ${\sf H}$ on ${\sf T }$  such that its composition with the Gauss-Manin connection satisfies certain
properties. The ordinary differential equation given by
${\sf H}$ is a generalization of differential equations introduced by Darboux, Halphen and Ramanujan.


text:
## Algebra: A Combined Approach (4th Edition)

$-\frac{7}{5}$
Substitute -5 for x and -3 for y in the expression, and solve the numerator and denominator separately before simplifying the fraction. $\frac{(-3)^{2} - (-5)}{2(-5)} = \frac{9 - (-5)}{2(-5)} = \frac{9 - (-5)}{-10} = \frac{14}{-10} = -\frac{7}{5}$


text:
# SIMD shift and float-to-half conversion

14 replies to this topic

### #1Nick

Senior Member

• Members
• 1227 posts

Posted 25 September 2007 - 02:00 PM

Hi all,

SIMD operations are indispensible for high-performance computing. For the latest generation of x86 CPU's, SSE even quadruples the floating-point performance, making a Core 2 Quad at 3 GHz more powerful than a Geforce 8600 GTS. So it can really pay off to convert performance-critical scalar code into vector code.

Unfortunately, compilers are still not adequately capable of generating SIMD code themselves. A first reason for this is that not every scalar operation can be translated directly to a vector equivalent. One of these is the shift operation. You can shift every element by the same shift value, but not by independent values. A second reason why writing SIMD code is difficult is that you can't branch per element (or at least not without losing the benefits of SIMD). In this Code Gem I will address both issues to convert 32-bit floating-point values to 16-bit floating-point values.

Shifting four 32-bit values in an SSE register by independent values in another SSE register won't become available as a single instruction until SSE5 appears in late 2008. Fortunately there's a trick to do almost the same thing with good old SSE2 (available since Pentium 4's and Athlon 64's). Shifting an integer value is the same thing as multiplying (or dividing) it by a power of two:

x << y = x * 2^y

So if we can convert our shift values to this power of two we just have to multiply to perform our shift operation. For this we can (ab)use the IEEE-754 floating-point format. It consists of a sign bit (s), 8 exponent bits (e), and a mantissa (m), and represents the following number:

s * 2^(e - 127) * m

Note that it performs a power of two operation. By setting the exponent field to y + 127, and the sign and mantissa both to 1, we get the value we need in floating-point representation. All we have to do next is convert to integer and multiply. But there's another issue here. There is no SSE instruction for multiplying four 32-bit integer numbers. There is one for floating-point numbers though. So instead we convert our values to be shifted (x) to floating-point, multiply in floating-point format, and then convert back to integer. Let's sum this up in code:

static __declspec(align(16)) unsigned int bias[4] = {127, 127, 127, 127};

__asm

{

paddd	xmm1, bias   // y in xmm1

pslld	xmm1, 23

cvtdq2ps	xmm0, xmm0   // x in xmm0

mulps	xmm0, xmm1

cvttps2dq	xmm0, xmm0   // Result in xmm0

}

(Note that this code is aimed at Visual C++ 32-bit)

What about precision and such? Converting an integer into a floating-point number can be done without losing any precision, as long as it fits into the mantissa field, which is 23 bits long. And because of an implicit 1 and the sign bit you can use signed integers up to 25 bits long. Anything that falls out of this range will loose some of the lower precision bits, which may or may not be critical for your application. Also, this version only works with positive shift values for shifting left, and when the result overflows it returns 0x80000000.

So it has several restrictions but for the situations where it's usable these five instructions are likely the fastest solution. Where I found this approach particularly useful is the parallel conversion of 32-bit floating-point numbers to 16-bit floating-point numbers (also known as the 'half' type).

This conversion has to deal with three cases: infinity, normal values, and denormal values. It's the denormal case where the SIMD shift comes in. Dealing with the three cases without branching can be achieved by masking (AND operation) and combining (OR operation). I'll save you from the details (but do not hesitate to ask questions) and immediately present the code:

static __declspec(align(16)) unsigned int abs[4]      = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};

static __declspec(align(16)) unsigned int infinity[4] = {0x47FFEFFF, 0x47FFEFFF, 0x47FFEFFF, 0x47FFEFFF};

static __declspec(align(16)) unsigned int denormal[4] = {0x38800000, 0x38800000, 0x38800000, 0x38800000};

static __declspec(align(16)) unsigned int mantissa[4] = {0x007FFFFF, 0x007FFFFF, 0x007FFFFF, 0x007FFFFF};

static __declspec(align(16)) unsigned int oneDot[4]   = {0x00800000, 0x00800000, 0x00800000, 0x00800000};

static __declspec(align(16)) unsigned int exponent[4] = {0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000};

static __declspec(align(16)) unsigned int fixup[4]    = {0x48000000, 0x48000000, 0x48000000, 0x48000000};

static __declspec(align(16)) unsigned int round1[4]   = {0x00000001, 0x00000001, 0x00000001, 0x00000001};

static __declspec(align(16)) unsigned int round2[4]   = {0x00000FFF, 0x00000FFF, 0x00000FFF, 0x00000FFF};

static __declspec(align(16)) unsigned int sign[4]     = {0x80000000, 0x80000000, 0x80000000, 0x80000000};

static __declspec(align(16)) unsigned int base[4]     = {0x00007FFF, 0x00007FFF, 0x00007FFF, 0x00007FFF};

static __declspec(align(16)) unsigned int adjust[4]   = {0x07000000, 0x07000000, 0x07000000, 0x07000000};

__asm

{

movaps	xmm1, xmm0   // Input in xmm0

andps	xmm0, abs

movaps	xmm2, xmm0

movaps	xmm3, xmm0

cmpnltps	xmm2, infinity

cmpltps	xmm3, denormal

// Denormal case

movaps	xmm4, xmm0

andps	xmm4, exponent

movaps	xmm6, xmm0

andps	xmm6, mantissa

orps	xmm6, oneDot

cvtdq2ps	xmm6, xmm6

mulps	xmm6, xmm4

cvttps2dq	xmm6, xmm6

// Normal case and combine

andps	xmm6, xmm3

andnps	xmm3, xmm0

orps	xmm6, xmm3

// Correct rounding

movaps	xmm0, xmm6

psrld	xmm0, 13

andps	xmm0, round1

// Combine with sign and infinity

psrld	xmm0, 13

andps	xmm1, sign

psrld	xmm1, 16

orps	xmm0, xmm2

andps	xmm0, base

orps	xmm0, xmm1   // Result in lower words of each element

}

A Core 2 Duo executes this code in about 14 clock cycles, or 3.5 cycles per element, which is clearly hard to beat with scalar code. Conversion from half to float can be done with a lookup table (one element at a time; SSE does not support gather operations yet).

So I hope this inspires more people to explore the world of SIMD computation. This particular example might be useful for image processing, ray tracing, compression, etc, but the techniques have a much wider applicability. So feel free to discuss SIMD and especially SSE below.

Cheers,

Nicolas

P.S: SSE5 will include float-to-half and half-to-float conversion in a single instruction...

### #2Kenneth Gorking

Senior Member

• Members
• 939 posts

Posted 27 September 2007 - 06:53 PM

Very cool trick with the shifting!
I just might go through my code and see if I can't use it somewhere :)

Couldn't you do the reverse for half-to-float conversions? Now, there is no NaN or denormal checking in this code, but it works when the values are valid, albeit with some lost precission :happy:

static __declspec(align(16)) unsigned half_sign[4]	  = {0x00008000, 0x00008000, 0x00008000, 0x00008000};

static __declspec(align(16)) unsigned half_exponent[4]	  = {0x00007C00, 0x00007C00, 0x00007C00, 0x00007C00};

static __declspec(align(16)) unsigned half_mantissa[4]	  = {0x000003FF, 0x000003FF, 0x000003FF, 0x000003FF};

static __declspec(align(16)) unsigned half_bias_offset[4] = {0x0001C000, 0x0001C000, 0x0001C000, 0x0001C000};

__asm

{

movaps	xmm1, xmm0  // Input in xmm0

movaps	xmm2, xmm0

andps	xmm0, half_sign

andps	xmm1, half_exponent

andps	xmm2, half_mantissa

pslld	xmm0, 16

pslld	xmm1, 13

pslld	xmm2, 13

orps	xmm1, xmm2

orps	xmm0, xmm1  // Result in xmm0

}

"Stupid bug! You go squish now!!" - Homer Simpson

### #3Nick

Senior Member

• Members
• 1227 posts

Posted 28 September 2007 - 06:38 AM

Kenneth Gorking said:

Couldn't you do the reverse for half-to-float conversions?
Probably yes. The trickiest part is conversion of denormal half values to normalized float values. It requires a log2 operation, and this can be achieved by converting from integer to floating-point format, and extracting the exponent...

But performance-wise a lookup table for the whole 16-bit value is likely hard to beat, even if it has to happen one element at a time. If an Intel/AMD guy is reading this: we need true scatter/gather operations in SSE6! :w00t: It would be useful for a lot more than just handling half values.

### #4iollmann

New Member

• Members
• 1 posts

Posted 03 October 2007 - 12:18 AM

You don't need a variable shift to do the denormals. Just use cvtdq2ps.

Also, if you are on MacOS X, you can make use of:

vImageConvert_Planar16FtoPlanarF
vImageConvert_PlanarFtoPlanar16F

...in Accelerate.framework to do these conversions.

Best Regards,

Ian Ollmann

### #5Nick

Senior Member

• Members
• 1227 posts

Posted 07 October 2007 - 11:05 AM

Hi Ian,

iollmann said:

You don't need a variable shift to do the denormals. Just use cvtdq2ps.
You probably meant cvt(t)ps2dq, like below?

static __declspec(align(16)) unsigned int abs[4]      = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};

static __declspec(align(16)) unsigned int infinity[4] = {0x47FFEFFF, 0x47FFEFFF, 0x47FFEFFF, 0x47FFEFFF};

static __declspec(align(16)) unsigned int denormal[4] = {0x38800000, 0x38800000, 0x38800000, 0x38800000};

static __declspec(align(16)) unsigned int fixup[4]    = {0x48000000, 0x48000000, 0x48000000, 0x48000000};

static __declspec(align(16)) unsigned int round1[4]   = {0x00000001, 0x00000001, 0x00000001, 0x00000001};

static __declspec(align(16)) unsigned int round2[4]   = {0x00000FFF, 0x00000FFF, 0x00000FFF, 0x00000FFF};

static __declspec(align(16)) unsigned int sign[4]     = {0x80000000, 0x80000000, 0x80000000, 0x80000000};

static __declspec(align(16)) unsigned int base[4]     = {0x00007FFF, 0x00007FFF, 0x00007FFF, 0x00007FFF};

static __declspec(align(16)) unsigned int integer[4]  = {0x52000000, 0x52000000, 0x52000000, 0x52000000};

__asm

{

movaps	xmm1, xmm0   // Input in xmm0

andps	xmm0, abs

movaps	xmm2, xmm0

movaps	xmm3, xmm0

cmpnltps	xmm2, infinity

cmpltps	xmm3, denormal

// Denormal case

movaps	xmm6, xmm0

mulps	xmm6, integer

cvttps2dq	xmm6, xmm6

// Normal case and combine

andps	xmm6, xmm3

andnps	xmm3, xmm0

orps	xmm6, xmm3

// Correct rounding

movaps	xmm0, xmm6

psrld	xmm0, 13

andps	xmm0, round1

// Combine with sign and infinity

psrld	xmm0, 13

andps	xmm1, sign

psrld	xmm1, 16

orps	xmm0, xmm2

andps	xmm0, base

orps	xmm0, xmm1   // Result in lower words of each element

}

Quote

Also, if you are on MacOS X, you can make use of:

vImageConvert_Planar16FtoPlanarF
vImageConvert_PlanarFtoPlanar16F
Interesting! Are those fully SSE optimized? I'm not experienced enough with Xcode to have a peek at the disassembly...

### #6J22

Member

• Members
• 92 posts

Posted 13 October 2007 - 02:03 PM

Nick said:

For the latest generation of x86 CPU's, SSE even quadruples the floating-point performance, making a Core 2 Quad at 3 GHz more powerful than a Geforce 8600 GTS
Just wondering, but isn't the throughput of basic SIMD instructions on quad core CPUs (INTEL Core 2 Extreme QX6850) only 4x3G=12G inst/s, while 8600GTS runs at 32x1.45G=46.4G inst/s, and 8800 Ultra runs at 128x1.5G=192G inst/s?

### #7Nick

Senior Member

• Members
• 1227 posts

Posted 13 October 2007 - 04:18 PM

J22 said:

Just wondering, but isn't the throughput of basic SIMD instructions on quad core CPUs (INTEL Core 2 Extreme QX6850) only 4x3G=12G inst/s, while 8600GTS runs at 32x1.45G=46.4G inst/s, and 8800 Ultra runs at 128x1.5G=192G inst/s?
Core 2 can execute one 4-component vector multiplication and one vector addition per clock cycle. So that's 8 floating-point operations x 4 cores x 3 GHz = 96 GFLOPS.

GeForce 8600 GTS can also do a multiplication and addition in the same cycle, but each stream processor is scalar, so it totals 92.8 GFLOPS.

### #8J22

Member

• Members
• 92 posts

Posted 14 October 2007 - 09:01 AM

Ah, that's right of course. I was under impression that stream processor operates on 4d vectors, not scalars, thus the confusion.

### #9GandiTheGrey

New Member

• Members
• 2 posts

Posted 20 December 2007 - 09:03 AM

Nick - thanks indeed for the cool trick!

One technical question:
the max finite half-precision number possible is 65504.0, hexed to single as 0x477fe000. the 'next' single is 0x477fe001, which is the minimal single to qualify as an infinite (in half prec). So why set the 'infinite' mask to 0x47ffefff? Or maybe i got the rationale wrong altogether?

thanks,

-G

### #10.oisyn

DevMaster Staff

• Moderators
• 1842 posts

Posted 20 December 2007 - 11:33 AM

I think that is because 0x477fe001 through 0x477fefff gets rounded down to 65504.0 anyway, so they're perfectly acceptable values.
-
Currently working on: the 3D engine for Tomb Raider.

### #11Nick

Senior Member

• Members
• 1227 posts

Posted 20 December 2007 - 04:06 PM

I used the behavior of D3DXFloat32To16Array/D3DXFloat16To32Array, which does not have a representation for NaN nor infinity. It can represent up to 131008.0, but clamps anything higher to the representation of this number (0x7FFF).

So they give it a slightly bigger range than it would have had if all 1's in the exponent meant NaN or infinity. I think this is done to allow storing +-65536 without causing it to immediately jump to infinity. So you could store a 16-bit integer texture in a 16-bit floating-point texture.

'Infinity' is probably not the best name for the 0x47FFEFFF value I used. Maybe 'limit' would have prevented confusion.

Anyway, this is an interesting topic. The IEEE 754r draft currently describes a 16-bit floating-point format that does have a representation for NaN and infinity. I'm not sure if this makes sense because this format is intended for storate only; arithmetic operations are only defined staring from 32-bit. You never want to create a texture or vertex buffer with a NaN or infinite value. And I can't think of an application outside of multimedia where it does make sense...

### #12Nick

Senior Member

• Members
• 1227 posts

Posted 21 December 2007 - 10:20 AM

Nick said:

I used the behavior of D3DXFloat32To16Array/D3DXFloat16To32Array, which does not have a representation for NaN nor infinity.
I've done some extra testing and found out this is only true for DirectX 9, not DirectX 10. :excl: It also appears to have different rounding rules...

### #13GandiTheGrey

New Member

• Members
• 2 posts

Posted 23 December 2007 - 12:10 PM

Nick said:

I used the behavior of D3DXFloat32To16Array/D3DXFloat16To32Array, which does not have a representation for NaN nor infinity. It can represent up to 131008.0, but clamps anything higher to the representation of this number (0x7FFF).

So they give it a slightly bigger range than it would have had if all 1's in the exponent meant NaN or infinity. I think this is done to allow storing +-65536 without causing it to immediately jump to infinity. So you could store a 16-bit integer texture in a 16-bit floating-point texture.

'Infinity' is probably not the best name for the 0x47FFEFFF value I used. Maybe 'limit' would have prevented confusion.

Anyway, this is an interesting topic. The IEEE 754r draft currently describes a 16-bit floating-point format that does have a representation for NaN and infinity. I'm not sure if this makes sense because this format is intended for storate only; arithmetic operations are only defined staring from 32-bit. You never want to create a texture or vertex buffer with a NaN or infinite value. And I can't think of an application outside of multimedia where it does make sense...
Ahh. Thanks!
doesn't D3DXFloat32To16Array use vectorized implementation anyhow? (odd, but possible)

### #14aqnuep

New Member

• Members
• 1 posts

Posted 08 September 2009 - 05:15 PM

Nick said:

Core 2 can execute one 4-component vector multiplication and one vector addition per clock cycle. So that's 8 floating-point operations x 4 cores x 3 GHz = 96 GFLOPS.

GeForce 8600 GTS can also do a multiplication and addition in the same cycle, but each stream processor is scalar, so it totals 92.8 GFLOPS.

GeForce 8600 -> 113-139 GFLOPS (MAD) means 226-178 GFLOPS

And these values are valid not just for vector operations but also for independent scalar ones, of which those weak CPUs aren't able at the rate you mentioned.

Don't say that CPUs are faster than even mid-range GPUs. GPUs are far more powerfull than CPUs as raw computational hardware and also they even perform more powerful because they have a wider memory bus and higher memory clock rates. Both get starved sometimes and GPU is of course a limited piece of hardware but for raw calculations it performs much, much better.

### #15Nick

Senior Member

• Members
• 1227 posts

Posted 08 September 2009 - 09:06 PM

aqnuep said:

GeForce 8600 -> 113-139 GFLOPS (MAD) means 226-178 GFLOPS
I don't think so. The GeForce 8600 GTS has 32 stream processors at 1450 MHz, each capable of a single MAD. That's 92.8 GFLOPS total.

Quote

And these values are valid not just for vector operations but also for independent scalar ones, of which those weak CPUs aren't able at the rate you mentioned.
The GeForce's stream processors are clustered together to work as an SIMD array. That's exactly the same as a CPU's SIMD vectors. So on a CPU you can just as easily use the full computational power even for scalar operations, if you process multiple elements in parallel.

Quote

Don't say that CPUs are faster than even mid-range GPUs.
I'm only summing up the facts.

Quote

...also they even perform more powerful because they have a wider memory bus and higher memory clock rates.
Again that's not quite true. The GeForce 8600 GTS has 32 GB/s of bandwidth. A Core 2 Quad has up to 25.6 GB/s while the Core i7 can have 64 GB/s. But that's not all. A GPU wastes bandwidth on storing intermediate results in RAM memory. The CPU can store vast amounts of data in its caches, which offer a whopping 384 GB/s of bandwidth. For a lot of applications it's the average bandwidth that really matters.

Furthermore, a GPU completely chokes once you've used up all physical registers. On a GeForce 8600, each stream processor has only 16 physical registers. You run out of those really quickly if you try anything a little complex. It 'solves' this by running less threads, effectively decimating performance. Unlike the GPU, a CPU has a large stack and the cache hierarchy ensures it functions efficiently even for very long pieces of code.

This is why we often see the GPU fail against modern CPUs at GPGPU tasks. They are designed for doing graphics and other highly coherent tasks, but performance crumbles as soon as you need a bit of flexibility or complexity.

The simple conclusion is that for games you really shouldn't be using the GPU for anything other than graphics. Doing anything else is more often than not highly inefficient, eating away performance needed for rendering. It also has terrible round-trip latencies. So for a large number of other tasks, even computationally intensive ones, you're still best off doing them on the CPU. With quad-core starting to get real traction in the mainstream market you'd be a fool not to tap into that power.

#### 1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users