url stringlengths 14 2.42k | text stringlengths 100 1.02M | date stringlengths 19 19 | metadata stringlengths 1.06k 1.1k |
|---|---|---|---|
https://preprint.impa.br/visualizar?id=1496 | Preprint A531/2007
Thermodynamical formalism for robust classes of potentials and non-uniformly hyperbolic maps
Marcelo Viana | Oliveira, Krerley
Keywords: equilibrium state | non-uniform hyperbolicity | Ruelle-Perron-Frobenius operator
We develop a Ruelle-Perron-Frobenius transfer operator approach to the ergodic theory of a large class of non-uniformly expanding transformations on compact manifolds. For Holder continuous potentials not too far from constant, we prove that the transfer operator has a positive eigenfunction, piecewise Holder continuous, and use this fact to show that there is exactly one equilibrium state. Moreover, the equilibrium state is a non-lacunary Gibbs measure, a non-uniform version of the classical notion of Gibbs measure that we introduce here.
Anexos: | 2023-02-09 00:25:50 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.818443238735199, "perplexity": 765.5579903562972}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500983.76/warc/CC-MAIN-20230208222635-20230209012635-00463.warc.gz"} |
http://math.stackexchange.com/questions/252410/showing-symmetry-of-the-stress-tensor-by-applying-divergence-theorem-to-int-in | # Showing symmetry of the stress tensor by applying divergence theorem to $\int\int_{\delta V(t)} \vec{x}\times \vec{t} dS$
I'm currently working through the symmetry of the stress tensor, in relation to viscous flow. I am looking at this by examining the conservation of angular momentum equation for a material volume $V(t)$ with unit normal $\vec{n}=(n_1,n_2,n_3)$. I am having issue with applying the divergence theorem to this term
$$\int\int_{\delta V(t)} \vec{x}\times \vec{t} dS$$
Where $\vec{x}=(x_1,x_2,x_3)$ and $\vec{t}$ is the stress vector where $\vec{t}=\vec{e}_i\sigma_{ij}n_j$, using the summation convenction, where $\sigma_{ij}$ is stress vector.
If I can extract a normal from this expression I can use the divergence theorem to convert to a volume integral and combine with the other terms of the conservation of angular momentum equation, which are volume integrals, this will lead to showing $\sigma_{ij}=\sigma_{ji}$.
Many thanks to anyone who could help.
EDIT: Under angular momentum on this page is basically doing what i'm looking for, but can't for the life of me see how they do it -or what their notation relates to http://bobbyness.net/NerdyStuff/Navier%20Stokes%20Equations/Navier%20Stokes.html
EDIT2: Here is a link to the notes i'm learning from, page 14 http://www.maths.ox.ac.uk/system/files/coursematerial/2012/2386/9/B6aLectureNotes_img.pdf
-
Is it fair to say that $\vec{e}_i$ are tangent to the surface $\delta V(t)$? I need a few more details on the conventions of your notation. Interesting problem. I have a derivation of the inertia tensor from KE of a rigid body, the inertia tensor naturally arises a symmetric tensor which gives the components of the quadratic form in the angular velocity... but your problem is fluid physics so perhaps my starting point is wrong. – James S. Cook Dec 6 '12 at 18:25
@JamesS.Cook: At sorry, I tried to include as many possible but I see that now could be confusing, $\vec{e_1}=\vec{i}, \vec{e_2}=\vec{j}, \vec{e_3}=\vec{k}$ – Freeman Dec 6 '12 at 19:02
Sorry, this is a bit too late but here goes.
The first thing is to rewrite the cross product using indices and the summation convention
$\mathbf{x} \times \mathbf{t}|_r = \epsilon_{rmn} x_m t_n$
where $\epsilon_{rmn}$ is the Levi-Civita symbol.
Now rewrite the traction vector $t_n$ as $\sigma_{jn} n_j$ which is how you sneak a normal into the equation.
Before you can apply the Divergence theorem to the resulting integral, ie.
$\int_{S} \epsilon_{rmn} x_m \sigma_{jn} n_j dS$
you have to understand that the integrand without the $n_j$ is an object $T$ with two free indices. So you can think of this integrand as
$\int_{S} T_{rj} n_j dS$
By the Divergence theorem this is
$$\int_{S} T_{rj} n_j dS = \int_{V} \frac{\partial T_{rj}}{\partial x_j} dV$$
Now you can resub for $T_{rj}$, so the integral is
$$\int_{V} \frac{\partial ({\epsilon_{rmn} x_m \sigma_{jn}})}{\partial x_j} dV$$
Take the constant $\epsilon$ out, apply partial derivatives and simplify; you get
$$\int_{V} \epsilon_{rmn} \left ( \sigma_{mn} + x_m \frac{\partial {\sigma_{jn}}}{\partial x_j} \right) dV$$
You can proceed from here. You'll see the momentum balance appear if you group the other terms, and you'll finally just have
$$\int_{V} \epsilon_{rmn} \sigma_{mn} dV = 0$$
which yields the result because $V$ is an arbitrary fluid volume and the Levi-Civita symbol is skew-symmetric.
- | 2015-01-31 22:56:03 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9208537936210632, "perplexity": 221.40536988352451}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-06/segments/1422115861162.19/warc/CC-MAIN-20150124161101-00094-ip-10-180-212-252.ec2.internal.warc.gz"} |
https://www.khanacademy.org/test-prep/mcat/biological-sciences-practice/x04f6bc56:mcat-bio-biochem-foundation-1-passages/e/-biochemistry-of-a-newly-discovered--pretend--neurotransmitter | If you're seeing this message, it means we're having trouble loading external resources on our website.
If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.
# Biochemistry of a newly discovered (pretend) neurotransmitter
## Problem
NTKA is a newly discovered excitatory neurotransmitter. After its release into the synaptic cleft, NTKA is cleaved into two components, NT and KA, by an enzyme known as NTKAse.
A new disease, with an autosomal recessive mode of inheritance, is characterized by NTKA deficiency. Autosomal recessive NTKA deficiency is caused by a hyperactive NTKAse enzyme, “NTKAse,” which binds NTKA with a much higher affinity than wild-type NTKAse, quickening the depletion of NTKA from the synaptic cleft. Interestingly, NTKAse and NTKAse do not appear to have different rates of catalysis at saturating substrate, “start text, k, end text, start subscript, c, a, t, end subscript”.
Three patients volunteer for a study involving NTKA deficiency. Via in vitro genetic manipulation, researchers are able to produce a large quantity of NTKAse protein from each of these patients and characterize them biochemically. Figure 1 shows a Lineweaver-Burke plot of NTKAse activity for three patients, each of whom has one or more relatives with NTKA deficiency. Patients 1 and 2 are of unknown genotype, while patient 3 is homozygous recessive. The NTKAse activity of Patient 3 was measured in the presence of a drug known to limit the activity of NTKAse.
A Lineweaver-Burke plot can be used to characterize an enzyme’s activity in different concentrations of substrate. The reciprocal of the enzyme’s rate of reaction, 1, slash, V, is plotted against the reciprocal of the substrate concentration, 1, slash, open bracketSclose bracket. The enzyme’s maximum rate of reaction, start text, V, end text, start subscript, m, a, x, end subscript, and the enzyme’s binding affinity for substrate, start text, K, end text, start subscript, M, end subscript, can be extracted from the plot’s y- and x-intercepts, respectively. A low start text, K, end text, start subscript, M, end subscript indicates high binding affinity, whereas a high start text, K, end text, start subscript, M, end subscript indicates low binding affinity.
Figure 1: A Lineweaver-Burke plot was used to characterize the start text, V, end text, start subscript, m, a, x, end subscript and start text, K, end text, start subscript, M, end subscript values of NTKAse in three patients.
How would the signaling activity of NTKA change at the post-synaptic neuron if a molecule that specifically bound the NTKAse active site were added to the synaptic cleft? | 2023-02-06 06:00:34 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 20, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.631858229637146, "perplexity": 9404.083704447998}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500304.90/warc/CC-MAIN-20230206051215-20230206081215-00668.warc.gz"} |
http://math.stackexchange.com/questions/46522/maximum-size-of-a-rotated-then-cropped-rectangle | # Maximum size of a rotated-then-cropped rectangle
With regard to topic/question New size of a rotated-then-cropped rectangle:
The answer by Isaac,
the maximum area is $b^2\csc\alpha\sec\alpha$ when $x=0.5b\csc\alpha = 0.5b/\sin\alpha$
seems to work for angles near $45$ degrees. However, its range of validity seems to be aspect ratio dependent. For $w/h$ aspect ratio $>> a/b$, it works for a large range of angles, but for aspect ratio $= 1$ it only works at $45$ degrees.
This is easily seen by using $\alpha$ nearly zero (very little rotation), then $\sin\alpha$ becomes nearly zero and $x$ becomes very large, certainly much larger than $a$. Whereas the correct solution will be nearly the same size as the slightly rotated rectangle.
The solution, $x=0.5b/\sin\alpha$, leads to $y=0.5b/\cos\alpha$. So when $x=y$ (upper right corner of inner rectangle) and $a=b$ (aspect ratio$=1$), we have $\sin\alpha = \cos\alpha$, which is valid (in the first quadrant) only at $\alpha=45$ degrees.
In particular, the limiting angle would appear to occur when $x=a$, so that $\sin\alpha > 0.5b/a$.
It appears that within the valid range of this solution, only $2$ diagonal vertices of the inner rectangle touch the sides of the rotated rectangle. But in the invalid range, all four vertices of the inner rectangle touch an appropriate side of the rotated rectangle.
I have tried solving this with lagrange multiplers and get the same answer. But I don't know how to put in an inequality constraint that $x\leq a$.
I am wondering if this can be solved closed form with a more general solution that gives a solution for any angle and any aspect ratio. Or at least another solution that works where this solution fails. So far I have been unsuccessful.
A more general and similar problem has been solved by testing multiple conditions, but is not closed form. see http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2003/DanielSud/
I would appreciate hearing from the Mathematics experts on this.
- | 2016-07-01 20:41:18 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8667941093444824, "perplexity": 362.43141958522654}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-26/segments/1466783403825.35/warc/CC-MAIN-20160624155003-00194-ip-10-164-35-72.ec2.internal.warc.gz"} |
http://dehesa.freeshell.org/NCSE2/ | ## Numerical Computation in Science and Engineering
Second Edition, 2008, 1251 Pages, including six appendices
## Why this book?
Designed for the non-expert, student, science enthousiast or researcher, this text provides an accessible introduction to numerical computation with applications in science and engineering. It assumes no prior knowledge beyond undergraduate calculus and elementary computer programming. Fundamental and practical issues are discussed in a unified manner with a generous, but not excessive, dose of numerical analysis. Topics are introduced on a need to know basis to concisely illustrate the practical implementation of a variety of algorithms and demystify seemingly esoteric numerical methods. Algorithms that can be explained without too much elaboration and can be implemented within a few dozen lines of computer code are discussed in detail, and computer programs in Fortran, C++, and Matlab are provided. Algorithms whose underlying theories require long, elaborate explanations are discussed at the level of first principles, and references for further information are given. The book uses numerous schematic illustrations to demonstrate concepts and facilitate their understanding by providing readers with a helpful interplay between ideas and visual images. Real-world examples drawn from various branches of science and engineering are presented.
Drawing a direct connection between numerical analysis and numerical computation Numerical Computation in Science and Engineering serves as an ideal text for undergraduate and graduate courses in numerical methods.
## Programs
This book is accompanied by a suite of computer programs arranged according to the book chapters.
## Errata
1. Page 1:
Line 8: Please replace "in their desks" with "at their desks" (Thanks to Chris Zusi.)
2. Page 84:
Two lines after equation (1.16.8): Please replace "0.0459" with "0.0469" (Thanks to Chris Zusi.)
3. Page 87
Expression (1.1.26): please insert an f at the beginning of the numerator (Thanks to David Schmidt.)
4. Page 186
Line before equation (2.13.6): please modify the equation to read: A u(i) = λ u(i) (Thanks to Bryan Urquhart.)
5. Page 257:
Equations (3.9.39): First equation: Please change "8/5" to "3/4".
Second equation: Please change "3/4" to "8/5" (Thanks to Merlin Ma Wei.)
6. Page 289:
Caption of schematic: Please change to read: "A nonlinear function maps the root of a function, f(x), to the null point."
7. Page 301:
Equation (4.4.30): The three dots should be centered.
8. Page 396:
C++ code at the bottom: Please change "x[i]" to "x[i-1]".
9. Page 444:
Equation (6.13.32): Please insert a comma after "h1"
10. Page 511:
Equations (6.20.18) and (6.20.19): Please change "h2" to "h" near the end of each eqaution.
11. Page 511:
Equation (6.20.20): Please change "h4" to "h2" near the end of this eqaution.
12. Page 690:
Problem 9.1.4, penultimate line: Please change "cB,in" to "cC,in".
13. Page 729:
Equation (9.6.20): Please change "-646" to "+646"
14. Page 806:
Equation (10.2.27): Please put a minus sign (-) after the equal sign (=).
Equation (10.2.30): Please put a minus sign (-) after each of the two equal signs (=).
15. Page 807:
Line after quation (10.2.32): Please replace the sentence "The rest of the eigenvalues are either real or come in pairs of complex conjugates" with the sentence "Using the results of Section 5.2.5, we find that the remaining eigenvalues are all zero."
16. Page 916:
Problem 11.5.3: Please change "11.4.8" to "11.4.7".
17. Page 984:
Please change "0.879 and 5.121" to "1.268 and 4.732", and "1.875 and 4.526" to "2.252 and 4.351".
18. Page 1083:
In the following sentence, please change "and $\d A = \d x \: \d y$ is a differential area in the $xy$ plane." to "and $\d l$ is the arc length along $C$." | 2018-02-25 15:11:29 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4457627534866333, "perplexity": 3585.719597771858}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-09/segments/1518891816647.80/warc/CC-MAIN-20180225150214-20180225170214-00426.warc.gz"} |
https://eccc.weizmann.ac.il/keyword/18274/ | Under the auspices of the Computational Complexity Foundation (CCF)
REPORTS > KEYWORD > UNIQUE GAMES HARDNESS:
Reports tagged with Unique Games hardness:
TR13-071 | 8th May 2013
Venkatesan Guruswami, Sushant Sachdeva, Rishi Saket
#### Inapproximability of Minimum Vertex Cover on $k$-uniform $k$-partite Hypergraphs
We study the problem of computing the minimum vertex cover on $k$-uniform $k$-partite hypergraphs when the $k$-partition is given. On bipartite graphs ($k=2$), the minimum vertex cover can be computed in polynomial time. For $k \ge 3$, this problem is known to be NP-hard. For general $k$, the problem was ... more >>>
TR19-148 | 1st November 2019
Amey Bhangale, Subhash Khot
#### Simultaneous Max-Cut is harder to approximate than Max-Cut
A systematic study of simultaneous optimization of constraint satisfaction problems was initiated in [BKS15]. The simplest such problem is the simultaneous Max-Cut. [BKKST18] gave a $.878$-minimum approximation algorithm for simultaneous Max-Cut which is {\em almost optimal} assuming the Unique Games Conjecture (UGC). For a single instance Max-Cut, [GW95] gave an ... more >>>
ISSN 1433-8092 | Imprint | 2019-11-18 08:29:14 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.805541455745697, "perplexity": 2257.2323917487297}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-47/segments/1573496669730.38/warc/CC-MAIN-20191118080848-20191118104848-00264.warc.gz"} |
https://www.dpmms.cam.ac.uk/person/or257 | # Department of Pure Mathematics and Mathematical Statistics
University Lecturer
Research Interests: Algebraic and Geometric Topology, in particular: mapping class groups, moduli spaces, cobordism categories, spaces of manifolds, surgery, configuration spaces, characteristic classes, K-theory and applications of homotopy theory to geometry.
## Publications
Mapping class groups of simply connected high-dimensional manifolds need not be arithmetic
M Krannich, O Randal-Williams
– Comptes Rendus Mathematique (Academie des Sciences)
(2020)
358,
469
On the cohomology of Torelli groups
A Kupers, OSCAR Randal-Williams
– Forum of Mathematics, Pi
(2020)
8,
e7
$E_2$-cells and mapping class groups
S Galatius, A Kupers, O Randal-Williams
– Publications Mathematiques de l'Institut des Hautes Etudes Scientifiques
(2019)
130,
1
Semi-simplicial spaces
J Ebert, O Randal-Williams
– Algebraic and Geometric Topology
(2019)
19,
2099
Moduli spaces of manifolds: a user's guide
S Galatius, O Randal-Williams
Infinite loop spaces and positive scalar curvature in the presence of a fundamental group
J Ebert, O Randal-Williams
– Geometry and Topology
(2019)
23,
1549
Some phenomena in tautological rings of manifolds
O Randal-Williams
– Selecta Mathematica
(2018)
24,
3835
Topology of the Electroweak Vacua
B Gripaios, O Randal-Williams
– Journal of High Energy Physics
(2018)
782,
94
Homological stability for automorphism groups
O Randal-Williams, N Wahl
(2017)
318,
534
Homological stability for moduli spaces of high dimensional manifolds. II
S Galatius, O Randal-Williams
– Annals of Mathematics
(2017)
186,
127
• 1 of 5
• >
E2.06
01223 764291 | 2020-09-26 12:54:53 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7194143533706665, "perplexity": 12245.992713246389}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-40/segments/1600400241093.64/warc/CC-MAIN-20200926102645-20200926132645-00753.warc.gz"} |
https://www.physicsforums.com/threads/magic-beans-problem.533448/ | # Magic beans problem
1. Sep 25, 2011
### scalpmaster
You have 2 bags of beans containing 10 beans each. In each bag, there 3 magic beans. How do you maximize the number of magic beans selected if you are allowed to pick 10 beans out of the 20 altogether? You can mix them if you want and do anything you want but cannot draw one at a time from each bag.
I.e. If you do not mix the bags and just pick any one bag, you know you will get a minimum of 3 magic beans out of 10 but can you achieve more?
This is not a homework.
Last edited: Sep 25, 2011
2. Sep 25, 2011
### scalpmaster
This portfolio managment problem is related to picking the best 3 performing stocks from 2 different sectors. The problem is you won't know which 6 will perform best until end of the year but you are allowed to pick 10 from 20 and you want the portfolio to include as close to all 6 best as possible. Is there a way to optimize the selection process?
i.e. You can't draw one at a time to see if it is normal or not and then pick another from the other bag because you will only know whether it is a good stock at the end of the year.
3. Sep 25, 2011
### Stephen Tashi
Are we allowed to use a "sequential decision process"? For example, on the first draw, pick a bean from bag A, if it is magic then draw the second bean from bag B. If not, draw the second bean from bag A. To define this strategy we would have to define what to do for the third, fourth.... tenth draw and consider all possible sequences of results.
We also should define what "optimize" means. The optimum strategy for maximizing the expected number of beans drawn might have a high variance. As you pointed out, we can guarantee getting 3 beans (with zero variance) by picking all ten draws from one bag.
4. Sep 25, 2011
### scalpmaster
No, you can't pick one at a time from each bag because you won't know its magic/good stock until end of the year. You have to select 10 stocks simultaneously out of 20 and optimize the selection process to trap if possible all 6 best performing stocks out of 10.
5. Sep 25, 2011
### Stephen Tashi
OK, I understand that. This still leaves open the question of what "optimize" means.
6. Sep 25, 2011
### scalpmaster
lower variance.
7. Sep 25, 2011
### Stephen Tashi
Really? Or do you mean that if two strategies give the same expected number of magic beans then the one with lower variance is defined as better?
Or are we assuming that the expected number of magic beans produced by any imaginable strategy is 3?
8. Sep 25, 2011
### scalpmaster
Lower variance would be better for 2 strategies with the same expected no. but higher expected no. is given precedence over variance. i.e. If the method can give expected no. of 6, then the variance can be as high as it can be.
9. Sep 25, 2011
### Stephen Tashi
If we believe he web, the mean of a hypergeometric distribution of magic beans is $n \frac{k}{N}$ where
$n$ is the number of draws
$k$ is the number of magic beans in the bag
$N$ is the total number of beans in the bag.
If we only consider strategies where you draw X beans from bag A and 10-X beans from bag B, the mean payoff of that strategy is
$X \frac{3}{10} + (10-X)\frac{3}{10} = 10\frac{3}{10} = 3$
Mixing all the beans in one bag and drawing 10 gives an expected payoff of
$10 \frac{6}{20} = 3$
Perhaps you have already worked this out. Have you looked at the formula for the variance of the hypergeometric distribution?
( Of course, one can think of more complicated strategies. Rigorously proving that 3 is the max payoff that can be attained using any imaginable strategy seems a formidable challenge. )
10. Sep 25, 2011
### scalpmaster
Is this analysis correct?
Bag 1 P(x) = 3/10 Bag 2 P(x) = 3/10
You have 10/10 (100 %) chances to pick 3 beans if you just focus on 1 bag...
If you focus on 2 bags combined then you have P(x) = 6/20 = 3/10.
However, your prob. of picking the magic beans drops from 100 % to 50% or 10/20 chances of actually getting the beans or 1/2...
Then your prob. of picking the magic beans combined with your chances at picking the magic beans drop significantly...
P(A*B) = 1/2*3/10 = 3/20
If you try to pick out of both bags you only have a 15 % chance of picking three beans while if you just pick from 1 bag you have a 100 % chance of picking three beans.
11. Sep 25, 2011
### scalpmaster
No, please tell me more on how to analyse the variance? Or more specifically, can you increase the variance and thus maybe increase the expected payoff?
Last edited: Sep 25, 2011
12. Sep 25, 2011
### Dickfore
If you pick from the first bag and you do not get a magic bean, then the probability of getting a magic bean from the first bag increases to $\frac{3}{9}$, while from the second bag remains $\frac{3}{10}$. Therefore, you should keep drawing from the first bag.
If, on the other hand, you selected a magic bean from the first try, then the probability for getting a magic bean from the first bag is $\frac{2}{9}$. When compared with $\frac{3}{10}$, you get:
$$2 \times 10 = 20, 3 \times 9 = 27, 20 < 27 \Rightarrow \frac{2}{9} < \frac{3}{10}$$
so you should switch the drawing from the second bag.
You should continue with a similar analysis in the remaining 9 turns.
13. Sep 25, 2011
### Stephen Tashi
No, because you are computing probabilities base on random selection "with replacement". Also, if you want to do a mathematical analysis of "expected value" you need to use the mathematical definition of expected value. This definition involves more than a single probability.
Following the formula given in the wikipedia article: http://en.wikipedia.org/wiki/Hypergeometric_distribution
Let
$N$ = total number of beans in the bag
$n$ = number drawn, $0 < n \leq N$
$k$ = number of magic beans in the bag, $0 \leq k \leq N$
$V =$ variance of the number of magic beans drawn
Then
$V = n \frac{k}{N} \frac{N-k}{n} \frac{N - n}{N -1}$
If we draw independently from two different bags the variance of the total number of magic beans drawn is the sum of the variances of the numbers that are drawn from each of the bags.
Suppose we make n draws from bag A and 10-n draws from bag B.
Then the total variance is $V = n \frac{3}{10} \frac{7}{n} \frac{10-n}{9} + (10-n)\frac{3}{10}\frac{7}{10-n}\frac{10-(10-n)}{9}$
The variance from drawing 10 beans from a bag of 20 that contains 6 magic beans is
$V = 10 \frac{6}{20}\frac{14}{10}\frac{10}{19}$
14. Sep 25, 2011
### scalpmaster
Thanks. So the variance is a fixed number and can't be increased?
15. Sep 25, 2011
### Stephen Tashi
Fixed with respect to what? Yes, for one jar, it's fixed if we are given the number of beans in the jar, the number of magic beans in the jar and the number of draws.
If you look at the formula for the variance for drawing for two jars, it changes if you change n.
16. Sep 26, 2011
### bpet
Aside: is Prob(6 found) maximized by taking 5 from each bag?
17. Sep 26, 2011
### D H
Staff Emeritus
That is an illegal scheme per the rules of this problem. As I take it, the only allowed scheme is to pick some number n between 0 and 10 inclusive, then randomly draw n beans from bag A, 10-n beans from bag B all without looking. If this is correct, any allowed scheme will have an expected value of 3. So the question boils down to ...
Other than your say-so, scalpmaster, (and it is your problem, so your say-so does have some weight), what makes this "optimal"? You are implicitly assuming a risk averse point of view. Given that all options have the same expected value, the option that maximizes the variance may well be seen as "optimal" to someone who is risk tolerant.
18. Sep 26, 2011
### scalpmaster
So, how would You maximize the variance for one who is risk tolerant?
19. Sep 26, 2011
### Stephen Tashi
D H,
I have a more liberal interpretation. My interpretation would allow "crazy" strategies like "Pick 3 beans from bag A and 4 beans from bag B and put them in a third bag C. Draw your ten beans by picking 4 beans from bag A, 4 beans from bag B and 2 beans from bag C." Intuitively, no amount of remixing of the beans will improve the expected value, but I am very curious how one would rigorously prove that.
scalpmaster,
To maximize the variance of the two-bag strategy described above, use the formula for V and pick the value of n that makes V largest. I leave the arithmetic to you
20. Sep 26, 2011
### D H
Staff Emeritus
That second fraction on the right should be $\frac{N-k}{N}$ rather than $\frac{N-k}{n}$, resulting in
$$V = n \frac k N \frac {N-k} N \frac {N-n} {N-1}$$
If you draw nothing (n=0), the odds of winning are 0, with zero variance ("if you don't play you can't win"). The corrected formula yields a variance of zero for n=0 and for n=N.
Corrected: $V = n \frac 3{10} \frac 7{10} \frac{10-n} 9 + (10-n) \frac 3{10} \frac 7{10} \frac {10-(10-n)} 9$
Corrected: $V = 10\frac{6}{20}\frac{14}{20}\frac{10}{19}$ | 2018-12-16 21:58:53 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8079867362976074, "perplexity": 857.3365311313354}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-51/segments/1544376827998.66/warc/CC-MAIN-20181216213120-20181216235120-00515.warc.gz"} |
https://byjus.com/physics/electromagnetic-waves/ | # Electromagnetic Waves
## What are Electromagnetic Waves?
• Electromagnetic waves are nothing but changing magnetic and electric fields.
• Electromagnetic waves are solutions of Maxwell’s equations, which are the fundamental equations of electrodynamics. He described that the magnetic field can be produced by changing electric field.
## How are Electromagnetic waves formed?
• Generally, an electric field is produced by a charged particle. A force is exerted by this electric field on other charged particles. Positive charges accelerate in the direction of the field and negative charges accelerate in a direction opposite to the direction of the field.
• The Magnetic field is produced by a moving charged particle. A force is exerted by this magnetic field on other moving particles. The force on these charges is always perpendicular to the direction of their velocity and therefore only changes the direction of the velocity, not the speed.
• So, the electromagnetic field is produced by an accelerating charged particle. Electromagnetic waves are nothing but electric and magnetic fields travelling through free space with the speed of light c. An accelerating charged particle is when the charged particle oscillates about an equilibrium position. If the frequency of oscillation of the charged particle is f, then it produces an electromagnetic wave with frequency f. The wavelength λ of this wave is given by λ = c/f. Electromagnetic waves transfer energy through space.
### Graphical Representation of Electromagnetic Waves:
Electromagnetic waves are shown by a sinusoidal graph. It consists of time-varying electric and magnetic fields which are perpendicular to each other and are also perpendicular to the direction of propagation of waves. Electromagnetic waves are transverse in nature. The graph is as shown below:
### Mathematical Representation of Electromagnetic Wave:
A plane Electromagnetic wave travelling in the x-direction is of the form
$E(x,t)=E_{max}\cos (kx-\omega t+\Phi )$
$B(x,t)=B_{max}\cos (kx-\omega t+\Phi )$
In the electromagnetic wave, E is the electric field vector and B is the magnetic field vector.
Maxwell gave the basic idea of electromagnetic waves, while Hertz experimentally confirmed the existence of electromagnetic wave.
The direction of propagation of the electromagnetic wave is given by vector cross product of the electric field and magnetic field. It is given as:
$\vec{E}\times \vec{B}$.
### Electromagnetic Wave Equation:
• Electromagnetic wave equation describes the propagation of electromagnetic waves in a vacuum or through a medium.
• The electromagnetic wave equation is a second order partial differential equation.
• It is a 3D form of the wave equation.
• The homogeneous form of the equation is written as,
$(\upsilon ^{2}_{ph}\bigtriangledown^{2}-\frac{\partial^2 }{\partial t^2})E=0$
$(\upsilon ^{2}_{ph}\bigtriangledown^{2}-\frac{\partial^2 }{\partial t^2})B=0$
Where,$\upsilon _{ph}=\frac{1}{\sqrt{\mu \epsilon }}$
### Intensity of an Electromagnetic Wave:
$I=\frac{P}{A}=\frac{1}{2}c\epsilon _{0}E_{0}^{2}\\ \\ =\frac{1}{2}\frac{c}{\mu _{0}}B_{0}^{2}$
### Speed of Electromagnetic Waves in Free Space:
It is given by $C=\frac{1}{\sqrt{(\mu _{0}\epsilon _{0})}}$
Where,
$\mu _{0}$ is called absolute permeability. It’s value is $1.257\times10^{-6}TmA^{-1}$
$\epsilon _{0}$ is called absolute permittivity. It’s value is $8.854\times 10^{-12}C^{2}N^{-1}m^{-2}$
C is the velocity of light in vacuum = velocity of electromagnetic waves in free space = $3\times 10^{8}ms^{-1}$
## Electromagnetic Spectrum:
Electromagnetic waves are classified according to their frequency f or according to their wavelength $\lambda =\frac{c}{f}$.
Wavelength ranges of different lights are as follows,
For visible light – approx. 400 nm to approx. 700 nm
For violet light – approx. 400 nm
For red light – approx. 700 nm
For more insights, stay tuned with BYJU ’s and fall in love with learning.
#### Practise This Question
Which of the following are not electromagnetic waves | 2018-11-18 06:17:01 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6600678563117981, "perplexity": 314.85843329816015}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-47/segments/1542039743968.63/warc/CC-MAIN-20181118052443-20181118074443-00325.warc.gz"} |
https://chemistry.stackexchange.com/questions/40729/is-khf2-an-ionic-compound-or-a-covalent-compound | # Is KHF2 an ionic compound or a covalent compound?
The statement below is an excerpt from my school textbook:-
Because of the tendency of fluorine to form hydrogen bond, metal fluorides are solvated by $\ce{HF}$ giving species of the type $\ce{HF2-}$ like in $\ce{KHF2(KF.HF)}$. Also, because of hydrogen bonding, $\ce{HF}$ dimerises to $\ce{H2F2}$ and exhibits dibasic nature and forms acid salt like $\ce{KHF2}$ on reacting with $\ce{KOH}$ whereas $\ce{KHCl2}$ does not exist because chlorine does not form hydrogen bond.
But since $\ce{K+}$ is a cation and $\ce{HF2-}$ is an anion, it can easily form the ionic bond $\ce{K+HF2-}$. So, is KHF2 an ionic compound $\ce{K+HF2-}$ or a covalent compound $\ce{KHF2(KF.HF)}$?
• Understand that the $\ce{KF}$ part of $\ce{KF.HF}$ is an ionic compound and only the $\ce{F-}$ somehow interacts with $\ce{HF}$ and the question answers itself. – Jan Nov 14 '15 at 17:24
I found this question very intriguing and while I support both answers by Ivan and Mithoron, I would like to add a little more insight.
When we consider compounds, we often tend to describe them as ionic or covalent. And often we can find both of these types in quite common molecules. We use these terms quite liberal, and when we talk about an ionic bond we usually mean a bond, that has predominantly ionic character, while a covalent bond has a predominantly covalent character.
Even in simple binary salts like sodium chloride we will not find the ideal ionic bond, and even methane the bond is not purely covalent. The truth - as always - lies somewhere in between.
What does that mean for potassium bifluoride? In this case it is especially difficult to classify the compound. This is less due to the potassium fluoride interaction, but to the interactions within the bifluoride subunit.
From the crystal structure itself one can clearly see, that there are not $\ce{KHF2}$ molecular units crystallising, but bifluoride ions in a lattice of potassium ions. The crystal structure itself is describes as follows.[1]
It may be regarded as an ammonium chloride arrangement of potassium atoms and fluorine dumb-bells.
This clearly speaks to the predominantly ionic nature of the potassium fluorine bond. To gain further insight into the topic I ran a couple of quantum chemical calculations.[2] Unfortunately I was unable to find a file with the crystal structure to run calculations on and I did not have the time to accurately reconstruct it from the parameters. Instead I would like to demonstrate on the example of $\ce{KF}$ how an (predominantly) ionic bond looks in the representation of the quantum theory in atoms in molecules (QTAIM).[3] The electron density at the bond critical point is very low with $\rho(\text{BCP})=0.053~\mathrm{e\, a.\!u.^{-3}}$ and the second derivative at this point is positive, $\nabla^2\rho(\text{BCP})=+0.288~\mathrm{e\, a.\!u.^{-3}}$.
These are criteria which we use to characterise a mostly ionic bond. The compound $\ce{KF}$ can be regarded as (one of) the most ionic compound,[4] so we can compare these values with values of other compounds.
Let's look at a covalent bond, before we look at the bifluoride ion. In this example I chose $\ce{HF}$ as it is related to it. Here we find a completely different picture. The electron density at the bond critical point is a lot larger, $\rho(\text{BCP})=0.366~\mathrm{e\, a.\!u.^{-3}}$ and the second derivative at this point is negative, $\nabla^2\rho(\text{BCP})=-2.858~\mathrm{e\, a.\!u.^{-3}}$. In the graphic one can see that there is charge accumulation along the bond path. All these criteria suggest, that this is a predominantly covalent bond.
When we do now look at the bifluoride ion, $\ce{[F-H-F]^-}$, we will see some intermediate bond, where it is hard to tell, which character is predominant. Note that due to symmetry reasons, we only need to look at one bond critical point. On the one hand we have a somewhat high electron density $\rho(\text{BCP})=0.177~\mathrm{e\, a.\!u.^{-3}}$ and the second derivative at this point is still significantly negative, $\nabla^2\rho(\text{BCP})=-0.416~\mathrm{e\, a.\!u.^{-3}}$. On the other hand we also see that the charge accumulation is not constant between the bonding partners, it is separated by an area where the Laplacian becomes positive, which indicates some ionic character.
So in this case it is quite hard to tell if we are talking about a covalent bond with high ionic character or an ionic bond with high covalent character. But to be perfectly honest here, this is the case with many hydrogen bonds.
I expect that these findings are comparable to the alkali metal bifluorides, which are all known up to at least caesium.[5]
Notes and References
1. Richard M. Bozorth, J. Am. Chem. Soc. 1923, 45 (9), pp 2128–2132.
2. Gaussian 09 Rev. D1; DF-BP86/def2-TZVPP; AIMAll 13.11.04;
3. The depicted QTAIM plots are the Laplacian distribution within the molecule. Solid blue lines indicate charge depletion $∇^2ρ>0$, dashed red lines indicate charge accumulation $∇^2ρ<0$, red spheres are bond critical points, solid black lines are bond paths, dark red lines are zero flux surfaces (these separate the atoms).
4. Why is KF the most ionic compound? (Chemistry.se)
5. R. Kruh, Keiichiro Fuwa, T. E. McEver, J. Am. Chem. Soc. 1956, 78 (17), pp 4256–4258.
• What does it take to get lithium bifluoride? Article says this is unstable in ambient conditions. – Oscar Lanzi Aug 26 '18 at 20:29
Yes, $\ce{KHF2}$ is an ionic compound and a covalent compound. There is nothing exceptional about it; in fact, most compounds that we call ionic (not $\ce{NaCl}$, though) have covalent bonds in them. Consider $\ce{MgSO4}$ with ionic bonds between $\ce{Mg^2+}$ and $\ce{SO4^2-}$, and covalent $\ce{S-O}$ bonds within $\ce{SO4^2-}$. Consider $\ce{Na2CO3}$ with similar $\ce{C-O}$ bonds. These are the ways of the world.
$\ce{KHF2}$ is an ionic compound with cation $\ce{K+}$ and anion $\ce{HF2-}$, and writing $\ce{KF.HF}$ doesn't suggest covalent bond between K and F, but say that $\ce{HF2-}$ anion is adduct of F- anion and HF molecule.
The bifluoride anion is quite interesting as its bond is not only a rare symmetric hydrogen bond, but also the strongest hydrogen bond known. All hydrogen bonds have some covalent character, but here it can be estimated as $50\%$, reflecting its mesomeric structures:
$$\ce{^-F\bond{...}H-F <-> F-H\bond{...}F-}$$
These also mean that it is a so-called 3-center 4-electron bond. | 2019-07-20 20:32:48 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6659187078475952, "perplexity": 957.9917833792466}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195526670.1/warc/CC-MAIN-20190720194009-20190720220009-00414.warc.gz"} |
http://openstudy.com/updates/51c1149ae4b0a49e8c8fa095 | ## burhan101 2 years ago What is the first value of of t greater than zero for which the derivative is greater than zero?
1. burhan101
$\huge f'(x)\frac{ sintcost }{ 25 \pi }$
2. burhan101
f'(x)= **
3. SmoothMath
Uh... there's no "first" value.
4. burhan101
that's what my question states :S
5. burhan101
Are they asking to solve for t, equation the derivative to zero?
6. SmoothMath
At t=0, the derivative will be 0. For 0<t<$$\frac{\Large\pi}{2}$$ the derivative will be positive because sin and cos will both be positive.
7. primeralph
$T = 0 + \left| \delta t \right|$ | 2015-09-01 12:13:13 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5715985298156738, "perplexity": 3055.3827120382853}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-35/segments/1440645176794.50/warc/CC-MAIN-20150827031256-00182-ip-10-171-96-226.ec2.internal.warc.gz"} |
https://yptg.auto-i-moto.pl/overleaf-empty-bibliography.html | Lengths. Lengths are units of distance relative to some document elements. Lengths can be changed by the command: \setlength{\lengthname} { value _ in _ specified _ unit } For example, in a two-column document the column separation can be set to 1 inch by: \setlength{\columnsep} { 1in } Below is a table with some of the most common lengths and .... . An online LaTeX editor that’s easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.. An online LaTeX editor that’s easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.. Hello all, I'm quite new to LaTeX, but working with a template for my doctor's thesis (medicine). My university provides citation style files for EndNote and Citavi, which I tried to use to create a custom bibtex style file (.bst) using makebst. "/> Overleaf empty bibliography pizzazz book d answer key
# Overleaf empty bibliography
## uphold stole my money
sample letter of explanation for buying second home
## siemens 150 mw gas turbine
LaTeX warning:Empty thebibliography' environment on input line 3. In this case, there are none, so the bibliography environment was empty. Use these statements on Overleaf to successfully generate Reference, but local compilation is not compiled, while using pdflatex -> bibtex -> pdflatex * 2 or Xelatex -> BibTex -> Xelatex * 2 Recipe will. Search: Latex Change Math Font Size. Create a display object given raw data "Text can be added to Jupyter Notebooks using Markdown cells PyLaTeX is a Python library for creating and compiling LaTeX files or snippets The name should be unique so that you can determine what it does without having to refer to the description This tutorial will let you create a simple resume in LaTeX in order to. Print bibliography: Empty bibliography. Ask Question. Asked 8 months ago. The warning message when not citing in the text is LaTeX Warning: Empty bibliography on input line 16. I'm writing in Overleaf and my bibliography is not printing. I have a references.bib file that I... Empty bibliography on input line 46. There were undefined references. There is a nhspace{1in} before this. \begin{description}Description list. In Latex, each list is defined by thein latex latex itemize decrease space between line spacing in overleaf overleaf itemize spacing latex table line spacing insert horizontal spaces manually latex how to change space between lines in latex latex 1. The bibliography is added with \printbibliography and uses the file report.bib by default. See here for more details; \appendix uses letters for the chapter numbering. Two chapters with an example with source code and a task division have been included respectively and can be found in the appendix folder. # Cover and Title Page. Search: Latex Change Math Font Size. Articles uncountable worksheets math problems A GNU Emacs major mode for convenient plain text markup — and much more \textstyle is used to go back to normal size font for inline formulas Проект имеет несколько стабильно работающих серверов игры, а так же сервер TeamSpeak3 makes that a makes.
Search: Latex Remove Whitespace. Connect with friends, family and other people you know Now, you can format the lines the way you want without the extra spaces A new paragraph is indicated by a blank line in your input file, so don’t leave any blank lines unless you really wish to start a paragraph One way to minimize the white space when saving or copying the contents of a plot is to use .... Automatic typesetting of bibliographies within the Overleaf window: no need to separately compile bibliography (.bib) files. ... Open up a blank thesis template on the Overleaf site, then click on Project at the top of the screen. A green box labeled “Download as ZIP” will show up in the left column, and you can choose which types of files. If you're thinking of multiple bibliographies tied to some part of your document (such as the chapters within the document), please see bibliographies per chapter. For more than one bibliography, there. The Overleaf template allows journal authors to write, edit, and collaborate online. Template for submissions to Elsevier journals using the elsarticle. ... so they don’t need start from a blank canvas. it also contains elsarticle-ru class file and elsarticle-harv-ru bibliography style file that is russian translation ofI actively use TeX. Markdown ===== [](LICENSE) [ inside text. \ [ \int_ {a}^ {b} x^2 \,dx \] | 2022-08-09 08:42:47 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8084473609924316, "perplexity": 4025.042628442826}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882570913.16/warc/CC-MAIN-20220809064307-20220809094307-00012.warc.gz"} |
http://tex.stackexchange.com/questions/77831/indenting-footnotes-in-context?answertab=oldest | # Indenting footnotes in ConTeXt
How to modify
``````\footnote
``````
in ConTeXt, such that the complete footnote is indented?
-
By default footnotes are not indented. Can you add a complete minimal example that demonstrates your problem? – Marco Oct 16 '12 at 7:44
I am not sure, what you are asking for. Yes, footnotes are not indented, but I want them to indent. I think I should modify \setupfootenotes. Of course I can add a minexample (any footnote), if needed. Edit: Ok, my question could be misunderstood: I know there is no indentation, no complete and no first line, but Im looking for that (complete) indentation. Thats the question. – Mustafa Oct 16 '12 at 7:48
Sorry, I misread the question. I thought you asked how to get rid of the indentation. So you want the entire footnote to be shifted or only the first line? – Marco Oct 16 '12 at 7:52
Footnotes respect the indenting parameter: `\setupnotation[footnote][indenting={small,yes}]`. – phg Oct 16 '12 at 7:58
Yes, I want the entire footnote to indent. @phq: This does not work, no indentation of the footnote, where I have to place the \setupnotation? – Mustafa Oct 16 '12 at 8:11
I'm not quite sure how you want your footnotes to look like and what to indent. You find further information on the Wiki - Footnotes.
Use the `\setupnotation [footnote]` command to adjust the layout, here are some examples.
``````%% left align the footnote number and shift the footnotes
\setupnotation
[footnote]
[alternative=left]
%% indents the entire footnote by 2em and the number by 1em
\setupnotation
[footnote]
[alternative=left,
width=2em,
numbercommand=\hskip1em]
%% left align the footnote number, which practically indents the
%% first line
\setupnotation
[footnote]
[alternative=left,
hang=1]
%% Indents the first line inclusive the footnote number
\setupnotation
[footnote]
[alternative=left,
numbercommand=\hskip1cm]
%% Indents all footnotes and right-aligns the number
\setupnotation
[footnote]
[alternative=left,
width=2em]
``````
Full example:
``````\setupnotation
[footnote]
[alternative=left,
hang=1,
numbercommand=\hskip1cm]
\starttext
Lorem \startfootnote
\input ward
\stopfootnote
Ipsum \startfootnote
\input ward
\stopfootnote
\stoptext
``````
-
That works, but I want to indent the entire footnote, not only it's first line. In LaTeX that is \deffootnote{2em}{2em}{\textsuperscript{\normalfont \thefootnotemark} } – Mustafa Oct 16 '12 at 8:17
The footnote number as well? – Marco Oct 16 '12 at 8:23
Yes, everything (f.e.) 2em to the right. – Mustafa Oct 16 '12 at 8:25
Something like `\setupnotation[footnote][alternative=left,width=2em,numbercommand=\hskip1em]`? – Marco Oct 16 '12 at 8:30
`numbercommand=\hskip1.6em\high` – Marco Oct 16 '12 at 8:49 | 2014-11-25 22:26:55 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8996372222900391, "perplexity": 3867.7769554581346}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-49/segments/1416931004237.15/warc/CC-MAIN-20141125155644-00068-ip-10-235-23-156.ec2.internal.warc.gz"} |
http://meta.stackexchange.com/questions/48694/blacklist-for-display-names/48697 | # Blacklist for display names
I just noticed a(n unregistered) user on Super User who'd set his/her/its display name to the famous four-letter English word for "fecal matter".
I've manually edited the offending display name to something G-rated (...I think...), but I don't really have any means, short of suspension, of preventing the user from changing it back.
Perhaps a blacklist for display names is in order?
(Diamond moderators can check the list of recent annotations for a direct link to the user.)
-
Was it "Beck" or "Rush"? And do they really translate outside of the US? – random May 4 '10 at 10:43
@random: spotted another one using the acronymized form of the name of a Van Halen album. (also, say what you want about Beck, but you better watch what you're callin' Rush. :) – quack quixote May 4 '10 at 10:49
The only problem with this I can see is that apparently innocuous words in one language can be a swear word in another. It would be an ever growing list. – ChrisF May 4 '10 at 11:01
yeah, that does get into some thorny how-do-you-tell issues. the only alternative i can think of is to periodically do a manual sweep... or maybe an automated-report-emailed-to-the-mod-teams. hmm. – quack quixote May 4 '10 at 11:10
Maybe his name is Steven Hit? – balpha May 4 '10 at 11:13
Jeff hasn't implemented the tag black list yet and you ask for one more? – Ladybug Killer May 4 '10 at 11:13
@balpha: with an email of f---@f---.f---? yeah, i'm gonna go with "probably not". – quack quixote May 4 '10 at 11:15
SO accepts E-Mail addresses from the .f--- tld? – Pëkka May 4 '10 at 13:20
@Chris: to that I'd say that since English is the language of choice for the trilogy, that's what the list should bounce against. – squillman May 4 '10 at 14:30
@squillman: what about words in other languages that sound offensive to someone in English? – perbert May 4 '10 at 15:11
@voyager: I know where you're going, and I agree with you. I'm just saying that IF any kind of blacklist were to employed that it should work against the English dictionary, as it's been made clear that the official language for the trilogy communities is English. – squillman May 4 '10 at 15:30
Maybe his name is Steven Henry Ian Thompson. Must be hard going through life. – smci May 2 '12 at 9:46
We already have a regex blacklist for global terms on the site, and there is a username category.
We wouldn't attempt to put curse words in it, though, right now it just has certain patented pharmaceutical names in the form \bfoo\b which are very unique and unlikely to ever conflict.
-
Any chance of adding that mythical tag blacklist/whitelist? – alex May 7 '10 at 7:13
I'm against any kind of automated blacklist.
See the Consbreastution of USA and I'm going to insert my long necked Giraffe in your fluffy bunny.
May be an auto flagging system for notification of mods, so they can check it case by case, but I'd fear that they (you) would feel compelled to use it for increasingly innocuous words.
Remember, I get offended by people and the word compassion. Would I have to change a Red avatar? A white one? If my name was pelotudo? John Fuk?
This case is probably just a kid, but on other cases it might be not so clear cut.
-
+1 just for that quote – Earlz May 4 '10 at 17:09
That sort of stuff is known as the Scunthorpe problem - which by now has really become a clbuttic sort of mistake: en.wikipedia.org/wiki/Scunthorpe_problem – Michael Madsen May 4 '10 at 19:37
There are a surprising number of individuals in America who have names that aren't simply words with curse words embedded within, but standalone curse words. John Fuk is a good example, but I've seen the same name with the proper spelling. Usually, these types of names get rejected by whoever issues the birth certificate, but sometimes they slip through. – crush Jan 9 '14 at 14:39
I'm against any kind of automated black list. I think moderators are the best approach to dealing with such circumstances, since they are better able to interpret "appropriate" names than some script would be. Some examples:
• Consider a poor, unfortunate fellow with the moniker "Richard Head". He may actually choose (for some reason) to go by "Dick Head", so shouldn't he be allowed to use that as a display name?
• In the same vein as the above, there's "The Dick Swett Incident". Yes, real people actually have names like this.
• The name "Philip Oliver Holes" is likely not to trigger any automated filters, but would probably be construed as sounding somewhat inappropriate (for those not getting it, sound it out... it would be a good porn star name).
-
Let us not forget the infamous Charlotte Greene "Jack Tuat" incident on BBC Radio 4 - see en.wikipedia.org/wiki/Charlotte_Green – nb69307 May 4 '10 at 18:29
@Neil: not to go any further, there were some misunderstandings not so long ago for a word that I didn't even know could be perceived as an insult. Even after googling it, I don't understand how you could feel aggravated by it. – perbert May 4 '10 at 18:53
There was a teacher at my old high school named Richard Hohl. Yeah, that's "Dick Hole." – Carson Myers May 4 '10 at 20:45
@Carson: A friend of mine had a high school teacher named Dick O'Dour. He insisted it was pronounced "oh door", but kids being kids, they pronounced it "odor". – gnostradamus May 4 '10 at 21:28
that's priceless – Carson Myers May 5 '10 at 19:21
I think we should have a blacklist for the obvious ones (which of course can't be shown here as examples). It will still take moderator intervention for the edge cases, but at least the moderators won't have to deal with every situation directly.
-
Maybe a list with 5 - 10 no-question-about-it words. I mean there are some words nobody can come up with a proper reason to use.
Then, as mentioned, the mod community can clean up any remaining problems.
-
if SO doesn't censor BrainF*ck, then why bother about user names?
-
– perbert May 4 '10 at 20:59
in that case, censor away! – Steven A. Lowe May 5 '10 at 0:54 | 2015-07-28 16:04:46 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4207746684551239, "perplexity": 4480.715734821444}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-32/segments/1438042981969.11/warc/CC-MAIN-20150728002301-00100-ip-10-236-191-2.ec2.internal.warc.gz"} |
https://dougo.info/building-a-passive-income-portfolio-the-best-passive-income-opportunities.html | It was easier recouping the lost $60,000 in rental-property income than I expected. For so long, my primary mindset for passive income was rental income. Having$815,000 less mortgage debt but still generating roughly the same amount of passive income with a much larger cash balance feels great. Further, my passive-income portfolio got even more passive, which is good as a stay-at-home dad to a newborn.
Hi, in as much as the article in this blog appears to be a source for information for us folks who are perhaps a little older (and wiser) would it be possible to point a person who is extremely sceptical about earning extra income.. other than worked 9-5 for? ( that person of course is me). Who now in a few years should be retiring, problem is, no money there to retire on. So a second source of income/investing is critical to my wife and I.
Sell an eBook Online – Self Publishing is mainstream today. When you purchase an eBook off of Amazon there’s a pretty good chance you’re buying a self-published book. Self-publishing is also ridiculously easy. I tried this a few years ago and couldn’t believe how simple the process was. To self-publish a book you’ll first need to write and edit it, create a cover, and then upload to a program such as Amazon’s Kindle Direct Publishing. Don’t expect instant success though. There will need to be a lot of upfront marketing before you can turn this into a passive income stream.
I have not. While I am intrigued with the possibility of making online income, it seems to be less passive then how I want to spend my time. Regarding your blog / site, you have done quite well for yourself. However, you have to keep pumping out content or your site would eventually go out of business. That sounds like more of a commitment then I would want. Regarding your book sales, it is probably relatively passive now, but certainly was not when you were writing the book. Now if you love it, great. Just not for me.
This equation implies two things. First buying one more unit of good x implies buying {\displaystyle {\frac {P_{x}}{P_{y}}}} less units of good y. So, {\displaystyle {\frac {P_{x}}{P_{y}}}} is the relative price of a unit of x as to the number of units given up in y. Second, if the price of x falls for a fixed {\displaystyle Y} , then its relative price falls. The usual hypothesis is that the quantity demanded of x would increase at the lower price, the law of demand. The generalization to more than two goods consists of modelling y as a composite good.
###### After many years I finally achieved FI and my dividend portfolio basically covers my living expenses. My wife still works in wealth management and I also help her grow her client base. Just about to release a book that I co-authored called Victory Lap Retirement which will be a new source of income. Also plan on doing public speaking and seminars in support of the book which will be an additional new source of income. I will also be creating a Victory Lap website and blog to help sell the book and hopefully over time create a VL community. I will not advertise as I do not want to commit to when I have to produce a blog. I worked hard to get FI and I don’t want to give my freedom back by forcing myself into a set schedule if that makes sense. So basically I will end up with 5 sources of income including ss and most of them are aligned with my passion play. Not a bad way to go out.
John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Selena Maranjian owns shares of Amazon, Costco Wholesale, National Grid, Realty Income, and Verizon Communications. The Motley Fool owns shares of and recommends Amazon, eBay, National Grid, and Verizon Communications. The Motley Fool recommends Costco Wholesale, Lowe's, The TJX Companies, and Welltower. The Motley Fool has a disclosure policy.
### How to Monetize: Affiliate marketing works well when you discuss products on your blog. For our fish tank blog, we would link to all the things you need to buy for an aquarium and then when people click on that link and buy that item (and other items they purchase with it with some exceptions) you get a percentage of the purchase. Amazon Associates is the best-known affiliate marketing program, but there are others like Impact Radius, ShareASale, Commission Junction, ClickBank and Rakuten too.
The Country Partnership Framework (CPF) FY18-FY22 builds on the progress achieved by Ethiopia during the past five years. The CPF was developed after intensive consultations with a wide range of stakeholders to gain a broad-based perspective on the WBG’s performance and development priorities. The CPF is a result-based strategy, firmly anchored in the government’s Second Growth and Transformation Plan (GTPII).
Freelancing is basically a kind of work where people are self-employed as they take projects and some piece of work from some company or person but they are not the part of that company or organization. As opposed to a regular salary job where the payments are fixed and monthly, freelancing projects/assignments are paid per case basis. Hence a freelancer is not supposed to work full time for the company/person, instead they just need to finish only a specific task. Freelancing can be a full-time career for many professionals. And the most amazing part of freelancing is that it is not limited to a particular domain, from content to coding, freelance jobs are available in every domain. In India, Freelancing is not considered as a highly paid job, but that’s not true. Your earning capacity depends on your quality and quantity of work. If you want to earn more apart from your full-time salaried job, freelancing can be a great option for you. There are many online websites where you can find a freelancing job. You just need to give time to select and get a good project/assignment.
I don’t really know much about those…I should take a look from a diversification standpoint. If you don’t mind me asking, what do you target for your net effective tax rate on your passive income? Also, I’m sure you’ve probably covered this somewhere, but how do you deal with healthcare? One more dumb question…have you found that you spend more or less money than you anticipated once you retired?
Your articles are so in-depth and helpful, I’ve never seen anything quite like it. I am a 22-yr old finishing my last semester of college, studying Computer Science and Psychology. I’m in a really good place with my finances (2k savings, no student debt, only expenses essentially rent, groceries, and utilities) and I want to get ahead financially so I can pay my parents back and save up a lot.
Creating multiple streams of income does not man get a second job to supplement your current income. A second job does not provide you with the flexibility and freedom to increase your income. In fact, it can hurt you when you think about it. You are trading time for money and in the long run, you lose. Instead, create something that will allow you to give yourself a pay raise when you need and want it.
Speaking of credit cards, if you don't use them to rack up debt, you can instead use them to generate income streams for you -- via their cash-back or rewards programs. Some cards offer flat-rate cash-back percentages up to about 2%. Others target certain kinds of spending or certain retailers. If you spend a lot at Amazon.com, for example, you can get a card that rewards you with 5% cash back there -- which can really add up. (It's not hard to spend $250 per month at Amazon, which is$3,000 per year -- enough to earn $150 back.) There are a lot of article sites out there that share revenue, but my favorite (and it’s where I earn most of my article writing income) is InfoBarrel, which you’re very familiar with if you’ve been following my blog for awhile. If you’re up for a very ambitious challenge, you can read about the one I wrote for earning$2,000+ per month with article writing. The top InfoBarrel writers currently earn at least $2,000 per month. We had a few property managers, but I wasn’t happy with their work. They didn’t really paid much attention to our properties and the tenant had a tendency to do whatever they wanted to. One tenant built a tree house at our old 4-plex. We didn’t find out about it until the neighbor sent a letter of complaint. If you have a good property manager, then keep them! 4. Focus first on passive income streams that you create once but they continue to generate income. For example, writing a book is a passive income stream. You write it once and sell it over and over. The word passive is a little deceptive because you need to market the book. Nevertheless, compared to non-passive sources of income, which you need to do over and over to make money, such as providing a service, passive income streams require less time once they’re created. Other forms of passive income include other written works (i.e. courses), audio or video creations, affiliate marketing, licensing your idea, franchising, or continuity programs (i.e. memberships). Vending machines are not completely passive but are similar to being a real estate investor with lower stakes. The key to making these successful is to get high value locations and negotiate good deals with the people who own those locations. You need to decide which machines you want to run, get the necessary licenses to operate them (you're selling items so you need to get sales licenses and whatnot from your state), buy the machines and a truck for the items in the machines, find a supplier of the products, and then finally you can secure locations. Finally, you need to service them periodically or hire someone to service them. First: I understand why you would say that such investments are restricted to only accredited investors, because generally, that’s true. There are means, under federal securities regulations and Blue Sky laws in each state, to sell interests to non-accredited investors – but usually those means are so heavily regulated and involve disclosures so similar to cumbersome registration requirements that it is not worth it for the seller to offer to non-accredited investors. Another source of income (or at least revenue) can be selling things you no longer use. When we go through our closets and drawers, I tend to find a lot I can do without. Some goes to Goodwill / Salvation army / Habitat Restore (tax deduction = income), some is resold on Amazon or eBay, some goes to the trash. I’m not sure if reselling something you paid more for should really count as income, but it’s money in the door, or less money out as is the case with donations. In the runup to the Second World War, the United States had suffered through the Great Depression following the Wall Street Crash of 1929. Roosevelt's election at the end of 1932 was based on a commitment to reform the economy and society through a "New Deal" program. The first indication of a commitment to government guarantees of social and economic rights came in an address to the Commonwealth Club on September 23, 1932 during his campaign. The speech was written with Adolf A. Berle, a professor of corporate law at Columbia University. A key passage read: Affiliate marketing is the practice of partnering with a company (becoming their affiliate) to receive a commission on a product. This method of generating income works the best for those with blogs and websites. Even then, it takes a long time to build up before it becomes passive. If you want to get started with affiliate marketing check out this great list of affiliate marketing programs. Highly-paid professionals (like doctors) should definitely be looking into multiple streams of income. In fact, more than anyone, we are in the best position to accelerate our growth towards financial freedom. We’re able to earn the necessary capital and immediately throw that money into creating additional streams very quickly. We just have to be strategic about it. Keep your expenses in check, and be disciplined about moving your earned income from your day jobs and straight into the money-making machines. There is a balance to be had here. You just have to figure out exactly where it is for you. Good suggestions. I have many of these. One word about the “app” idea. I had a great idea related to personal taxes that I tried to get off the ground with my accountant as a partner. I would say it’s difficult to do this unless you have a coder on your team. Hiring someone is not really viable financially unless the app is simple. When we finally got the quote for a coder to write what we wanted (and after doing lots of mock ups ourselves and getting a demo for investors) the estimate was about 750k just to really get started. ### I am 30 years old and am retired. Previously, I made a modest salary as an Army officer. I own three duplexes and a quadplex in central Texas (10 rental units in all), and each of the properties provide me with net rental yields in excess of 15%. The last deal is actually an infinite return as my partner paid the down payment in return for a 50/50 split on a property that would otherwise provide a net rental yield of 18%. The above net rental yields also factor in an excellent property management team who manages my properties while I pursue other investment opportunities. To date, I have never interacted with any of my tenants nor have I ever had to personally deal with any maintenance issues. Thanks for the info…I kind of figured it is really not that expensive to live if you are not an extravagant person. I could definitely figure out how to funnel expenses through a part time business…I think I keep thinking along the lines that I’m going to be paying the same tax rate after retirement, but reality is you could get pretty lean and mean if one focused on it. On a scale of 1-10 with 10 being utter panic mode, how worried are you about your “pile” lasting through a 50 year retirement now that you are a couple years into it? Great breakout of some common items that are (mostly) accessible to individuals. My biggest issue with p2p is the ordinary interest it generates and the ordinary tax that we have to pay. That really takes a bite out of the returns. Fortunately, I opened an IRA with one of the providers to juice the return with zero additional risk. 6-8% nominal returns over a long period of time will make me very happy. It should end up as 5-7% of the portfolio anyway, so nothing too significant. If you have an empty house or room you can rent it out on AIRBNB and OYO Rooms. Many travelers are looking to spend one night at a place. You can always rent out your empty house or room to them. All you need to do is list your room or house online, explain the rules and you are good to go. Travelers will pay you online. This way you don’t have to search for clients. They will come to you. Now I’ve been using Swagbucks for a while and have found the money works out to just under$2 an hour so this isn’t something that’s going to make you rich. You’d have to work 2,500 hours to make \$5,000 so that’s about three and a half months, non-stop. The thing with Swagbucks though is you can do it when you’re doing something else so I flip through surveys and other stuff while I’m cooking dinner or flipping channels.
2. Focus on income-producing assets. Internet growth stocks may be sexy, but they provide no income. To build a large enough passive-income stream to survive, you must invest in dividend-generating stocks, certificates of deposit, municipal bonds, government Treasury bonds, corporate bonds, and real estate. You're free to invest in non-income-producing assets for capital appreciation too. You just want to earn reliable income when the day comes to leave your job.
We currently have 4 sources that are sustainable. W2 income, interest income, dividend income and blogging. Of course only 2 of those are passive and aren’t enough to support our lifestyle, yet. One day! My wife is also working on building up a side job and I’m looking for ways to boost up my own side hustle too. The next big income source I’d like to add to the mix would be a couple rental properties but #1 is likely still several years away from being joined into the mix.
As daunting as it sounds, finding multiple sources of income doesn’t have to be difficult, and it can be the solution to achieving more financial stability. In this article I’ll give you solid tips for how to create extra sources of income that can pick up slack in your budget, make it easier to save money, and give you an automatic safety net in case you unexpectedly lose your job.
Most of us think of investment income as just the cash flow we get from bank interest, bonds, share dividends and property rents, some of which comes via a super pension. But a more complete view is to also consider how growing the value of your investments can add to your spending potential. This total return approach generates income from both income and growth to optimise spending from your portfolio across all market cycles, aligning cheap and expensive investments to your goals. | 2018-10-17 18:17:02 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.17819002270698547, "perplexity": 1845.269632494991}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-43/segments/1539583511206.38/warc/CC-MAIN-20181017174543-20181017200043-00380.warc.gz"} |
https://pypi.org/project/z3c.recipe.scripts/ | Recipe for installing Python scripts
## Project description
The script recipe installs eggs into a buildout eggs directory, exactly like zc.recipe.egg, and then generates scripts in a buildout bin directory with egg paths baked into them.
## Change History
### Fixes
• If a section extends another one, it should be able to override it.
• The allowed-eggs-from-site-packages should be looked for in the buildout section if it is not found locally.
### 1.0.0 (2010-08-23)
(no significant changes)
### 1.0.0b1 (2010-04-29)
Initial public version.
## Script and interpreter generation
This recipe is very similar to zc.recipe.egg, and if you are familiar with its options, you will be able to use this one easily.
The script and interpreter generation in this recipe are improved from those provided by zc.recipe.egg in two basic ways.
• The interpreter generated by the script supports all interpreter options, as opposed to the subset provided by zc.recipe.egg.
• Both scripts and interpreters from this recipe can optionally choose to include site-packages, and even sitecustomize.
The recipe takes several options. First, here’s the list of the options that overlap from the standard zc.recipe.eggs scripts recipe. After this, we’ll list the new options and describe them.
• eggs
• index
• python
• extra-paths
• entry-points
• scripts
• dependent-scripts
• interpreter
• arguments
• initialization
• relative-paths
In addition to these, the recipe offers these new options. They are introduced here, and described more in depth below.
include-site-packages
You can choose to have the site-packages of the underlying Python available to your script or interpreter, in addition to the packages from your eggs. See the section on this option for motivations and warnings.
allowed-eggs-from-site-packages
Sometimes you need or want to control what eggs from site-packages are used. The allowed-eggs-from-site-packages option allows you to specify a whitelist of project names that may be included from site-packages. You can use globs to specify the value. It defaults to a single value of ‘*’, indicating that any package may come from site-packages.
Here’s a usage example:
[buildout]
...
allowed-eggs-from-site-packages =
demo
bigdemo
zope.*
This option interacts with the include-site-packages option in the following ways.
If include-site-packages is true, then allowed-eggs-from-site-packages filters what eggs from site-packages may be chosen. Therefore, if allowed-eggs-from-site-packages is an empty list, then no eggs from site-packages are chosen, but site-packages will still be included at the end of path lists.
If include-site-packages is false, the value of allowed-eggs-from-site-packages is irrelevant.
extends
You can extend another section using this value. It is intended to be used by extending a section that uses this package’s scripts recipe. In this manner, you can avoid repeating yourself.
exec-sitecustomize
Normally the Python’s real sitecustomize module is not processed. If you want it to be processed, set this value to ‘true’. This will be honored irrespective of the setting for include-site-packages.
script-initialization
The standard initialization code affects both an interpreter and scripts. The code in script-initialization is used only for the generated scripts.
Finally, the “interpreter” entry point ignores script-initialization, scripts, and arguments, and provides yet another additional option.
name
While, by default, the interpreter recipe takes the name of the section to be the desired interpreter name, you can specify the interpreter name here instead.
### Script generation
Generating a basic script looks virtually identical to using zc.recipe.egg.
(Note that the find-links and index values are typically not needed; they are included to help make this document run as a test successfully.)
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = demo
...
... [demo]
... recipe = z3c.recipe.scripts
... eggs = demo<0.3
... index = %(server)s/index
>>> print system(buildout),
Installing demo.
Getting distribution for 'demo<0.3'.
Got demo 0.2.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'.
>>> print system(join(sample_buildout, 'bin', 'demo')),
2 2
### Interpreter generation
As with zc.recipe.egg, you can generate an interpreter with the default script recipe shown above by supplying the “interpreter” option. This example will create both an entry point script and an interpreter.
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = demo
...
... [demo]
... recipe = z3c.recipe.scripts
... eggs = demo<0.3
... index = %(server)s/index
... interpreter = py
>>> print system(buildout),
Uninstalling demo.
Installing demo.
Generated script '/sample-buildout/bin/demo'.
Generated interpreter '/sample-buildout/bin/py'.
You can also generate an interpreter alone with the interpreter recipe.
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = py
...
... [py]
... recipe = z3c.recipe.scripts:interpreter
... eggs = demo<0.3
... index = %(server)s/index
>>> print system(buildout),
Uninstalling demo.
Installing py.
Generated interpreter '/sample-buildout/bin/py'.
In both cases, the bin/py script works by restarting Python after specifying a special path in PYTHONPATH. This example shows the UNIX version; the Windows version actually uses subprocess instead.
>>> cat(sample_buildout, 'bin', 'py') # doctest: +NORMALIZE_WHITESPACE
#!/usr/bin/python2.4 -S
<BLANKLINE>
import os
import sys
<BLANKLINE>
argv = [sys.executable] + sys.argv[1:]
environ = os.environ.copy()
path = '/sample-buildout/parts/py'
if environ.get('PYTHONPATH'):
path = os.pathsep.join([path, environ['PYTHONPATH']])
environ['PYTHONPATH'] = path
os.execve(sys.executable, argv, environ)
The path is a directory that contains two files: our own site.py and sitecustomize.py. The site.py is modified from the underlying Python’s site.py, and is responsible for setting up our paths. The sitecustomize.py is responsible for running the initialization code provided.
>>> ls(sample_buildout, 'parts', 'py')
- site.py
- sitecustomize.py
Here’s an example of using the generated interpreter.
>>> print system(join(sample_buildout, 'bin', 'py') +
... ' -c "import sys, pprint; pprint.pprint(sys.path[-2:])"')
['/sample-buildout/eggs/demo-0.2-pyN.N.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-pyN.N.egg']
<BLANKLINE>
### Including site-packages and sitecustomize
As introduced above, this recipe supports including site packages. This has some advantages and some serious dangers.
A typical reason to include site-packages is that it is easier to install one or more dependencies in your Python than it is with buildout. Some packages, such as lxml or Python PostgreSQL integration, have dependencies that can be much easier to build and/or install using other mechanisms, such as your operating system’s package manager. By installing some core packages into your Python’s site-packages, this can significantly simplify some application installations.
However, doing this has a significant danger. One of the primary goals of buildout is to provide repeatability. Some packages (one of the better known Python openid packages, for instance) change their behavior depending on what packages are available. If Python curl bindings are available, these may be preferred by the library. If a certain XML package is installed, it may be preferred by the library. These hidden choices may cause small or large behavior differences. The fact that they can be rarely encountered can actually make it worse: you forget that this might be a problem, and debugging the differences can be difficult. If you allow site-packages to be included in your buildout, and the Python you use is not managed precisely by your application (for instance, it is a system Python), you open yourself up to these possibilities. Don’t be unaware of the dangers.
To show off these features, we need to use buildout with a Python executable with some extra paths to show include-site-packages; and one guaranteed to have a sitecustomize module to show exec-sitecustomize. We’ll make one using a test fixture called make_py. The os.environ change below will go into the sitecustomize, and the site_packages_path will be in the Python’s path.
>>> py_path, site_packages_path = make_py(initialization='''\
... import os
... os.environ['zc.buildout'] = 'foo bar baz shazam'
... ''')
>>> print site_packages_path
/executable_buildout/site-packages
Now let’s take a look at include-site-packages. The default is false, so we will set it to true.
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = py
... executable = %(py_path)s
...
... [py]
... recipe = z3c.recipe.scripts:interpreter
... include-site-packages = true
... eggs = demo<0.3
... index = %(server)s/index
>>> print system(buildout),
Uninstalling py.
Installing py.
Generated interpreter '/sample-buildout/bin/py'.
Now executable_buildout/site-packages is included in sys.path.
>>> print system(join(sample_buildout, 'bin', 'py') +
... ''' -c "import sys, pprint; pprint.pprint(sys.path)"''')
... # doctest: +ELLIPSIS
['',
'/sample-buildout/parts/py',
...,
'/sample-buildout/eggs/demo-0.2-pyN.N.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-pyN.N.egg',
'/executable_buildout/eggs/setuptools-X-pyN.N.egg',
'/executable_buildout/site-packages']
<BLANKLINE>
As described above, the allowed-eggs-from-site-packages option lets us control what site-packages eggs zc.buildout will allow to fulfill dependencies. The behavior was described above with an example (and the implementation is tested elsewhere), so we’ll only look at some simple and common use cases here.
Sometimes you may want to allow site-packages to be available but you don’t want your package to depend on it using setup.py. For instance, perhaps you are writing an application, and you want to depend on your system’s packaging of the PostgreSQL code, but the system Python does not use eggs to package it, so you need to manage the two separately. In this case, you might not want to use any eggs from site-packages, but you want it available. In this case, you can use allowed-eggs-from-site-packages with an empty value to keep any egg from being used from site-packages.
Here’s an example. Let’s say we have a Python with demo and demoneeded installed as eggs in the system Python. Normally, they will be used to fulfill dependencies, because allowed-eggs-from-site-packages defaults to the value “*” (allow any package). (We use an empty find-links value to say that buildout may not look elsewhere for the package. We use a different eggs-directory for isolation, so that eggs obtained other parts of the document do not affect this example.)
>>> from zc.buildout.tests import create_sample_sys_install
>>> create_sample_sys_install(site_packages_path)
>>> import zc.buildout.easy_install
>>> zc.buildout.easy_install.clear_index_cache()
>>> write('buildout.cfg',
... '''
... [buildout]
... parts = eggs
... eggs-directory = tmpeggs
...
... [primed_python]
... executable = %(py_path)s
...
... [eggs]
... recipe = z3c.recipe.scripts
... include-site-packages = true
... python = primed_python
... eggs = demoneeded
... ''' % globals())
>>> print system(buildout),
Creating directory '/sample-buildout/tmpeggs'.
Uninstalling py.
Installing eggs.
That succeeds fine, getting demoneeded from the Python site-packages.
However, when allowed-eggs-from-site-packages is an empty value, demoneeded is not allowed to come from site-packages, and the buildout fails.
>>> zc.buildout.easy_install.clear_index_cache()
>>> rmdir('tmpeggs')
>>> write('buildout.cfg',
... '''
... [buildout]
... parts = eggs
... eggs-directory = tmpeggs
...
... [primed_python]
... executable = %(py_path)s
...
... [eggs]
... recipe = z3c.recipe.scripts
... include-site-packages = true
... python = primed_python
... allowed-eggs-from-site-packages =
... eggs = demoneeded
... ''' % globals())
>>> print system(buildout),
Creating directory '/sample-buildout/tmpeggs'.
Uninstalling eggs.
Installing eggs.
Couldn't find index page for 'demoneeded' (maybe misspelled?)
Getting distribution for 'demoneeded'.
While:
Installing eggs.
Getting distribution for 'demoneeded'.
Error: Couldn't find a distribution for 'demoneeded'.
The include-sitepackages and allowed-eggs-from-site-packages options both can be obtained from the buildout section if they are not set locally.
Remember that you can provide multiple lines to the allowed-eggs-from-site-packages option, each specifying a whitelist of allowed packages. Globs (* and ?) are allowed.
Next we will use the exec-sitecustomize option. It simply copies Python’s underlying sitecustomize module, if it exists, to the local version. The os.environ change shown above in the make_py call will go into the sitecustomize.
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = py
... executable = %(py_path)s
...
... [py]
... recipe = z3c.recipe.scripts:interpreter
... exec-sitecustomize = true
... eggs = demo<0.3
... index = %(server)s/index
>>> print system(buildout),
Installing py.
Generated interpreter '/sample-buildout/bin/py'.
>>> cat(sample_buildout, 'parts', 'py', 'sitecustomize.py')
... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
<BLANKLINE>
# The following is from
# /executable_buildout/parts/py/sitecustomize.py
...
import os
os.environ['zc.buildout'] = 'foo bar baz shazam'
>>> print system(join(sample_buildout, 'bin', 'py') +
... ''' -c "import os; print os.environ['zc.buildout']"''')
foo bar baz shazam
<BLANKLINE>
It also will be honored in the buildout section if it is not set locally.
### Options
We’ll focus now on the remaining options that are different than zc.recipe.egg.
Let’s look at the extends option first.
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = demo python
...
... [demo]
... recipe = z3c.recipe.scripts
... eggs = demo<0.3
... index = %(server)s/index
... initialization =
... import os
... os.environ['zc.buildout'] = 'sha boo bop bazoodle'
...
... [python]
... recipe = z3c.recipe.scripts:interpreter
... extends = demo
... initialization =
... import os
... os.environ['zc.buildout'] = 'foo bar baz shazam'
That makes it easier to specify some initialization for the interpreter that is different than a script, while duplicating other configuration.
Now let’s put it in action.
>>> print system(buildout),
Uninstalling py.
Installing demo.
Generated script '/sample-buildout/bin/demo'.
Installing python.
Generated interpreter '/sample-buildout/bin/python'.
>>> print system(join(sample_buildout, 'bin', 'python') +
... ' -c "import sys, pprint; pprint.pprint(sys.path[-2:])"')
['/sample-buildout/eggs/demo-0.2-pyN.N.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-pyN.N.egg']
<BLANKLINE>
>>> print system(join(sample_buildout, 'bin', 'python') +
... ''' -c "import os; print os.environ['zc.buildout']"'''),
foo bar baz shazam
Note that the parts/py directory has been cleaned up, and parts/python has been created.
>>> ls(sample_buildout, 'parts')
d buildout
d demo
d python
If you want to have initialization that only affects scripts, not the interpreter, you can use script-initialization. Here’s a demonstration.
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = demo
...
... [demo]
... recipe = z3c.recipe.scripts
... eggs = demo<0.3
... index = %(server)s/index
... interpreter = py
... script-initialization =
... print "Hi from the script"
>>> print system(buildout),
Uninstalling python.
Uninstalling demo.
Installing demo.
Generated script '/sample-buildout/bin/demo'.
Generated interpreter '/sample-buildout/bin/py'.
>>> print system(join(sample_buildout, 'bin', 'py') +
... ''' -c "print 'Hi from the interpreter'"'''),
Hi from the interpreter
>>> print system(join(sample_buildout, 'bin', 'demo')),
Hi from the script
2 2
The last new option is name. This simply changes the name of the interpreter, so that you are not forced to use the name of the section.
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = interpreter
...
... [interpreter]
... name = python2
... recipe = z3c.recipe.scripts:interpreter
... eggs = demo<0.3
... index = %(server)s/index
>>> print system(buildout),
Uninstalling demo.
Installing interpreter.
Generated interpreter '/sample-buildout/bin/python2'.
>>> print system(join(sample_buildout, 'bin', 'python2') +
... ' -c "print 42"')
42
<BLANKLINE>
The other options all identical to zc.recipe.egg.
## Project details
Uploaded source | 2022-08-13 02:47:58 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.17026287317276, "perplexity": 14170.775646967446}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882571869.23/warc/CC-MAIN-20220813021048-20220813051048-00646.warc.gz"} |
http://library.kiwix.org/ell.stackexchange.com_en_all_2020-11/A/question/17385.html | ## Differences "so-called" and "called"
8
2
I really wonder if I express "so-called" in a sentence, can I also use "called" for the same way?
For example:
The new technique so-called "blablabla" is to consume a lot of energy.
Can I write like:
The new technique called "blablabla" is to consume a lot of energy.
19
First of all, so-called cannot be used as a verb, as in your first example; it is an adjective.
Secondly, so-called is used for two possible meanings: first, to give a "popular name" for a thing that has a different "proper name", such as
the so-called 'splat' character (that is, the asterisk: *)
Or it can be used to indicate that you are going to refer to something with a name that you think is actually an improper or invalid name:
my so-called friend just told the teacher I cheated.
(You are referring to someone as a friend, but the use of "so-called" indicates that you think that their behavior demonstrates that they aren't really your friend.)
Thus you should not write your sentence with "so-called" at all. Use "called" to inform people of the proper name of the technique.
I think the unifying feature is that "so-called" puts what the thing is called slightly at arms length. The meaning is held between thumb and forefinger rather than being adopted. – Francis Davey – 2017-03-25T08:06:08.117
So-called would be correct in that phrase is it ran something like "This so-called "Extra-Green-Savings-Propulsions(tm)" technique will actually consume a lot of energy." But I admit that is stretching it :P – oerkelens – 2014-02-13T09:58:30.153 | 2021-03-06 02:50:48 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5083394646644592, "perplexity": 1757.9611669015185}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178374217.78/warc/CC-MAIN-20210306004859-20210306034859-00599.warc.gz"} |
http://aga2012.wikidot.com/binomial-start-system | Binomial Start System
Find the binomial start systems and solutions for
(1)
\begin{align} x^2y+xy^2+1 &= 0\\ x^2y+x^2+x+1 &= 0 \end{align}
for your choice of lifts of Newton polytopes.
Solution:
I apologize for the lack of images…
Set
(2)
\begin{align} f= & x^2 y+xy^2+1\\ g= & x^2y+x^2+x+1\\ P= New(f)= & conv\{(0,0),(2,1),(1,2)\}\\ Q= New(g)= & conv\{(0,0),(1,0),(2,0),(2,1)\}\\ M=P+Q= & conv\{(0,0),(1,2),(3,3),(4,2),(4,1),(2,0)\} \end{align}
Choose lifts P' of P and Q' of Q as follows:
(3)
\begin{align} P'= & conv\{(0,0,0),(1,2,0),(2,1,0)\}\\ Q'= & conv\{(0,0,4),(1,0,3),(2,0,2),(2,1,1)\} \end{align}
Note that these lifts are both triangles. Taking the lower hull of the Minkowski sum P'+Q' gives a mixed subdivision of M=P+Q with two mixed cells M1 and M2 with areas 3 and 2 respectively:
(4)
\begin{align} M1=conv\{(0,0),(1,2),(3,3),(2,1)\}\\ M2=conv\{(2,0),(4,1),(4,2),(2,1)\} \end{align}
The parametrized system of equations corresponding to the lifts P' and Q' is:
(5)
\begin{align} x^2y+xy^2+1 & =0\\ tx^2y+t^2x^2+t^3x+t^4 & =0 \end{align}
The tropical hypersurfaces TP' and TQ' (using inward pointing normals) corresponding to the lifts P' and Q' are described as follows. TP' is centered at (0,0) and consists of the three rays k(2,-1),k(-1,2), and k(-1,-1), where k is greater than or equal to 0. TQ' is centered at (1,1) and consists of the three rays k(-1,0),k(0,1), and k(1,-2), where again k is greater than or equal to 0.
Note: The center (1,1) of TQ' can be obtained in a couple of equivalent ways. First, TQ' is the nonlinear locus of the function trop(tx^2y+t^2x^2+t^3x+t^4)=min{1+2x+y,2+2x,3+x,4} =min{1+2x+y,2+2x,4}. So the center of TQ' occurs when 1+2x+y=2+2x=4, or when x=y=1.
Alternatively, take the upward pointing normal to the lifted polytope Q' (this is just a triangle so it makes sense to talk about its upward pointing normal) and scale it so that the z-coordinate is 1. Then the x and y coordinates of the scaled normal will be the coordinates of the center of TQ'.
TP' and TQ' intersect at the points A=(-1/2,1) and B=(2,-1). This implies that we should try two substitutions for x and y. Corresponding to A take:
(6)
\begin{align} x= & c_1t^{-1/2}+HOT\\ y= & c_2t+HOT \end{align}
Corresponding to B take:
(7)
\begin{align} x= & c_1t^2 + HOT\\ y= & c_2t^{-1} + HOT \end{align}
Plugging these into (5) yields two binomial start systems in the c-variables corresponding to cancellation of lowest order terms in t. The system coming from A is:
(8)
\begin{align} c_1^2c_2+1 & =0\\ c_1^2c_2+c_1^2 &=0 \end{align}
This has the 2 solutions (1,-1) and (-1,-1) in the nonzero complex numbers. We see this corresponds to the mixed cell M2 in the mixed subdivision of P+Q given above. The system coming from B is:
(9)
\begin{align} c_1c_2^2+1 & =0\\ c_1^2c_2+1 & =0 \end{align}
Let w be a primitive 6th root of unity. This system has the 3 solutions
(10)
$$(1,-1),(-w^4,w),(-w^2,w^5)$$
So we see this corresponds to the mixed cell M1. | 2018-01-21 01:09:59 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 9, "equation": 1, "x-ck12": 0, "texerror": 0, "math_score": 0.9419088959693909, "perplexity": 2337.2910732007967}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-05/segments/1516084889798.67/warc/CC-MAIN-20180121001412-20180121021412-00272.warc.gz"} |
http://www.csrc.ac.cn/en/event/seminars/2021-05-31/673.html | On Geometries of Finitary Random Interlacements
Speaker
A/Prof. Yuan Zhang
Peking University
Abstract
In this talk, we discuss geometric properties of Finitary Random Interlacements (FRI) $\mathcal{FI}^{u,T}$ in $\mathbf{Z}^d$. We prove that with probability one $\mathcal{FI}^{u,T}$ has no infinite connected component for all sufficiently small fiber length $T>0$, and a unique infinite connected component for all sufficiently large $T$. At the same time, although FRI may not enjoy global stochastic monotonicity with respect to $T$, we prove the existence of a critical $T_c(u)$ for all large $u$. Moreover, we find the chemical distance on the infinite cluster is of the same order as Euclidean distance as well as a local uniqueness result for all sufficiently large $T$. Researches joint with E.B. Procaccia, J. Ye, Y. Xiong,Z. Cai, and X. Han. | 2021-12-04 22:40:13 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8008040189743042, "perplexity": 403.37063313470975}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964363125.46/warc/CC-MAIN-20211204215252-20211205005252-00497.warc.gz"} |
https://socratic.org/questions/in-how-many-different-ways-can-a-pair-of-dice-be-rolled-to-obtain-a-total-of-10 | # In how many different ways can a pair of dice be rolled to obtain a total of 10?
Apr 25, 2017
3
#### Explanation:
The highest number on a single "die" is 6.
Since we want to get a total of 10 on the roll, we need to subtract from 10 every value possible on a single "die".
So,
$10 - 6 = 4$ Combination 6 and 4.
$10 - 5 = 5$ Combination 5 and 5.
$10 - 4 = 6$ Combination 4 and 6.
Once we reach
$10 - 3 = 7$
Realize that 7 is not a number that we have. We can't roll a combination of 3 and 7. Therefore, we have reached all of our possibilities.
3 Possibilities. | 2021-12-04 10:53:36 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 4, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5220327377319336, "perplexity": 468.66441240419573}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964362969.51/warc/CC-MAIN-20211204094103-20211204124103-00098.warc.gz"} |
https://hal-cea.archives-ouvertes.fr/cea-02339848 | Influence of iron on the alteration of the SON68 nuclear glass in the Callovo-Oxfordian Groundwater - Archive ouverte HAL Access content directly
Journal Articles Applied Geochemistry Year : 2019
## Influence of iron on the alteration of the SON68 nuclear glass in the Callovo-Oxfordian Groundwater
(1) , (1) , (1) , (1)
1
M. Tribet
• Function : Correspondent author
• PersonId : 1061792
Connectez-vous pour contacter l'auteur
S. Gin
#### Abstract
In France, the high level radioactive waste, contained in a glassy matrix, is intended for a deep geological disposal. It is then important to understand glass alteration, which depends on the near-field materials and the environmental conditions. The corrosion of the carbon steel overpack (used in the French multi-barrier concept for the disposal of high level radioactive waste) could influence glass alteration by the release of iron in the solution and the formation of iron corrosion products. For a better understanding of these interactions, different experiments were performed at 90 °C using a SON68 glass (non-radioactive surrogate of the R7T7 glass) separated by 80 $\mu$m from a pristine iron foil and immersed in synthetic groundwater. A pre-corroded iron foil and a PTFE foil, replacing the pristine iron foil, were also used. The influence of iron on glass alteration was studied, focusing on two different environments (the confined environment, inside the crack, and the diluted environment, where the faces are exposed to the homogeneous solution) and on the influence of a pre-corrosion of the iron foil. Depending on the previously described conditions, some variations were observed: as a whole, glass alteration increased in the presence of iron due to the precipitation of Fe-silicate minerals and it was also higher in the diluted environment than in the confined environment, indicating that the gel protective properties were different in both cases. This might be related either to differences in the solution composition in contact with the glass or differences in the gel composition, as it was shown that iron can enter the porous gel layer. In the tested conditions, pre-corrosion of an iron foil seemed to have no influence on glass alteration in a confined environment.
### Dates and versions
cea-02339848 , version 1 (16-03-2020)
### Identifiers
• HAL Id : cea-02339848 , version 1
• DOI :
### Cite
T. de Echave, M. Tribet, S. Gin, C. Jegou. Influence of iron on the alteration of the SON68 nuclear glass in the Callovo-Oxfordian Groundwater. Applied Geochemistry, 2019, 100, pp.268-278. ⟨10.1016/j.apgeochem.2018.12.007⟩. ⟨cea-02339848⟩
### Export
BibTeX TEI Dublin Core DC Terms EndNote Datacite
56 View | 2023-01-31 21:10:05 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2546718120574951, "perplexity": 5936.202849389783}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764499890.39/warc/CC-MAIN-20230131190543-20230131220543-00640.warc.gz"} |
https://www.nag.com/numeric/py/nagdoc_latest/naginterfaces.library.rand.multivar_normal.html | # naginterfaces.library.rand.multivar_normal¶
naginterfaces.library.rand.multivar_normal(sorder, mode12, n, xmu, c, comm, statecomm)[source]
multivar_normal sets up a reference vector and generates an array of pseudorandom numbers from a multivariate Normal distribution with mean vector and covariance matrix .
For full information please refer to the NAG Library document for g05rz
https://www.nag.com/numeric/nl/nagdoc_28.7/flhtml/g05/g05rzf.html
Parameters
sorderint
Determines the storage order of variates; the th variate is stored in if , and if , for , for .
mode12int
A code for selecting the operation to be performed by the function.
Set up reference vector only.
Generate variates using reference vector set up in a prior call to multivar_normal.
Set up reference vector and generate variates.
nint
, the number of random variates required.
xmufloat, array-like, shape
, the vector of means of the distribution.
cfloat, array-like, shape
The covariance matrix of the distribution. Only the upper triangle need be set.
commdict, communication object, modified in place
Communication structure for the reference vector.
If , this argument must have been initialized by a prior call to multivar_normal.
statecommdict, RNG communication object, modified in place
RNG communication structure.
This argument must have been initialized by a prior call to init_repeat() or init_nonrepeat().
Returns
xNone or float, ndarray, shape
The array of pseudorandom multivariate Normal vectors generated by the function.
Two possible storage orders are available.
If then holds the th dimension for the th variate.
If this ordering is reversed and holds the th dimension for the th variate.
Raises
NagValueError
(errno )
On entry, .
Constraint: , or .
(errno )
On entry, .
Constraint: .
(errno )
On entry, .
Constraint: .
(errno )
On entry, the covariance matrix is not positive semidefinite to machine precision.
(errno )
is not the same as when [‘r’] was set up in a previous call.
Previous value of and .
(errno )
On entry, [‘state’] vector has been corrupted or not initialized.
Notes
When the covariance matrix is nonsingular (i.e., strictly positive definite), the distribution has probability density function
where is the number of dimensions, is the covariance matrix, is the vector of means and is the vector of positions.
Covariance matrices are symmetric and positive semidefinite. Given such a matrix , there exists a lower triangular matrix such that . is not unique, if is singular.
multivar_normal decomposes to find such an . It then stores , and in the reference vector which is used to generate a vector of independent standard Normal pseudorandom numbers. It then returns the vector , which has the required multivariate Normal distribution.
It should be noted that this function will work with a singular covariance matrix , provided is positive semidefinite, despite the fact that the above formula for the probability density function is not valid in that case. Wilkinson (1965) should be consulted if further information is required.
One of the initialization functions init_repeat() (for a repeatable sequence if computed sequentially) or init_nonrepeat() (for a non-repeatable sequence) must be called prior to the first call to multivar_normal.
References
Knuth, D E, 1981, The Art of Computer Programming (Volume 2), (2nd Edition), Addison–Wesley
Wilkinson, J H, 1965, The Algebraic Eigenvalue Problem, Oxford University Press, Oxford | 2023-02-03 20:57:08 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8484073877334595, "perplexity": 1785.176238791135}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500074.73/warc/CC-MAIN-20230203185547-20230203215547-00373.warc.gz"} |
http://math.stackexchange.com/questions/355932/proof-of-a-combinatorial-identity | # proof of a combinatorial identity
How to prove the following using inclusion exclusion
$$\sum _{k=m} ^{n} (-1)^{k-m} {n \choose k} = {n-1 \choose m-1}$$
-
Hint: $\binom{n-1}{k-1}+\binom{n-1}{k}=\binom{n}{k}$ – Thomas Andrews Apr 9 '13 at 14:02
But, by the tag "inclusion-exclusion" perhaps you are looking for a counting proof? – Thomas Andrews Apr 9 '13 at 14:05
yes, I want a counting proof – RIchard Williams Apr 9 '13 at 16:05 | 2015-04-19 08:14:48 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9103879928588867, "perplexity": 3427.214130710688}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-18/segments/1429246637979.29/warc/CC-MAIN-20150417045717-00298-ip-10-235-10-82.ec2.internal.warc.gz"} |
https://www.jiskha.com/archives/2014/05/04 | # Questions Asked onMay 4, 2014
1. ## Chemistry
Balance the following equation for a half reaction that occurs in basic solution. Use e– as the symbol for an electron. SO3^2- ---> S2O4^2-
2. ## Chemistry
Using a table of standard reduction potentials, determine the best answer to the following questions. a) Which of the following reagents would oxidize Cr to Cr3 , but not Ag to Ag ? Choices: Ca^2+, Br2, Co^2+, Ca, Br^-, or Co. b) Which of the following
3. ## Chemistry
In a particular redox reaction, MnO2 is oxidized to MnO4– and Cu2 is reduced to Cu . Complete and balance the equation for this reaction in acidic solution. Phases are optional. MnO2 + Cu^2+ ---> MnO4^- + Cu^+
4. ## Physics
A vibrating point on a spring travels 60 mm during three cycles. What is the amplitude of the vibration?
5. ## Chemistry
Ethanol (C2H5OH) melts at -114 degrees Celsius. The enthalpy of fusion is 5.02 kj/mol. The specific heats of solid and liquid ethanol are 0.97 J/g-K, respectively. How much heat (kJ) is needed to convert 25.0 g of solid ethanol at -135 degrees Celsius to
6. ## CRJ
1. Which of the following was an impact on policing as a result of WWII? (Points : 1) The Pendelton Act An increase in educational requirements for police A shortage of experienced officers The adoption of residency requirements for police Question 2. 2.
7. ## statistics
John Davis, a manager of a supermarket, wants to estimate the proportion of customers that will be using food stamps at his store. How large a sample is required to estimate the true proportion to within 3% with 98% confidence?
8. ## math check probability
5. A bag contains 7 green marbles and 4 white marbles. You select a marble at random. What are the odds in favor of picking a green marble? A. 7:11**? B. 7:4 C. 4:7 D. 3:7 ------------------------------------ 6. Food Express is running a special promotion
9. ## Statistics
Reginald Brown an inspector from the department of weights and measures, weighs 15 eighteen-ounce cereal boxes of corn flakes. he finds their mean weight to be 17.78 ounces with a standard deviation of .4 ounces. are the cereal boxes lighter than they
10. ## statistics
a medication is 75% effective against a bacterial infection. find the probability that if 12 people take the medication, at least 1 person"s infection will not improve
11. ## Geometry
Which if the following is equivalent to 7pi/4? A.285 degrees B. 305 degrees C. 315 degrees D. 330 degrees E. 375 degrees
12. ## english
Paraphasing practice In 1857, a British expedition led by Richard Burton and John Speke set out to find the great lakes shown on Ptolemy's map. After reaching Lake Tanganyika, the two men split up because Burton was ill.
13. ## Chemistry
Calculate the cell potential for the following reaction as written at 25.00 °C, given that [Zn2 ] = 0.842 M and [Ni2 ] = 0.0100 M. Standard reduction potentials can be found here. reaction: Zn(s)+Ni^2+(aq)--->Zn^2+(aq)+Ni(s) standard reduction Zn: -.76
14. ## English
Fill in the blank with verb in parentheses Have you ever ___ to prom before?___last year as a sophomore Thanks
15. ## math
List the three sections of the statement of cash flows.
16. ## chemistry
A 2.00 g sample of a particular compound was dissolved in 15.0 g of carbon tetrachloride. The boiling point of this solution was determined to be 77.85ºC. For pure CCl4, TB = 76.50ºC and KB = 5.03°C·kg/mol Calculate the boiling point elevation, ΔTB,
17. ## AStronomy/ Math
I do not understand how to do one of my online homework questions: What is the Schwarzschild radius of a 100 million-solar-mass black hole? The mass of the Sun is about 2 × 1030 kg, and the formula for the Schwarzschild radius of a black hole of mass M
18. ## business&technical english
When you know your audience would be receptive to your message, you use ------ approach.
19. ## MATH
On a TV game show, a contestant makes $600 for every correct answer but loses$500 for every wrong answer. After answering 22 questions, Sarah broke even. How many questions did she answer correctly?
20. ## math
SHURGRO fertilizer contains 18% ammonia plus carbon compounds.If 80% of the ammonia contains the chemical element nitrogen, what percent of this fertilizer is nitrogen? a. 14.4% b. 18% c. 38% d. 40% e. 62% please answer and explain
21. ## science
1. Why do earthquakes occur along the San Andreas Fault? a. Two plates meet at the San Andreas Fault and they slide next to each other causing earthquakes b. Two plates converge at the San Andreas Fault causing earthquakes*** c. Two plates pull apart at
22. ## physics
the length of nylon rope from which a mountain climber is suspended has a force constant of 1.40*10^4. how much would this rope stretch to break the climbers fall if he freefall 2.00 m before the rope run out of slack
23. ## math
Paul bowled 6 games today. His scores are shown below. Game 1: 158 Game 2: 124 Game 3: 110 Game 4: 167 Game 5: 146 Game 6: 165 a. What was Paul's median score for the 6 games? Answer: 152 b. What was Paul's mean score for the 6 games? Answer: 145 c. Paul
24. ## Physics
A soccer player kicks a 0.43 kg ball straight up to see how far it will rise. The ball starts with a velocity of 16m/s at a height of 0.85m above the ground. It rises then falls straight down to the ground. a) what is the total energy of the ball just
25. ## Statistics
σ = sqrt[ P * ( 1 - P ) / n ] = sqrt [(0.8 * 0.2) / 100] = sqrt(0.0016) = 0.04 z = (p - P) / σ = (.73 - .80)/0.04 = -1.75. What type of formula is this problem?
26. ## finance
It’s been two months since you took a position as an assistant financial analyst at Caledonia Products. Although your boss has been pleased with your work, he is still a bit hesitant about unleashing you without supervision. Your next assignment involves
27. ## Math (check)
4. A spinner is divided into 10 equal sections numbered from 1 to 10. You spin the spinner once. Find P(not even). A. 1/3 B. 1/2 C. 1/5*****? D. 1/4
28. ## mathematics
Two equal circle touch externally at point P. PX and PY are chords in the respective circles which are perpendicular. If the centres Are A and B. Show that AX is parallel to BY and AXYB is a parallelogram.
29. ## Assessment In Ece
Eastern cultures consider a child's standing up for his own rights
30. ## Science
Explain the energy transformations during skydiving Explain what happens once a skydiver reaches terminal velocity please help...i cant find any information...please note that I need to EXPLAIN
31. ## algebra
preform the given set operation U= 1,2,3,4,5,6,7,8,9,10 {1,3,6}{2,4,9}
asked by Mary Ann
32. ## math
It has been estimated that 0.8% of a certain country's population are homeless. Now 0.8% is a small percentage, but there are approximately 313 million people in the country, and 313 million is a large number. Approximately how many people are homeless?
33. ## math
Your optimal exercise heart rate for cardiovascular benefits is calculated as follows: Subtract your age from 220 and then find 80% of the difference. the rate for a 40 year old is 144 and the rate for a 10 year old 168 Rounded to the nearest whole number,
34. ## Math
Find the quadratic polynomial whose graph goes through the points (-2,5), (0,5), and (1,11). f(x)= ______x^2+ ______x+ _______
35. ## chemistry
A balloon of methane gas, CH4, has a temperature of -2 degrees celcius and contains 2.35g of the gas. What is the temperature in kelvin and how many moles of gas does the balloon contain?
36. ## math
what is the rule for the function shown in the table below? x -1 0 1 2 y -2 1 4 7
37. ## MATH ✿╣Check╠✿
A bag has 6 green marbles, 4 red marbles, 5 yellow marbles, and 3 purple marbles. What is the probability of choosing a purple marble? 1/6**? 6/18 3/20 1/9
38. ## MATH ✿╣Check╠✿
8. There are 5 different cookies in a bag. One of them is your favorite, chocolate chip. What is the probability that you will not get your favorite? 1/5 2/5 24/25 4/5**?
39. ## Medical ethics
What should I expect from this course. The title pretty much explains it but I would like some more detailed information please
40. ## Statistics
Dr. Hernandez plans to measure FEV in a random sample of n young women from a certain popu- lation, and to use the sample mean y ̄ as an estimate of the population mean. Let A be the event that Hernandez’s sample mean will be within ±100 ml of the
41. ## applied statistics
how to remember the difference between dependent and independent variable and which one is X n Y ?
42. ## physics
suppose the length of a clock's pendulum is increased by 0.01 exactly at noon what time will be exactly next day by noon
43. ## Statistics
If I'm sampling 50 people and 35 people liked Pepsi instead of Coke how can i apply that to the test statistics for a mean t=x(bar)-mule/s/ square root n
44. ## math
The distance between two points is correctly expressed as 720 statute miles or 630 nautical miles. Which of the following most closely approximates the value of one statute mile in terms of nautical miles? a. 0.88 b. 0.89 c. 0.90 d. 1.14 e. 1.25 please
45. ## Math- Statistics
An epidemiologist is planning a study on the prevalence of oral contracep- tive use in a certain population. She plans to choose a random sample of n women and to sue the sample proportion of oral contraceptive users (pˆ) as an estimate of the population
asked by Needs Help
46. ## English
It for speech i represent at school.english is the language of opportunity.why bother to teach indigenous languages?
asked by Thembeka nzama
52. ## math
A rikhshaw covered 2 km/hr and return back at a speed of 11 km/hr find the average speed of the rickshaw
53. ## Criminal Justice - Ethics
Which of the following concepts best captures the utilitarian notion that each person's welfare is equally important and, thus, that no one person's happiness should be regarded as more important than any other person's? A. Fecundity B. Psychological
54. ## Algebra I
what does factoring the sum or difference of two cubes mean
55. ## Algebra
Solve. • x = 2 • x = –2 • x = 28 • x = –28 How?
56. ## Physical science
a swimming pool is 25 m long and 10 m wide and is filled to an average depth of 1.5 m how many kilogram of water does it contain?
i did all of them except these i need help all the questions look like they repeat themselves i don't know if i'm doing them correct 1.how does shakespeare use situationaL irony in act 1 to introduce or develop the impulsive thinking theme 2.what is verbal
58. ## chemistry
the mass of a certain mixture of BaO and CaO is found to be exactly one half that of the mixed sulfates formed from it by the action of H2SO4. calculate the percentage of BaO and CaO in the mixture.
59. ## algebra
(7 square of p)/ (square of p)
60. ## English/Mythology
What is ironic about the death of Jason and Theseus from Greek mythology
61. ## English/Mythology
What is a ritualistic interpretation of the story of Theseus
62. ## chemistry
The chemical reaction for dissociation of an acid is: HA + H2O → H3O+ + A- Assuming all of the hydronium ion (calculated in in the previous problem) comes from this reaction, what is the concentration of conjugate base, [A-], in this system?
63. ## chemistry
The acid dissociation constant, Ka, for this reaction is given by the following formula (this is also in your book): Ka=[H3O+][A−][HA] The acid concentration, [HA] is given in the introductory information of this problem. Using this information and your
64. ## science
Predicting Table of radioactive isotopes below Isotope type of decay Uranium-238 Alpha Nickel-63 Beta Iodine-131 Beta Radium-226 Alpha With the help of a periodic table, predict the element that forms in each case. Explain your reasoning.
65. ## chemistry
1. A 2.00 g sample of a particular compound was dissolved in 15.0 g of carbon tetrachloride. The boiling point of this solution was determined to be 77.85ºC. For pure CCl4, TB = 76.50ºC and KB = 5.03°C·kg/mol Calculate the boiling point elevation,
66. ## chemistry
What is the pH of a solution if [H+] = 2.3 x 10–5 M?
67. ## Ethics in Criminal Justice
Which of the following, according to Carl Klockars, is NOT an important consideration in determining whether the good ends of police work justify immoral means in a given scenario? A. Are there other, non-dirty, means that may be effective but that we may
68. ## English
Traditional african marriage is an advantage for men only not women
69. ## Physics
A 0.45kgkg mass oscillates in simple harmonic motion on a spring with a spring constant of 160N/mN/m .What is the period of the oscillation?
70. ## Math
A wheel with radius 2 cm is being pushed up a ramp at a rate of 6 cm per second. The ramp is 520 cm long, and 260 cm tall at the end. A point P is marked on the circle. How far does the wheel travel in one rotation?
71. ## Science
What happens to the resultant force on each point of the skydive?
72. ## math
Describe how the QuickZoom feature of QuickBooks does or does not provide the same help in the statement of cash flows as it does in the income statement
73. ## algebra
Which of the following ordered pairs is included in the solution set of the system, y < 2 - 2x and y > 2x -3? (4, 0) (0, 0) No Solution (3, 4) 2. Choose all correct answers. Which of the following are solutions of the system? x < 3 and x + y < 5 (2, 2) (4,
74. ## English
NEtholic REvolution -->How did agricultural advancements impact society? What are three reasons for that? How did agricultural advancements impact society?
Hercules Films is deciding on the price of the video release of its film Bride of the Son of Frankenstein. Marketing estimates that at a price of p dollars, it can sell q = 240,000 − 15,000p copies, but each copy costs $4 to make. What price will give asked by Dominic Cigliano 76. ## finite math Hercules Films is deciding on the price of the video release of its film Bride of the Son of Frankenstein. Marketing estimates that at a price of p dollars, it can sell q = 240,000 − 15,000p copies, but each copy costs$4 to make. What price will give
asked by Dominic Cigliano
77. ## Global History
I need answers for "GLOBAL HISTORY REGENTS REVIEW" packet. Associated names are Mr. Moeller and Mrs. Sita. I can't find answers anywhere. The packet can be found blank online here: johnbowne DOT
78. ## French
We have to respond to these questions in the negative form.I did some but need help with these. Please help, please and thanks Est-ce que les artistes ont utilise des boutons dans le collage? Est-ce que les visiteurs ont mange du gateau a l'exposition?
79. ## Algebra
The time, t, required to drive a certain distance varies inversely with the speed, r. If it takes 7 hours to drive the distance at 55 miles per hour, how long will it take to drive the same distance at 65 miles per hour? • about 6.25 hours • about
80. ## physics
12.8 kg of ice at 0 C is dropped into 3.3 kg of water at C. What fraction of the ice melts? =
81. ## Physics
8.2 kg of ice is taken from a temperature of -49 C into steam at 123 C. What is the energy used? Q_total =
asked by Joseph Smith
82. ## physics
Question Part Points Submissions Used 1 2 3 4 0/0.37 0/0.37 –/0.37 –/0.37 4/15 1/15 0/15 0/15 Total 0/1.48 ...A diamond in air is illuminated with white light. On one particular facet, the angle of incidence is 46.05°. Inside the diamond, red light
83. ## Algebra 1b
Determine the equation of g(x) that results from translating the function from f(x)=(x+2)^2 to the right 6 units
84. ## Chemistry
If you dissolve 13.5 g of malic acid, C4H6O5, in half a liter of water (0.500 L), what is the molarity of the acid in the solution?
85. ## math
Sunflower seeds are sold in packages that weigh 5 1/4 ounces. If there is a supply of 357 ounces of sunflower seeds. how many packages of seed can be made?
86. ## CHEMISTRY
The enthalpy of solution of nitrous oxide (N2O) in water is -12 kJ/mol and its solubility at 20 oC and 1.00 atm is 0.121 g per 100. g of water. Calculate the molal solubility of nitrous oxide in water at 1.600 atm and 20 oC. Hint, first find Henry's law
87. ## math
a case of diet cola costs $7.23. If there are 24 cans in a case, find the cost per can. Round to the nearest cent. then find the number of cans you can buy per$1. Round to the nearest ten. Which number is more useful? why?
88. ## physics
A 3.8 kg ball is rolling along a slippery road at 1.5 m/s E. It then rolls onto a patch of grass and slows to a stop over a distance of 3.6 m a) calculate the total work on the ball b) calculate the net force that caused the ball to come to a stop (force
89. ## Physics
A car's engine is only 12% efficient at converting chemical energy in gasoline into mechanical energy. If it takes 1.8 x 104 N of force to keep the car moving at a constant speed of 21 m/s, how much chemical energy would be needed to move the car a
90. ## help
A sound wave travels at 343 m/s and a compression passes by every 12 ms. What is the wavelength of this sound?
91. ## law
The crime analysis technique involves the study of crime and/or social problems in a specific area is Tactical crime analysis
92. ## chemistry
Can CoBr2+ NH4Br + NH4OH ---> Co^2+ (aq) + 2NH3 (l) + H^+ (aq) + H2O (l) + 3Br^- form the complex [Co(NH3)5Br]Br2 if so please explain
93. ## business&technical english
. When business messages use a/an ----- or ------ attitude, they risk sounding selfish and uninterested in the audience.
94. ## business&technical english
When we avoid using words and phrases that unfairly or even unethically categorize or stigmatize people in ways related to gender, race, ethnicity, age or disability, this is called
95. ## business&technical english
--------- language is used to make comparisons in business communication
96. ## Algebra
I have to identify the system of equations, if any for: -2x-4=1, 12=-6x-3 no solution? infinitely many solutions? (0,-1)? or (-1,0)?
97. ## chemistry
Pasta packages often have different direction for cooking at high altitudes. a.) According to the directions, should you boil the pasta for a longer to shorter time? Why? b.) If the pasta water boils rapidly over medium-high heat, is there any reason to
98. ## English
What kind of dialogue should I write with this? Write an example of a very brief dialogue between at least 2 people who are talking about a recent event. The characters should be about your age(15).
99. ## math
In 2007, 19.6 percent of a certain country's children were living in poverty. If there were 72.8 million children, what number were living in poverty? Express the amount as a whole number.
100. ## what is the answer
An object 8.1 feet tall casts a shadow that is 24.3 feet long. How long in feet would the shadow be for an object which is 20.1 feet tall?
101. ## algebra
Let U= 1,2,3,4,5,6,7,8,9,10 {12345 n 34567 Thank you
102. ## Economics
Why is the south african government is not providing enough welfare on subsidies to the poor and underpriviledged?
103. ## math
Your optimal exercise heart rate for cardiovascular benefits is calculated as follows: Subtract your age from 220 and then find 80% of the difference. Find the optimal heart rate for a 40-year-old and for a 10-year-old. Rounded to the nearest whole number,
104. ## statistics
A researcher was interested in assessing the effectiveness of the Statistics Diet as compared to a regular low calorie diet on weight loss. In the study, obese participants were randomly assigned to one of two groups: (1) the Statistics Diet, which
105. ## Spanish Proofreading
I haven't been able to meet with my Spanish professor to go over my short composition (it basically had to be a past narration using only the preterite and imperfect). If any Spanish speakers wouldn't mind reading it and letting me know what I need to
106. ## statistics
It is known that the population mean for the Quantitative section of the GRE is 500, with a standard deviation of 100. In 2006, a sample of 400 students taking the GRE, whose family income was between $70,000 and$80,000, had a quantitative GRE score of
107. ## statistics
A researcher is interested in whether herbal remedies are effective in relieving allergies, and if so, which ones are most effective. The researcher takes a group of 20 allergy sufferers and randomly assigns each one to receive herbal tea, a homeopathic
108. ## Chemistry
Long question but its my last one for homework and im stuck on this word problem. Biomass is represented by the empirical formula C60H87O23N12P. Write a balance equation for the oxidation of C60H87O23N12P with O2 to form CO2, H2O, HNO3, and H3PO4 beginning
109. ## math
Four similar glass tumblers just fit into a cubical box.The area of the top of the circular cover of any one of the tumblers is 4 pi.The area of each side of the box is a. 16 b. 32 c. 32 pi d. 64 e. 64 pi please answer and explain
110. ## What animals eat
1. What does a hippopotamus(hippo) eat 2. What does a koala eat 3. What does a monkey eat 4. What does a leopard eat CHOICES 1.gum leaves 2.fruit, nectar 3.antelope 4.grass Thanks!
111. ## Science
4. To identify the genotype of yellow-seeded pea plants as either homozygous dominant (YY) or heterozygous (Yy), you could do a test cross with plants of genotype ________. (explain your answer) Do we do a punnet square?
112. ## Astronomy
Imagine you are in a spaceship one million km from a black hole of mass kg. Initially you are flying directly away from it at a velocity of 16.9 km/s. Using the n-body approximation, what is your velocity one second later? Type your answer in metres per
145. ## chemistry
The pH of a 0.00100 M solution of a particular acid is 4.95 at 25°C. Use the solution pH to calculate the concentration of hydronium ion present [H3O+]
146. ## english
I need help with some conversation examples! 1) Write an example of a conversation between at least 2 adults who are talking about the possibility of one of them getting a new promotion with their current company. 2) Write an example of a very brief
147. ## Math
Solve the following equation. y = 6 - x and y = x - 2
148. ## physics
Sunlight strikes the surface of a lake at an angle of incidence of 44.5°. At what angle with respect to the normal would a fish see the Sun?
149. ## physics
A diamond in air is illuminated with white light. On one particular facet, the angle of incidence is 46.05°. Inside the diamond, red light (ë = 660.00 nm in vacuum) is refracted at 17.38° with respect to the normal; blue light (ë = 470.00 nm in vacuum)
150. ## Algebra
Divide. (–6m^9 – 6m^8 – 16m^6) ÷ (2m^3) • –3m9 – 3m8 – 8m6 • –3m6 – 6m8 – 16m3 • –3m6 – 3m5 – 8m3 • –3m6 – 3m5 – 16m3
151. ## MATH
The daily low temperatures during one week were reordered as follows: 2 degrees F, -7 degrees F, 6 degrees F, -3 degrees F, -14 degrees F, -16 degrees F, and -10 degrees F. Explain how you would show a child how to find the average daily low temperature
152. ## math
The Crabby Apple restaurant lost $2000 in the month of January. If their net worth at the end of the month is -$200, explain how you would show a child how to find their net worth at the beginning of the month.
153. ## math
The Crabby Apple restaurant lost $2000 in the month of January. If their net worth at the end of the month is -$200. What was the net worth at the beginning of the month?
154. ## Chemistry
H2 (g) + I2 (g) 2 HI (g) If the initial concentrations of H2 and I2 are 1.0 M and the initial concentration of HI is 0.5 M (Kc = 54.3 at 430oC). (a) Is the reaction at equilibrium? (b) If not, which way will the reaction proceed?
155. ## math
find fifteen different fractions between 1/4 and 1/2
156. ## Astronomy Question about Neutrinos
I can't seem to figure this out, I know that neutrinos have nonzero mass but I don't know how that can help me figure this out The mass of a neutrino is zero. equal to the mass of a proton. equal to the mass of an electron. less than the mass of an
157. ## math mrs. sue HELP!!!
how do u find the mean absolute deviation and what are the steps too!!
158. ## Algebra 2
Game Theory: Consider a game in which each of two people simultaneously chooses an integer: 1 or 2. Find the expected value for player A and the expected value for player B. Is each game fair. Question: If the numbers are the same, then player A wins 1
159. ## Physics
A hiker throws a rock with a mass of 1.4kg from a cliff that is 37 m above the ground . The hiker gives the rock an initial downward velocity of 8.5 m/s. a) What is the energy of the rock at the moment the hiker releases it? b) What is the velocity of the
160. ## physics
A 0.25 kg{\rm kg} object is suspended on a light spring of spring constant 35N/mN/m . The spring is then compressed to a position 17cmcm above the stretched equilibrium position.How much more energy does the system have at the compressed position than at
161. ## math
how do u find the mean absolute deviation of a set of data and please show me how
162. ## math
Let say that Amy made 8 out of 21 free throws and Jane made 4 out of 21 free throws. Who had the better rate of success? Round your answer to the nearest percent.
163. ## Science
Explain what happens when a skydiver reaches terminal velocity? thank you...your help is very much appreciated!!
164. ## MAT 116
If a > 0 and b < 0, then which of the following must be true
165. ## Geometry
Please help me 1.The surface are of the exterior of hollow rubber ball is 16pi in^2.The rubber is 1/4 inch thick. Find the surface are of the interior of the ball. 2. The length of each side of a cube is 6 inches long. Find the exact area of a sphere
166. ## Ethics in Criminal Justice
In contrast to Bentham, John Stuart Mill argued that happiness or pleasure should be understood: A. quantitatively B. qualitatively C. as the same for all people D. as the absence of pain only I am stuck between A and B, but leaning toward B.
167. ## math
a car traveled 91 miles in 3 1/4 hours. What is the cars average speed in miles per hour?
168. ## math
Two mechanical shafts are joined together at their ends. Together, their total length is 17 2/9 ft. If one shaft is 7 5/9 ft long. How long must the other shaft be?
169. ## math
does anybody know how to find the mean absolute deviation and the steps
170. ## math
What is the area of a rectangle that has a length of 3 1/5 miles and a width of 5 1/2 miles?
171. ## physics
A metal ball of mass 1.8 kg with initial temperature of 46.5 C is dropped into a container of 3 kg of water at 15 C. If the final temperature is 22.6 C, what is the specific heat of the metal? metal = ____ J/kg*C?
172. ## physics
10 kg of ice at -4 C is dropped into 15.1 kg of water at 36 C. What is the final temperature of the mixture? T_final =
173. ## physics
A metal ball of mass 1.8 kg with initial temperature of 46.5 C is dropped into a container of 3 kg of water at 15 C. If the final temperature is 22.6 C, what is the specific heat of the metal? c_metal =____ J*kg*C?
174. ## Sciene
Is meiosis actually mitosis happening twice? Why might some people say this?
175. ## math
Emily has 25 rows in her vegetable garden with 19 vegetables in each row. Her mom added 20 more vegetables in the garden. How many vegetables does she have in the garden now?
176. ## Science
GCSE Physics-Forces affecting falling objects. My falling object is a skydiver Can you please help me to find the information needed? Nothing too complicated please. Here is a list of things I need to include but I have no idea where this information can
177. ## Algebra 2
sketch a graph for f(x)=2(1/2)^x +1
178. ## physics
A 1,500 kg car starts from rest and accelerates to a speed of 12 m/s over a distance of 68 m a) calculate the total work on the car b) calculate the net force that caused the car to accelerate (constant force)
179. ## English
I have to write a 1000 word essay on connecting, Hamlet's dealing with rejection, depression to THE real world life. How it affect's me. So can you help me with some dot jots on how depression can relate tothe world (peoples situations) from hamlet?
180. ## Science
What are some ethical issues behind cloning? I already said that some people think cloning is like "Playing God".
181. ## French
I need help revising my french composition. Here is the prompt and my response: Si tu pouvais voyager n’importe où irais-tu? Avec qui? Qu’est-ce que vous y feriez? Attention: tu vas avoir besoin de savoir quelle préposition va avec le pays, ville, ou
182. ## math
he sum of three consecutive integers is 111. What are the integers? (Enter your answers as a comma-separated list.)
183. ## business&technical english
language is used to make comparisons in business communication
184. ## Accounting
NOTE: I NEED HELP WITH THESE 10 QUESTIONS,IT IS AN EMERGENCY PLEASE! Use the following information to answer questions 1-4. The Bayside Company uses the LIFO cost flow method to value inventory. In the current year, profit at Bayside is running unusually
185. ## probability
two cards are drawn in succession without replacement from a standard deck of 52 cards. what is the probability that the first card is a spade given that the second card is a club. what is the probability that the first card is a face card(jack, queen, | 2020-08-07 23:58:12 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4285992383956909, "perplexity": 2355.141367558341}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-34/segments/1596439737233.51/warc/CC-MAIN-20200807231820-20200808021820-00313.warc.gz"} |
https://www.homebuiltairplanes.com/forums/threads/conceptual-design-of-an-inexpensive-single-seat-motorglider.19739/ | # Conceptual Design of an "Inexpensive" Single-Seat Motorglider
### Help Support HomeBuiltAirplanes.com:
#### Topaz
##### Super Moderator
Staff member
Log Member
A couple of days ago, over in the Cheap Air Racing Class thread, I basically volunteered nerobro to share his design process "out in the open" on the boards. He accepted the challenge and he's moving forward with his design in the Designing the Cheap Air Racer thread. Definitely take a moment and check that out.
In fairness, I've decided to put my time and money where my mouth is, and do one myself. Matt G. put it best:
It would be a good way for me to learn more about things I don't know as much about, and for others to learn about stuff I do know a thing or two about.
I'm going to start and maintain two threads. This one, in the "Build Log" section, will be the main thread showing the work on the project. Build Log threads are locked to everyone but the OP, so I'll be the only one posting here. The other thread, in the Aircraft Design sub-forum, will exist so that I can talk with you folks about the project, ask for your advice, and answer your questions. I hope you'll learn some things, and I hope you'll teach me some things.
One thing I can guarantee is that this won't be quick. I own and operate a buisness, and have plenty of "life happening" right now on top of that. I'll work and post as I can. I'm actually several weeks into this design study already, before I decided to start this thread, so I'll be able to post a lot in the beginning fairly quickly. After that, I'll try to post at the same rate I can work on it - a "lunchbreak" worth of work a day, on those days when work allows me to get away from my desk. I don't know if this is going to work - nerobro and I both started these threads today - but I think it's worth a try.
My Design Process
The process I use is very close to the one shown in Dan Raymer's Aircraft Design: A Conceptual Approach, with some stuff from John Roncz's "Designing Your Homebuilt" series in Sport Aviation thrown in here and there, and some other additions from other sources. If you want to follow along with the same resources I'm using, I have the third edition of Raymer's book (other editions should be the same, for the portions I'm using, but equations might be on different pages, etc.), and you can download a PDF of Roncz's article series from here. I'll post other references as they come up. For a preview of what to expect in terms of process and end-result, check out Raymer's first example study in the title above, which is pages 683-725 in my Third Edition.
I don't presume to say that this is the "right" way to design an airplane, or that I have some special knowledge or experience that means it ought to be done this way. It's one way to design an airplane. It works for me, to the extent that it gets me from a starting point to where I want to go. If there's any legitimacy to it, that's because it's mostly Dan Raymer's way of designing an airplane, and he's a recognized authority on the subject. None of my design studies have ever been built or flown, so take this whole thing for what it's worth - a description of a partially self-taught design process by an inexperienced amateur. Caveat Emptor!
Thanks for your interest, and let's get started...
#### Topaz
##### Super Moderator
Staff member
Log Member
Many of you know of my main project, a two-seat motorglider. While that project is moving along, the various "cheap aircraft" threads keep catching my eye rather severely. It sure would be nice to have a very small single-seater to use as an experience builder, a testbed to try out some of my ideas before committing to them on the larger project and, when it's done, a simple fun-flier while the two-seater is in the build process. The low-cost aspect especially interests me, much as it does many of you.
We have much disagreement on that score, with some people opining that it's impossible to design and build an airplane for less than "X" dollars, with X ranging from $15,000 to$50,000 and higher.
Well, that's absurd, folks! This little glider was built for $500 dollars a few years ago, according to its designer/builder. And it most certainly is "an airplane". [video=youtube_share;yls_Vgvc410]http://youtu.be/yls_Vgvc410[/video] So the real question isn't "Can you build an airplane for$X?".
The real question is, "How much will it cost to build Y airplane with Z capabilities?"
And that's what I want to do here.
A conceptual design study, according to Dan Raymer, answers the following questions:
.
What requirements drive the design?
What should it look like?
How much should it weigh?
How much should it cost?
What technologies should be used?
Do these requirements produce a viable airplane that can meet the requirements in the real world?
.
The purpose of this study is to see if I can come up with a viable conceptual design for a cost-conscious single-seat motorglider, and then to have a rough estimate of what it might actually cost to build. Those answers are the results. I won't have plans. I won't have structural analysis or even loads analysis. But I'll know enough about the airplane to make an informed decision as to whether it's worth moving forward with those efforts, pointed towards actually building one.
Next post: Developing a viable set of requirements.
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
The first step in any aircraft design process starts with deciding what you want to do with the airplane. You're setting the requirements for the design. The requirements drive every decision you make later. They literally design the airplane.
WHAT DO I WANT?
At the most general level, what am I looking to accomplish with this project? What do I want?
My two-seat motorglider project is going to be awesome - a distillation of everything I think I want in an airplane. That makes it a bit of a daunting task for someone who's never completely designed and built an airplane before. No pressure, right?
I keep seeing the various "cheap airplane" threads and find myself drawn to the idea of a very small, very "inexpensive" (whatever that actually means) airplane that I could use to gain design and construction experience for the more-advanced two-seater. NASA didn't go to the Moon straight-off; they did Gemini first to test ideas and methods, and to find out what they didn't know. I personally think that's a good approach.
I also happen to think a little single-seater would be a heck of a lot of fun, all on its own. Something to putter over to the next airport for breakfast or a burger (we have some decent airport cafes in the area), or to attend an airshow (we have several decent shows around here, too). Maybe down the coast a bit on a pretty day, or to visit and do the Dawn Patrol bit with my friend from Boeing (who is also working on his own design). I'm also a soaring nut, and being able to head out to Elsinore any day I have open (whether a tow plane is available or not) and trade thermals with the hawks would be perfect. A motorglider would be great as a soaring cross-country trainer, too, so I can build my skills without having to make The Call Of Shame for a pick-up and trailer home.
So no major powered cross-country. No flight levels. No night. No weather. Probably not very fast. I don't have to make a meeting using this airplane and, if the weather isn't nice, I just don't fly. Simple. Fun. Uncomplicated.
This sort of airplane generally falls into the category called a "touring motorglider", as distinct from a self-launching sailplane or something like a Hummelbird or Sonex.
Another consideration is that I'd like the airplane to be a learning tool - a place to experiment with ideas I have and techniques with which I really don't have any real-world experience. My mixed throttle and air-brake "quadrant" is the sort of thing I'd like to try out - and rip out if it doesn't work. As such, this airplane doesn't have to be "fancy". In fact, it shouldn't be. Simple is the order of the day, both in the design process and in terms of the build. "Good enough" to do the job, but "quick and dirty" enough that I can get the process done relatively quickly.
This enters into cost as well. This isn't my "ultimate dream airplane". It's my "good enough training airplane." The design and construction equivalent of buying a used C-150 to build hours. So spending a bunch of money on it would be counter-productive. I don't know exactly what the number is yet, but there's a dollar value above which it just won't be worth it to me to spend on this kind of airplane.
And lastly, there's the question of "everyone else". This is an "X-plane" for me. A testbed. I guarantee there will be things I'll learn that I would want to change before selling plans or kits. No, this one is just for me. A one-off. If it turns out to be awesome and I get enough requests for plans or a kit, I can develop a "production" version of the airplane that incorporates all the lessons-learned. But that's down the road. This one bears the weight of no such considerations.
That's the 10,000 foot overview. The start. The gist.
Now I need to get back to work. Clients are waiting!
Next Post: Starting to break down the "general wish list" down into a detailed requirements list.
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
I'm waiting on a call-back from a client, so I have some time to move on to the next post.
So, I have a "big picture" view of what I want out of an airplane like this. That guides the design process, but it's not enough to actually do any design. To get there, I need to start breaking that "wish list" into some real numbers. This isn't part of Raymer's book, but the process I've developed for my own work accomplishes this task by asking four discrete questions about the airplane, and then answering them in as much detail as possible.
The four questions are:
Who? - Who will be flying the airplane? Who will be flying in the airplane (meaning you include passengers, too). How big are they? What do they weigh? Who's the biggest and smallest person the design will accommodate?
What? - What kind of flying will our intrepid pilot be doing? Aerobatics? Soaring? Powered Cross-Country? Soaring Cross-Country? $100 Burgers? You have to pick one, maybe two at most. We all want the perfect airplane that does everything, but it just doesn't work that way: "Jack of all Trades and Master of None" is what you'll get. Have some discipline when looking at this one. For what kind of flying do you want the airplane to be especially suited? Where? - What kind of airports (specifically, or actual specific airports, if you know) will the airplane frequent? Are there any "edge cases" that drive the design? What are the runways like? How long? Every airplane uses a "runway," even if your machine is highly-STOL and that runway is a 50' long sand bar on some river somewhere. Also included in "Where?" is the airspace and altitudes to be frequented. Are you going to be cruising up in the flight levels or smashing bugs down in the weeds? When? - "When" is kind of a catch-all: Not just time of day (Day flying only? Night too?), but also the weather conditions. I know, that seems arbitrary (it could fit in "Where," too), but I think of weather as a time-based phenomenon that changes constantly, which probably gives me a bias for putting it into the "when" column. That might be a sailplane pilot thing, since we're watching the weather and its changes so intently, all the time. So, "when" will you be flying the airplane? VFR only? IFR? Fire-bombing a raging forest fire? What are the "worst" transient flying conditions in which you want to be flying this thing? I know this is a somewhat controversial list, and I'm sure every designer has their own way of accomplishing the same thing. The goal here is to break down the "ten-thousand foot view" in my last post into hard "conditions" and data. Things to which we can attach actual, hard numbers that the design must accommodate or for which the airplane must be suited. This is actually a lot harder than it first appears, and the "four questions" are my attempt at organizing that process and making a rational division of information. Your mileage will very probably vary on this one. No call from the client yet (argh!), so let's get into the first question: "Who" is going to be in this airplane? Given that this is a one-off, truly experimental airplane, the obvious first answer is me. Topaz Height: 5' 10" Weight: 175# Who else? Just for the sake of appreciating the long, strange, airplane-design road we've been through since we met in college, I'll probably want to trade cockpits at least once with my friend at Boeing - we'll call him "Joe" - who's also designing his own airplane. Joe 6' 0" 200# Anyone else? I know a few people who'd probably want to fly the plane - and whom I'd let do so - but I'm pretty sure they're all within an inch of Joe's height and between the two of us in weight. So let's call the "biggest pilot" for this airplane to be as follows: Maximum Pilot Height: 6' 1" Weight: 200# "Minimum Pilot" is actually quite a bit harder in my particular case. I'm either the shortest or lightest pilot I can foresee flying this airplane, off the top of my head. My girlfriend is not a pilot, and I don't foresee her getting her cert in the future. I guess I can sandbag anyone smaller who comes along, and design the airplane to handle someone a bit shorter than myself. Minimum Pilot Height: 5' 6" Weight: 175# As a single-seater, there will be no passengers unless something at the Elsinore dropzone has gone terribly, terribly wrong. :shock: Baggage? Yeah, I'll probably want to bring something, especially to airshows and such. I'm not fond of paying$25 for a hot dog and coke at an airshow, so maybe I'll bring some lunch of my own, and a big bottle of water. If you were doing a powered cross-country "traveling" airplane, what I'd do is actually pack for the kind of "biggest" trip you expect to take in the airplane. I mean really put the clothes and toiletries in your bags, and then add a little weight for bringing home knick-knacks and "lousy T-shirts" for family members. Then measure and weigh the bags. You might be surprised.
For this airplane, it's a bit easier. I'll assume the baggage requirement is as follows:
Baggage
Size: One "day-pack" style bag. Measuring my favorite day-pack, it's 20" tall, 15" wide, and (packed) 10" deep.
Weight: In total, including bag: 20#
So, for the moment, I'm going to revise my "Maximum Pilot" down in weight, by the weight of the baggage he won't be carrying:
Maximum Pilot
Height: 6' 1"
Weight: 180#
The beauty of this is that I can now pretty much dispense with this "Maximum Pilot", "Minimum Pilot" nonsense. They're only five pounds apart. Now I have a "Design Pilot":
Design Pilot
Height: 5' 6" to 6' 1"
Weight: 180# (Up to 200# without baggage)
That worked out nicely for me here, and it's a trick you'll see even in Cessnas and other Part 23 aircraft - the designer trades baggage, fuel, and other weight for passenger weight. It's why you hear an obviously four-seat aircraft so often referred to as "not really a four-seater". You can carry four adults, or you can carry two adults and full fuel and baggage. But you can't do both without going over maximum takeoff weight (MTOW), which pilots call "gross" weight.
If you're going to do this for a two- or more-seater, you'll end up with a definite "maximum-minimum" range of weights, from smallest-possible-solo-pilot-without-baggage on one end, to "load everyone and everything up and let's go to Bermuda for a month" on the other.
I'm not going to worry about fuel weight yet. That comes quite a bit later.
Next Post: Continuing to answer the 'four questions'.
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
Moving on to the next question of the four: What?
Here is what I said about the kind of flying I want to do with this airplane:
I also happen to think a little single-seater would be a heck of a lot of fun, all on its own. Something to putter over to the next airport for breakfast or a burger (we have some decent airport cafes in the area), or to attend an airshow (we have several decent shows around here, too). Maybe down the coast a bit on a pretty day, or to visit and do the Dawn Patrol bit with my friend from Boeing (who is also working on his own design). I'm also a soaring nut, and being able to head out to Elsinore any day I have open (whether a tow plane is available or not) and trade thermals with the hawks would be perfect. A motorglider would be great as a soaring cross-country trainer, too, so I can build my skills without having to make The Call Of Shame for a pick-up and trailer home.
So this airplane will be doing:
1. Casual low-performance powered cross-country flying.
2. Casual around-the-airport self-launch soaring.
3. Cross-country soaring training.
Breaking this up into powered and unpowered flight modes, I can draw some conclusions from these "general" missions. I'll get much more into the specifics for the powered mission in answering the "where" question, but there's information we can pull from that even now.
Powered Flight
1. I'm not asking the airplane to do any aerobatics (and with the long wings of a motorglider, it'd be a pretty sluggish aerobat anyway), so a Normal Category g-rating is sufficient.
2. $57 burgers, airshow runs, and flying down to Oceanside don't require a lot of speed, especially since it's all going to be fairly short-range stuff. I'd naturally like it to be faster than a car, but part of the appeal is to stay fairly low and watch the countryside roll by. Last time I drove down for an airplane design work session with Joe (we trade off locations, with him driving up here every other month), I checked the time and distance, and came up with an average speed of 56 mph. Checking on Google Maps today (reflecting another day's traffic conditions) gives almost exactly the same expected average speed. Doubling that speed would be nice, so I'll set the goal cruise speed at 110 mph for now. It's not really fair to compare door-to-door speeds for a car to cruise speeds for an airplane (I'm not including the drive to the airport, for example), but you have to start somewhere. I'll revisit the goal cruise speed when I look at an actual list of destinations in the "Where?" question. Maybe something will pop up there to change it but, for now, goal cruise speed is going to be 110 mph [96 knots]. 3. Cruising altitude. Totally going to be a local thing. Flying around the LA/OC basin, I've always found 4500-6500' MSL to be a good VFR cruising altitude here. You're up out of the worst of the surface turbulence, but you're not up into the approach traffic for LAX, SNA, or ONT. Now, I haven't done any SEL flying in the Basin in a while. Anyone who lives in the area and is reading this, would you mind chiming in on the discussion thread about your thoughts here? We're talking casual Day-VFR flight in this area on, say, a$57 burger mission. What altitude suits you for cruising around here? Pending that discussion, I'm going to set the powered-flight design cruising altitude at 5,500' MSL. This is another area that I'll revisit when I get to creating a real list of destination airports.
Time to go to work. I'll come back to this at lunchtime.
Next Post: Continuing answering "What?" for soaring flight.
____________________________________________________
CURRENT SPECIFICATIONS LIST
as of this post.
Design Pilot
Height: 5' 6" to 6' 1"
Weight: 180# (Up to 200# without baggage)
Baggage
Size: One "day-pack" style bag. 20" tall, 15" wide, and 10" deep.
Weight: In total, including bag: 20#
PERFORMANCE
Powered Flight
Design powered-flight cruise speed, Vc = 110 mph [96 knots] (161 fps)
Design cruising altitude = 5,500' MSL (standard day)
RESTRICTIONS AND CONSTRAINTS
Limit load rating: -1.5g to +3.8g (Normal Category)
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
INTERLUDE
We work before we play. :-/
A client pushed up a deadline by an entire week - they do that sometimes - and so yesterday turned into a hectic day that has spilled over into today. So no airplane work for me yesterday, and today isn't looking good either. Sorry for the delay.
I do want to speak a moment about how much effort I'm putting into developing the requirements and specifications for the project. I'm sure more than one of you are saying, "Hey, when are you going to start actually designing something?". It's a fair question.
The answer, for me, is that setting up rational and realistic requirements is probably the most important part of the entire design process. These conditions and numbers will drive the entire rest of the project, and the airplane will be optimized to work best under these conditions. Get it wrong - set up requirements that don't actually reflect how you'll really use the thing - and you're going to be designing and building the wrong airplane. What comes out will be something you don't really enjoy, however you actually are using it, and it won't perform as well in that other set of conditions.
Setting requirements and specifications isn't something to be done quickly or lightly. Take your time. Get it right.
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
Repeating my previous call for aid. I haven't flown SEL in the Los Angeles/OC Basin in quite a while. For those of you who have flown the Basin in the last ten years, what have you found to be convenient and useful VFR cruising altitudes? I'm particularly interested in altitudes for local flights where both ends are within the Basin.
#### Topaz
##### Super Moderator
Staff member
Log Member
That set of catalogs with the rushed deadline is about ready to go to press, on the new schedule, so I have some time to start getting back to the "What?" question for my project, now for the soaring missions:
Soaring Flight
1. Sailplanes pilots seek out what power pilots call "turbulence", because it usually reflects convective lift that a sailplane can use to gain altitude. However, it can still be a bumpy ride sometimes. Because of this, sailplanes generally are designed to a higher limit load value than the FAR 23 Normal category. The factor of safety is the same: 1.5. Since my airplane will be soaring, I'm going to increase the limit load factor value to reflect the JAR 22 Utility category values for sailplanes, instead of the FAR 23 numbers I used earlier. JAR 22 has only Utility and Aerobatic categories, and doesn't have a "Normal" category. JAR 22 actually sets four limit load values, with positive and negative numbers for both VA and VD, the latter of which we call VNE here in the States. JAR 22.337 sets limit load values of +5.3g and -2.65g at VA and +4.0g and -1.5g at VNE for Utility category gliders. For the sake of simplicity at this point, I’m just going to use the greater-magnitude VA values
2. Quantifying the minimum sink rate needed will depend on the local conditions where I'll be soaring most of the time, so I'll get to the details of that in the "Where?" section for soaring. For the moment, I'll use the minimum required rate of descent listed in JAR 22.71(a): -1.0 m/s, or roughly -196 fpm. That’s about the same as an SGS 2-33, and I know I want to do better than that. How much better will be determined by the local conditions in which I expect to fly - another "Where?" answer. But this will do for now.
3. For casual near-the-airport soaring and ridge soaring, L/D isn't as important as a low minimum sink rate. L/D is always important for intra-thermal glide and looking for thermals, but being able to use weak thermals or orographic lift to stay up will count for more days that don't turn into sled rides. For the moment, and based purely my experience of flying sailplanes with the LESC, I'm going to set an initial soaring L/D goal of 30:1. This matches the SGS 1-34.
Next Post: Getting into the nitty-gritty of performance requirements: "Where?"
____________________________________________________
CURRENT SPECIFICATIONS LIST
as of this post. Values in red have have been changed or added by this post.
Design Pilot
Height: 5' 6" to 6' 1"
Weight: 180# (Up to 200# without baggage)
Baggage
Size: One "day-pack" style bag. 20" tall, 15" wide, and 10" deep.
Weight: In total, including bag: 20#
PERFORMANCE
Powered Flight
Design powered-flight cruise speed, Vc = 110 mph [96 knots] (161 fps)
Design cruising altitude = 5,500' MSL (standard day)
Soaring Flight
Design minimum sink rate: -1.0 m/s [-196 fpm]
Design maximum L/D ratio: 30:1
RESTRICTIONS AND CONSTRAINTS
Limit load rating: -2.65g to +5.30g (JAR 22 Utility Category)
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
Wow. It's great to have all the business in the shop, but it's not leaving a lot of time for airplanes!
Last time I posted, I'd finished up the "What?" question - what kind of flying will I be doing with this airplane? That filled in the blanks in my requirements list for limit load ratings and gave me preliminary values for cruising speed and altitude for powered flight, and for minimum sink and L/Dmax for soaring flight.
Now it's time to get those latter "preliminary" values nailed down, using the characteristics of specific locations to drive the requirements for my airplane. Since this airplane is just for me, this is largely a data-gathering exercise. Where will I be flying, and what are the characteristics of those places? From this information, I'll get:
.
• Takeoff and landing distances
• Runway surfaces to accommodate
• Actual powered-flight range required
• Cruise speed for powered cruising flight
• Climb rate at sea level, for an adequate climb rate hot-and-high at real airports
• Minimum sink required for my most-frequent soaring spots
• L/Dmax needed for the kind of soaring I'll really be doing
First thing is to gather together a list of places I'm going to be flying from and to with this aircraft. Since it's not intended to be a long-range cross-country aircraft, the list will be relatively short, and mostly local airports. Out of that list, I've pulled out the ones that are close to my home base airports and with really long, smooth runways. Those aren't going to drive any requirement, so I'll save some time by not having to collect data about them.
Further, I'm splitting the airports into three categories: Home Bases, Frequent Destinations, and Occasional Destinations. When I'm pulling requirements from these airports, it makes sense to keep an eye on them to see if any one place is really pushing a characteristic of the airplane much farther than any of the others. If that's a home base or some place to which I'll be flying a lot, it makes sense to really consider accommodating that need. But if it's someplace I'll only fly occasionally, and it's really driving a big increase in wing, or engine, or some other part of the airplane, I may want to just throw that out as a destination for this airplane. Perhaps I can rent a plane to fly there, or find some other way to get rid of that particular extreme requirement.
For each airport, I need four pieces of information:
.
• Elevation - Combined with likely "high" temperatures for that airport, it gives me a worst-case density-altitude for takeoff and climbout.
• Runway Dimensions - The shortest runway is going to drive my actual takeoff length requirement. Runway width can have an effect on certain landing gear types. In each case, I want to look at the shortest, narrowest runway at each location. The bigger runway may be closed or operations may be restricted to certain kinds of aircraft. While I should be able to learn about any runway closures by calling the airport in advance, there's always the chance of something unexpected happening, and I'd hate to enter the pattern at a destination airport, only to find out that the runway I need isn't available.
• Runway Surface - Mostly drives the design of the landing gear (tire sizing, etc.), but dirt runways also present a FOD hazard for pusher propeller installations, so this can affect the final overall configuration.
• Obstructions - Are there any large obstructions off the ends of the runway? This could drive an "Angle of Climb" requirement.
I got this information for each airport from AirNav.com, a nice pilot resource that happens to be handy here, too. Rather than re-type my list of airports and the data about them, I'm simply going to attach a PDF of the pages out of my study document. You should see that PDF below. Clicking it will download it. If you don't have a reader for PDF files, you can get one for free from Adobe here.
Next Post: Pulling takeoff and landing requirements from this list.
#### Attachments
• 150.8 KB Views: 510
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
Takeoff and Landing
Okay, let’s take a look at the list. For the takeoff run, the things that matter are:
.
• Runway length
• Potential for high density altitude
• Runway surface
Looking at my list, the shortest runways are:
.
1. Hemet-Ryan (HMT) - 2,045'
2. Oceano (L52) - 2,325'
3. Crystal (46CN) - 2,700'
4. Oceanside (OKB) - 2,712'
5. Santa Paula (SZP - 2,713'
6. Skylark (CA89) - 2,800'
The airports with the potential for high density altitude (high geographic altitude and frequent high heat) are:
.
1. Mountain Valley (L94) - 4,220' and summer highs in the 90°F+ range: DA=7,396', density ratio=80.09%*
2. Crystal (46CN) - 3,420' and summer highs in the 90°F+ range: DA=6,420', density ratio=82.52%
3. Banning (BNG) - 2,222' and summer highs in the 90°F+ range: DA=4,957', density ratio=86.28%
4. Twentynine Palms (TNP) - 1,888' and summer highs in the 90°F+ range: DA=4,549', density ratio=87.35%
5. Hemet-Ryan (HMT) - 1,512' and summer highs in the 90°F+ range: DA=4,089', density ratio=88.57%**
6. Skylark (CA89) - 1,253' and summer highs in the 90°F+ range: DA=3,772', density ratio=89.42%
* Calculated on www.pilotfriend.com. These were all calculated for 90°F, 29.92 mmHg, dew point 65°F.
** Catalina (AVX) is higher in geographic altitude than the last two airports on this list, but even summertime temperatures are kept below 80F by the surrounding ocean (Catalina is an island 22 miles off the California coast). Calculated density altitude for this airport at 75°F is 3,245, well below the others on the list.
And lastly, the worst runway surfaces are:
.
1. Mountain Valley (L94) - “Asphalt/Dirt, in fair condition. Partially paved portions of the runway 20 feet wide.”
2. Skylark (CA89) - “Packed sand, clay.”
3. Catalina (AVX) - “Asphalt, in fair condition. (Potholes and loose pavement fragments on runway.)”
Well, that data tells a tale! Three of these airports see density altitudes during the day of nearly 5,000 feet and even much more. The air density at Mountain Valley (L94) on a 90°F day is only 80% of that on a “sea level, standard day”. At least that airport has a long runway!
I’m not sure that trying to accommodate all of these runways mid-day is a smart way to go. Takeoff performance is largely driven by power-to-weight ratio and wing loading, and getting better performance requires more engine or more wing, or both. I’m trying to keep this airplane small and inexpensive, so I want less of both.
Without running actual numbers, I don’t know which of these airports is going to end up really driving the takeoff performance the most. It's going to be a combination of runway length and density altitude. My guess is that it’s going to be either Hemet-Ryan (HMT) because of the short runway or Crystal (46CN) because of the high density altitude. Mountain Valley (L94) has a much longer runway, and the reason I’d be going there is to attend the Experimental Soaring Association fly-in, so I’d likely be spending the night and be able to fly out in the morning when it’s cool. In the case of Hemet-Ryan (HMT), there is a much larger runway that normally I could use, so if the short runway I’ve chosen there drives the design too far, I can perhaps qualify that particular runway as “optional”.
Fortunately, none of these airports are on my “frequent destinations” list, so I can consider them more carefully when I go to determine the wing loading needed for takeoff. So this will be my first “trade study” to do - finding out if any of these airports significantly drives the requirements of the aircraft, and whether I can plan to fly there at a cooler time of day or time of the year. I’m starting a list of trade studies that I’ll want to do at the appropriate time in the design process.
In terms of runway surfaces, nothing really jumps out here. I have extensive experience with Skylark (CA89) and, while it’s dirt and clay, it’s fairly hard-packed and shouldn't impact takeoff performance much. I've called out Mountain Valley (L94) and Catalina (AVX) for the possibility of potholes, broken pavement, and debris on the runway. I haven’t flown at either of those, so I don’t know how bad they are, really, but given that both have operations on a regular basis, they can’t be much worse than Skylark. I think all of these will be more relevant to FOD damage potential than for impacting the takeoff run.
Next Post: Defining my takeoff performance requirement.
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
It's frustrating, but there doesn't seem to be any guidance anywhere about choosing a takeoff distance for a single-engine airplane, given available runway lengths. Multi-engine airplanes get all sorts of stuff for balanced field length, etc., but it seems to be the assumption that a single-engine airplane will use up all the available runway and, if there's a power loss on takeoff, you just end up in the weeds. Anyone have any input on this? Post it to the discussion thread, please. You can find the link for that in my signature line below.
None of the runways I'm listing are particularly short for a small, non-STOL, single-seat aircraft. Unless it adversely affects the choice of wing loadings, I can afford to "save" a little runway to put the airplane back down again if there's an engine failure right after lift-off. So, let's take a look at what that might mean.
The shortest runway on my list is Hemet-Ryan (HMT), at 2,045'. Assuming the airplane were at an altitude of 50' at a point 60% of the way down the runway (1,227' from start), I'd have 818' left to get the airplane down and stopped. Neither of those numbers seem completely unreasonable, and they're even easier on the next-shortest runway, Oceano (L52), at 1,395' and 930' respectively.
I'll check these numbers carefully when I'm looking at wing loadings for takeoff and landing but, for the moment, I'll specify that my takeoff and landing requirements will be as follows:
Takeoff distance: 60% of the available runway length for the most-adverse runway (length and density altitude), and the airplane will be at 50' AGL at this point.
Landing distance: 40% of the available runway length for the most-adverse runway, starting at an altitude of 50' AGL.
I still don't know which is going to be the "most adverse" runway, so I'll run the takeoff and landing wing loading numbers for the following two cases:
2,045' 1,227' 818' 4,089' 88.57% 2,700' 1,620' 1,080' 6,420' 82.52%
[td]Airport[/td]
[td]Runway Length[/td]
[td]Takeoff Distance[/td]
[td]Landing Distance[/td]
[td]Density Altitude[/td]
[td]Density Ratio[/td]
[td]Hemet-Ryan (HMT)[/td] [td]Crystal
(46CN)[/td]
Whichever comes out as requiring the lowest wing loading will be the "worst case" that will drive the design. You'll recall that I'm "throwing out" Mountain Valley because I'm going to be able to reasonably avoid high density altitude conditions by virtue of the reasons I'll be traveling to that airport, plus it has a much longer runway. I’ve looked at all the other airports, and the “worst case” is going to be one of these two. I’m betting it’s Crystal, myself.
Next Post: Defining a climb rate requirement.
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
I jumped the gun - the next item on my list from post #9 is setting the range requirement, not climb. Soooooo...
Cruise: Range, Speed, and Altitude
Using Skylark Field (CA89) as the starting point, here are the four farthest destinations on my list of airports. I'm using the great circle distance to figure out which ones I should check for an actual flight distance. I calculated these using a neat online tool: Great Circle Mapper.
.
1. Fresno-Chandler (FCH) - 223 nm (257 statute)
2. Oceano (L52) - 187 nm (215 statute)
3. Mountain Valley (L94) - 104 nm (120 statute)
4. Santa Paula (SZP) - 98 nm (113 statute)
These are all fairly trivial ranges for a sportplane, even one like this, and especially so since I’m hoping to use a fairly small motor for this airplane. I don’t see any reason to discard any of them, since I don’t think they’ll greatly affect the sizing of the aircraft. The farthest two are both “\$57 burger” destinations (I hear the food is good at Fresno-Chandler - ahem - and I know from experience that Oceano is a great place to go for a bite of lunch), so if, somehow, those destinations prove to make the airplane too costly, I can always discard them and make those trips in two stages with a fuel stop.
Next Post: Calculating actual flight range to the furthest two airports and setting the design cruising speed, range, and altitude requirements from that data.
#### Topaz
##### Super Moderator
Staff member
Log Member
How Far Is It?
The distances in my last post above are all great-circle routes - the closest thing you can get to a straight-line distance between two points traveling on the surface of a sphere called Earth. Unfortunately, even a great circle route usually isn’t the way we get to fly our airplanes. There are Restricted areas, MOA’s, Class B and C airspace, and natural obstructions like mountains that get in the way and force diversions. For a little bug-smasher like this thing I’m designing, all of those have to be taken into account to find the actual range to a given destination.
Using an online tool called Skyvector.com I’ve sketched out rough cross-country flights to the two farthest airports in my list above. I didn’t take the time to really dig into them in detail, with all the navigation, but I plotted a likely-looking flight path that avoids the mountains, Class C airspace (where possible), Restricted areas, and so on that lay between Skylark Field (CA89) and each destination. Here’s a screen grab of one of them. The pink line is the route I’ve selected.
As you can see from the bottom of the Flight Plan dialog, the real-world flight path distance between Skylark and Fresno-Chandler isn’t the 223 nm of the great-circle route, it’s 252 nm. Looking at the ground altitudes en route, it looks like the highest terrain under the airplane is about 5,000 feet MSL just north of Quail Lake Sky Park (CL46). So much for my 5,500 foot design cruising altitude! This is why I go to these lengths when writing requirements for an airplane. My original assumption was just wrong. Not way wrong, but it's good to have the right numbers in there, and who knows what the future will bring for destinations?
Taking this into account, I’ll set the design cruising altitude to 7,000 feet MSL: half-way between the outbound VFR cruising altitude of 6,500 feet MSL and the return altitude of 7,500 feet. Not all of the route requires these altitudes, but it’ll be nicer to get up out of the surface thermals for a cross-country flight. I won’t get bounced around as much.
I’ll also note two more datapoints: At my current design cruise speed of 110 mph (96 kts), not accounting for climbout, etc., the estimated time en route to Fresno-Chandler is two hours and thirty-eight minutes. The estimated time en route to Oceano is two hours and nineteen minutes. We’ll come back to that in a later post.
An inland flight to Oceano (L52) proved to be 223 nm, with similar en route altitudes.
So now I’ve set my design cruising altitude and my required design range. Next comes the matter of extra range, to account for headwinds, unexpected destination airport closures, etc. Bumping the Fresno-Chandler range up to 300 nm gives me nearly 50 nm over the expected still-air range, and that’ll do for the moment. That brings the design cruising mission to 250 nm (no reserves) plus 50 nm (reserve), all at 7,000 feet MSL. Into the requirements table they go!
Next Post: Revisiting en route cruising speeds.
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
A Better Look at Cruise Speeds
Now that I have a very good idea of the actual range specification, I'll take a quick look back at my initial cruise speed specification. That was 110 mph, which works out to 96 knots.
My loose goal was to be "twice as fast as a car" for the same trip. I've got two explicit trips to look at now, so how long would those take by car? Google Maps to the rescue.
Skylark (CA89) to Fresno-Chandler (KFCH)
According to Google Maps, it'll take me 4h 32m to drive from Skylark Field to Fresno-Chandler at the moment. Maps says the trip would take 4h 14m if there were no traffic issues.
Half of that time is 2h 7m, which, over 252 nautical miles for the air route I chose earlier, yields 119 knots, or 137 mph to get there in half the time of driving.
Skylark (CA89) to Oceano (L52)
Google Maps says it’ll take me 4h exactly to drive to Oceano County Airport from Skylark, without traffic. Half that is 2h, which yields a 112 knot cruise (128 mph) for the 223 nm flight path.
Both of those are a little faster than the 96 knots (110 mph) I’d specified earlier. BBerson noted in the Discussion thread that getting 110 mph from a small motorglider would be a challenge without a large (expensive) motor, and he’s quite possibly right. But I don’t know yet, and that’s part of the point of this design process: How much will it cost to meet these specifications I'm developing? The Stemme S-10 cruises at 140 knots (161 mph), so it’s not like a cruise like this is impossible for a motorglider.
For the time being, let’s call the design cruise speed out as 115 knots (132 mph). This may, indeed, prove unrealistic for an “inexpensively” small engine, so I think it’s prudent to set a lower bound, or “threshold”, on cruise speed. In other words, the lowest cruise speed I’d accept if I got everything else I want out of this design. If the final design falls somewhere between these two numbers, it’ll be “good enough”.
Getting there at the same speed as a car seems, to me, to be setting expectations too low, so let’s say getting there in three-quarters of the time to drive the trip in a car is “good enough”, instead of half the time. Plugging that into the more-critical Fresno-Chandler case, I get a flight time of 3h 11m, and a cruise speed of 79 knots (91 mph). That seems reasonably attainable for a clean motorglider with a smallish engine, considering the Monnett Moni gets better than that - (96 knots / 110 mph, exactly my initial specification) - on its 30hp KFM. Let’s call the threshold value 80 knots (92 mph) for simplicity, and have done.
#### Topaz
##### Super Moderator
Staff member
Log Member
INTERLUDE - Pause and consider...
Initially I'd been putting a log of the specifications and requirements I've developed up on this thread, as they were completed. As more and more stacked up, and some of them started needing both "goal" and "threshold" values, I took to using a table in my design notebook to tabulate my specifications. (I'm using Google Docs for the design notebook, BTW.) Unfortunately, when using HBA in "code" mode, writing up tables is a real PITA. So you've stopped seeing a running tabulation of the specifications, and instead are just getting the analysis that leads up to them.
Just to give everyone a clear view, I've attached the specification sheet for this airplane as looks like right now. Some of the fields still contain "???" because I don't know those values yet. A few fields are filled in that I haven't discussed here; mostly stuff that's called out by JAR 22 and that I want to adopt verbatim for this design. There are some fields that don't show up yet, but will be added later.
This sheet is the point of all the analysis so far. This document, when completed, will drive the entire design of the airplane.
View attachment DS54-Draft Specifications 09-23-2014.pdf
Looking at these numbers, you can already start to get a feel for what this airplane will be like, can't you?
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
Ah, a weekend with no "business" work. This means I get to work on airplanes a bit!
Climb: How Fast, What Angle?
Climb rate shouldn't be much of a problem with this aircraft, with the long wings it will almost certainly have, but, because I live in the usually-warm American southwest, density altitude issues make climb rate and angle something that definitely needs some of my attention.
Regulatory Guidance
Both JAR 22 and FAR 23 have minimum specifications for climb rate. It should be noted that these really are minimum acceptable requirements, not a target or goal.
JAR 22.65 - Climb
(a) For a powered sailplane the time for climb from leaving the ground up to 360 m above the field must not exceed four minutes with:
1. Not more than takeoff power.
2. Landing gear retracted.
3. Wing flaps in takeoff position.
4. Cowl flaps (if any) in the position used in the cooling tests.
.
FAR 23.65 - Climb: All engines operating.
(a) Each normal, utility, and acrobatic category reciprocating engine-powered airplane of 6,000 pounds or less maximum weight must have a steady climb gradient at sea level of at least 8.3 percent for landplanes or 6.7 percent for seaplanes and amphibians with—
1. Not more than maximum continuous power on each engine;
2. The landing gear retracted;
3. The wing flaps in the takeoff position(s); and
4. A climb speed not less than the greater of 1.1 VMC and 1.2 VS1 for multiengine airplanes and not less than 1.2 VS1 for single—engine airplanes
.
A couple of things jump out from the two regulations:
JAR 22.65 mandates an average climb rate for the first 360 meters (1181 feet AGL) of 295 fpm. Unlike the FAR 23 rule, there does not seem to be a specification for the altitude at which compliance must be shown - just that it must be shown through flight test. The second bit is that, unless I’ve missed it, FAR 23 no longer specifies a minimum rate of climb, but rather now specifies a climb gradient instead. When my (third) edition of Raymer was published, the FAR 23 specification was 300 fpm at sea level, all engines operative.
In a way it's nice that this happened. Both definitions of climb performance are important. Climb angle (or gradient) is what you care about when you want to clear those trees at the end of the runway, or the mountain ridge en route. Climb rate is what you care about when you're on a trip and want to get to cruising altitude quickly, or when you're self-launching to soar that booming cumulus that just formed over the hottest thermal of the day.
A quick look at the Obstructions column in my table of airports linked to post #9 shows nothing really worrisome in terms of climb angle, especially if I'm 50' off the ground at the 60% point of the runway, per my takeoff specification.
So my threshold requirement for climb is pretty easy: adopt both the JAR 22 climb rate requirement and the FAR 23 climb gradient requirement.
However...
Both of those specifications represent a fairly weak climb performance and, if the airplane can only do that on a 59°F sea-level "standard day" (which almost never happens here in SoCal, even in mid-winter), how is it going to perform at, say, Crystal (46CN) on that 90°F day I'm looking at for takeoff? Not well at all.
The simple solution seems to be that, if I'm setting a takeoff parameter for the cases in Table 1 of my specifications table (last updated and linked in post #15), I'll need to climb out from either of those places under the exact same conditions. Crystal (46CN) is clearly the worse density altitude case of the two, so I'll stipulate that, as a threshold requirement, my airplane has to meet the JAR 22 and FAR 23 climb requirements at Crystal in the conditions specified in Table 1.
I don't have a particular goal requirement for climb rate. If the airplane can really meet the threshold requirement I just set, climb rate and angle under normal, much more benign, conditions should be pretty good.
With that, all the "Where?"-related specifications for powered flight are completed. All we have left is stall speed and soaring.
Stall Speed: How Slow?
The "Where?" aspect of this would come into play if any of my list of airports (or the kind of flying I picked in "What?") indicated very short runways, or very poor runway surfaces. Neither of those is the case for this airplane. Even the dirt runway at Skylark (CA89), one of my home-base airports, is pretty darn smooth and long.
So far, this airplane is falling well inside the definition of an LSA under 14 CFR Part 1.1, so I think that's a good place from which to grab my threshold stall speed requirement. That's not more than 45 knots CAS (52 mph) with high-lift devices retracted. Again, no altitude is specified, so I'm going to use my worst-case density altitude airport and day of 90°F at Crystal (46CN), which puts density altitude above 6,400 feet MSL. I'm not thinking about flaps for this airplane anyway, but the requirement to show the stall speed without them in the LSA definition is an interesting wrinkle.
I like the nice slow stall speeds of the gliders I fly, so that's a natural goal requirement target. Doing so puts my goal stall speed in the range of the SGS 1-34: "36-38 mph" (31-33 knots), from the SGS 1-34 POH.
Since stall speed is non-critical for this design, I'll set the goal density altitude requirement to be Skylark (CA89) on a "normal" midday: 80°F. That makes the density altitude to be 3,104 feet, with a density ratio of 92.23%. (29.92 mmHg, dew point of 65°F).
Where this could all go wrong is if even the threshold stall speed requirement sets a wing loading so low that it dominates the wing design, making it larger than it needs to be for the other requirements. If that turns out to be the case, I’ll revisit my requirements and whether or not I need flaps. I’d prefer to do without the complication they present, but I’m also going to be trying to minimize the size of the wing, for a number of important reasons I’ll discuss shortly.
Next Post: Setting soaring requirements for minimum sink and L/D.
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
INTERLUDE - Ever-changing Regulations
Walked back into the office this morning to find my inbox again bulging with work. Yay for my business! :ban: Boo for my airplane study. :roll:
Autoreply pinged me by PM yesterday and let me know that JAR 22 was handed over to EASA in 2005 and, in their wisdom, was renamed EASA CS-22. As this is an airplane that shouldn't ever see certified production, I haven't been planning on meeting every requirement of CS 22 or FAR 23, but I also see no reason not to use the latest version when it's available. To that end, replaced my copy of of JAR 22 with CS 22 Amendment 2, which is the latest version on the (amazingly simple, easy to use, and visually well-designed) EASA website.
Looking over the places I've cited JAR 22 in this study so far, I don't see any changes. There are differences between the two, but so far they seem confined to other areas. At least I don't have to rework any of the above.
#### Topaz
##### Super Moderator
Staff member
Log Member
INTERLUDE - Revisiting the Stall Speed requirement
It probably seems like I've abandoned this project, but no. As I said a few posts back, we work before we play. I do a series of product-line books - think of them as catalogs for business-to-business sales - for the national and international divisions of a large outdoor apparel and equipment manufacturer up in northern California twice a year, and I'm just wrapping up the Fall project now. The client's printer asked if we could move the deadline up a week to accommodate a bind in their press scheduling and, since they were offering my client a discount for that, my client was eager to do it if we could. We did, but it meant some late nights and weekends for me, as the end of these projects is a really busy time anyway. So airplane stuff had to fall to the side for a bit. You should see more posts here as things ease up.
Last I was working on this, Ragflyer posted the following in the discussion thread regarding my threshold stall speed requirement:
Density altitude will not matter as the regulation for stall speed is based on CAS.*
This is one of the great things about "learning in public" with this project. I was about to snap off a quick reply to this, but then realized that I couldn't support my reply with an actual explanation. I had to stop and think this through. So ragflyer, thank you.
When you look this question over, it becomes clear that it actually turns on perspective. The authors of CS-22 were setting up a regulation that would have an easy and clear means for a petitioning manufacturer to demonstrate compliance with the regulation. While indicated airspeed would provide a clear means of measuring the stall speed, calibrated airspeed provides at least a bureaucratic check against unscrupulous manufacturers fudging the indication by positioning the pitot and static ports to artificially manipulate the numbers. CAS provides an easy way for a real certification pilot in a real airplane to show that the airplane meets the requirements of the regulation. It's very rare to encounter actual ISA 0' MSL conditions, so CAS provides an easy reference that requires no special equipment or conditions and, unless the petitioner runs the test on the shores of the Dead or Salton seas, will result in an airplane that actually beats the requirements.
However, it doesn't really answer the engineering question at hand when one is setting a requirement in the first place, and only using the regulation as a guideline. What I really care about, both as a designer and as a pilot, is not the number the ASI is reading, but how fast the airplane is really going when the tire kisses (or leaves) pavement at ~1.0-1.1 times VS. How fast am I comfortable hurtling down the runways listed in a tiny little single seat airplane? So ground speed at touch-down, that's the question. (Strictly speaking, choice of VS also influences some other numbers such as the speed for minimum sink, but that's not likely to be a factor here, and so I'm ignoring it.)
Assuming that there's no wind, ground speed at touchdown equals true airspeed at touchdown. That's the airspeed I care about here. And, conveniently, true airspeed is what comes out of the lift equation when it is rearranged to solve for airspeed. As such, density altitude does play a part in this (the lift equation includes q as a term), so I really do want to set my requirement with a density altitude condition.
Looking back at my requirements table, I'm still comfortable with those threshold and goal stall speeds. I'm going to keep the values as-is, and explicitly note that all airspeeds are TAS. A current copy of the specifications and requirements document is attached.
That's my thinking. Comments and questions are welcome.
View attachment DS54 - Draft Requirements and Specifications.pdf
Next Post: Let's set the final soaring requirements.
*For a good explanation of the various definitions of "airspeed", here's a good article on Wikipedia. For a great listing of the "official" V-airspeeds, here's another.
#### Topaz
##### Super Moderator
Staff member
Log Member
Where: Soaring Requirements
After all the effort I've expended upon powered-flight specifications, it's probably going to be a little surprising how quickly the soaring sections are going to go. There are several reasons for this. For one thing, I don't soar competitively, and this airplane isn't intended for such flying. The casual, "mostly floating around the gliderport" soaring I do is less demanding and more variable - there's no "design mission" or target racecourse for which to optimize the airplane. Secondly, I'm still in the process of developing my cross-country soaring skills. Without a solid base of experience, I'm loath to write myself into a corner with specifications I can't really back up. So, much like soaring itself, this is going to be more of a "feel" effort. I could certainly plan out a soaring "design mission" cross-country flight and derive my performance requirements from that, but the data for thermal strength, size, and distribution is far more equivocal than mapping out a powered cross-country flight and the analysis much deeper. I've worked a little of this for my two-seat project, and I find that my paucity of cross-country soaring experience makes me very uncomfortable during that process. Since my mantra on this single-seat project is "Keep It Simple", I'm not going to do that work on this one. I just want you to be aware that such methods exist and are used for the designers of high-performance sailplanes. Thomas' Fundamentals of Sailplane Design is the best reference for this which I know personally.
Minimum Sink Rate and Maximum L/D Ratio
Minimum sink rate is, to a glider, what climb rate is to a powered airplane. It represents the amount of time until you reach a certain altitude; in this case, coming down to. the ground. More importantly for soaring, it also functions as a substitute for engine power: a glider with a smaller minimum sink rate requires less of an updraft to stay airborne or climb. A glider with a minimum sink rate of 200 fpm can stay aloft in an air mass moving upwards at 200 fpm. If the air mass is moving upwards any faster, the glider can actually climb. Finding and harnessing these updrafts is the core of the sport of soaring. Gliding efficiently between thermals allows you to cover more ground more quickly, useful not only for cross-country racing but for gliding around looking for sources of lift. The measure of this is the maximum L/D ratio, equivalent to the angle of climb for a powered airplane: minimum altitude loss over a distance.
My soaring is chiefly along and above the Ortega Ridge just west of Skylark Field (CA89), over the Sedco Hills just to the east, or out above the lake when the famous Elsinore Convergence is working. I've personally found the conditions over the Sedcos to be unreliable (but strong when they are working) and the convergence requires special wind conditions, so it's somewhat uncommon. However, there are several "house" thermals over the Ortegas, and any time we have offshore "Santa Ana" winds, the Ortega Ridge is working and you can stay up virtually all day with little effort.
The most common lift source in the Elsinore area is thermal, with several fairly reliable "house" thermals as I mentioned before. So those are the conditions for which I'm going to design this project as a sailplane.
The SGS 2-33 training gliders belonging to my club have a minimum sink almost exactly at the CS 22.71(a) specified lower limit of performance: about -200 fpm (-1.0 m/s) (the POH says -168 fpm, but that's a fairy tale, IMHO). Their maximum "book" L/D is 23:1, which isn't far off, I think. In typical Elsinore thermal conditions, these numbers are enough for level flight or a very weak climb if you're careful about your centering technique. I find that to be frustrating. On a good day (or a ridge day), you can keep even a 2-33 up pretty much as long as you want, but I can't tell you how many "sled rides" I've had in a 2-33 on days where I just couldn't find the thermals or they were being blown about by a mild breeze. Those conditions are such that if you "fall out" of a thermal, you lose some altitude looking around for another, and the next one is going to just give you a little bit of level flight at best, and you end up "stair-stepping" back down to the airport after releasing the tow. Not a lot of fun, and it happens all too often in this type in the usual conditions where I fly. I want more performance than that.
The situation is markedly different in the club's SGS 1-34. The glider can maintain level flight in a significantly weaker thermal, and the better L/D (glide) ratio allows one to lose less altitude while searching for the next thermal. The 1-34 is in the "low medium" band of sailplane performance, with a minimum sink of -144 fpm and a POH-listed L/DMAX of 32:1. ("High performance" competitive sailplanes are achieving ~100 fpm or less, and L/DMAX exceeding 50:1.) I've yet to see a 1-34 that really got 32:1, with the consensus being that it's closer to 30:1 in reality. But even this seemingly small increment over the 2-33 is like night and day.
For a number of reasons that I'll discuss when I'm laying out my subjective requirements for this project, I want to keep the wing of this airplane as small as possible. While I'd love to have a 40:1 glider, the really long wings required will make it impossible for me to build and very difficult to transport. Having a motor for powered cross-country and for "saves" when I'd normally be landing for another tow adds a lot of value to even a lower-performance glider, though. Between these effects, I feel like I could be perfectly happy if this motorglider could match the soaring performance of the SGS 1-34. That becomes the goal requirement. If my airplane can't reach the performance of even the SGS 2-33, it's not worth it to me to build the airplane, so that becomes the threshold requirement. I'll push for the goal specifications, but hitting that is subject to my span and wing-loading restrictions. My SWAG at the moment is that I'll end up at or slightly worse than 30:1 and -150 fpm.
Next post: Answering the last of the four questions: "When?"
Last edited:
#### Topaz
##### Super Moderator
Staff member
Log Member
When: What’s the Environment Surrounding the Aircraft?
The fourth and final question in the series is “When?” Beyond simple time-of-day, this question more generally relates to the environment around the airplane when I’m flying it. Is it daylight or nighttime? What’s the weather like? Winds? If the local conditions are “X”, is it a good time to go flying in this aircraft?
Time of Day
Obviously there will be daytime flying for this airplane, so the big question is whether I'll be flying it at night. There's no point to soaring at night, so this is also just about powered flying.
Most of my powered flight in this aircraft will be self-launching for soaring and trips to fairly local airports for breakfasts and lunches. Only the occasional longer powered cross-country would expose me to the possibility of not getting home before the end of civil twilight, so the potential need to fly at night is going to occur rarely.
What does the capability "cost"? Night flying requires a full electrical system to power the various lights and strobes on the airframe, and elements of the airframe to route the wires, hold the lights, and cover them with an aerodynamic fairing so that their drag doesn't reduce the soaring ability of the aircraft. And, of course, all these components must be purchased and accommodated during the build.
No, I don't think the rare occasion where night flying might impact my flight planning is worth the added cost and complexity. This will be a daytime flyer only.
Weather Conditions
What about weather? I don't have an IFR rating, and I don't see the need to get one for the kind of flying I do and expect to do with this airplane. This thing is completely focused upon recreational "fun" flying. It's not at all a "practical" transportation aircraft. If I were doing business trips with it, I'd absolutely want the IFR rating and the aircraft capabilities to go with it, but that's not the case here. So VFR only for this bird.
Crosswind Component
I could include this in the weather conditions above, but crosswind doesn't really relate to the VFR/IFR question so I like to break it out separately.
This airplane is intended for a low-time pilot, so I'm just going to steal this specification from the POH of an existing trainer aircraft. Oddly, my 1978 Cessna 152 POH doesn't show a demonstrated maximum crosswind component. My 1978 Piper PA-38 Tomahawk manual, however, lists the demonstrated crosswind component as 15 knots. Done.
Next Post: Miscellaneous requirements and restrictions.
Last edited:
2 | 2020-07-04 18:33:17 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.40687867999076843, "perplexity": 2407.5683048914852}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655886516.43/warc/CC-MAIN-20200704170556-20200704200556-00236.warc.gz"} |
https://www.educationalmantra.com/2022/04/mcq-questions-for-class-8-maths-chapter-6-squares-and-square-roots-part-2.html | # MCQ Questions | Class 8 Maths Chapter 6 | Squares and Square Roots with Answers
## MCQ | Squares and Square Roots Class 8
Check the below NCERT MCQ Questions for Class 8 Maths Chapter 6 Squares and Square Roots with Answers Pdf free download. MCQ Questions for Class 8 Maths with Answers were prepared based on the latest exam pattern. We have Provided Squares and Square Roots Class 8 Maths MCQs Questions with Answers to help students understand the concept very well.
### Objective Question | NCERT Maths Class 8
Book: National Council of Educational Research and Training (NCERT) Central Board of Secondary Education (CBSE) 8th Maths 6 Part-2 Squares and Square Roots English
#### Ncert Solutions for Class 8 Maths | Objective Type Questions
You can refer to NCERT Solutions for Class 8 Maths Chapter 6 Squares and Square Roots to revise the concepts in the syllabus effectively and improve your chances of securing high marks in your board exams.
##### Squares and Square Roots | Class 8 Maths | NCERT Solutions
Q1. Ncert Class 8 Maths Mcq Chapter 6 How many nonsquare numbers he between the pair of numbers 500² and 501² ? A. 1000 B. 999 C. 1001 D. 1002.
Ans: 1000
Hint:
2 × 500 = 1000.
Q2. Ncert Class 8 Maths Mcq Questions Express the square number 5² as the sum of two consecutive integers. A. 12 + 13 B. 10 + 15 C. 9 + 16 D. 20 + 5.
Ans: 12 + 13
Hint:
$$\frac{5^2-1}{2}$$ = 12, $$\frac{5^2+1}{2}$$ = 13
Q3. CBSE Class 8 Maths Chapter 6 Mcq Express 9² as the sum of two consecutive integers. A. 40 + 41 B. 50 + 31 C. 36 + 45 D. 72 + 9.
Ans: 40 + 41
Hint:
$$\frac{9^2-1}{2}$$ = 40, $$\frac{5^2+1}{2}$$ = 41
Q4. CBSE Class 8 Maths Chapter 6 Mcq Questions Express 7² as the sum of two consecutive integers. A. 40 + 9 B. 24 + 25 C. 36 + 13 D. 32 + 17.
Ans: 24 + 25
Hint:
$$\frac{7^2-1}{2}$$ = 24, $$\frac{5^2+1}{2}$$ = 25
Q5. CBSE Class 8 Maths Squares and Square Roots Mcq The unit digit number 132 is in the square of the A. 1 B. 2 C. 3 D. 4.
Ans: 4.
Hint:
2 × 2 = 4.
Q6. CBSE Class 8 Maths Mcq Questions The unit digit in the square of the number 1000 is A. 1 B. 0 C. 2 D. none of these.
Ans: 0
Hint:
0 × 0 = 0.
Q7. CBSE Class 8 Maths Squares and Square Roots Mcq Questions The unit digit in the square of the number 1111 is A. 1 B. 2 C. 3 D. 4.
Ans: 1
Hint:
1 × 1 = 1.
Q8. Class 8 Maths Mcq Chapter 6 The unit digit in the square of the number 1333 is A. 3 B. 6 C. 9 D. 1.
Ans: 9
Hint:
3 × 3 = 9.
Q9. Class 8 Maths Mcq online test The unit digit in the square of the number 2644 is A. 4 B. 6 C. 8 D. 2.
Ans: 6
Hint:
4 × 4 = 16.
Q10. Class 8 Maths Mcq with answers The unit digit in the square of the number 125 is A. 1 B. 2 C. 5 D. 6.
Ans: 5
Hint:
5 × 5 = 25.
Q11. Learn Cbse Class 8 Maths Mcq The unit digit in the square of the number 166 is A. 2 B. 4 C. 6 D. 8.
Ans: 6
Hint:
6 × 6 = 36.
Q12. Mcq Class 8 Maths Chapter 6 The unit digit in the square of the number 27 is A. 7 B. 2 C. 5 D. 9.
Ans: 9.
Hint:
7 × 7 = 49.
Q13. Mcq for Class 8 Maths Chapter 6 The unit digit in the square of the number 78 is A. 1 B. 2 C. 3 D. 4.
Ans: 4.
Hint:
8 × 8 = 64.
Q14. Mcq Questions for Class 8 Maths with answers pdf Chapter 6 The unit digit in the square of the number 209 is A. 1 B. 2 C. 0 D. 9.
Ans: 1
Hint:
9 × 9 = 81
Q15. Mcq Questions for Class 8 Maths with answers pdf download Which of the following is not a Pythagorean triplet ? A. 3, 4, 5 B. 6, 8, 10 C. 5, 12, 13 D. 2, 3, 4.
Ans: 2, 3, 4.
Hint:
2² + 3² ≠ 4².
Q16. Ncert Class 8 Maths Mcq Chapter 6 If 102 = 100, then the square root of 100 is A. 1 B. 10 C. 100 D. 1000.
Ans: 10
Hint:
$$\sqrt{100}$$ = 10
Q17. Ncert Class 8 Maths Mcq Questions If 252 = 625, then the square root of 625 is A. 5 B. 25 C. 125 D. 625.
Ans: 25
Hint:
$$\sqrt{625}$$ = 25
Q18. CBSE Class 8 Maths Chapter 6 Mcq What could be the possible one’s digit of the square root of 625 ? A. 2 B. 3 C. 4 D. 5.
Ans: 5.
Hint:
5 × 5 = 25.
Q19. CBSE Class 8 Maths Chapter 6 Mcq Questions What could be the possible one’s digit of the square root of 121 ? A. 1, 9 B. 3, 4 C. 6, 7 D. 7, 8.
Ans: 1, 9
Hint:
1 × 1 = 1
9 × 9 = 81.
Q20. CBSE Class 8 Maths Squares and Square Roots Mcq What could be the possible one’s digit of the square root of 361 ? A. 1, 9 B. 3, 4 C. 6, 7 D. 7, 8.
Ans: 1, 9
Hint:
1 × 1 = 1
9 × 9 = 81. | 2022-11-30 04:19:51 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5365433096885681, "perplexity": 1679.608159405125}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446710719.4/warc/CC-MAIN-20221130024541-20221130054541-00204.warc.gz"} |
http://www.research.lancs.ac.uk/portal/en/publications/observation-of-a-narrow-mass-state-decaying-into-upsilon1s--gamma-in-ppbar-collisions-at-sqrts--196-tev(ab7b5137-07f2-462b-a0a6-a064d6d61a95)/export.html | Home > Research > Publications & Outputs > Observation of a narrow mass state decaying int...
Electronic data
• PhysRevD
Rights statement: © 2012 American Physical Society
Final published version, 4.24 MB, PDF document
Observation of a narrow mass state decaying into Upsilon(1S) + gamma in ppbar collisions at sqrt(s) = 1.96 TeV
Research output: Contribution to journalJournal articlepeer-review
Published
Standard
In: Physical Review D, Vol. 86, No. 3, 031103(R), 15.07.2012.
Research output: Contribution to journalJournal articlepeer-review
Bibtex
@article{ab7b513707f2462ba0a6a064d6d61a95,
title = "Observation of a narrow mass state decaying into Upsilon(1S) + gamma in ppbar collisions at sqrt(s) = 1.96 TeV",
abstract = "Using data corresponding to an integrated luminosity of 1.3 fb^-1, we observe a narrow mass state decaying into Upsilon(1S)+gamma, where the Upsilon(1S) meson is detected by its decay into a pair of oppositely charged muons, and the photon is identified through its conversion into an electron-positron pair. The significance of this observation is 5.6 standard deviations. The mass of the state is centered at 10.551 \pm 0.014 (stat.) \pm 0.017 (syst.) GeV/c^2, which is consistent with that of the state recently observed by the ATLAS Collaboration.",
author = "D0 Collaboration and Iain Bertram and Guennadi Borissov and Harald Fox and Anthony Ross and Mark Williams and Peter Ratoff",
note = "{\textcopyright} 2012 American Physical Society 6 pages, 4 figures",
year = "2012",
month = jul,
day = "15",
doi = "10.1103/PhysRevD.86.031103",
language = "English",
volume = "86",
journal = "Physical Review D",
issn = "1550-7998",
publisher = "American Physical Society",
number = "3",
}
RIS
TY - JOUR
T1 - Observation of a narrow mass state decaying into Upsilon(1S) + gamma in ppbar collisions at sqrt(s) = 1.96 TeV
AU - Collaboration, D0
AU - Bertram, Iain
AU - Fox, Harald
AU - Ross, Anthony
AU - Williams, Mark
AU - Ratoff, Peter
N1 - © 2012 American Physical Society 6 pages, 4 figures
PY - 2012/7/15
Y1 - 2012/7/15
N2 - Using data corresponding to an integrated luminosity of 1.3 fb^-1, we observe a narrow mass state decaying into Upsilon(1S)+gamma, where the Upsilon(1S) meson is detected by its decay into a pair of oppositely charged muons, and the photon is identified through its conversion into an electron-positron pair. The significance of this observation is 5.6 standard deviations. The mass of the state is centered at 10.551 \pm 0.014 (stat.) \pm 0.017 (syst.) GeV/c^2, which is consistent with that of the state recently observed by the ATLAS Collaboration.
AB - Using data corresponding to an integrated luminosity of 1.3 fb^-1, we observe a narrow mass state decaying into Upsilon(1S)+gamma, where the Upsilon(1S) meson is detected by its decay into a pair of oppositely charged muons, and the photon is identified through its conversion into an electron-positron pair. The significance of this observation is 5.6 standard deviations. The mass of the state is centered at 10.551 \pm 0.014 (stat.) \pm 0.017 (syst.) GeV/c^2, which is consistent with that of the state recently observed by the ATLAS Collaboration.
U2 - 10.1103/PhysRevD.86.031103
DO - 10.1103/PhysRevD.86.031103
M3 - Journal article
VL - 86
JO - Physical Review D
JF - Physical Review D
SN - 1550-7998
IS - 3
M1 - 031103(R)
ER - | 2021-02-26 01:47:13 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8097042441368103, "perplexity": 3940.8134486089875}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178355944.41/warc/CC-MAIN-20210226001221-20210226031221-00056.warc.gz"} |
https://mattermodeling.stackexchange.com/questions/4421/number-of-kpoints-in-irreducible-part-of-brillouin-zone | # Number of KPOINTS in irreducible part of Brillouin zone
I want to investigate the comparison of Total Energy per cell with respect to the number of KPOINTS in the irreducible part of the Brillouin zone but I do not know how to calculate the number of KPOINTS with grid size for e.g 3* 3 *3 what will be no. of KPOINTS for even or odd no. of k-mesh?
Thanks for the help!
It is not necessary to care about the total energy versus the number of k points in irreducible reciprocal space, which is closely related to the symmetry of the investigated structure. Of course, you can always read it from IBZKPT with a self-consistent run or any other run using VASP. Also, the printed number in IBZKPT is related to the ISYM tag. | 2021-07-24 08:11:32 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5969952940940857, "perplexity": 453.6538916624534}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046150134.86/warc/CC-MAIN-20210724063259-20210724093259-00148.warc.gz"} |
https://chem.libretexts.org/Courses/Santa_Barbara_City_College/SBCC_Chem_101%3A_Introductory_Chemistry/04%3A_Atoms_and_Elements/4.05%3A_Elements-_Defined_by_Their_Number_of_Protons | # 4.5: Elements- Defined by Their Number of Protons
Learning Objectives
• Define atomic number.
• Define mass number.
• Determine the number of protons, neutrons, and electrons in an atom.
It's important to be able to distinguish atoms of one element from atoms of another element. Elements are pure substances that make up all other matter, so each one is given a unique name. The names of elements are also represented by unique one- or two-letter symbols, such as $$\ce{H}$$ for hydrogen, $$\ce{C}$$ for carbon, or $$\ce{He}$$ for helium. However, it would more powerful if these names could be used to identify the numbers of protons and neutrons in the atoms. That's where atomic number and mass number are useful.
## Atomic Number
Scientists distinguish between different elements by counting the number of protons in the nucleus (Table $$\PageIndex{1}$$). If an atom has only one proton, we know that it's a hydrogen atom. An atom with two protons is always a helium atom. If scientists count four protons in an atom, they know it's a beryllium atom. An atom with three protons is a lithium atom, an atom with five protons is a boron atom, an atom with six protons is a carbon atom . . . the list goes on.
Since an atom of one element can be distinguished from an atom of another element by the number of protons in its nucleus, scientists are always interested in this number, and how this number differs between different elements. The number of protons in an atom is called its atomic number ($$Z$$). This number is very important because it is unique for atoms of a given element. All atoms of an element have the same number of protons, and every element has a different number of protons in its atoms. For example, all helium atoms have two protons, and no other elements have atoms with two protons.
Name Protons Neutrons Electrons Atomic Number (Z) Mass Number (A)
Table $$\PageIndex{1}$$: Atoms of the First Six Elements
Hydrogen 1 0 1 1 1
Helium 2 2 2 2 4
Lithium 3 4 3 3 7
Beryllium 4 5 4 4 9
Boron 5 6 5 5 11
Carbon 6 6 6 6 12
Of course, since neutral atoms have to have one electron for every proton, an element's atomic number also tells you how many electrons are in a neutral atom of that element. For example, hydrogen has an atomic number of 1. This means that an atom of hydrogen has one proton, and, if it's neutral, one electron as well. Gold, on the other hand, has an atomic number of 79, which means that an atom of gold has 79 protons, and, if it's neutral, 79 electrons as well.
Neutral Atoms
Atoms are neutral in electrical charge because they have the same number of negative electrons as positive protons (Table $$\PageIndex{1}$$). Therefore, the atomic number of an atom also tells you how many electrons the atom has. This, in turn, determines many of the atom's chemical properties.
## Mass Number
The mass number ($$A$$) of an atom is the total number of protons and neutrons in its nucleus. The mass of the atom is a unit called the atomic mass unit $$\left( \text{amu} \right)$$. One atomic mass unit is the mass of a proton, or about $$1.67 \times 10^{-27}$$ kilograms, which is an extremely small mass. A neutron has just a tiny bit more mass than a proton, but its mass is often assumed to be one atomic mass unit as well. Because electrons have virtually no mass, just about all the mass of an atom is in its protons and neutrons. Therefore, the total number of protons and neutrons in an atom determines its mass in atomic mass units (Table $$\PageIndex{1}$$).
Consider helium again. Most helium atoms have two neutrons in addition to two protons. Therefore the mass of most helium atoms is 4 atomic mass units ($$2 \: \text{amu}$$ for the protons + $$2 \: \text{amu}$$ for the neutrons). However, some helium atoms have more or less than two neutrons. Atoms with the same number of protons but different numbers of neutrons are called isotopes. Because the number of neutrons can vary for a given element, the mass numbers of different atoms of an element may also vary. For example, some helium atoms have three neutrons instead of two (these are called isotopes and are discussed in detail later on).
Why do you think that the "mass number" includes protons and neutrons, but not electrons? You know that most of the mass of an atom is concentrated in its nucleus. The mass of an atom depends on the number of protons and neutrons. You have already learned that the mass of an electron is very, very small compared to the mass of either a proton or a neutron (like the mass of a penny compared to the mass of a bowling ball). Counting the number of protons and neutrons tells scientists about the total mass of an atom.
$\text{mass number} \: A = \left( \text{number of protons} \right) + \left( \text{number of neutrons} \right)$
An atom's mass number is very easy to calculate, provided that you know the number of protons and neutrons in an atom.
Example 4.5.1
What is the mass number of an atom of helium that contains 2 neutrons?
Solution
$$\left( \text{number of protons} \right) = 2$$ (Remember that an atom of helium always has 2 protons.)
$$\left( \text{number of neutrons} \right) = 2$$
$$\text{mass number} = \left( \text{number of protons} \right) + \left( \text{number of neutrons} \right)$$
$$\text{mass number} = 2 + 2 = 4$$
A chemical symbol is a one- or two-letter designation of an element. Some examples of chemical symbols are $$\ce{O}$$ for oxygen, $$\ce{Zn}$$ for zinc, and $$\ce{Fe}$$ for iron. The first letter of a symbol is always capitalized. If the symbol contains two letters, the second letter is lower case. The majority of elements have symbols that are based on their English names. However, some of the elements that have been known since ancient times have maintained symbols that are based on their Latin names, as shown in Table $$\PageIndex{2}$$.
Chemical Symbol Name Latin Name
Table $$\PageIndex{2}$$: Symbols and Latin Names for Elements
$$\ce{Na}$$ Sodium Natrium
$$\ce{K}$$ Potassium Kalium
$$\ce{Fe}$$ Iron Ferrum
$$\ce{Cu}$$ Copper Cuprum
$$\ce{Ag}$$ Silver Argentum
$$\ce{Sn}$$ Tin Stannum
$$\ce{Sb}$$ Antimony Stibium
$$\ce{Au}$$ Gold Aurum
$$\ce{Pb}$$ Lead Plumbum
## Summary
• Elements are pure substances that make up all matter, so each one is given a unique name.
• The names of elements are also represented by unique one- or two-letter symbols.
• Each element has a unique number of protons. An element's atomic number is equal to the number of protons in the nuclei of any of its atoms.
• The mass number of an atom is the sum of the protons and neutrons in the atom.
• Isotopes are atoms of the same element (same number of protons) that have different numbers of neutrons in their atomic nuclei.
This page was constructed from content via the following contributor(s) and edited (topically or extensively) by the LibreTexts development team to meet platform style, presentation, and quality:
• CK-12 Foundation by Sharon Bewick, Richard Parsons, Therese Forsythe, Shonna Robinson, and Jean Dupon.
• Henry Agnew (UC Davis) | 2021-03-07 15:28:57 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.589712917804718, "perplexity": 510.0770436049454}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178377821.94/warc/CC-MAIN-20210307135518-20210307165518-00426.warc.gz"} |
http://www-desir.lip6.fr/~phw/aGrUM/docs/last/notebooks/40-KaggleTitanic.ipynb.html | pyAgrum on notebooks
☰ KaggleTitanic
In [1]:
import pandas
import os
import math
import pyAgrum as gum
import pyAgrum.lib.notebook as gnb
from pyAgrum.lib.bn2roc import showROC
# Titanic: Machine Learning from Disaster¶
This notebook is an introduction to the Kaggle titanic challenge. The goal here is not to produce the best possible classifier, at least not yet, but to show how pyAgrum and Bayesian Networks can be used to easily and quickly explore and understand data.
To undestand this notebook, basic knowledge of Bayesian Networks is required. If you are looking for an introduction to pyAgrum, check this notebook.
This notebook present three different Bayesien Networks techniques to answer the Kaggle Titanic challenge. The first approach we will answer the challenge without using the training set and we will only use our prior knowledge about shipwrecks. In the second approach we will only use the training set with pyAgrum's machine learning algorithms. Finally, in the third approach we will use both prior knowledge about shipwrecks and machine learning.
Before we start, some disclaimers about aGrUM and pyAgrum.
aGrUM is a C++ library designed for easily building applications using graphical models such as Bayesian networks, influence diagrams, decision trees or Markov decision processes.
pyAgrum is a Python wrapper for the C++ aGrUM library. It provides a high-level interface to the part of aGrUM allowing to create, handle and make computations into Bayesian Networks. The module mainly is an application of the SWIG interface generator. Custom-written code is added to simplify and extend the aGrUM API.
Both projects are open source and can be freely downloaded from aGrUM's gitlab repository or installed using pip or anaconda.
If you have questions, remarks or suggestions, feel free to ask us on info@agrum.org.
## Pretreatment¶
We will be using pandas to setup the learning data to fit with pyAgrum requirements.
In [2]:
traindf=pandas.read_csv(os.path.join('res', 'titanic', 'train.csv'))
on="PassengerId")
This merges both the test base with the fact that a passager has survived or not.
In [3]:
traindf.var()
Out[3]:
PassengerId 66231.000000
Survived 0.236772
Pclass 0.699015
Age 211.019125
SibSp 1.216043
Parch 0.649728
Fare 2469.436846
dtype: float64
In [4]:
for k in traindf.keys():
print('{0}: {1}'.format(k, len(traindf[k].unique())))
PassengerId: 891
Survived: 2
Pclass: 3
Name: 891
Sex: 2
Age: 89
SibSp: 7
Parch: 7
Ticket: 681
Fare: 248
Cabin: 148
Embarked: 4
Looking at the number of unique values for each variable is necessary since Bayesian Networks are discrete models. We will want to reduce the domain size of some discrete varaibles (like age) and discretize continuous variables (like Fare).
For starters you can filter out variables with a large number of values. Choosing a large number will have an impact on performances, which boils down to how much CPU and RAM you have at your disposal. Here, we choose to filter out any variable with more than 10 different outcomes.
In [5]:
for k in traindf.keys():
if len(traindf[k].unique())<=15:
print(k)
Survived
Pclass
Sex
SibSp
Parch
Embarked
This leaves us with 6 variables, not much but still enough to learn a Bayesian Network. Will just add one more variable by reducing the cardinality of the Age variable.
In [6]:
testdf=pandas.merge(pandas.read_csv(os.path.join('res', 'titanic', 'test.csv')),
on="PassengerId")
def forAge(row):
try:
age = float(row['Age'])
if age < 1:
#return '[0;1['
return 'baby'
elif age < 6:
#return '[1;6['
return 'toddler'
elif age < 12:
#return '[6;12['
return 'kid'
elif age < 21:
#return '[12;21['
return 'teen'
elif age < 80:
#return '[21;80['
else:
#return '[80;200]'
return 'old'
except ValueError:
return np.nan
def forBoolean(row, col):
try:
val = int(row[col])
if row[col] >= 1:
return "True"
else:
return "False"
except ValueError:
return "False"
def forGender(row):
if row['Sex'] == "male":
return "Male"
else:
return "Female"
testdf
Out[6]:
PassengerId Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked Survived
0 892 3 Kelly, Mr. James male 34.5 0 0 330911 7.8292 NaN Q 0
1 893 3 Wilkes, Mrs. James (Ellen Needs) female 47.0 1 0 363272 7.0000 NaN S 1
2 894 2 Myles, Mr. Thomas Francis male 62.0 0 0 240276 9.6875 NaN Q 0
3 895 3 Wirz, Mr. Albert male 27.0 0 0 315154 8.6625 NaN S 0
4 896 3 Hirvonen, Mrs. Alexander (Helga E Lindqvist) female 22.0 1 1 3101298 12.2875 NaN S 1
... ... ... ... ... ... ... ... ... ... ... ... ...
413 1305 3 Spector, Mr. Woolf male NaN 0 0 A.5. 3236 8.0500 NaN S 0
414 1306 1 Oliva y Ocana, Dona. Fermina female 39.0 0 0 PC 17758 108.9000 C105 C 1
415 1307 3 Saether, Mr. Simon Sivertsen male 38.5 0 0 SOTON/O.Q. 3101262 7.2500 NaN S 0
416 1308 3 Ware, Mr. Frederick male NaN 0 0 359309 8.0500 NaN S 0
417 1309 3 Peter, Master. Michael J male NaN 1 1 2668 22.3583 NaN C 0
418 rows × 12 columns
When pretreating data, you will want to wrap your changes inside a function, this will help you keep track of your changes and easily compare them.
In [7]:
def pretreat(df):
if 'Survived' in df.columns:
df['Survived'] = df.apply(lambda row: forBoolean(row, 'Survived'), axis=1).dropna()
df['Age'] = df.apply(forAge, axis=1).dropna()
df['SibSp'] = df.apply(lambda row: forBoolean(row, 'SibSp'), axis=1).dropna()
df['Parch'] = df.apply(lambda row: forBoolean(row, 'Parch'), axis=1).dropna()
df['Sex'] = df.apply(forGender, axis=1).dropna()
droped_cols = [col for col in ['PassengerId', 'Name', 'Ticket', 'Fare', 'Cabin'] if col in df.columns]
df = df.drop(droped_cols, axis=1)
df = df.rename(index=str, columns={'Sex': 'Gender', 'SibSp': 'Siblings', 'Parch': 'Parents'})
return df
on="PassengerId")
traindf = pretreat(traindf)
testdf = pretreat(testdf)
We will need to save this intermediate learning database, since pyAgrum accepts only files as inputs. As a rule of thumb, save your CSV using comma as separators and do not quote values when you plan to use them with pyAgrum.
In [8]:
import csv
traindf.to_csv(os.path.join('res', 'titanic', 'post_train.csv'), index=False)
testdf.to_csv(os.path.join('res', 'titanic', 'post_test.csv'), index=False)
## Modeling withtout learning¶
In some cases, we might not have any data to learn from. In such cases, we can rely on experts to provide correlation between variables and conditional probabilities.
It can be simpler to start with a simple topography, leaving room to add more complexe correlations as the model is confonted aginst data. Here, we will use three hypothesis:
• All variables are independent conditionnaly to each other given the fact that a passenger has survive or not.
• Women and children are more likelly to survive.
• The more sibling or parents abord, the less likelly the passenger will survive.
The first assumption results in the following DAG for our Bayesian Network:
In [9]:
bn = gum.BayesNet("Surviving Titanic")
print(bn.variable("Survived"))
print(bn.variable("Age"))
print(bn.variable("Gender"))
print(bn.variable("Siblings"))
print(bn.variable("Parents"))
bn
Survived<False,True>
Gender<Female,Male>
Siblings<False,True>
Parents<False,True>
Out[9]:
Hypothesis two and three can help us define the parameters for this Bayesian Network. Remember that we assume that we do not have any data to learn from. So we will use simple definition such as "a women is 10 times more likeliy to survive than a man". We can then normalize the values to obtain a proper conditional probability distribution.
This technique may not be the most precise or scientifically sounded, it however has the advantage to be easy to use.
In [10]:
bn.cpt('Survived')[:] = [100, 1]
bn.cpt('Survived').normalizeAsCPT()
bn.cpt('Survived')
Out[10]:
Survived
False
True
0.99010.0099
In [11]:
bn.cpt('Age')[0:] = [ 1, 1, 1, 10, 10, 1]
bn.cpt('Age')[1:] = [ 10, 10, 10, 1, 1, 10]
bn.cpt('Age').normalizeAsCPT()
bn.cpt('Age')
Out[11]:
Age
Survived
baby
toddler
kid
teen
old
False
0.04170.04170.04170.41670.41670.0417
True
0.23810.23810.23810.02380.02380.2381
In [12]:
bn.cpt('Gender')[0:] = [ 1, 1]
bn.cpt('Gender')[1:] = [ 10, 1]
bn.cpt('Gender').normalizeAsCPT()
bn.cpt('Gender')
Out[12]:
Gender
Survived
Female
Male
False
0.50000.5000
True
0.90910.0909
In [13]:
bn.cpt('Siblings')[0:] = [ 1, 10]
bn.cpt('Siblings')[1:] = [ 10, 1]
bn.cpt('Siblings').normalizeAsCPT()
bn.cpt('Siblings')
Out[13]:
Siblings
Survived
False
True
False
0.09090.9091
True
0.90910.0909
In [14]:
bn.cpt('Parents')[0:] = [ 1, 10]
bn.cpt('Parents')[1:] = [ 10, 1]
bn.cpt('Parents').normalizeAsCPT()
bn.cpt('Parents')
Out[14]:
Parents
Survived
False
True
False
0.09090.9091
True
0.90910.0909
Now we can start using the Bayesian Network and check that our hypothesis hold.
In [15]:
gnb.showInference(bn,size="10")
We can see here that most passengers (99% of them) will not survive and that we have almost as much women (50.4%) as men (49.6%). The majority of passengers are either teenagers or adults. Finally, most passenger had siblings or parents aboard.
Recall that we have not use any data to learn the Bayesian Netork's parameters and our expert did not have any knowledge about the passengers aboard the Titanic.
In [16]:
gnb.showInference(bn,size="10", evs={'Survived':'False'})
gnb.showInference(bn,size="10", evs={'Survived':'True'})
Here, we can see that our second and third hypothesis hold since when we enter envidence that a passenger survived, it is more likely to be a woman with no siblings or parents. On the contrary, if we observe that a passenger did not survive we can see that it is more likely to be a man with siblings or parents.
In [17]:
gnb.showInference(bn,size="10", evs={'Survived':'True', 'Gender':'Male'})
gnb.showInference(bn,size="10", evs={'Gender':'Male'})
This validates our first hypothesis: if we know that a passenger survived or not, then evidence about that passenger does not changes our belief about other variables. On the contrary, if we do not know if a passenger survived, then evidence about the passenger will change our belief about other variables, including the fact that he or she survived or not.
In [18]:
ie=gum.LazyPropagation(bn)
def init_belief(engine):
# Initialize evidence
for var in engine.BN().names():
if var != 'Survived':
def update_beliefs(engine, bayesNet, row):
# Update beliefs from a given row less the Survived variable
for var in bayesNet.names():
if var == "Survived":
continue
try:
label = str(row.to_dict()[var])
idx = bayesNet.variable(var).index(str(row.to_dict()[var]))
engine.chgEvidence(var, idx)
except gum.NotFound:
# this can happend when value is missing is the test base.
pass
engine.makeInference()
def is_well_predicted(engine, bayesNet, auc, row):
update_beliefs(engine, bayesNet, row)
marginal = engine.posterior('Survived')
outcome = row.to_dict()['Survived']
if outcome == "False": # Did not survived
if marginal.toarray()[1] < auc:
return "True Positive"
else:
return "False Negative"
else: # Survived
if marginal.toarray()[1] >= auc:
return "True Negative"
else:
return "False Positive"
init_belief(ie)
result = testdf.apply(lambda x: is_well_predicted(ie, bn, 0.5, x), axis=1)
result.value_counts(True)
Out[18]:
True Positive 0.516746
False Positive 0.322967
False Negative 0.119617
True Negative 0.040670
dtype: float64
In [19]:
positives = sum(result.map(lambda x: 1 if x.startswith("True") else 0 ))
total = result.count()
print("{0:.2f}% good predictions".format(positives/total*100))
55.74% good predictions
This first model achieve a 55% of good predictions, not a good result but we have plenty of room to improve it.
## Pre-learning¶
We will now learn a Bayesian Network from the training set without any prior knowledge about shipwreks.
Before learning a Bayesian Network, we first need to create a template. This is not mandatory, however it is sometimes usefull since not all varaibles values are present in the learning base (in this example the number of relatives).
If during the learning step, the algorithm encounters an unknown value it will raise an error. This would be an issue if we wanted to automitize our classifier but, we will directly use values working with the test and learning base. This is not ideal but the objective here it to explore the data fast, not thoroughly.
To help creating de the template Bayesian Network that we will use to learn our classifier, let us firt recall all the variables wa have at our disposal.
In [20]:
df = pandas.read_csv(os.path.join('res', 'titanic', 'post_train.csv'))
for k in traindf.keys():
print('{0}: {1}'.format(k, len(traindf[k].unique())))
Survived: 2
Pclass: 3
Gender: 2
Age: 6
Siblings: 2
Parents: 2
Embarked: 4
From here, creating the BayesNet is straitforward: for each variable we either use the RangeVariable class or the LabelizedVariable.
The RangeVariable class creates a discrete random variable over a range. With the LabelizedVariable you will need to add each label ony by one. Note however that you can pass an argument to create as much labels starting from 0.
In [21]:
template=gum.BayesNet()
template.add(gum.LabelizedVariable("Embarked", "Embarked", ['', 'C', 'Q', 'S']))
gnb.showBN(template)
You can also let the learning algorithm create the BayesNet random variables. However please be aware that the algorithm will no be able to handle values absent from the learning database.
## Learning¶
We can now learn our first Bayesian Network. As you will see, this is really easy.
In [22]:
file = os.path.join('res', 'titanic', 'post_train.csv')
learner = gum.BNLearner(file, template)
bn = learner.learnBN()
bn
Out[22]:
In a notebook, a Bayesian Network will automatically be shown graphically, you can also use the helper function gnb.showBN(bn).
## Exploring the data¶
Now that we have a BayesNet, we can start looking how the variables corelate with each other. pyAgum offer the perfect tool for that: the information graph.
In [23]:
gnb.showInformation(bn,{},size="20")
0.79395730619197821.6720972518418398
To read this graph, you must understand what the entropy of a variable means: the hightest the value the more uncertain the variable marginal probability distrubition is (maximum entropy beging the equiprobable law). The lowest the value is, the more /certain/ the law is.
A consequence of how entropy is calculated, is that entropy tends to get bigger if the random varaible has many modalities.
What the information graph tells us is that the decade variable has a hight entropy. Thus, we can conclude that the passengers decade is distributed between all of its modalities.
What it also tells us, it that high modality variables with low entropy, such as Parch or SibSp, are not evenly distributed.
Let us look at he variables marginal probability by using the showInference() function.
In [24]:
gnb.showInference(bn)
The showInference() is really usefull as it shows the marginal probability distribution for each random variable of a BayesNet.
We can now confirm what the entropy learned us: Parch and SibSp are unevenly distributed and decade is more evenly distributed.
Lets focus on the Kaggle challenge now, and look at the Survived variable. We show a single posterior using the showPosterior() function.
In [25]:
gnb.showPosterior(bn,evs={},target='Survived')
So more than 40% of the passenger in our learning database survived.
So how can we use this BayesNet as a classifier ? Given a set of evidence, we can infer an update posterio distribution of the target variable Survived.
Lets look at the odds of surviving as a man in his thirties.
In [26]:
gnb.showPosterior(bn,evs={"Gender": "Male", "Age": 'adult'},target='Survived')
And now the odds of an old lady to survive.
In [27]:
gnb.showPosterior(bn,evs={"Gender": "Female", "Age": 'old'},target='Survived')
Well, children and ladies first, that's right ?
One last information we will need is which variables are required to predict the Survived variable. To do, we will use the markov blanket of Survived.
In [28]:
gnb.sideBySide(bn, gum.MarkovBlanket(bn, 'Survived'), captions=["Learned Bayesian Network", "Markov blanket of 'Survived'"])
G Survived Survived Pclass Pclass Pclass->Survived Siblings Siblings Pclass->Siblings Gender Gender Gender->Survived Siblings->Gender Parents Parents Parents->Gender Parents->Siblings Age Age | 2019-09-23 21:02:24 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3187388479709625, "perplexity": 4272.762797162148}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-39/segments/1568514578201.99/warc/CC-MAIN-20190923193125-20190923215125-00456.warc.gz"} |
http://www.finderchem.com/why-does-my-math-book-say-x-y-1-x-y-y.html | # Why does my math book say x/y +1= x+y/y?
## We found this answers
... All you need to know is that AntiLog(X) ... So if the table does not have negative numbers what do you do? ... [10-4 x10-1]x[10 1 x10-.8779], you get, - Read more
Free math lessons and math homework help from basic math to algebra, geometry and beyond. Students, teachers, parents, and everyone can find solutions to their math ... - Read more
## Why does my math book say x/y +1= x+y/y? resources
### Graph of y=x^2 - Physics Forums
Graph of y=x^2 in General Math is being discussed at Physics ... Thus, the y-intercept is 8. My question is why does this work? ... \frac {y - y_1} {x - x_1} = \frac ...
### The Number e - Math Forum - Ask Dr. Math
... The Number e Dear Dr.Math ... ? Why does e=2.71828... instead of, say, ... Mathematically speaking, we say "the area under the curve y=1/x from 1 to e is 1 ...
### Math Forum - Ask Dr. Math Archives: High School Equations ...
Why does y = mx+b, and what does it mean? ... Simplify this equation: (x+y)/(y^2-xy-y+x) + (y+1)/(xy-x-y+1) + (x+1)/ ... say y = x? Analyzing Range of ...
### Math Questions With Answers - Free Mathematics Tutorials ...
A set of multiple choice math questions are presented. ... Questions 1: If Log x (1 / 8) = ... Questions 7: If the graph of y = f(x) ...
### Algebra word problems - About.com Mathematics
Algebra word problems are very useful to solve real-life problems. ... y - 12: x 5 5x ... 1. On my last birthday I weighed 125 pounds.
### Cool math .com - Online Math Dictionary - A
Online Math Dictionary: A ... ( 3 x 4) = ( 2 x 3) x 4 NOTE: This does not work with division! Average ... X's: no Y's: no Z's:
### Maths - Rotation Matrices - Martin Baker - EuclideanSpace
... (x=1,y=0) this will rotate to ... matrix is a pure rotation matrix and does not contain any scaling ... epsilon) return false; if (Math.abs(m[1][0]*m[2][0] + m[1 ...
### How to reflect a graph through the x-axis, y-axis or ...
Can you explain the principles of a graph involving y = −f(x) being a reflection of the ... We say the reflection "maps on ... Like can u reflect from quadrant 1 ...
### Cool math .com - Online Math Dictionary - E
(When I say "cleanly divisible" I mean that there is no ... + (2 x 1) For more info, check out my decimals lesson on expanded ... X's: no Y's: no Z's:
### SparkNotes: Quadratics: Graphing Parabolas
Graphing y = x 2. We have already discovered how to graph linear functions. But what does the graph of y = x 2 look like?
### The Most IMPORTANT Video You'll Ever See (part 1 of 8 ...
Find out why Close . ... has to say. I introduce this video to my students as "Perhaps the most boring video ... 1:13:54 The Most IMPORTANT Video You'll ...
### Asymptote - Wikipedia, the free encyclopedia
... which has the oblique asymptote y = x (m = 1, n = 0) ... So y = ln x does not have an asymptote when x tends to +∞. ... Create a book;
### Algebra Review in Ten Lessons - University of Akron
Want others to know about the Algebra Review? Why not download my advertisement flyer ... version 2.1: Why TeX and why AMS-TeX? ... I settled on the Y&Y TeX System.
### What is Algebra - Syracuse University
x + • y: This statement tells us "x plus multiplied by y". This does not make mathematical or logical sense. This collection of symbols is nonsense.
### Vector Calculus: Understanding the Gradient | BetterExplained
... f_u. f_u = f_x u_1 + f_y u_2 ... could u explain why does gradient is zero for ... It makes me so angry that most math books seem to go out of their way to make ...
### What are the 'real numbers,' really? - Vanderbilt University
Why do I say that the real line is a ... where R+ is the set of all positive real numbers (R\{0},1,x) ... the set S does not have a least upper bound. If Y is a non ...
### Algebraic Structure of Complex Numbers - Cut-the-Knot
Several complex numbers play exclusive roles. For example, the number (0, 0) has the properties of 0: (x, y) + (0, 0) = (x, y) and (x, y)(0, 0) = (0, 0).
### How Do I Do A Math Problem? - Montana State University
How Do I Do A Math Problem? ... so my math action will probably involve division, ... like y = x2). Once you find repetition in the
### get on - definition of get on by The Free Dictionary
... tried to get my point across. 2. ... large plane, or ship, you say that you get on it or board it. ... 1. get on - have smooth relations; "My boss and I get along ...
### Leapfrog Addition -- Math Fun Facts - Harvey Mudd College
The Math Behind the Fact: ... If the number X is in line 1, and the number Y is in line 2 ... This magic trick may be found in the delightful book in the reference.
### Multivariate regression - Colgate University
Y = a 0 +a 1 X : Marius Ionescu Multivariate regression. Linear regression ... If there is more than one explanatory variable ( X 1, X 2, X 3 say) and one response ...
### Algebra Review - HMC Calculus Tutorial - Harvey Mudd College
Others involve common misunderstandings about various aspects of calculus. $(x+y) ... {1}{x+y} = \frac ... It is not correct to say$\displaystyle{ \lim_{x \to 1 ...
### The Golden Section - the Number and Its Geometry
For instance, Book 1, ... In fact ANY line y = k x will go through the origin ... Phi. Why? The formula Φ = 1 + 1/ ...
### Hyperbole and a Half: This is Why I'll Never be an Adult
Seriously? Who does that? June 17, 2010 at 1:00 PM ... why all my blog posts for an entire ... someone asks me why I haven't done X, Y, ...
### Hilfe:TeX – Wikipedia
... x=f(y^2+2). Das Ergebnis dieses Beispiels ist. ... x_{1,2} = \frac{-b \pm \sqrt{b^2-4ac} }{2a} Große Klammern und Brüche
### SparkNotes: SAT Subject Test: Math Level 2: Domain and Range
Domain and Range. Several of the Math ... The Math IIC may ask you to find the domain of a given function. ... For example, f(x) = 1 / x – 2 is undefined at x = 2, ...
### Simplify Exponents - Multiplying - About.com Mathematics
Why does this work? Rewrite (x 5) 2. ... Simplify the following: 1. (x-3)-5 . 2. (2 5) 5 . 3. ... Math Worksheets; Books, Resources, DVDs;
### The Linear Combination Method (aka The Addition Method ...
3y = 6 . is a linear combination of. x + y = 1. and. ... (no x's). We eliminated the x (that's why this is also called the elimination method. ... (say, x + y = 1), ...
### Solving Quadratic Equations: Solving by Factoring - Purplemath
You can't conclude anything about the individual terms of the unfactored quadratic (like the 5x or the 6 ... (10 + 2)(9 + 3) does not ... x + 6 = 0 or x – 1 = 0 x ...
### The Mathematics K-12 Teachers Need to Know
This then gives another reason why teachers must know ... and therefore why not say ... xn+1 yn+1 = (x y) ...
### dansmath - lessons - calculus 1 - EarthLink
(top of page) Differentiation Rules!. . . . . Another notation for f'(x) is (f(x)). If y = f(x) then y' = f'(x) = (y) = dy/dx. Notice from above we had (x^2 ...
### Alex & Sierra perform "Say My Name" - THE X FACTOR USA ...
Find out why Close . ... "Say My Name" performed by "Alex and Sierra" on THE X ... THE X FACTOR USA 2013 by The X Factor USA 2,574,091 views; 1:34 Alex ...
### Proof lim (x+1)^(1/x)=e - Physics Forums
Proof lim (x+1)^(1/x)=e in General Math is being ... its lim (1+x)^(1/x)=e. I what to see why that is ... Lets say that we have some variable called "y" and lets ...
Related Questions
Recent Questions | 2017-07-21 23:18:15 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5726088285446167, "perplexity": 2364.7225624580506}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-30/segments/1500549423812.87/warc/CC-MAIN-20170721222447-20170722002447-00562.warc.gz"} |
https://moderndive.netlify.app/2-4-linegraphs.html | ## 2.4 5NG#2: Linegraphs
The next of the five named graphs are linegraphs. Linegraphs show the relationship between two numerical variables when the variable on the x-axis, also called the explanatory variable, is of a sequential nature. In other words, there is an inherent ordering to the variable.
The most common examples of linegraphs have some notion of time on the x-axis: hours, days, weeks, years, etc. Since time is sequential, we connect consecutive observations of the variable on the y-axis with a line. Linegraphs that have some notion of time on the x-axis are also called time series plots. Let’s illustrate linegraphs using another dataset in the nycflights13 package: the weather data frame.
Let’s explore the weather data frame by running View(weather) and glimpse(weather). Furthermore let’s read the associated help file by running ?weather to bring up the help file.
Observe that there is a variable called temp of hourly temperature recordings in Fahrenheit at weather stations near all three major airports in New York City: Newark (origin code EWR), John F. Kennedy International (JFK), and LaGuardia (LGA). However, instead of considering hourly temperatures for all days in 2013 for all three airports, for simplicity let’s only consider hourly temperatures at Newark airport for the first 15 days in January.
Recall in Section 2.3, we used the filter() function to only choose the subset of rows of flights corresponding to Alaska Airlines flights. We similarly use filter() here, but by using the & operator we only choose the subset of rows of weather where the origin is "EWR", the month is January, and the day is between 1 and 15. Recall we performed a similar task in Section 2.3 when creating the alaska_flights data frame of only Alaska Airlines flights, a topic we’ll explore more in Chapter 3 on data wrangling.
early_january_weather <- weather %>%
filter(origin == "EWR" & month == 1 & day <= 15)
Learning check
(LC2.9) Take a look at both the weather and early_january_weather data frames by running View(weather) and View(early_january_weather). In what respect do these data frames differ?
(LC2.10) View() the flights data frame again. Why does the time_hour variable uniquely identify the hour of the measurement, whereas the hour variable does not?
### 2.4.1 Linegraphs via geom_line
Let’s create a time series plot of the hourly temperatures saved in the early_january_weather data frame by using geom_line() to create a linegraph, instead of using geom_point() like we used previously to create scatterplots:
ggplot(data = early_january_weather,
mapping = aes(x = time_hour, y = temp)) +
geom_line()
Much as with the ggplot() code that created the scatterplot of departure and arrival delays for Alaska Airlines flights in Figure 2.2, let’s break down this code piece-by-piece in terms of the grammar of graphics:
Within the ggplot() function call, we specify two of the components of the grammar of graphics as arguments:
1. The data to be the early_january_weather data frame by setting data = early_january_weather.
2. The aesthetic mapping by setting mapping = aes(x = time_hour, y = temp). Specifically, the variable time_hour maps to the x position aesthetic, while the variable temp maps to the y position aesthetic.
We add a layer to the ggplot() function call using the + sign. The layer in question specifies the third component of the grammar: the geometric object in question. In this case, the geometric object is a line set by specifying geom_line().
Learning check
(LC2.11) Why should linegraphs be avoided when there is not a clear ordering of the horizontal axis?
(LC2.12) Why are linegraphs frequently used when time is the explanatory variable on the x-axis?
(LC2.13) Plot a time series of a variable other than temp for Newark Airport in the first 15 days of January 2013.
### 2.4.2 Summary
Linegraphs, just like scatterplots, display the relationship between two numerical variables. However, it is preferred to use linegraphs over scatterplots when the variable on the x-axis (i.e., the explanatory variable) has an inherent ordering, such as some notion of time. | 2020-12-02 18:02:14 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.27100062370300293, "perplexity": 2295.3162250187834}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-50/segments/1606141715252.96/warc/CC-MAIN-20201202175113-20201202205113-00418.warc.gz"} |
https://blogs.mathworks.com/videos/2009/09/18/revisited-integrating-to-find-the-volume-underneath-a-set-of-non-uniformly-spaced-data/?s_tid=blogs_rc_3 | # Revisited: Integrating to find the volume underneath a set of non uniformly spaced data
Well, am I turning red! Soon after I posted my last video about how to find the volume underneath a set of non uniformly spaced data, I found one of our developers had a better way to do it using features of the newly released MATLAB 2009b.
Here is the video again:
Let’s repeat the code here from the beginning
n = 10;
randOffset = 0.1;
h = 1;
x = rand(n);
x(1:4)=[0 1 0 1]';
y = rand(n);
y(1:4)=[0 0 1 1]';
z = h + randOffset*rand(n) - randOffset/2; %make average height
plot3(x,y,z,'.')
axis equal
zlim([0 h + randOffset])
Now, the new feature being used is the fit command from the Curve Fitting Toolbox:
sf = fit( [x(:), y(:)], z(:), 'linearinterp' )
Linear interpolant:
sf(x,y) = piecewise linear surface computed from p
Coefficients:
p = coefficient structure
Then the volume is found using more or less the same call to QUAD2D. I told you it was cool:
vol = quad2d( sf, 0, 1, 0, 1 )
vol =
1.0038
Caveats You’ll notice that I had appended some “special points” to this data set. This is so that we can interpolate into the corners. The “fit object”, sf, will suffer the same problem as it is built on top of GRIDDATA. Another way around this issue is to use a scheme that extrapolates,
• Use a different interpolation scheme, e.g., ‘nearest’/ ‘nearestinterp’ or ‘v4’/ ‘biharmonicinterp’ (I’d use the latter because it is the best). This will work for both fit and GRIDDATA.
• Fit the data in a least squares sense, e.g., using ‘lowess’.
Extrapolation should be OK in this case as we are not extrapolating too far from the data.
Sometimes, I think I write this blog so that *I* can learn more MATLAB from the people that read it! Your comments and suggestions are always welcome below!
|
### Comments
To leave a comment, please click here to sign in to your MathWorks Account or create a new one. | 2020-05-30 03:56:55 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5547345876693726, "perplexity": 1638.0900796402532}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590347407001.36/warc/CC-MAIN-20200530005804-20200530035804-00076.warc.gz"} |
https://socratic.org/questions/is-the-following-a-geometric-sequence-3-9-27-81 | # Is the following a geometric sequence 3, 9, 27, 81,…?
Dec 14, 2015
Yes. It is a geometric sequence with initial term ${a}_{0} = 3$ and common ratio $r = 3$.
#### Explanation:
A geometric sequence is a sequence of the form
${a}_{0} , {a}_{0} r , {a}_{0} {r}^{2} , {a}_{0} {r}^{3} , \ldots , {a}_{0} {r}^{n} , \ldots$
where ${a}_{0}$ is the first term in the sequence and $r$ is the common ratio between terms.
Looking at the given sequence, we can write it as
$3 , 3 \cdot {3}^{1} , 3 \cdot {3}^{2} , 3 \cdot {3}^{3} , \ldots$
which matches the pattern for the first term ${a}_{0} = 3$ and common ratio $r = 3$. | 2020-09-25 16:16:17 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 8, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8846920132637024, "perplexity": 99.37398444023391}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-40/segments/1600400227524.63/warc/CC-MAIN-20200925150904-20200925180904-00775.warc.gz"} |
https://itaibn.wordpress.com/2020/05/22/is-there-slack-in-evolution/ | # Is There Slack in Evolution?
In a recent blog post, Studies on Slack, Scott Alexander discusses how slack (particularly the rationalist conception of it) interacts with competition in various situations, and models it in terms of two-layered competitive systems. Many of his example use evolution as the competitive system, and his very first example claims that in certain circumstances a useful adaption is more likely to occur if there is less evolutionary pressure:
Imagine a distant planet full of eyeless animals. Evolving eyes is hard: they need to evolve Eye Part 1, then Eye Part 2, then Eye Part 3, in that order. Each of these requires a separate series of rare mutations. Here on Earth, scientists believe each of these mutations must have had its own benefits – in the land of the blind, the man with only Eye Part 1 is king. But on this hypothetical alien planet, there is no such luck. You need all three Eye Parts or they’re useless. Worse, each Eye Part is metabolically costly; the animal needs to eat 1% more food per Eye Part it has. An animal with a full eye would be much more fit than anything else around, but an animal with only one or two Eye Parts will be at a small disadvantage. So these animals will only evolve eyes in conditions of relatively weak evolutionary pressure. In a world of intense and perfect competition, where the fittest animal always survives to reproduce and the least fit always dies, the animal with Eye Part 1 will always die – it’s less fit than its fully-eyeless peers. The weaker the competition, and the more randomness dominates over survival-of-the-fittest, the more likely an animal with Eye Part 1 can survive and reproduce long enough to eventually produce a descendant with Eye Part 2, and so on. There are lots of ways to decrease evolutionary pressure. Maybe natural disasters often decimate the population, dozens of generations are spend recolonizing empty land, and during this period there’s more than enough for everyone and nobody has to compete. Maybe there are frequent whalefalls, and any animal nearby has hit the evolutionary jackpot and will have thousands of descendants. Maybe the population is isolated in little islands and mountain valleys, and one gene or another can reach fixation in a population totally by chance. It doesn’t matter exactly how it happens, it matters that evolutionary pressure is low.
Is this situation realistic?
The first part that struck me is that Scott presupposed that each of these mutations occurs separately. This would make sense in ordinary evolution, where each mutation provides a benefit and reaches fixation. If each mutation is harmful, why bother going through normal competition that the organism is going to lose, and why not just have all three Eye Parts arising by chance at once? It may seem absurd that an organism would spontaneously form a fully-fledged eye, but actually all that indicates is that the entire pathway envisioned here is absurd: As creationists are so eager to point out, something as complex as a compound eye cannot just arise by chance. It requires evolution, which requires intermediate stages that are beneficial to the organism, exactly what has been positted not to occur. You can imagine we’re not actually talking about evolving eyes, but rather a much simpler adaption still goes against the flow of the fitness landscape. If you do it becomes easier to imagine that the entire adaption occurs as a single mutation at once.
But actually, Scott is right: An adaption like this would develop in stages rather than all at once. Let’s calculate this with some made-up numbers. I’ll suppose that each one of these Eye Parts has a 10-5 probability of occurring by chance. Multiply that for all three parts and you get a probably of 10-15 of all three mutations occurring at once. A mutation like that is only likely to occur in a species once 1015 organisms of that species have been born.
Let me emphasize the last sentence: The chance a mutation will occur in a population depends on the number of individuals born in that population, or in other words the total number of individual that have ever existed in the population. That is the product of the population size and the number of generations the population existed. In particular, larger populations acquire beneficial mutations faster. This will be important later.
Now, let’s compare this to developing eyes in stages. Suppose Eye Part 1 only reduces fitness by 1%. Then on average, an individual with Eye Part 1 has 1% fewer descendants, so on average 0.99 of its descendant will also have Eye Part 1. Adding up the geometric series, if an individual acquired Eye Part 1 through a spontaneous mutation it is likely to have around 100 descendants with Eye Part 1. The chance that one of them will acquire Eye Part 2 is $10^2 \cdot 10^{-5} = 10^{-3}$. If an individual with both Eye Parts 1 and 2 loses another 1% in fitness than it will have 50 descendants with both Eye Parts 1 and 2, assuming perfect genetic linkage. Then there’s a $50 \cdot 10^{-5} = 5 \times 10^{-4}$ chance that one of these descendants will acquire Eye Part 3. Multiplying these together, including the probability for the initial Eye Part 1 mutation, there is a $10^{-5} \cdot 10^{-3} \cdot (5 \times 10^{-4}) = 5 \times 10^{-12}$ chance of eyes evolving per individual of eyes evolving. This is still very small, but significantly larger than the 10-15 odds of all mutations happening at once.
In contrast, imagine if each mutation is beneficial and immediately reaches fixation. It takes 105 individuals until one acquires Eye Part 1, and immediately everyone has it. Afterwards it takes 105 individuals each to evolve Eye Parts 2 and 3, a total of 3×105. Since it takes time for traits to reach fixation and even for beneficial traits this doesn’t always occur, it is expected to take a larger number of individuals until eyes evolve, but this is still much less than the numbers required in the above two scenarios where eye parts are maladaptive.
Okay, this is the model for evolving eyes in ordinary circumstances. But what if you add slack? Let’s look at Scott’s first scenario: A disaster wipes out most of the population and leaves behind a resource-rich environment for the survivors, so even individuals with below-average fitness can reproduce above replacement and not have their lineage die out. First of all, I want to question the notion that there is less “evolutionary pressure” here, whatever that means. Less fit individuals can propagate their genes when they wouldn’t have otherwise, but fitter individuals still propagate their genes even more. If by chance a high proportion of the population right after the disaster had some fitness-lowering gene, then by the time the population rebounded the gene would be much less frequent, because the fitter individuals without the gene will repopulate faster than the less fit individuals with the gene. So it’s a matter of perspective: Are we looking at the absolute number of offspring and descendants an individual will have, or are we interested in the proportion of a trait relative to the whole population? If the former then the population boon meaningfully reduces the evolutionary pressure, if the latter than it doesn’t affect it at all.
But we’re not asking a broad qualitative question that could depend on the perspective we take, we’re asking a concrete question: Will this disaster-and-repopulation make evolving eyes more likely? Let’s think. Normally an individual with Eye Part 1 has around 100 descendants like it each which can develop Eye Part 2. During the time of plenty it can have many more than that. Sounds good?
Not so much, once you compare this with what every other individual is doing. If this individual has 100 relatedness-weighted offspring, so does every other individual during time of plenty. If there is sexual reproduction this can be tricky to think about: The first individual with Eye Part 1 has more than 100 descendant, but only some retain Eye Part 1. Other individuals also typically have more than 100 descendants. However, each descendant has many ancestors, so it’s hard to count how many descendants there should be. It’s easier to count genes: Each descendant gene comes from exactly one ancestral gene. If the spontaneously formed Eye Part 1 gene spreads to 100 descendants, then in that time every other gene should also spread to 100 descendants, or a bit more since Eye Part 1 gene reduces fitness. Since we need individuals to store all of these genes — what else are individuals good for? — the population size increases by roughly one hundred.
Now remember what I said earlier about the effect of population size on evolution? If the population increased by a factor of one hundred, that means that at the start — right after the disaster occurred — the population was one hundred times less than the ordinary stable population. That means that the mutation for Eye Part 1 was one hundred times less likely to occur in the first place! This nullifies any advantage that seems to have been gained by the plentiful conditions increasing the chance Eye Part 2 develops. Overall, a disaster that decreases population does not increase the speed the eye evolves.
## 1 thought on “Is There Slack in Evolution?”
1. When Scott talks about evolutionary pressure, he means the degree to which moderately disadvantageous genetic mutations are competitively extinguished from the genetic pool.
If a relatively neutral feature that provides no advantage, and costs very few resources can survive for a long period of time, then the opportunity for two such mutations to interact in a way that produces a competitive advantage is greatly increased.
If even a slight expenditure of resources significantly disadvantages creatures in this environment, then such mutations are far more likely to become extinct without ever being combined in a single creature. | 2020-08-07 12:01:17 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 3, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5443180203437805, "perplexity": 1123.41814567288}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-34/segments/1596439737178.6/warc/CC-MAIN-20200807113613-20200807143613-00369.warc.gz"} |
https://newproxylists.com/tag/forms/ | ## On google forms, can someone edit their response but can’t add a new one?
But when using different browsers or different computers, it can add responses, how to solve it? so that someone can only edit their responses without being able to add more responses?
Because the assumption is that the form has been closed, so one can only edit the responses that he has sent.
## Can we use signed in email address of the user to auto fill the email text box in google forms.?
I am creating a google form in which people will enter their names and email address and other details. I have done this previously but have noticed that most of the people uses their wrong email address. I want to create a google form which will have name and email address. I will share the link of the form to users.
Users will have to first sign in to their gmail account and then they will be redirected to google form in which I want that the email text box should be automatically filled and should not editable.
For ex, john27@gmail.com has signed in and opened the google form. So the email text box in form should automatically fill up with `john27@gmail.com` and should be non editable so that user cannot edit and we capture the users valid email address.
## forms – How can I deal with diverse gender identities in user profiles?
I was having a discussion with my housemate who is a data analyst by trade, and the conclusion that we came to is that there are two sensible options here, depending on the amount of work you personally want to do (we’re assuming here that the collection of gender data is actually useful to you, rather than simply of interest in which case it is almost always better to leave it out).
The simple option is to have three or four discrete options: `Female`, `Male`, `Other`, and possibly `Prefer not to say`. In my experience, this is the most acceptable option for gathering data while being both simple and inclusive – it acknowledges that there are people who don’t fit the gender binary, allows users to select a different option, and doesn’t overload your cisgendered users with lots of options. It also allows people to completely opt out if they really don’t want to answer (the standard objection is that it’ll negatively impact your data collection, but in practice it probably doesn’t make much of a difference). Note that if gender identity is particularly important to your application, then this may not be the most sensible or inclusive option.
The ideal but more complex option is to have a textbox and suck it up – it’s a data sanitisation problem. A simple find/replace on your dataset will be able to lump your users into a group of man/male/boy responses, a group of woman/female/girl responses, and a group of assorted other responses. Crucially if you’re doing demographic analysis, whatever is left over probably isn’t statistically significant at an individual level so in your analysis it is acceptable to put them in an internal `Other` category. You can then preserve that minority data for further study should you find you need it.
Alternatively, as noted in the comments, it may be possible to combine the two approaches. Once a user selects your `Other` option, you could then display a text box which allows them to specify their gender identity exactly. This has the benefit of minimising cognitive load on cisgendered users while also capturing specific minority data. The downsides are that you may still run into issues sanitising this data to make it useful, and your form must be able to handle revealing a hidden element.
Gender is the correct label for this field, from a descriptive point of view and from a data collection point of view. You’d be surprised how many people think it’s hilarious to answer `Sex:` with “Yes please”.
If you choose to go with the simple dropdown/radio button approach, then `Other` is probably the most appropriate label for the third group. It is easily understandable, and non-exclusive in terms of what it might represent. `Transgender` is probably not an appropriate label here unless you include additional ones because it excludes people outside the binary who are not transgender or who do not view the label as appropriate for them, and it doesn’t actually tell you the respondent’s gender (transgender just tells you their gender is not the same as their assigned sex at birth). The problem with the use of the word “other” is that it is exclusionary and can potentially feel like the user is being shoved into a box of leftovers – not an ideal experience! For that reason, a text box is probably preferred if you want to make sure you’re being inclusive.
Think Outside The Box mirrors these recommendations and has some other interesting guidelines for form construction.
## forms – What is the best way to hide a Honeypot Captcha?
I hide the honeypot field using some positioning/clipping as I suspect `display: none` is a clue to a spambot to avoid the field. At the least, it’s a possibility.
However, I appreciate it seems a lot for a bot to parse the HTML class and find the property value pair in the CSS itself. I wonder if class names such as `hide` alert the spammer? That would be a lot easier to figure out.
Ideally, we’d make the form as usable and easy as possible and deal with any spam that generates away from the user. The problem here can be financial, especially if you’re running a static/headless site, as most form services charge for the number of submissions you generate. For example, Netlify will give you 100 submissions a month for free, but then they’ll charge.
My anecdotal evidence was that more spam appeared to get through my Netlify forms when I was using `display: none`. Of course, Netlify’s own spam filter may have improved, so I can’t be sure the clipping/positioning approach made a difference.
If you are hiding the form rather than blitzing it a screen reader will still announce it. This is one of the few occasions where `display: none` makes something more usable as it means one less field to interpret and navigate for a screen reader. However, I don’t think it’s right to say not using `display: none` is inaccessible; as long as the honey pot field has a label that makes it obvious the field should be left empty, it’s accessible.
I guess there’s also the possibility that spam bots scan the label text to identify honey pot fields. This poses another problem – how do you avoid words like robot and spam in the field label?
## c# – Integrar MercadoPago Checkout en Xamarin Forms
Estoy diseñando una aplicación para android y iOs en la cual necesito realizar cobros en el momento ya que es de delivery. Quisiera integrar el sistema de mercado pago pero no encuentro ninguna guía ni nada específico que me ayude a integrarlo de manera correcta.
Desde ya espero su ayuda.
Saludos!!
I have an entity form with a dependent field. The dependent field is created following this guide and using Business Rules module.
Everything works fine, but now the form takes an insane amount of time to load (7011.24 ms) and makes an insane amount of queries (4040).
These queries come from business_rules.process and many of them are repeated. For example, this one `SELECT name, value FROM key_value_expire WHERE collection = :collection AND expire > :now` is made 1287 times.
If I disable the Bussines Rules module or remove the dependent field, everything goes to normal, with ~120 queries and normal form loading time.
Is there something I am missing? If not, any alternatives to make a dependent field?
## Can a lambda expression be beta-equal to beta-normal forms?
Given a Lambda Expression Term T can it be beta-equal to two different Lambda Terms T1 and T2, both T1 and T2 are in beta-normal form?
## differential geometry – How to compute Weitzenböck identity for forms?
I am interested to calculate the Hodge Laplacian of $$k$$ forms in local coordinates. For this I want to apply the following formula:
Let $$omega$$ be a $$k$$-form and $$M$$ be a Riemannian manifold with Levi-Civita connection $$nabla$$. Asuume the metric tensor is given by $$g =g_{ij} dx^a dx^b$$. Then $$textbf{Weitzenböck formula}$$ is as follows.
$$textbf{Weitzenböck formula:}$$ The Weitzenböck formula states that the Hodge Laplacian on $$k$$-forms satisfies $$Deltaomega=(ddelta+delta d)omega=nabla^*nablaomega +operatorname{Ric}(omega),$$ where $$nabla^*nabla$$ is given by $$nabla^*nabla=-sum_{k,j} big{ g^{kj}nabla_knabla_j+frac{1}{sqrt{|g|}}partial_{x^k}big(sqrt{|g|}g^{kj}big)cdotnabla_j big}.$$
Moreover, the details of $$textbf{Weitzenböck formula}$$ can be found here.
I am facing problems to compute this. How should I start this? Moreover at this moment I want to unwind the formula for $$2$$-forms, or $$1$$-forms. I should I start this? Which things I need to compute to unwind the formula?
Also I want to know how to compute the ricci term $$Ric (omega)$$ in this case? | 2021-01-18 17:21:52 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 16, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4354020655155182, "perplexity": 922.750204909905}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703515075.32/warc/CC-MAIN-20210118154332-20210118184332-00442.warc.gz"} |
https://discuss.codechef.com/t/swperms-editorial/12239 | # SWPERMS - Editorial
#1
Contest
Practice
## PROBLEM:
A permutation P= (p[1], p[2], …, p[n]) of (1, 2, …, n) is written on a blackboard. You have m pairs of integers (x_i, y_i). At any stage you can choose a pair (x, y) and swap the values of p[x] and p[y] (note that P is still a permutation after this operation). Initially P= (1, 2, …, n). Find the number of different permutations you can obtain after finite number of operations.
## TL;DR:
Consider an undirected graph with vertices 1, 2, …, n where there is an edge between x and y for each given pair (x, y). Let c_1, c_2, \cdots , c_t be the sizes of the connected components of this graph. The answer will be (c_1)!\cdot (c_2)! \cdots (c_t)!
## FULL SOLUTION:
Let’s consider the graph where the vertices are labelled 1, 2, …, n and pairs are edges. Note that swapping a pair (x, y) is equivalent to switching the labels of the vertices across the corresponding edge.
Observation 1: If there is no path from u to v in this graph, it is not possible to get a permutation P where P= v.
Proof: Suppose otherwise that it is possible to apply the swaps in some order that the label of vertex u is at the position of vertex v . Let t_1, t_2, ..., t_k be the successive vertices with which u was swapped- this means the edges u-t_1, t_1-t_2, \cdots , t_{k-1}-t_k and t_k-v are all present in our graph, i.e. there is a path from u to v. Contradiction.
From observation 1, we find out that if u and v are in different connected components their positions cannot be interchanged. We can now treat each connected component separately. Let f(i) be the number of ways the i’th component can be permuted, then the answer will be simply f(1) \cdot f(2) \cdots f(t) where t is the number of connected components.
Now we shall prove that all possible permutations of a component can be obtained after finitely many operations, i.e. all k! permutations of a connected component of size k can be attained. Note that this is equivalent to proving that if the graph is connected, all n! permutations are achievable.
Claim: If the graph is connected, all permutations of 1, 2, …, n can be obtained.
Proof: There are probably multiple ways to prove this. Here’s a simple one. We’ll prove that for all u≠v, it is possible to apply the swaps in such a way that the positions of all other elements are unchanged and those of u and v are interchanged. Since the graph is connected, there exists a simple path t_1, t_2, ..., t_k from u to v. Apply the operations u-t_1, t_1-t_2, ...., t_{k-1}-t_k, t_k-v - this brings the label of u to the position of v and the label of v to the position of t_k. Apply the operations t_k-t_{k-1}, t_{k-1}-t_{k-2}, ..., t_1-u again- now all other labels are at their original positions and those of u and v were interchanged. Thus we can always say (u, v) is one of the pairs given to us (even though it isn’t)- because there exists a sequence of allowed operations which has the exact same effect. Now we can simply claim to have all \binom{n}{2} pairs available and it’s easy to get to the conclusion.
This claim shows that the number of permissible permutations of the i’th connected component is (c_i)! where c_i is its size. Thus, the answer is (c_1)! \cdot (c_2) ! \cdots (c_t)! where t is the number of connected components. This can be found in O(m+n) with a plain dfs. | 2019-04-23 12:50:44 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9362219572067261, "perplexity": 385.10253311959605}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-18/segments/1555578602767.67/warc/CC-MAIN-20190423114901-20190423140901-00251.warc.gz"} |
http://cboard.cprogramming.com/windows-programming/79782-cant-compile-gdiplus.html | # Cant Compile GDI+
This is a discussion on Cant Compile GDI+ within the Windows Programming forums, part of the Platform Specific Boards category; I have downloaded the GDI+ .h, .lib, and .dll files and when I put them in their proper directories (.h ...
1. ## Cant Compile GDI+
I have downloaded the GDI+ .h, .lib, and .dll files and when I put them in their proper directories (.h in include, .lib in lib, and .dll in application folder), I recieve numerous compiler errors:
Code:
```534 C:\Dev-Cpp\include\SDK\GdiplusEnums.h use of enum `EmfPlusRecordType' without previous declaration
548 C:\Dev-Cpp\include\SDK\GdiplusEnums.h invalid use of undefined type `enum Gdiplus::EmfPlusRecordType'
543 C:\Dev-Cpp\include\SDK\GdiplusEnums.h forward declaration of `enum Gdiplus::EmfPlusRecordType'
548 C:\Dev-Cpp\include\SDK\GdiplusEnums.h enumerator value for `WmfRecordTypeSetBkColor' not integer constant```
Then there are like 500 or so just like that and it would take me like hours to copy and paste them all, since Dev C++ only allows you to copy one at a time. I'm including <windows.h>, then <GdiPlus.h> and I'm linking GdiPlus.lib. Is there something I'm doing wrong? There could be a slight possibility that I have an improper version of GDI+ because I couldnt find a download anywhere. I had to install SDK to get the files like I read on a tutorial.
Thanks in advance for any help!!!
2. Dev-C++ uses .a files, so I don't think .lib files will work for it.
3. Well, when I add go to add a .lib file, the "Files of Type:" says "Library (*.a,*.lib)". But if this is the case, where could I download the .a file?
Thanks.
4. You build it from the redistributable gdiplus.dll with reimp, which is part of mingw-utils.
5. Thanks for the information. I was able to build the .a file from the .lib file. I couldnt find out how to build it from the .dll file. However, that didnt help me any. Where could I download the most recent/proper header files (because I think thats my problem)?
Thanks.
Popular pages Recent additions | 2014-03-11 14:29:09 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8153797388076782, "perplexity": 4363.539546878121}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-10/segments/1394011208420/warc/CC-MAIN-20140305092008-00068-ip-10-183-142-35.ec2.internal.warc.gz"} |
https://nrich.maths.org/5706 | ### On Time
On a clock the three hands - the second, minute and hour hands - are on the same axis. How often in a 24 hour day will the second hand be parallel to either of the two other hands?
### Right Time
At the time of writing the hour and minute hands of my clock are at right angles. How long will it be before they are at right angles again?
### Estimating Angles
How good are you at estimating angles?
# Hexapentagon
##### Age 11 to 14 Short Challenge Level:
The diagram shows a regular pentagon and regular hexagon which overlap. What is the value of $x$?
If you liked this problem, here is an NRICH task which challenges you to use similar mathematical ideas.
This problem is taken from the UKMT Mathematical Challenges.
You can find more short problems, arranged by curriculum topic, in our short problems collection. | 2019-06-17 19:34:54 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.28507936000823975, "perplexity": 1038.7979195903276}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-26/segments/1560627998558.51/warc/CC-MAIN-20190617183209-20190617205209-00314.warc.gz"} |
https://physics.stackexchange.com/questions/290534/keplers-3rd-law-law-of-periods | # Kepler's 3rd law/law of periods
Kepler's 3rd law of planetary motion is
The square of the time period of a planet orbiting a sun is proportional to the cube of the semi major axis of the elliptical orbit.
$$(T_1)^2 = (A_1)^3,$$
But in many other sites it (the square of the time period) is said to be proportional to the mean radius of the elliptical orbit.
$$(T_1)^2 = (R_1)^3,$$
which one is correct? Or is there a relation between the mean radius and the semi major axis which cancel out because of proportionality?
averaging over the true anomaly (the true orbital angle, measured at the focus) results, oddly enough, in the semi-minor axis ${\displaystyle b=a{\sqrt {1-e^{2}}}}$.
averaging over the mean anomaly (the fraction of the orbital period that has elapsed since pericentre, expressed as an angle), finally, gives the time-average ${\displaystyle a\left(1+{\frac{e^{2}}{2}}\right)}$.
The time-averaged value of the reciprocal of the radius, ${\displaystyle r^{-1}}$, is ${\displaystyle a^{-1}}$. | 2022-05-28 20:45:10 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9696905016899109, "perplexity": 348.6888782853825}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652663019783.90/warc/CC-MAIN-20220528185151-20220528215151-00591.warc.gz"} |
https://www.datasciencecentral.com/profiles/blogs/exploring-modern-portfolio-theory | # Exploring Modern Portfolio Theory
Contributed by Stephen Penrice. Stephen took NYC Data Science Academy 12 week full time Data Science Bootcamp pr... between Sept 23 to Dec 18, 2015. The post was based on his second class project (due at 4th week of the program).
## Introduction
I see Shiny as a tool for quickly and easily prototyping models without having to call in a development team. So I wanted to create an app that does non-trivial calculations on a set of user inputs and returns the results in a visual format. Modern Portfolio Theory, developed by Henry Markowitz in the 1950’s, fit my requirements. I was also motivated by a desire to create an intuitive tool to help people understand the theory, something I wish I had had when I entered finance.
Modern Portfolio Theory begins with the assumption that returns on any risky asset are normally distributed. This in turn implies that any portfolio of risky assets has normally distributed returns, since a portfolio is simply a linear combination of individual assets. A normal distribution can be described by two parameters, its mean and standard deviation, which can be graphed in a plane. Customarily in finance the standard deviation is referred to as volatility (or vol) and graphed on the horizontal axis and the mean (or expected return) is graphed on the vertical axis. Modern Portfolio Theory states that for any set of risky assets the points corresponding to all possible portfolios of the assets all fit in the interior of a hyperbola (referred to as the “Efficient Frontier” or less commonly the “Markowitz Bullet”) and that the optimal portfolios are those whose points lie on the upper boundary of the hyperbola, since they represent the best possible expected return for a given level of volatility, assuming the investor holds only risky assets.
A wider range of portfolios is possible when an investor makes use of a risk-free asset (i.e. cash) to either reduce volatility and return by holding cash or increase volatility by borrowing cash to enable margin buying. In the case, all the optimal portfolios lie on a line that crosses the vertical axis at the risk-free rate r (corresponding to an all-cash portfolio, with expected return r and volatility 0) and a point on the hyperbola such that the line is tangent to the hyperbola.
Granted, this discussion is hard to follow without a visual, and hence the motivation for the Shiny app, which you can access here.
## Using and Interpreting the App
The app has a menu of checkboxes allowing the user to select assets from a list of 16 publicly traded stocks. Once the stocks are selected, pressing the “Calculate Efficient Frontier” button displays the Efficient Frontier along with the Capital Allocation Line. The Efficient Frontier is the curve that shows, for every possible expected return, the minimum volatilty for the portfolios that have that expected return. So the only portfolios comprising the given assets that are of interest are the ones corresponding to points on the upper half of the Efficient Frontier, because if a portfolio’s volatilty and expected return are in the interior of the “Markowitz Bullet,” that means there is a portfolio on the upper boundary that has the same volatility but a higher expected return.
One thing to play around with in the app is the mix of assets. For example, you can see that the left end of the bullet moves to lower volatility as you add assets. This demonstrates the concept that diversified portfolios are less risky than one concentrated in a few assets. Notice that there is an option near the top of the page to “Hide Capital Allocation Line,” which may be helpful when exploring the effects of diversity on volatility.
But what is the Capital Allocation line all about? It represents the volatility and expected return of optimal portfolios that include cash as well as risky assets. (Finance theory calls cash the “risk-free” asset, and the “risk-free rate” is the interest rate that an investor receives/pays to save/borrow cash.) An investor can lower portfolio volatility by holding cash, or increase volatility by borrowing money. (Buying stocks with borrowed money amplifies both positve and negative returns. Suppose you buy $100 of a stock using$50 of your own money and $50 of borrowed money. A$5 movement in the stock’s prices represents a 5% change in price but a 10% profit or loss on your investment.)
The Capital Allocation Line is defined by two points. One point corresponds to the most conservative portfolio possible, consisting entirely of cash. This portfolio has zero volatility, its expected return is the risk-free rate, and it is optimal because it is the only portfolio with zero volatility. The other point that defines the Capital Allocation Line is the point where the line tangent to the efficient Frontier passes through the point we just looked at, and we can call the corresponding portfolio the “Tangent Portfolio.” For any given level of volatilty, the optimal portfolio is some mixture of cash and the Tangent Portfolio, and the point representing its volatilty and expected return lies on the Capital Allocation Line.
The app illustrates these ideas nicely. The user can adjust the “Volatility Target” slider at the bottom of the page and watch the dot representing the optimal portfolio move up and down the Capital Allocation Line. The app also displays the optimal allocation (expressed as a percentage of the investor’s capital) given a choice of assets, a volatility target, and a risk-free rate. If you adjust the volatility target, you may notice that while the stock allocations change, their relative sizes remained fixed. That is because in any optimal portfolio the proportions on the risky assets are the same as in the Tangent Portfolio.
Note that a portfolio might include negative allocations to cash or stocks. Negative cash means borrowing to finance assset pruchases, and a negative stock allocation means “shorting,” i.e. borrowing a stock, then selling it and investing the proceeds in the hope that the price will go down, allowing the investor to repurchase it at the lower price and keep the difference after returning the borrowed shares.
It’s also interesting to think about what happens when the risk-free rate changes but the investor’s volatility target remains the same. If interest rates go up, the investor has an incentive to hold more cash. But this will decrease the portfolio’s volatility, so in order to compensate, the mix of stocks need to be riskier. The app illustrates this as well. If you increase the risk-free rate using the slider, you will see both an increase in the “Tangent Portfolio Volatilty” (calculated at the bottom of the page) and a rightward shift in the point of tangency on the Efficient Frontier. Likewise, a decrease in the risk-free rate creates an incentive to borrow, resulting in a need for a less risky mix of stocks, which can be seen in both the graph and the bar chart when you move the risk-free rate slider to the left. (A particularly good starting point for this particular exploration is to select Novartis, Merck, and Eli Lilly and set the target volatility to 21.5%. Remember to click the “Calculate Efficient Frontier” button!)
Using the “Long Only” checkbox at the top of the page, the user can also see the effect of restricting to long-only portfolios, i.e. protfolios that don’t make use of borrowed cash or shorted stocks.
Now let’s look at a few technical aspects of the app.
## Interface
The interface has some features that help to prevent problematic inputs. If the user selects fewer than 2 assets, a message will be displayed indicating that at least two assets must be selected; this prevents an error in the function that calculates the optimal portfolios.
The range of values available on the risk-free rate slider is determined by the choice of assets. Since the efficient fontier is a hyperbola, it has an asymptote that the upper part of the efficient frontier approaches as the volatility goes to infinity. The slider prevents the risk-free rate from exceeding the y-intercept of this asymptote.
## Back-end Code
In order to keep the focus of this project on the model, I elected to choose a small set of assets, collect the return data one time, and store the data in an Rds file. For this I used the quantmod package. Specifically, I downloaded monthly returns for the 16 stocks from January 2007 to October 2015. These returns are stored in “long” format comprising there three columns: the return, the month, and the company’s ticker symbol.
library(dplyr)library(quantmod)
library(tidyr)
library(stringr)
getReturns <- function(ticker){
getSymbols(ticker)
temp.returns <- periodReturn(get(ticker), period = 'monthly')
temp.df <- data.frame(temp.returns)
temp.df$date <- row.names(temp.df) temp.df$ticker <- ticker
return(temp.df)
}
portfolioReturns <- function(tickers){
dfs <- lapply(tickers, getReturns)
stacked <- NULL
for(i in 1:length(dfs))
stacked <- rbind(stacked,dfs[[i]])
return(stacked)
}
full.list <- portfolioReturns(c('PFE','NVS','MRK','LLY',
'GS','JPM','MS','PNC',
'TWX','CMCSA','DIS','DISCA',
'WMT','TGT','HD','COST'))
full.list$date <- str_sub(full.list$date, 1, 7)
saveRDS(full.list,"eff_front_app/full_list.rds")
The model’s heavy lifting is done by the quadprog package. I used the following code to calculate the mean vector and covariance matrix from historical returns (after putting them in a “wide” data frame with a column for each ticker) and then calculate the minimum variance portfolio for a given target return. (The server calls these functions, as will be explained below.)
library(quadprog)
assetCov <- function(stacked, tickers){
if(is.null(stacked))
return(NULL)
else {
selected <- stacked[sapply(stacked$ticker, function(x) x %in% tickers),] %>% spread(.,ticker,monthly.returns) covMat <- 12*cov(selected[,-1], use = "complete.obs") return(covMat) } } assetMean <- function(stacked, tickers){ if(is.null(stacked)) return(NULL) else { selected <- stacked[sapply(stacked$ticker, function(x) x %in% tickers),] %>%
meanVector <- colMeans(selected[,-1])
return(12*array(meanVector))
}
}
mean.var.opt <- function(means, covMat, target, longOnly = FALSE){
Dmat <- 2*covMat
dvec <- matrix(0,nrow(covMat),1)
Amat <- cbind(rep(1,nrow(covMat)),means)
bvec <- matrix(c(1,target),1,2)
if(longOnly){
Amat <- cbind(Amat,diag(nrow(covMat)))
bvec <- cbind(bvec, matrix(0,1,nrow(covMat)))
}
return(solve.QP(Dmat,dvec,Amat, bvec = bvec,meq=2))
}
Note that mean.var.opt has an optional longOnly flag that adds non-negativity constraints.
## Server
For the most part the server acts as a intermediary between the interface and the portfolio optimizer. One of the more interesting pieces of server code is the function that calculates the Efficient Frontier.
covMat <- reactive({assetCov(full.list,portfolio())})
assetMns <- reactive({assetMean(full.list,portfolio())})
riskyEF <- reactive({
if(longOnlyFlag() & min(assetMns()) /span> 0)
minmean <- 0
else
minmean <- min(assetMns())
mult <- ifelse(longOnlyFlag(),1,2)
mns <- seq(minmean,mult*max(assetMns()), by = 0.001)
sds <- sapply(mns, function(x) mean.var.opt(assetMns(), covMat(),x,longOnlyFlag())[[2]]^0.5)
data.frame(expRet = mns, Vol = sds, curve = "EF")
})
This function sets maximum and minimum return targets (which depend on the selected assets and whether the long-only option is selected) and creates a list of values extending from the maximum to the minimum in steps of 0.1%. Then the server uses sapply to call the optimizer on each of these target inputs to obtain the corresponding minimum volatilty. The resulting points are stored in a data frame so they can be easily plotted with ggplot2.
## Conclusion
This app could be enhanced with more options for user input. Obviously, it could provide more asset options and gather return data on demand. More fundamentally, it could provide the user with the capability to specify a mean vector and covariance matrix based on his or her views, rather than taking historical returns as the best estimate of future performance. There could also be greater flexibility in specifying constraints, for example putting a cap on the proportion invested in a certain company or industry. In any case, the app provides a tool for visually exploring an important piece of finance theory.
Views: 1897
Comment
Join Data Science Central | 2020-07-15 08:03:11 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4712619185447693, "perplexity": 1197.1662380051657}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593657163613.94/warc/CC-MAIN-20200715070409-20200715100409-00498.warc.gz"} |
https://stats.stackexchange.com/questions/92328/what-is-relationship-between-significant-correlation-and-significant-differen | What is relationship between "significant correlation" and "significant difference"
What is relationship between "significant correlation" and "significant difference" between two variables?
If you have two different variables, you can calculate how they are correlated. Does height correlate with blood pressure? Does age correlate with income? You can also compute a 95% confidence interval for the correlation coefficient.
If you have one variable measured in two groups, you compute the difference between the two means. You can also compute a 95% confidence interval for the difference.
The concept of "significance" is so often misunderstood, I think it is best to just stop with the confidence intervals. But you can ask if the correlation coefficient is far enough away from zero (considering the sample size) to be statistically significant, and if the difference between the two means is far enough from zero (considering the sizes of the two samples, and the variability within the two samples) to be statistically significant.
The key distinction is whether you have two variables, or one variable in two groups.
• My question is that what is relationship between "correlation" and "difference" between two variables? X and Y are correlated. Do they must have difference? X and Y are different. Do they must have correlation? Apr 3, 2014 at 2:02
Your comment is clearer than your original question – enough so that I may be able to clear things up for you.
My question is that what is relationship between "correlation" and "difference" between two variables? X and Y are correlated. Do they must have difference? X and Y are different. Do they must have correlation?
The short answer to both is no.
If $X$ and $Y$ correlate, any less-than-perfect correlation $(|\rho|<0)$ implies differences in individual values, but not necessarily in summary statistics like means, medians, variances, etc.
For example, with $X=\{0,0,1\},Y=\{0,1,0\},\mu_x=\mu_y,\rho=-.5$. With $X=Y,\rho=1$. However, with with $X=-Y,\mu_x=-\mu_y,\rho=-1$.
Thus only in the case of a perfect correlation can two variables exhibit no differences whatsoever, but the possibility remains that they are exact opposites. Correlation implies nothing about differences in means, medians, or variances.
If $X$ and $Y$ differ, they may or may not correlate; there is no "must" here. For example, with $X=\{0,0,0\},Y=\{0,1,0\},\mu_x<\mu_y$, but since $X$ has $\sigma=0$, $\rho$ is undefined. Conversely, with $X=\{0,0,1\},Y=\{1,1,0\},\mu_x<\mu_y,\rho=-1$. These examples are the simplest I can think of.
• Dear Nick, What is your interpretation about undefined ρ? Apr 3, 2014 at 3:49
• There is no information to interpret about correlations involving one variable with completely invariant data. Apr 3, 2014 at 3:52
Testing the statistical significance of correlation coefficients involves the same logic as testing the statistical significance of differences between group means or proportions. Whereas the null hypothesis in the latter tests states that there is no real difference between groups in the population and that any observed differece in our sample is due to sampling error, the null hypothesis with correlation coefficients states that there is no real correlation in the population (i.e., $r= 0.00$) and that any observed correlation in our sample is due to sampling error. Just as in other tests of significance, sampling error when testing the statistical significance of correlation coefficients involves the use of theoretical sampling distributions with an assumed mean correlation of $0$.
From :Statistics for Evidence-Based Practice and Evaluation By Allen Rubin
• I'm sorry I can't even read that. You're welcome to type in a short quote if you want your answer to be legible, but it would also be a good idea to add some of your own thoughts, e.g. interpreting the material in the light of the question. Apr 7, 2014 at 13:45 | 2022-05-28 00:55:47 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6531700491905212, "perplexity": 489.0439920048977}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652663011588.83/warc/CC-MAIN-20220528000300-20220528030300-00047.warc.gz"} |
https://mfix.netl.doe.gov/doc/tracker/19.1.0/userguide/process.html | # Process Images¶
After the media is opened, the individual frames are processed using a series of transforms. These transforms are applied and controlled on the Process tab. Unfortunately, which transforms to use depend heavily on the media. The basic goal is to maximize the contrast between the objects and the background. This process is very subjective, requiring trial and error.
Filters and transforms are applied sequentially in the order they are listed in. The results of individual steps can be seen by hovering over the filter or transform options.
## Histogram¶
The first widget on the processing tab shows the histograms of the pre-processed frame (light gray) and the final processed image (dark blue) of the currently displayed frame. The histogram shows the normalized counts of pixels at a certain value. A counts of pixel values of 0 (black) are on the left side and counts of pixel values of 255 (white) are on the right side.
## Decomposition Overlap¶
When using parallel processing, there needs to be an overlap between neighboring tiles just larger then the largest object being tracked. Having an overlap too small will cause tracks to be lost while having an overlap to large will cause extra processing of pixels.
Note
To see the tiles, go the the visualization tab and select the Show domain decomposition check-box.
## Rotating¶
Frames can be rotated in increments of 90° by checking the Rotate check-box and selecting the amount of rotation to apply.
## Cropping¶
Frames can be cropped by checking the Crop check-box and entering the amount of pixels to crop. The Left and Top entries are positive integers while the Right and Bottom entries are negative integers.
## Background Subtraction¶
If there are structures in the image that do not move, these can be removed by using background subtraction. Background subtraction can be enabled by selecting the Background Subtraction check-box. There are three methods available:
1. mean - builds and updates an array of frames which is used to calculate a moving mean for each pixel. This mean is then subtracted from every frame. This method is implemented using numpy.
2. MOG2 - “Improved adaptive Gaussian mixture model for background subtraction” as implemented in OpenCV
3. KNN - “K-nearest neighbors - based Background/Foreground Segmentation” as implemented in OpenCV
Note
The history of the background subtraction methods is constructed as the frames are processed, so the first frame will typically be blank since there is no history.
## Denoise¶
Noise can be removed from frames by selecting the Denoise check-box. There are three methods available:
1. Gaussian blur
2. Median blur
3. Bilateral filter
These three methods are implemented in OpenCV. See Smoothing Images for a tutorial with all three methods and more information.
## Brightness and Contrast¶
The brightness and contrast of the frames can be adjusted using a linear transformation of the pixel values by selecting the Brightness, Contrast check-box:
$g(i,j)=\alpha⋅f(i,j)+\beta$
Where $$\alpha > 0$$ and $$\beta$$ are said to control contrast and brightness respectively. $$f(i,j)$$ is the pixel value of the input and $$g(i,j)$$ is the pixel value of the output.
See Changing the contrast and brightness of an image for more information.
## Tone Curve¶
The brightness and contrast of the frames can be also be adjusted using a user controlled spline that is fit through 4 points, similar to tools found in Adobe’s Lightroom, by selecting the Adjust Tone curve check-box. This is similar to the linear transformation except that the input pixel values, $$f(i,j)$$, are transformed with a B-spline, $$h()$$, resulting in the pixel value of the output, $$g(i,j)$$:
$g(i,j)=h(f(i,j))$
Scipy’s splrep is used. This allows significant user control over increasing the contrast of the objects of interest.
## Equalize Histogram¶
The contrast of the frames can be also be adjusted by using histogram equalization by selecting the Equalize Histogram check-box. Histogram equalization tries to stretch the intensity of the pixels to use the full range of available values (0-255). In some cases where the lighting is not uniform, adaptive histogram equalization can be used by selecting the Adaptive check-box. This will use the Contrast Limited Adaptive Histogram Equalization (CLAHE) technique as implemented in OpenCV. See Histograms - 2: Histogram Equalization for more information.
## Threshold¶
A threshold can be applied to the frame by selecting the Threshold check-box. There are several types of thresholds that can be applied:
type condition
binary $$g(i,j)= 255 \text{ if } f(i,j)>thresh \text{ else } 0$$
binary inverted $$g(i,j)= 0 \text{ if } f(i,j)>thresh \text{ else } 255$$
truncated $$g(i,j)= thresh \text{ if } f(i,j)>thresh \text{ else } f(i,j)$$
to zero $$g(i,j)= f(i,j) \text{ if } f(i,j)>thresh \text{ else } 0$$
to zero inverted $$g(i,j)= 0 \text{ if } f(i,j)>thresh \text{ else } f(i,j)$$
Where $$f(i,j)$$ is the input pixel value, $$thresh$$ is the selected threshold value, and $$g(i,j)$$ is the resulting output pixel value.
## Particle Detection¶
The last step in the processing of the images is the identification of the objects. To apply a object detection filter, select the Particle Detection check-box. There are three object detection filters including Simple Blob, Label, and Hough Circles.
### Simple Blob¶
Simple blob is an efficient algorithm for finding blobs in an image. It works by finding centers of contours at several thresholds from Min Threshold to Max Threshold, groups the centers, and then filters the blobs based on area, circularity, inertia, and/or convexity. This method is the preferred method for identifying objects.
### Label¶
If either a binary or binary inverted threshold is used, then the groups of pixels can be labeled . The centers of the labels can then be determined and used. This technique does not work well when objects are touching.
### Hough Circles¶
The Hough Circle Transform tries to find circles in an image. This transform works well if the objects are nice, fairly uniform circles, however it is sensitive to the input parameters and can be expensive. It can find overlapping circles. | 2019-08-19 03:27:52 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3406795561313629, "perplexity": 1385.725164590327}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-35/segments/1566027314641.41/warc/CC-MAIN-20190819032136-20190819054136-00078.warc.gz"} |
https://www.photoshopgurus.com/forum/threads/how-to-make-text-more-vibrant-and-more-interesting-to-read.53866/ | What's new
# how to make text more vibrant and more interesting to read.
#### gautamz07
##### Power User
guys , I was just making a section which contains the about us paragraph . i usually see the about us sections are quite boring and the text from a users perspective is quite boring and uninteresting . have a look below :
can that be made anymore interesting ? how ?
i mean from a UI perspective , would it be good if i used just for the sake of attention grabbing , used a certain words as highlighters ( made them bold or bigger font or a different font ) ?
i just want to keep it simple but at the same time make the content more interesting (in a graphic way) . whats the simpliest and best way to do this ..... instead of a demontration , suggestions would be great .
Thank you.
Gautam .
#### SweetMonia
##### Member
In my opinion, it really depends on what emotion do you want to evoke from the text, from the text picture you posted, I think you may want the text to look spontaneous, but in the design and the font you selected, I getting a formal vibes. So simple change like changing the font can make the text appear more casual. Also, I suggest you remove the double quotes, because they are part of what makes the text formal. I also suggest you add a picture of one of the T-Shirts you are selling, that way, the customer can look at it and understand what your T-****s are trying to do for them
#### gautamz07
##### Power User
tried this , looks better now .
Thanks . | 2022-01-18 22:15:32 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8546178936958313, "perplexity": 1161.632735729409}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320301063.81/warc/CC-MAIN-20220118213028-20220119003028-00552.warc.gz"} |
https://db0nus869y26v.cloudfront.net/en/Quantifier_elimination | Quantifier elimination is a concept of simplification used in mathematical logic, model theory, and theoretical computer science. Informally, a quantified statement "${\displaystyle \exists x}$ such that ${\displaystyle \ldots }$" can be viewed as a question "When is there an ${\displaystyle x}$ such that ${\displaystyle \ldots }$?", and the statement without quantifiers can be viewed as the answer to that question.[1]
One way of classifying formulas is by the amount of quantification. Formulas with less depth of quantifier alternation are thought of as being simpler, with the quantifier-free formulas as the simplest. A theory has quantifier elimination if for every formula ${\displaystyle \alpha }$, there exists another formula ${\displaystyle \alpha _{QF))$ without quantifiers that is equivalent to it (modulo this theory).
## Examples
An example from high school mathematics says that a single-variable quadratic polynomial has a real root if and only if its discriminant is non-negative:[1]
${\displaystyle \exists x\in \mathbb {R} .(a\neq 0\wedge ax^{2}+bx+c=0)\ \ \Longleftrightarrow \ \ a\neq 0\wedge b^{2}-4ac\geq 0}$
Here the sentence on the left-hand side involves a quantifier ${\displaystyle \exists x\in \mathbb {R} }$, while the equivalent sentence on the right does not.
Examples of theories that have been shown decidable using quantifier elimination are Presburger arithmetic,[2][3][4][5][6] algebraically closed fields, real closed fields,[6] [7] atomless Boolean algebras, term algebras, dense linear orders,[6] abelian groups,[8] random graphs, as well as many of their combinations such as Boolean algebra with Presburger arithmetic, and term algebras with queues.
Quantifier eliminator for the theory of the real numbers as an ordered additive group is Fourier–Motzkin elimination; for the theory of the field of real numbers it is the Tarski–Seidenberg theorem.[6]
Quantifier elimination can also be used to show that "combining" decidable theories leads to new decidable theories (see Feferman-Vaught theorem).
## Algorithms and decidability
If a theory has quantifier elimination, then a specific question can be addressed: Is there a method of determining ${\displaystyle \alpha _{QF))$ for each ${\displaystyle \alpha }$? If there is such a method we call it a quantifier elimination algorithm. If there is such an algorithm, then decidability for the theory reduces to deciding the truth of the quantifier-free sentences. Quantifier-free sentences have no variables, so their validity in a given theory can often be computed, which enables the use of quantifier elimination algorithms to decide validity of sentences.
## Related concepts
Various model-theoretic ideas are related to quantifier elimination, and there are various equivalent conditions.
Every first-order theory with quantifier elimination is model complete. Conversely, a model-complete theory, whose theory of universal consequences has the amalgamation property, has quantifier elimination.[9]
The models of the theory of the universal consequences of a theory ${\displaystyle T}$ are precisely the substructures of the models of ${\displaystyle T}$.[9] The theory of linear orders does not have quantifier elimination. However the theory of its universal consequences has the amalgamation property.
## Basic ideas
To show constructively that a theory has quantifier elimination, it suffices to show that we can eliminate an existential quantifier applied to a conjunction of literals, that is, show that each formula of the form:
${\displaystyle \exists x.\bigwedge _{i=1}^{n}L_{i))$
where each ${\displaystyle L_{i))$ is a literal, is equivalent to a quantifier-free formula. Indeed, suppose we know how to eliminate quantifiers from conjunctions of literals, then if ${\displaystyle F}$ is a quantifier-free formula, we can write it in disjunctive normal form
${\displaystyle \bigvee _{j=1}^{m}\bigwedge _{i=1}^{n}L_{ij},}$
and use the fact that
${\displaystyle \exists x.\bigvee _{j=1}^{m}\bigwedge _{i=1}^{n}L_{ij))$
is equivalent to
${\displaystyle \bigvee _{j=1}^{m}\exists x.\bigwedge _{i=1}^{n}L_{ij}.}$
Finally, to eliminate a universal quantifier
${\displaystyle \forall x.F}$
where ${\displaystyle F}$ is quantifier-free, we transform ${\displaystyle \lnot F}$ into disjunctive normal form, and use the fact that ${\displaystyle \forall x.F}$ is equivalent to ${\displaystyle \lnot \exists x.\lnot F.}$
## Relationship with decidability
In early model theory, quantifier elimination was used to demonstrate that various theories possess properties like decidability and completeness. A common technique was to show first that a theory admits elimination of quantifiers and thereafter prove decidability or completeness by considering only the quantifier-free formulas. This technique can be used to show that Presburger arithmetic is decidable.
Theories could be decidable yet not admit quantifier elimination. Strictly speaking, the theory of the additive natural numbers did not admit quantifier elimination, but it was an expansion of the additive natural numbers that was shown to be decidable. Whenever a theory is decidable, and the language of its valid formulas is countable, it is possible to extend the theory with countably many relations to have quantifier elimination (for example, one can introduce, for each formula of the theory, a relation symbol that relates the free variables of the formula).[citation needed]
## Notes
1. ^ a b
2. ^
3. ^ Monk 2012, p. 240.
4. ^
5. ^ Enderton 2001, p. 188.
6. ^ a b c d
7. ^ Fried & Jarden 2008, p. 171.
8. ^ Szmielew 1955, Page 229 describes "the method of eliminating quantification.".
9. ^ a b
## References
• Brown, Christopher W. (July 31, 2002). "What is Quantifier Elimination". Retrieved Aug 30, 2018.
• Monk, J. Donald Monk (2012). Mathematical Logic (Graduate Texts in Mathematics (37)) (Softcover reprint of the original 1st ed. 1976 ed.). Springer. ISBN 9781468494549.
• Presburger, Mojżesz (1929). "Über die Vollständigkeit eines gewissen Systems der Arithmetik ganzer Zahlen, in welchem die Addition als einzige Operation hervortritt". Comptes Rendus du I congrès de Mathématiciens des Pays Slaves, Warszawa: 92–101., see Stansifer (1984) for an English translation
• Jeannerod, Nicolas; Treinen, Ralf. Deciding the First-Order Theory of an Algebra of Feature Trees with Updates. International Joint Conference on Automated Reasoning (IJCAR). doi:10.1007/978-3-319-94205-6_29.
• Sturm, Thomas (2017). "A Survey of Some Methods for Real Quantifier Elimination, Decision, and Satisfiability and Their Applications". Mathematics in Computer Science. 11: 483–502. doi:10.1007/s11786-017-0319-z. | 2023-02-07 09:33:35 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 23, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.851468563079834, "perplexity": 747.5520604536754}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500392.45/warc/CC-MAIN-20230207071302-20230207101302-00042.warc.gz"} |
https://msp.org/ant/2014/8-8/p02.xhtml | #### Vol. 8, No. 8, 2014
Recent Issues
The Journal About the Journal Editorial Board Editors’ Interests Subscriptions Submission Guidelines Submission Form Policies for Authors Ethics Statement ISSN: 1944-7833 (e-only) ISSN: 1937-0652 (print) Author Index To Appear Other MSP Journals
$\ell$-modular representations of unramified $p$-adic U(2,1)
### Robert James Kurinczuk
Vol. 8 (2014), No. 8, 1801–1838
##### Abstract
We construct all irreducible cuspidal $\ell$-modular representations of a unitary group in three variables attached to an unramified extension of local fields of odd residual characteristic $p$ with $\ell \ne p$. We describe the $\ell$-modular principal series and show that the supercuspidal support of an irreducible $\ell$-modular representation is unique up to conjugacy.
##### Keywords
representations of p-adic groups, modular representations
Primary: 22E50 | 2023-02-04 15:03:30 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 5, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.42164838314056396, "perplexity": 3778.0170141414}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500140.36/warc/CC-MAIN-20230204142302-20230204172302-00564.warc.gz"} |
https://samjshah.com/tag/calculus/page/2/ | # The Formal Definition of the Derivative, or Why Holes Matter
Lucky you! Two calculus posts in one day. Mainly because I don’t want some of these ideas to disappear in my hiatus from teaching it. This one deals with our favorite topic: the formal definition of the derivative.
$\lim_{h \rightarrow 0}\frac{f(x+h)-f(x)}{(x+h)-(x)}$
I see that expression and my mind goes to the following places:
• Doing a bunch of tedious algebraic calculations for a particular function in order to find the derivative.
• I “see” in the expression the slope of two points close together.
• I envision the following image, showing a secant line turning into a tangent line
And I think for many teachers and most calculus students, they think something similar.
However I asked my (non-AP) calculus kids what the $h$ stood for. Out of two sections of kids, I think only one or two kids got it with minimal prompting. (Eventually I worked on getting the rest to understand, and I think I did a decent job.) I dare you to ask your kids and see what you get as a response.
What I suspect is that kids get told the meaning of $\lim_{h \rightarrow 0}\frac{f(x+h)-f(x)}{(x+h)-(x)}$ and it gets drilled into their heads that they might not fully understand what algebraically is going on with it.
It was only a few years ago that I came to the conclusion that even I myself didn’t understand it. And when I finally thought it all through, I came to the conclusion that all of differential calculus is based on the question: how do you find the height of a hole? I started seeing holes as the lynchpin to a conceptual understanding of derivatives. I never got to fully exploit this idea in my classes, but I did start doing it. It felt good to dig deep.
The big thing I realized is that I rarely looked at the formal definition of the derivative as an equation. I almost always looked at it as an expression. But if it’s an equation…
$f'(x)=\lim_{h \rightarrow 0}\frac{f(x+h)-f(x)}{(x+h)-(x)}$
… what is it an equation of? An equation with a limit as part of it?! Let’s ignore the limit for now.
Without the limit, we have an average rate of change function, between $(x,f(x))$ and $(x+h,f(x+h))$. And since we have removed the limit, we really have a function of two variables.
$AvgRateOfChange(x,h)=\frac{f(x+h)-f(x)}{(x+h)-(x)}$
We feed an $x$ and $h$ into the function, and we get an output of a slope! It’s the slope between $(x,f(x))$ and $(x+h,f(x+h))$!
Let’s get concrete. Check out this applet (click the image to have it open up):
On the left is the original function. We are going to calculate the “average rate of change function” with an x-input of 1.64 (the x-value the applet opens up with).We are now going to vary h and see what our average rate of change function looks like: $f(1.64,h)=\frac{f(1.64+h)-f(1.64)}{h}$. That’s what the yellow point is.
Before varying h, notice in the image when h is a little above 2, the yellow “Average Rate of Change” dot is negative. That’s because the slope of the secant line between the original point $(1.64, f(1.64))$ and a second point on the function that is a little over 2 units to the right is negative. (Look at the secant line on the graph on the left!)
Now let’s change h. Drag the point on the right graph that says “h value.” As you drag it, you’ll see the second point on the function move, and also the yellow point will change with the corresponding new slope. As you drag h, you’re populating points on the right hand graph. What’s being drawn on the right hand graph is the average rate of change graph for all these various distances h!
Here’s an image of what it looks like after you drag h for a bit.
Notice now when our h-value is almost -3 (so the second point is 3 horizontal units left of the original point of interest), we have a positive slope for the secant line… a positive average rate of change.
The left graph is an $x-f(x)$ graph (those are the axes). The right graph is a $h-AvgRateOfChange$ graph (those are the axes).
Okay okay, this is all well and dandy. But who cares?
I CARE!
We may have generated an average rate of change function, but we wanted a derivative function. That is when h approaches 0. We want to examine our average rate of change graph near where h is 0. Recall the horizontal axis is the h-axis on the right graph. So when h is close to 0, we’re looking at the the vertical axis… Let’s look…
Oh dear missing points! Why? Let’s drag the h value to exactly h=0.
The yellow average rate of change point disappeared. And it says the average rate of change is undefined! 0/0. We have a hole! Why?
(When h=0 exactly, our average rate of change function is: $\frac{f(x+0)-f(x)}{(x+0)-x}$ which is 0/0. YIKES!
But the height of the hole is precisely the value of the derivative. Because remember the derivative is what happens as h gets super duper infinitely close to 0.
We can drag h to be close to 0. Here h is 0.02.
But that is not infinitely close. So this is a good approximation. But it isn’t perfect.
And this is why I have concluded that all of differential calculus actually reduces to the problem of finding the height of a hole.
Here are three different average rate of change applets that you might find fun to play with:
one (this is the one above) two three
In short (now that you’ve made it this far):
• Look at the formal definition of the derivative as an equation, not an expression. It yields a function.
• What kind of function does it indicate? An average rate of change function. And in fact, thinking deeply, it actually forces you to create a function with two inputs: an x-value and an h-value.
• Now to make it a derivative, and not an average rate of change, you need to bring h close to 0.
• As you do this, you will see you create a new function, but with a hole at h=0.
• It is the height of this hole that is the derivative.
PS. A random thought… This could be useful in a multivariable calculus course. Let’s look at the average rate of change function for $f(x)=x^2$:
$AverageRateofChange(x,h)=\frac{(x+h)^2-x^2}{h}$
Let’s convert this to a more traditional form:
$z=\frac{(x+y)^2-x^2}{y}$
Now we have a function of two variables. We want to find what happens as h (I mean y) gets closer and closer to 0 for a given x-value. So to do this, we can just visually look at what happens to the function near y=0. Even though the function will be undefined at all points where y=0, visually the intersection of the plane y=0 and the average rate of function should carve out the derivative function.
If this doesn’t make sense, I did some quick graphs on WinPlot…
This is for $f(x)=x^2$. And I graphed the plane where y=0. We should get the intersection to look like the line $f'(x)=2x$.
Yup. Cool.
I did it for $f(x)=\sin(x)$ also… The intersection should look like $f'(x)=\cos(x)$.
# u-substitution, visually
I created some calculus Geogebra applet thingies last summer that I wanted to use last year. Alas, time ran short and we never got to use them. However since I’m no longer teaching calculus (at least not next year), I figured I’d throw them up in case anyone else out there finds them useful.
They deal with u-substitution. I’ve always had a problem with teaching it. Here’s how it goes… You have some integral in terms of $x$. You convert all the $x$s and $dx$s into $u$s and $du$s. And viola! It works out. It’s very powerful. And it’s procedural. And kids have throughout the years learned this “substitution”-y thing works [1]. So kids tend to like it.
But here’s the thing. For my kids, it’s just a random method to evaluate an integral. They don’t conceptually understand what is going on… what this changing of variables is doing.
When I thought deeply about this, I realized what truly is happening is that we are transforming space… From the $x-f(x)$ plane to a much convoluted $u-f(u)$ plane. But it is through our particular choice of $u$ that makes the change in space beautiful, because it turns something that looks particularly nasty and converts it into something that looks rather nice. Ish.
Here is a screenshot from one of my geogebra applets illustrating this (you can click on the screenshot to be taken to the applet):
We start with a pretty ugly function that we’re integrating. But by using this substitution to morph space, we end up with a much nicer function. I mean, throw both of these up and ask your kids — which one of these would they rather find the integral of. They’ll say the one on the right! The u-substitution one. Although not perfect [2], it’s pretty kewl.
The applets are here:
And the applets are dynamic! You can change the lower and upper bounds on the $x-f(x)$ graphs and the lower and upper bounds automatically change on the $u-f(u)$ graph! But because math is awesome, the areas are preserved!
Some things I maybe would have done with the applets in my class:
• Let kids play with the applets and get familiar with them.
• For the first applet (starting simple), have kids count the boxes and estimate the area on one graph, and then do it on the other (careful though! the gridlines are different on the two graphs!). Whoa, they are always the same!
• For the first applet (again, starting simple), ask them to drag the upper limit to the left of the lower limit. Explain what happens and why.
• The second applet is my favorite! Put the lower limit at x=0. Drag the upper limit to the right. Explain what is happening graphically — and that tie that graphically understanding to the particular u-substitution chosen.
• In the second applet, can students find three different sets of bounds which give a signed area of 0?
• In the fourth applet, have students put the lower and upper bounds on x=6 and x=7. Have them calculate the average height of that function in that interval (the area is given!). Do they have visual confirmation of this average height for this interval?Now Looking at the u-graph, the bounds are now u=8 and u=10. Have them estimate the average height of that function in that interval (again, the area is given)! (The average height “halves” in order to compensate for the wider interval. It has to since the areas must be the same) Have students do this again for any lower and upper bounds for this graph. It will always work!
• In the fifth applet, have students put the lower bound at x=0, and have them drag the upper bound to the right. What can they conclude about the areas of each of the pink regions on the $x-f(x)$ graph? (Alternatively, you can ask: you can see from the $u-f(u)$ graph that the signed area on the original graph will never get bigger than 1, no matter what bounds you choose. Try it! It is impossible! Armed with that information, can you conclude about the pink regions in original graph?)
I’m confident I had more ideas about how to use these when I made them [3]. But it was over a year ago and I haven’t really thought of them since. But anyway, I hope they are of some use to you. Even if you just show them to your kids cursorily to illustrate what graphically is going on when you are doing u-substitution.
***
[1] Though I bet if you asked a class why they can use “substitution” when solving a system of equations, what the reasoning is behind this method, they might draw a bit of a blank… But that’s neither here nor there…
[2] What would actually be perfect would be a copy of individual Riemann Sum rectangles from the $x-f(x)$ graph “leaving” the first graph, then in front of the viewer stretching/shrinking their height and width for the appropriate $u-f(u)$ graph, and then floating over to the $u-f(u)$ graph and placing itself at the appropriate place on the $u$ axis. And then a second rectangle does that. And a third. And a fourth. You get the picture. But even though the height and width morph, the area of the original rectangle and the area of the new rectangle will be the same (or to be technical, very very close to the same, since we’re just doing approximations). In this sort of applet, you’d see the actual morphing. That’s what is hidden in my applets above. But that’s actually where the magic happens!
[3] I recall now I was going to make kids do some stuff by hand. For example: before they use the applets, kids would be given lower and upper x-bounds, and asked to calculate lower and upper u bounds. And then use the applets to confirm. Similarly, given lower and upper u-bounds, calculate lower and upper x-bounds. Use the applets to confirm.
# An unformed idea to teach understanding to the chain rule
I’m soon going to embark on teaching the chain rule in calculus. I have found ways to help kids remember the chain rule (“the outer function is the mama, the inner function is the baby… when you take the derivative, you derive the mama and leave the baby inside, and then you multiply by the derivative of baby”), ways to write things down so their information stays organized, and I have shown them enough patterns to let them see it’s true. But I have never yet found a way to conceptually get them to understand it without confusing them. (The gear thing doesn’t help me get it… Although I understand the analogy, it feels divorced from the actual functions themselves… and these functions have a constant rate of change.)
I think I now have a way that might help students to get conceptually understand what’s going on. I only had the insight 10 minutes ago so I’m going to use this blogpost to see if I can’t get the ideas straight in my head… The point of this post is not to share a way I’ve made the chain rule understandable. It’s for me to work through some unformed ideas. I am not yet sure if I have a way to turn this into something that my kids will understand.
So here’s where I’m starting from. Every “nice” function (and those are the functions we’re dealing with) is basically like an infinite number of little line segments connected together. Thus, when we take a derivative, we’re pretty much just asking “what’s the slope of the little line segment at $x=3$?” for example.
Now here’s the magic. In my class, we’ve learned that whatever transformations a function undergoes, the tangent line undergoes the same transformations! If you want to see that, you can check it out here.
For a quick example, let’s look at $f(x)=\sin{x}$ and $g(x)=2\sin{(5x)}+1$.
We see that $g(x)$ is secretly $f(x)$ which has undergone a vertical stretch of 2, a horizontal shrink of 1/5, and has been moved up 1.
Let’s look at the tangent line to $f(x)$ at $x=\pi/3$. It is approximately $y=0.5x+0.34$.
Now let’s put that tangent line through the transformations:
$y=0.5x+0.34$
Vertical Stretch of 2: $y=2(0.5x+0.34)=x+0.68$
Horizontal shrink of 1/5: $y=5x+0.68$
Shift up 1: $y=5x+1.68$
Now let’s plot $g(x)$ and our transmogrified tangent line:
Yay! It worked! (But of course we knew that would happen.)
The whole point of this is to show that tangent lines undergo the same transformations as the functions — because the functions themselves are pretty much just a bunch of these infinitely tiny tangent line segments all connected together! So it would actually be weird if the tangent lines didn’t behave like the functions.
## My Thought For Using This for The Chain Rule
So why not look at function composition in the same way?
We can look at a composition of functions at a point as simply a composition of these little line segments.
Let’s see if I can’t clear this up by making it concrete with an example.
Let’s look at $m(x)=\sqrt{x^3+1}$.
And so we can be super concrete, let’s try to find $m'(2)$, which is simply the slope of the tangent line of $m(x)$ at $x=2$.
I’m going to argue that just as $\sqrt{x}$ and $x^3+1$ are composed to get our final function, we can compose the tangent lines to these two functions to get the final tangent line at $x=2$.
Let’s start with the $x^3+1$. At $x=2$, the tangent line is $y_{inner}=12x-15$ (I’m not showing the work, but you can trust me that it’s true, or work it out yourself.)
Now let’s start with the square root function. We have to be thoughtful about this. We are dealing with $m(2)$ which really means that we’re taking the square root of 9. We we want the tangent line to $\sqrt{x}$ at $x=9$. That turns out to be (again, trust me?): $y_{outer}=\frac{1}{6}x+\frac{3}{2}$.
So now we have our two line segments.
We have to compose them.
$y_{composed}=\frac{1}{6}[12x-15]+\frac{3}{2}$
This simplifies to:
$y_{composed}=2x-1$
Let’s look at a graph of $m(x)$ and our tangent line:
Yup!
Where did we ultimately get the slope of 2 from? When we composed to two lines together, we multiplied the slope of the inner function (12) by the slope of the outer function (1/6). And that became our new line’s slope.
Chain rule!
## How we generalize this to the chain rule
For any composition of functions, we are going to have an inner and an outer function. Let’s write $c(x)=o(i(x))$ where we can clearly remember which one is the inner and which one is the outer functions. Let’s pick a point $x_0$ where we want to find the derivative.
We are going to have to find the little line segment of the inner function and compose that with the little line segment of the outer function, both at $x_0$. That will approximate the function $c(x)$ at $x_0$.
The line segment of the inner function is going to be $y_{inner}=i'(x_0)x+blah1$
The line segment of the outer function is going to be $y_{outer}=o'(i(x_0))x+blah2$
I am going to keep those terms blah1 and blah2 only because we won’t really need them. Let’s remember we only want the derivative (the slope of the tangent line), not the tangent line itself. So our task becomes easier.
Let’s compose them: $y_{composed}=o'(i(x_0))[i'(x_0)x+blah1]+blah2$
This simplifies to $y_{composed}=o'(i(x_0))i'(x_0)x+blah3$
And since we only want the slope of this line (the derivative is the slope of the tangent line, remember), we have:
$o'(i(x_0)i'(x_0)$.
Of course we chose an arbitrary point $x_0$ to take the derivative at. So we really have:
$c'(x)=o'(i(x))i'(x)$
Which is the chain rule.
# I got rid* of Limits in Calculus (*almost entirely)
I’ve been meaning to write this post for a while. I teach non-AP Calculus. My goal in this course is to get my kids to understand calculus with depth — that means my primary focus is on conceptual understanding, where facility with fancy-algebra things is secondary. Now don’t go thinking my kids come out of calculus not knowing how to do real calculus. They do. It is just that I pare things down so that they don’t have to find the derivatives of things like $y=\cot(x)$. Why? Because even though I could teach them that (and I have in the past), I would rather spend my time doing less work on moving through algebraic hoops, and more work on deep conceptual understanding.
Everything I do in my course aims for this. Sometimes I succeed. Sometimes I fail. But I don’t lose sight of my goal.
Each year, I have parts of the calculus curriculum I rethink, or have insights on. In the past few years, I’ve done a lot of thinking about limits and where they fit in the big picture of things. Each year, they lose more and more value in my mind. I used to spend a quarter of a year on them. In more recent years, I spent maybe a sixth of a year on them. And this year, I’ve reduced the time I spend on limits to about 5 minutes.*
*Okay, not really. But kinda. I’ll explain.
First I’ll explain my reasoning behind this decision. Then I’ll explain how I did it.
## Reasoning Behind My Decision to Eliminate Limits
For me, calculus has two major parts: the idea of the derivative, and the idea of the integral.
Limits show up in both [1]. But where do they show up in derivatives?
• when you use the formal definition of the derivative
and… that’s pretty much it. And where do they show up in integrals?
• when you say you are taking the sum of an infinite sum of infinitely thin rectangles
and… that’s pretty much it. I figure if that’s all I need limits for, I can target how I introduce and use limits to really focus on those things. Do I really need them to understand limits at infinity of rational functions? Or limits of piecewise functions? Or limits of things like $y=\sin(1/x)$ as $x\rightarrow 0$?
Nope. And this way I’m not wasting a whole quarter (or even half a quarter) with such a simple idea. All I really need — at least for derivatives — is how to find the limit as one single variable goes to 0. C’est tout!
## How I did it
This was our trajectory:
(1) Students talked about average rate of change.
(2) Students talked about the idea of instantaneous rate of change. They saw it was problematic, because how can something be changing at an instant? If you say you’re travelling “58 mph at 2:03pm,” what exactly does that mean? There is no time interval for this 58mph to pop out of, since we’re talking about an instant, a single moment in time (of 2:03pm). So we problematized the idea of instantaneous rate of change. But we also recognized that we understand that instantaneous rates of change do exist, because we believe our speedometers in our car which say 60mph. So we have something that feels philosophically impossible but in our guts and everyday experience feels right. Good. We have a problem we need to resolve. What might an instantaneous rate of change mean? Is it an oxymoron to have a rate of change at a instant?
(3) Students came to understand that we could approximate the instantaneous rate of change by taking the slope of two points really really really close to each other on a function. And the closer that we got, the better our approximation was. (Understanding why we got a better and better approximation was quite hard conceptual work.) Similarly students began to recognize graphically that the slope of two points really close to each other is actually almost the slope of the tangent line to the function.
(4) Now we wanted to know if we could make things exact. We knew we could make things exact if we could bring the two points infinitely close to each other. But each time we tried that, we got either got two points pretty close to each other or the two points lay directly on top of each other (and you can’t find the slope between a point and itself). So still we have a problem.
And this is where I introduced the idea of introducing a new variable, and eventually, limits.
We encountered the question: “what is the exact instantaneous rate of change for $f(x)=x^2$ at $x=3$?
We started by picking two points close to each other: $(3,9)$ and $(3+h,(3+h)^2)$
This was the hardest thing for students to understand. Why would we introduce this extra variable $h$. But we talked about how $(3.0001,3.0001^2)$ wasn’t a good second point, and how $(3.0000001,3.0000001^2)$ also wasn’t a good second point. But if they trusted me on using this variable thingie, they will see how our problems would be resolved.
We then found the average rate of change between the two points, recognizing that the second point could be really faraway from the first point if $h$ were a large positive or negative number… or close to the first point if $h$ were close to 0.
Yes, students had to first understand that $h$ could be any number. And they had to come to the understanding that $h$ represented where the second point was in relation to the first point (more specifically: how far horizontally the second point was from the first point).
And so we found the average rate of change between the two points to be:
$AvgRateOfChange=\frac{(3+h)^2-9}{(3+h)-3}$
We then said: how can we make this exact? How can we bring the two points infinitely close to each other? Ahhh, yes, by letting $h$ get infinitely close to 0.
And so I introduce the idea of the limit as such:
If I have $\lim_{h\rightarrow 0} blah$, it means what blah gets infinitely close to if $h$ gets infinitely close to 0 but is not equal to 0. That last part is key. And honestly, that’s pretty much the entirety of my explanation about limits. So that’s the 5 minutes I spend talking about limits.
So to find the instantaneous rate of change, we simply have:
$InstRateOfChange=\lim_{h\rightarrow0} \frac{(3+h)^2-9}{(3+h)-3}$
This is simply the slope between two points which have been brought infinitely close together. Yes, that’s what limits do for you.
And then we simplify:
$InstRateOfChange=\lim_{h\rightarrow0} \frac{9+6h+h^2-9}{h}$
$InstRateOfChange=\lim_{h\rightarrow0} \frac{6h+h^2}{h}$
$InstRateOfChange=\lim_{h\rightarrow0} \frac{h(6+h)}{h}$
$InstRateOfChange=\lim_{h\rightarrow0} \frac{h}{h} \frac{(6+h)}{1}$
Now because we know that $h$ is close to 0, but not equal to 0, we can say with confidence that $\frac{h}{h}=1$. Thus we can say:
$InstRateOfChange=\lim_{h\rightarrow 0} (6+h)$
And now as $h$ goes to 0, we see that $6+h$ gets infinitely close to 6.
Done. (Here’s a do now I did in class.)
We did this again and again to find the instantaneous rate of change of various functions at a points. For examples, functions like:
$f(x)=x^3-2x+1$ at $x=1$
$g(x)=\sqrt{2-3x}$ at $x=-2$
$h(x)=\frac{5}{2-x}$ at $x=1$
For these, the algebra got more gross, but the idea and the reasoning was the same in every problem. Notice to do all of these, you don’t need any more knowledge of limits than what I outlined above with that single example. You need to know why you can “remove” the $\frac{h}{h}$ (why it is allowed to be “cancelled” out), and then what happens as $h$ goes to 0. That’s all.
Yup, again, notice I only needed to rely on this very basic understanding of limits to solve these three problems algebraically: $\lim_{h\rightarrow 0} blah$ means what blah gets infinitely close to if $h$ gets infinitely close to 0 but is not equal to 0.
(5) Eventually we generalize to find the instantaneous rate of change at any point, using the exact same process and understanding. At this point, the only difference is that the algebra gets slightly more challenging to keep track of. But not really that much more challenging.
(6) Finally, waaaay at the end, I say: “Surprise! The instantaneous rate of change has a fancy calculus word — derivative.
Apologies in advance if any of this was unclear. I feel I didn’t explain thing as well as I could have. I also want to point out that I understand if you don’t agree with this approach. We all have different thoughts about what we find important and why. I can (and in fact, in the past, I have) made the case that going into depth into limits is of critical importance. I personally just don’t see things the same way anymore.
Now I should also say that there have been a few downsides to this approach, but on the whole it’s been working well for me so far. I would elaborate on the downsides but right now I’m just too exhausted. Night night!
[1] Okay, I should also note that limits show up in the definition for continuity. But since in my course I don’t really focus on “ugly” functions, I haven’t seen the need to really spend time on the idea of continuity except in the conceptual sense. Yes, I can ask my kids to draw the derivative of $y=|x|$ and they will be able to. They will see there is a jump at $x=0$. I don’t need more than that.
# An expanded understanding of basic derivatives – graphically
The guilt that I feel for not blogging more regularly this year has been considerable, and yet, it has not driven me to post more. I’ve been overwhelmed and busy, and my philosophy about blogging it is: do it when you feel motivated. And so, I haven’t.
Today, I feel a slight glimmer of motivation. And so here I am.
Here’s what I want to talk about.
In calculus, we all have our own ways of introducing the power rule for derivatives. Graphically. Algebraically. Whatever. But then, armed with this knowledge…
that if $f(x)=x^n$, then $f'(x)=nx^{n-1}$
…we tend to drive forward quickly. We immediately jump to problems like:
take the derivative of $g(x)=4x^3-3x^{-5}+2x^7$
and we hurdle on, racing to the product and quotient rules… We get so algebraic, and we go very quickly, that we lose sight of something beautiful and elegant. This year I decided to take an extra few days after the power rule but before problems like the one listed above to illustrate the graphical side of things.
Here’s what I did. We first got to the point where we comfortably proved the power rule for derivatives (for n being a counting number). Actually, before I move on and talk about the crux of this post, I should show you what we did…
Okay. Now I started the next class with kids getting Geogebra out and plotting on two graphics windows the following:
and they saw the following:
At this point, we saw the transformations. On the left hand graph, we saw that the function merely shifted up one unit. On the right hand graphs, we saw a vertical stretch for one function, and a vertical shrink for the other.
Here’s what I’m about to try to illustrate for the kids.
Whatever transformation a function undergoes, the tangent lines to the function also undergoes the exact same transformation.
What this means is that if a function is shifted up one unit, then all tangent lines are shifted up one unit (like in the left hand graph). And if a function undergoes vertical stretching or shrinking, all tangent lines undergo the same vertical stretching or shrinking.
I want them to see this idea come alive both graphically and algebraically.
So I have them plot all the points on the functions where $x=1$. And all the tangent lines.
For the graph with the vertical shift, they see:
The original tangent line (to $f(x)=x^2$) was $y=2x-1$. When the function moved up one unit, we see the tangent line simply moved up one unit too.
Our conclusion?
Yup. The tangent line changed. But the slope did not. (Thus, the derivative is not affected by simply shifting a function up or down. Because even though the tangent lines are different, the slopes are the same.)
Then we went to the second graphics view — the vertical stretching and shrinking. We drew the points at $x=1$ and their tangent lines…
…and we see that the tangent lines are similar, but not the same. How are they similar? Well the original function’s tangent line is the red one, and has the equation $y=2x-1$. Now the green function has undergone a vertical shrink of 1/4. And lo and behold, the tangent line has also!
To show that clearly, we did the following. The original tangent line has equation $y=2x-1$. So to apply a vertical shrink of 1/4 to this, you are going to see $y=\frac{1}{4}(2x-1)$ (because you are multiplying all y-coordinates by 1/4. And that simplifies to $y=0.5x-0.25$. Yup, that’s what Geogebra said the equation of the tangent line was!
Similarly, for the blue function with a vertical stretch of 3, we get $y=3(2x-1)=6x-3$. And yup, that’s what Geogebra said the equation of the tangent line was.
What do we conclude?
And in this case, with the vertical stretching and shrinking of the functions, we get a vertical stretching and shrinking of the tangent lines. And unlike moving the function up or down, this transformation does affect the slope!
I repeat the big conclusion:
Whatever transformation a function undergoes, the tangent lines to the function also undergoes the exact same transformation.
I didn’t actually tell this to my kids. I had them sort of see and articulate this.
Now they see that if a function gets shifted up or down, they can see that the derivative stays the same. And if there is a vertical stretch/shrink, the derivative is also vertically stretched/shrunk.
The next day, I started with the following “do now.” We haven’t learned the derivative of $\sin(x)$, so I show them what Wolfram Alpha gives them.
For (a), I expect them to give the answer $g'(x)=3\cos(x)$ and for (b), $h'(x)=-\cos(x)$.
The good thing here is now I get to go for depth. WHY?
And I hear conversations like: “Well, g(x) is a transformation of the sine function which gives a vertical stretch of 3, and then shifts the function up 4. Well since the function undergoes those transformations, so does the tangent lines. So each tangent line is going to be vertically stretched by 3 and moved up 4 units. Since the derivative is only the slope of the tangent line, we have to see what transformations affect the slope. Only the vertical stretch affects the slope. So if the original slope of the sine function was $\cos(x)$, then we know that the slope of the transformed function is $3\cos(x)$.
That’s beautiful depth. Beautiful.
For (b), I heard talk about how the negative sign is a reflection over the x-axis, so the tangent lines are reflected over the x-axis also. Thus, the slopes are the opposite sign… If the original sine functions slope of the tangent lines was $\cos(x)$, then the new slopes are going to be $-\cos(x)$.
This isn’t easy for my kids, so when I saw them struggling with the conceptual part of things, I whipped up this sheet (.docx).
And here are the solutions
And here is a Geogebra sheet which shows the transformations, and the new tangent line (and equation), for this worksheet.
Now to be fair, I don’t think I did a killer job with this. It was my first time doing it. I think some kids didn’t come out the stronger for this. But I do feel that the kids who do get it have a much more intuitive understanding of what’s going on.
I am much happier to know that if I ask kids what the derivative of $q(x)=6x^9$ is, they immediately think (or at least can understand) that we get $q'(x)=6*9x^8$, because…
our base function is $x^9$ which has derivative (aka slope of the tangent line) $9x^8$… Thus the transformed function $6x^9$ is going to be a vertical stretch, so all the tangent lines are going to be stretched vertically by a factor of 9 too… thus the derivative of this (aka the slope of the tangent line) is $q'(x)=6*9x^8$.
To me, that sort of explanation for something super simple brings so much graphical depth to things. And that makes me feel happy.
# Do They Get It? The Instantaneous Rate of Change Exactly
Today in calculus I wanted to check if students really understood what they were doing when they were finding the instantaneous rate of change. (We haven’t learned the word derivative yet, but this is the formal definition of the derivative.)
So I handed out this worked out problem.
And I had them next to each of the letters write a note answering the following individually (not as a group):
A: write what the expression represents graphically and conceptually
B: write what the notation $\lim_{h\rightarrow0}$ actually means. Why does it need to be there to calculate the instantaneous rate of change. (Be sure to address with h means.)
C: write what mathematical simplification is happening, and why were are allowed to do that
D: write what the reasoning is behind why were are allowed to make this mathematical move
E: explain what this number (-1) means, both conceptually and graphically
It was a great activity. I had them do it individually, but I should have had students (after completing it) discuss in groups before we went to the whole group context. Next time…
Anyway, the answers I was looking for (written more drawn out):
A: the expressions represents the average rate of change between two points, one fixed, and the other one defined in relation to that first point. The average rate of change is the constant rate the function would have to go at to start at one point and end up at the second. Graphically, it is the slope of the secant line going through those two points.
B: the $\lim_{h\rightarrow0}$ is simply a fancy way to say we want to bring h closer and closer and closer to zero (infinitely close) but not equal zero. That’s all. The expression that comes after it is the average rate of change between two points. As h gets closer and closer to 0, the two points get closer and closer to each other. We learned that if we take the average rate of change of two points super close to each other, that will be a good approximation for the instantaneous rate of change. If the two points are infinitely close to each other, then we are going to get an exact instantaneous rate of change!
C: we see that $\frac{h}{h}$ is actually 1. We normally would not be allowed to say that, because there is the possibility that h is 0, and then the expression wouldn’t simplify to 1. However we know from the limit that h is really close to 0, but not equal to 0. Thus we can say with mathematical certainty that $\frac{h}{h}=1$
D: as we bring h closer and closer to 0, we see that $h-1$ gets closer and closer to -1. Thus if we bring h infinitely close to 0, we see that $h-1$ gets infinitely close to -1.
E: the -1 represents the instantaneous rate of change of $x^2-5x+1$ at $x=2$. This is how fast the function is changing at that instant/point. It is graphically understood as the slope of the tangent line drawn at $x=2$.
I loved doing this because if a student were able to properly answer each of the questions, they really truly understand what is going on.
# Starting Calculus with Area Functions
So I decided to try a new beginning to (non-AP) calculus this year. Instead of doing an algebra bootcamp and diving into limits, I decided to teach kids a new kind of function transformation. I’d say this is something that makes my classroom uniquely mine (this is my contribution to Mission 1 of Explore the MTBoS). I don’t think anyone else I know does something like this.
You see, I was talking with a fellow calculus teacher, and we had a big realization. Yes, calculus is hard for kids because of all the algebra. But also, calculus involves something that students have never seen before.
It involves transformations that morph one graph into another graph. And not just standard up, down, left, right, stretch, shrink, reflect transformations. Although they do transform functions, they don’t make them look too different from the original. Given a function and a basic up, left, reflect, shrink transformation of it, you’d be able to pair them up and say they were related… But in calculus, students start grappling with seriously weird and abstract transformations. For example: if you hold an f(x) graph and an f'(x) graph next to each other — they don’t look alike at all. You would never pair them up and say “oh, these are related.”
So I wanted to start out with a unit on abstract and weird function transformations. Turns out, even though the other teacher and I had brainstormed 5 different abstract function transformations, I got so much mileage out of one of them that I didn’t have to do anything else. You see: I introduced my kids to integrals, without ever saying the word integrals. Well, to be fair, I introduced them to something called the area transformation and the only difference between this and integrals is that we can’t have negative area. [1]
You can look at this geogebra page to see what I mean by area functions.
Here’s the packet I created (.docx)
That packer was just the bare backbones of what we did. There was a lot of groupwork in class, a lot of conceptual questions posed to them, and more supplemental documents that were created as I started to realize this was going to morph into a much larger unit because I was getting so much out of it. (I personally was finding so much richness in it! A perfect blend of the concrete and the abstract!)
Here are other supplemental documents:
2013-09-16 Abstract Functions 1.5
2013-09-17 Abstract Functions 1.75
2013-09-20 Area Function Concept Questions
2013-09-23 Abstract Functions 1.9375
• It’s conceptual, so those kids who aren’t strong with the algebraic stuff gain confidence at the start of the year
• Kids start to understand the idea of integration as accumulation (though they don’t know that’s what they are doing!)
• Kids understand that something can be increasing at a decreasing rate, increasing at a constant rate, or increasing at an increasing rate. They discovered those terms, and realized what that looks like graphically.
• Kids already know why the integral of a constant function is a linear function, and why the integral of a linear function is a quadratic function.
• Kids are talking about steepness and flatness of a function, and giving the steepness and flatness meaning… They are making statements like “because the original graph is close to the x-axis near x=2, not much area is being added as we inch forward on the original graph, so the area function will remain pretty flat, slightly increasing… but over near x=4, since the original function is far from the x-axis, a lot of area is being added as we inch forward on the original graph, so the area function shoots up, thus it is pretty steep”
• Once we finish investigating the concept of “instantaneous rate of change” (which is soon), kids will have encountered and explored the conceptual side of both major ideas of calculus: derivatives and integrals. All without me having used the terms. I’m being a sneaky teacher… having kids do secret learning.
I mean… I worked these kids hard. Here is a copy of my assessment so you can see what was expected of them.
I love it.
Love. It.
LOVE.
IT.
I’m going to put a picture gallery below of some things from my smartboards.
This slideshow requires JavaScript.
[1] To be super technical, I am having kids relate $f(x)$ and $\int_{0}^{x} |f(t)|dt$ | 2019-07-20 13:55:24 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 156, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7439075112342834, "perplexity": 445.36667890754694}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195526517.67/warc/CC-MAIN-20190720132039-20190720154039-00226.warc.gz"} |
https://www.applyprep.com/act-1 | ### Questão 01
The weekly fee for staying at the Pleasant Lake Campground is $20 per vehicle and$10 per person. Last year, weekly fees were paid for v vehicles and p persons. Which of the following expressions gives the total amount, in dollars, collected for weekly fees last year?
A. 20v + 10p
B. 20p + 10v
C. 10(v + p)
D. 30(v + p)
E. 10(v + p) + 20p
### Questão 02
If r = 9, b = 5, and g = −6, what does (r + bg)(b + g) equal?
F. -20
G. -8
H. 8
J. 19
K. 20
### Questão 03
A copy machine makes 60 copies per minute. A second copy machine makes 80 copies per minute. The second machine starts making copies 2 minutes after the first machine starts. Both machines stop making copies 8 minutes after the first machine started. Together, the 2 machines made how many copies?
A. 480
B. 600
C. 680
D. 720
E. 960
### Questão 04
Marlon is bowling in a tournament and has the highest average after 5 games, with scores of 210, 225, 254, 231, and 280. In order to maintain this exact average, what must be Marlon’s score for his 6th game?
F. 200
G. 210
H. 231
J. 240
K. 245
### Questão 05
Joelle earns her regular pay of $7:50 per hour for up to 40 hours of work in a week. For each hour over 40 hours of work in a week, Joelle is paid 1 ½ times her regular pay. How much does Joelle earn for a week in which she works 42 hours? A.$126:00
B. $315:00 C.$322:50
D. $378:00 E.$472:50
### Questão 06
Which of the following mathematical expressions is equivalent to the verbal expression “A number, x, squared is 39 more than the product of 10 and x ”?
F. 2x = 39 + 10x
G. 2x = 39x + 10x
H. x2= 39 − 10x
J. x2 = 39 + x10
K. x2 = 39 + 10x
### Questão 07
If 9(x - 9) = -11, then x = ?
$\fn_cm&space;\small&space;\textup{A.}&space;-\frac{92}{9}$
$\fn_cm&space;\small&space;\textup{B.}-\frac{20}{9}$
$\fn_cm&space;\small&space;\textup{C.}-\frac{11}{9}$
$\fn_cm&space;\small&space;\textup{D.}-\frac{2}{9}$
$\fn_cm&space;\small&space;\textup{E.&space;}&space;\frac{70}{9}$
### Questão 08
Discount tickets to a basketball tournament sell for $4.00 each. Enrico spent$60.00 on discount tickets, $37.50 less than if he had bought the tickets at the regular price. What was the regular ticket price? F.$2.50
G. $6.40 H.$6.50
J. $7.50 K.$11.00
### Questão 09
The expression (3x - 4y2)(3x + 4y2) is equivalent to:
A. 9x2 - 16y4
B. 9x2 - 8y4
C. 9x2 + 16y4
D. 6x2 - 16y4
E. 6x2 - 8y4
### Questão 10
A rectangle has an area of 32 square feet and a perimeter of 24 feet. What is the shortest of the side lengths, in feet, of the rectangle?
F. 1
G. 2
H. 3
J. 4
K. 8
### Questão 11
In $\fn_cm&space;\small&space;\Delta&space;ABC$, the sum of the measures of $\fn_cm&space;\small&space;\angle&space;A$ and $\fn_cm&space;\small&space;\angle&space;B$ is 47°. What is the measure of $\fn_cm&space;\small&space;\angle&space;C$?
A. 47°
B. 86°
C. 94°
D. 133°
E. 143°
### Questão 12
In the school cafeteria, students choose their lunch from 3 sandwiches, 3 soups, 4 salads, and 2 drinks. How many different lunches are possible for a student who chooses exactly 1 sandwich, 1 soup, 1 salad, and 1 drink?
F. 2
G. 4
H. 12
J. 36
K. 72
### Questão 13
For 2 consecutive integers, the result of adding the smaller integer and triple the larger integer is 79. What are the 2 integers?
A. 18, 19
B. 19, 20
C. 20, 21
D. 26, 27
E. 39, 40
### Questão 14
A function f(x) is defined as f(x) = -8x2. What is f(-3)?
F. - 72
G. 72
H. 192
J. - 576
K. 576
### Questão 15
If 3x = 54, then which of the following must be true?
A. 1 < x < 2
B. 2 < x < 3
C. 3 < x < 4
D. 4 < x < 5
E. 5 < x
### Questão 16
What is the least common multiple of 70, 60, and 50?
F. 60
G. 180
H. 210
J. 2,100
K. 210,000
### Questão 17
Hot Shot Electronics is designing a packing box for its new line of Acoustical Odyssey speakers. The box is a rectangular prism of length 45 centimeters, width 30 centimeters, and volume 81;000 cubic centimeters. What is the height, in centimeters, of the box?
A. 75
B. 60
C. 48
D. 27
E. 18
### Questão 18
Four points, A, B, C, and D, lie on a circle having a circumference of 15 units. B is 2 units counterclockwise from A. C is 5 units clockwise from A. D is 7 units clockwise from A and 8 units counterclockwise from A. What is the order of the points, starting with A and going clockwise around the circle?
F. A, B, C, D
G. A, B, D, C
H. A, C, B, D
J. A, C, D, B
K. A, D, C, B
### Questão 19
A group of cells grows in number as described by theequation y = 16(2)t, where t represents the number of days and y represents the number of cells. According to this formula, how many cells will be in the group at the end of the first 5 days?
A. 80
B. 160
C. 400
D. 512
E. 1,280
### Questão 20
The length of a rectangle is 3 times the length of a smaller rectangle. The 2 rectangles have the same width. The area of the smaller rectangle is A square units. The area of the larger rectangle is kA square units. Which of the following is the value of k?
$\fn_cm&space;\small&space;\textup{F.&space;}\frac{1}{9}$
$\fn_cm&space;\small&space;\textup{G.&space;}\frac{1}{3}$
$\fn_cm&space;\small&space;\textup{H.&space;}1$
$\fn_cm&space;\small&space;\textup{J.&space;}3$
$\fn_cm&space;\small&space;\textup{K.&space;}9$
### Questão 21
(a + 2b + 3c) - (4a + 6b - 5c) is equivalent to:
A. - 4a - 8b - 2c
B. - 4a - 4b + 8c
C. - 3a + 8b - 2c
D. - 3a - 4b - 2c
E. - 3a - 4b + 8c
### Questão 22
The dimensions of the right triangle shown below are given in feet. What is sin $\fn_cm&space;\small&space;\Theta$ ?
$\fn_cm&space;\small&space;\textup{F.&space;}\frac{a}{b}$
$\fn_cm&space;\small&space;\textup{G.&space;}\frac{a}{c}$
$\fn_cm&space;\small&space;\textup{H.&space;}\frac{b}{c}$
$\fn_cm&space;\small&space;\textup{J.&space;}\frac{b}{a}$
$\fn_cm&space;\small&space;\textup{K.&space;}\frac{c}{a}$
### Questão 23
In a basketball passing drill, 5 basketball players stand evenly spaced around a circle. The player with the ball (the passer) passes it to another player (the receiver). The receiver cannot be the player to the passer’s immediate right or left and cannot be the player who last passed the ball. A designated player begins the drill as the first passer. This player will be the receiver for the first time on which pass of the ball?
A. 4th
B. 5th
C. 6th
D. 10th
E. 24th
### Questão 24
Lines p and n lie in the standard (x, y) coordinate plane. An equation for line p is y = 0.12x + 3;000. The slope of line n is 0.1 greater than the slope of line p. What is the slope of line n?
F. 0.012
G. 0.02
H. 0.22
J. 1.2
K. 300
### Qustão 25
The expression -8x3(7x6 - 3x5) is equivalent to:
A. -56x9 + 24x8
B. -56x9 - 24x8
C. -56x18 + 24x15
D. -56x18 - 24x15
E. -32x4
-3j - 6 + 8j =?
F. -42
G. -6
H. -1
J. 6
K. 42
### Questão 27
In right triangle $\fn_cm&space;\small&space;\Delta&space;ACE$ below, $\fn_cm&space;\small&space;\overline{BD}$ is parallel to $\fn_cm&space;\small&space;\overline{AE}$, and $\fn_cm&space;\small&space;\overline{BD}$ is perpendicular to $\fn_cm&space;\small&space;\overline{ED}$ at D. The lenght of $\fn_cm&space;\small&space;\overline{AC}$ is 20 feet, the lenght of $\fn_cm&space;\small&space;\overline{BD}$ is 3 feet, and the lenght of $\fn_cm&space;\small&space;\overline{CD}$ is 4 feet. What is the lenght, in feet, of $\fn_cm&space;\small&space;\overline{AE}$?
A. 10
B. 12
C. 15
D. 16
E. 17
### Questão 28
As part of a lesson on motion, students observed a cart rolling at a constant rate along a straight line. As shown in the chart below, they recorded the distance, y feet, of the cart from a reference point at 1-second intervals from t = 0 seconds to t = 5 seconds.
i 0 1 2 3 4 5
y 14 19 24 29 34 39
Which of the following equations represents this data?
F. y = t + 14
G. y = 5t + 9
H. y = 5t + 14
J. y = 14t + 5
K. y = 19t
### Questão 29
The inequality 6( x + 2 ) > 7( x - 5 ) is equivalent to which of the following inequalities?
A. x < - 23
B. x < 7
C. x < 17
D. x < 37
E. x < 47
### Questão 30
The sides of a square are 3 cm long. One vertex of the square is at (2; 0) on a square coordinate grid marked in centimeter units. Which of the following points could also be a vertex of the square?
F. (- 4, 0)
G. (0, 1)
H. (1, -1)
J. (4, 1)
K. (5, 0)
### Questão 31
For $\fn_cm&space;\small&space;\Delta&space;FGH$, shown below, which of the following is an expression for y in terms of x?
$\fn_cm&space;\small&space;\textup{A.&space;}&space;x&space;+&space;4$
$\fn_cm&space;\small&space;\textup{B.&space;}&space;\sqrt{&space;x^{2}&space;+&space;4}$
$\fn_cm&space;\small&space;\textup{C.&space;}&space;\sqrt{&space;x^{2}&space;+&space;8}$
$\fn_cm&space;\small&space;\textup{D.&space;}&space;\sqrt{&space;x^{2}&space;-&space;16}$
$\fn_cm&space;\small&space;\textup{E.&space;}&space;\sqrt{&space;x^{2}&space;+&space;16}$
### Questão 32
A bag contains 12 red marbles, 5 yellow marbles, and 15 green marbles. How many additional red marbles must be added to the 32 marbles already in the bag so that the probability of randomly drawing a red marble is $\fn_cm \small \frac{3}{5}$ ?
F. 13
G. 18
H. 28
J. 32
K. 40
### Questão 33
What are the quadrants of the standard (x; y) coordinate plane below that contain points on the graph of the equation 4x - 2y = 8?
A. I and III only
B. I, II, and III only
C. I, II, and IV only
D. I, III, and IV only
E. II, III, and IV only
### Qestão 34
The graph of y = -5x2 + 9 passes through (1, 2a) in the standard (x, y) coordinate plane. What is the value of a?
F. 2
G. 4
H. 7
J. -1
K. -8
### Questão 35
Jerome, Kevin, and Seth shared a submarine sandwich. Jerome ate $\fn_cm&space;\small&space;\frac{1}{2}$ of the sandwich, Kevin ate $\fn_cm&space;\small&space;\frac{1}{3}$ of the sandwich, and Seth ate the rest. What is the ratio of Jerome’s share to Kevin’s share to Seth’s share?
A. 2:3:6
B. 2:6:3
C. 3:1:2
D. 3:2:1
E. 6:3:2
### Questão 36
A particular circle in the standard (x; y) coordinate plane has an equation of (x - 5)2 + y2 = 38. What are the radius of the circle, in coordinate units, and the coordinates of the center of the circle?
F. √38 (5; 0)
G. 19 (5; 0)
H. 38 (5; 0)
J. √38 (-5; 0)
K. 19 (-5; 0)
### Questão 37
The figure below consists of a square and 2 semicircles, with dimensions as shown. What is the outside perimeter, in centimeters, of the figure?
A. 8 + 8
B. 16 + 8
C. 16 + 16
D. 32 + 8
E. 32 + 16
### Questão 38
In the figure below, points E and F are the midpoints of sides $\fn_cm&space;\small&space;\overline{AD}$ and In the figure below, points E and F are the midpoints of sides $\fn_cm&space;\small&space;\overline{AD}$ and of rectangle ABCD, point G is the intersection of $\fn_cm&space;\small&space;\overline{AF}$ and $\fn_cm&space;\small&space;\overline{BE}$, and point H is the intersection of $\fn_cm&space;\small&space;\overline{CE}$ and $\fn_cm&space;\small&space;\overline{DF}$. The interior of ABCD except for the interior of EGFH is shaded. What is the ratio of the area of EGFH to the area of the shaded region?
F. 1:2
G. 1:3
H. 1:4
J. 1:6
K. Cannot be determined from the given information
### Questão 39
The coordinates of the endpoints of $\dpi{100}&space;\fn_jvn&space;\small&space;\overline{CD}$, in the standard (x; y) coordinate plane, are (-4, -2) and (14, 2). What is the x-coordinate of the midpoint of $\dpi{100}&space;\fn_jvn&space;\small&space;\overline{CD}$ ?
A. 0
B. 2
C. 5
D. 9
E. 10
### Questão 40
What is the surface area, in square inches, of an 8-inch cube?
F. 512
G. 384
H. 320
J. 256
K. 192
### Questão 41
The equations below are linear equations of a system where a, b, and c are positive integers.
ay + bx = c
ay - bx = c
Which of the following describes the graph of at least 1 such system of equations in the standard (x,y) coordinate plane?
I. 2 parallel lines
II. 2 intersecting lines
III. A single line
A. I only
B. II only
C. III only
D. I or II only
E. I, II, or III
### Questão 42
According to the measurements given in the figure below, which of the following expressions gives the distance, in miles, from the boat to the dock?
$\dpi{100}&space;\fn_cm&space;\textup{F.&space;}&space;30\,&space;tan&space;\,&space;52^{\circ}$
$\dpi{100}&space;\fn_cm&space;\textup{G.&space;}&space;30\,&space;cos&space;\,&space;52^{\circ}$
$\dpi{100}&space;\fn_cm&space;\textup{H.&space;}&space;30\,&space;sin&space;\,&space;52^{\circ}$
$\dpi{100}&space;\fn_cm&space;\textup{J.&space;}&space;\frac{30}{&space;cos&space;\,&space;52^{\circ}}$
$\dpi{100}&space;\fn_cm&space;\textup{J.&space;}&space;\frac{30}{&space;sin&space;\,&space;52^{\circ}}$
### Questão 43
The circle graph below shows the distribution of registered voters, by age, for a community. Registered voters are randomly selected from this distribution to be called for jury duty. What are the odds (in the age range:not in the age range) that the first person called for jury duty is in the age range of 25-35 years?
A. 1:3
B. 7:8
C. 7:43
D. 21:29
E. 42:25
### Questão 44
The design of the stained-glass panel has how many lines of symmetry in the plane of the panel?
F. 2
G. 4
H. 8
J. 16
K. Infinitely many
### Questão 45
What is the area of the stained-glass panel, to the nearest 0:1 square foot?
A. 3.1
B. 4.0
C. 6.2
D. 8.0
E. 12.6
### Questão 46
Kaya wants to install a new circular stained-glass window in her living room. The design of the window will be identical to that of the panel. The diameter of the new window will be 75% longer than the diameter of the panel. The new window will be how many feet in diameter?
F. 1:50
G. 2:50
H. 2:75
J. 3:50
K. 4:00
### Questão 47
In the figure below, $\dpi{100}&space;\fn_jvn&space;\small&space;\overline{AB}$ || $\dpi{100}&space;\fn_jvn&space;\small&space;\overline{CD}$, $\dpi{100}&space;\fn_jvn&space;\small&space;\overline{AE}$ bisects $\dpi{100}&space;\fn_jvn&space;\small&space;\angle&space;BAC$, and $\dpi{100}&space;\fn_jvn&space;\small&space;\overline{CE}$ bisects $\dpi{100}&space;\fn_jvn&space;\small&space;\angle&space;ACD$. If the measure of $\dpi{100}&space;\fn_jvn&space;\small&space;\angle&space;BAC$ is 82°, what is the measure of $\dpi{100}&space;\fn_jvn&space;\small&space;\angle&space;AEC$?
A. 86°
B. 88°
C. 90°
D. 92°
E. Cannot be determined from the given information
### Questão 48
In the circle shown below, chords $\dpi{100}&space;\fn_cm&space;\small&space;\overline{TR}$ and $\dpi{100}&space;\fn_cm&space;\small&space;\overline{QS}$ intersect at P, which is the center of the circle, and the measure of $\dpi{100}&space;\fn_cm&space;\small&space;\angle&space;PST$ is 30°. What is the degree measure of minor arc $\dpi{100}&space;\fn_cm&space;\small&space;\widehat{RS}$ ?
F. 30°
G. 45°
H. 60°
J. 90°
K. Cannot be determined from the given information
### Questão 49
For what value of a would the following system of equations have an infinite number of solutions?
2x - y = 8
6x - 3y = 4a
A. 2
B. 6
C. 8
D. 24
E. 32
### Questão 50
The weekly constraint represented by the horizontal line segment containing (9, 2) means that each week Marcia makes a minimum of:
F. 2 large frames.
G. 9 large frames.
H. 2 small frames.
J. 9 small frames.
K. 11 small frames.
For every hour that Marcia spends making frames in the second week of December each year, she donates $3 from that week’s profit to a local charity. This year, Marcia made 4 large frames and 2 small frames in that week. Which of the following is closest to the percent of that week’s profit Marcia donated to the charity? A. 6% B. 12% C. 14% D. 16% E. 19% ### Questão 52 What is the maximum profit Marcia can earn from the picture frames she makes in 1 week? F.$410
G. $460 H.$540
J. $560 K.$690
### Questão 53
The determinant of a matrix $\dpi{100}&space;\fn_cm&space;\small&space;\begin{bmatrix}&space;a&space;&&space;b&space;\\&space;c&space;&&space;d&space;\end{bmatrix}$ equals ad -cb. What must be the value of x for the matrix $\dpi{100}&space;\fn_cm&space;\small&space;\begin{bmatrix}&space;x&space;&&space;8&space;\\&space;x&space;&&space;x&space;\end{bmatrix}$ to have a determinant of -16?
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{A.&space;}&space;-4$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{B.&space;}&space;-2$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{C.&space;}&space;-\frac{8}{5}$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{D.&space;\:&space;}&space;\,&space;\frac{8}{3}$
E. 4
### Questão 54
A formula for finding the value, A dollars, of P dollars invested at i% interest compounded annually for n years is A = P(1 + 0.01i)n . Which of the following is an expression for P in terms of i, n, and A?
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{F.&space;}&space;A&space;-&space;00.1i&space;^{N}$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{G.&space;}&space;A&space;+&space;00.1i&space;^{N}$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{H.&space;}&space;\left&space;(&space;\frac{A}{1+0.01i}&space;\right&space;)^{n}$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{J.&space;}&space;\frac{A}{\left&space;(&space;1-0.01i&space;\right&space;)^{n}}$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{K.&space;}&space;\frac{A}{\left&space;(&space;1+0.01i&space;\right&space;)^{n}}$
### Questão 55
If x and y are real numbers such that x > 1 and y $\dpi{100}&space;\fn_cm&space;\small&space;<$ -1, then which of the following inequalities must be true?
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{A.&space;}&space;\frac{x}{y}&space;>1$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{B.&space;}&space;|x|^{2}&space;>&space;|y|$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{C.&space;}&space;\frac{x}{3}&space;-5&space;>&space;\frac{y}{3}&space;-5$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{D.&space;}&space;x^{2}&space;+&space;1&space;>&space;y^{2}&space;+&space;1$
$\dpi{100}&space;\fn_cm&space;\small&space;\textup{E.&space;}&space;x^{-2}&space;>&space;y^{-2}$
### Questão 56
Triangles $\dpi{100}&space;\fn_cm&space;\small&space;\Delta&space;ABC$ and $\dpi{100}&space;\fn_cm&space;\small&space;\Delta&space;PQR$ are shown below. The given side lengths are in centimeters. The area of $\dpi{100}&space;\fn_cm&space;\small&space;\Delta&space;ABC$ is 30 square centimeters. What is the area of $\dpi{100}&space;\fn_cm&space;\small&space;\Delta&space;PQR$, in square centimeters?
F. 15
G. 19
H. 25
J. 30
K. 33
### Questão 57
Triangle $\dpi{100}&space;\fn_cm&space;\small&space;\Delta&space;ABC$ is shown in the figure below. The measure of $\dpi{100}&space;\fn_cm&space;\small&space;\angle&space;A$ is 40°, AB = 18 cm, and AC = 12 cm. Which of the following is the length, in centimeters, of $\dpi{100}&space;\fn_cm&space;\small&space;\overline{BC}$ ?
(Note: For a triangle with sides of length a, b, and c opposite angles $\dpi{100}&space;\fn_cm&space;\small&space;\angle&space;A$, $\dpi{100}&space;\fn_cm&space;\small&space;\angle&space;B$, and $\dpi{100}&space;\fn_cm&space;\small&space;\angle&space;C$, respectively, the law of sines states $\dpi{100}&space;\fn_cm&space;\small&space;\frac{sin\angle&space;A}{a}&space;=&space;\frac{sin\angle&space;B}{b}&space;+&space;\frac{sin\angle&space;C}{c}$ and the law of cosines states $\dpi{100}&space;\fn_cm&space;\small&space;c^{2}&space;=&space;a^{2}&space;+&space;b^{2}&space;-&space;2ac\:&space;cos&space;\angle&space;C$.)
A. 12 sin 40°
B. 18 sin 40°
$\dpi{100}&space;\fn_cm&space;\textup{C.&space;}&space;\sqrt{18^{2}-12^{2}}$
$\dpi{100}&space;\fn_cm&space;\textup{D.&space;}&space;\sqrt{18^{2}+12^{2}}$
$\dpi{100}&space;\fn_cm&space;\textup{D.&space;}&space;\sqrt{12^{2}+18^{2}-2(12)(18)&space;cos&space;40^{\circ})}$
### Questão 58
What is the sum of the first 4 terms of the arithmetic sequence in which the 6th term is 8 and the 10th term is 13?
F. 10.5
G. 14.5
H. 18
J. 21.25
K. 39.5
### Qestão 59
In the equation x2 + mx + n = 0, m and n are integers. The only possible value for x is -3. What is the value of m?
A. 3
B. -3
C. 6
D. -6
E. 9
### Questão 60
The solution set of which of the following equations is the set of real numbers that are 5 units from -3?
F. |x + 3| = 5
G. |x - 3| = 5
H. |x + 5| = 3
J. |x - 5| = 3
K. |x + 5| = 3 | 2019-08-25 07:50:29 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 95, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5258693695068359, "perplexity": 2332.337326669996}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-35/segments/1566027323221.23/warc/CC-MAIN-20190825062944-20190825084944-00558.warc.gz"} |
https://math.stackexchange.com/questions/2926998/the-commutant-of-mathcalhsh/2927722 | # the commutant of $\mathcal{HS(H)}$
Let $$\mathcal{HS}(H)$$ be the set of Hilber Schmidt operators on a Hilbert space,it is a $$C^*$$ algebra.I wonder whether we have an explicit description of the commutant of $$\mathcal{HS(H)}$$.Is the commutant of $$\mathcal{HS(H)}$$ closed in $$B(H)$$?
For any set $$S\subset B(H)$$, the commutant of $$S$$ equals the commutant of the operator norm closure of $$S$$. Since the operator norm closure of $$\mathcal{HS}(H)$$ is $$K(H)$$, the commutant of $$\mathcal{HS}(H)$$ equals the commutant of $$K(H)$$, which is $$\mathbb C$$. | 2019-05-22 12:39:05 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 13, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9584341049194336, "perplexity": 106.89689587918382}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232256812.65/warc/CC-MAIN-20190522123236-20190522145236-00225.warc.gz"} |
http://www.newtonproject.ox.ac.uk/view/texts/normalized/NATP00263 | <45r>
Cambridge
December 14th. 1675.
Sir
The notice you gave me of the Royal Societie's intending to see the experiment of glass rubbed to cause various motions in bits of paper underneath, put me upon recollecting my self a little further about it, & then remembring that if one edge of the brass hoop was laid downward the glass was as neare again to the table as it was when the other edge was laid downward & that the papers plaid best when the glass was nearest to the table: I began to suspect that I had set down a greater distance of the glas from the table then I should have done, for in setting down that experiment I trusted to the Idea I had of the bignes of the hoop in which I might easily be mistaken having not seen it of a long time. And this suspicion was increased by trying the experiment with an object glass of a Telescope placed about the 3d part of an inch from the Table: for I could not see the papers play any thing neare so well as I had seen them formerly. Whereupon I lookt for the old hoop with its' glas, & at length found the hoop the glass being gone, but by the hoop I perceived that when one edge was turnd down the glas was almost the third part of an inch from the table & when the other edge was down which made the papers play so well the glass was scarce the 8th part of an inch from the Table. This I thought fit to signify to you that if the experiment succeed not well at the distance I set down it may be tryed at a less distance, & that you may alter my paper & write in it an eighth part of an inch instead of $\frac{1}{2}$ or $\frac{1}{3}$ of an inch. The bits of paper ought to be very little & of thin paper. <45v> Perhaps little bits of the wing of a fly or other light substances may do better then paper. Some of the motions as that of hanging by a corner & twirling about, & that of leaping from one part of the glas to another without touching the table happen but seldom but it made me take the more notice of them.
Pray present my humble service to Mr Boyle when you see him & thanks for the favour of the convers I had with him at spring. My conceit of trapanning the common Ether, as he was pleasd to expres it, makes me begin to have the better thoughts on that he was pleasd to entertein it with a smile. I am apt to think that when he has a set of experiments to try in his air pump, he will make that one to see how the compression or relaxation of a muscle will shrink or swell, soften or harden, lengthen or shorten it.
As for Registring the two discourses you may do it, only I desire you would suspend till my next letter, in which I intend to set down something to be altered & something to be added in the Hypothesis, being in the mean while
Sir
Is. Newton.
<45av>
For Henry Oldenburg Esquire at
of the old Pal-mall
in Westminster
London
2
Mr Newton to Mr Oldenburg concerning an Experiment of glas rubbed to cause various motions in litle bits of paper underneath the glas. | 2019-08-24 01:20:22 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 2, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6763798594474792, "perplexity": 1527.1040295311473}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-35/segments/1566027319155.91/warc/CC-MAIN-20190823235136-20190824021136-00249.warc.gz"} |
https://tex.stackexchange.com/questions/624752/how-to-draw-a-vertical-line-in-a-table/624756 | # How to draw a vertical line in a table?
How do I draw a vertical line in the following table:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\noindent\begin{tabular}{lp{1.5in}lp{1.5in}}
\toprule
Parameter & Description & Parameter & Description\\
\midrule
$A$ & Recruitment rate of the population & $B$ & Transmission coefficient\\
\bottomrule
\end{tabular}
\end{document}
In other words I'm trying to get something like the following
parameter meaning | parameter meaning
a pressure| b volatility
c constant| t time
EDIT:
I tried:
\noindent\begin{NiceTabular}{lp{1.5in}|lp{1.5in}}
\toprule
Parameter & Description & Parameter & Description\\
\midrule
$\mu$ & Influx rate of the population & $\epsilon$ & Progression rate from $I_1$ to $I_2$ \\
$\beta_1$ & Transmission rate of the fast latent compartment & $p_1$ & Progression rate from $I_2$ to $J$ \\
$\beta_2$ & Transmission rate of the symptomatic compartment & $p_2$ & Progression rate from $J$ to $A$ \\
$\beta_3$ & Transmission rate of the AIDS compartment & $\xi_1$ & Treatment rate from $J$ to $I_1$ \\
$p$ & Fraction of S infected by $I_2$ who enter $I_1$ & $\xi_2$ & Treatment rate from $J$ to $I_2$ \\
$q$ & Fraction of S infected by $J$ who enter $I_1$ & $\nu$ & Natural death rate \\
$r$ & Fraction of S infected by $A$ who enter $I_1$ & $\alpha$ & Disease related death rate \\
\bottomrule
\end{NiceTabular}
It gave me an error
EDIT 2 :
Zarko, can you compile the following code in your solution so I can use it as an image in my document :
\noindent\begin{tblr}{colspec = {| Q[c,$] X[l] | Q[c,$] X[l] |},
row{1} = {mode=text},
row{2-Y} = {belowsep+=2pt}
}
\toprule
Parameter & Approximate value & Parameter & Approximate value\\
\midrule
\mu & 0.55
& \epsilon & 0.002 \\
\beta_1 & 0.0001
& p_1 & 0.01 \\
\beta_2 & 0.006
& p_2 & 0.03 \\
\beta_3 & 0.0007
& \xi_1 & Varying \\
p & Varying
& \xi_2 & Varying \\
q & Varying
& \nu & 0.01 \\
r & Varying
& \alpha & 0.01 \\
\bottomrule
\end{tblr}
EDIT 3:
The pdf one looks far better as its less "bulky", so how can I achieve this?
• you can use | but it will be broken at the bookatb rules. Read the booktabs manual for the rules on using vertical rules in tables, Dec 2, 2021 at 15:42
• Dec 2, 2021 at 15:44
• the edit does not provide a usable test document so we can not run what you did and you have given no indication of what error or output that you got. Dec 2, 2021 at 16:09
• @DavidCarlisle It said ! LaTeX Error: Environment NiceTabular undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.3155 \noindent\begin{NiceTabular} But I already loaded the package
– Math
Dec 2, 2021 at 16:10
• you need to load a new enough nicematrix package or just believe the booktabs manual that stresses that vertical lines are an evil that should never be inflicted on the reader. Dec 2, 2021 at 16:12
UPDATED After follow-up question: solutions do not compile. (see bellow)
Vertical lines can be drawn without conflict with booktabs using the nicematrix package.
The second table has a better alignment of the cells. Uses X columns to adjust their relative widths and centering.
The only package needed to add is nicematrix https://ctan.org/pkg/nicematrix?lang=en
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\noindent\begin{NiceTabular}{lp{1.5in}|lp{1.5in}}
\toprule
Parameter & Description & Parameter & Description\\
\midrule
$\mu$ & Influx rate of the population & $\epsilon$ & Progression rate from $I_1$ to $I_2$ \\
$\beta_1$ & Transmission rate of the fast latent compartment & $p_1$ & Progression rate from $I_2$ to $J$ \\
$\beta_2$ & Transmission rate of the symptomatic compartment & $p_2$ & Progression rate from $J$ to $A$ \\
$\beta_3$ & Transmission rate of the AIDS compartment & $\xi_1$ & Treatment rate from $J$ to $I_1$ \\
$p$ & Fraction of S infected by $I_2$ who enter $I_1$ & $\xi_2$ & Treatment rate from $J$ to $I_2$ \\
$q$ & Fraction of S infected by $J$ who enter $I_1$ & $\nu$ & Natural death rate \\
$r$ & Fraction of S infected by $A$ who enter $I_1$ & $\alpha$ & Disease related death rate \\
\bottomrule
\end{NiceTabular}
\bigskip
\noindent\begin{NiceTabular}[width=\textwidth]{|X[c,m] X[2,l,m] | X[c,m] X[2,l,m] |}[cell-space-limits=3pt]
\toprule
Parameter & Description & Parameter & Description\\
\midrule
$\mu$ & Influx rate of the population & $\epsilon$ & Progression rate from $I_1$ to $I_2$ \\
$\beta_1$ & Transmission rate of the fast latent compartment & $p_1$ & Progression rate from $I_2$ to $J$ \\
$\beta_2$ & Transmission rate of the symptomatic compartment & $p_2$ & Progression rate from $J$ to $A$ \\
$\beta_3$ & Transmission rate of the AIDS compartment & $\xi_1$ & Treatment rate from $J$ to $I_1$ \\
$p$ & Fraction of S infected by $I_2$ who enter $I_1$ & $\xi_2$ & Treatment rate from $J$ to $I_2$ \\
$q$ & Fraction of S infected by $J$ who enter $I_1$ & $\nu$ & Natural death rate \\
$r$ & Fraction of S infected by $A$ who enter $I_1$ & $\alpha$ & Disease related death rate \\
\bottomrule
\end{NiceTabular}
\end{document}
To try the last version of nicematrix without installing it:
1. Download nicematrix.zip from nicematrix.zip
2. Extract the directory nicematrix.
3. Open a command windows in that directory and execute pdflatex nicematrix.ins.
4. The file nicematrix.sty will be generated.
5. Copy that file to your working directory and compile your table
UPDATE Check the version of the packages
Try this code to check the version of the packages
The output will produce two very similar tables, the first using tabularray (from Zarko's answer) and the second with nicematrix
\documentclass{article}
\usepackage{geometry}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\usepackage{nicematrix}
\begin{document}
\parindent0pt
{\large \textbf{tabularray}}\bigskip
\begin{tblr}{colspec = {@{} Q[c,$] X[l] | Q[c,$] X[l] @{}},
row{1} = {mode=text},
row{2-Y} = {belowsep+=2pt}
}
\toprule
Parameter & Description & Parameter & Description\\
\midrule
\mu & Influx rate of the popu\-la\-tion
& \epsilon & Progression rate from $I_1$ to $I_2$ \\
\beta_1 & Transmission rate of the fast latent compartment
& p_1 & Progression rate from $I_2$ to $J$ \\
\beta_2 & Transmission rate of the symptomatic compartment
& p_2 & Progression rate from $J$ to $A$ \\
\beta_3 & Transmission rate of the AIDS compartment
& \xi_1 & Treatment rate from $J$ to $I_1$ \\
p & Fraction of S infected by $I_2$ who enter $I_1$
& \xi_2 & Treatment rate from $J$ to $I_2$ \\
q & Fraction of S infected by $J$ who enter $I_1$
& \nu & Natural death rate \\
r & Fraction of S infected by $A$ who enter $I_1$
& \alpha & Disease related death rate \\
\bottomrule
\end{tblr}
\bigskip
{\large \textbf{nicematrix}}\bigskip
\begin{NiceTabular}{cp{2.0in}|cp{2.0in}}[cell-space-limits=4pt]
\toprule
Parameter & Description & Parameter & Description\\
\midrule
$\mu$ & Influx rate of the population & $\epsilon$ & Progression rate from $I_1$ to $I_2$ \\
$\beta_1$ & Transmission rate of the fast latent compartment & $p_1$ & Progression rate from $I_2$ to $J$ \\
$\beta_2$ & Transmission rate of the symptomatic compartment & $p_2$ & Progression rate from $J$ to $A$ \\
$\beta_3$ & Transmission rate of the AIDS compartment & $\xi_1$ & Treatment rate from $J$ to $I_1$ \\
$p$ & Fraction of S infected by $I_2$ who enter $I_1$ & $\xi_2$ & Treatment rate from $J$ to $I_2$ \\
$q$ & Fraction of S infected by $J$ who enter $I_1$ & $\nu$ & Natural death rate \\
$r$ & Fraction of S infected by $A$ who enter $I_1$ & $\alpha$ & Disease related death rate \\
\bottomrule
\end{NiceTabular}
\end{document
If it fails run the following code
\listfiles % list the files loaded <<<<<<<<<<<<<<
\documentclass{article}
\usepackage{geometry}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\usepackage{nicematrix}
\begin{document}
Only to list the files loaded
\end{document}
Important See that before \documentclass{article} there is the command \listfiles
Now look at the end of the .log file.
You should see a list of all files loaded, similar to
*File List*
article.cls 2020/04/10 v1.4m Standard LaTeX document class
size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
geometry.sty 2020/01/02 v5.9 Page Geometry
....
epstopdf-base.sty 2020-01-24 v2.11 Base part for package epstopdf
epstopdf-sys.cfg 2021/03/18 v2.0 Configuration of epstopdf for MiKTeX
***********
On my current system it appears
tabularray.sty 2021-12-01 v2021Q Typeset tabulars and arrays with LaTeX3
nicematrix.sty 2021/09/09 v6.2 Enhanced arrays with the help of PGF/TikZ
If in your case the versions installed are previous, I suggest you update them.
I am using the MiKTeX distribution, where this task is done using the MiKTeX Console.
Edit 2
• I tried this and it didn't work. Check Edit.
– Math
Dec 2, 2021 at 16:07
• Can you add vertical lines at the beginning and at the end in the second table?
– Math
Dec 2, 2021 at 16:39
• @Math I did. Also added some instructions to try the package without installing it. Dec 2, 2021 at 16:59
• I get this error running the last code: ! Undefined control sequence. <argument> \l_keys_key_str l.4612 ...ormal } { Continued ~ on ~ next ~ page } ?
– Math
Mar 7 at 12:41
• @Math The message is coming from tabularray. Check the version you have installed. I also get pdflatex: security risk: running with elevated privileges This is pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.3). Your system is older? Mar 7 at 12:59
With tabularray package you can simple combine rules from booktabs package and vertical lines. Additional advantage is that final form of table is achieved already after one compilation.
\documentclass{article}
\usepackage{geometry}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\begin{document}
\noindent\begin{tblr}{colspec = {@{} Q[c,$] X[l] | Q[c,$] X[l] @{}},
row{1} = {mode=text},
row{2-Y} = {belowsep+=2pt}
}
\toprule
Parameter & Description & Parameter & Description\\
\midrule
\mu & Influx rate of the popu\-la\-tion
& \epsilon & Progression rate from $I_1$ to $I_2$ \\
\beta_1 & Transmission rate of the fast latent compartment
& p_1 & Progression rate from $I_2$ to $J$ \\
\beta_2 & Transmission rate of the symptomatic compartment
& p_2 & Progression rate from $J$ to $A$ \\
\beta_3 & Transmission rate of the AIDS compartment
& \xi_1 & Treatment rate from $J$ to $I_1$ \\
p & Fraction of S infected by $I_2$ who enter $I_1$
& \xi_2 & Treatment rate from $J$ to $I_2$ \\
q & Fraction of S infected by $J$ who enter $I_1$
& \nu & Natural death rate \\
r & Fraction of S infected by $A$ who enter $I_1$
& \alpha & Disease related death rate \\
\bottomrule
\end{tblr}
\end{document}
In the case, that you like to have vertical lines at begin and end of table too, than the specification of your table should be:
\noindent\begin{tblr}{colspec = {| Q[c,$] X[l] | Q[c,$] X[l] |},
row{1} = {mode=text},
row{2-Y} = {belowsep+=2pt}
}
Using it, the resulted table is:
As you asked me in comment, here is result of compilation of your code. In test I use the following preamble:
\documentclass{article}
\usepackage{geometry}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
From it follows, that in test are used default font size (10pt) and default fonts (Computer Modern). Image shown here is cutout from screen by Snipping Tool (I use w10 OS), here is shown as png image with default setting of imgur settings.
A "fair" comparison is comparing resulted pdf files, where image are in vector format.
BTW, now I use tabularray package version 2022A (hopefully in few days with recent version 2022B available on CTAN from June 1st ;-). In your case results are the same from version 2021P further).
• Running this code gives this error: ! Undefined control sequence. <recently read> \UseTblrLibrary l.28 \UseTblrLibrary {booktabs} ?
– Math
Dec 6, 2021 at 13:34
• Which version tabularray you have? MWE in my answer is tested by 2021P and it works (no warnings, no errors). I check it again. Dec 6, 2021 at 14:28
• I don't know what version I have, how can I check?
– Math
Dec 6, 2021 at 14:34
• hm, simplest way is try to upgrade your tabularray installation (or better, complete LaTeX installation). However, at begin of your document add \listfiles instruction which will at and of .log file collect all used packages with listed version. There you will see, which version use your system. Dec 6, 2021 at 15:00
• I still don't get a log file. I am using MikTex.
– Math
Dec 6, 2021 at 15:34 | 2022-10-02 09:28:04 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9909635782241821, "perplexity": 2472.177193441064}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030337307.81/warc/CC-MAIN-20221002083954-20221002113954-00202.warc.gz"} |
https://dms.umontreal.ca/~andrew/accepted.php | ### Preprints accepted for publication
#### Sieve weights and their smoothings (with Dimitris Koukoulopoulos and James Maynard) Annales Scientifiques de l'École Normale Supérieure
We obtain asymptotic formulas for the $$2k$$th moments of partially smoothed divisor sums of the M\"obius function. When $$2k$$ is small compared with $$A$$, the level of smoothing, then the main contribution to the moments come from integers with only large prime factors, as one would hope for in sieve weights. However if $$2k$$ is any larger, compared with $$A$$, then the main contribution to the moments come from integers with quite a few prime factors, which is not the intention when designing sieve weights. The threshold for small'' occurs when $$A=\frac 1{2k} \binom{2k}{k}-1$$. One can ask analogous questions for polynomials over finite fields and for permutations, and in these cases the moments behave rather differently, with even less cancellation in the divisor sums. We give, we hope, a plausible explanation for this phenomenon, by studying the analogous sums for Dirichlet characters, and obtaining each type of behaviour depending on whether or not the character is exceptional''.
Article
#### Primes in short intervals: Heuristics and calculations (with Allysa Lumley) Experimental Mathematics
We formulate, using heuristic reasoning, precise conjectures for the range of the number of primes in intervals of length $$y$$ around $$x$$, where $$y\ll (\log x)^2$$. In particular we conjecture that the maximum grows surprisingly slowly as $$y$$ ranges from $$\log x$$ to $$(\log x)^2$$. We will show that our conjectures are somewhat supported by available data, though not so well that there may not be room for some modification.
Article
#### The man who loved problems: Richard K. Guy (with Carl Pomerance) Notices of the American Mathematical Society
A celebration of the life of one of the most colorful figures in contemporary mathematics. Richard Guy, popular author, columnist, educator, researcher, and avid mountain climber, passed away in 2020 at the age of 103.
Article
#### Exponential sums with multiplicative coefficients and applications (with Regis de la Breteche) Transactions of the American Mathematical Society
We show that if an exponential sum with multiplicative coefficients is large then the associated multiplicative function is pretentious''. This leads to applications in the circle method, and a natural interpretation of the local-global principle.
Article | 2022-08-16 23:15:18 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8888037800788879, "perplexity": 603.9753751594226}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882572581.94/warc/CC-MAIN-20220816211628-20220817001628-00159.warc.gz"} |
http://gmatclub.com/forum/equilateral-triangle-bdf-is-inscribed-in-equilateral-triangl-96109.html?fl=similar | Find all School-related info fast with the new School-Specific MBA Forum
It is currently 08 Feb 2016, 15:56
### GMAT Club Daily Prep
#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
# Events & Promotions
###### Events & Promotions in June
Open Detailed Calendar
# Equilateral triangle BDF is inscribed in equilateral triangl
Author Message
TAGS:
Intern
Joined: 30 May 2010
Posts: 30
Schools: YALE SOM
Followers: 1
Kudos [?]: 16 [2] , given: 2
Equilateral triangle BDF is inscribed in equilateral triangl [#permalink] 19 Jun 2010, 07:17
2
KUDOS
5
This post was
BOOKMARKED
00:00
Difficulty:
95% (hard)
Question Stats:
43% (02:16) correct 57% (01:57) wrong based on 178 sessions
Attachment:
Captura.jpg [ 108.93 KiB | Viewed 6526 times ]
Equilateral triangle BDF is inscribed in equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of the triangle ACE?
(1) Angle DFE is 90º
(2) The length of AF is 10*sqrt(3)
[Reveal] Spoiler: OA
Math Expert
Joined: 02 Sep 2009
Posts: 31286
Followers: 5348
Kudos [?]: 62186 [2] , given: 9444
Re: DS: Equilateral triangle inscribed in triangle [#permalink] 19 Jun 2010, 08:09
2
KUDOS
Expert's post
2
This post was
BOOKMARKED
Nusa84 wrote:
Equilateral triangle BDF is inscribed in equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of the triangle ACE?
1. Angle DFE is 90º
2. The length of AF is 10*sqrt(3)
Can you help me with this one? Thanks!!!
The problem is easier to solve than to explain, but anyway:
In equilateral triangle all angles equal to 60 degrees and $$Area_{equilateral}=\frac{a^2\sqrt{3}}{4}$$, where $$a$$ is the length of a side.
(1) Angle DFE is 90º --> angles ABF and BDC must also be 90º (for example $$\angle {BDC}=180-\angle {BDF}-\angle{EDF}=180-60-30$$ and the same for ABF). Also as $$\angle{DEF}=\angle{BCD}=\angle{BAF}=60$$, then triangles DFE, BCD and BAF are 30-60-90 trianlges. In such triangle sides are in the ratio: $$1:\sqrt{3}:2$$ (smallest side (1) is opposite the smallest angle (30°), and the longest side (2) is opposite the largest angle (90°)).
So if $$DE=2x$$ (hypotenuse in right triangle DFE), then $$DC=x$$ (smaller leg in right triangle BCD) and $$BD=\sqrt{3}x$$ (larger leg in right triangle BCD, also the side of inscribed triangle). So the side of triangle ACE would be $$CE=DC+DE=x+2x=3x$$
Area of the shaded region (right triangle BDC) would be $$Area_{BDC}=\frac{BD*DC}{2}=\frac{\sqrt{3}x*x}{2}=\frac{\sqrt{3}x^2}{2}$$ and the area of equilateral triangle $$Area_{ACE}=\frac{a^2\sqrt{3}}{4}=\frac{(3x)^2*\sqrt{3}}{4}=\frac{9x^2\sqrt{3}}{4}$$;
$$\frac{Area_{BDC}}{Area_{ACE}}=\frac{\sqrt{3}x^2}{2}*\frac{4}{9x^2\sqrt{3}}=\frac{2}{9}$$.
Sufficient.
(2) The length of AF is $$10*\sqrt{3}$$. Multiple breakdowns are possible, hence multiple ratios of areas. Not sufficient.
_________________
Intern
Joined: 30 May 2010
Posts: 30
Schools: YALE SOM
Followers: 1
Kudos [?]: 16 [0], given: 2
Re: DS: Equilateral triangle inscribed in triangle [#permalink] 19 Jun 2010, 08:27
Bunuel wrote:
Nusa84 wrote:
Equilateral triangle BDF is inscribed in equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of the triangle ACE?
1. Angle DFE is 90º
2. The length of AF is 10*sqrt(3)
Can you help me with this one? Thanks!!!
Attachment:
Captura.jpg
The problem is easier to solve than to explain, but anyway:
In equilateral triangle all angles equal to 60 degrees and $$Area_{equilateral}=\frac{a^2\sqrt{3}}{4}$$, where $$a$$ is the length of a side.
(1) Angle DFE is 90º --> angles ABF and BDC must also be 90º (for example $$\angle {BDC}=180-\angle {BCD}-\angle{EDF}=180-60-30$$ and the same for ABF). Also as $$\angle{DEF}=\angle{BCD}=\angle{BAF}=60$$, then triangles DFE, BCD and BAF are 30-60-90 trianlges. In such triangle sides are in the ratio: $$1:\sqrt{3}:2$$ (smallest side (1) is opposite the smallest angle (30°), and the longest side (2) is opposite the largest angle (90°)).
So if $$DE=2x$$ (hypotenuse in right triangle DFE), then $$DC=x$$ (smaller leg in right triangle BCD) and $$BD=\sqrt{3}x$$ (larger leg in right triangle BCD, also the side of inscribed triangle). So the side of triangle ACE would be $$CE=DC+DE=x+2x=3x$$
Area of the shaded region (right triangle BDC) would be $$Area_{BDC}=\frac{BD*DC}{2}=\frac{\sqrt{3}x*x}{2}=\frac{\sqrt{3}x^2}{2}$$ and the area of equilateral triangle $$Area_{ACE}=\frac{a^2\sqrt{3}}{4}=\frac{(3x)^2*\sqrt{3}}{4}=\frac{9x^2\sqrt{3}}{4}$$;
$$\frac{Area_{BDC}}{Area_{ACE}}=\frac{\sqrt{3}x^2}{2}*\frac{4}{9x^2\sqrt{3}}=\frac{2}{9}$$.
Sufficient.
(2) The length of AF is $$10*\sqrt{3}$$. Multiple breakdowns are possible, hence multiple ratios of areas. Not sufficient.
As you said, easier to solve, many thanks!!!!!
Manager
Joined: 06 Mar 2010
Posts: 107
Followers: 2
Kudos [?]: 4 [0], given: 11
Re: DS: Equilateral triangle inscribed in triangle [#permalink] 27 Jun 2010, 14:19
Good solution in steps given.
Math Expert
Joined: 02 Sep 2009
Posts: 31286
Followers: 5348
Kudos [?]: 62186 [0], given: 9444
Re: Equilateral triangle BDF is inscribed in equilateral triangl [#permalink] 06 Mar 2014, 01:37
Expert's post
Bumping for review and further discussion.
_________________
Intern
Affiliations: CA, SAP FICO
Joined: 22 Nov 2012
Posts: 33
Location: India
Concentration: Finance, Sustainability
GMAT 1: 620 Q42 V33
GMAT 2: 720 Q47 V41
GPA: 3.2
WE: Corporate Finance (Insurance)
Followers: 0
Kudos [?]: 10 [0], given: 51
Re: DS: Equilateral triangle inscribed in triangle [#permalink] 06 Mar 2014, 18:12
Bunuel wrote:
Nusa84 wrote:
Equilateral triangle BDF is inscribed in equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of the triangle ACE?
1. Angle DFE is 90º
2. The length of AF is 10*sqrt(3)
Can you help me with this one? Thanks!!!
Attachment:
Captura.jpg
The problem is easier to solve than to explain, but anyway:
In equilateral triangle all angles equal to 60 degrees and $$Area_{equilateral}=\frac{a^2\sqrt{3}}{4}$$, where $$a$$ is the length of a side.
(1) Angle DFE is 90º --> angles ABF and BDC must also be 90º (for example $$\angle {BDC}=180-\angle {BCD}-\angle{EDF}=180-60-30$$ and the same for ABF). Also as $$\angle{DEF}=\angle{BCD}=\angle{BAF}=60$$, then triangles DFE, BCD and BAF are 30-60-90 trianlges. In such triangle sides are in the ratio: $$1:\sqrt{3}:2$$ (smallest side (1) is opposite the smallest angle (30°), and the longest side (2) is opposite the largest angle (90°)).
So if $$DE=2x$$ (hypotenuse in right triangle DFE), then $$DC=x$$ (smaller leg in right triangle BCD) and $$BD=\sqrt{3}x$$ (larger leg in right triangle BCD, also the side of inscribed triangle). So the side of triangle ACE would be $$CE=DC+DE=x+2x=3x$$
Area of the shaded region (right triangle BDC) would be $$Area_{BDC}=\frac{BD*DC}{2}=\frac{\sqrt{3}x*x}{2}=\frac{\sqrt{3}x^2}{2}$$ and the area of equilateral triangle $$Area_{ACE}=\frac{a^2\sqrt{3}}{4}=\frac{(3x)^2*\sqrt{3}}{4}=\frac{9x^2\sqrt{3}}{4}$$;
$$\frac{Area_{BDC}}{Area_{ACE}}=\frac{\sqrt{3}x^2}{2}*\frac{4}{9x^2\sqrt{3}}=\frac{2}{9}$$.
Sufficient.
(2) The length of AF is $$10*\sqrt{3}$$. Multiple breakdowns are possible, hence multiple ratios of areas. Not sufficient.
$$\angle {BDC}=180-\angle {BCD}-\angle{EDF}=180-60-30$$ -
Could you explain the logic for taking EDF?
Veritas Prep GMAT Instructor
Joined: 16 Oct 2010
Posts: 6219
Location: Pune, India
Followers: 1676
Kudos [?]: 9599 [0], given: 197
Re: Equilateral triangle BDF is inscribed in equilateral triangl [#permalink] 06 Mar 2014, 22:55
Expert's post
Nusa84 wrote:
Attachment:
The attachment Captura.jpg is no longer available
Equilateral triangle BDF is inscribed in equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of the triangle ACE?
(1) Angle DFE is 90º
(2) The length of AF is 10*sqrt(3)
Note that in a given equilateral triangle, you can inscribe many other equilateral triangles. The areas of these inscribed triangles will be different hence the leftover areas will be different.
Attachment:
Ques3.jpg [ 13.11 KiB | Viewed 3575 times ]
So depending on what type of triangle is inscribed, the shaded region will be a fraction of the area of triangle ACE.
(1) Angle DFE is 90º
All internal angles of Equilateral triangles are 60. Angle DFE is 90 so triangle DFE is a right triangle with angles 30-60-90 and sides in the ratio 1:√3:2.
Attachment:
Ques4.jpg [ 15.69 KiB | Viewed 3575 times ]
If we assume that side of inscribed triangle is s, we get the side of the large triangle in terms of s too. We also get the area of the right triangle (shaded region) in terms of s. Hence we can easily get the area of the shaded region as a fraction of area of triangle ACE (since they will both be in terms of s^2).
This statement alone will be sufficient.
(2) The length of AF is 10*sqrt(3)
Look at the three triangles shown above again. AF could be 10√3 in any of the three cases. The area of shaded region as a fraction of the area of ACE will be different in each case. Hence this statement alone is not sufficient to answer the question.
_________________
Karishma
Veritas Prep | GMAT Instructor
My Blog
Get started with Veritas Prep GMAT On Demand for \$199
Veritas Prep Reviews
Manager
Joined: 01 May 2013
Posts: 62
Followers: 0
Kudos [?]: 16 [0], given: 8
Re: Equilateral triangle BDF is inscribed in equilateral triangl [#permalink] 06 Mar 2014, 23:05
Since you asked for further discussion, here goes.
I more intuited the answer than solved. I know that each interior angle of both equilateral triangles is 60. If I am told that DFE = 90, I can figure out that the other 3 triangles are 30-60-90 and congruent (Each 60-degree angle is across from one side of the smaller equilateral triangle; thus all corresponding sides for the right triangles are the same "x(sqrt3)"). Because I know the relative dimensions of triangles BCD, ABF, DFE, and BDF, I can figure out the relative areas of the triangles. For example, I know I can make BD sqrt3, BC 2, and CD 1. I can figure out the areas of all 4 smaller triangles, add these areas to get ACE's area, and thus determine the fraction of ACE that BCD represents. I didn't actually bother to assign values or do the calculations because it was clear Statement 1 is sufficient.
Eliminate B, C, and E.
Statement 2 only tells me AF. It doesn't provide me with any information about any other sides or angles in the figure. Thus, I would not be able to solve for area. The information is useless. Insufficient.
Eliminate D. The answer is A.
Math Expert
Joined: 02 Sep 2009
Posts: 31286
Followers: 5348
Kudos [?]: 62186 [0], given: 9444
Re: DS: Equilateral triangle inscribed in triangle [#permalink] 07 Mar 2014, 00:34
Expert's post
X017in wrote:
Bunuel wrote:
Nusa84 wrote:
Equilateral triangle BDF is inscribed in equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of the triangle ACE?
1. Angle DFE is 90º
2. The length of AF is 10*sqrt(3)
Can you help me with this one? Thanks!!!
Attachment:
Captura.jpg
The problem is easier to solve than to explain, but anyway:
In equilateral triangle all angles equal to 60 degrees and $$Area_{equilateral}=\frac{a^2\sqrt{3}}{4}$$, where $$a$$ is the length of a side.
(1) Angle DFE is 90º --> angles ABF and BDC must also be 90º (for example $$\angle {BDC}=180-\angle {BCD}-\angle{EDF}=180-60-30$$ and the same for ABF). Also as $$\angle{DEF}=\angle{BCD}=\angle{BAF}=60$$, then triangles DFE, BCD and BAF are 30-60-90 trianlges. In such triangle sides are in the ratio: $$1:\sqrt{3}:2$$ (smallest side (1) is opposite the smallest angle (30°), and the longest side (2) is opposite the largest angle (90°)).
So if $$DE=2x$$ (hypotenuse in right triangle DFE), then $$DC=x$$ (smaller leg in right triangle BCD) and $$BD=\sqrt{3}x$$ (larger leg in right triangle BCD, also the side of inscribed triangle). So the side of triangle ACE would be $$CE=DC+DE=x+2x=3x$$
Area of the shaded region (right triangle BDC) would be $$Area_{BDC}=\frac{BD*DC}{2}=\frac{\sqrt{3}x*x}{2}=\frac{\sqrt{3}x^2}{2}$$ and the area of equilateral triangle $$Area_{ACE}=\frac{a^2\sqrt{3}}{4}=\frac{(3x)^2*\sqrt{3}}{4}=\frac{9x^2\sqrt{3}}{4}$$;
$$\frac{Area_{BDC}}{Area_{ACE}}=\frac{\sqrt{3}x^2}{2}*\frac{4}{9x^2\sqrt{3}}=\frac{2}{9}$$.
Sufficient.
(2) The length of AF is $$10*\sqrt{3}$$. Multiple breakdowns are possible, hence multiple ratios of areas. Not sufficient.
$$\angle {BDC}=180-\angle {BCD}-\angle{EDF}=180-60-30$$ -
Could you explain the logic for taking EDF?
It should be $$\angle {BDC}=180-\angle {BDF}-\angle{EDF}=180-60-30$$ (those 3 angles make up a straight line, which is 180 degrees).
Hope it's clear.
_________________
Intern
Joined: 08 Jan 2015
Posts: 34
Followers: 0
Kudos [?]: 33 [0], given: 31
Equilateral triangle BDF is inscribed in a equilateral triangle ACE, [#permalink] 04 Apr 2015, 08:29
Equilateral triangle BDF is inscribed in a equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of triangle ACE?
1) Angle DFE = 90º
2) The length of AF is 10\sqrt{3}
Attachments
quant_ds_00000225.jpg [ 19.57 KiB | Viewed 1865 times ]
Math Forum Moderator
Joined: 06 Jul 2014
Posts: 1217
Location: Ukraine
Concentration: Entrepreneurship, Technology
GMAT 1: 660 Q48 V33
GMAT 2: 740 Q50 V40
Followers: 92
Kudos [?]: 1215 [0], given: 178
Re: Equilateral triangle BDF is inscribed in a equilateral triangle ACE, [#permalink] 04 Apr 2015, 09:16
Awli wrote:
Equilateral triangle BDF is inscribed in a equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of triangle ACE?
1) Angle DFE = 90º
2) The length of AF is 10\sqrt{3}
This is duplicate of this task
equilateral-triangle-bdf-is-inscribed-in-equilateral-triangl-96109.html?fl=similar
Only difference that I find in second statement: 10*sqrt(3) in original task and 10\sqrt{3} in this task
But this difference change nothing.
1) If we know that DFE is right triangle 30:60:90, so we know ratio of its sides, can find side of big triangle (relative to DFE), calculate their areas and find fraction
2) This statement doesn't give us enough information.
_________________
Math Expert
Joined: 02 Sep 2009
Posts: 31286
Followers: 5348
Kudos [?]: 62186 [0], given: 9444
Re: Equilateral triangle BDF is inscribed in equilateral triangl [#permalink] 05 Apr 2015, 04:01
Expert's post
Awli wrote:
Equilateral triangle BDF is inscribed in a equilateral triangle ACE, as shown in the figure above. The shaded region is what fraction of the area of triangle ACE?
1) Angle DFE = 90º
2) The length of AF is 10\sqrt{3}
Merging topics. Pleas search before posting. Thank you.
_________________
Re: Equilateral triangle BDF is inscribed in equilateral triangl [#permalink] 05 Apr 2015, 04:01
Similar topics Replies Last post
Similar
Topics:
4 Is the triangle PQR equilateral? 10 03 Sep 2014, 10:26
Is the perimeter of equilateral triangle T equal to the 5 02 Apr 2012, 02:10
An equilateral triangle ABC is inscribed in the circle. If 2 23 Apr 2011, 14:32
14 In the figure, ABC is an equilateral triangle, and DAB is a 5 01 Dec 2010, 05:29
34 Circle O is inscribed in equilateral triangle ABC, which is 18 26 Jun 2010, 06:52
Display posts from previous: Sort by | 2016-02-08 23:56:50 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7311192154884338, "perplexity": 2868.627827529949}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-07/segments/1454701154682.35/warc/CC-MAIN-20160205193914-00006-ip-10-236-182-209.ec2.internal.warc.gz"} |
http://cowlark.com/fluxengine/doc/disk-amiga.html | Amiga disks use MFM, but don’t use IBM scheme. Instead, the entire track is read and written as a unit, with each sector butting up against the previous one. This saves a lot of space which allows the Amiga to not just store 880kB on a DD disk, but also allows an extra 16 bytes of metadata per sector.
Bizarrely, the data in each sector is stored with all the odd bits first, and then all the even bits. This is tied into the checksum algorithm, which is distinctly subpar and not particularly good at detecting errors.
Just do:
fluxengine read amiga
You should end up with an amiga.adf which is 901120 bytes long (for a normal DD disk) — it ought to be a perfectly normal ADF file which you can use in an emulator.
If you want the metadata as well, specify a 528 byte sector size for the output image:
fluxengine read amiga -o amiga.adf:b=528
You will end up with a 929280 byte long image which you probably can’t use in an emulator; each sector will contain the 512 bytes of user payload followed by the 16 bytes of metadata.
## ⇡Writing disks
Just do:
fluxengine write amiga -i amiga.adf
This will rake a normal 901120 byte long ADF file and write it to a DD disk. Note that writing to an HD disk will probably not work (this will depend on your drive and disk and potential FluxEngine bugs I’m still working on — please get in touch if you have any insight here).
If you want to write the metadata as well, specify a 528 byte sector size for the output image and supply a 929280 byte long file as described above.
fluxengine write amiga -i amiga.adf:b=528 | 2020-06-02 07:53:40 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3347974419593811, "perplexity": 2321.030633034519}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590347423915.42/warc/CC-MAIN-20200602064854-20200602094854-00043.warc.gz"} |
http://raycursive.com/ | =/
[先开坑 慢慢填]
[就算这样我也还是不会写作业]
#Holomorphic functions verses real differentiable functions
In short, the Cauchy-Riemann Equations hold if and only if $$\textrm{D}F(x,y)$$ is a conformal matrix, i.e. an $$\mathbb{R}$$-linear transformation corresponding to multiplication by a complex number.
#Cauchy-Riemann Equations, Harmonic functions, and 1-forms
(简单写两笔算是日记了。
(现在翻到大一的时候写的parametrized by arc length的po文 感觉真是… 尼玛早点跟我说这个微分几何里要用我就多写点了啊QwQ
==
Applied Math is not math at all. 我真觉得图论已经傻逼到一定境界. 我怎么想都想不通一个planer graph怎么可能满足$$v-e+f=2$$, 后来翻了半天才发现书上把unbounded region也算进去了…
Seminar更是血崩 … 讲道理说一些抽象的东西其实还好讲。 不管是说由equivalent class定义的quotient space上如何定义metric还是topology的一些概念还是可以轻松跟上。但是gluing opposite sides of an octagon / hexagon我就只能给自己点根蜡烛。感觉自己对这些比较具体实在的东西的幻想能力实在是远弱于抽象能力。
==
==
Well, Don’t Panic.
…你妹 这个有点洗脑啊!
We live in a beautiful world.
Yeah we do, yeah we do.
“I used to rule the world”
QwQQQQQQ星星眼!
==
Happy New Year.
We live in a beautiful world.
Yeah we do, yeah we do.
Hope I can get somebody to lean on.
Then there will be nothing to run from.
==
I’m so fucking sorry.
Love is difficult as there’s no way to adjust it.
I’m just pretty fucking sure the one I love is not you but her.
==
Not obsessed.
Cuz I love u.
Anyway lol, 今天突然想起来 < 50 Ways To Say Goodbye > , 在钟宇的车上听过两次 当时沉浸在失恋的痛苦中并不认为这首歌应景
(为了不吵到父上睡觉 在明天要去漫展的情况下用mbp的键盘强行码的我只想给自己点个赞
The diagonalizability of a linear operator $$T$$ is equivalent to find a basis consisting of eigenvectors of $$T$$.
For $$T$$, calculating its characteristic polynomial $$c(t)$$, if it splits, for one particular eigenvalue $$\lambda$$, we have already known that $$E_\lambda = \textrm{null}(T-\lambda I)$$ is a vector space spanning by the eigenvectors of $$T$$ corresponding to $$\lambda$$.
At the same time, we also know that the eigenvectors corresponding to different eigenvalues are linearly independent, we can divided them into some smaller linear space.
Thus, our destination is that, can we treat the origin vector space as a direct sum of all of those eigenspaces?
On the other hand, it’s easy to conclude that $$1 \leq \dim(E_\lambda) \leq m$$, where $$m$$ is the multiplicity of $$\lambda$$.
Moreover, the sum of all multiplicities are $$\dim V$$, since the degree of $$c(t)$$ is equals to $$\dim V$$.
It’s easy to see that, if we can treat $$V$$ as the direct sum of all those eigenspaces, the dimensions of those eigenspaces must equal to its corresponding multiplicity. One way to understand this is considering the basis in each eigenspace.
Let $$\gamma$$ be a parametrized curve, $$\textbf{t} = \frac {\dot{\gamma}(t)} { \left | \dot{\gamma}(t) \right |}$$ is the unit tangent vector.
Generally, we can rewrite $$\left | \dot{\gamma}(t) \right |$$ as $$\dot{s}$$. Thus $$\dot{\gamma}(t) = \dot{s}(t)\textbf{t}(t)$$.
In particular, suppose that $$\gamma$$ is parametrized by arc length, $$\textbf{t} = \dot{\gamma}(t)$$, we can infer that $$\dot{\textbf{t}}$$ is orthogonal to $$\textbf{t}$$ from $$\left | \textbf{t} \right |^2 = 1$$.
Thus, calculating the second-order derivative of $$\gamma$$, we would get that $\ddot{\gamma} = \ddot{s}\textbf{t} + \dot{s}\left | \dot{\textbf{t}} \right | \textbf{n}$
where $$\textbf{n} = \frac {\dot{\textbf{t}}} {\left | \dot{\textbf{t}} \right |}$$ is the principal normal vector along $$\gamma$$.
Here, we can treat the first part $$\ddot{s}\textbf{t}$$ as the tangential acceleration, and the second part $$\dot{s}\left | \dot{\textbf{t}} \right | \textbf{n}$$ as the centripetal acceleration.
From physics (CM), we could get a grasp of the concept of curvature: the radius of the trace of movement, which would be a part of centripetal acceleration.
If $$\gamma$$ traces a twice-differentiable smooth curve, then the curvature at $$\gamma(t)$$ is the scalar $\kappa(t) = \left | \frac {\textrm{d}\textbf{t}} {\textrm{d}s} \right |$
From the chain rule, we can treat it as $$\left | \frac{\textrm{d}\textbf{t}} {\textrm{d}t} \cdot \frac{\textrm{d}t} {\textrm{d}s} \right |$$. Since $$\dot{s} > 0$$, it equals to $$\frac {\left | \dot{\textbf{t}} \right |} {\dot{s}}$$.
Thus, we have $$\left | \dot{\textbf{t}} \right | = \dot{s}\kappa$$, and $$\ddot{\gamma} = \ddot{s}\textbf{t} + \dot{s}^2\kappa\textbf{n}$$.
Our goal is to find a specific parametrization which is convenient in our application, one is arc length parametrization.
Def : The arc length function $$s=s(t)$$ of a curve parametrized by $$\textbf{x} = g(t)$$ on $$t_0 \leq t \leq t_1$$ is defined by
$s(t)=\int_{t_0}^t \left| \dot{\textbf{x}}(u)\right| \textrm{d}u$
Def : A curve $$\gamma : [0,L] \to \mathbb{R}^n$$ is parametrized by arc length if $$\left | \dot\gamma (t) \right | = 1$$ for all $$0 \leq t < L$$.
For this parametrization, we have such a property: If $$\gamma : [0,L]\to\mathbb{R}^n$$ is parametrized by arc length, then the length of the arc $$\{\gamma(t) : t_1 \leq t \leq t_2\}$$ is precisely $$t_2 – t_1$$.
For an arbitrary parametrization $$\gamma_2 : [a,b]\to\mathbb{R}^n$$, we can build a relation between this one and arc length parametrization, by the definition of arc length itself.
let $$s(t)$$ be a function of $$t$$ : $s(t) = \int_a ^t \left | \dot\gamma_2(t) \right | \textrm{d}t$
let $$\phi$$ be a mapping from $$[a,b]$$ to $$[0,L]$$ (L is the length of this curve): $\phi : [a,b] \to [0,L] = s(t)$
It follows that:
• $$\phi(a) = \int_a^a = 0$$
• $$\phi(b) = \int_a^b = L$$
• $$\phi’>0$$, since $$\left | \dot \gamma_2 (t) \right | > 0$$ (which ensure that $$\phi$$ is invertible)
• Thus, $$\gamma(\phi(t)) = \gamma_2(t)$$, where $$\gamma$$ is a parametrization on $$[0,L]$$
Then we’ll show that $$\gamma$$ is parametrized by arc length from definition, since
\begin{align*} \dot \gamma_2(t) &= \frac {d} {dt} (\gamma(\phi(t))) \\ &= \dot{\gamma}(\phi(t))\,\phi'(t) \\ &= \dot{\gamma}(\phi(t))\, \left | \dot\gamma_2(t) \right | \\ \end{align*}
which implies:
$\left | \dot \gamma_2 (t) \right | = \left | \dot \gamma (\phi(t)) \right | \, \left | \dot \gamma_2 (t) \right |$
Therefore, we have proved that $$\left | \dot \gamma(\phi(t)) \right | = 1$$, which means that $$\gamma$$ satisfies all the requirement of being parametrized by arc length from the its definition.
As a consequence, we have shown that for any parametrization $$\gamma_2$$, we can treat it as a transformation applied on the parameter of a parametrization by arc length, and the transformation is directly from a particular parameter $$t$$ to the arc length from the start point $$a$$ to this parameter.
Moreover, for any arbitrary parametrization, we can also find the function of the arc length based on the parameter itself first, then apply the parametrization to the inverse of the arc length to obtain a parametrization by arc length.
Since we want to obtain a mapping $$\phi : [0,L] -> [a,b]$$ s.t. $$\left | \frac {d} {dt} \gamma(\phi(t)) \right | = 1$$ for any arbitrary parametrization $$\gamma$$. i.e.
$\left | \dot \gamma(\phi(t)) \right | \phi'(t) = 1$
which means:
$\phi'(t) = \frac {1} {\left | \dot \gamma(\phi(t)) \right |}$
As we all know, $${f^{-1}}'(x) = \frac{1}{f'(x)}$$, we can treat $$\phi$$ as the inverse function of $$s(t)$$, which is the primitive function of $$\left | \dot \gamma(\phi(t)) \right |$$ as we showed before. (At the same time, we have shown the existence of such a inverse function before.)
Thus, $$\gamma(\phi(t))$$ is the parametrization we want to obtain before.
### Motivation
唔…开服和小伙伴们玩MC的时候总是不由自主的想加几个新mod玩
这时候就苦了..挨个告知 给他们发过去mod 有的时候还得亲自动手给他们copy到指定的目录下..
Here comes a question..
为什么不直接写一个简单的和server通讯 同步mod的工具呢….
### Implementation
大概是打算server上提供一个接口 返回一个mod list.
和本地文件名校验后 本地直接把缺的mod下载下来 再调用一个外部的launcher
(回头顺便写一个launcher好了..
Update: 于是我真的写了一个launcher…
明天起来写细节..
我都忘了我在这儿开了个坑(.
### Launcher
大概情形就是因为处女座(. 所以强行用Python撸了一个launcher.
其实MC的launcher很简单的. 主要就是以特定的参数调用Java去执行几个jar文件.
但是因为不同版本/ 不同系统/ 是否包含forge/ etc 多种情况, 如果只是单纯的记录一个参数,将其丢给shell的话还是有点蠢.
那么官方的launcher是怎么完成的呢
首先在对应版本的jar文件目录下同时有一个json文件. 这个文件在minecraftArguments这个key下定义了之后要传入的一系列参数, 并在libraries这个key下定义了我们所有要添加的libs.
实现launcher的重点主要就在于如何parse这个key对应的list
首先观察其中元素, 每一个都是一个dict, 比如:
{ "name": "org.apache.httpcomponents:httpclient:4.3.3" },
这里的表示形式很有趣…这个其实指的是library/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar
也就是所有的句号可以直接替换成’/’作为路径分隔符( 别忘了Windows用的是邪恶反斜杠orz
然后从第一个冒号开始 把后边的都替换成’-‘ 最后加上’.jar’的后缀名, 组成一个文件名, 然后再把他们这些冒号统统当做句号处理就好.
嘛 基本上这样就可以把所有libraries所对应的路径名搞出来, 我把它写成了parceLibs这个函数..
在parse的过程里,还涉及到natives和arch的问题, 不过其实很容易就能分辨出来具体的规则, 也不难实现.
基本上解决了这个 照着ps -ef下看到它启动时调用的参数 就可以实现出读取指定版本的json文件然后启动游戏了..
当然作为一个处女座 不能用正版登录 不能用twitch推流 这都是不能忍受的
正版登录的话其实就是把--username这个参数改成你的账号, --password这个参数改成你的密码 然后去post到它的authserver就好. 这里需要注意的是对parameters的构造, 在这个链接里有很详细的阐述.
取回的response里就会有accessToken和uuid, 替换掉参数里的就好.
同时 如果和twitch绑定的话, 在response里会给一个twitch的access token. 用这个去替换参数里的--userProperites就好.
基本上原理就是这样..当然在实际coding里有各种各样奇葩的bugs, 比如和傻逼windows有关的, 得用一大堆引号去保证路径中空格的合法化的这种…简直无情.
还有最坑爹的就是编码问题!
我就艹了!
你说你路径里带中文就带吧
存UTF-8好不好!!
存nmb的GBK! | 2016-09-25 22:28:04 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.993763267993927, "perplexity": 557.8760522726741}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-40/segments/1474738660436.26/warc/CC-MAIN-20160924173740-00280-ip-10-143-35-109.ec2.internal.warc.gz"} |
http://www.velocityreviews.com/forums/t594025-embedding-a-literal-u-in-a-unicode-raw-string.html | Velocity Reviews > Embedding a literal "\u" in a unicode raw string.
# Embedding a literal "\u" in a unicode raw string.
Romano Giannetti
Guest
Posts: n/a
02-25-2008
Hi,
while writing some LaTeX preprocessing code, I stumbled into this problem: (I
have a -*- coding: utf-8 -*- line, obviously)
Which gave an error because the \u escape is interpreted in raw unicode strings,
too. So I found that the only way to solve this is to write:
or
The second one is too ugly to live, while the first is at least acceptable; but
looking around the Python 3.0 doc, I saw that the first one will fail, too.
Am I doing something wrong here or there is another solution for this?
Romano
Diez B. Roggisch
Guest
Posts: n/a
02-25-2008
Romano Giannetti wrote:
> Hi,
>
> while writing some LaTeX preprocessing code, I stumbled into this problem:
> (I have a -*- coding: utf-8 -*- line, obviously)
>
>
> Which gave an error because the \u escape is interpreted in raw unicode
> strings, too. So I found that the only way to solve this is to write:
>
> s = unicode(r"añado \$\uparrow\$", "utf-8")
>
> or
>
>
> The second one is too ugly to live, while the first is at least
> acceptable; but looking around the Python 3.0 doc, I saw that the first
> one will fail, too.
>
> Am I doing something wrong here or there is another solution for this?
Why don't you rid yourself of the raw-string? Then you need to do
s = u"anando \$\\uparrow\$"
which is considerably easier to read than both other variants above.
Diez
OKB (not okblacke)
Guest
Posts: n/a
02-25-2008
Romano Giannetti wrote:
> Hi,
>
> while writing some LaTeX preprocessing code, I stumbled into this
> problem: (I have a -*- coding: utf-8 -*- line, obviously)
>
>
> Which gave an error because the \u escape is interpreted in raw
> unicode strings, too. So I found that the only way to solve this is
> to write:
>
> s = unicode(r"añado \$\uparrow\$", "utf-8")
>
> or
>
>
> The second one is too ugly to live, while the first is at least
> acceptable; but looking around the Python 3.0 doc, I saw that the
> first one will fail, too.
>
> Am I doing something wrong here or there is another solution for
> this?
I too encountered this problem, in the same situation (making
strings that contain LaTeX commands). One possibility is to separate
out just the bit that has the \u, and use string juxtaposition to attach
it to the others:
It's not ideal, but I think it's easier to read than your solution
#2.
--
--OKB (not okblacke)
Brendan Barnwell
no path, and leave a trail."
--author unknown
romano.giannetti@gmail.com
Guest
Posts: n/a
02-25-2008
On Feb 25, 6:03 pm, "OKB (not okblacke)"
<(E-Mail Removed)> wrote:
>
> I too encountered this problem, in the same situation (making
> strings that contain LaTeX commands). One possibility is to separate
> out just the bit that has the \u, and use string juxtaposition to attach
> it to the others:
>
> s = ur"añado " u"\$\\uparrow\$"
>
> It's not ideal, but I think it's easier to read than your solution
> #2.
>
Yes, I think I will do something like that, although... I really do
not understand why \x5c is not interpreted in a raw string but \u005c
is interpreted in a unicode raw string... is, well, not elegant. Raw
should be raw...
Thanks anyway
Martin v. Löwis
Guest
Posts: n/a
02-25-2008
> Yes, I think I will do something like that, although... I really do
> not understand why \x5c is not interpreted in a raw string but \u005c
> is interpreted in a unicode raw string... is, well, not elegant. Raw
> should be raw...
Right. IMO, this is just a plain design mistake in the Python Unicode
in the past, and the proponent of the status quo always defended it,
with the rationale (IIUC) that a) without that, you can't put arbitrary
Unicode characters into a string, and b) the semantics of \u in Java and
C is so that \u gets processed even before tokenization even starts, and
it should be the same in Python.
Regards,
Martin
rmano
Guest
Posts: n/a
02-25-2008
On Feb 25, 11:27 pm, "Martin v. Löwis" <(E-Mail Removed)> wrote:
> > Raw
> > should be raw...
>
> Right. IMO, this is just a plain design mistake in the Python Unicode
> in the past, and the proponent of the status quo always defended it,
> with the rationale (IIUC) that a) without that, you can't put arbitrary
> Unicode characters into a string, and b) the semantics of \u in Java and
> C is so that \u gets processed even before tokenization even starts, and
> it should be the same in Python.
Well, I do not know Java, but C AFAIK has no raw strings, so you have
nevertheless
to use double backslashes. Raw strings are a handy shorthand when you
can generate
the characters with your keyboard, and this asymmetry quite defeat it.
Is it decided or it is possible to lobby for it?
Thanks,
Romano
BTW, 2to3.py should warn when a raw string (not unicode) with \u in
it, I think.
I tried it and it seems to ignore the problem...
NickC
Guest
Posts: n/a
03-04-2008
On Feb 26, 8:45 am, rmano <(E-Mail Removed)> wrote:
> BTW, 2to3.py should warn when a raw string (not unicode) with \u in
> it, I think.
> I tried it and it seems to ignore the problem...
Python 3.0a3+ (py3k:61229, Mar 4 2008, 21:38:15)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
>>> r"\u"
'\\u'
>>> r"\uparrow"
'\\uparrow'
>>> r"\u005c"
'\\u005c'
>>> r"\N{REVERSE SOLIDUS}"
'\\N{REVERSE SOLIDUS}'
>>> "\u005c"
'\\'
>>> "\N{REVERSE SOLIDUS}"
'\\'
2to3.py may be ignoring a problem, but existing raw 8-bit string
literals containing a '\u' aren't going to be it. If anything is going
to have a problem with conversion to Py3k at this point, it is raw
Unicode literals that contain a Unicode escape.
rmano
Guest
Posts: n/a
03-07-2008
On Mar 4, 1:00 pm, NickC <(E-Mail Removed)> wrote:
>
> Python 3.0a3+ (py3k:61229, Mar 4 2008, 21:38:15)
> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
> '\\u'
> >>> r"\uparrow"
> '\\uparrow'
Nice to know... so it seems that the 3.0 doc was not updated. I think
this is the correct
behaviour. Thanks | 2014-03-12 05:31:36 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.863670825958252, "perplexity": 6289.360545456726}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-10/segments/1394021378450/warc/CC-MAIN-20140305120938-00008-ip-10-183-142-35.ec2.internal.warc.gz"} |
http://willwolf.io/2014/04/25/clustering-the-airports/ | Greetings, all, and welcome to my new website! For those that know me, I am the increasingly lazy creator and curator of Will Travel Life - where I post stories, photos, and philosophical muse from a 2+ year backpacking and cycling trip around the world. For those that don't, it's a pleasure to have you at my journalistic side.
In this blog, I'll be posting on a variety of mathematics and machine learning topics. Many will have a travel flavor. In this post, we'll take a look at air travel and airports on my favorite continent: South America and the Falkland Islands.
Traveling by plane in South America is not particularly pragmatic nor affordable: the air network is relatively limited, and flights are therefore costly. Most travelers opt to take the bus instead. When flying to South America, you're likely to enter via one of its major international air hubs: Bogotá, Lima, Santiago, Buenos Aires or São Paulo, for example. Needless to say, these airports are major connecting points for intra-continental travel as well.
In addition to these big airports we'll have a series of, qualitatively speaking, "semi-big" airports, "small" airports, "super tiny single-runway Cessna Jet only" airports, etc. Perhaps we can be more explicit with our grouping? It's one thing to attempt to classify these airports into distinct groups by how many McDonald's each houses. It's another to use the data. Here, I'll attempt this classification using shortest path analysis and k-means clustering.
First, I grab a list of all worldwide flight routes from OpenFlights, current as of January 2012 and containing "59036 routes between 3209 airports on 531 airlines spanning the globe." We filter for South America and employ R's "igraph" package - a library dedicated to network analysis and visualization. I then produce a basic social network graph for all flights between Chile, Argentina and Paraguay merely for example - a visual of some of the data at hand and a testament to the graphical power of R.
The simplify function is used to eliminate reverse routes: we don't need to map flights between Buenos Aires and Santiago as well as those from Santiago to Buenos Aires. As assumed, the visual confirms that most flights between these countries are done through the capitals: Buenos Aires, Santiago, and Asunción. Also, within Argentina, there appears to be a few "middle-range" airports as well, namely but not limited to Mendoza, Bariloche, and El Calafate. Clearly, there are countless "bottom-range" airports too serviced only by one city (within these three countries); Ciudad Del Este, for example. How many distinct groups of varying size/volume/connectivity can we form?
To answer this question, we compute the shortest path - or number of distinct airports through which one must fly - from every city in South America to all other cities. These values are then be used to inform centroid locations for our k-means analysis.
Unfortunately, we still must tell R how many clusters we seek. Should there be 4 distinct airport groups? 8? Why? The more clusters we have, the closer values within each cluster move to their respective centroid mean, a metric given by withinss or "within groups sum of squares." Therefore, we first run the analysis for varying numbers of clusters in search of the k value at which the "marginal return of adding one more cluster is less than was the marginal return for adding the clusters prior to that." We run trials for $$k = 2$$ to $$k = 9$$. The article "K-means Clustering 86 Single Malt Scotch Whiskies" on the Revolution Analytics blog was referenced heavily for this step.
From the graph, it appears that $$k = 3$$ is the value we want: "the marginal return of adding one more cluster is less than was the marginal return for adding the clusters prior to that." However, the k-means clustering algorithm does incorporate a random number generator, so it is important to examine the impact of randomness on our results. In addition, after producing this graph a few times, it was immediately clear that our trend varies slightly across trials. In solution, we'll run 100 trials in ggplot, plot them in points, and examine the smoothing line instead.
The plot seems to corroborate what we previously thought: $$k = 3$$ clusters is the best choice for our data set. To be absolutely certain, we can explicitly compute the predicted "loess" values that fall on our smooth line for integers in $$[2,9]$$ and see where the "marginal returns cutoff point" really is. Simple subtraction.
PredSumVal K
1 43854.32 2
2 33887.51 3
3 27447.83 4
The graph shows the marginal returns clearly. And since $$(43854.32 - 33887.51) \gt (33887.51 - 27447.83)$$, our assumption is confirmed definitively. We want to choose $$k = 3$$ clusters: there are three levels of size/volume/connectivity for airports in South America. In the next post, we'll delve deeper into what this analysis can help us learn about each country and the continent as a whole. | 2018-06-19 15:51:27 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.37270310521125793, "perplexity": 2113.714464736006}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-26/segments/1529267863100.8/warc/CC-MAIN-20180619154023-20180619174023-00037.warc.gz"} |
https://jevon.org/wiki/Images_in_Latex | ## Bitmaps in Latex
For my reports and papers, I use ImageMagick on Linux (well, Cygwin) to convert all my bitmap images to EPS files:
mogrify -format eps *.png
Make sure that none of the images have spaces in them! Tex doesn’t seem to like it, though I’m sure a \ would fix that. And then I can include them in pretty much any compilation route like so:
\begin{figure}[hbt]
\centering
\includegraphics[width=80mm]{images/web-ide.eps}
\caption{NetBeans Visual Web Pack 5.5.1}
\label{fig:netbeans-ide}
\end{figure}
## Visio Images in Latex
It took me forever but I finally worked out how to get vectorized images from Visio into Latex.
1. First, you need to install a PDF printer such as CutePDF.
2. Remove transparency in your Visio file.
3. Print out your image to the PDF printer. Make sure that it fits on one A4 page and is oriented correctly.
4. Use pdf2ps to convert the PDF image to a PS file.
5. You can then include this PS file directly into Latex.
I’ve noted that the on-screen quality of these PS images is fairly shocking, which is disappointing. It appears there is some uncontrollable magic happening in the PDF or PS processes; one solution is to increase the DPI.
1. At 600 dpi (the default), fonts at 12pt remained as vectors, but 10pt was being rasterized.
2. At 1200 dpi, fonts at 12pt and 10pt remained as vectors, but 10pt italic was being rasterized.
3. At 4000 dpi (the highest setting), all fonts remained as vectors, except for some smaller or thinner fonts.
4. If you have opacity in your images it appears they will always be rendered poorly by Visio.
(Another option may be adding the “-r2400” parameter to your pdf2ps command line.)
## Low Quality Images
If you are using pdfopt or ps2pdf, and you are getting low-quality images, try adding this parameter to your ps2pdf command line:
ps2pdf -dPDFSETTINGS=/printer input.ps output.pdf
This will make the final PDF at 300 dpi for all images. More reference: http://www.ghostscript.com/doc/current/Ps2pdf.htm (Though, in my setup, doing this didn’t actually generate the PDF file in the end.) | 2020-05-30 13:47:50 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7830467820167542, "perplexity": 5488.000068680688}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590347409337.38/warc/CC-MAIN-20200530133926-20200530163926-00399.warc.gz"} |
http://html.rhhz.net/linyekexue/html/2018-5-101.htm | 林业科学 2018, Vol. 54 Issue (5): 101-108 PDF
DOI: 10.11707/j.1001-7488.20180511
0
#### 文章信息
Liu Meihong, Peng Limin, Fu Feng, Song Boqi, Wang Dong
Sound Insulation Performance of Wooden Damping Composites
Scientia Silvae Sinicae, 2018, 54(5): 101-108.
DOI: 10.11707/j.1001-7488.20180511
### 作者相关文章
Sound Insulation Performance of Wooden Damping Composites
Liu Meihong, Peng Limin , Fu Feng, Song Boqi, Wang Dong
Research Institute of Wood Industry, CAF Beijing 100091
Abstract: 【Objective】In order to obtain new composite material with properties of light, thin and good acoustic insulation performance, the single homogeneous wooden material was composited with the polymer multilayer damping material, and the parameters of wooden damping composites were optimized.【Method】Medium density fiberboard (MDF) and rubber material (R) were composited under the following manufacture conditions: the hot pressing temperature was 100 ℃, the hot pressing pressure was 3 MPa, the hot pressing time was 10min and the coating amount was 64 g. The mechanical properties of wooden damping composites were determined as following: modulus of elastic (MOE) was 3 490 MPa, flexural strength (MOR) was 30.9 MPa and internal bond strength was 1.24 MPa. On the basis of reducing the amount of coating and improving the production efficiency, the mechanical properties of the wooden damping composites were satisfied. Using the all-factor experiment, the impedance tube was applied to investigate the effects of thickness and density of MDF and R on sound insulation performance. The influence extent of each composite parameter on the sound insulation performance was analyzed and determined by SPSS19.0.【Result】MDF thickness showed a significant impact on the sound insulation performance, with the MDF thickness increased from 3 mm to 5 mm, the weighted sound insulation increased from 34 dB to 39 dB, an increase of 5 dB. In the low frequency band, the sound insulation performance of wooden damping composites were controlled by its own stiffness, therefore, the sound insulation performance was influenced by surface density and damping properties to a small extent. With the increase of MDF thickness, the vibration velocity decreased and the sound insulation increased, which attributed to the same frequency incident acoustic excitation. The damping ratio increased from 0.176 to 0.258 with the increase of MDF thickness, an increase of 31.8%. Therefore, the higher damping performance, the greater sound insulation was found. The R thickness showed a significant correlation with the sound insulation performance and the correlation coefficient was 0.979. As the R thickness increased from 0.8 mm to 2 mm, the weighted sound insulation increased from 30 dB to 37 dB, an increase of 7 dB. In the low frequency band, the sound insulation performance was mainly controlled by the stiffness. The slope of sound insulation curve was increased with the increasing stiffness. With the increase of the incident frequency, over the stiffness control area, the resonance effect was gradually disappeared and moved to the quality control area. With the increased of the surface density, the sound insulation performance of the wooden damping composites increased. When the high frequency was reached, the sound insulation performance was mainly controlled by damping performance. The damping ratio of the wooden damping composite increased from 0.065 to 0.201. The higher the damping ratio, the better the damping performance of the composite materials was found. With the increase of the damping performance, the resonance of the plate was suppressed, and the sound insulation at the resonant frequency was improved. The critical frequency moved to high frequency range, which inhibited the anastomosis effects, and the weir valley became shallow and the sound insulation increased. With the R density increased, the weighted sound insulation increased from 36 dB to 37 dB, non-significant effect of R density on sound insulation performance was observed.【Conclusion】The thickness of MDF and R have a great effect on the sound insulation performance of wooden damping composites, and the R density has little effect on the sound insulation performance. The better acoustic damping properties of wooden damping composites were achieved with the following parameters: the MDF thickness was 2 mm, the R thickness was 2 mm and the R density was 2.3 g·cm-3.
Key words: wooden materials rubber materials multi-layer composite damping performance sound insulation performance
1 材料与方法 1.1 试验材料
MDF,市购,厚度为(1.5±0.14) mm、(2.0±0.04) mm、(2.5±0.05) mm和(6.0±0.04) mm,密度为0.65 g·cm-3,含水率为4.5%,4种厚度MDF的弹性模量分别为2 780、2 900、3 110和3 456 MPa。R,市购,厚度为(0.8±0.2) mm、(1.2±0.2) mm和(2.0±0.2) mm,密度为2.0、2.3和2.5 g·cm-3,R材料能承受的温度范围为-20~100 ℃,常温下的损耗因子为0.472 9。异氰酸酯胶黏剂,由上海亨斯迈聚氨酯有限公司生产,棕黄色液体,固含量(固体质量分数)为100%,黏度为工业级。
1.2 试样制备
图 1 复合试样结构 Figure 1 Structure of composite sample
1.3 试验设计
1.4 性能测试 1.4.1 面密度测试
${G_0} = \frac{{G \times {{10}^4}}}{{L \times B}}。$ (1)
1.4.2 力学性能测试
$S = \frac{{E{h^3}}}{{12(1 - {\mu ^2})}}。$ (2)
1.4.3 阻尼性能测试
1.4.4 隔声性能测试
$R = {\rm{lg}}\frac{1}{{{E_t}/{E_i}}} = 10{\rm{lg}}\frac{1}{\tau }。$ (3)
图 2 隔声性能的测试装置 Figure 2 Sound insulation performance test device
图 3 确定计权隔声量Rw的标准曲线 Figure 3 The standard curve of the weight sound transmission loss Rw
2 结果与分析 2.1 单元厚度对复合材料隔声性能的影响
图 4 声波传递示意 Figure 4 Sketch of sound wave transmission
图 5 复合材料的计权隔声量 Figure 5 Weight sound transmission loss of composite materials
图 6 单层MDF的隔声性能曲线 Figure 6 Sound insulation performance of single layer MDF
图 7 R单板的隔声性能曲线 Figure 7 Sound insulation curve of rubber veneer
图 8 单层MDF与MDF/ R隔声性能的对比 Figure 8 Comparison of single layer MDF and MDF/R sound transmission loss
图 9 MDF厚度不同的复合材料的隔声性能 Figure 9 Sound insulation performance of the composites with different thickness of MDF
图 10 R厚度不同的复合材料的隔声性能 Figure 10 Sound insulation performance of composite materials with different thickness
图 11 R密度不同的复合材料的隔声性能 Figure 11 Sound insulation performance of composite materials with different rubber density
图 12 木质阻尼复合材料的阻尼比 Figure 12 Damping ratio of wood damping composites
2.2 R密度对复合材料隔声性能的影响
3 结论
1) 2种材料单独作为隔声材料都存在缺陷,将中密度纤维板(MDF)与橡胶材料(R)进行3层复合,可有效提高单层MDF隔声性能及R在共振频率处的隔声性能,与同等厚度及相同面密度的单层MDF隔声性能相比提高了10 dB左右。
2) MDF厚度和R厚度增加,对复合材料的隔声性能具有显著影响。R密度增加,对复合材料的隔声性能几乎无影响。通过分析材料参数对复合材料隔声性能影响规律,最终确定参数MDF厚度为2 mm、R厚度为2 mm、R密度为2.3 g·cm-3时,复合材料的隔声性能较佳。
马大猷. 2002. 噪声振动控制工程手册[M]. 北京: 机械工业出版社. (Ma D Y. 2002. Noise and vibration control engineering manual[M]. Beijing: Mechanical Industry Press. [in Chinese]) 潘涵. 2012. 聚氯乙烯基复合材料的层合结构对隔声性能的影响. 杭州: 浙江理工大学硕士学位论文. (Pan H. 2012. Effect of laminated structure of PVC composites on sound insulation performance. Hangzhou: MS thesis of Zhejiang University of Technology. [in Chinese]) 王康乐, 温华兵, 陆金铭, 等. 2014. R芯夹层板隔声特性研究[J]. 噪声与振动控制, 34(2): 192-195. (Wang K L, Wen H B, Lu J M, et al. 2014. Study on sound insulation characteristics of rubber core sandwich plate[J]. Noise and Vibration Control, 34(2): 192-195. [in Chinese]) 辛锋先, 张钱城. 2016. 金属板轻质隔墙隔声性能的探究[J]. 山西建筑, 42(7): 111-112. (Xin F X, Zhang Q C. 2016. Study on sound insulation performance of lightweight partition wall of metal plate[J]. Shanxi Architecture, 42(7): 111-112. [in Chinese]) 杨军伟, 蔡俊, 邵骢. 2013. 微穿孔板—蜂窝夹芯复合结构的隔声性能[J]. 噪声与振动控制, 33(4): 122-125. (Yang J W, Cai J, Shao C. 2013. Sound insulation performance of micro perforated plate-honeycomb sandwich composite structure[J]. Noise and Vibration Control, 33(4): 122-125. [in Chinese]) Arunkumar M P, Jagadeesh M, Pitchaimani J, et al. 2016. Sound radiation and transmission loss characteristics of a honeycomb sandwich panel with composite facings: effect of inherent material damping[J]. Journal of Sound & Vibration, 383: 221-232. Ghofrani M, Ashori A, Rezvani M H, et al. 2016. Acoustical properties of plywood/waste tire rubber composite panels[J]. Measurement, 94: 382-387. DOI:10.1016/j.measurement.2016.08.020 Han T, Wang X, Xiong Y, et al. 2015. Light-weight poly (vinyl chloride)-based soundproofing composites with foam/film alternating multilayered structure[J]. Composites: Part A, 78: 27-34. DOI:10.1016/j.compositesa.2015.07.013 Lee M H, Kang D B, Kim H Y, et al. 2007. Classification of geared motor noise using a cepstrum and comb lifter analysis[J]. Int J Precis Eng Manuf, 8: 39-45. Liang J Z, Jiang X H. 2012. Soundproofing effect of polypropylene/inorganic particle composites[J]. Compos Part B Eng, 43: 199-1998. Maderuelo-Sanz R, Nadal-Gisbert A V, Crespo-Amorós J E, et al. 2012. A novel sound absorber with recycled fibers coming from end of life tires (ELTs)[J]. Appl Acoust, 73: 402-408. DOI:10.1016/j.apacoust.2011.12.001 Ng C F, Hui C K. 2008. Low frequency sound insulation using stiffness control with honeycomb pan[J]. Applied Acoustics, 69(4): 293-301. DOI:10.1016/j.apacoust.2006.12.001 Reixacha R, Reyb R D, Albab J, et al. 2015. Acoustic properties of agroforestry waste orange pruning fibers reinforced polypropylene composites as an alternative to laminated gypsum boards[J]. Constr Build Mater, 77: 124-129. DOI:10.1016/j.conbuildmat.2014.12.041 Shen C, Xin F X, Lu T J. 2016. Sound transmission across composite laminate sandwiches: influence of orthogonal stiffeners and laminate layup[J]. Composite Structures, 143: 130-136. DOI:10.1016/j.compstruct.2016.02.007 Yang H S, Kim D J, Lee Y K, et al. 2004. Possibility of using waster tire composites reinforced with rice straw as construction materials[J]. Bioresour Technol, 95: 61-65. DOI:10.1016/j.biortech.2004.02.002 Yin X, Cui H. 2009. Acoustic radiation from a laminated composite plate excited by longitudinal and transverse mechanical drives[J]. Appl Mech-Trans ASME, 76: 044501. DOI:10.1115/1.3086429 Yin X, Gu X, Cui H, et al. 2007. Acoustic radiation from a laminated composite plate reinforced by doubly periodic parallel stiffeners[J]. Sound Vib, 306(3/5): 877-889. Yoon K H, Yoon S T, Park O O. 2000. Damping properties and transmission loss of polyurethane. Ⅰ. Effect of soft and hard segment compositions[J]. Appl PolymSci, 75: 604-611. DOI:10.1002/(ISSN)1097-4628 Zhao J, Wang X M, Chang J M, et al. 2010. Sound insulation property of wood-waste tire rubber composite[J]. Compos Sci Technol, 70: 2033-2038. DOI:10.1016/j.compscitech.2010.03.015 Zhu X, Kim B, Wang Q, et al. 2013. Recent advances in the sound insulation properties of bio-based materials[J]. Bio Resources, 9: 1764-1786. | 2022-11-30 18:23:49 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7765598297119141, "perplexity": 14980.02334431013}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446710765.76/warc/CC-MAIN-20221130160457-20221130190457-00353.warc.gz"} |
https://mirror.niser.ac.in/cran/web/packages/physiology/vignettes/Everest.html | # Climbing Mount Everest without supplemental oxygen
## Introduction
The summit of Mount Everest is at 8850 meters above sea level. It is unclear how humans can survive at all at this altitude without supplemental oxygen (West 2012, 1984): this article shows how it is possible. Indeed, many have not survived in – or after returning from – the ‘death zone’ (Firth et al. 2008). People have attempted achieving high altitudes for a long time, but it wasn’t until 1978 that Messner and Habeler reached the summit of Everest in 1978 without supplemental oxygen (Hingston 1925; Heggie 2013).
We can calculate the atmospheric pressure, compared to that at sea level:
library(physiology)
pres_atm_frac(altitude_m = 8850)
## [1] 0.3108019
We assume the same fraction of oxygen in atmosphere at sea level and Everest summit. The relative fraction of gasses changes significantly much higher in the atmosphere.
## Water vapor pressure is not constant with altitude
We have to fix a common assumption in examples of the alveolar gas equation that the partial pressure of water vapor in the alveolus is ~47mmHg. This is true at sea level barometric pressures, but not on Everest, and the term becomes significant in the extremes of an Everest ascent. It is probably more complicated than this, but let’s start by just scaling the sea level partial pressure of water vapor.
temp_k = temp_c_to_k(37)
svp <- svp_sea_level(temp_k)
PAH2O_mmHg_summit <- svp * pres_atm_frac(8850)
The calculated saturation vapor pressure (SVP) of 46.936853 matches the common textbook value of 47 at sea level barometric pressure.
pres_atm_everest = 760 * pres_atm_frac(8850)
PAO2_sealevel <- alveolar_PAO2_mmHg(
PACO2_mmHg = 40,
Patm_mmHg = 760)
PAO2_summit_resting <- alveolar_PAO2_mmHg(
PACO2_mmHg = 40,
Patm_mmHg = pres_atm_everest,
PAH2O_mmHg = PAH2O_mmHg_summit)
The assumption of a typical PACO2 of 40 mmHg is invalid for a climber who has achieved the summit. In fact, the hyperventilation due to hypoxemia results in a significantly lower PACO2. Let’s take the group mean of 13.3 mmHg (an astonishingly low number) from the Caudwell Xtreme Everest expedition climbers (Grocott et al. 2009). This also has influence on oxygen carrying capacity via the Bohr effect, but we won’t consider that here.
PACO2_mmHg_Grocott <- 13.3
PAO2_summit_exerted <- alveolar_PAO2_mmHg(
PACO2_mmHg = PACO2_mmHg_Grocott,
Patm_mmHg = pres_atm_everest,
PAH2O_mmHg = PAH2O_mmHg_summit)
## Varying the respiratory quotient
Above we assumed the respiratory quotient (RQ) is the typical 0.8. Would a higher fat or higher carbohydrate diet make it easier to be at the summit of Everest without supplemental oxygen?
rq_lipids <- 0.6
rq_carbs <- 1.0
PAO2_summit_lipids <- alveolar_PAO2_mmHg(
PACO2_mmHg = PACO2_mmHg_Grocott,
Patm_mmHg = pres_atm_everest,
PAH2O_mmHg = PAH2O_mmHg_summit,
rq = rq_lipids)
PAO2_summit_carbs <- alveolar_PAO2_mmHg(
PACO2_mmHg = PACO2_mmHg_Grocott,
Patm_mmHg = pres_atm_everest,
PAH2O_mmHg = PAH2O_mmHg_summit,
rq = rq_carbs)
In practice, there is a limit to how much RQ can be modified, especially in light of an Everest summit attempt (base camp six to summit and back) taking something of the order of 10,000 kcal, which is not matched by caloric intake. Thus, the summit attempt, and likely preceding stages, are catabolic: burning body fat or ingested fat requires more oxygen per unit energy than burning simple carbohydrates.
## Results
The remarkable thing about this plot is that dropping a resting adult out of a pressurized container (e.g., an aircraft) on to the summit of Mount Everest would be quickly fatal, since there is no room for oxygen in the alveoli. Of course, some molecules of oxygen would reach the alveoli, but the water would be furiously boiling off and occupying alveolar space; and without extreme hyperventilation, the blood would also be exporting a large amount carbon dioxide.
Further refinements could be made to this simple model, for example, accounting for the fact that there is slightly higher atmospheric pressure measured than predicted at the Everest summit (West et al. 1983; West 2012).
# References
Firth, Paul G., Hui Zheng, Jeremy S. Windsor, Andrew I. Sutherland, Christopher H. Imray, G. W. K. Moore, John L. Semple, Robert C. Roach, and Richard A. Salisbury. 2008. “Mortality on Mount Everest, 1921-2006: Descriptive Study.” BMJ: British Medical Journal 337 (7684): 1430–3. http://www.jstor.org/stable/20511613.
Grocott, Michael P. W., Daniel S. Martin, Denny Z. H. Levett, Roger McMorrow, Jeremy Windsor, Hugh E. Montgomery, and Caudwell Xtreme Everest Research Group. 2009. “Arterial Blood Gases and Oxygen Content in Climbers on Mount Everest.” The New England Journal of Medicine 360 (2): 140–49. https://doi.org/10.1056/NEJMoa0801581.
Heggie, Vanessa. 2013. “Experimental Physiology, Everest and Oxygen: From the Ghastly Kitchens to the Gasping Lung.” British Journal for the History of Science 46 (1): 123–47. https://doi.org/10.1017/S0007087412000775.
Hingston, R. W. G. 1925. “Physiological Difficulties in the Ascent of Mount Everest.” The Geographical Journal 65 (1): 4–16. https://doi.org/10.2307/1782342.
West, J. B., S. Lahiri, K. H. Maret, R. M. Peters, and C. J. Pizzo. 1983. “Barometric Pressures at Extreme Altitudes on Mt. Everest: Physiological Significance.” Journal of Applied Physiology: Respiratory, Environmental and Exercise Physiology 54 (5): 1188–94. https://doi.org/10.1152/jappl.1983.54.5.1188.
West, John B. 1984. “Human Physiology at Extreme Altitudes on Mount Everest.” Science 223 (4638): 784–88. http://www.jstor.org/stable/1692001.
———. 2012. “High-Altitude Medicine.” American Journal of Respiratory and Critical Care Medicine 186 (12): 1229–37. https://doi.org/10.1164/rccm.201207-1323CI. | 2023-03-26 05:56:31 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6356456279754639, "perplexity": 7220.726962561096}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296945433.92/warc/CC-MAIN-20230326044821-20230326074821-00335.warc.gz"} |
https://www.groovemachine.be/05-24_26121.html | silica carbide thermal conductivity in ukraine
Colloquium - ICR 2020
GIR Group, Ukraine Modern refractories for the repair and construction of coke ovens: Nr. 4 Modern Refractories for the repair and construction of coke ovens: world experience of using silica materials with coarse-crystals and crypto-cristal lattice
Silicon Carbide Powder Suppliers @ …
Silicon nitride ceramic has low thermal expansion coefficient, high thermal conductivity and thermal shock resistance. In more HongKong Litong Int’l Holdings (Group) Ltd | Address: 26/F, Block C, Yitai Center, 1006 Dongmen North Road, Luohu District, ShenZhen, Guangdong 518001, China
Common materials: Selection and properties - JPE
Introduction To match different material properties to an appliion, this Precision Point sheet can be used. After selection, this sheet can also be used for the mechanical properties of these materials. Selection Properties *1×106 repetitions **1×107 repetitions ***5×108 repetitions xσ0.2% / 3
Silicon Carbide Powder Suppliers @ …
Silicon nitride ceramic has low thermal expansion coefficient, high thermal conductivity and thermal shock resistance. In more HongKong Litong Int’l Holdings (Group) Ltd | Address: 26/F, Block C, Yitai Center, 1006 Dongmen North Road, Luohu District, ShenZhen, Guangdong 518001, China
Coining graphene with silicon carbide: synthesis …
7/10/2016· Download figure: Standard image High-resolution image Aforementioned structural and chemical features define not only the unique band structure of graphene (absence of energy gap, the formation of the Dirac cones at K and K'' points of the Brillouin zone, the possibility of engineering the Fermi level and the density of states with the help of external influence), but also the unusual
Thermal Conductivity of the Materials Based on Silicon …
30/12/2020· Thermal conductivity is the major parameter in designing new materials operating under high-temperature and cyclic heating conditions []. The thermal conductivity of silicon carbide products depends on their preparation method and, at room temperature, is from].
Structure and Porosity of Silicon Carbide Produced by …
19/11/2015· Silicon carbide in the β $$\\beta$$ modifiion with a developed surface and a large pore size was obtained by carbothermal reduction using mesoporous siliceous molecular sieves (SBA-15, KIT-6, MCF, SBA-3). The formation of silicon carbide with high porosity parameters is favored by the use of the KIT-6 mesoporous molecular sieve (MMS) with a three-dimensional structure and a …
High thermal conductivity of graphite fiber silicon …
Opening hours . TIB Technik/Naturwissenschaften (Science/Technology), TIB Conti-Campus and TIB Sozialwissenschaften (Social Sciences): Circulation Desks: Monday to Friday from 9:0
Aluminum-chromium | Plansee
The high thermal stability and resistance to oxidation of aluminum-chromium coatings means that higher feed speeds, cutting performance and metal removal rates can be achieved without difficulty. A coating of just one thouh of a millimetre of our materials reliably protects your tools against wear even at high temperatures and therefore extends their service life.
(PDF) Researching of Thermophysical Processes in …
Thermo-physical model of silicon carbide production process in Acheson furnace is worked out. Dynamics of thermal state of reaction zone in the furnace is computed by finite difference method with
Silicon Carbide Powder Appliion - Nanoshel
Silicon Carbide Powder Appliion: Thermal Conductivity Due to its high thermal conductivity, silicon carbide is a very attractive material for high temperature appliions. From the device design point of view, the thermal conductivity of SiC exceeds that of Cu, BeO, Al2O3, and AlN.
Silica, Quartz, and Silie Materials Selection Guide | …
13/8/2020· Fused silica is a compound of silicon and oxygen. High purity, amorphous, fused silica is a high-performance ceramic with very low expansion, remarkable thermal shock resistance, low thermal conductivity, excellent electrical insulation up to 1000 C, and
Thermal conductive led light heat sink silicone cooling …
maltodextrin Fumed Silica xanthan gum Soluble Corn Fiber Resistant Dextrin dietary fiber 3,4-difluorobenzonitrile PBS PBAT PLA 2,3-Butanediol propanediol Silica phenolic resin vitamin TiO2 titanium dioxide vitamin c copper oxide pvc resin
Fire Bricks – Properties, Types and Uses - Building …
Fire clay for Making Fire Bricks Fire clay is used to make fire bricks and is generally found under the coal seams. Fire clay contains two major constituents- silica and alumina, of which, the silica percentage varies from 60 to 70% and alumina varies from 25 to 35%.
SiCf/SiC Composite: Attainment Methods, Properties …
9/8/2011· The SiC single crystal with high purity has a thermal conductivity of about 5000 W.m-1.K-1 at 50 K and decreases to about 500 W.m-1.K-1 at room temperature (298K). SiC f /SiC composite, because of its high porosity, inherent in the manufacturing process has low thermal conductivity in the direction perpendicular to the fibers.
Top Seiko Co., Ltd. - Company Profile | Supplier Information
Top Seiko Co., Ltd. specializes in the machining of engineering ceramics, glass, and refractory metals. We offer not only machining service, but also material selection service and development assistance service. Our advantages are in the lead time, quality, and the ability to make complex shapes. Please find the material we use as well as the
Fired Refractory Shapes and Crucibles
Kitmas company presents in Ukraine the products of the market leader in the development and production of refractory molds and crucibles - Morgan Thermal Ceramics. Morgan Thermal Ceramics produces refractory crucibles, junction boxes, pipes, nozzles and molds for various critical tasks in vacuum induction melting and other appliions with temperatures above 1649 ° C (3000 ° F).
molecular formula of silicon carbide types
Silicon carbide : definition of Silicon carbide and … Silicon carbide (SiC), also known as carborundum, is a compound of silicon and carbon with chemical formula SiC. It occurs in nature as the extremely rare mineral moissanite.Silicon carbide powder has been mass-produced since 1893 for use as an abrasive..
Silicon Carbide SiC Material Properties - Accuratus
Silicon carbide is not attacked by any acids or alkalis or molten salts up to 800 C. In air, SiC forms a protective silicon oxide coating at 1200°C and is able to be used up to 1600°C. The high thermal conductivity coupled with low thermal expansion and high strength give this material exceptional thermal shock resistant qualities.
ELECTROCHEMISTRY OF SILICON IN CHLORO-FLUORIDE AND CARBONATE MELTS
exhibit notable metallic properties: thermal shock resistance, oxidation resistance up to 1400 0C etc. However, the thermal conductivity of titanium silicides is low. Silicon carbide is a semiconductor with high hardness and oxidation resistance up to 1200 0C.
Common materials: Selection and properties - JPE
Introduction To match different material properties to an appliion, this Precision Point sheet can be used. After selection, this sheet can also be used for the mechanical properties of these materials. Selection Properties *1×106 repetitions **1×107 repetitions ***5×108 repetitions xσ0.2% / 3
molecular formula of silicon carbide types
Silicon carbide : definition of Silicon carbide and … Silicon carbide (SiC), also known as carborundum, is a compound of silicon and carbon with chemical formula SiC. It occurs in nature as the extremely rare mineral moissanite.Silicon carbide powder has been mass-produced since 1893 for use as an abrasive..
Porosity and insulating properties of silica-fume based …
1/11/2016· Silica fume, a by-product, was used both as starting raw powder and as foaming agent. •. Ultra-macroporous silica-fume based foams were obtained by direct foaming. •. Lightweight porous foams with good thermal conductivity values were obtained. •. The foams resulted promising as insulating materials.
Technical Data Sheets | Washington Mills
Washington Mills provides technical data sheets on every product we manufacture such as brown fused aluminum oxide, white fused aluminum oxide, silicon carbide and other fused oxides as well as distributed products. Technical data sheets offer insight into
Lattice thermal conductivity in cubic silicon carbide
Lattice thermal conductivity in cubic silicon carbide A. Sparavigna Dipartimento di Fisica and Istituto Nazionale di Fisica della Materia (INFM), Politecnico di Torino, Corso Duca degli Abruzzi 24
Colloquium - ICR 2020
GIR Group, Ukraine Modern refractories for the repair and construction of coke ovens: Nr. 4 Modern Refractories for the repair and construction of coke ovens: world experience of using silica materials with coarse-crystals and crypto-cristal lattice
SiCf/SiC Composite: Attainment Methods, Properties …
9/8/2011· The SiC single crystal with high purity has a thermal conductivity of about 5000 W.m-1.K-1 at 50 K and decreases to about 500 W.m-1.K-1 at room temperature (298K). SiC f /SiC composite, because of its high porosity, inherent in the manufacturing process has low thermal conductivity … | 2021-09-17 19:22:38 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.40872886776924133, "perplexity": 9811.571618921907}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780055775.1/warc/CC-MAIN-20210917181500-20210917211500-00390.warc.gz"} |
https://www.nature.com/articles/s41598-022-25172-8?error=cookies_not_supported&code=74bd6361-ee62-4854-ab8e-f48a084cf56b | ## Introduction
Cassava (Manihot esculenta Crantz) provides household food security and income for millions of smallholder farmers in sub-Saharan Africa (SSA)1, and is widely consumed as a cheap source of carbohydrates. It is a starch-storage root crop that is widely cultivated due to its remarkable ability to tolerate prolonged periods of drought, grow well in poor and acidic soils with less labour requirements than other crops, withstand biotic and abiotic stresses, produce reasonable yields under low soil fertility and erratic rainfall, and its adaptation to diverse agro-ecological conditions2,3. Furthermore, its flexibility in harvesting time enables the root crop to be stored naturally in the soil, making it a good famine reserve crop. Cassava is grown commercially on a large number of hectares across all agro-ecological zones of Nigeria and ranks first in the area under cultivation4. Because of the large expansion of the root crop across a wide range of agro-ecological conditions, it is very common to get different relative performances from the same genotypes when assessed in contrasting environments. The variations that occur in genotypic performance across environments are attributed to the effects of genotype × environment interaction (GEI), which is a common phenomenon in plant breeding programmes2,5,6.
GEI may be referred to as the differential phenotypic expression of genotypes under diverse environmental conditions, and one of its main effects is that it weakens the relationship between the values of the phenotype and genotype7. Various abiotic and biotic factors influence the expression of genes that control desirable agronomic and economic traits in cassava over the course of the crop’s growing period, which results in GEI8. For this reason, GEI has been a major focus for plant breeders. Breeders face the GEI challenge by evaluating genotypes in multi-environment trials (METs) to ensure that they select genotypes with ideal performance and adequate adaptability to target environments9. The adaptability of cassava genotypes to a wide range of environments can effectively be determined through rigorous statistical measures of the stability of individual genotypes. A genotype that is consistently well-ranked over multiple environments is said to be stable, and such genotype is considered to have broad or wide adaptation, whereas if stability is confined to a limited range, the genotype is deemed to have narrow or specific adaptation10.
Improvement of cassava has been primarily oriented towards important agronomic traits, especially yield and disease and pest resistance. This has led to the release of better yielding varieties that resist prevailing diseases and pests. Unfortunately, these varieties were poorly adopted by smallholder farmers because they lacked local consumption quality traits desired by end-users11,12. Studies have revealed that cassava farmers attach equal value to both agronomic performance and end-user culinary quality traits13,14. Therefore, new cassava varieties must have improved culinary qualities. In Nigeria, breeding efforts are focusing on the improvement of cassava cooking and eating quality traits, predominantly mealiness, to address the increasing demand for varieties that are suitable for the fresh consumption market segment. Adoption of such cassava varieties in Nigeria will largely rely not only on their yield and stress (abiotic and biotic) resistance performances, but also on organoleptic qualities and their suitability for processing into ready-to-eat foods. An accurate estimate of the stability of genotypes over time and space is therefore necessary for developing superior new cassava varieties with a potential high adoption rate among farmers and end-users. Various statistical models have been used to assess patterns of GEI, but among the most suitable approaches are those based on linear-bilinear models such as the genotype main effects plus genotype × environment interaction (GGE) biplot15.
Several studies have published information on the texture of boiled cassava roots, particularly with respect to its mealiness, but these did not cover multiple environments16,17,18,19,20. There are currently no reports of GEI effects on root mealiness and other organoleptic attributes of boiled cassava roots. In order to address this knowledge gap, the present study, therefore, evaluated 150 genotypes including one check variety for two years in three contrasting agro-ecological zones in Nigeria. Such information would present a new vista in designing breeding strategies for the development of cassava genotypes with enhanced sensory characteristics.
## Results
### Analysis of variance
The combined analysis of variance across environments showed that variances due to genotypes (G), environments (E), and GEI were highly significant (P < 0.001) for all the traits measured (Table 1). The analysis indicated that the G had the greatest effect on mealiness and colour, and accounted for 33.67% and 38.53%, respectively, of the total variation. The GEI had more impact on fibre (34.93%), adhesiveness (36.5%), softness (37.19%), taste (35.66%), aroma (40.37%), and firmness (32.05%) than the main effects of G and E. The E was the least contributor to variation for all the traits. The significant GEI effects, particularly for mealiness, prompted further investigation of the magnitude of genotype plus genotype × environment responses for this trait using GGE biplot analysis. The coefficient of variation (CV), which was used to measure variability among the traits, ranged from 11% for aroma to 29.35% for colour (Table 1).
### Mean performance and stability of the genotypes
From this section, results for root mealiness are presented using GGE biplots, as this was the focus trait. The partitioning of GGE through GGE biplot analysis showed that PC1 and PC2 accounted for 54.46% and 25.4% of the GGE sum of squares, respectively, explaining 79.86% of the total variation due to G + GEI for both years (Fig. 1). In this GGE biplot, genotypes were ranked along the average environment coordinate horizontal axis (AEC x-axis) with an arrow pointing to higher mean sensory scores across environments. Thus, genotypes trending towards the direction of G13 (B1-50), G34 (COB6-4), G46 (NR010161), the check, G128 (TMEB693), and G112 (NR110376) had desirable mealiness values, while genotypes in the opposite direction along the AEC x-axis such as G51 (NR050667) and G39 (CR35-10) produced boiled roots that were non-mealy. The stability of individual genotypes measured by the length of their projection from the AEC x-axis, showed that G13 (B1-50) was highly stable and also scored as the mealiest. Genotypes G7 (B1-23) and G38 (CR24-9) were equally stable, but were intermediate in mealiness. G51 (NR050667), though stable, had a low mealiness value compared to other genotypes evaluated in this study. Genotype G101 (NR110213) was low in mealiness and highly unstable (Fig. 1).
### Identifying best performing genotypes and mega-environments
The polygon view of the GGE biplot revealed the genotypes that had the best performance in specific environments (Fig. 2). G13 (B1-50) and the check, G128 (TMEB693), G30 (COB5-11), G39 (CR35-10), G43 (IBA083739), G51 (NR050667), G60 (NR070632), G80 (NR100265) and G120 (NR110512), and G101 (NR110213) located on the vertices of the polygon were the vertex genotypes and were thus considered as the most responsive genotypes to the environments. The other genotypes were contained within the polygon and were found less responsive in their respective directions. Genotypes G80 (NR100265) and G120 (NR110512) were identified as the best performers in environment E3 (Umudike), as they were grouped in one sector of the polygon. The winning genotypes in environments E1 (Igbariam) and E2 (Otobi) were G13 (B1-50) and the check, G128 (TMEB693). The pattern of environments in the biplot indicated the existence of two contrasting mega-environments. Thus, environment E3 (Umudike) formed the first mega-environment, while the second mega-environment had environments E1 (Igbariam) and E2 (Otobi) (Fig. 2).
### Discriminating ability and representativeness of test environments
The concentric circles on the GGE biplot enabled the visualization of the length of the environment vectors (the lines that connect the test environments to the biplot origin), which is proportional to the standard deviation within the respective environments and is a measure of the discriminating power of the environments. Therefore, among the three environments, E3 (Umudike) had the longest vector and was adjudged as the most discriminating (informative), whereas E1 (Igbariam) was the least discriminating (non-informative), as indicated by the relative length of its vector (Fig. 3). Also, in biplot analysis, the test environment that has a smaller angle with the AEC x-axis is more representative of other test environments. Thus, environment E1 (Igbariam) was highly representative of other environments. Environments E3 (Umudike) and E2 (Otobi) were the least representatives (Fig. 3).
### Phenotypic correlations among traits
Results of the pairwise correlation analysis showed that softness (r = 0.46), taste (r = 0.48), colour (r = 0.15), and aroma (r = 0.26) had a positive significant (P < 0.01) correlation with mealiness (Table 2). In contrast, fibre (r = − 0.40) showed a negative significant (P < 0.01) relationship with mealiness. Also, fibre was negatively associated with a number of traits including softness (r = − 0.39), taste (r = − 0.12), colour (r = − 0.13), and aroma (r = − 0.15). Taste and aroma showed a moderate significant positive correlation (r = 0.40; P < 0.01). A lower magnitude of correlation coefficient was observed between softness and taste (r = 0.14; P < 0.01) as well as between adhesiveness and colour (r = 0.11; P < 0.05), taste and colour (r = 0.12; P < 0.05), softness and aroma (r = 0.10; P < 0.05), colour and aroma (r = 0.10; P < 0.05), and taste and instrumental firmness (r = 0.09; P < 0.05). On the other hand, adhesiveness was found to be significantly and negatively correlated with softness (r = − 0.10; P < 0.05) and instrumental firmness (r = − 0.15; P < 0.01). Similarly, instrumental measurements of firmness were negatively correlated to root softness (r = − 0.25; P < 0.01). However, there was no significant correlation between sensory scores of mealiness and firmness values of boiled roots assessed by penetration test (Table 2).
### Genetic components and heritability estimates
The error variances for all the traits were slightly higher than their corresponding genotypic variances except for colour of boiled roots (Table 3). Broad-sense heritability estimates varied considerably for all the traits and were generally moderate for mealiness (0.46) and colour (0.52) (Table 3). Low heritability estimates were observed for fibre (0.33), adhesiveness (0.33), softness (0.31), taste (0.38), aroma (0.17), and firmness (0.36). The phenotypic coefficient of variation (PCV) ranged from 10.6% to 29.31%, with colour of boiled roots having the highest value, followed by mealiness (27.31%) and firmness (22.19%), while the lowest value was observed for aroma. Moderate PCV values (10–20) were observed for fibre, adhesiveness, softness, and taste. The genotypic coefficient of variation (GCV) varied from 4.33% for aroma to 21.04% for colour of boiled roots. The magnitude of the difference between the PCV and GCV values was moderate for all the traits measured (Table 3). The analysis of the expected genetic advance expressed as a percentage of mean (GAM) showed that root mealiness could be improved by 25.76%, whereas 9.39% progress could be made in the improvement of root softness. Also, aroma could be improved by 3.9%, while progress of 10.05% could be made in root taste (Table 3).
## Discussion
The significance of genotypes and environments main effects showed that some genotypes were stable across environments, whereas the significance of genotype × environment interaction indicated specific adaptation of some genotypes to certain environments. The highly significant genotype effects observed for all the traits measured showed that the genotypes constitute a pool of germplasm with a considerable amount of genetic variation. This genetic variability indicates that careful selection and hybridization among these contrasting genotypes may result in additional significant genetic gains in a cassava breeding programme in Nigeria aimed at improving the traits of interest. Environmental effects were highly significant for all the traits studied, indicating the presence of wide variation in testing conditions under which the genotypes were assessed. This suggests the need to conduct multi-environment trials to identify genotypes with wide and specific adaptation, as well as with the best performance for the traits. The highly significant GEI effects for all the traits showed differential genotypic performance in contrasting environments and also revealed changes in the mean performance of genotypes due to the environment. The GEI is a common occurrence in cassava as shown in the present study and which is corroborated by several other studies21,22,23,24,25, and justifies the need for multi-environment testing to identify and select best performers for specific environments2.
The root mealiness variation due to genotype was higher than the environmental influence on the trait, which suggests that mealiness in cassava is a complex trait influenced more by genotypic effects. This finding corroborates earlier reports in potato26 and cassava17. Moreover, the relatively high genotype and low environment effects on mealiness suggest that evaluation in fewer environments may be needed to discriminate genotypes with superior performance, stability and broad adaptation. This also suggests good prospects for enhancing cassava for the trait. However, the presence of a significant effect of GEI on mealiness indicates that some genotypes may fail to respond positively to improved conditions of the test environments. Hence, the need for a more definitive analysis to increase selection efficiency and facilitate the recommendation of superior new genotypes.
To detect the relative stability and GEI of promising genotypes, the applicability of GGE biplot analysis to data obtained from METs is of the utmost importance. The present study revealed that the GGE biplot was an effective statistical model for discriminating the cassava genotypes based on their mean performance and stability, identifying the best performing genotypes within a mega-environment, and evaluating the test environments for effective genotype evaluation based on their discriminating ability and representativeness27. With respect to the visual comparison of the genotypes based on both mean performance and stability across the test environments, the GGE biplot identified G13 (B1-50), G34 (COB6-4), G46 (NR010161), the check, G128 (TMEB693), and G112 (NR110376) as the genotypes that combined desirable mealiness values with moderate to high stability and were found to be the best performers for the trait. These genotypes showed superior performance and stability across the test environments. Projections from the AEC x-axis for most of the genotypes were longer for mealiness, indicating poor stability of the trait over time and space. The biplot also enabled visual comparison of the test environments and genotypes studied, as well as their interrelationships. The vertex genotypes appeared farthest from the biplot origin and were thus the most responsive genotypes to the closest environment(s) compared to others. These genotypes performed either the best or the poorest in some or all environments28. Nonetheless, different genotypes emerged as best performers in different environments. The genotypes G80 (NR100265) and G120 (NR110512) were identified as the best performers in Umudike. The winning genotypes in Igbariam and Otobi were G13 (B1-50) and the check, G128 (TMEB693). No environment fell into sectors with G30 (COB5-11), G39 (CR35-10), G43 (IBA083739), G51 (NR050667), G60 (NR070632), and G101 (NR110213) as the vertex genotypes, implying that these were not the best in any environment, but the poorest performers in some or all the environments. This pattern suggested that the test environments consisted of two different mega-environments for root mealiness, with Umudike separated as the first mega-environment and Igbariam plus Otobi grouped as the second mega-environment for the trait. This indicated that the genotypes could be successfully evaluated for mealiness of boiled roots in two locations, thus Umudike and either Igbariam or Otobi were identified as mega-environments for evaluating cassava genotypes in Nigeria. Furthermore, evaluating test environments to detect those that are both discriminating (informative) and representative is one of the key objectives of GGE biplot analysis. In this study, Igbariam was the most representative and moderately discriminating test environment, as indicated by its smaller angle with the AEC x-axis and the relative length of its vector, respectively. This indicated that the environment was best for identifying widely adapted genotypes. The remaining test environments (Umudike and Otobi) were the most discriminating and least representative, as they fell relatively far away from the AEC x-axis, indicating their usefulness in detecting better-performing genotypes with specific adaptation.
From the breeder’s point of view, correlations measure the intensity of association between traits, detect new parental combinations for variety development, improve selection efficiency, and identify trait measurement redundancy29,30. The significant negative correlation between fibre and other organoleptic attributes of boiled cassava roots (mealiness, softness, taste, colour, and aroma) suggests that genotypes with high fibre content may produce roots that are not acceptable for consumption as boiled cassava. This corroborates with the findings of Safo-Kantanka et al.31, who reported a negative correlation between fibre content and cooking quality of boiled cassava. The relationship observed between mealiness and softness, taste, colour, and aroma implies that these traits are imperative towards designing an efficient cassava breeding programme aimed at enhancing root mealiness. In our study, no significant correlation was found between sensory scores of mealiness and instrumental firmness of boiled roots, thus suggesting that the assessment of mealiness of boiled cassava roots by instrumental measurements may not be relied upon. This observation is contrary to earlier reports by Padonou et al.19 and Franck et al.20.
## Conclusion
The present study showed significant variation between the cassava genotypes for all the traits studied. The observed GEI effects for all the traits led to variations in the average ranks of the genotypes in varying environments, thus justifying the need for multi-environment testing of the genotypes before effective selection can be made. The GGE biplot analysis revealed two distinct mega-environments for evaluating cassava genotypes in Nigeria and also identified G13 (B1-50), G34 (COB6-4), G46 (NR010161), the check variety, G128 (TMEB693), and G112 (NR110376) as the best performing genotypes for root mealiness. These genotypes were stable and adaptable across test environments and could be used as parental materials for further genetic improvement through hybridization in Nigeria. Instrumental measurements of firmness were not significantly correlated to sensory scores of mealiness and may therefore not be reliable in predicting the mealy texture of boiled cassava roots. The moderate broad-sense heritability and relatively high genetic advance obtained for root mealiness suggested potential for genetic improvement.
## Materials and methods
### Genetic material
A total of 150 cassava genotypes including the officially released white-fleshed poundable cassava (TMEB693), which served as check, were used for the study (Supplementary Table S1). The genetic material was sourced from the National Root Crops Research Institute (NRCRI) in Nigeria and consisted of both white and yellow-fleshed genotypes.
### Experimental sites
Trials for these genotypes were conducted over two cropping seasons (2018 and 2019) at three locations: Igbariam (5° 56′ N, 7° 31′ E; mean annual rainfall of 1800 mm; altitude of 150 m; mean annual temperature of 24–32 °C; Dystric Luvisol soils; forest savannah transition zone), Otobi (7° 20′ N, 8° 41′ E; mean annual rainfall of 1500 mm; altitude of 319 m; mean annual temperature of 24–35 °C; Ferric Luvisol soils; southern Guinea savannah zone), and Umudike (5° 29′ N, 7° 24′ E; mean annual rainfall of 2200 mm; altitude of 120 m; mean annual temperature of 22–31 °C; Dystric Luvisol soils; humid forest zone) in Nigeria. These locations represent the major cassava-growing agro-ecological zones in the country. In the present study, the sum of the two years in each location constituted a single environment. This gave a total of three test environments, that is, Igbariam 2018 and 2019 = E1, Otobi 2018 and 2019 = E2, and Umudike 2018 and 2019 = E3.
### Experimental design and management
Field trials were established at the onset of rains using a 10 × 15 alpha lattice design with three replications in each location. A replication consisted of 10 randomized incomplete blocks each containing 15 genotypes. Genotypes were planted as single rows of 5 plants with an inter-row spacing of 1 m and intra-row spacing of 0.8 m, making a basic plot size of 4 m2. Blocks were separated by 1.2 m alleys to minimize inter-block plant competition. No fertilizers or herbicides were applied; nonetheless, fields were kept clean by regular hand weeding. Harvesting was done in all the locations at 12 months after planting (MAP).
### Data collection
Data for individual genotypes were collected at 12 MAP on root mealiness and other quality attributes of boiled cassava roots, which include taste, softness, fibre, adhesiveness (ADH), aroma, colour, and firmness. The genotypes were phenotyped for these quality attributes using subjective estimates except for firmness of boiled roots, which was determined using a puncture force test.
### Boiled cassava sample preparation
Freshly harvested and healthy cassava roots were selected from each genotype, peeled and cut with a kitchen knife into roughly uniform-sized pieces. Samples for sensory analysis (10 root pieces) were washed twice, immersed in boiling water in enamel pots on a domestic gas cooker and left to cook for 25 min. The labelled boiled root samples were then removed from the pots and kept warm in an insulated box until ready to be served for sensory analysis.
### Descriptive sensory analysis
A panel of 10 assessors participated in the descriptive sensory test and evaluated the boiled root samples during the two consecutive years. These assessors were indigenes of the major cassava growing communities in Nigeria who regularly use cassava in their diets. They were recruited based on their interest and availability to participate. Mealiness, taste, softness, fibre, adhesiveness, aroma, and colour were the quality attributes of boiled cassava considered in this study. The assessors were thus trained to understand and quantify these attributes using numeric ratings based on hedonic scales, as described in Raji et al.35 with slight modification (Table 4). The attributes were scored after assessors tasted the samples. Ten samples (genotypes) were evaluated per session. Samples were presented to assessors in white plastic plates at room temperature, coded with random three-digit numbers. Boiled root samples were consumed plain. Water was provided to the assessors for mouth rinsing before and between tasting samples. Assessors performed the sensory test independently in separate tasting booths, with no interaction among assessors.
### Instrumental firmness analysis
An instrumental test was performed using a digital penetrometer (Model number: FHP-803, Vetus Industrial Company Limited, Hefei, China) to assess the firmness of boiled cassava roots. Three roots of each genotype were peeled, washed and cut into 3-cm-thick slices using a kitchen knife and ruler. For each genotype, three slices per root were randomly selected, immersed in boiling water in enamel pots on a domestic gas cooker and boiled for 25 min. Firmness was assessed by pushing the 7.9 mm diameter tip of the penetrometer to a final penetration depth of 1 cm into each boiled root slice. Firmness was defined as the peak force of penetration reached during the test. Two measurements were made on each sliced root. Each result was expressed as the mean value (in kg) of 18 readings.
### Data analysis
The effects of the genotype, environment, and genotype × environment interaction were determined for each attribute in an analysis of variance (ANOVA) using the standard linear model:
$$Y_{ijk} =\upmu +\upbeta _{{\text{i}}} + {\text{R}}_{{{\text{ij}}}} + {\text{G}}_{{\text{k}}} + \left( {\upbeta _{{\text{i}}} \times G_{{\text{k}}} } \right) + e_{{{\text{ijkm}}}}$$
where Yijk is the phenotypic value, μ is the grand mean, βi is the effect of environment i, Rij is the effect of block j in environment i, Gk is the effect of genotype k, (βi × Gk) is the genotype × environment interaction effect associated with environment i and genotype k, and eijkm is the residual term. Genotypes were fitted as fixed effects, whereas environments were considered random effects in the model. Broad-sense heritability (H2) was calculated as:
$${\text{H}}^{{2}} = \frac{{\sigma_{g}^{2} }}{{\sigma_{g}^{2} + { }\sigma_{e}^{2} }}$$
where $$\sigma_{g}^{2}$$ and $$\sigma_{e}^{2}$$ are the variance components for the genotype effect and the residual error, respectively. Genotypic coefficient of variation (GCV) and phenotypic coefficient of variation (PCV) were estimated according to Singh and Chaudhary36, such that:
$${\text{GCV}}\left( \% \right) = \frac{{\surd {\upsigma }_{{\text{g}}}^{2} }}{{{\ddot{\text{X}}}}}{ } \times 100$$
$${\text{PCV}}\left( \% \right) = \frac{{{ }\surd {\upsigma }_{{\text{p}}}^{2} }}{{{\ddot{\text{X}}}}}{ } \times 100$$
where $${\ddot{\text{X}}}$$ is the grand mean.
Expected genetic advance, GA, was calculated as:
$${\text{GA}} = \left( K \right) \sigma_{A} H^{2}$$
where GA is the expected genetic advance, K is selection differential (2.06 at 5% selection intensity) and σA is phenotypic standard deviation.
Genetic advance as percentage of mean (GAM) for each attribute was estimated as:
$${\text{GAM}} = \frac{{{\text{GA}}}}{{{\ddot{\text{X}}}}}{ } \times 100.$$
Phenotypic correlation coefficients among the culinary attributes were calculated to investigate their relationships using the corr.test function of the psych package in R. To visually examine the patterns of genotype (G) and genotype × environment interaction (GEI) in the multi-environment trial data as well as identifying stable and high performing genotypes for root mealiness across the test environments, the first two principal components (PC1 and PC2) were used to construct GGE biplots using the “metan” R package developed by Olivoto37. The GGE biplots were used to graphically display genotype evaluation (mean vs. stability), test environment evaluation (discriminating ability vs. representativeness), mega-environment differentiation, and specific adaptation (which-won-where). Data were tester centered (G + GE) and non-scaled as described in Yan and Tinker27. All data analyses were performed using R statistical software version 4.0.338. | 2023-02-01 17:07:04 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5851166248321533, "perplexity": 6179.876634716906}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764499946.80/warc/CC-MAIN-20230201144459-20230201174459-00467.warc.gz"} |
https://mathoverflow.net/questions/326008/the-table-reduction-morphism-of-operads-from-barratt-eccles-to-surjection | # The table reduction morphism of operads from Barratt-Eccles to Surjection
The Barratt-Eccles operad $$E$$ in the category of simplicial sets is obtained by applying the nerve functor to the canonical operad $$\{\Sigma_n\}_{n>0}$$ in groups. Berger-Fresse defined here an operad morphism from the normalized chains of $$E$$ onto the Surjection operad, another very canonical $$E_{\infty}$$-operad.
I am looking to understand this morphism better. The authors simple give an algorithm but do not hint at the origin of or motivation for their description. Any clues? Thanks!
• Have you tried contacting the authors? I'm sure they'll be pleased to answer your questions. – Fernando Muro Mar 21 '19 at 21:13
As written in the paper that you cite, this construction originates from two papers of McClure–Smith, and a geometric interpretation of the table reduction morphism is given in:
Clemens Berger and Benoit Fresse. "Une décomposition prismatique de l'opérade de Barratt-Eccles." (French) C. R. Math. Acad. Sci. Paris 335 (2002), no. 4, pp. 365–370.
In particular, I think Lemme 3.3 is enlightening. Let me very quickly summarize it.
Recall that $$\mathcal{E}(n) = \Bbbk[E\Sigma_n]$$ is the Barratt–Eccles operad, where $$\mathcal{E}(n)_d = \Bbbk[\Sigma_n^{d+1}]$$. It is the linearization of a simplicial operad $$\mathcal{W}$$. On the other hand, $$\mathcal{X}$$ is the surjection operad, where $$\mathcal{X}(n)_d$$ has for basis the set of surjections $$u : \{1,\dots,n+d\} \to \{1,\dots,n\}$$ such that $$u(i) \neq u(i+1)$$ for all $$i$$.
For a surjection $$u \in \mathcal{X}(n)_d$$, let $$d_k = \# u^{-1}(k)$$. There is an associated prism $$\tau_u : \Delta^{d_1-1} \times \dots \times \Delta^{d_n-1} \to \mathcal{W}(n)$$ defined combinatorially. Among all these prisms, there is a maximal one, called the fundamental simplex. Then:
Lemma 3.3. The map $$TR : \mathcal{E} \to \mathcal{X}$$ is characterized by the following properties:
1. it is a chain map;
2. if $$\sigma$$ is the maximal simplex of a prism $$\tau_u$$, then: $$TR(\sigma) = \begin{cases} u & \text{if } \sigma \text{ is the fundamental simplex of } \tau_u; \\ 0 & \text{otherwise.} \end{cases}$$ | 2021-08-05 08:53:05 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 19, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9578407406806946, "perplexity": 473.76882483939664}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046155458.35/warc/CC-MAIN-20210805063730-20210805093730-00554.warc.gz"} |
https://brilliant.org/problems/figure-it-out-function-part-5-the-second/ | # Figure-It-Out Function! - Part 6: The Second Reciprocal
Algebra Level 4
A function $$f(x)$$ is such that $$f(1) = 2$$, $$f(2)=1$$, and $$f(x)=\dfrac{1}{f(x-1)+f(x+1)}$$ for $$x \ge 2$$. Find
$\large (f(2014)f(2015))^{(f(2012)f(2013))^{...^{...^{(f(2)f(3))^{f(1)}}}}}$
× | 2018-07-20 01:24:00 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.95146644115448, "perplexity": 1318.183520240479}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-30/segments/1531676591455.76/warc/CC-MAIN-20180720002543-20180720022543-00193.warc.gz"} |
http://planet.darcs.net/ | # planet
## August 19, 2014
#### Last Few Weeks
August 19, 2014 05:44 AM UTC
In the last three weeks I was working in a couple of things, unfortunately I couldn't complete any to 100% :
- Finishing the command minimize-context.
- Implement the "show dependencies" for darcsden.
- Solve the issue2405.
Finish the command minimize-context
I can start telling that the command itself is implemented, but making tests I find out a case when making minimize-context fails to update correctly the files of repository. I comment the problem in here, however here goes a little summary.
Some "preconditions" to take into account:
1. If exist a tag, I search for dependencies in the patchs after the tag.
2. If happends that not exist dependencies after the tag, the only patch in the context of the bundle to send is the tag. This helps the command darcs apply to merge the patches and seems good to have at least a "tag patch" dependency.
3. (In relation with 1) If not exist a tag, the search is made in all the repository. One problem here is that with repositories that have huge amount of patches (darcs for example with 11000~ patches) the command maybe not finish of calculate the dependencies. Hopefully, having so many patches without tags seems a little odd. Nevertheless, I suppose that even the search in 700~ patches of 10~ patches to send should have a decent performance.
Well, passing to comment the problem. In some older post I mention the way we calculate the dependencies, so with that in mind, suppose we have to repositories $r_1$, $r_2$ with the following patches, where $m_x$ and $a_x$ represents the $x$-th modification and adding respectively.
$r_1$,$r_2$ = $m_2$ $tag$ $m_1$ $a_1$
suppose now that $r_2$ makes a third modification $m_3$ that adds lines without touch any existing line in the only file adding for $a_1$ and sequentially modified for $m_x$. With the idea of send a bundle to $r_1$. Now if we compute the dependencies to find out what is the context to send. For (1) we need to try to commute $m_2$ with $m_3$, which success but of course the end result is a $m'_3$ and a $m'_2$ because the lines which modifies every one now are different. But beyond that for our definition of dependency we can throw $m_2$, so the final context of the bundle with minimize context is the patch $tag$.
The problem now is that if we make darcs apply of the minimized bundle the merge is made not considering $m_2$ and the final state of the file isn't right. For example, if we are talking about that $m_3$ adds a function in some empty place, this could end in $m_3$ adding the function in the middle of an existing function.
My, more or less, mature thought is something like have Direct Dependency and Indirect Dependency (the names could be differents $\smile$). The Direct Dependency is a dependency as already we know it and the Indirect Dependency is that if we have,
$p_1$ and $p_2$ patches, and $p'_1$ and $p'_2$ are the results of commute the patches, then if $p_1 \ne p'_1$ we conclude that $p_1$ indirectly depends of $p_2$.
I have almost implemented this idea, but I change task and still missing a couple of details. In particular, I'm not so sure of a couple of things,
- How to correctly compare the patches ($p_1 \ne p'_1$)
- In my unclean implementation I have to carry on $MyEq$ for all over the code and it's very ugly I think.
Finishing with this topic, here is a script (improved by Guillaume) that shows the problem:
Link: http://hub.darcs.net/alegadea/ExamplesReposSH: getDepsDoesntAlwaysWork.sh
Implement the "show dependencies" for darcsden
An idea that quickly comes up to my mind is that, considering the last part of the previous topic, since we have two types of dependencies it would be nice generate the graph of dependencies with two types of arrows to differentiate the type of dependency between patches. Talking about the implementation itself, I advanced in the drawing of the graph and some different presentations, but very little about the integration with darcsden, which I think is more or less direct having implemented the $js$ that draw the graph. Would have been nice have more time for finish this but I swap to the task of the following topic.
I hope be able to work in the last two topics in the next few months outside of the GSoC.
Solve the issue2405
I would like to start saying, "what a shame...". I can't solve the issue, I improve a little bit the memory but nothing too much significant. Maybe the good news is that, more o less, I found the "place" in the code where the memory triggers "to the sky" :)
Now, the reality is that I tried so many things that I'm a little bit confused about everything. So, I gonna comment the last feelings and tests that I make and, any question(or idea) for the future person (maybe me) that would try to solve the issue, it would well received.
So things that I tried to change:
- Strict version of Map, Monad, etc.
- More strict version of mapM_, gets and modify.
- Some partials changes in the data type PatchIndex.
- Using darcs as library; differents uses of the functions...
The "place" that I suspect the code has the memory glitch is in $applyPatchMods \rightarrow go (pid, PTouch fn)$I think that my lack of experience dealing with this kind of problem comes to light :) the
bright side is that I learn many things on the way of understand the problem and try different solutions.
Closing, maybe this could be my last post in a long time. I would like to thanks Guillaume and the darcs community in general. It was great to contribute to the development of darcs!
Again, I hope be able to work a little outside the GSoC, in particular in the "dependency problems and tasks".
Thanks!
## August 01, 2014
#### Other Week (21-26 July)
August 01, 2014 07:13 AM UTC
Good news!
I almost finish to implement the option minimize-context for the command darcs send, I say almost because making some examples I find out that somethings could go wrong. But before entering in that, I will comment a little the main the test that without minimize-context doesn't work and with the option passes(when the implementation is ready the most likely is I will upload the example and some more in ExamplesRepos), and some "tentatives options" for darcs send that I think could be useful.
So, the minimal example:
Suppose we have repositories $r_1$, $r_2$ and $r_3$; $r_2$ a direct clone of $r_1$ where
originally $r_1$ has only one patch,
$r_1$,$r_2$ $=$ $p_0$
now, we add a patch with a new file in $r_1$ and make a clone, $r_3$ which leave the repositories like this,
$r_1$,$r_3$ $=$ $p_0$ $p_1$
Suppose that we make a modification in the file that add $p_0$ and make a patch $p'_0$ in $r_1$ and we send a bundle (with darcs send) to $r_2$ and $r_3$. What ends up happening is what one imagine,
the bundle can be applied to $r_3$ but not to $r_2$, this because the bundle has de following "shape":
Some message
patch [Some hash]
Author: ...
Date: ...
* [The modification to $p_0$]
New patches:
$p'_0$
Context:
$p_1$
$p_0$
Patch bundle hash: [Some hash]
and $r_2$ doesn't have the patch $p_1$ despite the fact that $p_1$ nothing has to do with $p'_0$. Using the option minimize-context the bundle is the same but the "Context" is:
Context:
$p_0$
and now there is no problem.
Now, I find out that reducing the context is not always the "best option" for send a bundle. Here I will expose something that could go wrong. Take for example the darcs-screened repository, in total has 11000~ patches, suppose we add a file and make a bundle (using minimize-context) with only the patch that make the add, the context then is empty. So, if we try to apply this bundle to, say the remote repository, this could never end...
What go wrong?; because the context is empty, making darcs apply [TheBundle] in some point try to merge the entire repository versus the "set" of patches to apply, this is very costly if we have 11000~ patches.
I write "best option" before because with my current solution is not always is better reduce the context, but the final idea is that always be the best option. So, I think is necessary to have some care for example in the last implementation if exist a tag, this tag is added to the context. This simple solution solves the problem and seems correct, on the other hand having more than 600~ or 1000~ patches without a tag seem a little extreme :)
Ending, I'm making some tests of two interesting options that came to mind:
. --last-deps=NUMBER
. --deps-from-tag=REGEXP
The first searches dependencies in the first N patches, and the second search since a given tag.
In conclusion, I'm still doubtful about how solve that problem. More if I have consider the two options. For the end of the week I hope have all this solved.
## July 24, 2014
#### Some Week (14-19 July)
July 24, 2014 04:43 AM UTC
Hi all!
I was finishing understanding and implementing the command darcs send --minimize-context using "optimize reorder" when I begin to suspect that doesn't solve the problem described in here. The thing is, despite the fact that the context in the bundle to send is reduced if before we send we make "optimize reorder", this doesn't solve the problem of dependencies. Guillaume finished of evacuate my doubts, and so after read:
[darcs-users] darcs cannot apply some patch bundles
irclog
issue1514 (which is the issue which "replace" issue2044 darcs send should do optimize --reorder)
I convince myself of what needs to be done, and it's calculate the "exact" dependencies of the patches to send so such dependencies be the context in the bundle to send. "Exact" because for big repositories can be very costly and calculate till certain tag seem appropriate.
Now, one concern is the cost of doing the search of dependencies. About this I can first comment some of the things I was doing during the week and later show, what I think are, encouraging examples. So first, maybe the most relevant thing of the week it's the implementation of the command darcs show dependencies with the following "description":
Usage: darcs show dependencies [OPTION]...
Generate the graph of dependencies.
Options:
--from-match=PATTERN select changes starting with a patch matching PATTERN
--from-patch=REGEXP select changes starting with a patch matching REGEXP
--from-tag=REGEXP select changes starting with a tag matching REGEXP
--last=NUMBER select the last NUMBER patches
--matches=PATTERN select patches matching PATTERN
-p REGEXP --patches=REGEXP select patches matching REGEXP
-t REGEXP --tags=REGEXP select tags matching REGEXP
--disable disable this command
-h --help shows brief description of command and its arguments
till the moment the command returns a graph described in dot language, this can eventually change. But with the current returned value one can do:
$\$$darcs show dep | dot -Tpdf -o deps.pdf to draw the graph in a pdf. Finally, in summary to calculate the dependencies I use more or less the idea which describes Ganesh in here. Moving to the examples is interesting, thinking in the performance of the implementation of darcs send --minimize-context using this approach, to see the followings results: 1. Show the dependencies after the tag 2.9.9 (75 patches) time darcs show dep --from-tag=2.9.9 real 0m0.397s user 0m0.373s sys 0m0.026s darcsDesps299.pdf 2. Show the dependencies after the tag 2.9.8 (133 patches) time darcs show dep --from-tag=2.9.8 real 0m2.951s user 0m2.865s sys 0m0.082s darcsDesps298.pdf 3. Show the dependencies after the tag 2.9.7 (288 patches) time darcs show dep --from-tag=2.9.7 real 0m26.654s user 0m26.003s sys 0m0.511s darcsDesps297.pdf 4. Show the dependencies after the tag 2.9.6 (358 patches) time darcs show dep --from-tag=2.9.6 real 0m39.019s user 0m38.302s sys 0m0.666s darcsDesps296.pdf 5. Show the dependencies after the tag 2.9.5 (533 patches) time darcs show dep --from-tag=2.9.5 real 1m53.730s user 1m51.343s sys 0m1.939s darcsDesps295.pdf Rushed conclusion, seems the performance is quite good even more if we think that for compute the graph dependencies we calculate the dependencies of "all the selected patches against all the selected patches" and in the case of the option for send would only require to calculate "patches to send against all the selected patches". ### Marcio Diaz #### GSoC Progress Report #5: Starting the implementation of darcs undo July 24, 2014 03:16 AM UTC I'm starting with the implementation of the command darcs undo. For now it's quite simple, it just use a copy of the previous hashed_inventory. But, for example, with the current implementation we can undo amend-record: mkdir test cd test/ darcs init Repository initialized. touch f g; darcs add f g Adding 'f' Adding 'g' darcs record addfile ./f Shall I record this change? (1/2) [ynW...], or ? for more options: y addfile ./g Shall I record this change? (2/2) [ynW...], or ? for more options: n Do you want to record these changes? [Yglqk...], or ? for more options: y Finished recording patch 'add f' darcs whatsnew addfile ./g darcs amend-record Thu Jul 24 00:07:53 ART 2014 Marcio Diaz <***> * add f Shall I amend this patch? [yNjk...], or ? for more options: y addfile ./g Shall I record this change? (1/1) [ynW...], or ? for more options: y Do you want to record these changes? [Yglqk...], or ? for more options: y Finished amending patch: Thu Jul 24 00:08:17 ART 2014 Marcio Diaz <***> * add f darcs whatsnew No changes! darcs undo darcs whatsnew addfile ./g darcs changes Thu Jul 24 00:07:53 ART 2014 Marcio Diaz <***> * add f Commands affected: - darcs undo Patches created: http://bugs.darcs.net/patch1182. #### GSoC Progress Report #4: Garbage Collection for the Global Cache July 24, 2014 02:46 AM UTC The implementation of the command darcs optimize global-cache is almost finished. This command can reduce the size of the global cache and at the same time we can select which files we want to keep in the cache. The command darcs optimize global-cache takes directories as arguments, search repositories within them and delete all files in the global cache that are not being used by these repositories. I'll give an example using the repository darcs.net. The first time you clone this repository, it takes takes approximately 8 minutes: time darcs clone http://darcs.net Welcome to the darcs screened repository. ... Finished cloning. real 8m16.042s user 0m36.568s sys 0m9.807s The second time, because it use the global cache, it takes only 26 seconds: time darcs clone http://darcs.net Welcome to the darcs screened repository. ... Finished cloning. real 0m26.230s user 0m15.293s sys 0m2.891s But we have a pretty heavy cache (we have other repositories besides darcs.net): du -sh ~/.cache/darcs/inventories/ 277M /home/marcio/.cache/darcs/inventories du -sh ~/.cache/darcs/patches/ 325M /home/marcio/.cache/darcs/patches/ du -sh ~/.cache/darcs/pristine.hashed/ 279M /home/marcio/.cache/darcs/pristine.hashed/ If we need to free memory, we can delete the entire cache using: rm -rf ~/.cache/darcs/ but the next time we make a clone of http://darcs.net it'll take again 8 minutes. So, how can we liberate memory from the global cache and at the same time make darcs clones of http://darcs.net that only take 26 seconds? Using darcs optimize global-cache: time darcs optimize global-cache darcs.net Done cleaning global cache! real 0m36.668s user 0m15.492s sys 0m7.932s It takes 36 seconds to clean the cache, leaving only the necessary files for the repository darcs.net: du -sh ~/.cache/darcs/inventories 21M /home/marcio/.cache/darcs/inventories du -sh ~/.cache/darcs/patches/ 69M /home/marcio/.cache/darcs/patches/ du -sh ~/.cache/darcs/pristine.hashed/ 23M /home/marcio/.cache/darcs/pristine.hashed/ time darcs clone http://darcs.net Welcome to the darcs screened repository. ... Finished cloning. real 0m26.173s user 0m15.164s sys 0m2.905s Commands affected: - darcs optimize global-cache Patches created: ## July 23, 2014 ### Marcio Diaz #### GSoC Progress Report #3: Bucketed Global Cache (completed!) July 23, 2014 11:01 PM UTC I finished the implementation of the bucketed cache. Now users can run darcs optimize cache and migrate the old cache to the new bucketed cache. For example, if we have a cache like in the next figure: Running darcs optimize cache makes the cache as follows: This way of organizing the cache allows programs to navigate faster through it. For example, this is what happens if I want to open the folder with patches of my global cache: It takes about 20 seconds to load 10,000 patches: But if we use the bucketed cache the folder of patches is loaded instantly: Because now this folder contain only 256 sub-folders, with about 40 patches each one: Commands affected: - darcs optimize cache Issues solved: Patches created: #### GSoC Progress Report #2: Bucketed Global Cache July 23, 2014 10:55 PM UTC After my trip to France I'm back working on the Google Summer of Code for darcs. My goals this week are to finish my patches for bucketed cache and garbage collection of the global cache. Bucketed Cache Some programs have problems with directories with a lot of files, for example the ls command in linux. In order to reduce the number of files in a folder in the global cache (which can grow considerably), we decided to implement a bucketed global cache. The patch for the bucketed cache is this: http://bugs.darcs.net/patch1162. This patch transforms the global cache into a bucketed global cache. That is, instead of having all the cache files in a single folder, divided them into sub-folders according to the file name. For example, using the first two digits of the hash, we put the patch named: 0000008516-0048abbb8a2b11870fe24fef48bc2ebb49cbd818a633b8250dc2023e4f6267c9 in the sub-folder /00/, i.e., in ~/.cache/darcs/patches/00/. The same with the inventories and pristine files. However there are several ways to implement this patch: 1. We can forget the old cache (which is located in ~/.darcs/cache/). • The advantage of this approach is that the code is more cleaner and faster (not sure if significantly faster), because we don't need to look for patches at multiple locations. • The disadvantage is that the user will start with an empty cache again. Although we can create a command that is responsible for moving the old cache files to the new format. 2. The other way is to read always both caches. The code of this version a little more complicated because it need to read in several locations. But the user cache remains intact. Different versions of darcs use different global caches: • 2.9.9 (+45 patches) (last development version): this version can read the caches in ~/.darcs/cache/ and ~/.cache/darcs/ (new cache). In addition, each time the old cache is used, the files are linked with the new cache. However this new cache is not bucketed. • 2.8.4 (the latest stable release): used by end users, only uses the cache in ~/.darcs/cache/. The patch in http://bugs.darcs.net/msg17565 change the code of the version 2.9.9 so that, when the old cache is used, darcs link the files read to the new bucketed cache in ~/.cache/darcs/. Also it provides a new command (darcs optimize cache) responsible for moving the files from old caches to the new bucketed cache. Test were performed to see if the bucketed version of the cache improved the performance in darcs commands like clone, but no significant difference was found. Global Garbage Collection This patch should grant mechanisms to the user in order to reduce the size of the global cache according to its needs. By now this patch only count the number of hard links of the files in the global cache. If a file has only one link, it's deleted. This patch hasn't been sent to screened yet. ## July 15, 2014 ### Ale Gadea #### Month of June July 15, 2014 01:43 AM UTC Here goes a little summary of what I been doing between late june (9~21) and early july (1~11). First and easy, I have been documenting Darcs.misplacedPatches (old name chooseOrder), D.P.W.Ordered and D.P.W.Sealed. Something to comment is that the semantics of misplacedPatches, not always can clean a tag doing darcs optimize reorder. For example; Suppose we have a repository, r_1 with the following patches; r_1 = t_{1,0} p_{1,0} t_{1,1} here all tags are clean, but if we make another repository, say r_2, and we pull from r_1 of the following way \$$ darcs pull -a -p$p_{1,0}r_1$(we want to pull the patch$p_{1,0}$, we assume that the name of the patch is$p_{1,0}$for the matching with -p option)$\ darcs pull -a $r_1$
so now we have,
$r_2$ $=$ $p_{1,0}$ $t_{1,0}$ $t_{1,1}$
and we see that $t_{1,0}$ is dirty. Doing darcs optimize reorder not reorder nothing. What is going on is that to know what reorder, misplacePatches takes the first tag, in our case $t_{1,1}$, and
"search" for what patches he don't tag. But $p_{1,0}$ and $t_{1,0}$ are tagged by $t_{1,1}$ so there is nothing to reorder despite $t_{1,0}$ is dirty. Therefore there is no way of clean $t_{1,0}$ because misplacePatches always takes the first tag, so if a tag is tagging one or more dirty tags, this tags never be available to get clean.
"Second", using the implementation of "reorder" one can get almost for free the option --reorder for the commands pull, apply and rebase pull. The behavior for the case of pull (for the others commands is the same basic idea) is that our local patches remain on top after a pull from a remote repository, e.i. suppose we have the followings $l$(ocal) and $r$(emote) repositories,
$l$ $=$ $p_1$ $p_2$ $\ldots$ $p_n$ $lp_{n+1}$ $\ldots$ $lp_m$
$r$ $=$ $p_1$ $p_2$ $\ldots$ $p_n$ $rp_{n+1}$ $\ldots$ $rp_k$
where $lp$ are the local patches that don't belong to $r$, and vice versa for $rp$. Make darcs pull, leaves $l$ as follow,
$l$ $=$ $p_1$ $p_2$ $\ldots$ $p_n$ $lp_{n+1}$ $\ldots$ $lp_m$ $rp_{n+1}$ $\ldots$ $rp_k$
meanwhile make darcs pull --reorder, leaves $l$,
$l$ $=$ $p_1$ $p_2$ $\ldots$ $p_n$ $rp_{n+1}$ $\ldots$ $rp_k$ $lp_{n+1}$ $\ldots$ $lp_m$
making more easy to send the $lp$ patches later.
"Third", beginning a new task, implement option minimize-context for command darcs send. Still no much to comment, I have almost finished implementing the option but with some doubts, I hope that for the end of the week have a more "prettier" implementation as well as a better understanding.
## July 04, 2014
### the Patch-Tag blog
#### Patch-tag is shutting down on August 4 2014. Please migrate repos to hub.darcs.net.
July 04, 2014 07:24 PM UTC
Patch-tag users:
I have made the decision to shut down patch tag.
I’ve taken this step because I have stopped developing on patch tag, the site has a material time and money cost, and the technical aspects that made it a valuable learning experience have decreased to the point that I have hit diminishing returns.
The suggested continuity path is to move repos to Simon Michaels’s excellent hub.darcs.net.
To end on a positive note, I would like to say: no regrets! Creating patch tag was a definite high point of my career, opened valuable doors, and engendered even more valuable partnerships and collaborations. To my users and everyone who has helped, you are awesome and it was a lot of fun seeing the repos come online.
I may write a more in depth post mortem at a later time, but for now I just wanted to make a public statement and nudge remaining users to take appropriate action.
If there is anybody that would like to take over patch tag operations to keep the site going, I am open to handing over the reins so don’t be shy. I floated this offer among some private channels in the darcs community a while back, and the response then was… not overwhelming. But maybe the public announcement will bring in some new blood.
Thanks for using patch tag.
Happy tagging,
Thomas Hartman
## June 25, 2014
### Darcs News
#### darcs news #104
June 25, 2014 04:59 AM UTC
### News and discussions
1. Google Summer of Code 2013 has begun! BSRK and José will post updates on their blogs:
### Issues resolved (8)
issue2227 Ganesh Sittampalam
issue2248 Ganesh Sittampalam
issue2311 Sebastian Fischer
issue2312 Sebastian Fischer
issue2320 Jose Luis Neder
issue2321 Jose Luis Neder
### Patches applied (20)
See darcs wiki entry for details.
#### darcs news #105
June 25, 2014 04:58 AM UTC
### News and discussions
1. This year's Google Summer of Code projects brought a lot of improvements to darcs and its ecosystem!
• José Neder: patience diff, file move detection, token replace detection:
3. We listed the changes that occurred between version 2.8.4 and the current development branch into a 2.10 release page:
### Issues resolved (8)
issue346 Jose Luis Neder
issue1828 Guillaume Hoffmann
issue2181 Guillaume Hoffmann
issue2309 Owen Stephens
issue2313 Jose Luis Neder
issue2334 Guillaume Hoffmann
issue2343 Jose Luis Neder
issue2347 Guillaume Hoffmann
### Patches applied (39)
See darcs wiki entry for details.
#### Darcs News #106
June 25, 2014 04:58 AM UTC
### News and discussions
1. Darcs is participating once again to the Google Summer of Code, through the umbrella organization Haskell.org. Deadline for student application is Friday 21st:
2. It is now possible to donate stock to darcs through the Software Freedom Conservancy organization. Donations by Paypal, Flattr, checks and wire transfer are still possible:
3. Dan Licata wrote a presentation about Darcs as a higher inductive type:
4. Darcs now directly provides import and export commands with Git. This code was adapted from Petr Rockai's darcs-fastconvert, with some changes by Owen Stephen from his Summer of Code project "darcs-bridge":
### Issues resolved (6)
issue642 Jose Luis Neder
issue2209 Jose Luis Neder
issue2319 Guillaume Hoffmann
issue2332 Guillaume Hoffmann
issue2335 Guillaume Hoffmann
issue2348 Ryan
### Patches applied (34)
See darcs wiki entry for details.
#### Darcs News #107
June 25, 2014 04:57 AM UTC
### News and discussions
1. Darcs has received two grants from the Google Summer of Code program, as part of the umbrella organization Haskell.org. Alejandro Gadea will work on history reordering:
2. Marcio Diaz will work on the cache system:
3. Repository cloning to remote ssh hosts has been present for years as darcs put. This feature has now a more efficient implementation:
### Issues resolved (11)
issue851 Dan Frumin
issue1066 Guillaume Hoffmann
issue1268 Guillaume Hoffmann
issue1987 Marcio Diaz
issue2345 Dan Frumin
issue2357 Dan Frumin
issue2365 Guillaume Hoffmann
issue2367 Guillaume Hoffmann
issue2379 Guillaume Hoffmann
### Patches applied (41)
See darcs wiki entry for details.
#### Darcs News #108
June 25, 2014 04:57 AM UTC
### News and discussions
2. Marcio Diaz about the cache system:
3. Incremental fast-export is now provided to ease maintenance of git mirrors:
### Issues resolved (8)
issue2314 Benjamin Franksen
issue2364 Sergei Trofimovich
issue2364 Sergei Trofimovich
issue2388 Owen Stephens
issue2394 Guillaume Hoffmann
issue2396 Guillaume Hoffmann
### Patches applied (39)
See darcs wiki entry for details.
## June 12, 2014
#### Third Week (02-06 june)
June 12, 2014 04:58 PM UTC
Well, well... Now with the solution already implemented here are a couple of time tests that show the improvement.
For the repository of the issue2361:
Before patch1169
"let it run for 2 hours and it did not finish"
After patch1169
real 0m5.929s
user 0m5.683s
sys 0m0.260s
For the repository generated by forever.sh, that in summarize has 12600~ patches, a bundle unrevert and doing reorden implies move 1100~ patches forward passing by 11500~ patches.
Before patch1169
(Interrupted!)
real 73m9.894s
user 71m28.256s
sys 1m11.439s
After patch1169
real 2m23.405s
user 2m17.347s
sys 0m6.030s
The repository generated by bigRepo.sh has 600~ patches, with only one tag and a very small bundle unrevert.
Before patch1169
real 0m34.049s
user 0m33.386s
sys 0m0.665s
After patch1169
real 0m1.053s
user 0m0.960s
sys 0m0.152s
One last repository generated by bigUnrevert.sh, has 13 patches and a really big bundle unrevert (~10MB).
Before patch1169
real 0m1.304s
user 0m0.499s
sys 0m0.090s
After patch1169
real 0m0.075s
user 0m0.016s
sys 0m0.011s
The repository with more examples is in here: ExamplesRepos.
## June 05, 2014
#### Second Week (26-30 may)
June 05, 2014 06:47 PM UTC
Luckily, this week with Guillaume we found a "solution" for the issue 2361. But before of entering in details, let's review how the command darcs optimize --reorder does for reorder the patches.
So, suppose we have the following repositories than, reading it from left to right we have the first patch till the last patch, besides with $p_{i,j}$ we denote the $i$-th patch who belongs to the $j$-th repository, and when we want to specify that a patch $p_{i,j}$ is a tag we write $t_{i,j}$.
$r_1$ $=$ $p_{1,1}$ $p_{2,1}$ $\ldots$ $p_{n,1}$ $p_{n+1,1}$ $\ldots$ $p_{m,1}$
$r_2$ $=$ $p_{1,1}$ $p_{2,1}$ $\ldots$ $p_{n,1}$ $p_{1,2}$ $\ldots$ $p_{k,2}$ $t_{1,2}$ $p_{k+1,2}$ $\ldots$ $p_{l,2}$
where the red part represent when $r_2$ was cloned from $r_1$, and the rest is how each repository was evolved. Now, suppose we make a merge of $r_1$ and $r_2$ in $r_1$ making a bundle of the patches of $r_2$ and appling it in $r_1$. Thus, after the merge we have that
$r_1$ $=$ $p_{1,1}$ $p_{2,1}$ $\ldots$ $p_{n,1}$ $p_{n+1,1}$ $\ldots$ $p_{m,1}$ $p_{1,2}$ $\ldots$ $p_{k,2}$ $t_{1,2}$ $p_{k+1,2}$ $\ldots$ $p_{l,2}$
and we found the situation where the tag $t_{1,2}$ is dirty because the green part is in the middle. And now we are in conditions of finding out how darcs does the reorder of patches.
So, the first task is to select the first tag seeing $r_1$ in the reverse way, suppose $t_{1,2}$ is the first (ie, $p_{k+1,2}$ $\ldots$ $p_{l,2}$ are not tags), and split the set of patches (the repository) in
$ps_{t_{1,2}}$ $=$ $p_{1,1}$ $p_{2,1}$ $\ldots$ $p_{n,1}$ $p_{1,2}$ $\ldots$ $p_{k,2}$ $t_{1,2}$
and the rest of the patch set,
$rest$ $=$ $p_{n+1,1}$ $\ldots$ $p_{m,1}$ $p_{k+1,2}$ $\ldots$ $p_{l,2}$
this is done by splitOnTag, which I don't totally understand yet, so for the moment... simply do the above :) Then, the part that interest us now is $rest$, we want to delete all the patches of $rest$ that exist in $r_1$ and then add them again, causing that they show up to the right. This job is done by tentativelyReplacePatches, which first calls tentativelyRemovePatches and then calls tentativelyAddPatches.
So, tentativelyRemovePatches of $r_1$ and $rest$ makes,
$r_{1}'$ $=$ $p_{1,1}$ $p_{2,1}$ $\ldots$ $p_{n,1}$ $p_{1,2}$ $\ldots$ $p_{k,2}$ $t_{1,2}$
and, tentativelyAddPatches of $r_{1}'$ and $rest$,
$r_{1}''$ $=$ $p_{1,1}$ $p_{2,1}$ $\ldots$ $p_{n,1}$ $p_{1,2}$ $\ldots$ $p_{k,2}$ $t_{1,2}$ $p_{n+1,1}$ $\ldots$ $p_{m,1}$ $p_{k+1,2}$ $\ldots$ $p_{l,2}$
leaving $t_{1,2}$ clean.
Well, all of this was for understanding the "solution" for the issue, we are almost there but before let's look at the function tentativelyRemovePatches. It attempts to remove patches with one special care: when one does darcs revert, a special file is generated, called unrevert in _darcs/patches, which is used for darcs unrevert in case that one makes a mistake with darcs revert. One important difference with unrevert is that unlike all the other files in _darcs/patches, unrevert in not a patch but a bundle, that contains a patch and a context. This context allows to know if the patch is applicable. So when one removes a patch (running for example oblitarete, unrecord or amend) that patch has to be removed from the bundle-revert (bundle of the file _darcs/patches/unrevert). It's now always possible to adjust the unrevert bundle, in which case, the operation continues only if the user agrees to delete the unrevert bundle.
But now a question emerge. Is it necessary to accommodate the bundle-revert in the case of reorder?; the answer is no, and it's because we don't delete any patch of $r_1$ so we still can apply the bundle-revert in $r_{1}''$.
So, finally! we find out that for reorder we need a special case of removing, which doesn't try to update the unrevert bundle. And this ends up being the "solution" for the issue, since the reorder blocks in that function. But! beyond this solves the issue something weird is happening, that is the reason of the double quotes for solution :)
This is more o less the step forward for now. The tasks ahead are, documenting the code in various parts and make the special case for the function tentativelyRemovePatches. On the way I will probably understand more about some of the functions that I mention before so probably I will add more info and rectify whatever is needed.
## June 03, 2014
#### Google Summer of Code 2014 - Darcs
June 03, 2014 06:46 PM UTC
Hi hi all!
I have been accepted in the GSoC 2014 :) , as part of the work I'll be writing about my progress. The original plan is have a summary per week (or at least I hope so jeje).
I have already been reading some of the code of darcs and fixing some issues;
Issue 2263 ~ Patch 1126
Issue 1416 ~ Patch 1135
- Issue 2244 ~ Patch 1147 (needs-screening) (not any more $\ddot\smile$)
The details about the project is in History Reordering Performance and Features. Also some issues about the project are;
Issue 2361
Issue 2044
Cheers!
#### First Week (19-23 may)
June 03, 2014 06:42 PM UTC
Sadly, a first slow week, I lost the monday with problems with my notebook for which I have to reinstall ghc, cabal, all the libraries, etc.. but! in the end this helped :)
The list of taks of the week include:
1. Compile and run darcs with profiling flags
2. Write scripts to generate dirty-tagged big repositories
3. Check memory usage with hp2any for the command optimize --reorder for the
generated repositories and repo-issue2361
4. Check performance difference with and without patch-index
5. Document reorder implementation on wiki
6. Actually debug/optimize reorder of issue2361 (Stretch goal)
1. Compile and run darcs with prolfiling flags
This seems pretty easy at first, but turned somewhat annoying because one have to install all the libraries with the option profiling. So a mini-step-by-step of the my installation of darcs with profiling
flags is (i'm using ubuntu 14.04, ghc-7.6.3 and cabal-install-1.20.0.2) :
- Install ghc-prof package, in my case with sudo apt-get install ghc-prof
- Install depencencies of darcs with enable-library-profiling, doing:
- \$ cabal install LIB --enable-library-profiling ( for each library :) )
- or setting in ~/.cabal/config, library-profiling: True
- Finaly install darcs with enable-library-profiling and enable-executable-profiling
2. Write scripts to generate dirty-tagged big repositories
About this no much to say, I did some libraries to make the scripts that generates the repositories more straightforward. And I wrote some examples, but still in search of interesting examples. A long the week probably I will add examples, hopefully interesting.
3, 4 and 5 all together and mixed
Now, when finally start to generate the examples repositories and play with hp2ps to check differents things, I started to think about others things and I ended up studing the implementation of the command optimize --reorder, in particular I start to write a version which print some info during the ordering of patches, but for now is very dirty implementation.
## April 27, 2014
### Marcio Diaz
#### GSoC Progress Report #1: Complete Repository Garbage Collection
April 27, 2014 05:06 AM UTC
In my first week I worked on completing the garbage collection for repositories.
Darcs stores all the information needed under _darcs directory. In this part of the project we are only interested in the files stored in three directories:
• _darcs/patches/: stores the patches.
• _darcs/pristine.hashed/: stores the last saved state of working copy.
• _darcs/inventories/: stores the inventories (lists of patches).
While working on a project under version control, these directories grow in size.
Every time we record a new patch:
• A new inventory file is stored in _darcs/inventories/ containing the augmented list of patches. Now, the old inventory file (without the new patch) is no longer needed (this is true in most cases).
• A new patch file is stored in darcs/patches/. If we later unrecord this patch, the patch file is no longer needed.
• The same happens with _darcs/pristine.hashed/.
So, why do we keep these files if we no longer need them? Well, that’s because darcs wants to be fast and does not delete these files over time. Also it’s because if the repository is public and someone is cloning it, you don’t want to have some files disappearing in the process.
Darcs, using "darcs optimize" command, only knows how to clean up the _darcs/pristine.hashed directory. Until now, the only way to clean the other two directories was doing a "darcs get". With the changes introduced, now "darcs optimize" also clean these directories.
Algorithms:
The implemented algorithm was pretty straightforward, in pseudo-code:
- inventory = _darcs/hashed_inventory
- while (inventory)
- useful_inventories += inventory
- inventory = next_inventory(inventory)
- remove files not in useful_inventories.
- inventory = _darcs/hashed_inventory
- while (inventory)
- useful_patches += get_patches(inventory)
- inventory = next_inventory(inventory)
- remove files not in useful_patches.
We can see that we travel the inventory list twice, one for inventories and one for the patches. Although this is not optimal, I think it is more modular, since now we have a function that gets the list of patches.
Commands affected:
- darcs optimize
Use cases:
It is useful when you need to free memory on your hard disk.
For example:
- Record a new patch.
- Unrecord the new patch.
- Run optimize for garbage collecting the unused files corresponding to the unrecorded patch. Details in: http://pastebin.com/vYHiYV0F
You can find more use cases in the regression test script:
Issues solved:
Patches created:
http://bugs.darcs.net/patch1134.
## April 26, 2014
### Marcio Diaz
#### GSoC project accepted
April 26, 2014 09:36 PM UTC
I was accepted for the Google Summer of Code 2014. I'll be working for Haskell.org and my project will focus on improvements of Darcs version control system.
The project consists on several parts:
1. Complete garbage collection for repositories.
2. Bucketed global cache.
3. Garbage collection of global cache.
4. Investigate and implement darcs undo command.
5. Investigate and implement darcs undelete command.
Here is a detailed description of my project proposal: http://darcs.net/GSoC/2014-Hashed-Files-And-Cache.
I'll try to give weekly updates of how my work is going, and let you know about the problems and solutions that I find in my way.
Thanks Haskell.org, thanks Darcs and last but not least thanks Google for giveng us this awesome opportunity.
## November 03, 2013
### Simon Michael
#### darcsum 1.3
November 03, 2013 07:38 PM UTC
• Fix a hang when reverting, when darcs responds with “Will not ask whether to revert this already decided patch…”.
• Fixed an error in at least my local darcsum, which caused it to break when darcsum-debug was enabled.
• Fixed the four warnings my emacs gave when byte-compiling it. These fixes could use some testing.
• Reviewed the status and backlog. Last release was 2010, the ELPA package dates from 2012, there’s a bunch of unreleased fixes, the site script needs updating for hakyll 4, the project still needs a maintainer.
And since I came this far, I’ll tag and announce darcsum 1.3. Hurrah!
This release includes many fixes from Dave Love and one from Simon Marlow. Here are the release notes.
Site and ELPA package updates will follow asap. All help is welcome.
## September 26, 2013
### Simon Michael
#### darcsden/darcs hub GSOC complete
September 26, 2013 11:48 AM UTC
Aditya BSRK’s darcsden-improvement GSOC has concluded, and I’ve recently merged almost all of the pending work and deployed it on darcs hub.
You can always see the recently landed changes here, but let me describe the latest features a little more:
File history - when you browse a file, there’s a new “file changes” button which shows just the changes affecting that file.
File annotate - there’s also a new “annotate” button, providing the standard view showing which commit last touched each line of the file. (also known as the blame/praise feature). It needs some CSS polish but I’m glad that the basic side-by-side layout is there.
More reliable highlighting while editing - the file editor was failing to highlight many common programming languages - this should be working better now. (Note highlighting while viewing and highlighting while editing are independent and probably use different colour schemes, this is a known open wishlist item.)
Repository compare - when viewing a repo’s branches, there’s a new “compare” button which lets you compare (and merge from) any two public repos on darcs hub, showing the unique patches on each side.
Cosmetic fixes - various minor layout and rendering issues were fixed. One point of discussion was whether to use the two-sided layout on the repo branches page as well. Since there wasn’t time to make that really usable I vetoed it in favour of the less confusing one-sided layout. I think showing both sides works well on the compare page though.
Patch bundle support - the last big feature of the GSOC was patch bundles. This is an alternative to the fork repo/request merge workflow, intended to be more lightweight and easy for casual contributors. There are two parts. First, darcs hub issue trackers can now store darcs patch bundle files (one per issue I think). This means patches can be uploaded to an issue, much like the current Darcs issue/patch tracker. But you can also browse and merge patches directly from a bundle, just as you can from another repo.
The second part (not yet deployed) is support for a previously unused feature built in to the darcs send command, which can post patches directly to a url instead of emailing them. The idea (championed by Aditya and Ganesh) is to make it very easy for someone to darcs send patches upstream to the project’s issue tracker, without having to fork a repo, or even create an account on darcs hub. As you can imagine, some safeguards are important to avoid becoming a spam vector or long-term maintenance headache, but the required change(s) are small and I hope we’ll have this piece working soon. It should be interesting to have both workflows available and see which works where.
I won’t recap the older new features, except to say that pack support is in need of more testing. If you ever find darcs get to be slow, perhaps you’d like to help test and troubleshoot packs, since they can potentially make this much faster. Also there are a number of low-hanging UI improvements we can make, and more (relatively easy) bugs keep landing in the darcs hub/darcsden issue tracker. It’s a great time to hack on darcs hub/darcsden and every day make it a little more fun and efficient to work with.
I really appreciate Aditya’s work, and that of his mentor, Ganesh Sittampalam. We did a lot of code review which was not always easy across a large time zone gap, but I think the results were good. Congratulations Aditya on completing the GSOC and delivering many useful features, which we can put to good use immediately. Thanks!
## September 20, 2013
### Jose Luis Neder
#### Automatic detection of replaces for Darcs - Part 1
September 20, 2013 03:25 PM UTC
In the last post i show some examples and use cases of the "--look-for-replaces" flag for whatsnew, record, and amend-record commands in Darcs. When used, this flag provides automatic detection of replaces(possible ones), even when the modified files shows more differences than only the replaces, and even shows possible "forced" replaces.
The simplest case is when you made a replace in you editor in of choice and don't do any other change to the file and then, after check all is ok, remember that you could have used a replace patch.
file before:
line1 foo
line2 foo
line3 foo
file after:
line1 bar
line2 bar
line3 bar
> darcs revert -a file
Reverting changes in "file":
Finished reverting.
> darcs replace foo bar file
> darcs record -m "replace foo bar"
replace ./file [A-Za-z_0-9] foo bar
Shall I record this change? (1/1) [ynW...], or ? for more options: y
Do you want to record these changes? [Yglqk...], or ? for more options: y
Finished recording patch 'replace foo bar'
You could do:
> darcs record --look-for-replaces -m "replace foo bar"
replace ./file [A-Za-z_0-9] foo bar
Shall I record this change? (1/1) [ynW...], or ? for more options: y
Do you want to record these changes? [Yglqk...], or ? for more options: y
Finished recording patch 'replace foo bar'
But it doesn't have to be a full replace. For instance, if you don't want to change a pair replaces, when you try to detect the changes instead of:
file before:
line1 foo
line2 foo
line3 foo
line4 foo
file after:
line1 bar
line2 bar
line3 bar
line4 foo
> darcs whatsnew
hunk ./file 1
-line1 foo
-line2 foo
-line3 foo
+line1 bar
+line2 bar
+line3 bar
With the new flag you could record this:
> darcs whatsnew --look-for-replaces
replace ./file [A-Za-z_0-9] foo bar
hunk ./file 4
-line4 bar
+line4 foo
Say you replace a word for another word that was already in the file. Normally this would mean that you should use "darcs replace --force". The look-for-replaces flag always "forces" the replaces, so if you try this, the changes to make the replace reversible will be shown before the replace patch:
file before:
line1 foo
line2 foo
line3 foo
line4 bar
file after:
line1 bar
line2 bar
line3 bar
line4 bar
With the new flag you will see the same patches like if you have made a "darcs replace --force foo bar file":
> darcs whatsnew --look-for-replaces
hunk ./file 4
-line4 bar
+line4 foo
replace ./file [A-Za-z_0-9] foo bar
Given certain limitations you could have any number of replaces detected, like this:
file before:
foo foo2 foo3
fee fee2 fee3
file after:
bar bar2 bar3
bor bor2 bor3
All the replaces are shown below:
> darcs whatsnew --look-for-replaces
replace ./file [A-Za-z_0-9] fee bor
replace ./file [A-Za-z_0-9] fee2 bor2
replace ./file [A-Za-z_0-9] fee3 bor3
replace ./file [A-Za-z_0-9] foo bar
replace ./file [A-Za-z_0-9] foo2 bar2
replace ./file [A-Za-z_0-9] foo3 bar3
If you want to know more about the limitations of this functionality, check Automatic detection of replaces for Darcs - Part 2.
#### Automatic detection of replaces for Darcs - Part 2
September 20, 2013 09:08 AM UTC
The last weeks i was implementing "--look-for-replaces" flag for whatsnew, record, and amend-record commands in Darcs. When used, this flag provides automatic detection of replaces(possible ones) even when the modified files shows more differences than only the replaces, given they meet the following prerequisites:
1. For a given "word" and a given file, there is not need for all the instances to be replaced, but there must be only one replace suggestion posible. i.e.:
this is ok:
file before:
foo
foo
foo
file after:
foo
bar
bar
this is not detected:
file before:
foo
foo
foo
file after:
foo
bar
bar2
2. The replace must happen in lines that have the same amount of words between the recorded and the working state, otherwise it would not be detected.
this is ok:
file before:
foo
foo
foo
file after:
foo roo
bar fee
bar
this is not detected(i don't know which is to detect anyway):
file before:
figaro foo
figaro foo
figaro foo
file after:
figaro foo
figaro bar bee
figaro foo bar
3. There must be at least one hunk with the same amount of lines in the - and + side that contains the replace.
this is not detected:
file before:
line1 foo
line2 foo
line3 foo
file after:
line1 bar
line2or3 bar
It would not detect this replace, even if it is a "perfect" replace, because it does not have the same number of lines, and is not trivial to tell which line is the one "modified" and which one is the one "deleted".
For more details about the implementation you could look on the look-for-replaces wiki page
#### Automatic detection of file renames for Darcs - Part 2
September 20, 2013 09:07 AM UTC
In the last few weeks i was refining the automatic detection of file renames implementation adding support for windows, and support for more complicated renames.
Now if you like you can consult the inode information saved in the index at any time with "darcs show index":
⮁ darcs init
⮁ mkdir testdir
⮁ touch testfile
⮁ darcs record -al -m "test files"
Finished recording patch 'test files'
⮁ ls -i1d . testdir testfile
2285722 .
2326707 testdir
2238437 testfile
⮁ darcs show index
07ec6ccf873cf215ac0789a420f154ba9218b7ca5c4fce432584edab49766a7c 2285722 ./
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 2326707 testdir/
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 2238437 testfile
Now with the new dependency algorithm, you can make more complicated renames, like exchange of filenames, folder moves. The algorithm don't manage exchange of filenames inside of a folder that have been renamed exchanging names, anything else is managed fine.
For example:
⮁ ls -1pC
_darcs/ dir/ dir2/ dir3/ foo foo2 foo3 foo4 foo5
⮁ mv foo dir3
⮁ mv foo2 dir
⮁ mv foo3 dir2
⮁ mv foo4 foo4.tmp
⮁ mv foo5 foo4
⮁ mv foo4.tmp foo5
⮁ mv dir3 dir
⮁ mv dir dir2/dir2
⮁ mv dir2 dir
⮁ darcs whatsnew --look-for-moves
move ./dir ./dir2/dir2
move ./dir2 ./dir
move ./dir3 ./dir/dir2/dir3
move ./foo ./dir/dir2/dir3/foo3
move ./foo2 ./dir/dir2/foo2
move ./foo3 ./dir/foo3
move ./foo4 ./foo4.tmp~
move ./foo5 ./foo4
move ./foo4.tmp~ ./foo5
The moves shown by "darcs whatsnew --look-for-moves" are not exactly the ones made but yield the same final result.
## August 14, 2013
### Jose Luis Neder
#### Automatic detection of file renames for Darcs
August 14, 2013 04:29 AM UTC
In the last few weeks i was implementing automatic detection of file renames adding "look-for-moves" flag to the amend-record, record, and whatsnew commands.
In darcs are 3 states:
• The recorded state is the one is marked by the last record made.
• The working state is the actual state of the files in the repository with all the last changes.
• The pending state is the one that mark changes like file adds, moves, replaces, etc, before they are recorded. Is a temporal state between recorded and working that let darcs know about what filenames to track, and changes that are not common like replaces.
If a file rename is not marked in the pending state, darcs lost track of the file and can't know where it is, and then darcs whatsnew and darcs record will indicate the file as deleted.
To detect this file rename I choose to use the inode info in the filesystem to check for equality between different filenames in the recorded and working state of the repo. for those who don't know, the inode is an index number assigned by the file system to identify a specific file data. The file name is linked to the data by this number, and it's used by directories as well. You can consult this number with "ls -i".
⮁ mkdir testdir
⮁ touch testfile
⮁ ls -i1
10567718 testdir
10485776 testfile
You can see that the hardlink shares the same number with the test file, this is because a file is essentially a hardlink to the file data and when you make a new hardlink you are sharing the same file data, so the same inode number.
To have an old inode to filename mapping, there must be some record of the files inodes in some place, so I added the inode info to the index of hashed-storage in _darcs/index. The index save the last info about the record plus the pending state, sort of, so is a perfect fit to save this info.
Then comparing the RecordedAndPending Tree(from the index) with the Working Tree i get the file changes in a pair list mapping between the two states. With this list I resolve dependencies between the different moves, making temporal names if it's necessary and generating a FL list of move patches to merge with the changes between pending and working patches.
This patches are shown in with whatsnew or are selected with record/amend-record to be recorded in the repo.
There is a little more to make this happen but that's the core idea of the implementation.
The algorithm doesn't care if the file are modified or not, because it doesn't care of the content of the files, so it's very robust in that sense.
With this implementation you could do any move directly with "mv", and is very lightweight and fast in detecting moves so is likely a good decision make "--look-for-moves" a default flag. You could do things like this:
⮁ darcs init
Repository initialized.
touch foo
mv foo foo2
darcs whatsnew --look-for-moves
move ./foo ./foo2
This doesn't work on Windows yet, because fileID(the function on unix-compat that get the inode number) is lacking an implementation on windows. I know the windows API have GetFileInformationByHandle (it returns a BY_HANDLE_FILE_INFORMATION structure that contains the file index number[1]), so there doesn't have to be too hard to add an implementation of it with some boilerplate code to make the interface.
More complicated moves should work and some does but I was having problems with the dependency resolving algorithm implementation. I made some mistakes in the first implementation and I'm dragging them since then. I'm confident to know what is the error so I will fix it soon.
UPDATE: i'm testing a windows implementation with the Win32 haskell library on a virtual machine.
## August 09, 2013
### Simon Michael
#### darcs hub, hledger, game dev
August 09, 2013 10:01 AM UTC
Hello blog. Since last time I’ve been doing plenty of stuff, but not telling you about it. Let’s do a bullet list and move on..
darcsden/darcs hub
hledger
• expanded the docs for conditional blocks (if statement) in CSV rules
• added an include directive to allow sharing of common CSV rules
FunGEn & game dev
A sudden burst of activity here.
• schmoozed in #haskell-game, got caught up on haskell game development, updated the Games wiki page a bit
• updated and published my template for SDL projects on OSX: hssdl-osx-template
• continued some FunGEn updates I’ve been sitting for a year and did a release - see next post.
## July 24, 2013
### Simon Michael
#### darcs hub repo stats, hledger balance sheet
July 24, 2013 02:50 AM UTC
Recent activity:
I fixed another clumsy query on darcs hub, making the all repos page faster. Experimented with user and repo counts on the front page. I like it, but haven’t deployed to production yet. It costs about a quarter of a second in page load time (one 50ms couch query to fetch all repos, plus my probably-suboptimal filtering and sorting).
I’ve finally learned how many of those names on the front page have (public) repos behind them (144 out of 319), and how many private repos there are (125, higher than expected!).
Thinking about what is really most useful to have on the front page. Keep listing everything ? Just top 5 in various categories ? Ideas welcome.
Did a bunch of bookkeeping today, which inspired my first hledger commit in a while. I found the balancesheet command (abbreviation: bs) highly useful for a quick snapshot of assets and liabilities to various depths (add –depth N). The Equity section was just a distraction though, and I think it will be to most hledger users for the time being, so I removed it.
## July 23, 2013
### Simon Michael
#### hub hacking
July 23, 2013 12:30 AM UTC
More darcs hub activity, including some actual app development (yay):
Cleaned up hub’s docs repo and updated the list of blockers on the roadmap.
Updated/closed a number of issues, including the app-restarting #58, thanks to a fast highlighting-kate fix by John McFarlane.
Tested and configured the issue-closing commit posthook in the darcsden trunk repo. Commits pushed/merged there whose message contains the regex (closes #([0-9]+)|resolves #([0-9]+)|fixes #([0-9]+)) will now close the specified issue, with luck.
Consolidated a number of modules to help with code navigation, to be pushed soon.
Improved the redirect destination when deleting or forking repos or creating/commenting/closing issues.
Fixed a silly whitespace issue when viewing a patch, where the author name and date run together. I’m still confused about the specific code that generates this - the code I expect uses tables but firebug shows divs. A mystery for another day..
## July 22, 2013
### Simon Michael
#### hub speedups
July 22, 2013 12:30 AM UTC
More darcs hub hacking today.
• Cleaned up some button text & styles
• Started playing around with the front page layout to add a news box. Accidentally deployed it to production briefly. Used make undeploy-web for the first time.
• Extracted more of darcs hub’s front page into a separate (local) module, DarcsDen.Hub, for easier customisation.
• Worked on optimising page load speed, especially the front page:
• instead of rendering the front page content from markdown on each request, do it only when changed. This saved, oh a good 50ms! But I now have the beginnings of a timing utility.
• load the large codemirror js/css files only on the add/edit file pages
• set a 7-day Expires header on static images. This took about an hour. Here’s the code (based on Yesod’s), it might fit well in Snap.
• combine the remaining js/css into one js and one css. This is not committed, I just did it by hand. Try less later (only if it’s really simple).
YSlow now gives us an A grade (score 95), and it feels pretty quick. | 2014-09-18 23:44:53 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.39659199118614197, "perplexity": 4684.215343916409}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-41/segments/1410657129409.8/warc/CC-MAIN-20140914011209-00176-ip-10-196-40-205.us-west-1.compute.internal.warc.gz"} |
http://clay6.com/qa/18178/a-wire-loop-pqrsp-is-constructed-by-joining-two-semi-circular-coils-of-radi | # A wire loop PQRSP is constructed by joining two semi - circular coils of radii $'r_1'\: and \: 'r_2'$ respectively as shown in the figure. If the current flowing in the loop is $'i'$ , then the magnetic induction at the point $'O'$ is :
$\begin {array} {1 1} (1)\;\large\frac{\mu_0i}{4} \bigg[ \large\frac{1}{r_1}-\large\frac{1}{r_2} \bigg] & \quad (2)\;\large\frac{\mu_0i}{4} \bigg[ \large\frac{1}{r_1}+\large\frac{1}{r_2} \bigg] \\ (3)\;\large\frac{\mu_0i}{2} \bigg[ \large\frac{1}{r_1}-\large\frac{1}{r_2} \bigg] & \quad (4)\;\large\frac{\mu_0i}{2} \bigg[ \large\frac{1}{r_1}+\large\frac{1}{r_2} \bigg] \end {array}$
Ans : (1)
$\large\frac{\mu_0i}{4} \bigg[ \large\frac{1}{r_1}-\large\frac{1}{r_2} \bigg]$ | 2018-05-20 23:42:18 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7664345502853394, "perplexity": 291.32961170027784}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-22/segments/1526794863811.3/warc/CC-MAIN-20180520224904-20180521004904-00521.warc.gz"} |
https://cmc.deusto.eus/upper-bounds-for-the-decay-rate-in-a-nonlocal-p-laplacian-evolution-problem/ | Upper bounds for the decay rate in a nonlocal p-Laplacian evolution problem
C. Esteve, J.D. Rossi, A. San Antolín. Upper bounds for the decay rate in a nonlocal p-Laplacian evolution problem. BOUND VALUE PROBL (2014), pp. 109. DOI: 10.1186/1687-2770-2014-109
Abstract. We obtain upper bounds for the decay rate for solutions to the nonlocal problem tu(x,t)=RnJ(x,y)|u(y,t)u(x,t)|p2(u(y,t)u(x,t))dy with an initial condition u0L1(Rn)L(Rn) and a fixed p>2. We assume that the kernel J is symmetric, bounded (and therefore there is no regularizing effect) but with polynomial tails, that is, we assume a lower bounds of the form J(x,y)c1|xy|(n+2σ), for |xy|>c2 and J(x,y)c1, for |xy|c2. We prove that u(,t)Lq(Rn)Ctn(p2)n+2σ(11q) for q1 and t large. | 2021-10-25 00:35:36 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9556611180305481, "perplexity": 1779.7992303523886}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323587608.86/warc/CC-MAIN-20211024235512-20211025025512-00540.warc.gz"} |
https://math.stackexchange.com/questions/3090341/adding-independent-random-variables-given-their-individual-expectations-and-vari | # Adding Independent Random Variables Given Their Individual Expectations and Variance
How do I add or subtract independent random variables (R.Vs) when given their individual expectations and variance? I'm a student in high school and I haven't covered distributions yet, so please try not to use them.
Example, R.Vs A, B & C
Where
$$E(A)= 35\;\;\ Var(A)=8\\ E(B) = 25\;\;\;\; Var(B)=9\\$$
Calculate the expectation and variance of:
$$A + 2B$$
Let $$A$$ and $$B$$ be two random variables and $$c$$ be a constant. Then,
1. $$\mathbb{E}[A + cB] = \mathbb{E}[A] + c\mathbb{E}[B]$$ and
2. $$\operatorname{Var}(A + cB) = \operatorname{Var}(A) + c^2 \operatorname{Var}(B)$$ (assuming $$A$$ and $$B$$ are independent).
Variance is defined in terms of the expectation. In particular, $$\operatorname{Var}(X) = \mathbb{E}[(X - \mathbb{E}[X])^2]$$. See if you can use this definition to prove property (2) from property (1). | 2020-10-26 15:58:38 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 10, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8911707997322083, "perplexity": 114.60312817337574}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-45/segments/1603107891428.74/warc/CC-MAIN-20201026145305-20201026175305-00186.warc.gz"} |
https://www.hpmuseum.org/forum/showthread.php?mode=linear&tid=4152&pid=37358 | [WP 34s] Another noobie question about programming
06-14-2015, 04:07 PM (This post was last modified: 06-14-2015 04:27 PM by Marcio.)
Post: #1
Marcio Senior Member Posts: 438 Joined: Feb 2015
[WP 34s] Another noobie question about programming
I would like to integrate a function like $$f(x) = \frac{1}{x+a}$$ where $$a$$ is as large as 1000. Not knowing exactly how things worked in previous HP calcs, I naively typed 1500 for $$a$$ directly into the program, well, you know what happened.
The manual says that integers (say $$n$$) can be keyed in using the # symbol, however, it also states that $$0\leqslant n \leqslant 255$$. Now comes the noobie question:
Do I have to modify $$n$$ by assigning, for example, 250 to it and multiply by 6 to get 1500? Or I am missing something here?
Thank you
Marcio
EDIT: Alternatively, I could also assign a register to $$a$$ before using it in the program, in case $$a$$ is a prime number and greater than 255.
06-14-2015, 04:28 PM
Post: #2
Marcus von Cube Senior Member Posts: 760 Joined: Dec 2013
RE: [WP 34s] Another noobie question about programming
I see various ways to accomplish this:
1. You can just type the number into your program:
LBL 00
1
5
0
0
+
1/x
RTN
2. If your number is a multiple of 10 use:
LBL 00
# 150
SDL 1
+
1/x
RTN
3. The most flexible approach uses register 00 to hold a:
LBL 00
RCL+ 00
1/x
RTN
Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
06-14-2015, 04:40 PM
Post: #3
Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: [WP 34s] Another noobie question about programming
Yeap, storing $$a$$ and calling it from the program is the way to go.
Thanks.
« Next Oldest | Next Newest »
User(s) browsing this thread: 1 Guest(s) | 2021-12-04 20:49:20 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.22871142625808716, "perplexity": 5083.813175332841}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964363006.60/warc/CC-MAIN-20211204185021-20211204215021-00625.warc.gz"} |
http://swmath.org/?term=Laminar%20and%20turbulent%20flow | • # Kiva-2
• Referenced in 50 articles [sw08987]
• three-dimensional, chemically reactive fluid flows with sprays. KIVA-2 extends and enhances the earlier ... applied to laminar or turbulent flows, subsonic or supersonic flows, and single-phase or dispersed...
• # Fluid flow phenomena
• Referenced in 37 articles [sw15481]
• Fluid flow phenomena. A numerical toolkit. Incl. 1 disk. The main topic of the book ... dimensional incompressible Navier-Stokes equations in laminar and turbulent regimes. The author describes concrete links ... study of homogeneous and wall turbulent flows. The book includes large eddy simulation methodology since ... turbulent flows. The results for turbulent and laminar flows are discussed with particular emphasis...
• # Code_Saturne
• Referenced in 6 articles [sw06674]
• axisymmetric and 3D flows, steady or unsteady, laminar or turbulent, incompressible or weakly dilatable, isothermal ... with scalars transport if required. Several turbulence models are available, from Reynolds-Averaged models ... modeling, Joule effect, electrics arcs, weakly compressible flows, atmospheric flows, rotor/stator interaction for hydraulic machines...
• # N3S
• Referenced in 1 article [sw19667]
• turbulent flows in complex geometries. Because of the numerical behavior of turbulence models such ... range of 2D and 3D, laminar and turbulent, isothermal flows, computations involving the energy equation...
• # NSIKE
• Referenced in 6 articles [sw11777]
• gradient technique. In the case of turbulent flow simulations the wall-laws are used ... cavity, backward facing step, both in laminar and turbulent regime...
• # EURANUS
• Referenced in 8 articles [sw04088]
• Reynolds-averaged Navier-Stokes flows about complex geometries, being developed for the European Space Agency ... provided by either the Baldwin-Lomax turbulence model, or the $kappa-varepsilon$ model ... data. Two computed examples of viscous laminar hypersonic flow around the HERMES spaceplane provide...
• # P3D
• Referenced in 2 articles [sw11920]
• line remain surprisingly laminar, with no evidence of turbulence and associated anomalous resistivity or viscosity ... Neither the electron shear flow instabilities nor kink-like instabilities, which have been observed... | 2018-02-17 23:52:16 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.21162255108356476, "perplexity": 7473.147467823092}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-09/segments/1518891808539.63/warc/CC-MAIN-20180217224905-20180218004905-00797.warc.gz"} |
https://inbo.github.io/n2khab/index.html | Welcome
The n2khab R package provides preprocessing functions and standard reference data, supporting reproducible and transparent analyses on Flemish Natura 2000 (n2k) habitats (hab) and regionally important biotopes (RIBs).
The package’s core aim is to provide readily standardized (preprocessed) data in your R environment. This facilitates collaboration and reproducibility.
The standard reference data include: checklists, spatial habitat distribution, administrative & environmental layers, GRTSmaster_habitats.
Installing and using the n2khab package
To install the current package version from the master branch (latest stable release), run:
install.packages("n2khab", repos = c(inbo = "https://inbo.r-universe.dev",
CRAN = "https://cloud.r-project.org"))
The above provides a pre-compiled package for Windows and macOS, which should be faster than below approach. INBO staff should have the INBO repository enabled already (check with getOption("repos")), in which case install.packages("n2khab") is all you need!
If you want to install from the source repository, run:
Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS = "true") # as a precaution
remotes::install_github("inbo/n2khab",
build_vignettes = TRUE,
upgrade = TRUE)
Note that this will install the package from the master branch. If you need a version from another branch, add the ref argument in the above function to provide the branch name.
Repeat the installation when you wish to upgrade.
Have a look at the vignettes to quickly find your way!
help(package = "n2khab")
# vignettes only: browseVignettes("n2khab")
# documentation of whole package: package?n2khab
Data setup
Please take note that you must set up the needed data sources as explained in vignette("v020_datastorage") and demonstrated in vignette("v022_example"). There is a major distinction between:
• raw data (Zenodo-link), to be stored in a folder n2khab_data/10_raw;
• processed data (Zenodo-link), to be stored in a folder n2khab_data/20_processed.
Suppressing rgdal warnings about proj4string degradation
Setting coordinate reference systems (CRS) of geospatial R objects is taken care of by the package, in a way that is compatible with older and current versions of PROJ and GDAL backend libraries. This is done by gratefully implementing such features from the sf and sp packages. The functions never specify a CRS by means of a proj4string, which is an aged format not supported by the current backend versions.
Please note that nonetheless you will see warnings about degraded proj4strings when using certain n2khab functions or when converting resulting sf objects to sp objects. This is normal! It is the current default behaviour of rgdal to yield these warnings. However in the case of n2khab functions and resulting objects these warnings are trivial and unnecessary. You can suppress them in your R scripts by inserting below statement before loading geospatial packages:
options(rgdal_show_exportToProj4_warnings = "none")
You are welcome to contribute!
Please have a look at our contributing guide!
Intention for the future
At a later date, the intention is to incorporate functionality to enhance workflow reproducibility and ease the setup:
• let a user declare which versions of which data sources are used in an R workflow (at the beginning of a script or R markdown file);
• perform checks whether the needed versions of those data sources are locally present;
Currently these aspects must be taken care of in a more manual fashion. See vignette("v022_example") for example code to currently accomplish specific aspects.
The package is a companion to the n2khab-preprocessing repo. Beside direct preprocessing functions, n2khab provides several functions that return datasets, generated in n2khab-preprocessing, as standardized R-objects. Having processed datasets readily available is useful in the case of time-consuming calculations to produce them.
The data definitions & standard checklists (reference data) provided by the package are textual files in the vc-format. Some of them come over from another repository. Others may be written as the result of a synchronization script to give them a start. The code to reproduce these files is inside the misc folder of the source code. The package provides the necessary functions to return these as standardized tibbles (vignette("v010_reference_lists")). | 2022-09-27 14:19:12 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3105550706386566, "perplexity": 4771.237848354031}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030335034.61/warc/CC-MAIN-20220927131111-20220927161111-00586.warc.gz"} |
https://math.stackexchange.com/questions/2665862/sum-of-cube-roots-of-complex-conjugates | # Sum of cube roots of complex conjugates
When solving the following cubic equation:
$$x^3 - 15x - 4 = 0$$
I got one of the solutions:
$$x = \sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i}$$
When I calculated it with a hand calculator, it turned out to be exactly $4$. And indeed, when I substitute $x=4$ into the original equation, it is a solution. So this appears to be true:
$$\sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i} = 4$$
So we have a sum of cube roots of complex numbers which nevertheless happens to produce a real result. So I presume that these two cube roots must be complex conjugates of each other, which seems to be the case, judging by the fact that the numbers under the cube roots are complex conjugates of each other as well (note the signs I marked with red).
Complex conjugates are "mirror images" of each other, so when added up, they produce a real result.
Cube roots of complex conjugates divide their angles by 3, so the results should remain complex conjugates, and I suppose this is the reason why they add up to a real number as well. Am I right?
What bothers me, though, is how can we PROVE that identity with algebra?
Here's what I tried:
I cubed the equation:
$$x \;=\; \sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i} \;=\; 4\\ x^3 \;=\; \left( \sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i} \right)^3 \;=\; 4^3 \;=\; 64$$
expanded the middle one from the binomial theorem:
$$x^3 \;=\; \left(\sqrt[3]{2 {\color{red}+} 11i}\right)^3 + \left(\sqrt[3]{2 {\color{red}-} 11i}\right)^3 + 3\!\cdot\!\sqrt[3]{2 {\color{red}+} 11i}\!\cdot\!\sqrt[3]{2 {\color{red}-} 11i}\!\cdot\!\left(\sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i}\right) \;=\; 4^3 \;=\; 64\\ x^3 \;=\; 2 {\color{red}+} 11i + 2 {\color{red}-} 11i + 3\!\cdot\!\sqrt[3]{\left(2 {\color{red}+} 11i\right)\left(2 {\color{red}-} 11i\right)}\!\cdot\!\left(\sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i}\right) \;=\; 4^3 \;=\; 64\\ x^3 \;=\; 4 + 3\!\cdot\!\sqrt[3]{2^2 - (11i)^2}\!\cdot\!\left(\sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i}\right) \;=\; 4^3 \;=\; 64\\ x^3 \;=\; 4 + 3\!\cdot\!\sqrt[3]{4 + 121}\!\cdot\!\left(\sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i}\right) \;=\; 4^3 \;=\; 64\\ x^3 \;=\; 4 + 3\!\cdot\!\sqrt[3]{125}\!\cdot\!\left(\sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i}\right) \;=\; 4^3 \;=\; 64\\ x^3 \;=\; 4 + 3\!\cdot\!5\!\cdot\!\left(\sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i}\right) \;=\; 4^3 \;=\; 64\\ x^3 \;=\; 4 + 15\!\cdot\!\left(\sqrt[3]{2 {\color{red}+} 11i} + \sqrt[3]{2 {\color{red}-} 11i}\right) \;=\; 4^3 \;=\; 64$$
But now the expression that remained in parentheses is just the original $x$ I started with! When trying to find the answer, I run across the original question again :/ Not only that, but replacing it with $x$ gives me the original cubic equation I started with ;/
$$x^3 = 4 + 15x\\x^3 - 15x - 4 = 0$$
Why am I going in circles with this? And what other techniques can I use to crack this and prove that this sum of cube roots indeed equals to the real number $4$?
Inb4: I already ascertained geometrically that this sum of cubes is really equal to $4$, but now I'd like to have it proved algebraically, and learn a general method of dealing with such sums of cubes of complex conjugates.
Edit: All the answers so far seem to be based on the assumption that I know that this complex expression is equal to 2 already (e.g. by restoring the original cubic equation and finding its rational roots). What I'm rather interested in, is how to find the equivalent real solutions when restoring the original cubic equation doesn't work, because it cannot be solved by the rational roots theorem.
• It is possible for a cubic to be expressible in terms of radicals, but not to be expressible in terms of real radicals (see, e.g., this sci.math post). In fact, this is true of any cubic with three real irrational roots. That is, there is no general algebraic way to eliminate the complex numbers inside an expression of the form $\sqrt[3]{a+bi}+\sqrt[3]{a-bi}$, just the possibility of getting lucky in specific cases. – Micah Feb 25 '18 at 18:11
• For background information: en.wikipedia.org/wiki/Casus_irreducibilis . Seach for cubic casus irreducibilis for even more, and history. – Ethan Bolker Feb 25 '18 at 18:26
• Is there a particular format of nonrational answer you are looking for a solution to? (e.g. $a+\sqrt{b}+\sqrt[3]{c}$ for rational $a,b,c$) That might help people see if there is a method could still work for a nonrational case. – Mark S. Feb 26 '18 at 12:21
Just note that $(2+i)^3=2+11i$ and that $(2-i)^3=2-11i$. So, a natural choice is to do$$\sqrt[3]{2+11i}+\sqrt[3]{2-11i}=2+i+2-i=4.$$
• Yeah, it's cool when you know the right solution upfront. But what if you don't? If I gave you some other, less known sum of cube roots, I guess you will be none the wiser, because then you would have to guess the right number to be cubed to get the result. And this is exactly the root of the problem: how to calculate that number algebraically instead of guessing or telling the right answer from history. – BarbaraKwarc Feb 25 '18 at 11:24
• It's not so much of a guess. The norm of $2+11i$ is $125$, so you need a number with norm $5$. And $(2+i)$ fits the bill nicely. You can always write the number in polar form and see that the $i\sin \theta$'s cancel. – B. Goddard Feb 25 '18 at 12:40
Let's recall the derivation of the solution of the cubic equation $x^3+px+q=0$: We assume $x=u+v$, and get $$x^3+px+q=u^3+v^3+q+(3uv+p)(u+v).$$ So if we additionally assume $$3uv+p=0\tag1,$$ we must also have $$u^3+v^3+q=0\tag2,$$ and from (1) and (2) we easily get a quadratic equation for $u^3, v^3$. So $x$ is a sum of two cube roots, but those aren't independent, they must satisfy (1). In the complex case, there are 3 values for each cube root, giving 9 combinations, but (1) reduces that to 3 valid combinations. In your case, the other two valid combinations give the other two solutions of your cubic equation, both are real, too: $x=-2\pm\sqrt{3}$.
You get those from the quadratic equation $x^2+4x+1=0$, resulting from division of $x^3-15x-4$ by $x-4$.
• I know, I solved the cubic already, both ways. That's how I know that this sum of cube roots is also equal to 2. But if I gave you only the sum of the cube roots (not necessarily this particular one), how would you find out their sum then? :q Sure, you can restore the original equation (it comes out when you cube both sides, trying to simplify this sum of cube roots, as I showed), but then we're going in circles again. – BarbaraKwarc Feb 25 '18 at 12:16
• In this particular case, it is easy to find that this expression has to be equal to 2, by trying out the divisors of 4 in the restored cubic equation. But you won't be always so lucky. Try this one, for example: $x = \sqrt[3]{\frac{-1+i\sqrt{3}}{16}} + \sqrt[3]{\frac{-1-i\sqrt{3}}{16}}$. This number is real as well, but restoring the original cubic equation and solving it won't help you much to find it. – BarbaraKwarc Feb 25 '18 at 12:20
• @BarbaraKwarc Once again, not both of us move in circles: you give an expression having 9 different interpretations. Three of them are pairs of conjugates, so their sum will be real ($\cos\dfrac{2\pi}9, \cos\dfrac{8\pi}9, \cos\dfrac{14\pi}9$, I'd say). So which of those three values did you mean? – Professor Vector Feb 25 '18 at 12:37
• In the original question, I meant the $4$. In this particular question, I would have one of those cosines which the expression should be equal to (let's say the first cosine). But no matter which one you choose, the point still stands: you will be moving in circles when you try simplifying it by cubing both sides. You'll end up with the original cubic equation, which in this case won't have any rational roots, and the values for the cosines can only be approximated as far as I know, so I wouldn't call it a solution, rather a restatement of the problem in a different notation. – BarbaraKwarc Feb 25 '18 at 13:04
This won't always work out so nicely, and there is likely a shortcut or at least a more efficient way of solving the geometric equations, but here is one approach that works out for a variety of special cases, including $\sqrt[3]{2+11i}+\sqrt[3]{2-11i}$.
Using the polar form of complex numbers, we can see that the value we're looking for is $2\sqrt{5}\cos\left(\dfrac{\arctan\frac{11}{2}}{3}\right)$. We can figure out this cosine by drawing the triangle in the complex plane with vertices $0$, $2$, and $2+11i$ and trisecting the angle at $0$.
Then we have the following equations:
1. $a+b+c=11$ because that is the height of the triangle.
2. $2^2+a^2=x^2$ by Pythagorean Theorem on smallest triangle.
3. $2^2+(a+b)^2=y^2$ by Pythagorean Theorem.
4. $2^2+11^2=z^2$ by Pythagorean Theorem.
5. $\frac{b}{a}=\frac{y}{2}$ by Angle Bisector Theorem.
6. $\frac{c}{b}=\frac{z}{x}$ by Angle Bisector Theorem.
7. $\frac{2}{x}$ is the cosine we're looking for by right triangle trig.
Now we just have to do the terrible algebra: We can eliminate $z$ and $a$ with equations 6 and 2 respectively, to get:
1. $\frac{b}{\sqrt{x^2-4}}=\frac{y}{2}$ (from 5 above)
2. $125b^2=x^2c^2$ (from 4 above)
3. $4+\left(\sqrt{x^2-4}+b\right)^2=y^2$ (from 3 above)
4. $\sqrt{x^2-4}+b+c=11$ (from 1 above)
Then we can eliminate $y$ with equation 1 to get:
1. $125b^2=x^2c^2$ (2 above)
2. $4+\left(\sqrt{x^2-4}+b\right)^2=\dfrac{4b^2}{x^2-4}$ (from 3 above)
3. $\sqrt{x^2-4}+b+c=11$ (4 above)
From here we have a few options that all can work out (we can eliminate $x$, for instance). Since $x$ is our goal, here is an approach headed that way: Equation 1 tells us that $c=5\sqrt 5b/x$ and equation 3 can be used to eliminate the square root from equation 2, which leaves us with:
1. $4+(11-5\sqrt5\frac{b}x)^2=\frac{4b^2}{x^2-4}$
2. $\sqrt{x^2-4}+b+5\sqrt{5}\frac{b}x=11$
Solving 1. for $b$ yields $b=5\sqrt{5}x\dfrac{11x^2-44\pm4\sqrt{x^2-4}}{121x^2-500}$. Since we know $x>2$ and $b<x$, we need the negative root here: $b=5\sqrt{5}x\dfrac{11x^2-44-4\sqrt{x^2-4}}{121x^2-500}$.
Solving 2. for $b$ yields $b=\dfrac{x(11-\sqrt{x^4-2})}{x+5\sqrt{5}}$.
Setting these equal gives us a complicated expression that we can manipulate to solve for the square root: $$\sqrt{x^2-4}=\dfrac{11\left(5\sqrt{5}x^3+4x^2-20\sqrt{5}x\right)}{-121x^2+20\sqrt{5}x+1000}$$
Squaring both sides and putting over a common denominator (and dividing by $4$) gives us: $$\dfrac{121x^6+2420\sqrt{5}x^5+44875x^4-19680\sqrt{5}x^3-429500x^2+40000\sqrt{5}x+1000000}{\left(-121x^2+20\sqrt{5}x+1000\right)^2}=0$$
We only have to worry about the numerator, and since we have $\sqrt{5}$ as a factor of every other coefficient, it will be convenient to substitute $x=\hat{x}*\sqrt{5}$, so that the equation from the numerator becomes $15125\hat{x}^6+302500\hat{x}^5+1121875\hat{x}^4-492000\hat{x}^3-2147500\hat{x}^2-200000\hat{x}+1000000=0$. Testing rational roots tells us we have $\hat{x}=-5,1,-\frac{10}{11},\frac{10}{11}$ as roots. The remaining ones are roots of the resulting quadratic: $\hat{x}=4(-2\pm\sqrt{3})$.
We know $\hat{x}$ must be positive, so it's either $1$ or $10/11$, and checking the other equations shows that $\hat{x}=1$ is correct, which leads to the cosine being $\dfrac{2}{\sqrt{5}*1}$ and the original value being $2\sqrt{5}*\dfrac{2}{\sqrt{5}*1}=4\checkmark$.
• This was my first idea, I didn't check all step but it seems a very nice work and it seems very difficult to obtain the result! (+1) – user Feb 26 '18 at 7:13
As an alternative we could show algebrically that
$$x=z+\bar z\implies x=2Re(z)=2\sqrt 5\cdot \left(\cos \frac{\theta}3\right)=4$$
with
$$\theta = \arccos \frac{2}{5\sqrt5}$$
• That's nonsense, sorry. – Professor Vector Feb 25 '18 at 12:31
• Why Is it nonsense? – user Feb 25 '18 at 12:34
• It doesn't help the OP to make the same mistake (arbitrarily choosing one of three possible roots), especially if the connection to the original question is so obscure as in you mass-produced "answer". – Professor Vector Feb 25 '18 at 12:53
• @ProfessorVector yeah, the notation kinda is, but I understand what he meant to say, because this is the "geometric way" I mentioned in my question. Complex conjugates are symmetric with respect to the real axis, so when we add them, they form the sides of a parallelogram, with its diameter laying along the real axis. Half that sum is the perpendicular projection of each of the conjugates onto the real axis, that is, its real component. So the sum is twice the real component of the conjugate. He used that, and the fact that the cube root divides the angle by 3, hence $\cos(\frac{\theta}{3})$ – BarbaraKwarc Feb 25 '18 at 12:53
• That's the thing: this particular equation is well-known from historic reasons, and everyone knows what the solution is, so everyone is jumping to conclusions and tells the solution from memory. But if I chose a different pair of cube roots, less known, which are the solution to a cubic equation that doesn't have rational roots (but that are still real and algebraic), I bet people would be none the wiser and guessing or reciting solutions from memory won't quite work. The discussion about other values of cube roots is a moot point, only to muddle the real issue here. – BarbaraKwarc Feb 25 '18 at 13:08
Here's an odd approach: the rational root theorem.
Possible factors: $\pm 1,\pm 2,\pm 4$
Using trial and error along with synthetic division upon this polynomial shows that $4$ is a solution.
This doesn't solve your question on how to prove the idendity, but it does provide a simple solution to similar questions that will have this method easily applicable.
The goal is to show that
$$\sqrt[3]{2 + 11i} + \sqrt[3]{2 - 11i} = 4$$
I think you're going to have problems proving that algebraically.
From the standpoint of an unordered field, where the only operations available are $+ - \times\ \div$, it's impossible, since the three roots of each number are indistinguishable from each other, and for some pairings of those values, the identity is false.
So, we have to work in the complex plane. The essence of the problem is to find the real component of $\sqrt[3]{2+11i}$. The "obvious" way to do that is to compute an arctangent, divide the angle by three, then take the cosine. Actually carrying out this computation, in the general case, and without approximation, is beyond the ability of our current mathematics.
It's an angle trisection problem, and that means that you're always going to come back to solving a cubic equation.
I'd suggest approaching the factorization problem differently, using Kronecker's algorithm (older but easier to understand), or Cantor-Zassenhaus (most widely implemented in computer algebra systems). See wikipedia's article on Polynomial Factorization.
The idea is to factor the polynomial over the rational number field, not the complex field. If your answer isn't rational, this won't work (the algorithm will tell you that the polynomial is irreducible), but if one of your roots is a rational number (like 4), this method will find it without any circular arguments.
What if your answer isn't rational? Then the best you can hope for is to find an irreducible polynomial with a single real root that is your solution, and I think you're running up against fundamental theoretical limits to do any better.
I think all your way is total wrong because $\sqrt[3]{2+11i}$ is a set of three numbers and $\sqrt[3]{2-11i}$ is a set of three numbers.
• I'm aware of that, but since I'm looking for a real solution, I may safely assume that taking only the real answer (i.e. the principal root) would bring me closer to that real solution. – BarbaraKwarc Feb 25 '18 at 11:26
• It's very common for the cubic formula to be written in this sort of way, since you can get to the answers to the original equation regardless of your choice of cube root. In this case, BarbaraKwarc has already said that they were interested in the choice that makes the sum 4. – Mark S. Feb 26 '18 at 3:02 | 2020-02-24 03:01:18 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.849868655204773, "perplexity": 248.38958219263347}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875145869.83/warc/CC-MAIN-20200224010150-20200224040150-00215.warc.gz"} |
https://forum.framework7.io/t/mathjax-and-vue/2587 | # Mathjax and vue
i have succes to load math formula using mathjax with framework7 v2. by adding this code on index.html
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
imageFont: null,
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$","$"],["\$$","\$$"]]}
});
</script>
<script type="text/javascript" async
src="MathJax/MathJax.js">
</script>
**and calling render function on my app.js**
(document).on('page:init', function (e) {
// Do something here when page loaded and initialized
MathJax.Hub.Typeset();
});
But the problem is , when i want to use another template with vue.js
i do not know where to place the Mathjax Config code , i tried to place that code on the index.html . But its seem like the code didnt work | 2022-08-11 09:28:27 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2162535935640335, "perplexity": 8656.813111902331}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882571246.56/warc/CC-MAIN-20220811073058-20220811103058-00001.warc.gz"} |
https://msp.org/involve/2008/1-1/p06.xhtml | #### Vol. 1, No. 1, 2008
Recent Issues
The Journal About the Journal Subscriptions Editorial Board Editors’ Interests Scientific Advantages Submission Guidelines Submission Form Ethics Statement Editorial Login Author Index Coming Soon Contacts ISSN: 1944-4184 (e-only) ISSN: 1944-4176 (print) Other MSP Journals
Patch and crossover planar dyadic wavelet sets
### A. J. Hergenroeder, Zachary Catlin, Brandon George and David R. Larson
Vol. 1 (2008), No. 1, 59–90
##### Abstract
A single dyadic orthonormal wavelet on the plane ${ℝ}^{2}$ is a measurable square integrable function $\psi \left(x,y\right)$ whose images under translation along the coordinate axes followed by dilation by positive and negative integral powers of 2 generate an orthonormal basis for ${\mathsc{ℒ}}^{2}\left({ℝ}^{2}\right)$. A planar dyadic wavelet set $E$ is a measurable subset of ${ℝ}^{2}$ with the property that the inverse Fourier transform of the normalized characteristic function $\frac{1}{2\pi }\chi \left(E\right)$ of $E$ is a single dyadic orthonormal wavelet. While constructive characterizations are known, no algorithm is known for constructing all of them. The purpose of this paper is to construct two new distinct uncountably infinite families of dyadic orthonormal wavelet sets in ${ℝ}^{2}$. We call these the crossover and patch families. Concrete algorithms are given for both constructions.
##### Keywords
wavelet, wavelet set, patch, crossover, congruence
##### Mathematical Subject Classification 2000
Primary: 47A13, 42C40, 42C15 | 2018-12-14 03:36:44 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 8, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4378524124622345, "perplexity": 1699.6967982905846}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-51/segments/1544376825349.51/warc/CC-MAIN-20181214022947-20181214044447-00249.warc.gz"} |
https://ameerd.github.io/files/VRP-Project---Github-Version.html | # 1 Introduction and Motivation
The Vehicle Routing Problem (VRP) is a classic operations research problem concerned with finding the optimal routing of a fleet of k vehicles seeking to reach n nodes. Each vehicle must begin its route at a shared source node and return to said source node at the end of its path. Optimality can be defined in a few ways but generally includes minimizing some quantity such as distance or time. For example, we might want to minimize the distance travelled across all vehicles in an effort to minimize fuel usage. Or, we may want to minimize the time until the last vehicle returns to the source thereby setting a cap on the amount of time to serve all n nodes.
Another way of thinking about this problem is as a generalization of the classic Travelling Salesman Problem (TSP). The TSP involves a wandering salesman seeking to sell his goods to customers in n far off cities. The salesman wants to minimize the amount of time to reach each of these cities and return to his starting place. Generalizing to the VRP from the TSP, instead of one salesperson, we now have k salespeople who agree that each destination will be serviced by one member of the sales team before the salespeople return home to the source. Notice that the VRP must have a fixed source unlike the TSP since the TSP’s solution generates a single cycle in the network and thus the starting point does not affect optimality. In contrast, the starting point of the VRP defines the distinct cycles each vehicle or salesperson must complete. Secondly, the VRP contains an assignment problem buried into it. To find the optimal solution, we have to find the optimal assignment of nodes to vehicles along with the optimal path for each vehicle to its assigned node.
An important shared trait of the TSP and the VRP is that neither of them can be solved simple, efficient algorithms. Just like many combinatorial optimization problems, they fall into the class of NP-Hard problems. The feasible set of solutions (or in this case routing choices) is enormous and grows exponentially with the problem size. For a given VRP with n destinations and k vehicles, there are $$k^{n-1}$$ valid assignments of destinations to vehicles plus the sum of within common assignment permutations of destinations. Clearly, enumerating over the entire space is not remotely feasible for larger problems. Finally, one of the other challenges of combinatorial optimization problems is that the cost function typically contains a large number of local optima that an approach such as hill-climbing will be unable to overcome. These challenges motivate the use of simulated annealing.
Simulated annealing presents a very plausible approach to the VRP given its ability to maneuver between peaks and valleys in the cost function to avoid getting caught in a local optima. The random proposals aspect is absolutely necessary for this movement to happen. Then, as the peaks become sharper, we should expect to find the optimal routing.
# 2 Problem Formulation
In more formal terms, the Vehicle Routing Problem can be formulated as follows. If our objective is to minimize the total distance travelled by the vehicles, the problem becomes:
\begin{aligned} \min &\sum_{i=1}^k \sum_{j=2}^{n_k} d(x_{i(j-1)},x_{ij}) \\ \text{subject to} & \sum_{i=1}^k n_k = n + 2k - 1 \\ & x_{i1} = x_{in_k} = x_1 \qquad \forall i \in 1,2,\dots,k \end{aligned}
where the variables are defined as follows:
• $$k$$ is the number of vehicles in the fleet
• $$n$$ is the number of destinations in the network
• $$n_k$$ is the number of nodes vehicle $$k$$ will visit including starting and ending at the source node
• $$x_{ij}$$ is the $$j$$th destination in vehicle $$i$$’s route
• $$d(x_{i(j-1)},x_{ij})$$ is the distance measure computing the distance between destination $$j-1$$ and $$j$$ on vehicle $$i$$’s route. In this report we will be using Euclidean distance.
• $$x_1$$ is the source node
The functions computing the distance and cost of a given routing are available in Appendix A1.
As specified above, the problem operates over a graph with $$n$$ nodes and a designated source node. For the purposes of examining the performance of simulated annealing on the VRP, we can generate sample networks by plotting $$n$$ uniformly generated nodes in the unit square. We will leave the option to set a specified starting node to illustrate the impact of different source nodes on the solutions. Below are a set of four sample networks. One of them is completely random, the other three have their source nodes set at $$(0,0)$$, $$(0.5,0)$$, and $$(0.5,0.5)$$. The code to generate these plots can be found in Appendix A3. | 2021-05-11 03:09:18 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7732598185539246, "perplexity": 404.94671188802926}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243991641.5/warc/CC-MAIN-20210511025739-20210511055739-00520.warc.gz"} |
https://convenienceretailersummit.com/pfiqg/portfolio-optimization-using-machine-learning-229dde | optimization algorithms have emerged for solving large-scale machine learning problems. Always try to pick up innovative projects to build a portfolio that excites the interviewer making him want to … Lessons Learnt. Following from the previous article (Snow 2020), which looked at trading strategies, this article identifies different weight optimization methods for supervised, unsupervised, and reinforcement learning frameworks. is the Sharpe ratio observed in the market. Using machine learning to model complex data: This set-ting is more general than linear regression and with much weaker assumptions. All allocations are positive and sum up to 1 (constraints are handled correctly); There is a tendency towards corner solutions at the right end of the spectrum. PortfolioAnalytics: Portfolio Analysis, Including Numerical Methods for Optimization of Portfolios, Peterson, B. G. & Carl, P. (2015), PortfolioAnalytics: Portfolio Analysis, Including Numerical Methods Quandl provides a dataset of continuous futures (, series represents the daily price of the first futures contract that is being perpetually r, Most of these series are commodities, but stock indices are also present, and their summary is, For diversification purposes, two more futures from the same source wer, from 2014-01-07 till 2018-06-28 was considered, with an obvious skew towards European coun-. Efficient frontier, min VaR/ES objective. Green dot -GDP-induced risk aversion, red dot -λ = 1, orange dot -λ = 0.1. We’ll see the returns of an equal-weighted portfolio comprising of the sectoral indices below. Asset prices and the risk-free rate were used to calculate weekly excess returns. The "integrated portfolio intelligence" model extracts hidden patterns out of company fundamental indices and filters out effects such as trader noise or fraud utilizing advanced big data machine, We investigate the problem of dynamic portfolio optimization in a continuous-time, finite-horizon setting for a portfolio of two stocks and one risk-free asset. This makes it necessary to set a risk tolerance for each investment and use risk figures (like VaR) as key ingredient for each investment decision. attempting to search for the best algorithm in terms of its’ historical performance. fensive due to zero-negative correlation with the rest of the assets. The original mean-variance framework is appealing because it is very efficient from a computational point of view. To address this, we adapt two machine learning methods, regularization and cross-validation, for portfolio optimization. Another significant breakthrough was achieved by Black and Litterman, (, many studies suggest various settings to generate return forecasts, yet there is no apparent con-. general consensus that an attempt to predict asset returns based on their previous history is a fu-, tile effort regardless of the complexity of the underlying algorithm. approach to view generation for the Black-Litterman model by performing a one-step prediction. One such metric of variability is proposed in (, allocation perturbation), defined as a Frobenius norm of the column-demeaned matrix of weights, The third metric, BPC (boundary percentage) indicates what is the proportion of asset allocations. Fully documented code is available for download. of the solutions, we compare them with the best known solutions, The dependence on. The return of the i-th asset between period t and period t-1is defined as: Now, when we want to build an investment portfolio, we want to mix many assets together allocating a fraction x of our capital to each one of them. ∙ 0 ∙ share . Bias results from the model doing a poor job of capturing the pertinent features of the data. leverage that can be obtained by trading futures contracts. Bottom right -simple view, market prior. Our idea consists in using HOO for solving some NP-hard variants returns is itself a random variable, which is only known with some degree of uncertainty, allocation”, usually taken from a broad market index. You are currently offline. This method assigns equal weights to all components. preliminary numerical experiments give promising results. Machine Learning in Asset Management—Part 2: Portfolio Construction—Weight Optimization. The difference between Pearson and Spearman correlations is insignificant for all considered assets. The covariance matrix is estimated as. They can be stock, funds, bonds, ETF etc. are the first and the second moments of the expected return distribution. learning for view generation in the Black-Litterman model is also of interest. A python application, that demonstrates optimizing a portfolio using machine learning. A set of objective functions to optimize for; Moments estimation, including the Ledoit-W. Full coverage of the Black-Litterman model; Backtesting framework and performance analysis; An acronym for “Portfolio High-Level Optimization Suite”. — simple view in favor of emerging markets. the optimal portfolio, is the one with the highest expected return (or in statistical terms, the one with the highest Z-score). window length. That means that we will need to create our models over the period beginning 1/4/18 and ending 4/30/18 and actually construct on portfolio using these models over our test period. Additionally, using past data and normality assumptions, we can define the set of model residuals U B. The second is the tail risk minimization (“minimum V. the optimal portfolio that also maximizes the logarithmic utility (Kelly portfolio). shows the allocation dynamics when the desired level of return (and risk) changes. The central message of this paper is that nobody should be using the sample covariance matrix for the purpose of portfolio optimization. A style drift score is ideal for screening thousands of portfolios, comparing the style consistency of portfolios, and monitoring drift in a portfolio's style. Since machine learning and deep learning models have shown overwhelming superiority than time series models, this paper combines return prediction in portfolio formation with two machine learning models, i.e., random forest (RF) and support vector regression (SVR), and three deep learning models, i.e., LSTM neural network, deep multilayer perceptron (DMLP) and convolutional neural network. Some features of the site may not work correctly. solutely stable” regardless of the market inputs. backtesing period) view towards emerging markets as in the previous section. viable when the history of discretionary views is not available for backtesting purposes. sequential portfolio optimization (asset allocation) strategies. Demand Response and Energy Portfolio Optimization for Smart Grid using Machine Learning and Cooperative Game Theory Title: Demand Response and Energy Portfolio Optimization for Smart Grid using Machine Learning and Cooperative Game Theory: Author(s): Chis, Adriana: Date: 2018: Language: en: Pages: 100 + app. First of all, in portfolio re-balance part, Max-Return and Min-Risk. We treat the problem as context-independent, Portfolio Generator and Optimizer: Constructs portfolios using pairwise selection of weakly correlated stocks. Kinn’s approach recognizes that estimation error can be decomposed into two sources: bias and variance. the provided Sharpe ratios are just parametric estimates, not produced by running actual. This article focuses on portfolio weighting using machine learning. data sets and report the results. - areed1192/portfolio-optimization profile, with individual assets and optimal portfolios. Secondly, Entering/Leaving Rule (E/L) is suggested to upgrade portfolio when particular stock`s rate of return is low. backtests. The construction of the efficient frontier was described earlier. Note that we do not include the risk-free rate in any of the optimization formulations, since. Nikkei225 -0.38 -0.33 -0.08 -0.29 -0.03 -0.71. We will be using stocks from 4 companies, namely, Apple, Nike, Google and Amazon for a period of 5 years. single-period allocations were discarded or found to be of little use. As it has been shown by modern portfolio theory (MPT), the higher the return of an asset, the higher the risk. Both ends of the efficient frontier are corr, Both auxiliary portfolios are efficient. Green dot -mean-variance with λ = 5, red dot -max Sharpe. Such imbalance will be quantified and corrected at the next step, before the optimization. Portfolio optimization emerged with the seminal paper of Markowitz (1952). for Optimization of Portfolios. All individual assets are within the feasible set. The Ledoit-Wolf curve is also provided in Figur. Absolute allocation profiles for various BL inputs. For this section, the baseline scenario is the infamous, if the asset universe is chosen appropriately, Before we consider the best results, we note that the resulting optimization and backtesting. Artificial intelligence, machine learning, big data, and other buzzwords are disrupting decision making in almost any area of finance. This is another evidence that the assets were chosen well. The po… ture within the data (see factor loadings, T, difference between the primary and the defensive assets (“All versus defensive”). Top right -simple view, uninformed prior. Implementation details and reproducibility. of machine learning classifiers for view generation is studied. Both S5 and S9. is interpreted as an investor’s risk aversion. Each fraction is called weight. All figure content in this area was uploaded by Anton Antonov, All content in this area was uploaded by Anton Antonov on Oct 01, 2019, Portfolio Optimization using Machine Learning, This report presents an empirical study of allocation stability on the historical dataset of index. lows to examine not just a single portfolio, but the whole set of feasible portfolios. several drawbacks though — it adds the need to calibrate the input and the parameters of, jectives and constraints, approaches to BL priors) grows as we choose more and mor, plicated procedures, so that the problem of picking all these settings is now an optimization, problem of its’ own. well diversified, and no asset is redundant. minimal diversification for the portfolio and risks low - ering returns per unit risk. ), and the growth is uniform across assets, with one noticeable exception. tries. The suggested methods were validated and applied on stocks which are listed in KOSPI200 from January 2007 to August 2008. proper understanding of the allocation strategy we employ a rolling rebalancing scheme, when the, optimization is applied on a window of historical data and the optimal allocation is held for some, actual performance is aggregated by keeping this allocation for, The previous section indicates that using, towards zero. This paper consolidates insights from the. an aggressive allocation, so the well-diversified region without too many corner solutions, is captured by relatively high risk aversion parameter values (i.e., more penalization for the, position in FTSE 100 changes direction from short to long quite sharply between 50% and, is a similar behavior in Nikkei 225 (portfolios 6–10, T. Our second experiment covers the influence of various optimization objectives. Several factors, bear geographical division, like the third (“Americas versus others”), the fourth (“Europe versus. ResearchGate has not been able to resolve any citations for this publication. This article focuses on portfolio weighting using machine learning. First, we introduce performance-based regularization PBR, where the idea is to constrain the sample variances of the estimated portfolio risk and return, which steers the solution toward one associated with less estimation error in the performance. market perspective on the risk aversion parameter and the equilibrium prior allocations. was used as a reference to check results independently, The basic idea behind the data preference was to construct a set of instruments that pr, posure to different world economies. A small number of entries in the. allocations are equal for emerging/non-emerging markets, and the same pictur. You will learn to … This tends to pull the most extreme coefficients towards more central values, thereby systematically reducing estimation error where it matters most. One straightforward way of doing so is to allocate between, futures on leading indices. as locally, The goal of stock investment is earning high rate or return with stability. The previous point is further aggravated by the fact that the, There is little difference in the optimal allocation (T, The effect of VIX on the efficient frontier observed in the pr, , which is a popular choice for discrete distributions, The Black-Litterman model results indicate a strong dependence on the prior, Black-Litterman estimates show a significant sensitivity towards inputs (see how the asset, There is a clear allocation “inheritance effect” of the prior: for the uninformed prior, optimal, Adding a simple view has a well-pronounced effect on the allocation (see Ibovespa and, as expected, the baseline scenario with the uninformed prior and no views is “ab-, the scenario with the simple view and the market prior is the most stable along the, the BPC metric suggests that all portfolios are free of corner solutions, which suggests. , which illustrates the dynamics of the allocation. S9 bet against European indices, but disagree on the direction of betting on American indices. The portfolio optimization model has limited impact in practice because of estimation issues when applied to real data. Machine Learning in Future Reinsurance Portfolio Optimization. The stocks follow the Cointelation model introduced in [9] and the optimal strategies are derived explicitly with respect to Mean Variance Criterion and Power Utility Criterion. Point that classical portfolio optimization model has limited impact in practice due to finding local instead of optima... Is bounded in the risk-return plane Economics at Yale University Positive Technologies search for the best performance, if recall... Relatively new techniques that help practitioners develop robust, well-diversified asset allocations are the aspect. Solutions listed above to verify that the assets of Projects to Include join to... Often underperform the naïve allocation out-of-sample others it works as intended problem of optimal asset allocation is of... Rate of return ( and risk ) changes stock, funds, bonds, etc! Discussion, see e.g is suggested to require these conditions allocations are equal for emerging/non-emerging markets,.! Portfolio weighting using machine learning portfolio: Type of Projects to Include 0.01 ( annualized ) model... Is the tail risk minimization ( “ minimum V. the optimal portfolio that also maximizes the logarithmic utility Kelly! So on such imbalance will be using stocks from 4 companies, namely, Apple, Nike portfolio optimization using machine learning Google Amazon... Stocks from 4 companies, namely, Apple, Nike, Google and Amazon for a discussion. Good performance within the backtesting performance, if we recall our PCA interpretation of factor and minus one standard —... Set of model residuals U B and U B are used to calculate weekly excess returns found! Unless it shows good performance within the backtesting routine and/or for the portfolio selection, /. And Min-Risk conducted using several scenarios with varying inputs most extreme coefficients towards more central values portfolio optimization using machine learning... Extreme coefficients towards more central values, thereby systematically reducing estimation error where it matters most under some,! Optimal allocation between, futures on leading indices improve the portfolio and risks low ering... Of estimation issues when applied with real data called Hierarchical Optimistic optimization ( HOO ) data! By trading futures contracts: the R optimization Infrastructure Package have no views are on... Matrix through a transformation called shrinkage aversion is closer to shows good performance within the backtesting and/or. And Min-Risk dot -λ = 0.1 dynamic, rebalancing a mean-variance Optimizer to earn the largest rate of is... Emerging/Non-Emerging markets, and we have no views are passed on to optimal. ( PBR ), where the … Offered by Coursera Project Network metric non-zero! The ML classifiers yields either a similar or worse, allocation, so choose! A poor job of capturing the pertinent features of the rolling standard deviation — 0, the... With linear and logistic regression models that is bounded in the Age of machine learning,... Equal for emerging/non-emerging markets, and repeat the procedure by shifting the dropped...., regularization with penalty functions and nonlinear constraints ) 10-23 matrices are numerically ill-defined, to learn risk preference non-zero. ” ), portfolio selection problem way of characterizing asset allocation general than linear regression with... Demonstrates optimizing a portfolio using machine learning Sharpe ratio portfolio performs poorly due to finding local of! Has long been associated with linear and logistic regression models and heuristics emerging/non-emerging markets and... “ minimum V. the optimal shrinkage intensity, and in such case no views are passed to. Economics at Yale University a similar or worse, allocation, so we the... The 1/N portfolio strategy similar to the optimal portfolio that also maximizes the utility! Produced by running actual where the … Offered by Coursera Project Network use a $\chi -armed. Ratios are just parametric estimates, not produced by running actual data Science, Spring,... Happened in the market data input is designed similar to the market prior is used the! These allocations is far from being acceptable Financial covariance matrices are numerically ill-defined, to optimal. The price relative difference from one period to another are two important that. Naive diversification: how Inefficient is the tail risk minimization ( “ Europe versus the. Industrial problems, three methods are suggested to earn the largest rate of return low., U B Project Network that demonstrates optimizing a portfolio with dynamic, rebalancing the previous section about... Necessarily the same pictur poor job of capturing the pertinent features of the subject good... So we choose the second in a series of articles dealing with learning! In very different ways variants of the most important topics in quantitative finance role these! Emerging/Non-Emerging markets, and many strategies that provided robust in such case no views are passed on to the weights! In terms of its ’ historical performance and Min-Risk ML classifiers yields either similar! As previously considered, long-only and budget ) computational point of view finance to. Networks and review LSTMs and how they can be obtained by trading futures contracts at the Allen Institute for.! A significant impact on the risk aversion parameter and the second option running actual LSTMs and they... An equal-weighted portfolio comprising of the portfolio the series of articles dealing with machine learning to learn preference... Your work in terms of its ’ properties is an important issue when constructing a portfolio using learning... An allocation profile along the efficient frontier are corr, both auxiliary are! Are indeed optimal, the challenge is to allocate between, futures on leading indices how Inefficient is the portfolio! Such case no views are passed on to the Black-Litterman model convince others it works as intended the... The third ( “ Americas versus others ” ), and repeat procedure., Entering/Leaving Rule ( E/L ) is suggested to earn the largest rate of return with stability them. 21.7 % machine learning forecasts improve minimum variance portfolio optimization challenge is to know the optimal shrinkage intensity and. On leading indices Prado, Founder & CIO, True Positive Technologies is unstable chosen well comparison conducted. Optimizer: Constructs portfolios using pairwise selection of weakly correlated stocks covariance matrices are numerically,! Is that nobody should be changing to reflect the defensive role of these allocations far... Provided Sharpe ratios decades, if within plus and minus one standard —! One standard deviation, we assign +1, if within plus and minus one standard deviation — 0 and... Focuses on portfolio weighting using machine learning has long been associated with linear logistic... It contains estimation error can be days, weeks, months and so on as for the performance. Extensions ’ portfolio Construction in the s & P 500 optimization Fall 2020. correlated. Papers, Department of Economics and Business, Universitat Pompeu Fabra be changing to reflect the defensive role of assets... Regularization and cross-validation, for portfolio optimization emerged with the seminal paper Markowitz! Yale Univ level of return ( and risk ) changes instead of global optima the proper comparison conducted! Pull the most extreme coefficients towards more central values, thereby systematically reducing estimation error can be days weeks. Of applications highly correlated ; thus, adding them again provides cross-validation, for portfolio.. Learning portfolio: Type of Projects to Include this publication optimization Fall 2020. highly correlated ; thus, them., Entering/Leaving Rule ( E/L ) is suggested to earn the largest rate of return is 13.3 % portfolio optimization using machine learning equilibrium! Are indeed optimal, the optimization formulations, since random forest is an RNG-dependent method this... The second moments of the portfolio optimization using machine learning returns portfolio: Type of Projects Include... Numerous alternative approaches and heuristics return ” portfolios, correspondingly ) and iterate over instead... See the returns of an up-down move using a set of model residuals U are! Solving some NP-hard variants of the efficient frontier been associated with linear and logistic regression models that is bounded the... Your work and its ’ historical performance Black-Litterman model is also of interest asset management two portfolios with high but! Factors, bear geographical division, like the third ( “ Europe versus were! Called shrinkage estimates, not produced by running actual ) covariance matrix Markowitz, (... Dot -mean-variance with λ = 5, red dot -λ = 0.1 semantic Scholar is a good sign for investor. At all$ \chi \$ -armed bandit algorithm called Hierarchical Optimistic optimization ( HOO ) classifiers portfolio optimization using machine learning... The series of returns as follows do that, here we may use the budget and the long-only.. Assign +2 recall our PCA interpretation of factor understand what can potentially work was definitely challenge... Contains estimation error can be decomposed into two sources: bias and variance: Inefficient! Portfolio optimization time series data learn to … machine learning Sharpe ratio with to... To real data using portfolio optimization using machine learning learning in asset Management—Part 2: portfolio Construction—Weight.... We choose the second in a strictly defined sense ) covariance matrix a. Ratio portfolio performs poorly due to zero-negative correlation with the rest of the Minimum-Torsion bets over whole... Low - ering returns per unit risk them has many historical returns, the performance of assets. ( in a series of returns as follows dealing with machine learning.! 5, red dot -λ = 0.1 risk-free rate in any of the data parameter re-...... Financial covariance matrices are numerically ill-defined, to the Black-Litterman model: S1–S5 — views... Changes the allocation study is conducted in the previous section during and after the backtesting range so on routine!, three methods are suggested to earn the largest rate of return ( risk. Not violated, etc. ), based at the Allen Institute for AI to. Model by performing a one-step prediction is useful as a final note on direction. We show how minor modifications of the expected return distribution very popular nowadays, but very! Resolve any citations for this publication of global optima ’ historical performance reducing estimation error where it most. | 2022-05-18 12:03:07 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.49232327938079834, "perplexity": 2341.317606337989}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662522270.37/warc/CC-MAIN-20220518115411-20220518145411-00047.warc.gz"} |
https://flaviocopes.com/python-tcp-server/ | The Python standard library provides the socketserver package. We can use that to create a TCP server.
from socketserver import BaseRequestHandler, TCPServer
class handler(BaseRequestHandler):
def handle(self):
while True:
msg = self.request.recv(1024)
if msg == b'quit\n':
break
with TCPServer(('', 8000), handler) as server:
server.serve_forever()
Connect to this using Netcat, a handy utility that is very useful to test-drive TCP and UDP servers. It’s installed by default on Linux and macOS, available under the nc command:
nc localhost 8000
Once it’s connected to the server, you can send any message by typing it. The server will reply with a confirmation of the message received.
Until you say quit. Then the connection will close (but the server will still run, you can connect again) | 2021-09-25 10:13:12 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.17461171746253967, "perplexity": 8288.322451059956}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780057615.3/warc/CC-MAIN-20210925082018-20210925112018-00506.warc.gz"} |
https://paperswithcode.com/task/combinatorial-optimization | Browse > Methodology > Combinatorial Optimization
# Combinatorial Optimization Edit
22 papers with code · Methodology
No evaluation results yet. Help compare methods by submit evaluation metrics.
# Pointer Networks
It differs from the previous attention attempts in that, instead of using attention to blend hidden units of an encoder to a context vector at each decoder step, it uses attention as a pointer to select a member of the input sequence as the output.
340
# Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing
We present Memory Augmented Policy Optimization (MAPO), a simple and novel way to leverage a memory buffer of promising trajectories to reduce the variance of policy gradient estimate.
214
# Attention, Learn to Solve Routing Problems!
The recently presented idea to learn heuristics for combinatorial optimization problems is promising as it can save costly development.
160
# Learning Combinatorial Optimization Algorithms over Graphs
The design of good heuristics or approximation algorithms for NP-hard combinatorial optimization problems often requires significant specialized knowledge and trial-and-error.
160
# Neural Combinatorial Optimization with Reinforcement Learning
Despite the computational expense, without much engineering and heuristic designing, Neural Combinatorial Optimization achieves close to optimal results on 2D Euclidean graphs with up to 100 nodes.
76
# Model Vulnerability to Distributional Shifts over Image Transformation Sets
28 Mar 2019ricvolpi/generalize-unseen-domains
We are concerned with the vulnerability of computer vision models to distributional shifts.
68
# Fast Best Subset Selection: Coordinate Descent and Local Combinatorial Optimization Algorithms
5 Mar 2018hazimehh/L0Learn
While these methods lead to estimators with excellent statistical properties, often there is a price to pay in terms of a steep increase in computation times, especially when compared to highly efficient popular algorithms for sparse learning (e. g., based on $L_1$-regularization) that scale to much larger problem sizes.
38
# Exact Combinatorial Optimization with Graph Convolutional Neural Networks
4 Jun 2019ds4dm/learn2branch
Combinatorial optimization problems are typically tackled by the branch-and-bound paradigm.
26
# Deep Learning as a Mixed Convex-Combinatorial Optimization Problem
Based on this, we develop a recursive mini-batch algorithm for learning deep hard-threshold networks that includes the popular but poorly justified straight-through estimator as a special case.
17
# Improving Optimization Bounds using Machine Learning: Decision Diagrams meet Deep Reinforcement Learning
10 Sep 2018qcappart/learning-DD
Finding tight bounds on the optimal solution is a critical element of practical solution methods for discrete optimization problems.
12 | 2019-06-26 20:48:03 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.22355376183986664, "perplexity": 2649.578197166964}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-26/segments/1560628000545.97/warc/CC-MAIN-20190626194744-20190626220744-00074.warc.gz"} |
https://z0ltan.wordpress.com/ | # Interop mini-series – Callbacks special! (Common Lisp special) (Part 2b)
This is a continuation of the previous post callbacks interlude. I decided to give the section pertaining to Common Lisp its own post as I think there is some good educational value in this part itself.
We carry on from where we left off last time. We continue with the same squaring number callback example.
As a quick refresher, the idea is to implement a synchronous callback scenario. The function client invokes another function squarify which squares the passed value and invokes a callback function callback.
## How it’s done in Common Lisp
Let’s start off with our first attempt to implement the solution in Common Lisp.
;;;; Callback demo using the squarify example.
(defpackage :callback-demo-user
(:use :cl))
(in-package :callback-demo-user)
(defun callback(n)
(defun squarify(n cb)
(funcall cb (* n n)))
(defun client ()
(let ((n (progn
(princ "Enter a number: ")
(squarify n #'callback)))
CALLBACK-DEMO-USER> (client)
Enter a number: 19
NIL
That’s the direct equivalent of all the demos shown so far. However, since Common Lisp is a functional language (albeit not as pure as, say, Scheme or Haskell), we can certainly do better!
In most Functional Programming languages, higher order functions are usually deployed to do the job. So let’s see if we can cook up something nicely functional like function composition.
Here’s a first attempt:
(defun client()
(funcall #'(lambda (n)
(funcall #'(lambda (n)
(* n n))
(funcall #'(lambda ()
(princ "Enter number: ")
Which produces:
CALLBACK-DEMO-USER> (client)
Enter number: 19
NIL
As expected! Now, as you may know, funcall simply takes a function and some arguments (optional), and applies the function to those arguments. In this case, we simply compose them in the proper order so that the types match up: read a number -> square it -> print message.
However, let’s work our way to a generic compose function that simulates the behaviour of Haskell’s composition operator. The previous function can be improved by defining a new version that composes the three functions in the mentioned order (so as to match types):
The compose function:
(defun compose (fn gn hn)
#'(lambda (&rest args)
(funcall fn (funcall gn (apply hn args)))))
And the client to test it:
(defun client ()
(funcall (compose #'(lambda (x)
#'(lambda (x)
(* x x))
#'(lambda ()
(princ "Enter a number: ")
And the output is the same:
CALLBACK-DEMO-USER> (client)
Enter a number: 19
NIL
So what’s changed? Well, taking inspiration from the nested funcall function, we defined compose to invoke the functions in the proper order – first read the number, and then square it, and then finally print it! (Remember that the functions are composed in reverse order in which they are entered).
Note that the last function invocation is done using apply instead of funcall because &rest args produces a list of arguments, and funcall does not work with that (unless the function definition takes a list itself as a parameter, but that is not the general case, and apply works very well with lists and destructures them correctly.
How can we make this generic enough though? We notice the pattern – we invoke apply on the innermost function call, but we use funcall for the rest of the function call chain. This means that we must handle two cases – if there is a single function passed in, we should simply use apply on that, and if not, we should take care to chain them up as discussed. This lends itself to a nice recursive definition as shown next.
The updated compose function:
(defun compose (&rest funcs)
(labels ((f (funcs args)
(if (null (cdr funcs))
(apply (car funcs) args)
(funcall (car funcs) (f (cdr funcs) args)))))
#'(lambda (&rest args)
(f funcs args))))
)
And the test client for it:
(defun client ()
(funcall (compose #'(lambda (x)
#'(lambda (x)
(* x x))
#'(lambda ()
(princ "Enter number: ")
And the output:
CALLBACK-DEMO-USER> (client)
Enter number: 19
NIL
Explanation: What we do is simply generalise the three-function version of compose into a generic function. For this we, define an internal function f that takes the supplied functions and the arguments as input.
f then recursively decomposes the function applications. The base condition (stopping condition) is when there is only one function left. The (if (null (cdr funcs)) bit then takes care to return the only apply call that we need, and that is of course, applied to the args argument.
As the recursion unwinds the call stack, successive funcallS are applied at each stage. This is exactly in line with the algorithm discussed at the end of the last section.
Now we are almost home and dry! Pay special attention to the order in which the lambda equivalents of the functions are entered in the client function. They are applied in the following order – callback, squarify, and then client.
We could stop here, but there’s one more change that we can make. The current version of compose works absolutely as expected, but the intuitive order of supplying functions is the opposite of what we could expect as a user. The expected order would be, in English, “read in the number, square it, and then print out a message indicating that the number was received”.
Let’s fix that last bit for out final version of compose.
Final version of compose:
;;; final version of compose
(defun compose(&rest funcs)
(labels ((f (funcs args)
(if (null (cdr funcs))
(apply (car funcs) args)
(funcall (car funcs) (f (cdr funcs) args)))))
#'(lambda (&rest args)
(f (reverse funcs) args)))))
And the corresponding test code:
;;; test out the final version of compose
(defun client ()
(funcall (compose #'(lambda ()
(princ "Enter a number: ")
#'(lambda (x)
(* x x))
#'(lambda (x)
And now let’s test out and see if it works!
CALLBACK-DEMO-USER> (client)
Enter a number: 19
NIL
Success!
The only difference is this line: (f (reverse funcs) args). We simply reverse the order of the received functions while passing it to the recursive function f, and the rest of the code remains exactly the same!
And, of course, this is purely functional! Sweet, ain’t it?
The compose function could be optimised in multiple ways – converting it to an iterative version for instance, but conceptually, this works exactly as advertised.
## Conclusion
This post illustrates why I love Common Lisp! Even as I make my journey through the world of Common Lisp, my admiration for it only grows. If there is some feature that we would like to incorporate into the language, it can be done in a just a few lines of code! No other language truly comes close in terms of expressiveness and extensibility.
# Interop mini-series – Callbacks special! (Part 2a)
This post was actually meant to be part of the previous post(Calling C and C++ from Common Lisp).
However, as I began writing the section of “callbacks”, it started growing to such an extent that I decided to give its own post with a slightly more comprehensive treatment than originally planned!
## What exactly is a callback?
A callback, in essence, is simply a function that is executed by another function which has a reference of sorts to the first function. Yes, that’s really it!
### Uses
One major use is to ensure proper separation of concerns.
Suppose we are writing some client code that makes use of a library, and say that our client function wishes to invoke a library function. Now, this library function executes code that might result in some form of platform specific signalling that will need to be handled in disparate ways depending on the specific signal received. The library writer could not possibly have imagined all the scenarios for such signalling when he was writing the library. So how can this work? Callbacks to the rescue!
So what the library writer did was to hold a reference to a callback function in his own function, and then his function invokes this callback function as and when the need arises (say an error condition or an OS interrupt). The callback function then takes care of all the handling and bookkeeping involved.
This callback function is, of course, expected to be supplied by the client code. This makes sense since the client has the best knowledge of its own domain. This then means that the library writer can make his code as generic as possible, leaving the specifics for the client to manage.
Another common use of callbacks is asynchronous programming. For example, suppose we have a function that needs to be activated when some specific conditions have arisen, and those conditions are decided by some other code. This is a good case to use a callback.
The current function can “register” itself with the condition-generating code, and then that code can invoke a callback in the current function’s module, which can then proceed to completion. Node, in particular, makes extensive use of this approach. The general Observer pattern is, in essence, the generalisation of a callback.
### Implementation
Top
Callbacks may be implemented through various means – function pointers, function objects, or lambda abstractions. The important bit is to understand the concept and defer the specifics of the modes of implementation to the language at hand.
Callbacks can be both synchronous or asynchronous (think Node).
So much for the concept. As far as the terminology goes, it is important to remember that the callback itself is the actual function that is invoked by the function that takes the callback as the parameter. A lot of confusion arises precisely for the reason that some people tend to assume that the function taking the function parameter is the callback function. Quite contrary, as we have just surmised. The one mnemonic that always works for me is to remember that both the client function and the callback function are in the same conceptual module.
Finally, a caveat – extensive use of callbacks can lead to what is known as “callback hell” (check the Reference section – there is a whole site dedicated to it!). The rule of thumb is to use a callback only when it is absolutely needed. Otherwise, it can lead to code which is both unreadable and unmaintainable.
## Demos
Top
Let’s now take a brief look at the functionality offered by callbacks is implemented in various languages. Of course, there may be different mechanisms for doing so, but I have chosen what I feel to be the idiomatic form in each language under discussion.
For all these examples, we will consider the same example – we have a function (squarify) which takes two parameters – a number and a callback function (callback). squarify simply squares the parameter, and then invokes callback with the squared value.
callback simply prints out the received value with a small message. The whole chain is triggered by another function client, which invokes squarify.
Note that all the examples here are, for the sake of simplicity, synchronous.
### How it’s done in C
Top
In C and C++, we make use of function pointers like so:
#include <stdio.h>
void squarify(int, void(*)(int));
void callback(int);
void client();
int main()
{
client();
return 0;
}
void client()
{
int n;
printf("Enter a number: ");
scanf("%d", &n);
squarify(n, &callback);
}
void squarify(int n, void (*cb)(int))
{
(*cb)(n*n);
}
void callback(int n)
{
}
And the output:
Timmys-MacBook-Pro:C z0ltan$gcc -Wall -o callbackdemo callbackdemo.c Timmys-MacBook-Pro:C z0ltan$ ./callbackdemo
Enter a number: 19
Notice how we pass the address of callback to squarify using &callback inside the client function.
### How it’s done in C++
Top
The technique used in the C example (declaring the callback as a function pointer parameter to squarify and then passing it the address of callback at runtime will work just the same way in C++ as well.
However, in addition, C++ offers a whole lot more ways of achieving the same result. Let’s explore three of these in the same demo – lambda abstractions, function objects, and functors.
To this end, we use a std::function object to hold a reference to the callback in squarify. This class type is specified in the header.
The logic remains unchanged from that used in the C demo.
Note that this code only works in C++11 (or above).
//C++11 or above
#include <iostream>
#include <functional>
// Define the functor class
typedef struct {
public:
void operator()(int n)
{
std::cout << "Received: " << n << std::endl;
}
} backcall;
void squarify(int, std::function<void(int)>);
void callback(int);
void client();
int main()
{
client();
return 0;
}
void client()
{
int n;
std::cout << "Enter a number: ";
std::cin >> n;
// simply pass in a lambda abstraction!
squarify(n, [](int x)
<< x << std::endl;
});
// or specify a function explicitly
squarify(n, callback);
// or pass in a functor!
squarify(n, backcall());
}
void squarify(int n, std::function<void(int)> cb)
{
cb(n*n);
}
void callback(int n)
{
std::cout << "Received: " << n << std::endl;
}
And the output:
Timmys-MacBook-Pro:C++ z0ltan$g++ -std=c++11 -Wall -o callbackdemo callbackdemo.cpp Timmys-MacBook-Pro:C++ z0ltan$ ./callbackdemo
Enter a number: 19
Et voila!
### How it’s done in Java
Top
In Java, the situation is a bit more complicated than usual for many reasons – lack of pure function objects, extreme verboseness, lack of pure generic functions, etc.
However, the code below demonstrates how we would do it pre-Java 8 (and frankly, most code written today still follow this idiomatic approach).
import java.io.InputStreamReader;
import java.io.IOException;
interface Callback {
void call(int x);
}
public class CallbackDemo {
public static void main(String[] args) {
client();
}
public static void client() {
int n;
Callback cb = new Callback() {
@Override
public void call(int n) {
}
};
System.out.print("Enter a number: ");
squarify(n, cb);
} catch (NumberFormatException |IOException ex) {
ex.printStackTrace();
}
}
public static void squarify(int n, Callback callback) {
callback.call(n*n);
}
}
Timmys-MacBook-Pro:Java z0ltan$javac CallbackDemo.java Timmys-MacBook-Pro:Java z0ltan$ java -cp . CallbackDemo
Enter a number: 19
The code is mostly self-explanatory. To simulate function pointers/function objects, we simply make use of essentially what’s equivalent to the C++ functor (backcall) used in the previous demo.
The Callback interface declares a single abstract method called call which takes a single int parameter, and prints out a small message onto the console.
The squarify function takes an int parameter along with an instance of Callback, and then calls that instance’s call function. (On a side note, this is precisely why even C++’s functors are superior to Java’s. C++ has operator overloading, Java unfortunately does not).
Now, let’s take a look at how it would be done using Java 8 (and above). The Java 8 version is a marked improvement in terms of readability and conciseness.
Here’s the code:
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.function.Function;
public class CallbackDemo8 {
public static void main(String[] args) {
client();
}
public static void client() {
System.out.print("Enter a number: ");
squarify(n, (x) -> { System.out.println("Received: " + x); return null; });
} catch (NumberFormatException | IOException ex) {
ex.printStackTrace();
}
}
public static void squarify(int n, Function<Integer,Void> cb) {
cb.apply(n*n);
}
}
And here’s the output:
Timmys-MacBook-Pro:Java z0ltan$java -cp . CallbackDemo8 Enter a number: 19 Received: 361 We observe a few things that differentiate it from the pre-Java 8 version: • The Callback interface is gone, having been replaced by the built-in Function function interface. • The callback function is also gone, and a lambda abstraction replaces it instead. The lambda expression (x) -> { System.out.println(“Received: “ + x); return null; } still looks ugly with that return null; call. It is clearly redundant, but because of the way the Function functional interface is defined, this statement is mandatory. We could fix that by creating our own functional interface like so: @FunctionalInterface interface Function<T> { void apply(T o); } However, it would reintroduce a custom interface in our code. So, not much gained there! ### How it’s done in Common Lisp Top A full post containing a detailed discussion on this topic (along with the relevant demos) is available here in the next part of this series. Make sure to check that out! ### How it’s done in other languages Top Let’s implement the same example in a few other languages for our own edification! For the sake of brevity (this post is already quite long!), we will stick to very commonly used languages - JavaScript and Python. I feel these should be representative of most of the mainstream languages. Haskell is a bit of a different beast, but that is worthy of its own series of posts! #### JavaScript Top Since client-side JavaScript does not provide any means of taking input in from the command line, we will use Node.js for this demo. For I/O from the console, we will use the readline module that now comes bundled with Node. const readline = require('readline'); const stream = readline.createInterface({ input: process.stdin, output: process.stdout }); function callback(n) { console.log("Received: " + n); } function squarify(n, cb) { cb(n*n); } function client() { stream.question("Enter a number: ", function(n) { squarify(n, callback); stream.close(); process.stdin.destroy(); }); } // run! client(); And the output: Timmys-MacBook-Pro:JavaScript z0ltan$ node callback.js
Enter a number: 19
Again, this is equivalent to the C version. We simply pass the function name (which is a reference to the function object) to the squarify function as the callback function.
However, we could do it more idiomatically using a lambda abstraction as follows:
const readline = require('readline');
input: process.stdin,
output: process.stdout
});
function squarify(n, cb) {
cb(n*n);
}
function client() {
stream.question("Enter a number: ", function(n) {
squarify(n, function(x) {
});
stream.close();
process.stdin.destroy();
});
}
// run!
client()
Note how the callback function has now been replaced by a a lambda abstraction that does the same operation.
And the output:
Timmys-MacBook-Pro:JavaScript z0ltan$node callback_demo_lambda.js Enter a number: 19 Received: 361 Nice! #### Python Top In Python, just like in JavaScript, the function name itself is an intrinsic reference to the function object. Functions are, after all, first-class objects in Python, and we can simply pass it around like so: def callback(n): print("Received: " + str(n)) def squarify(n, cb): cb(n*n) def client(): print("Enter a number: ", end='') n = int(input()) squarify(n, callback) if __name__ == '__main__': client() Note that the code was written in Python 3. However, it will easily work with minimal changes with Python 2.x as well. And the output: Timmys-MacBook-Pro:Python z0ltan$ python3 callback_demo.py
Enter a number: 19
However, since Python also supports a crude form of lambda abstractions, we could rewrite the demo like so:
def squarify(n, cb):
cb(n*n)
def client():
print("Enter a number: ", end='')
n = int(input())
squarify(n, lambda x: print("Received: " + str(x)))
if __name__ == '__main__':
client()
So now we have simply passed the callback function as a lambda abstraction to the squarify function.
And just to verify, the output:
Timmys-MacBook-Pro:c_demo_system_info z0ltan$ls libsysteminfo.lib system_info.c system_info.h Excellent! Finally, let’s write the Common Lisp client code to use this library: ;;; C-demo (define-foreign-library libsysteminfo (:darwin "libsysteminfo.dylib") (:unix "libsysteminfo.so") (t (:default "libsysteminfo.dylib"))) (load-foreign-library 'libsysteminfo) (defcfun "get_machine" :string) (defcfun "get_model" :string) (defcfun "get_memory" :long-long) (defcfun "get_ncpu" :int) (defcfun "get_nlogicalcpu" :int) (defun print-system-info () (let ((arch (get-machine)) (model (get-model)) (mem (/ (get-memory) (* 1024 1024 1024))) (ncpu (get-ncpu)) (nlogicalcpu (get-nlogicalcpu))) (format t "System Information~%") (format t "Arch: ~a, Model: ~a, Mem = ~dGB, CPUs = ~d, Logical CPUs = ~d~%" arch model mem ncpu nlogicalcpu))) (print-system-info) (close-foreign-library 'libsysteminfo) And the output: LISP-TO-C-USER> (print-system-info) System Information Arch: x86_64, Model: MacBookPro11,2, Mem = 16GB, CPUs = 8, Logical CPUs = 8 NIL Explanation: We define the native library by using the cffi:define-foreign-library macro. This macro also allows us to define the specific name of the shared library depending on the OS. Then we can load the specified library using the cffi:load-foreign-library macro. Take care to observed that the name of the library is quoted. This can save you a lot of anguish later on. The next part is interesting – we use the cffi:decfun macro to define the C functions present in the library as Lispy function. For instance, the C function “get_machine” which is defined in the libsysteminfo.dylib library, is proxied into the current Lisp image as “get-machine”. There are ways to perform such name mangling automatically, but letting the cffi library take care of this is my recommendation. The general syntax of the defcfun macro is: (cffi:defcun <C-function-name> &optional<return-type> <arg with types>*) So the first defcfun indicates that get_machine is a C function that returns a character array (represented by cffi’s local type, :string), and that it doesn’t take any parameter(s), The cffi library defines a huge set of types that map to C’s primitive, pointer, and structure types extremely well. Now that we have create proxies for the C functions, we can invoke them as seen in the print-system-info function by passing in the appropriate return type and parameters. Finally, we unload the native library using another macro, cffi:close-foreign-library, which also takes a quoted library representation. ### Interop with C++ Top This is the more interesting demo for more than one reason! In this example, let’s try and sort an array of integers using the native library. Again, let’s write the interface out first (in number_sorting.h): #ifndef __NUMBER_SORTING_H__ #define __NUMBER_SORTING_H__ "number_sorting.h" void callback_function(int[], int); extern "C" { void sort_numbers(int[], int); } #endif Looks good, but what’s the deal with the callback_function? We’ll get to that in just a moment. For now, let’s flesh out the functionality for this interface (in number_sorting.cpp: #include <iostream> #include <vector> #include <algorithm> #include <functional> void sort_vector(std::vector<int>&, int[], int); void callback_function(int array[], int size) { std::vector<int> vec(size); sort_vector(vec, array, size); int i = 0; for (std::vector<int>::const_iterator it = vec.begin(); it != vec.end(); it++) array[i++] = *it; } template <typename T> void display_elements(const std::vector<T>& vec) { for (std::vector<int>::const_iterator it = vec.begin(); it != vec.end(); it++) std::cout << *it << " "; std::cout << std::endl; } void sort_vector(std::vector<int>& v, int numbers[], int count) { for (int i = 0; i < count; i++) v[i] = numbers[i]; display_elements(v); std::sort(v.begin(), v.end(), [](int x, int y) { return x < y; }); } int main() { std::ios_base::sync_with_stdio(false); int sample[] = { 1, 2, 0, -1, 3, 199, 200, 110, -234, 12345 }; callback_function(sample, sizeof(sample)/sizeof(sample[0])); for (int i = 0; i < (int)sizeof(sample)/sizeof(sample[0]); i++) std::cout << sample[i] << " "; std::cout << std::endl; return 0; } Hmmm, this seems a bit too convoluted for this simple example? Why all the indirection? The reason will become crystal clear once we define the corresponding C file (in number_sorting.c) as well: #include "number_sorting.h" void sort_numbers(int numbers[], int n) { callback_function(numbers, n); } Explanation: The reasons why we need both number_sorting.c and number_sorting.cpp, both of which implement the same interface, number_sorting.h are two-fold: 1. Since we are using some C++-only features such std::vector , std::sort, and C++11 lambdas, we need to invoke them in a separate function 2. And the more important reason – C++’s pernicious name-mangling Now, if we had simply written the entire sorting functionality using integer arrays and sorted using with C-like constructs (say, qsort, or a manually written sorting function), we wouldn’t need all this indirection, and we could have simply written the header as: #ifndef __NUMBER_SORTING_H__ #define __NUMBER_SORTING_H__ "number_sorting.h" extern "C" { void sort_numbers(int[], int); } #endif and provided the implementation in number_sorting.cpp alone. That would have worked out fine. However, because we use all those C++ templated constructs as well as functional constructs, if we had used this same header file, we would have got a name-mangling issue, and the function would not be visible to the Common Lisp client! To get around this, we write a C wrapper (number_sorting.c) which simply invokes the C++ function callback_function defined in number_sorting.cpp. Now you may think that we could have simply embedded callback_function inside the definition of sort_numbers in the C++ file alone, but that would not work either. Check out the reference “How to mix C and C++” in the “References section” for more details. All right, let’s compile the code and generate the shared library: Timmys-MacBook-Pro:c++_demo_sorting z0ltan$ clang++ -std=c++11 -stdlib=libc++ -dynamiclib -o libnumbersorting.dylib number_sorting.c number_sorting.cpp
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
Timmys-MacBook-Pro:c++_demo_sorting z0ltan$ls libnumbersorting.dylib number_sorting.c number_sorting.cpp number_sorting.h Timmys-MacBook-Pro:c++_demo_sorting z0ltan$ nm -gU libnumbersorting.dylib
0000000000000a10 T __Z11sort_vectorRNSt3__16vectorIiNS_9allocatorIiEEEEPii
0000000000000730 T __Z17callback_functionPii
0000000000000c00 T _main
0000000000000700 T _sort_numbers
We can also see that the function sort_numbers has not been subjected to name-mangling. Now that we’ve resolved that, let’s flesh out the Common Lisp client, and run the demo!
;;; C++-demo
(define-foreign-library libnumbersorting
(:darwin "libnumbersorting.dylib")
(:unix "libnumbersorting.so")
(t (:default "libnumbersorting.dylib")))
(use-foreign-library libnumbersorting)
(defun sort-some-numbers (&optional (n 10))
(with-foreign-object (numbers :int n)
(dotimes (i n)
(setf (mem-aref numbers :int i) (random 100)))
(let ((before (loop for i below n
collect (mem-aref numbers :int i))))
(format t "Before: ~{~d ~}~%" before))
(foreign-funcall "sort_numbers" :pointer numbers :int n :void)
(let ((after (loop for j below n
collect (mem-aref numbers :int j))))
(format t "After: ~{~d ~}~%" after))))
(sort-some-numbers)
(close-foreign-library 'libnumbersorting)
And the output:
LISP-TO-C-USER> (sort-some-numbers 15)
Before: 52 11 18 62 39 89 2 48 48 66 73 89 73 26 97
After: 2 11 18 26 39 48 48 52 62 66 73 73 89 89 97
NIL
Cool!
Explanation: This demo differs only slightly from the C demo in terms of Common Lisp code. We define the native library in the same manner, but we use another macro,
use-foreign-library instead this time. This is my preferred way of loading a native library since I always forget the quoting with load-foreign-library!
Jokes aside, we can see another way of executing a function defined in a native library: cffi:foreign-funcall.
This macro has the following syntax:
(cffi:foreign-funcall <C-function-name> &optional<args with types>*
<return-type>)
I tend to prefer foreign-funcall for functions with only side-effects (as in this case), and use defcfun when I need to use the function in the Common Lisp part more than once. YMMV.
The most interesting bit, of course, in the with-foreign-object macro. I won’t bother to show its general syntax, but suffice to say that this macro is used to allocate, set, and use foreign memory (i.e., from the native library) with encapsulation within its body.
In this case, we simply generate a C integer array (not the usage of the type specifier, :int), set the values of the elements of this array using cffi:mem-aref, and read the values of the array using the same accessor function.
Note that value of the var numbersis a pointer type, and also that this is available only within the body of the macro. In the next post, we will see how we can work with custom C-style structs.
## Useful basic functions
Top
Here is a summarised list of the functions used in the demos in this blog post.
• cffi:define-foreign-library
• cffi:close-foreign-library
• cffi:use-foreign-library
• cffi:defcfun
• cffi:foreign-funcall
• cffi:with-foreign-object
• cffi:mem-aref
## References
Top
Some references that you might find useful on this subject matter:
# How to compile a Java program embedded in a String? Here’s how! (Better)
I am not quite satisfied with the way I left things in the last post.
There was just a bit too much hand-waving and magic about. Since then, I’ve experimented a bit more, and found out that some things that were claimed in the last couple of posts on this topic are also blatantly wrong – for instance, this approach of dynamic compilation does require a JDK (even though it does not need javac). The javax.tools package depends on tools.jar, which does not come bundled with the JRE.
This post is meant to make amends for that mistake, plus show a better way of handling compilation of Java code stored inside a String object without resorting to creating directories dynamically. In this attempt, we will try and make the following improvements:
• The client code now invokes a custom compiling class loader.
• The class loader then compiles the code stored inside the string.
• The code is then loaded by the class loader into the current JVM.
• Finally, the code is executed by the Client using Reflection.
## The Code
The code is organised as follows:
Timmys-MacBook-Pro:Better z0ltan$tree . ├── com │ └── z0ltan │ ├── compilers │ │ └── JavaStringCompiler.java │ └── loaders │ └── CompilingClassLoader.java └── org └── z0ltan └── client └── Client.java ### The Class Loader Top package com.z0ltan.loaders; import java.io.File; import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.regex.Pattern; import java.util.regex.Matcher; import java.util.logging.Logger; import com.z0ltan.compilers.JavaStringCompiler; public class CompilingClassLoader extends ClassLoader { private static final CompilingClassLoader __instance = new CompilingClassLoader(); private static final Logger logger = Logger.getLogger(CompilingClassLoader.class.getName()); private Pattern namePattern; private Pattern packagePattern; private CompilingClassLoader() { this.namePattern = Pattern.compile(".*class[ ]+([a-zA-Z0-9$_]+).*");
this.packagePattern =
Pattern.compile(".*package[ ]+([a-zA-Z0-9$_.]+).*"); } public static CompilingClassLoader getInstance() { return __instance; } // load the class file after compiling the code public Class<?> loadClassFromString(final String program) throws ClassNotFoundException { final String className = getClassName(program); final String packagePath = getPackagePath(program); final String fullClassName; if (packagePath != null) { fullClassName = packagePath + '.' + className; } else { fullClassName = className; } logger.info("Loading " + fullClassName); // compile it! boolean result = JavaStringCompiler.INSTANCE .compileStringCode(fullClassName, program); if (result) { byte[] classBytes = getClassBytes(className); if (classBytes != null) { logger.info("Loaded " + fullClassName); return defineClass(fullClassName, classBytes, 0, classBytes.length); } else throw new ClassNotFoundException("Unable to load: " + fullClassName + ". Reason = failed to load class bytes."); } else throw new ClassNotFoundException("Unable to load: " + fullClassName + ". Reason = compilation failed."); } private String getClassName(final String program) { Matcher m = namePattern.matcher(program); if (m.matches() && (m.groupCount() == 1)) { return m.group(1); } throw new RuntimeException("Could not find main class to load!"); } private String getPackagePath(final String program) { Matcher m = packagePattern.matcher(program); if (m.matches() && (m.groupCount() == 1)) { return m.group(1); } return null; } private byte[] getClassBytes(final String className) { final String classFilePath = className.replace('.', File.separatorChar) + ".class"; try (BufferedInputStream bin = new BufferedInputStream(new FileInputStream(classFilePath)); ByteArrayOutputStream baos = new ByteArrayOutputStream()) { byte[] buffer = new byte[4 * 1024]; int bytesRead = -1; while ((bytesRead = bin.read(buffer)) != -1) { baos.write(buffer, 0, bytesRead); } // delete the class file before returning try { Files.deleteIfExists(Paths.get(classFilePath)); } catch (IOException ex) { // } return baos.toByteArray(); } catch (IOException ex) { return null; } } } The code is as simple as it gets. The loadClassFromString method takes in the Java String containing our program, and constructs the full class name by appending the package path (if any). It then invokes the compiler to generate the .class file. Finally, it deletes the .class file once the bytes have been read from it, thus cleaning up the unnecessary file. ### The Compiler Top package com.z0ltan.compilers; import java.net.URI; import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.Arrays; import java.util.logging.Logger; import javax.tools.ToolProvider; import javax.tools.JavaCompiler; import javax.tools.DiagnosticCollector; import javax.tools.Diagnostic; import javax.tools.DiagnosticCollector; import javax.tools.StandardJavaFileManager; import javax.tools.SimpleJavaFileObject; import javax.tools.JavaFileObject; public enum JavaStringCompiler { INSTANCE; private JavaCompiler compiler; private DiagnosticCollector<JavaFileObject> collector; private StandardJavaFileManager manager; private static final Logger logger = Logger.getLogger(JavaStringCompiler.class.getName()); private JavaStringCompiler() { this.compiler = ToolProvider.getSystemJavaCompiler(); this.collector = new DiagnosticCollector<JavaFileObject>(); this.manager = compiler.getStandardFileManager(collector, null, null); } // class to represent a string object as a source file class StringCodeObject extends SimpleJavaFileObject { private String code; StringCodeObject(final String name, final String code) { super(URI.create("string:///" + name.replace('.', File.separatorChar) + Kind.SOURCE.extension), Kind.SOURCE); this.code = code; } @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) { return this.code; } } // Compile the Java code stored inside the string public boolean compileStringCode(final String name, final String code) { logger.info("Compiling: " + name); boolean result = false; StringCodeObject source = new StringCodeObject(name, code); result = compiler.getTask(null, manager, null, null, null, Collections.unmodifiableList(Arrays.asList(source))).call(); // display errors, if any for (Diagnostic<? extends JavaFileObject> d : collector.getDiagnostics()) { System.err.format("Error at line: %d, in file: %s\n", d.getLineNumber(), d.getSource().toUri()); } try { manager.close(); } catch (IOException ex) { // } logger.info("Finished compiling: " + name); return result; } } This again makes use of the same facilities available in the javax.tools package. However, unlike last time, this time we make sure that we use the StandardJavaFileManager to output any compilation errors correctly. Apparently, even explicitly specifying a DiagnosticCollector instance in the compiler.getTask() call does not work. We need to have a file manager to be able to catch errors. The rest of the is pretty much the same as last time. ## Testing Top The testing code agains covers the two scenarios – using the default package, and using a more realistic package structure. ### The Client Top Here is the sample client that we will use to test the code: // The Client code package org.z0ltan.client; import java.lang.reflect.Method; import java.util.logging.Logger; import com.z0ltan.loaders.CompilingClassLoader; public class Client { private static final Logger logger = Logger.getLogger(Client.class.getName()); public static void main(String[] args) throws Exception { final String simpleProgram = "public class SimpleProgram {" + " public static void main(String[] args) {" + " System.out.println(\"Hello from SimpleProgram!\");}}"; testSimpleProgram(simpleProgram); final String complexProgram = "package foo.bar.baz.quux;" + "import java.util.Random;" + "public class ComplexProgram {"+ " public static void main(String[] args) {" + " System.out.println(\"'Sup from Fubar\");}" + "public int getRandomNumber() {" + " return (new Random()).nextInt(100);}}"; testComplexProgram(complexProgram); } private static void testSimpleProgram(final String simpleProgram) throws Exception { logger.info("Testing SimpleProgram"); Class<?> simpleClazz = CompilingClassLoader.getInstance().loadClassFromString(simpleProgram); if (simpleClazz != null) { Method main = simpleClazz.getDeclaredMethod("main", String[].class); if (main != null) { main.invoke(null, (Object)null); } } logger.info("Finished testing SimpleProgram"); } private static void testComplexProgram(final String complexProgram) throws Exception { logger.info("Testing ComplexProgram"); Class<?> complexClazz = CompilingClassLoader.getInstance().loadClassFromString(complexProgram); if (complexClazz != null) { Object obj = complexClazz.getConstructor().newInstance(); if (obj != null) { Method main = complexClazz.getDeclaredMethod("main", String[].class); if (main != null) { main.invoke(null, (Object)null); } Method getRandomNumber = complexClazz.getDeclaredMethod("getRandomNumber"); if (getRandomNumber != null) { int n = (int)getRandomNumber.invoke(obj); System.out.format("Random number = %d\n", n); } } } logger.info("Finished testing ComplexProgram"); } } ### Test Run Top Timmys-MacBook-Pro:Better z0ltan$ javac -cp . com/z0ltan/compilers/JavaStringCompiler.java
Timmys-MacBook-Pro:Better z0ltan$javac -cp . com/z0ltan/loaders/CompilingClassLoader.java Timmys-MacBook-Pro:Better z0ltan$ javac -cp . org/z0ltan/client/Client.java
Timmys-MacBook-Pro:Better z0ltan$java -cp . org.z0ltan.client.Client Sep 16, 2016 2:17:49 PM org.z0ltan.client.Client testSimpleProgram INFO: Testing SimpleProgram Sep 16, 2016 2:17:49 PM com.z0ltan.loaders.CompilingClassLoader loadClassFromString INFO: Loading SimpleProgram Sep 16, 2016 2:17:50 PM com.z0ltan.compilers.JavaStringCompiler compileStringCode INFO: Compiling: SimpleProgram Sep 16, 2016 2:17:50 PM com.z0ltan.compilers.JavaStringCompiler compileStringCode INFO: Finished compiling: SimpleProgram Sep 16, 2016 2:17:50 PM com.z0ltan.loaders.CompilingClassLoader loadClassFromString INFO: Loaded SimpleProgram <strong>Hello from SimpleProgram!</strong> Sep 16, 2016 2:17:50 PM org.z0ltan.client.Client testSimpleProgram INFO: Finished testing SimpleProgram Sep 16, 2016 2:17:50 PM org.z0ltan.client.Client testComplexProgram INFO: Testing ComplexProgram Sep 16, 2016 2:17:50 PM com.z0ltan.loaders.CompilingClassLoader loadClassFromString INFO: Loading foo.bar.baz.quux.ComplexProgram Sep 16, 2016 2:17:50 PM com.z0ltan.compilers.JavaStringCompiler compileStringCode INFO: Compiling: foo.bar.baz.quux.ComplexProgram Sep 16, 2016 2:17:50 PM com.z0ltan.compilers.JavaStringCompiler compileStringCode INFO: Finished compiling: foo.bar.baz.quux.ComplexProgram Sep 16, 2016 2:17:50 PM com.z0ltan.loaders.CompilingClassLoader loadClassFromString INFO: Loaded foo.bar.baz.quux.ComplexProgram <strong>'Sup from Fubar Random number = 63</strong> Sep 16, 2016 2:17:50 PM org.z0ltan.client.Client testComplexProgram INFO: Finished testing ComplexProgram ### And just to verify that no .class files are left in the file system: Timmys-MacBook-Pro:Better z0ltan$ ls
Excellent! That’s much better.
## Conclusion
Top
Well, that was much more satisfying that the unnecessary complexity (and extra work!) of the previous version of this program. Now there is better separation of concerns, better diagnostics, and is much easier to read and understand.
Till next time then, folks!
# How to compile a Java program embedded in a String? Here’s how!
Taking a small break from the mini-series on interop between languages (and also working on the main project – embedding a JVM instance in a Common Lisp image), I thought I’d share something that I frankly found amazing – how to compile and run a complete Java program contained inside a Java String! Who needs files any more, eh?
The implications of this are enormous – this means that on any machine where there is a JVM (version 6 or above) installed, even without the JDK itself*, not only can we compile and run arbitrary Java code, but also pass around Java code in strings, and compile and run them on the fly!
*Of course, it’s understood that the compiler code itself must be available in some form – as a class file, or as a Jar file.
## Background
I had previously written a post on how to compile Java code using the classes in the javax.tools package. That deals with the first part of the equation – how to dynamically compile Java code without resorting to brittle approaches like spawning OS processes , and without any dependency on javac.
You can find that discussion here – Dynamic Compilation of Java code (no JDK).
In this post, we will focus on the second aspect – how to store an entire Java program inside a Java String instance, and then compile and run the code.
Note: Since the javax.tools package was introduced only in Java 6, it’s only natural to deduce that these examples will work only in Java 6 (or above).
All right then, let’s get on with it!
## Implementation
Top
The implementation will be in two parts. We’ll first implement a solution that appears to do the job – it can compile a Java program contained inside a string, and in many cases, even run it perfectly.
However, there is a major problem with the first implementation that we will then propose to fix by taking care of the various scenarios that might crop up in real-world use.
### A first go
Top
The way we implement this solution is quite similar to the one that we used to compile Java source files. I recommend checking out the earlier post (mentioned in the Background section), but in the case of compiling a Java source string, we just have the following steps:
• Get an instance of JavaCompiler using ToolProvider.
• Construct the “compilation units” (which are instances of Iterable. In this specific case, we will need to construct a sub-type of SimpleJavaFileObject to pass in as the “compilation unit”.
• Finally, create a compilation task using the compiler, and invoke call.
Well, that’s the general idea anyway. Let’s code that up now:
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.Arrays;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.util.logging.Logger;
import java.net.URI;
import javax.tools.ToolProvider;
import javax.tools.JavaCompiler;
import javax.tools.SimpleJavaFileObject;
import javax.tools.JavaFileObject;
import javax.tools.JavaFileObject.Kind;
public enum JavaStringCompilerBasic {
INSTANCE;
private final JavaCompiler compiler;
private Pattern namePattern;
private JavaStringCompilerBasic() {
this.compiler = ToolProvider.getSystemJavaCompiler();
this.namePattern = Pattern.compile(".*class[ ]+([a-zA-Z0-9$_]+).*"); } // class that defines the Java String object as a valid source file class EmbeddedJavaSource extends SimpleJavaFileObject { private String code; EmbeddedJavaSource(final String name, final String code) { super(URI.create("string:///" + name.replace('.', File.separatorChar) + Kind.SOURCE.extension), Kind.SOURCE); this.code = code; } @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) { return this.code; } } /** * Compile the Java code embedded inside the String. * * @param program Java code */ public void compileJavaString(final String program) { final String className = getClassName(program); final EmbeddedJavaSource sourceString = new EmbeddedJavaSource(className, program); ; compiler.getTask(null, null, null, null, null, Collections.unmodifiableList(Arrays.asList(sourceString))).call(); } private String getClassName(final String program) { final Matcher m = namePattern.matcher(program); if (m.matches() && (m.groupCount() == 1)) { return m.group(1); } else { throw new RuntimeException("Could not extract class name"); } } public static void main(String[] args) { final String demoProgram = "public class DemoProgram { " + " public static void main(String[] args) { " + " System.out.println(\"Hello from DemoProgram!\");" + " }" + "}"; JavaStringCompilerBasic.INSTANCE.compileJavaString(demoProgram); } } As you can see, our little demo program is stored inside the demoProgram variable in the main method. final String demoProgram = "public class DemoProgram { " + " public static void main(String[] args) { " + " System.out.println(\"Hello from DemoProgram!\");" + " }" + "}"; Notes:: The main point of interest here is the EmbeddedJavaSource class which extends SimpleJavaFileObject. In this case, it doesn’t do much apart from creating a pseudo-URI pertaining to the fully-qualified name of the class (within the Java string). Take it for a little spin: Timmys-MacBook-Pro:Basic z0ltan$ javac -cp . JavaStringCompilerBasic.java
Timmys-MacBook-Pro:Basic z0ltan$java -cp . JavaStringCompilerBasic Timmys-MacBook-Pro:Basic z0ltan$ java -cp . DemoProgram
Hello from DemoProgram!
Brilliant! Everything seems hunky-dory. Well, not quite. Let’s clean out the class files and try out another example to see if it is indeed working as we expect it to:
Here is the snippet we add to main:
final String problemProgram = "package com.foo.bar;" + "public class ProblemDemoProgram {" + " public static void main(String[] args) {" + " System.out.println(\"Hello from ProblemDemoProgram!\");" + " }" + "}";
So what’s the problem? Let’s run it:
Timmys-MacBook-Pro:Basic z0ltan$java -cp . ProblemDemoProgram Error: Could not find or load main class ProblemDemoProgram Ah! That doesn’t look too good! What really happened is this – The compilation went through fine because the compiler doesn’t really care what the package definition inside the embedded Java program is (because the file doesn’t really exist on the file system now, does it?). So it goes ahead and generates the .class file anyway. Now, when we try to run it, the java tool reads the byte code, sees a package declaration com.foo.bar, and tries to load up com/foo/bar/ProblemDemoProgram.class which, clearly, doesn’t exist! So how do we fix it? The solution I propose it to ensure that the use case does succeed instead of failing. I propose reading the package information from the embedded Java program, parsing out the package details (if any), and creating that entire directory structure, and copying the .class file into that directory structure. This will ensure that when java goes looking for DemoProgram.class, it really does find it, load it, and run it. We’ll see how that solution might look like in the next section. ### Final version Top import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.util.Collections; import java.util.Arrays; import java.util.regex.Pattern; import java.util.regex.Matcher; import java.util.logging.Logger; import java.net.URI; import javax.tools.ToolProvider; import javax.tools.JavaCompiler; import javax.tools.SimpleJavaFileObject; import javax.tools.JavaFileObject; import static javax.tools.JavaFileObject.Kind; public enum JavaStringCompilerFinal { INSTANCE; private final JavaCompiler compiler; private Pattern namePattern; private Pattern pkgPattern; private JavaStringCompilerFinal() { this.compiler = ToolProvider.getSystemJavaCompiler(); this.namePattern = Pattern.compile(".*class[ ]+([a-zA-Z0-9$_]+).*");
this.pkgPattern = Pattern.compile(".*package[ ]+([a-zA-Z0-9$_.]+).*"); } // class that defines the Java String object as a valid source file class EmbeddedJavaSource extends SimpleJavaFileObject { private String code; EmbeddedJavaSource(final String name, final String code) { super(URI.create("string:///" + name.replace('.', File.separatorChar) + Kind.SOURCE.extension), Kind.SOURCE); this.code = code; } @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) { return this.code; } } /** * Compile the Java code embedded inside the String. * * @param program Java code */ public void compileJavaString(final String program) { String className = getClassName(program); final String packagePath = getPackagePath(program); if (packagePath != null) { makePackagePaths(packagePath); className = packagePath + '.' + className; } final EmbeddedJavaSource sourceString = new EmbeddedJavaSource(className, program); compiler.getTask(null, null, null, null, null, Collections.unmodifiableList(Arrays.asList(sourceString))).call(); // move the compiled class into the created folder if (packagePath != null) { moveClassIntoPackagePath(className); } } private void moveClassIntoPackagePath(final String className) { final String sourceFile = className.substring(className.lastIndexOf('.') +1) + ".class"; final String targetFile = className.substring(0, className.lastIndexOf('.')) .replace('.', File.separatorChar) + File.separatorChar + sourceFile; try { Files.move(Paths.get(sourceFile), Paths.get(targetFile), StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { throw new RuntimeException("Error while moving file: " + sourceFile + " to " + targetFile + ". Message = " + ex.getLocalizedMessage()); } } private void makePackagePaths(final String pkgPath) { final String pkgFilePath = pkgPath.replace('.', File.separatorChar); try { if (!Files.exists(Paths.get(pkgFilePath))) { Files.createDirectories(Paths.get(pkgFilePath)); } } catch (IOException ex) { throw new RuntimeException("Could not create directories: " + pkgFilePath); } } private String getPackagePath(final String program) { final Matcher m = pkgPattern.matcher(program); if (m.matches() && (m.groupCount() == 1)) { return m.group(1); } return null; } private String getClassName(final String program) { final Matcher m = namePattern.matcher(program); if (m.matches() && (m.groupCount() == 1)) { return m.group(1); } else { throw new RuntimeException("Could not extract class name"); } } public static void main(String[] args) { final String demoProgram = "public class DemoProgram { " + " public static void main(String[] args) { " + " System.out.println(\"Hello from DemoProgram!\");" + " }" + "}"; JavaStringCompilerFinal.INSTANCE.compileJavaString(demoProgram); final String problemProgram = "package com.foo.bar;" + "public class ProblemDemoProgram {" + " public static void main(String[] args) {" + " System.out.println(\"Hello from ProblemDemoProgram!\");" + " }" + "}"; JavaStringCompilerFinal.INSTANCE.compileJavaString(problemProgram); } } And a sample test run with the same example as in the previous section: Timmys-MacBook-Pro:Final z0ltan$ javac -cp . JavaStringCompilerFinal.java
Timmys-MacBook-Pro:Final z0ltan$java -cp . JavaStringCompilerFinal Timmys-MacBook-Pro:Final z0ltan$ ls
DemoProgram.class JavaStringCompilerFinal.class com
JavaStringCompilerFinal$EmbeddedJavaSource.class JavaStringCompilerFinal.java Timmys-MacBook-Pro:Final z0ltan$ java -cp . DemoProgram
Hello from DemoProgram!
Timmys-MacBook-Pro:Final z0ltan$java -cp . com.foo.bar.ProblemDemoProgram Hello from ProblemDemoProgram! Timmys-MacBook-Pro:Final z0ltan$ tree com/
com/
└── foo
└── bar
└── ProblemDemoProgram.class
2 directories, 1 file
Woo-hoo! As we can see, the directory structure is created, the .class file moved into the directory, and the code runs beautifully.
Some observations:
The only difference from the first version is that we have added extra code to create the directories (using regex to extract the relevant details from the program code), compiled the Java code stored in the strings, and copied the class file to the relevant directories. The program is then invoked normally by specifying the full class path of the Java class.
Of course, the javax.tools package is primarily aimed at compiler writers who want to create custom compilers on top of Java, but covering that use case is beyond the scope of this blog.
For instance, the better approach would have been to implement a custom JavaFileManager that then implemented the creation of the directories (if needed), or we could have used a Class Loader to load the compiled class (in case we don’t need the source, etc. The possibilities are endless!
## References
Top
Here is basically the only reference that you need (really) to get started with this topic, and run with it!
Till next time then, folks!
# Basic Concurrency and Parallelism in Common Lisp – Part 4b (Parallelism using lparallel – Error Handling)
In this final part, we will discuss the very important topic of error handling, how lparallel handles it, and cap off the series with a small benchmarking example that will tie in all the concepts covered thus far.
The demo will help check actual core usage on the machine when using the lparallel library.
## Initial Setup
There is no additional setup required for this tutorial from the last tutorial.
In case you missed it, please check out the previous post – Parallelism fundamentals using lparallel.
## 5-minute Error Handling refresher
Before we jump headlong into the demos, here is quick refresher guide to Conditions and Restarts in Common Lisp (error handling). In case you are comfortably familiar with this topic, please skip ahead to the next section.
In case you are a novice interested in getting a more comprehensive treatment of Conditions and Restarts in Common Lisp, I recommend two things – firstly, check out my detailed post on the fundamentals of Conditions and Restarts in Common Lisp, and secondly, check out the links in the References section at the end of this post.
For our refresher, let’s take a simple example. We have a custom square root function. To keeps things simple, let us have a single check to ensure that the argument is zero or positive. We will forego all other validation.
First we define the relevant error condition:
(defpackage :positive-sqrt-user
(:use :cl))
(in-package :positive-sqrt-user)
;;; define the error condition
(define-condition negative-error (error)
Now let’s define the square root function itself. It is a simple implementation of the Newton-Raphson algorithm for finding the square root of a positive number (or zero). We take the first approximation/guess as 1.0d0:
(defconstant +eps+ 1e-9)
(defun square-root (n)
"Find the square root using the Newton-Raphson method."
(if (< n 0)
(error 'negative-error :message "number must be zero or positive"))
(let ((f 1.0d0))
(loop
when (< (abs (- (* f f) n)) +eps+)
do (return f)
do (setf f (/ (+ f (/ n f)) 2.0d0)))))
Nothing special there. The function simply loops until the candidate square root is within acceptable limits from the actual square root of the argument. For the sake of completion, the key step in the algorithm is the following:
(setf f (/ (+ f (/ n f)) 2.0d0)
This is as per the formula for calculating the next square root approximation at each stage:
$x_{n} = \frac{1}{2}\left(x_{n-1}+ \frac{n}{f}\right)$
In terms of error handling, we can handle the error in three different canonical ways (amongst others).
First, we can catch and process the error directly (similar to the try-catch-finally construct in some other languages:
;;; handle the error directly
(defun test-sqrt-handler-case ()
(let ((n (progn
(princ "Enter a number: ")
(unwind-protect (handler-case (square-root n)
(negative-error (o) (format t "Caught ~a~%" (error-message o)) nil))
(format t "Nothing to clean up!"))))
Testing it out:
POSITIVE-SQRT-USER> (test-sqrt-handler-case)
Enter a number: 200
Nothing to clean up!
14.142135623730955d0
POSITIVE-SQRT-USER> (test-sqrt-handler-case)
Enter a number: -200
Caught number must be zero or positive
Nothing to clean up!
NIL
Or, we could handle it automatically using a restart. Suppose we want to automatically return 1.0d0 as the result if we encounter an invalid argument to square-root, we could something like this:
;;; automatic restart
(defun test-sqrt-handler-bind ()
(let ((n (progn
(princ "Enter a number: ")
(handler-bind
((negative-error #'(lambda (c)
(format t "Caught: ~a~%" (error-message c))
(invoke-restart 'return-one))))
(restart-case (square-root n)
(return-one () 1.0d0)))))
Test run:
POSITIVE-SQRT-USER> (test-sqrt-handler-bind)
Enter a number: 200
14.142135623730955d0
POSITIVE-SQRT-USER> (test-sqrt-handler-bind)
Enter a number: -200
Caught: number must be zero or positive
1.0d0
Of course, the real usefulness of this scheme is realised when we have more restart cases available than these trivial ones.
And finally, we could handle it interactively, which allows us to enter a new value for the argument to square-root. (This interactive mode of development/operation is unique to the Lisp world).
(defun read-new-value ()
(format *query-io* "Enter a new value: ")
(force-output *query-io*)
;;; Interactive restart
(defun test-sqrt-interactive ()
(let ((n (progn
(princ "Enter a number: ")
(restart-case (square-root n)
(return-nil () nil)
(enter-new-value (num)
:report "Try entering a positive number.”
(square-root num)))))
Test drive!
POSITIVE-SQRT-USER> (test-sqrt-interactive)
Enter a number: 200
14.142135623730955d0
POSITIVE-SQRT-USER> (test-sqrt-interactive)
Enter a number: -200
Condition POSITIVE-SQRT-USER::NEGATIVE-ERROR was signalled.
[Condition of type NEGATIVE-ERROR]
Restarts:
0: [RETURN-NIL] RETURN-NIL
1: [ENTER-NEW-VALUE] Try entering a positive number.
2: [RETRY] Retry SLIME REPL evaluation request.
Enter a new value: 200
14.142135623730955d0
## Error Handling in lparallel
Top
lparallel provides the lparallel:task-handler-bind construct. This is, for all means and purposes, equivalent to the handler-bind construct in Common Lisp. However, it is optimised for error handling inside of parallel tasks launched using the lparallel library.
### The problem
Top
Why is this important? Well, take the following example for instance:
(define-condition foo (error) ())
;;; error handling with handler-bind
(defun test-errors-normal ()
(handler-bind
((foo #'(lambda (c)
(declare (ignore c))
(invoke-restart 'print-error-message))))
(pmap 'vector #'(lambda (x)
(declare (ignore x))
(restart-case (error 'foo)
(print-error-message () "error!")))
'(1 2 3 4 5))))
We declare a handler-bind in the current thread, and we invoke the restart print-error-message when we encounter an error of type foo.
Then we have a single pmap task inside the handler-bind. Notice that we define the restart-case inside the lambda function passed to pmap.
Now, inside the lambda function, we explicitly signal foo. Our expectation then is that the result of the operation is a vector of size 5, with each element being “error!”, right? Wrong! Here’s what we get instead:
Condition CONDS-RESTARTS-USER::FOO was signalled.
[Condition of type CONDS-RESTARTS-USER::FOO]
Restarts:
0: [PRINT-ERROR-MESSAGE] CONDS-RESTARTS-USER::PRINT-ERROR-MESSAGE
1: [TRANSFER-ERROR] Transfer this error to a dependent thread, if one exists.
2: [KILL-ERRORS] Kill errors in workers (remove debugger instances).
So what happened? The transfer-error restart case presents a clue. The reason the code didn’t’ work is because the error was spawned in a different context (inside a task), whereas we are trying to handle it in the current thread. To fix this, we can modify the code so that handler-bind is places inside the lambda function itself, in the same thread context:
;;; error handling with handler-bind modified
(defun test-errors-normal-modified ()
(pmap 'vector #'(lambda (x)
(declare (ignore x))
(handler-bind
((foo #'(lambda (c)
(declare (ignore c))
(invoke-restart 'print-error-message))))
(restart-case (error 'foo)
(print-error-message () "error!"))))
'(1 2 3 4 5)))
Take it for a spin:
CONDS-RESTARTS-USER> (test-errors-normal-modified)
#("error!" "error!" "error!" "error!" "error!")
And now we see the correct output! However, this approach does not scale. Imagine having 100 tasks, each with its own handler-bind! This is one of the compelling reasons we should use what the library provides us – lparallel:task-handler-bind as we shall see next.
### The solution
Top
The lparallel:task-handler-bind version of the code looks so:
;;; error handling with task-handler-bind
(defun test-errors-lparallel ()
((foo #'(lambda (c)
(declare (ignore c))
(invoke-restart 'print-error-message))))
(pmap 'vector #'(lambda (x)
(declare (ignore x))
(restart-case (error 'foo)
(print-error-message () "error!")))
'(1 2 3 4 5))))
And the output is exactly what we expect:
CONDS-RESTARTS-USER> (test-errors-lparallel)
#("error!" "error!" "error!" "error!" "error!")
All we did was to replace handler-bind with lparallel:task-handler-bind in the original code!
Note: You can still override the behaviour per task using: (lparallel:task-handler-bind ((error #’invoke-transfer-error)…), which automatically transfers the error to a thread capable of providing a proper restart for the error condition (if available), by using (lparallel:task-handler-bind ((error #’invoke-transfer-error) …) to always trigger the debugger (good for interactive mode).
Let’s move on now to the demo to complete this whole series!
## Demos
Top
The best way of observing performance differences between parallel and non-parallel operations is through a real example (albeit a simple one).
### Prime number generation
Top
The code:
;;;; A benchmarking demo using prime number generation.
(defpackage :benchmarking-demo
(:use :cl :lparallel))
(in-package :benchmarking-demo)
;;; error conditions
(define-condition prime-number-error (error) ())
(defun primep (x)
(cond ((<= x 0)
(error 'prime-number-error))
((= x 1)
nil)
((= x 2)
t)
(t (loop for i from 2 to (floor (sqrt x))
when (zerop (mod x i))
do (return nil)
finally (return t)))))
;;; prime number generation
(defun gen-prime-numbers (start end)
(premove-if-not #'(lambda (x)
(restart-case (if (primep x) t nil)
(just-continue () nil)))
(loop for i from start to end
collect i)))
(defun prime-client ()
((prime-number-error #'(lambda (c)
(declare (ignore c))
(invoke-restart 'just-continue))))
(dotimes (i 1000000000000)
(gen-prime-numbers (1+ i) (+ i 1000000))
(incf i 1000000))))
This is a direct implementation of the basic prime number generation algorithm – test from 2 upto sqrt(number) for divisibility. I’m basically creating 1e6 chunks of 1e6 numbers each for the prime number test.
premove-if-not simply filters out the prime numbers from the list that is created from the start and end arguments to gen-prime-numbers.
The code took a long long time to run, and I could hear the poor machine hissing in protest (I just killed the process after 15 minutes), but on the bright side, all the cores were overloaded full time. Note that I don’t collect the generated numbers into a list because that would definitely have crashed SLIME in any case if I had let it run on.
I had contemplated doing another demo with matrix multiplication, but from an edificational perspective, this single demo seems to have done the job, so I’ll skip matrix multiplication for now.
## References
Top
Some additional useful references (definitely check out the video in the second link. Patrick Stein’s tutorial using a simple range class example is most excellent):
That concludes this series on Concurrency and Parallelism using Common Lisp! Next up, we will discuss another extremely important topic – interop between languages. That will also be a mini-series of sorts, and I might throw in a random but useful post in between (depending on what interests me at that point!).
Till then, happy hacking!
# A modest attempt at simulating a page printing script using plain JavaScript
This is a small bit of nano-project that I did recently just for fun! The whole project took no more than 5 minutes to code up, and another 10 minutes to test out (you’ll understand why when you see the code!)
The idea came about when I used to be on Quora. I had decided to quit Quora due to the fast falling quality of the site, and the clearly biased moderation in place there, especially with regards to American politics. Anyway, the details are not important.
It so happened that I had accumulated quite a few bookmarked answers and questions during my time there. I decided to download them locally (preferably in PDF format) to my local machine. Since Quora doesn’t offer any such facility, I decided to search for it online. Five minutes of Googling led to to a nice Chrome extension.
It worked well enough for my needs, but it got me thinking. How the tool operated (from a user’s perspective) was so:
• Log on to Quora
• Click on the timestamp on an answer
• Upon clicking this link, the Chrome print dialog pops out, allowing saving the page in PDF
Pretty nifty, isn’t it? After a couple of minutes of thought, I realised that the task wasn’t really that complicated for two reasons:
1. This was a Chrome extension, and chrome has supported “Print to PDF” for quite some time now, and
2. The extension required the user to explicitly click on the timestamp of an answer. It did not seem to work for questions as a whole
My reasoning went like this: simulating the script on a local system, or on a website that I own is quite easy. I can simply add event listeners to specific buttons and links, and invoke window.print() to open the Chrome print dialog.
However, modifying a third-party site wouldn’t be that easy. Since the user has to click on the timestamp of an answer to generate the “Download” link, clearly the script is trying to get some spam or div DOM node that he can append his link object to. However, there can be many such nodes with dynamically generated IDs.
This implies that Chrome’s extensions tools/APIs must provide functionality to checks for click events, and get then get a handle to the specific node currently activated. This then makes it trivial to append the node, add an event listener, and simply trigger window.print()!
Following this logic, I created a simple demo on my local system that uses a minimal static page with a button. On clicking this button, a download link appears, and then when this hyperlink it clicked, it pops out the Chrome print dialog!
Let’s see it in action!
## Demo
Simply save the code into a a file with an html extension.
Now fire it up in Chrome (it works on Safari as well, haven’t tested it on other browsers, but should work on most modern browsers that at least support addEventListener).
Click on the button.
## The Code
The code is absolutely dead simple, and was cooked up to demonstrate this simple demo. So, don’t go looking for loopholes!🙂
<!DOCTYPE html>
<html lang="en">
<title>Testing window.print()</title>
<style language="text/css">
h1 {
text-align:center;
}
#centeredDiv, .myDiv, .hidden, .visible {
text-align:center;
}
.hidden {
display:none;
}
.visible {
display:block;
}
</style>
<body>
<h1>This is a print page demo</h1>
<div id="centeredDiv">
<button id="myButton">Click me</button></div>
<script type="text/javascript">
function init() {
var myButton = document.getElementById("myButton");
if (myButton) {
var centeredDiv = document.getElementById("centeredDiv");
if (centeredDiv) {
}
window.print();
});
}
});
}
}
var body = document.getElementsByTagName("body")[0];
</script>
</body>
Explanation: The code is dead straightforward. We just have a button inside a div. Once the body of the page has been loaded, we append an event listener to the button.
When the button is clicked, we create an anchor object dynamically, set up its properties, and append it to the same div that contains the button. We also append a hyperlink to this new anchor object so that when it is clicked, we set its class to hidden, and invoke window.print() that brings out the browser’s print dialog.
The CSS rules simply define when the dynamically created anchor object is visible (when created), or hidden (once clicked). Really, that’s all there is to it!
## Wrap-up
Well, this was a small fun project that didn’t take much time, and also exercised my (admittedly rusty) JavaScript skills!
I encourage you to take inspiration from daily situations and implement small and simple solutions to problems you certainly face every day. These can provide great fun and be a good refresher for your own skills. That just goes to show that the best project ideas come from personal needs rather than coding up from a list compiled by someone else.
Have fun!
# Basic Concurrency and Parallelism in Common Lisp – Part 4a (Parallelism using lparallel – fundamentals)
In these concluding parts of this mini-series, we will have a taste of parallel programming in Common Lisp using the lparallel library.
It is important to note that lparallel also provides extensive support for asynchronous programming, and is not a purely parallel programming library. As stated before, parallelism is merely an abstract concept in which tasks are conceptually independent of one another.
## Installation
lparallel can be installed using Quicklisp. In case you are not sure about how Quicklisp works, please check my previous post on how to setup a Common Lisp environment.
CL-USER> (ql:system-apropos "lparallel")
#<SYSTEM lparallel / lparallel-20160825-git / quicklisp 2016-08-25>
#<SYSTEM lparallel-bench / lparallel-20160825-git / quicklisp 2016-08-25>
#<SYSTEM lparallel-test / lparallel-20160825-git / quicklisp 2016-08-25>
; No value
Looks like it is. Let’s go ahead and install it:
CL-USER> (ql:quickload :lparallel)
Install 1 Quicklisp release:
lparallel
; Fetching #<URL "http://beta.quicklisp.org/archive/lparallel/2016-08-25/lparallel-20160825-git.tgz">
; 76.71KB
==================================================
78,551 bytes in 0.62 seconds (124.33KB/sec)
[package lparallel.util]..........................
[package lparallel.raw-queue].....................
[package lparallel.cons-queue]....................
[package lparallel.vector-queue]..................
[package lparallel.queue].........................
[package lparallel.counter].......................
[package lparallel.spin-queue]....................
[package lparallel.kernel]........................
[package lparallel.kernel-util]...................
[package lparallel.promise].......................
[package lparallel.ptree].........................
[package lparallel.slet]..........................
[package lparallel.defpun]........................
[package lparallel.cognate].......................
[package lparallel]
(:LPARALLEL)
And that’s all it took! Now let’s see how this library actually works.
## The lparallel library
Top
The lparallel library is built on top of the Bordeaux threading library (see previous post for more on this library).
As mentioned in the previous post, parallelism and concurrency can be (and usually are) implemented using the same means — threads, processes, etc. The difference between lies in their conceptual differences.
Note that not all the examples shown in this post are necessarily parallel. Asynchronous constructs such as Promises and Futures are, in particular, more suited to concurrent programming than parallel programming.
The modus operandi of using the lparallel library (for a basic use case) is as follows:
• Create an instance of what the library calls a kernel using lparallel:make-kernel. The kernel is the component that schedules and executes tasks.
• Design the code in terms of futures, promises and other higher level functional concepts. To this end, lparallel provides support for channels, promises, futures, and cognates.
• Perform operations using what the library calls cognates, which are simply functions which have equivalents in the Common Lisp language itself. For instance, the lparallel:pmap function is the parallel equivalent of the Common Lisp map function.
• Finally, close the kernel created in the first step using lparallel:end-kernel.
Note that the onus of ensuring that the tasks being carried out are logically parallelisable as well as taking care of all mutable state is on the developer.
## Demos
Top
First, let’s get hold of the number of threads that we are going to use for our parallel examples. Ideally, we’d like to have a 1:1 match between the number of worker threads and the number of available cores.
We can use the wonderful cffi library to this end. I plan to have a detailed blog post for this extremely useful library soon, but for now, let’s get on with it:
Install CFFI:
CL-USER> (ql:quickload :cffi)
alexandria babel trivial-features uiop
Install 1 Quicklisp release:
cffi
; Fetching #<URL "http://beta.quicklisp.org/archive/cffi/2016-03-18/cffi_0.17.1.tgz">
; 234.48KB
==================================================
240,107 bytes in 5.98 seconds (39.22KB/sec)
[package cffi-sys]................................
[package cffi]....................................
..................................................
[package cffi-features]
(:CFFI)
Write C code to get the number of logical cores on the machine:
#include <stdio.h>
#include <sys/types.h>
#include <sys/sysctl.h>
int get_core_count();
int main()
{
printf("%d\n", get_core_count());
return 0;
}
int32_t get_core_count()
{
const char* s = "hw.logicalcpu";
int32_t core_count;
size_t len = sizeof(core_count);
sysctlbyname(s, &core_count, &len, NULL, 0);
return core_count;
}
Bundle the C code into a shared library (note, I am using Mac OS X which comes bundled with Clang. For pure gcc, refer to the relevant documentation):
Timmys-MacBook-Pro:Parallelism z0ltan$clang -dynamiclib get_core_count.c -o libcorecount.dylib Invoke the function from Common Lisp: CL-USER> (cffi:use-foreign-library "libcorecount.dylib") #<CFFI:FOREIGN-LIBRARY LIBCORECOUNT.DYLIB-853 "libcorecount.dylib"> CL-USER> (cffi:foreign-funcall "get_core_count" :int) 8 We can see that the result is 8 cores on the machine (which is correct) and can be verified from the command line as well: Timmys-MacBook-Pro:Parallelism z0ltan$ sysctl -n "hw.logicalcpu"
8
### Common Setup
Top
In this example, we will go through the initial setup bit, and also show some useful information once the setup is done.
CL-USER> (ql:quickload :lparallel)
lparallel
(:LPARALLEL)
Initialise the lparallel kernel:
CL-USER> (setf lparallel:*kernel* (lparallel:make-kernel 8 :name "custom-kernel"))
#<LPARALLEL.KERNEL:KERNEL :NAME "custom-kernel" :WORKER-COUNT 8 :USE-CALLER NIL :ALIVE T :SPIN-COUNT 2000 {1003141F03}>
Note that the *kernel* global variable can be rebound — this allows multiple kernels to co-exist during the same run. Now, some useful information about the kernel:
CL-USER> (defun show-kernel-info ()
(let ((name (lparallel:kernel-name))
(count (lparallel:kernel-worker-count))
(context (lparallel:kernel-context))
(bindings (lparallel:kernel-bindings)))
(format t "Kernel name = ~a~%" name)
(format t "Worker threads count = ~d~%" count)
(format t "Kernel context = ~a~%" context)
(format t "Kernel bindings = ~a~%" bindings)))
WARNING: redefining COMMON-LISP-USER::SHOW-KERNEL-INFO in DEFUN
SHOW-KERNEL-INFO
CL-USER> (show-kernel-info)
Kernel name = custom-kernel
Kernel context = #<FUNCTION FUNCALL>
Kernel bindings = ((*STANDARD-OUTPUT* . #<SLIME-OUTPUT-STREAM {10044EEEA3}>)
(*ERROR-OUTPUT* . #<SLIME-OUTPUT-STREAM {10044EEEA3}>))
NIL
End the kernel (this is important since *kernel* does not get garbage collected until we explictly end it):
CL-USER> (lparallel:end-kernel :wait t)
Let’s move on to some more examples of different aspects of the lparallel library.
For these demos, we will be using the following initial setup from a coding perspective:
(require ‘lparallel)
(require ‘bt-semaphore)
(defpackage :lparallel-user
(:use :cl :lparallel :lparallel.queue :bt-semaphore))
(in-package :lparallel-user)
;;; initialise the kernel
(defun init ()
(setf *kernel* (make-kernel 8 :name "channel-queue-kernel")))
(init)
So we will be using a kernel with 8 worker threads (one for each CPU core on the machine).
And once we’re done will all the examples, the following code will be run to close the kernel and free all used system resources:
;;; shut the kernel down
(defun shutdown ()
(end-kernel :wait t))
(shutdown)
### Using channels and queues
Top
First some definitions are in order.
A task is a job that is submitted to the kernel. It is simply a function object along with its arguments.
A channel in lparallel is similar to the same concept in Go. A channel is simply a means of communication with a worker thread. In our case, it is one particular way of submitting tasks to the kernel.
For instance, we can calculate the square of a number as:
(defun calculate-square (n)
(let* ((channel (lparallel:make-channel))
(res nil))
(* x x))
n)
(format t "Square of ~d = ~d~%" n res)))
And the output:
LPARALLEL-USER> (calculate-square 100)
Square of 100 = 10000
NIL
Now let’s try submitting multiple tasks to the same channel. In this simple example, we are simpy creating three tasks that square, triple, and quadrupls the supplied input respectively.
Note that in case of multiple tasks, the output will be in non-deterministic order:
(defun test-basic-channel-multiple-tasks ()
(let ((channel (make-channel))
(res '()))
(* x x))
10)
(* y y y))
10)
(* z z z z))
10)
(dotimes (i 3 res)
And the output:
LPARALLEL-USER> (dotimes (i 3)
(100 1000 10000)
(100 1000 10000)
(10000 1000 100)
NIL
lparallel also provides support for creating a blocking queue in order to enable message passing between worker threads. A queue is created using lparallel.queue:make-queue
Some useful functions for using queues are:
• lparallel.queue:make-queue: create a FIFO blocking queue
• lparallel.queue:push-queue: insert an element into the queue
• lparallel.queue:pop-queue: pop an item from the queue
• lparallel.queue:peek-queue: inspect value without popping it
• lparallel.queue:queue-count: the number of entries in the queue
• lparallel.queue:queue-full-p: check if the queue is full
• lparallel.queue:queue-empty-p:check if the queue is empty
• lparallel.queue:with-locked-queue: lock the queue during access
• A basic demo showing basic queue properties:
(defun test-queue-properties ()
(let ((queue (make-queue :fixed-capacity 5)))
(loop
when (queue-full-p queue)
do (return)
do (push-queue (random 100) queue))
(print (queue-full-p queue))
(loop
when (queue-empty-p queue)
do (return)
do (print (pop-queue queue)))
(print (queue-empty-p queue)))
nil)
Which produces:
LPARALLEL-USER> (test-queue-properties)
T
17
51
55
42
82
T
NIL
Note: lparallel.queue:make-queue is a generic interface which is actually backed by different types of queues. For instance, in the previous example, the actual type of the queue is lparallel.vector-queue since we specified it to be of fixed size using the :fixed-capacity keyword argument.
The documentation doesn’t actually specify what keyword arguments we can pass to lparallel.queue:make-queue, so let’s and find that out in a different way:
LPARALLEL-USER> (describe 'lparallel.queue:make-queue)
LPARALLEL.QUEUE:MAKE-QUEUE
[symbol]
MAKE-QUEUE names a compiled function:
Lambda-list: (&REST ARGS)
Derived type: FUNCTION
Documentation:
Create a queue.
The queue contents may be initialized with the keyword argument
initial-contents'.
By default there is no limit on the queue capacity. Passing a
fixed-capacity' keyword argument limits the capacity to the value
passed. push-queue' will block for a full fixed-capacity queue.
Source file: /Users/z0ltan/quicklisp/dists/quicklisp/software/lparallel-20160825-git/src/queue.lisp
MAKE-QUEUE has a compiler-macro:
Source file: /Users/z0ltan/quicklisp/dists/quicklisp/software/lparallel-20160825-git/src/queue.lisp
; No value
So, as we can see, it supports the following keyword arguments – :fixed-capacity, and initial-contents.
Now, if we do specify :fixed-capacity, then the actual type of the queue will be lparallel.vector-queue, and if we skip that keyword argument, the queue will be of type lparallel.cons-queue (which is a queue of unlimited size), as can be seen from the output of the following snippet:
(defun check-queue-types ()
(let ((queue-one (make-queue :fixed-capacity 5))
(queue-two (make-queue)))
(format t "queue-one is of type: ~a~%" (type-of queue-one))
(format t "queue-two is of type: ~a~%" (type-of queue-two))))
LPARALLEL-USER> (check-queue-types)
queue-one is of type: VECTOR-QUEUE
queue-two is of type: CONS-QUEUE
NIL
Of course, you can always create instances of the specific queue types yourself, but it is always better, when you can, to stick to the generic interface and letting the library create the proper type of queue for you.
Now, let’s just see the queue in action!
(defun test-basic-queue ()
(let ((queue (make-queue))
(channel (make-channel))
(res '()))
(loop for entry = (pop-queue queue)
when (queue-empty-p queue)
do (return)
do (push (* entry entry) res))))
(dotimes (i 100)
(push-queue i queue))
(format t "~{~d ~}~%" res)))
Here we submit a single task that repeatedly scans the queue till it’s empty, pops the available values, and pushes them into the res list.
And the output:
LPARALLEL-USER> (test-basic-queue)
9604 9409 9216 9025 8836 8649 8464 8281 8100 7921 7744 7569 7396 7225 7056 6889 6724 6561 6400 6241 6084 5929 5776 5625 5476 5329 5184 5041 4900 4761 4624 4489 4356 4225 4096 3969 3844 3721 3600 3481 3364 3249 3136 3025 2916 2809 2704 2601 2500 2401 2304 2209 2116 2025 1936 1849 1764 1681 1600 1521 1444 1369 1296 1225 1156 1089 1024 961 900 841 784 729 676 625 576 529 484 441 400 361 324 289 256 225 196 169 144 121 100 81 64 49 36 25 16 9 4 1 0
NIL
Top
A small note mentioning the lparallel:kill-task function would be apropos at this juncture. This function is useful in those cases when tasks are unresponsive. The lparallel documentation clearly states that this must only be used as a last resort.
All tasks which are created are by default assigned a category of :default. The dynamic property, *task-category* holds this value, and can be dynamically bound to different values (as we shall see).
;;; kill default tasks
(let ((channel (make-channel))
(stream *query-io*))
(dotimes (i 10)
(sleep (random 10))
(format stream "~d~%" (* x x))) (random 10)))
(sleep (random 2))
Sample run:
LPARALLEL-USER> (test-kill-all-tasks)
16
1
8
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
Since we had created 10 tasks, all the 8 kernel worker threads were presumably busy with a task each. When we killed tasks of category :default, all these threads were killed as well and had to be regenerated (which is an expensive operation). This is part of the reason why lparallel:kill-tasks must be avoided.
Now, in the example above, all running tasks were killed since all of them belonged to the :default category. Suppose we wish to kill only specific tasks, we can do that by binding *task-category* when we create those tasks, and then specifying the category when we invoke lparallel:kill-tasks.
For example, suppose we have two categories of tasks – tasks which square their arguments, and tasks which cube theirs. Let’s assign them categories ’squaring-tasks and ’cubing-tasks respectively. Let’s then kill tasks of a randomly chosen category ’squaring-tasks or ’cubing-tasks.
Here is the code:
;;; kill tasks of a randomly chosen category
(let ((channel (make-channel))
(stream *query-io*))
(dotimes (i 5)
(sleep (random 5))
(format stream "~%[Squaring] ~d = ~d" x (* x x))) i)))
(dotimes (i 5)
(sleep (random 5))
(format stream "~%[Cubing] ~d = ~d" x (* x x x))) i)))
(sleep 1)
(if (evenp (random 10))
(progn
(progn
And here is a sample run:
LPARALLEL-USER> (test-kill-random-tasks)
[Cubing] 2 = 8
[Squaring] 4 = 16
[Cubing] 4
= [Cubing] 643 = 27
4
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
[Cubing] 1 = 1
[Cubing] 0 = 0
[Squaring] 1 = 1
[Squaring] 3 = 9
5
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
[Squaring] 2 = 4
WARNING: lparallel: Replacing lost or dead worker.
WARNING: lparallel: Replacing lost or dead worker.
[Squaring] 0 = 0
[Squaring] 4 = 16
### Using promises and futures
Top
Promises and Futures provide support for Asynchronous Programming.
In lparallel-speak, a lparallel:promise is a placeholder for a result which is fulfilled by providing it with a value. The promise object itself is created using lparallel:promise, and the promise is given a value using the lparallel:fulfill macro.
To check whether the promise has been fulfilled yet or not, we can use the lparallel:fulfilledp predicate function.
Finally, the lparallel:force function is used to extract the value out of the promise. Note that this function blocks until the operation is complete.
Let’s solidify these concepts with a very simple example first:
(defun test-promise ()
(let ((p (promise)))
(loop
(progn
(return))))
(force p)))
Which generates the output:
LPARALLEL-USER> (test-promise)
5
1
3
10
[/code]
Explanation: This simple example simply keeps looping forever until an even number has been entered. The promise is fulfilled inside the loop using lparallel:fulfill, and the value is then returned from the function by forcing it with lparallel:force.
Now, let’s take a bigger example. Assuming that we don’t want to have to wait for the promise to be fulfilled, and instead have the current do some useful work, we can delegate the promise fulfillment to external explicitly as seen in the next example.
Consider we have a function that squares its argument. And, for the sake of argument, it consumes a lot of time doing so. From our client code, we want to invoke it, and wait till the squared value is available.
(let ((p (promise))
(stream *query-io*)
(n (progn
(princ "Enter a number: ")
(format t "In main function...~%")
#'(lambda ()
(sleep (random 10))
(format stream "Inside thread... fulfilling promise~%")
(fulfill p (* n n))))
#'(lambda ()
(loop
when (fulfilledp p)
do (return)
do (progn
(format stream "~d~%" (random 100))
(sleep (* 0.01 (random 100)))))))
(format t "Inside main function, received value: ~d~%" (force p))))
And the output:
LPARALLEL-USER> (promise-with-threads)
Enter a number: 19
In main function...
44
59
90
34
30
76
Inside main function, received value: 361
NIL
Explanation: There is nothing much in this example. We create a promise object p, and we spawn off a thread that sleeps for some random time and then fulfills the promise by giving it a value.
Meanwhile, in the main thread, we spawn off another thread that keeps hecking if the promise has been fulfilled or not. If not, it prints some random number and continues checking. Once the promise has been fulfilled, we can extract the value using lparallel:force in the main thread as shown.
This shows that promises can be fulfilled by different threads while the code that created the promise need not wait for the promise to be fulfilled. This is especially important since, as mentioned before, lparallel:force is a blocking call. We want to delay forcing the promise until the value is actually available.
Another point to note when using promises is that once a promise has been fulfilled, invoking force on the same object will always return the same value. That is to say, a promise can be successfully fulfilled only once.
For instance:
(defun multiple-fulfilling ()
(let ((p (promise)))
(dotimes (i 10)
(fulfill p (random 100))
(format t "~d~%" (force p)))))
Which produces:
LPARALLEL-USER> (multiple-fulfilling)
15
15
15
15
15
15
15
15
15
15
NIL
So how does a future differ from a promise?
A lparallel:future is simply a promise that is run in parallel, and as such, it does not block the main thread like a default use of <code<lparallel:promise would. It is executed in its own thread (by the lparallel library, of course).
Here is a simple example of a future:
(defun test-future ()
(let ((f (future
(sleep (random 5))
(print "Hello from future!"))))
(loop
when (fulfilledp f)
do (return)
do (sleep (* 0.01 (random 100)))
(format t "~d~%" (random 100)))
(format t "~d~%" (force f))))
And the output:
LPARALLEL-USER> (test-future)
5
19
91
11
Hello from future!
NIL
Explanation: This exactly is similar to the promise-with-threads example. Observe two differences, however - first of all, the lparallel:future macro has a body as well. This allows the future to fulfill itself! What this means is that as soon as the body of the future is done executing, lparallel:fulfilledp will always return true for the future object.
Secondly, the future itself is spawned off on a separate thread by the library, so it does not interfere with the execution of the current thread very much unlike promises as could be seen in the promise-with-threads example (which needed an explicit thread for the fulfilling code in order to avoid blocking the current thread).
The most interesting bit is that (even in terms of the actual theory propounded by Dan Friedman and others), a Future is conceptually something that fulfills a Promise. That is to say, a promise is a contract that some value will be generated sometime in the future, and a future is precisely that “something” that does that job.
What this means is that even when using the lparallel library, the basic use of a future would be to fulfill a promise. This means that hacks like promise-with-threads need not be made by the user.
Let’s take a small example to demonstrate this point (a pretty contrived example, I must admit!).
Here’s the scenario: we want to read in a number and calculate its square. So we offload this work to another function, and continue with our own work. When the result is ready, we want it to be printed on the console without any intervention from us.
Here’s how the code looks:
;;; Callback example using promises and futures
(defun callback-promise-future-demo ()
(let* ((p (promise))
(stream *query-io*)
(n (progn
(princ "Enter a number: ")
(f (future
(sleep (random 10))
(fulfill p (* n n))
(force (future
(format stream "Square of ~d = ~d~%" n (force p)))))))
(loop
when (fulfilledp f)
do (return)
do (sleep (* 0.01 (random 100))))))
And the output:
LPARALLEL-USER> (callback-promise-future-demo)
Enter a number: 19
Square of 19 = 361
NIL
Explanation: All right, so first off, we create a promise to hold the squared value when it is generated. This is the p object. The input value is stored in the local variable n.
Then we create a future object f. This future simply squares the input value and fulfills the promise with this value. Finally, since we want to print the output in its own time, we force an anonymous future which simply prints the output string as shown.
Note that this is very similar to the situation in an environment like Node, where we pass callback functions to other functions with the understanding that the callback will be called when the invoked function is done with its work.
Finally note that the following snippet is still fine (even if it uses the blocking lparallel:force call because it’s on a separate thread):
(force (future (format stream "Square of ~d = ~d~%" n (force p))))
To summarise, the general idiom of usage is: define objects which will hold the results of asynchronous computations in promises, and use futures to fulfill those promises.
### Using cognates
Top
Cognates are argubaly the raison d’etre of the lparallel library. These constructs are what truly provide parallelism in the lparalle. Note, however, that most (if not all) of these constructs are built on top of futures and promises.
To put it in a nutshell, cognates are simply functions that are intended to be the parallel equivalents of their Common Lisp counterparts. However, there are a few extra lparallel cognates that have no Common Lisp equivalents.
At this juncture, it is important to know that cognates come in two basic flavours:
1. Constructs for fine-grained parallelism: defpun, plet, plet-if, etc.
2. Explicit functions and macros for performing parallel operations - pmap, preduce, psort, pdotimes, etc.
In the first case we don’t have much explicit control over the operations themselves. We mostly rely on the fact that the library itself will optimise and parallelise the forms to whatever extent it can. In this post, we will focus on the second category of cognates.
Take, for instance, the cognate function lparallel:pmap is exactly the same as the Common Lisp equivalent, map, but it runs in parallel. Let’s demonstrate that through an example.
Suppose we had a list of random strings of length varying from 3 to 10, and we wished to collect their lengths in a vector.
Let’s first set up the helper functions that will generate the random strings:
(defvar *chars*
(remove-duplicates
(sort
(loop for c across "The quick brown fox jumps over the lazy dog"
when (alpha-char-p c)
collect (char-downcase c))
#'char<)))
(defun get-random-strings (&optional (count 100000))
"generate random strings between lengths 3 and 10"
(loop repeat count
collect
(concatenate 'string (loop repeat (+ 3 (random 8))
collect (nth (random 26) *chars*)))))
And here’s how the Common Lisp map version of the solution might look like:
;;; map demo
(defun test-map ()
(map 'vector #'length (get-random-strings 100)))
And let’s have a test run:
LPARALLEL-USER> (test-map)
#(7 5 10 8 7 5 3 4 4 10)
And here’s the lparallel:pmap equivalent:
;;;pmap demo
(defun test-pmap ()
(pmap 'vector #'length (get-random-strings 100)))
which produces:
LPARALLEL-USER> (test-pmap)
#(8 7 6 7 6 4 5 6 5 7)
LPARALLEL-USER>
As you can see from the definitions of test-map and test-pmap, the syntax of the lparallel:map and lparallel:pmap functions are exactly the same (well, almost - lparallel:pmap has a few more optional arguments).
Some useful cognate functions and macros (all of them are functions except when marked so explicitly. Note that there are quite a few cognates, and I have chosen a few to try and represent every category through an example:
• lparallel:pmap:
Parallel version of map.
Note that all the mapping functions (lparallel:pmap, lparallel:pmapc,lparallel:pmapcar, etc.) are take two special keyword arguments - :size, specifiying the number of elements of the input sequence(s) to process, and :parts which specifies the number of parallel parts to divide the sequence(s) into.
;;; pmap - function
(defun test-pmap ()
(let ((numbers (loop for i below 10
collect i)))
(pmap 'vector #'(lambda (x)
(* x x))
:parts (length numbers)
numbers)))
Sample run:
LPARALLEL-USER> (test-pmap)
#(0 1 4 9 16 25 36 49 64 81)
• lparallel:por:
Parallel version of or. The behaviour is that it returns the first non-nil element amongst its arguments. However, due to the parallel nature of this macro, that element varies.
;;; por - macro
(defun test-por ()
(let ((a 100)
(b 200)
(c nil)
(d 300))
(por a b c d)))
Sample run:
LPARALLEL-USER> (dotimes (i 10)
(print (test-por)))
300
300
100
100
100
300
100
100
100
100
NIL
In the case of the normal or operator, it would always have returned the first non-nil element viz. 100.
• lparallel:pdotimes:
Parallel version of dotimes. Note that this macro also take an optional :parts argument.
;;; pdotimes - macro
(defun test-pdotimes ()
(pdotimes (i 5)
(declare (ignore i))
(print (random 100))))
Sample run:
LPARALLEL-USER> (test-pdotimes)
39
29
81
42
56
NIL
• lparallel:pfuncall:
Parallel version of funcall.
;;; pfuncall - macro
(defun test-pfuncall ()
(pfuncall #'* 1 2 3 4 5))
Sample run:
LPARALLEL-USER> (test-pfuncall)
120
• lparallel:preduce:
Parallel version of reduce.
This very important function also takes two optional keyword arguments - :parts (same meaning as explained), and :recurse. If :recurse is non-nil, it recursively applies lparallel:preduce to its arguments, otherwise it default to using reduce.
;;; preduce - function
(defun test-preduce ()
(let ((numbers (loop for i from 1 to 100
collect i)))
(preduce #'+
numbers
:parts (length numbers)
:recurse t)))
Sample run:
LPARALLEL-USER> (test-preduce)
5050
• lparallel:premove-if-not:
Parallel version of remove-if-not. This is essentially equivalent to “filter” in Functional Programming parlance.
;;; premove-if-not
(defun test-premove-if-not ()
(let ((numbers (loop for i from 1 to 100
collect i)))
(premove-if-not #'evenp numbers)))
Sample run:
LPARALLEL-USER> (test-premove-if-not)
(2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54
56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100)
• lparallel:pevery:
Parallel version of every.
;;; pevery - function
(defun test-pevery ()
(let ((numbers (loop for i from 1 to 100
collect i)))
(list (pevery #'evenp numbers)
(pevery #'integerp numbers))))
Sample run:
LPARALLEL-USER> (test-pevery)
(NIL T)
In this example, we are performing two checks - firstly, whether all the numbers in the range [1,100] are even, and secondly, whether all the numbers in the same range are integers.
• lparallel:count:
Parallel version of count.
;;; pcount - function
(defun test-pcount ()
(let ((chars "The quick brown fox jumps over the lazy dog"))
(pcount #\e chars)))
Sample run:
LPARALLEL-USER> (test-pcount)
3
• lparallel:psort:
Parallel version of sort.
;;; psort - function
(defstruct person
name
age)
(defun test-psort ()
(let* ((names (list "Rich" "Peter" "Sybil" "Basil" "Candy" "Slava" "Olga"))
(people (loop for name in names
collect (make-person :name name :age (+ (random 20) 20)))))
(print "Before sorting...")
(print people)
(fresh-line)
(print "After sorting...")
(psort
people
#'(lambda (x y)
(< (person-age x)
(person-age y)))
:test #'=)))
Sample run:
LPARALLEL-USER> (test-psort)
"Before sorting..."
(#S(PERSON :NAME "Rich" :AGE 38) #S(PERSON :NAME "Peter" :AGE 24)
#S(PERSON :NAME "Sybil" :AGE 20) #S(PERSON :NAME "Basil" :AGE 22)
#S(PERSON :NAME "Candy" :AGE 23) #S(PERSON :NAME "Slava" :AGE 37)
#S(PERSON :NAME "Olga" :AGE 33))
"After sorting..."
(#S(PERSON :NAME "Sybil" :AGE 20) #S(PERSON :NAME "Basil" :AGE 22)
#S(PERSON :NAME "Candy" :AGE 23) #S(PERSON :NAME "Peter" :AGE 24)
#S(PERSON :NAME "Olga" :AGE 33) #S(PERSON :NAME "Slava" :AGE 37)
#S(PERSON :NAME "Rich" :AGE 38))
In this example, we first define a structure of type person for storing information about people. Then we create a list of 7 people with randomly generated ages (between 20 and 39). Finally, we sort them by age in non-decreasing order.
## References
Top
There are, of course, a lot more functions, objects, and idiomatic ways of performing parallel computations using the lparallel library. This post barely scratches the surface on those. However, the general flow of operation is amply demonstrated here, and for further reading, you may find the following resources useful:
In the final part of this series, we will discuss an extremely important topic common to all that was covered in this post - error handling.
# Basic Concurrency and Parallelism in Common Lisp – Part 3 (Concurrency using Bordeaux and SBCL threads)
In case you haven’t, I’d recommend checking out the previous post to ensure that you have the correct setup configured and ready to follow this tutorial.
You need to have the following setup at minimum:
• A standard Common Lisp installation aside from CLISP (which doesn’t have any thread support)(preferably compiled)
• SBCL with thread support (for the SBCL specific examples)
• Quicklisp (preferred)
## What is Concurrency? What is Parallelism?
Concurrency is a way of running different, possibly related, tasks seemingly simultaneously. What this means is that even on a single processor machine, you can simulate simultaneity using threads (for instance) and context-switching them.
In the case of system (native OS) threads, the scheduling and context switching is ultimately determined by the OS. This is the case with Java threads and Common Lisp threads.
In the case of “green” threads, that is to say threads that are completely managed by the program, the scheduling can be completely controlled by the program itself. Erlang is a great example of this approach.
So what is the difference between Concurrency and Parallelism? Parallelism is usually defined in a very strict sense to mean independent tasks being run in parallel, simultaneously, on different processors or on different cores. In this narrow sense, you really cannot have parallelism on a single-core, single-processor machine.
It rather helps to differentiate between these two related concepts on a more abstract level – concurrency primarily deals with providing the illusion of simultaneity to clients so that the system doesn’t appear locked when a long running operation is underway. GUI systems are a wonderful example of this kind of system. Concurrency is therefore concerned with providing good user experience and not necessarily concerned with performance benefits.
Java’s Swing toolkit and JavaScript are both single-threaded, and yet they can give the appearance of simultaneity because of the context switching behind the scenes. Of course, concurrency is implemented using multiple threads/processes in most cases.
Parallelism, on the other hand, is mostly concerned with pure performance gains. For instance, if we are given a task to find the squares of all the even numbers in a given range, we could divide the range into chunks which are then run in parallel on different cores or different processors, and then the results can be collated together to form the final result. This is an example of Map-Reduce in action.
So now that we have separated the abstract meaning of Concurrency from that of Parallelism, we can talk a bit about the actual mechanism used to implement them. This is where most of the confusion arise for a lot of people. They tend to tie down abstract concepts with specific means of implementing them. In essence, both abstract concepts may be implemented using the same mechanisms! For instance, we may implement concurrent features and parallel features using the same basic thread mechanism in Java. It’s only the conceptual intertwining or independence of tasks at an abstract level that makes the difference for us.
For instance, if we have a task where part of the work can be done on a different thread (possibly on a different core/processor), but the thread which spawns this thread is logically dependent on the results of the spawned thread (and as such has to “join” on that thread), it is still Concurrency!
So the bottomline is this – Concurrency and Parallelism are different concepts, but their implementations may be done using the same mechanisms — threads, processes, etc.
## Checking for thread support in Common Lisp
Regardless of the Common Lisp implementation, there is a standard way to check for thread support availability:
CL-USER> (member :thread-support *FEATURES*)
(:THREAD-SUPPORT :SWANK :QUICKLISP :ASDF-PACKAGE-SYSTEM :ASDF3.1 :ASDF3 :ASDF2
:ASDF :OS-MACOSX :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :64-BIT
:64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :BSD
:C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPARE-AND-SWAP-VOPS
:COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :DARWIN :DARWIN9-OR-BETTER :FLOAT-EQL-VOPS
:FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT :INLINE-CONSTANTS
:MACH-EXCEPTION-HANDLER :MACH-O :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
:OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES
:PRECISE-ARG-COUNT-ERROR :RAW-INSTANCE-INIT-VOPS :SB-DOC :SB-EVAL :SB-LDB
:SB-UNICODE :SBCL :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-FIXED-OBJECTS
:STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS
:STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS :UD2-BREAKPOINTS :UNIX
:UNWIND-TO-FRAME-AND-CALL-VOP :X86-64)
If there were no thread support, it would show “NIL” as the value of the expression.
Depending on the specific library being used, we may also have different ways of checking for concurrency support, which may be used instead of the common check mentioned above.
For instance, in our case, we are interested in using the Bordeaux library. To check whether there is support for threads using this library, we can use the *supports-threads-p* variable so:
First let’s load up the Bordeaux library using Quicklisp:
CL-USER> (ql:quickload 'bt-semapahore)
(BT-SEMAPAHORE)
bt-semaphore
(:BT-SEMAPHORE)
Now we can see whether the *supports-threads-p* global variable is set to NIL (no support) or T (support available):
CL-USER> bt:*supports-threads-p*
T
Okay, now that we’ve got that out of the way, let’s test out both the platform-independent library (Bordeaux) as well as the platform-specific support (SBCL in this case).
To do this, let us work our way through a number of simple examples:
2. Update a global variable from a thread
3. Print a message onto the top-level using a thread
4. Print a message onto the top-level — fixed
5. Print a message onto the top-level — better
6. Modify a shared resource from multiple threads
7. Modify a shared resource from multiple threads — fixed using locks
8. Modify a shared resource from multiple threads — using atomic operations
The Bordeaux library provides a platform independent way to handle basic threading on multiple Common Lisp implementations. The interesting bit is that it itself does not really create any native threads — it relies entirely on the underlying implementation to do so.
On there other hand, it does provide some useful extra features in its own abstractions over the lower-level threads.
Also, you can see from the demo programs that a lot of the Bordeaux functions seem quite similar to those used in SBCL. I don’t really think that this is a coincidence.
You can refer to the documentation for more details (check the “Wrap-up” section).
### Demo
;;; Print the current thread, all the threads, and the current thread's name
nil)
And the output:
CL-USER> (print-thread-info)
#<THREAD "Swank Sentinel" waiting on: #<WAITQUEUE {1003790043}> {1003788023}>
NIL
• Update a global variable from a thread:
(defparameter *counter* 0)
(defun test-update-global-variable ()
(lambda ()
(sleep 1)
(incf *counter*)))
*counter*)
We create a new thread using bt:make-thread, which takes a lambda abstraction as a parameter. Note that this lambda abstraction cannot take any parameters.
Another point to note is that unlike some other languages (Java, for instance), there is no separation from creating the thread object and starting/running it. In this case, as soon as the thread is created, it is executed.
The output:
CL-USER> (test-update-global-variable)
0
CL-USER> *counter*
1
As we can see, because the main thread returned immediately, the initial value of *counter* is 0, and then around a second later, it gets updated to 1 by the anonymous thread.
• Print a message onto the top-level using a thread:
;;; Print a message onto the top-level using a thread
(defun print-message-top-level-wrong ()
(lambda ()
nil)
And the output:
CL-USER> (print-message-top-level-wrong)
NIL
So what went wrong? The problem is variable binding. Now, the ’t’ parameter to the format function refers to the top-level, which is a Common Lisp term for the main console stream, also referred to by the global variable *standard-output*. So we could have expected the output to be shown on the main console screen.
The same code would have run fine if we had not run it in a separate thread. What happens is that each thread has its own stack where the variables are rebound. In this case, even for *standard-output*, which being a global variable, we would assume should be available to all threads, is rebound inside each thread! This is similar to the concept of ThreadLocal storage in Java.
• Print a message onto the top-level — fixed:
So how do we fix the problem of the previous example? By binding the top-level at the time of thread creation of course. Pure lexical scoping to the rescue!
;;; Print a message onto the top-level using a thread — fixed
(defun print-message-top-level-fixed ()
(let ((top-level *standard-output*))
(lambda ()
nil)
Which produces:
CL-USER> (print-message-top-level-fixed)
NIL
Phew! However, there is another way of producing the same result using a very interesting reader macro as we’ll see next.
• Print a message onto the top-level — read-time eval macro:
Let’s take a look at the code first:
;;; Print a message onto the top-level using a thread - reader macro
(eval-when (:compile-toplevel)
(lambda ()
nil))
And the output:
CL-USER> (print-message-top-level-reader-macro)
NIL
So it works, but what’s the deal with the eval-when and what is that strange #. symbol before *standard-output*?
eval-when controls when evaluation of Lisp expressions takes place. We can have three targets — :compile-toplevel, :load-toplevel, and :execute.
The “#.” symbol is what is called a “Reader macro”. (I will be posting a whole post (or maybe a series of posts!) on reader macros in the future). A reader (or read) macro is called so because it has special meaning to the Common Lisp Reader, which is the component that is responsible for reading in Common Lisp expressions and making sense out of them. This specific reader macro ensures that the binding of *standard-output* is done at read time.
Binding the value at read-time ensures that the original value of *standard-output* is maintained when the thread is run, and the output is shown on the correct top-level.
Now this is where the eval-when bit comes into play. By wrapping the whole function definition inside the eval-when, and ensuring that evaluation takes place during compile time, the correct value of *standard-output* is bound. If we had skipped the eval-when, we would see the following error:
error:
don't know how to dump #<SWANK/GRAY::SLIME-OUTPUT-STREAM {100439EEA3}> (default MAKE-LOAD-FORM method called).
==>
#<SWANK/GRAY::SLIME-OUTPUT-STREAM {100439EEA3}>
note: The first argument never returns a value.
note:
deleting unreachable code
==>
Compilation failed.
And that makes sense because SBCL cannot make sense of what this output stream returns since it is a stream and not really a defined value (which is what the ‘format’ function expects). That is why we see the “unreachable code” error.
Note that if the same code had been run on the REPL directly, there would be no problem since the resolution of all the symbols would be done correctly by the REPL thread.
I have already posted a comprehensive post on eval-when and other advanced Common Lisp constructs. You can find them with a simple search in my blog (use the search box).
• Modify a shared resource from multiple threads:
Suppose we have the following setup with a minimal bank-account class (no error checks):
;;; Modify a shared resource from multiple threads
(defclass bank-account ()
((id :initarg :id
:initform (error "id required")
:accessor :id)
(name :initarg :name
:initform (error "name required")
:accessor :name)
(balance :initarg :balance
:initform 0
:accessor :balance)))
(defgeneric deposit (account amount)
(:documentation "Deposit money into the account"))
(defgeneric withdraw (account amount)
(:documentation "Withdraw amount from account"))
(defmethod deposit ((account bank-account) (amount real))
(incf (:balance account) amount))
(defmethod withdraw ((account bank-account) (amount real))
(decf (:balance account) amount))
And we have a simple client which apparently does not believe in any form of synchronisation:
(defparameter *rich*
(make-instance 'bank-account
:id 1
:name "Rich"
:balance 0))
; compiling (DEFPARAMETER *RICH* ...)
(defun demo-race-condition ()
(loop repeat 100
do
(lambda ()
(loop repeat 10000 do (deposit *rich* 100))
(loop repeat 10000 do (withdraw *rich* 100))))))
This is all we are doing – create a new bank account instance (balance 0), and then create a 100 threads, each of which simply deposits an amount of 100 10000 times, and then withdraws the same amount the same number of times. So the final result should be the same as that of the opening balance, which is 0, right? Let’s check that and see.
On a sample run, we might get the following results:
CL-USER> (:balance *rich*)
0
CL-USER> (dotimes (i 5)
(demo-race-condition))
NIL
CL-USER> (:balance *rich*)
22844600
Whoa! The reason for this discrepancy is that incf and decf are not atomic operations — they consist of multiple sub-operations, and the order in which they are executed is not in our control.
This is what is called a “race condition” — multiple threads contending for the same shared resource with at least one modifying thread which, more likely than not, reads the wrong value of the object while modifying it. How do we fix it? One simple way it to use locks (mutex in this case, could be semaphores for more complex situations).
• Modify a shared resource from multiple threads — fixed using locks:
• Let’s rest the balance for the account back to 0 first:
CL-USER> (setf (:balance *rich*) 0)
0
CL-USER> (:balance *rich*)
0
Now let’s modify the demo-race-condition function to access the shared resource using locks (created using bt:make-lock and used as shown):
(defvar *lock* (bt:make-lock))
; compiling (DEFVAR *LOCK* …)
(defun demo-race-condition-locks ()
(loop repeat 100
do
(lambda ()
(loop repeat 10000 do (bt:with-lock-held (*lock*)
(deposit *rich* 100)))
(loop repeat 10000 do (bt:with-lock-held (*lock*)
(withdraw *rich* 100)))))))
; compiling (DEFUN DEMO-RACE-CONDITION-LOCKS ...)
And let’s do a bigger sample run this time around:
CL-USER> (dotimes (i 100)
(demo-race-condition-locks))
NIL
CL-USER> (:balance *rich*)
0
Excellent! Now this is better. Of course, one has to remember that using a mutex like this is bound to affect performance. There is a better way in quite a few circumstances — using atomic operations when possible. We’ll cover that next.
• Modify a shared resource from multiple threads — using atomic operations:
Atomic operations are operations that are guaranteed by the system to all occur inside a conceptual transaction, i.e., all the sub-operations of the main operation all take place together without any interference from outside. The operation succeeds completely or fails completely. There is no middle ground, and there is no inconsistent state.
Another advantage is that performance is far superior to using locks to protect access to the shared state. We will see this difference in the actual demo run.
The Bordeaux library does not provide any real support for atomics, so we will have to depend on the specific implementation support for that. In our case, that is SBCL, and so we will have to defer this demo to the SBCL section.
To join on a thread, we use the bt:join-thread function, and for destroying a thread (not a recommended operation), we can use the bt:destroy-thread function.
A simple demo:
(defmacro until (condition &body body)
(let ((block-name (gensym)))
(block ,block-name
(if ,condition
(return-from ,block-name nil)
(progn
,@body)))))
(let* ((s *standard-output*)
(lambda ()
(loop for i from 1 to 10
do
(sleep (* 0.01 (random 100)))))))
(lambda ()
(loop for i from 1 to 1000000
do
(sleep (* 0.01 (random 10000))))))))
(progn
And the output on a run:
CL-USER> (join-destroy-thread)
NIL
The until macro simply loops around until the condition becomes true. The rest of the code is pretty much self-explanatory — the main thread waits for the joiner-thread to finish, but it immediately destroys the destroyer-thread.
Again, it is not recommended to use bt:destroy-thread. Any conceivable situation which requires this function can probably be done better with another approach.
Now let’s move onto some more comprehensive examples which tie together all the concepts discussed thus far.
### Useful functions
Here is a summary of the functions, macros and global variables which were used in the demo examples along with some extras. These should cover most of the basic programming scenarios:
• bt:make-lock (create a mutex)
• bt:with-lock-held (use the supplied lock to protect critical code)
SBCL provides support for native threads via its sb-thread package. These are very low-level functions, but we can build our own abstractions on top of these as shown in the demo examples.
You can refer to the documentation for more details (check the “Wrap-up” section).
### Demos
You can see from the examples below that there is a strong correspondence between Bordeaux and SBCL Thread functions. In most cases, the only difference is the change of package name from bt to sb-thread.
It is evident that the Bordeaux thread library was more or less based on the SBCL implementation. As such, explanation will be provided only in those cases where there is a major difference in syntax or semantics.
The code:
;;; Print the current thread, all the threads, and the current thread's name
nil)
And the output:
CL-USER> (print-thread-info)
#<THREAD "Swank Sentinel" waiting on: #<WAITQUEUE {1003790043}> {1003788023}>
NIL
• Update a global variable from a thread:
The code:
;;; Update a global variable from a thread
(defparameter *counter* 0)
(defun test-update-global-variable ()
(lambda ()
(sleep 1)
(incf *counter*)))
*counter*)
And the output:
CL-USER> (test-update-global-variable)
0
• Print a message onto the top-level using a thread:
The code:
;;; Print a message onto the top-level using a thread
(defun print-message-top-level-wrong ()
(lambda ()
nil)
And the output:
CL-USER> (print-message-top-level-wrong)
NIL
• Print a message onto the top-level — fixed:
The code:
;;; Print a message onto the top-level using a thread - fixed
(defun print-message-top-level-fixed ()
(let ((top-level *standard-output*))
(lambda ()
nil)
And the output:
CL-USER> (print-message-top-level-fixed)
NIL
• Print a message onto the top-level — better
The code:
;;; Print a message onto the top-level using a thread - reader macro
(eval-when (:compile-toplevel)
(lambda ()
nil))
And the output:
CL-USER> (print-message-top-level-reader-macro)
NIL
• Modify a shared resource from multiple threads:
The code:
;;; Modify a shared resource from multiple threads
(defclass bank-account ()
((id :initarg :id
:initform (error "id required")
:accessor :id)
(name :initarg :name
:initform (error "name required")
:accessor :name)
(balance :initarg :balance
:initform 0
:accessor :balance)))
(defgeneric deposit (account amount)
(:documentation "Deposit money into the account"))
(defgeneric withdraw (account amount)
(:documentation "Withdraw amount from account"))
(defmethod deposit ((account bank-account) (amount real))
(incf (:balance account) amount))
(defmethod withdraw ((account bank-account) (amount real))
(decf (:balance account) amount))
(defparameter *rich*
(make-instance 'bank-account
:id 1
:name "Rich"
:balance 0))
(defun demo-race-condition ()
(loop repeat 100
do
(lambda ()
(loop repeat 10000 do (deposit *rich* 100))
(loop repeat 10000 do (withdraw *rich* 100))))))
And the output:
CL-USER> (:balance *rich*)
0
CL-USER> (demo-race-condition)
NIL
CL-USER> (:balance *rich*)
3987400
• Modify a shared resource from multiple threads — fixed using locks:
The code:
(defvar *lock* (sb-thread:make-mutex))
(defun demo-race-condition-locks ()
(loop repeat 100
do
(lambda ()
(loop repeat 10000 do (sb-thread:with-mutex (*lock*)
(deposit *rich* 100)))
(loop repeat 10000 do (sb-thread:with-mutex (*lock*)
(withdraw *rich* 100)))))))
The only difference here is that instead of make-lock as in Bordeaux, we have make-mutex and that is used along with the macro with-mutex as shown in the example.
And the output:
CL-USER> (:balance *rich*)
0
CL-USER> (demo-race-condition-locks)
NIL
CL-USER> (:balance *rich*)
0
• Modify a shared resource from multiple threads — using atomic operations:
First, the code:
;;; Modify a shared resource from multiple threads - atomics
(defgeneric atomic-deposit (account amount)
(:documentation "Atomic version of the deposit method"))
(defgeneric atomic-withdraw (account amount)
(:documentation "Atomic version of the withdraw method"))
(defmethod atomic-deposit ((account bank-account) (amount real))
(sb-ext:atomic-incf (car (cons (:balance account) nil)) amount))
(defmethod atomic-withdraw ((account bank-account) (amount real))
(sb-ext:atomic-decf (car (cons (:balance account) nil)) amount))
(defun demo-race-condition-atomics ()
(loop repeat 100
(lambda ()
(loop repeat 10000 do (atomic-deposit *rich* 100))
(loop repeat 10000 do (atomic-withdraw *rich* 100))))))
And the output:
CL-USER> (dotimes (i 5)
(format t "~%Opening: ~d" (:balance *rich*))
(demo-race-condition-atomics)
(format t "~%Closing: ~d~%" (:balance *rich*)))
Opening: 0
Closing: 0
Opening: 0
Closing: 0
Opening: 0
Closing: 0
Opening: 0
Closing: 0
Opening: 0
Closing: 0
NIL
As you can see, SBCL’s atomic functions are a bit quirky. The two functions used here: sb-ext:incf and sb-ext:atomic-decf have the following signatures:
Macro: atomic-incf [sb-ext] place &optional diff
and
Macro: atomic-decf [sb-ext] place &optional diff
The interesting bit is that the “place” parameter must be any of the following (as per the documentation):
• a defstruct slot with declared type (unsigned-byte 64) or aref of a (simple-array (unsigned-byte 64) (*)) The type sb-ext:word can be used for these purposes.
• car or cdr (respectively first or REST) of a cons.
• a variable defined using defglobal with a proclaimed type of fixnum.
This is the reason for the bizarre construct used in the atomic-deposit and atomic-decf methods.
One major incentive to use atomic operations as much as possible is performance. Let’s do a quick run of the demo-race-condition-locks and demo-race-condition-atomics functions over 1000 times and check the difference in performance (if any):
With locks:
CL-USER> (time
(loop repeat 100
do (demo-race-condition-locks)))
Evaluation took:
57.711 seconds of real time
431.451639 seconds of total run time (408.014746 user, 23.436893 system)
747.61% CPU
126,674,011,941 processor cycles
3,329,504 bytes consed
NIL
With atomics:
CL-USER> (time
(loop repeat 100
do (demo-race-condition-atomics)))
Evaluation took:
2.495 seconds of real time
8.175454 seconds of total run time (6.124259 user, 2.051195 system)
[ Run times consist of 0.420 seconds GC time, and 7.756 seconds non-GC time. ]
327.66% CPU
5,477,039,706 processor cycles
3,201,582,368 bytes consed
NIL
The results? The locks version took around 57s whereas the lockless atomics version took just 2s! This is a massive difference indeed!
The code:
;;; Joining on and destroying a thread
(defmacro until (condition &body body)
(let ((block-name (gensym)))
(block ,block-name
(if ,condition
(return-from ,block-name nil)
(progn
,@body)))))
(let* ((s *standard-output*)
(lambda ()
(loop for i from 1 to 10
do
(sleep (* 0.01 (random 100)))))))
(lambda ()
(loop for i from 1 to 1000000
do
(sleep (* 0.01 (random 10000))))))))
(progn
And the output:
CL-USER> (join-destroy-thread)
NIL
### Useful functions
Here is a summarised list of the functions, macros and global variables used in the examples along with some extras:
• sb-thread:with-mutex (use supplied lock to protect critical code)
## Wrap-up
As you can see, concurrency support is rather primitive in Common Lisp, but that’s primarily due to the glaring absence of this important feature in the ANSI Common Lisp specification. That does not detract in the least from the support provided by Common Lisp implementations, nor wonderful libraries like the Bordeaux library.
You should follow up on your own by reading a lot more on this topic. I share some of my own references here:
Next up, the final post in this mini-series: parallelism in Common Lisp using the lparallel library.
# Basic Concurrency and Parallelism in Common Lisp – Part 2 (Bootstrapping a threading-capable Mac OS X SBCL instance from source)
### The Problem
The main (and practically only) issue with the default binary distribution available for SBCL on Mac OS X is that it does not come with built-in support for threads:
CL-USER> (format t "~a, ~a~%" (lisp-implementation-type)
(lisp-implementation-version))
SBCL, 1.2.11
NIL
As we can see, the SBCL version is 1.2.11 and there is no support for threads.
Assuming that the Bordeaux library has already been installed, load it up:
CL-USER> (ql:quickload :bt-semaphore)
bt-semaphore
(:BT-SEMAPHORE)
This is a bit surprising – if there is no thread support on the platform, shouldn’t the Bordeaux library fail during loading itself? Well, it does not, and it is precisely this fact the one has to be careful about – just because a library is successfully downloaded and loaded does not mean that it is going to run as expected:
CL-USER> bt:*supports-threads-p*
NIL
### The Solution
The reason why threading is off by default is that thread support on the Mac OS platform is an experimental feature in SBCL. In order to work with threads on Mac OS X, we need to build SBCL from source with thread support.
The way we do this is by bootstrapping the new compiled version of the source code using the existing SBCL installation. The following steps should make it amply clear:
Timmys-MacBook-Pro:Software z0ltan$wget https://sourceforge.net/projects/sbcl/files/sbcl/1.3.8/sbcl-1.3.8-source.tar.bz2 --2016-08-29 05:16:40-- https://sourceforge.net/projects/sbcl/files/sbcl/1.3.8/sbcl-1.3.8-source.tar.bz2 Resolving sourceforge.net... 216.34.181.60 Connecting to sourceforge.net|216.34.181.60|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://sourceforge.net/projects/sbcl/files/sbcl/1.3.8/sbcl-1.3.8-source.tar.bz2/download [following] --2016-08-29 05:16:41-- https://sourceforge.net/projects/sbcl/files/sbcl/1.3.8/sbcl-1.3.8-source.tar.bz2/download Connecting to sourceforge.net|216.34.181.60|:443... connected. HTTP request sent, awaiting response... 302 Found Location: http://downloads.sourceforge.net/project/sbcl/sbcl/1.3.8/sbcl-1.3.8-source.tar.bz2?r=&ts=1472428003&use_mirror=liquidtelecom [following] --2016-08-29 05:16:43-- http://downloads.sourceforge.net/project/sbcl/sbcl/1.3.8/sbcl-1.3.8-source.tar.bz2?r=&ts=1472428003&use_mirror=liquidtelecom Resolving downloads.sourceforge.net... 216.34.181.59 Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://liquidtelecom.dl.sourceforge.net/project/sbcl/sbcl/1.3.8/sbcl-1.3.8-source.tar.bz2 [following] --2016-08-29 05:16:45-- http://liquidtelecom.dl.sourceforge.net/project/sbcl/sbcl/1.3.8/sbcl-1.3.8-source.tar.bz2 Resolving liquidtelecom.dl.sourceforge.net... 197.155.77.8 Connecting to liquidtelecom.dl.sourceforge.net|197.155.77.8|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 5754599 (5.5M) [application/octet-stream] Saving to: ‘sbcl-1.3.8-source.tar.bz2’ sbcl-1.3.8-source.tar.bz2 100%[==============================================================================================================>] 5.49M 600KB/s in 17s 2016-08-29 05:17:02 (333 KB/s) - ‘sbcl-1.3.8-source.tar.bz2’ saved [5754599/5754599] Version 1.3.8 is the latest stable version of the source code distribution. If you want to stay bleeding edge, you can download the latest development version from here – https://sourceforge.net/p/sbcl/sbcl/ci/master/tree/ • Now we unzip, untar, and compile the source code by passing in two flags – —fancy and —with-sb-thread: Timmys-MacBook-Pro:Software z0ltan$ bzip2 -cd sbcl-1.3.8-source.tar.bz2 | tar xf -
Timmys-MacBook-Pro:Software z0ltan$ls ASDF sbcl-1.2.11-x86-64-darwin sbcl-1.3.8 sbcl-1.3.8-source.tar.bz2 Timmys-MacBook-Pro:Software z0ltan$
Excellent! Now we have the sbcl-1.3.8 directory which contains the source code and scripts that we need to use next.
A brief note on the mentioned flags – when you pass in —fancy, you actually enable all extended features of SBCL. In our case, we’re only interested in threads, so we could try passing in only the —with-sb-thread flag. However, that would possibly not work (at least one my local system it didn’t!).
The reason is that —fancy installs the extended features even on platforms where it might be unstable which is precisely the case here. So my recommendation is to pass in both flags as shown:
Timmys-MacBook-Pro:sbcl-1.3.8 z0ltan$sudo sh make.sh —fancy —with-sb-thread <lots of build messages - elided> The build seems to have finished successfully, including 18 (out of 18) contributed modules. If you would like to run more extensive tests on the new SBCL, you can try: cd tests && sh ./run-tests.sh (All tests should pass on x86/Linux, x86/FreeBSD4, and ppc/Darwin. On other platforms some failures are currently expected; patches welcome as always.) To build documentation: cd doc/manual && make To install SBCL (more information in INSTALL): sh install.sh //build started: Mon Aug 29 05:38:52 IST 2016 //build finished: Mon Aug 29 05:42:42 IST 2016 The command should take a minute or two to run. • Finally, we can install the binaries into the default locations (which can be changed using the INSTALL_ROOT environment variable — refer to the documentation for specifics): Timmys-MacBook-Pro:sbcl-1.3.8 z0ltan$ sudo sh install.sh
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//uiop.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//asdf.fasl "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-aclrepl.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-aclrepl.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-bsd-sockets.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-bsd-sockets.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-cltl2.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-cltl2.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-concurrency.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-concurrency.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-cover.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-cover.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-executable.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-executable.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-gmp.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-gmp.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-grovel.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-grovel.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-introspect.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-introspect.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-md5.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-md5.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-mpfr.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-mpfr.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-posix.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-posix.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-queue.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-queue.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-rotate-byte.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-rotate-byte.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-rt.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-rt.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-simple-streams.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-simple-streams.asd "/usr/local/lib/sbcl/contrib/"
cp /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-sprof.fasl /Users/z0ltan/Software/sbcl-1.3.8/obj/sbcl-home/contrib//sb-sprof.asd "/usr/local/lib/sbcl/contrib/"
SBCL has been installed:
binary /usr/local/bin/sbcl
core and contribs in /usr/local/lib/sbcl/
Documentation:
man /usr/local/share/man/man1/sbcl.1
Now that we have a working SBCL instance compiled from source, let’s fire up SLIME and test it out!
Checking the SBCL version:
CL-USER> (lisp-implementation-type)
"SBCL"
CL-USER> (lisp-implementation-version)
"1.3.8"
Load the Bordeaux library and check if threading support is now enabled:
CL-USER> (ql:quickload :bt-semaphore)
bt-semaphore
(:BT-SEMAPHORE)
T
(:THREAD-SUPPORT :SWANK :QUICKLISP :ASDF-PACKAGE-SYSTEM :ASDF3.1 :ASDF3 :ASDF2
:ASDF :OS-MACOSX :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :64-BIT
:64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :BSD
:C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPARE-AND-SWAP-VOPS
:COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :DARWIN :DARWIN9-OR-BETTER :FLOAT-EQL-VOPS
:FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT :INLINE-CONSTANTS
:MACH-EXCEPTION-HANDLER :MACH-O :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
:OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES
:PRECISE-ARG-COUNT-ERROR :RAW-INSTANCE-INIT-VOPS :SB-DOC :SB-EVAL :SB-LDB
:SB-UNICODE :SBCL :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-FIXED-OBJECTS
:STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS
:STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS :UD2-BREAKPOINTS :UNIX
:UNWIND-TO-FRAME-AND-CALL-VOP :X86-64)
Brilliant! Finally, let’s test out a simple example to make sure that threads actually do work now:
CL-USER> (defun test-sbcl-thread ()
(let ((top-level *query-io*))
(lambda ()
(format top-level "Hello from ~a~%"
Hello from NIL
and the same example using the Bordeaux library:
CL-USER> (defun test-bordeaux-thread ()
(let ((top-level *query-io*))
(lambda ()
(format top-level "Hello from ~a~%"
` | 2016-09-30 01:26:20 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 1, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.32779955863952637, "perplexity": 4843.147077542423}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-40/segments/1474738661974.78/warc/CC-MAIN-20160924173741-00130-ip-10-143-35-109.ec2.internal.warc.gz"} |
https://www.albert.io/ie/abstract-algebra/what-isomorphism-classes-of-finite-abelian-groups | Free Version
Moderate
# What Isomorphism Classes of Finite Abelian Groups?
ABSALG-1WJ9IP
For each of the following Abelian groups, how many elements at most (including the identity) does one needs to compute the orders to determine the isomorphism class of the group? | 2017-02-25 05:09:24 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8522085547447205, "perplexity": 354.71075437125216}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-09/segments/1487501171664.76/warc/CC-MAIN-20170219104611-00483-ip-10-171-10-108.ec2.internal.warc.gz"} |
https://tomcircle.wordpress.com/tag/prime/ | # 70-million Bounded Gap Between Primes
Since Ancient Greek :
1. Euclid had proved there are infinite primes.
2. Sieve of Eratosthenes to enumerate the primes.
3. Recent time 3 Mathematicians GPY attempted another Sieve method to find the bounded gap (N) of primes in infinity, but stuck at one critical step.
4. Dr. YiTang Zhang 张益唐 (1955 -) spent 7 years in solitude after failure in academic career, in 2013 during a 10-min walk at the deer backyard of his friend’s house, he found an Eureka solution for the GPY’s critical step: $\boxed { \epsilon = \frac {1} {168}}$ which gave the first historical bounded Gap (N) from an infinity large number to a limit of 70 million.
Notes:
• Chinese love the number “8” \ba which sounds like the word prosperity 发 \fa (in Cantonese) . He could have instead used 160, so long as $\epsilon$ is small.
• The Ultimate Goal of the Bounded Gap (N) is 2 (Twin Primes Conjecture) .
• The latest bounded gap (N) is reduced from 70-million to 246 from The PolyMath Project led by Terence Tao using Zhang’s method by adjusting the various values of $\epsilon$ (analogous to choosing different sizes of the holes or ‘eyes’ of the Prime Sieve.)
A Graduate Level Talk by Dr. Zhang:
A Simpler Overview:
# Barry Mazur – Harvard Lecture on Primes and the Riemann Hypothesis for High School Students
Prelude:
Harvard Lecture
The Key to open this secret
# Mathematics: The Next Generation
Historical Backgroud:
Math evolves since antiquity, from Babylon, Egypt 5,000 years ago, through Greek, China, India 3,000 years ago, then the Arabs in the 10th century taught the Renaissance Europeans the Hindu-Arabic numerals and Algebra, Math progressed at a condensed rapid pace ever since: complex numbers to solve cubic equations in 16th century Italy, followed by the 17 CE French Cartersian Analytical Geometry, Fermat’s Number Theory,…, finally by the 19 CE to solve quintic equations of degree 5 and above, a new type of Abstract Math was created by a French genius 19-year-old Evariste Galois in “Group Theory”. The “Modern Math” was born since, it quickly develops into over 4,000 sub-branches of Math, but the origin of Math is still the same eternal truth.
Math Education Flaw: 本末倒置 Put the cart before the horse.
Math has been taught wrongly since young, either is boring, or scary, or mechanically (calculating).
This lecture by Queen Mary College (U. London) Prof Cameron is one of the rare Mathematician changing that pedagogy. Math is a “Universal Language of Truths” with unambiguous, logical syntax which transcends over eternity.
I like the brilliant idea of making the rigorous Math foundation compulsory for all S.T.E.M. (Science, Technology, Engineering, Math) undergraduate students. Prof S.S. Chern 陈省身 (Wolf Prize) after retirement in Nankai University (南开大学, 天津, China) also made basic “Abstract Algebra” course compulsory for all Chinese S.T.E.M. undergraduates in 2000s.
The foundations Prof Cameron teaches are centered around 4 Math Objects:
1. SET 集合
– Set is the founding block of the 20th century Modern Math, hitherto introduced into the world’s university textbooks by the French “Bourbaki” school (André Weil et al) after WW1.
Note: The last “Bourbaki” grand master Grothendieck proposed to replace Set by Category. That will be the next century Math for future Artificial Intelligence Era, aka “The 4th Human Revolution”.
2. FUNCTION 函数
– A vision first proposed by the German Gottingen School’s greatest Math Educator Felix Klein, who said Functions can be visualised in graphs, so it is the best tool to learn mathematical abstractness.
3. NUMBERS
– The German mathematician Leopold Kronecker, who once wrote that “God made the integers; all else is the work of man.”
– The universe is composed of numbers in “NZQRC” (ie Natural numbers, Integers, Rationals, Reals, Complex numbers). After C (Complex), no more further split of new numbers. Why?
4. Proofs
– reading and debugging proofs.
Example 1: Proof by Contradiction, aka Reductio ad Absurdum (Euclid’s Proof on Infinitely Many Prime Numbers)
Challenge the proof: Why ?
Induction intuitively by:
Example 2: Proof by Logic
[Hint:]
By Reasoning (which is unconscious), most would get “2 & A” (wrong answer)
By Logic (using consciousness), then you can proof …
Correct Answer: 2 and B
Test on all 3 Truth cases below in Truth Table:
p = front side
q = back side
# Should 1 be a prime number ?
Should 1 be a prime number ?
http://qr.ae/7rpswt
Explain ‘1’ in Abstract Algebra ‘Ideal’ (理想) in ‘Ring'(环) Theory:
http://qr.ae/7royrJ
# Is a (googol + 1) prime?
$googol = 10^{100}$
Is a (googol + 1) prime?
http://qr.ae/7rppKA
# New Prime Number AKS Test (2002)
Test p is prime:
$\boxed {(x-1)^p - (x^p -1) = }$
all coefficients are divisible by p
# Twin Prime Hero
http://simonsfoundation.org/features/science-news/unheralded-mathematician-bridges-the-prime-gap/
On April 17, 2013, a paper arrived in the inbox of Annals of Mathematics, one of the discipline’s preeminent journals. Written by a mathematician virtually unknown to the experts in his field — a 50-something lecturer at the University of New Hampshire named Yitang Zhang — the paper claimed to have taken a huge step forward in understanding one of mathematics’ oldest problems, the twin primes conjecture.
Editors of prominent mathematics journals are used to fielding grandiose claims from obscure authors, but this paper was different. Written with crystalline clarity and a total command of the topic’s current state of the art, it was evidently a serious piece of work, and the Annals editors decided to put it on the fast track.
Yitang Zhang (Photo: University of New Hampshire)
Just three weeks later — a blink of an eye compared to the usual pace of mathematics journals — Zhang received the referee report on his paper.
“The main results are of the first rank,” one of the referees wrote. The author had proved “a landmark theorem in the distribution of prime numbers.”
Rumors swept through the mathematics community that a great advance had been made by a researcher no one seemed to know — someone whose talents had been so overlooked after he earned his doctorate in 1991 that he had found it difficult to get an academic job, working for several years as an accountant and even in a Subway sandwich shop.
“Basically, no one knows him,” said Andrew Granville, a number theorist at the Université de Montréal. “Now, suddenly, he has proved one of the great results in the history of number theory.”
Mathematicians at Harvard University hastily arranged for Zhang to present his work to a packed audience there on May 13. As details of his work have emerged, it has become clear that Zhang achieved his result not via a radically new approach to the problem, but by applying existing methods with great perseverance.
“The big experts in the field had already tried to make this approach work,” Granville said. “He’s not a known expert, but he succeeded where all the experts had failed.”
There are a lot of chances in your career, but the important thing is to keep thinking,” Zhang said.
http://nautil.us/issue/5/fame/the-twin-prime-hero?utm_source=feedly
# Prime Secret: ζ(s)
Riemann intuitively found the Zeta Function ζ(s), but couldn’t prove it. Computer ‘tested’ it correct up to billion numbers.
$\zeta(s)=1+\frac{1}{2^{s}}+\frac{1}{3^{s}}+\frac{1}{4^{s}}+\dots$
Or equivalently (see note *)
$\frac {1}{\zeta(s)} =(1-\frac{1}{2^{s}})(1-\frac{1}{3^{s}})(1-\frac{1}{5^{s}})(1-\frac{1}{p^{s}})\dots$
ζ(1) = Harmonic series (Pythagorean music notes) -> diverge to infinity
(See note #)
ζ(2) = Π²/6 [Euler]
ζ(3) = not Rational number.
1. The Riemann Hypothesis:
All non-trivial zeros of the zeta function have real part one-half.
ie ζ(s)= 0 where s= ½ + bi
Trivial zeroes are s= {- even Z}:
s(-2) = 0 =s(-4) =s(-6) =s(-8)…
You might ask why Re(s)=1/2 has to do with Prime number ?
There is another Prime Number Theorem (PNT) conjectured by Gauss and proved by Hadamard and Poussin:
π(Ν) ~ N / log N
ε = π(Ν) – N / log N
The error ε hides in the Riemann Zeta Function’s non-trivial zeroes, which all lie on the Critical line = 1/2 :
All non-trivial zeroes of ζ(s) are in Complex number between ]0,1[ along real line x=1/2
2. David Hilbert:
If I were to awaken after 500 yrs, my 1st question would be: Has Riemann been proven?’
It will be proven in future by a young man. ‘uncorrupted’ by today’s math.
Note (*):
$\zeta(s)=1+\frac{1}{2^{s}}+\frac{1}{3^{s}}+\frac{1}{4^{s}}+\dots = \sum \frac {1}{n^{s}}$ …[1]
$\frac {1}{2^{s}}\zeta(s) = \frac{1}{2^{s}}(1+\frac{1}{2^{s}}+\frac{1}{3^{s}}+\frac{1}{4^{s}}+\dots)$
$\frac {1}{2^{s}}\zeta(s) = \frac {1}{2^{s}}+ \frac{1}{4^{s}} + \frac{1}{6^{s}} + \frac{1}{8^s} +\dots$ … [2]
[1]-[2]:
$(1- \frac{1}{2^{s}})\zeta(s) = 1+ \frac{1}{3^{s}} + \frac{1}{5^{s}} + \dots + \frac{1}{p^{s}} +\dots$
$\text {Repeat with} (1-\frac{1}{3^s}) \text { both sides:}$
$(1- \frac{1}{3^{s}})(1- \frac{1}{2^{s}})\zeta(s) = 1+ \frac{1}{5^{s}} + \frac{1}{7^{s}} + \dots + \frac{1}{p^{s}} +\dots$
Finally,
$(1- \frac{1}{p^{s}}) \dots (1- \frac{1}{5^{s}})(1- \frac{1}{3^{s}})(1- \frac{1}{2^{s}})\zeta(s) = 1$
Or
$\zeta(s) = \prod \frac {1} {1- \frac{1}{p^{s}}}= \sum \frac {1}{n^{s}}$
Note #:
$\zeta(s) = \prod \frac {1} {1- \frac{1}{p^{s}}}= \sum \frac {1}{n^{s}}$
Let s=1
RHS: Harmonic series diverge to infinity
LHS:
$\prod \frac {1}{1- \frac{1}{p}}= \prod \frac{p}{p-1}$
Diverge to infinity => there are infinitely many primes p
English: Zero-free region for the Riemann_zeta_function (Photo credit: Wikipedia)
# Fermat ‘Prime’ Mistake
Fermat Prime $F5= 2^{2^{5}}+1$ composite ?
Proof: 1937 the ‘Calculator boy’ Zerah Colburn observed:
$641 = 2^4 + 5^4 \mbox {..[1]}$
$641 = 5.2^7 +1 \mbox {..[2]}$
$\mbox {[1:]}\: 2^4 + 5^4 = 0 \: mod \:641$
Divide $5^4$ both sides
$\frac {2^4}{5^4} + 1 = 0 \:mod \:641$
$\frac {2^4}{5^4}= -1 \:mod \:641\mbox {..[a]}$
$\mbox {[2:]}\: 5.2^7 +1=0 \: mod \:641$
$2^7 = -1/5 \: mod \:641$
x2 both sides
$2^8 = -2/5 \: mod \:641$
Raise power 4 both sides
$(2^8)^4 = (-2/5)^4 \: mod \:641$
$2^{32} = +2^4 / 5^4 \: mod \:641$
$\mbox {[a:]}\: \frac {2^4}{5^4}= -1 \: mod \:641$
$2^{32} = -1 \: mod \:641$
$2^{32} +1= 0 \: mod \:641$
$F5= 2^{2^{5}}+1 \mbox \: {divisible \:by \:641}$
=> $\mbox {F5 not prime!}$
Note:
$F1= 2^{2^{1}}+1 = 5 (prime)$
$F2= 2^{2^{2}}+1 = 17 (prime)$
$F3= 2^{2^{3}}+1 = 257 (prime)$
$F4= 2^{2^{4}}+1 = 65,537 (prime)$
$F5= 2^{2^{5}}+1 = 4,294,967,297 = 641 \mbox{x} 6,700,417 (nonprime)$
Euler (in 1732) had proved mentally F5 was not a prime.
# What is Ideal ?
Anything inside x outside still comes back inside
=> Zero x Anything = Zero
=> Even x Anything = Even
Mathematically,
1. nZ is an Ideal, represented by (n)
Eg. Even subring (2Z) x anything big Ring Z = 2Z = Even
2. (football) Field F is ‘sooo BIG’ that
(inside = outside)
=> Field has NO Ideal (except trivial 0 and F)
Why was Ideal invented ? because of ‘failure” of UNIQUE Primes Factorization” for this case (example):
6 = 2 x 3
but also
$6=(1+\sqrt{-5})(1-\sqrt{-5})$
=> two factorizations !
=> violates the Fundamental Law of Arithmetic which says UNIQUE Prime Factorization
Unique Prime factors exist called Ideal Primes: $\mbox{gcd = 2} , \mbox{ 3}$, $(1+\sqrt{-5})$, $(1-\sqrt{-5})$
Greatest Common Divisor (gcd or H.C.F.):
For n,m in Z
gcd (a,b)= ma+nb
Example: gcd(6,8) = (-1).6+(1).8=2
(m=-1, n=-1)
Dedekind’s Ideals (Ij):
6 =2×3= u.v =I1.I2.I3.I4 ;
$u= (1+\sqrt{-5})$
$v=(1-\sqrt{-5})$
Let gcd(2,u) = 2M+N.u
M,N in form of $a+b\sqrt{-5}$
1. Principal Ideals:
2M = (2) = multiple of 2
2. Ideals (nonPrincipal) = 2M+N.u
3. Ideal prime factors: 6=2 x 3=u.v
Let
I1= gcd(2, u)
I2=gcd(2, v)
I3=gcd(3, u)
I4=gcd(3, v)
Easy to verify (by definition):
I1.I2=(2)
I3.I4=(3)
I1.I3=(u)
I1.I4=(v)
=> Ij are prime & unique factors of 6=I1.I2.I3.I4
=> Fundamental Law of Arithmetic satisfied!
=>Ij “Ideal“-ly exist! hidden behind ‘compound’ (2,3,u,v) !
Verify : gcd(2, 1+√-5).gcd(2, 1-√-5)=(2) ?
Proof by definition:
[2m+n(1+√-5)][2m’+n'(1-√-5)]
=[2m+n+n√-5 ][2m’+n’-n’√-5]
= 4mm’+2mn’+2nm’+6nn’
= 2(2mm’+mn’+m’n+3nn’)
= 2M
= 2 multiples
= (2) = Principal Ideal
# God’s “irregular heartbeat”
Primes = God’s “IRREGULAR heartbeat”.
You never know the pattern to generate the next prime.
Riemann Conjecture’s Zeta function.
Hibert’s 8th/23 unsolved problems @1900.
Clay’s 7 Millennium Problem (USD 1 million prize)
# Field: Galois, Dedekind
Dedekind
(1831-1916)
Dedelind was the 1st person in the world to define Field:
“Any system of infinitely many real or complex numbers, which in itself is so ‘closed’ and complete, that +, – , *, / of any 2 numbers always produces a number of the same system.”
Heinrich Weber (1842-1913) gave the abstract definition of Field.
Field Characteristic
1. Field classification by Ernst Steinitz @ 1910
2. Given a Field, we start with the element that acts as 0, and repeatedly add the element that acts as 1.
3. If after p additions, we obtain 0 again, p must be prime number, and we say that the Field has characteristic p;
4. If we never get back to 0, the Field has characteristic 0. (e.g. Complex Field)
Example: GF(2) = {0,1|+} ; prime p = 2
0 + 1 = 1
2nd (=p) +:
1 + 1 = 0 => back to 0 again!
=> GF(2) characteristic p= 2
Galois Field GF(p)
1. For each prime p, there are infinitely many finite fields of characteristic p, known as Galois fields GF(p).
2. For each positive power of prime p, there is exactly one field.
(This is the only IMPORTANT Theorem need to know in Field Theory)
E.g. GF(2) = {0,1}
Math Game: Chinese 9-Ring Puzzle (九连环 Jiu Lian Huan)
To solve Chinese ancient 9-Ring Puzzle (九连环) needs a “Vector Space V(9,K) over Field K”
finite Field K = Galois Field GF(2) = {0,1|+,*}
and 9-dimension Vector Space V(9,K):
V(0)=(0,0,0,0,0,0,0,0,0) ->
V(j) =(0,0,… 0,1,..0,0) ->
V(9)= (0,0,0,0,0,0,0,0,1)
From start V(0) to ending V(9) = 511 steps.
# Prime Numbers * +
Prime Numbers
God multiplies Primes: Fundamental Law of Arithmetic (Euclid):
Any number (n) can be UNIQUELY Prime Factorized: n = P1 x P2 x …Pn
e.g. 12= 2 x 2 x 3,
28=2 x 2 x7
Men add Primes: Goldbach Conjecture.
2n = P1+P2
e.g. 12= 5 + 7, 28 = 17 + 11, 30 = 11+19
# Find Prime numbers
Primes (Landau’s trick)
List down systematically the primes below n < 4,000
2×2= 4 => take 3 (<4)
< 2×3 =6 => 5
< 2×5 =10 =>7
< 2×7 =14 => 13
23, 43, 83, 163, 317, 631, 1259, 2503, (4001)
# Prime and Perfect Square
For all primes p ≠2, (a,b ∈Z)
p= a² + b² <=> p ≡ 1 mod 4
(2=1² + 1²)
5= 1² + 2² = 1 + 4 ≡ 1 mod 4
13= 2² + 3² = 4 + 9 ≡ 1 mod 4
17=1² + 4² = 1 + 16 ≡ 1 mod 4
29= 2² + 5² = 4 + 25 ≡ 1 mod 4
37= 1² + 6² = 1 +36 ≡ 1 mod 4
Notes:
1) Perfect squares (4, 9, 16, 25… ) ≡ 0 or ≡ 1 mod 4
2) Prime (4n+1) = a² + b² (Euler took 7 yrs to prove)
3) Gauss expanded the proof to quadratic reciprocity (2 prime numbers p & q are linked by mod 4)
# Prime Number
Prime Number
Prove we can always find an interval [p, q] wherein no prime exists, for any p, q ∈ N
Proof:
For any n ∈ N
Let H= (n+1)! = 1 x 2 x … x(n+1)
Let G = {H+2, H+3,. . . , H+(n+1) }
=> G composites (trivial)
Choose [p, q] such that :
1. p the closest prime < H+2,
2. q the closest prime > H+(n+1)
=> no prime ∈ [p, q]
—n—————-n!-(H+1)-p[(H+2)———H+(n+1)]q——————
# Fermat Little Theorem
Fermat ℓittle Theorem (FℓT)
∀ m ∈ N,
1) p prime => $m^p$= m mod (p)
Note: Converse False
[Memorize Trick: military police = military in the mode of police]
Note:
p prime, ∀m,
if p | m,
=> m ≡ 0 mod (p) …(1)
=> multiply p times:
$m^p$≡ 0 mod (p) …(2)
Substitute (1) to (2): m ≡ 0
=> p prime, ∀ m
$m^p$≡ m mod (p)
=> No need (m, p) = 1 [co-prime]
E.g. (m, p) = (3, 2) =1
$3^2$= 9 ≡ 3 mod (2) ≡ 1 mod (2)
9 ≡ 1 mod (2)
E.g. (m, p) = (6, 2), p =2 |6
$6^2$= 36 ≡ 6 mod (2) ≡ 0 mod (2)
6 ≡ 0 mod (2)
WRONG EXAMPLE: p = 4 = non prime
$2^4$= 16 ≡ 2 mod (4)
but 16 ≡ 0 mod (4)
Equivalent:
p prime => $m^{p-1}$= 1 mod (p)
by Contra-positive:
3) $m^{p-1}$ ≠ 1 mod (p)
=> p non-prime
Apply: Prove 39 non-prime?
Take m =2, p= 39
Prove $m^{p-1}$ ≠ 1 mod (p)?
a) $2^{38} =2^{36}.2^2$ .
b) $2^6$= 64 ≡ 25 mod (39)
c) $25^2$ = 625 ≡ 1 mod (39)
From (b) & (c):
$(2^6)^6$ = $2^{36}$$25^6$ mod(39)≡$(25^2)^3$$1^3$ ≡ 1
From (a): $2^{38}$ = $2^{36}.2^2$ ≡ 1×4 ≠ 1 mod(39)
=> 39 non-prime | 2021-04-15 11:43:42 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 65, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6907042860984802, "perplexity": 5424.1538407895805}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618038084765.46/warc/CC-MAIN-20210415095505-20210415125505-00164.warc.gz"} |
https://gamedev.stackexchange.com/questions/187410/how-do-i-put-random-velocity-in-a-vector2 | # How do i put random velocity in a Vector2?
I'm very new to C# scripting.
I want to use a random velocity for my Enemies using Vector2. Here's the code that I have done at the moment:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy1 : MonoBehaviour
{
[SerializeField]
Rigidbody2D rb2d;
[SerializeField]
Vector2 vectorEnemysVelocity;
[SerializeField]
gameManager gameManager;
[SerializeField]
AudioSource source;
[SerializeField]
AudioClip deathSound;
private void Awake()
{
gameManager = FindObjectOfType<gameManager>();
}
void Start()
{
MoveEnemy();
}
void MoveEnemy()
{
rb2d.velocity = vectorEnemysVelocity;
}
private void OnTriggerEnter2D(Collider2D collision)
{
if(collision.gameObject.layer == 8)
{
gameManager.GenerateGameOver();
source.PlayOneShot(deathSound, 1f);
}
if (collision.gameObject.layer == 9)
{
Destroy(gameObject);
}
}
}
With this I can choose the velocity but as I said earlier I want it to be random. How can I do this?
• Take a look at docs.unity3d.com/ScriptReference/Random.Range.html with an example for a Vector3. From there it should be quite easy for you to apply it to Vector2 Dec 2 '20 at 12:57
• You've been searching for a week and you didn't find the Random class in Unity that gives you a method to generate a random Vector2? Dec 2 '20 at 16:00
• @Zibelas You should post this as an answer. Dec 2 '20 at 16:18
• @DMGregory I've been a developer for years by now, and this is the first time I bump into such a useful function. I'd better dust off the docs more often. Dec 2 '20 at 18:24
There is always more than one way on how to do it.
https://docs.unity3d.com/ScriptReference/Random.Range.html
This gives you a random value between your given min and max value. Gives you a lot of control and is easy to understand.
float minValue = 0f;
float maxValue = 10f;
Vector2 randomVector = new Vector2(Random.Range(minValue, maxValue), Random.Range(minValue, maxValue));
Another method (credit to DMGregory) is https://docs.unity3d.com/ScriptReference/Random-insideUnitCircle.html which gives you directly a Vector2.
float maxValue = 10f;
Vector2 randomVector = Random.insideUnitCircle * maxValue;
Debug.Log(randomVector);
• Note that the first method gives you a vector inside a square, and the second gives you a vector inside a disc. With the second option, you control the maximum length of the vector (speed) directly, and it's the same in all directions. With the first method, diagonal vectors are allowed to be √2 times longer (faster) than the max value you input, so you can go different speeds in different directions. The first method with the numbers given also never generates velocities pointing down or to the left. Jan 2 at 12:49
Another approach is generate a random vector in polar coordinates, and convert it to cartesian coordinates:
public Vector2 InCircle(float radius)
{
// Generate random vector in polar coordinates
var angle = Random.Range(0f, 2f * Mathf.PI);
// Convert to cartesian coordinates
var x = radius * Mathf.Cos(angle);
var y = radius * Mathf.Sin(angle);
return new Vector2(x, y);
}
I have a Unity library with UPM support called Eflatun.RandomUtils that has a bunch of useful RNG utility methods, and one of them covers your case, called InCircle:
// using Eflatun.RandomUtils;
var rng = new BetterRandom();
var result = rng.Vector2.InCircle(radius);
• Note that the polar version you've shown here is biased toward choosing vectors near the center of the circle. That may be desirable for some circumstances (eg. having an equal probability of any speed in the range), but I wanted to mention it because it may not be obvious from the code alone for folks unfamiliar with random sampling. The version in the external link corrects for this by adding a square root to the radius. Jan 3 at 14:28 | 2021-10-26 04:52:38 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5242023468017578, "perplexity": 1401.0731465127005}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323587799.46/warc/CC-MAIN-20211026042101-20211026072101-00490.warc.gz"} |
https://gateoverflow.in/312022/gate2010-tf-ga-3 | # GATE2010 TF: GA-3
177 views
Choose the most appropriate word from the options given below to complete the following sentence:
The two child norm with _______ for the violators will have significant implications for oar demographic profile$.$
1. disincentives
2. incitements
3. restrictions
4. restraints
edited
1 vote
disincentives.
Basically disincentives means some sort of punishment for the people who will not follow the 2 child norm.
selected by
## Related questions
1
193 views
Choose the most appropriate word from the options given below to complete the following sentence$:$ There is no fixed relation between food and famine$;$ famines can occur with or without a substantial _______ in food output$.$ aberration weakening decline deterioration
It has taken fifty-six long and frustrating, years to turn bronze, into gold for India's Olympics aspirations$.$ Beijing $2008$ marks a defining moment in India's Olympic history$.$ From Delhi to Beijing is a long journey but one that our Olympians have ... in India's Olympic history. Our Olympians have undertaken a long journey to Beijing. India's bronze medal turned into gold at Beijing.
The question below consists of a pair of related words followed by four pairs of words. Select the pair the best expresses the relation in the original pair$.$ Erudition : Scholar steadfast $:$ mercurial competence $:$ strict skill $:$ craftsman nurse $:$ doctor
Which of the following options is the closest in meaning to the word below$:$ Ephemeral effeminate ghostlike soft short-lived | 2020-08-14 22:37:11 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4045642614364624, "perplexity": 8335.442887071646}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-34/segments/1596439740343.48/warc/CC-MAIN-20200814215931-20200815005931-00496.warc.gz"} |
https://tex.stackexchange.com/questions/26747/tex-macro-and-command-expansion?noredirect=1 | # TeX macro and command expansion?
I have implemented couple of macros that should remove commas from numbers. It's nasty dirty stuff, but it works when input is number:
\removecommas{12,34,56.7} % => 123456.7
But it stop working when the input is given by some command, such as:
\newcommand\mynumber{12,34,56.7}
\removecommas\mynumber
Why is this happening? How can I force TeX to expand \mynumber before commas? I've tried:
\expandafter\removecommas\mynumber
but that didn't seem to help.
You are nearly there with
\expandafter\removecommas\mynumber
What is needed is a group:
\expandafter\removecommas\expandafter{\mynumber}
To understand why, you have to remember that TeX grabs arguments as tokens. Taking the example input, in the first case, you expand \mynumber to 12,34,56.7. TeX then grabs 1 as the argument to \removecommas, and unsurprisingly nothing actually happens. On the other hand, with the group in place all of 12,34,56.7 is grabbed by \removecommas, and the processing takes place as you want.
(Notice that we need two \expandafter primitives. The second one is needed to expand past {.)
If you need only up to one level expansion, this works:
\def\removecommas{\begingroup\catcode,=9 \doremove}
\def\doremove#1{\scantokens\expandafter{#1\endinput}\endgroup}
The other answers explain the macro expansion. However, if all you want to do is to remove the commas in numbers you could use the numprint package with the following setup:
\documentclass{article}
\usepackage{numprint}
\makeatletter%
\renewcommand*\nprt@dotlist{.}% only . for decimal separator in input
\renewcommand*\nprt@ignorelist{,}% ignore , in input
\npdecimalsign{\ensuremath{.}}% use . as decimal output
\npthousandsep{}%
\makeatother%
\begin{document}
\numprint{12,34,56.7}
\end{document}
` | 2020-02-27 11:46:41 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9758014678955078, "perplexity": 2630.164490730942}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875146681.47/warc/CC-MAIN-20200227094720-20200227124720-00467.warc.gz"} |
https://worksheets.tutorvista.com/word-problems-algebra-worksheet.html | # Word Problems Algebra Worksheet
Word Problems Algebra Worksheet
• Page 1
1.
The table shows the perimeter and side lengths of three equilateral triangles.
Perimeter of the triangle
2.
A car travels at an average speed of 55 miles/hour for 180 minutes. Find the distance traveled by the car.
a. 110 miles b. 165 miles c. 55 miles d. 220 miles
#### Solution:
Let x be the distance traveled by the car.
The time taken by the car to travel x miles = 180 minutes
180 minutes = 3 hours
[Convert minutes into hours.]
The average speed of the car = 55 miles/hour.
Distance traveled by the car, x = average speed x time taken
x = 55 x 3
[Replace the variables with the values, given.]
= 165
[Multiply.]
The car traveled a distance of 165 miles in 180 minutes.
3.
The formula for the volume of a rectangular pyramid is V = ($\frac{1}{3}$) $l$$w$$h$. Write a formula to find the height ($h$) of the pyramid.
a. $\frac{3V}{l}$ units b. $\frac{3V}{lw}$ units c. $\frac{3V}{w}$ units d. $\frac{V}{lw}$ units
#### Solution:
V = (13) x lwh
[Formula.]
3V = (13) x lwh x (3)
[Multiply by 3 on each side.]
3V = lwh
[Simplify.]
3Vlw = lwhlw
[Divide each side by lw.]
3Vlw = h
[Simplify.]
So, the height of the rectangular pyramid is 3V / lw units.
4.
The perimeter of a rectangular wallpaper is 46 inches and its width is 10 inches. Find the length of the rectangular sheet of wallpaper.
a. 12 inches b. 14 inches c. 13 inches d. 15 inches
#### Solution:
P = 2L + 2w
[Perimeter of a rectangle.]
46 = 2L + 2(10)
[Replace the variables with the values, given.]
46 = 2L + 20
[Multiply.]
46 - 20 = 2L + 20 - 20
[Subtract 20 from each side.]
26 = 2L
[Simplify.]
262 = 2L2
[Divide each side by 2.]
13 = L
[Simplify.]
So, the length of the rectangular wallpaper is 13 inches.
5.
An airplane flew 1182 miles at an average speed of 394 miles/hour. How long does it take to fly the entire distance?
a. 4 hours b. 3 hours c. 6 hours d. 5 hours
#### Solution:
An airplane flew 1182 miles at an average speed of 394 miles/hour.
Time = DistanceSpeed
[Formula.]
Time = 1182394
[Substitute.]
= 3
[Simplify.]
The airplane took 3 hours to travel 1182 miles.
6.
Arthur left his house at 4:00 p.m. and drove directly to his aunt's house, which is 312 miles away. What was the average speed with which he drove, if he reached his aunt's house at 8:00 p.m.?
a. 86 miles/hour b. 70 miles/hour c. 78 miles/hour d. 90 miles/hour
#### Solution:
The time taken by Arthur to reach his aunt's house = 8 - 4 = 4 hours
The distance from Arthur's house to his aunt's house = 312 miles
Speed = DistanceTime
[Formula.]
= 3124
[Replace the variables with the values, given.]
= 78
[Simplify.]
The average speed with which Arthur drove is 78 miles/hour.
7.
The average of 41 non-negative integers is 23.4. Find their sum.
a. 918.4 b. 960.4 c. 959.4 d. 958.4
#### Solution:
The sum of the numbers = Average of the numbers x count of the numbers
[Formula.]
= 23.4 x 41
[Substitute the values.]
= 959.4
[Simplify.]
The sum of the numbers is 959.4.
8.
The formula F = ($\frac{9}{5}$) × C + 32 is used to convert temperature in Celsius (C) scale to that in Fahrenheit (F) scale. Which of the following best suits the conversion of temperature from Fahrenheit scale to Celsius scale?
a. C = $\frac{5}{9}$ (F - 22) b. C = $\frac{5}{9}$ (F - 32) c. C = $\frac{5}{9}$ (F + 32) d. C = $\frac{5}{9}$ (F - 12)
#### Solution:
F = ( 95 ) x C + 32
[Formula.]
F - 32 = ( 95 ) x C + 32 - 32
[Subtract 32 from each side.]
F -32 = ( 95 ) x C
[Simplify.]
5(F - 32) = 5 x ( 95 ) x C
[Multiply by 5 on each side.]
5(F - 32) = 9C
[Simplify.]
59 (F - 32) = 9C9
[Divide by 9 on each side.]
59 (F - 32) = C
[Simplify.]
The formula C = 5 / 9 (F - 32) is used to convert temperature from Fahrenheit scale to Celsius scale.
9.
Find the celsius temperature that corresponds to a room temperature of 50oF by using the formula F = ( $\frac{9}{5}$ ) C + 32.
a. 6o b. 4o c. 10o d. 8o
#### Solution:
F = ( 95 ) x C + 32
[Formula.]
50 = ( 95 ) x C + 32
[Replace the variable with the value, given.]
50 - 32 = ( 95 ) x C + 32 - 32
[Subtract 32 from each side.]
18 = ( 95 ) x C
[Simplify.]
(5)(18) = 5 x ( 95 ) x C
[Multiply by 5 on each side.]
90 = 9C
[Simplify.]
909 = 9C9
[Divide each side by 9.]
10 = C
[Simplify.]
The Celsius temperature corresponding to 50o F is 10oC.
10.
Convert 25oC into Fahrenheit scale by using the formula, F = ( $\frac{9}{5}$ ) C + 32.
a. 77oF b. 82oF c. 72oF d. 85oF
#### Solution:
F = ( 95 ) x C + 32
[Original formula.]
F = ( 95 ) x 25 + 32
[Substitute 25 for C.]
= (9)(5) + 32
[Divide.]
= 45 + 32
[Multiply.]
= 77
[Simplify.]
25oC is equal to 77oF. | 2019-06-17 15:45:52 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 16, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6040919423103333, "perplexity": 2806.013971239832}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-26/segments/1560627998509.15/warc/CC-MAIN-20190617143050-20190617165050-00162.warc.gz"} |
https://brilliant.org/problems/a-combinatorics-problem-by-ankit-nigam-3/ | See from another point of view
Seven white balls and three black balls are randomly placed in a row. The probability that no two black balls are placed adjacently equals to?
× | 2017-09-22 13:27:05 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9563579559326172, "perplexity": 230.0339792690365}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-39/segments/1505818688966.39/warc/CC-MAIN-20170922130934-20170922150934-00088.warc.gz"} |
https://www.ier.co.za/wga17le/how-to-find-molar-mass-of-zinc-200763 | Number Bracelets Math, Great Stuff Pro Adhesive Lowe's, Journal And Courier, Asus Keyboard @ Symbol, Suture Removal Kit, Flick Electric Promo Code, Descargar Música De Youtube, Gunny Bags Wholesale Suppliers, Chain Of Thorns Cassandra Clare, Reverse Osmosis Systems, " />
### how to find molar mass of zinc
that compound. so find moles of Zn by dividing Mass/ Molar mass. x 19 grams/mole of fluorine) = 42 grams/mole of sodium fluoride, 6. element, we need to find the molar mass from the chemical formula. Each mole of a substance will always be equal to Avogadro's Number of particles of that substance. Molar Mass: The mole is a common unit in chemistry used to represent the quantity of a substance. The specific volume of the virus is 0. At least 15 clinical trials have shown that zinc improved weight gain in anorexia. c. C 5 H 8 NNaO 4, monosodium glutamate, flavor enhancer. Molar masses of Add the atomic masses of the solute together to find the molar mass. ), SO 4) 5) 6) CH,COOH Pb(NO3)2 Ga (SO) Solve (1 pt each = 3 points) 7) How many moles are 1.20 x 1025 atoms of phosphorus? Molar mass is defined as the mass of one mole of representative particles of a substance. atoms of anything next to that subscript by the number of the subscript. Mass of ZnO= Molar mass of ZnO * Number of moles of ZnO. We have been asked to weigh out 2.8696grams of zinc. So, in our example, carbon has a molar mass of 12.01 grams per mole. Using the chemical formula of the compound and the periodic table of elements, we can add up the atomic weights and calculate molecular weight of the substance. Enter the molecular formula of the substance. this, we need to remember a few rules: 1. The molar mass will be equal to (1 atom x 56 grams/mole Symbol: Zn [ element | zinc-based compounds] Atomic number: 30 Atomic weight: 65.38(2) Ionization energy, eV: 9.394199. of calcium, one atom of sulfur, and four atoms of oxygen. Based on this weight, determine molar mass, number of moles and number of atoms. so, 0.3822104 mol * 32.065 g/mol = 12.26 grams of sulfur required the element has two atoms of that element stuck together. ›› Zinc molecular weight. The molar mass of Zinc is 65.38 grams per mole. -For elements, the molar mass is equal to the atomic mass on the periodic table. Does the water used during shower coming from the house's water tank contain chlorine? Multiply it by 100% to get percent composition. are equal to the sums of the molar masses of all the atoms in one molecule of chemical formula, then you, For most compounds, this is easy. no limit to how heavy a chemical compound can be - it is not uncommon for macromolecules Former Citigroup chairman: How to bring unity to U.S. Republican forces vote on 25th Amendment resolution, Etsy removes 'disrespectful' Auschwitz shirt, SCOTUS rejects fast track for Trump election cases, Marriott shuns lawmakers who balked at certification, Trump faces a new challenge in his final days. Convert grams Zinc Iodide to moles or moles Zinc Iodide to grams. compounds: 1. then (1 x 40 grams) + (1 x 32 grams) + (4 x 16 grams) = 136 grams/mole of Convert grams Zinc Nitrate to moles or moles Zinc Nitrate to grams. are equal to the sums of the molar masses of all the atoms in one molecule of Basically, you should know how to find the molar masses of any chemical compound now. However, if you have the molar mass (65.39 g/mol) you can calculate the other values: 2.8696 grams Zn X (1 mol/65.39 grams) = 0.04388 moles of Zinc. 1 : 1 mol ratio so the same moles of Sulfur are required and we can convert this into mass because. Examples: Fe, Au, Co, Br, C, O, N, F. You can use parenthesis or brackets []. The molar mass is then (1 x 55 What or who protects you from residue and odour? atom of manganese and two atoms of oxygen. Zn+ 2 x Br. formula is. Finding Molar Mass. bromine, and iodine, the element is diatomic, meaning that each molecule of formula of hydrogen is H2, nitrogen is N2, etc. atom x 23 grams/mole Na) + (1 atom x 35.5 grams/mole Cl) = 58.5 grams/mole Yes; 0.366 mol is about 1/3 mol. Use uppercase for the first character in the element and lowercase for the second character. Molar Mass, Molecular Weight and Elemental Composition Calculator Enter a chemical formula to calculate its molar mass and elemental composition: Molar mass of Zn(C2H3O2)2 is 183.4680 g/mol In the case of hydrogen, nitrogen, oxygen, fluorine, chlorine, And add them up. First you need to find n.o of moles n =mass of the substance /molecular weight n=10 /65=0.153 N.o of atoms =n into avogardo n.o =0.153 into 6.022 into 10 raise to 23 =0.926 into 10 raise to 23 Molecular weight: 65.38 g/mol. ›› Zinc Nitrate molecular weight. In sodium fluoride, there is one atom If you have a subscript in a d. C 6 H 12 O 2, isoamyl formate, used to make artificial fruit syrups F3Fe; Fe{3+} Al2(SO4)3*5H2O; K2SO4*Al2(SO4)3*24H2O; CNa2O3; F6U; Mg(BrO4)2; NaPO4; Ga2(SO3)3; B2(SO4)3; Fe(NO2)2; Zn(BrO3)2; Recently Calculated Molar Masses; Calculators. atoms, P4, and sulfur is found in clumps of eight atoms, or S8. g 164 g/ mol b. mole. Molar Mass is: the number of grams of a substance that is equal to 1 mole of that substance. iron (II) chloride, or FeCl2, you have one atom of iron and two What is the molar mass of zinc sulfate hexahydrate, ZnSO4 6H2O? Still have questions? Molar volume: 9.166 cm³/mol. mass will then be (1 x 39 grams) + (1 x 1 gram) + (1 x 16 grams) = 56 Zinc Acetate Zn(C2H3O2)2 Molar Mass, Molecular Weight. is the same. From the following info calculate the molar mass of zinc. Could anyone help me with this? write this as a calculation, it looks like this: (1 It will calculate the total mass along with the elemental composition and mass of each element in the compound. of one atom of sodium plus the molar mass of one atom of chlorine. In magnesium phosphate, there are three phosphorus is normally found in clumps of four The change in pressure, the temperature, and the volume of the system were used to calculate moles of hydrogen gas, using the ideal gas law: Using the mass and moles of the metals, the average molar masses of manganese and zinc were determined to be 54.3 ± 2.5 g/mol and 62.4 ± 2.9 g/mol, respectively. Email me at misterguch@chemfiesta.com, How to calculate the molar masses of chemical compounds, Molar mass is the weight of one mole (or Compound: Moles: Weight, g: ZnSO4: Elemental composition of ZnSO4. with water? 8) How many atoms are in 0.750 moles of zinc? In the case of hydrogen, nitrogen, oxygen, fluorine, chlorine, (1 atom x 23 grams/mole of sodium) + (1 atom K Assume the specific heat units are Joules/g K . The solutions are given at the Molecular weight calculation: 65.38 + (54.938049 + 15.9994*4)*2 ›› Percent composition by element In magnesium phosphate, there are three atoms of chlorine. Zinc Sulfate Heptahydrate ZnSO4.7H2O Molar Mass. In sodium fluoride, there is one atom atom of potassium, one atom of hydrogen, and one atom of oxygen. 6.02 x 1023 molecules) of any chemical compounds. You will now have a number between 0 and 1. There are a few exceptions to this rule. Step 1: Find molar mass of an element Find the molar mass of an element. Molecular weight calculation: 65.38 + (15.9994*2 + 12.0107 + 12.0107 + 1.00794*3)*2 + (1.00794*2 + 15.9994)*2 ›› Percent composition by element x 19 grams/mole of fluorine) = 42 grams/mole of sodium fluoride, 2. Zinc is a bluish-white lustrous metal of a hexagonal close-packed crystalline structure. Molar volume: 9.166 cm³/mol. If we How would this new observation affect your reported molar mass value? that compound. grams/mole of magnesium phosphate, Got Tips for solving: The percent composition of all elements in a compounds must add up to 100%. Which of the following is likely to occur after decreasing the pressure of a liquid? Add together the atomic masses from your solute to find the total molar mass. The vapor pressure of water at 22 degrees celsius is 19.827 mm Hg? That is molecular weight of zinc acetate… Zn(O₂CCH₃)₂. Molecular formula: Zn. Element Symbol Atomic weight Atoms Mass percent; Zinc: Zn: 65.38: 1: 40.4974: Sulfur: S: 32.065: 1: 19.8615: Oxygen: O: 15.9994: 4: 39.6411: Mass percent composition : Atomic percent composition: Sample … The molar mass of zinc nitrate (The By looking at a periodic table, we can conclude that the molar mass of lithium is 6.94 g, the molar mass of zinc is 65.38 g, and the molar mass of gold is 196.97 g. Each of these quantities contains 6.02 × 10 23 atoms of that particular element. m=M*xn ==>n=m/M=3.62 moles of zinc chloride. Divide 1/65.38 to find out what part of a mole you have. formula is Mg3(PO4)2). If we have a Could anyone help me with this? Molar Mass * moles = mass. All we need now is the molar mass, thus: Molar mass of … For example, take the example of zinc nitrate, per mole. For other compounds, this might get a Convert grams Zinc to moles or moles Zinc to grams ›› Percent composition by element Based on this weight, determine molar mass, number of moles and number of atoms. Look at the elements in the chemical formula for the solute you’re using. Now For (PO4)2, this means there's two compounds of (PO4)2. the atoms in the compound which is. To do m=Mxn where m is the mass and M is the molar mass, n is the #of moles. Thanks in advance :-) The molar In potassium hydroxide, there is one Do a quick conversion: 1 grams Zinc Iodide = 0.0031329406338453 mole using the molecular weight calculator and the molar mass of ZnI2. 1. That’s easy – Molar mass of Zn = 65.38 g/mol. What is the molar mass of Zinc? Thanks in advance :-), 2.8696 g / 65.39 g = molar mass of Zinc sample, ( 6.022 x 10^23 atoms per mole )( 0.04388438599 mole ) = number of atoms, [ (0.26427177244 x 10^23) / (6.022 x 10^23) ] x [ 65.39 g ] = weight of sample, [ (0.26427177244 ) / (6.022 ) ] x [ 65.39 g ] = weight of sample, 0.04388438599 ( 65.39 g ) = weight of sample. The molar mass of elements is found by can have under normal conditions is hydrogen gas, or H, There are a few exceptions to this rule. Zinc is a bluish-white lustrous metal of a hexagonal close-packed crystalline structure. Take a look at periodic table. a reaction between .12 g of zinc and excess HCl generates 44 mL of H2 having a combined pressure (h2+water vapor) of 770 mm Hg and a temp of 22 degrees celsius. By looking at a periodic table, we can conclude that the molar mass of lithium is $$6.94 \: \text{g}$$, the molar mass of zinc is $$65.38 \: \text{g}$$, and the molar mass of gold is $$196.97 \: \text{g}$$. Get your answers by asking now. This gets weirder for a couple of cases... If you have a subscript in a Fortunately, they gave you the number of moles as 2mole. chemical compound like NaCl, the molar mass will be equal to the molar mass 287.56 (161.4 for the water free version). For example, take the example of zinc nitrate, For example, if you want to find the molar mass of carbon, you would find the atomic mass of carbon on the periodic table, and this is equal to the molar mass in grams per mole. Molar mass is defined as the mass of one mole of representative particles of a substance. Molar masses of chemical compounds In the next and final section, I'll give you some practice … Definitions of molecular mass, molecular weight, molar mass and molar weight If you mean mass then this is easy. 65.39 g Zn 1 mol Zn 0.366 mol Zn 23.9 g Zn multiply by the molar mass of Zn Amount of Zn in mol 2 Mass of Zn in mol 1 molar mass Zn given 65.39 g Zn mol Zn g Zn 1 mol Zn Items Data Amount of zinc 0.366 mol Molar mass of zinc 65.39 g/mol Mass of zinc ? Answer to what is the molar mass of zinc sulfite heptahydrate, ZnSo3 . Equations/Reactions. In manganese (IV) oxide, there is one Instructions. Definition von Molekularmasse, Molekulargewicht, molarer Masse und molarem … So, in our example, carbon has a molar mass of 12.01 grams per Molar mass of Zn(O2CCH3)2(H2O)2 = 219.4986 g/mol. so 65.4 G/mol+ 79.9 G mol*2=225.5 Grams/ mol which is the molar mass and then use it to convert to mol and divide by the total volume of the solution. phosphorus. formula of hydrogen is H, This gets weirder for a couple of cases... Basically, you should know how to find the molar masses of any a. How many moles of PbS04 are 0.04388 moles Zn X (6.02X10^23 atoms/mole ) = 2.64 X 10^22 atoms of zinc. Calculate the molar mass for each of the following: a. ZnSO 4, zinc sulfate, zinc supplement. This site explains how to find molar mass. All you need to do is find the molar mass of zinc which is 65.38 g/mole. Molar mass of Zn(MnO4)2 = 303.251298 g/mol. write this as a calculation, it looks like this: 2. unbonded atom. Select one: O a. Zinc nbr 30 has atomic weight 65.38. It can be done by Dulongs and petit’s law. 2.8696 g Zn x (1 mole Zn / 65.39 g Zn) = 0.04388 moles Zn, 0.04388 moles Zn x (6.023 x 10^23 Zn atoms / 1 mole Zn) = 2.64 x 10^22 Zn atoms, Number of moles: 2.8696 grams * (1moles/ 65.39g), Number of atoms: just multiply it by Avogadro number instead of by moles and divide by molar mass. or. Zinc-65 atom is a zinc atom in which the nucleus contains 35 neutrons. Molecular formula: Zn. That is molecular weight of zinc acetate… Zn(O₂CCH₃)₂. Molar Mass, Molecular Weight and Elemental Composition Calculator Enter a chemical formula to calculate its molar mass and elemental composition: Molar mass of Zn(NO3)2 is 189.3898 g/mol Well if u have 493.28g of zinc chloride and its molar mass is 136.20 grams per mol then ul need to find the number of moles of ZnCl2. 40 x 3 = 120. In this compound, just add al the MM together. As a result, the grams) + (2 x 16 grams) = 87 grams/mole of manganese (IV) oxide, 5. Divide the component's molar mass by the entire molecular mass. atoms of magnesium, two atoms of phosphorus, and eight atoms of oxygen. chemical formula, then you multiply the number of The molar mass will then be: We have been asked to weigh out 2.8696grams of zinc. The molar mass of zinc phosphate is M=386.1. atoms of magnesium, two atoms of phosphorus, and eight atoms of oxygen. all elements have the same molar mass as the atomic masses on the periodic spontaneous combustion - how does it work? So there is 2 Phosphorus which has a mass of 30.9 (31) So 31 x 2 = 62. What mass of silver nitrate must be placed into a 500 mL volumetric flask, dissolved, and diluted to the mark Made from : Zn + H2SO4 + 7 H2O → ZnSO4•7H2O + H2 Zinc sulfate - Wikipedia Molar mass 287.53 g/mol (heptahydrate) b. Ca(IO 3) 2, calcium iodate, iodine source in table salt. 7H2o? I know from the period table zinc has atomic number of 30 and weight of 65.39g. chemical compound? a reaction between .12 g of zinc and excess HCl generates 44 mL of H2 having a combined pressure (h2+water vapor) of 770 mm Hg and a temp of 22 degrees celsius. little bit more complicated. 7 5 m L g − 1. if the virus is considered to be a single particle, find its molar mass. TIP: In the case of zinc nitrate, the molar mass is (1 atom times 65 grams/mole zinc) plus (two atoms times 14 grams/mole of nitrogen) plus (six atoms times … Examples. chemical compound now. We can then find the empirical formula mass by adding together the masses of its components: Well, it appears our molar mass is the same as our empirical mass. atom of copper and one atom of chlorine. 9) How many molecules are in 0.400 moles of N,O ? For most compounds, this is easy. Fe) + (2 atoms x 35.5 grams/mole of chlorine) = 127 grams/mole of iron (II) The molar mass of elements is found by looking at the atomic mass of the element on the periodic table. And add them up. of nitrogen) + (six atoms x 16 grams/mole of oxygen) = 189 grams/mole of zinc List the atomic mass for each element in the solute since atomic and molar mass are the same. will be equal to (1 atom x 65 grams/mole of zinc) + (two atoms x 14 grams/mole mole for more complex chemical compounds. You take a look at other elements in Zinc acetate. How to Calculate Molar Mass: 7 Steps (with Pictures) - wikiHow The atomic weight for Zn on the periodic table IS the molar mass in grams. calcium sulfate, 6. How can I find the molar mass of an element? Berechnungsbeispiele des Molekulargewichts: C[14]O[16]2, S[34]O[16]2. Molar Mass: 183.468 In some cases, the element is usually found in a different form than just one If we have a Give the molar masses of the following Zinc nbr 30 has atomic weight 65.38. 4. For example, in There is Belichick declines Trump's Medal of Freedom, Skyrocketing stocks now have investors worried, Rioter pictured with Pelosi's lectern released on bond, Hailie Deegan apologizes for use of slur in broadcast, 'Black Panther' actor, model confirm romance rumors. 12.5g I2 × 1mol I2 253.808g I2 × 1mol Zn 1mol I2 × 65.38g Zn 1mol Zn = 3.22 g Zn. Molar Mass, Molecular Weight and Elemental Composition Calculator Enter a chemical formula to calculate its molar mass and elemental composition: Molar mass of ZnO is 81.3794 g/mol Find the molar mass of all the elements in the compound in grams per mole. For any chemical compound that's not an A bottle of PbS04 contains 158.1 g of the compound. 65.39 g Zn 1 mol Zn 0.366 mol Zn 23.9 g Zn multiply by the molar mass of Zn Amount of Zn in mol 2 Mass of Zn in mol 1 molar mass Zn given 65.39 g Zn mol Zn g Zn 1 mol Zn Items Data Amount of zinc 0.366 mol Molar mass of zinc 65.39 g/mol Mass of zinc ? 2 molar mass See full answer below the following compounds: 1 of sodium and atom..., they gave you the number of atoms I know from the period zinc! Final section, I 'll give you some practice … we have been asked to weigh out 2.8696grams zinc... Compound ( the formula weight computed is the molecular formula, then you, for most compounds, for! G of the Zn required to react with 12.5 g ZnBr2 how to find molar mass of zinc 1 mol ratio so same. Degrees celsius is 19.827 mm Hg the water used during shower coming the. Dioxide were consumed be placed into a 500 mL volumetric flask,,... Do this, we need to find the molar mass of an.... → 2 H 2 O you can also ask for help in our example, in our example, the. Few rules: 1 will calculate the molar mass calculation probems I might ask you on a quiz water! Solve for molar mass Iodide to moles or moles zinc Acetate to grams in chemistry used represent! It will calculate the molar mass from the house 's water tank chlorine. Know from the chemical formula for the first character in the solute together to find how. Copper and one atom how to find molar mass of zinc oxygen the elements in the element is usually in! 189.3898 g/mol like this: 2 weight gain in anorexia as the atomic of. Degrees celsius is 19.827 mm Hg will be 1x10-3 moles weight and how to find molar mass of zinc composition and mass …... Water tank contain chlorine need now is the mass of the following: a. ZnSO,. G of the solute you ’ re using four atoms of that compound petit ’ s easy Yes. Approximately 6.023 * 10^23 molecules in a mol ZnSO4 weight and elemental composition of ZnSO4 be equal to the of! Iodate, iodine source in table salt pt each = 8 points ) 10 ) grams..., it looks like this: 2 atoms in one molecule of that particular.... Get a little bit more complicated mass along with the elemental composition.! Kind of molar mass by the entire molecular how to find molar mass of zinc so find moles of N, O { 23 } ). To do is find the molar mass of the molar mass is defined as the atomic masses from solute... At periodic table PbS04 contains 158.1 g of the following is likely to occur after decreasing the of... Is 161.4426 g/mol compound name is zinc sulfate, there is one atom of manganese and two atoms of,! Nitrate must be placed into a 500 mL volumetric flask, dissolved, and eight of. Treatment of anorexia nervosa -for elements, the element on the periodic table 0.750! Convert the volume into liters, the element on the periodic table mass because at periodic.. House 's water tank contain chlorine, molecular weight of 65.39g the house 's water tank contain chlorine =! A liquid this new observation affect your reported molar mass of zinc sulfate is 161.4426 g/mol name... Compounds of ( PO4 ) 2 your solute to find the total mass with! Than just one unbonded atom would this new observation affect your reported mass! Exceptions above, all elements have the same 35.45 grams per mole, I 'll give some! Component 's molar mass as the mass of zinc percent composition of ZnSO4 name is zinc convert! In a mol between ZnSO4 weight and moles the use of zinc acetate… Zn ( C2H3O2 2. Phosphate, there is one atom of sodium nitrate. a chemical compound that 's not an element find molar... Of 12.01 grams per mole subscript in a mol the exceptions above, all elements in a in!: find molar mass of 12.01 grams per mole – Yes ; 0.366 mol is about 1/3 molar... Zn by it molar mass of each element in the treatment of anorexia has been since...... See full answer below I find the molar mass is defined the... Result, the molarity of the solute since atomic and molar mass is to. … zinc Acetate to grams we write this as a calculation, it looks this. 189.3898 g/mol any given compound be equal to the sums of the compound in grams 10^23! Same moles of Zn ( NO3 ) 2 molar mass of 12.01 grams per mole hydroxide there! The lightest possible chemical that one can have under normal conditions is hydrogen gas or! Want will be 1x10-3 moles you should know how to find the molar mass of all elements... To calculate molar mass of silver nitrate must be placed into a 500 mL volumetric,... Calculate molar mass of zinc is 65.38 g/mole decreasing the pressure of water at 22 degrees is. 1: find molar mass of each element in the treatment of has... Its density is 3.31 g/cm 3, deliquescent in air.It disolves well water! The house 's water tank contain chlorine of elements is found by looking at elements. Of anorexia has been advocated since 1979 divide 1/65.38 to find the molar,. … take a look at other elements in the treatment of anorexia been... Are approximately 6.023 * 10^23 molecules in a chemical compound that 's not an element, we need find. 10^23 to find the molar mass of each element in the treatment of anorexia has been advocated since 1979 180.. Following steps: I diluted to the mark with water for Zn on periodic... The use of zinc it behave as a gas a quiz a quick conversion of!: 1 mol ZnBr2/225.2 G=.0555 mol/.25 l =.222 molar so find of! Sulfate, zinc supplement of ZnI2, take the example of zinc acetate… Zn ( O2CCH3 2! And four atoms of phosphorus, and eight atoms of chlorine of N,?. ( 6.02 \times 10^ { 23 } \ ) atoms of zinc chloride just add al the mm together:... Be formed in a different form than just one unbonded atom is one atom fluorine... 0.400 moles of C5H12 that are in 0.750 moles of zinc acetate… Zn ( MnO4 ),... Done by Dulongs and petit ’ s law a few rules: 1 23.576 grams of are. Znso 4, monosodium glutamate, flavor enhancer have been asked to weigh out 2.8696grams of zinc a... Mno4 ) 2 = 219.4986 g/mol: elemental composition calculator and m the! Use uppercase for the second character 1994 trial showed that zinc improved weight in. From your solute to find the molar mass, molecular weight calculator the! Hexagonal close-packed crystalline structure to get percent composition contains 35 neutrons 161.4426 g/mol compound is... Compound in grams per mole anorexia has been advocated since how to find molar mass of zinc of mass... Zinc acetate… Zn ( MnO4 ) 2 molar mass of ZnI2 ( cas RN ): 7440-66-6 1 than! 32.065 g/mol = 12.26 grams of sulfur required it can be done by Dulongs and petit s! Of ZnI2 calculation probems I might ask you on a quiz ( ZnO ) this:.... Heat units are Joules/g k ( 6.02 \times 10^ { 23 } \ ) atoms phosphorus... S easy – Yes ; 0.366 mol is about 1/3 the molar.... Zinc Acetate Zn x ( 6.02X10^23 atoms/mole ) = 2.64 x 10^22 atoms of oxygen represent the of! Give the molar mass of ZnI2 9 ) how many atoms are in 362.8 g of the following a.. Add up to 100 % to get percent composition use of zinc acetate… Zn ( C2H3O2 ) 2 likely occur. M=M * xn == > n=m/M=3.62 moles of zinc in the compound in grams per.! [ 16 ] 2 the second character of phosphorus, and eight of... That compound are equal to the mark with water out how many are... Likely to occur after decreasing the pressure of water at 22 degrees is. Formula used in calculating molar mass are the same moles of sulfur required it can be by..., grams are a pain to work with, so we have to the. C. 270. g/mol O d. 366 g/mol O c. 270. g/mol O c. 270. O. Be equal to the sums of the compound in grams with 12.5 I2! Constant there are approximately 6.023 * 10^23 molecules in a different form than just one unbonded.! Hexahydrate, ZnSO4 6H2O ZnSO 4, zinc supplement, zinc sulfate hexahydrate, ZnSO4?. # of moles weight calculator and the molar mass based on this weight g! One can have under normal conditions is hydrogen gas, or equal to the atomic on. ( the formula used in calculating molar mass of zinc following: ZnSO... Calculate molar mass, N is the molar mass of each element in the compound section. Sulfur required it can be done by Dulongs and petit ’ s law metal of a sample which the contains. Be formed in a reaction in which the nucleus contains 35 neutrons, they you! Weight computed is the mass of … take a look at other elements in a chemical compound now in. Of PbS04 contains 158.1 g of the molar masses of the element is usually in! In manganese ( IV ) oxide, there is one atom of chlorine 35.45... Should know how to find the molar mass of one mole of particles! The moles Zn by it molar mass of an element, we need remember. | 2021-07-31 18:31:25 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6938455700874329, "perplexity": 3126.942431583725}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046154099.21/warc/CC-MAIN-20210731172305-20210731202305-00313.warc.gz"} |
http://www.gclubonline2015.com/category/customwritings/ | ## Tips, Formulas and Shortcuts for Paper Writing On The Web
Tips, Formulas and Shortcuts for Paper Writing On The Web
Whenever you order a paper right here, you could be assured that all associated with works are distinctive and written myself for you personally! You’ll be able to order any type or kind of scholastic paper notwithstanding the grade, degree, complexity or due date. Prior to having your paper done, it really is proofread and modified with good attention. Alternatively, you are stuck by having a various paper. A study paper involves customwriting plagiarism surveying a industry of real information in order to get the very best feasible information in that area. อ่านเพิ่มเติม “Tips, Formulas and Shortcuts for Paper Writing On The Web” | 2020-04-10 02:06:03 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8293449878692627, "perplexity": 3148.47613553232}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-16/segments/1585371883359.91/warc/CC-MAIN-20200410012405-20200410042905-00472.warc.gz"} |
https://proofwiki.org/wiki/Euclid%27s_Theorem | # Euclid's Theorem
## Theorem
For any finite set of prime numbers, there exists a prime number not in that set.
In the words of Euclid:
Prime numbers are more than any assigned multitude of prime numbers.
### Corollary 1
There are infinitely many prime numbers.
### Corollary 2
There is no largest prime number.
## Proof
Let $\mathbb P$ be a finite set of prime numbers.
Consider the number:
$\displaystyle n_p = \left({\prod_{p \mathop \in \mathbb P} p}\right) + 1$
Take any $p_j \in \mathbb P$.
We have that:
$\displaystyle p_j \mathrel \backslash \prod_{p \mathop \in \mathbb P} p$
Hence:
$\displaystyle \exists q \in \Z: \prod_{p \mathop \in \mathbb P} p = q p_j$
So:
$\displaystyle n_p$ $=$ $\displaystyle q p_j + 1$ $\quad$ by Division Theorem $\quad$ $\displaystyle \implies \ \$ $\displaystyle n_p$ $\perp$ $\displaystyle p_j$ $\quad$ by definition of coprime $\quad$
So $p_j \nmid n_p$.
There are two possibilities:
$(1): \quad n_p$ is prime, which is not in $\mathbb P$.
$(2): \quad n_p$ is composite.
But from Positive Integer Greater than 1 has Prime Divisor, it must be divisible by some prime.
That means it is divisible by a prime which is not in $\mathbb P$.
So, in either case, there exists at least one prime which is not in the original set $\mathbb P$ we created.
$\blacksquare$
## Historical Note
This theorem is Proposition $20$ of Book $\text{IX}$ of Euclid's The Elements.
## Fallacy
There is a fallacy associated with Euclid's Theorem.
It is often seen to be stated that: the number made by multiplying all the primes together and adding $1$ is not divisible by any members of that set.
So it is not divisible by any primes and is therefore itself prime.
That is, sometimes readers think that if $P$ is the product of the first $n$ primes then $P + 1$ is itself prime.
This is not the case.
For example:
$\left({2 \times 3 \times 5 \times 7 \times 11 \times 13}\right) + 1 = 30\ 031 = 59 \times 509$
both of which are prime, but, take note, not in that list of six primes that were multiplied together to get $30\ 030$ in the first place.
## Source of Name
This entry was named for Euclid. | 2018-04-22 03:00:58 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8846069574356079, "perplexity": 366.3912121039144}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-17/segments/1524125945484.58/warc/CC-MAIN-20180422022057-20180422042057-00196.warc.gz"} |
https://ir.cwi.nl/pub/21416 | Let $G$ be a simple graph on the vertex set ${1,\ldots,n}$. An algebraic object attached to $G$ is the ideal $P_G$ generated by diagonal 2-minors of an $n \times n$ matrix of variables. In this paper we first provide some general results concerning the ideal $P_G$. It is also proved that if $G$ is bipartite, then every initial ideal of $P_G$ is generated by squarefree monomials. Furthermore, we completely characterize all graphs $G$ for which $P_G$ is the toric ideal associated to a finite simple graph. As a byproduct we obtain classes of toric ideals associated to non-bipartite graphs which have quadratic Gröbner bases. Finally, we provide information in certain cases about the universal Gröbner basis of $P_G$. | 2019-05-21 02:35:37 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7091268301010132, "perplexity": 59.34522821415087}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232256215.47/warc/CC-MAIN-20190521022141-20190521044141-00021.warc.gz"} |
https://gmatclub.com/forum/ps-cube-73320.html | It is currently 25 Feb 2018, 19:53
### GMAT Club Daily Prep
#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
Your Progress
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
# Events & Promotions
###### Events & Promotions in June
Open Detailed Calendar
# PS: Cube
post reply Question banks Downloads My Bookmarks Reviews Important topics
Author Message
Manager
Joined: 23 Nov 2008
Posts: 79
PS: Cube [#permalink]
### Show Tags
27 Nov 2008, 01:42
00:00
Difficulty:
(N/A)
Question Stats:
0% (00:00) correct 0% (00:00) wrong based on 0 sessions
### HideShow timer Statistics
This topic is locked. If you want to discuss this question please re-post it in the respective forum.
ABCD and EFGH are two parallel sides of a cube. What is the measure of angle BEG?
A.30 degrees
B.45 degrees
C.60 degrees
D.75 degrees
E.90 degrees
Manager
Joined: 08 Aug 2008
Posts: 229
Re: PS: Cube [#permalink]
### Show Tags
27 Nov 2008, 01:50
ABCD/EFGH shud be 2 faces rather...
nyways, the answer should be E-90 degrees.
BE,EG and BG form a right triangle.
Attachments
brett1.2.gif [ 3.06 KiB | Viewed 986 times ]
Manager
Joined: 23 Nov 2008
Posts: 79
Re: PS: Cube [#permalink]
### Show Tags
27 Nov 2008, 02:25
I jumped to a 90 degrees answer as well - which is why I thought this would be an interesting question to post here. We need to look at the sides of the triangle BEG..
Attachments
cube.JPG [ 3.49 KiB | Viewed 984 times ]
Manager
Joined: 08 Aug 2008
Posts: 229
Re: PS: Cube [#permalink]
### Show Tags
27 Nov 2008, 02:35
Thanx for pointing that out...
the answer is 60 degrees then as its equilateral triangle...
as all sides are equal with length a$$sqrt(2)$$ if a is a side of the cube.
Current Student
Joined: 28 Dec 2004
Posts: 3342
Location: New York City
Schools: Wharton'11 HBS'12
Re: PS: Cube [#permalink]
### Show Tags
27 Nov 2008, 10:16
i get an equilatreal triangle each leg is sqrt(2)(x) where x is the side of the cube..
60 degree it is
Re: PS: Cube [#permalink] 27 Nov 2008, 10:16
Display posts from previous: Sort by
# PS: Cube
post reply Question banks Downloads My Bookmarks Reviews Important topics
Powered by phpBB © phpBB Group | Emoji artwork provided by EmojiOne Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®. | 2018-02-26 03:53:30 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.48766764998435974, "perplexity": 12629.061308315113}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-09/segments/1518891817999.51/warc/CC-MAIN-20180226025358-20180226045358-00029.warc.gz"} |
https://www.quizover.com/course/section/extra-credit-1-point-lab-3-lab-by-openstax | # 4.3 Lab 3: lab (Page 3/3)
Page 3 / 3
## Parameter passing
The parameter passing convention between assembly and C is simple for single input, single output assembly functions.From a C program, the input to an assembly program is in the low part of accumulator A with the output returned in the same place. In this example, the function filter takes the right input sample from A and returns a single output in A (note the left shift by 16 to put the result in the low part of A ). When more than one parameter is passed to an assembly function, the parameters are passed on thestack (see the core file description for more information). We suggest that you avoid passing or returning more than oneparameter. Instead, use global memory addresses to pass in or return more than one parameter. Another alternative isto pass a pointer to the start of a buffer intended for passing and returning parameters.
## Registers modified
When entering and leaving an assembly function, the ENTER_ASM and LEAVE_ASM macros ensure that certain registers are saved and restored. Sincethe C program may use any and all registers, the state of a register cannot be expected to remain the same between callsto assembly function(s). Therefore, any information that needs to be preserved across calls to anassembly function must be saved to memory! In this example, stateptr keeps track of the location of the current sample in the circular buffer firstate . Why don't we need to keep track of the location of the coefficient pointer ( AR2 in this example) after every sample?
A working program can be produced by compiling the C code and linking assembly modules and the core module. Thecompiler translates C code to a relocatable assembly form. The linker assigns physical addresses on the DSP to therelocatable data and code segments, resolves .global references and links runtime libraries.
The procedure for compiling C code and linking assembly modules has been automated for you in the batch file v:\ece320\54x\dsptools\C_ASM.bat . Copy the files lab3main.c , and lab3filt.asm from the v:\ece320\54x\dspclib\ directory into your own directory on the W: drive. Using Matlab, write the coefficients you created in the prelabinto a coef1.asm file. Then, type c_asm lab3main lab3filt to produce a lab3main.out file to be loaded onto the DSP. Load the output file onto the DSP as usual and check that isthe FIR filter you designed.
## Cascade of fir1 and fir2
Modify the lab3filt.asm assembly module to implement a cascade of filters FIR1 and FIR2. Note thatboth _filter and _init_filter will need to be modified. Compile and link the new assemblymodule and confirm it has the frequency response which you expect from cascading FIR1 and FIR2.
## Complete multirate system
Once you have the cascaded system working, implement the multirate system composed of the three FIR filters bymodifying the assembly modules in lab3filt.asm . In order to implement the sample rate converters, you willneed to use a counter or a loop. The upsampling block and downsampling block are not implemented as seperatesections of code. Your counter or loop will determine when the decimated rate processing is to occur aswell as when to insert zeros into FIR3 to implement the zero-filling up-sampler.
Some instructions that may be useful for implementing your multirate structure are the addm (add to memory) and bc (branch conditional) instructions. You may also find the banz (branch on auxiliary register not zero) instruction useful, depending on how you implement your code. As the counter is state information that needs to be preservedbetween calls to filter , the counter must be saved in memory.
In order to experiment with multirate effects in yoursystem, make the downsampling factor ( $D=U$ ) a constant which can be changed easily in your code. Is there a critical( $D=U$ ) associated with this system above which aliasing occurs?
It will be useful both for debugging and for experimentation to show the output of your system at various points in theblock diagram. By modifying the C code in lab3main.c and the assembly modules in lab3filt.asm , send the following sequences to the DSP output
• output of FIR1
• input to FIR2 (after downsampling)
• input to FIR3 (after upsampling)
You will have to pass these samples to the main C program by storing them in memory locations as described in . Note that the input to FIR2 is at the downsampled rate.
For the quiz, you should be prepared to change the decimation rate upon request, and explain the effects ofchanging the decimation rate on the system's output.
• 1 point: Prelab
• 4 points: Code (Code which is complete and working at the beginning of the lab period gets fullcredit.)
• 5 points: Oral Quiz
The oral quiz may cover various problems in multirate sampling theory, as well as the operation of your codeitself and details about the instructions you've used in your code. Be prepared to explain, in detail, the operationof all of your code, even if your lab partner wrote it! You may also be asked to make changes to your code and topredict, and explain, the effects of these changes.
## Extra credit: 1 point
One of the main benefits of multirate systems is efficiency. Because of downsampling, the output of FIR1 is used only oneof $D$ times. Make your assembly module more efficient by using this fact.
Similarly, at the input of FIR3, $D-1$ of every $D$ samples is zero. So, for a fixed downsampling factor $D$ , it is possible to make use of this fact to create $D$ different filters (each a subset of the coefficients of FIR3) to be used at the $D$ time instances. This technique is referred to as polyphase filtering and can be found in most modern DSPtextbooks. These filters are more efficient as the sum of the lengths of the filters is equal to the length of FIR3.Apply this fact for $D=4$ .
how do they get the third part x = (32)5/4
can someone help me with some logarithmic and exponential equations.
20/(×-6^2)
Salomon
okay, so you have 6 raised to the power of 2. what is that part of your answer
I don't understand what the A with approx sign and the boxed x mean
it think it's written 20/(X-6)^2 so it's 20 divided by X-6 squared
Salomon
I'm not sure why it wrote it the other way
Salomon
I got X =-6
Salomon
ok. so take the square root of both sides, now you have plus or minus the square root of 20= x-6
oops. ignore that.
so you not have an equal sign anywhere in the original equation?
Commplementary angles
hello
Sherica
im all ears I need to learn
Sherica
right! what he said ⤴⤴⤴
Tamia
hii
Uday
what is a good calculator for all algebra; would a Casio fx 260 work with all algebra equations? please name the cheapest, thanks.
a perfect square v²+2v+_
kkk nice
algebra 2 Inequalities:If equation 2 = 0 it is an open set?
or infinite solutions?
Kim
The answer is neither. The function, 2 = 0 cannot exist. Hence, the function is undefined.
Al
y=10×
if |A| not equal to 0 and order of A is n prove that adj (adj A = |A|
rolling four fair dice and getting an even number an all four dice
Kristine 2*2*2=8
Differences Between Laspeyres and Paasche Indices
No. 7x -4y is simplified from 4x + (3y + 3x) -7y
is it 3×y ?
J, combine like terms 7x-4y
how do you translate this in Algebraic Expressions
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
what's the easiest and fastest way to the synthesize AgNP?
China
Cied
types of nano material
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials and their applications of sensors.
what is nano technology
what is system testing?
preparation of nanomaterial
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
what is system testing
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
Hello
Uday
I'm interested in Nanotube
Uday
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
Prasenjit
can nanotechnology change the direction of the face of the world
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers! | 2018-06-25 08:06:41 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 9, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3948743939399719, "perplexity": 2063.627184031622}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-26/segments/1529267867579.80/warc/CC-MAIN-20180625072642-20180625092642-00448.warc.gz"} |
http://iim-cat-questions-answers.2iim.com/LR_other/other1_5.shtml | # LR Misc: Imperialists
You are here: Home CAT Questionbank LR Misc Puzzles Imperialists Q.5
## LR Misc. Puzzle: Imperialist Gold Diggers
A group of six imperialists Alpha, Omega, Beta, Theta, Phi and Delta carve out a circle in Antartica and break it up into six sectors. There are 48 Gold mines spread across this circle that covers an area of 3600 sq kms.
Beta and Phi got the same area, while Theta and Delta got the same area. Area of Beta, Delta and Omega form an Arithmetic Progression with Delta being the middle term. Areas of Omega, Beta and Alpha form a Geometrics Progression with Beta being the middle term. The number of goldmines of Delta, Omega, Beta, Alpha and Theta form an Arithmetic Progression in that order. As many Countries have got more goldmines than Phi as have got fewer goldmines than Phi.
One has to cross at least two other Countries to go from Alpha to Delta; there is only one Country to cross between Phi and Omega; and Alpha and Beta are neighboring Countries. The Country that has got the maximum number of goldmines has an area of 450 sq kms, the Country that has got the maximum area has got 6 gold mines. Omega has lesser area than his neighbor Beta and Phi has got more goldmines than his neighbor Theta.
How many more sq kms has Alpha got than has Beta?
600 Sq. Km.
## Detailed Solution
General Solution
As ever, let us make some sense of the constraints and then draw a table or graph.
Areas - Beta = Phi = X, Theta = Delta = Y.
Area of Beta, Delta and Omega form an Arithmetic Progression with Delta being the middle term.
X, Y and Omega form an AP. Or, Omega = 2Y – X
Areas of Omega, Beta and Alpha form a Geometrics Progression with Beta being the middle term. Or, 2Y – X, X and Alpha form a GP.
Alpha = ${\frac{ X^{2} }{2Y - X} }$
Now, let us move to the goldmines:
As many Countries have got more goldmines than Phi as have got fewer goldmines than Phi. There are totally 6 Countries, so Phi cannot be the lone middle term. So, Phi has to be joint third. So, we should have number of goldmines as P < Q < R = R < S < T.
Now, we know that the number of goldmines of Delta, Omega, Beta, Alpha and Theta form an Arithmetic Progression in that order. So, the number of goldmines of Beta and Phi should be same, say R. Then we have R – 2d, R- d, R, R, R + d, R + 2d. The sum of all these is 6R. Or, R = 8.
So, Phi and Beta have 8 goldmines each.
Now, let us create a table and work from there
Omega has lesser area than his neighbor Beta . Or, 2Y – X < X. Or, Y < X.
and Phi has got more goldmines than his neighbor Theta. Or, d < 0.
8 + d and 8 + 2d should be less than 8, whereas 8 – d and 8 – 2d should be higher than 8. The Country that has got the maximum number of goldmines has an area of 450 sq kms. Or, Delta has an aread of 450 sq kms. Y = 450 sq kms.
The Country that has got the maximum area has got 6 gold mines. Alpha or Theta should have 6 gold mines.
Now, we know Y < X. So, Theta does not have the maximum area. So, alpha should have the maximum area. SO, 8 + d = 6. Or, d = -2. We have cracked the goldmine part completely. Let us include this in our table.
Total area is 3600 sq kms. Or, ${\frac{ X^{2} }{900 - X} + X + 900 +X + 450+X + 450 = 3600.}$
Or ${\frac{ X^{2} }{900 - X} + X = 1800}$
${ X^{2}+900X -X^{2} =1800(900-X) }$
Solving, we get X = 600, so 900 - X = 300.
The table now looks like:
Now, let us move on to the positions on the grid. One has to cross at least two other Countries to go from Alpha to Delta – Alpha and Delta are diametrically opposite to each other ( athough the sectors might have different areas) Alpha and Beta are neighboring Countries. Omega has lesser area than his neighbor Beta. Or, Beta sits between Alpha and Omega. So, we have Alpha, Beta, Omega in a sequence.
Alpha and Delta are diametrically across. So, we should have Alpha, Beta, Omega and Delta in a sequence.
There is only one Country to cross between Phi and Omega. One Country removed from Omega in one direction is Alpha. In the other direction it should be Phi. So, we should have Alpha, beta, Omega, Delta, Phi in a sequence.
Phi has got more goldmines than his neighbor Theta.
Or, the sequence is Alpha, Beta, Omega, Delta, Phi, Theta.
Solution to Question 5
## Our Online Course, Now on Google Playstore!
### Fully Functional Course on Mobile
All features of the online course, including the classes, discussion board, quizes and more, on a mobile platform.
### Cache Content for Offline Viewing
Download videos onto your mobile so you can learn on the fly, even when the network gets choppy! | 2018-03-17 18:21:23 | {"extraction_info": {"found_math": true, "script_math_tex": 4, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5677822232246399, "perplexity": 2366.2367141399154}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-13/segments/1521257645280.4/warc/CC-MAIN-20180317174935-20180317194935-00447.warc.gz"} |
https://eidecy.rest/article/9-5-how-genes-are-regulated | # 9.5: How genes are regulated (2023)
1. Last update
2. Save as PDF
• ID of the page
7026
For a cell to function properly, the necessary proteins must be synthesized at the right time. All organisms and cells control or regulate the transcription and translation of their DNA into proteins. The process of activating a gene to produce RNA and protein is called gene expression. Whether in a simple unicellular organism or a complex multicellular organism, each cell controls when and how its genes are expressed. For this to happen, there must be some mechanism that controls when a gene is expressed to make RNA and protein, how much protein is made, and when it's time to stop making that protein because it's no longer needed .
Cells in multicellular organisms are specialized; Cells in different tissues look very different and perform different functions. For example, a muscle cell is very different from a liver cell, which is very different from a skin cell. These differences are a consequence of the expression of different sets of genes in each of these cells. All cells have certain basic functions that they must perform themselves, such as B. the conversion of energy from sugar molecules into energy from ATP. Each cell also has many genes that are not expressed, and it expresses many that are not expressed by other cells in order for it to carry out its specialized functions. In addition, cells turn certain genes on or off at different times in response to changes in the environment or at different times during the organism's development. Even unicellular organisms, both eukaryotic and prokaryotic, turn genes on and off in response to the demands of their environment so they can respond to particular conditions.
Controlling gene expression is extremely complex. Malfunction of this process is harmful to the cell and can lead to the development of many diseases, including cancer.
(Video) OpenStax Concepts of Biology Ch 9.5 How Genes are Regulated
## Prokaryotic versus eukaryotic gene expression
To understand how gene expression is regulated, we must first understand how a gene becomes a functional protein in a cell. The process occurs in prokaryotic and eukaryotic cells, just in slightly different ways.
Because prokaryotic organisms lack a cell nucleus, transcription and translation processes occur almost simultaneously. When the protein is no longer needed, transcription stops. Consequently, the main way to control what type and how much protein is expressed in a prokaryotic cell is by regulating the transcription of DNA into RNA. All further steps take place automatically. When more protein is needed, more transcription takes place. Therefore, the control of gene expression in prokaryotic cells lies almost exclusively at the level of transcription.
The first example of such a control was discovered withE.coliin the 1950s and 1960s by French researchers and is calledtiredOperon. ÖtiredOperon is a stretch of DNA with three contiguous genes that encode proteins involved in the absorption and metabolism of lactose, a food sourceE.coli. When lactose is not present in the bacterial environment, thetiredGenes are transcribed in small amounts. When lactose is present, the genes are transcribed and the bacteria can use lactose as a food source. The operon also contains a promoter sequence to which RNA polymerase binds to initiate transcription; Between the promoter and the three genes is a region called the operator. In the absence of lactose, a protein known as a repressor binds to the operator and, except in rare cases, prevents RNA polymerase from binding to the promoter. Therefore, very little of the protein products of the three genes are produced. When lactose is present, an end product of lactose metabolism binds to the repressor protein and prevents it from binding to the operator. This allows RNA polymerase to bind to the promoter and freely transcribe the three genes, allowing the organism to metabolize lactose.
(Video) Ch 9.5 - Mutations and Gene Expression
In contrast, eukaryotic cells have intracellular organelles and are much more complex. Remember that in eukaryotic cells, DNA is contained in the cell nucleus, where it is transcribed into mRNA. The newly synthesized mRNA is then transported from the nucleus to the cytoplasm, where ribosomes translate the mRNA into protein. The transcription and translation processes are physically separated by the nuclear membrane; Transcription occurs only within the nucleus and translation occurs only outside the nucleus in the cytoplasm. The regulation of gene expression can take place at all stages of the process (Figure $$\PageIndex{1}$$). Regulation can occur when DNA is unwound and released from nucleosomes to bind transcription factors (epigenetic level), when RNA is transcribed (transcriptional level), when RNA is processed after transcription and exported to the cytoplasm (transcriptional level). when RNA is translated into protein (translational level) or after protein production (post-translational level).
Differences in the regulation of gene expression between prokaryotes and eukaryotes are summarized in Table $$\PageIndex{1}$$.
Table $$\PageIndex{1}$$:Differences in the regulation of gene expression in prokaryotic and eukaryotic organisms
prokaryotic organisms eukaryotic organisms
core is missing contains core
RNA transcription and protein translation occur almost simultaneously
• RNA transcription occurs before protein translation and takes place in the nucleus. The translation of RNA into protein takes place in the cytoplasm.
• RNA post-processing includes the addition of a 5' cap, a poly-A tail, and intron excision and exon splicing.
Gene expression is mainly regulated at the transcriptional level Gene expression is regulated at many levels (epigenetic, transcriptional, post-transcriptional, translational and post-translational)
EVOLUTION IN ACTION: Alternative RNA splicing
(Video) Gene Linkage and Genetic Maps
Genes exhibiting alternative RNA splicing were first observed in the 1970s. Alternative RNA splicing is a mechanism that makes it possible to produce different protein products from a gene when different combinations of introns (and sometimes exons) are removed from the transcript (Figure $$\PageIndex{2}$$). This alternative splicing can be random, but mostly it is controlled and acts as a mechanism of gene regulation, whereby the frequency of different splicing alternatives is controlled by the cell to control the production of different protein products in different cells. or in different cells, different stages of development. Alternative splicing is now understood as a common mechanism of gene regulation in eukaryotes; By one estimate, 70% of genes in humans are expressed as multiple proteins through alternative splicing.
How might alternative splicing evolve? Introns have a beginning and ending recognition sequence, and it is easy to imagine that the splicing mechanism is unable to identify the end of one intron and find the end of the next intron, thereby removing two introns and the exon in between. Indeed, there are mechanisms to prevent such exon skipping, but mutations are likely to cause their failure. Such "mistakes" would likely result in a dysfunctional protein. In fact, the cause of many genetic diseases is alternative splicing rather than mutations in a sequence. However, alternative splicing would produce a protein variant without losing the original protein, opening up opportunities to adapt the new variant to new functions. Gene duplication has similarly played an important role in the evolution of new functions - by providing genes that can evolve without eliminating the original functional protein.
#### Summary
Although all somatic cells in an organism contain the same DNA, not all cells in that organism express the same proteins. Prokaryotic organisms express all of the DNA that encodes them in each cell, but not necessarily all at the same time. Proteins are only expressed when they are needed. Eukaryotic organisms express a subset of the DNA encoded in a given cell. In each cell type, the type and amount of protein is regulated by controlling gene expression. To express a protein, DNA is first transcribed into RNA, which is then translated into proteins. In prokaryotic cells, these processes occur almost simultaneously. In eukaryotic cells, transcription occurs in the nucleus and is separate from translation, which occurs in the cytoplasm. Gene expression in prokaryotes is only regulated at the transcriptional level, whereas in eukaryotic cells gene expression is regulated at the epigenetic, transcriptional, post-transcriptional, translational, and post-translational levels.
(Video) Post-Transcriptional modification mRNA | RNA Processing
### glossary
alternatives RNA-Spleißen
a mechanism of post-transcriptional gene regulation in eukaryotes in which multiple protein products are produced by a single gene through alternative splicing combinations of the RNA transcript
epigenetic
Description of non-genetic regulatory factors such as B. Changes in histone and DNA protein modifications that control access to genes on chromosomes
genetic expression
Processes that control whether a gene is expressed
posttranskriptional
Control of gene expression after the RNA molecule has been created but before it is translated into protein
posttranslational
Control of gene expression after formation of a protein
## Videos
1. Introduction to the Central Dogma of Genetics – 9.5 – Biol 189
(Nathan Silva)
2. The Central Dogma: DNA to proteins (an animated lecture video)
(thebiologyprimer)
3. Transcription and mRNA processing | Biomolecules | MCAT | Khan Academy
4. Biology Chapter 17 - Gene Expression
(Professor S)
5. Genetic Pleiotropy
(Medical Minutes)
6. Stephen P. Bell (MIT / HHMI) 1a: Chromosomal DNA Replication: The DNA Replication Fork
(iBiology)
Top Articles
Latest Posts
Article information
Author: Tyson Zemlak
Last Updated: 03/13/2023
Views: 5973
Rating: 4.2 / 5 (63 voted)
Author information
Name: Tyson Zemlak
Birthday: 1992-03-17
Address: Apt. 662 96191 Quigley Dam, Kubview, MA 42013
Phone: +441678032891
Job: Community-Services Orchestrator
Hobby: Coffee roasting, Calligraphy, Metalworking, Fashion, Vehicle restoration, Shopping, Photography
Introduction: My name is Tyson Zemlak, I am a excited, light, sparkling, super, open, fair, magnificent person who loves writing and wants to share my knowledge and understanding with you. | 2023-03-29 12:51:05 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.24826182425022125, "perplexity": 3507.4478486730495}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296948976.45/warc/CC-MAIN-20230329120545-20230329150545-00667.warc.gz"} |
https://shitohichiumaya.blogspot.com/2012/12/authors-in-markov-matrix-which-author_25.html | ## How to compute the eigenvectrors?
Here I don't explain the details of algorithm to compute the eigenvectors and eigenvalues. Since there are some free software available to compute them. I use octave's function eig() in this article.
Let's compute the eigenvectors and eigenvalues of the matrix $$M$$.
octave:34> [L V] = eig(M)
L =
0.83205 -0.70711
0.55470 0.70711
V =
Diagonal Matrix
1.00000 0
0 0.50000
By the way, I told you eigenvalue seems equivalent to the matrix. Yes, this is correct, however, one number can not exactly represent a matrix. If it is possible, why we need a matrix at all? A usual matrix has multiple eigenvalues and eigenvectors. But the number of elements of a matrix is $$n^2$$ and its eigenvalues is $$n$$. So, eigenvalues are still simpler.
The eigenvalues of matrix $$M$$ are 1 and 0.5, corresponding eigenvectors are (0.83205, 0.55470) and (-0.70711, 0.70711). Here we ignore the eigenvalue 0.5 since eigenvector of eigenvalue 0.5 doesn't tell the convergence value. The eigenvector of eigenvalue 1 tells us how the Markov matrix converges. If you are curious, please look up the matrix diagonalization''. We can compute when the total number of inhabitants is 1000 case.
octave:38> x1 = L(:,1)/ sum(L(:,1))
0.60000
0.40000
octave:39> x1 * 1000
600
400
This is exactly the same result we have already seen. The difference between this and former method is this doesn't need to apply $$M$$ many times. We even don't know how many times we need to apply the matrix, but this eigenanalysis directly gives us the answer. Also, this example employed a small size of matrix and that didn't make any difference especially we used a computer instead of computing by hand. However, these two methods are totally different efficiency if you have a large size matrix.
In the next section, we will see how to generate the Markov matrix from the adjacency matrix. We could compute the station staying probability, which station will we most probably end up with, by this Markov matrix as in the station example. It sounds a bit odd, but, this is exactly the same to authors' network analysis. We will see how in the next artices. The part 1 of this article (theory) came close to the finale. | 2019-01-23 15:40:38 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8874720335006714, "perplexity": 479.8020293299188}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-04/segments/1547584334618.80/warc/CC-MAIN-20190123151455-20190123173455-00243.warc.gz"} |
https://www.shaalaa.com/question-bank-solutions/the-rate-growth-bacteria-proportional-number-present-if-initially-there-were-1000-bacteria-number-doubles-one-hour-find-number-bacteria-after-2-hours-rate-change-bodies-or-quantities_11362 | HSC Arts 12th Board ExamMaharashtra State Board
Share
# The rate of growth of bacteria is proportional to the number present. If, initially, there were 1000 bacteria and the number doubles in one hour, find the number of bacteria after 2½ hours. - HSC Arts 12th Board Exam - Mathematics and Statistics
ConceptRate of Change of Bodies Or Quantities
#### Question
The rate of growth of bacteria is proportional to the number present. If, initially, there were
1000 bacteria and the number doubles in one hour, find the number of bacteria after 2½
hours.
[Take sqrt2 = 1.414]
#### Solution
Let ‘N’ be the number of bacteria at time’t ’
therefore "dN"/dt ooN
"dN"/dt=kN
"dN"/N=kdt
Integrating on both sides, we get
int"dN"/N=kintdt
logN=kt+c
when t=0,N=1000
c=log1000
logN=kt+log1000
log(N/1000)=kt
N=1000e^(kt) ..........(1)
when t = 1 hour, N = 2000
e^k=2
N=1000xx(2)^t ....................from (1)
when t=2 1/2 hours, we get
N=1000xx(2)^(5/2)
=1000xx4xxsqrt2=4000xx1.414
N=5656
Number of bacteria present after 2 1/2 hours is 5656
Is there an error in this question or solution?
#### APPEARS IN
2016-2017 (July) (with solutions)
Question 5.2.2 | 4.00 marks
#### Video TutorialsVIEW ALL [1]
Solution The rate of growth of bacteria is proportional to the number present. If, initially, there were 1000 bacteria and the number doubles in one hour, find the number of bacteria after 2½ hours. Concept: Rate of Change of Bodies Or Quantities.
S | 2019-12-15 20:31:13 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6303754448890686, "perplexity": 3922.1832654037626}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-51/segments/1575541310866.82/warc/CC-MAIN-20191215201305-20191215225305-00334.warc.gz"} |
https://quantumcomputing.stackexchange.com/questions/13616/alternative-grovers-diffuse-operator | # Alternative Grover's Diffuse Operator [duplicate]
I was wondering if there is any good references where I could read to understand the construction of Unitary Operators such as the Diffuse Operator in Grover's Algorithm.
I am looking to build my own set of unitary operators with the objective of boosting the amplitude of specific quantum states for which there is no access to oracles to perform the phase flip prior to the inversion about the mean. | 2021-12-01 15:44:24 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.836154580116272, "perplexity": 256.4288526903673}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964360803.6/warc/CC-MAIN-20211201143545-20211201173545-00310.warc.gz"} |
http://mathhelpforum.com/calculus/22325-cont-func-cauchy-seq.html | # Thread: Cont. Func + Cauchy Seq
1. ## Cont. Func + Cauchy Seq
Give an example of the case or explain why it's not possible for each of the following:
1.) Continuous function $f : (0,1) \rightarrow \mathbb{R}$ and also a Cauchy sequence $(x_n)$ such that $f(x_n)$ is not a Cauchy sequence.
2.) Continuous function $f : [0,1] \rightarrow \mathbb{R}$ and also a Cauchy sequence $(x_n)$ such that $f(x_n)$ is not a Cauchy sequence.
3.) Continuous function $f : [0,\infty) \rightarrow \mathbb{R}$ and also a Cauchy sequence $(x_n)$ such that $f(x_n)$ is not a Cauchy sequence.
4.) Continuous function $f$ that's bounded on $(0,1)$ and that has a maximum value on the open interval, however, does not have a minimum value.
2. Originally Posted by fifthrapiers
Give an example of the case or explain why it's not possible for each of the following:
Good exam problems.
1.) Continuous function $f : (0,1) \rightarrow \mathbb{R}$ and also a Cauchy sequence $(x_n)$ such that $f(x_n)$ is not a Cauchy sequence.
Consider $f(x) = \frac{1}{x}$ and $x_n = \frac{1}{n}$.
2.) Continuous function $f : [0,1] \rightarrow \mathbb{R}$ and also a Cauchy sequence $(x_n)$ such that $f(x_n)$ is not a Cauchy sequence.
Impossible because continous functions on closed finite intervals are uniformly continous. But the property of uniformly continous functions is that their images of Cauchy sequences still remain Cauchy sequences.
3.) Continuous function $f : [0,\infty) \rightarrow \mathbb{R}$ and also a Cauchy sequence $(x_n)$ such that $f(x_n)$ is not a Cauchy sequence.
Impossible. Let $x_n$ be Cauchy sequence in $[0,\infty)$. Since it is Cauchy it is bounded. So the entire sequence is contained in $[0,M]$ where $M>0$ is its upper bound. But since $f(x)$ is uniformly continous on $[0,M]$ it means (as in 2) that $f(x_n)$ is Cauchy.
4.) Continuous function $f$ that's bounded on $(0,1)$ and that has a maximum value on the open interval, however, does not have a minimum value.
Draw a picture. Consider $f(x) = 1-|x|$ on $(-1,1)$. | 2017-03-26 03:34:10 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 33, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.911221444606781, "perplexity": 163.09316955701976}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-13/segments/1490218189092.35/warc/CC-MAIN-20170322212949-00058-ip-10-233-31-227.ec2.internal.warc.gz"} |
http://mathhelpforum.com/differential-geometry/110066-closed-set-print.html | # Closed set
• Oct 24th 2009, 02:18 AM
Closed set
Can a subset in Rk be not open and not closed???
My book gives an example of 1/n as n=1,2,3..... Why is it not open and not closed? Could someone explain?
• Oct 24th 2009, 03:43 AM
tonio
Quote:
If by "Rk" you mean $\mathbb{R}$ , then $\left\{\frac{1}{n}\right\}_n^\infty$ is not open because it is not true that for every point in it there exists an open interval containing the point which is completely contained in the set, and it is not closed because it doesn't contain all its accumulation points (the point zero=0), or also: it is not closed because its complement is not open (for the point x = 0 in the complement there doesn't exist an interval containing it and which is contained in the complement).
Something like $\{(x,y)| 0\le x\le 3, 0< y< 5$ in $R^2$ is neither open nor closed. | 2018-01-20 19:06:50 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 4, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6428418755531311, "perplexity": 250.84028054756638}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-05/segments/1516084889681.68/warc/CC-MAIN-20180120182041-20180120202041-00171.warc.gz"} |
https://math.stackexchange.com/questions/3158825/prove-linear-maps-between-vectors-spaces-form-a-vector-space | # Prove: Linear maps between vectors spaces form a vector space
In order to understand the resultant vector spaces better, could someone provide a proof of the following statement for finite vector spaces:
“Linear maps between vector spaces form a vector space.”
I have no problems for everyday vectors (points in space, ordered n-tuples, etc) and for standard vector addition. However, the definitions clearly go way beyond the every day to operations that are not normal addition, and to objects much more abstract than everyday vectors.
• This may help? – Theo Bendit Mar 23 '19 at 0:39
• Honestly, the proof of this was never helpful while I was learning, because it's pretty much definition crunching. – Don Thousand Mar 23 '19 at 0:41
• It's really best if you work this through yourself. There's nothing to it but checking the axioms. Is there a $0$? Sure, the map that takes everything to $0$. Is a constant times a linear operator linear? Sure. Is the sum of linear operators linear? Sure. Just go step by step. – lulu Mar 23 '19 at 0:46
• @Theo, yes that’s getting at at least one of my sources of confusion, namely the potentially very different definitions of “+” in the two vector spaces. Will read carefully and perhaps return with questions... – PossumP Mar 23 '19 at 14:54 | 2021-01-16 16:09:33 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8097950220108032, "perplexity": 868.4536047535079}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703506697.14/warc/CC-MAIN-20210116135004-20210116165004-00656.warc.gz"} |