url stringlengths 6 1.61k | fetch_time int64 1,368,856,904B 1,726,893,854B | content_mime_type stringclasses 3 values | warc_filename stringlengths 108 138 | warc_record_offset int32 9.6k 1.74B | warc_record_length int32 664 793k | text stringlengths 45 1.04M | token_count int32 22 711k | char_count int32 45 1.04M | metadata stringlengths 439 443 | score float64 2.52 5.09 | int_score int64 3 5 | crawl stringclasses 93 values | snapshot_type stringclasses 2 values | language stringclasses 1 value | language_score float64 0.06 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://www.philosophy-science-humanities-controversies.com/listview-details.php?id=434158&a=t&first_name=%20G.W.&author=Leibniz&concept=Decidability | 1,597,296,038,000,000,000 | text/html | crawl-data/CC-MAIN-2020-34/segments/1596439738960.69/warc/CC-MAIN-20200813043927-20200813073927-00441.warc.gz | 805,270,399 | 4,698 | # Philosophy Dictionary of Arguments
Home
Decidability: a question, for example, whether a property applies to an object or not, is decidable if a result can be achieved within a finite time. For this decision process, an algorithm is chosen as a basis. See also halting problem, algorithms, procedures, decision theory.
_____________
Annotation: The above characterizations of concepts are neither definitions nor exhausting presentations of problems related to them. Instead, they are intended to give a short introduction to the contributions below. – Lexicon of Arguments.
Author Item Summary Meta data
Berka I 329
Decision problem/Logic/Berka: appeared historically for the first time in Leibniz with the idea of a purely arithmetical "ars iudicandi".
Behmann: (1922)(1): "The main problem of modern logic".
Ackermann: (1954)(2):
I. It is to be decided with exactly stated means, whether a relevant formula of a (logical) calculus is valid.
II. If it is not universal, it is to be decided whether it is valid in none of the areas or whether it is valid in an area. If it is valid in any area, one must determine which cardinal number this area has.
III. It is to be decided whether a relevant formula is valid in all areas with a finite number of elements or not."
Berka: this is a basically semantic formulation of the E problem.
E Problem/syntactical: it is to be decided with the help of exactly defined processes that have to fulfill certain conditions whether a relevant formula of a calculus is provable or refutable.
Statement Calculus/E-Problem: by Lukasiewicz (1921)(3), Post (1921)(4), Wittgenstein (1921)(5) positively solved.
1. H. Behmann, Beiträge zur Algebra der Logik, insbesondere zum Entscheidungsproblem, Math. Ann. 86 (1922), 163-229
2. R. Ackermann, Solvable Classes of the Decision Problem, Amsterdam (3. ed.) 1968
3. J. Lukasiewicz, Logica dwuwartosciowa, PF 23 (1921), 189-205
4. E. L. Post, Introduction to a general theory of elemantary propositions, American Journal of Mathematics 43 (1921) , 163-185
5. L. Wittgenstein, Logisch-Philosophische Abhandlung, Ann. Naturphil. 14 (1921), 185-262
_____________
Explanation of symbols: Roman numerals indicate the source, arabic numerals indicate the page number. The corresponding books are indicated on the right hand side. ((s)…): Comment by the sender of the contribution.
The note [Author1]Vs[Author2] or [Author]Vs[term] is an addition from the Dictionary of Arguments. If a German edition is specified, the page numbers refer to this edition.
Lei II
G. W. Leibniz
Philosophical Texts (Oxford Philosophical Texts) Oxford 1998
Berka I
Karel Berka
Lothar Kreiser
Logik Texte Berlin 1983
> Counter arguments against Leibniz
Ed. Martin Schulz, access date 2020-08-13 | 705 | 2,754 | {"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} | 2.8125 | 3 | CC-MAIN-2020-34 | latest | en | 0.792341 |
https://www.weegy.com/?ConversationId=Z11X3CJH&Link=i&ModeType=2 | 1,603,829,981,000,000,000 | text/html | crawl-data/CC-MAIN-2020-45/segments/1603107894759.37/warc/CC-MAIN-20201027195832-20201027225832-00482.warc.gz | 886,830,884 | 11,075 | 11-223=
11 - 223 = -212
Question
Asked 4/3/2014 2:23:25 PM
Updated 4/3/2014 2:55:33 PM
This answer has been confirmed as correct and helpful.
g
Rating
There are no new answers.
There are no comments.
Questions asked by the same visitor
80 x 50 =
Question
Updated 4/3/2014 2:42:19 PM
80 x 50 = 4000
Added 4/3/2014 2:42:19 PM
This answer has been confirmed as correct and helpful.
Confirmed by yumdrea [4/3/2014 2:45:35 PM]
32,536,459
Popular Conversations
An ocean wave is an example of a(n) _____ wave form.
Weegy: An ocean waves are examples of surface wave. User: primary wave Weegy: In physics, a wave is disturbance or ...
10/26/2020 2:20:04 PM| 5 Answers
What is wailing?
10/27/2020 3:43:18 AM| 4 Answers
Write the following equation in the general form Ax + By + C = 0. 2x ...
Weegy: 2x + y = 6 in general form is 2x + y - 6 = 0 User: Write the following equation in the general form Ax + By + ...
10/19/2020 9:42:21 PM| 4 Answers
An athlete's arousel level refers to
10/18/2020 2:09:45 AM| 4 Answers
There are twelve months in year.
Weegy: 12+12 = 24 User: Approximately how many hours does she play soccer in a year?
10/26/2020 3:19:01 PM| 3 Answers
Amendment two
Weegy: An amendment is a formal or official change made to a law, contract, constitution, or other legal document. ...
10/21/2020 3:13:51 PM| 3 Answers
*
Get answers from Weegy and a team of really smart live experts.
S
L
L
Points 1970 [Total 6704] Ratings 0 Comments 1960 Invitations 1 Offline
S
L
L
1
Points 1722 [Total 8484] Ratings 13 Comments 1592 Invitations 0 Offline
S
L
P
R
P
R
L
P
P
C
R
P
R
L
P
R
P
R
P
R
Points 1228 [Total 16902] Ratings 4 Comments 1008 Invitations 18 Offline
S
L
R
Points 1165 [Total 1499] Ratings 0 Comments 1165 Invitations 0 Offline
S
L
Points 895 [Total 1063] Ratings 1 Comments 885 Invitations 0 Offline
S
L
P
P
P
1
P
L
1
Points 442 [Total 8593] Ratings 6 Comments 382 Invitations 0 Offline
S
L
P
1
L
Points 373 [Total 5909] Ratings 4 Comments 333 Invitations 0 Offline
S
L
Points 350 [Total 381] Ratings 0 Comments 350 Invitations 0 Offline
S
L
Points 203 [Total 203] Ratings 0 Comments 203 Invitations 0 Offline
S
L
Points 184 [Total 3011] Ratings 5 Comments 134 Invitations 0 Offline
* Excludes moderators and previous
winners (Include)
Home | Contact | Blog | About | Terms | Privacy | © Purple Inc. | 823 | 2,312 | {"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} | 2.625 | 3 | CC-MAIN-2020-45 | latest | en | 0.876167 |
http://www.jiskha.com/display.cgi?id=1262913317 | 1,498,196,554,000,000,000 | text/html | crawl-data/CC-MAIN-2017-26/segments/1498128320003.94/warc/CC-MAIN-20170623045423-20170623065423-00387.warc.gz | 564,289,663 | 4,134 | # algebra II
posted by on .
5 3
4 . 4
_______
6
4
I really need help with this math..I don't understand it and all I have is a worksheet with no examples...I am a 10th grader...any help would be appreciated.
Jeremy
• I do not know what you mean - ,
Are you doing something with matrices? Please say what that is besides some random numbers.
• algebra II - ,
4 to the fifth power times 4 to the third power divided by 4 to the sixth power
• algebra II - ,
Please use the ^ symbol to indicate exponents.
(4^5 * 4^3) /4^6 = 4^(5+3-6) = 4^2 = 16
• algebra II - , | 172 | 569 | {"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} | 3.328125 | 3 | CC-MAIN-2017-26 | latest | en | 0.936663 |
https://www.spreadsheetweb.com/category/resources/excel-tips-and-tricks/page/24/ | 1,568,613,880,000,000,000 | text/html | crawl-data/CC-MAIN-2019-39/segments/1568514572491.38/warc/CC-MAIN-20190916060046-20190916082046-00437.warc.gz | 1,024,088,825 | 11,586 | Select Page
## How to find the root of a number
Algebraically, the nth root of a number can be calculated by using 1/n for its power. You can always use caret symbol (^) to find a certain power of a number, but doing this with a formula can be easier to read and identify in nested formula sets. Syntax =POWER(base...
## How to find the power of a number
You can always use caret symbol (^) to find a certain power of a number. However, doing this with a formula can be easier to read and identify in nested formula sets. Syntax =POWER(base number, how many times that base number will be multiplied by itself) Steps Begin...
## How to find the unique items in a list
Dissecting and organizing data doesn’t have to be challenging. You can quickly filter your data items with this method using a combination of formulas to determine which are unique items. Syntax =LOOKUP(2, 1/(COUNTIF(expanding unique list, original list)=0),...
## How to get the column index of a cell using the COLUMN function
Working with Excel’s coordinate system makes building data models extremely easy. You can retrieve the column index information of a cell using the COLUMN function and implement in other formulas. Syntax =COLUMN(cell or range reference you want get its column...
## How to get the row index of a cell using the ROW function
Working with Excel’s coordinate system makes building data models extremely easy. You can retrieve the row index information of a cell using the ROW function and implement in other formulas. Syntax =ROW(cell or range reference you want get its row number) Steps...
## How to get the first name text from the full name data
One perfect example of automatically cleaning up data in Excel is when working with name fields. You can separate first and last names (or actually any text with spaces) using this method. Syntax =LEFT(Full name, FIND(” “, Full name) – 1) Steps Begin by...
## How to calculate payments for a loan
In need of quick money? Well, we can’t tell you how to get that, but we can show you how to use Excel to find out what you’re getting into. Use this easy method to calculate what you would be paying for that shiny new loan. Syntax =PMT(interest rate for...
## How to get the worksheet name, workbook name, and its path
Working across several workbooks with multiple sheets can be tedious. Furthermore, file names are dynamic and can be changed by your users. Use this simple trick to organize your data and label workbook details. Syntax =CELL(“filename”, reference which is...
## How to count the number of characters inside a cell
You can easily count the number of characters inside a cell using the LEN function. This function can be especially useful when identifying data types or creating validation rules. Syntax =LEN(text) Steps Begin by typing in =LEN( Select or type in the range reference... | 611 | 2,862 | {"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} | 3.65625 | 4 | CC-MAIN-2019-39 | longest | en | 0.866687 |
http://www.ck12.org/algebra/Systems-Using-Substitution/ | 1,448,933,513,000,000,000 | text/html | crawl-data/CC-MAIN-2015-48/segments/1448398464386.98/warc/CC-MAIN-20151124205424-00222-ip-10-71-132-137.ec2.internal.warc.gz | 349,077,644 | 19,320 | <img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />
# Systems Using Substitution
## Solve for one variable, substitute the value in the other equation
Levels are CK-12's student achievement levels.
Basic Students matched to this level have a partial mastery of prerequisite knowledge and skills fundamental for proficient work.
At Grade (Proficient) Students matched to this level have demonstrated competency over challenging subject matter, including subject matter knowledge, application of such knowledge to real-world situations, and analytical skills appropriate to subject matter.
Advanced Students matched to this level are ready for material that requires superior performance and mastery.
## Systems Using Substitution
Isolate and substitute for one variable to solve systems of equations in two variables.
2
## Solving Systems with One Solution Using Substitution
This lesson covers solving a system of linear equations using substitution.
1
## Solving Linear Systems by Substitution
Learn to solve a system of equations by substitution.
0
• PLIX
## Systems Using Substitution: Visualizing Systems of Equations
Systems Using Substitution Interactive
0
• PLIX
## Systems Using Substitution: Circles and Arrows
Systems Using Substitution Interactive
0
• PLIX
## Systems Using Substitution: Circles and Arrows 2
Systems Using Substitution Interactive
0
• PLIX
## Systems Using Substitution: Circles and Arrows 4
Systems Using Substitution Interactive
0
• PLIX
## Systems Using Substitution: Circle Sums 6
Systems Using Substitution Interactive
0
• PLIX
## Systems Using Substitution: Circle Sums 5
Systems Using Substitution Interactive
0
• PLIX
## Systems Using Substitution: Circles and Arrows 3
Systems Using Substitution Interactive
0
• PLIX
## Systems Using Substitution: Hanging Scales 7
Systems Using Substitution Interactive
0
• PLIX
## Variable Equations: Mystery Numbers
Systems Using Substitution Interactive
0
• Video
## Solve a System of Equations Using Substitution
Solves equations by substitution.
0
• Video
## Linear Systems by Substitution: An Explanation of the Concept
This video provides an explanation of the concept of solving linear systems by substitution.
2
## Systems Using Substitution Quiz
Quiz for Solving Systems Using Substitution.
0
• Practice
0%
## Systems Using Substitution Practice
0
• Critical Thinking
## Systems Using Substitution Discussion Questions
A list of student-submitted discussion questions for Systems Using Substitution.
0
## Systems Using Substitution Pre and Post Read
To activate prior knowledge, to generate questions about a given topic, and to organize knowledge using a KWL Chart.
0
0
## Solving Linear Systems by Substitution
Summarize the main idea of a reading, create visual aids, and come up with new questions using a Four Square Concept Matrix.
0
## Systems Using Substitution KWL Chart
0
• Real World Application
## Finding the Cheapest Cell Phone Plan
All students will be able to research two different cell phone companies and determine which cell phone plan is the cheapest using systems of linear equations. Students will represent these relationships through equations, tables and graphs.
0
• Real World Application
## Taxation
Learn how to use a system of linear equations to calculate federal and state taxes.
1
• Real World Application
## The Bill of (Equal) Rights
Learn how to use a system of equations to determine which of two cell phone plans is a better deal.
0
• Study Guide
## Linear Systems: Solve by Graphing and Substitution Study Guide
This study guide looks at systems of linear equations and how to solve them by graphing and by substitution. It also looks at the types/number of solutions to systems of linear equations.
1 | 824 | 3,875 | {"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} | 3.8125 | 4 | CC-MAIN-2015-48 | longest | en | 0.687108 |
https://discourse.mcneel.com/t/perpendicular-from-curve-seems-inconsistent/40602 | 1,603,123,881,000,000,000 | text/html | crawl-data/CC-MAIN-2020-45/segments/1603107863364.0/warc/CC-MAIN-20201019145901-20201019175901-00552.warc.gz | 301,356,785 | 6,466 | # 'Perpendicular from curve' Seems Inconsistent
Hi, I was wondering if anyone could tell me why I am not able to get a perpendicular line to another line in the attached file using the ‘Perpendicular from curve’ command?
Sometimes it works, sometimes it doesn’t.
The line in this file was actually made using ‘perpendicular from curve’ on an actual curved line, but instead of giving a perpendicular line it would only give what appears to be a tangent line.
So I thought, ok I’ll just use that new line and from it’s end point use the same command, but doing so doesn’t give a perpendicular line - it comes close, but it looks more like about 85 deg.
So I’m thinking, ok, I’ll just use the draw a line option that let’s you specifiy an angle, so in my case I would go with 90 deg.
But I’m starting to think…if it’s not giving a true 90 deg perpendicular line, is the original line I made with that command really tanget? Does is just look that way? yet may also be off by a few degrees.
Suggestions on a better workflow/tool/command use that can give definite results is appreciated.
Thanks
Line Perpendicular to Curve.3dm (23.1 KB)
Hi BabaJ - I think you’ll find that the line is perpendicular, but it is one of an infinite number of possible perp lines that lie in the perpendicular plane at that location. When the line is skewed to the Cplane then there is no good way to know which perp line you’re after.
-Pascal
Hi, I’m not sure what your saying…except for the part that I do understand how a different plane could alter how it appears on another plane.
But in this case both my view and cplan are both co-planar…and so when I try to draw it perpendicular it doesn’t do so. If I use the angle measurement tool, it gives me something like 87 deg.
So if I am drawing on a construction plane that is also co-planar with my view, there is only two possibilities for perpendicularity, one at 90 deg. and the other at 270/-90.
Hi BabaJ - all of the blue lines are perp to the red one in the attached file.
Line Perpendicular to Curve_PG.3dm (61.1 KB)
-Pascal
Hi Pascal, yes I understand.
They are perpendicular, but on different planes.
I guess the question should be, is there not a command that can draw a line perpendicular to a point on a curve that is constrained to a specific cplane?
I stripped out alot of stuff in my original file I attached to keep things looking simple.
But the original curve and the resulting line were both created orthographicly on the same cplane.
But Rhino doesn’t seem to retain that information and is randomly choosing a plane of its’ own choice.
if there’s something else on the cplane (a point or curve for example), you can place your cursor on it during the line->perpendicular operation and rhino will draw the perpendicular line on the cplane… you can also use the tab key once you’ve registered to the cplane in order to lock it on the plane.
(not sure if this is the most understandable explanation… try it out… if you still can’t get it to work, reply back and i’ll try to say it more clearly)
Thanks again for your help Pascal…I will work with your idea and see.
Yes.
Turn off Grid snap, turn on Planar.
Use the Line-perpendicular from tool
you can also use the shift key to lock the perp line to a horizontal or vertical plane.
@BabaJ Turn on Planar. The use Line with the Perpendicular option to draw a line perpendicular to a curve in the view with the CPlane you want to be parallel to. With Planar on the end point of the line is constrained to be the same distance from the CPlane as the first end of the line.
Thanks guys for all your help…I think I found out why it’s not working.
The curve that I am attempting to draw perpendicular lines from isn’t exactly sitting on the cplane I’m working with.
The whole line seems to be about 0.005/6 mm off from it.( The colored red line).
This is what I believe is giving me unexpected results.
I tried drawing another line on the same Cplane and am not having trouble getting perpendicular lines. It’s working as expected with that one.( green colored line).
I suspect I know why my initial line ended up being off ever so slight from the plane, but that brings up another question that I think would be best for a new post, as it applies to other things as well.
Thanks again.
Perpendicular.3dm (28.2 KB) | 992 | 4,341 | {"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} | 2.609375 | 3 | CC-MAIN-2020-45 | latest | en | 0.93681 |
https://ergodicity.net/2010/06/20/isit-2010-error-analysis-and-asynchrony/?shared=email&msg=fail | 1,638,416,715,000,000,000 | text/html | crawl-data/CC-MAIN-2021-49/segments/1637964361064.69/warc/CC-MAIN-20211202024322-20211202054322-00221.warc.gz | 286,246,405 | 32,316 | # ISIT 2010 : error analysis and asynchrony
The remaining blogging from ISIT on my end will probably be delayed a bit longer since I have camera deadlines for EVT and ITW, a paper with Can Aysal for the special SP gossip issue that is within epsilon of getting done (and hence keeps getting put off) and a paper for Allerton with Michele Wigger and Young-Han Kim that needs some TLC. Phew! Maybe Alex will pick up the slack… (hint, hint)
Asynchronous Capacity per Unit Cost (Venkat Chandar, Aslan Tchamkerten, David Tse)
This paper was the lone non-adversarial coding paper in the session my paper was in. Aslan talked about a model for coding in which you have a large time block $[0,A]$ in which $B$ bits arrive at a random time at the encoder. The bits have to be transmitted to the receiver with delay less than $D$. The decoder hears noise when the encoder is silent, and furthermore doesn’t know when the encoder starts transmitting. They both know $A$, however. They do a capacity per-unit-cost analysis for this system and give capacity results in various cases, such as whether or not there is is a 0-cost symbol, whether or not the delay is subexponential in the number of bits to be sent, and so on.
Moderate Deviation Analysis of Channel Coding: Discrete Memoryless Case (Yucel Altug, Aaron Wagner)
This was a paper that looked at a kind of intermediate behavior in summing and normalizing random variables. If you sum up $n$ iid variables and normalize by $n$ you get a law of large numbers and large deviations analysis. If you normalized by $\sqrt{n}$ you get a central limit theorem (CLT). What if you normalize by $n^{2/3}$ for example? It turns out you get something like
$\mathbb{P}( \frac{1}{n^{\beta}} \sum_{i=1}^{n} X_i \ge \epsilon ) \le \exp( -n^{2 \beta - 1} I_{\mathcal{N}}(\epsilon) )$
where $I_{\mathcal{N}}(\epsilon)$ is the rate function for the Gaussian you get out of the CLT. This is useful for error exponent analysis because it lets you get a handle on how fast you can get the error to decay if your sequence of codes has rate tending to capacity. They use these techniques to show that for a sequence of codes with gaps $\epsilon_n$ to capacity the error decays like $\exp( - n \epsilon_n^2/(2 \sigma)$, where $\sigma$ is the dispersion of the channel.
Minimum energy to send k bits with and without feedback (Yury Polyanskiy, H. Vincent Poor, Sergio Verdu)
This was on the energy to send a bit but in the non-asymptotic energy regime (keeping philosophically with the earlier line of work by the authors) for the AWGN channel. Without feedback they show an achievability and converse for sending $M$ codewords with error $\epsilon$ and energy $E$. These give matching scalings up to the first three terms as $E \to \infty$. The first term is $(E/N_0) \log e$. Interestingly, with feedback, they show that the first term is $1/(1 - \epsilon)$ times the term without feedback, which makes sense since as the error goes to 0 the rates should coincide. They also have a surprising result showing that with energy $E > k N_0$ you can send $2^k$ messages with 0 error.
This site uses Akismet to reduce spam. Learn how your comment data is processed. | 795 | 3,186 | {"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": 21, "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} | 2.6875 | 3 | CC-MAIN-2021-49 | latest | en | 0.899186 |
https://www.dreamincode.net/forums/topic/24159-analysis-of-algorithms/ | 1,526,929,703,000,000,000 | text/html | crawl-data/CC-MAIN-2018-22/segments/1526794864466.23/warc/CC-MAIN-20180521181133-20180521201133-00417.warc.gz | 738,664,041 | 18,458 | # analysis of algorithms
Page 1 of 1
## 2 Replies - 1802 Views - Last Post: 25 February 2007 - 06:00 AM
### #1 mattman059
• Epic Awesomeness
Reputation: 15
• Posts: 538
• Joined: 23-October 06
# analysis of algorithms
Posted 19 February 2007 - 09:53 PM
having learned some about algorithm analysis in my discrete structres class..Ive been wondering how other functions are affected by big O...could you have a O (1/x^2) ?....or even better... O(1/n!)...the once infamous runtime that everyone avoided would soon become the one everyone sought to acheive (as if O(1) could get any better)
It caught my attention and I thought it deserved a post on this website..so my questions are:
Can you have O(1/ some complexity ex..n^2 b^n n^b etc...)
and if so, what kind of loop would this be, i know that doubling or halving would result in log n or n log n time but not sure about 1/ anything
Is This A Good Question/Topic? 0
## Replies To: analysis of algorithms
### #2 gregoryH
Reputation: 60
• Posts: 656
• Joined: 04-October 06
## Re: analysis of algorithms
Posted 20 February 2007 - 01:26 AM
mattman059, on 19 Feb, 2007 - 09:53 PM, said:
having learned some about algorithm analysis in my discrete structres class..Ive been wondering how other functions are affected by big O...could you have a O (1/x^2) ?....or even better... O(1/n!)...the once infamous runtime that everyone avoided would soon become the one everyone sought to acheive (as if O(1) could get any better)
It caught my attention and I thought it deserved a post on this website..so my questions are:
Can you have O(1/ some complexity ex..n^2 b^n n^b etc...)
and if so, what kind of loop would this be, i know that doubling or halving would result in log n or n log n time but not sure about 1/ anything
Hi
If you have a think about linear programming, any processing with an algorithm will never meet the criteria to meet 1/n or smaller Big O timings. The program must have an increasing function against time purely because of n and the iterations.
If you used a threaded solution, however, the potential for 1/2, 1/3 1/4(n) is there, related to the total processing power and how well the parallelism operates. Some older CPU (and OS's) may not be capable of delivering true multi-threaded capability.
You should also consider the effect of increasing the loading (n) in multithreaded programs. There is a point at which the machine will be running to many processes and simply bog down with context switching and memory swapping. Taking you from say O(1/4n) to O(n^2) very quickly (based on time to complete the processing).
Finally, there is a recommended limit of 16 independent threads in your process. While I have run 101 threads attached to a process, there was a clear level of latency (like 4 seconds) that was clearly visible in the logs after running. Also, my threads required a level of synchronisation because access to the logs was restricted to one thread at a time.
hope this helps.
### #3 NickDMax
Reputation: 2255
• Posts: 9,245
• Joined: 18-February 07
## Re: analysis of algorithms
Posted 25 February 2007 - 06:00 AM
Althogh my backgound is in mathematics and I should LOVE BIG-O I really don't. I think that is because the engineers love math where you can throw out unimportant numbers and I hate to throw out numbers. I don't know, it is a personal prejudice that I should really get over.
Anyway the concept of a O(1/n) essentialy means that the process gets FASTER the longer the input is. There are some algorithms that "seem" to offer such a feat, such as searching though a text document of size M. THe longer our seach string (length N) the faster a Boyer–Moore search will go. When this is brought up for the first time there is always at least one student who thinks that this will have a complexity like O(1/N). I was one of these lucky dunces.
I know that this is an O(n) algorithm, but I can't explain exactly why.
This is why I hate Big-O (though I did ace all of my tests on it in school, then promptly forgot all I knew about using recurrence relations to calculate Big-O) | 1,050 | 4,108 | {"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} | 2.96875 | 3 | CC-MAIN-2018-22 | latest | en | 0.937731 |
https://oneconvert.com/unit-converters/specific-heat-capacity-converter/kilojoule-kilogram-k-to-kilocalorie-it-kilogram-176-c | 1,713,424,452,000,000,000 | text/html | crawl-data/CC-MAIN-2024-18/segments/1712296817200.22/warc/CC-MAIN-20240418061950-20240418091950-00180.warc.gz | 394,816,593 | 24,698 | # Convert kilojoule/kilogram/K to kilocalorie (IT)/kilogram/°C
## How to Convert kilojoule/kilogram/K to kilocalorie (IT)/kilogram/°C
To convert kilojoule/kilogram/K to kilocalorie (IT)/kilogram/°C , the formula is used,
$1\mathrm{kj}/\mathrm{kg}/K=0.239006\mathrm{kcal}/\mathrm{kg}/\mathrm{°C}$
where the kilojoule/kilogram/K to kilocalorie (IT)/kilogram/°C value is substituted to get the answer from Specific Heat Capacity Converter.
1 kilojoule/kilogram/K
=
0.2388 kilocalorie (IT)/kilogram/°C
1 kilocalorie (IT)/kilogram/°C
=
4.1868 kilojoule/kilogram/K
Example: convert 15 kilojoule/kilogram/K to kilocalorie (IT)/kilogram/°C:
15 kilojoule/kilogram/K
=
15
x
0.2388 kilocalorie (IT)/kilogram/°C
=
3.5827 kilocalorie (IT)/kilogram/°C
## kilojoule/kilogram/K to kilocalorie (IT)/kilogram/°C Conversion Table
kilojoule/kilogram/K kilocalorie (IT)/kilogram/°C
0.01 kilojoule/kilogram/K 0.002388459 kilocalorie (IT)/kilogram/°C
0.1 kilojoule/kilogram/K 0.02388459 kilocalorie (IT)/kilogram/°C
1 kilojoule/kilogram/K 0.238845897 kilocalorie (IT)/kilogram/°C
2 kilojoule/kilogram/K 0.477691793 kilocalorie (IT)/kilogram/°C
3 kilojoule/kilogram/K 0.71653769 kilocalorie (IT)/kilogram/°C
5 kilojoule/kilogram/K 1.194229483 kilocalorie (IT)/kilogram/°C
10 kilojoule/kilogram/K 2.388458966 kilocalorie (IT)/kilogram/°C
20 kilojoule/kilogram/K 4.776917933 kilocalorie (IT)/kilogram/°C
50 kilojoule/kilogram/K 11.94229483 kilocalorie (IT)/kilogram/°C
100 kilojoule/kilogram/K 23.88458966 kilocalorie (IT)/kilogram/°C
1000 kilojoule/kilogram/K 238.8458966 kilocalorie (IT)/kilogram/°C
### Popular Unit Conversions Specific Heat Capacity
The most used and popular units of Specific Heat Capacity conversions are presented for quick and free access. | 650 | 1,744 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 1, "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} | 3.328125 | 3 | CC-MAIN-2024-18 | latest | en | 0.234432 |
http://www.vawhigs.org/how-much-mortgage-payment-can-you-afford/ | 1,604,106,037,000,000,000 | text/html | crawl-data/CC-MAIN-2020-45/segments/1603107912593.62/warc/CC-MAIN-20201031002758-20201031032758-00375.warc.gz | 168,847,151 | 9,905 | # How Much Mortgage Payment Can You Afford
### How Much Mortgage Payment Can You Afford
For example, let’s say your maximum monthly payment is \$1,250, you have \$25,000 for a down payment, and taxes and insurance will cost about \$200 a month. That means you could afford a \$172,000 house on a 15-year fixed-rate mortgage at 3.5% interest.
5 Ways to Calculate How Much House You Can Afford.. For the mortgage payment expense-to-income ratio (front-end), the percentage.
Use our free mortgage calculator to quickly estimate what your new home will cost. Includes taxes, insurance, PMI and the latest mortgage rates.
Lenders also consider how deep you are in debt when evaluating how much mortgage you can afford. Generally, your debts, including your mortgage payment and expenses like mortgage insurance and property taxes shouldn’t amount to more than 36 percent of your income. calculate 36 percent of your income by multiplying your income by .36.
This helps them determine how much of your monthly income will be going toward your monthly debt obligations, which will include your new mortgage payment. The higher your salary, the more house you.
This table used \$600 as a benchmark for monthly debt payments, based on average 0 car payment and \$200 in student loan or credit payments. The mortgage section assumes a 20% down payment on the home value. The payment reflects a 30-year fixed-rate mortgage for a home located in Kansas City, Missouri.
If you earn \$56,516, the average household income, you can afford \$1,695 in total monthly payments, according to the 36% rule. The rule, which measures your debt relative to your income, is used by lenders to evaluate how much you can afford.
Presuming you have \$40,000 to put toward a down payment and you get a 30-year fixed-rate mortgage at 4%, this will mean your housing payments will end up being around \$1,022 per month (\$764 to your mortgage, \$208 to property taxes, and \$50 to home insurance).
"Your mortgage payment should not be more than 25 percent of your take-home pay and you should get a 15-year or less, fixed-rate mortgage. Now, you can probably qualify for a much larger loan than what 25 percent of your take-home pay would give you.
and not “How much house can I afford and still retire?. money that should go to retirement savings goes to cover a higher mortgage payment. | 515 | 2,368 | {"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} | 2.59375 | 3 | CC-MAIN-2020-45 | latest | en | 0.95031 |
https://mathandmind.com/history/greek-mathematics | 1,558,661,885,000,000,000 | text/html | crawl-data/CC-MAIN-2019-22/segments/1558232257481.39/warc/CC-MAIN-20190524004222-20190524030222-00483.warc.gz | 555,617,683 | 6,359 | # GREEK MATHEMATICS
Ancient Greece, a civilization that developed from about 12th-9th cc. BCE to 600 AD, occupied a large part of the Mediterranean region and Central Asia. At first, Greek mathematics was much influenced by mathematical practices of Ancient Egypt and Babylonia – for example, the ancient Greek numeral system resembled the Egyptian base 10 system. Like the Egyptians, the Greeks would use a symbol for “100” three times to represent the number “300.” However, the Ancient Greeks quickly moved beyond the mere adoption of certain elements to the development of their own practices. Since Greek mathematics was mostly based on geometry, it’s only natural that their most influential contributions to modern mathematics are related to geometry.
## Thales
Thales of Miletus who is generally considered the founder of geometry not only understood similar and right triangles but also used his knowledge to find the height of pyramids.
## Pythagoras
Pythagoras’s investigations marked the birth of Greek mathematics. Moreover, the very word “mathematics” is believed to be invented by Pythagoras! It derives from the Greek root “mathema” that means “knowledge” or “learning.” You can hardly find a person who has never heard of the Pythagorean theorem (a2+b2=c2) that is used for right-angled triangles. However, only few people know that the ancient Greek mathematician didn’t invent the theorem – he was the first to prove it.
## Plato
Although, Plato is mostly famous for his works in philosophy, he also made a great contribution to mathematics. He identified five regular symmetrical 3-dimensional shapes known as the Platonic Solids:
• the tetrahedron that is composed of four regular triangles. According to Plato, the tetrahedron symbolized fire;
• the octahedron that is made up of eight triangles. Plato said that octahedrons represented air;
• the icosahedron that is constructed of 20 triangles. Plato the mathematician associated it with water;
• the cube made up of 6 squares symbolized earth;
• the dodecahedron that was constructed of 12 pentagons. Plato defined the figure as “the god used for arranging the constellations on the whole heaven.”
Quick Quiz
Question of
Elon Musk is the head of company...
Math facts
FUN FACTS ABOUT NUMBERS: 6 and 7
What President of the United States was the first to have his photo taken? Why does the name of ninth month of the year come from a word meaning “seven”? Read a compilation of fun facts about numbers 6 and 7!
FUN FACTS ABOUT NUMBERS: 8 and 9
Welcome to the world of numbers 8 and 9! Find out how many sides an umbrella usually have, why the 2008 Summer Olympic Games kicked off at 8 seconds and 8 minutes past 8 pm, and what the most terrifying words in the English language are! | 619 | 2,763 | {"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} | 3.328125 | 3 | CC-MAIN-2019-22 | longest | en | 0.965142 |
https://www.classtools.net/QR/4-UMHCA | 1,685,646,416,000,000,000 | text/html | crawl-data/CC-MAIN-2023-23/segments/1685224648000.54/warc/CC-MAIN-20230601175345-20230601205345-00029.warc.gz | 766,977,091 | 13,880 | Print
A. Prior to the lesson:
1. Arrange students into groups. Each group needs at least ONE person who has a mobile device.
2. If their phone camera doesn't automatically detect and decode QR codes, ask students to
• Bring these devices into the lesson.
4. Cut them out and place them around your class / school.
B. The lesson:
1. Give each group a clipboard and a piece of paper so they can write down the decoded questions and their answers to them.
2. Explain to the students that the codes are hidden around the school. Each team will get ONE point for each question they correctly decode and copy down onto their sheet, and a further TWO points if they can then provide the correct answer and write this down underneath the question.
3. Away they go! The winner is the first team to return with the most correct answers in the time available. This could be within a lesson, or during a lunchbreak, or even over several days!
C. TIPS / OTHER IDEAS
4. A detailed case study in how to set up a successful QR Scavenger Hunt using this tool can be found here.
Question
1. 20x9=180180
2. 91x5=455455
3. 13x2=2626
4. 37x9=333333
5. 46x3=138138
6. 222x9=1,9981,998
7. 405x2=810810
8. 412x7=2,8842,884
9. 234x8=1,8721,872
10. 833x3=2,4992,499
11. 1,185x3=3,5553,555
12. 2,095x3=6,2856,285
13. 4,821x4=19,28419,284
14. 3,540x4=14,16014,160
15. 2,754x4=11,01611,016
Multiply Multi-digit numbers: QR Challenge
Question 1 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 2 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 3 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 4 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 5 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 6 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 7 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 8 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 9 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 10 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 11 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 12 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 13 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 14 (of 15)
Multiply Multi-digit numbers: QR Challenge
Question 15 (of 15) | 673 | 2,339 | {"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} | 3.875 | 4 | CC-MAIN-2023-23 | latest | en | 0.813967 |
http://www.electronicsteacher.com/succeed-in-physical-science/electricity/series-and-parallel-dc-circuits.php | 1,603,758,486,000,000,000 | text/html | crawl-data/CC-MAIN-2020-45/segments/1603107892710.59/warc/CC-MAIN-20201026234045-20201027024045-00189.warc.gz | 137,791,681 | 5,553 | » Experiment » Calculator/Converters » Radio » Newsletter » Associations and Societies » Component Manufacturers
Electronics Symentics A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Electricity
Series and Parallel DC Circuits A direct current (DC) electrical circuit consists of a source of DC electricity with a conducting wire going from one of the source terminals to a set of electrical devices and then back to the other terminal, in a complete circuit. A DC circuit is necessary for DC electricity to exist. DC circuits may be in series, parallel or a combination. Understanding DC circuits is important for learning about the more complex AC circuits, like those used in the home. Questions you may have include: What does an electric circuit consist of? What is a series circuit? What is a parallel circuit? Simple circuit If you take a continuous source of DC electricity, such as a battery, and connect conducting wires from the positive and negative poles of the battery to an electrical device such as a light bulb, you have formed an electric circuit. The battery, bulb and switch inside a flashlight form a DC circuit In other words, the electricity flows in a loop from one end of the battery (or source of electricity) to the other end in a circuit. The concept of electric circuits is the basis for our use of electricity. One nice feature of an electrical circuit is that you can install a switch in the circuit to turn the power on or off when you want. Note: Although electrons move from a negative (-) area toward the positive (+), the convention was established that electricity is designation as moving from (+) to (-). Power source A DC circuit requires a source of power. Typically, a battery is used to provide continuous DC electricity. A DC generator is another source of energy. Alternating current (AC) electricity can be modified through a rectifier or adapter to create DC electricity. The common adapter used for some of your small DC-powered devices will transform 110V AC house current into 12V DC current for your device. Voltage, current and resistance The electricity moving through a wire or other conductor consists of its voltage (V), current (I) and resistance (R). The voltage or potential energy of a source of electricity is measured in Volts. The current of amount of electrons flowing through the wire is measured in Amperes or Amps. The resistance or electrical friction is measured in Ohms. Conductors The wire and electrical devices must be able to conduct electricity. Metal such as copper is a good conductor of electricity and has a low resistance. The tungsten filament in a light bulb conducts electricity, but it has high resistance that causes it to heat up and glow. Series DC circuit In an electrical circuit, several electrical devices such as light bulbs can be placed in a line or in series in the circuit between the positive and negative poles of the battery. This is called a series circuit. Two light bulbs in a series circuit with a battery One problem with such an arrangement is if one light bulb burns out, then it acts like a switch and turns off the whole circuit. Schematic Every device in a DC circuit--whether a light bulb or electrical motor--can be represented by an electrical resistance or resistor Usually, when drawing a circuit diagram or schematic, you use certain symbols for the battery and resistors. Schematic of a DC circuit with three resistor in series Parallel DC circuit Devices can also arranged in a parallel configuration, such that if any bulbs go out, the circuit is still intact. Not only is a parallel circuit useful for holiday lighting, the electrical wiring in homes is also in parallel. In this way lights and appliances can be turned on and off at will. Otherwise if you turned one light off--or one burned out--all the other lights in the house would go off too. Two light bulbs in a parallel circuit If either light bulb would go out, the other would still shine. You could add other bulbs or even appliances such as electric motors in parallel to this circuit, and they would remain independent of each other. Schematic of parallel DC circuit You could also replace a bulb with a series circuit of bulbs or add bulbs or devices in series between parallel items. There are many combinations possible. In conclusion DC electrical circuits consist of a source of DC electricity with a conducting wire going from one of the terminals to a set of electrical devices and then back to the other terminal, in a complete circuit. DC circuits may be in series, parallel or some complex combination. | 918 | 4,605 | {"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} | 3.5 | 4 | CC-MAIN-2020-45 | latest | en | 0.920225 |
https://algebra-cheat.com/algebra-cheat/parallel-lines/basic-math-for-dummies.html | 1,606,654,822,000,000,000 | text/html | crawl-data/CC-MAIN-2020-50/segments/1606141198409.43/warc/CC-MAIN-20201129123729-20201129153729-00614.warc.gz | 185,925,445 | 12,994 | Try the Free Math Solver or Scroll down to Tutorials!
Depdendent Variable
Number of equations to solve: 23456789
Equ. #1:
Equ. #2:
Equ. #3:
Equ. #4:
Equ. #5:
Equ. #6:
Equ. #7:
Equ. #8:
Equ. #9:
Solve for:
Dependent Variable
Number of inequalities to solve: 23456789
Ineq. #1:
Ineq. #2:
Ineq. #3:
Ineq. #4:
Ineq. #5:
Ineq. #6:
Ineq. #7:
Ineq. #8:
Ineq. #9:
Solve for:
Please use this form if you would like to have this math solver on your website, free of charge. Name: Email: Your Website: Msg:
basic math for dummies
Related topics:
rationalize the denominator | math homework grade 3 | demical to fraction formula | free online algebra placement test | north carolina algebra 1 book answer key | printable 8th grade algebra test | hardest math probelm | 3 grade partial- sums addition worksheet | sums algebra | pre- algebra dictionary for 7 grade | teachers package for algebra questions
Author Message
rivsolj
Registered: 16.04.2003
From: England
Posted: Thursday 28th of Dec 09:50 I think God would have been in a really bad mood that he came up with something called math to trouble us! I’ve spent hours working on this algebra problem which relates to basic math for dummies and I still can’t solve it. I’m particularly having problems with quadratic equations, lcf and hyperbolas. Can anyone show me the way on how to go about finding a solution to such problems? I’ve tried all ways that I could think of, but none helped. I need some urgent help now. Anybody?
oc_rana
Registered: 08.03.2007
From: egypt,alexandria
Posted: Friday 29th of Dec 13:30 You are right , there are programs that can help you with study . I think there are several ones that help you solve algebra problems, but I read that Algebrator stands out amongst them. I used the program when I was a student in Basic Math for helping me with basic math for dummies, and it never failed me since then. Gradually I understood all the topics, and then I was able to solve the hardest of the tasks without the program. Don't worry; you won't have any problem using it. It was made for students, so it's simple to use. Actually you just have to type in the topic that's all .Of course you should use it to learn math , not just copy the results, because you won't learn that way.
CHS`
Registered: 04.07.2001
From: Victoria City, Hong Kong Island, Hong Kong
Posted: Saturday 30th of Dec 18:00 It would really be nice if you could tell us about a tool that can offer both. If you could get us a home tutoring software that would offer a step-by-step solution to our assignment , it would really be great . Please let us know the genuine websites from where we can get the software.
Yavnel
Registered: 16.07.2004
From: London, UK
Posted: Monday 01st of Jan 11:09 Sorry guys. But whenever I see those book and piles of homework, I just can’t seem to retain my senses. Thanks a lot for the advice and I will use it for sure. Where can I get this thing?
alhatec16
Registered: 10.03.2002
From: Notts, UK.
Posted: Wednesday 03rd of Jan 08:01 Thanks dudes for all your replies . I have got the Algebrator from https://algebra-cheat.com/assessment-sample-question-for-m.html. Just got it installed and began using it. Its superb. The exercise problems can test the real expertise that we possess on Intermediate algebra. I am thankful to you all! | 868 | 3,371 | {"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} | 2.703125 | 3 | CC-MAIN-2020-50 | latest | en | 0.927438 |
https://www.sharpsightlabs.com/blog/category/python/matplotlib/ | 1,696,091,167,000,000,000 | text/html | crawl-data/CC-MAIN-2023-40/segments/1695233510697.51/warc/CC-MAIN-20230930145921-20230930175921-00212.warc.gz | 1,059,219,428 | 56,784 | ## The 5 Python Skills You Need Before You Study Machine Learning
Machine learning is a very powerful skill. And machine learning is a valuable skill. According to Glassdoor, the average salary for a machine learning engineer is about \$127,000 in early 2021. If you already know some Python, then upskilling to add machine learning to your skill set could increase your earning power a lot. The … Read more
## Python Data Analysis: covid-19, part 4 [visual data exploration]
This tutorial is part of a series of tutorials analyzing covid-19 data. For parts 1, 2, and 3, see the following posts: https://www.sharpsightlabs.com/blog/python-data-analysis-covid19-part1/ https://www.sharpsightlabs.com/blog/python-data-analysis-covid19-part2/ https://www.sharpsightlabs.com/blog/analyzing-covid-19-with-python-part-3-eda/ Covid19 analysis, part 4: visual data exploration So far in this tutorial series, we’ve focused mostly on getting data, particularly in parts 1 and 2. Most recently, in part 3, … Read more
## How to make a matplotlib line chart
In this tutorial, I’ll show you how to make a simple matplotlib line chart. Essentially, I’ll show you how to use the plt.plot function from pyplot to create a line chart. Line charts are a little confusing in Python I’ll be honest. Creating a line chart in Python is a little confusing to beginners. If … Read more
## How to make a matplotlib scatter plot
In this tutorial, I’ll show you how to make a matplotlib scatter plot. The scatter plot is a relatively simple tool, but it’s also essential for doing data analysis and data science. Having said that, if you want to do data science in Python, you really need to know how to create a scatter plot … Read more
## How to make a matplotlib bar chart
In this tutorial, you’ll learn how to create a matplotlib bar chart. Specifically, you’ll learn how to use the plt.bar function from pyplot to create bar charts in Python. Bar charts in Python are a little challenging I’ll be honest … creating bar charts in Python is harder than it should be. People who are … Read more
## How to make a matplotlib histogram
This tutorial will explain how to make a matplotlib histogram. If you’re interested in data science and data visualization in Python, then read on. This post will explain how to make a histogram in Python using matplotlib. Here’s exactly what the tutorial will cover: A quick introduction to matplotlib The syntax for the matplotlib histogram … Read more | 551 | 2,474 | {"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} | 2.515625 | 3 | CC-MAIN-2023-40 | longest | en | 0.827904 |
http://www.evancarmichael.com/blog/category/money/ | 1,526,887,576,000,000,000 | text/html | crawl-data/CC-MAIN-2018-22/segments/1526794863967.46/warc/CC-MAIN-20180521063331-20180521083331-00630.warc.gz | 392,810,687 | 8,552 | # Money
## Happy Valentine’s Day – From Google!
Tweet This week I received a Valentine’s Day card… from Google! I love the idea of sending out cards on offbeat holidays. Sometimes companies will take less celebrated occasions like Valentine’s or St. Patrick’s Day and I’ve also seen companies create their own holidays or recognize customers for special occasions (ie 1 year anniversary as […]
## From \$0.30 to \$300 / Day on Google AdSense Part 6 – How To Make Money
Tweet It’s been a while since my last AdSense post so to continue with the series on From \$0.30 to \$300 / Day on Google AdSense here is Part 6. If you haven’t been following along or need a quick recap our Money Making Formula is \$ = V x CTR x CPC. In previous […]
Tweet (Photo Credit: Rebecca Bollwitt) A couple of weeks ago I had a chance to head to Google’s office for a full day of AdSense discussion. As part of the event we got to ask questions via an online form and members who attended were asked to vote on the questions. The top 9 voted […]
Tweet Last week I got an amazing opportunity from Google – they invited me and some of the other top Canadian AdSense publishers to their Toronto head office to discuss AdSense tips and tricks as well as preview new changes that are coming to the AdSense program. We weren’t allowed to take pictures inside their […]
## From \$0.30 to \$300 / Day on Google AdSense Part 5 – How To Make Money
Tweet (Photo Credit: Tomitheos) It’s time to kick it up a notch in the “\$0.30 to \$300 / Day on Google AdSense” series. Today I’m going to cover another important factor to increase you click through rate (CTR) from our Money Making Formula: \$ = V x CTR x CPC formula. If you’re not sure […]
## From \$0.30 to \$300 / Day on Google AdSense Part 4 – How To Make Money
Tweet It’s time for Part 4 of my series on how to make \$300 / day from Google AdSense. Today I’m going to focus in on another key strategy that can increase your click through rate (CTR) from the \$ = V x CTR x CPC formula. In case you missed the first three posts, […]
## From \$0.30 to \$300 / Day on Google AdSense Part 3 – How To Make Money
Tweet In my first two posts in this series I discussed the AdSense formula \$ = V x CTR x CPC and how to increase your V through search engine optimization, Twitter, and getting others to write content for you. Today I’m going to assume we’ve solved the “How do I get traffic?” problem and […]
## From \$0.30 to \$300 / Day on Google AdSense Part 2 – How To Make Money
Tweet In my last post (From \$0.30 to \$300 / Day on Google AdSense Part 1 – How To Make Money) I talked about the importance of the formula \$ = V x CTR x CPC which means that the money that you make (\$) is equal to the number of visitors (V) that you […]
## From \$0.30 to \$300 / Day on Google AdSense Part 1 – How To Make Money
Tweet Making money from a website used to be extremely challenging – not only did you have to produce great content and promote it effectively, you also had to go out and find advertisers to give yourself a revenue stream to live off of. Enter Google AdSense Google changed the playing field for many web […]
Table 'evan_WPTMW.LightBox' doesn't exist | 771 | 3,201 | {"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} | 2.578125 | 3 | CC-MAIN-2018-22 | latest | en | 0.899989 |
https://www.rosettacode.org/wiki/Amicable_pairs | 1,627,950,345,000,000,000 | text/html | crawl-data/CC-MAIN-2021-31/segments/1627046154408.7/warc/CC-MAIN-20210802234539-20210803024539-00472.warc.gz | 1,013,680,730 | 79,189 | I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)
# Amicable pairs
Amicable pairs
You are encouraged to solve this task according to the task description, using any language you may know.
Two integers ${\displaystyle N}$ and ${\displaystyle M}$ are said to be amicable pairs if ${\displaystyle N\neq M}$ and the sum of the proper divisors of ${\displaystyle N}$ (${\displaystyle \mathrm {sum} (\mathrm {propDivs} (N))}$) ${\displaystyle =M}$ as well as ${\displaystyle \mathrm {sum} (\mathrm {propDivs} (M))=N}$.
Example
1184 and 1210 are an amicable pair, with proper divisors:
• 1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592 and
• 1, 2, 5, 10, 11, 22, 55, 110, 121, 242, 605 respectively.
Calculate and show here the Amicable pairs below 20,000; (there are eight).
## 11l
F sum_proper_divisors(n) R I n < 2 {0} E sum((1 .. n I/ 2).filter(it -> (@n % it) == 0)) L(n) 1..20000 V m = sum_proper_divisors(n) I m > n & sum_proper_divisors(m) == n print(n"\t"m)
org 100h ;;; Calculate proper divisors of 2..20000 lxi h,pdiv + 4 ; 2 bytes per entry lxi d,19999 ; [2 .. 20000] means 19999 entries lxi b,1 ; Initialize each entry to 1init: mov m,c inx h mov m,b inx h dcx d mov a,d ora e jnz init lxi b,1 ; BC = outer loop variableiouter: inx b lxi h,-10001 ; Are we there yet? dad b jc idone ; If so, we've calculated all of them mov h,b mov l,c dad h xchg ; DE = inner loop variableiinner: push d ; save DE xchg dad h ; calculate *pdiv[DE] lxi d,pdiv dad d mov e,m ; DE = pdiv[DE] inx h mov d,m xchg ; pdiv[DE] += BC dad b xchg ; store it back mov m,d dcx h mov m,e pop h ; restore DE (into HL) dad b ; add BC lxi d,-20001 ; are we there yet? dad d jc iouter ; then continue with outer loop lxi d,20001 ; otherwise continue with inner loop dad d xchg jmp iinneridone: lxi b,1 ; BC = outer loop variabletouter: inx b lxi h,-20001 ; Are we there yet? dad b rc ; If so, stop mov d,b ; DE = outer loop variable mov e,ctinner: inx d lxi h,-20001 ; Are we there yet? dad d jc touter ; If so continue with outer loop push d ; Store the variables push b mov h,b ; find *pdiv[BC] mov l,c dad b lxi b,pdiv dad b mov a,m ; Compare low byte (to E) cmp e jnz tnext1 ; Not equal = not amicable inx h mov a,m cmp d ; Compare high byte (to B) jnz tnext1 ; Not equal = not amicable pop b ; Restore BC xchg ; find *pdiv[DE] dad h lxi d,pdiv dad d mov a,m ; Compare low byte (to C) cmp c jnz tnext2 ; Not equal = not amicable inx h mov a,m ; Compare high byte (to B) cmp b jnz tnext2 ; Not equal = not amicable pop d ; Restore DE push d ; Save them both on the stack again push b push d mov h,b ; Print the first number mov l,c call prhl pop h ; And the second number call prhl lxi d,nl ; And a newline mvi c,9 call 5tnext1: pop b ; Restore Btnext2: pop d ; Restore D jmp tinner ; Continue ;;; Print the number in HLprhl: lxi d,nbuf ; Store buffer pointer on stack push d lxi b,-10 ; Divisorpdgt: lxi d,-1 ; Quotientpdivlp: inx d dad b jc pdivlp mvi a,'0'+10 ; Make ASCII digit add l pop h ; Store in output buffer dcx h mov m,a push h xchg ; Keep going with rest of number mov a,h ; if not zero ora l jnz pdgt mvi c,9 ; CP/M call to print string pop d ; Get buffer pointer jmp 5 db '*****'nbuf: db ' $'nl: db 13,10,'$'pdiv: equ $; base Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## 8086 Assembly LIMIT: equ 20000 ; Maximum value cpu 8086 org 100hsection .text mov ax,final ; Set DS and ES to point just beyond the mov cl,4 ; program. We're just going to assume MS-DOS shr ax,cl ; gave us enough memory. (Generally the case, inc ax ; a .COM gets a 64K segment and we need ~40K.) mov cx,cs add ax,cx mov ds,ax mov es,axcalc: mov ax,1 ; Calculate proper divisors for 2..20000 mov di,4 ; Initially, set each entry to 1. mov cx,LIMIT-1 ; 2 to 20000 inclusive = 19999 entries rep stosw mov ax,2 ; AX = outer loop counter mov cl,2 mov dx,LIMIT*2 ; Keep inner loop limit ready in DX mov bp,LIMIT/2 ; And outer loop limit in BP.outer: mov bx,ax ; BX = inner loop counter (multiplied by two) shl bx,cl ; Each entry is 2 bytes wide.inner: add [bx],ax ; divsum[BX/2] += AX add bx,ax ; Advance to next entry add bx,ax ; Twice, because each entry is 2 bytes wide cmp bx,dx ; Are we there yet? jbe .inner ; If not, keep going inc ax cmp ax,bp ; Is the outer loop done yet? jbe .outer ; If not, keep goingshow: mov dx,LIMIT ; Keep limit ready in DX mov ax,2 ; AX = outer loop counter mov si,4 ; SI = address for outer loop.outer: mov cx,ax ; CX = inner loop counter inc cx mov di,cx ; DI = address for inner loop shl di,1 mov bx,[si] ; Preload divsum[AX].inner: cmp cx,bx ; CX == divsum[AX]? jne .next ; If not, the pair is not amicable cmp ax,[di] ; AX == divsum[CX]? jne .next ; If not, the pair is not amicable push ax ; Keep the registers push bx push cx push dx push cx ; And CX twice because we need to print it call prax ; Print the first number pop ax call prax ; And the second number mov dx,nl ; And a newline call pstr pop dx ; Restore the registers pop cx pop bx pop ax.next: inc di ; Increment inner loop variable and address inc di ; Address twice because each entry has 2 bytes inc cx cmp cx,dx ; Are we done yet? jbe .inner ; If not, keep going inc si ; Increment outer loop variable and address inc si ; Address twice because each entry has 2 bytes inc ax cmp ax,dx ; Are we done yet? jbe .outer ; If not, keep going. ret ;;; Print the number in AX. Destroys AX, BX, CX, DX.prax: mov cx,10 ; Divisor mov bx,nbuf ; Buffer pointer.digit: xor dx,dx div cx ; Divide by 10 and extract digit add dl,'0' ; Add ASCII 0 to digit dec bx mov [cs:bx],dl ; Store in string test ax,ax ; Any more? jnz .digit ; If so, keep going mov dx,bx ; If not, print the result ;;; Print string from CS.pstr: push ds ; Save DS mov ax,cs ; Set DS to CS mov ds,ax mov ah,9 ; Print string using MS-DOS int 21h pop ds ; Restore DS ret db '*****'nbuf: db '$'nl: db 13,10,'$'final: equ$
Output:
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416
This solution uses the package Generic_Divisors from the Proper Divisors task [[1]].
with Ada.Text_IO, Generic_Divisors; use Ada.Text_IO; procedure Amicable_Pairs is function Same(P: Positive) return Positive is (P); package Divisor_Sum is new Generic_Divisors (Result_Type => Natural, None => 0, One => Same, Add => "+"); Num2 : Integer;begin for Num1 in 4 .. 20_000 loop Num2 := Divisor_Sum.Process(Num1); if Num1 < Num2 then if Num1 = Divisor_Sum.Process(Num2) then Put_Line(Integer'Image(Num1) & "," & Integer'Image(Num2)); end if; end if; end loop;end Amicable_Pairs;
Output:
220, 284
1184, 1210
2620, 2924
5020, 5564
6232, 6368
10744, 10856
12285, 14595
17296, 18416
## ALGOL 60
Works with: A60
begin comment - return p mod q;integer procedure mod(p, q); value p, q; integer p, q;begin mod := p - q * entier(p / q);end; comment - return sum of the proper divisors of n;integer procedure sumf(n); value n; integer n;begin integer sum, f1, f2; sum := 1; f1 := 2; for f1 := f1 while (f1 * f1) < n do begin if mod(n, f1) = 0 then begin sum := sum + f1; f2 := n / f1; if f2 > f1 then sum := sum + f2; end; f1 := f1 + 1; end; sumf := sum;end; comment - main program begins here;integer a, b, c, found;outstring(1,"Searching up to 20000 for amicable pairs\n");found := 0;for a := 2 step 1 until 20000 do begin b := sumf(a); if b > a then begin c := sumf(b); if a = c then begin found := found + 1; outinteger(1,a); outinteger(1,b); outstring(1,"\n"); end; end; end;outinteger(1,found);outstring(1,"pairs were found"); end
Output:
Searching up to 20000 for amicable pairs
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416
8 pairs were found
## ALGOL 68
# returns the sum of the proper divisors of n ## if n = 1, 0 or -1, we return 0 #PROC sum proper divisors = ( INT n )INT: BEGIN INT result := 0; INT abs n = ABS n; IF abs n > 1 THEN FOR d FROM ENTIER sqrt( abs n ) BY -1 TO 2 DO IF abs n MOD d = 0 THEN # found another divisor # result +:= d; IF d * d /= n THEN # include the other divisor # result +:= n OVER d FI FI OD; # 1 is always a proper divisor of numbers > 1 # result +:= 1 FI; result END # sum proper divisors # ; # construct a table of the sum of the proper divisors of numbers ## up to 20 000 #INT max number = 20 000;[ 1 : max number ]INT proper divisor sum;FOR n TO UPB proper divisor sum DO proper divisor sum[ n ] := sum proper divisors( n ) OD; # returns TRUE if n1 and n2 are an amicable pair FALSE otherwise ## n1 and n2 are amicable if the sum of the proper diviors ## n1 = n2 and the sum of the proper divisors of n2 = n1 #PROC is an amicable pair = ( INT n1, n2 )BOOL: ( proper divisor sum[ n1 ] = n2 AND proper divisor sum[ n2 ] = n1 ); # find the amicable pairs up to 20 000 #FOR p1 TO max number DO FOR p2 FROM p1 + 1 TO max number DO IF is an amicable pair( p1, p2 ) THEN print( ( whole( p1, -6 ), " and ", whole( p2, -6 ), " are a amicable pair", newline ) ) FI ODOD
Output:
220 and 284 are a amicable pair
1184 and 1210 are a amicable pair
2620 and 2924 are a amicable pair
5020 and 5564 are a amicable pair
6232 and 6368 are a amicable pair
10744 and 10856 are a amicable pair
12285 and 14595 are a amicable pair
17296 and 18416 are a amicable pair
## ANSI Standard BASIC
Translation of: GFA Basic
100 DECLARE EXTERNAL FUNCTION sum_proper_divisors110 CLEAR120 !130 DIM f(20001) ! sum of proper factors for each n140 FOR i=1 TO 20000150 LET f(i)=sum_proper_divisors(i)160 NEXT i170 ! look for pairs180 FOR i=1 TO 20000190 FOR j=i+1 TO 20000200 IF f(i)=j AND i=f(j) THEN210 PRINT "Amicable pair ";i;" ";j220 END IF230 NEXT j240 NEXT i250 !260 PRINT270 PRINT "-- found all amicable pairs"280 END290 !300 ! Compute the sum of proper divisors of given number310 !320 EXTERNAL FUNCTION sum_proper_divisors(n)330 !340 IF n>1 THEN ! n must be 2 or larger350 LET sum=1 ! start with 1360 LET root=SQR(n) ! note that root is an integer370 ! check possible factors, up to sqrt380 FOR i=2 TO root390 IF MOD(n,i)=0 THEN400 LET sum=sum+i ! i is a factor410 IF i*i<>n THEN ! check i is not actual square root of n420 LET sum=sum+n/i ! so n/i will also be a factor430 END IF440 END IF450 NEXT i460 END IF470 LET sum_proper_divisors = sum480 END FUNCTION
## AppleScript
Translation of: JavaScript
-- AMICABLE PAIRS ------------------------------------------------------------ -- amicablePairsUpTo :: Int -> Inton amicablePairsUpTo(max) -- amicable :: [Int] -> Int -> Int -> [Int] -> [Int] script amicable on |λ|(a, m, n, lstSums) if (m > n) and (m ≤ max) and ((item m of lstSums) = n) then a & [[n, m]] else a end if end |λ| end script -- divisorsSummed :: Int -> Int script divisorsSummed -- sum :: Int -> Int -> Int script sum on |λ|(a, b) a + b end |λ| end script on |λ|(n) foldl(sum, 0, properDivisors(n)) end |λ| end script foldl(amicable, {}, ¬ map(divisorsSummed, enumFromTo(1, max)))end amicablePairsUpTo -- TEST ----------------------------------------------------------------------on run amicablePairsUpTo(20000) end run -- PROPER DIVISORS ----------------------------------------------------------- -- properDivisors :: Int -> [Int]on properDivisors(n) -- isFactor :: Int -> Bool script isFactor on |λ|(x) n mod x = 0 end |λ| end script -- integerQuotient :: Int -> Int script integerQuotient on |λ|(x) (n / x) as integer end |λ| end script if n = 1 then {1} else set realRoot to n ^ (1 / 2) set intRoot to realRoot as integer set blnPerfectSquare to intRoot = realRoot -- Factors up to square root of n, set lows to filter(isFactor, enumFromTo(1, intRoot)) -- and quotients of these factors beyond the square root, -- excluding n itself (last item) items 1 thru -2 of (lows & map(integerQuotient, ¬ items (1 + (blnPerfectSquare as integer)) thru -1 of reverse of lows)) end ifend properDivisors -- GENERIC FUNCTIONS --------------------------------------------------------- -- enumFromTo :: Int -> Int -> [Int]on enumFromTo(m, n) if m > n then set d to -1 else set d to 1 end if set lst to {} repeat with i from m to n by d set end of lst to i end repeat return lstend enumFromTo -- filter :: (a -> Bool) -> [a] -> [a]on filter(f, xs) tell mReturn(f) set lst to {} set lng to length of xs repeat with i from 1 to lng set v to item i of xs if |λ|(v, i, xs) then set end of lst to v end repeat return lst end tellend filter -- foldl :: (a -> b -> a) -> a -> [b] -> aon foldl(f, startValue, xs) tell mReturn(f) set v to startValue set lng to length of xs repeat with i from 1 to lng set v to |λ|(v, item i of xs, i, xs) end repeat return v end tellend foldl -- map :: (a -> b) -> [a] -> [b]on map(f, xs) tell mReturn(f) set lng to length of xs set lst to {} repeat with i from 1 to lng set end of lst to |λ|(item i of xs, i, xs) end repeat return lst end tellend map -- Lift 2nd class handler function into 1st class script wrapper -- mReturn :: Handler -> Scripton mReturn(f) if class of f is script then f else script property |λ| : f end script end ifend mReturn
Output:
{{220, 284}, {1184, 1210}, {2620, 2924}, {5020, 5564},{6232, 6368}, {10744, 10856}, {12285, 14595}, {17296, 18416}}
## Arturo
properDivs: function [x] -> (factors x) -- x amicable: function [x][ y: sum properDivs x if and? x = sum properDivs y x <> y -> return @[x,y] return ø] amicables: [] loop 1..20000 'n [ am: amicable n if am <> ø -> 'amicables ++ @[sort am]] print unique amicables
Output:
[220 284] [1184 1210] [2620 2924] [5020 5564] [6232 6368] [10744 10856] [12285 14595] [17296 18416]
(* ****** ****** *)//#include"share/atspre_staload.hats"#include"share/HATS/atspre_staload_libats_ML.hats"//(* ****** ****** *)//funsum_list_vt (xs: List_vt(int)): int =( case+ xs of | ~list_vt_nil() => 0 | ~list_vt_cons(x, xs) => x + sum_list_vt(xs))//(* ****** ****** *) funpropDivs( x0: int) : List0_vt(int) = loop(x0, 2, list_vt_sing(1)) where{//funloop(x0: int, i: int, res: List0_vt(int)) : List0_vt(int) =(if(i * i) > x0then list_vt_reverse(res)else( if x0 % i != 0 then loop(x0, i+1, res) // end of [then] else let val res = cons_vt(i, res) // end of [val] val res = ( if i * i = x0 then res else cons_vt(x0 / i, res) ) : List0_vt(int) // end of [val] in loop(x0, i+1, res) end // end of [else] // end of [if])) (* end of [loop] *)//} // end of [propDivs] (* ****** ****** *) funsum_propDivs(x: int): int = sum_list_vt(propDivs(x)) (* ****** ****** *) valtheNat2 = auxmain(2) where{funauxmain( n: int) : stream_vt(int) = $ldelay(stream_vt_cons(n, auxmain(n+1)))} (* ****** ****** *)//valtheAmicable =(stream_vt_takeLte(theNat2, 20000)).filter()(lam x =>let val x2 = sum_propDivs(x)in x < x2 && x = sum_propDivs(x2) end)//(* ****** ****** *) val () =theAmicable.foreach()( lam x => println! ("(", x, ", ", sum_propDivs(x), ")")) (* ****** ****** *) implement main0 () = () (* ****** ****** *) Output: (220, 284) (1184, 1210) (2620, 2924) (5020, 5564) (6232, 6368) (10744, 10856) (12285, 14595) (17296, 18416) ## AutoHotkey SetBatchLines -1Loop, 20000{ m := A_index ; Getting factors loop % floor(sqrt(m)) { if ( mod(m, A_index) = 0 ) { if ( A_index ** 2 == m ) { sum += A_index continue } else if ( A_index != 1 ) { sum += A_index + m//A_index } else if ( A_index = 1 ) { sum += A_index } } } ; Factors obtained ; Checking factors of sum if ( sum > 1 ) { loop % floor(sqrt(sum)) { if ( mod(sum, A_index) = 0 ) { if ( A_index ** 2 == sum ) { sum2 += A_index continue } else if ( A_index != 1 ) { sum2 += A_index + sum//A_index } else if ( A_index = 1 ) { sum2 += A_index } } } if ( m = sum2 ) && ( m != sum ) && ( m < sum ) final .= m . ":" . sum . "n" } ; Checked sum := 0 sum2 := 0}MsgBox % finalExitApp Output: 220:284 1184:1210 2620:2924 5020:5564 6232:6368 10744:10856 12285:14595 17296:18416 ## AWK #!/bin/awk -ffunction sumprop(num, i,sum,root) {if (num < 2) return 0sum=1root=sqrt(num)for ( i=2; i < root; i++) { if (num % i == 0 ) { sum = sum + i + num/i } } if (num % root == 0) { sum = sum + root } return sum } BEGIN{limit=20000print "Amicable pairs < ",limitfor (n=1; n < limit+1; n++) { m=sumprop(n) if (n == sumprop(m) && n < m) print n,m }}} Output: # ./amicable Amicable pairs < 20000 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## BCPL get "libhdr" manifest$( MAXIMUM = 20000$) // Calculate proper divisors for 1..Nlet propDivSums(n) = valof$( let v = getvec(n) for i = 1 to n do v!i := 1 for i = 2 to n/2 do $( let j = i*2 while j < n do$( v!j := v!j + i j := j + i $)$) resultis v$) // Are A and B an amicable pair, given the list of sums of proper divisors?let amicable(pdiv, a, b) = a = pdiv!b & b = pdiv!a let start() be$( let pds = propDivSums(MAXIMUM) for x = 1 to MAXIMUM do for y = x+1 to MAXIMUM do if amicable(pds, x, y) do writef("%N, %N*N", x, y)$) Output: 220, 284 1184, 1210 2620, 2924 5020, 5564 6232, 6368 10744, 10856 12285, 14595 17296, 18416 ## Befunge [email protected]#-*8*:"2":$_:#!2#*8#g*#6:#0*#!:#-*#<v>*/.55+,1>:28*:*:*%\28*:*:*/06p28*:*:*/\2v %%^:*:<>*v+|!:-1g60/*:*:*82::+**:*:<<>:#**#8:#<*^>.28*^8 ::v>>*:*%/\28*:*:*%+\v>8+#$^#_+#\:#0<:\1/*:*2#<2v^:*82\/*:*:*82:::_v#!%%*:*:*82\/*:*:*82::<_^#<>>06p:28*:*:**1+01-\>1+::28*:*:*/\28*:*:*%:*\!^ Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## C Remark: Look at Pascal Alternative [[2]].You are using the same principle, so here too both numbers of the pair must be < top. The program will overflow and error in all sorts of ways when given a commandline argument >= UINT_MAX/2 (generally 2^31) #include <stdio.h>#include <stdlib.h> typedef unsigned int uint; int main(int argc, char **argv){ uint top = atoi(argv[1]); uint *divsum = malloc((top + 1) * sizeof(*divsum)); uint pows[32] = {1, 0}; for (uint i = 0; i <= top; i++) divsum[i] = 1; // sieve // only sieve within lower half , the modification starts at 2*p for (uint p = 2; p+p <= top; p++) { if (divsum[p] > 1) { divsum[p] -= p;// subtract number itself from divisor sum ('proper') continue;} // p not prime uint x; // highest power of p we need //checking x <= top/y instead of x*y <= top to avoid overflow for (x = 1; pows[x - 1] <= top/p; x++) pows[x] = p*pows[x - 1]; //counter where n is not a*p with a = ?*p, useful for most p. //think of p>31 seldom divisions or p>sqrt(top) than no division is needed //n = 2*p, so the prime itself is left unchanged => k=p-1 uint k= p-1; for (uint n = p+p; n <= top; n += p) { uint s=1+pows[1]; k--; // search the right power only if needed if ( k==0) { for (uint i = 2; i < x && !(n%pows[i]); s += pows[i++]); k = p; } divsum[n] *= s; } } //now correct the upper half for (uint p = (top >> 1)+1; p <= top; p++) { if (divsum[p] > 1){ divsum[p] -= p;} } uint cnt = 0; for (uint a = 1; a <= top; a++) { uint b = divsum[a]; if (b > a && b <= top && divsum[b] == a){ printf("%u %u\n", a, b); cnt++;} } printf("\nTop %u count : %u\n",top,cnt); return 0;} Output: % ./a.out 20000 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 Top 20000 count : 8 % ./a.out 524000000 .. 475838415 514823985 491373104 511419856 509379344 523679536 Top 524000000 count : 442 real 0m16.285s user 0m16.156s ## C# using System;using System.Collections.Generic;using System.Linq; namespace RosettaCode.AmicablePairs{ internal static class Program { private const int Limit = 20000; private static void Main() { foreach (var pair in GetPairs(Limit)) { Console.WriteLine("{0} {1}", pair.Item1, pair.Item2); } } private static IEnumerable<Tuple<int, int>> GetPairs(int max) { List<int> divsums = Enumerable.Range(0, max + 1).Select(i => ProperDivisors(i).Sum()).ToList(); for(int i=1; i<divsums.Count; i++) { int sum = divsums[i]; if(i < sum && sum <= divsums.Count && divsums[sum] == i) { yield return new Tuple<int, int>(i, sum); } } } private static IEnumerable<int> ProperDivisors(int number) { return Enumerable.Range(1, number / 2) .Where(divisor => number % divisor == 0); } }} Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## C++ #include <vector>#include <unordered_map>#include <iostream> int main() { std::vector<int> alreadyDiscovered; std::unordered_map<int, int> divsumMap; int count = 0; for (int N = 1; N <= 20000; ++N) { int divSumN = 0; for (int i = 1; i <= N / 2; ++i) { if (fmod(N, i) == 0) { divSumN += i; } } // populate map of integers to the sum of their proper divisors if (divSumN != 1) // do not include primes divsumMap[N] = divSumN; for (std::unordered_map<int, int>::iterator it = divsumMap.begin(); it != divsumMap.end(); ++it) { int M = it->first; int divSumM = it->second; int divSumN = divsumMap[N]; if (N != M && divSumM == N && divSumN == M) { // do not print duplicate pairs if (std::find(alreadyDiscovered.begin(), alreadyDiscovered.end(), N) != alreadyDiscovered.end()) break; std::cout << "[" << M << ", " << N << "]" << std::endl; alreadyDiscovered.push_back(M); alreadyDiscovered.push_back(N); count++; } } } std::cout << count << " amicable pairs discovered" << std::endl;} Output: [220, 284] [1184, 1210] [2620, 2924] [5020, 5564] [6232, 6368] [10744, 10856] [12285, 14595] [17296, 18416] 8 amicable pairs discovered ## Clojure (ns example (:gen-class)) (defn factors [n] " Find the proper factors of a number " (into (sorted-set) (mapcat (fn [x] (if (= x 1) [x] [x (/ n x)])) (filter #(zero? (rem n %)) (range 1 (inc (Math/sqrt n)))) ))) (def find-pairs (into #{} (for [n (range 2 20000) :let [f (factors n) ; Factors of n M (apply + f) ; Sum of factors g (factors M) ; Factors of sum N (apply + g)] ; Sum of Factors of sum :when (= n N) ; (sum(proDivs(N)) = M and sum(propDivs(M)) = N :when (not= M N)] ; N not-equal M (sorted-set n M)))) ; Found pair ;; Output Results(doseq [q find-pairs] (println q)) Output: #{220 284} #{6232 6368} #{1184 1210} #{5020 5564} #{2620 2924} #{12285 14595} #{17296 18416} #{10744 10856} ## Common Lisp (let ((cache (make-hash-table))) (defun sum-proper-divisors (n) (or (gethash n cache) (setf (gethash n cache) (loop for x from 1 to (/ n 2) when (zerop (rem n x)) sum x))))) (defun amicable-pairs-up-to (n) (loop for x from 1 to n for sum-divs = (sum-proper-divisors x) when (and (< x sum-divs) (= x (sum-proper-divisors sum-divs))) collect (list x sum-divs))) (amicable-pairs-up-to 20000) Output: ((220 284) (1184 1210) (2620 2924) (5020 5564) (6232 6368) (10744 10856) (12285 14595) (17296 18416)) ## Cowgol include "cowgol.coh"; const LIMIT := 20000; # Calculate sums of proper divisorsvar divSum: uint16[LIMIT + 1];var i: @indexof divSum;var j: @indexof divSum; i := 2;while i <= LIMIT loop divSum[i] := 1; i := i + 1;end loop; i := 2;while i <= LIMIT/2 loop j := i * 2; while j <= LIMIT loop divSum[j] := divSum[j] + i; j := j + i; end loop; i := i + 1;end loop; # Test each pairi := 2;while i <= LIMIT loop j := i + 1; while j <= LIMIT loop if divSum[i] == j and divSum[j] == i then print_i32(i as uint32); print(", "); print_i32(j as uint32); print_nl(); end if; j := j + 1; end loop; i := i + 1;end loop; Output: 220, 284 1184, 1210 2620, 2924 5020, 5564 6232, 6368 10744, 10856 12285, 14595 17296, 18416 ## Crystal MX = 524_000_000N = Math.sqrt(MX).to_u32x = Array(Int32).new(MX+1, 1) (2..N).each { |i| p = i*i x[p] += i k = i+i+1 (p+i..MX).step(i) { |j| x[j] += k k += 1 }} (4..MX).each { |m| n = x[m] if n < m && n != 0 && m == x[n] puts "#{n} #{m}" end} Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ...... ...... ....... ....... 426191535 514780497 475838415 514823985 509379344 523679536 ## D Translation of: Python void main() @safe /*@nogc*/ { import std.stdio, std.algorithm, std.range, std.typecons, std.array; immutable properDivs = (in uint n) pure nothrow @safe /*@nogc*/ => iota(1, (n + 1) / 2 + 1).filter!(x => n % x == 0); enum rangeMax = 20_000; auto n2d = iota(1, rangeMax + 1).map!(n => properDivs(n).sum); foreach (immutable n, immutable divSum; n2d.enumerate(1)) if (n < divSum && divSum <= rangeMax && n2d[divSum - 1] == n) writefln("Amicable pair: %d and %d with proper divisors:\n %s\n %s", n, divSum, properDivs(n), properDivs(divSum));} Output: Amicable pair: 220 and 284 with proper divisors: [1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110] [1, 2, 4, 71, 142] Amicable pair: 1184 and 1210 with proper divisors: [1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592] [1, 2, 5, 10, 11, 22, 55, 110, 121, 242, 605] Amicable pair: 2620 and 2924 with proper divisors: [1, 2, 4, 5, 10, 20, 131, 262, 524, 655, 1310] [1, 2, 4, 17, 34, 43, 68, 86, 172, 731, 1462] Amicable pair: 5020 and 5564 with proper divisors: [1, 2, 4, 5, 10, 20, 251, 502, 1004, 1255, 2510] [1, 2, 4, 13, 26, 52, 107, 214, 428, 1391, 2782] Amicable pair: 6232 and 6368 with proper divisors: [1, 2, 4, 8, 19, 38, 41, 76, 82, 152, 164, 328, 779, 1558, 3116] [1, 2, 4, 8, 16, 32, 199, 398, 796, 1592, 3184] Amicable pair: 10744 and 10856 with proper divisors: [1, 2, 4, 8, 17, 34, 68, 79, 136, 158, 316, 632, 1343, 2686, 5372] [1, 2, 4, 8, 23, 46, 59, 92, 118, 184, 236, 472, 1357, 2714, 5428] Amicable pair: 12285 and 14595 with proper divisors: [1, 3, 5, 7, 9, 13, 15, 21, 27, 35, 39, 45, 63, 65, 91, 105, 117, 135, 189, 195, 273, 315, 351, 455, 585, 819, 945, 1365, 1755, 2457, 4095] [1, 3, 5, 7, 15, 21, 35, 105, 139, 417, 695, 973, 2085, 2919, 4865] Amicable pair: 17296 and 18416 with proper divisors: [1, 2, 4, 8, 16, 23, 46, 47, 92, 94, 184, 188, 368, 376, 752, 1081, 2162, 4324, 8648] [1, 2, 4, 8, 16, 1151, 2302, 4604, 9208] ## Delphi See Pascal. ## EchoLisp ;; using (sum-divisors) from math.lib (lib 'math)(define (amicable N)(define n 0) (for/list ((m (in-range 2 N))) (set! n (sum-divisors m)) #:continue (>= n (* 1.5 m)) ;; assume n/m < 1.5 #:continue (<= n m) ;; prevent perfect numbers #:continue (!= (sum-divisors n) m) (cons m n))) (amicable 20000) → ((220 . 284) (1184 . 1210) (2620 . 2924) (5020 . 5564) (6232 . 6368) (10744 . 10856) (12285 . 14595) (17296 . 18416)) (amicable 1_000_000) ;; 42 pairs → (... (802725 . 863835) (879712 . 901424) (898216 . 980984) (947835 . 1125765) (998104 . 1043096)) ## Ela Translation of: Haskell open monad io number list divisors n = filter ((0 ==) << (n mod)) [1..(n div 2)]range = [1 .. 20000]divs = zip range$ map (sum << divisors) rangepairs = [(n, m) \\ (n, nd) <- divs, (m, md) <- divs | n < m && nd == m && md == n] do putLn pairs ::: IO
Output:
[(220,284),(1184,1210),(2620,2924),(5020,5564),(6232,6368),(10744,10856),(12285,14595),(17296,18416)]
## Elena
Translation of: C#
ELENA 5.0 :
import extensions;import system'routines; const int N = 20000; extension op{ ProperDivisors = Range.new(1,self / 2).filterBy:(n => self.mod:n == 0); get AmicablePairs() { var divsums := Range .new(0, self + 1) .selectBy:(i => i.ProperDivisors.summarize(Integer.new())) .toArray(); ^ 1.repeatTill(divsums.Length) .filterBy:(i) { var ii := i; var sum := divsums[i]; ^ (i < sum) && (sum < divsums.Length) && (divsums[sum] == i) } .selectBy:(i => new { Item1 = i; Item2 = divsums[i]; }) }} public program(){ N.AmicablePairs.forEach:(pair) { console.printLine(pair.Item1, " ", pair.Item2) }}
Output:
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416
### Alternative variant using strong-typed closures
import extensions;import system'routines'stex;import system'collections; const int N = 20000; extension op : IntNumber{ Enumerator<int> ProperDivisors = new Range(1,self / 2).filterBy:(int n => self.mod:n == 0); get AmicablePairs() { auto divsums := new List<int>( cast Enumerator<int>( new Range(0, self).selectBy:(int i => i.ProperDivisors.summarize(0)))); ^ new Range(0, divsums.Length) .filterBy:(int i) { auto sum := divsums[i]; ^ (i < sum) && (sum < divsums.Length) && (divsums[sum] == i) } .selectBy:(int i => new Tuple<int,int>(i,divsums[i])); }} public program(){ N.AmicablePairs.forEach:(var Tuple<int,int> pair) { console.printLine(pair.Item1, " ", pair.Item2) }}
### Alternative variant using yield enumerator
import extensions;import system'routines'stex;import system'collections; const int Limit = 20000; singleton ProperDivisors{ Enumerator<int> function(int number) = Range.new(1, number / 2).filterBy:(int n => number.mod:n == 0);} public sealed AmicablePairs{ int max; constructor(int max) { this max := max } yieldable Tuple<int, int> next() { List<int> divsums := Range.new(0, max + 1).selectBy:(int i => ProperDivisors(i).summarize(0)); for (int i := 1, i < divsums.Length, i += 1) { int sum := divsums[i]; if(i < sum && sum <= divsums.Length && divsums[sum] == i) { yield:new Tuple<int, int>(i, sum); } }; ^ nil } } public program(){ auto e := new AmicablePairs(Limit); for(auto pair := e.next(), pair != nil) { console.printLine(pair.Item1, " ", pair.Item2) }}
Output:
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416
## Elixir
Works with: Elixir version 1.2
With proper_divisors#Elixir in place:
defmodule Proper do def divisors(1), do: [] def divisors(n), do: [1 | divisors(2,n,:math.sqrt(n))] |> Enum.sort defp divisors(k,_n,q) when k>q, do: [] defp divisors(k,n,q) when rem(n,k)>0, do: divisors(k+1,n,q) defp divisors(k,n,q) when k * k == n, do: [k | divisors(k+1,n,q)] defp divisors(k,n,q) , do: [k,div(n,k) | divisors(k+1,n,q)]end map = Map.new(1..20000, fn n -> {n, Proper.divisors(n) |> Enum.sum} end)Enum.filter(map, fn {n,sum} -> map[sum] == n and n < sum end)|> Enum.sort|> Enum.each(fn {i,j} -> IO.puts "#{i} and #{j}" end)
Output:
220 and 284
1184 and 1210
2620 and 2924
5020 and 5564
6232 and 6368
10744 and 10856
12285 and 14595
17296 and 18416
## Erlang
### Erlang, slow
Very slow solution. Same functions by and large as in proper divisors and co.
-module(properdivs). -export([amicable/1,divs/1,sumdivs/1]). amicable(Limit) -> amicable(Limit,[],3,2). amicable(Limit,List,_Current,Acc) when Acc >= Limit -> List; amicable(Limit,List,Current,Acc) when Current =< Acc/2 -> amicable(Limit,List,Acc,Acc+1); amicable(Limit,List,Current,Acc) -> CS = sumdivs(Current), AS = sumdivs(Acc), if CS == Acc andalso AS == Current andalso Acc =/= Current -> io:format("A: ~w, B: ~w, ~nL: ~w~w~n", [Current,Acc,divs(Current),divs(Acc)]), NL = List ++ [{Current,Acc}], amicable(Limit,NL,Acc+1,Acc+1); true -> amicable(Limit,List,Current-1,Acc) end. divs(0) -> []; divs(1) -> []; divs(N) -> lists:sort(divisors(1,N)). divisors(1,N) -> [1] ++ divisors(2,N,math:sqrt(N)). divisors(K,_N,Q) when K > Q -> []; divisors(K,N,_Q) when N rem K =/= 0 -> [] ++ divisors(K+1,N,math:sqrt(N)); divisors(K,N,_Q) when K * K == N -> [K] ++ divisors(K+1,N,math:sqrt(N)); divisors(K,N,_Q) -> [K, N div K] ++ divisors(K+1,N,math:sqrt(N)). sumdivs(N) -> lists:sum(divs(N)).
Output:
3> properdivs:amicable(20000).
A: 220, B: 284,
L: [1,2,4,5,10,11,20,22,44,55,110][1,2,4,71,142]
A: 1184, B: 1210,
L: [1,2,4,8,16,32,37,74,148,296,592][1,2,5,10,11,22,55,110,121,242,605]
A: 2620, B: 2924,
L: [1,2,4,5,10,20,131,262,524,655,1310][1,2,4,17,34,43,68,86,172,731,1462]
A: 5020, B: 5564,
L: [1,2,4,5,10,20,251,502,1004,1255,2510][1,2,4,13,26,52,107,214,428,1391,2782]
A: 6232, B: 6368,
L: [1,2,4,8,19,38,41,76,82,152,164,328,779,1558,3116][1,2,4,8,16,32,199,398,796,1592,3184]
A: 10744, B: 10856,
L: [1,2,4,8,17,34,68,79,136,158,316,632,1343,2686,5372][1,2,4,8,23,46,59,92,118,184,236,472,1357,2714,5428]
A: 12285, B: 14595,
L: [1,3,5,7,9,13,15,21,27,35,39,45,63,65,91,105,117,135,189,195,273,315,351,455,585,819,945,1365,1755,2457,4095][1,3,5,7,15,21,35,105,139,417,695,973,2085,2919,4865]
A: 17296, B: 18416,
L: [1,2,4,8,16,23,46,47,92,94,184,188,368,376,752,1081,2162,4324,8648][1,2,4,8,16,1151,2302,4604,9208]
[{220,284},
{1184,1210},
{2620,2924},
{5020,5564},
{6232,6368},
{10744,10856},
{12285,14595},
{17296,18416}]
### Erlang, faster
This is lazy AND depends on the fun fact that we're not really identifying pairs. They just happen to order. Probably, this answer is false in some sense. But a good deal faster :) As above with the additional function.
[See the talk section amicable pairs, out of order for this Rosetta Code task.]
friendly(Limit) -> List = [{X,properdivs:sumdivs(X)} || X <- lists:seq(3,Limit)], Final = [ X || X <- lists:seq(3,Limit), X == properdivs:sumdivs(proplists:get_value(X,List)) andalso X =/= proplists:get_value(X,List)], io:format("L: ~w~n", [Final]).
Output:
45> properdivs:friendly(20000).
L: [220,284,1184,1210,2620,2924,5020,5564,6232,6368,10744,10856,12285,14595,17296,18416]
ok
We might answer a challenge by saying:
friendly(Limit) -> List = [{X,properdivs:sumdivs(X)} || X <- lists:seq(3,Limit)], Final = [ X || X <- lists:seq(3,Limit), X == properdivs:sumdivs(proplists:get_value(X,List)) andalso X =/= proplists:get_value(X,List)], findfriendlies(Final,[]). findfriendlies(List,Acc) when length(List) =< 0 -> Acc;findfriendlies(List,Acc) -> A = lists:nth(1,List), AS = sumdivs(A), B = lists:nth(2,List), BS = sumdivs(B), if AS == B andalso BS == A -> {_,BL} = lists:split(2,List), findfriendlies(BL,Acc++[{A,B}]); true -> false end.
Output:
94> properdivs:friendly(20000).
[{220,284},
{1184,1210},
{2620,2924},
{5020,5564},
{6232,6368},
{10744,10856},
{12285,14595},
{17296,18416}]
In either case, it's a lot faster than the recursion in my first example.
## ERRE
PROGRAM AMICABLE CONST LIMIT=20000 PROCEDURE SUMPROP(NUM->M) IF NUM<2 THEN M=0 EXIT PROCEDURE SUM=1 ROOT=SQR(NUM) FOR I=2 TO ROOT-1 DO IF (NUM=I*INT(NUM/I)) THEN SUM=SUM+I+NUM/I END IF IF (NUM=ROOT*INT(NUM/ROOT)) THEN SUM=SUM+ROOT END IF END FOR M=SUMEND PROCEDURE BEGIN PRINT(CHR$(12);) ! CLS PRINT("Amicable pairs < ";LIMIT) FOR N=1 TO LIMIT DO SUMPROP(N->M1) SUMPROP(M1->M2) IF (N=M2 AND N<M1) THEN PRINT(N,M1) END FOREND PROGRAM Output: Amicable pairs < 20000 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## F# [2..20000 - 1]|> List.map (fun n-> n, ([1..n/2] |> List.filter (fun x->n % x = 0) |> List.sum))|> List.map (fun (a,b) ->if a<b then (a,b) else (b,a))|> List.groupBy id|> List.map snd|> List.filter (List.length >> ((=) 2))|> List.map List.head|> List.iter (printfn "%A") Output: (220, 284) (1184, 1210) (2620, 2924) (5020, 5564) (6232, 6368) (10744, 10856) (12285, 14595) (17296, 18416) ## Factor This solution focuses on the language's namesake: factoring code into small words which are subsequently composed to form more powerful — yet just as simple — words. Using this approach, the final word naturally arrives at the solution. This is often referred to as the bottom-up approach, which is a way in which Factor (and other concatenative languages) commonly differs from other languages. USING: grouping math.primes.factors math.ranges ; : pdivs ( n -- seq ) divisors but-last ;: dsum ( n -- sum ) pdivs sum ;: dsum= ( n m -- ? ) dsum = ;: both-dsum= ( n m -- ? ) [ dsum= ] [ swap dsum= ] 2bi and ;: amicable? ( n m -- ? ) [ both-dsum= ] [ = not ] 2bi and ;: drange ( -- seq ) 2 20000 [a,b) ;: dsums ( -- seq ) drange [ dsum ] map ;: is-am?-seq ( -- seq ) dsums drange [ amicable? ] 2map ;: am-nums ( -- seq ) t is-am?-seq indices ;: am-nums-c ( -- seq ) am-nums [ 2 + ] map ;: am-pairs ( -- seq ) am-nums-c 2 group ;: print-am ( -- ) am-pairs [ >array . ] each ; print-am Output: { 220 284 } { 1184 1210 } { 2620 2924 } { 5020 5564 } { 6232 6368 } { 10744 10856 } { 12285 14595 } { 17296 18416 } ## Fortran This version uses some latter-day facilities such as array assignment that could be replaced by an ordinary DO-loop, as could the FOR ALL statement that for two adds two to every second element, for three adds three to every third, etc. Each FORALL statement applies its DO-given increment to all the selected array elements potentially in any order or even simultaneously. Likewise, the "MODULE" protocol could be abandoned, which would mean that the KNOWNSUM array would have to be declared COMMON for access across routines - or the whole re-written as a single mainline. And if the PARAMETER statements were replaced appropriately, this source could be compiled using Fortran 77. Output: Perfect!! 6 Perfect!! 28 Amicable! 220 284 Perfect!! 496 Amicable! 1184 1210 Amicable! 2620 2924 Amicable! 5020 5564 Amicable! 6232 6368 Perfect!! 8128 Amicable! 10744 10856 Amicable! 12285 14595 Amicable! 17296 18416 MODULE FACTORSTUFF !This protocol evades the need for multiple parameters, or COMMON, or one shapeless main line...Concocted by R.N.McLean, MMXV. INTEGER LOTS,ILIMIT !Some bounds. PARAMETER (ILIMIT = 2147483647) !Computer arithmetic is not with real numbers. PARAMETER (LOTS = 22000) !Nor is computer storage infinite. INTEGER KNOWNSUM(LOTS) !Calculate these once as multiple references are expected. CONTAINS !Assistants. INTEGER FUNCTION SUMF(N) !Sum of the proper divisors of N. INTEGER N !The number in question. INTEGER S,F,F2,INC,BOOST !Assistants. IF (N.LE.LOTS) THEN !If we're within reach, SUMF = KNOWNSUM(N) !The result is to hand. ELSE !Otherwise, some on-the-spot effort ensues.Could use SUMF in place of S, but some compilers have been confused by such usage. S = 1 !1 is always a factor of N, but N is deemed not. F = 1 !Prepare a crude search for factors. INC = 1 !One by plodding one. IF (MOD(N,2) .EQ. 1) INC = 2!Ah, but an odd number cannot have an even number as a divisor. 1 F = F + INC !So half the time we can doubleplod. F2 = F*F !Up to F2 < N rather than F < SQRT(N) and worries over inexact arithmetic. IF (F2 .LT. N) THEN !F2 = N handled below. IF (MOD(N,F) .EQ. 0) THEN !Does F divide N? BOOST = F + N/F !Yes. The divisor and its counterpart. IF (S .GT. ILIMIT - BOOST) GO TO 666 !Would their augmentation cause an overflow? S = S + BOOST !No, so count in the two divisors just discovered. END IF !So much for a divisor discovered. GO TO 1 !Try for another. END IF !So much for the horde. IF (F2 .EQ. N) THEN !Special case: N may be a perfect square, not necessarily of a prime number. IF (S .GT. ILIMIT - F) GO TO 666 !It is. And it too might cause overflow. S = S + F !But if not, count F once only. END IF !All done. SUMF = S !This is the result. END IF !Whichever way obtained, RETURN !Done.Cannot calculate the sum, because it exceeds the integer limit. 666 SUMF = -666 !An expression of dismay that the caller will notice. END FUNCTION SUMF !Alternatively, find the prime factors, and combine them... SUBROUTINE PREPARESUMF !Initialise the KNOWNSUM array.Convert the Sieve of Eratoshenes to have each slot contain the sum of the proper divisors of its slot number.Changes to instead count the number of factors, or prime factors, etc. would be simple enough. INTEGER F !A factor for numbers such as 2F, 3F, 4F, 5F, ... KNOWNSUM(1) = 0 !Proper divisors of N do not include N. KNOWNSUM(2:LOTS) = 1 !So, although 1 is a proper divisor of all N, 1 is excluded for itself. DO F = 2,LOTS/2 !Step through all the possible divisors of numbers not exceeding LOTS. FOR ALL(I = F + F:LOTS:F) KNOWNSUM(I) = KNOWNSUM(I) + F !And augment each corresponding slot. END DO !Different divisors can hit the same slot. For instance, 6 by 2 and also by 3. END SUBROUTINE PREPARESUMF !Could alternatively generate all products of prime numbers. END MODULE FACTORSTUFF !Enough assistants. PROGRAM AMICABLE !Seek N such that SumF(SumF(N)) = N, for N up to 20,000. USE FACTORSTUFF !This should help. INTEGER I,N !Steppers. INTEGER S1,S2 !Sums of factors. CALL PREPARESUMF !Values for every N up to the search limit will be called for at least once.c WRITE (6,66) (I,KNOWNSUM(I), I = 1,48)c 66 FORMAT (10(I3,":",I5,"|")) DO N = 2,20000 !Step through the specified search space. S1 = SUMF(N) !Only even numbers appear in the results, but check every one anyway. IF (S1 .EQ. N) THEN !Catch a tight loop. WRITE (6,*) "Perfect!!",N !Self amicable! Would otherwise appear as Amicable! n,n. ELSE IF (S1 .GT. N) THEN !Look for a pair going upwards only. S2 = SUMF(S1) !Since otherwise each would appear twice. IF (S2.EQ.N) WRITE (6,*) "Amicable!",N,S1 !Aha! END IF !So much for that candidate. END DO !On to the next. END !Done. ## FreeBASIC ### using Mod ' FreeBASIC v1.05.0 win64 Function SumProperDivisors(number As Integer) As Integer If number < 2 Then Return 0 Dim sum As Integer = 0 For i As Integer = 1 To number \ 2 If number Mod i = 0 Then sum += i Next Return sumEnd Function Dim As Integer n, fDim As Integer sum(19999) For n = 1 To 19999 sum(n) = SumProperDivisors(n)Next Print "The pairs of amicable numbers below 20,000 are :"Print For n = 1 To 19998 ' f = SumProperDivisors(n) f = sum(n) If f <= n OrElse f < 1 OrElse f > 19999 Then Continue For If f = sum(n) AndAlso n = sum(f) Then Print Using "#####"; n; Print " and "; Using "#####"; sum(n) End IfNext PrintPrint "Press any key to exit the program"SleepEnd Output: The pairs of amicable numbers below 20,000 are : 220 and 284 1184 and 1210 2620 and 2924 5020 and 5564 6232 and 6368 10744 and 10856 12285 and 14595 17296 and 18416 ### using "Sieve of Erathosthenes" style ' version 04-10-2016' compile with: fbc -s console' replaced the function with 2 FOR NEXT loops #Define max 20000 ' test for pairs below max#Define max_1 max -1 Dim As String u_str = String(Len(Str(max))+1,"#")Dim As UInteger n, fDim Shared As UInteger sum(max_1) For n = 2 To max_1 sum(n) = 1Next For n = 2 To max_1 \ 2 For f = n * 2 To max_1 Step n sum(f) += n NextNext PrintPrint Using " The pairs of amicable numbers below" & u_str & ", are :"; maxPrint For n = 1 To max_1 -1 f = Sum(n) If f <= n OrElse f > max Then Continue For If f = sum(n) AndAlso n = sum(f) Then Print Using u_str & " and" & u_str ; n; f End IfNext ' empty keyboard bufferWhile Inkey <> "" : WendPrint : Print : Print " Hit any key to end program"SleepEnd The pairs of amicable numbers below 20,000 are : 220 and 284 1184 and 1210 2620 and 2924 5020 and 5564 6232 and 6368 10744 and 10856 12285 and 14595 17296 and 18416 ## Frink This example uses Frink's built-in efficient factorization algorithms. It can work for arbitrarily large numbers. n = 1seen = new set do{ n = n + 1 if seen.contains[n] next sum = sum[allFactors[n, true, false, false]] if sum != n and sum[allFactors[sum, true, false, false]] == n { println["$n, $sum"] seen.put[sum] }} while n <= 20000 Output: 220, 284 1184, 1210 2620, 2924 5020, 5564 6232, 6368 10744, 10856 12285, 14595 17296, 18416 ## Futhark This example does not show the output mentioned in the task description on this page (or a page linked to from here). Please ensure that it meets all task requirements and remove this message. Note that phrases in task descriptions such as "print and display" and "print and show" for example, indicate that (reasonable length) output be a part of a language's solution. This program is much too parallel and manifests all the pairs, which requires a giant amount of memory. fun divisors(n: int): []int = filter (fn x => n%x == 0) (map (1+) (iota (n/2))) fun amicable((n: int, nd: int), (m: int, md: int)): bool = n < m && nd == m && md == n fun getPair (divs: [upper](int, int)) (flat_i: int): ((int,int), (int,int)) = let i = flat_i / upper let j = flat_i % upper in unsafe (divs[i], divs[j]) fun main(upper: int): [][2]int = let range = map (1+) (iota upper) let divs = zip range (map (fn n => reduce (+) 0 (divisors n)) range) let amicable = filter amicable (map (getPair divs) (iota (upper*upper))) in map (fn (np,mp) => [#1 np, #1 mp]) amicable ## GFA Basic OPENW 1CLEARW 1'DIM f%(20001) ! sum of proper factors for each nFOR i%=1 TO 20000 f%(i%)[email protected]_proper_divisors(i%)NEXT i%' look for pairsFOR i%=1 TO 20000 FOR j%=i%+1 TO 20000 IF f%(i%)=j% AND i%=f%(j%) PRINT "Amicable pair ";i%;" ";j% ENDIF NEXT j%NEXT i%'PRINTPRINT "-- found all amicable pairs"~INP(2)CLOSEW 1'' Compute the sum of proper divisors of given number'FUNCTION sum_proper_divisors(n%) LOCAL i%,sum%,root% ' IF n%>1 ! n% must be 2 or larger sum%=1 ! start with 1 root%=SQR(n%) ! note that root% is an integer ' check possible factors, up to sqrt FOR i%=2 TO root% IF n% MOD i%=0 sum%=sum%+i% ! i% is a factor IF i%*i%<>n% ! check i% is not actual square root of n% sum%=sum%+n%/i% ! so n%/i% will also be a factor ENDIF ENDIF NEXT i% ENDIF RETURN sum%ENDFUNC Output is: Amicable pair: 220 284 Amicable pair: 1184 1210 Amicable pair: 2620 2924 Amicable pair: 5020 5564 Amicable pair: 6232 6368 Amicable pair: 10744 10856 Amicable pair: 12285 14595 Amicable pair: 17296 18416 -- found all amicable pairs ## Go package main import "fmt" func pfacSum(i int) int { sum := 0 for p := 1; p <= i/2; p++ { if i%p == 0 { sum += p } } return sum} func main() { var a[20000]int for i := 1; i < 20000; i++ { a[i] = pfacSum(i) } fmt.Println("The amicable pairs below 20,000 are:") for n := 2; n < 19999; n++ { m := a[n] if m > n && m < 20000 && n == a[m] { fmt.Printf(" %5d and %5d\n", n, m) } }} Output: The amicable pairs below 20,000 are: 220 and 284 1184 and 1210 2620 and 2924 5020 and 5564 6232 and 6368 10744 and 10856 12285 and 14595 17296 and 18416 ## Haskell divisors :: (Integral a) => a -> [a]divisors n = filter ((0 ==) . (n mod)) [1 .. (n div 2)] main :: IO ()main = do let range = [1 .. 20000 :: Int] divs = zip range$ map (sum . divisors) range pairs = [(n, m) | (n, nd) <- divs, (m, md) <- divs, n < m, nd == m, md == n] print pairs
Output:
[(220,284),(1184,1210),(2620,2924),(5020,5564),(6232,6368),(10744,10856),(12285,14595),(17296,18416)]
Or, deriving proper divisors above the square root as cofactors (for better performance)
Output:
$jq -c -n -f amicable_pairs.jq220 and 284 are amicable1184 and 1210 are amicable2620 and 2924 are amicable5020 and 5564 are amicable6232 and 6368 are amicable10744 and 10856 are amicable12285 and 14595 are amicable17296 and 18416 are amicable ## Julia Given factor, it is not necessary to calculate the individual divisors to compute their sum. See Abundant, deficient and perfect number classifications for the details. It is safe to exclude primes from consideration; their proper divisor sum is always 1. This code also uses a minor trick to ensure that none of the numbers identified are above the limit. All numbers in the range are checked for an amicable partner, but the pair is cataloged only when the greater member is reached. using Primes, Printf function pcontrib(p::Int64, a::Int64) n = one(p) pcon = one(p) for i in 1:a n *= p pcon += n end return pconend function divisorsum(n::Int64) dsum = one(n) for (p, a) in factor(n) dsum *= pcontrib(p, a) end dsum -= nend function amicables(L = 2*10^7) acnt = 0 println("Amicable pairs not greater than ", L) for i in 2:L !isprime(i) || continue j = divisorsum(i) j < i && divisorsum(j) == i || continue acnt += 1 println(@sprintf("%4d", acnt), " => ", j, ", ", i) endend amicables() Output: Amicable pairs not greater than 20000000 1 => 220, 284 2 => 1184, 1210 3 => 2620, 2924 4 => 5020, 5564 5 => 6232, 6368 6 => 10744, 10856 7 => 12285, 14595 8 => 17296, 18416 9 => 66928, 66992 10 => 67095, 71145 11 => 63020, 76084 12 => 69615, 87633 13 => 79750, 88730 14 => 122368, 123152 15 => 100485, 124155 16 => 122265, 139815 17 => 141664, 153176 18 => 142310, 168730 19 => 171856, 176336 20 => 176272, 180848 21 => 196724, 202444 22 => 185368, 203432 23 => 280540, 365084 24 => 308620, 389924 25 => 356408, 399592 26 => 319550, 430402 27 => 437456, 455344 28 => 469028, 486178 29 => 503056, 514736 30 => 522405, 525915 31 => 643336, 652664 32 => 600392, 669688 33 => 609928, 686072 34 => 624184, 691256 35 => 635624, 712216 36 => 667964, 783556 37 => 726104, 796696 38 => 802725, 863835 39 => 879712, 901424 40 => 898216, 980984 41 => 998104, 1043096 42 => 1077890, 1099390 43 => 947835, 1125765 44 => 1154450, 1189150 45 => 1185376, 1286744 46 => 1156870, 1292570 47 => 1280565, 1340235 48 => 1175265, 1438983 49 => 1392368, 1464592 50 => 1328470, 1483850 51 => 1358595, 1486845 52 => 1511930, 1598470 53 => 1466150, 1747930 54 => 1468324, 1749212 55 => 1798875, 1870245 56 => 1669910, 2062570 57 => 2082464, 2090656 58 => 2236570, 2429030 59 => 2723792, 2874064 60 => 2739704, 2928136 61 => 2652728, 2941672 62 => 2802416, 2947216 63 => 2728726, 3077354 64 => 2803580, 3716164 65 => 3276856, 3721544 66 => 3606850, 3892670 67 => 3805264, 4006736 68 => 3786904, 4300136 69 => 4238984, 4314616 70 => 4259750, 4445050 71 => 4246130, 4488910 72 => 4482765, 5120595 73 => 4604776, 5162744 74 => 5459176, 5495264 75 => 5123090, 5504110 76 => 5357625, 5684679 77 => 5232010, 5799542 78 => 5385310, 5812130 79 => 5147032, 5843048 80 => 5730615, 6088905 81 => 4532710, 6135962 82 => 5726072, 6369928 83 => 6329416, 6371384 84 => 6377175, 6680025 85 => 6993610, 7158710 86 => 6955216, 7418864 87 => 7275532, 7471508 88 => 5864660, 7489324 89 => 7489112, 7674088 90 => 7677248, 7684672 91 => 7800544, 7916696 92 => 7850512, 8052488 93 => 7288930, 8221598 94 => 8262136, 8369864 95 => 7577350, 8493050 96 => 9363584, 9437056 97 => 9071685, 9498555 98 => 9199496, 9592504 99 => 8619765, 9627915 100 => 9339704, 9892936 101 => 9660950, 10025290 102 => 8826070, 10043690 103 => 10254970, 10273670 104 => 8666860, 10638356 105 => 9206925, 10791795 106 => 10572550, 10854650 107 => 8754130, 10893230 108 => 10533296, 10949704 109 => 9491625, 10950615 110 => 9478910, 11049730 111 => 10596368, 11199112 112 => 9773505, 11791935 113 => 11498355, 12024045 114 => 10992735, 12070305 115 => 11252648, 12101272 116 => 11545616, 12247504 117 => 11693290, 12361622 118 => 12397552, 13136528 119 => 11173460, 13212076 120 => 11905504, 13337336 121 => 13921528, 13985672 122 => 10634085, 14084763 123 => 12707704, 14236136 124 => 13813150, 14310050 125 => 14311688, 14718712 126 => 15002464, 15334304 127 => 13671735, 15877065 128 => 14443730, 15882670 129 => 16137628, 16150628 130 => 15363832, 16517768 131 => 14654150, 16817050 132 => 15938055, 17308665 133 => 17257695, 17578785 134 => 17908064, 18017056 135 => 14426230, 18087818 136 => 18056312, 18166888 137 => 17041010, 19150222 138 => 18655744, 19154336 139 => 16871582, 19325698 140 => 17844255, 19895265 141 => 17754165, 19985355 ## K propdivs:{1+&0=x!'1+!x%2} (8,2)#[email protected]&{(x=+/propdivs[a])&~x=a:+/propdivs[x]}' v:1+!20000(220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416) ## Kotlin // version 1.1 fun sumProperDivisors(n: Int): Int { if (n < 2) return 0 return (1..n / 2).filter{ (n % it) == 0 }.sum()} fun main(args: Array<String>) { val sum = IntArray(20000, { sumProperDivisors(it) } ) println("The pairs of amicable numbers below 20,000 are:\n") for(n in 2..19998) { val m = sum[n] if (m > n && m < 20000 && n == sum[m]) { println(n.toString().padStart(5) + " and " + m.toString().padStart(5)) } }} Output: The pairs of amicable numbers below 20,000 are: 220 and 284 1184 and 1210 2620 and 2924 5020 and 5564 6232 and 6368 10744 and 10856 12285 and 14595 17296 and 18416 ## Lua 0.02 of a second in 16 lines of code. The vital trick is to just set m to the sum of n's proper divisors each time. That way you only have to test the reverse, dividing your run time by half the loop limit (ie. 10,000)! function sumDivs (n) local sum = 1 for d = 2, math.sqrt(n) do if n % d == 0 then sum = sum + d sum = sum + n / d end end return sumend for n = 2, 20000 do m = sumDivs(n) if m > n then if sumDivs(m) == n then print(n, m) end endend Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## MAD NORMAL MODE IS INTEGER DIMENSION DIVS(20000) PRINT COMMENT$ AMICABLE PAIRS$R CALCULATE SUM OF DIVISORS OF N INTERNAL FUNCTION(N) ENTRY TO DIVSUM. DS = 0 THROUGH SUMMAT, FOR DIVC=1, 1, DIVC.GE.NSUMMAT WHENEVER N/DIVC*DIVC.E.N, DS = DS+DIVC FUNCTION RETURN DS END OF FUNCTION R CALCULATE SUM OF DIVISORS FOR ALL NUMBERS 1..20000 THROUGH MEMO, FOR I=1, 1, I.GE.20000MEMO DIVS(I) = DIVSUM.(I) R FIND ALL MATCHING PAIRS THROUGH CHECK, FOR I=1, 1, I.GE.20000 THROUGH CHECK, FOR J=1, 1, J.GE.ICHECK WHENEVER DIVS(I).E.J .AND. DIVS(J).E.I, 0 PRINT FORMAT AMI,I,J VECTOR VALUES AMI =$I6,I6*$END OF PROGRAM Output: AMICABLE PAIRS 284 220 1210 1184 2924 2620 5564 5020 6368 6232 10856 10744 14595 12285 18416 17296 ## Maple This example does not show the output mentioned in the task description on this page (or a page linked to from here). Please ensure that it meets all task requirements and remove this message. Note that phrases in task descriptions such as "print and display" and "print and show" for example, indicate that (reasonable length) output be a part of a language's solution. with(NumberTheory):pairs:=[];for i from 1 to 20000 do for j from i+1 to 20000 do sum1:=SumOfDivisors(j)-j; sum2:=SumOfDivisors(i)-i; if sum1=i and sum2=j and i<>j then pairs:=[op(pairs),[i,j]]; printf("%a", pairs); end if; end do;end do;pairs; ## Mathematica / Wolfram Language amicableQ[n_] := Module[{sum = Total[[email protected]@n]}, sum != n && n == Total[[email protected]@sum]] [email protected][Cases[Range[4, 20000], _?([email protected]# &)], 2] Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## MATLAB function amicable tic N=2:1:20000; aN=[]; N(isprime(N))=[]; %erase prime numbers I=1; a=N(1); b=sum(pd(a)); while length(N)>1 if a==b %erase perfect numbers; N(N==a)=[]; a=N(1); b=sum(pd(a)); elseif b<a %the first member of an amicable pair is abundant not defective N(N==a)=[]; a=N(1); b=sum(pd(a)); elseif ~ismember(b,N) %the other member was previously erased N(N==a)=[]; a=N(1); b=sum(pd(a)); else c=sum(pd(b)); if a==c aN(I,:)=[I a b]; I=I+1; N(N==b)=[]; else if ~ismember(c,N) %the other member was previously erased N(N==b)=[]; end end N(N==a)=[]; a=N(1); b=sum(pd(a)); clear c end end disp(array2table(aN,'Variablenames',{'N','Amicable1','Amicable2'})) tocend function D=pd(x) K=1:ceil(x/2); D=K(~(rem(x, K)));end Output: N Amicable1 Amicable2 _ _________ _________ 1 220 284 2 1184 1210 3 2620 2924 4 5020 5564 5 6232 6368 6 10744 10856 7 12285 14595 8 17296 18416 Elapsed time is 8.958720 seconds. ## Nim Being a novice, I submitted my code to the Nim community for review and received much feedback and advice. They were instrumental in fine-tuning this code for style and readability, I can't thank them enough. from math import sqrt const N = 524_000_000.int32 proc sumProperDivisors(someNum: int32, chk4less: bool): int32 = result = 1 let maxPD = sqrt(someNum.float).int32 let offset = someNum mod 2 for divNum in countup(2 + offset, maxPD, 1 + offset): if someNum mod divNum == 0: result += divNum + someNum div divNum if chk4less and result >= someNum: return 0 for n in countdown(N, 2): let m = sumProperDivisors(n, true) if m != 0 and n == sumProperDivisors(m, false): echo$n, " ", $m Output: 523679536 509379344 511419856 491373104 514823985 475838415 ...... ...... ..... ..... 18416 17296 14595 12285 10856 10744 6368 6232 5564 5020 2924 2620 1210 1184 284 220 Total number of pairs is 442, on my machine the code takes ~389 minutes to run. Here's a second version that uses a large amount of memory but runs in 2m32seconds. Again, thanks to the Nim community from math import sqrt const N = 524_000_000.int32var x = newSeq[int32](N+1) for i in 2..sqrt(N.float).int32: var p = i*i x[p] += i var j = i + i while (p += i; p <= N): j.inc x[p] += j for m in 4..N: let n = x[m] + 1 if n < m and n != 0 and m == x[n] + 1: echo n, " ", m Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ..... ..... ...... ...... 426191535 514780497 475838415 514823985 509379344 523679536 ## Oberon-2 MODULE AmicablePairs;IMPORT Out;CONST max = 20000; VAR i,j: INTEGER; pd: ARRAY max + 1 OF LONGINT; PROCEDURE ProperDivisorsSum(n: LONGINT): LONGINT;VAR i,sum: LONGINT;BEGIN sum := 0; IF n > 1 THEN INC(sum,1);i := 2; WHILE (i < n) DO IF (n MOD i) = 0 THEN INC(sum,i) END; INC(i) END END; RETURN sumEND ProperDivisorsSum; BEGIN FOR i := 0 TO max DO pd[i] := ProperDivisorsSum(i) END; FOR i := 2 TO max DO FOR j := i + 1 TO max DO IF (pd[i] = j) & (pd[j] = i) THEN Out.Char('[');Out.Int(i,0);Out.Char(',');Out.Int(j,0);Out.Char("]");Out.Ln END END ENDEND AmicablePairs. Output: [220,284] [1184,1210] [2620,2924] [5020,5564] [6232,6368] [10744,10856] [12285,14595] [17296,18416] ## Oforth Using properDivs implementation tasks without optimization (calculating proper divisors sum without returning a list for instance) : import: mapping Integer method: properDivs -- [] #[ self swap mod 0 == ] self 2 / seq filter ; : amicables| i j | Array new 20000 loop: i [ i properDivs sum dup ->j i <= if continue then j properDivs sum i <> if continue then [ i, j ] over add ]; Output: amicables . [[220, 284], [1184, 1210], [2620, 2924], [5020, 5564], [6232, 6368], [10744, 10856], [12285, 14595], [17296, 18416]] ## PARI/GP for(x=1,20000,my(y=sigma(x)-x); if(y>x && x == sigma(y)-y,print(x" "y))) Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## Pascal ### Direct approach Works with: Turbo Pascal Works with: Free Pascal This version mutates the Sieve of Eratoshenes from striking out factors into summing factors. The Pascal source compiles with Turbo Pascal (7, patched to avoid the zero divide problem for cpu speeds better than ~150MHz) except that the array limit is too large: 15,000 works but does not reach 20,000. The Free Pascal compiler however can handle an array of 20,000 elements. Because the sum of factors of N can exceed N an ad-hoc SumF procedure is provided, thus the search could continue past the table limit, but at a cost in calculation time. Output is Chasing Chains of Sums of Factors of Numbers. Perfect!! 6, Perfect!! 28, Amicable! 220,284, Perfect!! 496, Amicable! 1184,1210, Amicable! 2620,2924, Amicable! 5020,5564, Amicable! 6232,6368, Perfect!! 8128, Amicable! 10744,10856, Amicable! 12285,14595, Sociable: 12496,14288,15472,14536,14264, Sociable: 14316,19116,31704,47616,83328,177792,295488,629072,589786,294896,358336,418904,366556,274924,275444,243760,376736,381028,285778,152990,122410,97946,48976,45946,22976,22744,19916,17716, Amicable! 17296,18416, Source file: Program SumOfFactors; uses crt; {Perpetrated by R.N.McLean, December MCMXCV}//{$DEFINE ShowOverflow}{$IFDEF FPC} {$MODE DELPHI}//tested with lots = 524*1000*1000 takes 75 secs generating KnownSum{$ENDIF} var outf: text; const Limit = 2147483647; const lots = 20000; {This should be much bigger, but problems apply.} var KnownSum: array[1..lots] of longint; Function SumF(N: Longint): Longint; var f,f2,s,ulp: longint; Begin if n <= lots then SumF:=KnownSum[N] {Hurrah!} else begin {This is really crude...} s:=1; {1 is always a factor, but N is not.} f:=2; f2:=f*f; while f2 < N do begin if N mod f = 0 then begin {We have a divisor, and its friend.} ulp:=f + (N div f); if s > Limit - ulp then begin SumF:=-666; exit; end; s:=s + ulp; end; f:=f + 1; f2:=f*f; end; if f2 = N then {A perfect square gets its factor in once only.} if s <= Limit - f then s:=s + f else begin SumF:=-667; exit; end; SumF:=s; end; End; var i,j,l,sf,fs: LongInt; const enuff = 666; {Only so much sociability.} var trail: array[0..enuff] of longint; BEGIN ClrScr; WriteLn('Chasing Chains of Sums of Factors of Numbers.'); for i:=1 to lots do KnownSum[i]:=1; {Sigh. KnownSum:=1;} {start summing every divisor } for i:=2 to lots do begin j:=i + i; While j <= lots do {Sigh. For j:=i + i:Lots:i do KnownSum[j]:=KnownSum[j] + i;} begin KnownSum[j]:=KnownSum[j] + i; j:=j + i; end; end; {Enough preparation.} Assign(outf,'Factors.txt'); ReWrite(Outf); WriteLn(Outf,'Chasing Chains of Sums of Factors of Numbers.'); for i:=2 to lots do {Search.} begin l:=0; sf:=SumF(i); while (sf > i) and (l < enuff) do begin l:=l + 1; trail[l]:=sf; sf:=SumF(sf); end; if l >= enuff then writeln('Rope ran out! ',i);{$IFDEF ShowOverflow} if sf < 0 then writeln('Overflow with ',i);{$ENDIF} if i = sf then {A loop?} begin {Yes. Reveal its members.} trail[0]:=i; {The first.} if l = 0 then write('Perfect!! ') else if l = 1 then write('Amicable! ') else write('Sociable: '); for j:=0 to l do Write(Trail[j],','); WriteLn; if l = 0 then write(outf,'Perfect!! ') else if l = 1 then write(outf,'Amicable! ') else write(outf,'Sociable: '); for j:=0 to l do write(outf,Trail[j],','); WriteLn(outf); end; end; Close (outf); END. ### More expansive. a "normal" Version. Nearly fast as perl using nTheory. program AmicablePairs;{$IFDEF FPC} {$MODE DELPHI} {$H+}{$ELSE} {$APPTYPE CONSOLE}{$ENDIF}uses sysutils;const MAX = 20000;//MAX = 20*1000*1000;type tValue = LongWord; tpValue = ^tValue; tPower = array[0..31] of tValue; tIndex = record idxI, idxS : Uint64; end; var Indices : array[0..511] of tIndex; //primes up to 65536 enough until 2^32 primes : array[0..6542] of tValue; procedure InitPrimes;// sieve of erathosthenes without multiples of 2type tSieve = array[0..(65536-1) div 2] of ansichar;var ESieve : ^tSieve; idx,i,j,p : LongINt;Begin new(ESieve); fillchar(ESieve^[0],SizeOF(tSieve),#1); primes[0] := 2; idx := 1; //sieving j := 1; p := 2*j+1; repeat if Esieve^[j] = #1 then begin i := (2*j+2)*j;// i := (sqr(p) -1) div 2; if i > High(tSieve) then BREAK; repeat ESIeve^[i] := #0; inc(i,p); until i > High(tSieve); end; inc(j); inc(p,2); until j >High(tSieve); //collecting For i := 1 to High(tSieve) do IF Esieve^[i] = #1 then Begin primes[idx] := 2*i+1; inc(idx); IF idx>High(primes) then BREAK; end; dispose(Esieve);end; procedure Su_append(n,factor:tValue;var su:string);var q,p : tValue;begin p := 0; repeat q := n div factor; IF q*factor<>n then Break; inc(p); n := q; until false; IF p > 0 then IF p= 1 then su:= su+IntToStr(factor)+'*' else su:= su+IntToStr(factor)+'^'+IntToStr(p)+'*';end; procedure ProperDivs(n: Uint64);//output of prime factorizationvar su : string; primNo : tValue; p:tValue; begin str(n:8,su); su:= su +' ['; primNo := 0; p := primes[0]; repeat Su_Append(n,p,su); inc(primNo); p := primes[primNo]; until (p=0) OR (p*p >= n); p := n; Su_Append(n,p,su); su[length(su)] := ']'; writeln(su);end; procedure AmPairOutput(cnt:tValue);var i : tValue; r_max,r_min,r : double;begin r_max := 1.0; r_min := 16.0; For i := 0 to cnt-1 do with Indices[i] do begin r := IdxS/IDxI; writeln(i+1:4,IdxI:16,IDxS:16,' ratio ',r:10:7); IF r < 1 then begin writeln(i); readln; halt; end; if r_max < r then r_max := r else if r_min > r then r_min := r; IF cnt < 20 then begin ProperDivs(IdxI); ProperDivs(IdxS); end; end; writeln(' min ratio ',r_min:12:10); writeln(' max ratio ',r_max:12:10);end; procedure SumOFProperDiv(n: tValue;var SumOfProperDivs:tValue);// calculated by prime factorizationvar i,q, primNo, Prime,pot : tValue; SumOfDivs: tValue;begin i := N; SumOfDivs := 1; primNo := 0; Prime := Primes[0]; q := i DIV Prime; repeat if q*Prime = i then Begin pot := 1; repeat i := q; q := i div Prime; Pot := Pot * Prime+1; until q*Prime <> i; SumOfDivs := SumOfDivs * pot; end; Inc(primNo); Prime := Primes[primNo]; q := i DIV Prime; {check if i already prime} if Prime > q then begin prime := i; q := 1; end; until i = 1; SumOfProperDivs := SumOfDivs - N;end; function Check:tValue;const //going backwards DIV23 : array[0..5] of byte = //== 5,4,3,2,1,0 (1,0,0,0,1,0); var i,s,k,n : tValue; idx : nativeInt;begin n := 0; idx := 3; For i := 2 to MAX do begin //must be divisble by 2 or 3 ( n < High(tValue) < 1e14 ) IF DIV23[idx] = 0 then begin SumOFProperDiv(i,s); //only 24.7...% IF s>i then Begin SumOFProperDiv(s,k); IF k = i then begin With indices[n] do begin idxI := i; idxS := s; end; inc(n); end; end; end; dec(idx); IF idx < 0 then idx := high(DIV23); end; result := n;end; var T2,T1: TDatetime; APcnt: tValue;begin InitPrimes; T1:= time; APCnt:= Check; T2:= time; AmPairOutput(APCnt); writeln('Time to find amicable pairs ',FormatDateTime('HH:NN:SS.ZZZ' ,T2-T1)); {$IFNDEF UNIX} readln;{$ENDIF}end. Output 1 220 284 ratio 1.2909091 220 [2^2*5*11*220] 284 [2^2*284] 2 1184 1210 ratio 1.0219595 1184 [2^5*1184] 1210 [2*5*11^2*1210] 3 2620 2924 ratio 1.1160305 2620 [2^2*5*2620] 2924 [2^2*17*43*2924] 4 5020 5564 ratio 1.1083665 5020 [2^2*5*5020] 5564 [2^2*13*5564] 5 6232 6368 ratio 1.0218228 6232 [2^3*19*41*6232] 6368 [2^5*6368] 6 10744 10856 ratio 1.0104244 10744 [2^3*17*79*10744] 10856 [2^3*23*59*10856] 7 12285 14595 ratio 1.1880342 12285 [3^3*5*7*13*12285] 14595 [3*5*7*14595] 8 17296 18416 ratio 1.0647549 17296 [2^4*23*47*17296] 18416 [2^4*18416] ### Alternative about 25-times faster. This will not output the amicable number unless both! numbers are under the given limit. So there will be differences to "Table of n, a(n) for n=1..39374" https://oeis.org/A002025/b002025.txt Up to 524'000'000 the pairs found are only correct by number up to no. 437 460122410 and only 442 out of 455 are found, because some pairs exceed the limit. The limits of the ratio between the numbers of the amicable pair up to 1E14 are, based on b002025.txt: No. lower upper 31447 52326552030976 52326637800704 ratio 1.0000016 52326552030976 [2^8*563*6079*59723] 52326637800704 [2^8*797*1439*178223] 38336 92371445691525 154378742017851 ratio 1.6712821 92371445691525 [3^2*5^2*7^2*11*13^2*23*29^2*233] 154378742017851 [3^2*13^2*53*337*5682671] The distance check is being corrected, the lower number is now not limited. The used method is not useful for very high limits. n = p[1]^a[1]*p[2]^a[2]*...p[l]^a[l] sum of divisors(n) = s(n) = (p[1]^(a[1]+1) -1) / (p[1] -1) * ... * (p[l]^(a[l]+1) -1) / (p[l] -1) with p[k]^(a[k]+1) -1) / (p[k] -1) = sum (i= [1..a[k]])(p[k]^i) Using "Sieve of Erathosthenes"-style program AmicPair;{find amicable pairs in a limited region 2..MAXbeware that >both< numbers must be smaller than MAXthere are 455 amicable pairs up to 524*1000*1000correct up to#437 460122410}//optimized for freepascal 2.6.4 32-Bit{$IFDEF FPC} {$MODE DELPHI} {$OPTIMIZATION ON,peephole,cse,asmcse,regvar} {$CODEALIGN loop=1,proc=8}{$ELSE} {$APPTYPE CONSOLE}{$ENDIF} uses sysutils; type tValue = LongWord; tpValue = ^tValue; tDivSum = array[0..0] of tValue;// evil, but dynamic arrays are slower tpDivSum = ^tDivSum; tPower = array[0..31] of tValue; tIndex = record idxI, idxS : tValue; end;var power, PowerFac : tPower; ds : array of tValue; Indices : array[0..511] of tIndex; DivSumField : tpDivSum; MAX : tValue; procedure Init;var i : LongInt;begin DivSumField[0]:= 0; For i := 1 to MAX do DivSumField[i]:= 1;end; procedure ProperDivs(n: tValue);//Only for output, normally a factorication would dovar su,so : string; i,q : tValue;begin su:= '1'; so:= ''; i := 2; while i*i <= n do begin q := n div i; IF q*i -n = 0 then begin su:= su+','+IntToStr(i); IF q <> i then so:= ','+IntToStr(q)+so; end; inc(i); end; writeln(' [',su+so,']');end; procedure AmPairOutput(cnt:tValue);var i : tValue; r : double;begin r := 1.0; For i := 0 to cnt-1 do with Indices[i] do begin writeln(i+1:4,IdxI:12,IDxS:12,' ratio ',IdxS/IDxI:10:7); if r < IdxS/IDxI then r := IdxS/IDxI; IF cnt < 20 then begin ProperDivs(IdxI); ProperDivs(IdxS); end; end; writeln(' max ratio ',r:10:4);end; function Check:tValue;var i,s,n : tValue;begin n := 0; For i := 1 to MAX do begin //s = sum of proper divs (I) == sum of divs (I) - I s := DivSumField^[i]; IF (s <=MAX) AND (s>i) AND (DivSumField^[s]= i)then begin With indices[n] do begin idxI := i; idxS := s; end; inc(n); end; end; result := n;end; Procedure CalcPotfactor(prim:tValue);//PowerFac[k] = (prim^(k+1)-1)/(prim-1) == Sum (i=0..k) prim^ivar k: tValue; Pot, //== prim^k PFac : Int64;begin Pot := prim; PFac := 1; For k := 0 to High(PowerFac) do begin PFac := PFac+Pot; IF (POT > MAX) then BREAK; PowerFac[k] := PFac; Pot := Pot*prim; end;end; procedure InitPW(prim:tValue);begin fillchar(power,SizeOf(power),#0); CalcPotfactor(prim);end; function NextPotCnt(p: tValue):tValue;//return the first power <> 0//power == n to base primvar i : tValue;begin result := 0; repeat i := power[result]; Inc(i); IF i < p then BREAK else begin i := 0; power[result] := 0; inc(result); end; until false; power[result] := i;end; procedure Sieve(prim: tValue);var actNumber,idx : tValue;begin //sieve with "small" primes while prim*prim <= MAX do begin InitPW(prim); Begin //actNumber = actual number = n*prim actNumber := prim; idx := prim; while actNumber <= MAX do begin dec(idx); IF idx > 0 then DivSumField^[actNumber] *= PowerFac[0] else Begin DivSumField^[actNumber] *= PowerFac[NextPotCnt(prim)+1]; idx := Prim; end; inc(actNumber,prim); end; end; //next prime repeat inc(prim); until DivSumField^[prim]= 1;//(DivSumField[prim] = 1); end; //sieve with "big" primes, only one factor is possible while 2*prim <= MAX do begin InitPW(prim); Begin actNumber := prim; idx := PowerFac[0]; while actNumber <= MAX do begin DivSumField^[actNumber] *= idx; inc(actNumber,prim); end; end; repeat inc(prim); until DivSumField^[prim]= 1; end; For idx := 2 to MAX do dec(DivSumField^[idx],idx);end; var T2,T1,T0: TDatetime; APcnt: tValue; i: NativeInt;begin MAX := 20000; IF ParamCount > 0 then MAX := StrToInt(ParamStr(1)); setlength(ds,MAX); DivSumField := @ds[0]; T0:= time; For i := 1 to 1 do Begin Init; Sieve(2); end; T1:= time; APCnt := Check; T2:= time; AmPairOutput(APCnt); writeln(APCnt,' amicable pairs til ',MAX); writeln('Time to calc sum of divs ',FormatDateTime('HH:NN:SS.ZZZ' ,T1-T0)); writeln('Time to find amicable pairs ',FormatDateTime('HH:NN:SS.ZZZ' ,T2-T1)); setlength(ds,0); {$IFNDEF UNIX} readln; {$ENDIF}end.
output
220 284
[1,2,4,5,10,11,20,22,44,55,110]
[1,2,4,71,142]
1184 1210
[1,2,4,8,16,32,37,74,148,296,592]
[1,2,5,10,11,22,55,110,121,242,605]
2620 2924
[1,2,4,5,10,20,131,262,524,655,1310]
[1,2,4,17,34,43,68,86,172,731,1462]
5020 5564
[1,2,4,5,10,20,251,502,1004,1255,2510]
[1,2,4,13,26,52,107,214,428,1391,2782]
6232 6368
[1,2,4,8,19,38,41,76,82,152,164,328,779,1558,3116]
[1,2,4,8,16,32,199,398,796,1592,3184]
10744 10856
[1,2,4,8,17,34,68,79,136,158,316,632,1343,2686,5372]
[1,2,4,8,23,46,59,92,118,184,236,472,1357,2714,5428]
12285 14595
[1,3,5,7,9,13,15,21,27,35,39,45,63,65,91,105,117,135,189,195,273,315,351,455,585,819,945,1365,1755,2457,4095]
[1,3,5,7,15,21,35,105,139,417,695,973,2085,2919,4865]
17296 18416
[1,2,4,8,16,23,46,47,92,94,184,188,368,376,752,1081,2162,4324,8648]
[1,2,4,8,16,1151,2302,4604,9208]
8 amicable numbers up to 20000
00:00:00.000
.... Test with 524*1000*1000 Linux32, FPC 3.0.1, i4330 3.5 Ghz //Win32 swaps first to allocate 2 GB )
440 475838415 514823985 ratio 1.0819303
441 491373104 511419856 ratio 1.0407974
442 509379344 523679536 ratio 1.0280738
max ratio 1.3537
442 amicable pairs til 524000000
Time to calc sum of divs 00:00:12.601
Time to find amicable pairs 00:00:02.557
## Perl
Not particularly clever, but instant for this example, and does up to 20 million in 11 seconds.
Library: ntheory
use ntheory qw/divisor_sum/;for my $x (1..20000) { my$y = divisor_sum($x)-$x; say "$x$y" if $y >$x && $x == divisor_sum($y)-$y;} Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## Phix integer n for m=1 to 20000 do n = sum(factors(m,-1)) if m<n and m=sum(factors(n,-1)) then ?{m,n} end if end for Output: {220,284} {1184,1210} {2620,2924} {5020,5564} {6232,6368} {10744,10856} {12285,14595} {17296,18416} ## Phixmonti def sumDivs var n 1 var sum n sqrt 2 swap 2 tolist for var d n d mod not if sum d + n d / + var sum endif endfor sumenddef 2 20000 2 tolist for var i i sumDivs var m m i > if m sumDivs i == if i print "\t" print m print nl endif endifendfor nl msec print " s" print ## PHP <?php function sumDivs ($n) { $sum = 1; for ($d = 2; $d <= sqrt($n); $d++) { if ($n % $d == 0)$sum += $n /$d + $d; } return$sum;} for ($n = 2;$n < 20000; $n++) {$m = sumDivs($n); if ($m > $n) { if (sumDivs($m) == $n) echo$n." ".$m."<br />"; }} ?> Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## PicoLisp (de accud (Var Key) (if (assoc Key (val Var)) (con @ (inc (cdr @))) (push Var (cons Key 1)) ) Key )(de **sum (L) (let S 1 (for I (cdr L) (inc 'S (** (car L) I)) ) S ) )(de factor-sum (N) (if (=1 N) 0 (let (R NIL D 2 L (1 2 2 . (4 2 4 2 4 6 2 6 .)) M (sqrt N) N1 N S 1 ) (while (>= M D) (if (=0 (% N1 D)) (setq M (sqrt (setq N1 (/ N1 (accud 'R D)))) ) (inc 'D (pop 'L)) ) ) (accud 'R N1) (for I R (setq S (* S (**sum I))) ) (- S N) ) ) )(bench (for I 20000 (let X (factor-sum I) (and (< I X) (= I (factor-sum X)) (println I X) ) ) ) ) Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 0.101 sec ## PL/I Translation of: REXX *process source xref; ami: Proc Options(main); p9a=time(); Dcl (p9a,p9b,p9c) Pic'(9)9'; Dcl sumpd(20000) Bin Fixed(31); Dcl pd(300) Bin Fixed(31); Dcl npd Bin Fixed(31); Dcl (x,y) Bin Fixed(31); Do x=1 To 20000; Call proper_divisors(x,pd,npd); sumpd(x)=sum(pd,npd); End; p9b=time(); Put Edit('sum(pd) computed in',(p9b-p9a)/1000,' seconds elapsed') (Skip,col(7),a,f(6,3),a); Do x=1 To 20000; Do y=x+1 To 20000; If y=sumpd(x) & x=sumpd(y) Then Put Edit(x,y,' found after ',elapsed(),' seconds') (Skip,2(f(6)),a,f(6,3),a); End; End; Put Edit(elapsed(),' seconds total search time')(Skip,f(6,3),a); proper_divisors: Proc(n,pd,npd); Dcl (n,pd(300),npd) Bin Fixed(31); Dcl (d,delta) Bin Fixed(31); npd=0; If n>1 Then Do; If mod(n,2)=1 Then /* odd number */ delta=2; Else /* even number */ delta=1; Do d=1 To n/2 By delta; If mod(n,d)=0 Then Do; npd+=1; pd(npd)=d; End; End; End; End; sum: Proc(pd,npd) Returns(Bin Fixed(31)); Dcl (pd(300),npd) Bin Fixed(31); Dcl sum Bin Fixed(31) Init(0); Dcl i Bin Fixed(31); Do i=1 To npd; sum+=pd(i); End; Return(sum); End; elapsed: Proc Returns(Dec Fixed(6,3)); p9c=time(); Return((p9c-p9b)/1000); End; End; Output: sum(pd) computed in 0.510 seconds elapsed 220 284 found after 0.010 seconds 1184 1210 found after 0.060 seconds 2620 2924 found after 0.110 seconds 5020 5564 found after 0.210 seconds 6232 6368 found after 0.260 seconds 10744 10856 found after 2.110 seconds 12285 14595 found after 2.150 seconds 17296 18416 found after 2.240 seconds 2.250 seconds total search time ## PL/M 100H:/* CP/M CALLS */BDOS: PROCEDURE (FN, ARG); DECLARE FN BYTE, ARG ADDRESS; GO TO 5; END BDOS;EXIT: PROCEDURE; CALL BDOS(0,0); END EXIT;PRINT: PROCEDURE (S); DECLARE S ADDRESS; CALL BDOS(9,S); END PRINT; /* PRINT A NUMBER */PRINT$NUMBER: PROCEDURE (N); DECLARE S (6) BYTE INITIAL ('.....$'); DECLARE (N, P) ADDRESS, C BASED P BYTE; P = .S(5);DIGIT: P = P - 1; C = N MOD 10 + '0'; N = N / 10; IF N > 0 THEN GO TO DIGIT; CALL PRINT(P);END PRINT$NUMBER; /* CALCULATE SUMS OF PROPER DIVISORS */DECLARE DIV$SUM (20$001) ADDRESS;DECLARE (I, J) ADDRESS; DO I=2 TO 20$000; DIV$SUM(I) = 1; END;DO I=2 TO 10$000; DO J = I*2 TO 20$000 BY I; DIV$SUM(J) = DIV$SUM(J) + I; END;END; /* TEST EACH PAIR */DO I=2 TO 20$000; DO J=I+1 TO 20$000; IF DIV$SUM(I)=J AND DIV$SUM(J)=I THEN DO; CALL PRINT$NUMBER(I); CALL PRINT(.',$'); CALL PRINT$NUMBER(J); CALL PRINT(.(13,10,'$')); END; END;END; CALL EXIT;EOF
Output:
220, 284
1184, 1210
2620, 2924
5020, 5564
6232, 6368
10744, 10856
12285, 14595
17296, 18416
## PowerShell
Works with: PowerShell version 2
function Get-ProperDivisorSum ( [int]$N ) {$Sum = 1 If ( $N -gt 3 ) {$SqrtN = [math]::Sqrt( $N ) ForEach ($Divisor1 in 2..$SqrtN ) {$Divisor2 = $N /$Divisor1 If ( $Divisor2 -is [int] ) {$Sum += $Divisor1 +$Divisor2 } } If ( $SqrtN -is [int] ) {$Sum -= $SqrtN } } return$Sum } function Get-AmicablePairs ( $N = 300 ) { ForEach ($X in 1..$N ) {$Sum = Get-ProperDivisorSum $X If ($Sum -gt $X -and$X -eq ( Get-ProperDivisorSum $Sum ) ) { "$X, $Sum" } } } Get-AmicablePairs 20000 Output: 220, 284 1184, 1210 2620, 2924 5020, 5564 6232, 6368 10744, 10856 12285, 14595 17296, 18416 ## Prolog Works with: SWI-Prolog 7 With some guidance from other solutions here: divisor(N, Divisor) :- UpperBound is round(sqrt(N)), between(1, UpperBound, D), 0 is N mod D, ( Divisor = D ; LargerDivisor is N/D, LargerDivisor =\= D, Divisor = LargerDivisor ). proper_divisor(N, D) :- divisor(N, D), D =\= N. assoc_num_divsSum_in_range(Low, High, Assoc) :- findall( Num-DivSum, ( between(Low, High, Num), aggregate_all( sum(D), proper_divisor(Num, D), DivSum )), Pairs ), list_to_assoc(Pairs, Assoc). get_amicable_pair(Assoc, M-N) :- gen_assoc(M, Assoc, N), M < N, get_assoc(N, Assoc, M). amicable_pairs_under_20000(Pairs) :- assoc_num_divsSum_in_range(1,20000, Assoc), findall(P, get_amicable_pair(Assoc, P), Pairs). Output: ?- amicable_pairs_under_20000(R).R = [220-284, 1184-1210, 2620-2924, 5020-5564, 6232-6368, 10744-10856, 12285-14595, 17296-18416]. ## PureBasic EnableExplicit Procedure.i SumProperDivisors(Number) If Number < 2 : ProcedureReturn 0 : EndIf Protected i, sum = 0 For i = 1 To Number / 2 If Number % i = 0 sum + i EndIf Next ProcedureReturn sumEndProcedure Define n, fDefine Dim sum(19999) If OpenConsole() For n = 1 To 19999 sum(n) = SumProperDivisors(n) Next PrintN("The pairs of amicable numbers below 20,000 are : ") PrintN("") For n = 1 To 19998 f = sum(n) If f <= n Or f < 1 Or f > 19999 : Continue : EndIf If f = sum(n) And n = sum(f) PrintN(RSet(Str(n),5) + " and " + RSet(Str(sum(n)), 5)) EndIf Next PrintN("") PrintN("Press any key to close the console") Repeat: Delay(10) : Until Inkey() <> "" CloseConsole()EndIf Output: The pairs of amicable numbers below 20,000 are : 220 and 284 1184 and 1210 2620 and 2924 5020 and 5564 6232 and 6368 10744 and 10856 12285 and 14595 17296 and 18416 ## Python Importing Proper divisors from prime factors: from proper_divisors import proper_divs def amicable(rangemax=20000): n2divsum = {n: sum(proper_divs(n)) for n in range(1, rangemax + 1)} for num, divsum in n2divsum.items(): if num < divsum and divsum <= rangemax and n2divsum[divsum] == num: yield num, divsum if __name__ == '__main__': for num, divsum in amicable(): print('Amicable pair: %i and %i With proper divisors:\n %r\n %r' % (num, divsum, sorted(proper_divs(num)), sorted(proper_divs(divsum)))) Output: Amicable pair: 220 and 284 With proper divisors: [1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110] [1, 2, 4, 71, 142] Amicable pair: 1184 and 1210 With proper divisors: [1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592] [1, 2, 5, 10, 11, 22, 55, 110, 121, 242, 605] Amicable pair: 2620 and 2924 With proper divisors: [1, 2, 4, 5, 10, 20, 131, 262, 524, 655, 1310] [1, 2, 4, 17, 34, 43, 68, 86, 172, 731, 1462] Amicable pair: 5020 and 5564 With proper divisors: [1, 2, 4, 5, 10, 20, 251, 502, 1004, 1255, 2510] [1, 2, 4, 13, 26, 52, 107, 214, 428, 1391, 2782] Amicable pair: 6232 and 6368 With proper divisors: [1, 2, 4, 8, 19, 38, 41, 76, 82, 152, 164, 328, 779, 1558, 3116] [1, 2, 4, 8, 16, 32, 199, 398, 796, 1592, 3184] Amicable pair: 10744 and 10856 With proper divisors: [1, 2, 4, 8, 17, 34, 68, 79, 136, 158, 316, 632, 1343, 2686, 5372] [1, 2, 4, 8, 23, 46, 59, 92, 118, 184, 236, 472, 1357, 2714, 5428] Amicable pair: 12285 and 14595 With proper divisors: [1, 3, 5, 7, 9, 13, 15, 21, 27, 35, 39, 45, 63, 65, 91, 105, 117, 135, 189, 195, 273, 315, 351, 455, 585, 819, 945, 1365, 1755, 2457, 4095] [1, 3, 5, 7, 15, 21, 35, 105, 139, 417, 695, 973, 2085, 2919, 4865] Amicable pair: 17296 and 18416 With proper divisors: [1, 2, 4, 8, 16, 23, 46, 47, 92, 94, 184, 188, 368, 376, 752, 1081, 2162, 4324, 8648] [1, 2, 4, 8, 16, 1151, 2302, 4604, 9208] Or, supplying our own properDivisors function, and defining the harvest in terms of a generic concatMap: '''Amicable pairs''' from itertools import chainfrom math import sqrt # amicablePairsUpTo :: Int -> [(Int, Int)]def amicablePairsUpTo(n): '''List of all amicable pairs of integers below n. ''' sigma = compose(sum)(properDivisors) def amicable(x): y = sigma(x) return [(x, y)] if (x < y and x == sigma(y)) else [] return concatMap(amicable)( enumFromTo(1)(n) ) # TEST ----------------------------------------------------# main :: IO ()def main(): '''Amicable pairs of integers up to 20000''' for x in amicablePairsUpTo(20000): print(x) # GENERIC ------------------------------------------------- # compose (<<<) :: (b -> c) -> (a -> b) -> a -> cdef compose(g): '''Right to left function composition.''' return lambda f: lambda x: g(f(x)) # concatMap :: (a -> [b]) -> [a] -> [b]def concatMap(f): '''A concatenated list or string over which a function f has been mapped. The list monad can be derived by using an (a -> [b]) function which wraps its output in a list (using an empty list to represent computational failure). ''' return lambda xs: (''.join if isinstance(xs, str) else list)( chain.from_iterable(map(f, xs)) ) # enumFromTo :: Int -> Int -> [Int]def enumFromTo(m): '''Enumeration of integer values [m..n]''' def go(n): return list(range(m, 1 + n)) return lambda n: go(n) # properDivisors :: Int -> [Int]def properDivisors(n): '''Positive divisors of n, excluding n itself''' root_ = sqrt(n) intRoot = int(root_) blnSqr = root_ == intRoot lows = [x for x in range(1, 1 + intRoot) if 0 == n % x] return lows + [ n // x for x in reversed( lows[1:-1] if blnSqr else lows[1:] ) ] # MAIN ---if __name__ == '__main__': main() Output: (220, 284) (1184, 1210) (2620, 2924) (5020, 5564) (6232, 6368) (10744, 10856) (12285, 14595) (17296, 18416) ## Quackery properdivisors is defined at Proper divisors#Quackery. [ properdivisors dup size 0 = iff [ drop 0 ] done behead swap witheach + ] is spd ( n --> n ) [ dup dup spd dup spd rot = unrot > and ] is largeamicable ( n --> b ) [ [] swap times [ i^ largeamicable if [ i^ dup spd swap join nested join ] ] ] is amicables ( n --> [ ) 20000 amicables witheach [ witheach [ echo sp ] cr ] Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## R divisors <- function (n) { Filter( function (m) 0 == n %% m, 1:(n/2) )} table = sapply(1:19999, function (n) sum(divisors(n)) ) for (n in 1:19999) { m = table[n] if ((m > n) && (m < 20000) && (n == table[m])) cat(n, " ", m, "\n")} Output: 220 284 1184 1210 2620 2924 5020 5564 6232 6368 10744 10856 12285 14595 17296 18416 ## Racket With Proper_divisors#Racket in place: #lang racket(require "proper-divisors.rkt")(define SCOPE 20000) (define P (let ((P-v (vector))) (λ (n) (set! P-v (fold-divisors P-v n 0 +)) (vector-ref P-v n)))) ;; returns #f if not an amicable number, amicable pairing otherwise(define (amicable? n) (define m (P n)) (define m-sod (P m)) (and (= m-sod n) (< m n) ; each pair exactly once, also eliminates perfect numbers m)) (void (amicable? SCOPE)) ; prime the memoisation (for* ((n (in-range 1 (add1 SCOPE))) (m (in-value (amicable? n))) #:when m) (printf #<<EOSamicable pair: ~a, ~a ~a: divisors: ~a ~a: divisors: ~a EOS n m n (proper-divisors n) m (proper-divisors m))) Output: amicable pair: 284, 220 284: divisors: (1 2 4 71 142) 220: divisors: (1 2 4 5 10 11 20 22 44 55 110) amicable pair: 1210, 1184 1210: divisors: (1 2 5 10 11 22 55 110 121 242 605) 1184: divisors: (1 2 4 8 16 32 37 74 148 296 592) amicable pair: 2924, 2620 2924: divisors: (1 2 4 17 34 43 68 86 172 731 1462) 2620: divisors: (1 2 4 5 10 20 131 262 524 655 1310) amicable pair: 5564, 5020 5564: divisors: (1 2 4 13 26 52 107 214 428 1391 2782) 5020: divisors: (1 2 4 5 10 20 251 502 1004 1255 2510) amicable pair: 6368, 6232 6368: divisors: (1 2 4 8 16 32 199 398 796 1592 3184) 6232: divisors: (1 2 4 8 19 38 41 76 82 152 164 328 779 1558 3116) amicable pair: 10856, 10744 10856: divisors: (1 2 4 8 23 46 59 92 118 184 236 472 1357 2714 5428) 10744: divisors: (1 2 4 8 17 34 68 79 136 158 316 632 1343 2686 5372) amicable pair: 14595, 12285 14595: divisors: (1 3 5 7 15 21 35 105 139 417 695 973 2085 2919 4865) 12285: divisors: (1 3 5 7 9 13 15 21 27 35 39 45 63 65 91 105 117 135 189 195 273 315 351 455 585 819 945 1365 1755 2457 4095) amicable pair: 18416, 17296 18416: divisors: (1 2 4 8 16 1151 2302 4604 9208) 17296: divisors: (1 2 4 8 16 23 46 47 92 94 184 188 368 376 752 1081 2162 4324 8648) ## Raku (formerly Perl 6) Works with: Rakudo version 2019.03.1 sub propdivsum (\x) { my @l = 1 if x > 1; (2 .. x.sqrt.floor).map: -> \d { unless x % d { @l.push: d; my \y = x div d; @l.push: y if y != d } } sum @l} (1..20000).race.map: ->$i { my $j = propdivsum($i); say "$i$j" if $j >$i and $i == propdivsum($j);}
Output:
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416
## REBOL
;- based on Lua code ;-) sum-of-divisors: func[n /local sum][ sum: 1 ; using to-integer for compatibility with Rebol2 for d 2 (to-integer square-root n) 1 [ if 0 = remainder n d [ sum: n / d + sum + d ] ] sum] for n 2 20000 1 [ if n < m: sum-of-divisors n [ if n = sum-of-divisors m [ print [n tab m] ] ]]
Output:
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416
## REXX
### version 1, with factoring
/*REXX*/ Call time 'R'Do x=1 To 20000 pd=proper_divisors(x) sumpd.x=sum(pd) EndSay 'sum(pd) computed in' time('E') 'seconds'Call time 'R'Do x=1 To 20000 /* If x//1000=0 Then Say x time() */ Do y=x+1 To 20000 If y=sumpd.x &, x=sumpd.y Then Say x y 'found after' time('E') 'seconds' End EndSay time('E') 'seconds total search time'Exit proper_divisors: ProcedureParse Arg nPd=''If n=1 Then Return ''If n//2=1 Then /* odd number */ delta=2Else /* even number */ delta=1Do d=1 To n%2 By delta If n//d=0 Then pd=pd d EndReturn space(pd) sum: ProcedureParse Arg listsum=0Do i=1 To words(list) sum=sum+word(list,i) EndReturn sum
Output:
sum(pd) computed in 48.502000 seconds
220 284 found after 3.775000 seconds
1184 1210 found after 21.611000 seconds
2620 2924 found after 46.817000 seconds
5020 5564 found after 84.296000 seconds
6232 6368 found after 100.918000 seconds
10744 10856 found after 150.126000 seconds
12285 14595 found after 162.124000 seconds
17296 18416 found after 185.600000 seconds
188.836000 seconds total search time
### version 2, using SIGMA function
This REXX version allows the specification of the upper limit (for the searching of amicable pairs).
Some optimization was incorporated by using a sigma function, which was a re-coded proper divisors (Pdivs) function,
which was taken from the REXX language entry for Rosetta Code task integer factors.
Other optimizations were incorporated which took advantage of several well-known generalizations about amicable pairs.
The generation/summation is about 5,000% times faster than the 1st REXX version; searching is about 10,000% times faster.
CPU time consumption note: for every doubling of H (the upper limit for searches), the CPU time consumed triples.
/*REXX program calculates and displays all amicable pairs up to a given number. */parse arg H .; if H=='' | H=="," then H= 20000 /*get optional arguments (high limit).*/w= length(H) ; low= 220 /*W: used for columnar output alignment*/@.=. /* [↑] LOW is lowest amicable number. */ do k=low for H-low; _= sigma(k) /*generate sigma sums for a range of #s*/ if _>=low then @.k= _ /*only keep the pertinent sigma sums. */ end /*k*/ /* [↑] process a range of integers. */#= 0 /*number of amicable pairs found so far*/ do m=low to H; n= @.m /*start the search at the lowest number*/ if [email protected].n then do /*If equal, might be an amicable number*/ if m==n then iterate /*Is this a perfect number? Then skip.*/ #= # + 1 /*bump the amicable pair counter. */ say right(m,w) ' and ' right(n,w) " are an amicable pair." m= n /*start M (DO index) from N. */ end end /*m*/saysay # ' amicable pairs found up to ' H /*display count of the amicable pairs. */exit /*stick a fork in it, we're all done. *//*──────────────────────────────────────────────────────────────────────────────────────*/sigma: procedure; parse arg x; od= x // 2 /*use either EVEN or ODD integers. */ s= 1 /*set initial sigma sum to unity. ___*/ do j=2+od by 1+od while j*j<x /*divide by all integers up to the √ X */ if x//j==0 then s= s + j + x%j /*add the two divisors to the sum. */ end /*j*/ /* [↑] % is REXX integer division. */ /* ___ */ if j*j==x then return s + j /*Was X a square? If so, add √ X */ return s /*return (sigma) sum of the divisors. */
output when using the default input:
220 and 284 are an amicable pair.
1184 and 1210 are an amicable pair.
2620 and 2924 are an amicable pair.
5020 and 5564 are an amicable pair.
6232 and 6368 are an amicable pair.
10744 and 10856 are an amicable pair.
12285 and 14595 are an amicable pair.
17296 and 18416 are an amicable pair.
8 amicable pairs found up to 20000
### version 3, SIGMA with limited searches
This REXX version is optimized to take advantage of the lowest ending-single-digit amicable number, and
also incorporates the search of amicable numbers into the generation of the sigmas of the integers.
The optimization makes it about another 30% faster when searching for amicable numbers up to one million.
/*REXX program calculates and displays all amicable pairs up to a given number. */parse arg H .; if H=='' | H=="," then H=20000 /*get optional arguments (high limit).*/w=length(H) ; low=220 /*W: used for columnar output alignment*/x= 220 34765731 6232 87633 284 12285 10856 36939357 6368 5684679 /*S minimums.*/ do i=0 for 10; $.i= word(x, i + 1); end /*minimum amicable #s for last dec dig.*/@.= /* [↑] LOW is lowest amicable number. */#= 0 /*number of amicable pairs found so far*/ do k=low for H-low /*generate sigma sums for a range of #s*/ parse var k '' -1 D /*obtain last decimal digit of K. */ if k<$.D then iterate /*if no need to compute, then skip it. */ _= sigma(k) /*generate sigma sum for the number K.*/ @.k= _ /*only keep the pertinent sigma sums. */ if [email protected]._ then do /*is it a possible amicable number ? */ if _==k then iterate /*Is it a perfect number? Then skip it*/ #= # + 1 /*bump the amicable pair counter. */ say right(_, w) ' and ' right(k, w) " are an amicable pair." end end /*k*/ /* [↑] process a range of integers. */saysay # 'amicable pairs found up to' H /*display the count of amicable pairs. */exit /*stick a fork in it, we're all done. *//*──────────────────────────────────────────────────────────────────────────────────────*/sigma: procedure; parse arg x; od= x // 2 /*use either EVEN or ODD integers. */ s= 1 /*set initial sigma sum to unity. ___*/ do j=2+od by 1+od while j*j<x /*divide by all integers up to the √ x */ if x//j==0 then s= s + j + x%j /*add the two divisors to the sum. */ end /*j*/ /* [↑] % is REXX integer division. */ /* ___ */ if j*j==x then return s + j /*Was X a square? If so, add √ X */ return s /*return (sigma) sum of the divisors. */
output is identical to the 2nd REXX version.
### version 4, SIGMA using integer SQRT
This REXX version is optimized to use the integer square root of X in the sigma function (instead of
computing the square of J to see if that value exceeds X).
The optimization makes it about another 20% faster when searching for amicable numbers up to one million.
/*REXX program calculates and displays all amicable pairs up to a given number. */parse arg H .; if H=='' | H=="," then H=20000 /*get optional arguments (high limit).*/w= length(H) ; low= 220 /*W: used for columnar output alignment*/x= 220 34765731 6232 87633 284 12285 10856 36939357 6368 5684679 /*S minimums.*/ do i=0 for 10; $.i= word(x, i + 1); end /*minimum amicable #s for last dec dig.*/@.= /* [↑] LOW is lowest amicable number. */#= 0 /*number of amicable pairs found so far*/ do k=low for H-low /*generate sigma sums for a range of #s*/ parse var k '' -1 D /*obtain last decimal digit of K. */ if k<$.D then iterate /*if no need to compute, then skip it. */ _= sigma(k) /*generate sigma sum for the number K.*/ @.k= _ /*only keep the pertinent sigma sums. */ if [email protected]._ then do /*is it a possible amicable number ? */ if _==k then iterate /*Is it a perfect number? Then skip it*/ #= # + 1 /*bump the amicable pair counter. */ say right(_, w) ' and ' right(k, w) " are an amicable pair." end end /*k*/ /* [↑] process a range of integers. */saysay # 'amicable pairs found up to' H /*display the count of amicable pairs. */exit /*stick a fork in it, we're all done. *//*──────────────────────────────────────────────────────────────────────────────────────*/iSqrt: procedure; parse arg x; r= 0; q= 1; do while q<=x; q= q * 4; end do while q>1; q=q%4; _=x-r-q; r=r%2; if _>=0 then do;x=_;r=r+q; end; end return r/*──────────────────────────────────────────────────────────────────────────────────────*/sigma: procedure; parse arg x; od= x // 2 /*use either EVEN or ODD integers. */ s= 1 /*set initial sigma sum to unity. ___*/ do j=2+od by 1+od to iSqrt(x) /*divide by all integers up to the √ x */ if x//j==0 then s= s + j + x%j /*add the two divisors to the sum. */ end /*j*/ /* [↑] % is the REXX integer division.*/ /* ___ */ if j*j==x then return s + j /*Was X a square? If so, add √ X */ return s /*return (sigma) sum of the divisors. */
output is identical to the 2nd REXX version.
### version 5, SIGMA (in-line code)
This REXX version is optimized by bringing the functions in-line (which minimizes the overhead of invoking two
internal functions), and it also pre-computes the powers of four (for the integer square root code).
This method of coding has the disadvantage in that the code (logic) is less idiomatic and therefore less readable.
The optimization makes it about another 15% faster when searching for amicable numbers up to one million.
/*REXX program calculates and displays all amicable pairs up to a given number. */parse arg H .; if H=='' | H=="," then H=20000 /*get optional arguments (high limit).*/w= length(H) ; low= 220 /*W: used for columnar output alignment*/x= 220 34765731 6232 87633 284 12285 10856 36939357 6368 5684679 /*S minimums.*/ do i=0 for 10; $.i= word(x, i + 1); end /*minimum amicable #s for last dec dig.*/@.= /* [↑] LOW is lowest amicable number. */#= 0 /*number of amicable pairs found so far*/ do k=low for H-low /*generate sigma sums for a range of #s*/ parse var k '' -1 D /*obtain last decimal digit of K. */ if k<$.D then iterate /*if no need to compute, then skip it. */ _= sigma(k) /*generate sigma sum for the number K.*/ @.k= _ /*only keep the pertinent sigma sums. */ if [email protected]._ then do /*is it a possible amicable number ? */ if _==k then iterate /*Is it a perfect number? Then skip it*/ #= # + 1 /*bump the amicable pair counter. */ say right(_, w) ' and ' right(k, w) " are an amicable pair." end end /*k*/ /* [↑] process a range of integers. */saysay # 'amicable pairs found up to' H /*display the count of amicable pairs. */exit /*stick a fork in it, we're all done. *//*──────────────────────────────────────────────────────────────────────────────────────*/iSqrt: procedure; parse arg x; r= 0; q= 1; do while q<=x; q= q * 4; end do while q>1; q=q%4; _=x-r-q; r=r%2; if _>=0 then do;x=_;r=r+q; end; end return r/*──────────────────────────────────────────────────────────────────────────────────────*/sigma: procedure; parse arg x; od= x // 2 /*use either EVEN or ODD integers. */ s= 1 /*set initial sigma sum to unity. ___*/ do j=2+od by 1+od to iSqrt(x) /*divide by all integers up to the √ x */ if x//j==0 then s= s + j + x%j /*add the two divisors to the sum. */ end /*j*/ /* [↑] % is the REXX integer division.*/ /* ___ */ if j*j==x then return s + j /*Was X a square? If so, add √ X */ return s /*return (sigma) sum of the divisors. */
output is identical to the 2nd REXX version.
## Ring
size = 18500for n = 1 to size m = amicable(n) if m>n and amicable(m)=n see "" + n + " and " + m + nl oknextsee "OK" + nl func amicable nr sum = 1 for d = 2 to sqrt(nr) if nr % d = 0 sum = sum + d sum = sum + nr / d ok next return sum
## Ruby
With proper_divisors#Ruby in place:
h = {}(1..20_000).each{|n| h[n] = n.proper_divisors.sum }h.select{|k,v| h[v] == k && k < v}.each do |key,val| # k<v filters out doubles and perfects puts "#{key} and #{val}"end
Output:
220 and 284
1184 and 1210
2620 and 2924
5020 and 5564
6232 and 6368
10744 and 10856
12285 and 14595
17296 and 18416
## Run BASIC
size = 18500for n = 1 to size m = amicable(n) if m > n and amicable(m) = n then print n ; " and " ; mnext function amicable(nr) amicable = 1 for d = 2 to sqr(nr) if nr mod d = 0 then amicable = amicable + d + nr / d next end function
220 and 284
1184 and 1210
2620 and 2924
5020 and 5564
6232 and 6368
10744 and 10856
12285 and 14595
17296 and 18416
## Rust
fn sum_of_divisors(val: u32) -> u32 { (1..val/2+1).filter(|n| val % n == 0) .fold(0, |sum, n| sum + n)} fn main() { let iter = (1..20_000).map(|i| (i, sum_of_divisors(i))) .filter(|&(i, div_sum)| i > div_sum); for (i, sum1) in iter { if sum_of_divisors(sum1) == i { println!("{} {}", i, sum1); } }}
Output:
284 220
1210 1184
2924 2620
5564 5020
6368 6232
10856 10744
14595 12285
18416 17296
## Scala
def properDivisors(n: Int) = (1 to n/2).filter(i => n % i == 0)val divisorsSum = (1 to 20000).map(i => i -> properDivisors(i).sum).toMapval result = divisorsSum.filter(v => v._1 < v._2 && divisorsSum.get(v._2) == Some(v._1)) println( result mkString ", " )
Output:
5020 -> 5564, 220 -> 284, 6232 -> 6368, 17296 -> 18416, 2620 -> 2924, 10744 -> 10856, 12285 -> 14595, 1184 -> 1210
## Scheme
(import (scheme base) (scheme inexact) (scheme write) (only (srfi 1) fold)) ;; return a list of the proper-divisors of n(define (proper-divisors n) (let ((root (sqrt n))) (let loop ((divisors (list 1)) (i 2)) (if (> i root) divisors (loop (if (zero? (modulo n i)) (if (= (square i) n) (cons i divisors) (append (list i (quotient n i)) divisors)) divisors) (+ 1 i)))))) (define (sum-proper-divisors n) (if (< n 2) 0 (fold + 0 (proper-divisors n)))) (define *max-n* 20000) ;; hold sums of proper divisors in a cache, to avoid recalculating(define *cache* (make-vector (+ 1 *max-n*)))(for-each (lambda (i) (vector-set! *cache* i (sum-proper-divisors i))) (iota *max-n* 1)) (define (amicable-pair? i j) (and (not (= i j)) (= i (vector-ref *cache* j)) (= j (vector-ref *cache* i)))) ;; double loop to *max-n*, displaying all amicable pairs(let loop-i ((i 1)) (when (<= i *max-n*) (let loop-j ((j i)) (when (<= j *max-n*) (when (amicable-pair? i j) (display (string-append "Amicable pair: " (number->string i) " " (number->string j))) (newline)) (loop-j (+ 1 j)))) (loop-i (+ 1 i))))
Output:
Amicable pair: 220 284
Amicable pair: 1184 1210
Amicable pair: 2620 2924
Amicable pair: 5020 5564
Amicable pair: 6232 6368
Amicable pair: 10744 10856
Amicable pair: 12285 14595
Amicable pair: 17296 18416
## Sidef
func propdivsum(n) { n.sigma - n} for i in (1..20000) { var j = propdivsum(i) say "#{i} #{j}" if (j>i && i==propdivsum(j))}
Output:
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416
## Swift
import func Darwin.sqrt func sqrt(x:Int) -> Int { return Int(sqrt(Double(x))) } func properDivs(n: Int) -> [Int] { if n == 1 { return [] } var result = [Int]() for div in filter (1...sqrt(n), { n % $0 == 0 }) { result.append(div) if n/div != div && n/div != n { result.append(n/div) } } return sorted(result) } func sumDivs(n:Int) -> Int { struct Cache { static var sum = [Int:Int]() } if let sum = Cache.sum[n] { return sum } let sum = properDivs(n).reduce(0) {$0 + $1 } Cache.sum[n] = sum return sum} func amicable(n:Int, m:Int) -> Bool { if n == m { return false } if sumDivs(n) != m || sumDivs(m) != n { return false } return true} var pairs = [(Int, Int)]() for n in 1 ..< 20_000 { for m in n+1 ... 20_000 { if amicable(n, m) { pairs.append(n, m) println("\(n, m)") } }} ### Alternative about 800 times faster. import func Darwin.sqrt func sqrt(x:Int) -> Int { return Int(sqrt(Double(x))) } func sigma(n: Int) -> Int { if n == 1 { return 0 } // definition of aliquot sum var result = 1 let root = sqrt(n) for var div = 2; div <= root; ++div { if n % div == 0 { result += div + n/div } } if root*root == n { result -= root } return (result)} func amicables (upTo: Int) -> () { var aliquot = Array(count: upTo+1, repeatedValue: 0) for i in 1 ... upTo { // fill lookup array aliquot[i] = sigma(i) } for i in 1 ... upTo { let a = aliquot[i] if a > upTo {continue} //second part of pair out-of-bounds if a == i {continue} //skip perfect numbers if i == aliquot[a] { print("\(i, a)") aliquot[a] = upTo+1 //prevent second display of pair } }} amicables(20_000) Output: (220, 284) (1184, 1210) (2620, 2924) (5020, 5564) (6232, 6368) (10744, 10856) (12285, 14595) (17296, 18416) ## tbas dim sums(20000) sub sum_proper_divisors(n) dim sum = 0 dim i if n > 1 then for i = 1 to (n \ 2) if n %% i = 0 then sum = sum + i end if next end if return sumend sub dim i, jfor i = 1 to 20000 sums(i) = sum_proper_divisors(i) for j = i-1 to 2 by -1 if sums(i) = j and sums(j) = i then print "Amicable pair:";sums(i);"-";sums(j) exit for end if next next >tbas amicable_pairs.bas Amicable pair: 220 - 284 Amicable pair: 1184 - 1210 Amicable pair: 2620 - 2924 Amicable pair: 5020 - 5564 Amicable pair: 6232 - 6368 Amicable pair: 10744 - 10856 Amicable pair: 12285 - 14595 Amicable pair: 17296 - 18416 ## Tcl proc properDivisors {n} { if {$n == 1} return set divs 1 set sum 1 for {set i 2} {$i*$i <= $n} {incr i} { if {!($n % $i)} { lappend divs$i incr sum $i if {$i*$i <$n} { lappend divs [set d [expr {$n /$i}]] incr sum $d } } } return [list$sum $divs]} proc amicablePairs {limit} { set result {} set sums [set divs {{}}] for {set n 1} {$n < $limit} {incr n} { lassign [properDivisors$n] sum d lappend sums $sum lappend divs [lsort -integer$d] } for {set n 1} {$n <$limit} {incr n} { set nsum [lindex $sums$n] for {set m 1} {$m <$n} {incr m} { if {$n==[lindex$sums $m] &&$m==$nsum} { lappend result$m $n [lindex$divs $m] [lindex$divs $n] } } } return$result} foreach {m n md nd} [amicablePairs 20000] { puts "$m and$n are an amicable pair with these proper divisors" puts "\t$m :$md" puts "\t$n :$nd"}
Output:
220 and 284 are an amicable pair with these proper divisors
220 : 1 2 4 5 10 11 20 22 44 55 110
284 : 1 2 4 71 142
1184 and 1210 are an amicable pair with these proper divisors
1184 : 1 2 4 8 16 32 37 74 148 296 592
1210 : 1 2 5 10 11 22 55 110 121 242 605
2620 and 2924 are an amicable pair with these proper divisors
2620 : 1 2 4 5 10 20 131 262 524 655 1310
2924 : 1 2 4 17 34 43 68 86 172 731 1462
5020 and 5564 are an amicable pair with these proper divisors
5020 : 1 2 4 5 10 20 251 502 1004 1255 2510
5564 : 1 2 4 13 26 52 107 214 428 1391 2782
6232 and 6368 are an amicable pair with these proper divisors
6232 : 1 2 4 8 19 38 41 76 82 152 164 328 779 1558 3116
6368 : 1 2 4 8 16 32 199 398 796 1592 3184
10744 and 10856 are an amicable pair with these proper divisors
10744 : 1 2 4 8 17 34 68 79 136 158 316 632 1343 2686 5372
10856 : 1 2 4 8 23 46 59 92 118 184 236 472 1357 2714 5428
12285 and 14595 are an amicable pair with these proper divisors
12285 : 1 3 5 7 9 13 15 21 27 35 39 45 63 65 91 105 117 135 189 195 273 315 351 455 585 819 945 1365 1755 2457 4095
14595 : 1 3 5 7 15 21 35 105 139 417 695 973 2085 2919 4865
17296 and 18416 are an amicable pair with these proper divisors
17296 : 1 2 4 8 16 23 46 47 92 94 184 188 368 376 752 1081 2162 4324 8648
18416 : 1 2 4 8 16 1151 2302 4604 9208
## Transd
#lang transd MainModule : { _start: (lambda (with sum 0 d 0 f Filter( from: 1 to: 20000 apply: (lambda (= sum 1) (for i in Range(2 (to-Int (sqrt @it))) do (if (not (mod @it i)) (= d (/ @it i)) (+= sum i) (if (neq d i) (+= sum d)))) (ret sum))) (with v (to-vector f) (for i in v do (if (and (< i (size v)) (eq (+ @idx 1) (get v (- i 1))) (< i (get v (- i 1)))) (textout (+ @idx 1) ", " i "\n") )))))}
Output:
284, 220
1210, 1184
2924, 2620
5564, 5020
6368, 6232
10856, 10744
14595, 12285
18416, 17296
## uBasic/4tH
Input "Limit: ";lPrint "Amicable pairs < ";l For n = 1 To l m = FUNC(_SumDivisors (n))-n If m = 0 Then Continue ' No division by zero, please p = FUNC(_SumDivisors (m))-m If (n=p) * (n<m) Then Print n;" and ";mNext End _LeastPower Param(2) Local(1) [email protected] = [email protected] Do While ([email protected] % [email protected]) = 0 [email protected] = [email protected] * [email protected] Loop Return ([email protected]) ' Return the sum of the proper divisors of [email protected] _SumDivisors Param(1) Local(4) [email protected] = [email protected] [email protected] = 1 ' Handle two specially [email protected] = FUNC(_LeastPower (2,[email protected])) [email protected] = [email protected] * ([email protected] - 1) [email protected] = [email protected] / ([email protected] / 2) ' Handle odd factors For [email protected] = 3 Step 2 While ([email protected]*[email protected]) < ([email protected]+1) [email protected] = FUNC(_LeastPower ([email protected],[email protected])) [email protected] = [email protected] * (([email protected] - 1) / ([email protected] - 1)) [email protected] = [email protected] / ([email protected] / [email protected]) Loop ' At this point, t must be one or prime If ([email protected] > 1) [email protected] = [email protected] * ([email protected]+1)Return ([email protected])
Output:
Limit: 20000
Amicable pairs < 20000
220 and 284
1184 and 1210
2620 and 2924
5020 and 5564
6232 and 6368
10744 and 10856
12285 and 14595
17296 and 18416
0 OK, 0:238
## UTFool
···http://rosettacode.org/wiki/Amicable_pairs···■ AmicablePairs § static ▶ main • args⦂ String[] ∀ n ∈ 1…20000 m⦂ int: sumPropDivs n if m < n = sumPropDivs m System.out.println "⸨m⸩ ; ⸨n⸩" ▶ sumPropDivs⦂ int • n⦂ int m⦂ int: 1 ∀ i ∈ √n ⋯> 1 m +: n \ i = 0 ? i + (i = n / i ? 0 ! n / i) ! 0 ⏎ m
## VBA
Option Explicit Public Sub AmicablePairs()Dim a(2 To 20000) As Long, c As New Collection, i As Long, j As Long, t# t = Timer For i = LBound(a) To UBound(a) 'collect the sum of the proper divisors 'of each numbers between 2 and 20000 a(i) = S(i) Next 'Double Loops to test the amicable For i = LBound(a) To UBound(a) For j = i + 1 To UBound(a) If i = a(j) Then If a(i) = j Then On Error Resume Next c.Add i & " : " & j, CStr(i * j) On Error GoTo 0 Exit For End If End If Next Next 'End. Return : Debug.Print "Execution Time : " & Timer - t & " seconds." Debug.Print "Amicable pairs below 20 000 are : " For i = 1 To c.Count Debug.Print c.Item(i) Next iEnd Sub Private Function S(n As Long) As Long'returns the sum of the proper divisors of nDim j As Long For j = 1 To n \ 2 If n Mod j = 0 Then S = j + S NextEnd Function
Output:
Execution Time : 7,95703125 seconds.
Amicable pairs below 20 000 are :
220 : 284
1184 : 1210
2620 : 2924
5020 : 5564
6232 : 6368
10744 : 10856
12285 : 14595
17296 : 18416
## VBScript
Not at all optimal. :-(
start = NowSet nlookup = CreateObject("Scripting.Dictionary")Set uniquepair = CreateObject("Scripting.Dictionary") For i = 1 To 20000 sum = 0 For n = 1 To 20000 If n < i Then If i Mod n = 0 Then sum = sum + n End If End If Next nlookup.Add i,sumNext For j = 1 To 20000 sum = 0 For m = 1 To 20000 If m < j Then If j Mod m = 0 Then sum = sum + m End If End If Next If nlookup.Exists(sum) And nlookup.Item(sum) = j And j <> sum _ And uniquepair.Exists(sum) = False Then uniquepair.Add j,sum End IfNext For Each key In uniquepair.Keys WScript.Echo key & ":" & uniquepair.Item(key)Next WScript.Echo "Execution Time: " & DateDiff("s",Start,Now) & " seconds"
Output:
220:284
1184:1210
2620:2924
5020:5564
6232:6368
10744:10856
12285:14595
17296:18416
Execution Time: 162 seconds
## Wren
Library: Wren-fmt
Library: Wren-math
import "/fmt" for Fmtimport "/math" for Int, Nums var a = List.filled(20000, 0)for (i in 1...20000) a[i] = Nums.sum(Int.properDivisors(i))System.print("The amicable pairs below 20,000 are:")for (n in 2...19999) { var m = a[n] if (m > n && m < 20000 && n == a[m]) { System.print(" %(Fmt.d(5, n)) and %(Fmt.d(5, m))") }}
Output:
The amicable pairs below 20,000 are:
220 and 284
1184 and 1210
2620 and 2924
5020 and 5564
6232 and 6368
10744 and 10856
12285 and 14595
17296 and 18416
## Yabasic
Translation of: Lua
sub sumDivs(n) local sum, d sum = 1 for d = 2 to sqrt(n) if not mod(n, d) then sum = sum + d sum = sum + n / d end if next return sumend sub for n = 2 to 20000 m = sumDivs(n) if m > n then if sumDivs(m) = n print n, "\t", m end ifnext print : print peek("millisrunning"), " ms"
## zkl
Slooooow
fcn properDivs(n){ [1.. (n + 1)/2 + 1].filter('wrap(x){ n%x==0 and n!=x }) }const N=20000;sums:=[1..N].pump(T(-1),fcn(n){ properDivs(n).sum(0) });[0..].zip(sums).filter('wrap([(n,s)]){ (n<s<=N) and sums[s]==n }).println();
Output:
L(L(220,284),L(1184,1210),L(2620,2924),L(5020,5564),L(6232,6368),L(10744,10856),L(12285,14595),L(17296,18416))
## Zig
const MAXIMUM: u32 = 20_000; // Fill up a given array with arr[n] = sum(propDivs(n))pub fn calcPropDivs(divs: []u32) void { for (divs) |*d| d.* = 1; var i: u32 = 2; while (i <= divs.len/2) : (i += 1) { var j = i * 2; while (j < divs.len) : (j += i) divs[j] += i; }} // Are (A, B) an amicable pair?pub fn amicable(divs: []const u32, a: u32, b: u32) bool { return divs[a] == b and a == divs[b];} pub fn main() !void { const stdout = @import("std").io.getStdOut().writer(); var divs: [MAXIMUM + 1]u32 = undefined; calcPropDivs(divs[0..]); var a: u32 = 1; while (a < divs.len) : (a += 1) { var b = a+1; while (b < divs.len) : (b += 1) { if (amicable(divs[0..], a, b)) try stdout.print("{d}, {d}\n", .{a, b}); } }}
Output:
220, 284
1184, 1210
2620, 2924
5020, 5564
6232, 6368
10744, 10856
12285, 14595
17296, 18416
## ZX Spectrum Basic
Translation of: AWK
10 LET limit=2000020 PRINT "Amicable pairs < ";limit30 FOR n=1 TO limit40 LET num=n: GO SUB 100050 LET m=num60 GO SUB 100070 IF n=num AND n<m THEN PRINT n;" ";m80 NEXT n90 STOP 1000 REM sumprop1010 IF num<2 THEN LET num=0: RETURN 1020 LET sum=11030 LET root=SQR num1040 FOR i=2 TO root-.011050 IF num/i=INT (num/i) THEN LET sum=sum+i+num/i1060 NEXT i1070 IF num/root=INT (num/root) THEN LET sum=sum+root1080 LET num=sum1090 RETURN
Output:
Amicable pairs < 20000
220 284
1184 1210
2620 2924
5020 5564
6232 6368
10744 10856
12285 14595
17296 18416` | 41,956 | 119,049 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 7, "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} | 3.34375 | 3 | CC-MAIN-2021-31 | latest | en | 0.662778 |
https://fred.stlouisfed.org/data/CGPDUW1619.txt | 1,701,456,511,000,000,000 | text/plain | crawl-data/CC-MAIN-2023-50/segments/1700679100304.52/warc/CC-MAIN-20231201183432-20231201213432-00722.warc.gz | 322,510,710 | 1,830 | Title: Unemployment Level - College Graduates - Professional Degree, 16 to 19 years, Women Series ID: CGPDUW1619 Source: U.S. Bureau of Labor Statistics Release: Employment Situation Seasonal Adjustment: Not Seasonally Adjusted Frequency: Monthly Units: Thousands of Persons Date Range: 2012-02-01 to 2021-01-01 Last Updated: 2021-02-05 1:54 PM CST Notes: People are classified as unemployed if they meet all of the following criteria: they had no employment during the reference week; they were available for work at that time; and they made specific efforts to find employment sometime during the 4-week period ending with the reference week. Persons laid off from a job and expecting recall need not be looking for work to be counted as unemployed. The unemployment data derived from the household survey in no way depend upon the eligibility for or receipt of unemployment insurance benefits. To obtain estimates of women worker employment, the ratio of weighted women employees to the weighted all employees in the sample is assumed to equal the same ratio in the universe. The current month's women worker ratio, thus, is estimated and then multiplied by the all-employee estimate. The weighted-difference-link-and-taper formula (described in the source) is used to estimate the current month's women worker ratio. This formula adds the change in the matched sample's women worker ratio (the weighted-difference link) to the prior month's estimate, which has been slightly modified to reflect changes in the sample composition (the taper). DATE VALUE 2012-02-01 1 2012-03-01 . 2012-04-01 . 2012-05-01 . 2012-06-01 . 2012-07-01 . 2012-08-01 . 2012-09-01 . 2012-10-01 . 2012-11-01 . 2012-12-01 . 2013-01-01 . 2013-02-01 . 2013-03-01 . 2013-04-01 . 2013-05-01 . 2013-06-01 . 2013-07-01 . 2013-08-01 . 2013-09-01 . 2013-10-01 . 2013-11-01 . 2013-12-01 . 2014-01-01 . 2014-02-01 . 2014-03-01 . 2014-04-01 . 2014-05-01 . 2014-06-01 . 2014-07-01 . 2014-08-01 . 2014-09-01 . 2014-10-01 . 2014-11-01 . 2014-12-01 . 2015-01-01 . 2015-02-01 . 2015-03-01 . 2015-04-01 . 2015-05-01 . 2015-06-01 . 2015-07-01 . 2015-08-01 . 2015-09-01 . 2015-10-01 . 2015-11-01 . 2015-12-01 . 2016-01-01 . 2016-02-01 . 2016-03-01 . 2016-04-01 . 2016-05-01 . 2016-06-01 . 2016-07-01 . 2016-08-01 . 2016-09-01 . 2016-10-01 . 2016-11-01 . 2016-12-01 . 2017-01-01 . 2017-02-01 . 2017-03-01 . 2017-04-01 . 2017-05-01 . 2017-06-01 . 2017-07-01 . 2017-08-01 . 2017-09-01 . 2017-10-01 . 2017-11-01 . 2017-12-01 . 2018-01-01 . 2018-02-01 . 2018-03-01 . 2018-04-01 . 2018-05-01 . 2018-06-01 . 2018-07-01 . 2018-08-01 . 2018-09-01 . 2018-10-01 . 2018-11-01 . 2018-12-01 . 2019-01-01 . 2019-02-01 . 2019-03-01 . 2019-04-01 . 2019-05-01 . 2019-06-01 . 2019-07-01 . 2019-08-01 . 2019-09-01 . 2019-10-01 . 2019-11-01 . 2019-12-01 . 2020-01-01 . 2020-02-01 . 2020-03-01 . 2020-04-01 . 2020-05-01 . 2020-06-01 . 2020-07-01 . 2020-08-01 . 2020-09-01 . 2020-10-01 . 2020-11-01 . 2020-12-01 5 2021-01-01 5 | 1,189 | 2,960 | {"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} | 2.65625 | 3 | CC-MAIN-2023-50 | latest | en | 0.861172 |
https://support.sisense.com/hc/en-us/community/posts/360029272414-Subtotals-calculations?sort_by=votes | 1,580,274,619,000,000,000 | text/html | crawl-data/CC-MAIN-2020-05/segments/1579251788528.85/warc/CC-MAIN-20200129041149-20200129071149-00102.warc.gz | 673,860,420 | 10,104 | • Hi Regina,
The default option is Auto, which aggregates all the data. This is described more in depth in this document. The other custom options (Sum, Min, Max, etc.) calculate only the values in the rows above the subtotal.
Please select the type of aggregation you are looking for within that setting. Hope that helps!
Kind Regards,
Katie Garrison | Technical Solutions Consultant
• Hi Katie,
Thank you for the quick reply.
I've read the document in your link, but unfortunately it doesn't meet my requirement. I can't use the other custom options for the subtotals, because the customer wants to see the weighted average calculation. In example above I expect to get the following numbers:
(39.827% * 18377 + 13.739% * 17435 + 31.862% * 18333) / (18377 + 17435 + 18333) = 28.729%
When I use the auto option I get 29.580%.
Thank you,
Regina.
• Hi Regina,
When a category has only one occurence, then the row and the subtotal are merged in order not to provide two rows almost duplicated :
Cat 1 - sub category A => values
Cat 1 - sub category B => values
Cat 1 - sub total => values
Cat 2 - sub category C => values
Cat 2 - sub total => values
In the example above, there would be only one row for Category 2. For a "Sum" agregation, that is ok. BUT for calculation like a contribution, the value displayed would be the contribution against the TOTAL of all categories. Which makes sense for the subtotal, but weird for the sub category. This behaviour is automatic and means that some automatic calculation by sisense are not made for the subcategory, but for the upper level. I did not check your formula in detail, but given you are using formulas with " , ", I guess you could be in that situation.
If it is not clear enough, try to do a test with contribution, and with a custom formul to do the contribution (like (agreg/(agreg,ALL(dimension)))
Hopes this helps.
Best,
David. | 456 | 1,904 | {"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} | 2.53125 | 3 | CC-MAIN-2020-05 | latest | en | 0.876024 |
https://www.gamedev.net/forums/topic/671368-rotated-aabbs-and-frustum-intersection/ | 1,544,697,048,000,000,000 | text/html | crawl-data/CC-MAIN-2018-51/segments/1544376824675.15/warc/CC-MAIN-20181213101934-20181213123434-00280.warc.gz | 910,271,438 | 32,857 | Rotated AABBs and frustum intersection
This topic is 1200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.
Recommended Posts
I'm doing view frustum culling using this fairly standard algorithm
AABBIntersection Intersection(const AABB& aabb, const Mat4& frustumMatrix)
{
const Vec4 rowX(frustumMatrix[0].x, frustumMatrix[1].x, frustumMatrix[2].x, frustumMatrix[3].x);
const Vec4 rowY(frustumMatrix[0].y, frustumMatrix[1].y, frustumMatrix[2].y, frustumMatrix[3].y);
const Vec4 rowZ(frustumMatrix[0].z, frustumMatrix[1].z, frustumMatrix[2].z, frustumMatrix[3].z);
const Vec4 rowW(frustumMatrix[0].w, frustumMatrix[1].w, frustumMatrix[2].w, frustumMatrix[3].w);
AABBIntersection ret(AABBIntersection::Inside);
// left, right, bottom, top, near, far planes
std::array<Vec4, 6> planes = { rowW + rowX, rowW - rowX, rowW + rowY, rowW - rowY, rowW + rowZ, rowW - rowZ };
float d = 0.0f, r = 0.0f;
for (const Vec4& plane : planes)
{
d = glm::dot(Vec3(plane), aabb.mAABBCenter);
r = glm::dot(Vec3(glm::abs(plane)), aabb.mAABBExtent);
if (d - r < -plane.w)
ret = AABBIntersection::Partial;
if (d + r < -plane.w)
return AABBIntersection::Outside;
}
return ret;
}
The frustrumMatrix is the Local-World-View-Projection matrix and the aabb is simply in Local space. This works fine even if the world matrix is scaled or translated. However if a rotation component is added then the test is no longer working.
Why is this? And is there anything I can do to modify the frustrumMatrix to make it play nice with rotations aswell? I could apply a rotation matrix to the aabb but I would very much like to avoid that and only as a last resort if it cannot be done by modifying the frustrumMatrix...
Any ideas?
Thanks
Edited by KaiserJohan
Share on other sites
AABB’s are not to be held in local space. They are to be represented in world space. Applying the world matrix, rotations and all, to the AABB is the correct solution and should fix your problems.
L. Spiro
Share on other sites
There is nothing wrong using AABB's at local space. I have implemented local space frustum culling method that use couple different tricks and is quite efficient and very precise. This method work for any rotation, scale, translation local matrix and I have tested both ortho and perspective projection matrices. Only drawback is that I don't normalize plane equations so I can't get exact distances from aabb to plane so I can't get information about intersection. Only binary in or out. There is my code. http://pastebin.com/9uPvpAfj
For OBB culling alternative is transform 8 corners from AABB's and test all of them against all planes. Or transforming points to clipspace and doing culling on there.
References:
https://fgiesen.wordpress.com/2012/08/31/frustum-planes-from-the-projection-matrix/
https://fgiesen.wordpress.com/2010/10/17/view-frustum-culling/
http://iquilezles.org/www/articles/frustum/frustum.htm
Clipspace reference:
http://zeuxcg.org/2009/01/31/view-frustum-culling-optimization-introduction/
Share on other sites
What is the purpose of keeping them in local space? You can’t use them for octrees, quadtrees, BVH’s, coarse-level culling, etc., and you have the much-greater expense of transforming either the frustum of the AABB for each frustum test.
Transforming an AABB into world space once for each update of the object’s world matrix is trivial.
/**
* Computes an AABB from an existing AABB with a matrix-stored translation.
* The matrix must be row-major.
*
* \param _aabbOther The source bounding box to transform by the given matrix and store in this object.
* \param _mTrans The matrix used to transform _aabbOther into this bounding box.
*/
LSVOID LSE_CALL CAabb::ComputeAabbFromAabbAndMatrix( const CAabb &_aabbOther, const CMatrix4x4 &_mTrans ) {
// For each axis.
for ( LSUINT32 I = 0; I < 3; ++I ) {
m_vMin[I] = m_vMax[I] = _mTrans( 3, I );
// Create extents by summing smaller and larger terms on this axis only.
for ( LSUINT32 J = 0; J < 3; ++J ) {
LSREAL fE = _mTrans( J, I ) * _aabbOther.m_vMin[J];
LSREAL fF = _mTrans( J, I ) * _aabbOther.m_vMax[J];
if ( fE < fF ) {
m_vMin[I] += fE;
m_vMax[I] += fF;
}
else {
m_vMin[I] += fF;
m_vMax[I] += fE;
}
}
}
}
Keeping them in local space may make them tighter fits, but it is unlikely to make up for the overhead and lack of usefulness.
L. Spiro
Share on other sites
It's only about tighter fit. Frustum test in local space is very fast and isn't problem.
Another advantage is that same test can be used for any frustum and in any space. In my real world usage I only send one frustum matrix in and just use that. Then I can do culling in space what make most sense for current use case. One relevant use case could be use that test only for objects that intersect frustum. So you only spend extra effort when it's needed.
Edit: There are also even better aproach if false positives are problem. http://iquilezles.org/www/articles/frustumcorrect/frustumcorrect.htm
Edited by kalle_h
Share on other sites
There is nothing wrong using AABB's at local space. I have implemented local space frustum culling method that use couple different tricks and is quite efficient and very precise. This method work for any rotation, scale, translation local matrix and I have tested both ortho and perspective projection matrices. Only drawback is that I don't normalize plane equations so I can't get exact distances from aabb to plane so I can't get information about intersection. Only binary in or out. There is my code. http://pastebin.com/9uPvpAfj
For OBB culling alternative is transform 8 corners from AABB's and test all of them against all planes. Or transforming points to clipspace and doing culling on there.
References:
https://fgiesen.wordpress.com/2012/08/31/frustum-planes-from-the-projection-matrix/
https://fgiesen.wordpress.com/2010/10/17/view-frustum-culling/
http://iquilezles.org/www/articles/frustum/frustum.htm
Clipspace reference:
http://zeuxcg.org/2009/01/31/view-frustum-culling-optimization-introduction/
Expanding the dot products in my code it should be exactly the same as yours for testing if its outside or not. And your aabb's are in local space too? And ignoring the typo in the pastebin code, the matrix used is a local*world*view*projection matrix too?
Is there a specific reason as to why only rotations might be causing this test to fail when translation and scaling works fine? Also the object are rendered correctly when not culled so the matrices must be fine...?
The test works when rotating the local AABB using the rotation component from the world matrix aswell like below but I'd rather avoid it...
frustumMatrix = projMatrix * viewMatrix * worldMatrix * localMatrix;
aabb *= (rotationMatrix);
Surely transforming the aabb with the rotation matrix can somehow be worked into the frustumMatrix for the test to work.
Either way I'm gonna have to keep debugging it
Edited by KaiserJohan
Share on other sites
There is nothing wrong using AABB's at local space. I have implemented local space frustum culling method that use couple different tricks and is quite efficient and very precise. This method work for any rotation, scale, translation local matrix and I have tested both ortho and perspective projection matrices. Only drawback is that I don't normalize plane equations so I can't get exact distances from aabb to plane so I can't get information about intersection. Only binary in or out. There is my code. http://pastebin.com/9uPvpAfj
For OBB culling alternative is transform 8 corners from AABB's and test all of them against all planes. Or transforming points to clipspace and doing culling on there.
References:
https://fgiesen.wordpress.com/2012/08/31/frustum-planes-from-the-projection-matrix/
https://fgiesen.wordpress.com/2010/10/17/view-frustum-culling/
http://iquilezles.org/www/articles/frustum/frustum.htm
Clipspace reference:
http://zeuxcg.org/2009/01/31/view-frustum-culling-optimization-introduction/
Expanding the dot products in my code it should be exactly the same as yours for testing if its outside or not. And your aabb's are in local space too? And ignoring the typo in the pastebin code, the matrix used is a local*world*view*projection matrix too?
Is there a specific reason as to why only rotations might be causing this test to fail when translation and scaling works fine? Also the object are rendered correctly when not culled so the matrices must be fine...?
The test works when rotating the local AABB using the rotation component from the world matrix aswell like below but I'd rather avoid it...
frustumMatrix = projMatrix * viewMatrix * worldMatrix * localMatrix;
aabb *= (rotationMatrix);
Surely transforming the aabb with the rotation matrix can somehow be worked into the frustumMatrix for the test to work.
Either way I'm gonna have to keep debugging it
My AABB's are in local space and matrices are same as yours. I haven't had any problems with rotations so far. Can you test normalizing your planes? This is needed for partial test to work right,
1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5
• 26
• 10
• 9
• 9
• 11
• Forum Statistics
• Total Topics
633696
• Total Posts
3013394
× | 2,368 | 9,231 | {"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} | 3.234375 | 3 | CC-MAIN-2018-51 | latest | en | 0.648926 |
http://mathhelpforum.com/pre-calculus/index258.html | 1,490,762,822,000,000,000 | text/html | crawl-data/CC-MAIN-2017-13/segments/1490218190181.34/warc/CC-MAIN-20170322212950-00585-ip-10-233-31-227.ec2.internal.warc.gz | 237,023,234 | 15,110 | # Pre-Calculus Forum
Pre-Calculus Help Forum: Pre-calculus does not involve calculus, but explores topics that will be applied in calculus
1. ### This forum is for PRE-Calculus. READ BEFORE POSTING
• Replies: 25
• Views: 9,681
Oct 1st 2011, 05:08 AM
2. ### Read this before posting in this subforum.
• Replies: 0
• Views: 3,095
Aug 14th 2010, 02:52 PM
• Replies: 0
• Views: 343
Aug 10th 2009, 08:02 AM
2. ### locus and ellipse problems
• Replies: 2
• Views: 1,053
Aug 10th 2009, 05:34 AM
3. ### mistake?
• Replies: 2
• Views: 423
Aug 10th 2009, 12:40 AM
4. ### Finite Difference of Polynomial Functions..
• Replies: 6
• Views: 1,836
Aug 9th 2009, 05:17 PM
5. ### Solving exponential equation using a... graph?
• Replies: 4
• Views: 873
Aug 9th 2009, 05:15 PM
6. ### Help me with these 2 problems
• Replies: 3
• Views: 472
Aug 9th 2009, 01:14 PM
7. ### Solving equations with rational terms.
• Replies: 6
• Views: 559
Aug 9th 2009, 01:02 PM
8. ### Solving functions with graph, inverses and etc.?
• Replies: 8
• Views: 566
Aug 9th 2009, 12:24 PM
9. ### Distance from point to line on hyperbola asymptotes problem
• Replies: 3
• Views: 1,463
Aug 9th 2009, 11:53 AM
10. ### Helping with long inverse equation
• Replies: 5
• Views: 496
Aug 9th 2009, 11:00 AM
11. ### even/odd graph
• Replies: 11
• Views: 994
Aug 9th 2009, 10:57 AM
12. ### slope of curve
• Replies: 1
• Views: 401
Aug 9th 2009, 08:04 AM
13. ### continuous function
• Replies: 1
• Views: 373
Aug 9th 2009, 07:50 AM
14. ### even/odd trig functions
• Replies: 1
• Views: 837
Aug 9th 2009, 07:39 AM
15. ### Need help w/ pre-calculus summer packet.
• Replies: 4
• Views: 988
Aug 9th 2009, 05:04 AM
16. ### Logistic function
• Replies: 2
• Views: 479
Aug 9th 2009, 04:54 AM
17. ### Distance between two parallel lines?
• Replies: 1
• Views: 710
Aug 9th 2009, 02:55 AM
18. ### Inverse of Funciton
• Replies: 1
• Views: 393
Aug 8th 2009, 06:24 PM
19. ### Math 11-Equation of Quadratic Function, when given vertex and other point on parabola
• Replies: 5
• Views: 1,327
Aug 8th 2009, 06:04 PM
• Replies: 16
• Views: 837
Aug 8th 2009, 03:34 PM
21. ### Quick elementary question regading vectors
• Replies: 7
• Views: 557
Aug 8th 2009, 10:52 AM
22. ### Completeing the Squares
• Replies: 3
• Views: 312
Aug 8th 2009, 03:35 AM
23. ### sketching
• Replies: 2
• Views: 415
Aug 7th 2009, 11:32 PM
24. ### Common Logarithm Questions I don't understand
• Replies: 2
• Views: 842
Aug 7th 2009, 07:22 PM
25. ### Polynomial Functions
• Replies: 2
• Views: 399
Aug 7th 2009, 12:40 PM
,
,
,
,
,
,
,
,
,
,
,
,
,
# precalculus with limits page 294
Click on a term to search for related topics.
Use this control to limit the display of threads to those newer than the specified time frame.
Allows you to choose the data by which the thread list will be sorted. | 1,070 | 2,844 | {"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} | 3.46875 | 3 | CC-MAIN-2017-13 | longest | en | 0.733084 |
https://www.coursehero.com/file/6710771/lec12/ | 1,513,637,670,000,000,000 | text/html | crawl-data/CC-MAIN-2017-51/segments/1512948627628.96/warc/CC-MAIN-20171218215655-20171219001655-00405.warc.gz | 728,483,694 | 41,704 | # lec12 - 15.053 Introduction to Networks Announcement no...
This preview shows pages 1–9. Sign up to view the full content.
1 15.053 March 22, 2007 Introduction to Networks Announcement: no recitations this week Comment on Excel
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
2 Quotes for today "A journey of a thousand miles begins with a single step." -- Confucius “You cannot travel the path until you have become the path itself” -- Buddha
3 Network Models z Optimization models that exhibit a very special structure. z For special cases, this structure to dramatically reduce computational complexity (running time). z First widespread application of LP to problems of industrial logistics z Addresses huge number of diverse applications z Today’s lecture (first of 3): introductory material, Eulerian tours, the Shortest Path Problem
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
1 Notation and Terminology Note: Network terminology is not (and never will be) standardized. The same concept may be denoted in many different ways. Called: NETWORK directed graph digraph graph Class Handouts (Ahuja, Magnanti, Orlin) Node set N = {1, 2, 3, 4} Arc Set Network G = (N, A) {(1,2), (1,3), (3,2), (3,4), (2,4)} E={1-2,1-3,3-2,3-4,2-4} Graph G = (V,E) Edge set: Also Seen Vertex set V = {1,2,3,4} 2 1 4 3 Personally, I find introducing all of the network notation and terminology to be boring. At the same time, it is critical to any further understanding in this area. I use the notation in the text Network Flows by Ahuja, Magnanti, and Orlin. Tom Magnanti is currently Dean of Engineering at MIT. Ravi Ahuja and I have worked together more than 20 years, and have co - authored around 50 papers together as well as this book.
2 Directed and Undirected Networks 2 3 4 1 a b c d e A Directed Graph The field of Network Optimization concerns optimization problems on networks Networks are used to transport commodities physical goods (products, liquids) communication electricity, etc. 2 3 4 1 a b c d e An Undirected Graph Networks are universal, and are applied to a wide range of situations. Almost any system can be described in large part by a network that describes relationships between parts of a system. This includes communication systems, electrical systems, manufacturing systems, social networks, and much more.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
6 Networks are Everywhere z Physical Networks Road Networks Railway Networks Airline traffic Networks Electrical networks, e.g., the power grid z Abstract networks organizational charts precedence relationships in projects z Others?
7 Overview: z Networks and graphs are powerful modeling tools. z Most OR models have networks or graphs as a major aspect z Next five lectures: we will develop models that are efficiently solvable. Help form a toolkit for those problems that are harder to solve z Next: representations of networks A great insight from computer scientists: how data is represented is important to how it is used
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
8 The Adjacency Matrix (for directed graphs) 2 3 4 1 a b c d e A Directed Graph 0101 0010 0000 0110 Have a row for each node 1 2 3 4 1 2 3 4 Have a column for each node Put a 1 in row i- column j if (i, j) is an arc What would happen if (4, 2) became (2, 4)?
This is the end of the preview. Sign up to access the rest of the document.
{[ snackBarMessage ]}
### Page1 / 60
lec12 - 15.053 Introduction to Networks Announcement no...
This preview shows document pages 1 - 9. Sign up to view the full document.
View Full Document
Ask a homework question - tutors are online | 910 | 3,851 | {"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} | 2.9375 | 3 | CC-MAIN-2017-51 | latest | en | 0.898261 |
https://brilliant.org/problems/triple-cube-sum/ | 1,513,155,423,000,000,000 | text/html | crawl-data/CC-MAIN-2017-51/segments/1512948522343.41/warc/CC-MAIN-20171213084839-20171213104839-00278.warc.gz | 519,183,276 | 11,932 | # Triple Cube Sum
Algebra Level 5
Suppose that the following holds for complex numbers $$a,b,c$$: \begin{align} a + b + c & = 6 \\ \frac{a-b}{c} + \frac{c-a}{b} + \frac{b-c}{a} & = \left(1 + \frac{a}{b}\right) \left(1 + \frac{b}{c}\right) \left(1 + \frac{c}{a}\right) \\ \frac{a^2}{bc} + \frac{b^2}{ac} + \frac{c^2}{ab} + \frac{bc}{a^2} + \frac{ac}{b^2} + \frac{ab}{c^2} & = -2 \end{align} What is the value of $$a^3 + b^3 + c^3$$?
× | 201 | 436 | {"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": 1, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.5 | 4 | CC-MAIN-2017-51 | longest | en | 0.463717 |
http://www.learner.org/courses/learningmath/number/session9/part_b/models.html | 1,553,230,242,000,000,000 | text/html | crawl-data/CC-MAIN-2019-13/segments/1552912202628.42/warc/CC-MAIN-20190322034516-20190322060516-00014.warc.gz | 320,068,828 | 7,530 | Teacher resources and professional development across the curriculum
Teacher professional development and classroom resources across the curriculum
Session 9, Part B:
Decimals and Percents
In This Part: Percent as Proportion | Percents as Fractions and Decimals | Percent Models
Many tools can be used to visually represent percentages; for example, a 100-grid (a grid containing 100 squares) that is shaded to represent a percent. The grid below represents 25%, or 25 out of 100:
This grid also represents the fraction 1/4 and the decimal 0.25.
Problem B10
a. What percent, fraction, and decimal are represented by the shaded part below? b. How would you represent 39% on a 100-grid?
Here is another model you can make for working with percents. Get a board that has a meter stick or number line on it, and attach a wide elastic band. Then, on the elastic band, mark all the key percents up to 100. Release the elastic band. Now, if you stretch the elastic band to line up the 100% mark you made with any number -- for example, 40, as shown below -- the other percents will automatically line up with the correct numbers (50% will line up with 20, etc.). This is an easy way to tell how much a given percent is of a given number. (You can use this model for numbers greater than 100 as well.)
Problem B11 Complete the following: Forty percent of 80 is ______ % of 96. Try using the elastic model above to solve this problem.
Sometimes we can use an area model to represent percentages. For example, in Problem B2, Jane bought a dress marked down 25%, for a total of \$39. We can represent that as follows:
Calculating the original price would require increasing the sale price by approximately 33.3%, rather than 25%.
In this case, a visual model can help us better understand and solve this percentage problem.
Session 9: Index | Notes | Solutions | Video | 426 | 1,875 | {"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} | 4.59375 | 5 | CC-MAIN-2019-13 | latest | en | 0.918731 |
https://fdocument.org/document/decision-making-hypothesis-testing.html | 1,713,115,453,000,000,000 | text/html | crawl-data/CC-MAIN-2024-18/segments/1712296816893.19/warc/CC-MAIN-20240414161724-20240414191724-00081.warc.gz | 234,670,920 | 24,867 | 14
Decision Making Decision Making (Hypothesis Testing) (Hypothesis Testing) 11 Oct 2011 BUSI275 Dr. Sean Ho HW5 due Thu Work on REB forms
carson-battle
• Category
## Documents
• view
28
2
description
11 Oct 2011 BUSI275 Dr. Sean Ho. Decision Making (Hypothesis Testing). HW5 due Thu Work on REB forms. Outline for today. Decision making and hypothesis testing Null hypothesis ( H 0 ) vs. alternate ( H A ) Making conclusions : “ reject H 0 ” vs. “ fail to reject H 0 ” - PowerPoint PPT Presentation
### Transcript of Decision Making (Hypothesis Testing)
Decision MakingDecision Making(Hypothesis Testing)(Hypothesis Testing)
11 Oct 2011BUSI275Dr. Sean Ho
HW5 due ThuWork on REB forms
11 Oct 2011BUSI275: hypothesis testing 2
Outline for todayOutline for today
Decision making and hypothesis testing Null hypothesis (H0) vs. alternate (HA)
Making conclusions: “reject H0” vs. “fail to reject H0”
Risks of error: Type I and Type II error Hypothesis test on population mean (μ)
One-tailed vs. two-tailed Test on μ, with unknown σ (TDIST) Test on binomial proportion π
11 Oct 2011BUSI275: hypothesis testing 3
Decision makingDecision making
The real world is fuzzy / uncertain / complex To make decisions, we need to assess risk
Fuzzy risk → binary yes/no decision A hypothesis is an idea of how the world works
Decision: accept or reject the hypothesis? Based on the data, what are the risks in
accepting hypothesis? Risks in rejecting?
Null hypothesis (H0) is the default, “status quo”
Fallback if insufficient evidence for HA
Alternate hypothesis (HA) is the opposite Usually same as our research hypothesis:
what we intend to show
11 Oct 2011BUSI275: hypothesis testing 4
HH00 vs. H vs. HAA
Do index funds outperform actively-managed mutual funds?
H0: no difference, or do not outperform
HA: do outperform
Does gender affect investment risk tolerance? H0: no difference, tolerance same for both
HA: risk tolerance of men + women differs
Supplier claims defect rate is less than 0.001% H0: defect rate is too high: ≥ 0.001%
HA: supplier has proved defect rate is low
11 Oct 2011BUSI275: hypothesis testing 5
““Reject HReject H00” vs. “fail to rej H” vs. “fail to rej H
00””
Two options for making decisions: Reject H0: strong statement, significant
evidence in favour of HA and against H0
Fail to reject H0: weak statement,insufficient evidence in favour of HA
Does not mean strong evidence in favor of accepting H0! Perhaps need more data
Index funds: “reject H0” means strong evidence that index outperforms active management
“Fail to reject H0” means insufficient evidence to show they perform better
11 Oct 2011BUSI275: hypothesis testing 6
Risks / errorsRisks / errors
Our decision may or may not be correct:
We define H0/HA so that Type I error is worse and Type II error is more bearable
Can't eliminate risk, but can manage it α is our limit on Type I (level of significance) β is our limit on Type II (1-β = “power”)
H0 true HA true
Rej H0
Type I
Fail rej Type II
11 Oct 2011BUSI275: hypothesis testing 7
Type I vs. Type II risksType I vs. Type II risks
Supplier: H0: high defect rate; HA: low defects Type I: think defect rate is low, when in
reality it is high: ⇒ angry customers Type II: supplier is good, but we wrongly
suspected / fired them: ⇒ loss of partner
Murder trial: H0 / HA? Type I/II?
Parachute inspector: H0 / HA? Type I/II? In most research, α=0.05 and β is unlimited
But depends on context, meaning of H0/HA
e.g., what should α for parachute be?
11 Oct 2011BUSI275: hypothesis testing 8
Test on population meanTest on population mean
e.g., assume starting salary of clerical workers is normally distributed with σ=\$3k
Research question: is avg salary < \$30k? Data: sample n=12 salaries, get x=\$28k
H0 (status quo): avg salary μ ≥ \$30k
HA (research hypothesis): μ < \$30k
Strategy: calculate risk of Type I error (p-value) Assume μ is what H0 says it is (μ=\$30k) Sample data x is a threshold on the SDSM Risk of Type I error is area in tail of SDSM
11 Oct 2011BUSI275: hypothesis testing 9
Test on pop mean, cont.Test on pop mean, cont.
In our example, Std err σx = σ/√n
= \$3k/√12 ≈ \$866 Z-score: (28-30)/866 ≈ 2.3 Area in tail: NORMSDIST(-2.3) → 1.07%
Or: NORMDIST(28, 30, 3/SQRT(12)) → 1.05% So there is a 1.05% risk of Type I error
Compare against α (usually 5%) Conclude this is an acceptable risk, so
Reject H0: yes, at the 5% level of significance, salaries are significantly lower than \$30k
1.05%
z = -2.3
σx ≈ \$866
\$28k \$30k
11 Oct 2011BUSI275: hypothesis testing 10
Two-tailed testsTwo-tailed tests
The preceding example was “one-tailed” H0 / HA use directional inequalities <, ≤, >, ≥ “greater than”, “bigger”, “more/less”
Two-tailed test uses non-directional inequalities ≠, “differ”, “change”, “same / not same”
e.g., standard height of doors is 203cm.Is a batch of doors significantly out of spec?
H0: no difference, within spec: μ = 203 cm
HA: differ from spec(either too tall or too short): μ ≠ 203 cm
Data: measure a sample of doors, get n, x, s
11 Oct 2011BUSI275: hypothesis testing 11
Door ex.: two-tailed, no σDoor ex.: two-tailed, no σ
HA: μ ≠ 203 Data: n=8, x=204, s=1.2 Std err = s/√n ≈ 0.424 t = (204-203)/0.424 ≈ 2.357 df=7, so the % in both tails (p-value) is
TDIST(2.357, 7, 2) → 0.0506 More precisely: TDIST(1/(1.2/SQRT(8)), 7, 2)
So our calculated risk of Type I error is 5.06% Assuming normal distribution
This is larger than our tolerance (α): Unacceptably high risk of Type I error
5.06%
t = 2.357
σx ≈ 0.424
204203
11 Oct 2011BUSI275: hypothesis testing 12
Door ex.: conclusionDoor ex.: conclusion
In view of the high risk of Type I error, we are unwilling to take that chance, so we conclude:
Fail to reject H0: at the 5% level, this batch of doors is not significantly out of spec
In this example, we follow the research convention of assigning '≠' to HA
But in quality control (looking for defects), we might want H0 to assume there is a defect, unless proven otherwise
Also note that if this test had been one-tailed: TDIST(2.357, 7, 1) → 2.53% < α
and we would have rejected H0!
11 Oct 2011BUSI275: hypothesis testing 13
Test on binomial proportion πTest on binomial proportion π
p.373 #33: Wall Street Journal claims 39% of consumer scam complaints are on identity theft
RQ: do we believe the claim? HA: π ≠ 0.39 Data: 40/90 complaints are about ID theft
Std err: σp= √(pq/n) = √(.39*.61/90) ≈ .0514 Z-score: z = (40/90 – .39) / .0514 ≈ 1.06 P-value (two-tailed): 2*NORMSDIST(-1.06)
Or: 2*(1-NORMDIST(40/90, .39, .0514, 1)) → 28.96%
Fail to reject H0: insufficient evidence to disbelieve the WSJ claim, so we believe it
11 Oct 2011BUSI275: hypothesis testing 14
TODOTODO
HW5 (ch7-8): due this Thu at 10pm REB form due next Tue 18 Oct 10pm
If approval by TWU's REB is required,also submit printed signed copy to me
You are encouraged to submit early to allow time for processing by TWU's REB(3-4 weeks)
Midterm (ch1-8): next week Thu | 2,066 | 7,028 | {"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} | 2.796875 | 3 | CC-MAIN-2024-18 | latest | en | 0.847928 |
https://mathematica.stackexchange.com/questions/123718/nsolve-gives-an-empty-solution-at-some-values?noredirect=1 | 1,603,246,365,000,000,000 | text/html | crawl-data/CC-MAIN-2020-45/segments/1603107874637.23/warc/CC-MAIN-20201021010156-20201021040156-00474.warc.gz | 408,722,545 | 35,744 | # NSolve gives an empty solution at some values
I have the equation
$$x(\phi)=\frac{1}{2\sqrt2}\left(\frac{-2}{\phi}+\log\left(\frac{1+\phi}{1-\phi}\right)\right)$$ I need to find the dependence $\phi(x)$, so I use NSolve:
B = 20;
NSteps = 2*B*100;
H = N[2*B/NSteps];
X = Range[-B, B, H];
F[i_] := NSolve[x[ϕ] == i && (-1.0 <= ϕ <= 0.0), ϕ];
Monitor[PhiTable = Table[ϕ /. F[i], {i, -B, B, H}], i]
And I get this output:
NSolve can't find the solution and it gives an empty result at the values from about -15 and lower. I suppose this bug is caused by exponential asymptotic of the function $\phi(x)$.
But when I write
F[i_] := NSolve[x[ϕ] == i, ϕ, Reals];
Monitor[PhiTable = Table[ϕ /. F[i][[1]], {i, -B, B, H}], i]
It finds roots at the begining but freezes at the point 16.44 and higher.
Is there a way to fix it? Or shall I use another function, not NSolve?
x[ϕ_] := 1/(2 Sqrt[2]) (-2/ϕ + Log[(1 + ϕ)/(1 - ϕ)]);
• Welcome! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – user9660 Aug 11 '16 at 18:35
• Could you give Mathematica code for your definition of x[\[Phi]]? Could be similar to this question. – Chris K Aug 11 '16 at 18:55
• It looks like your equation $x(\phi) = x_0$ has two solutions for all values of $x_0$, one with positive $\phi$ and one with negative $\phi$. Do you have a preference as to which one is returned? – Michael Seifert Aug 11 '16 at 19:03
• @ChrisK definition: x[[Phi]_] := 1/(2 Sqrt[2]) (-2/[Phi] + Log[(1 + [Phi])/(1 - [Phi])]); I also added it to the post as screenshot – Chertan Aug 11 '16 at 19:04
• @MichaelSeifert yes, I need negative one. Therefore I used the restrictions on phi in the first example – Chertan Aug 11 '16 at 19:07
The root tracker TrackRoot I wrote here can be applied to this problem. First, run TrackRoot from that link.
Then:
x[ϕ_] := 1/(2 Sqrt[2]) (-2/ϕ + Log[(1 + ϕ)/(1 - ϕ)]);
tr = TrackRoot[{x[ϕ] - xval}, {ϕ}, {xval, -20, 20}, 0, {-0.5}];
Plot[ϕ[x] /. tr, {x, -20, 20}]
• Thanks a lot, it works! Is it possible to correct this function and not to use interpolation? I'd like to get only values of phi. Sorry if it is a very foolish and simple question, I have never worked with manual functions before. – Chertan Aug 12 '16 at 14:22
• @Chertan I'm not sure if this is exactly what you mean by correcting this function, but you can extract particular values of \[Phi] like this: \[Phi][1] /. tr gives -0.506903. – Chris K Aug 13 '16 at 1:39
• yes, that's exactly what I meant. Thank you! – Chertan Aug 13 '16 at 13:42 | 945 | 2,903 | {"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} | 3.203125 | 3 | CC-MAIN-2020-45 | latest | en | 0.878058 |
https://lindseyvan.com/293svsz5/dM3959uL/ | 1,606,548,946,000,000,000 | text/html | crawl-data/CC-MAIN-2020-50/segments/1606141195198.31/warc/CC-MAIN-20201128070431-20201128100431-00210.warc.gz | 392,677,414 | 9,073 | Print It School Readiness Work Sheets Parent24 Grade Maths Worksheets South Africa Mathematics In
Jeanne Nelya October 5, 2020 Math Worksheet
What are math worksheets and what are they used for? These are math forms that are used by parents and teachers alike to help the young kids learn basic math such as subtraction, addition, multiplication and division. This tool is very important and if you have a small kid and you don’t have a worksheet, then its time you got yourself one or created one for your kid. There are a number of sites over the internet that offer free worksheets that are downloadable and printable for use by parents and teachers at home or at school.
At the grassroots level, teachers in schools are given a packed curriculum for the year. Schools try to teach the students a number of procedures without delving much into its finer details. Hence, the student is left in a confounding position as to when a particular procedure must be used. The key ingredient to understanding math is constant practice and math assignment help. Unfortunately, this is not a common scenario among the popular math classes. It is widely understood that math has a global use and acceptance. People are also aware of the rate at which math is advancing today at various fields of research and study. Many mathematicians will talk about the pattern and structure of math worksheets which are helpful for people in working fields. Math has helped science and technology reach a higher level of advancement.
First, the Basics! The x axis of a graph refers to the horizontal line while the y axis refers to the vertical line. Together these lines form a cross and the point where they both meet is called the origin. The value of the origin is always 0. So if you move your pencil from the origin to the right, you are drawing a line across the positive values of the x axis, i.e., 1, 2, 3 and so on. From the origin to the left, you’re moving across the negative values of the x axis, i.e., -1, -2, -3 and so on. If you go up from the origin, you are covering the positive values of the y axis. Going down from the origin, will take you to the negative values of the y axis.
Practice makes perfect, Learning math requires repetition that is used to memorize concepts and solutions. Studying with math worksheets can provide them that opportunity; Math worksheets can enhance their math skills by providing them with constant practice. Working with this tool and answering questions on the worksheets increases their ability to focus on the areas they are weaker in. Math worksheets provide your kids’ the opportunity to analytical use problem solving skills developed through the practice tests that these math worksheets simulate.
Maths Practice Worksheets For Class 3
Nov 07, 2020
Killing Zombies Math Worksheet
Nov 07, 2020
Math Standardized Test Practice Worksheets
Nov 06, 2020
Apples Pears Plums 10 Partner Math Worksheet
Nov 06, 2020
Graphing Linear Equations. If you have several sets of x and y coordinates, you can now draw lines on a graph. Free math worksheets can drill you on plotting x and y coordinates while graphing linear equation. A linear equation when drawn on a line graph always yields a straight line. Take ”y = 2x + 1” for example – a linear equation. Assign any three numbers to x, and then solve for y. Whatever numbers you assign to x and whatever y comes out to be, you will end up with a straight line. Remember to practice on easier math worksheets first before moving on to writing a linear equation or to the systems of linear equations. Good luck!
When a child learns to relate math to everyday questions, he will be great at it from the simplest addition all the way to trigonometry. To convert percentages, decimals and fractions is thus one essential skill. How much of an apple pie has been eaten? The answer to this question can be expressed in percentages, 50%; or in decimals, 0.5; or in fraction, ½. In other words, half of mom’s delicious apple pie is gone. How many kids in school have done their homework? Again this can be answered in several ways: in percentages, 70%; or in ratio, 7:10; Both of these mean out of ten kids in class there are seven good ones who did and three not-so-good ones who didn’t. The bottom line is that kids learn math much better when it makes sense.
Photos of Grade R Maths Worksheets South Africa
• 5
• 4
• 3
• 2
• 1
Rate This Grade R Maths Worksheets South Africa
Reviews are public and editable. Past edits are visible to the developer and users unless you delete your review altogether.
Most helpful reviews have 100 words or more
Categories
Static Pages
Most Popular
Nov 07, 2020
Nov 07, 2020
Nov 06, 2020
Nov 06, 2020
Nov 07, 2020
Latest Review
Nov 06, 2020
Nov 06, 2020
Nov 06, 2020
Latest News | 1,075 | 4,805 | {"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} | 4.28125 | 4 | CC-MAIN-2020-50 | latest | en | 0.957136 |
http://www-inst.eecs.berkeley.edu/~cs61a/fa11/61a-python/content/labs/lab4/lab4.html | 1,513,581,170,000,000,000 | text/html | crawl-data/CC-MAIN-2017-51/segments/1512948609934.85/warc/CC-MAIN-20171218063927-20171218085927-00673.warc.gz | 301,394,609 | 2,908 | # CS61A Lab 4: Data Abstraction
### Week 4, 2011
Today we get to explore the ideas of DATA ABSTRACTION!!!
### Exercise 1: Data Derping
Try typing these into python, and think about the results:
```x = (4, 5)
x[0]
x[1]
x[2]
y = ('hello', 'goodbye')
z = (x, y)
z[1]
(z[1])[0]
z[1][0]
z[1][1]
```
### Exercise 2: Data Herp Derping
Predict the result of each of these before you try it:
```z[0][1]
(8, 3)[0]
z[0]
3[0]
```
### Exercise 3: Abstracting Rational Numbers
Enter these definitions into Python:
```def make_rat(num, den):
return (num, den)
def num(rat):
return rat[0]
def den(rat):
return rat[1]
def mul_rat(a, b):
new_num = num(a) * num(b)
new_den = den(a) * den(b)
return make_rat(new_num, new_den)
def str_rat(x): #from lecture notes
"""Return a string 'n/d' for numerator n and denominator d."""
return '{0}/{1}'.format(num(x), den(x))
```
Now try this, be sure to predict the results first!
```str_rat(make_rat(2, 3))
str_rat(mul_rat(make_rat(2, 3), make_rat(1, 4)))
```
### Exercise 4: div_rat
Define a procedure div_rat to divide two rational numbers in the same style as mul_rat above
### Exercise 5: Segments
Consider the problem of representing line segments in a plane. Each segment is represented as a pair of points: a starting point and an ending point. Define a constructor make-segment and selectorsstart-segment and end-segment that define the representation of segments in terms of points. Furthermore, a point can be represented as a pair of numbers: the x coordinate and the y coordinate. Accordingly, specify a constructor make-point and selectors x-point and y-point that define this representation. Finally, using your selectors and constructors, define a procedure midpoint-segment that takes a line segment as argument and returns its midpoint (the point whose coordinates are the average of the coordinates of the endpoints)
### Exercise 6: Functional Pairs
Remember this from lecture?
```def make_pair(x, y):
"""Return a function that behaves like a pair."""
def dispatch(m):
if m == 0:
return x
elif m == 1:
return y
return dispatch
```
The above is a functional representation of pairs form lecture. The big idea here is something called message passing. Notice that when we call make_pair, what we actually get back is a procedure, specifically the dispatch procedure. That dispatch procedure can then be called with an argument, and based on the argument, it returns the correct part of the pair. You can think of the argument to the dispatch procedure as a message, that the procedure takes and dispatches to the right task, hence the idea of message passing. Study this representation carefully, and understand the alternatives it brings, message passing will come back bigger and better later.
Modify the make_pair procedure above to accept a pair message, so that you can return the original pair as a tuple. Also add some error checking to catch cases when we call a dispatch function with a bad message. Use an assert statement to raise an error if a message is not recognized.
```>>> p = make_pair(2, 3)
>>> p(0)
>>> 2
>>> p(1)
>>> 3
>>> p('pair')
>>> (2, 3)
>>> p(3)
Traceback (most recent call last):
File "", line 1, in
AssertionError: Message not recognized
```
### Exercise 7: Abstracting Rectangles
Implement a representation for rectangles in a plane. (Hint: You may want to make use of your procedures from exercise 6) In terms of your constructors and selectors, create procedures that compute the perimeter and the area of a given rectangle.
You are now a professional Data Abstracter, now go derp around with your new toys.... :D | 901 | 3,618 | {"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} | 4.15625 | 4 | CC-MAIN-2017-51 | latest | en | 0.754923 |
https://mathematica.stackexchange.com/questions/58495/imagetransformation-polar-to-cartesian?noredirect=1 | 1,716,759,203,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971058973.42/warc/CC-MAIN-20240526200821-20240526230821-00751.warc.gz | 324,323,656 | 39,695 | # ImageTransformation: polar to cartesian
I am working on something that requires the polar transformation of some images. I implemented this transformation with ImageTransformation:
img = Import["https://i.sstatic.net/9cV4T.jpg"]
{center, radius} = ComponentMeasurements[MorphologicalComponents[img, 0.2],
polar = ImageTransformation[img, center + {Cos[#[[1]]], Sin[#[[1]]]}*#[[2]] &,
PlotRange -> {{0, 360 \[Degree]}, {1, radius}}]
After some processing I would like to transform the image back into the original coordinate system. This step is where I ran into problems. The transformation of the coordinates isn't really the problem but I couldn't figure out how to center the transformation properly and what PlotRange I have to provide.
So the question is how to reverse the transformation:
ImageTransformation[img, center + {Cos[#[[1]]], Sin[#[[1]]]}*#[[2]] &,
PlotRange -> {{0, 360 \[Degree]}, {1, radius}}]
One of my failed attempts:
ImageTransformation[imgNorm, {0, Pi radius} + {Sqrt[#[[1]]^2 + #[[2]]^2],
This seems to work:
ImageTransformation[polar,
DataRange -> {{-180 \[Degree], 180 \[Degree]}, {1, radius}},
• Don't call ArcTan[y/x]. You'd only get an angle between -90°..90°. There's an overload ArcTan[x,y] that returns an angle from -180°..180°
• Somewhat unintuitively, PlotRange->Full isn't the same as PlotRange->(* dimensions of output image*), it uses the input image's dimensions. If in doubt, give explicit ranges.
• Thanks this is exactly what i was looking for. Replacing the 1 in the DataRange option with 0 gets rid of the black dot in the middle.
• @paw: The black dot is there because the polar image contains no data for that location. If you use 0 in the DataRange of the inverse transform, but used 1 in the PlotRange of the polar transform, the result will be slightly skewed (by 1 pixel at the center). You can either use 0 for both, or use Padding -> "Fixed" to get rid of the black dot in the center. Aug 31, 2014 at 11:11
• @paw and @nikie : Thanks a lot for both of your code examples that are very helpful to me. However, could you please explain why ({x,y} + {Cos[#[[1]]], Sin[#[[1]]]}*#[[2]] &) does what it is doing in ImageTransormation? Because I tried to understand the transformation by using a list of pixel positions, e.g. {{1,1},{1,2},...,{2,1},{2,2}...} and the transformed pixel positions on which I applied the above equation and displayed the results using ListPlot. Thanks a lot! Dec 22, 2016 at 22:08
• @paw and @nikie : My motivation is that I want to use an arbitrary vector center={x,y}` about which to tranform the image in polar coordinates. But I get problems with the settings I need to use for PlotRange in order to display the whole transformed image. Thank you! Dec 22, 2016 at 22:18 | 747 | 2,766 | {"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} | 3.015625 | 3 | CC-MAIN-2024-22 | latest | en | 0.83324 |
https://www.fanfiction.net/s/8338286/5/Blood-and-Bronze | 1,500,884,585,000,000,000 | text/html | crawl-data/CC-MAIN-2017-30/segments/1500549424756.92/warc/CC-MAIN-20170724062304-20170724082304-00160.warc.gz | 785,160,452 | 13,471 | Chapter Five: Spelled Out on a Double-Word and Triple-Letter Score
AN: Yes, the title is from the Kimaya Dawson song "Loose Lips," from the movie Juno. Also, something that happened in this chapter happened to me. I'll put a secondary AN with an explanation at the end.
...
When Helena next turned on her lantern, she was surprised to see Myka setting up a board game of some kind on her hotel bed. "What's this?" Helena asked, examining the tiled board as best she could.
Myka smiled mysteriously. "Another word game," she said as she set a small wooden rack before the lantern so it faced Helena. On it was a set of wooden tiles containing letters, and each letter had a number in the lower right corner. The rack itself also had the numbers one through seven written across the bottom, but it looked like they'd been penned by hand. "It's called Scrabble," Myka continued. "Each letter is worth a certain number of points, and the goal is to earn as many points as you can both with words and with squares on the board." She indicated a colored square with writing on it. "The 'DL' stands for 'double letter,' so any letter placed there counts double." She pointed to another. "'DW' is for 'double word,' so if your word crosses through that, the whole thing counts double."
"So," Helena surmised, "'TL' stands for 'triple letter' and 'TW' stands for 'triple word'?"
Myka beamed. "Exactly." She finished setting up her own rack of letters as she explained the rest of the rules. "The starting player's word has to cross through the star on the center of the board, and each word after that has to share at least one letter with another word." Done, she smiled at Helena. "I numbered your letter rack, so just tell me what you want to put where." Helena could tell she was nervous, because she was wrapping one of her curls around her finger and biting her lip a little. "So…d'you want to play?"
Helena gazed at the other woman through the lantern. Despite her nervousness, as if she was almost praying that the dark-haired woman would like her idea, Helena thought she looked adorable, and her heart melted just a little more for the curly-haired agent. "Why don't you go first – show me how it's done?" Helena replied, resting her chin in her hands. Myka's responding smile was nearly blinding.
The agent looked at her tiles thoughtfully for a moment before vertically spelling out "OCCUR," counting her score and taking new tiles. Helena pondered her own tiles and the board for a moment before listing the numbers of the tiles she wanted to place and where, playing "COMPORT" from the second "C." Myka tallied her score, replaced her tiles, and so the game continued.
Their combined love of literature and lexical intelligence made for the most interesting game of Scrabble Myka had ever played. There were many a pause to debate whether or not words like "prithee," "verily," and "egads" were allowed, and Helena insisted that they stick strictly to British spelling while Myka argued that both American and British spellings should be allowed. Many words were able to take prefixes and suffixes as well, which made for some very underhanded moves.
Helena had just finished playing "QUIET" on the board and was waiting for Myka to take her turn when she saw the brunette visibly wince, even as she seemed to be trying not to smile. Giving Helena an apologetic look, she placed three letters on the board to spell out the word "QUIETING." The raven-haired woman's eyebrows hit her hairline as Myka tallied the rather impressive score. "Sorry," the agent said earnestly with another wince. "Cheap shot, I know."
"But a good shot nonetheless," Helena pointed out. Myka's smile was more than a little sheepish.
Helena found her opportunity for revenge some time later, when the board was nearly full. She'd been eyeing the second "D" in "DIAD" (a word of questionable legality by the more mundane, conventional rules, "MUNDANE" being on the board as well) for several rounds, and she was just lucky enough to have the tiles she needed.
"Tile two after the 'D' at the end of 'DIAD,'" she requested, trying her hardest to keep a straight face. Myka gave her a curious look, but did as she asked. "And then tile five after that." Myka complied, and Helena watched with some great amusement as the realization sank in.
It took the brunette a moment to fully comprehend what Helena had done, but when she did, she felt like she'd taken a sledgehammer upside the head. Myka stared at the tiles with wide-eyed astonishment, jaw hanging open. "DISQUIETING" was spelled out across the bottom of the board. On a triple-word score.
"I…you…" the agent began, unable to form coherent words. She looked up at Helena, who was smiling as innocently as she could, even though she was obviously trying to hide an outright grin. "I can't believe…you little…"
"Yes, darling?" Helena prompted.
Myka gaped for a moment before shaking her head in complete disbelief. "Only you, Helena. Only you."
She said it with such tenderness and affection that Helena's breath caught in her throat and her heart stumbled in its rhythm. For a moment, she thought she saw something in Myka's eyes she only dared dream of, wildly hoped for, desperately craved. But, panicking, she quickly chased those thoughts away; she couldn't risk losing Myka, losing her soul.
Instead, she cleared her throat, and Myka couldn't help but notice her blush. "It's your turn, darling," Helena mumbled, uncharacteristically shy. The brunette filed the strange behavior in the back of her mind to ponder later as she began to lay out her tiles.
Needless to say, Helena won by a landslide, leaving a baffled, slightly disgruntled, but very impressed Myka. "This means I get to pick your bedtime story," Helena said triumphantly as the agent put away the game.
Myka made a face. "You picked the story the last time, too!" She pointed out as she wriggled under the covers.
The dark-haired woman smirked nonetheless. "It's the victory that counts, darling." Myka rolled her eyes as Helena cleared her throat for dramatic emphasis. "Once upon a time, on a dark and stormy night – "
"Really?"
"Hush, you. Once upon a time, on a dark and stormy night, a young woman hurried fearfully home through the streets of Whitechapel…."
For two hours, Helena regaled Myka with the story of the Warehouse 12 hunt for Jack the Ripper and the artifact he used to lure innocent girls to their gruesome deaths. Myka listened with a mix of eager curiosity and wild terror as Helena wove her tale, perfectly imitating the voices of the various people involved and adjusting her tone for each change of mood and pace. She hushed through the suspense, darkened her voice for the descriptions of the murdered, and for every sudden shock, her voice burst forth from an emphatic pause, making Myka jump.
"…And though the lantern was recovered for a time before being stolen by your rogue agent, no one ever learned what became of Jack the Ripper." Finished, Helena sat back with a smug smile as she observed Myka's reaction.
The brunette agent was nearly curled into a ball, clutching the covers she'd pulled up under her chin. When she realized that Helena had stopped speaking, she all but whimpered, "That's it?"
"That's it," Helena confirmed, trying to hold back her laughter. She stretched her aems, faking a yawn. "I must say, I am quite tired," she commented with exaggerated fatigue. Snuggling under her own bedcovers with a smile, Helena reached for her lantern. "Goodnight, darling." Myka's responding squeak was the last thing she heard before she turned the lamp off.
Falling back on her bed, Helena finally allowed herself to chuckle, reveling in the joy that evening's simple activities had brought. She was quite looking forward to the next night; she wanted to see how and if Myka had slept. Helena was still laughing as she turned off her bedside light so she could go to sleep herself.
For Myka's part, she did sleep, but with the lights on, the chair propped under the doorknob, the curtains shut, and her gun tucked under her pillow.
...
When Helena turned on the lamp the next night, Myka was once again setting up the Scrabble game, but…
Helena squinted and peered closer. "Is that in French?"
Myka grinned. "Well we couldn't let it get too easy now, could we?"
...
AN2: QUIET - QUIETING happened in a game of Words With Friends between me and my cousin, and I only noticed the possibility for DISQUIETING after I didn't have the tiles for it. Ah well. Since links are wonky here, go to photobucket and type "winning move missing" into the search bar. My username there is restless_goddess, so the result should be easy to find. :) | 1,983 | 8,707 | {"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} | 3.0625 | 3 | CC-MAIN-2017-30 | latest | en | 0.98501 |
http://experiment-ufa.ru/-8y+9=-9y+6 | 1,529,431,636,000,000,000 | text/html | crawl-data/CC-MAIN-2018-26/segments/1529267863109.60/warc/CC-MAIN-20180619173519-20180619193519-00488.warc.gz | 109,887,913 | 6,495 | # -8y+9=-9y+6
## Simple and best practice solution for -8y+9=-9y+6 equation. Check how easy it is, and learn it for the future. Our solution is simple, and easy to understand, so dont hesitate to use it as a solution of your homework.
If it's not what You are looking for type in the equation solver your own equation and let us solve it.
## Solution for -8y+9=-9y+6 equation:
Simplifying
-8y + 9 = -9y + 6
Reorder the terms:
9 + -8y = -9y + 6
Reorder the terms:
9 + -8y = 6 + -9y
Solving
9 + -8y = 6 + -9y
Solving for variable 'y'.
Move all terms containing y to the left, all other terms to the right.
Add '9y' to each side of the equation.
9 + -8y + 9y = 6 + -9y + 9y
Combine like terms: -8y + 9y = 1y
9 + 1y = 6 + -9y + 9y
Combine like terms: -9y + 9y = 0
9 + 1y = 6 + 0
9 + 1y = 6
Add '-9' to each side of the equation.
9 + -9 + 1y = 6 + -9
Combine like terms: 9 + -9 = 0
0 + 1y = 6 + -9
1y = 6 + -9
Combine like terms: 6 + -9 = -3
1y = -3
Divide each side by '1'.
y = -3
Simplifying
y = -3` | 402 | 1,000 | {"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} | 4.21875 | 4 | CC-MAIN-2018-26 | latest | en | 0.853746 |
https://mathematica.stackexchange.com/questions/108295/export-plot-to-pdf-results-very-messy | 1,721,093,300,000,000,000 | text/html | crawl-data/CC-MAIN-2024-30/segments/1720763514724.0/warc/CC-MAIN-20240715224905-20240716014905-00434.warc.gz | 332,112,821 | 41,090 | # Export Plot to PDF results very messy
When my nice looking DiscretePlot results are exported as PDF, they look very different from the original plots. For example, my original plot in Mathematica looks like
When this is exported as PDF, I have
Is there anyway I can export my plots exactly as they look?
EDIT
My model is a discrete dynamic model consisted of around ten variables and ten equations. So I used DiscretePlot, not Plot.
My code is:
a1 = 0.85;
a2 = 0.25;
L1 = 0.07;
L2 = 0.3;
w = 2;
b1 = 1;
b2 = 0.2;
x1[0] = 1;
x2[0] = 1;
p1[0] = 0.5;
p2[0] = 0.2;
mul0 = 0.9
mul1 = 3.9
mul2 = 2.8
H[0] = 1
r[0] = 0.1
x1[t_] := x1[t] = G*x1[t - 1];
x2[t_] := x2[t] = G*x2[t - 1];
mul[t_] := mul[t] = mul0 + mul1*r[t - 1] + mul2*(G - 1)
H[t_] := H[t] = H[t - 1]*G
m[t_] := m[t] = (mul[t]*H[t])/(L1*x1[t] + L2*x2[t])
exp[t_] := exp[t] = (m[t] - p2[t - 1]*w)/(p2[t - 1]*w)
r[t_] := r[t] = (exp[t]*(p2[t - 1]*w*L1*x1[t] +
p2[t - 1]*w*L2*x2[t]))/((p1[t - 1]*a1 + p2[t - 1]*w*L1)*
x1[t] + (p1[t - 1]*a2 + p2[t - 1]*w*L2)*x2[t])
p1[t_] := p1[t] = (1 + r[t])*(p1[t - 1]*a1 + p2[t - 1]*w*L1)
p2[t_] := p2[t] = (1 + r[t])*(p1[t - 1]*a2 + p2[t - 1]*w*L2)
check[t_] := check[t] = (x1[t] - a1 x1[t] - a2 x2[t])*p1[t] +
x2[t]*p2[t] -m[t]*(L1*x1[t] + L2*x2[t])
n1 = 1;
n2 = 200
Plot3 = Show[GraphicsRow[{DiscretePlot[p1[t], {t, n1, n2},
PlotLabel -> "Price 1", BaseStyle -> {FontSize -> 10},
PlotRange -> {{n1, n2}, {0, 10}}, Filling -> None,
Joined -> True],
DiscretePlot[v1[t], {t, n1, n2}, PlotLabel -> "Price 2",
BaseStyle -> {FontSize -> 10}, PlotRange -> {{n1, n2}, {0, 5}},
Filling -> None, Joined -> True],
DiscretePlot[check[t], {t, n1, n2}, PlotLabel -> "check",
BaseStyle -> {FontSize -> 10}, PlotRange -> {{n1, n2}, {0, 10}},
Filling -> None, Joined -> True]}], ImageSize -> Full]
Export["Plot3.pdf", Plot3];
• Please always add code to enable reproduction of your exact situation. Otherwise other people may waste time guessing what you did. Commented Feb 25, 2016 at 8:30
• This question will be easier to answer and more useful for others if you add a minimal working example of working code and data to show specifically what you are working with. Please edit your question to improve it. Include a minimum example of code that shows the problem and an example of the desired output. Commented Feb 25, 2016 at 8:51
• I personally stopped trying to get Graphics exported as .pdf altogether and usually use .eps instead and imbed/convert to .pdf in my external software (Adobe Illustrator, Latex ...) Commented Feb 25, 2016 at 10:30
• Probably the only surefire (and rather uninspired) approach to excatly reproduce screen appearance is to Rasterize at suitable resolution and export in PNG or similar lossless bitmap format. Related: mathematica.stackexchange.com/a/750/131 Commented Feb 25, 2016 at 18:56
1. Select the cell with the plots
2. Copy-paste into a new empty notebook
3. File -> Printing Settings -> Page Setup...
4. Choose paper size A3 and landscape
5. Save as a new pdf
6. Go to https://www.cutepdf-editor.com/edit.asp
7. Upload pdf and crop it and save it
I have experienced that some of the symbols from mathematica (such as capital gamma) appear wrong when the file is loaded in cutepdf, but when I save them and open in adobe reader, they are right again.
How are you producing the pdf? What operating system are you using? You haven't included any code, but in my attempt I don't reproduce your problem,
GraphicsRow[{
Plot[(20 Exp[-t/2] + 2 Exp[-t/20] Cos[t] + 3), {t, 0, 50},
PlotLabel -> "Price 1"],
Plot[(30 Exp[-t/2] - 2 Exp[-t/5] Cos[t] + 14), {t, 0, 50},
PlotLabel -> "Price 2"],
Plot[(2 Exp[-t/2] - 2 Exp[-t/25] Cos[t] + 6), {t, 0, 50},
PlotLabel -> "Price is Right"]}, ImageSize -> 700]
Export["pricecheck.pdf", %]
and here is a comparison of the results
• thanks so much! In fact, I used DiscretePlot. I added my code. Any followup would be greatly appreciated!
– ppp
Commented Feb 25, 2016 at 17:11 | 1,393 | 3,948 | {"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} | 2.921875 | 3 | CC-MAIN-2024-30 | latest | en | 0.736845 |
http://www.numbersaplenty.com/41344 | 1,582,820,836,000,000,000 | text/html | crawl-data/CC-MAIN-2020-10/segments/1581875146744.74/warc/CC-MAIN-20200227160355-20200227190355-00515.warc.gz | 212,648,418 | 3,638 | Search a number
41344 = 271719
BaseRepresentation
bin1010000110000000
32002201021
422012000
52310334
6515224
7231352
oct120600
962637
1041344
1129076
121bb14
1315a84
14110d2
15c3b4
hexa180
41344 has 32 divisors (see below), whose sum is σ = 91800. Its totient is φ = 18432.
The previous prime is 41341. The next prime is 41351. The reversal of 41344 is 44314.
Subtracting from 41344 its sum of digits (16), we obtain a triangular number (41328 = T287).
Adding to 41344 its reverse (44314), we get a palindrome (85658).
It is a tau number, because it is divible by the number of its divisors (32).
It is a Harshad number since it is a multiple of its sum of digits (16).
It is an Ulam number.
It is a congruent number.
It is not an unprimeable number, because it can be changed into a prime (41341) by changing a digit.
It is a polite number, since it can be written in 3 ways as a sum of consecutive naturals, for example, 2167 + ... + 2185.
241344 is an apocalyptic number.
It is an amenable number.
It is a practical number, because each smaller number is the sum of distinct divisors of 41344, and also a Zumkeller number, because its divisors can be partitioned in two sets with the same sum (45900).
41344 is an abundant number, since it is smaller than the sum of its proper divisors (50456).
It is a pseudoperfect number, because it is the sum of a subset of its proper divisors.
41344 is a wasteful number, since it uses less digits than its factorization.
41344 is an evil number, because the sum of its binary digits is even.
The sum of its prime factors is 50 (or 38 counting only the distinct ones).
The product of its digits is 192, while the sum is 16.
The square root of 41344 is about 203.3322404342. The cubic root of 41344 is about 34.5783418870.
The spelling of 41344 in words is "forty-one thousand, three hundred forty-four", and thus it is an iban number. | 544 | 1,898 | {"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} | 3.6875 | 4 | CC-MAIN-2020-10 | latest | en | 0.912292 |
syneruc.joeshammas.com | 1,568,995,667,000,000,000 | text/html | crawl-data/CC-MAIN-2019-39/segments/1568514574050.69/warc/CC-MAIN-20190920155311-20190920181311-00546.warc.gz | 692,509,829 | 4,864 | The purpose of rounding is to make a number easier to work with. Along the way you'll learn the basic ideas behind spreadsheets. The process is recursive. Perhaps you want to paste just the formatting but not the formulas, or vice versa.
Interactive practice solving systems by combination, how do you do scale factors, sample of word for today, 8th grade pre algebra worksheets. What's more, spreadsheets have strict limits on the number of rows and columns they can contain. For instance, someone who says, "I am a student," would value things associated with that self-definition.
Sorting One thing that Excel excels at is sorting data. Green reached a full dollar by Month It has four identifying features. Ben's playing is so substantial that it is almost a food upon which one dines in splendid profusion.
If you delete a row, all of the rows after it will get shifted up.
Try typing other things in A1. Go to cell A1 either with the arrow keys or by clicking there and type 1 and hit Enter. Trig solver, comparing linear equations, math dictionary for 6 graders.
Finally it was agreed, after some discussion, that the waiter would arrange to have some sandwiches created. This reference-moving isn't always desired behavior. All Clear When you Delete cells, other cells move in to fill their place. Green gives 22 cents to Mr. Blue as never changing. An operator is a symbol which effects one or more operands.
Sinclair and I found spare seats in the direct line of fire from Harry's baritone, which transpired to be a distinct improvement. Graves, in creating a definition of himself, also projects goals for the future.
Such and so many of my books as I shall mark on my said catalogue with the name of my grandson, Benjamin Franklin Bache, I do hereby give to him; and such and so many of my books as I shall mark on the said catalogue with the name of my grandson, William Bache, I do hereby give to him; and such as shall be marked with the name of Jonathan Williams, I hereby give to my cousin of that name.
Though we alternate between thinking and writing, we will tend to follow all the steps of the process fairly completely.
This stylistic feature is part of the revelation of who the writer is. This time I'm going to beat you', and we started off again. Part II, "Pattern" Chapters 5 through 8covers the four basic patterns of organization—classification, description, narration, and evaluation.
Why not take even shorter time periods? These breeds, and other less familiar kinds of cats, can be grouped into three general classes: To the children, grandchildren, and great-grandchildren of my brother James Franklin, that may be living at the time of my decease, I give fifty pounds sterling to be equally divided among them.
If you Drag-Fill text that ends in a number e. A reference to A1 will become a reference to C1. The organizing principle for narration is the relationship between events in time. How do you solve the particular solution of a second order partial differential equation?
At this point 8. The other two buttons increase and decrease the number of decimal places shown. Everything starting at the column you selected has been moved one column to the right.
For example, narrations usually have some descriptive elements in them.Subjects include math, reading, writing, science, social studies, spelling Distributive Property with Variables Worksheets 6th and 7th Grade # Using the Distributive Property (Answers Do Not Include Exponents) (A) # Properties Worksheets # High School Math Worksheets.
Download-Theses Mercredi 10 juin About Scoring Whether you are trying to create a helpful quiz or a fun personality test, you want to use Scoring.
This feature gives you the ability to. Many people believe that any equation without a radical, exponential, or polynomial. The idea of a negative exponent is a topic of discussion that should be addressed during the explanation of the definition of a polynomial.
Many students go on thinking that rational functions are a subset of the polynomials. ~ Write equivalent forms of. In fact, part of Thinking Spreadsheet is always using parenthesis to specify order of operations, even when the formula would work correctly without them.
That is, you really ought to use 2+(3*4), even though 2+3*4 would give the same answer.
1. Explain the language processing requirements of proficient reading and writing 2. Explain how problems with fluency, spelling, and written expression affect learning. 3.
Explain reasonable goals and development expectations for learners at various stages of reading and writing 4. | 954 | 4,612 | {"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} | 3.09375 | 3 | CC-MAIN-2019-39 | latest | en | 0.962766 |
https://math.answers.com/math-and-arithmetic/What_is_36_over_126_simplest_form | 1,723,007,797,000,000,000 | text/html | crawl-data/CC-MAIN-2024-33/segments/1722640682181.33/warc/CC-MAIN-20240807045851-20240807075851-00202.warc.gz | 314,149,687 | 47,177 | 0
# What is 36 over 126 simplest form?
Updated: 9/22/2023
Wiki User
11y ago
36/126 = 6/32 = 2/7
^^
Great but 6/32 should be 6/21.
Wiki User
11y ago | 66 | 156 | {"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} | 2.828125 | 3 | CC-MAIN-2024-33 | latest | en | 0.813084 |
https://www.geeksforgeeks.org/operators-in-cpp/ | 1,709,195,951,000,000,000 | text/html | crawl-data/CC-MAIN-2024-10/segments/1707947474795.48/warc/CC-MAIN-20240229071243-20240229101243-00631.warc.gz | 801,873,669 | 62,679 | # Operators in C++
An operator is a symbol that operates on a value to perform specific mathematical or logical computations. They form the foundation of any programming language. In C++, we have built-in operators to provide the required functionality.
An operator operates the operands. For example,
`int c = a + b;`
Here, ‘+’ is the addition operator. ‘a’ and ‘b’ are the operands that are being ‘added’.
Operators in C++ can be classified into 6 types:
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Bitwise Operators
5. Assignment Operators
6. Ternary or Conditional Operators
### 1) Arithmetic Operators
These operators are used to perform arithmetic or mathematical operations on the operands. For example, ‘+’ is used for addition, ‘-‘ is used for subtraction ‘*’ is used for multiplication, etc.
Arithmetic Operators can be classified into 2 Types:
A) Unary Operators: These operators operate or work with a single operand. For example: Increment(++) and Decrement(–) Operators.
Example:
the description
Output
```a++ is 10
++a is 12
b-- is 15
--b is 13```
Time Complexity: O(1)
Auxiliary Space : O(1)
Note: ++a and a++, both are increment operators, however, both are slightly different.
In ++a, the value of the variable is incremented first and then It is used in the program. In a++, the value of the variable is assigned first and then It is incremented. Similarly happens for the decrement operator.
B) Binary Operators: These operators operate or work with two operands. For example: Addition(+), Subtraction(-), etc.
Note: The Modulo operator(%) operator should only be used with integers.
Example:
## C++
`// CPP Program to demonstrate the Binary Operators``#include ``using` `namespace` `std;` `int` `main()``{`` ``int` `a = 8, b = 3;` ` ``// Addition operator`` ``cout << ``"a + b = "` `<< (a + b) << endl;`` ` ` ``// Subtraction operator`` ``cout << ``"a - b = "` `<< (a - b) << endl;`` ` ` ``// Multiplication operator`` ``cout << ``"a * b = "` `<< (a * b) << endl;`` ` ` ``// Division operator`` ``cout << ``"a / b = "` `<< (a / b) << endl;`` ` ` ``// Modulo operator`` ``cout << ``"a % b = "` `<< (a % b) << endl;` ` ``return` `0;``}`
Output
```a + b = 11
a - b = 5
a * b = 24
a / b = 2
a % b = 2```
Time Complexity: O(1)
Auxiliary Space : O(1)
### 2) Relational Operators
These operators are used for the comparison of the values of two operands. For example, ‘>’ checks if one operand is greater than the other operand or not, etc. The result returns a Boolean value, i.e., true or false.
Example:
## C++
`// CPP Program to demonstrate the Relational Operators``#include ``using` `namespace` `std;` `int` `main()``{`` ``int` `a = 6, b = 4;` ` ``// Equal to operator`` ``cout << ``"a == b is "` `<< (a == b) << endl;`` ` ` ``// Greater than operator`` ``cout << ``"a > b is "` `<< (a > b) << endl;`` ` ` ``// Greater than or Equal to operator`` ``cout << ``"a >= b is "` `<< (a >= b) << endl;`` ` ` ``// Lesser than operator`` ``cout << ``"a < b is "` `<< (a < b) << endl;`` ` ` ``// Lesser than or Equal to operator`` ``cout << ``"a <= b is "` `<< (a <= b) << endl;`` ` ` ``// true`` ``cout << ``"a != b is "` `<< (a != b) << endl;` ` ``return` `0;``}`
Output
```a == b is 0
a > b is 1
a >= b is 1
a < b is 0
a <= b is 0
a != b is 1```
Time Complexity: O(1)
Auxiliary Space : O(1)
### 3) Logical Operators
These operators are used to combine two or more conditions or constraints or to complement the evaluation of the original condition in consideration. The result returns a Boolean value, i.e., true or false.
Example:
## C++
`// CPP Program to demonstrate the Logical Operators``#include ``using` `namespace` `std;` `int` `main()``{`` ``int` `a = 6, b = 4;` ` ``// Logical AND operator`` ``cout << ``"a && b is "` `<< (a && b) << endl;`` ` ` ``// Logical OR operator`` ``cout << ``"a ! b is "` `<< (a > b) << endl;`` ` ` ``// Logical NOT operator`` ``cout << ``"!b is "` `<< (!b) << endl;` ` ``return` `0;``}`
Output
```a && b is 1
a ! b is 1
!b is 0```
Time Complexity: O(1)
Auxiliary Space : O(1)
### 4) Bitwise Operators
These operators are used to perform bit-level operations on the operands. The operators are first converted to bit-level and then the calculation is performed on the operands. Mathematical operations such as addition, subtraction, multiplication, etc. can be performed at the bit level for faster processing.
Note: Only char and int data types can be used with Bitwise Operators.
Example:
## C++
`// CPP Program to demonstrate the Bitwise Operators``#include ``using` `namespace` `std;` `int` `main()``{`` ``int` `a = 6, b = 4;` ` ``// Binary AND operator`` ``cout << ``"a & b is "` `<< (a & b) << endl;` ` ``// Binary OR operator`` ``cout << ``"a | b is "` `<< (a | b) << endl;` ` ``// Binary XOR operator`` ``cout << ``"a ^ b is "` `<< (a ^ b) << endl;` ` ``// Left Shift operator`` ``cout << ``"a<<1 is "` `<< (a << 1) << endl;` ` ``// Right Shift operator`` ``cout << ``"a>>1 is "` `<< (a >> 1) << endl;` ` ``// One’s Complement operator`` ``cout << ``"~(a) is "` `<< ~(a) << endl;` ` ``return` `0;``}`
Output
```a & b is 4
a | b is 6
a ^ b is 2
a<<1 is 12
a>>1 is 3
~(a) is -7```
Time Complexity: O(1)
Auxiliary Space : O(1)
### 5) Assignment Operators
These operators are used to assign value to a variable. The left side operand of the assignment operator is a variable and the right side operand of the assignment operator is a value. The value on the right side must be of the same data type as the variable on the left side otherwise the compiler will raise an error.
Example:
## C++
`// CPP Program to demonstrate the Assignment Operators``#include ``using` `namespace` `std;` `int` `main()``{`` ``int` `a = 6, b = 4;` ` ``// Assignment Operator`` ``cout << ``"a = "` `<< a << endl;`` ` ` ``// Add and Assignment Operator`` ``cout << ``"a += b is "` `<< (a += b) << endl;`` ` ` ``// Subtract and Assignment Operator`` ``cout << ``"a -= b is "` `<< (a -= b) << endl;`` ` ` ``// Multiply and Assignment Operator`` ``cout << ``"a *= b is "` `<< (a *= b) << endl;`` ` ` ``// Divide and Assignment Operator`` ``cout << ``"a /= b is "` `<< (a /= b) << endl;` ` ``return` `0;``}`
Output
```a = 6
a += b is 10
a -= b is 6
a *= b is 24
a /= b is 6```
Time Complexity: O(1)
Auxiliary Space : O(1)
### 6) Ternary or Conditional Operators(?:)
This operator returns the value based on the condition.
`Expression1? Expression2: Expression3`
The ternary operator ? determines the answer on the basis of the evaluation of Expression1. If it is true, then Expression2 gets evaluated and is used as the answer for the expression. If Expression1 is false, then Expression3 gets evaluated and is used as the answer for the expression.
This operator takes three operands, therefore it is known as a Ternary Operator.
Example:
## C++
`// CPP Program to demonstrate the Conditional Operators``#include ``using` `namespace` `std;` `int` `main()``{`` ``int` `a = 3, b = 4;` ` ``// Conditional Operator`` ``int` `result = (a < b) ? b : a;`` ``cout << ``"The greatest number is "` `<< result << endl;` ` ``return` `0;``}`
Output
`The greatest number is 4`
Time Complexity: O(1)
Auxiliary Space : O(1)
7) There are some other common operators available in C++ besides the operators discussed above. Following is a list of these operators discussed in detail:
A) sizeof Operator: This unary operator is used to compute the size of its operand or variable.
`sizeof(char); // returns 1`
B) Comma Operator(,): This binary operator (represented by the token) is used to evaluate its first operand and discards the result, it then evaluates the second operand and returns this value (and type). It is used to combine various expressions together.
```int a = 6;
int b = (a+1, a-2, a+5); // b = 11```
C) -> Operator: This operator is used to access the variables of classes or structures.
`cout<<emp->first_name;`
D) Cast Operator: This unary operator is used to convert one data type into another.
```float a = 11.567;
int c = (int) a; // returns 11```
E) Dot Operator(.): This operator is used to access members of structure variables or class objects in C++.
`cout<<emp.first_name;`
F) & Operator: This is a pointer operator and is used to represent the memory address of an operand.
G) * Operator: This is an Indirection Operator
## C++
`// CPP Program to demonstrate the & and * Operators``#include ``using` `namespace` `std;` `int` `main()``{`` ``int` `a = 6;`` ``int``* b;`` ``int` `c;`` ``// & Operator`` ``b = &a;` ` ``// * Operator`` ``c = *b;`` ``cout << ``" a = "` `<< a << endl;`` ``cout << ``" b = "` `<< b << endl;`` ``cout << ``" c = "` `<< c << endl;` ` ``return` `0;``}`
Output
``` a = 6
b = 0x7ffe8e8681bc
c = 6```
H) << Operator: It is called the insertion operator. It is used with cout to print the output.
I) >> Operator: It is called the extraction operator. It is used with cin to get the input.
```int a;
cin>>a;
cout<<a;```
Time Complexity: O(1)
Auxiliary Space : O(1)
Previous
Next | 2,908 | 9,306 | {"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} | 2.703125 | 3 | CC-MAIN-2024-10 | latest | en | 0.830372 |
https://grinebiter.com/Numbers/Cardinal/530-five-hundred-thirty.html | 1,571,889,782,000,000,000 | text/html | crawl-data/CC-MAIN-2019-43/segments/1570987841291.79/warc/CC-MAIN-20191024040131-20191024063631-00299.warc.gz | 518,840,662 | 3,471 | Five hundred thirty
Here is information about "five hundred thirty" that you may find useful and interesting. Number Systems Five hundred thirty is a decimal number and can be written with numbers: 530 Binary is a number system with only 0s and 1s. Five hundred thirty in binary form is displayed below: 1000010010 A Hexadecimal number has a base of 16 which means it includes the numbers 0 to 9 and A through F. Five hundred thirty converted to hexadecimal is: 212 Roman Numerals is another number system. Below is five hundred thirty in roman numerals: DXXX Scientific Notation Sometimes calculators and scientists shorten numbers using scientific notation. Here is five hundred thirty as a scientific notation: 5.3E+02 Math Here are some math facts about Five hundred thirty: Five hundred thirty is a rational number and an integer. Five hundred thirty is an even number because it is divisible by two. Five hundred thirty is divisible by the following numbers: 1, 2, 5, 10, 53, 106, 265, 530 Five hundred thirty is not a square number because no number multiplied by itself will equal five hundred thirty. Number Lookup Five hundred thirty is not the only number we have information about. Go here to look up other numbers.
Translated Here we have translated five hundred thirty into some of the most commonly used languages: Chinese: 五百三十 French: cinq cent trente German: fünfhundert dreißig Italian: cinquecento trenta Spanish: quinientos treinta
Currency Here is five hundred thirty written in different currencies: US Dollars: \$530 Canadian Dollars: CA\$530 Australian Dollars: A\$530 British Pounds: £530 Indian Rupee: ₹530 Euros: €530
Ordinal The cardinal number five hundred thirty can also be written as an ordinal number: 530th Or if you want to write it with letters only: five hundred thirtieth.
Five hundred thirty-one Go here for the next number on our list that we have information about. | 428 | 1,917 | {"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} | 2.921875 | 3 | CC-MAIN-2019-43 | latest | en | 0.90053 |
https://math.stackexchange.com/questions/4317727/if-vdash-a-then-vdash-ax-t | 1,643,140,588,000,000,000 | text/html | crawl-data/CC-MAIN-2022-05/segments/1642320304872.21/warc/CC-MAIN-20220125190255-20220125220255-00659.warc.gz | 430,512,243 | 34,895 | # If $\vdash A$, then $\vdash A[x:=t]$
Let $$A$$ be a formula, $$x$$ a variable, $$t$$ a term and $$\Gamma$$ a set of formulas. If $$\Gamma\vdash A$$ and $$x$$ is not a free variable of some open assumption, then $$\Gamma\vdash A\to\forall_xA$$ and $$\vdash \forall_xA\to A[x:=t]$$ by the natural deduction rules. Thus, $$\Gamma\vdash A[x:=t]$$.
However, I was just told that $$\tag{1}\text{If }\vdash A\text{, then }\vdash A[x:=t]$$ is also true when $$x$$ is a free variable of $$A$$. I have the impression that $$(1)$$ does not follow from the natural deduction rules and I hope someone can elaborate on this. Is $$(1)$$ an additional axiom?
Addendum: Maybe I should mention how derivability was defined in my lecture:
Definition: A formula $$A$$ is called derivable in minimal logic, written $$\vdash A$$, if there is a derivation of $$A$$ without free assumptions using the natural deduction rules. $$A$$ is called derivable from assumptions $$A_1, \ldots, A_n$$ if there is a derivation of $$A$$ with free assumptions among $$A_1, \ldots, A_n$$. Let $$\Gamma$$ be a set of formulas. We write $$\Gamma\vdash A$$ if the formula $$A$$ is derivable from finitely many assumptions $$A_1,\ldots , A_n \in\Gamma$$.
• How do you interpret "$\vdash A$" when $A$ is not a closed formula? It's either nonsense or it means that $A$ is provable no matter what terms you put for the free variables.
– Karl
Nov 27 '21 at 16:50
• @Karl From my lecture notes: A formula $A$ is called derivable in minimal logic, written $\vdash A$, if there is a derivation of $A$ without free assumptions using the natural deduction rules. Nov 27 '21 at 16:52
• Also note that your conclusion that $\vdash A\to A[x:=t]$ when $x$ is not free in $A$ is sort of vacuously true, since $[x:=t]$ only modifies free occurrences of $x$.
– Karl
Nov 27 '21 at 16:55
• Right, so how would one derive a formula containing a free variable?
– Karl
Nov 27 '21 at 16:56
• @Karl I don't really know what to answer. We simply assume that $A$ is derivable. Maybe we can even consider the case $\Gamma\vdash A$ and ask if this implies $\Gamma\vdash A[x:=t]$. Of course, the fact that I don't see a problem doesn't mean that there isn't one. Nov 27 '21 at 17:05
Based on your most recent comment, yes, (1) is a special case when $$\Gamma$$ is empty.
I'm not exactly sure what part of the argument in the introduction you're skeptical of. I'm writing the answer under the assumption that it's the side condition that we impose on $$\Gamma$$. If this is mistaken, I'll amend my answer. I'm trying to avoid retreating to the semantics of first-order minimal logic (which is the system I think you're working in).
So, we have a way of eliminating the pesky side condition that $$x$$ does not occur as a free variable of any open assumption. That side condition is very convenient to use in a proof calculus though.
$$\frac{\Gamma \vdash A}{\Gamma[x := t] \vdash A[x:=t]} \;\; \text{holds}$$
Imposing the side condition is just a way of making sure that $$\Gamma$$ is equal to $$\Gamma[x:=t]$$.
When $$\Gamma$$ is empty the side condition is trivial since $$\varnothing$$ never contains any formulas and thus never contains any free variables.
• Thank you very much for the answer. The problem is that we haven't really discussed when and how the expression $A[x:=t]$ is defined in the lecture. I have the impression that you are using the following fact: If $x$ is not free in $B$, then $B[x:=t]=B$. Is that correct? Nov 27 '21 at 18:45
• Yes, what you are saying is correct. $A[x:=t]$ is equal to $A$ if and only if $x$ is equal to $t$ or $x \not\in \text{FV}(A)$. Let $\text{FV}(A)$ refer to the free variables of $A$. $A[x:=t]$ can be defined inductively on formulas by finding free occurrences of $x$ and replacing them with $t$. There is some complexity that you have to deal with if $t$ itself has free variables that might end up being captured. For example, what should the following mean: $(\forall y \mathop. x =y)[y := f(x)]$ ? I don't think there's one universal convention for how to deal with this problem. Nov 27 '21 at 18:55 | 1,166 | 4,100 | {"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": 33, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.765625 | 4 | CC-MAIN-2022-05 | latest | en | 0.904271 |
https://schoolbag.info/physics/physics_math/13.html | 1,669,976,922,000,000,000 | text/html | crawl-data/CC-MAIN-2022-49/segments/1669446710900.9/warc/CC-MAIN-20221202082526-20221202112526-00119.warc.gz | 566,474,809 | 6,235 | Conclusion - Work and Energy - MCAT Physics and Math Review
## Chapter 2: Work and Energy
### Conclusion
The conceptualization of energy as the capacity to do something or make something happen is a very broad definition. However, such an all-encompassing definition allows us to understand everything from pushing a rock up a hill to melting an ice cube, from stopping a car at an intersection to harnessing the energy of biomolecules in metabolism, to all be forms of energy transfer. Indeed, energy on its own has little significance without considering the transference of energy, either through work or heat. The work–energy theorem is a powerful expression that will guide our approach to many problems in the Chemical and Physical Foundations of Biological Systems section. We also covered the application of energy and work with simple machines, such as levers, inclined planes, and pulleys. These devices assist us in accomplishing work by reducing the forces necessary for displacing objects.
Preparing for the MCAT is hard (mental) work, but you are well on your way to achieving success on Test Day. This MCAT Physics and Math Review book (and all the materials provided in your Kaplan program) is part of a set of tools—your simple machines, if you will—that will provide you with the mechanical advantage to ease your efforts toward a higher score.
### Concept Summary
Energy
· Energy is the property of a system that enables it to do something or make something happen, including the capacity to do work. The SI units for all forms of energy are joules (J).
· Kinetic energy is energy associated with the movement of objects. It depends on mass and speed squared (not velocity).
· Potential energy is energy stored within a system. It exists in gravitational, elastic, electric, and chemical forms.
o Gravitational potential energy is related to the mass of an object and its height above a zero-point, called a datum.
o Elastic potential energy is related to the spring constant (a measure of the stiffness of a spring) and the degree of stretch or compression of a spring squared.
o Electrical potential energy exists between charged particles.
o Chemical potential energy is the energy stored in the bonds of compounds.
· The total mechanical energy of a system is the sum of its kinetic and potential energies.
· Conservative forces are path independent and do not dissipate the mechanical energy of a system.
o If only conservative forces are acting on an object, the total mechanical energy is conserved.
o Examples of conservative forces include gravity and electrostatic forces. Elastic forces, such as those created by springs, are nearly conservative.
· Nonconservative forces are path dependent and cause dissipation of mechanical energy from a system.
o While total energy is conserved, some mechanical energy is lost as thermal or chemical energy.
o Examples of nonconservative forces include friction, air resistance and viscous drag.
Work
· Work is a process by which energy is transferred from one system to another.
o Work may be expressed as the dot product of force and displacement, or the product of force and distance traveled with the cosine of the angle between the two.
o Work may also be expressed as the area under a pressure–volume (P–V) curve.
· Power is the rate at which work is done or energy is transferred. The SI unit for power is the watt (W).
· The work–energy theorem states that when net work is done on or by a system, the system’s kinetic energy will change by the same amount. In more general applications, the work done on or by a system can be transferred to other forms of energy as well.
· Mechanical advantage is the factor by which a simple machine multiplies the input force to accomplish work.
· The six simple machines are the inclined plane, wedge, wheel and axle, lever, pulley, and screw. Simple machines provide the benefit of mechanical advantage.
· Mechanical advantage makes it easier to accomplish a given amount of work because the input force necessary to accomplish the work is reduced; the distance through which the reduced input force must be applied, however, is increased by the same factor (assuming 100% efficiency).
· The load is the output force of a simple machine, which acts over a given load distance to determine the work output of the simple machine. The effort is the input force of a simple machine, which acts over a given effort distance to determine the work input of the simple machine.
· Efficiency is the ratio of the machine’s work output to work input when nonconservative forces are taken into account.
### Answers to Concept Checks
· 2.1
1. Kinetic energy is the energy of motion. It is related to the mass of an object as well as its speed squared.
Potential energy is energy associated with a given position or intrinsic property of a system; it is stored in gravitational, electrical, elastic, or chemical forms. Gravitational potential energy is directly related to the mass of the object and its height above a reference point.
2.
Conservative Forces Nonconservative Forces What happens to total mechanical energy of the system? Remains constant Decreases (energy is dissipated) Does the path taken matter? No Yes; more energy is dissipated with a longer path What are some examples? Gravity Electrostatic forces Elastic forces (approximately conservative) Friction Air resistance Viscous drag
· 2.2
1. The unit of work is the joule, which is also the unit for energy. Work and energy are related concepts. By performing work, the energy of a system is changed. Work, along with heat, is a form of energy transfer.
2. Three methods for calculating work discussed in this chapter are:
1. W = Fd cos θ (the dot product of the force and displacement vectors)
2. W = PΔV (the area under a pressure–volume curve)
3. Wnet = ΔK (the work–energy theorem)
· 2.3
1. As the length of an inclined plane increases, the amount of force necessary to perform the same amount of work (moving the object the same displacement) decreases.
2. As the effort (required force) decreases in a pulley system, the effort distance increases to generate the same amount of work.
3. The decrease in work output is due to nonconservative or external forces that generate or dissipate energy.
4. When a device provides mechanical advantage, it decreases the input force required to generate a particular output force. Generally, this is accomplished at the expense of increased distance over which the force must act.
5. The six simple machines are: inclined plane, wedge, wheel and axle, lever, pulley, and screw.
### Equations to Remember
(2.1) Kinetic energy:
(2.2) Gravitational potential energy: U = mgh
(2.3) Elastic potential energy:
(2.4) Total mechanical energy: E = U + K
(2.5) Conservation of mechanical energy: ΔE = ΔU + ΔK = 0
(2.6) Work done by nonconservative forces: Wnonconservative = ΔE = ΔU + ΔK
(2.7) Definition of work (mechanical): W = F · d = Fd cos θ
(2.8) Definition of work (isobaric gas–piston system): W = PΔV
(2.9) Definition of power:
(2.10) Work–Energy theorem: Wnet = ΔK = KfKi
(2.12) Efficiency:
### Shared Concepts
· Biochemistry Chapter 6
o DNA and Biotechnology
· Biochemistry Chapter 9
o Carbohydrate Metabolism I
· Biochemistry Chapter 12
o Bioenergetics and Regulation of Metabolism
· General Chemistry Chapter 7
o Thermochemistry
· Physics and Math Chapter 1
o Kinematics and Dynamics
· Physics and Math Chapter 3
o Thermodynamics
| 1,659 | 7,529 | {"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} | 3.578125 | 4 | CC-MAIN-2022-49 | latest | en | 0.931579 |
https://web2.0calc.com/questions/geometric-series_21 | 1,618,682,630,000,000,000 | text/html | crawl-data/CC-MAIN-2021-17/segments/1618038461619.53/warc/CC-MAIN-20210417162353-20210417192353-00450.warc.gz | 694,365,289 | 5,429 | +0
# geometric series
0
79
1
An infinite geometric series has common ratio 1/8 and sum 80. What is the first term of the series?
Jan 6, 2021
#1
+218
+1
We can set a to be the first term and r to be the ratio.
Using the infinite geometric series formula \(S=a/(1-r)\) where S is the sum, we can plug in values to get \(80=a/(7/8)\) so a=70.
:D
Jan 6, 2021 | 127 | 363 | {"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} | 3.78125 | 4 | CC-MAIN-2021-17 | latest | en | 0.826508 |
https://modeltheory.fandom.com/wiki/O-minimality | 1,555,943,170,000,000,000 | text/html | crawl-data/CC-MAIN-2019-18/segments/1555578555187.49/warc/CC-MAIN-20190422135420-20190422161420-00557.warc.gz | 495,643,467 | 32,198 | ## FANDOM
78 Pages
A structure $(M,<,\ldots)$ is said to be o-minimal if every subset $X \subset M^1$ definable with parameters from $M$ can be written as a finite union of points and intervals, i.e., as a boolean combination of sets of the form $\{x \in M : x \le a\}$ and $\{x \in M : x \ge a\}$. Note that this is an assertion about subsets of $M^1$, not definable sets in higher dimensions.
This notion is analogous to minimality. In minimality, one assumes that the definable (one-dimensional) sets are quantifier-free definable using nothing but equality. Here, one assumes that the (one-dimensional) sets are quantifier-free definable using nothing but the ordering.
A theory $T$ with a predicate $<$ is said to be o-minimal if every model of $T$ is o-minimal. Unlike the case of minimality vs. strong minimality, there is no notion of strong o-minimality. It turns out that any elementary extension of an o-minimal structure is o-minimal. Consequently, the true theory of any o-minimal structure is an o-minimal theory. The proof of this is rather non-trivial, and uses the cell decomposition result for o-minimal theories.
Often one restricts to the class of o-minimal structures/theories in which the ordering $(M,<)$ is dense, i.e., a model of DLO. Most o-minimal theories of interest have this property, and many proofs can be simplified with this assumption.
## Examples Edit
Some relatively elementary examples:
• DLO, the theory of dense linear orders. This is the true theory of $(\mathbb{Q},<)$.
• RCF, the theory of real closed fields. This is the true theory of $\mathbb{R}$ as an ordered field.
• DOAG or ODAG, the theory of divisible ordered abelian groups. This is the true theory of $(\mathbb{R},+,<)$.
By hard theorems of Alex Wilkie and other people, certain expansions of the ordered field $\mathbb{R}$ are known to be o-minimal.
• The structure $\mathbb{R}_{exp} := (\mathbb{R},+,\cdot,\exp)$ was proven to be o-minimal by Alex Wilkie. This structure consists of the ordered field $\mathbb{R}$ expanded by adding in a predicate for the exponentiation map. This example is somewhat surprising, given that we lack a recursive axiomatization of this structure.
• The structure $\mathbb{R}_{an}$, consisting of the ordered field $\mathbb{R}$ with restricted analytic functions, is o-minimal. For each real-analytic function $f$ on an open neighborhood of $[0,1]^n$, one adds a function symbol for $f$ restricted to $[0,1]$. This does not subsume $\mathbb{R}_{exp}$, since $\exp$ turns out to not be definable in $\mathbb{R}_{an}$. In fact the o-minimality of $\mathbb{R}_{an}$ is a more basic result. It is essentially Gabrielov's theorem.
• More generally, $\mathbb{R}_{an,exp}$ is o-minimal. This is the expansion of $\mathbb{R}$ obtained by adding in both the exponential map and the restricted analytic functions.
• More generally, one can add all Pfaffian functions. The most general result in this direction is due to Speissegger, maybe.
## Properties Edit
O-minimal theories are NIP, but never stable or simple, as they have the order property. O-minimal theories are also superrosy, of finite rank.
In any o-minimal theory, definable closure and algebraic closure agree (on account of the ordering), and these operations define a pregeometry on the home sort. This yields a well-defined notion of dimension of definable sets.
Not all o-minimal theories eliminate imaginaries, even after naming all parameters from a model. However, o-minimal expansions of RCF always eliminate imaginaries, and in fact have definable choice (which includes definable Skolem functions). The same holds for o-minimal expansions of DOAG after naming at least one non-zero element.
Definable functions and definable sets have many nice structural properties. For simplicity assume that the order is dense. Then one has the following results:
• Every definable function $f : M^1 \to M^n$ is piecewise continuous: the domain of $f$ can be written as a finite union of intervals, such that on each interval, $f$ is continuous. If $n = 1$, then one can also arrange that on each interval, $f$ is either constant, or strictly increasing, or strictly decreasing.
• Every definable subset of $M^n$ has finitely many definably connected components. In the presence of definable Skolem functions, each piece is definably path-connected.
• More precisely, every definable subset $X \subset M^n$ has a cell-decomposition: it can be written as disjoint union of sets that are "cells" in a certain sense. Each cell is definably connected, and in the case of o-minimal expansions of RCF, is definably homeomorphic to a ball.
• If $f : M^n \to M^m$ is a definable function, then the domain of $f$ has a cell decomposition such that the restriction of $f$ to each cell is continuous.
• If $X \subset M^n$, the topological closure $\overline{X}$ of $X$ has dimension no bigger than $X$, and the frontier $\overline{X} \setminus X$ has strictly lower dimension than $X$.
Many of the topological pathologies that are common in pointset topology and real analysis don't occur when working with definable sets in o-minimal expansions of the reals. For example, every definable set is locally path-connected, every connected component is path connected, every set without interior is nowhere dense, and every definable set is homotopy equivalent to a finite simplicial complex. Moreover, every continuous definable function is piecewise differentiable, and in fact piecewise $C^k$ for every $k < \infty$. One also knows that if $f$ and $g$ are two definable functions $\mathbb{R} \to \mathbb{R}$, then $f$ and $g$ are asymptotically comparable. Limits always exist (possibly taking values $\pm \infty$).
These results apply in particular to, e.g., the structure $(\mathbb{R},+,\cdot,\exp)$. In sharp contrast, the definable sets in $(\mathbb{R},+,\cdot,\sin)$ are exactly the sets in the projective hierarchy, so e.g. there are definable sets which are not Borel.
## O-minimal trichotomy Edit
Some analog of the Zilber trichotomy holds in the o-minimal setting.
## Applications Edit
Real algebraic geometry, Pila-Wilkie… | 1,522 | 6,130 | {"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} | 2.6875 | 3 | CC-MAIN-2019-18 | latest | en | 0.891052 |
https://study.com/academy/answer/the-volume-of-a-growing-spherical-cell-is-v-frac-4-3-pi-r-3-where-the-radius-is-measured-in-micrometers-find-the-average-rate-of-change-of-v-with-respect-to-r-when-r-changes-from.html | 1,642,697,977,000,000,000 | text/html | crawl-data/CC-MAIN-2022-05/segments/1642320302355.97/warc/CC-MAIN-20220120160411-20220120190411-00075.warc.gz | 585,079,864 | 21,589 | # The volume of a growing spherical cell is V = \frac{4}{3} \pi r^3 , where the radius is...
## Question:
The volume of a growing spherical cell is {eq}V = \frac{4}{3} \pi r^3 {/eq}, where the radius is measured in micrometers. Find the average rate of change of {eq}V {/eq} with respect to {eq}r {/eq} when {eq}r {/eq} changes from
(i) 3 to 6 micrometers
(ii) 3 to 4 micrometers
(iii) 3 to 3.1 micrometers
## Average Rate of Change:
Suppose, we have a function {eq}y = f(x) {/eq} and we want to find the average rate of change of this function from {eq}x = a {/eq} to {eq}x = b {/eq}
Then, the average rate of change is:
{eq}f_{avg} = \frac{f(b) - f(a)}{b-a} {/eq}
Become a Study.com member to unlock this answer! Create your account
The volume function of a growing spherical cell is given by:
{eq}V(r) = \frac{4}{3} \pi r^3 {/eq}
Where {eq}r {/eq} is the radius of the spherical...
Average Rate of Change: Definition, Formula & Examples
from
Chapter 20 / Lesson 5
42K
Finding the average rate of change is similar to finding the slope of a line. Study the definition of average rate of change, its formula, and examples of this concept. | 366 | 1,156 | {"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} | 4 | 4 | CC-MAIN-2022-05 | latest | en | 0.844135 |
https://gasstationwithoutpumps.wordpress.com/2012/06/04/soda-bottle-rocket-simulation-take-2/ | 1,669,489,284,000,000,000 | text/html | crawl-data/CC-MAIN-2022-49/segments/1669446708046.99/warc/CC-MAIN-20221126180719-20221126210719-00692.warc.gz | 326,398,994 | 44,604 | # Gas station without pumps
## 2012 June 4
### Soda-bottle rocket simulation: take 2
Launcher with empty 1.3 liter bottle.
In my Soda-bottle rocket simulation post, I posted a buggy version of a water rocket simulation that my students had written, and that I had helped them extend. I asked for help on both this blog and the AP-physics mailing list, since it was clear to me that the simulation was not doing a good job of capturing the phenomena even qualitatively.
Several people pointed me to an old article:
Soda-Bottle Water Rockets
David Kagan, Louis Buchholtz, and Lynda Klein
The Physics Teacher 33:150-157, March 1995
I read that article using the university library subscription (there may be copies on the web that aren’t behind the paywall, but I didn’t look for them). I also did a lot of poking around on the web (mainly in Wikipedia). I found a number of bugs in the simulation, the most important of which was that the students had computed the momentum change of the rocket based on the velocity of the exhaust relative to the ground, rather than relative to the rocket.
I reworked the water jet to include a correction for the cross-sectional area of the bottle, though this makes less than a half-a-percent difference for the bottles we were using. I also followed the lead of Kagan et al. and used a fixed exhaust volume for the water, rather than a fixed time step in the simulation. They had used far too large a step (10–30 cc) in their simulation, resulting in over-estimates of the speed and “burnout” height.
The biggest problems with their simulation (which I’ll call the KBK simulation), though, were that they did not simulate air drag or the air jet that occurs once the water has been emptied. These two corrections change the max height from about 136m to about 19m, a much more reasonable number.
The air jet is essential in modeling what happens when an empty bottle is launched. Their simulation suggests that it doesn’t move, but experimentally it goes quite high—maybe half as high as an optimally filled bottle. When I duplicated their simulation, I saw that they still had an extra atmosphere or more of pressure in the bottle at their reported “burnout”. I had the simulation record data at this point (when the bottle emptied of water) and at the real burnout (when the pressure inside dropped to the ambient). If the bottle is overfilled, there may not be enough air pressure to empty it. The point where bottle is full enough that the air pressure is just enough to empty the bottle is an interesting one, as it seems to maximize the burnout height (though not the max height, as the speed at burnout is fairly low then). There also seems to be a bit of glitch in the simulation just above that fill level—I’ve not tracked down the bug yet, but I think it may be from the last packet of water dropping the internal pressure below ambient.
The air-jet simulation that we had written was based on crude modifications to the water-jet code, and it did not seem to work at all. Because the Matter and Interactions textbook we’ve been using does not cover anything on fluid flow (not even Bernoulli’s principle for incompressible fluids), I read a number of Wikipedia articles. This is one area of Wikipedia where the articles are far from being standalone—they look like they were extracted from the middle of physics book without providing the links to the required prerequisite material.
I did finally find some good approximations I could use in Orifice plate and Choked flow, which turned out to be better explanations than in Rocket nozzle and more detailed than the article on Bernoulli’s Principle. I ended up modeling both choked flow and subsonic flow, as both seem to be relevant for the soda-bottle rocket.
The bottle doesn’t have an expansion nozzle, but the simulation suggests that adding one might get better performance since the air-jet contributes a lot and we should be able to get at least the first part of the air jet to be supersonic with an appropriate nozzle. I’ve not yet investigated what the specs should be for the nozzle. Rigging up a nozzle that doesn’t interfere with the launch release on the Aquaport launcher might be tough, and I don’t want to build another launcher.
We now get a reasonable result for the optimal fill, at around 350 mL for a 1.3 L bottle (27% full) or 600mL for a 2L bottle (30% full). The empty and full bottles behave reasonably, and the 14g paper and masking tape “rocket” fired with compressed air off a 30cm long launching tube is simulated to go about 4.5 times as high as a 2L soda bottle.
Plot of maximum height vs. the amount of water in the bottle, for both the new simulation and the simulation in the paper by K, Buchholtz, and Klein. Note that adding the drag force makes the maximum height almost independent of fill for a wide range, and adding the air jet gives a reasonable value for the launch of an empty bottle.
I was going to post the data files from the simulations, but WordPress.com does not support any reasonable plain-text formats—a major irritation that I’ve had with them repeatedly. If people want to look at the simulation outputs and have too much trouble re-running them, I can try putting the outputs elsewhere and linking to them.
Burnout speed as a function of water fill. Note that the air jet increases the burnout speed substantially for nearly empty bottles, and that there is a small boost throughout from treating the liftoff from the launcher like a very short-barrel gun. The air drag has very little effect for the short duration of the powered phase of the flight—it mainly affect the ballistic phase.
The KBK simulation is done with finer-grain simulation steps than in the paper, avoiding their 10% overshoot from too large a step.
Height at which the bottle stops expelling water, either because the water is all gone, or because the air pressure has dropped to the ambient pressure. Note that the KBK claim that the this is well fit by a straight line corresponding to a cylinder of water from the nozzle does not match even their simulation, except around the 35% fill region.
I find the cusp near 1.35 L interesting—this is where the rocket just finishes emptying the water when it runs out of pressure. That’s the setting to maximize the height from which water rains down on people, I think. I suspect that with exactly the right settings, this height is the same as the max height, with the water slowly dribbling out as the rocket it traveling almost ballisticly.
We still need to do a lot of launches with various amounts of water and measure the flights. My main concern here is coming up with an accurate measurement. Lots of people do water and compressed-air rocket labs of various sorts, and I was pointed to a number of methods. The most common ones measure height with trigonometry, measuring angles with a couple of theodolites. In a comment on the previous post, TW pointed me to two good tutorials: “a single station method, http://www.apogeerockets.com/education/downloads/newsletter92.pdf Or you can use a two station method.http://www.apogeerockets.com/education/downloads/newsletter93.pdf” I don’t want to build theodolites for just this experiment, though.
The KBK article mentioned using a thread wrapped around a Pasco super pulley (\$24) which is similar to the Vernier “Ultra Pulley” (\$24). The thread-and-pulley approach seems good for getting finely spaced measurements for the first couple of meters (validating the simulation up to burnout), but not so good for measuring max height.
The other approach is to use video, but that again is best at measuring the first few meters of the launch.
I considered measuring time of flight (which is simpler to measure than height), but the variation in time of flight is fairly small.
The drag model is still a very crude one from first principles, with a guess at the drag coefficient. We should probably do some experiments towing a soda bottle on a string with a force gauge. There is a long enough hill on campus that we should be able to make measurements up to 15 m/s, if we don’t crash trying to stay on the bike path, read the bike speed, and read the force gauge all at once. Still, that 15 m/s is nowhere near the 55 m/s maximum predicted by the simulation. I’ll need to think a bit more about how to measure drag safely.
Here is the latest draft of the simulation code, which uses the VPython library for graphing and the Unum library for handling units. The code would run much faster without the Unum units in every computation.
```# Soda Bottle Rocket Simulation
# Mon Jun 4 08:30:18 PDT 2012
# Kevin Karplus, Abe Karplus, Milo B.
# This 1D simulation of soda-bottle water rockets was started as
# a homework exercise in a home-school high school physics class.
# After the initial programming was done, the program was compared to the
# simulation described in
# Soda-Bottle Water Rockets
# David Kagan, Louis Buchholtz, and Lynda Klein
# The Physics Teacher 33:150-157, March 1995
#
# A few bugs in the program were fixed based on that comparison,
# but this simulation simulates several phenomena that the KBK
# simulation did not---including drag and the jet of air that occurs
# after the water has run out. The air jet is particularly important
# for simulating what happens when an empty bottle is launched.
#
# The drag model is extremely crude and the drag coefficient is a guess.
# Experiments towing empty soda bottles at different speeds would be needed to
# construct and validate a better drag model.
# Tumbling of the bottle (easily observed) has not been incorporated into the
# the drag model.
#
# The model has not yet been compared to experimental data.
### Module Imports
from __future__ import division
from argparse import ArgumentParser
from math import sqrt, pi
# The VPython package is used only for graphs, and can
# be replaced by other graphing packages (or the graphs can be
# removed from the simulator, and external plotting programs used).
import vis
from vis import crayola as color
from vis.graph import gcurve, gdisplay
# The Unum package is used to be sure that units are consistently
# handled throughout the simulation.
# The program could be sped up substantially by using some convention
# about units for each variable, at some risk of introducing
# hard-to-detect errors.
# An ideal compromise would be to have compile-time unit checking and conversion,
# but Python does not offer an easy way to do that.
from unum.units import *
from unum import Unum
Unum.VALUE_FORMAT = "%9.4f" # format for printing units
# derived units
cc = cm*cm*cm
kPa = Unum.unit("kPa", 1000.*Pa, "kilopascal")
# non-standard pressure units (definitions form www.wolframalpha.com)
psi = Unum.unit("psi", 8896442230521./1290320000. *Pa, "pounds per square inch")
inHg = Unum.unit("inHg", 514731./152. * Pa, "inches of mercury")
## Debugging check that pressure units ok
# print "DEBUG: 1 psi=", psi.asUnit(kPa), "1 inch of mercury=", inHg.asUnit(kPa)
def unit_sqrt(squared_unum):
"""sqrt function for the Unum package, retaining appropriate units"""
square_exps = squared_unum._unit
exps = {unit: square_exps[unit]/2 for unit in square_exps}
new_unit = Unum(exps,1)
return sqrt(squared_unum.asNumber(new_unit*new_unit))*new_unit
### Physical constants
g_grav = 9.80665* m/s/s # standard gravity
gravity_acceleration = 9.7995 * m/s/s # from Wolfram Alpha's gravitational field widget
# for the gravitational field in Santa Cruz, CA
# http://www.wolframalpha.com/widgets/view.jsp?id=d34e8683df527e3555153d979bcda9cf
water_density = 1 * g/cc
# We'll ignore any slight changes in water density due to temperature or impurities.
specific_gas_constant_for_dry_air = 287.058 * J/(kg * K)
# http://en.wikipedia.org/wiki/Density_of_air
specific_gas_constant_for_water_vapor = 461.5 * J/(kg * K)
# http://www.engineeringtoolbox.com/density-air-d_680.html
# http://en.wikipedia.org/wiki/Heat_capacity_ratio
# based on the approximation that air is a diatomic ideal gas
# ratio needed for compressible flow equation
# http://en.wikipedia.org/wiki/Bernoulli%27s_equation
# flow is choked if the ratio of pressures is greater than the choked_flow_limit
# http://en.wikipedia.org/wiki/Choked_flow
def air_density_from_pressure_temp_humidity(p,t,h):
# Compute the density of the air from absolute pressure, absolute temperature, and relative humidity
return p /(specific_gas_constant_for_dry_air* t) \
* (1+h)/(1+h*specific_gas_constant_for_water_vapor/specific_gas_constant_for_dry_air)
## Debugging check that air density ok.
# standard_air_density = air_density_from_pressure_temp_humidity(100*kPa, 273.15*K, 0.0)
# print "DEBUG: Standard air density should be 1.2754 kg/m3, is {}".format(standard_air_density)
def sign(x):
"""return the sign of a number"""
return 1 if x>0 else 0 if x==0 else -1
### Class for defining rocket parameters
class rocket_type:
def __init__(self,name,
nozzle_diameter=2.13*cm, # measured for soda bottles
launcher_length=2.2*cm, # measured for AquaPod launcher (2.2cm or 2.4cm to O-ring, 3.6cm full lenth)
drag_coefficient=1.2, # guess at drag coefficient
bottle_diameter=None, # compute if not provided
bottle_volume=None, # compute if not provided
bottle_mass=48*g, # measured for Crystal Geyser bottle
do_air_jet=True):
self.name=name
self.nozzle_diameter=nozzle_diameter
self.nozzle_area= pi/4 * nozzle_diameter*nozzle_diameter
self.launcher_length = launcher_length
self.drag_coefficient=drag_coefficient
# The default value is a guess at drag coefficient for a possibly tumbling bottle
# Use 0.82 for long cylinder, 0.47 for sphere, 0.75 for model rocket
# http://en.wikipedia.org/wiki/Drag_coefficient
if bottle_diameter is None:
bottle_diameter= nozzle_diameter+2*mm # assume cylinder, with 1mm walls (measured for paper rocket)
self.bottle_diameter=bottle_diameter
self.bottle_area = pi/4 * bottle_diameter *bottle_diameter
# Note: the bottle diameters are measured on the outside, to get frontal area for the
# drag calculations, but the same values are used for the inside diameter to get the
# cross-sectional area of the bottle in computing the speed of the water jet.
if bottle_volume is None:
bottle_volume = self.nozzle_area * launcher_length # assume cylinder
self.bottle_volume =bottle_volume
self.bottle_mass =bottle_mass
self.do_air_jet=do_air_jet
self.speed2_scale = 1- (self.nozzle_area/self.bottle_area)**2
# scaling factor for square of speed of exhaust
# see Bernoulli's principle for incompressible flow
# sqrt(speed2_scale) is called the "velocity of approach factor" in
# http://en.wikipedia.org/wiki/Orifice_plate
def __str__(self):
print_items = ["name", "launcher_length", "nozzle_diameter", "nozzle_area",
"bottle_diameter", "bottle_area", "bottle_volume", "bottle_mass",
"drag_coefficient", "do_air_jet"]
return "\n".join(["# {}={}".format(x,self.__dict__[x]) for x in print_items])
def air_drag(self,v,density):
"""a simple drag model, returning 1D force as a function of velocity
and the density of the surrounding air.
This should probably be replaced by an empirically validated drag model.
"""
return -sign(v.asNumber(m/s))*0.5*density*v*v*self.drag_coefficient*self.bottle_area
### Define some standard rockets
# a 1.3 liter bottle for Crystal Geyser sparkling mineral water
rocket_cg = rocket_type("1.3liter",
bottle_volume = 1.302*L, # measured
bottle_diameter = 9.19*cm, # measured (outside diameter)
bottle_mass = 48*g) # measured
# a paper "rocket" made at Maker Faire 2012, launched with a blast of 50psi air
rocket_paper = rocket_type("paper",
launcher_length = 30*cm, #measured
nozzle_diameter = 2.125*cm, # measured
bottle_mass = 14*g, #measured
drag_coefficient = 0.8) # guess at drag coefficient (0.82 for long cylinder, 0.47 for sphere, 0.75 for model rocket)
# a 2 liter soda bottle, measurements from Kagan, Buchholtz, and Klein
rocket_2L = rocket_type("2liter",
bottle_diameter = 11.0*cm,
bottle_volume = 2.08*L,
bottle_mass = 48.4*g)
# a 2 liter soda bottle, measurements from Kagan, Buchholtz, and Klein
# Turn off air-jet simulation, drag, and initial boost from launcher
# in an attempt to match the simulation in Kagan, Buchholtz, and Klein paper
rocket_KBK = rocket_type("KBK",
bottle_diameter = 11.0*cm,
bottle_volume = 2.08*L,
bottle_mass = 48.4*g,
launcher_length=0*cm,
do_air_jet=False,
drag_coefficient=0)
# What rockets are allowed to be specified on the command line?
rockets= [rocket_cg, rocket_paper, rocket_2L, rocket_KBK]
### Command-line Argument Parsing
# The argparse module has been used to provide command-line options for specifying
# various parameters and control options. It also provides a simple help system
# invoked by running
# rocket_3.py --help
parser = ArgumentParser(description='Bottle rocket simulator.')
help="""if set, use "rate" function to try to make simulation run at real speed
""")
help="""if set, graph various rocket measurements as functions of time.
""")
help="""ambient temperature in Celsius
default=%default
""")
help="""relative humidity (between 0 and 1.0)
default=%default
""")
parser.add_argument('--rocket', default="1.3liter", choices=[r.name for r in rockets],
help="""rocket types set several parameters:
1.3liter a Crystal Geyser water bottle
paper a paper "rocket" launched on compressed air
2liter a 2-liter soda bottle
KBK a 2-liter soda bottle, with no drag and no air jet,
to match parameters in paper by Kagan, Buchholtz, and Klein
default=%default
""")
help="""increment for initial water amount in grams.
Used for plotting rocket behavior with different amounts of water initially in bottle.
default=%default
""")
help="""time step in seconds for ballistic phase
default=%default
""")
help="""volume step in cc for water_jet phase
default=%default
Note: Kagan, Buchholtz, and Klein used much too large a step (10cc to 30cc)
""")
parser.add_argument('-p', '--pressure', default=(50*psi).asNumber(bar), type=float, help="gauge pressure in bar")
parser.add_argument('-b', '--barometric', default=29.936, type=float, help="barometric pressure in inches of Mercury")
args = parser.parse_args()
# We need temperature on an absolute scale, not Celsius
init_temperature = (args.temperature+ 273.15)* K
gauge_pressure= args.pressure * bar # pressure read from the bicycle pump
barometric_pressure = (args.barometric*inHg).asUnit(bar) # ambient air pressure
barometric_density = air_density_from_pressure_temp_humidity(barometric_pressure, \
init_temperature,args.humidity)
# density of the ambient air, used for the drag model
# Look for rocket in rockets (it must be there)
for rocket in rockets:
if rocket.name==args.rocket:
break
# Echo the parameters, so that the output is properly documented.
# It might be a good idea to output a program version number and a date as well,
# but that is left as a future enhancement.
print "# Gauge pressure=", gauge_pressure.asUnit(bar), gauge_pressure.asUnit(psi)
print "# barometric pressure=", \
barometric_pressure.asUnit(inHg), \
barometric_pressure.asUnit(bar), \
barometric_pressure.asUnit(psi)
print rocket
# The setup for the graph windows is rather crude,
# with which properties are plotted determined by commenting out code in 3 places.
# The code has not been improved, since we don't use the graphs often.
if args.graph:
position_window =gdisplay(title='Position (m)', y=0, foreground=color.black, background=color.white)
velocity_window =gdisplay(title='Velocity (m/s)', y=100, foreground=color.black, background=color.white)
pressure_window =gdisplay(title='Air pressure (kPa)', y=200, foreground=color.black, background=color.white)
# water_window =gdisplay(title='Water mass (g)', y=300, foreground=color.black, background=color.white)
# energy_window =gdisplay(title='Kinetic energy (J)', y=400, foreground=color.black, background=color.white)
# momentum_window =gdisplay(title='|Momentum| (kg m/s)', y=500, foreground=color.black, background=color.white)
### Simulation Function
def single_run(gauge_pressure, init_water_volume, use_rate=True, use_graph=True):
### Graph Setup
if args.graph:
graphs = dict()
graphs["position"] = gcurve(gdisplay=position_window, color=color.red)
graphs["velocity"] = gcurve(gdisplay=velocity_window, color=color.green)
graphs["pressure"] = gcurve(gdisplay=pressure_window, color=color.green)
# graphs["water"] = gcurve(gdisplay=water_window, color=color.blue)
# graphs["energy"] = gcurve(gdisplay=energy_window, color=color.black)
# graphs["momentum"] = gcurve(gdisplay=momentum_window, color=color.black)
def update_graph(graphs):
graphs["position"].plot(pos=(time/s, rocket_height/m))
graphs["velocity"].plot(pos=(time/s, rocket_velocity/(m/s)))
graphs["pressure"].plot(pos=(time/s, air_pressure/kPa))
# graphs["water"].plot(pos=(time/s, water_mass/g))
# graphs["energy"].plot(pos=(time/s, kinetic_energy/J))
# graphs["momentum"].plot(pos=(time/s, abs(momentum.asNumber(kg*m/s))))
# initialization
time = 0*s
rocket_height = 0*m
init_air_pressure = barometric_pressure + gauge_pressure
init_air_density = air_density_from_pressure_temp_humidity(init_air_pressure,init_temperature,1.0)
water_volume=init_water_volume
air_volume = rocket.bottle_volume - water_volume
air_pressure= init_air_pressure
air_mass = air_volume *init_air_density
water_mass = water_volume * water_density
max_height = 0*m
# while on launcher, gains initial speed
starting_energy = (air_pressure - barometric_pressure) * rocket.nozzle_area * rocket.launcher_length
starting_speed = unit_sqrt(2*starting_energy/(rocket.bottle_mass + water_mass + air_mass))
rocket_velocity = starting_speed
rocket_mass = rocket.bottle_mass + water_mass+ air_mass
# water jet phase
while water_volume > 0*L and rocket_height >= 0*m and air_pressure > barometric_pressure:
exhaust_pressure = max(air_pressure - barometric_pressure, 0*Pa)
# from Bernoulli's principle for incompressible flow:
# u^2/2 + barometric_pressure/water_density = constant = v^2/2 + air_pressure/water_density
# Including in the model the internal water velocity v: v = u*nozzle_area/bottle_area
# u^2-v^2 = (1- (nozzle_area/bottle_area)^2)*u^2 = barometric_pressure/water_density - air_pressure/water_density
exhaust_speed = unit_sqrt(2 * exhaust_pressure / (water_density*rocket.speed2_scale))
if exhaust_speed < 1.e-5*m/s:
# for very low exhaust speeds, use a tiny time step, rather than a fixed volume
delta_time = 1.e-5*s
exhaust_volume = rocket.nozzle_area * exhaust_speed * delta_time
if exhaust_volume>water_volume: exhaust_volume=water_volume
else:
# Use steps of constant water leaving rather than fixed time step
# Note: Kagan, Buchholtz, and Klein used much too large a step (10cc to 30cc)
# resulting in overestimates of the speed of the rocket.
exhaust_volume = args.step_water*cc
if exhaust_volume>water_volume: exhaust_volume=water_volume
delta_time = exhaust_volume / (rocket.nozzle_area * exhaust_speed)
water_volume -= exhaust_volume
water_mass = water_volume * water_density
exhaust_mass = exhaust_volume * water_density
air_volume = rocket.bottle_volume - water_volume
rocket_mass = rocket.bottle_mass + water_mass+ air_mass
rocket_velocity += delta_time * rocket.air_drag(rocket_velocity,barometric_density) / rocket_mass
rocket_velocity -= gravity_acceleration * delta_time
rocket_velocity += exhaust_speed*exhaust_mass / rocket_mass
kinetic_energy = 0.5 * rocket_mass * rocket_velocity * rocket_velocity
momentum = rocket_mass * rocket_velocity
rocket_height += rocket_velocity * delta_time
time += delta_time
if use_rate:
vis.rate(1*s/delta_time)
if rocket_height > max_height:
max_height = rocket_height
if use_graph: update_graph(graphs)
empty_time = time
empty_height= rocket_height
empty_speed = rocket_velocity
empty_pressure = air_pressure
# air jet phase
if rocket.do_air_jet:
delta_time = 0.1* args.step_time*s # use smaller time-step while powered
while air_pressure > barometric_pressure and rocket_height >= 0*m:
if use_rate:
vis.rate(1*s/delta_time)
time += delta_time
# Air density is not a constant, because the temperature and pressure both change.
# Perhaps it is best to compute it from the mass and volume directly.
air_density = air_mass/air_volume
pressure_ratio= barometric_pressure/air_pressure
if air_pressure >= choked_flow_limit * barometric_pressure:
# choked flow, barometric pressure doesn't matter
# http://en.wikipedia.org/wiki/Choked_flow
# Because of the taper of the bottle, we'll pretend that the discharge coefficient is close to 1.
exhaust_mass_rate = rocket.nozzle_area* \
else:
# subsonic flow
# http://en.wikipedia.org/wiki/Orifice_plate (Equation 4)
*air_index_ratio \
*(1-pressure_ratio**(1/air_index_ratio)) \
/ (1-pressure_ratio) )
# http://en.wikipedia.org/wiki/Orifice_plate (Equation 3)
exhaust_mass_rate= expansion_factor*rocket.nozzle_area \
* unit_sqrt(2*air_density*(air_pressure-barometric_pressure))
## BUG: I don't believe that the exhaust_speed is right, since
## the density of the air in the jet is not being computed.
## Because we don't have an expansion nozzle,
## let's underestimate speed by assuming density is the same as in rocket.
exhaust_speed = exhaust_mass_rate/(air_density*rocket.nozzle_area)
exhaust_mass= exhaust_mass_rate*delta_time
exhaust_momentum = exhaust_mass*exhaust_speed
rocket_mass = rocket.bottle_mass + air_mass + water_mass
rocket_velocity += delta_time * rocket.air_drag(rocket_velocity,barometric_density) / rocket_mass
rocket_velocity -= gravity_acceleration * delta_time
rocket_velocity += exhaust_momentum / rocket_mass
kinetic_energy = 0.5 * rocket_mass * rocket_velocity * rocket_velocity
momentum = rocket_mass * rocket_velocity
# I don't think that this air_pressure update is quite right,
# as it assumes no change in temperature of the air.
air_pressure *= (air_mass-exhaust_mass)/air_mass
air_mass -= exhaust_mass
rocket_height += rocket_velocity * delta_time
if rocket_height > max_height:
max_height = rocket_height
if use_graph: update_graph(graphs)
burnout_speed=rocket_velocity
burnout_time = time
burnout_height = rocket_height
# ballistic phase
rocket_mass = rocket.bottle_mass + water_mass+ air_mass
delta_time = args.step_time*s # use normal time step
while rocket_height >= 0*m:
if use_rate:
vis.rate(1*s/delta_time)
time += delta_time
rocket_velocity += delta_time * rocket.air_drag(rocket_velocity,barometric_density) / rocket_mass
rocket_velocity -= gravity_acceleration * delta_time
rocket_height += rocket_velocity * delta_time
kinetic_energy = 0.5 * rocket_mass * rocket_velocity * rocket_velocity
momentum = rocket_mass * rocket_velocity
if rocket_height > max_height:
max_height = rocket_height
if use_graph: update_graph(graphs)
return dict(
starting_time=0*s,
water=init_water_volume,
starting_height=rocket.launcher_length,
starting_speed=starting_speed,
empty_time=empty_time,
empty_height=empty_height,
empty_speed=empty_speed,
empty_pressure=empty_pressure,
burnout_time=burnout_time,
burnout_height=burnout_height,
burnout_speed=burnout_speed,
max_height=max_height,
flight_time=time)
### Simulation Caller
# which values from the simulation do we want to print, and with what units
fields= [("water",L),
("empty_time",s),
("empty_speed",m/s),
("empty_height", m),
("empty_pressure", bar),
("burnout_speed", m/s),
("burnout_height", m),
("flight_time", s),
("max_height", m)]
print( "\t".join(["{:15}".format(f[0]) for f in fields]))
print( "\t".join([" {:11}".format(f[1].strUnit()) for f in fields]))
# We don't use water in the paper rocket, so only run the loop with the 0 value
volume_limit = 1 if rocket.name=="paper" else int(rocket.bottle_volume.asNumber(cc)+1)
for water in range(0,volume_limit,args.water):
values = single_run(gauge_pressure, water*cc, use_rate=args.realtime, use_graph=args.graph)
print("\t".join([ "{:9.4f}".format(values[f[0]].asNumber(f[1])) for f in fields]))
```
1. […] would like us to continue on the rocket experiment, now that the simulation seems to be working. Launching next to a tall building and making a video recording may be our best bet for measuring […]
Pingback by Physics homework chapter 12 « Gas station without pumps — 2012 June 5 @ 09:33
2. […] Soda bottle rocket simulation take 2, I mentioned that the authors of one paper used “a thread wrapped around a Pasco super […]
Pingback by Homemade super pulley « Gas station without pumps — 2012 June 10 @ 23:34
3. […] 2012 June 14: please see Soda-bottle rocket simulation: take 2 for a better […]
Pingback by Soda-bottle rocket simulation « Gas station without pumps — 2012 June 14 @ 14:06
4. […] while the rocket is on the launcher—it is modeled more like a gun than like a rocket. (But my soda-bottle rocket simulator can model these paper bullets also.) It would probably best to have a shorter barrel for doing […]
Pingback by Nerf gun prototype 1 « Gas station without pumps — 2012 July 3 @ 21:12
5. I was going to download the latest draft of the python code. The article says “Here is the latest draft of the simulation code…” but I didn’t see a link to the code.
Comment by Aaron Titus — 2012 September 12 @ 20:26
• You should see a “show source” button on the line just below the “Here is the latest draft …” paragraph. If not, try a different browser, as I see it with Firefox, Chrome, and Safari. I don’t have Internet Exploder, so I can’t test with that, nor with any of the rarely-used Linux browsers.
Comment by gasstationwithoutpumps — 2012 September 12 @ 21:58
• Thank you. I am using Chrome. The “show source” link was light gray and I just didn’t see it. Thanks for the tip. I see it now
Comment by Aaron Titus — 2012 September 13 @ 04:14
6. […] Soda-bottle rocket simulation: take 2 […]
Pingback by 2012 in review « Gas station without pumps — 2012 December 31 @ 11:17
7. […] Soda-bottle rocket simulation: take 2 […]
Pingback by Blogoversary 3 | Gas station without pumps — 2013 June 1 @ 20:00
8. […] Scientific (which can be seen in the superpulley post and the water-rocket simulation posts 1 and 2). Nonetheless, several families did take instructions for making the simple PVC launchers, with […]
Pingback by Soda bottle rockets used again | Gas station without pumps — 2016 May 12 @ 20:48
This site uses Akismet to reduce spam. Learn how your comment data is processed. | 7,462 | 30,405 | {"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} | 2.75 | 3 | CC-MAIN-2022-49 | latest | en | 0.97174 |
https://dfine.gitbook.io/leetcode/interview_1618 | 1,713,275,825,000,000,000 | text/html | crawl-data/CC-MAIN-2024-18/segments/1712296817095.3/warc/CC-MAIN-20240416124708-20240416154708-00014.warc.gz | 194,092,379 | 45,749 | # 面试题 16.18
To Index ---
## 面试题 16.18
`````````
0 <= len(pattern) <= 1000
0 <= len(value) <= 1000
`````````
`````````
class Solution {
string pattern;
inline string patternString(string a, string b)
{
string res;
for(auto c: pattern)
{
if(c=='a') res+=a;
else res+=b;
}
return res;
}
public:
bool patternMatching(string pattern, string value) {
int sizeA=0;
int sizeB=0;
if(pattern[0]=='b')
{
string tmp;
for(auto c:pattern)
tmp+= c=='a' ? 'b' :'a';
this->pattern=tmp;
}
else
this->pattern=pattern;
for(auto c:this->pattern)
{
if(c=='a') sizeA++;
else sizeB++;
}
if(sizeA ==0 && sizeB ==0) return value=="";
if(sizeA==0)
{
int cntB=value.length()/sizeB;
return patternString("",value.substr(0,cntB)) ==value;
}
if(sizeB==0)
{
int cntA=value.length()/sizeA;
return patternString(value.substr(0,cntA),"") ==value;
}
int startB=0;
for(auto c:this->pattern)
{
if(c=='a') {
startB++;
}
else
break;
}
//cout<<startB<<endl;
//cout<<sizeA<<endl;
int cntA=value.length()/sizeA;
// cout<<cntA<<endl;
for(int i=0; i<=cntA;i++)
{
int cntB=(value.length()-sizeA*i)/sizeB;
string a=value.substr(0,i);
// cout<<i*startB<<endl;
string b =value.substr(i*startB,cntB);
// cout<<a<<" "<<b<<endl;
if(a==b) continue;
// cout<<patternString(a,b) <<endl;
if(patternString(a,b) == value) return true;
}
return false;
}
};``````
``````> 执行用时 :4 ms, 在所有 C++ 提交中击败了63.82%的用户
Last updated | 477 | 1,392 | {"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} | 2.734375 | 3 | CC-MAIN-2024-18 | latest | en | 0.149491 |
https://brilliant.org/problems/tircky/ | 1,627,123,742,000,000,000 | text/html | crawl-data/CC-MAIN-2021-31/segments/1627046150264.90/warc/CC-MAIN-20210724094631-20210724124631-00226.warc.gz | 164,636,830 | 11,312 | # Is $x$ real?
Algebra Level 5
A math student was learning about the principle square root function, and extending it to the complex numbers. For a complex number $\omega = R e^{i \theta }$ where $R \geq 0$ is real and $0 \leq \theta < 2 \pi$, we define $\sqrt{ \omega} = \sqrt{R} e^{ i \theta / 2 }$.
The math student was asked to determine the value of $x = \sqrt{i}-\sqrt{-i}$, and wrote down the following steps. Is every step correct? If no, then what is the first incorrect step.
Step 1. $\hspace{1mm}$Consider the complex number $x$: $x=\sqrt{i}-\sqrt{-i}.$ Step 2. $\hspace{1mm}$ Squaring both sides, $x^2 = i+(-i)-2\sqrt{i}\sqrt{-i}.$ This might introduce extraneous roots.
Step 3. $\hspace{1mm}$ Simplifying the expression,
$x^2 = 0-2 \cdot i ^{\frac12} \times i \times i^{\frac12}.$ Step 4. $\hspace{1mm} x^2 = -2\cdot i \cdot i$
Step 5. $\hspace{1mm} x^2= 2$
Step 6. $\hspace{1mm} x = \pm \sqrt{2}$
Step 7. Reject the extraneous root $x = - \sqrt{2}$, and conclude that $x = \sqrt{2}$.
×
Problem Loading...
Note Loading...
Set Loading... | 366 | 1,061 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 18, "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} | 4.5625 | 5 | CC-MAIN-2021-31 | latest | en | 0.725827 |
https://amylemons.com/category/math/page/33/ | 1,721,111,976,000,000,000 | text/html | crawl-data/CC-MAIN-2024-30/segments/1720763514737.55/warc/CC-MAIN-20240716050314-20240716080314-00164.warc.gz | 81,116,554 | 45,767 | # Math
Word problems, regrouping, place value, OH MY! If you want to bring the engagement to your math block, I got you! You’ll find math games, activities, and lesson plan ideas that will hook your little learners. I’ll show you how make your math lessons go from drab to fab with the use of simple items such as a hula hoops, play-dough, and poms!
### Measuring Fun!
We’ve been busy measuring this week! I love getting a break from subtraction/addition with regrouping, counting coins, telling time, etc because those concepts can be stressful! Measuring length is just
### Lots going on here!
So, remember on Monday when I showed you what I was planning to do throughout the next couple of weeks and during my maternity leave?! It turns out the Lord
### Letter Writing and Regrouping
Man, teaching is hard work, y’all! After a full week off last week, I am completely exhausted! If I went to sleep and didn’t wake up until Monday I’d be
Well, it’s been quite a week… I’ll tell you that much. I mean, Halloween on a Wednesday?! That’s like a teacher’s nightmare! Well, I *kinda* *maybe* *sort of* went against
### Some Frankie Fun :)
This post is going to be short and sweet, AND I’m going to start with the end product 🙂 We have been working on double digit subtraction without regrouping this
### Even and Odd Freebies
Last week when we were learning about place value, a question about even/odd came up, and probably only 2 of my students could answer it! So, my team decided that
### Measuring Fun!
We’ve been busy measuring this week! I love getting a break from subtraction/addition with regrouping, counting coins, telling time, etc because those concepts can be stressful! Measuring length is just
### Lots going on here!
So, remember on Monday when I showed you what I was planning to do throughout the next couple of weeks and during my maternity leave?! It turns out the Lord
### Letter Writing and Regrouping
Man, teaching is hard work, y’all! After a full week off last week, I am completely exhausted! If I went to sleep and didn’t wake up until Monday I’d be
Well, it’s been quite a week… I’ll tell you that much. I mean, Halloween on a Wednesday?! That’s like a teacher’s nightmare! Well, I *kinda* *maybe* *sort of* went against | 570 | 2,283 | {"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} | 3.390625 | 3 | CC-MAIN-2024-30 | latest | en | 0.936255 |
http://mathhelpforum.com/calculus/19855-integral-tanx-71-secx-4-a.html | 1,480,804,343,000,000,000 | text/html | crawl-data/CC-MAIN-2016-50/segments/1480698541140.30/warc/CC-MAIN-20161202170901-00230-ip-10-31-129-80.ec2.internal.warc.gz | 175,730,787 | 9,979 | # Thread: Integral of (tanx)^71 * (secx)^4
1. ## Integral of (tanx)^71 * (secx)^4
$\int tan^71x sec^4x$
$\int tan^70x sec^3x * tanx secx$
I'm stuck after this part
2. I wouldn't do that.
My first impression is to take two of the secants and turn them into tangents.
After that, it is a rather obvious substitution u = tan(x) and you're done.
3. Hello, circuscircus!
TKHunny has the best idea . . .
$\int \left(\tan^{71}\!x\right)\left(\sec^4\!x\right)\,d x$
We have: . $\left(\tan^{71}\!x\right)\left(\sec^2\!x\right)\le ft(\sec^2\!x\right) \;=\;\left(\tan^{71}\!x\right)\left(\tan^2\!x+1\ri ght)\left(\sec^2\!x\right)$
. . Then: . $\int \left(\tan^{73}\!x + \tan^{71}\!x\right)(\sec^2\!x)\,dx$
Let: $u \:= \:\tan x\quad\Rightarrow\quad du \:=\:\sec^2\!x\,dx$
Substitute: . $\int \left(u^{73} + u^{71}\right)\,du$ . . . . Got it? | 341 | 843 | {"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": 7, "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} | 3.515625 | 4 | CC-MAIN-2016-50 | longest | en | 0.612425 |
http://kwiznet.com/p/takeQuiz.php?ChapterID=11372&CurriculumID=49&Method=Worksheet&NQ=10&Num=9.11&Type=D | 1,561,445,686,000,000,000 | text/html | crawl-data/CC-MAIN-2019-26/segments/1560627999800.5/warc/CC-MAIN-20190625051950-20190625073950-00094.warc.gz | 104,364,871 | 3,620 | Name: ___________________Date:___________________
Email us to get an instant 20% discount on highly effective K-12 Math & English kwizNET Programs!
### High School Mathematics - 29.11 The Two Points Form of A Line
Equation of a line passing through the points A(x1 , y1) and B(x2 , y2) is (x - x1) (y2 - y1) = (y - y1) (x2 - x1). Example: Find the equation of line passing through (3,4) and (5,6). Solution: Formula for finding the equation of line when two points are given is (x - x1) (y2 - y1) = (y - y1) (x2 - x1). Given that, (x1 , y1) = (3,4) (x2 , y2) = (5,6) Substituting these values in the formula, we get (x - 3) (6 - 4) = (y - 4) (5 - 3) (x - 3) 2 = (y - 4) 2 2x - 6 = 2y - 8 2x - 2y + 2 = 0 Therefore, the 2x - 2y + 2 = 0 is the required line. Directions: Find the equation of the line, given two points. Also write at least 10 examples of your own.
Name: ___________________Date:___________________
### High School Mathematics - 29.11 The Two Points Form of A Line
Q 1: Find the equation of line passing through (-2,3) and (4,5).2x - 6y + 6 = 0None of these2y - 6x + 6 = 06x - 2y + 6 = 0 Q 2: Find the equation of line passing through (4,5) and (2,6).x - y + 3 = 02x - y - 6 = 0x - 2y + 6 = 0x - y - 3 = 0 Q 3: Find the equation of line passing through (-2,0) and (0,4).x + 2y + 4 = 0x - 2y + 4 = 02x + y + 4 = 02x - y + 4 = 0 Q 4: Find the equation of line passing through (-2,1) and (3,4).5x - 3y + 7 = 03x - 5y + 7 = 05x - 3y - 7 = 03y - 5x + 7 = 0 Q 5: Find the equation of line passing through (5,6) and (4,5).-x + y - 1 = 0x + y + 1 = 0x - y + 1 = 0x + y - 1 = 0 Q 6: Find the equation of line passing through (2,5) and (1,6).x + y + 7 = 0x + y - 7 = 0x - y - 7 = 0None of these Question 7: This question is available to subscribers only! Question 8: This question is available to subscribers only! | 725 | 1,828 | {"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} | 4.75 | 5 | CC-MAIN-2019-26 | longest | en | 0.827472 |
https://betterlesson.com/lesson/resource/2528982/guided-practice | 1,490,737,452,000,000,000 | text/html | crawl-data/CC-MAIN-2017-13/segments/1490218189903.83/warc/CC-MAIN-20170322212949-00533-ip-10-233-31-227.ec2.internal.warc.gz | 764,746,083 | 19,974 | ## guided Practice - Section 3: Guided Practice
guided Practice
guided Practice
Unit 3: Number & Operations-Fractions
Lesson 7 of 21
## Big Idea: Given a set of models students will be able to use them to add two or more fractions.
Print Lesson
17 teachers like this lesson
Standards:
Subject(s):
65 minutes
### Carol Redfield
##### Similar Lessons
###### Understand Fractions
4th Grade Math » Fraction Equivalents and Ordering Fractions
Big Idea: Students will use fraction strips and begin discovering fractional relationships.
Favorites(2)
Resources(9)
Helena, MT
Environment: Suburban
###### Decomposing Submarine Sandwiches
Big Idea: Students will decompose paper submarine sandwiches into fraction equations.
Favorites(13)
Resources(42)
MT
Environment: Urban | 173 | 772 | {"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} | 2.609375 | 3 | CC-MAIN-2017-13 | longest | en | 0.760688 |
https://www.investopedia.com/video/play/herfindahlhirschman-index-hhi/ | 1,542,811,444,000,000,000 | text/html | crawl-data/CC-MAIN-2018-47/segments/1542039748901.87/warc/CC-MAIN-20181121133036-20181121155036-00385.warc.gz | 892,835,330 | 31,659 | Next video:
The Herfindhal-Hirschman Index, (HHI) is a measure of market concentration and competition among market participants. The formula for calculating HHI is to square each market participant’s market share, and then sum those squared numbers. Based on this formula, the resulting number ranges from close to 1 to a maximum of 10,000.
When the number is close to 10,000, this indicates a highly concentrated, monopolist market. For instance, if there were only one market participant with 100% of the market, the square of that 100% would be 10,000. A HHI number close to 1 indicates a lot of small, equally-sized market participants in a very competitive market.
The formula is useful because squaring all of the percentages gives greater weight to market participants that have a large share of the market.
As an example, assume a market with eight participants as follows:
Participant Market Share Square A 10% 100 B 9% 81 C 12% 144 D 15% 225 E 12% 144 F 11% 121 G 15% 225 H 16% 256 100% 1,296
According to the United States Justice department, this HHI index of 1,296 indicates there is not much market concentration. The Justice Department considers an HHI score from 1,500 to 2,500 to indicate a moderately concentrated market. A score above 2,500 is a concentrated market.
In evaluating mergers, the Antitrust Division of the Justice Department considers that any merger or transaction that increases the HHI by 200 is a significant market power enhancement, and thus may create antitrust concerns.
## In This Series
Related Articles
1. Tech
### Square Surpasses \$1B in Business Loans (SQ)
Square reported Q3 software and data product revenue up 140% over last year, as Square Capital opens up and builds out with an array of new partnerships.
2. Tech
### Square Inc. to Report Q3 Earnings (SQ)
The global fintech leader may be positioned to secure its fourth consecutive earnings beat since its public debut in November of last year.
3. Investing
### Square Is Becoming a Bank
The company, which sells hardware for payments and lends to small businesses, took the first step by filing an application.
4. Investing
### Bill Ackman on Concentrated Portfolios, Lessons From Valeant (VRX)
Explore the lessons of concentrated portfolios, including how Bill Ackman's strategy change at Pershing Square mirrors one at his previous fund, which closed.
5. Tech
### Square Moves to Attract 'Upmarket' Clients (SQ)
In the fintech leader's latest earnings call, the company indicates a push to harness larger businesses in order to gain more stable and lucrative revenue.
6. Tech
### Needham Initiates Square Inc. at Buy
Analysts applaud the fintech leader's 'complete and cohesive' platform for clients of all sizes.
7. Investing
### Square Stock at Risk on ‘Bitcoin Mania’: BTIG
Analysts expect Square Inc. to lose more than a quarter of its value in the next 12 months.
8. Tech
### Lending Club, a Square Rival, Soars on Q3 (LC, SQ)
Non-traditional online lending platforms post better-than-expected third quarter earnings, sending fintech stocks on the way to recovery.
9. Investing
### Square Is Winning With Its Cash App: Nomura
Square is making swift strides against its payment-processing competitors. | 745 | 3,246 | {"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} | 2.53125 | 3 | CC-MAIN-2018-47 | longest | en | 0.917211 |
https://artofproblemsolving.com/wiki/index.php?title=2015_AMC_12A_Problems/Problem_25&oldid=67597 | 1,632,260,250,000,000,000 | text/html | crawl-data/CC-MAIN-2021-39/segments/1631780057227.73/warc/CC-MAIN-20210921191451-20210921221451-00605.warc.gz | 162,200,813 | 13,170 | 2015 AMC 12A Problems/Problem 25
Problem
A collection of circles in the upper half-plane, all tangent to the $x$-axis, is constructed in layers as follows. Layer $L_0$ consists of two circles of radii $70^2$ and $73^2$ that are externally tangent. For $k>=1$, the circles in $\bigcup_{j=0}^{k-1}L_j$ are ordered according to their points of tangency with the $x$-axis. For every pair of consecutive circles in this order, a new circle is constructed externally tangent to each of the two circles in the pair. Layer $L_k$ consists of the $2^{k-1}$ circles constructed in this way. Let $S=\bigcup_{j=0}^{6}L_j$, and for every circle $C$ denote by $r(C)$ its radius. What is $$\sum_{C\in S} \frac{1}{\sqrt{r(C)}}?$$
$[asy] import olympiad; size(350); defaultpen(linewidth(0.7)); // define a bunch of arrays and starting points pair[] coord = new pair[65]; int[] trav = {32,16,8,4,2,1}; coord[0] = (0,73^2); coord[64] = (2*73*70,70^2); // draw the big circles and the bottom line path arc1 = arc(coord[0],coord[0].y,260,360); path arc2 = arc(coord[64],coord[64].y,175,280); fill((coord[0].x-910,coord[0].y)--arc1--cycle,gray(0.75)); fill((coord[64].x+870,coord[64].y+425)--arc2--cycle,gray(0.75)); draw(arc1^^arc2); draw((-930,0)--(70^2+73^2+850,0)); // We now apply the findCenter function 63 times to get // the location of the centers of all 63 constructed circles. // The complicated array setup ensures that all the circles // will be taken in the right order for(int i = 0;i<=5;i=i+1) { int skip = trav[i]; for(int k=skip;k<=64 - skip; k = k + 2*skip) { pair cent1 = coord[k-skip], cent2 = coord[k+skip]; real r1 = cent1.y, r2 = cent2.y, rn=r1*r2/((sqrt(r1)+sqrt(r2))^2); real shiftx = cent1.x + sqrt(4*r1*rn); coord[k] = (shiftx,rn); } // Draw the remaining 63 circles } for(int i=1;i<=63;i=i+1) { filldraw(circle(coord[i],coord[i].y),gray(0.75)); }[/asy]$
$\textbf{(A)}\ \frac{286}{35} \qquad\textbf{(B)}\ \frac{583}{70} \qquad\textbf{(C)}\ \frac{715}{73} \qquad\textbf{(D)}}\ \frac{143}{14} \qquad\textbf{(E)}\ \frac{1573}{146}$ (Error compiling LaTeX. ! Extra }, or forgotten \$.)
Solution
Let us start with the two circles in $L_0$ and the circle in $L_1$. Let the larger circle in $L_0$ be named circle $X$ with radius $x$ and the smaller be named circle $Y$ with radius $y$. Also let the single circle in $L_1$ be named circle $Z$ with radius $z$. Draw radii $x$, $y$, and $z$ perpendicular to the x-axis. Drop altitudes $a$ and $b$ from the center of $Z$ to these radii $x$ and $y$, respectively, and drop altitude $c$ from the center of $Y$ to radius $x$ perpendicular to the x-axis. Connect the centers of circles $x$, $y$, and $z$ with their radii, and utilize the Pythagorean Theorem. We attain the following equations. $$(x - z)^2 + a^2 = (x + z)^2 \implies a^2 = 4xz$$ $$(y - z)^2 + b^2 = (y + z)^2 \implies b^2 = 4yz$$ $$(x - y)^2 + c^2 = (x + y)^2 \implies c^2 = 4xy$$
We see that $a = 2\sqrt{xz}$, $b = 2\sqrt{yz}$, and $c = 2\sqrt{xy}$. Since $a + b = c$, we have that $2\sqrt{xz} + 2\sqrt{yz} = 2\sqrt{xy}$. Divide this equation by $2\sqrt{xyz}$, and this equation becomes the well-known relation of Ford circles $\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{y}} = \frac{1}{\sqrt{z}}.$ We can apply this relationship recursively with the circles in layers $L_2, L_3, \cdots, L_6$.
Here, let $S(n)$ denote the sum of the reciprocals of the square roots of all circles in layer $n$. The notation in the problem asks us to find the sum of the reciprocals of the square roots of the radii in each circle in this collection, which is $\textstyle\sum_{n=0}^{6}S(n)$. We already have that $S(0) = S(1) = \frac{1}{\sqrt{z}} = \frac{1}{73} + \frac{1}{70}$. Then, $S(2) = 2S(1) + S(0) = 3S(0)$. Additionally, $S(3) = 2S(2) + 2S(1) + S(0) = 9S(0)$, and $S(4) = 2S(3) + 2S(2) + 2S(1) + S(0) = 27S(0)$. Now, we notice that, since $S(n)$ is doubled for all $n$ except $0$, $S(n + 1) = 3S(n)$. Hence, our desired sum is $(1 + 1 + 3 + 9 + 27 + 81 + 243)(S(0)) = 365\left(\frac{1}{73} + \frac{1}{70}\right)$. This simplifies to $365\left(\frac{143}{73(70)}\right) = \frac{143}{14} \textbf{ (D)}$. | 1,515 | 4,099 | {"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": 62, "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} | 3.953125 | 4 | CC-MAIN-2021-39 | latest | en | 0.5895 |
http://book.caltech.edu/bookforum/showthread.php?s=3278ea0e25a09d00ce5bb3e58dfe5072&p=9278 | 1,618,381,505,000,000,000 | text/html | crawl-data/CC-MAIN-2021-17/segments/1618038076819.36/warc/CC-MAIN-20210414034544-20210414064544-00484.warc.gz | 19,234,560 | 8,882 | LFD Book Forum Target function formulation in Q8
User Name Remember Me? Password
Register FAQ Calendar Mark Forums Read
Thread Tools Display Modes
#1
02-09-2013, 10:52 AM
ripande Senior Member Join Date: Jan 2013 Posts: 71
Target function formulation in Q8
I guess this is pretty basic, but I am unclear on this, so would like some help. As per requiremets of question 8
f(x) = 1 for Y=+1
f(x) = 0 for Y = -1
Is my understanding correct ?
if yes, f(x) should be the step function of y*x. I am unable to formulate this in a form such that it is differentiable to use SGD. Can someone help me understand how to do it?
Thanks
#2
02-09-2013, 11:01 AM
ripande Senior Member Join Date: Jan 2013 Posts: 71
Re: Target function formulation in Q8
Or do we just use formula to minimize mean square error
sum ( sq(y1 - wx1) + sq(y2 - wx2) ...) ?
#3
02-09-2013, 12:47 PM
yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478
Re: Target function formulation in Q8
Quote:
Originally Posted by ripande I guess this is pretty basic, but I am unclear on this, so would like some help. As per requiremets of question 8 f(x) = 1 for Y=+1 f(x) = 0 for Y = -1 Is my understanding correct ? if yes, f(x) should be the step function of y*x. I am unable to formulate this in a form such that it is differentiable to use SGD. Can someone help me understand how to do it?
The target function in this case is indeed "hard threshold," but the hypotheses are "soft threshold" (they only approximate the target) and these are the ones that have the required smoothness properties for SGD. The goal of miniizing the cross entropy error measure is to get a hypothesis that approximately replicates , based on the noisy examples.
__________________
Where everyone thinks alike, no one thinks very much
#4
02-09-2013, 01:23 PM
ripande Senior Member Join Date: Jan 2013 Posts: 71
Re: Target function formulation in Q8
Understood. Thanks Prof Yaser. So in this case we can use the theta(s) as the sigmoid function as explained in the lecture, correct?
#5
02-09-2013, 06:46 PM
yaser Caltech Join Date: Aug 2009 Location: Pasadena, California, USA Posts: 1,478
Re: Target function formulation in Q8
Quote:
Originally Posted by ripande Understood. Thanks Prof Yaser. So in this case we can use the theta(s) as the sigmoid function as explained in the lecture, correct?
Correct.
__________________
Where everyone thinks alike, no one thinks very much
Thread Tools Display Modes Linear Mode
Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General General Discussion of Machine Learning Free Additional Material Dynamic e-Chapters Dynamic e-Appendices Course Discussions Online LFD course General comments on the course Homework 1 Homework 2 Homework 3 Homework 4 Homework 5 Homework 6 Homework 7 Homework 8 The Final Create New Homework Problems Book Feedback - Learning From Data General comments on the book Chapter 1 - The Learning Problem Chapter 2 - Training versus Testing Chapter 3 - The Linear Model Chapter 4 - Overfitting Chapter 5 - Three Learning Principles e-Chapter 6 - Similarity Based Methods e-Chapter 7 - Neural Networks e-Chapter 8 - Support Vector Machines e-Chapter 9 - Learning Aides Appendix and Notation e-Appendices
All times are GMT -7. The time now is 11:25 PM.
Contact Us - LFD Book - Top | 931 | 3,748 | {"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} | 3.21875 | 3 | CC-MAIN-2021-17 | latest | en | 0.895147 |
https://masimed.it/what-else-would-need-to-be-congruent-to-show-that-abc-def-by-asa-apex.html | 1,618,201,373,000,000,000 | text/html | crawl-data/CC-MAIN-2021-17/segments/1618038066568.16/warc/CC-MAIN-20210412023359-20210412053359-00432.warc.gz | 497,810,384 | 8,512 | Battle cats data transfer error
Life360 virus
Oct 18, 2019 · Show all inverse operations. ... Is angle ABC congruent to angle DEF if so, name the postulate that applies. ... What else would need to be congruent to show that ...
I hate you i love you lyrics nightcore clean
Oct 21, 2020 · You need a busy practice with a good payor mix (ie mostly commercial insurance) and probably a busy OB service. The unit value also needs to be above average. You can take a bunch of call, probably like 2x a week overnight and a couple of weekends and you can certainly get to that number. Mar 07, 2019 · What else would need to be congruent to show tha by Rodrigo Anthony Posted on March 7, 2019 Anyways for them to be congruent.You need to have two angles congruent and a congruent side in between
John deere gator windshield
Question: What Else Would Need To Be Congruent To Show That Triangle ABC Triangle XYZ By ASA? A. Angle C Angle Z B. BC Bar YZ Bar C. AC Bar XZ D. Angle Transcribed Image Text from this Question. What else would need to be congruent to show that triangle ABC triangle XYZ by ASA?
Take A Sneak Peak At The Movies Coming Out This Week (8/12) New Year, New Movies: 2021 Movies We’re Excited About + Top 2020 Releases; Dua Lipa: ‘Cancel culture is toxic’ 2. If there are two congruent legs, or it tells you isos in the given, you can conclude it is an isos proof!! 3. Fill in information that you can working with the given (either say the base angles are congruent by congruent sides imply congruent base angles, or you can say that legs are congruent bc of def of isos triangle) 4.
Supercharged cars for sale under 10k
A Show ABC EDC. • Based on the information marked in the figure, which pairs of sides or pairs of angles do you know to be congruent? • What additional pair of sides or pair of angles do you know to be congruent? Why? • How can you conclude that ABC EDC? B Use corresponding parts of congruent triangles. • Which side of EDC corresponds ...
Feb 19, 2017 · A. congruent- SAS B. congruent-ASA C. congruent - SSS D. might not be congruent 1 answer What else would need to be congruent to show that triangle ABC triangle PQR by SSS?
Flav spun sugar belts
Title: 4.4 Proving Triangles are Congruent: ASA and AAS 1 4.4 Proving Triangles are Congruent ASA and AAS. Geometry ; Mrs. Spitz ; Fall 2004; 2 Objectives. Prove that triangles are congruent using the ASA Congruence Postulate and the AAS Congruence Theorem ; Use congruence postulates and theorems in real-life problems. 3 Assignment. 4.4 pp. 223 ...
Answer: 2 📌📌📌 question What else would need to be congruent to show that AABCE AXYZby ASA?Grvenczz - the answers to estudyassistant.com Mar 17, 2010 · Abstract. An assessment of the meaning and role of uniformitarianism in natural history is demanded by: (1) the confusion it has generated for nearly two centuries, (2) the recent revolution in geology that has rejected traditional uniformitarianism in favor of neocatastrophism, and (3) the accusation by some who embrace neocatastrophism that diluvialists—failing to understand nuances of ... | 804 | 3,079 | {"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} | 3.078125 | 3 | CC-MAIN-2021-17 | latest | en | 0.895172 |
https://cran.um.ac.ir/web/packages/kinship2/vignettes/kinship_code_details.html | 1,702,213,297,000,000,000 | text/html | crawl-data/CC-MAIN-2023-50/segments/1700679102469.83/warc/CC-MAIN-20231210123756-20231210153756-00536.warc.gz | 221,898,450 | 10,520 | # Introduction
The kinship matrix is foundational for random effects models with family data.
For $$n$$ subjects it is an $$n \times n$$ matrix whose $$ij$$ element contains the expected fraction of alleles that would be identical by descent if we sampled one from subject $$i$$ and another from subject $$j$$. Note that the diagonal elements of the matrix will be 0.5 not 1: when we randomly sample twice from the same subject (with replacement) we will get two copies of the gene inherited from the father 1/4 of the time, the maternal copy twice (1/4) or one of each 1/2 the time. The formal definition is $$K(i,i) = 1/4 + 1/4 + 1/2 K(m,f)$$ where $$m$$ and $$f$$ are the father and mother of subject $$i$$.
The algorithm used is found in K Lange, , Springer 1997, page 71–72.
The key idea of the recursive algorithm for $$K(i,j)$$ is to condition on the gene selection for the first index $$i$$. Let $$m(i)$$ and $$f(i)$$ be the indices of the mother and father of subject $$i$$ and $$g$$ be the allele randomly sampled from subject $$i$$, which may of either maternal or paternal origin.
\begin{align} K(i,j) &= P(\mbox{g maternal}) * K(m(i), j) + P(\mbox{g paternal}) * K(f(i), j) \label{recur0} \\ &= 1/2 K(m(i), j) + 1/2 K(f(i), j) \label{recur1} \\ K(i,i) &= 1/2(1 + K(m(i), f(i))) \label{self} \end{align}
The key step in equation is if $$g$$ has a maternal origin, then it is a random selection from the two maternal genes, and its IBD state with respect to subject $$j$$ is that of a random selection from m(i) to a random selection from $$j$$. This is precisely the definition of $$K(m(i), j)$$. The recursion does not work for $$K(i,i)$$ in equation since once we select a maternal gene the second choice from $$j$$ cannot use a different maternal gene.
For the recurrence algorithm to work properly we need to compute the values of $$K$$ for any parent before the calculations for their children. Pedigree founders (those with no parents) are assumed to be unassociated, so for these subjects we have \begin{align*} K(i,i) &= 1/2 K(i,j) &=0 \; i\ne j \end{align*}
The final formula slightly different for the $$X$$ chromosome. Equation still holds, but for males the probability that a selected $$X$$ chromosome is maternal is 1, so when $$i$$ a male the recurrence formula becomes $$K(i,j) = K(m(i),j)$$.
For females it is unchanged. All males will have $$K(i,i) = 1$$ for the $$X$$ chromosome.
In order to have already-defined terms on the right hand side of the recurrence formula for each element, subjects need to be processed in the following order
The kindepth routine assigns a plotting depth to each subject in such a way that parents are always above children.
For each depth we need to do the compuations of formula twice. The first time it will get the relationship between each subject and prior generations correct, the second will correctly compute the values between subjects on the same level. The computations within any stage of the above list can be vectorized, but not those between stages.
Let [[indx]] be the index of the rows for the generation currently being processed, say generation $$g$$.
We add correct computations to the matrix one row at a time; all of the calculations depend only on the prior rows with the exception of the [i,i] element. This approach leads to a for loop containing operations on single rows/columns.
At one point below we use a vectorized version. It looks like the snippet below
for (g in 1:max(depth)) {
indx <- which(depth==g)
kmat[indx,] <- (kmat[mother[indx],] + kmat[father[indx], ])/2
kmat[,indx] <- (kmat[,mother[indx]] + kmat[,father[indx],])/2
for (j in indx) kmat[j,j] <- (1 + kmat[mother[j], father[j]])/2
}
The first line computes all the values for a horizontal stripe of the matrix. It will be correct for columns in generations $$<g$$, unreliable for generation $$g$$ with itself because of incomplete parental relationships, and zero for higher generations. The second line does the vertical stripe, and because of the line before it does have the data it needs and so gets all the stripe correct. Except of course for the diagonal elements, for which formula does not hold. We fill those in last. We know that vectorized calculations are always faster in R and I was excited to figure this out. The unfortunate truth is that for this code it hardly makes a difference, and for the X chromosome calculation leads to impenetrable if-then-else logic.
The program can be called with a pedigree, a pedigree list, or raw data. The first argument is [[id]] instead of the more generic [[x]] for backwards compatability with an older version of the routine. We give founders a fake parent of subject $$n+1$$ who is not related to anybody (even themself); it avoids some if-then-else constructions.
For S3 method dispatch to work on pedigree and pedigreeList objects, we need to define a kinship(), kinship.default(), kinship.pedigree(), and kinship.pedigreeList(). The default version takes the vectors
## Pedigree Object
The method for a pedigree object is an almost trivial modification. Since the mother and father are already indexed into the id list it has two lines that are different, those that create mrow and drow. The other change is that now we potentially have information available on monozygotic twins. If there are any such, then when the second twin of a pair is added to the matrix, we need to ensure that the pairs kinship coefficient is set to the self-self value. This can be done after each level is complete, but before children for that level are computed. If there are monozygotic triples, quadruplets, etc. this computation gets more involved.
The total number of monozygotic twins is always small, so it is efficient to fix up all the monzygotic twins at each generation. A variable [[havemz]] is set to TRUE if there are any, and an index array [[mzindex]] is created for matrix subscripting.
## PedigreeList Object
For the Minnesota Family Cancer Study there are 461 families and 29114 subjects. The raw kinship matrix would be 29114 by 29114 which is over 5 terabytes of memory, something that clearly will not work within S.
The solution is to store the overall matrix as a sparse Matrix object. Each family forms a single block. For this study we have [[n <- table(minnbreast$famid); sum(n*(n+1)/2)]] or 1.07 million entries; assuming that only the lower half of each matrix is stored. The actual size is actually smaller than this, since each family matrix will have zeros in it — founders for instance are not related — and those zeros are also not stored. The result of each per-family call to kinship will be a symmetric matrix. We first turn each of these into a dsCMatrix object, a sparse symmetric form. The [[bdiag]] function is then used to paste all of these individual sparse matrices into a single large matrix. Why do we note use [[(i in famlist)]] below? A numeric subscript of [[[9]]] %’ selects the ninth family, not the family labeled as 9, so a numeric family id would not act as we wished. If all of the subject ids are unique, across all families, the final matrix is labeled with the subject id, otherwise it is labeled with family/subject. ## MakeKinship The older [makekinship] function, from before the creation of pedigreeList objects, accepts the raw identifier data, along with a special family code for unrelated subjects, as produced by the [[makefamid]] function. All the unrelated subjects are put at the front of the kinship matrix in this case rather than within the family. Because unrelateds get put into a fake family, we cannot create a rational family/subject identifier; the id must be unique across families. We include a copy of the routine for backwards compatability, but do not anticipate any new usage of it. Like most routines, this starts out with a collection of error checks. ## Monozygotic Twins, for Pedigree object Return now to the question of monzygotic sets, used specifically in the kinship for pedigree objects. Consider the following rather difficult example: Subjects 1, 2, 3, and 7 form a monozygotic quadruple, 5/6 and 9/10 are monzygotic pairs. First create a vector which contains for each subject the lowest index of a monozygotic twin for that subject. For non-twins it can have any value. For this example that vector is set to 1 for subjects 1, 2, 3, and 7, to 5 for 5 and 6, and to 9 for 9 and 10. Creating this requires a short while loop. Once this is in hand we can identify the sets. Next make a matrix that has a row for every possible pair. Finally, remove the rows that are identical. The result is a set of all pairs of observations in the matrix that correspond to monozygotic pairs. # Older routines For testing purposes we have a version of the kinship function prior to addition of the chrtype argument. oldkinship <- function(id, ...) { UseMethod('oldkinship') } oldkinship.default <- function(id, dadid, momid, ...) { n <- length(id) if (n==1) return(matrix(.5,1,1, dimnames=list(id, id))) if (any(duplicated(id))) stop("All id values must be unique") kmat <- diag(n+1) /2 kmat[n+1,n+1] <- 0 pdepth <- kindepth(id, dadid, momid) mrow <- match(momid, id, nomatch=n+1) #row number of the mother drow <- match(dadid, id, nomatch=n+1) #row number of the dad for (depth in 1:max(pdepth)) { indx <- (1:n)[pdepth==depth] for (i in indx) { mom <- mrow[i] dad <- drow[i] kmat[i,] <- kmat[,i] <- (kmat[mom,] + kmat[dad,])/2 kmat[i,i] <- (1+ kmat[mom,dad])/2 } } kmat <- kmat[1:n,1:n] dimnames(kmat) <- list(id, id) kmat } oldkinship.pedigree <- function(id, ...) { n <- length(id$id)
if (n==1)
return(matrix(.5,1,1, dimnames=list(id$id, id$id)))
if (any(duplicated(id$id))) stop("All id values must be unique") kmat <- diag(n+1) /2 kmat[n+1,n+1] <- 0 pdepth <- kindepth(id) mrow <- ifelse(id$mindex ==0, n+1, id$mindex) drow <- ifelse(id$findex ==0, n+1, id$findex) # Are there any MZ twins to worry about? if (!is.null(id$relation) && any(id$relation$code=="MZ twin")) {
havemz <- TRUE
temp <- which(id$relation$code=="MZ twin")
## drop=FALSE added in case only one MZ twin set
mzmat <- as.matrix(id$relation[,c("indx1", "indx2")])[temp,,drop=FALSE] # any triples, quads, etc? if (any(table(mzmat) > 1)) { #yes there are # each group id will be min(member id) mzgrp <- 1:max(mzmat) #each person a group indx <- sort(unique(as.vector(mzmat))) # The loop below will take k-1 iterations for a set labeled as # 1:2, 2:3, ...(k-1):k; this is the worst case. while(1) { z1 <- mzgrp[mzmat[,1]] z2 <- mzgrp[mzmat[,2]] if (all(z1 == z2)) break mzgrp[indx] <- tapply(c(z1, z1, z2, z2), c(mzmat,mzmat), min) } # Now mzgrp = min person id for each person in a set matlist <- tapply(mzmat, mzgrp[mzmat], function(x) { x <- sort(unique(x)) temp <- cbind(rep(x, each=length(x)), rep(x, length(x))) temp[temp[,1] != temp[,2],] }) } else { #no triples, easier case matlist <- tapply(mzmat, row(mzmat), function(x) matrix(x[c(1,2,2,1)],2), simplify=FALSE) } } else havemz <- FALSE for (depth in 1:max(pdepth)) { indx <- (1:n)[pdepth==depth] for (i in indx) { mom <- mrow[i] dad <- drow[i] kmat[i,] <- kmat[,i] <- (kmat[mom,] + kmat[dad,])/2 kmat[i,i] <- (1+ kmat[mom,dad])/2 } if (havemz) { for (i in 1:length(matlist)) { temp <- matlist[[i]] kmat[temp] <- kmat[temp[1], temp[1]] } } } kmat <- kmat[1:n,1:n] dimnames(kmat) <- list(id$id, id$id) kmat } oldkinship.pedigreeList <- function(id, ...) { famlist <- unique(id$famid)
nfam <- length(famlist)
matlist <- vector("list", nfam)
idlist <- vector("list", nfam) #the possibly reorderd list of id values
for (i in 1:length(famlist)) {
tped <- id[i] #pedigree for this family
temp <- try(oldkinship(tped, ...), silent=TRUE)
if (class(temp)=="try-error")
stop(paste("In family", famlist[i], ":", temp))
else matlist[[i]] <- as(forceSymmetric(temp), "dsCMatrix")
idlist[[i]] <- tped$id } result <- bdiag(matlist) if (any(duplicated(id$id)))
temp <-paste(rep(famlist, sapply(idlist, length)),
unlist(idlist), sep='/')
else temp <- unlist(idlist)
dimnames(result) <- list(temp, temp)
result
} | 3,283 | 12,028 | {"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": 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": 1, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.03125 | 3 | CC-MAIN-2023-50 | latest | en | 0.865354 |
http://mathforum.org/kb/message.jspa?messageID=7908573 | 1,527,260,949,000,000,000 | text/html | crawl-data/CC-MAIN-2018-22/segments/1526794867094.5/warc/CC-MAIN-20180525141236-20180525161236-00181.warc.gz | 184,908,348 | 6,589 | Search All of the Math Forum:
Views expressed in these public forums are not endorsed by NCTM or The Math Forum.
Notice: We are no longer accepting new posts, but the forums will continue to be readable.
Topic: Please remind me why -3^2 = -9
Replies: 26 Last Post: Nov 18, 2012 7:51 PM
Messages: [ Previous | Next ]
Phil Mahler Posts: 126 Registered: 12/6/04
Re: Please remind me why -3^2 = -9
Posted: Oct 18, 2012 8:33 PM
att1.html (2.6 K)
This is a good discussion on such a seemingly simple expression.
I don¹t see two operations in 3^2. I see a number, -3, being squared. ...
Or, I would see that, if I hadn¹t been told otherwise. Just like 3^2 means 3
being squared.
As someone noted the dash is used for multiple meanings, to indicate we want
the additive inverse of say 3, or to say we want to subtract 3 from 10, 10
3, which, using the most common definition, is meaningless without knowing
that a b means a + (-b), so the dash really does mean we want an opposite
of a value, and is not, in fact, an operation.
I sometimes see students who were taught to use a smaller elevated dash to
indicate the negative of a number, so 10 - (-3) would be written 10 - -3,
with the second dash small, elevated and closer to the 3. That might
disambiguate 3^2, depending on which symbol is used. The smaller one means
you are squaring a 3, the larger symbol by the definition above must mean 0
3^2 (a = 0) and so PEMDAS actually helps there.
I also don¹t see the problem with PEMDAS, since it is, as far as I can tell,
also arbitrary, and established by custom and not axioms.
In 3 + 5 x 2, I don¹t see an axiom that would tell me what to do first. So I
wouldn¹t know how to explain it without noting the custom.
Of course maybe I¹m displaying an ignorance of the properties of a field or
something.
Phil
On 10/18/12 1:26 PM, "Paul Hertzel" <hertzpau@niacc.edu> wrote:
> Although I agree with Jack Rotman about the damage inflicted by PEMDAS, I'm
> not sure
>
> . . ."the expression ³-3^2² deals with the order of operations"
>
> gets to the heart of the problem. The reason is, in this case, the little
> horizontal bar in front of the 3 could be a part of the number's name. So
> "-3^2" is not two operations, just like "43^2" is not two operations. In the
> latter, the 4 is part of the number's name, it is not a multiplier.
>
> This is the problem, in this case, and so I think Guy Brandenburg is right.
> Writing -3^2 is just asking for trouble.
Date Subject Author
10/18/12 Phil Mahler
10/18/12 John Peterson
10/18/12 Guy Brandenburg
10/18/12 Wayne Mackey
10/18/12 Phil Mahler
10/18/12 RotmanJ
10/18/12 Paul Hertzel
10/18/12 Phil Mahler
10/18/12 Clyde Greeno
10/19/12 Clyde Greeno
10/19/12 Alain Schremmer
10/19/12 Wayne Mackey
10/19/12 Alain Schremmer
10/19/12 Clyde Greeno
10/19/12 Alain Schremmer
10/21/12 Wayne Mackey
11/14/12 Beth Hentges
11/15/12 Clyde Greeno
11/16/12 Alain Schremmer
10/18/12 Collinge, Peter (Mathematics)
10/18/12 Guy Brandenburg
10/18/12 Phil Mahler
10/18/12 Alain Schremmer
11/18/12 EddieC
11/18/12 Matthews, George
11/18/12 Phil Mahler
11/18/12 Alain Schremmer | 975 | 3,118 | {"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} | 3.875 | 4 | CC-MAIN-2018-22 | latest | en | 0.950579 |
https://www.jiskha.com/questions/1823822/for-what-values-of-a-and-b-is-each-quadrilateral-a-parallelogram-left-side-5a-top-3a-1 | 1,591,025,106,000,000,000 | text/html | crawl-data/CC-MAIN-2020-24/segments/1590347419056.73/warc/CC-MAIN-20200601145025-20200601175025-00437.warc.gz | 767,740,144 | 5,815 | # geometry
for what values of a and b is each quadrilateral a parallelogram?
Left side: 5a
Top: 3a+1
Right side: 2b-5
Bottom: b
1. 👍 0
2. 👎 0
3. 👁 38
1. to have a parallogram, opposite sides must be equal, so
3a+1 = b, and 5a = 2b-5
use substitution ,
5a = 2(3a+1) - 5
solve for a, then you can find b in b = 3a+1
1. 👍 1
2. 👎 0
## Similar Questions
1. ### Geometry
Quadrilateral ABCD is a parallelogram. If adjacent angles are congruent, which statement must be true? A. Quadrilateral ABCD is a square. B. Quadrilateral ABCD is a rhombus. C. Quadrilateral ABCD is a rectangle. D. Quadrilateral
asked by Lauren on July 5, 2017
2. ### Math
1. Name a pair of complementary angles. (1 point) 1 and 4 1 and 6 3 and 4 4 and 5 2. If m1=37°, what is m4? (1 point) 53° 43° 37° 27° 3. If m1 = 40°, what is m5? (1 point) 50° 40° 35° 25° Use the figure to answer
asked by YRN DJ on December 17, 2015
3. ### geometry
What is the most precise name for quadrilateral ABCD with vertices A(–3, 2), B(–1, 4), C(4, 4), and D(2, 2)? 1. parallelogram 2. rhombus 3. quadrilateral 4. rectangle
asked by Bob on January 11, 2013
4. ### Math Help
1. Parallelogram PARL~ parallelogram WXYZ. Find the value of c. Parallelogram 1 has P n the bottom left corner, A on the left top, R on the right top, L on the right bottom. Parallelogram 2 has W on the bottom left corner, X on
asked by callie on November 20, 2014
5. ### Geometry
A. Find the values of a and b that would make the quadrilateral a parallelogram. B. Make sure to show work Top 6b-3 Left 2a+6 Right 3a-10 Bottom 5a+1 Thank you
asked by Genevieve on January 15, 2016
1. ### Geometry
In parallelogram DEFG, DH = x + 1, HF = 3y, GH = 3x – 4, and HE = 5y + 1. Find the values of x and y. The parallelogram has D at the top left E at the top right, G at the bottom left and and F at the bottom right with H in the
asked by Hilary on January 4, 2012
2. ### Geometry PARALLELOGRAM question?
If ON=8x-8, LM=7x+4, NM=x-5, and OL=3y-6, find the values of x and y for which LMNO must be a parallelogram. {O is on the left, N is on top right, L is on bottom left and M is on bottom right} Thank You :)
asked by Alexandria on January 8, 2012
3. ### Complete the two-column proof
Complete the two-column proof Given: triangle SVX is congruent to triangle UTX and Line SV is || to line TU Prove: VUTS is a parallelogram Image: It's a parallelogram, with one line going from corner S to corner U and a line going
asked by Unknown on January 18, 2017
4. ### Math "Need Help Asap"!
Geometry Unit Practice Sheet Multiple Choice Use the figure to answer questions 1–3. 1. Name a pair of complementary angles. (1 point) 1 and 4 1 and 6 3 and 4 4 and 5 2. If m1=37°, what is m4? (1 point) 53° 43° 37° 27° 3.
asked by Markest Lee on December 17, 2015
5. ### algebra
1) What is the length of the unknown leg to the nearest tenth? (a triangle, sides: a, 10, 16. 10 is on the bottom, 16 is on the right, a is on the left. There's a right angle square on the corner to the left of the 10) A. 2.4 B.
asked by Ash on March 17, 2020
6. ### Math
The two triangle-shaped gardens are congruent. Find all of the missing side lengths and angle measures. Show any necessary work. (Triangle) • On the left, a triangle is shown with a lower horizontal side labeled 7.9 yards, a
asked by Agala on February 7, 2017 | 1,158 | 3,337 | {"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} | 4.1875 | 4 | CC-MAIN-2020-24 | latest | en | 0.844845 |
http://www.enotes.com/homework-help/what-answer-question-1-http-postimg-org-image-445925 | 1,461,874,589,000,000,000 | text/html | crawl-data/CC-MAIN-2016-18/segments/1461860106452.21/warc/CC-MAIN-20160428161506-00009-ip-10-239-7-51.ec2.internal.warc.gz | 354,579,472 | 11,900 | # What is the answer for question 1) ? http://postimg.org/image/grjobmz2f/(Reminder): this is 1 question.
### 1 Answer |Add Yours
Posted on
You need to use the following formula to evaluate the amplitude, period and phase shift of the given function `y =` `-4cos 3x + 4` :
`y = Acos(Bx - C) + D`
A represents the amplitude, hence, `A = 4.`
You may evaluate the period using the formula `T = (2pi)/B` , hence `T = (2pi)/3.`
You may evaluate the phase shift using the formula phase shift `= C/B` . Since `C = 0` ,yields that the phase shift is `C/B = 0` .
Hence, evaluating the amplitude, period and phase shift of the given function yields `A = 4, T = (2pi)/3` , phase shift `C/B = 0.`
We’ve answered 319,135 questions. We can answer yours, too. | 232 | 753 | {"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} | 3.671875 | 4 | CC-MAIN-2016-18 | longest | en | 0.73077 |
https://www.ncertbooksolutions.com/mcqs-for-ncert-class-11-physics-chapter-6-work-energy-and-power/ | 1,716,368,330,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971058534.8/warc/CC-MAIN-20240522070747-20240522100747-00524.warc.gz | 808,725,602 | 27,282 | # MCQs For NCERT Class 11 Physics Chapter 6 Work, Energy and Power
Please refer to the MCQ Questions for Class 11 Physics Chapter 2 Work, Energy and Power with Answers. The following Work, Energy and Power Class 11 Physics MCQ Questions have been designed based on the latest syllabus and examination pattern for Class 11. Our experts have designed MCQ Questions for Class 11 Physics with Answers for all chapters in your NCERT Class 11 Physics book.
## Work, Energy and Power Class 11 MCQ Questions with Answers
See below Work, Energy and Power Class 11 Physics MCQ Questions, solve the questions and compare your answers with the solutions provided below.
Question. If two particles are brought near one another, the potential energy of the system will
(a) increase
(b) decrease
(c) remains the same
(d) equal to the K.E
A
Question. A ball is allowed to fall from a height of 10 m. If there is 40% loss of energy due to air friction, then velocity of the ball when it hit the ground is
(a) 190m/s
(b) 180m/s
(c) 150m/s
(d) 120m/s
D
Question. In the non-relativistic region, if the momentum, is increase by 100% , the percentage increase in kinetic energy is
(a) 100
(b) 200
(c) 300
(d) 400
C
Question. Two bodies A and B having masses in the ratio of 3 : 1 possess the same kinetic energy. The ratio of linear momentum of B to A is
(a) 1 : 3
(b) 3 : 1
(c) 1: 3
(d) 3 :1
C
Question. Calculate the K.E and P.E. of the ball half way up, when a ball of mass 0.1 kg is thrown vertically upwards with an initial speed of 20 ms–1.
(a) 10 J, 20 J
(b) 10 J, 10 J
(c) 15 J, 8 J
(d) 8 J, 16 J
B
Question. A crate is pushed horizontally with 100 N across a 5 m floor. If the frictional force between the crate and the floor is 40 N, then the kinetic energy gained by the crate is
(a) 200 J
(b) 240 J
(c) 250 J
(d) 300 J
D
Question. An engineer claims to have made an engine delivering 10kW power with fuel consumption of 1 g/s. The calorific value of fuel is 2 kcal/g. This claim is
(a) valid
(b) invalid
(c) depends on engine design
B
Question. A force applied by an engine of a train of mass 2.05 × 106 kg changes its velocity from 5m/s to 25 m/s in 5 minutes. The power of the engine is
(a) 1.025 MW
(b) 2.05 MW
(c) 5 MW
(d) 6 MW
B
Question. When a body moves with a constant speed along a circle
(a) no work is done on it
(b) no acceleration is produced in it
(c) its velocity remains constant
(d) no force acts on it.
A
Question. A particle moves in a straight line with retardation proportional to its displacement. Its loss of kinetic energy for any displacement x is proportional to
(a) x2
(b) ex
(c) x
(d) loge x
A
Question. If the extension in a spring is increased to 4 times then the potential energy
(a) remains the same
(b) becomes 4 times
(c) becomes one fourth
(d) becomes 16 times
D
Question. A ball moving with velocity 2 m/s collides head on with another stationary ball of double the mass. If the coefficient of restitution is 0.5, then their velocities (in m/s) after collision will be
(a) 0, 1
(b) 1, 1
(c) 1, 0.5
(d) 0, 2
A
Question. A mass of 20 kg moving with a speed of 10m/s collides with another stationary mass of 5 kg. As a result of the collision, the two masses stick together. The kinetic energy of the composite mass will be
(a) 600
(b) 800
(c) 1000
(d) 1200
B
Question. A body of mass m moving with velocity v collides head on with another body of mass 2m which is initially at rest. The ratio of K. E. of colliding body before and after collision will be
(a) 1 : 1
(b) 2 : 1
(c) 4 : 1
(d) 9 : 1
D
Question. A spherical ball of mass 20 kg is stationary at the top of a hill of height 100 m. It rolls down a smooth surface to the ground, then climbs up another hill of height 30 m and finally olls down to a horizontal base at a height of 20 m above the ground. The velocity attained by the ball is
(a) 20 m/s
(b) 40 m/s
(c) 10 30 m/s
(d) 10 m/s
B
Question. Which of the following must be known in order to determine the power output of an automobile?
(a) Final velocity and height
(b) Mass and amount of work performed
(c) Force exerted and distance of motion
(d) Work performed and elapsed time of work
D
Question. A vehicle is moving with a uniform velocity on a smooth horizontal road, then power delivered by its engine must be
(a) uniform
(b) increasing
(c) decreasing
(d) zero
D
Question. How much water, a pump of 2 kW can raise in one minute to a height of 10 m, take g = 10 m/s2?
(a) 1000
(b) 1200
(c) 100
(d) 2000
B
Question. A body of mass 10 kg moves with a velocity v of 2 m/s along a circular path of radius 8 m. The power produced by the body will be
(a) 10 J/s
(b) 98 J/s
(c) 49 J/s
(d) zero
D
Question. Johnny and his sister Jane race up a hill. Johnny weighs twice as much as jane and takes twice as long as jane to reach the top . Compared to Jane
(a) Johnny did more work and delivered more power.
(b) Johnny did more work and delivered the same amount of power.
(c) Johnny did more work and delivered less power
(d) Johnny did less work and johnny delivered less power
B
Question. If two persons A and B take 2 seconds and 4 seconds respectively to lift an object to the same height h, then the ratio of their powers is
(a) 1 : 2
(b) 1 : 1
(c) 2 : 1
(d) l : 3
C
Question. A 10 H.P. motor pumps out water from a well of depth 20 m and fills a water tank of volume 22380 litres at a height of 10 m from the ground. The running time of the motor to fill he empty water tank is (g = 10ms–2)
(a) 5 minutes
(b) 10 minutes
(c) 15 minutes
(d) 20 minutes
C
Question. If a machine gun fires n bullets per second each with kinetic energy K, then the power of the machine gun is
(a) nK2
(b) K n
(c) n2K
(d) nK
D
Question. A particle of mass 5m at rest suddenly breaks on its own into three fragments. Two fragments of mass m each move along mutually perpendicular direction with speed v each. The energy released during the process is
(a) 3 /5 mv2
(b) 5 /3 mv2
(c) 3/2 mv2
(d) 4 /3mv2
D
Question. A body of mass (4m) is lying in x-y plane at rest.
It suddenly explodes into three pieces. Two pieces, each of mass (m) move perpendicular to each other with equal speeds (v). The total kinetic energy generated due to explosion is
(a) mv2
(b) 3 /2mv2
(c) 2mv2
(d) 4mv
B
Question. A 10 m long iron chain of linear mass density 0.8 kg m–1 is hanging freely from a rigid support. If g = 10 ms–2, then the power required to left the chain upto the point of support n 10 second
(a) 10 W
(b) 20W
(c) 30 W
(d) 40 W
D
Question. Which one of the following statements is true?
(a) Momentum is conserved in elastic collisions but not in inelastic collisions
(b) Total kinetic energy is conserved in elastic collisions but momentum is not conserved in elastic collisions
(c) Total kinetic energy is not conserved but momentum is conserved in inelastic collisions
(d) Kinetic energy and momentum both are conserved in all types of collisions
C
Question. When after collision the deformation is not relived and the two bodies move together after the collision, it is called
(a) elastic collision
(b) inelastic collision
(c) perfectly inelastic collision
(d) perfectly elastic collision
C
Question. In an inelastic collision, which of the following does not remain conserved?
(a) Momentum
(b) kinetic energy
(c) Total energy
(d) Neither momentum nor kinetic energy
B
Question. The coefficient of restitution e for a perfectly elastic collision is
(a) 1
(b) 0
(c) ¥
(d) –1
A
Question. The coefficient of restitution e for a perfectly inelastic collision is
(a) 1
(b) 0
(c) ¥
(d) –1
B
Question. In case of elastic collision, at the time of impact.
(a) total K.E. of colliding bodies is conserved.
(b) total K.E. of colliding bodies increases
(c) total K.E. of colliding bodies decreases
(d) total momentum of colliding bodies decreases.
C
Question. Assertion : If collision occurs between two elastic bodies their kinetic energy decreases during the time of collision. Reason : During collision intermolecular space decreases and ence elastic potential energy increases.
(a) Assertion is correct, reason is correct; reason is a correct explanation for assertion.
(b) Assertion is correct, reason is correct; reason is not a correct explanation for assertion
(c) Assertion is correct, reason is incorrect
(d) Assertion is incorrect, reason is correct.
B
Question. Before a rubber ball bounces off from the floor, the ball is in contact with the floor for a fraction of second. Which of the following statements is correct?
(a) Conservation of energy is not valid during this period
(b) Conservation of energy is valid during this period
(c) As ball is compressed, kinetic energy is converted to compressed potential energy
(d) None of these
B
Question. A particle A suffers an oblique elastic collision with a particle B that is at rest initially. If their masses are the same, then after collision
(a) they will move in opposite directions
(b) A continues to move in the original direction while B remains at rest
(c) they will move in mutually perpendicular directions
(d) A comes to rest and B starts moving in the direction of the original motion of A
C
Question. A metal ball of mass 2 kg moving with a velocity of 36 km/h has a head on collision with a stationary ball of mass 3 kg. If after the collision, the two balls move together, the loss n kinetic energy due to collision is
(a) 140 J
(b) 100 J
(c) 60 J
(d) 40 J
A
Question. An object of mass 2.0 kg makes an elastic collision with another object of mass M at rest and continues to move in the original direction but with one-fourth of its original speed. hat is the value of M?
(a) 0.75 kg
(b) 1.0 kg
(c) 1.2 kg
(d) None of these
D
Question. A bullet of mass 20g and moving with 600 m/s collides with a block of mass 4 kg hanging with the string. What is velocity of bullet when it comes out of block, if block rises to eight 0.2 m after collision ?
(a) 200 m/s
(b) 150 m/s
(c) 400 m/s
(d) 300 m/s
A
Question. A block of mass 0.50 kg is moving with a speed of 2.00 ms–1 on a smooth surface. It strikes another mass of 1.00 kg and then they move together as a single body. The energy loss during the collision is
(a) 0.16 J
(b) 1.00 J
(c) 0.67 J
(d) 0.34 J
C
Question. An electron and a proton are moving under the influence of mutual forces. In calculating the change in the kinetic energy of the system during motion, one ignores the magnetic force of one on another. This is, because
(a) the two magnetic forces are equal and opposite, so they produce no net effect
(b) the magnetic forces do not work on each particle
(c) the magnetic forces do equal and opposite (but nonzero) work on each particle
(d) the magnetic forces are necessarily negligible
B
Question. A proton is kept at rest. A positively charged particle is released from rest at a distance d in its field. Consider two experiments; one in which the charged particle is also a
proton and in another, a positron. In the same time t, the work done on the two moving charged particles is
(a) same as the same force law is involved in the two experiments
(b) less for the case of a positron, as the positron moves away more rapidly and the force on it weakens
(c) more for the case of a positron, as the positron moves away a larger distance
(d) same as the work done by charged particle on the stationary proton
C
Question. A man squatting on the ground gets straight up and stand.
The force of reaction of ground on the man during the process is
(a) constant and equal to mg in magnitude
(b) constant and greater than mg in magnitude
(c) variable but always greater than mg
(d) at first greater than mg and later becomes equal to mg
D
Question. A bicyclist comes to a skidding stop in 10 m. During this process, the force on the bicycle due to the road is 200N and is directly opposed to the motion. The work done by the cycle on the road is
(a) + 2000 J
(b) – 200 J
(c) zero
(d) – 20,000 J
C
Question. A body is falling freely under the action of gravity alone in vaccum. Which of the following quantities remain constant during the fall?
(a) Kinetic energy
(b) Potential energy
(c) Total mechanical energy
(d) Total linear momentum
C
Question. During inelastic collision between two bodies, which of the following quantities always remain conserved?
(a) Total kinetic energy
(b) Total mechanical energy
(c) Total linear momentum
(d) Speed of each body
C
Question. The vector sum of two forces is perpendicular to their vector differences. In that case, the forces
(a) are equal to each other
(b) are equal to each other in magnitude
(c) are not equal to each other in magnitude
(d) cannot be predicted.
B
Question. A particle of mass 10 g moves along a circle of radius 6.4 cm with a constant tangential acceleration. What is the magnitude of this acceleration if the kinetic energy of the particle becomes equal to 8 × 10–4 J by the end of the second revolution after the beginning of the motion?
(a) 0.18 m/s2
(b) 0.2 m/s2
(c) 0.1 m/s2
(d) 0.15 m/s2
D
Question. A bullet of mass 10 g leaves a rifle at an initial velocity of 1000 m/s and strikes the earth at the same level with a velocity of 500 m/s. The work done in joule for overcoming the resistance of air will be
(a) 375
(b) 3750
(c) 5000
(d) 500
B
Question. A body moves a distance of 10 m along a straight line under the action of a 5 N force. If the work done is 25 J, then angle between the force and direction of motion of the body is
(a) 60°
(b) 75°
(c) 30°
(d) 45° | 3,700 | 13,481 | {"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} | 3.46875 | 3 | CC-MAIN-2024-22 | latest | en | 0.85564 |
https://cboard.cprogramming.com/cplusplus-programming/78739-mpi-linear-pipeline-solution-jacobi-iteration-printable-thread.html | 1,511,207,439,000,000,000 | text/html | crawl-data/CC-MAIN-2017-47/segments/1510934806124.52/warc/CC-MAIN-20171120183849-20171120203849-00152.warc.gz | 571,566,064 | 4,088 | # MPI - linear pipeline solution for jacobi iteration
• 05-03-2006
eclipt
MPI - linear pipeline solution for jacobi iteration
hello
i have a problem on how to write 2 parallel code by using MPI programming with c/c++ to solve a system of linear equation by using jacobi and gauss-seidel iteration method. and it is using pipelining.
here is sample code of an equation solve by using pipeline:
F = a0x0 + a1x1 + a2x2 …….+ k + an-1xn-1
Code:
```#include <stdio.h> #include <stdlib.h> #include "mpi.h" #define n 100 void main(int argc,char** argv) { int my_id,i,data[n],a,p,F,x,Tx; MPI_Status status; MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD,&my_id); MPI_Comm_size(MPI_COMM_WORLD,&p); if (my_id==0) { x=rand()%5; for (i=0;i<p;i++) { data[i]=rand()%5; MPI_Send(&data[i],1,MPI_INT,I,0,MPI_COMM_WORLD); MPI_Send(&x,1,MPI_INT,i,0,MPI_COMM_WORLD); } } MPI_Recv(&a,1,MPI_INT,0,0,MPI_COMM_WORLD,&status); MPI_Recv(&x,1,MPI_INT,0,0,MPI_COMM_WORLD,&status); if (my_id==0) { F=a; x=1; MPI_Send(&F,1,MPI_INT,1,0,MPI_COMM_WORLD); MPI_Send(&x,1,MPI_INT,1,0,MPI_COMM_WORLD); } if (my_id>0) { MPI_Recv(&F,1,MPI_INT,my_id-1,0,MPI_COMM_WORLD,&status); MPI_Recv(&Tx,1,MPI_INT,my_id-1,0,MPI_COMM_WORLD,&status); x=Tx*x; F=F+a*x; MPI_Send(&F,1,MPI_INT,(my_id+1)%p,0,MPI_COMM_WORLD); MPI_Send(&x,1,MPI_INT,(my_id+1)%p,0,MPI_COMM_WORLD); } if (my_id==0) { MPI_Recv(&F,1,MPI_INT,p-1,0,MPI_COMM_WORLD,&status); printf("F= %d\n",F); } MPI_Finalize(); }```
so how can i modified this code so that
i can do the pipeline jacobi iteration and pipeline gauss-seidel iteration
assuming the equation is like
a11x1 + a12x2 + … + a1nxn = b1;
a21x1 + a22x2 + … + a2nxn = b2;
. .
. .
. .
an1x1 + an2x2 + … + annxn = bn
for the jacobi iteration :
suppose that one process is allocated for each unknown ( p=n)
and each process iterate the same number of time.on each iteration the newly computed values of the unknow will need to be broadcast to all other process.
the parallel algorithm should be like this
Code:
```x[i] = b [i] /*initialize unknown for (iteration =0; iteration<limit; iteration++){ sum = -a[i][i] * x[i]; for (j = 0; j < n; j++) /* compute summation */ sum = sum + a[i][j] * x[j]; new_x[i] = (b[i] - sum) / a[i][i]; /*compute unknown*/ broadcast_receive (xnew[i]); /*broadcast value*/ global_barrier (); /* wait for all process */ }```
an alternative simple solution is to return to basic send() and recv() , for broadcast_receive(); that is process i might have:
Code:
```for (j=0; j<n; j++) if (i !=j) send (&x[i], Pj); for (j=0; j<n; j++) if (i !=j) send (&x[j], Pj);```
i need to modify this sequential code for gauss-seidel so that in can be done in parallel
Code:
```for (i = 0; i < n -1; i++) /*for each row except last*/ for (j = i+1; j<n; j++){ /* step through subsequent row*/ m = a[j] [i]/a[i][i]; /*compute multiplier*/ for (k= i; k<n; k++) /*modify last n-i-1 element of row j */ a [j][k] = a[j][k] - a[i][k] * m ; b[j] = b[j] - b[i] *m; /* modify right side */```
The master process (rank 0) accepts the size of the system and reads the coefficients a’s
and b’s. Then, it will distribute them to the corresponding slave processes. The master
process should collect the final solution from the slave processes and display
i wish if there is solution for this problem
• 05-03-2006
Salem
Can you check your code?
There seems to be a lot of italic code, so it seems like the board has eaten an [ i ] subscript and turned it into italics.
Also, void main is wrong, see the FAQ | 1,169 | 3,730 | {"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} | 2.6875 | 3 | CC-MAIN-2017-47 | latest | en | 0.429001 |
https://guidedmath.wordpress.com/2011/08/23/an-addition-algorithm/ | 1,500,856,375,000,000,000 | text/html | crawl-data/CC-MAIN-2017-30/segments/1500549424645.77/warc/CC-MAIN-20170724002355-20170724022355-00136.warc.gz | 647,861,077 | 40,561 | The New Math Common Core states that children will understand how to “add and subtract (depending on the grade level the number range varies)…using strategies and algorithms based in place value, properties of operations and/or the relationship between addition and subtraction.”
We have to really think about what does this mean in action? How does it look in the classroom? How do we get fluent as a teaching community ourselves, so that we can teach this way. I think one way to start is to have grade level discussions about how to operationalize this.
I do think that we should use small guided math groups to discuss different strategies because you want to give the students a chance to talk about their thinking.
Here are some examples of teaching partial sums.
Video
What do you think of the way the teacher frames the method?
How does it make it more student friendly by saying we are going to “break-down” the parts.
What do you think of the way that the teacher uses different colored pencils to highlight the parts of the problem?
In this next video notice how Eli is solving the problem by drawing out the base ten blocks. What does this tell us about his understanding of place value?
Now look at this video of a teacher using technology to teach the partial sums method.
How does this instructional strategy of representing it differ from using the concrete base ten blocks? Do you see how it clearly shows the relationship of place value while moving towards just the abstract representation – but using the pictures as the ongoing scaffold.
Look at these next two videos:
Video 1
Video 2
What do you notice about the way that the teacher is talking about the numbers? Notice how he says “5 tens or 50 ones.” Also notice the very step by step process that he uses to scaffold learning of the strategy.
Here is a Partial Sums Poster.
I wanted to share these videos because they offer different perspectives and nuances on teaching this algorithm.
Happy Mathing,
Dr. Nicki
Partial Sums Poster
Make a Comment
## 3 Responses to “An Addition Algorithm”
Dr. Nicki,
I look forward to your blog enteries and always find them very helpful. I just want to thank you for all of your hard work.
You seem to accept that teachers should respect, be answerable to, and accept whatever the Common Core Standards say. I’m much less sanguine about them and wonder if your readers have considered questioning the notion that the “gods” of mathematics have spoken and we mortals have no choice but to obey. For that matter, I wonder if you’ve considered that notion yourself.
Hi Mike,
I think you raise a great issue. I think we should always think critically about the standards. Along with that, we all know that the standards are coming! Everybody except Alaska and Texas has signed up to implement them. So, I think we have to really talk about what that looks like. We have to consider how do we effectively implement them given that they are here to stay for a while. I also really like a great deal about the new standards. I think it is great how they are based in the research. I don’t think we talk about math research enough and so to see standards that tie directly to the research is exciting.
Happy Mathing,
Dr. Nicki
Where's The Comment Form? | 680 | 3,285 | {"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} | 3.6875 | 4 | CC-MAIN-2017-30 | longest | en | 0.953292 |
https://www.instructables.com/id/Intel-Edison-Hands-on-Day-2-FlameFire-alarm/ | 1,568,959,863,000,000,000 | text/html | crawl-data/CC-MAIN-2019-39/segments/1568514573832.23/warc/CC-MAIN-20190920050858-20190920072858-00533.warc.gz | 908,238,316 | 20,234 | # Intel® Edison Hands-on Day 2: FlameFire Alarm
3,531
14
1
Install a fire alarm in the kitchen will be of use to us. A small flame can trigger it and the range of it can reach 20CM. This mini fire alarm may avoid some accidents so why not?
### Teacher Notes
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
## Step 1: Connection
Digital Buzzer Module → Digital Pin 8
Flame sensor → Analog Pin 0
## Step 2: Coding
```float sinVal; int toneVal; void setup(){
pinMode(8, OUTPUT); //Set the buzzer pin as output
Serial.begin(9600); //Set
the baud to 9600}void loop(){
int sensorValue = analogRead(0);//Read the Analog value from Flame
sensorSerial.println(sensorValue); delay(1);
if(sensorValue < 1023){ // If
the value is less than 1023, the fire exists and let the buzzer run. for(int x=0; x<180; x++){ //Change from degree to radian
using sin() function sinVal = (sin(x*(3.1412/180))); //Create the frequency for the
buzzer. toneVal = 2000+(int(sinVal*1000)); //Run the buzzer. tone(8, toneVal); delay(2);
}
} else { // If the value is more
than 1023, the fire doesn’t exists and let the buzzer stop. noTone(8); //Turn off the buzzer
}}```
Try to move the lighter close to the flame sensor, and hear whether the buzzer will work.
Flame sensor is an analog input device to detect the fire,buzzer is parentally an output device,the Edison is the controller.
## Step 4: Code Review
Note the two variable:
float sinVal;
int toneVal;
Float variable sinVal stores the sine changing corresponding to the degree. Sine wave describes a smooth repetitive oscillation, so that we use it to create the frequency of the sound. Thus we convert the sinVal to toneVal, which makes it suitable to the buzzer output.
Flame sensor is the input device, so we need to read the analog value from the specific pin. The Syntax looks like this:
Reads the value from the specified analog pin. The Edison Arduino kit contains a 6 channel 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. For example, the analog value 512 stands for 2.5V.
The sin() function calculates the sine of an angle (in radians). The result will be between -1 and 1. To avoid the negative, we should constrain the degree changing between 0 and 180. We realize it by using for statement.
for(int x=0; x<180; x++){}
The sin() function uses radian as input, so conversion should be done at first. Multiplied by 3.1415/180 can change from degree to radian:
sinVal = (sin(x*(3.1412/180)));
After that convert the sinVal to toneVal, which makes it suitable to the frequency of the buzzer:
toneVal = 2000+(int(sinVal*1000));
There is one point here, which is how to convert the float to integer.
sinVal is a float type, just use int() to do the convertion:
int(sinVal*1000)
sinVal multiplied by 1000 and plus 2000 results in toneVal. Then toneVal can be used as the frequency for buzzer.
After that, use tone to run the buzzer.
tone(8, toneVal);
Let’s talking about the tone:
(1)tone(pin,frequency)
It is used to generate a square wave of the specified frequency on a pin
pin: the pin on which to generate the tone
frequency: the frequency of the tone in hertz - unsigned int
(2)tone(pin,frequency,duration)
pin: the pin on which to generate the tone
frequency: the frequency of the tone in hertz - unsigned int
duration: the duration of the tone in milliseconds (optional) - unsigned long
(3)noTone(pin)
It stops the generation of a square wave triggered by tone()
## Recommendations
• ### Large Motors Class
13,274 Enrolled | 972 | 3,817 | {"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} | 3.140625 | 3 | CC-MAIN-2019-39 | latest | en | 0.700434 |
https://betterlesson.com/lesson/432498/graphing-the-tangent-function?from=consumer_breadcrumb_dropdown_lesson | 1,532,271,345,000,000,000 | text/html | crawl-data/CC-MAIN-2018-30/segments/1531676593302.74/warc/CC-MAIN-20180722135607-20180722155607-00486.warc.gz | 611,990,881 | 19,694 | # Graphing the Tangent Function
Unit 8: Trigonometry: Periodic Functions
Lesson 4 of 6
## Big Idea: By exploring the graph of the tangent function, students get a preview of some important ideas that they may see in future math classes.
Print Lesson
80 minutes
### James Dunseith
##### Similar Lessons
###### What is Algebra?
Algebra II » Modeling with Algebra
Big Idea: Algebra is built on axioms and definitions and relies on proofs just as much as geometry.
Favorites(37)
Resources(19)
Fort Collins, CO
Environment: Suburban
###### Maximizing Volume - Day 1 of 2
12th Grade Math » Functioning with Functions
Big Idea: A classic maximization problem is used to investigate relative extrema.
Favorites(4)
Resources(12)
Troy, MI
Environment: Suburban
###### SUPPLEMENT: Linear Programming Application Day 1 of 2
Algebra I » Systems of Equations and Inequalities
Big Idea: This lesson gives students the opportunity to synthesize what they have learned before they begin to create their own linear programming problems.
Favorites(5)
Resources(17)
Boston, MA
Environment: Urban
Something went wrong. See details for more info
Nothing to upload details close | 267 | 1,164 | {"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} | 2.6875 | 3 | CC-MAIN-2018-30 | latest | en | 0.847777 |
http://www.solutioninn.com/a-make-recommendations-to-harry-and-belinda-regarding-where-to | 1,495,730,456,000,000,000 | text/html | crawl-data/CC-MAIN-2017-22/segments/1495463608107.28/warc/CC-MAIN-20170525155936-20170525175936-00617.warc.gz | 667,137,374 | 7,953 | # Question: a Make recommendations to Harry and Belinda regarding where to
(a) Make recommendations to Harry and Belinda regarding where to seek financing and what APR to expect.
(b) Using the Garman/Forgue companion website or the information in Table 7-1, calculate the monthly payment for a loan period of three, four, and five years at 8 percent APR. Describe the relationship between the loan period and the payment amount.
(c) Harry and Belinda have a cash-flow deficit projected for several months this year. Suggest how, when, and where they might finance the shortages by borrowing.
Harry and Belinda need some questions answered regarding credit. Their three-year-old car has been experiencing mechanical problems lately. Instead of buying a new set of tires, as planned for in March, they are considering trading the car in for a newer used vehicle so that Harry can have dependable transportation for commuting to work. The couple still owes \$3600 to the bank for their current car, or \$285 per month for the remaining 18 months of the 48-month loan. The trade-in value of this car plus \$1000 that Harry earned from a freelance interior design job should allow the couple to pay off the auto loan and leave \$1250 for a down payment on the newer car. The Johnsons have agreed on a sales price for the newer car of \$14,250. The money planned for tires will be spent for other incidental taxes and fees associated with the purchase.
View Solution:
Sales5
Views205 | 311 | 1,481 | {"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} | 2.65625 | 3 | CC-MAIN-2017-22 | longest | en | 0.952327 |
http://rfcafe.com/references/popular-electronics/electronic-sticklers-may-1959-popular-electronics.htm | 1,675,172,332,000,000,000 | text/html | crawl-data/CC-MAIN-2023-06/segments/1674764499871.68/warc/CC-MAIN-20230131122916-20230131152916-00120.warc.gz | 38,535,007 | 8,607 | # Electronic SticklersMay 1959 Popular Electronics
May 1959 Popular Electronics Table of Contents Wax nostalgic about and learn from the history of early electronics. See articles from Popular Electronics, published October 1954 - April 1985. All copyrights are hereby acknowledged.
Here are a few more electronics conundrums with which to exercise the old noodle. These are puzzlers from a 1959 issue of Popular Electronics magazine, but at least one of them (#4) will likely prove to be a real stickler unless you have seen a similar resistor mesh problem before (here is my solution for the resistor cube equivalent resistance). There are no tube circuits to use as an excuse for not attempting them - just resistors, batteries, switches, meters, a motor, and a couple light bulbs. All four would be fair game to present to an interviewee to see where he/she stands on basic circuit analysis. (see also the April Electronic Sticklers)
Electronic Sticklers
These four thought twisters are arranged in order of increasing difficulty.
1) Happy Snap (left), having only an s.p.s.t. switch, wanted to turn on a floodlight and a pilot light on the control board at the same time. Expecting no trouble, he wired his setup as shown. After double-checking his connections, he held his breath and inserted the wall plug. Things didn't quite work out. Do you have any idea why?
-Robert L. Noland
2) Dewey Dubblecheck, who believes in making all measurements twice, connected a voltmeter and an ammeter to measure the power drawn in this circuit (right). Using the formula: W = E x I, he found that the motor drew 40 watts. He made the measurement again, this time using a standard wattmeter, and read only 30 watts. Dewey is puzzled - are you?
-Donald R. Wesson
3) Sam Addit made this simple computer (left) to add any numbers from 1 to 6. The resistors were adjusted so that if battery #1 were switched in, the 0-15 voltmeter would read 1, switching in battery #2 would give a reading of 2, and so on. He figured that if a combination like 2 and 5 were used, the meter would read 7. What did it actually read ?
-Hal Carlson
4) Network has a mesh of 1-ohm resistors connected as shown and extending across his living room floor. Some day he hopes to extend the mesh all the way to infinity - and maybe even beyond. Can you calculate what the resistance will be between points "A" and "B" when his "tangled web" is finished?
-Roy S. Reichert & Gene Harris
Answers to Electronic Sticklers
1. With the switch off, the lights will be in series across 117 volts ±6 volts. Pilot light will pop first, then the floodlight will go out.
2. Dewey failed to consider power factor when he made his original measurement with a voltmeter and ammeter. The wattmeter automatically took power factor into consideration. In this circuit the power factor is 0.75.
3. The reading would be 5 because the batteries are connected in parallel. Actually, unless the resistors are very large in value, the meter will read some value between 2 and 5 due to the loop current set up in the parallel circuit.
4. Although it is not practical to construct an infinite mesh, you can solve this problem by using a variation of the constant current method for solving network problems.
Assume that a battery is connected to the mesh in such a way that one terminal of the battery is connected to point "A" and the other terminal is connected at infinity. The size and polarity of the battery is such that 1 ampere of current flows "into the paper" at point "A". Since the three resistors connected to point "A" are all equal (1 ohm) and the surrounding mesh is symmetrical, the current divides equally in the three branches. Hence, the current in the resistor between "A" and "B" is 1/3 ampere (ia).
Now connect a second battery in a similar fashion, only in this case, while one terminal again connects at infinity, the other terminal is connected to point "B". The size and polarity of this battery is such that 1 ampere of current flows "out of the paper" at "B". Again, for the same reason, the current divides equally. Hence, an additional 1/3 ampere (ib) flows through the resistor between "A" and "B" in the same direction as the current from the first battery. Since one terminal of each battery is connected at infinity, the two currents at this point are equal and opposite; therefore, they cancel. The infinite extremes of the mesh may be neglected.
It can be seen that a total current through the resistor (ia + ib) is 2/3 ampere. Since this resistor equals 1 ohm, the voltage drop across it will be 2/3 volt. It follows then that since 1 ampere of current flows into point "A" and out of point "B," and the voltage drop from "A" to "B" is 2/3 volt, the total mesh resistance is: R = E/1, or 2/3 volt/1 ampere, or 2/3 of an ohm.
If you know of a tricky Electronic Stickler, send it in with the solution to the editors of POPULAR ELECTRONICS. If it is accepted, we will send you a \$5 check. Write each Stickler you would like to submit on the back of a postcard. Submit as many postcards as you like but, please, just one Stickler per postcard. Send to: POPULAR ELECTRONICS STICKLERS, One Park Ave., New York 16, N. Y. Sorry, but we will not be able to return unused Sticklers.
Posted August 4, 2021
(updated from original post on 2/7/2013) | 1,280 | 5,340 | {"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} | 3.015625 | 3 | CC-MAIN-2023-06 | longest | en | 0.961143 |
https://e-learnteach.com/12-56-divided-by-3-14/ | 1,679,664,016,000,000,000 | text/html | crawl-data/CC-MAIN-2023-14/segments/1679296945282.33/warc/CC-MAIN-20230324113500-20230324143500-00465.warc.gz | 268,745,538 | 13,453 | # 12.56 divided by 3.14
.. by step method for solving your equations 12.56/3.14 so that you understand better. To divide fractions, write the divison as multiplication by the. 12.56÷3.14 12.56 ÷ 3.14. Divide the numbers. Answer. 4 4. circle-check-icon. Please divide by decimals. See the solving process. Please divide by decimals.Simple and best practice solution for 12.56=3.14*d equation. 0.00 + -12.56 = -12.56 -3.14d = -12.56 Divide each side by ‘-3.14’. d = 4 Simplifying d = 4. Q: What is 12.56 divided by 3.14? Write your answer.. Submit. Still have questions? magnify glass. Find more answers. Ask your question.Expand frac{12.56}{3.14} by multiplying both numerator and the denominator by 100. sqrt{4}. Divide 1256 by 314 to get 4.
View this answer now! It’s completely free. | 243 | 787 | {"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} | 3.859375 | 4 | CC-MAIN-2023-14 | latest | en | 0.89275 |
https://gmatclub.com/forum/in-january-there-was-a-large-drop-in-the-number-of-new-44108.html?fl=similar | 1,511,267,958,000,000,000 | text/html | crawl-data/CC-MAIN-2017-47/segments/1510934806353.62/warc/CC-MAIN-20171121113222-20171121133222-00515.warc.gz | 625,304,703 | 44,094 | It is currently 21 Nov 2017, 05:39
### 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
# In January there was a large drop in the number of new
Author Message
Manager
Joined: 22 Feb 2007
Posts: 66
Kudos [?]: 1 [0], given: 0
In January there was a large drop in the number of new [#permalink]
### Show Tags
04 Apr 2007, 16:34
00:00
Difficulty:
(N/A)
Question Stats:
0% (00:00) correct 0% (00:00) wrong based on 0 sessions
### HideShow timer Statistics
In January there was a large drop in the number of new houses sold, because interest rates for mortgages were falling and many consumers were waiting to see how low the rates would go. This large sales drop was accompanied by a sharp rise in the average price of new houses sold.
Which of the following, if true, best explains the sharp rise in the average price of new houses?
(A) Sales of higher-priced houses were unaffected by the sales drop because their purchasers have fewer constraints limiting the total amount they pay.
(B) Labor agreements of builders with construction unions are not due to expire until the next January.
(C) The prices of new houses have been rising slowly over the past three years because there is an increasing shortage of housing.
(D) There was a greater amount of moderate-priced housing available for resale by owners during January than in the preceding three months.
(E) Interest rates for home mortgages are expected to rise sharply later in the year if predictions of increased business activity in general prove to be accurate.
Kudos [?]: 1 [0], given: 0
Manager
Joined: 07 Feb 2007
Posts: 212
Kudos [?]: 15 [0], given: 0
Re: CR - rise in avg prices [#permalink]
### Show Tags
04 Apr 2007, 17:06
A is right.
Lower-priced houses are sold fewer and higher-priced houses are sold as same as before.
Kudos [?]: 15 [0], given: 0
VP
Joined: 28 Mar 2006
Posts: 1367
Kudos [?]: 38 [0], given: 0
### Show Tags
04 Apr 2007, 17:39
A..
Kudos [?]: 38 [0], given: 0
GMAT Club Legend
Joined: 07 Jul 2004
Posts: 5032
Kudos [?]: 453 [0], given: 0
Location: Singapore
### Show Tags
04 Apr 2007, 18:09
A sound plausible. High networth customers might not be bothered with moartgage loan rates when they decide on purchasing a property.
Kudos [?]: 453 [0], given: 0
Senior Manager
Joined: 04 Nov 2006
Posts: 257
Kudos [?]: 260 [0], given: 0
Location: California
### Show Tags
04 Apr 2007, 19:16
C?
Kudos [?]: 260 [0], given: 0
VP
Joined: 07 Nov 2005
Posts: 1115
Kudos [?]: 53 [0], given: 1
Location: India
### Show Tags
04 Apr 2007, 21:04
mm007 wrote:
C?
The question clearly refers to "This large sales drop was accompanied by a sharp rise in the average price of new houses sold".
The time frame in question is the drop of interest rates in January.
So if there was a drop in the sales of the lower to medium priced houses in January while the higher priced houses sales were not affected, the average price shot up.
_________________
Trying hard to conquer Quant.
Kudos [?]: 53 [0], given: 1
Manager
Joined: 20 Nov 2006
Posts: 213
Kudos [?]: 18 [0], given: 0
### Show Tags
04 Apr 2007, 21:41
Another A
Kudos [?]: 18 [0], given: 0
Manager
Joined: 28 Feb 2007
Posts: 195
Kudos [?]: 12 [0], given: 0
Location: California
Re: CR - rise in avg prices [#permalink]
### Show Tags
04 Apr 2007, 21:46
amd08 wrote:
In January there was a large drop in the number of new houses sold, because interest rates for mortgages were falling and many consumers were waiting to see how low the rates would go. This large sales drop was accompanied by a sharp rise in the average price of new houses sold.
Which of the following, if true, best explains the sharp rise in the average price of new houses?
(A) Sales of higher-priced houses were unaffected by the sales drop because their purchasers have fewer constraints limiting the total amount they pay.
(B) Labor agreements of builders with construction unions are not due to expire until the next January.
(C) The prices of new houses have been rising slowly over the past three years because there is an increasing shortage of housing.
(D) There was a greater amount of moderate-priced housing available for resale by owners during January than in the preceding three months.
(E) Interest rates for home mortgages are expected to rise sharply later in the year if predictions of increased business activity in general prove to be accurate.
The average price of sold houses increased. This means that high priced houses were sold. Hence A
All other points dont make much sense
Kudos [?]: 12 [0], given: 0
Re: CR - rise in avg prices [#permalink] 04 Apr 2007, 21:46
Display posts from previous: Sort by
# In January there was a large drop in the number of new
Moderators: GMATNinjaTwo, GMATNinja
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®. | 1,423 | 5,518 | {"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} | 3.46875 | 3 | CC-MAIN-2017-47 | latest | en | 0.971751 |
https://www.varsitytutors.com/algebra_1-help/how-to-write-expressions-and-equations | 1,670,610,984,000,000,000 | text/html | crawl-data/CC-MAIN-2022-49/segments/1669446711475.44/warc/CC-MAIN-20221209181231-20221209211231-00163.warc.gz | 1,089,367,350 | 61,740 | # Algebra 1 : How to write expressions and equations
## Example Questions
← Previous 1 3 4 5 6 7 8 9 16 17
### Example Question #1 : How To Write Expressions And Equations
Write in simplest form:
Explanation:
Rewrite, then distribute:
### Example Question #2 : How To Write Expressions And Equations
A car travels at a speed of 60 miles per hour. It is driven for 2.5 hours. How many miles does it travel?
Explanation:
To solve this problem, you need to construct an algebraic equation. If is the distance traveled, then must equal to the speed multiplied by the time travelled. In this case, , which gives you a result of 150 miles.
### Example Question #1 : How To Write Expressions And Equations
Rewrite the expression in simplest terms, where is the imaginary number .
Explanation:
Writing this expression in simplest terms can be achieved by first factoring the radical into its smallest factors.
Multiplying the two together results in . Multiplying this by (which is simplified to ) results in the answer .
### Example Question #2 : How To Write Expressions And Equations
Rewrite the equation for in terms of .
Explanation:
The goal in expressing in terms of is to isolate on one side of the equation. One way to do this is to factor out of the fraction on the right side of the equation, then divide the entire equation by the fraction that remains after factoring. Remember that dividing by a fraction is the same as multiplying by the reciprocal of that fraction.
The left side of this equation will simply resolve into , although there are still variables on the right, so this is not yet in terms of . The right side resolves based on the rules for multiplying and dividing variables with exponents (add the exponents of like variables being multiplied, subtract the smaller exponent from the larger in the case of division, and change the variable to a if the resulting exponent is ).
Since there is still a in the numerator on the right side of the equation, we will need to divide both sides of the equation by .
We have no solved for the reciprocal of in terms of . We simply flip both sides of the equation to get our answer.
### Example Question #2 : How To Write Expressions And Equations
Translate this sentence into a mathematical equation:
Three less than five times a number is the same as two more than twice that number.
Explanation:
Three less than five times a number is the same as two more than twice that number.
Let the number be .
"Three less than five times a number" translates into .
"Is the same as" means equal to or "".
"Two more than twice that number" means .
Putting these together gives:
### Example Question #1 : How To Write Expressions And Equations
For the given equation determine the slope:
Explanation:
By changing the equation to slope intercept form we get the following:
Hence the slope is
### Example Question #923 : Algebra 1
What is the slope and the and intercepts of a line which passes through and ?
slope = undefined, x-int = -3, y-int = none
slope = 0, x-int = -3, y-int = 2
slope = 0, x-int = 2, y-int = -3
slope = undefined, x-int 2, y-int = -3
slope = 1, x-int = 2, y-int = 2
slope = undefined, x-int = -3, y-int = none
Explanation:
For a vertical line e.g. and
This line does not intersect the and hence there is no .
Since the line passes through hence the -intercept .
### Example Question #1 : How To Write Expressions And Equations
Write the equation of a line with a slope of
and passes through the point .
Explanation:
Here we use the point-slope formula of a line which is
By plugging in , and values we get the following:
which is equal to
When the above is simplified we get:
### Example Question #4 : How To Write Expressions And Equations
Complete the missing information for the equation of the following line
and determine which one of the coordinates is not a solution to the above equation.
Explanation:
Replacing with , one gets which tells us that is not a solution.
### Example Question #1 : How To Write Expressions And Equations
Convert the following into the standard form of a line: | 972 | 4,158 | {"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} | 4.90625 | 5 | CC-MAIN-2022-49 | longest | en | 0.876858 |
https://repl.it/@bobbywjamc/ChillyTamePetabyte | 1,579,371,031,000,000,000 | text/html | crawl-data/CC-MAIN-2020-05/segments/1579250593295.11/warc/CC-MAIN-20200118164132-20200118192132-00128.warc.gz | 626,090,593 | 84,523 | @bobbywjamc/
# ChillyTamePetabyte
## No description
Files
• main.cpp
• input.txt
main.cpp
```1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
```
```/*
Problem: Write a program that allows the user to enter the last names of five candidates in
a local election and the number of votes received by each candidate. The
program should then output each candidate’s name, the number of votes
program should also output the winner of the election.
*/
//////////////////////////////////////////
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <fstream>
using namespace std;
//Function prototype
void electionValues(string nombre[], int votos[]);
void winner(string name[], int votes[], int counts[]);
int total(string nam[], int nums[]);
int gTotal;
//Main Function
int main() {
cout << "================================================" << endl;
cout << "Description: Candidate Project" << endl;
cout << "School: Long Beach City College" << endl;
cout << "Author: Christian Araya" << endl;
cout << "Date: April 29th 2018" << endl;
cout << "Program: CArayaProject7" << endl;
cout << "================================================\n\n\n" << endl;
//Declarations & Initializations
int tally[5] = {0};
string names[5] = {""};
// Gen Format
cout << fixed << showpoint << setprecision(2);
//Output
cout << setw(15) << left << "Candidate"
<< setw(25) << right << "% of Total Votes\n\n";
//Process
//CALL FUNCTION that will calculate total and assign it to some global variable so that the following function electionValues can have the correct value of the total
total(names, tally);
electionValues(names, tally);
cout << endl << endl << "The Winner of the Election is: ";
winner(names, tally, tally);
cout << endl << endl << endl;
return 0;
}
//Function Definitions
void electionValues(string nombre[], int votos[])
{
setprecision(2);
int i = 0;
int sum = 0;
ifstream inFile; //Declare input variable
inFile.open("input.txt"); // open file
while (!inFile.eof())
{
inFile >> nombre[i] >> votos[i];
cout << setw(10) << left << nombre[i]
<< setw(15) << right << votos[i]
<< setw(22) << right << (static_cast<double>(votos[i])) / gTotal * 100 << endl;
++i;
}
for (int j = 0; j <= 4; j++)
{
sum = sum + votos[j];
}
cout << setw(10) << left << "Total"
<< setw(15) << right << sum;
inFile.close(); // close file
}
void winner(string name[], int votes[], int counts[])
{
int e = 0;
int champTally;
ifstream input;
input.open("input.txt");
while (!input.eof())
{
}
int max = 0;
string champName;
for (int k = 0; k < 4; k++)
{
max = k;
}
champName = name[max];
cout << champName;
input.close(); // close file
}
int total(string nam[], int nums[])
{
int i = 0;
int suma = 0;
ifstream in; //Declare input variable
in.open("input.txt"); // open file
while (!in.eof())
{
in >> nam[i] >> nums[i];
++i;
}
for (int j = 0; j <= 4; j++)
{
suma = suma + nums[j];
}
gTotal = suma;
return suma;
in.close(); // close file
}
``` | 1,050 | 3,345 | {"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} | 2.53125 | 3 | CC-MAIN-2020-05 | longest | en | 0.481144 |
http://slideplayer.com/slide/4220876/ | 1,513,363,385,000,000,000 | text/html | crawl-data/CC-MAIN-2017-51/segments/1512948577018.52/warc/CC-MAIN-20171215172833-20171215194833-00653.warc.gz | 266,824,497 | 20,155 | # Group B01 Tarek Yakub – 4133137 Fahad Aljenaei – 4290975 Danish Qureshi - 417235.
## Presentation on theme: "Group B01 Tarek Yakub – 4133137 Fahad Aljenaei – 4290975 Danish Qureshi - 417235."— Presentation transcript:
Group B01 Tarek Yakub – 4133137 Fahad Aljenaei – 4290975 Danish Qureshi - 417235
Project Background Major Electrical Components Pulse Width Modulation (PWM) Remote Control Potentiometer Major Mechanical Components Creating a body that can float on water Fans to propel boat forward
PWM (IC 555 timer) How it works? Uses square voltage pulses that power a motor The amount of power applied to the motor depends on the duration of each pulse The higher the duration of the pulses results in an increased average power applied to the motor
Theoretical Circuit
Actual Circuit & Connection
The Boat The boat was made out of swimming noodles held together using metal bars Holes were drilled through a piece of wood to hold the motors in place and mounted on the boat using metal brackets and screws
Propulsion The boat is powered by two computer fans which have been attached to the output shafts of 6V motors
By adjusting the potentiometer, the boat is able to move forward at variable speeds. By varying the speed of one motor at a time allows the boat to turn left or right
The Boat in Motion This video shows the boat slightly turning right and left, as well as slowing speed while moving forward
Complications Building the circuit Low voltages across the motor Not enough current going into the motor Solutions to these problems Changed one of the capacitors and removed one of the resistors To deliver the proper amount of current into the motor (1.8 A) Changed Potentiometer (from 100 kOhms, to 10 kOhms because resistance was to high) This was found through trial and error (at 100 kOhms the current was 428 mA, at 10 kOhms the current was 2.4 A, 6 times greater!) Used multi-sim to aid in problem solving Choosing a PWM over the variable resistor due to heating up and also make use of IC 555 timer as we learned
Improvements/Modifications Larger Fans More powerful motors To increase speed Place the fans further apart To allow the boat to turn easier Wireless control
Thank You | 512 | 2,216 | {"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} | 2.859375 | 3 | CC-MAIN-2017-51 | latest | en | 0.921868 |
https://www.physicsforums.com/threads/increasing-or-decreasing-logarithms.750671/ | 1,521,633,525,000,000,000 | text/html | crawl-data/CC-MAIN-2018-13/segments/1521257647612.53/warc/CC-MAIN-20180321102234-20180321122234-00599.warc.gz | 863,543,182 | 18,324 | # Increasing or decreasing - logarithms
1. Apr 25, 2014
### Rectifier
Hey there!
How do I determine whether this function is growing or decreasing without using any calculator or graphing tools?
$$y=ln(\frac{1}{x})$$
I know that
$$y=ln(\frac{1}{x}) \ \Leftrightarrow \ e^y=\frac{1}{x} \ \ \ (1)$$
Then I tried to use the formula
$$f(x)=a^x$$ and then determine whether a is 0<a<1 or a>1. But I dont know how I should do to write (1) in the same same manner :( .
If a is 0<a<1 means that the function is strictly decreasing.
If a is a>1 means that the function is strictly increasing.
2. Apr 25, 2014
### Dick
Your function doesn't have that form. Is this a calculus class? Can't you just take the derivative?
3. Apr 25, 2014
### Rectifier
I dont know if its calculus or not. Its called one-dimensional analysis and its a class I take where I live - in Sweden.
There should be another way to do that than the derivative since I must be able to plot the function after that without a calculator or a graphing tool.
I am sorry if this is the wrong subforum.
4. Apr 25, 2014
### Dick
I think the forum is ok. If you have 1/x=e^y then you have x=e^(-y)=(1/e)^y. That will let you plot x=f(y) as a decreasing function of y since (1/e)<1. What does your graph translate to when you think of y as a function of x?
5. Apr 25, 2014
### HallsofIvy
Yes, "analysis" is "Calculus". (In the United States we tend to use the word "Analysis" to mean "the theory behind Calculus" so a higher level course than "Calculus".)
Why would not using a calculator or graphing tool mean you cannot take the derivative?
The derivative of ln(1/x)= - ln(x) is -1/x. You can tell where that is positive or negative without a calculator, can't you?
6. Apr 25, 2014
### Rectifier
You went through f(y) to determine whether the function is decreasing or increasing in terms of x being a funtion of y to then mirror the function on the x=y line and get the inverse which is the original function. But the nice thing here is that since the inverse is increasing this must mean that the original is increasing too.
Did I get it right?
7. Apr 25, 2014
### Rectifier
Yeah I can :) but oficially I am not allowed to use derivatives since I am not at that chapter of the book :D.
I like to have more than one way to the solution. Thank you for your comment HallsofIvy :)
8. Apr 26, 2014
### Ray Vickson
$$y = \ln \left( \frac{1}{x}\right) = - \ln(x)$$
Do you know what the graph of $\ln(x)$ looks like?
BTW: in LaTeX you should write "\ln" instead of "ln", because it produces better-looking results: compare $ln(x)$, entered as # # ln(x) # # (no spaces) with $\ln(x)$, entered as # #\ln(x) # # (no spaces).
Last edited: Apr 26, 2014
9. Apr 26, 2014
### Dick
Right idea, but x=(1/e)^y isn't increasing. I hope that was a typo.
10. Apr 26, 2014
### Rectifier
Hehe indeed I was going to write decreasing. Thank you for your help :)
11. Apr 26, 2014
### Rectifier
Oh, I didnt see that option! Thank you for pointing this out!
Thank you yet again :) | 869 | 3,046 | {"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} | 3.578125 | 4 | CC-MAIN-2018-13 | latest | en | 0.899689 |
http://www.numbersaplenty.com/5181 | 1,566,558,648,000,000,000 | text/html | crawl-data/CC-MAIN-2019-35/segments/1566027318375.80/warc/CC-MAIN-20190823104239-20190823130239-00456.warc.gz | 295,081,088 | 3,492 | Search a number
5181 = 311157
BaseRepresentation
bin1010000111101
321002220
41100331
5131211
635553
721051
oct12075
97086
105181
113990
122bb9
132487
141c61
151806
hex143d
5181 has 8 divisors (see below), whose sum is σ = 7584. Its totient is φ = 3120.
The previous prime is 5179. The next prime is 5189. The reversal of 5181 is 1815.
Adding to 5181 its reverse (1815), we get a palindrome (6996).
It is a happy number.
5181 is nontrivially palindromic in base 6.
It is a sphenic number, since it is the product of 3 distinct primes.
It is not a de Polignac number, because 5181 - 21 = 5179 is a prime.
It is a super-2 number, since 2×51812 = 53685522, which contains 22 as substring.
It is an Ulam number.
5181 is a lucky number.
It is a self number, because there is not a number n which added to its sum of digits gives 5181.
It is a congruent number.
It is an inconsummate number, since it does not exist a number n which divided by its sum of digits gives 5181.
It is not an unprimeable number, because it can be changed into a prime (5189) by changing a digit.
It is a pernicious number, because its binary representation contains a prime number (7) of ones.
It is a polite number, since it can be written in 7 ways as a sum of consecutive naturals, for example, 46 + ... + 111.
It is an arithmetic number, because the mean of its divisors is an integer number (948).
It is an amenable number.
5181 is a deficient number, since it is larger than the sum of its proper divisors (2403).
5181 is a wasteful number, since it uses less digits than its factorization.
5181 is an odious number, because the sum of its binary digits is odd.
The sum of its prime factors is 171.
The product of its digits is 40, while the sum is 15.
The square root of 5181 is about 71.9791636517. The cubic root of 5181 is about 17.3036556588.
The spelling of 5181 in words is "five thousand, one hundred eighty-one".
Divisors: 1 3 11 33 157 471 1727 5181 | 581 | 1,962 | {"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} | 3.6875 | 4 | CC-MAIN-2019-35 | latest | en | 0.91773 |
http://ptp.ipap.jp/link?PTP/50/409 | 1,369,414,717,000,000,000 | text/html | crawl-data/CC-MAIN-2013-20/segments/1368704818711/warc/CC-MAIN-20130516114658-00093-ip-10-60-113-184.ec2.internal.warc.gz | 215,159,787 | 4,663 | Quick Search:
Author: Title/Abstract: Vol./No: Page:
## Prog. Theor. Phys. Vol. 50 No. 2 (1973) pp. 409-423
[ Full Text PDF : FREE ACCESS (1076K) ]
# Integral Euqations for Fluids with Long-Range and Short-Range Potentials
## — Application to a Charged Particle System —
Japan Atomic Energy Research Institute, Tokai-Mura, Ibaraki-Ken
### Abstract:
Four new integral equations for the radial distribution function g(r) suitable for a fluid (including a charged-particle system, such as plasmas, electrolyte solutions and molten salts) interacting via a potential consisting of a strong repulsive short-range part and a slow-varying long-range part are derived by Percus' functional-expansion method. The first equation of them is composed of two equations: one is the Percus-Yevick (PY) equation involving the short-range part of the potential and the other an equation involving the long-range part. The second is an extended PY equation in which the long-range potential is taken into account in the form of the Hartree field. The third equation is derived on the basis of an improvement on the thermodynamical equation determining the density n(r|U) in a nonuniform system under an external field U(r). The fourth equation is a combination of the second and third equations.
As an illustration, the first integral equation is solved for a system with potential v(r)= erf(ζr)(Ze)2/r+hard-sphere for θ from 10.0 to 0.01, where θ=kBTa/(Ze)2, a=[3/4πn0]1/3, n0 the average density and Z the valency. The result for θ=10.0 agrees quite well with the non-linear Debye-Huckel result. At θ=1.0 there is a close agreement between the present result and the Monte Carlo result. As θ increases, g(r) begins to oscillate around unity and resembles g(r) of a neutral fluid.
DOI : 10.1143/PTP.50.409
[ Full Text PDF : FREE ACCESS (1076K) ] Citation:
### Citing Article(s) :
1. Progress of Theoretical Physics Vol. 50 No. 3 (1973) pp. 794-806 :
Space-Time Correlation Functions in Quantal and Classical Binary Mixtures. I
Junzo Chihara
2. Progress of Theoretical Physics Vol. 50 No. 4 (1973) pp. 1156-1181 :
Integral Equations for Neutral and Charged Quantum Fluids Including Extension of the Percus-Yevick Equation
Junzo Chihara
3. Progress of Theoretical Physics Vol. 53 No. 2 (1975) pp. 400-410 :
Calculation of Pair Correlations in a Degenerate Electron Liquid
Junzo Chihara
4. Progress of Theoretical Physics Vol. 55 No. 2 (1976) pp. 340-355 :
Space-Time Correlation Functions in Quantal and Classical Binary Mixtures. II
Junzo Chihara
5. Progress of Theoretical Physics Vol. 58 No. 3 (1977) pp. 1061-1063 :
A Series of Integral Equations for Liquids Varying from the PY to HNC Equation
Junzo Chihara
6. Progress of Theoretical Physics Vol. 58 No. 6 (1977) pp. 1709-1721 :
Pair Correlation Functions in Classical and Quantal Electron Gases
Junzo Chihara
7. Progress of Theoretical Physics Vol. 60 No. 6 (1978) pp. 1640-1652 :
Radial Distribution Functions and Bound Electronic Energy Levels in Hydrogen Plasmas
Junzo Chihara
8. Progress of Theoretical Physics Vol. 70 No. 2 (1983) pp. 331-342 :
Comparison of Local-Density and Quantal Hypernetted-Chain Approximations in the Calculation of Electron Density Distribution
Junzo Chihara
9. Progress of Theoretical Physics Vol. 71 No. 3 (1984) pp. 427-437 :
Hypernetted Chain Approximation, Convolution Approximation and Perfect Screening in Coulombic Many-Particle System
Hiroshi Iyetomi | 935 | 3,438 | {"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} | 2.5625 | 3 | CC-MAIN-2013-20 | latest | en | 0.861755 |
http://www.mothering.com/community/t/1310177/deciding-what-is-the-appropriate-next-step-kindergarten-math-and-struggles | 1,398,043,510,000,000,000 | text/html | crawl-data/CC-MAIN-2014-15/segments/1397609539337.22/warc/CC-MAIN-20140416005219-00062-ip-10-147-4-33.ec2.internal.warc.gz | 572,452,517 | 36,511 | or Connect
Mothering › Mothering Forums › Childhood and Beyond › Education › Learning at Home and Beyond › Deciding what is the appropriate next step - Kindergarten Math and struggles
New Posts All Forums:Forum Nav:
# Deciding what is the appropriate next step - Kindergarten Math and struggles
I've posted 2 other threads on our struggles with math this year for DD1 and kindergarten.http://www.mothering.com/community/forum/thread/1290870/dyscalculia#post_16178379Â and posts in the kindergarten thread. Â I have not had DD1 tested because I don't want to jump the gun or anything. Â We started kindergarten with the goal of counting to 100 and identifying written numbers to 100. Â This was what I learned in kindergarten and remember how it was taught well. Â Just rote counting and writing until we could write them without looking at anything. Â When DD1 began to show clear signs of struggle as I described in the linked thread, I lowered our goals to identifying the written teens and twenties. Â I have done all I know to do at this point. Â We've worked with felt numbers on a felt board, done rote writing, used a chalkboard, sidewalk chalk, she's counted to 100 as movies load on Netflix watching the numbers change, we've used a calendar, watched YouTube videos, Leap Frog Math Circus and Math Adventures to the Moon as well as the math sections in our school curriculum connect the dots, writing practice, color by number, etc...
Right now she can:
-Count to 30 without a problem
-Write numbers 1-10 without a problem
-Write numbers 1-20 with little problem (however she cannot tell you which numbers she is writing)
Â
Today, I was having her read the calendar. Â It didn't matter how many times I told her that 2 and 6 is 26, she kept calling it 16, 17, 70. I've explained it every way I know how. Â I've followed recommendations. Â A friend of mine who is a math professor said that this seems more like a reading issue than a math issue, however, she is catching onto letters and their sounds without any problems. Â She will be reading in no time.
Â
She still makes many of her numbers backwards, confuses 8 and 9 as well. Â I'm lost and worried that something is wrong. Â I would have thought that if not learned as a true skill then she would have memorized the teens and twenties by now. Â I mean if I say 2 and 6 is 26 she should be able to remember that a minute later - right.
Â
So, what should I do next. Â We have 20 school days left. Â Should I drop the numbers altogether and just focus on shape concepts and such? (Our curriculum picks back up at one and moves quickly through the numbers for 1st grade.) Â Should I have her tested before we start 1st grade? Â I'm so frustrated and confused. :( Â I don't want DD1 to hate math.
She just recently turned 6, right? I think the difficulties you describe are within the range of normal for that age. It's possible that this is just a lack of readiness, and an issue of poorness of fit with the math curriculum / teaching style you're using. The difficulties you list seem to be mostly related to the reading and writing of numerals. In other words, they're related to the symbolic representation of numbers on paper. She's not really grasping place value at all yet which isn't unusual at this age. Forgetting that 2 beside 6 means 26 is totally understandable: without the concept of place value to slot that information into, it's just a meaningless bit of rote-memorization with no context.
Â
I wouldn't abandon number-teaching at all. But I would change the approach to work as much as possible with her strengths, towards her areas of weakness. Is your math program manipulative-rich, multi-sensory, kinesthetic? If not, I'd definitely move towards those modes of learning for a good while, and stay away from stuff written on paper. Pick up a 10x10 counting frame / abacus. Use Unifix cubes, counters, pennies, beans, fingers, cuisenaire rods, dice, playing cards ... anything that will gradually firm up her association between a numerical amount (say, this many * * * * * * * * pinto beans) and a word ("eight") and a written numeral (8).
Â
For instance, you can get an egg carton and use a sharpie to write the numbers from 1 to 12 randomly in the bottoms of the wells, and then challenge her to put the correct number of pinto beans into each well. Or put 13 pennies on the table and ask her to represent those pennies on the abacus. Give her bigger and bigger numbers of pennies. Teach her how to put them in piles of ten to make it easier to keep track of how many there are to match them up with rows on the abacus. You might also want to try a more kinesthetic approach like a number-line on the floor that she can walk along -- particularly a short (1-12?) number-line that includes dots to show amount as well as the number-symbols. Give her directions ("Go forward three steps, now go forward two more, now go backwards three: where did you end up?") and have her hop and answer questions about the numerals she steps on.Â
Â
Just some thoughts and ideas I think might be worth trying. Have fun!
Â
Miranda
I found this "counting to 100" placemat at a local teaching store.Â
Â
http://www.brainymats.com/brainymats_green.html
Â
It has been very helpful to our son who is 5.5.
Â
Â
Just thought I'd comment, since you said you had the goal at the beginning of the year of teaching her to "count to 100," that I don't think this is a particularly meaningful milestone, even though it's one many North American curriculums get hung up on. In Singapore, for instance, the English-speaking nation with the highest math achievement scores, they don't get into numbers larger than 20 until the 2nd half of first grade, and first grade doesn't start until after the 7th birthday. And yet by 7th grade, Singaporean kids are a year or so ahead of North American kids in math learning, and miles beyond in achievement. They don't start later: they start smarter, IMO, with really really strong development of "number sense" in the 0-20 range, without the confusion of larger numbers. When that is supremely well learned through concrete, pictorial and symbolic learning using multiple modalities and learning styles, it's easy to apply it to groups of higher place value. Those foundations in the numbers from 0-20 are crucial. There's no need to hurry on.
Â
To my mind counting to a hundred is a little like "singing the ABCs." Parents of bright 3-year-olds love it when their kids can do either of these things. But these skills really have nothing to do with early literacy and numeracy. For literacy it's all about phonemic awareness. For numeracy it's that foundational "number sense" with which is best exercised with tangible (0-20) numbers.
Â
Some kids are fascinated with big numbers from early on and seem to intuit the place-value relationships at a young age. For these kids, there's no harm in encouraging them to work with big numbers. But there is a solid body of evidence from Asian nations that early (prior to age 7.5) mastery of counting to 100 is entirely unnecessary with respect to later math achievement. In some kids I don't doubt it can be counter-productive if it provokes anxiety and/or resistance.
Â
Miranda
Is her problem just with the symbolic representation of the numbers?
Â
If you spilled a pile of marbles (or whatever) on the floor and asked her to count them, could she? Â Since she only counts to 30 right now, use an amount smaller than that. Â If she can consistently count out objects--that is "one to one" correspondence. Â If she can't do this, then the problem is greater than the symbolic representation. Â If she can do this. . . celebrate! Â Number sense is worth more imo than the rest.
Â
Oh, forgot about the rote memorization part. Â Here is what helped my dd to be able to just count to 100. Â We taught her to count by 10s to 100. Â Then, we would have her use her fingers. Â First, she would just count (no fingers yet). Â When she got to ten, she held up one finger. Â She kept that finger up until 20 (when she lifted a second finger). Â Once she got the right ten-word (twenty, thirty, forty, etc) she could rapidly add the 1, 2, 3, etc to it. Â She was always pausing when she needed a new term for the tens. Â So, by teaching her to count by tens--and then associating a finger with each one, she was able to extend that to counting to 100 and eventually it helped with writing the numbers as well. Â
BTW, when we started this, her 1 to 1 correspondence was great with numbers up to 29 as well, her symbolic representation was awful, and her rote memorization was awful. Â Additionally, this is my dyslexic child, but I have NO idea if the dyslexia is what affected these areas of math or not. Â She is actually quite good at math, yet she still struggles with rote memorization (now of math facts), and she will sometimes still mess up written numeric expression (usually backwards numbers--sometimes the 3 looks like an E but once in a while she will still do mistakes like 31 is written as 13).
Â
Amy
We use RightStart curriculum and one technique that really helped my kids learn place value was the "math way" of counting. (This was combined with work on the abacus, which I highly recommend so that the child can visualize what they are saying.) My kids could already rattle off the numbers the regular way up to 40 or 60 or something, but the "math way" really drove home what those numbers *meant*. It's very simple -- if your child can count to 10, she can get it with a little practice.
Â
Count 1 - 10 normally
11 = "One ten, one" (You would show her on the abacus or with other manipulatives that "one ten, one" is one group of ten plus one extra.)
12 = "one ten, two"
13 = "one ten, three"
and so on. The teens can be extremely confusing for English speaking children because they don't follow the pattern linguistically. This way of counting avoids that problem.
Â
20 = "two ten" or "two tens" if she needs that extra concrete literal-ness
21 = "two ten, one"
22 = "two ten, two"
etc.
Â
Continue gradually until the child can count to 100 ("ten ten")Â Once she is proficient, then re-introduce the everyday words for the numbers.
Â
Seriously, with this system, my dd could count her own money in Monopoly when she was 5 or 6. I would just tell her she needed to pay "seven ten, 5". At first she always payed with a pile of \$10 bills of course! As she learned more about adding, she started to combine a 5-ten bill with a 2-ten bill, etc.Â
Â
I also agree with the pp who said you should first establish that she understands one-to-one correspondence. That is foundational. I'm not an expert, but if a 6 year old did not get one-to-one correspondence yet, I might be thinking about learning disabilities. (?) The difficulty with counting beyond 30, writing numbers, and place value is more typical of young 6 year old challenges, I think.
These suggestions are right on the ball. Â You should absolutely shift your focus to CONCEPTUAL understanding of math at this stage, rather than SYMBOLIC representations. Â It's like putting the cart before the horse. Â Or to compare it with reading/literacy, it's like expecting a kid to be able to read in a language they don't yet speak. Â
Â
From the way you've described it, it sounds like you're focussed on rote memorization of the oral terms and the written symbols, without any connection to their meaning. Â I love the analogy to the ABC song -- it's a fun song, but has really nothing to do with literacy. Â Singing the song doesn't mean they recognize the written letters, nor their phonemic roles. Â Counting to 100 just as a rote exercise is only an exercise in memorization. Â Not that there isn't value in exercising memory, of course... but it has nothing to do with MATH.
Â
Instead, it should be the other way around. Â Once they've learned what counting MEANS, how it WORKS, then counting on forever becomes a no-brainer. Â They need to understand the PATTERN of it first. Â All you really need to understand is the order of 0 to 9, and then the concept of place value; that every time you go past 9, the '10' which is next becomes 1 more in the other space and 0 in the current space. Â Memorization is pointless, you can *figure it out*.
Â
What likely happened in your own K class, was that you were able to *figure it out*... whether because there was manipulative/other activities that helped with that which you've simply forgotten about, or you were just one of the kids who cottons on to it quickly enough. Â You didn't necessarily have it memorized by rote. Â But after being able to recite it for a period of weeks or months by *figuring it out* as you went, then it did become memorized to the point where you didn't have to even think about it, and the oddities of memory have backed up that event a little bit so you're remembering it as the other way around. Â That would be my guess, anyway.
Â
In most math memorization, the way it SHOULD happen (and how it is too often NOT taught in schools) is that kids learn how to figure something out FIRST, then through repeated practice they start to memorize just intuitively, then realize the speed advantage of memorization and if necessary do deliberate exercises to finish the process. Â It shouldn't be the other way around.
Â
I'm another evangelist for Right Start math, most especially because of how it treats EARLY numeracy and math concepts. Â My daughter is only 4 and already understands place value pretty well... when she uses the abacus, she can count to 100 easily. Â She wouldn't be able to do it "from memory" yet, not by a long shot. Â But she understands the concept. Â Actually, we recently took the next step, of counting 100's! Â She was able to correctly figure out that if a chicken farmer has 200 eggs then gets 300 more eggs, they'd have 500 eggs, and she demonstrated it with 100's tiles as well. Â She can take place value cards and stack them to build 2 and 3-digit numbers, and name them (using "math language"). Â I just think it's a much more sensible approach.
Just wanted to say that you can buy the RightStart math games kit for \$50. Â You don't need to buy the whole system. Â We are loving the games kit. Â It comes with everything you need. Â If it turns out to work really well for your dd, you might consider the bigger investment with the curriculum. Â Right now we use Singapore, but we love using RightStarts games.
Â
Amy
New Posts All Forums:Forum Nav:
Return Home
Back to Forum: Learning at Home and Beyond
• Deciding what is the appropriate next step - Kindergarten Math and struggles
Mothering › Mothering Forums › Childhood and Beyond › Education › Learning at Home and Beyond › Deciding what is the appropriate next step - Kindergarten Math and struggles | 3,589 | 14,868 | {"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} | 3.453125 | 3 | CC-MAIN-2014-15 | latest | en | 0.95527 |
https://math.stackexchange.com/questions/3868842/degree-matrix-of-fully-connected-graph | 1,722,677,910,000,000,000 | text/html | crawl-data/CC-MAIN-2024-33/segments/1722640365107.3/warc/CC-MAIN-20240803091113-20240803121113-00565.warc.gz | 304,693,059 | 35,998 | # Degree Matrix of Fully connected graph
https://www.kaggle.com/vipulgandhi/spectral-clustering-detailed-explanation
In this blog post about spectral clustering it states that we can just use the Gaussian Kernel directly.
"Generally we use the Gaussian Kernel K directly, or we form the Graph Laplacian A"
I am confused about how to calculate the degree matrix from a fully connected weighted graph. And I want to implement this in python.
The degree of a vertex in a fully connected graph is sometimes defined as the sum of the weights of all edges coming from that vertex.
So in other words, the degree $$d_i$$ of vertex $$v_i$$ is:
$$d_i = \sum_j w_{ij}$$
where $$w_{ij}$$ is the weight of the edge between vertices $$v_i$$ and $$v_j$$.
I have found this pdf to be somewhat helpful in understanding both the algorithm and the mathematical intuition behind why it works:
https://people.csail.mit.edu/dsontag/courses/ml14/notes/Luxburg07_tutorial_spectral_clustering.pdf | 230 | 981 | {"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": 6, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.046875 | 3 | CC-MAIN-2024-33 | latest | en | 0.886316 |
https://mathematica.stackexchange.com/questions/298169/estimating-float32-precision-loss | 1,716,008,616,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971057260.44/warc/CC-MAIN-20240518023912-20240518053912-00633.warc.gz | 352,224,454 | 40,432 | # Estimating float32 precision loss
What's the correct way to using Mathematica to get location of true value when using IEEE-754 float32 precision?
Inspired by this question, where the user got a range of different answers when asking for the result of the following computation, I'm curious to see what the error estimates would be for float32.
import math
u = 5.0
for i in range(73):
u = 6*math.cos(u)
print(u)
• An analysis that might be a little bit easier and almost equivalent would be to used fixed point. We know that the output range is always -1 to 1, and we know the number of bits used for the floating point manitssa. Feb 16 at 18:26
• Why do it with 32-bit when 64-bit fails miserably (which it does because of the magnification of round-off error at each of the 73 steps)? Feb 16 at 19:29
• Because you want to know the point at which it fails miserably :) I can get an interval object for 64-bit doing Interval[5.], wondering if there's something similar for 32-bit Feb 16 at 19:55
We can coerce a real number into a 32 bit float in a few ways:
pi = N[\[Pi]];
pi // FullForm
3.141592653589793
ImportString[ExportString[pi, "Real32"], "Real32"][[1]] // FullForm
3.1415927410125732
Normal[NumericArray[{pi}, "Real32"]][[1]] // FullForm
3.1415927410125732
To verify equivalence as a 32 bit float, we see the first 23 digits in the mantissa agree (IEEE 754 standard), other than rounding of the least significant bit:
pi32bit = ImportString[ExportString[pi, "Real32"], "Real32"][[1]];
RealDigits[pi, 2][[1, 2 ;; 24]]
{1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0}
RealDigits[pi32bit, 2][[1, 2 ;; 24]]
{1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1}
• Thanks, this is useful for sanity checking. I found Interval[5.] gives me an interval for float64, was looking for an easy way to get interval for 32-bit Feb 16 at 19:56
Here are a couple of demonstrations that we have no significant digits after 13 or so steps. First we get the base 10 precision for 24 bits mantissas, the common standard for 32 bit floats.
Log[10., 2^24]
(* Out[56]= 7.22472 *)
Now use this to create a bignum 5 with that precision. Then iterate and print precision of the result.
u = 5.7.225;
Do[Print[Precision[u = 6*Cos[u]]], {13}]
(* During evaluation of In[63]:= 5.99705
During evaluation of In[63]:= 4.88645
During evaluation of In[63]:= 4.99221
During evaluation of In[63]:= 4.06717
During evaluation of In[63]:= 3.96362
During evaluation of In[63]:= 3.17044
During evaluation of In[63]:= 2.55444
During evaluation of In[63]:= 1.73966
During evaluation of In[63]:= 2.35372
During evaluation of In[63]:= 2.08599
During evaluation of In[63]:= 1.5386
During evaluation of In[63]:= 0.453482
During evaluation of In[63]:= 0. *)
Alternatively, set up intervals with an epsilon of 2^(-24).
u = Interval[{5. - 2^(-24), 5. + 2^(-24)}];
Do[Print[u = 6*Cos[u]], {13}]
(* During evaluation of In[67]:= Interval[{1.70197,1.70197}]
During evaluation of In[67]:= Interval[{-0.784807,-0.784803}]
During evaluation of In[67]:= Interval[{4.24515,4.24516}]
During evaluation of In[67]:= Interval[{-2.70256,-2.70247}]
During evaluation of In[67]:= Interval[{-5.43098,-5.43074}]
During evaluation of In[67]:= Interval[{3.94887,3.94994}]
During evaluation of In[67]:= Interval[{-4.14881,-4.14418}]
During evaluation of In[67]:= Interval[{-3.22876,-3.20531}]
During evaluation of In[67]:= Interval[{-5.98782,-5.97722}]
During evaluation of In[67]:= Interval[{5.72134,5.74018}]
During evaluation of In[67]:= Interval[{5.07764,5.13697}]
During evaluation of In[67]:= Interval[{2.1431,2.47161}]
During evaluation of In[67]:= Interval[{-4.703,-3.24943}] *)
Same outcome: we no longer have any significant digits at this point. | 1,252 | 3,792 | {"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} | 3.390625 | 3 | CC-MAIN-2024-22 | latest | en | 0.801858 |
https://subscanner.com/yhPH1369OWc | 1,618,615,342,000,000,000 | text/html | crawl-data/CC-MAIN-2021-17/segments/1618038092961.47/warc/CC-MAIN-20210416221552-20210417011552-00609.warc.gz | 638,619,325 | 8,395 | # Cracking the 4D Rubik's Cube with simple 3D tricks
Exciting news everybody. Just a couple of days ago I solved the 40 Rubik's cube for
the first time. Not many people have done this so I thought I'd do a video on this
to enable as many of you as possible to do the same. I've got two warm up
exercises for you. The first one is this. What are you looking at here? Strange
question, obviously a cube. But that's not the correct answer. What you're looking at is
a 2d image of a 3-dimensional cube. It's going to be very important this kind of
distinction. Second thing so imagine a cube which has kind of a solid surface.
How many faces can you see max when you look at it? And most
people will answer three which is wrong. If you actually imagine that the cube is
hollow and you can step inside what you see is five faces and actually you can
even see six faces if you go into one of the corners and kind of just look around
you can see all six faces of the cube, kind of thinking inside the box :) Now this
actually is a view of a Rubik's cube simulator. So the Rubik's cube simulator
actually shows you the Cube like this. So it's a lot better than what you see
normally when you look at something like this, hold it in your hand. Here's a couple
of twists and now that one is actually a when you turn the Rubik's cube and that
gets a straight away to our 4D Rubik's cube. So there it is comes in the form of
It's a program that has been around for a long time, has been developed for a long
time. It's it's a great program, you should use it. And this is the 4D Rubik's
cube. Well, no, it's not the 4D Rubik's cube. What it is is well something
similar to that right wherever you see squares there you see cubes here now
this one is a two-dimensional image of a three-dimensional object
now the four-dimensional rubik's cube actually really exists in abstract
four-dimensional mathematical space but of course we can't really go there right
so what we have to do is we have to project it down to at three dimensions
just like we projected our three dimensional object to this
two-dimensional surface so we can do the same sort of thing this guy here for
example as six square faces that are glued
together the edges this one here in actual four dimensional space is eight
cubes glued together along the faces of the cubes and here where you see five
and ones missing and here you see seven of the eight cubes and once not visible
here anyway so what this really is is well what is it really
it's a two-dimensional image of a three dimensional image of a four dimensional
rubik's cube can manipulate like a real object in fact you don't even have to
know that it's a four dimensional rubik's cube you can just take the
program and just manipulate it based on what you see there okay that's what we
want to do okay let's have a look here let's some twists you can see it's a lot
more complicated than normal rubik's cube that's actually turns of the
rubik's cube so we don't manipulate anything kind of just turn it around to
look at it from different perspectives and this is what it looks like solved if
you want to actually be one of those people who can solve it interested to
scramble it scramble it looks like that pretty intimidating first time you see
this you think not this is just a mess I don't want to touch this but you
probably thought the same the first time you saw like a five by five by five and
you know think you know I don't want to touch this one but of course then you
realize well actually since I know how to do that three by three by three the
normal rubik's cube well i can actually solve this part of the five by five by
five so I'm always harmful is there and something similar is the case with the
forty rubik's cube so is the 40 rubik's cube at first sight at least there is no
rubik's cube inside you see lots of these cubes but they all have the same
color so where are the rubik's cubes well I'll show you in a second now let's
have a close look at the individual bits and pieces that are being manipulated
here so in a normal room X cube you've got three different types of cubies that
are being manipulated around so let's first the face cube is they'll
just have one sticker so we also got something like this here in the forty
Rubik's cubes it's the little cubicle stickers right
in the center of these cubicles cells that is one kind of a hypercube II now
we've got cue bees that have two stickers
you also have cue bees that have two stickers in the four dimensional cube
here it's edge cubies there it's face cubies so see those faces of those
little cubes well the sticker there's one sticker
there's another sticker here right opposite those belong together
they basically form one hypercube a face Peiper QV now we've got three stick-up
pieces they're the corner here they're on the edges here to see those those
three cubicle stickers they belong together as you manipulate the cube they
will always stay together either vollis like they can never be separated they
form one hypercube E and then we've got one more type of hyper cutie these are
the corner hyper cubes and they have four stickers and you can see them here
highlighted now hyper twists as I said there's a lot more complicated twists in
this puzzle then in the ordinary rubik's cube you click on any one of the
stickers here and the program will perform a twist so let's just do it so
for example on that corner here we get a corner twist right so basically we are
turning around the diagonal that goes through this corner now here that's an
edge twist and then we've got one more kind of twist that's a face twist so
there's the first very important feature of this puzzle that I have to draw your
attention to and that is that every single twist can be replaced by face
twist so you can really restrict yourself to face was just to show you
what I mean by this let's just focus on one of those corner twists okay and so
there it is and now I'll undo this corner twist but a straight face twists
so one and there is another one actually does two to face twists can replace one
of those corner twists also edge twists here we go it is I'll undo this with
face twists so there and there okay so what
means for you if you start solving a Rubik's Cube you actually don't have to
worry about the fancy corner twists and the edge twists you can just stick with
face twists so now let's see where those 3d cubes are hiding inside the 40 cube
and how we can use them to solve the 40 cube now anybody who knows anything
about cubes and I hope you belong in this category knows that you need just a
few algorithms and solve the whole cube in fact four is enough so you need like
one algorithm to two cycle three edges of the Rubik's Cube then there's another
one here one dead cycles three corners then
there's one that just flips two edges and then there's one that twists two
corners so you use those sort of algorithms here to put the individual
qubits in the right place and then you use those algorithms to orient them and
what I want to show you is how you can translate those algorithms into
algorithms for the 40 rubik's cube so for that we first find some rubik's
cubes in the 41 here we go so it's just a different way of looking at the 40
rubik's cube and she actually when you kind of pull things together like this
but we're actually looking at usually it's kind of an exploded view is just a
rubik's cube so for example click on that face here you know just is the
usual twist of course the 40 rubik's cube is also twisted in this case now
what i do here is i'm actually executing one of those elders and 3d rubik's cube
algorithms on it was the one that flips edges and let's
just see what effect it had on the 40 rubik's cube okay so we kind of expand
things back out again and you can see very few type of cuba's of the 40
rubik's cube are affected by this in fact it's just like two columns of
hypercube YZ and every single one of the hypercube is in there is still in the
same place as before it's just that the two stickers have swapped over now what
I like to do is actually I like to focus on the middle of the puzzle to my
surgery there and and rotate things in and out
on the outside so I'm going to change this new algorithm into one that
actually affects the middle but as rotating things down to the middle like
this and so there you can see the columns of hyper cubes that are being
affected right in the middle arm now let's do the same sort of thing for
another one of our 3d rubik's cube algorithms the one that cycles edges
it's actually quite impressive when you see that thing in action so that's again
just the 3d rubik's cube algorithm what do we get well again there's just three
columns of hyper cubes that are being affected and actually they just get
cycled around like this and if you just look at what we've done now that already
looks very promising in fact when you look at it more closely you see that
these columns that we're talking about here contain one phase hypercube each so
what gets cycled here in particular is 3 phase hypercube is and here again every
column has one of those face either Q is in it these get flipped so what you can
do is you can use these algorithm actually to fix up all the positions and
orientations of the face hypercube is straight away you just kind of go for it
and you don't worry about the other bits that get pushed around here which is all
edge hypercube ease the second trick now which makes things very clean ok so what
I want to do is I want to have another look at this algorithm and just refine
it a little bit so that I get out a cycle of just edge pieces edge hypercube
ease this is look so what I want is something like this so this edge
hypercube me that one and that one just those cycle around with nothing
else going on and we do this with commutator z' and if you watch my other
rubik's cube video familiar is it otherwise maybe watch it so what we do
is we just twist the top so we just press this sticker that will rotate
things some bits are left in peace now comes the thing I'm going to run
this 3d Rubik's Cube algorithm in Reverse it's going to restore all the
pieces that I've not rotted it away to wait away
before okay let's just do this so this one here in Reverse go for it in case
you can already see that looks a lot cleaner and now the only thing that I
need to do is untwist the top which I'll do and you see the overall effect is has
is that it just cycles these three edge pieces around so that's very clean right
a very clean solution and well it gets us something different too you can just
go back to this this column look and I can also isolate a cycle of face pieces
a very clean cycle of face pieces and the way I do this is I do a slice move
which this program can also do just like with the Rubik's Cube you can just take
the middle slice and do it like this and so I've just sliced away the middle and
now I'm going to run this guy in Reverse it's going to restore everything else
yeah it's a bit of magic really okay wait for it okay so it looks very good
now undone slice the middle and just have a really really close look at it
and what you get is a clean three cycle here that just affects those face pieces
and now we do the same for all the other 3d algorithms in total we get out of
this eight algorithms for the 40 Rubik's cube and for all the different hypercube
ease so we've got a go reason for positioning the face hypercube is and
for orienting them we've got algorithms ford edge hypercube
ease and we've got algorithm for the corner hypercube is actually here in the
middle you see we've got actually lots of other reasons for for the edges and
it seems that we're doubling up things here so we've got two algorithms for
cycling edges but actually doing slightly different things so I'm going
to create them create both of them okay so now how do we use these algorithms to
solve the 40 rubik's cube well you can just kind of go for it in fact you can
go for any of the different sorts of pieces straight away because all those
algorithms that we've created work on the
and hypercube is in isolation you could either go straight for the corners or
for the edges or for the faces well I recommend you go for the face hypercube
ease because they only have two stickers and here you know stickers highlighted
where they belong they are also fairly easy to locate so
for example if we look at the cell here in the middle there's going to be in a
sticker of a certain color in this case it's some sort of blue and in this guy
here you know sticker I love another color purple so we know that this face
hypercube e that goes here has to have a blue and the purple sticker okay so
pretty easy so let's go for it and also this way it's very easy to kind
of get used to the interface and how this thing moves and all that so you
finished with that at some point in time move on to the edge pieces those have
three stickers a little bit harder to orient also so far it seems like we only
need those 3d Rubik's Cube algorithms to do the whole thing but actually here at
this point we can encounter a surprise something works for the 40 rubik's cube
that does not work for the 3d rubik's cube on a 3d rubik's cube you can never
twist a corner in isolation you can never flip an edge in isolation anybody
who knows anything knows this with a 40 rubik's cube that's possible so you can
have something like this happening so the whole 40 rubik's cube is solved
except for one of the edge hypercube is it's in the right place but the stickers
are circular around it's twisted around in fact all six permutations of those
three stickers are possible that comes as a little bit of surprise and you
actually need a separate algorithm to take care of that and what I've done is
I've actually created a second video for all those people who really want to
tackle this thing and that video I described the interface that you're
dealing with how to create lock files how to create macros how to you know
create those algorithms eventually hopefully you get to fixing up all the
edges and well only the corners remain and with
the corners a similar kind of surprise waits for you at the end you may have
solved the whole Rubik's Cube and the only thing left over is this one corner
hypercube we hear the stickers have been permitted around so you also need
another algorithm to take care of that
okay what's next so you've solved your 40 rubik's cube
what else can you do well scramble it up again like so and now try to blind solve
it so how does that work well you've got a scramble to you can look at it as long
as you want then you put on your blindfold and type in a key no that's
not going to work so they've got an alternative setup for this what you do
is you gray out what you see here and now you try to solve this thing for
memory and once you think it's all in place you ungraded nobody else has been
able to do so for blinds of a 40 rubik's cube one person has been able to do the
2 by 2 by 2 by 2 nobody has been able to do this one
something slightly less challenging quite a few people have been able to do
this to the 4 by 4 by 4 by 4 looks like this or well nobody's done that one bit
tedious I suspect the nine by nine by nine by nine or you could try this one
here which is the 5 dimensional Rubik's Cube or if that's not insane enough you
could try this one here which is the four dimensional counterpart of the
megaminx 120 colors some people have done this crazy okay but now here's the
real challenge ok here's the real challenge and I really want as many
people as possible to go for this challenge solve the 40 rubik's cube and
get yourself into the Hall of Fame so the people who maintain the program also
maintain a Hall of Fame and everybody who solves the Rubik's Cube can send in
the log file and have their name recorded in the Hall of Fame
so Hall of Fame starts in 1988 it's a fairly short list considering the
time so it ends at 230 and that's actually me here the last entry on the
27th of May 2060 anything will count as long as you get to the end you will get
the mythology seal of approval and it will be very remarkable achievement
you | 3,776 | 16,198 | {"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} | 3.734375 | 4 | CC-MAIN-2021-17 | latest | en | 0.976338 |
https://www.techylib.com/el/view/buttermilkbouncy/financial_management_formula_sheet_value_nowc | 1,524,785,969,000,000,000 | text/html | crawl-data/CC-MAIN-2018-17/segments/1524125948617.86/warc/CC-MAIN-20180426222608-20180427002608-00375.warc.gz | 874,417,266 | 12,690 | # FINANCIAL MANAGEMENT FORMULA SHEET Value = NOWC ...
Διαχείριση
10 Νοε 2013 (πριν από 4 χρόνια και 6 μήνες)
82 εμφανίσεις
FINANCIAL MANAGEMENT FORMULA SHEET
V
alue
=
)
(
...
)
(
)
(
WACC
1
FCF
WACC
1
FCF
WACC
1
FCF
2
2
1
)
PV(FVIF
i)
PV(1
FV
n
i,
n
n
)
FV(PVIF
i)
FV(1
i)
(1
1
FV
PV
n
i,
n
-
n
n
0
)
(FVIFA
PMT
i
1
i)
(1
PMT
FVA
n
i,
n
n
i)
(1
)
(FVIFA
PMT
i)
(1
FVA
n
i,
n
n
)
(PVIFA
PMT
i
i)
(1
1
PMT
PVA
n
i,
-n
0
i)
(1
)
(PVIFA
PMT
PVA
n
i,
0
0
n
1
t
t
i
t
n
1
t
t
t
PVIF
CF
i
1
1
CF
PV
,
n
1
t
t
i
t
n
1
t
t
t
FVIF
CF
i
1
CF
FV
,
NOWC = OCA
OCL NOWC = C + AR + IN
AP
ACRU
NOPAT = EBIT (1
-
T)
F
CF =
NOPAT
+
Depreciation
Gross investment in operating capital
MVA =
Market value of stock + market value of debt
total ca
pital
EVA = EBIT(1
-
T)
NOWC*WACC = (Operating capital)(ROIC
WACC)
n
1
i
i
2
p
pi
p
P
r
r
ˆ
=
B
A
AB
A
A
2
B
2
A
2
A
2
A
w
1
w
2
w
1
w
)
(
)
(
N
d
d
N
d
N
d
N
1
t
t
d
B
r
1
M
r
r
1
1
INT
r
1
M
r
1
INT
V
)
(
)
(
)
(
)
(
N
2
d
N
2
1
t
t
d
B
2
r
1
M
2
r
1
2
INT
V
)
(
)
(
N
d
N
1
t
t
d
B
)
r
(1
price
Call
)
r
(1
INT
V
1
t
t
s
t
0
)
r
(1
D
P
ˆ
g
r
g)
(1
D
g
r
D
P
s
0
s
1
0
ˆ
ps
ps
ps
r
D
V
N
s
s
1
N
N
s
N
2
s
2
1
s
1
0
r
1
g
r
D
r
1
D
.
.
.
r
1
D
r
1
D
P
ˆ
cov cos
cov
s
Unre ered tatstartofyear
Payback Yearbeforefullre ery
Cashflowduringyear
CA
CR
CL
Sales
Inventoryturnoverratio
Inventories
CA Inventories
QR
CL
/365
AR
DSO
Sales
Pr arg
NI
ofitM in
Sales
Sales
Totalassetturnoverratio
TA
A
D
1
A
D
E
D
/
/
/
/
/
1/
D E
D A
D E
Pr
/
icepershare
P E
Earningpershare
NI Sales
ROA x
Sales TA
NI
ROE
CE
MRP
LP
DRP
IP
r
r
*
IP
r
r
r
RF
bill
T
*
n
I
I
I
IP
n
2
1
n
...
1
m
i
1
EAR
m
nom
n
m
nom
n
m
i
1
PV
FV
i
PMT
PV
NOPAT
ROIC
Operatingcapital
n
1
i
i
i
r
P
r
ˆ
i
2
n
1
i
i
P
r
r
)
ˆ
(
1
n
r
r
n
1
t
2
Avg
t
)
(
r
CV
ˆ
n
1
i
i
i
P
r
w
r
ˆ
ˆ
=
B
A
A
A
r
w
1
r
w
ˆ
)
(
ˆ
i
B
n
1
t
Bi
A
Ai
P
r
r
r
r
AB
Cov
)
ˆ
)(
ˆ
(
)
(
B
A
AB
AB
Cov
n
1
i
i
i
P
w
iM
M
i
2
M
M
i
i
r
r
Cov
b
)
,
(
p
M
RF
M
RF
p
r
r
r
r
ˆ
ˆ
ps
ps
ps
V
D
r
( )
i RF M RF i RF M i
r r r r r RP
Firm
M
RF
s
)
(RP
r
r
g
P
D
r
0
1
S
ˆ
1
0
ˆ
(1 )
e
D
r g
P F
WACC = w
d
r
d
(1
-
T) + w
ps
r
ps
+ w
ce
*r
s
t
0
t
t 1
(1 r )
n
CF
NPV CF
inf
(1 )
n
FV lows
PVoutflows
MIRR
EBIT
BEP
TA
NI
ROA
TA
NI Sales TA
ROE x x
Sales TA CE
1
CGS
Sales
GPM
NWC = CA
CL TA = CA + NFA | 1,521 | 2,368 | {"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} | 2.6875 | 3 | CC-MAIN-2018-17 | latest | en | 0.370919 |
http://spmath81609.blogspot.com/2009/11/s-rate-growing-post_02.html | 1,532,164,875,000,000,000 | text/html | crawl-data/CC-MAIN-2018-30/segments/1531676592475.84/warc/CC-MAIN-20180721090529-20180721110529-00232.warc.gz | 351,205,840 | 24,385 | ## Monday, November 2, 2009
### %%%%%'s Rate Growing Post
Part 1
Ratio is the comparison between two numbers with the same unit.
Rate is a comparison of two quantities measured in different units.
-rate is different then a ratio because it's comparing the amounts in different units.
6. Gina earns \$78.00 for working 6 h. Asad makes \$192.50 after working 14 h. Determine each person’s unit rate of pay. Who has a greater hourly rate of pay?
-Asad has a better hourly pay because he has \$13.7 per/h.
14. Conversion rates among currencies vary from day to day. The numbers in the table give the value in foreign currency of one Canadian dollar on one particular day.
a.)What was the value of \$600 Canadian
in euros?
- 600 x o.6940 = 416.4 dollars
b) What was the value of \$375 Canadian
in U.S. dollars?
-375 x 0.8857 = 332.14 dollars
c) What was the value of \$450 Canadian
in Australian dollars?
-450 x 1.1527 = 518.71 dollars
If there were 6 jars and theres 400 dollars in it?. how many coins are in 1 jar?
400/6= 66.67 dollars
Part 2
1.)What would the recipe look like if it had to serve 10 people? Show your calculations.
3.75 lbs ground beef
2.5 medium onion diced
2.5 celery finely sliced
2.5 cloves of garlic
35 oz can of tomatoes chopped
3.75 can of tomato paste
2.5 tsp parsley
3.76 tsp basil
2.5 tsp oregano
2.5 tsp sugar
1.25 tsp Worchester Sauce
1.25 tsp Seasoning Salt
2.5 Bay Leaf
2) What would the recipe look like if you had to only serve 1 person? Show your calculations.
0.375 lbs ground beef
0.25 medium onion diced
0.25 celery finely sliced
0.25 cloves of garlic
3.5 oz can of tomatoes chopped
0.375 can of tomato paste
0.25 tsp parsley
0.376 tsp basil
0.25 tsp oregano
0.25 tsp sugar
0.125 tsp Worchestershire Sauce
0.125 tsp Seasoning Salt
0.25 Bay Leaf
1. Very well done, I liked how you showed your work for the first problem. It shows not only do you know what the answer is but how to explain yourself too!
Shelby Mackey | 558 | 1,963 | {"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} | 3.90625 | 4 | CC-MAIN-2018-30 | latest | en | 0.920533 |
http://infinigons.blogspot.com/2010/12/ | 1,560,661,071,000,000,000 | text/html | crawl-data/CC-MAIN-2019-26/segments/1560627997731.69/warc/CC-MAIN-20190616042701-20190616064701-00279.warc.gz | 83,331,204 | 17,024 | ## Saturday, December 18, 2010
### A really fun physics/calculus lesson
This was the last week before winter break, and my honors calculus classes spent it working on The Great Calculus Challenge. In a nutshell, I built a wooden ramp and I told them we'd be putting the ramp on the roof of the school and letting a metal cube (I used density cubes - brass in one class, copper in another) slide off of it. They had 3 days to figure out where on the ground it would land, and as a class they'd get to place one blue plastic cup on the ground. The goal, of course, was for the block to land in the cup. I made a big show of the fact that the entire class would get only one try to get the block in, so they all had to agree on their answer.
This was a sort of "culmination" of our first semester of calculus. We've spent a lot of time talking about derivatives and antiderivatives in the context of motion - position, velocity, and acceleration. My students had done tons of problems about motorcycles screeching to a halt, potatoes being projected off of cliffs, etc. The new mathematical element here was that students had to calculate the velocity of the block leaving the ramp, which required them to take into account acceleration other than that due to gravity (like friction).
So what happened? In the first class, as my students were feverishly perfecting their calculation, my boyfriend (who is finishing his Ph.D. in math, and who I'm trying to convince to become a high school physics teacher - hence dragging him to school for the day) did his own calculation in about 10 minutes. (He actually wrote a little Python code to help him.) When we went outside, the class put down their cup and my boyfriend put down his (it was just short of theirs ... very "Price is Right" of him!) and, lo and behold, the block landed in his cup! I would say that the excitement this caused was a very close second to what would have happened had the block landed in their cup. In the second class, we did the same and this time everyone agreed on where the block should land. However, it fell about 2 inches short of the cup. We talked about why this might be, and I blame it on the shoddy craftsmanship (and therefore variable initial conditions) of the ramp (for which I am completely responsible). In any case, it was a fun way to spend the week before break:
Some students chose to solve the problem by experimenting from different heights...
Others took a pencil and paper approach...
A good time was had by all...
Especially by my colleague Kyle, who got to scale the building and drop the block for us!
The anticipation was INTENSE...
And in the end, the block fell just a smidge short.
For me, this turned out to be an experiment in what happens when you tell a group of 25-ish bright, motivated students that they have three days to come up with one answer to an open-ended problem. The two classes approached the task completely differently - one class relied heavily on a couple of "leaders" and many students were quiet or worked mostly independently, while the other class naturally split into a few truly collaborative groups. It was fun for me to be a bystander, observing the classroom dynamic and occasionally giving a cryptic nod of my head or raise of my eyebrows to indicate whether or not they were on the right track.
I really liked this activity for one main reason: when a couple of students asked how they would be graded, I got to be really dramatic and say something like "Graded??? This is SO much more than a grade! This isn't me versus you, it's you versus the laws of physics!" and that kind of silenced that conversation. I would love to have more of these activities in my back pocket for next semester, where there's a high level of intrinsic motivation, especially because I'll have second-semester seniors ... any thoughts?
## Tuesday, December 7, 2010
### I can prove it, but I don't believe it!
There's a problem I really like whose result always surprises me. First, imagine you have a piece of string that’s long enough to stretch all the way around a basketball (the circumference of a basketball is 30 inches). Then you realize you have an extra 24 inches of string in your pocket, which you want to add to the string. So, you cut the circle of string somewhere, add exactly 24 inches, and then smooth it out until it makes a circle all around the ball (kind of like a ring orbiting a planet). The question is to figure out how high is the string off the basketball? It's a simple geometry calculation, and you wind up getting around 3.8 inches.
Got it? Now, try the same problem, except instead of a basketball imagine that you start by wrapping a string around the equator of the earth. Then, just as before, you find an extra 24 inches of string in your pocket, which you add on to the string, and then smooth out the resulting string until it makes a circle around the earth. How high is the string off the earth?
My intuition always tells me that the gap should be minuscule - after all, what is a mere 24 inches compared with a 25,000 mile equator? But of course, every time, the answer comes out to be ... around 3.8 inches.This definitely falls under the category of "I can prove it, but I don't believe it!"
It occurred to me that there just HAD to be some calculus in this problem (is there a problem for which that couldn't be said?), and lo and behold I found it. For their weekly challenge set, I gave my students the basketball/earth problems, and also this last one: Express the radius of a sphere as a function of its circumference, and then find the derivative of this function. Why does this make sense in light of your previous answers?
The answer is that r(c)=c/(2*pi), so r'(c) is just the constant 1/(2*pi)! So, regardless of the starting circumference, a constant change in circumference will result in a constant change in the radius. Neat, huh?
So I get it. I can prove it with calculus and without calculus. Yet somehow, I still don't really understand how this can be true. And I have to admit, after years doing math calculations that "give" the answer, it's always refreshing to come across one that doesn't...
## Friday, December 3, 2010
### Order of Operations?
One of my calculus classes just finished a long introduction to the derivative -- we learned it (or rather, I taught it) once, at which point I realized that the students were still completely confused about the concept of the derivative even though they were making progress in actually computing derivatives. So, we spent another week reviewing both the concept and the skill (as I attempted to explain, possibly in vain, why both of those things are important ... I told them that if they left my class without being able to explain the derivative to someone, I would have failed at my job). After another week of review, I am confident that they are ready to move on to the next topic.
This of course brings up the question of what the "next" topic is. Calculus is not linear, and at a school with absolutely no prescribed curriculum the thought of moving on often propels me into a panic-ridden tizzy. What's the best next topic - the one that will tap into the students' current understanding, keep their interest, draw on their mathematical strengths, and work on their weaknesses? (Am I asking too much of a single topic?) My two thoughts are:
1. Having them discover the power rule. They're primed to appreciate it now that they've spent weeks calculating derivatives using limits. Also, my other classes have known about the power rule for awhile now and have already tried to ruin the surprise (I have to admit, part of me loves that there even is a math rumor mill!), so I'd feel a little slimy hiding it any longer.
2. Having them practice graphing functions and their derivatives. This will get back to the concept of the derivative as the "rate of change," which is something I really want to hammer home. I would have them start out simply by making observations using this super-rad calculus grapher, which I just read about on Sam Shah's blog. Gosh I love the internet.
I teach three calculus classes - two honors and one regular. Teaching this non-honors class in particular is really forcing me to hone in on the essence of calculus. Somehow I'd be missing the point if I tried to push the "standard" calculus curriculum on these students, because they're still getting comfortable with so much of the algebra that successful calc students take for granted. I'm sure that we could eventually get to the point where they could apply the quotient rule and the chain rule to complicated functions, but it would be at the cost of a greater conceptual understanding. This reminds me of something my office-mate Kyle said the other day: "A year from now, I'd rather have students say that they understand what derivatives are and they used to be able to calculate them, than that they know the derivative of x^2 is 2x and they used to actually understand why."
This brings up the juicy debate over how and why calculus is taught in high school, but that's for another day... | 1,987 | 9,144 | {"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} | 3.265625 | 3 | CC-MAIN-2019-26 | latest | en | 0.988897 |
https://socratic.org/questions/how-do-you-find-the-five-remaining-trigonometric-function-satisfying-tantheta-5- | 1,718,578,858,000,000,000 | text/html | crawl-data/CC-MAIN-2024-26/segments/1718198861671.61/warc/CC-MAIN-20240616203247-20240616233247-00092.warc.gz | 465,623,464 | 6,193 | # How do you find the five remaining trigonometric function satisfying tantheta=5/4, costheta<0?
Jan 16, 2017
Find values of trig functions
#### Explanation:
Use trig identity:
$1 + {\tan}^{2} x = \frac{1}{{\cos}^{2} x}$
${\cos}^{2} x = \frac{1}{1 + {\tan}^{2} x}$
${\sin}^{2} x = \frac{1}{1 + {\cot}^{2} x}$
In this case:
${\cos}^{2} x = \frac{1}{1 + \frac{25}{16}} = \frac{1}{\frac{41}{16}} = \frac{16}{41}$
$\cos x = - \frac{4}{\sqrt{41}} = - \frac{4 \sqrt{41}}{41}$
Find sin x by the same way:
${\sin}^{2} x = \frac{1}{1 + \frac{16}{25}} = \frac{1}{\frac{41}{25}} = \frac{25}{41}$
$\sin x = - \frac{5}{\sqrt{41}}$ (because $\tan x = \frac{5}{4}$ > 0)
$\tan x = \frac{\sin}{\cos} = \frac{5}{4}$
$\cot x = \frac{1}{\tan} = \frac{4}{5}$
$\sec x = \frac{1}{\cos} = - \frac{\sqrt{41}}{4}$
$\csc x = \frac{1}{\sin} = - \frac{\sqrt{41}}{5}$ | 381 | 841 | {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 12, "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} | 4.53125 | 5 | CC-MAIN-2024-26 | latest | en | 0.445268 |
https://encyclopediaofmath.org/index.php?title=Variety_of_rings&diff=next&oldid=16516 | 1,639,010,173,000,000,000 | text/html | crawl-data/CC-MAIN-2021-49/segments/1637964363641.20/warc/CC-MAIN-20211209000407-20211209030407-00157.warc.gz | 292,781,839 | 8,130 | # Difference between revisions of "Variety of rings"
A class of rings $\mathfrak M$ satisfying a given system of polynomial identities. A variety of rings can be defined axiomatically as a hereditary class of algebras that is closed with respect to taking homomorphic images and complete direct sums (see Algebraic systems, variety of). Since the totality of polynomial identities that are satisfied in a given ring forms a fully-characteristic ideal (a $T$-ideal) of a free ring, there exists a one-to-one correspondence between varieties of rings and the $T$-ideals of a countably-generated free ring. If for two varieties of rings there is an inclusion $\mathfrak N\subseteq\mathfrak M$, one says that $\mathfrak N$ is a subvariety of $\mathfrak M$. The variety corresponding to the $T$-ideal of identities of the ring $A$ is called the variety generated by the ring $A$. Every variety of rings is generated by a "universal object" of it; this is a free ring of the given variety containing an infinite free system of generators: Every mapping from the set of free generators into an arbitrary ring of the variety can be extended to a homomorphism.
Let $M_n$ be the variety generated by the algebra of square matrices of order $n$. For each variety of associative rings of characteristic zero (that is, rings whose additive group is torsion-free) there exists a positive integer $n=n(\mathfrak M)$ such that $M_n\subseteq\mathfrak M$, but $M_{n+1}\not\subseteq\mathfrak M$. A variety of rings is called a Specht variety if every ring in it has a finite basis of identities. A variety generated by a finite associative ring or by a finite Lie ring is a Specht variety. The question whether every variety of associative algebras is a Specht variety forms the content of the Specht problem. If a variety $\mathfrak M$ is generated by an associative algebra with a finite number of generators over a field of characteristic zero and if $M_2\not\subseteq\mathfrak M$, then $\mathfrak M$ is a Specht variety.
#### References
[1] C. Procesi, "Rings with polynomial identities" , M. Dekker (1973) [2] P.M. Cohn, "Universal algebra" , Reidel (1981)
In addition to solving the Specht problem in the case of characteristic zero, Kemer has also described the $T$-ideal of a variety in terms of a finite $\mathbf Z_2$-graded algebra $A$ and an infinite Grassmannian algebra $G$. He has proved that, given a $T$-ideal $I$, there exists a finite-dimensional $\mathbf Z_2$-graded algebra $A=A_0\oplus A_1$ such that $I=T(A_0\otimes G_0+A_1\otimes G_1)$, the $T$-ideal of identities of the algebra $A_0\oplus G_0\otimes G_1$, where $G_0,G_1$ are the even and odd terms of the infinite Grassmannian algebra $G$. | 693 | 2,702 | {"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} | 2.9375 | 3 | CC-MAIN-2021-49 | latest | en | 0.902499 |
https://www.matterhere.com/2018/07/tcs-codevita-problem-consecutive-prime-sum-c-program.html | 1,531,901,580,000,000,000 | text/html | crawl-data/CC-MAIN-2018-30/segments/1531676590074.12/warc/CC-MAIN-20180718080513-20180718100513-00373.warc.gz | 934,062,455 | 41,377 | # [TCS] CodeVita Problem : Consecutive Prime Sum C-language Program
Problem : Consecutive Prime Sum
Some prime numbers can be expressed as Sum of other consecutive prime numbers.
For example
5 = 2 + 3
17 = 2 + 3 + 5 + 7
41 = 2 + 3 + 5 + 7 + 11 + 13
Your task is to find out how many prime numbers which satisfy this property are present in the range 3 to N subject to a constraint that summation should always start with number 2.
Write code to find out number of prime numbers that satisfy the above mentioned property in a given range.
Input Format:
First line contains a number N
Output Format:
Print the total number of all such prime numbers which are less than or equal to N.
Constraints:
1. 2
Sample Input and Output
SNo.InputOutputComment
1202
(Below 20, there are 2 such numbers: 5 and 17).
5=2+3
17=2+3+5+7
2151
Pseudo Code:
1. Find all the prime numbers till N
i. A is an array length N + 1 initialized with numbers from 0 to N (0,1,2, ..., N)
ii. initialize p = 2
a. for p = 2 to p * p <= N ; p++
if A[p] != 0 then
for i = p * 2; i <= N; i += p
A[i] = 0 // mark non prime as 0
2. sum = 5, count = 0
3. for j = 5 to j <= N; j = j+2
i. if ( (A[j] != 0 && A[j] = sum) || A[j] = -1)
count = count + 1
ii. if (A[j] != 0 || A[j] == -1)
sum = sum + j
if ( A[sum] != 0) // if A[sum] is prime
A[sum] = -1 // mark A[sum] as sum of consecutive
4. print count
TCS CodeVita 2016 Round1 Question: Consecutive Prime Sum
C-Language Program (MockVita1/consecprimesum.c)
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef long int ulint;
bool isPrime(ulint);
bool isConsecSumPrime(ulint, ulint*);
ulint* buildPrimesList(ulint n)
{
ulint i;
ulint* vals = (ulint*) malloc(sizeof(ulint) * n);+
vals[0] = vals[1] = 2;
for (i = 3; i < n; i += 2)
if (isPrime(i))
vals[vals[0]++] = i;
return vals;
}
int main()
{
ulint* primes;
ulint n;
int i, c = 0;
scanf("%ld", &n);
primes = buildPrimesList(n);
for (i = 2; i < primes[0]; i++)
if (isConsecSumPrime(primes[i], primes))
c++;
printf("%ld", c);
free(primes);
return 0;
}
bool isPrime(ulint n)
{
ulint i, w;
if (n == 2) return true;
if (n == 3) return true;
if (n % 2 == 0) return false;
if (n % 3 == 0) return false;
i = 5, w = 2;
while (i * i <= n)
{
if (n % i == 0)
return false;
i += w;
w = 6 - w;
}
return true;
}
bool isConsecSumPrime(ulint prime, ulint* primes)
{
int n;
ulint sum = 0;
for (n = 1; n < primes[0]; n++)
{
sum += primes[n];
if (sum == prime)
return true;
if (sum > prime)
return false;
}
return false;
}
Sources:
https://www.programminggeek.in/
https://github.com/
* Ask us, what you want? | 931 | 2,624 | {"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} | 3.515625 | 4 | CC-MAIN-2018-30 | longest | en | 0.651359 |
http://intranet.math.vt.edu/netmaps/hurwitz/m6n2/m6n2hurwitz156_Main.output | 1,579,996,342,000,000,000 | text/plain | crawl-data/CC-MAIN-2020-05/segments/1579251681625.83/warc/CC-MAIN-20200125222506-20200126012506-00461.warc.gz | 86,608,365 | 1,719 | These Thurston maps are NET maps for every choice of translation term. They are primitive and have degree 12. PURE MODULAR GROUP HURWITZ EQUIVALENCE CLASSES FOR TRANSLATIONS {0} {lambda1} {lambda2} {lambda1+lambda2} These pure modular group Hurwitz classes each contain only finitely many Thurston equivalence classes. However, this modular group Hurwitz class contains infinitely many Thurston equivalence classes. The number of pure modular group Hurwitz classes in this modular group Hurwitz class is 24. ALL THURSTON MULTIPLIERS c/d IN UNREDUCED FORM 0/6, 1/6, 1/2, 2/2 Every NET map in these pure modular group Hurwitz classes is rational because every loop multiplier in the mod 2 slope correspondence graph is less than 1. EXCLUDED INTERVALS FOR THE HALF-SPACE COMPUTATION (-infinity,-2.000000) (-2.000000,-1.000000) (-1.000000,infinity ) SLOPE FUNCTION INFORMATION NUMBER OF FIXED POINTS: 1 EQUATOR? FIXED POINT c d 0 lambda1 lambda2 lambda1+lambda2 0/1 1 6 No No No No NUMBER OF EQUATORS: 0 0 0 0 There are no more slope function fixed points. Number of excluded intervals computed by the fixed point finder: 931 There are no equators because both elementary divisors are greater than 1. No nontrivial cycles were found. The slope function maps some slope to the nonslope. The slope function orbit of every slope p/q with |p| <= 50 and |q| <= 50 ends in either one of the above cycles or the nonslope. If the slope function maps slope p/q to slope p'/q', then |p'| <= |p| for every slope p/q with |p| <= 50 and |q| <= 50. FUNDAMENTAL GROUP WREATH RECURSIONS When the translation term of the affine map is 0: NewSphereMachine( "a=<1,a*b,b,a*b,1,1,1,c*d,1,c*d,b^-1,1>(2,10)(3,11)(4,8)(5,9)", "b=(1,11)(2,12)(3,9)(4,10)(5,7)(6,8)", "c=(1,2)(3,4)(5,6)(7,8)(9,10)(11,12)", "d=(1,12)(2,3)(4,5)(6,7)(8,9)(10,11)", "a*b*c*d"); When the translation term of the affine map is lambda1: NewSphereMachine( "a=(1,3)(2,12)(4,10)(5,11)(6,8)(7,9)", "b=<1,1,b,a*b,1,c*a*b,1,1,1,c*d*c^-1,b^-1,c*d>(3,11)(4,12)(5,9)(6,10)", "c=<1,1,c,c^-1,1,1,1,1,1,1,1,1>(1,2)(3,4)(5,6)(7,8)(9,10)(11,12)", "d=(1,12)(2,3)(4,5)(6,7)(8,9)(10,11)", "a*b*c*d"); When the translation term of the affine map is lambda2: NewSphereMachine( "a=(1,4)(2,11)(3,6)(5,8)(7,10)(9,12)", "b=(1,2)(3,4)(5,6)(7,8)(9,10)(11,12)", "c=(1,11)(2,12)(3,9)(4,10)(5,7)(6,8)", "d=(1,9)(3,7)(4,12)(6,10)", "a*b*c*d"); When the translation term of the affine map is lambda1+lambda2: NewSphereMachine( "a=(1,4)(2,11)(3,6)(5,8)(7,10)(9,12)", "b=<1,1,c,c^-1,1,1,1,1,1,1,1,1>(1,2)(3,4)(5,6)(7,8)(9,10)(11,12)", "c=<1,1,b,a*b,1,c*a*b,1,1,1,c*d*c^-1,b^-1,c*d>(3,11)(4,12)(5,9)(6,10)", "d=(1,11)(2,4)(3,9)(5,7)(6,12)(8,10)", "a*b*c*d"); | 1,050 | 2,672 | {"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} | 2.6875 | 3 | CC-MAIN-2020-05 | latest | en | 0.742223 |
https://forum.math.toronto.edu/index.php?PHPSESSID=ss1tlr3mp6ir5dbatm3ubifhs7&action=profile;area=showposts;u=39 | 1,726,027,940,000,000,000 | text/html | crawl-data/CC-MAIN-2024-38/segments/1725700651343.80/warc/CC-MAIN-20240911020451-20240911050451-00386.warc.gz | 238,180,228 | 4,673 | ### Show Posts
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
### Messages - Dana Kayes
Pages: [1]
1
##### Home Assignment X / Re: Problem 1
« on: October 14, 2012, 03:24:26 PM »
Thanks!
2
##### Home Assignment X / Problem 1
« on: October 14, 2012, 03:13:49 PM »
For part C, 'Where the solution is fully determined by the initial condition u(x, 0) = g(x).', is supposed to be this a question, 'Where is the solution fully determined ...' or is it asking us to do something?
Thanks
3
##### Misc Math / Method of Continuation
« on: October 05, 2012, 11:09:44 AM »
Could anyone help me understand the method of continuation? The notes for Lecture 8 are just a little too complex for me to follow. What are the steps, and what is the aim? I think that if I can better understand what we're trying to achieve by using it, I'll be able to follow the notes better.
Thanks
4
##### Home Assignment 2 / Re: Problem 2
« on: September 29, 2012, 06:21:51 PM »
I'm even more confused after your response to Thomas' comment - why is part b) the only part that has x as a variable now?
Could you make it clear which version you change first, so I know if I should always check the html version instead of the pdf version for changes?
5
##### Home Assignment 2 / Re: Problem 2
« on: September 28, 2012, 08:01:03 PM »
Thanks, that makes it clear
6
##### Home Assignment 2 / Re: Problem 2
« on: September 28, 2012, 02:50:51 PM »
I'm confused about what to do when 2b) asks us to solve for v and then gives us v. I feel like I'm missing something obvious, but I can't figure it out. Can anyone help me?
Pages: [1] | 490 | 1,698 | {"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} | 2.921875 | 3 | CC-MAIN-2024-38 | latest | en | 0.90755 |
https://lagaiascienza.org/science/readers-ask-what-is-discrete-structures-in-computer-science.html | 1,660,819,566,000,000,000 | text/html | crawl-data/CC-MAIN-2022-33/segments/1659882573193.35/warc/CC-MAIN-20220818094131-20220818124131-00469.warc.gz | 325,878,562 | 10,996 | ## What is the use of discrete structures in computer science?
Concepts and notations from discrete mathematics are useful in studying and describing objects and problems in branches of computer science, such as computer algorithms, programming languages, cryptography, automated theorem proving, and software development.
## What is taught in discrete structure?
Course Introduction Discrete mathematics describes processes that consist of a sequence of individual steps, as compared to forms of mathematics that describe processes that change in a continuous manner. The major topics we cover in this course are single-membership sets, mathematical logic, induction, and proofs.
## What is the use of discrete structure?
Logical formulas are described by the discrete structure, which is used to create directed acyclic graph structures and finite trees. A finite set is produced by the truth values of logical formulas.
## Is discrete structures for computer science hard?
Many people will find discrete math more difficult than calculus because of the way they are exposed to both of the areas. Many people will find discrete math more difficult than calculus because of the way they are exposed to both of the areas.
You might be interested: FAQ: What Does Interdependent Mean In Science?
## Why is called discrete math?
“Discrete Math” is not the name of a branch of mathematics, like number theory, algebra, calculus, etc. Rather, it’s a description of a set of branches of math that all have in common the feature that they are “discrete” rather than “continuous”. set theory. relations and functions.
## Can I do computer science without maths?
Well, some of the Bachelor’s degree courses in Computer requires you to have studied Mathematics in Class 12th. However, it’s will be good for you to do these courses if you have studied Mathematics up to your Class 10th. Courses in Computers are definitely some of the best courses without Maths after Class 12th.
## Is discrete math easy?
Many people will find discrete math more difficult than calculus because of the way they are exposed to both of the areas. Many people will find discrete math more difficult than calculus because of the way they are exposed to both of the areas.
## What comes under discrete math?
The various research domains included by Discrete Mathematics are graph and hypergraph theory, coding theory, block designs, the combinatorics, set theory, matroid theory, discrete geometry, matrices, discrete probability, and parts of cryptography.
## What is the meaning of discrete structure?
discrete structure A set of discrete elements on which certain operations are defined. The term discrete structure covers many of the concepts of modern algebra, including integer arithmetic, monoids, semigroups, groups, graphs, lattices, semirings, rings, fields, and subsets of these.
## What is discrete structure and its application?
● Discrete Structures: Abstract mathematical structures. that represent objects and the relationships between them. Examples are sets, permutations, relations, graphs, trees, and finite state machines. Page 6. Goals of a Course in Discrete.
You might be interested: What Is Science Concept?
## Why discrete structure is important?
Discrete Mathematics is the backbone of Computer Science Concepts and notations from discrete mathematics are useful in studying and describing objects and problems in all branches of computer science, such as computer algorithms, programming languages, cryptography, automated theorem proving, and software development.
## What is an example of discrete math?
Discrete mathematics is the study of mathematical structures that are countable or otherwise distinct and separable. Examples of structures that are discrete are combinations, graphs, and logical statements. Discrete structures can be finite or infinite.
## Is computer science hard?
Is computer science hard? Yes, computer science can be hard to learn. The field requires a deep understanding of difficult topics like computer technology, software, and statistical algorithms. However, with enough time and motivation, anyone can succeed in a challenging field like computer science.
## Do you need discrete math for programming?
Math is an important part of all programming. Discrete math can be used for software design specifications, analysis of algorithms, and other practical applications, but it’s really a great tool to develop as a programmer. Put simply, it’s a building block for logical thinking.
## Is calculus a discrete math?
Discrete mathematics comes in mind. But calculus is already inherent in discrete mathematics. Combinatorics, set theory or graph theory are usually core elements in a discrete math course. Newer models of calculus see discrete structures as special cases of a more general calculus. | 913 | 4,859 | {"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} | 3.53125 | 4 | CC-MAIN-2022-33 | latest | en | 0.953598 |
https://www.adventuresinmachinelearning.com/mastering-random-sampling-in-python-a-comprehensive-guide/ | 1,726,820,364,000,000,000 | text/html | crawl-data/CC-MAIN-2024-38/segments/1725700652138.47/warc/CC-MAIN-20240920054402-20240920084402-00748.warc.gz | 587,483,363 | 18,857 | # Mastering Random Sampling in Python: A Comprehensive Guide
## Random Sampling in Python
Python is an incredibly flexible programming language that is used extensively for a wide range of applications. One of the most important tasks in data science is collecting a random sample of data.
Python has a powerful tool known as the `random.sample()` function that can be used for this purpose. In this article, we’ll explore how to use this function to perform random sampling from a list and a set in Python.
### 1) Random Sampling: Definition and Importance
Random sampling is a statistical technique that involves selecting a subset of data from a larger population.
This selection is done in such a way that each element in the population has an equal chance of being selected. Random sampling is commonly used in research, data science, and many other fields.
### 2) The random.sample() Function
Python provides several functions for performing random sampling, and one of the most commonly used ones is `random.sample()`.
The `random.sample()` function allows users to get a random sample of a given size from a list, tuple, or set of elements without any repetition.
This function is built into Python’s `random` module, which provides several other functions for generating random numbers and data.
### How to use random.sample() function
The syntax for the `random.sample()` function is straightforward.
To use this function, we need to provide the list or set that we want to sample, along with the number of items we wish to sample.
## The general syntax is as follows:
`random.sample(population, k)`
Where `population` is the list, tuple, or set from which we want to sample, and `k` is the number of items we wish to sample.
### Example: random.sample() function to select multiple items from a list without repetition
Let’s say we have a list of items that we want to sample randomly. For example, to create a list of fruits, we could write:
``fruits = ['apple', 'banana', 'cherry', 'date', 'elderberry', 'fig', 'grape']``
Now, suppose we want to randomly select three fruits from the list without repeats.
We can use the `random.sample()` function as follows:
``selected_fruits = random.sample(fruits, 3)``
This code will choose three fruits from the list at random, with no repeats, and store them in the variable `selected_fruits`.
### Points to remember about random.sample()
It’s important to remember that `random.sample()` only works with collections that support indexing and slicing, such as lists and tuples.
Also, the size of the random sample cannot be greater than the size of the collection being sampled. If `k` is greater than the length of the `population`, the function will raise a `ValueError`.
## Random sampling with replacement to including repetitions
By default, the `random.sample()` function returns a list of unique items with no repeats. But what if we want to generate a list of random integers with repetitive numbers?
To include repetitions in our sampled list, we can use the `random.choices()` function instead. The `random.choices()` function has similar parameters as the `random.sample()` function.
The difference is that `random.choices()` allows repetitions while `random.sample()` does not. For instance, to generate a list of random integers with repetitions, we can write:
``random.choices(range(10), k=5)``
## Generate the sampled list of random integers
Another critical function for dealing with random data in Python is `random.shuffle()`. This function shuffles a list or set of elements randomly.
This function operates in-place and doesn’t return a new list.
Suppose we have a list of integers from 1 to 10, and we want to shuffle them randomly.
We can use the `random.shuffle()` function as follows:
``````numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
random.shuffle(numbers)
print(numbers)``````
This code will shuffle the elements of the list `numbers` randomly, generating a new list with the same elements in a different order.
## Random Sampling from a Python set
Sets are another data structure in Python that support random sampling. A set is an unordered collection of unique elements with no duplicates.
As the nature of elements in a set already ensures randomness and having no duplication, the `random.sample()` function only provides one use, which is taking a random sample from an unordered data structure.
To use a set in Python, we can declare a variable with the `set()` function. For example, we can create a set of colors like this:
``colors = set(['blue', 'green', 'red', 'yellow', 'orange', 'purple'])``
### Example: random.sample() function to select random items from a set
To select a random item from a set in Python, we can use the `random.sample()` function as well.
For example, we can use the following code to select a random item from the `colors` set:
``random_color = random.sample(colors, 1)``
This code will select a random color from the set `colors` and store it in the variable `random_color`.
## Conclusion
In conclusion, random sampling is an essential statistical technique used in a wide range of applications, including data science and research. Python provides several functions for performing random sampling, such as `random.sample()`, `random.choices()`, and `random.shuffle()`.
By using a combination of these functions, Python programmers can generate random data for their applications with ease.
## 3) Random Sampling from a Python dictionary
Python dictionaries are another useful data structure that can be useful in random sampling. Dictionaries are collections of key-value pairs and are used to store and retrieve data in an unordered manner.
Dictionaries make it easy to associate keys with values, and therefore suitable for the construction of mapping data.
To use a dictionary in Python, we can declare a variable with the `{}` brackets or call the `dict()` function. For example, we can create a dictionary of people with their age like this:
``people = {'Jon': 28, 'Ada': 35, 'Lila': 24, 'Ben': 45, 'Kayla': 30}``
### Example: random.sample() function to select random key-value pairs from a dictionary
To select a random key-value pair from a dictionary in Python, we can use the `random.sample()` function with a few modifications.
For example, we can use the following code to select a random person with their age from the `people` dictionary:
``random_person = random.sample(people.items(), 1)``
The `items()` function of a dictionary returns a list containing a tuple for each key-value pair in the dictionary, and the `random.sample()` function can select a random tuple from that list. The resulting `random_person` variable will contain a tuple with a person’s name as the key and their age as the value.
## 4) Random Seed to get the same sample list every time
Random sampling is inherently unpredictable as it selects elements from a collection at random. In some instances, we may want the same sample to be generated each time we run our program.
In such a situation, we can use a random seed. By using a random seed, we can set the starting point for the random number generator, ensuring that the same random numbers will be generated each time the seed is set.
To set a random seed, we can use the `random.seed()` function.
The seed value can be any integer, and it will set the initial state of the random number generator.
### Example: random.seed() function to get the same sampled list every time
Consider the following example, where we have a list of numbers, and we want to select a random sample of five numbers from the list each time we run our program:
``````numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
random.seed(0)
random_numbers = random.sample(numbers, 5)
print(random_numbers)
random.seed(0)
random_numbers = random.sample(numbers, 5)
print(random_numbers)``````
In this code, we use the `random.seed(0)` function to set the initial state of the random number generator to 0.
We then use the `random.sample()` function to select five random numbers from the list each time we execute this code. Running this code multiple times will always generate the same set of random numbers because we specified the same initial state for the random number generator using the `random.seed()` function.
This technique is useful when we need to ensure that our code generates the same set of results each time it runs. Using identical data repeatedly for testing is a typical scenario where reusability of test cases is executed.
## Conclusion
In this article, we have seen how to use the `random.sample()` function in Python to select random elements from a list, set, and dictionary. We have also learned how to use the `random.seed()` function to obtain the same set of random numbers every time the code is executed.
Random sampling is useful in various situations, and it is an essential tool in data science and research. Python’s built-in `random` module makes it a useful resource for generating random numbers and data, simplifying the process of conducting statistical analysis and testing.
## 5) Getting a sample array from a multidimensional array
In Python, multi-dimensional arrays are often used to represent complex data structures. Multidimensional arrays can be thought of as tables of elements with rows and columns, and they can be created from nested lists or the NumPy library.
NumPy is a popular Python library for scientific computing and provides a wide range of functions for dealing with multi-dimensional arrays.
To create a multidimensional array in Python, we can use a nested list. A two-dimensional array is a list of lists and can be created as follows:
``arr = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]``
This creates a two-dimensional array with three rows and three columns.
We can then access elements of the array using two indices, one for the row and one for the column.
### Example: numpy.random.choice() function to pick multiple random rows from the multidimensional array
To select a random sample of rows from a two-dimensional array, we can use the `numpy.random.choice()` function from the NumPy library.
This function selects a random sample of elements from a given array using a specified sample size. For example, we can use the following code to select two random rows from the array `arr`:
``````import numpy as np
arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
random_rows = np.random.choice(arr, size=2, replace=False)``````
In this code, we first import the NumPy library and create the multidimensional array `arr` using the `numpy.array()` function.
We then use the `np.random.choice()` function to select two random rows from the array, with the `replace` parameter set to `False` to ensure that the selected rows are unique. The resulting `random_rows` variable will contain a sample of two rows from the original array `arr`.
This method applies to higher dimensional arrays as well. For example, to generate a sample containing two subarrays with shape (2,3) from a multidimensional array with shape (3,2,3), we can write:
``````arr = np.random.rand(3,2,3)
arr_sampled = np.random.choice(arr, size=(2,3), replace=False)``````
This will generate a 2×3 array of two random 2×3 sub-arrays from the original, three-dimensional array.
## 6) Error and exception
Despite its simplicity, the `random.sample()` function can sometimes behave counter-intuitively when not used correctly, generating errors or exceptions.
### Possible errors while using the random.sample() function
One possible error is the `ValueError`.
This error occurs when the sample size `k` is greater or equal to the size of the population, as cannot draw a unique sample of size greater or equal to population size. The error may occur when the function is called with `k` equal to or greater than the length of the collection being sampled.
Another possible error is the `TypeError`. This error occurs if the `population` provided cannot support indexing or slicing because the `random.sample()` function only works with iterable objects that can be indexed.
A third possible error is the `KeyError`. This error occurs when we try to select an item from a dictionary that doesn’t have the key passed to the function.
## In Summary
In this article, we have discussed how to get a sample array from a multidimensional array in Python. Multidimensional arrays play a significant role in data science and scientific computing, and Python libraries like NumPy provide a wide range of functions for dealing with arrays.
We have also discussed the potential errors and exceptions that can occur when using the `random.sample()` function in Python. It is essential to carefully review one’s code to avoid such errors and to use data validation techniques to ensure data integrity in research and data science.
In this article, we have explored the topic of random sampling in Python, including the use of the `random.sample()` function to select random elements from a list, set, and dictionary. We’ve learned how to use the NumPy library to extract a sample from a multidimensional array.
The article has also emphasized the importance of being aware of potential errors while using the `random.sample()` function and provided insights on how to avoid them. Random sampling is an essential tool used for data science and research, and the Python language with its built-in `random` module and many external libraries make it easier for users to perform statistical analysis efficiently.
Data validation and careful consideration of potential errors remain crucial in data analysis and research. | 2,927 | 13,658 | {"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} | 2.6875 | 3 | CC-MAIN-2024-38 | latest | en | 0.873902 |
https://tutorme.com/tutors/195084/interview/ | 1,607,044,887,000,000,000 | text/html | crawl-data/CC-MAIN-2020-50/segments/1606141733120.84/warc/CC-MAIN-20201204010410-20201204040410-00426.warc.gz | 506,400,759 | 42,861 | Enable contrast version
# Tutor profile: Martha G.
Inactive
Martha G.
Chem, Math and Science. 10+ years of tutoring expirience
Tutor Satisfaction Guarantee
## Questions
### Subject:Geometry
TutorMe
Question:
What is the difference between an isosceles triangle and an obtuse triangle?
Inactive
Martha G.
It is not so much that there is a specific difference between an isosceles triangle and an obtuse triangle as they are two different definitions for different kinds of triangles. An isosceles triangle has 2 sides that are the same length and one side that is a different length. This results in two angles that have the same number of degrees and one that is different. Meanwhile an obtuse triangle has one angle that is obtuse, or larger than 90 degrees. It is not possible for any triangle to have two obtuse angles because the sum of two obtuse angles would be greater than 180 degrees. As such, it is not possible for an equilateral triangle to be obtuse as all the angles in an equilateral are 60 degrees. It is possible for an obtuse triangle to be scalene - all the sides and all the angles would have a different size. It is also possible for an obtuse triangle to be an isosceles triangle. This would be a triangle with one large angle and two smaller angles of the same size, and therefore one long side and two shorter sides of the same length.
### Subject:Chemistry
TutorMe
Question:
How is chemistry connected to everyday life?
Inactive
Martha G.
Chemistry is connected to everyday life because every single thing in the universe is composed of atoms of some type of element. Atoms make up elements, which are the components of everything that exists. When we look around, everything we see and even what we cannot see is made of atoms and elements that interact with each other in specific ways. In the air we breathe, there are invisible molecules of gases such as oxygen and nitrogen, which are elements. Every living thing is made of organic compounds, which are those that are composed of elements such as carbon, oxygen, hydrogen and nitrogen. Even our own bodies are composed of tiny atoms that are bonded together into molecules such as proteins, fats, carbohydrates and lipids. We are also made of water, which is a chemical molecule that is necessary for life. Chemistry helps us to understand the molecular composition of the world around us. It also helps us to understand how atoms bond with each other to form compounds and molecules through chemical reactions. Chemical reactions such as photosynthesis in plants and respiration in animals occur constantly, and make life possible.
### Subject:Algebra
TutorMe
Question:
If j=19; i=16 and z = j - i then, what is value of z?
Inactive
Martha G.
z= 19-16 z=3
## Contact tutor
Send a message explaining your
needs and Martha will reply soon.
Contact Martha
Start Lesson
## FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Lesson" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.
BEST IN CLASS SINCE 2015
TutorMe homepage | 783 | 3,605 | {"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} | 2.90625 | 3 | CC-MAIN-2020-50 | latest | en | 0.942917 |
https://web2.0calc.com/questions/also-this | 1,521,433,946,000,000,000 | text/html | crawl-data/CC-MAIN-2018-13/segments/1521257646375.29/warc/CC-MAIN-20180319042634-20180319062634-00523.warc.gz | 735,087,220 | 6,035 | +0
# Also this:
0
30
2
+769
What is the radius of the circle inscribed in triangle ABC if AB = 10, AC = 17, BC = 21? Express your answer as a decimal to the nearest tenth.
AnonymousConfusedGuy Feb 28, 2018
Sort:
#1
+83946
+1
Here's a pic, ACG :
The perpendicular bisectors meet at (7, 3.5)......this is the circle's center
The equation of the circle is
(x - 3.5)^2 + ( y - 7)^2 = 3.5^2
CPhill Feb 28, 2018
#2
+769
+1
Thanks CPhill, unfortunately I can't see your diagram but I think i get the gist!
AnonymousConfusedGuy Feb 28, 2018
### 15 Online Users
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners. See details | 253 | 806 | {"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} | 3.09375 | 3 | CC-MAIN-2018-13 | longest | en | 0.88718 |
http://tretherington.blogspot.com/2016/05/when-to-use-lognormal-distribution.html | 1,566,289,535,000,000,000 | text/html | crawl-data/CC-MAIN-2019-35/segments/1566027315258.34/warc/CC-MAIN-20190820070415-20190820092415-00382.warc.gz | 184,352,366 | 15,337 | ## Wednesday, May 04, 2016
### When to use a lognormal distribution rather than a normal distribution
Recently a reviewer commented that perhaps a lognormal distribution rather than normal distribution should be used in order to avoid truncation of negative values. Now I had used lognormal distributions in the past, but only so that I could to describe a positively skewed distribution.
So I did some reading and found a paper by Limpert et al. (2001) from which I picked out a few key points:
1. The reviewer was quite correct, and unlike a normal distribution, a lognormal distribution is incapable of producing random numbers below zero.
2. As the mean gets larger and the standard deviation gets smaller, the normal and lognormal distributions become identical.
3. The two distributions are defined in a similar manner. The normal distribution is defined by the arithmetic mean and standard deviation, and the lognormal distribution is defined by the geometric mean and standard deviation.
To get my head around how the normal and lognormal distributions behaved, and how to generate and fit data in R, I knocked up some example scripts. I didn't fix the random seed value as I wanted to see how the patterns varied with different random samples, so if you run the scripts yourself you will get different results to those shown here, but the patterns will be broadly the same.
```# Define some values to work with
v = c(9.36, 8.06, 7.93)
# Set up things for plotting
x = seq(-5, 20, 0.1)
png("example1.png", width=15/2.54, height=12/2.54,
res=100, units="in", pointsize=8)
par(oma=c(2,0,0,0), mar=c(3,3,2,0.5), mgp=c(2,0.55,0), mfrow=c(2,1))
# NORMAL DISTRIBUTION
# Calculate arithmetic mean and standard deviation
aM = mean(v)
aS = sd(v)
# Generate some random numbers
normal = rnorm(1000, mean = aM, sd = aS)
# Plot a histogram
hist(normal, breaks=seq(-5,50,0.5), xlim=c(-5,20),
col="dodgerblue", border="white",
main="Normal", xlab="Values")
# Create a probability density values and add to plot
normY = dnorm(x, mean = aM, sd = aS)
par(new=TRUE)
plot(x, normY, type = "l", xlim=c(-5,20), col="red", bty="n",
xaxt="n", yaxt="n", ylab="", xlab="")
# LOGNORMAL DISTRIBUTION
# Calculate geometric mean and standard deviation
gM = exp(mean(log(v)))
gS = exp(sd(log(v)))
# Generate some random numbers
lognormal = rlnorm(1000, meanlog = log(gM), sdlog = log(gS))
# Plot a histogram
hist(lognormal, breaks=seq(-5,50,0.5), xlim=c(-5,20),
col="gold", border="white",
main="Lognormal", xlab="Values")
# Create a probability density values and add to plot
lognormY = dlnorm(x, mean = log(gM), sd = log(gS))
par(new=TRUE)
plot(x, lognormY, type = "l", xlim=c(-5,20), col="red", bty="n",
xaxt="n", yaxt="n", ylab="", xlab="")
dev.off()```
In this example we can see that the two distributions describe the data in an almost identical manner, so either could be used. However, when the values are closer to zero, and the variation becomes larger, there is a marked difference in behaviour.
```# Define some values to work with
v = c(2.49, 0.93, 4.08)
# Set up things for plotting
x = seq(-5, 20, 0.1)
png("example2.png", width=15/2.54, height=12/2.54,
res=100, units="in", pointsize=8)
par(oma=c(2,0,0,0), mar=c(3,3,2,0.5), mgp=c(2,0.55,0), mfrow=c(2,1))
# NORMAL DISTRIBUTION
# Calculate arithmetic mean and standard deviation
aM = mean(v)
aS = sd(v)
# Generate some random numbers
normal = rnorm(1000, mean = aM, sd = aS)
# Plot a histogram
hist(normal, breaks=seq(-5,50,0.5), xlim=c(-5,20),
col="dodgerblue", border="white",
main="Normal", xlab="Values")
# Create a probability density values and add to plot
normY = dnorm(x, mean = aM, sd = aS)
par(new=TRUE)
plot(x, normY, type = "l", xlim=c(-5,20), col="red", bty="n",
xaxt="n", yaxt="n", ylab="", xlab="")
# LOGNORMAL DISTRIBUTION
# Calculate geometric mean and standard deviation
gM = exp(mean(log(v)))
gS = exp(sd(log(v)))
# Generate some random numbers
lognormal = rlnorm(1000, meanlog = log(gM), sdlog = log(gS))
# Plot a histogram
hist(lognormal, breaks=seq(-5,50,0.5), xlim=c(-5,20),
col="gold", border="white",
main="Lognormal", xlab="Values")
# Create a probability density values and add to plot
lognormY = dlnorm(x, mean = log(gM), sd = log(gS))
par(new=TRUE)
plot(x, lognormY, type = "l", xlim=c(-5,20), col="red", bty="n",
xaxt="n", yaxt="n", ylab="", xlab="")
dev.off()```
Now the randomly generated numbers from the normal distribution contain values that are negative, while in contrast the lognormal distribution produces values that are all above zero. This is quite a handy property for modelling, as there are occasions where data such as species abundances or total rainfall cannot be negative. If a normal distribution were used there would be the potential for illogical negative values to be randomly generated – which could cause merry chaos within a model!
So the take home message would seem to be that if your data should always be positive, then use a lognormal distribution rather than a normal distribution. This will prevent any chance of negative values being generated, and as the mean becomes larger and the standard deviation becomes smaller the lognormal distribution becomes identical to a normal distribution anyway.
Of course that is all well and good when you are modelling from your own data. But what if you want to use other published information that has been described in terms of an arithmetic mean and standard deviation rather than the geometric mean and standard deviation that you need for a lognormal distribution? Well, you can also estimate the geometric mean and standard deviation from the arithmetic mean and standard deviation. To demonstrate the following compares a lognormal distribution generated from some actual data and from a reported arithmetic mean and standard deviation.
```# Define some values to work with
v = c(2.49, 0.93, 4.08)
# Set up things for plotting
x = seq(-5, 20, 0.1)
png("example3.png", width=15/2.54, height=12/2.54,
res=100, units="in", pointsize=8)
par(oma=c(2,0,0,0), mar=c(3,3,2,0.5), mgp=c(2,0.55,0), mfrow=c(2,1))
# LOGNORMAL DISTRIBUTION FROM CALCULATED VALUES
# Calculate geometric mean and standard deviation
gM = exp(mean(log(v)))
gS = exp(sd(log(v)))
# Generate some random numbers
lognormal = rlnorm(1000, meanlog = log(gM), sdlog = log(gS))
# Plot a histogram
hist(lognormal, breaks=seq(-5,50,0.5), xlim=c(-5,20),
col="dodgerblue", border="white",
main="Lognormal calculated", xlab="Values")
# Create a probability density values and add to plot
lognormY = dlnorm(x, mean = log(gM), sd = log(gS))
par(new=TRUE)
plot(x, lognormY, type = "l", xlim=c(-5,20), col="red", bty="n",
xaxt="n", yaxt="n", ylab="", xlab="")
# LOGNORMAL DISTRIBUTION FROM ESTIMATED VALUES
# Calculate arithmetic mean and standard deviation
aM = mean(v)
aS = sd(v)
# Estimate the geometric mean and standard deviation
gEstM = aM / sqrt(1 + (aS / aM) ^ 2)
gEstS = exp(sqrt(log(1 + (aS / aM) ^ 2)))
# Generate some random numbers
lognormal = rlnorm(1000, meanlog = log(gEstM), sdlog = log(gEstS))
# Plot a histogram
hist(lognormal, breaks=seq(-5,50,0.5), xlim=c(-5,20),
col="gold", border="white",
main="Lognormal estimated", xlab="Values")
# Create a probability density values and add to plot
lognormY = dlnorm(x, mean = log(gEstM), sd = log(gEstS))
par(new=TRUE)
plot(x, lognormY, type = "l", xlim=c(-5,20), col="red", bty="n",
xaxt="n", yaxt="n", ylab="", xlab="")
dev.off()```
As can be seen, the two distributions are very similar. So while it would obviously be better to get the original data and base a lognormal distribution from a calculated geometric mean and standard deviation, if all that is available is a reported arithmetic mean and standard deviation, it should still be possible to produce a reasonable lognormal distribution for inclusion within a model.
References | 2,229 | 7,832 | {"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} | 3.65625 | 4 | CC-MAIN-2019-35 | latest | en | 0.873947 |
https://www.saintpeterandsaintpaulcatholicprimary.co.uk/blog/?pid=41&nid=10&storyid=83 | 1,624,485,248,000,000,000 | text/html | crawl-data/CC-MAIN-2021-25/segments/1623488540235.72/warc/CC-MAIN-20210623195636-20210623225636-00518.warc.gz | 879,820,609 | 7,270 | # 26.3.20
The answer to yesterday's riddle was a strait which is the small gap of water in the picture above. If you can find out the name of this particular strait, you'll get a prize when you come back to school.
Also, I've had a play on some of your fantastic Egyptian games. Well done, lots of details added.
English: Today, we need to see if you can use subordinating clauses in your everyday writing. I want you to use your poster you created on Tuesday and your jigsaws on Wednesday and rewrite a traditional tale of your choice using at least 10 subordinate clauses. I’m looking for at least a page worth of writing in your workbooks.
To challenge yourselves, mix up where you place your subordinate clause (before the main clause or after).
Tip: Traditional tales like: Red Riding Hood, Rumplestiltskin, Billy Goats Gruff etc
Maths: Investigate the flags using the link below. Answer the questions in your workbook.
https://nrich.maths.org/7749
Foundation 1 Science: As our current topic is Living things and their habitats, go into your garden and find where different animals live. Write up a report, with diagrams, describing and explaining what you have observed.Use the fact file template below to support.
Foundation 2 Times Tables: Log on to ttrockstars and play garage mode. Everybody is aiming to get to level 420. For those who are already there, you can play in an arena of your choice.
https://ttrockstars.com/ | 328 | 1,442 | {"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} | 2.5625 | 3 | CC-MAIN-2021-25 | longest | en | 0.913199 |
https://www.mql5.com/en/market/product/34296 | 1,548,129,022,000,000,000 | text/html | crawl-data/CC-MAIN-2019-04/segments/1547583826240.93/warc/CC-MAIN-20190122034213-20190122060213-00121.warc.gz | 866,487,662 | 13,644 | • Overview
• Reviews
• What's new
# EA assistance Martingale Manual
### PROFIT CALCULATIONS
Manual Trade floating minus \$ 1 x 30 pip = - \$ 30
The first EA transaction is floating minus \$ 2 x 20 pip = - \$ 40
The second EA transaction is floating minus \$ 4 x 10 pip = - \$ 40
Third EA transaction \$ 8 x 0 pip = + \$ 0
The fourth EA transaction is profit of \$ 16 x 10 pip = + \$ 160
Profit = -30 - 40 - 40 - 0 + 160 = profit + \$ 50
### PARAMETERS
1. StarLotManual this is the first manual lot you trade, used to calculate the next lot from EA
2. Multiplier Lot multiplication value
3. Distance distance EA will trade back from the previous price
4. AverageProfit Take profit all transactions
5. Comment Comment EA
Manual Martingale | Manual Averaging
No reviews
Version 2.20 2019.01.09
Version 2.0 2018.12.30
PROFIT CALCULATIONS
Manual Trade floating minus \$ 1 x 30 pip = - \$ 30
The first EA transaction is floating minus \$ 2 x 20 pip = - \$ 40
The second EA transaction is floating minus \$ 4 x 10 pip = - \$ 40
Third EA transaction \$ 8 x 0 pip = + \$ 0
The fourth EA transaction is profit of \$ 16 x 10 pip = + \$ 160
Profit = -30 - 40 - 40 - 0 + 160 = profit + \$ 50
PARAMETERS
Multiplier Lot multiplication value
Distance distance EA will trade back from the previous price
AverageProfit Take profit all transactions | 393 | 1,349 | {"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} | 3.328125 | 3 | CC-MAIN-2019-04 | latest | en | 0.618198 |
https://biology.stackexchange.com/questions/20869/premise-of-life-cycle-synchronization-between-predator-and-prey | 1,714,021,368,000,000,000 | text/html | crawl-data/CC-MAIN-2024-18/segments/1712297284704.94/warc/CC-MAIN-20240425032156-20240425062156-00524.warc.gz | 108,634,681 | 40,418 | # Premise of life cycle synchronization between predator and prey
While reading about the predator satiation hypothesis of the periodical cicadas' 13/17 year life cycles, I started wondering about its premise. By the way, I understand the math behind the prime number life cycle. 13 and 17, being prime numbers are only divisible by themselves and 1, and thus have as few divisors as possible. But my question is about the premise of why a predator would even want to synchronize its life cycle with a divisor of the prey's life cycle in the first place.
If the predator has a set life cycle, but its individuals are evenly distributed in regards to their development within that life cycle at any given time (for example there could be roughly even amounts of mature and immature predators at any given time), then what difference does the life cycle make? Here I am assuming that eating cicadas is most beneficial to a specific developmental stage of the predators, which is the only reason I can think of why there would be an advantage to this synchronization. By the way, is this even a correct assumption in regards to this hypothesis?
To be clear, my main question is why life cycle synchronizations between predator and prey matter when/if predators aren't all undergoing the same stages of their life cycles simultaneously.
edit: To be even more clear, I am asking what the benefits are to the predator to synchronize its life cycle with the prey (the cicadas, in my example).
My reference: Wikipedia says the following: *It was hypothesized that the emergence period of large prime numbers (13 and 17 years) was a predator avoidance strategy adopted to eliminate the possibility of potential predators receiving periodic population boosts by synchronizing their own generations to divisors of the cicada emergence period. Goles, E.; Schulz, O.; Markus, M. (2001). "Prime number selection of cycles in a predator-prey model". Complexity 6 (4): 33–38. doi:10.1002/cplx.1040.
I have interpreted "synchronizing their own generations to divisors..." to mean synchronizing the length of the life cycle. I am happy to hear of another interpretation.
• Thanks for your edits. I've updated my answer. I hope it proves a bit more satisfactory than my first attempt. Aug 29, 2014 at 21:17
New Answer, based on first comment by user2686410 and subsequent edits to the question.
I have interpreted "synchronizing their own generations to divisors..." to mean synchronizing the length of the life cycle. I am happy to hear of another interpretation.
First, the overall goal of Goles et al. (2001) does not seem to test hypotheses related to the evolution of life cycles in the cicadas per se. It seems their overall goal instead may have been to explore the generation of prime numbers from numerical theory, using biologically-based models. For example, from the abstract they state,
The model marks an encounter of two seemingly unrelated disciplines: biology and number theory. A restriction to the latter, provides an evolutionary generator of arbitrarily large prime numbers.
and at the end of the discussion they write,
Although there are traditional methods for prime number detection (see e.g., Ref. 23) that are faster than the methods presented here, it is remarkable that the generation of prime numbers can be performed using a biological model.
To more directly address your question and if I understand their models, Goles et al. (2001) do seem to allow the the life cycles of both predators and prey to co-evolve yet this is not always clear.
We compare now a prey mutating to a cycle Y' with the resident prey (cycle length Y ) at constant X. Analogously, we compare mutant cycles X' with resident cycles X at constant Y (Goles et al. 2001, pg. 34; emphasis added).
Here, they seem to be saying that the life cycle of one (predator or prey) can change while other other remains constant (prey or predator). The life cycles don't coevolve. Subsequent formulas and statements imply an interactive effect between the predator and prey life cycles. (Honestly, their writing is somewhat opague to me and they do not define all of their mathematical terms, making it difficult to follow the logic of their models.)
Regardless, the results of their initial models, shown in the figure below, shows the prey converging on a 17 year life cycle while the predators converge on a 4 year cycle. Somewhat more complex models tended to converge on 13 and 17 year cycles, although other primes like 11, 19 and 23, had similar probabilities of evolving.
Goles et al. (2001) admit at the outset of their paper that there is no evidence for predators with periodical cycles that align with the life cycles of cicadas. This would be consistent with general ecological observations. Most predators consume multiple prey items. Highly specialized predators would be more vulnerable to extinction if their prey source went extinct.
Another numerical model, developed by Tanaka et al. (2009) explicitly to explore life cycle evolution of cicadas, does not include predator life cycles at all. Their results still converge on 13 and 17 year life cycles although they restricted the possible range of life cycles to between 10 and 20 years. Thus, it does not appear to be necessary for predators to evolve a life cycle that coincides with prey life cycles for the predator satiation hypothesis to work. Of course, this is consistent with the real world observations that cicadas do not appear to have predators with concommitant life cycles.
Original answer, lightly edited
In the case of the cicadas, they are the prey, not the predators. They are not synchronizing their life cycles with the predators (if I am interpreting your entire question correctly). The argument is that cicadas have evolved synchronized life cycles to maximize survivorship. By having a large number of individuals emerge within a very short period of time, the very high density means most individuals will live long enough to reproduce because the predators (birds, small rodents, etc.) will be satiated (see Williams and Simon 1995 for a review and pointers to early literature). Some predators of cicadas will be always present so the cicadas are not synchronizing to any specific predator.
Goles et al. (2001) used numerical models to argue that such life cycles will tend to converge on prime numbers. (As discussed in the update above)
Tanaka et al. (2009) recently argued, again using numerical models, that the prime number-based life cycles of cicadas evolved as a result of the Allee effect. The Allee effect basically states that there is a positive association between the fitness of individuals in the population and the population size or density. Below a certain size, a population is unable to sustain itself and is vulnerable to extinction. Tanaka et al. argue that the Allee effect results in prime-based life cycles under varying environmental parameters. They further argue that maintenance of alternate life cycles minimize hybridization between groups with different life cycle timings.
What seems to really remain to understand the evolution of cicada life cycles is to unravel the genetic mechanisms involved with timing.
Literature Cited
Goles, E. et al. 2001. Prime number selection of cycles in a predator-prey model. Complexity 6: 33-38.
Tanaka, Y. et al. 2009. Allee effect in the selection for prime-number cycles in periodical cicadas. Proceedings of the National Academy of Sciences USA 106: 8975-8979.
Williams, K.S. and C. Simon. 1995. The ecology, behavior, and evolution of periodical cicadas. Annual Reviews of Entomology 40: 269-295.
• I am not sure where you read that I said cicadas were predators. I was referring to the life cycle of the predators of the cicadas, and its synchronization with the life cycle of the cicadas. At one point I even mentioned "eating cicadas." Thanks for your links, though. It looks like the models needed to explain this aren't as simple as I thought they might be. Aug 29, 2014 at 17:28
• @user2686410 - Sorry, I completely overlooked that phrase in your question. I interpreted sentences like "If the predator has a set life cycle..." in light of the cicada life cycle, which is why I thought you were thinking of cicadas as the predator. Later this evening, I'll try to edit my answer to better suit your question. Aug 29, 2014 at 18:01
• @user2686410 - would you please provide a citation you found that suggests the predators are synchronizing to their prey, especially for interpreting the predator satiation hypothesis. I'm interpreting your question in light of that hypothesis. However, no predator has synchronized it's life cycle to the cicadas (that I am aware of). Aug 29, 2014 at 18:07
• OK - I have added a reference to my question. Aug 29, 2014 at 18:16
• @user2686410 You're welcome. I hope you found it useful. Sep 3, 2014 at 16:51
Mike Taylor's answer is well-researched and inspired the following thought experiment that might help you.
Imagine a predator of the cicada which takes several years to reach maturity(say, five). The population of this predator is distributed evenly across all the different stages of its life cycle, at least at first.
One year there is a cicada eruption and all the members of this predator species are incredibly well-fed for a month or two. If the effects of this prey glut aren't perfectly evenly spread across all ages of the predator species, there will be a fitness advantage to one age group or another. Maybe the young ones grow faster, or the old ones spend more time looking for mates instead of eating. It doesn't matter which(it can even be both) as long as it's not even across all members of the predator species.
Now examine the next generation, five years down the line. The effects of the prey glut are felt here too (more parents-> more children, bigger parents->stronger children, etc etc). If the cicada cycle is five years, or even ten, every predator generation(or every other generation) that coincides with the cicada eruption gets a fitness/population bump. After many iterations, the age group of predators that matures or spawns or whatever in time to get the maximal benefit from the cicada eruption dominates. Instead of evenly distributed age ranges, you get a big group of predator species that are synced up to benefit optimally from the cicada eruptions, which is bad news for the cicadas.
The thing that regulates the predator life cycle length is the time to sexual maturity, or the generation time. If this is a factor of the cicada hibernation time, cycles develop and the cicadas are in trouble. If the cicadas use a large prime number, the number of cicada generations between matching predator generations is very large. (a five year predator cycle and 17 year cicada cycle only overlap once every 85 years.) For every predator generation that benefits optimally from the cycle, 17 of them have to live without the benefit.
Generally speaking taking a long time to reach sexual maturity is bad news for a predator species(all other things being equal), so no species to my knowledge has evolved to sync up its generations with the cicadas.
• Thank you! Very helpful and reasonable sounding explanation. Aug 30, 2014 at 15:57 | 2,411 | 11,289 | {"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} | 2.65625 | 3 | CC-MAIN-2024-18 | latest | en | 0.940817 |
http://openmx.psyc.virginia.edu/thread/998 | 1,454,912,014,000,000,000 | text/html | crawl-data/CC-MAIN-2016-07/segments/1454701152959.66/warc/CC-MAIN-20160205193912-00331-ip-10-236-182-209.ec2.internal.warc.gz | 164,392,448 | 8,687 | ## BASIC Question about running ACE model
5 replies [Last post]
Offline
Joined: 05/26/2011
Hello!,
I have prepared a script to compute a factor model (path diagram for Phillips and Fulker model ) of phenotypes of parents and twin children given by Neale.
I get an error message indicating the following sentence:
+ mxAlgebra( expression= (A%*%(S%*%t(C)))+(C%*%(t(S)%*%t(A))), name="J" ),
# MZ Twin
+ mxAlgebra( expression= (A%&%G%)+(C%&%R%)+J+(N%*%t(N)), name="U1" ),
Error: unexpected '&' in:
"mxAlgebra( expression= (A%*%(S%*%t(C)))+(C%*%(t(S)%*%t(A))), name="J" ),
mxAlgebra( expression= (A%&%G%)+(C%&"
> mxAlgebra( expression= H%x%(A%&%(G+H%x%(T%&%(t(D)+D)))+(C%&%R)+J+((H%x%H)%x%(N%*%t(N))), name="V" ),# DZ Twin
Error: unexpected ',' in "mxAlgebra( expression= H%x%(A%&%(G+H%x%(T%&%(t(D)+D)))+(C%&%R)+J+((H%x%H)%x%(N%*%t(N))),"
>
> # Algebra - Constraints
> #===========================================================
># Phenotypic Variance constraint
> mxAlgebra( expression= A&G+C&R+E%*%t(E)+A%*%S%*%t(C)+C%*%t(S)%*%t(A)+N%*%t(N), name="Z1" )
Error: unexpected ',' in "mxAlgebra( expression= A&G+C&R+E%*%t(E)+A%*%S%*%t(C)+C%*%t(S)%*%t(A)+N%*%t(N), name="Z1" ),"
> mxConstraint(as.mxMatrix(P)==as.mxMatrix(Z1)),
Error: unexpected ',' in "mxConstraint(as.mxMatrix(P)==as.mxMatrix(Z1)),"
========================================================= FIN
I think that the following operations are supported in mxAlgebra:
t( ), %*%, %x% and %&%.
Can the openMx team give me some advice ? Thank you in advance! :-)
Best Regards,
Maikol
Offline
Joined: 07/31/2009
There are extra '%'
There are extra '%' characters following the 'G' and 'R' in `(A%&%G%)+(C%&%R%)`
Offline
Joined: 05/26/2011
basic question
Thank very much!
Offline
Joined: 07/31/2009
R is case-sensitive. T(M) is
R is case-sensitive. T(M) is not the same as t(M).
Offline
Joined: 05/26/2011
Hi, Thank very much! I have
Hi,
Thank very much!
I have another basic question.
The rawData is generated "every run" using the multivariate normal function. However,
I get an error message indicating the following sentence:
Running ACEN
Error: The job for model 'ACEN' exited abnormally with the error message: Expected covariance matrix is not positive-definite in data row 169 at iteration 0.
> summary(twinACENFit)
Error in summary(twinACENFit) :
error in evaluating the argument 'object' in selecting a method for function 'summary': Error: object 'twinACENFit' not found
Any help will be appreciated!
Anyone could tell me what happened?
###********************** The RawData will be generated using the multivariate normal function
require(OpenMx)
require(MASS)
set.seed(200)
rs=.7
n1<-500
n2<-n1/2
n3<-n2+1
xy <- mvrnorm (n1, c(0,0), matrix(c(1,rs,rs,1),2,2))
wy <- mvrnorm (n1, c(0,0), matrix(c(1,rs,rs,1),2,2))
data<-cbind(xy,wy)
Vars<- c('lbmip1','lbmim1', 'lbmi8T1', 'lbmi8T2')
dimnames(data) <- list(NULL, Vars)
mzData <-data[1:n2,]
dzData <-data[n3:n1,]
dimnames(mzData) <- list(NULL, Vars)
dimnames(dzData) <- list(NULL, Vars)
#=====================================================================
#
#Fit ACEN Model with RawData input and Matrices style (multivariate)
#
# -----------------------------------------------------------------------
twinACENModel <- mxModel("ACEN",
#===========================================================
# Matrices & Model Parameters
#===========================================================
mxMatrix( type="Full", nrow=2, ncol=2, free=TRUE, values=c(.41,.42,.39,.38), name="D" ), # assortive mating delta paths
mxMatrix( type="Symm", nrow=2, ncol=2, free=TRUE, values=.5, name="P" ), # within person covariance (Rp)
mxMatrix( type="Lower", nrow=2, ncol=2, free=TRUE, values=c(.41,.42,.39), name="A" ), # additive genetic paths
mxMatrix( type="Lower", nrow=2, ncol=2, free=TRUE, values=c(.41,.42,.39), name="C" ), # common environment paths
mxMatrix( type="Full", nrow=2, ncol=2, free=TRUE, values=c(.41,.42,.39,.38), name="F" ), # paternal cultural transmission
mxMatrix( type="Full", nrow=2, ncol=2, free=TRUE, values=c(.41,.42,.39,.38), name="M" ), # maternal cultural transmission
mxMatrix( type="Symm", nrow=2, ncol=2, free=TRUE, values=.5, name="G" ), # additive genetic covariance (Ra)
mxMatrix( type="Full", nrow=2, ncol=2, free=TRUE, values=c(.41,.42,.39,.38), name="S" ), # A-C covariance
mxMatrix( type="Symm", nrow=2, ncol=2, free=TRUE, values=.45, name="R" ), # common environmental covariance (Rc)
mxMatrix( type="Lower", nrow=2, ncol=2, free=TRUE, values=c(.41,.42,.39), name="E" ), # specific enviromental paths
mxMatrix( type="Lower", nrow=2, ncol=2, free=F, values=0, name="N" ), # non-additive paths # drop at 0
mxMatrix( type="Full", nrow=1, ncol=1, free=F, values=.5, name="H" ), # scalar
mxMatrix( type="Iden", nrow=2, ncol=2, free=F, name="I" ), # Identity matrix
mxMatrix( type="Iden", nrow=2, ncol=2, free=F, name="B" ), # common env residual variance - Identity matrix
mxMatrix( type="Full", nrow=1, ncol=8, free=T, values=1,
label="mean", name="expMean" ), # Exp Means
# Algebra - Covariance Matrices
#===========================================================
mxAlgebra( expression= P%*%D%*%t(P), name="W" ), # Mother-Father covariance
mxAlgebra( expression= G%*%t(A), name="GA" ),
mxAlgebra( expression= S%*%t(C), name="SC" ),
mxAlgebra( expression= GA+SC, name="T" ), # Mother-Child Covariance
mxAlgebra( expression= (P%*%t(F)+ W%*%t(M))%*%t(C), name="O1" ),
mxAlgebra( expression= (I+P%*%t(D))%*%t(T)%*%(H%x%t(A)), name="O2" ),
mxAlgebra( expression= O1+ O2, name="O" ), # Father-Child Covariance
mxAlgebra( expression= (P%*%t(M)+W%*%t(F))%*%t(C), name="Q1" ),
mxAlgebra( expression= Q1+O2, name="Q" ), # Mother-Child Covariance
mxAlgebra( expression= (A%*%(S%*%t(C)))+(C%*%(t(S)%*%t(A))), name="J" ),
mxAlgebra( expression= (A%&%G), name="AG" ),
mxAlgebra( expression= C%&%R, name="CR" ),
mxAlgebra( expression= N%*%t(N), name="NN" ),
mxAlgebra( expression= AG+CR+J+NN, name="U1" ), # MZ Twin
mxAlgebra( expression= t(D)+D, name="DD" ),
mxAlgebra( expression= (T%*%DD)%*%t(T), name="TDD" ),
mxAlgebra( expression= H%x%(A%&%(G+H%x%TDD))+CR+J+((H%x%H)%x%NN), name="V1" ),
mxAlgebra( expression= ((H%x%H)%x%NN), name="V2" ),
mxAlgebra( expression= V1+CR+J+V2, name="V" ), # DZ Twin
# Algebra - Constraints
#===========================================================
mxAlgebra( expression=U1+E%*%t(E), name="Z1" ), # Phenotypic Variance constraint
mxConstraint(P==Z1),
mxAlgebra( expression=TDD%*%t(T), name="Z3" ),
mxAlgebra( expression=H%x%(G+(H%x%Z3)+I) , name="Z2" ), # Genetic constraint
mxConstraint(G==Z2),
mxAlgebra( expression=H%x%T%*%(t(M)+t(F)+D%*%P%*%t(M)+t(D)%*%P%*%t(F)) , name="Z3" ), # A-C constraint
mxConstraint(S==Z3),
mxAlgebra( expression=M%*%P%*%t(M), name="MM" ),
mxAlgebra( expression=F%*%P%*%t(F), name="FF" ),
mxAlgebra( expression=(M%*%W%*%t(F))+(F%*%t(W)%*%t(M))+B , name="RES" ),
mxAlgebra( expression=MM+FF+RES , name="Z4" ), # Common Environment Constraint
mxConstraint(R==Z4),
# MZ & DZ TWINS AND PARENTS
#=================================================================
mxAlgebra( expression= rbind( cbind(P, t(W), O, O),
cbind(W, P, Q, Q),
cbind(t(O), t(Q), P, U1),
cbind(t(O), t(Q), t(U1), P)), name="expCOVMZP"),
mxAlgebra( expression= rbind( cbind(P, t(W), O, O),
cbind(W, P, Q, Q),
cbind(t(O), t(Q), P, V),
cbind(t(O), t(Q), t(V), P)), name="expCOVDZP"),
# Objective function
#===============================================================
mxModel("MZ",
mxData( observed=mzData, type="raw" ),
mxFIMLObjective( covariance="ACEN.expCOVMZP", means="ACEN.expMean", dimnames=c('lbmip1', 'lbmip1', 'lbmim1', 'lbmim1', 'lbmi8T1', 'lbmi8T1', 'lbmi8T2','lbmi8T2') ) ),
mxModel("DZ",
mxData( observed=dzData, type="raw" ),
mxFIMLObjective( covariance="ACEN.expCOVDZP",means="ACEN.expMean", dimnames=c('lbmip1', 'lbmip1', 'lbmim1', 'lbmim1', 'lbmi8T1', 'lbmi8T1', 'lbmi8T2','lbmi8T2') ) ),
mxAlgebra( expression=MZ.objective + DZ.objective, name="twin" ),
mxAlgebraObjective("twin")
)
#===========================================================
# run THE ACEN MODEL
#==========================================================
twinACENFit <- mxRun(twinACENModel)
summary(twinACENFit)
Offline
Joined: 07/31/2009 | 2,840 | 8,210 | {"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} | 2.5625 | 3 | CC-MAIN-2016-07 | longest | en | 0.70558 |
https://www.taxtim.com/za/blog/how-do-the-medical-rebates-work | 1,490,350,648,000,000,000 | text/html | crawl-data/CC-MAIN-2017-13/segments/1490218187792.74/warc/CC-MAIN-20170322212947-00113-ip-10-233-31-227.ec2.internal.warc.gz | 967,397,237 | 7,147 | Hide
Earn under R350,000? Click here to see why you still need to file to get your Tax Refund.
CLOSE
Get Tax Deadline Reminders, News and Tips
We'll tell you when you need to file, along with tax tips and updates.
# How do the medical rebates work?
Posted 9 February 2013 under Tax Questions
### Blog Categories
I was wondering if u can maybe assist me.
I?%u20AC%u2122m studying payroll and sars returns, I have an old text book with the old medical aid rates of 720 & 440. I hav a question where I have to calculate the taxable value of medical aid. The question reads, The following tax rebates apply to medical fund contributions: R230 for sole member, R230 for first additional dependent, an additional R154 is allowed as a REBATE for each additional dependent other than the first dependant.
Question: G.Snel(49) has 4 dependants and his monthly contribution paid to medical aid is R3961. Calculate his taxable value of medical aid?
This entry was posted in Tax Questions and tagged , , , . Bookmark the permalink.
TaxTim says:10 February 2013 at 22:43 The old textbook refers to the deductions up until the 2012 year. For 2013 and beyond there is a new regime whereby a pure tax credit is given. So instead of there being a deduction before taxable income is calculated, the credit is given against the actual tax payable. So to answer the question, which I must admit is ambiguous as the whole value would be taxable, just dependent on the regime. 1. So 2 x R230 x 12 3 *R154 x 12 = R11 064 would be allowed as a tax credit each year. 2. If the tax credits (230 230 154 154 154) in this case multiplied by 4 is greater than the monthly contribution then this difference would be allowed as a deduction provided this difference exceed the 7.5% threshold of the taxpayers taxable income.
Get Tax Deadline Reminders, News and Tips
We'll tell you when you need to file, along with tax tips and updates. | 460 | 1,916 | {"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} | 2.5625 | 3 | CC-MAIN-2017-13 | latest | en | 0.959133 |
https://physics.stackexchange.com/questions/356536/electric-potential-vs-induced-emf | 1,717,101,192,000,000,000 | text/html | crawl-data/CC-MAIN-2024-22/segments/1715971670239.98/warc/CC-MAIN-20240530180105-20240530210105-00871.warc.gz | 387,921,767 | 43,532 | Electric potential vs induced emf
Suppose we have a changing magnetic field in the $z$ direction and a conductive ring of radius r inside the magnetic field lying in the $xy$ plane. Then we have an induced emf: $$ε= -{{dΦ} \over {dt} }$$
This emf causes a current along the conductor-ring: $I = \frac{ε}{R}$ , R its resistance. (1)
However we know that all points inside a conductor have the same electric potential. (2)
How can both (1) and (2) be true?
Some thoughts:This is a pure Faraday field and the induced electric field is of course not conservative. So how can there even be a potential? If $E$ is not conservative then we can't write $E=- \nabla V$ , right? However we do have some sort of potential from which we get E: the emf. What's the difference between the induced emf and the electric potential?
Also: what would happen if I cut the ring at one point? Would I have potential difference between the 2 ends?
• Hopefully, someone comes along with a more complete answer, but I think that there only exists a potential V such that E= - grad(V) for the case of electrostatics. The situation you described doesn't fall into that category. See en.wikipedia.org/wiki/Electric_potential and look at the sections on "Electrostatics" and "Generalization to electrodynamics".
– user93237
Sep 10, 2017 at 23:17
• This is why EMF is distinct from electric potential. Sep 10, 2017 at 23:43
You're right. When you have a conservative $E$ field, you can define an electric potential $V$. And when you don't, you can't define such a potential (just as you can't define a potential energy $U$ for a nonconservative force $F$ - nonconservative forces still do work - but there is no associated potential energy function for such forces).
General Remarks
Electric potential is measured in volts and defined by $$V(x) = -\int_{\mathcal{O}}^x \vec{E}\cdot d\vec{l} \tag{1}$$ A voltage is defined by (in the textbooks) as a difference in potential $$\Delta V = V_b - V_a = -\int_a^b \vec{E}\cdot d\vec{l} \tag{2}$$
However this is too restrictive. In general, anything that takes the form $$\int \frac{\vec{F}}{q}\cdot d\vec{l} \tag{3}$$ can be called voltage and is measured in volts. So yes $\text{(2)}$ above is a voltage and even $\text{(1)}$ is a voltage if you like (as $V(x)$ is secretly $V(x) - V(\mathcal{O}) = V(x) - 0$ and therefore a difference in potential). But note that $\vec{F}$ can be anything. It doesn't have to be a conservative electric force. Again, anything that takes the form of $\text{(3)}$ is measured in volts and can be called a voltage. EMF takes the form $\text{(3)}$ [I explain this further down]. So too does potential difference. This is one reason why EMF and potential difference get mixed up: they take similar forms and hence both are measured in volts and can be called voltage (or induced voltage or whatever). And actually, this is great. If you are doing anything in the lab or talking to engineers, it doesn't really matter whether voltage means potential difference or EMF. It does, but all we really care about is energy. Voltage (equation $\text{(3)}$)is energy. EMF and potential difference/potential are energy. Energy is energy, whether it be EMF or potential difference. Voltage is just a general term for energy. If you are ever in a situation where you don't know whether to say "the EMF is 5 volts" or the "potential difference is 5 volts", just say "5 volts" or "the voltage/induced voltage/whatever is 5 volts" and you are safe.
What is EMF
In order to get current to flow around a circuit, you need some force pushing charges around the wire. Let's call this the driving force $\vec{F}$. EMF $\mathcal{E}$ is defined as
$$\mathcal{E} = \oint \frac{\vec{F}}{q}\cdot d\vec{l} \tag{4}$$ where the integration is taken around the loop. There are two main forces that drive current around a circuit: a "source" force from say a battery and a conservative electric field which pushes charges around the wire. $\vec{F} = \vec{F}_s + q\vec{E}$. Therefore, $\text{(4)}$ can be written
$$\mathcal{E} = \int_a^b \frac{\vec{F}_s}{q}\cdot d\vec{l}$$ as $\vec{F}_s$ is usually confined to a section of the loop and $E$ is conservative so it integrates to 0 (started where we left off - once around the loop). $\vec{F}_s$ can be anything. It can be a chemical force, some temperature gradient thing, pressure on a crystal, a magnetic force, a nonconservative $E$ field, etc. So consider a battery. A conservative electric field goes from the positive terminal, around the loop, to the negative terminal, as well as from the positive terminal to the negative terminal inside the battery. Using the last equation, assuming the battery is ideal so that the chemical force is equal and opposite to the electric force,
$$\mathcal{E} = \int_a^b \frac{\vec{F}_{\text{chemical}}}{q}\cdot d\vec{l} = -\int_a^b \vec{E}\cdot d\vec{l} = V$$ The EMF of the battery is equal to the potential difference across its terminals. But this does not mean that EMF is potential difference. It just happens to be so in this case. Most simple circuits turn out to be this way but realize again that EMF and potential difference are totally different. In the first place, you can't have a potential difference without an EMF generating that separation of charge in the battery. EMF generates a potential difference that happens to match the numerical value of the EMF (which you can think of as energy conservation). Then if you have a resistor connected to this battery, current $I = V/R$. I could also say $I = \mathcal{E}/R$ as they are numerically equivalent. But it's more appropriate in my opinion to use $I = V/R$ as the energy drop is coming as electric potential energy in a conservative $E$ field (which exists throughout the wire doing the pushing). Here we begin to see, as in the next section, that All circuits require an EMF to function.
There is no such thing as an electric potential in your example. There's an $E$ field, but it's not conservative. Therefore, don't say potential. There is an EMF however. You can say there's a voltage or an induced voltage if you like (from the above discussion). But there's definitely not a potential difference/potential present. For this specific example, the EMF is given by
$$\mathcal{E} = -\frac{d\phi}{dt} = \oint \vec{E} \cdot d\vec{l}$$ where the driving force is that nonconservative $E$ field. The current as you say is $I = \mathcal{E}/R$. Here again we see a true instance of the following: all circuits require an EMF. The idea that all points in a conductor are at the same potential is equivalent to saying that there is no $E$ field in a conductor. Note that this idea of there being no $E$ field in a conductor only holds for electrostatics + no time varying external magnetic fields (having a time varying $B$ prevents electrostatics anyways so saying "+ no time varying $B$" was redundant). Having an $E$ field in a conductor is completely fine. Turn on an $E$ field in a conductor. There is definitely an $E$ field in the conductor until electrostatics is reached. This is why conducting wires in simple circuits can have $E$ fields in them. This $E$ field is essential for driving current around even though it's through a conductor. It's just that the conductor can never reach electrostatics when it's part of a circuit. It desperately tries, but the battery prevents the wire from coming to a static situation. And with time-varying $B$ fields, nothing wrong with having an $E$ field in a conductor. When you stop varying $B$, you'll stop changing the $E$ field and things will reach statics. While you are changing the $B$ field, $E$ is changing with time. The conductor is trying to reach statics, but can never do so. So there will always be an $E$ present and hence the conductor won't be an equipotential (albeit, in simple circuits, you can take the wires to be equipotentials because $E$ is so so tiny).
Too Much Theory, What to know about EMF
From equation $\text{(4)}$, because of the closed line integral, EMF does not care about conservative forces while electric potential crucially depends on a conservative E field. EMF and potential are both instances of equation $\text{(3)}$, and therefore both tell you about energy. Potential is energy in a conservative E field. EMF is energy added to your circuit through "nonconservative" driving forces. In order for circuits to work, you need to pump energy into them so that charges will flow back down to low energy, making a circuit. EMF tells you how much energy driving forces give to a unit charge in one trip around the loop. Conservative forces don't give any net energy to a charge after one complete loop (started where you stopped). "Nonconservative" forces will give you some nonzero value to equation $\text{(4)}$. EMF tells you how much energy was added by driving forces and hence how much energy must be dropped by dissipative/"friction" forces in one trip around the loop. An EMF of 5 volts means 5 volts must be dropped by every unit of charge. If you have a battery providing 2 volts of EMF and a changing magnetic field providing 6 volts of EMF, 8 volts must be dropped
[by the way, If you ever see an example circuit out there with both a battery and a changing flux enclosed by the loop, more than likely their derived equations have wrong explanations. Right equation. Wrong explanation (which is basically just as bad as not knowing what you are doing). What they do is say $-d\phi/dt = \oint \vec{E}\cdot d\vec{l}$. This is Faraday's Law, true in anycase. But what actually does that $\vec{E}$ mean? It's the net $E$ field on your loop. In the case of a battery and a changing flux, that $E$ has both a conservative and a nonconservative component. The conservative component integrates to zero, leaving only the nonconservative $E$ providing the $-d\phi/dt$. Therefore, if you have this simple battery + changing flux + resistor circuit, $-d\phi/dt = I_{\phi}R$ where $I_{\phi}R$ is the integral of nonconservative $E$ around the loop. Now we can add a constant to each side of the equation. Since EMF battery $V_0 = I_0R$, we can say $V_0 - d\phi/dt = (I_{\phi} + I_0)R = IR$. Or if you want, you can write out $-d\phi/dt = I_{\phi}R + \oint \vec{E}_{\text{conserv}} \cdot d\vec{l} = I_{\phi}R - V_0 + I_0R$].
• The topic of self-inductance has confused me for a while. This post helps alot since it answers one of my biggest doubts on induced emf. However, one thing I was not able to understand was the non-electrostatic component of the Field. Upon taking the line integral of the non-electrostatic component and dividing it by resistance we get the current flowing in the loop. But isn't this result (ohms law) only applicable to POTENTIAL drop and not emf. Feb 18, 2020 at 18:29
Wasn't sure if this should just be a comment but relevant and lengthy.
You can apply a potential to the problem, but not the electric potential.
There's a theorem that for any vector field whose divergence is zero in all space, there exists a vector field who's curl is the first field. Given Gauss' Law for magnetic fields then:
$$\nabla \cdot \vec{B}=0 \implies \vec{B}=\nabla \times \vec{A}$$
Where $$\vec{B}$$ is the magnetic field and $$\vec{A}$$ is the Vector or Magnetic Potential.
With Maxwell's Laws and vector identities, it can be shown that $$\vec{E}=-\frac{\partial \vec{A}}{\partial t}$$
By definition $$\Phi_B=\int\vec{B}\cdot\hat{n}dA$$ where $$\hat{n}$$ is the unit normal to the surface contained by the current loop, and $$dA$$ is an infinitesimal area element.
But $$\vec{B}=\nabla\times \vec{A}$$. By Stoke's Theorem: $$\Phi_B=\int (\nabla \times \vec{A})\cdot \hat{n} \ dA=\int \vec{A}\cdot \vec{dl}$$.
$$- \frac{d\Phi_B}{dt}=\int \frac{-\partial\vec{A}}{\partial t}\cdot \vec{dl}=\epsilon$$
So we have an EMF anywhere we have a time varying Vector Potential. Further, we can calculate this EMF using a Line Integral,convenient for certain geometries. It's no coincidence the integrand we have is equivalent to the Electric Field. A non-zero line integral around a loop directly implies a non-conservative Vector Field is in play. | 3,131 | 12,143 | {"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": 10, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0} | 3.390625 | 3 | CC-MAIN-2024-22 | latest | en | 0.939013 |
https://www.manualslib.com/manual/359091/Hp-F2226a-48gii-Graphic-Calculator.html?page=574 | 1,571,210,183,000,000,000 | text/html | crawl-data/CC-MAIN-2019-43/segments/1570986666467.20/warc/CC-MAIN-20191016063833-20191016091333-00478.warc.gz | 1,013,441,345 | 60,470 | # HP F2226A - 48GII Graphic Calculator User Manual Page 574
Graphing calculator.
Definitions
The definitions used for these quantities are the following:
Suppose that you have a number data points x
different measurements of the same discrete or continuous variable x. The set
of all possible values of the quantity x is referred to as the population of x. A
finite population will have only a fixed number of elements x
represents the measurement of a continuous quantity, and since, in theory,
such a quantity can take an infinite number of values, the population of x in
this case is infinite.
If you select a sub-set of a population, represented by
the n data values {x
, x
1
2
of x.
Samples are characterized by a number of measures or statistics. There are
measures of central tendency, such as the mean, median, and mode, and
measures of spreading, such as the range, variance, and standard deviation.
Measures of central tendency
The mean (or arithmetic mean) of the sample, x, is defined as the average
value of the sample elements,
The value labeled
Total
values of x, or Σx
= n⋅x. This is the value provided by the calculator under
i
. Other mean values used in certain applications are the
Mean
geometric mean, x
, or the harmonic mean, x
g
x
g
Examples of calculation of these measures, using lists, are available in
Chapter 8.
The median is the value that splits the data set in the middle when the
elements are placed in increasing order. If you have an odd number, n, of
ordered elements, the median of this sample is the value located in position
, ..., x
}, we say you have selected a sample of values
n
1
n
x
x
.
i
n
i
=
1
obtained above represents the summation of the
, defined as:
h
x
x
L
x
,
n
1
2
n
, x
, x
, ..., representing
1
2
3
. If the quantity x
i
1
1
n
.
x
x
i
=
1
h
i
Page 18-3 | 495 | 1,814 | {"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} | 3.796875 | 4 | CC-MAIN-2019-43 | latest | en | 0.893697 |
https://www.know.cf/enciclopedia/en/Brahmi_numerals | 1,558,624,018,000,000,000 | text/html | crawl-data/CC-MAIN-2019-22/segments/1558232257259.71/warc/CC-MAIN-20190523143923-20190523165923-00026.warc.gz | 857,699,405 | 7,636 | Brahmi numerals
Evolution of Brahmi numerals from the time of Ashoka.
The number "256" in Ashoka's Minor Rock Edict No.1 in Sasaram (circa 250 BCE).
Coin of Western Satrap Damasena (232 CE). The minting date, here 153 (100-50-3 in Brahmi script numerals) of the Saka era, therefore 232 CE, clearly appears behind the head of the king.
The Brahmi numerals are a numeral system attested from the 3rd century BCE (somewhat later in the case of most of the tens). They are the direct graphic ancestors of the modern Indian and Hindu–Arabic numerals. However, they were conceptually distinct from these later systems, as they were not used as a positional system with a zero. Rather, there were separate numerals for each of the tens (10, 20, 30, etc.). There were also symbols for 100 and 1000 which were combined in ligatures with the units to signify 200, 300, 2000, 3000, etc.
Origins
The source of the first three numerals seems clear: they are collections of 1, 2, and 3 strokes, in Ashoka's era vertical I, II, III like Roman numerals, but soon becoming horizontal like the modern Chinese numerals. In the oldest inscriptions, 4 is a +, reminiscent of the X of neighboring Kharoṣṭhī, and perhaps a representation of 4 lines or 4 directions. However, the other unit numerals appear to be arbitrary symbols in even the oldest inscriptions.[citation needed] It is sometimes supposed that they may also have come from collections of strokes, run together in cursive writing in a way similar to that attested in the development of Egyptian hieratic and demotic numerals, but this is not supported by any direct evidence. Likewise, the units for the tens are not obviously related to each other or to the units, although 10, 20, 80, 90 might be based on a circle.
Brahmi numerals signs of the 2nd century CE.
The sometimes rather striking graphic similarity they have with the hieratic and demotic Egyptian numerals, while suggestive, is not prima facie evidence of an historical connection, as many cultures have independently recorded numbers as collections of strokes. With a similar writing instrument, the cursive forms of such groups of strokes could easily be broadly similar as well, and this is one of the primary hypotheses for the origin of Brahmi numerals.
Another possibility is that the numerals were acrophonic, like the Attic numerals, and based on the Kharoṣṭhī alphabet. For instance, chatur 4 early on took a ¥ shape much like the Kharosthi letter ch; panca 5 looks remarkably like Kharosthi p; and so on through shat 6, sapta 7, and nava 9 (Kharosthi sh, s, n). However, there are problems of timing and lack of records. The full set of numerals is not attested until the 1st-2nd century CE, 400 years after Ashoka. Assertions that either the numerals derive from tallies or that they are alphabetic are, at best, educated guesses.
Other Languages | 709 | 2,871 | {"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} | 2.546875 | 3 | CC-MAIN-2019-22 | latest | en | 0.963105 |
http://mdct.ru/depreciation/depreciation-expense/ | 1,529,762,661,000,000,000 | text/html | crawl-data/CC-MAIN-2018-26/segments/1529267865081.23/warc/CC-MAIN-20180623132619-20180623152619-00364.warc.gz | 194,466,223 | 14,168 | # Depreciation Expense
A depreciation expense is required due to the reduction in value of a long term asset caused by its limited useful life.
Most long term assets (with the exception of land) have a limited useful life as a result of wear and tear and obsolescence and therefore depreciate over time.
Wear and tear or physical deterioration results from use. The asset can be kept in good working order by regular repairs and maintenance but ultimately it will have to be discarded and replaced.
Obsolescence is a consequence of changing technology. An asset such as a computer may not have worn out but may have gone out of date and need replacing due to technological changes.
In accounting, the depreciation expense is the allocation of the cost of the asset to the accounting periods over which it is to be used. The allocation is necessary to comply with the matching principle, ensuring that the expense of owning the asset is matched to the revenues generated by the asset.
An estimate of this depreciation expense is charged to the income statement each accounting period and represents an expense of the business.
## How to Calculate the Depreciation Expense
If for example, a business has purchased furniture with a value of 4,000 and expects it to have a useful life of 4 years and no salvage value, then the straight line depreciation expense would be calculated as follows:
```Depreciation expense = (Cost of fixed asset - Salvage value) / Useful life
Depreciation expense = (4,000 - 0) / 4 = 1,000
```
In this example the depreciable value is 4,000 and the depreciation expense is 1,000 per year for the next 4 years.
## Partial Year Depreciation Expense
The example above assumes that the business purchased the asset at the beginning of the accounting period and a full years depreciation expense (1,000) is calculated. If the business acquires the asset part way through the year it has two options:
1. Decide on a specific depreciation accounting policy, such as a full years depreciation expense will be charged in the year of acquisition.
2. or,
3. Pro rata the depreciation expense for the first year depending on the number of months the equipment was in use. Using the example above, suppose the equipment was acquired at the start of month 3, then it would have been in use for 9 months of the year, and the depreciation expense for the first year is calculated as 1,000 x 9/12 = 750.
In both cases the depreciation expense method should be applied consistently each accounting period.
## Methods of Depreciation
There are various methods used to calculate depreciation, but they generally fall into two categories.
### Straight Line Method
The straight line method depreciates the asset at a constant rate over its useful life. The depreciation charge will be the same for each accounting period. Further details on using the method can be found in our straight line depreciation tutorial.
### Accelerated Depreciation Methods
The accelerated depreciation method as the name implies, will accelerate the charge for depreciation by making the charge in the early years higher than the charge in the later years. There are various ways in which accelerated depreciation can be calculated including, declining balance, double declining balance, and sum of digits methods.
## Depreciation Expense Journal Entry
The depreciation expense is calculated at the end of an accounting period and is entered as a journal
Depreciation Expense
Account Debit Credit
Depreciation Expense 1,000
Accumulated Depreciation 1,000
Total 1,000 1,000
The first entry is the expense being recorded in the income statement, the second entry is to the accumulated depreciation account which is a contra asset account in the balance sheet.
The accumulated depreciation account is used as it reflects only an estimate of how much the asset has been used during the accounting period, and the asset account itself continues to show the original cost of the asset.
It is normal to group long term (fixed) assets into categories which have the same useful life (e.g. computer equipment might have a 3 year useful life) so that depreciation can be more easily calculated and recorded in the accounting records.
It is important to understand that although the charging of depreciation affects the net income (and therefore the amount equity attributable to shareholders) of a business, it does not involve the movement of cash.
Depreciation Expense September 20th, 2017
## Related pages
notes receivable vs accounts receivabledebtors turnover daysassets turnover formulasimple bookkeeping templateaccrual to cash worksheetpayback analysis exampleexamples of closing entriesformula to calculate variable costjournal voucher templateaccounts receivable divided by salesgeneral ledger templatenormal balance of accumulated depreciationbookkeeping entriesjournal entries examples accountingformula for direct materials usedmarkup sheetjournal entry for sale of assetloan repayment excel formulacalculate mirr onlineaccounting journal entries templatecredit sales journal entryentry for sale of fixed assetprepayment accountingproviding for doubtful accountsadjusting entrieaccounting ledgers templatesallowance to reduce inventory to marketcarriage outwardsadvertising expense journal entrygeneral ledger booksaccounts recievable ledgercalculate straight line depreciationchart of accounts for restaurantscost accounting fifo methodinventory perpetual methodmarkup and profitcash flow formula excelwhat is factoring in accountingsubsidiary general ledgera problem with the monetary unit assumption is thatyear end adjustments journal entriesaccrued salariessum of digits calculatorinventory turnover ratio calculatorprepaid rent expense journal entrycontribution margin and fixed costsdupont analysis calculatorjournal entry for common stock issuedexamples of prepaymentsdupont equation analysispmt calculator excelactivity ratios formulafinished goods produced formulamarkup calculation formuladebit credit accounting chartnet account receivable formulahire purchase accounting double entrycash replenishmentfixed overhead capacity varianceformula to calculate margin percentagebanking trivia questionsaccounting mcqs testretail markup calculatoroverhead variance formulagross margin vs contribution marginledger paper template download freeaccounting for accruals and prepaymentswhat is the pmt functionjournal entry for accrualexpanded basic accounting equationbalance sheet versus income statementdistinguish between trial balance and balance sheetpractise balancing equationsentry of prepaid expenseshow to calculate variable cost per unitnpv perpetuity | 1,278 | 6,679 | {"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} | 3.078125 | 3 | CC-MAIN-2018-26 | latest | en | 0.939131 |
http://www.cs.nyu.edu/pipermail/fom/2002-February/005181.html | 1,501,231,709,000,000,000 | text/html | crawl-data/CC-MAIN-2017-30/segments/1500549448146.46/warc/CC-MAIN-20170728083322-20170728103322-00594.warc.gz | 412,642,033 | 2,425 | # FOM: Re: RE: FOM Arbitrary Objects
charles silver silver_1 at mindspring.com
Tue Feb 5 07:27:57 EST 2002
```
> Greetings,
>
> Re (Charles Silver): "The trick is to make reasonable mathematical/logical
> sense of this notion [arbitrary object] using just the resources of
> first-order logic."
>
> Hilbert used the epsilon symbol to elucidate the notion of an arbitrary
> selection, which he axiomatized in the epsilon-calculus. Is this not
what
> respects is it deficient?
In my opinion, it is deficicient because for the epsilon-intantiation to
work, some particular element must always be plucked out of the range of
objects over which ExFx ranges. That is, an element having F must be
somehow obtained ("chosen") from all the F's. One deficiency, mentioned
early by Leisenring and credited to Carnap is that if F happens to be empty,
some *extra* object, outside the domain of all-objects, must be pressed into
service (F could turn out to be empty even though ExFx may appear as a line
of a proof). I regard all this as "unnatural" and "unintuitive."
Further, the theorems established on behalf of the epsilon calculus seem
overly technical and artificial--not natural at all. Moreover, and this I
think is the most relevant point to the questions I raised, there is no
indication that the element plucked out either of the range of Fs or
elsewhere is at all "arbitrary." It's just one of many, having no claim
whatever to arbitrariness. I know that there are other developments of H's
epsilon calculus, but to my knowledge the working out of it provided by
Leisenring is the most prominent. I am not that it isn't interesting, for
I think it is. I'm saying only that it doesn't seem to provide answers to
the questions I raised. Of course, one has to admit that some of its
popularity is that it's attached to a famous person. If Joe Blow had
invented it, we'd have no "Blow's epsilon calculus" at all.
I appreciate your reminding me of this. I know a person who's active
in Hilbert's epsilon research and have read a couple of papers on the topic
(besides looking at Leisenring's book).
Thanks,
Charlie
``` | 538 | 2,145 | {"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} | 2.515625 | 3 | CC-MAIN-2017-30 | latest | en | 0.957116 |
https://community.qlik.com/t5/QlikView-Layout-Visualizations/Calculate-Average-Dimensions/td-p/612054 | 1,547,705,694,000,000,000 | text/html | crawl-data/CC-MAIN-2019-04/segments/1547583658702.9/warc/CC-MAIN-20190117041621-20190117063621-00525.warc.gz | 480,113,039 | 48,048 | # QlikView Layout & Visualizations
Discussion Board for collaboration on QlikView Layout & Visualizations.
Not applicable
## Calculate Average Dimensions
I have a table as below
DateProduct%low sales
01/01/01abc95
01/02/01abc97
01/03/01abc98
01/04/01bcd85
01/01/01bcd80
01/02/01bcd65
01/03/01bcd70
I want to create a chart that will take an avg of low sales and categories them as high performance and low performance based on avg % low sales and give me a product count
So, eg. if avg(%low sales) >95, low performance, high performance)
I cannot seem to get avg calculation working in the Dimension to create these categories to classify my product as low or high... Please help.
7 Replies
Valued Contributor
## Re: Calculate Average Dimensions
In your Table you should have two Dimensions and two Expressions:
Dimensions (in this order):
Product
Date
Expressions (in this order):
AVG([%low sales])
if(AVG([%low sales]) > 95,'High Performance','Low Performance')
Hope this helps.
## Re: Calculate Average Dimensions
You can use this expression: if(avg(total <Product> [%low sales])>95,'low performance','high performance')
See attached example.
talk is cheap, supply exceeds demand
Contributor III
## Re: Calculate Average Dimensions
Hi
You need to specify the dimension to calculate averages. Please look at the first chart in example attached.
If you just want to categorize already existing %low sales, then look at the second chart. I used DUAL to have custom sort order for performance.
Hope this helps
Cheers
Darius
Not applicable
## Re: Calculate Average Dimensions
Hi Tim,
This was working but I need it the other way round, I need a chart that shows, High and low as dimension and a count of products that fall under each category
Not applicable
## Re: Calculate Average Dimensions
Hi Darius, this might work but not in the current form. you see I have a %low for all days in the past 30 days. for 1000's of products. I want to get an average for the month for each product and them classify the products as low performance or high.
In the table, I do not need date. When I remove the date from Dimensions the numbers are not right
Valued Contributor
## Re: Calculate Average Dimensions
Hmm the closest thing I could get was to have:
Dimensions (in this order):
Product
Date
Expressions:
Label: High Performance: If(AVG(total <Product> [%low sales])>95,Count(DISTINCT Product))
Label: Low Performance: If(AVG(total <Product> [%low sales])<=95,Count(DISTINCT Product))
hope this helps point you in the right direction.
Contributor III
## Re: Calculate Average Dimensions
Then try to use the following expression for your dimension
=IF(AGGR(AVG([%low sales]), [Product]) > 95, 'High performance', 'Low performance')
Cheers
Darius | 663 | 2,789 | {"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} | 2.671875 | 3 | CC-MAIN-2019-04 | latest | en | 0.849716 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.