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
http://www.cfd-online.com/Forums/fluent/31968-heat-transfer-flux-print.html
1,477,661,645,000,000,000
text/html
crawl-data/CC-MAIN-2016-44/segments/1476988722459.85/warc/CC-MAIN-20161020183842-00500-ip-10-171-6-4.ec2.internal.warc.gz
373,017,695
2,547
CFD Online Discussion Forums (http://www.cfd-online.com/Forums/) -   FLUENT (http://www.cfd-online.com/Forums/fluent/) -   -   heat transfer flux (http://www.cfd-online.com/Forums/fluent/31968-heat-transfer-flux.html) Mark August 11, 2003 11:41 heat transfer flux Hi, I have simulated a combustion gas flow in a furnace. The heat transfer rate report from the flux reports gives me a Negative value at the inlet indicating heat leaving the domain at the inlet and positive value at the outlet - indicating heat into the domain. This can't be right!!! The only thing I think of, were there might be a problem is that I used an outlet profile from a previous simulation as the inlet boundary condition for this simulation. Could this be causing a problem? Everything else looks fine. Thanks for your help Mark Jin-Wook LEE August 11, 2003 20:55 Re: heat transfer flux I guess that your combustion model is mixture-fraction/PDF model. Is it so ? Then it is possible. For example, let your fuel be CH4. Then, standard enthalpy of formation of fuel(CH4) and products(CO2 and H2O) are negative. Then, numerically, negative flux to the fuel inlet and positive flux at the outlet. Sincerely, Jinwook Mark August 12, 2003 04:18 Re: heat transfer flux Jinwook, The combustion model I'm using is the eddy dissipiation. I should be using the PDF model but I wanted to used the eddy dissipiation model. Is the advice the same for the eddy dissipiation model? Regards, Mark Jin-Wook LEE August 13, 2003 01:42 Re: heat transfer flux YES................... Negative or positive heat flux to the 'outlet' and/or to the 'inlet' is entirely dependent of the value of the 'standard state of enthalpy(let SSE)', not dependent of the combustion model. For your reference, I would like to introduce my idea. I am using my own SSE values, to avoid confusing and to easily check the heat balance. They are, SSE of N2=0, O2=0, CO2=0, H2O=0....... SSE of fuel=LHV(positive value) SSE of CO=LHV(positive value) (for two step model). Then you can avoid the confusing and you can get positve at the inlet and negative at the outlet. The above approach is NOT valid if you are considering backward reaction. Note that SSE is used to calculate the reaction rate of backward reaction. SIncerely, Jinwook Jin-Wook LEE August 13, 2003 01:49 Re: heat transfer flux Simply speaking, non-zero SSE for fuel only for single step model, and non-zero SSE for CO or other intermediate species for multi-step model. All times are GMT -4. The time now is 09:34.
650
2,554
{"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-44
latest
en
0.837753
https://midtermpapers.com/essays/number-grid-investigation
1,516,501,688,000,000,000
text/html
crawl-data/CC-MAIN-2018-05/segments/1516084889917.49/warc/CC-MAIN-20180121021136-20180121041136-00535.warc.gz
788,531,684
11,874
Number Grid Investigation I’m going to investigate about ten different squares randomly across the grid. And put them into a table, which I will have my working out underneath. I will do this to discover a pattern with my answer and see how the pattern varies between the different shape and rectangles. I will also use about six to eight rectangles in my grid investigation. 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 74*85 = 6290 84*75 = 6300 6300 – 6290 = 10 Difference = 10 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 57*68 = 3876 67*58 = 3886 3886 – 3876 = 10 Difference = 10 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 18*29 = 522 28*19 = 532 532 – 522 = 10 Difference = 10
761
1,737
{"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.28125
3
CC-MAIN-2018-05
latest
en
0.434854
http://oeis.org/A333907
1,660,155,168,000,000,000
text/html
crawl-data/CC-MAIN-2022-33/segments/1659882571198.57/warc/CC-MAIN-20220810161541-20220810191541-00710.warc.gz
43,078,109
4,128
The OEIS is supported by the many generous donors to the OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!) A333907 For n >= 1, a(n) = Sum_{k=1..n} prevfib(k) + nextfib(k) - 2*k, where prevfib(k) is the largest Fibonacci number < k, nextfib(k) is the smallest Fibonacci number > k. 0 0, 0, 1, 1, 2, 3, 2, 4, 7, 8, 7, 4, 7, 13, 17, 19, 19, 17, 13, 7, 12, 23, 32, 39, 44, 47, 48, 47, 44, 39, 32, 23, 12, 20, 39, 56, 71, 84, 95, 104, 111, 116, 119, 120, 119, 116, 111, 104, 95, 84, 71, 56, 39, 20, 33, 65, 95, 123, 149, 173, 195, 215, 233, 249, 263, 275 (list; graph; refs; listen; history; text; internal format) OFFSET 1,5 LINKS EXAMPLE a(1) = (0 + 2 - 2*1) = 0; a(2) = (0 + 2 - 2*1) + (1 + 3 - 2*2) = 0; a(3) = (0 + 2 - 2*1) + (1 + 3 - 2*2) + (2 + 5 - 2*3) = 1; a(4) = (0 + 2 - 2*1) + (1 + 3 - 2*2) + (2 + 5 - 2*3) + (3 + 5 - 2*4) = 1. PROG (PARI) isfib(k) = my(m=5*k^2); issquare(m-4) || issquare(m+4); nextfib(n) = my(k=n+1); while (!isfib(k), k++); k; prevfib(n) = my(k=n-1); while (!isfib(k), k--); k; a(n) = sum(k=1, n, prevfib(k) + nextfib(k) - 2*k); \\ Michel Marcus, Apr 10 2020 CROSSREFS Cf. A000045, A001076, A087172, A130473, A194029, A256654, A280514. Sequence in context: A132439 A338902 A116217 * A274486 A227961 A108838 Adjacent sequences:  A333904 A333905 A333906 * A333908 A333909 A333910 KEYWORD nonn AUTHOR Ctibor O. Zizka, Apr 09 2020 STATUS approved Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents The OEIS Community | Maintained by The OEIS Foundation Inc. Last modified August 10 13:12 EDT 2022. Contains 356039 sequences. (Running on oeis4.)
771
1,744
{"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.765625
4
CC-MAIN-2022-33
latest
en
0.506007
http://rockandice.com/climbing-gear-tips/the-holding-power-of-nuts/
1,511,434,884,000,000,000
text/html
crawl-data/CC-MAIN-2017-47/segments/1510934806771.56/warc/CC-MAIN-20171123104442-20171123124442-00456.warc.gz
258,107,272
18,398
## The Holding Power of Nuts If a small nut can hold a fall of 6 kN, can I place two in the same crack, one above the other, clip them with the same draw and get 12 kN of holding power? By Rock and Ice | January 17th, 2017 If a small nut can hold a fall of 6 kN, can I place two in the same crack, one above the other, clip them with the same draw and get 12 kN of holding power? —Jeffrey Thomas via e-mail Because you are clipping both nuts with one draw, and because the hexes are at different levels, your placements will not be equalized. The top nut will load before the bottom one. When the top nut fails, you fall onto the bottom nut. So, no, you won’t get 12 kN in holding power out of that situation. To try to achieve what you want—more holding power from dubious placements—you must lengthen the sling/cable on the top nut so you clip it at exactly the same level as the loop on the lower nut. There are several confusing ways to do this, and equalizing two nuts while you are on lead is unlikely unless you have a great stance and how-to-climb book in your hip pocket, so we’ll skip that chapter. A practical and quickie if flawed method to approximate equalizing nuts is to clip the top one with a longer draw than the bottom nut so the rope runs through both placements at approximately the same height. These anchors still won’t be equalized; rather, you will rely on the “Screamer” effect: When the top nut pulls or breaks, it will absorb energy from the fall. You will then load the bottom nut, which now has a better chance of holding due to the lowered load. A recent example of this technique really working is Ben Rueck’s ascent of Pure Pressure (5.14), Escalante Canyon, Colorado (RI No. 233). To protect this tips crack, Rueck stacked three micro cams, non-equalized, and took lengthy falls onto them. The top cams would rip or even break, but the lowest of the three placements always held, and kept our brother out of the infirmary. I admire your thinking: Doubling up on gear placements, even good ones, is always a good call. Gear Guy has spoken! ##### How to Climb: How to Place Protection This article originally appeared in Rock and Ice issue 235 (July 2016). #### Toy Story: Beware Knockoff Carabiners! You’d have to be pretty daft to mistakenly use those cheap toy carabiners you see all over the place for real climbing. But what about iffy carabiners that appear to be sturdy and legit at first glance? #### Kinks Be Gone! How to Rappel and Lower Without Twisting the Rope When I toprope belay (with an ATC), the rope ends up totally kinked. Why is this happening? #### Can Sleeping on Your Rope Cause Damage? Entire generations of luckless alpinists have used ropes to level out ledges and insulate against the cold ground, ice and snow.
666
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.953125
3
CC-MAIN-2017-47
latest
en
0.927186
http://www.articletrunk.com/Article/Students-of-Statistics---Professional-Help-for-Your-Assignments/498488
1,521,949,604,000,000,000
text/html
crawl-data/CC-MAIN-2018-13/segments/1521257651780.99/warc/CC-MAIN-20180325025050-20180325045050-00448.warc.gz
334,565,207
7,684
# Students of Statistics - Professional Help for Your Assignments By: George McGuire As a subject, Statistics is all about collecting, tabulating, presenting, analyzing and interpreting numerical data. A separate mathematical science, statistics is used in making decisions concerning various aspects of our lives-whether personal or professional. For example, a business owner can estimate the sales of his products in the week to come, based on sales of earlier weeks. Here, he uses statistics to find information based on his own experience, rather than on any set statistical models. Today, the application of statistics far exceeds this example and is seen in any field that deals with quantitative and qualitative data. So, you would need Statistics in fields like Epidemiology, Actuarial Science, Econometrics, Biostatistics, Reliability Engineering, Business Analytics and Statistical Finance. Statistics Assignment Help The complexities that surround Statistics is commonly known, particularly to students of this subject. It involves solving difficult problems with all kinds of data with the help of computational methods. Though computers have helped to simplify this subject to some extent, yet students find it difficult to understand the correct applications of statistical concepts. However, if you go online and look for experienced and reliable statistics assignment help, you're sure to find several to choose from. These agencies comprise experts in this subject who have helped several students like you in overcoming their fear and nervousness towards Statistics and replacing it with problem-solving techniques and strategies. By using the most up-to-date software and tools, they simplify this subject for students and clear all their doubts. By approaching the assignment logically, they are able to answer all aspects of the difficult topic given to students. Through this logical method of approach, students can understand how to solve problems logically and retain the concepts used. Students can depend on these professional services in areas like standard deviation, probability theory, distribution function, normal distribution, chi-squared test, binomial distribution, linear regression, hypothesis testing, random variables, analysis of variance (ANOVA), etc. Besides solving problems, these experts can also be called upon to use software like Minitab, SAS, R, Megastat, SPSS, Gretl, JMP, Eviews, STATA, etc. Statistics Assignment Tutor Students seeking a helping hand with their Statistics assignment can approach these professional agencies. A typical statistics assignment help agency can be called at any time of the day or night, and from any part of the world. The tutors one finds here are highly educated, experienced and wizards with calculating the most difficult problems. So, it would be best to depend on them for their unique skills. If students need help with their dissertations and projects based on Economics data, these professionals can assist them with these projects too. These experts are excellent in various branches of Statistics including Econometrics, Mathematical Statistics, Operations Research, Quantitative Methods, Business Statistics and Applied Statistics. They complete each assignment using graphs, pie charts, tables, diagrams and other tools that are sure to fetch students higher grades in their assignments. The statistics assignment help students can expect from such professionals is not restricted to their assignments but also to helping students create online statistics quizzes, apart from their homework tasks and exams. Article Directory: http://www.articletrunk.com | Ben Marsh is a online expert and he is providing the services to Tutorhelpdesk. Tutorhelpdesk is one of the solution for your statistics assignment help. We also provide tutoring services in sas assignment help and all the field of economics like micro, macro, managerial, international, health, labor, industrial econo
718
3,986
{"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.28125
3
CC-MAIN-2018-13
latest
en
0.951746
https://en.thefreedictionary.com/manometer
1,620,935,284,000,000,000
text/html
crawl-data/CC-MAIN-2021-21/segments/1620243991943.36/warc/CC-MAIN-20210513173321-20210513203321-00214.warc.gz
253,800,027
13,633
# manometer Also found in: Thesaurus, Medical, Encyclopedia, Wikipedia. manometer To calculate pressure in a U-tube manometer, add the sum of the readings above and below zero. The manometer on the right shows a reading of 4. ## ma·nom·e·ter (mă-nŏm′ĭ-tər) n. 1. An instrument used for measuring the pressure of liquids and gases. 2. A sphygmomanometer. [Greek manos, sparse; see men- in Indo-European roots + -meter.] man′o·met′ric (măn′ə-mĕt′rĭk), man′o·met′ri·cal adj. ma·nom′e·try n. American Heritage® Dictionary of the English Language, Fifth Edition. Copyright © 2016 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company. All rights reserved. ## manometer (məˈnɒmɪtə) n (General Physics) an instrument for comparing pressures; typically a glass U-tube containing mercury, in which pressure is indicated by the difference in levels in the two arms of the tube [C18: from French manomètre, from Greek manos sparse + metron measure] maˈnometry n Collins English Dictionary – Complete and Unabridged, 12th Edition 2014 © HarperCollins Publishers 1991, 1994, 1998, 2000, 2003, 2006, 2007, 2009, 2011, 2014 ## ma•nom•e•ter (məˈnɒm ɪ tər) n. an instrument for measuring the pressure of a fluid, consisting of a tube filled with a liquid, the level of the liquid being determined by the fluid pressure. [1725–30; < French manomètre] man•o•met•ric (ˌmæn əˈmɛ trɪk) man`o•met′ri•cal, adj. ma•nom′e•try, n. Random House Kernerman Webster's College Dictionary, © 2010 K Dictionaries Ltd. Copyright 2005, 1997, 1991 by Random House, Inc. All rights reserved. manometer To calculate pressure in a U-tube manometer, add the sum of the readings above and below zero. The manometer on the left is at equilibrium. The manometer on the right shows readings of 2 above zero and 2 below zero, indicating a pressure of 4. ## ma·nom·e·ter (mə-nŏm′ĭ-tər) An instrument that measures the pressure exerted by liquids and gases. The American Heritage® Student Science Dictionary, Second Edition. Copyright © 2014 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company. All rights reserved. ## manometer 1. an instrument for measuring the pressure of gases or vapors. 2. an instrument for measuring blood pressure. Also called sphygmanometer.manometric, adj. 1. an instrument for measuring the pressure of gases or vapors. 2. an instrument for measuring blood pressure. Also called sphygmomanometer. — manometric. adj. ThesaurusAntonymsRelated WordsSynonymsLegend: Noun 1 manometer - a pressure gauge for comparing pressures of a gaspressure gage, pressure gauge - gauge for measuring and indicating fluid pressuretensimeter - a manometer for measuring vapor pressure Based on WordNet 3.0, Farlex clipart collection. © 2003-2012 Princeton University, Farlex Inc. Translations ManometerDruckmessgerät manometr ## manometer [məˈnɒmɪtəʳ] N Collins Spanish Dictionary - Complete and Unabridged 8th Edition 2005 © William Collins Sons & Co. Ltd. 1971, 1988 © HarperCollins Publishers 1992, 1993, 1996, 1997, 2000, 2003, 2005 ## manometer n (Tech) → Manometer nt Collins German Dictionary – Complete and Unabridged 7th Edition 2005. © William Collins Sons & Co. Ltd. 1980 © HarperCollins Publishers 1991, 1997, 1999, 2004, 2005, 2007 ## manometer [məˈnɒmɪtəʳ] nmanometro Collins Italian Dictionary 1st Edition © HarperCollins Publishers 1995 ## ma·nom·e·ter n. manómetro, instrumento para medir la presión de líquidos o gases. English-Spanish Medical Dictionary © Farlex 2012 References in classic literature ? Instead we continued to submerge until the manometer registered forty feet and then I knew that we were safe. Opposite the quick-connect Foster air fill fitting is a manometer (pressure gauge) to show air-pressure status. [USPRwire, Thu Oct 18 2018] The pressure gauge industry's impressive growth, in turn, drives the progress of manometer market which finds application in multiple applications starting from manufacturing to healthcare to the construction industry. [ClickPress, Thu Oct 18 2018] The pressure gauge industry's impressive growth, in turn, drives the progress of manometer market which finds application in multiple applications starting from manufacturing to healthcare to the construction industry. The standard method of measuring CSF OP is with a spinal manometer, but in many resource-limited centres manometers are not readily available. During my final year project, our manometer leaked and all mercury drained out. Rhythmic 10 Mexico; 9 Son; And Dombey 8 tails; no have They 7 Rice; 6 manometer; A5 Mann; Thomas 4 Umbria; 3 Nene; The 2 Suffolk; 1 ANSWERS: MKS Instruments' a-Baratron Capacitance Manometer is an advanced, high-performance, heated absolute capacitance manometer with better accuracy, higher tolerance to ambient temperature changes and excellent repeatability. Brooks Instrument will unveil its new XacTorr CMX0 capacitance manometer, as well as the new EtherCAT capabilities of its GF40/80 mass flow controller at Intersolar North America, July 10-12 in San Francisco. Site: Follow: Share: Open / Close
1,415
5,159
{"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-2021-21
latest
en
0.679761
http://www.enotes.com/homework-help/how-can-use-substitution-problem-2x-y-5-3x-2y-399614
1,477,165,381,000,000,000
text/html
crawl-data/CC-MAIN-2016-44/segments/1476988719041.14/warc/CC-MAIN-20161020183839-00392-ip-10-171-6-4.ec2.internal.warc.gz
424,294,330
9,234
# How can I use substitution in the problem 2x-y=5, 3x-2y=9 ?How can I use substitution in the problem 2x-y=5, 3x-2y=9 ? justaguide | College Teacher | (Level 2) Distinguished Educator Posted on To solve 2x - y = 5 ...(1) 3x - 2y = 9 ...(2) using substitution take (1) 2x - y = 5 => y = 2x - 5 substitute in (2) 3x - 2(2x - 5) = 9 => 3x - 4x + 10 = 9 => -x = -1 => x = 1 y = 2x - 5 = 2 - 5 = -3 The solution of the equations is x = 1 and y = -3 giorgiana1976 | College Teacher | (Level 3) Valedictorian Posted on We'll write the first equatino, isolating y to the left side. For this reason, we'll subtract 5 both sides: 2x - y - 5 = 0 y = 2x - 5 (1) Now, we can replace y by it's expression into the 2nd equation: 3x - 2(2x - 5) = 9 <=> 3x - 4x + 10 = 9 We'll combine like terms: -x + 10 = 9 We'll subtract 10 both sides: -x = -1 <=> x = 1 We'll determine y: y = 2x - 5 y = 2 - 5 y  = -3 The solution of the system is represented by the pair: (1 ; -3).
401
984
{"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.4375
4
CC-MAIN-2016-44
latest
en
0.822137
https://www.debugcn.com/article/182639698.html
1,685,853,920,000,000,000
text/html
crawl-data/CC-MAIN-2023-23/segments/1685224649439.65/warc/CC-MAIN-20230604025306-20230604055306-00563.warc.gz
790,200,875
8,727
# 数组乘以矩阵中的各个行 array1 <- array(1:108, c(6,6,3)) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 7 13 19 25 31 [2,] 2 8 14 20 26 32 [3,] 3 9 15 21 27 33 [4,] 4 10 16 22 28 34 [5,] 5 11 17 23 29 35 [6,] 6 12 18 24 30 36 , , 2 [,1] [,2] [,3] [,4] [,5] [,6] [1,] 37 43 49 55 61 67 [2,] 38 44 50 56 62 68 [3,] 39 45 51 57 63 69 [4,] 40 46 52 58 64 70 [5,] 41 47 53 59 65 71 [6,] 42 48 54 60 66 72 , , 3 [,1] [,2] [,3] [,4] [,5] [,6] [1,] 73 79 85 91 97 103 [2,] 74 80 86 92 98 104 [3,] 75 81 87 93 99 105 [4,] 76 82 88 94 100 106 [5,] 77 83 89 95 101 107 [6,] 78 84 90 96 102 108 matrix1 <- matrix(1:18, nrow = 3, ncol = 6) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 4 7 10 13 16 [2,] 2 5 8 11 14 17 [3,] 3 6 9 12 15 18 1*1 + 7*4 + 13*7 + 19*10 +25*13 + 31*16 = result Rows <- min(dim(array1)[1], dim(matrix1)[1]) Cols <- min(dim(array1)[2], dim(matrix1)[2]) apply(array1, 3, function(x) rowSums(matrix1 * x[1:Rows,1:Cols])) array1[ , , 1] * matrix1 #or array1[1:Rows, 1:Cols, 1] * matrix1 rowSums如其名称所示,给出每一行的总和。因此,阵列中第一个平面的结果与矩阵相乘并汇总为一个向量。 rowSums(array1[1:Rows, 1:Cols, 1] * matrix1) # 1131 1284 1449 0条评论
813
1,361
{"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.359375
3
CC-MAIN-2023-23
latest
en
0.129398
https://toppapers.org/2020/11/23/cardinal-directions-and-latitude-and-longitude/
1,624,219,228,000,000,000
text/html
crawl-data/CC-MAIN-2021-25/segments/1623488253106.51/warc/CC-MAIN-20210620175043-20210620205043-00560.warc.gz
495,522,395
12,727
Select Page cardinal_coordinates.pdf chino_campus.pdf fontana_campus.pdf latitude_and_longitude.pdf rancho_campus.pdf Unformatted Attachment Preview Cardinal Directions For this lab, you will learn about or review cardinal directions. You will use all three of the Chaffey College campus maps (Rancho Cucamonga, Chino, and Fontana) to answer the questions. I recommend that you print the lab, record your answers, and then use those to input your answers into our online class site so that you can then get credit for the laboratory exercise. There is more than one way to give someone directions. Some people prefer to use the terms left, right, up, and down. For example, you may hear someone say, “Go up to Main Street, and turn left on Monument Road.” Others prefer to use cardinal directions, such as north, south, east, and west. For example, you may hear someone say, “Go south on Second Street, and turn east on Black Ridge Road.” Neither method is necessarily right or wrong, but the Cardinal directions are more reliable, as it is more specific and will not change relative to the person’s perspective or direction they are facing. The cardinal directions use the four main points of a compass: north, south, east, and west. Cardinal directions can also include intermediary directions such as northeast, which is between north and east, and northwest, southeast, and southwest. While outdoors, you can always figure out general cardinal directions by using the Sun. The Sun always rises in the east in the morning, and sets in the west in the evening. Therefore, now that you know where east and west is based on the Sun, you could figure out where north and south are. For example, if you stand with your left hand pointed to the west and your right hand pointed to the east, then you are facing north. If you turn west, then you are facing south. Therefore, you can always find which direction is which by using the sun. Another way to figure out cardinal directions is by using a compass. No matter where you are standing on earth, a compass will point to north. A compass has a small, lightweight magnet balanced on an almost frictionless pivot point on which it can spin easily. The magnet is often referred to as a needle. Imagine that the earth has a huge bar magnet inside of it. Picture that the south-end of the bar magnet is at the North Pole. This would cause the compass to point north because when dealing with magnets, opposite ends attract. This happens because the Earth’s core consists of molten iron. Since the core of the earth has such great pressure, the iron crystallizes into a solid. Convection caused by heat radiating from the earth’s core, along with the rotation of the earth, causes the liquid iron to rotate. It is the rotational forces that are believed to create a weak magnetic force. This explains why a compass always points north. Cardinal directions can also be found on a map by using a compass rose. A compass rose is different from a compass. It is a symbol used to show direction on a map. The compass rose has four points. Each point represents north, south, east, and west. The compass rose has existed since the 1300’s. The term “rose” comes from the figure’s compass points, which resembles the pedals of a flower. By using the compass rose on a map you can figure out which way you need to go to get somewhere. You can also determine where places are located by describing where a place is in relation to other places, such as the United States is south of Canada and north of Mexico. To remember the order of directions clockwise around the compass rose, you can use mnemonics, such as “Never Eat Soggy Waffles.” The letter “N” in north corresponds to the first letter “N” in Never, and so on with south and soggy, east and eat, and west and waffles. Sometimes, the map will not include all four of the cardinal directions, and will instead just show a north arrow. By knowing only one of the cardinal directions, the other three can be determined. A map legend or key is often provided on a map to help the user understand the symbols, colors, etc. on the map. The symbols and colors on the map mean something specific, and the legend or key explains what they mean. Before starting this lab, view the following video, which reviews some of the concepts above in a more visual form: https://www.youtube.com/watch?v=HcglOmnbrgQ If you would like more information on how compasses work, or the history of the compass rose, the following articles are useful (but not required for you to read): Brain, Marshall. “How Compasses Work.” 01 April 2000. HowStuffWorks.com. 09 November 2008. Thoen, Bill. “Origins of the Compass Rose.” February 2001. GISnet.com. < http://www.gisnet.com/notebook/comprose.php> 09 November 2008. Let’s get started! Use the three Chaffey College campus maps (Rancho Cucamonga, Chino, and Fontana) to answer the questions below. Make sure to locate the compass rose (in the form of a north arrow) and the map legend on each of the maps before attempting to answer the questions so that you are able to orient yourself and understand what many of the symbols mean. Use the Fontana Campus map to answer the following questions: 1. Where is the compass rose (north arrow) located on the map? A. The bottom, left-hand corner, or southwest area of the map B. The bottom, right-hand corner, or southeast area of the map C. The top, right-hand corner, or northeast area of the map D. The top, left-hand corner, or northeast area of the map 2. Which of the following are found in the Academic Center (FNAC) building? A. Student Lounge, Success Center, and EOPS B. Bookstore, Counseling, and Campus Police/Security C. Student Lounge, Success Center, and Admission and Records D. Library Resource Center, Bookstore, and Student Lounge 3. Are the three buildings of the Fontana campus north, south, east or west of Merrill Ave.? A. North B. South C. East D. West 4. If you were parked in the middle of the parking lot, and your class was in the Fontana Center (FNAC), which general direction would you walk? A. Southeast B. Northwest C. Northeast D. Southwest 5. If you were in the Ralph M. Lewis Center (FNLC) visiting the Admissions and Records office, which direction would you walk in order to go directly to your class in A. North B. South C. East D. West 6. If you parked on Juniper Ave,, just south of Merril Ave. by the parking lot exit, which way would you walk in order to get to your class in the Ralph M. Lewis Center (FNLC)? A. North B. South C. East D. West 7. When your class was over in the Ralph M Lewis Center (FNLC), which way would you then walk to get to your car parked on Juniper Ave., just south of Merril Ave, by the parking lot exit? A. North B. South C. East D. West 8. From which side of the parking lot can you enter and exit? A. The north side of the parking lot B. The south side of the parking lot C. The east side of the parking lot D. The west side of the parking lot 9. Which way would you drive through the parking lot in order to exit?. A. North B. South C. East D. West 10. Is the Fontana campus north, south, east, or west of Sierra Ave.? A. North B. South C. East D. West Use the Chino Campus map to answer the following questions: 11. In which building is the Admissions and Records office located? A. Main Instructional Building (CHMB) B. Health Science Center (CHHC) C. Community Center (CHCM) D. The Chino campus does not have an Admissions and Records office. 12. If you finished your class in the Health Science Center (CHHC), and your next class was in the Main Instructional Building (CHMB), which direction would you walk to go directly there? A. Northeast B. Northwest C. Southeast D. Southwest 13. If you were driving south on Oaks Ave, and you carefully went around the roundabout (that circle on the map in the road), when you entered onto Eucalyptus Ave., which direction would you be driving? A. Northeast B. Northwest C. Southeast D. Southwest 14. Of the three buildings on the Chino campus, which one is on the south end of the campus? A. Main Instructional Building (CHMB) B. Health Science Center (CHHC) C. Community Center (CHCM) 15. How many parking lots are there on the Chino campus? A. 1 B. 2 C. 3 D. 4 E. 5 16. If you were standing in Parking Lot C-2, which direction should you walk to get to your car in Parking Lot C-1? A. North B. South C. East D. West 17. If you were standing at the intersection of Notre Dame Ave. and Oaks Ave., where is the community Center building (CHCM) in relation to you? A. directly south B. southeast C. southwest D. northeast Use the Rancho Cucamonga Campus map to answer the following questions: 18. Which building is directly west of the Math and Physical Sciences buildings? A. des Lauriers Labs B. Michael Alexander Campus Center C. Sport Center D. Health Science 19. Which building is directly east of the Math and Physical Sciences buildings? A. des Lauriers Labs B. Michael Alexander Campus Center C. Sport Center D. Health Science 20. Which building is northwest of the Math and Physical Sciences buildings? A. des Lauriers Labs B. Michael Alexander Campus Center C. Sport Center D. Health Science 21. Which building is southwest of the Math and Physical Sciences buildings? A. des Lauriers Labs B. Michael Alexander Campus Center C. Sport Center D. Health Science 22. Which street is on the west side of the Rancho Cucamonga campus? A. Haven Ave. B. College Drive C. Panther Drive D. Wilson Ave. 23. Which street is on the north side of the Rancho Cucamonga campus? A. Haven Ave. B. College Drive C. Panther Drive D. Wilson Ave. 24. Which street is on the southern end of the Rancho Cucamonga campus? A. Haven Ave. B. College Drive C. Panther Drive D. Wilson Ave. 25. If you are standing on Grigsby Field, which general direction should you walk to get to the Lowder Baseball Field or the Soccer Practice Field? A. North B. South C. East D. West Ruben S. Ayala Park To Edison Avenue Chino Campus UE VEN EA AM ED TR NO OAKS AVENUE Parking Lot C-1 Parking Lot C-2 Community Center (CHCM) To Central Avenue Main Instructional Building (CHMB) Bookstore Campus Dean Counseling EOPS Financial Aid Library Classrooms Success Center Health Science Center (CHHC) COLLEGE PARK AVENUE Vocational Nursing Labs Science Labs Community Center (CHCM) S TU UE EN AV Parking Lot C-4 YP AL Main Instructional Building (CHMB) C EU Parking Lot C-3 Banquet Facility (joint use with City of Chino) Culinary Arts Fashion Design and Merchandising Hotel and Food Service Management Interior Design Blue Phones REV. 1-25-17 Parking Lot C-5 Health Science Center (CHHC) 5897 College Park Avenue, Chino, CA 91710 909/652-8000 www.chaffey.edu/chino Blue Phones REV. 1-11-17 Latitude and Longitude The latitude and longitude grid system has been used since at least 300 B.C. The lines of this coordinate system are called lines of latitude and lines of longitude. Any point on Earth can be located by the intersection of these lines. Lines of latitude are also called parallels. Latitude lines run east – west around the earth, paralleling each other. The Equator is the line of zero latitude. The number of each line moving either northward or southward away from the equator increases in value, until you get to either the north or south pole. Therefore, the lines are numbered 0°, at the Equator, to 90°, at the poles. Since the numbers will repeat themselves, you always have to state if the latitude line you are referring to is north or south of the equator. In other words, you have to state if you are referring to the northern or southern hemisphere. Lines of longitude are also called meridians. Longitude lines run north – south from pole to pole. Therefore, they all cross each other at both the North and South Poles. The beginning of the longitude lines starts at 0°, a line called the prime meridian. The prime meridian runs through the Royal Observatory in Greenwich, England. Going from the prime meridian westward, longitude lines are numbered up to180° West (because they are in the western hemisphere west of England). Going from The Prime Meridian eastward, longitude lines are numbered up to 180°East (because they are in the eastern hemisphere, east of England). As a side note, the 180° meridian is basically the International Date Line. When stating a location’s longitude and latitude, it is extremely important to specify which hemisphere of latitude and which hemisphere of longitude of the particular location. In other words, when you state a line of latitude, you have to state if the location is north or south of the equator. When you state a line of longitude, you must state if the location is east or west of Greenwich, England. For example, let’s look at California. For latitude, California is north of the equator (it is in the Northern Hemisphere). For longitude, California is west of England (it is in the Western Hemisphere). Therefore, it should makes sense that Rancho Cucamonga, CA is located at about 34° North latitude and 118° West longitude. For this lab, you will be determining locations based on given latitudes and longitudes. I recommend that you print the maps and questions, plot the locations on the map, fill in class site so that you can then get credit for the laboratory exercise. If you find you are a website/game, which is juvenile, but fun: http://www.abcya.com/latitude_and_longitude_practice.htm If the maps in this lab are difficult to see, either download the pdf file I have posted on Moodle, or visit The World Factbook site and download the pdf files of these maps yourself in order to zoom in to be more clear: https://www.cia.gov/library/publications/the-world-factbook/docs/refmaps.html 150° W 90° W 30° W 30° E 90° E 150° E 90° N 60° N 30° N 30° S 60° S 90° S 130° 110° 120° 100° 90° 50° 40° 30° 120° 110° 100° 90° 80° Using the maps above, answer the following questions. Then, when you are done, log into our class, and submit class management system, you will not be given credit for this assignment. 1. Which country is found at 60° N latitude and 90° E longitude? 2. Which country is found at 30° N latitude and 30° E longitude? 3. Which country is found at 30° N latitude and 90° W longitude? 4. Which country is found at 60° N latitude and 120° W longitude? 5. Which country is found at 30° N latitude and 0° longitude? 6. Which country is found at 30° S latitude and 120° E longitude? 7. Which country is found at 30° S latitude and 60° W longitude? 8. Which country is found at 60° N latitude and 60° E longitude? 9. Which country is found at 0° latitude and 60° W longitude? 10. Which country is found at 30° N latitude and 60° E longitude? 11. Which ocean is found at 0° latitude and 90° E longitude? 12. Which ocean is found at 30° N latitude and 30° W longitude? 13. Which ocean is found at 30° S latitude and 90° W longitude? 14. Which ocean is found at 90° N latitude and 30° W longitude? 15. Which ocean is found at 30° N latitude and 150° W longitude? 16. Which ocean is found at 30° N latitude and 120° W longitude? 17. Which ocean is found at 60° S latitude and 30° E longitude? 18. Which ocean is found at 30° S latitude and 30° W longitude? 19. Which ocean is found at 10° S latitude and 30° W longitude? 20. Which ocean is found at 0° latitude and 60° E longitude? 21. Which state is found at 40° N latitude and 90° W longitude? 22. Which state is found at 30° N latitude and 100° W longitude? 23. Which state is found at 40° N latitude and 110° W longitude? 24. Which state is found at 35° N latitude and 105° W longitude? 25. Which state is found at 45° N latitude and 85° W longitude? CD-A CD-B CD-C CD-D Blue Phones REV. 1-25-17 GPS Assessment 24 Parking Fuel
4,031
15,716
{"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.1875
3
CC-MAIN-2021-25
latest
en
0.95483
https://www.jiskha.com/questions/1586303/find-d-dx-integral-from-2-to-x-4-tan-x-2-dx-tan-x-4-2-4x-3-MY-ANSWER
1,537,618,239,000,000,000
text/html
crawl-data/CC-MAIN-2018-39/segments/1537267158320.19/warc/CC-MAIN-20180922103644-20180922124044-00233.warc.gz
761,528,199
5,554
find d/dx (integral from 2 to x^4) tan(x^2) dx 1. I assume you meant d/dx ∫[2,x^4] tan(t^2) dt = tan((x^4)^2) * 4x^3 = 4x^3 tan(x^8) posted by Steve 2. yes! thank you! posted by Ke\$ha ## Similar Questions 1. ### Trigonometry Find the exact value of tan(a-b) sin a = 4/5, -3pi/2<a<-pi; tan b = -sqrt2, pi/2<b<pi identity used is: tan(a-b)=(tan a-tan b)/1+tan a tan b simplify answer using radicals. (a is alpha, b is beta) 2. ### Tan^2 Integrals I'm having a hard time understanding how to do Integrals involving tan^2. I have two problems: 1. Find the integral of (tan^2 y +1)dy 2. Find the integral of (7tan^2 u +15)du 1. My approach to it is to replace the tan^2 y portion 3. ### Integration Intergrate ¡ì sec^3(x) dx could anybody please check this answer. are the steps correct? thanks. = ¡ì sec x d tan x = sec x tan x - ¡ì tan x d sec x = sec x tan x - ¡ì sec x tan^2(x) dx = sec x tan x + ¡ì sec x dx - ¡ì 4. ### Calc intergral of (x^3 -4x + 3)/(2x) dx would this be ln abs(x^3-4x+3) + C? I don't really understand how to solve this problem. d/dx (tan (x^2)) sec^2(x^2)(2x) would this be the correct answer to find the derivative of tan (x^2)? no, 5. ### Maths- complex numbers Find tan(3 theta) in terms of tan theta Use the formula tan (a + b) = (tan a + tan b)/[1 - tan a tan b) in two steps. First, let a = b = theta and get a formula for tan (2 theta). tan (2 theta) = 2 tan theta/[(1 - tan theta)^2] 6. ### calculus Use integration by parts to evaluate the integral of x*sec^2(3x). My answer is ([x*tan(3x)]/3)-[ln(sec(3x))/9] but it's incorrect. u=x dv=sec^2(3x)dx du=dx v=(1/3)tan(3x) [xtan(3x)]/3 - integral of(1/3)tan(3x)dx - 7. ### Calculus - Integration Hello! I really don't think I am understanding my calc hw. Please help me fix my errors. Thank you! 1. integral from 0 to pi/4 of (tanx^2)(secx^4)dx It says u = tan x to substitute So if I use u = tan x, then my du = secx^2 then I 8. ### trig h t t p : / / i m g 4 0 . i m a g e s h a c k . u s / c o n t e n t . p h p ? p a g e = d o n e& l = i m g 4 0 / 1 4 8 / a s d a s d y e . j p g & v i a = m u p l o a d (def of tan theta = a^-1 o)a = o opposite = adjacent tan 9. ### Math-Trigonometry Show that if A, B, and C are the angles of an acute triangle, then tan A + tan B + tan C = tan A tan B tan C. I tried drawing perpendiculars and stuff but it doesn't seem to work? For me, the trig identities don't seem to plug in 10. ### integral confusion integral of Sec[2x]Tan[2x] i know u is sec 2x du=2sec2xtan2x dx what would i have to multiply with du so it would equal tan 2x dx? if my question is confusing, then here's another example of what i'm talking about: integral of 11. ### Calculus Calculate the following integral: ∫ sec^4 (3x)/ tan^3 (3x) dx For this one, can I bring up the tan to tan^-3? More Similar Questions
1,005
2,819
{"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.03125
4
CC-MAIN-2018-39
latest
en
0.675879
http://slideplayer.com/slide/8028452/
1,713,249,382,000,000,000
text/html
crawl-data/CC-MAIN-2024-18/segments/1712296817073.16/warc/CC-MAIN-20240416062523-20240416092523-00093.warc.gz
35,401,519
18,230
Presentation is loading. Please wait. # When adding two numbers, the order does not matter. EXAMPLES: 5 + 6 = 6 + 5 a + b = b + a. ## Presentation on theme: "When adding two numbers, the order does not matter. EXAMPLES: 5 + 6 = 6 + 5 a + b = b + a."— Presentation transcript: When adding two numbers, the order does not matter. EXAMPLES: 5 + 6 = 6 + 5 a + b = b + a When multiplying two numbers, the order does not matter. EXAMPLES: 5 6 = 6 5 a b = b a When adding three numbers, the order does not matter. Always involves parenthesis EXAMPLES: (3 + 2) + 4 = 3 + (2 + 4) (a + b) + c = a + (b + c) When multiplying three numbers, the order does not matter. Always involves parenthesis EXAMPLES: (3 2) 4=3 (2 4) (a b) c=a (b c) Any number plus zero equals itself EXAMPLES: 3 + 0 = 3 0 + d = d Any number times one equals itself EXAMPLES: 8 1 = 8 1 m = m Any number added to its inverse equals zero. EXAMPLES: 8 + (-8) = 0 -a + a = 0 Any number multiplied by its inverse (reciprocal) equals one. EXAMPLES: and Any number times zero equals zero EXAMPLES: 4 0 = 0 0 h = 0 Multiplying the number outside of the parentheses (distributing) to each number inside the parentheses EXAMPLES: 2(3 + 4) = 2(3) + 2(4) = 6 + 8 = 14 2(d – 6) = 2d – 2(6) = 2d - 12 The distance from zero on a number line The absolute value of any number is positive Download ppt "When adding two numbers, the order does not matter. EXAMPLES: 5 + 6 = 6 + 5 a + b = b + a." Similar presentations Ads by Google
491
1,489
{"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.84375
4
CC-MAIN-2024-18
latest
en
0.801329
https://www.physicsforums.com/threads/simple-probability-check.528369/
1,544,425,435,000,000,000
text/html
crawl-data/CC-MAIN-2018-51/segments/1544376823318.33/warc/CC-MAIN-20181210055518-20181210081018-00107.warc.gz
1,006,355,619
13,836
# Homework Help: Simple Probability Check 1. Sep 8, 2011 ### Zhalfirin88 1. The problem statement, all variables and given/known data A group of n students decided to find out on what day of the week each of them was born. Find the probability that all of them were born on different days of the week if a)n=2, b)n=4, c)n=7, d)n=8. 3. The attempt at a solution Let's start with n = 2. First, I started out by finding the complement of A, that they are all born on the same day. The total number of combinations is nr , where r = 7 for 7 days of the week. Then the probability is 7 choose 2, because there are 7 different possible days, and there are 2 students that were born on the same day. Thus, the probability of A' is 21/128 = .1641, and the probability of A is 1 - .1641 = .8359. This just doesn't seem right, because if you take n = 8, 8^7 = 2,097,152 but 7 choose 8 doesn't exist, so I'm thinking I'm misinterpreting the formulas or something. 2. Sep 8, 2011 ### gb7nash No. Think about it. Listing the ways we can have 2 being born on the same way, we get: Monday Monday Tuesday Tuesday Wednesday Wednesday Thursday Thursday Friday Friday Saturday Saturday Sunday Sunday So, there are 7 valid events. What's the total number of events? (It's not 128). Once you have the new probability of A', do what you were doing before. Unfortunately, you can't use this method for n > 2. Do you see why? What's another way of counting n = 4 and n = 7? By the way, for n = 8, can 8 people be born on different days of the week? Think pigeonhole principle. 3. Sep 8, 2011 ### Zhalfirin88 So, in this case, the number of samples, r, is the number of students, and the set of objects, n, are the days of the week, thus nr = 72 = 49 possible ways. And you listed the favorable events for A', because since we want them to have the same birthday, would be 7 choose 1, correct? P(A') = 7/49 = 1/7 = 0.142857 P(A) = 1 - 0.142857 = .8571428. And I see why you can't use this for n > 2. For n = 4, would it not be (7 choose 1)(6 choose 1)...(4 choose 1) divided by 7^3? For n = 7, there is only 1 favorable outcome, yet there are 7^7 different ways, correct? Finally, n = 8 is the impossible outcome, yes. 4. Sep 9, 2011 ### Ray Vickson If the two students are Smith and Jones, look first at Smith. In 6 out of 7 days, the birthday of Jones is different from that of Smith, so P{two different days} = 6/7. For n = 3, P{all different} = (6/7)*(5/7), etc. This just a variant of the "birthday problem"; see, eg., http://en.wikipedia.org/wiki/Birthday_problem or http://mathworld.wolfram.com/BirthdayProblem.html . RGV
784
2,628
{"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.25
4
CC-MAIN-2018-51
latest
en
0.963425
https://www.metricsconverter.com/length/millimeters-to-centimeters/
1,669,755,670,000,000,000
text/html
crawl-data/CC-MAIN-2022-49/segments/1669446710711.7/warc/CC-MAIN-20221129200438-20221129230438-00079.warc.gz
910,524,497
13,944
Convert Millimeters (mm) to Centimeters (cm) Please provide the values below to convert from Millimeter (mm) to Centimeters (cm) and vice versa. What is a Millimeter? The Millimetre (international spelling; SI unit symbol mm) or millimeter (American spelling) is a unit of length in the metric system, equal to one-thousandth of a meter, which is the SI base unit of length. Therefore, there are one thousand millimeters in a meter and ten millimeters in a centimeter. What is a Centimeter? A Centimeter (abbreviation, cm) is a unit for measuring length in the metric system of measurement. A Centimeter is equal to one hundredth of a metre (1/100). The centimetre remains a practical unit of length for many everyday measurements of the length of objects and small distances. A meter consists of 100 centimeters, a square meter consists of 10,000 square centimeters, and a cubic meter consists of 1,000,000 cubic centimeters. How to Convert Millimeter to Centimeters? To convert Millimeter to Centimeters, simply divide the Millimeter value by 10. The formula used to calculate Millimeter to Centimeters - d(mm) = d(cm) / 10 The distance d in Centimeters (cm) is equal to the distance d in Millimeters (mm) divided by 10. How many Centimeters in a Millimeter In simple terms, 1 mm is equal to 0.1 cm. The formula used is 1/10 = 0.1(cm) How many Millimeters in a Centimeter 1 Centimeter is equal to 10 Millimeters. So we can also say that there are 10 Millimeters in a Centimeter. Millimeter to Centimeters Conversion Table Millimeter (mm)Centimeter (cm) 0.01 (mm) 0.02 (mm) 0.03 (mm) 0.04 (mm) 0.05 (mm) 1 (mm) 2 (mm) 3 (mm) 4 (mm) 5 (mm) 6 (mm) 7 (mm) 8 (mm) 9 (mm) 10 (mm) 20 (mm) 30 (mm) 40 (mm) 50 (mm) 60 (mm) 70 (mm) 80 (mm) 90 (mm) 100 (mm) 200 (mm) 300 (mm) 400 (mm) 500 (mm) 600 (mm) 700 (mm) 800 (mm) 900 (mm) 1000 (mm) 5000 (mm) 10000 (mm)
539
1,870
{"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-49
latest
en
0.777418
https://superstitionfarmtours.com/flash-cards/stats
1,527,112,677,000,000,000
text/html
crawl-data/CC-MAIN-2018-22/segments/1526794865830.35/warc/CC-MAIN-20180523215608-20180523235608-00558.warc.gz
653,842,362
8,662
stats what are some reasons for different scores of people on baseline readings? individual differences, researcher error and chance factors what are chance factors? factors which can have an effect on results but cannot be mitigated for (I.e. rained on one day, not the other) what is the collective name for individual differences, researcher error and chance factors? these are known as experimental errors. what is another name for experimental error? within group variation what are the reasons for between group variations? treatment effect and experimental error what is F ratio? the statistical test to see the effect of our treatment what is the formula for F ratio? between subjects variation over within subjects variation. what would we expect the result of F to be if there was no treatment effects we would expect F to be 1, or pretty close to it. what is the null hypothesis? that there will be no treatment effects. what is alpha level? alpha level is another word for p what is a type one error? that we have rejected the null hypothesis wrongly. what are the assumptions which must be met before we can do between subjects anova? assumption of normalityassumption of independenceassumption of equal variance violation of which assumption invalidates a between subject design? independence what is the assumption of normality? this assumption that the dependant variable is normally distributed in each of the conditions/groups. what is the assumption of independence? that individual observations are independent within groups and between groups. what is the assumption of equal variance? (homogeneity of variance) that the experimental error (I.e. within group variability) is approximately equal in each group. what test can we use to see if homogeneity of variance is met? F max test how do we calculate F max test? Fmax = largest variance over smallest variance. If if the results are greater than 3 than a correction must be made to alpha level. The usual way is to divide alpha by 2.
400
2,008
{"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.84375
3
CC-MAIN-2018-22
longest
en
0.956805
http://mathhelpforum.com/differential-geometry/160182-heine-borel-theorem.html
1,524,149,228,000,000,000
text/html
crawl-data/CC-MAIN-2018-17/segments/1524125936969.10/warc/CC-MAIN-20180419130550-20180419150550-00533.warc.gz
202,193,065
11,883
1. Heine-Borel Theorem Hi, I am trying to understand the first proof "A set S of real numbers is compact if and only if every open cover C of S can be reduced to a finite subcovering. " on this page: Theorem 5.2.6: Heine-Borel Theorem But I don't understand towards the end when they say "However, aN+1 is an element of S, so that this subcovering can not cover S." How do we know aN+1 is an element of S? 2. That is an incredibly non-standard way of defining a compact set. Compact sets have the property that every open cover has a finite subcover. This is the best way of defining compact sets, because it is more generally applicable than defining compact sets as closed and bounded, as the web page you've linked to appears to do. You know that $\displaystyle a_{N+1}\in S$ by construction. Look at the bullet point: $\displaystyle \text{ for any }n>1\;\text{there exists }\mathbf{a_{n}\in S}\;\text{with...}$ 3. "Compact", defined as "every open cover has a finite subcover", can be defined in any topological space. It can be shown that any compact set is closed. Even to define "bounded" requires a metric space rather than a general topological space but in a metric space, it can be proven that any compact set is bounded. The other way, that all closed and bounded sets are "compact" (in this sense) requires the real number system or space derived from the real numbers because the proof requires the "completeness" property of the real numbers. That is why Ackbeet says that "closed and bounded" is "an incredibly non-standard way of defining a compact set". 4. hmmm okay, I guess I'm just trying to visualize how they justify that for any n > 1 there exists an S with | s - an | < 1 / n because every neighborhood of s must contain elements from S. I understand that every point in S has a neighbourhood in S, but why does this property allow us to make An sufficiently large? (We defined a compact set in class like they did too... my prof said compact means closed an bounded, and so he wanted us to show how it was closed by contradiction, and so this link looks like a similiar method, but I'm just trying to understand it.) 5. why does this property allow us to make An sufficiently large? They're not "sufficiently large". In fact, the $\displaystyle a_{n}$'s are getting closer and closer to $\displaystyle s$. my prof said compact means closed an bounded In the more typical "compact defined as open covers have finite subcovers" definition, compact always implies closed and bounded, but in some metric spaces, closed and bounded does not imply compact. Compact is a stronger condition in some metric spaces. 6. Originally Posted by Ackbeet They're not "sufficiently large". In fact, the $\displaystyle a_{n}$'s are getting closer and closer to $\displaystyle s$. Ohh okay, so for example, (s - A1000) < 1/1000 ... so the An is just any point getting closer and closer to s. So now, if C = { comp([s - 1/n, s + 1/n]), n > 0 } ... C should be finite and open and includes everything but s? So I don't understand why C couldn't include An+1. I must be picturing it wrong. Like, I picture S as something like S: ---(-------)--- last bracket ")" would be where s is located. And C: --------)(------------ where s i located at )( . So why can't C include all points around s like S? 7. C should be finite and open and includes everything but s? C is not a finite collection of sets, it is an infinite collection of sets. Every set in the collection C is open, because every set in the collection C is the complement of a closed set. For any point in S that is not s, it is in at least one set in the collection C, because $\displaystyle \cup C=S\setminus\{s\}.$ C contains a set that includes $\displaystyle A_{N+1}.$ C contains at least one set that includes all of the $\displaystyle A_{n}$'s. However, because C is an open cover of S, and because you have assumed that every open cover of S has a finite subcover, that implies that $\displaystyle A_{N+1}$ is not in the finite subcover that you have assumed exists. That is the main point here. You have then found a point in S that is not in the supposedly finite subcover. Hence it's not really a finite subcover, because it doesn't contain every point of S. Make sense?
1,054
4,265
{"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}
3.609375
4
CC-MAIN-2018-17
latest
en
0.954624
https://la.mathworks.com/matlabcentral/cody/problems/1038-change-the-sign-of-even-index-entries-of-the-reversed-vector/solutions/1216791
1,582,614,670,000,000,000
text/html
crawl-data/CC-MAIN-2020-10/segments/1581875146033.50/warc/CC-MAIN-20200225045438-20200225075438-00295.warc.gz
431,583,578
16,158
Cody # Problem 1038. Change the sign of even index entries of the reversed vector Solution 1216791 Submitted on 20 Jun 2017 by Augusto Mazzei This solution is locked. To view this solution, you need to provide a solution of the same size or smaller. ### Test Suite Test Status Code Input and Output 1   Pass x = [4 -5 -2 9]; y_correct = [9 2 -5 -4]; assert(isequal(your_fcn_name(x),y_correct)) y = 9 -2 -5 4 y = 9 2 -5 -4 2   Pass x = ones(1,4); y_correct = [1 -1 1 -1]; assert(isequal(your_fcn_name(x),y_correct)) y = 1 1 1 1 y = 1 -1 1 -1 3   Pass x = 1:10; y_correct = [10 -9 8 -7 6 -5 4 -3 2 -1]; assert(isequal(your_fcn_name(x),y_correct)) y = 10 9 8 7 6 5 4 3 2 1 y = 10 -9 8 -7 6 -5 4 -3 2 -1 4   Pass x = 2:2:12; y_correct = [12 -10 8 -6 4 -2]; assert(isequal(your_fcn_name(x),y_correct)) y = 12 10 8 6 4 2 y = 12 -10 8 -6 4 -2 5   Pass x = -3:3; y_correct = [3 -2 1 0 -1 2 -3]; assert(isequal(your_fcn_name(x),y_correct)) y = 3 2 1 0 -1 -2 -3 y = 3 -2 1 0 -1 2 -3 6   Pass x = [1 1 2 3 5 8 13 21 34 55 89 144]; y_correct = [144 -89 55 -34 21 -13 8 -5 3 -2 1 -1]; assert(isequal(your_fcn_name(x),y_correct)) y = 144 89 55 34 21 13 8 5 3 2 1 1 y = 144 -89 55 -34 21 -13 8 -5 3 -2 1 -1 7   Pass x = [1 0 1 0 1 0 1 0 1 0 1 0]; y_correct = [0 -1 0 -1 0 -1 0 -1 0 -1 0 -1]; assert(isequal(your_fcn_name(x),y_correct)) y = 0 1 0 1 0 1 0 1 0 1 0 1 y = 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 8   Pass x = [0 1 0 2 0 3 0 4 0 5 0 6]; y_correct = [6 0 5 0 4 0 3 0 2 0 1 0]; assert(isequal(your_fcn_name(x),y_correct)) y = 6 0 5 0 4 0 3 0 2 0 1 0 y = 6 0 5 0 4 0 3 0 2 0 1 0 9   Pass x = [0 1 0 1 0 1 0 1 0 1 0 1]; y_correct = [x(2:end) x(1)]; assert(isequal(your_fcn_name(x),y_correct)) y = 1 0 1 0 1 0 1 0 1 0 1 0 y = 1 0 1 0 1 0 1 0 1 0 1 0
928
1,752
{"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.4375
3
CC-MAIN-2020-10
latest
en
0.48284
https://askfilo.com/physics-question-answers/a-total-charge-q-is-broken-in-two-parts-q-1-and-q-neu
1,709,278,988,000,000,000
text/html
crawl-data/CC-MAIN-2024-10/segments/1707947475203.41/warc/CC-MAIN-20240301062009-20240301092009-00229.warc.gz
113,775,165
56,808
World's only instant tutoring platform Question Easy Solving time: 2 mins A total charge Q is broken in two parts and and they are placed at a distance R from each other. The maximum force of repulsion between them will occur, when A B C D Found 6 tutors discussing this question Discuss this question LIVE 9 mins ago Text solutionVerified (i) and .... (ii) From (i) and (ii) For F to be maximum 35 Share Report Filo tutor solutions (38) Learn from their 1-to-1 discussion with Filo tutors. 13 mins 126 Share Report 6 mins 62 Share Report 3 mins 66 Share Report One destination to cover all your homework and assignment needs Learn Practice Revision Succeed Instant 1:1 help, 24x7 60, 000+ Expert tutors Textbook solutions Big idea maths, McGraw-Hill Education etc Essay review Get expert feedback on your essay Schedule classes High dosage tutoring from Dedicated 3 experts Trusted by 4 million+ students Stuck on the question or explanation? Connect with our Physics tutors online and get step by step solution of this question. 231 students are taking LIVE classes Question Text A total charge Q is broken in two parts and and they are placed at a distance R from each other. The maximum force of repulsion between them will occur, when Updated On Oct 24, 2023 Topic Electric Charges and Fields Subject Physics Class Class 12 Answer Type Text solution:1 Video solution: 38 Upvotes 3818 Avg. Video Duration 7 min
352
1,433
{"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-2024-10
latest
en
0.871625
https://www.toppr.com/ask/question/give-examples-of-polynomials-px-gx-qx-and-rx-which/
1,670,006,176,000,000,000
text/html
crawl-data/CC-MAIN-2022-49/segments/1669446710916.40/warc/CC-MAIN-20221202183117-20221202213117-00537.warc.gz
1,097,012,313
25,431
Question # Give examples of polynomials and , which satisfy the division algorithm and (i) deg deg  (ii) deg deg (iii) deg Medium Solution Verified by Toppr ## (i) deg p(x) = deg q(x) We know the formula, Dividend = Divisor x quotient + Remainder So here the degree of quotient will be equal to degree of dividend when the divisor is constant. Let us assume the division of by . Here, and Degree of and is the same i.e., . Checking for division algorithm, Hence, the division algorithm is satisfied. (ii) deg q(x) = deg r(x) Let us assume the division of by , Here, p(x) = , g(x) = , q(x) = x and r(x) = x Degree of q(x) and r(x) is the same i.e., 1. Checking for division algorithm, Hence, the division algorithm is satisfied. (iii) deg r(x) = 0 Degree of remainder will be 0 when remainder comes to a constant. Let us assume the division of by Here, p(x) = g(x) = and Degree of is Checking for division algorithm, Hence, the division algorithm is satisfied. Video Explanation Solve any question of Polynomials with:- Was this answer helpful? 0 0
276
1,051
{"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.09375
4
CC-MAIN-2022-49
latest
en
0.890264
https://simplywall.st/stocks/au/media/asx-dhg/domain-holdings-australia-shares/news/calculating-the-fair-value-of-domain-holdings-australia-limited-asxdhg/
1,550,459,663,000,000,000
text/html
crawl-data/CC-MAIN-2019-09/segments/1550247484020.33/warc/CC-MAIN-20190218013525-20190218035525-00446.warc.gz
724,913,666
15,598
# Calculating The Fair Value Of Domain Holdings Australia Limited (ASX:DHG) In this article I am going to calculate the intrinsic value of Domain Holdings Australia Limited (ASX:DHG) by taking the expected future cash flows and discounting them to today’s value. I will be using the Discounted Cash Flows (DCF) model. Don’t get put off by the jargon, the math behind it is actually quite straightforward. Anyone interested in learning a bit more about intrinsic value should have a read of the Simply Wall St analysis model. If you are reading this and its not October 2018 then I highly recommend you check out the latest calculation for Domain Holdings Australia by following the link below. ### The calculation I use what is known as a 2-stage model, which simply means we have two different periods of varying growth rates for the company’s cash flows. Generally the first stage is higher growth, and the second stage is a more stable growth phase. In the first stage we need to estimate the cash flows to the business over the next five years. For this I used the consensus of the analysts covering the stock, as you can see below. The sum of these cash flows is then discounted to today’s value. #### 5-year cash flow forecast 2019 2020 2021 2022 2023 Levered FCF (A\$, Millions) A\$67.33 A\$80.00 A\$88.50 A\$93.47 A\$122.00 Source Analyst x3 Analyst x3 Analyst x2 Analyst x2 Analyst x1 Present Value Discounted @ 8.55% A\$62.03 A\$67.89 A\$69.18 A\$67.31 A\$80.93 Present Value of 5-year Cash Flow (PVCF)= AU\$347m After calculating the present value of future cash flows in the intial 5-year period we need to calculate the Terminal Value, which accounts for all the future cash flows beyond the first stage. The Gordon Growth formula is used to calculate Terminal Value at an annual growth rate equal to the 10-year government bond rate of 2.8%. We discount this to today’s value at a cost of equity of 8.6%. Terminal Value (TV) = FCF2022 × (1 + g) ÷ (r – g) = AU\$122m × (1 + 2.8%) ÷ (8.6% – 2.8%) = AU\$2.2b Present Value of Terminal Value (PVTV) = TV / (1 + r)5 = AU\$2.2b ÷ ( 1 + 8.6%)5 = AU\$1.4b The total value, or equity value, is then the sum of the present value of the cash flows, which in this case is AU\$1.8b. To get the intrinsic value per share, we divide this by the total number of shares outstanding, or the equivalent number if this is a depositary receipt or ADR. This results in an intrinsic value of A\$3.08. Relative to the current share price of A\$3.32, the stock is fair value, maybe slightly overvalued at the time of writing. ### Important assumptions Now the most important inputs to a discounted cash flow are the discount rate, and of course, the actual cash flows. If you don’t agree with my result, have a go at the calculation yourself and play with the assumptions. Because we are looking at Domain Holdings Australia as potential shareholders, the cost of equity is used as the discount rate, rather than the cost of capital (or weighed average cost of capital, WACC) which accounts for debt. In this calculation I’ve used 8.6%, which is based on a levered beta of 0.800. This is derived from the Bottom-Up Beta method based on comparable companies, with an imposed limit between 0.8 and 2.0, which is a reasonable range for a stable business. ### Next Steps: Although the valuation of a company is important, it shouldn’t be the only metric you look at when researching a company. For DHG, I’ve compiled three important factors you should further examine: 1. Financial Health: Does DHG have a healthy balance sheet? Take a look at our free balance sheet analysis with six simple checks on key factors like leverage and risk. 2. Future Earnings: How does DHG’s growth rate compare to its peers and the wider market? Dig deeper into the analyst consensus number for the upcoming years by interacting with our free analyst growth expectation chart. 3. Other High Quality Alternatives: Are there other high quality stocks you could be holding instead of DHG? Explore our interactive list of high quality stocks to get an idea of what else is out there you may be missing! PS. The Simply Wall St app conducts a discounted cash flow for every stock on the ASX every 6 hours. If you want to find the calculation for other stocks just search here. To help readers see past the short term volatility of the financial market, we aim to bring you a long-term focused research analysis purely driven by fundamental data. Note that our analysis does not factor in the latest price-sensitive company announcements. The author is an independent contributor and at the time of publication had no position in the stocks mentioned. For errors that warrant correction please contact the editor at editorial-team@simplywallst.com.
1,128
4,777
{"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-2019-09
latest
en
0.907564
http://ebook.worldlibrary.net/articles/eng/Accelerated_reference_frame
1,560,835,295,000,000,000
text/html
crawl-data/CC-MAIN-2019-26/segments/1560627998607.18/warc/CC-MAIN-20190618043259-20190618065259-00132.warc.gz
57,263,583
20,747
### Accelerated reference frame A non-inertial reference frame is a frame of reference that is undergoing acceleration with respect to an inertial frame.[1] An accelerometer at rest in a non-inertial frame will in general detect a non-zero acceleration. In a curved spacetime all frames are non-inertial. The laws of motion in non-inertial frames do not take the simple form they do in inertial frames, and the laws vary from frame to frame depending on the acceleration.[2][3] To explain the motion of bodies entirely within the viewpoint of non-inertial reference frames, fictitious forces (also called inertial forces, pseudo-forces[4] and d'Alembert forces) must be introduced to account for the observed motion, such as the Coriolis force or the centrifugal force, as derived from the acceleration of the non-inertial frame.[5] As stated by Goodman and Warner, "One might say that F = ma holds in any coordinate system provided the term 'force' is redefined to include the so-called 'reversed effective forces' or 'inertia forces'."[6] ## Avoiding fictitious forces in calculations In flat spacetime, the use of non-inertial frames can be avoided if desired. Measurements with respect to non-inertial reference frames can always be transformed to an inertial frame, incorporating directly the acceleration of the non-inertial frame as that acceleration is seen from the inertial frame.[7] This approach avoids use of fictitious forces (it is based on an inertial frame, where fictitious forces are absent, by definition) but it may be less convenient from an intuitive, observational, and even a calculational viewpoint.[8] As pointed out by Ryder for the case of rotating frames as used in meteorology:[9] A simple way of dealing with this problem is, of course, to transform all coordinates to an inertial system. This is, however, sometimes inconvenient. Suppose, for example, we wish to calculate the movement of air masses in the earth's atmosphere due to pressure gradients. We need the results relative to the rotating frame, the earth, so it is better to stay within this coordinate system if possible. This can be achieved by introducing fictitious (or "non-existent") forces which enable us to apply Newton's Laws of Motion in the same way as in an inertial frame. —Peter Ryder, Classical Mechanics, pp. 78-79 ## Detection of a non-inertial frame: need for fictitious forces That a given frame is non-inertial can be detected by its need for fictitious forces to explain observed motions.[10][11][12][13][14] For example, the rotation of the Earth can be observed using a Foucault pendulum.[15] The rotation of the Earth seemingly causes the pendulum to change its plane of oscillation because the surroundings of the pendulum move with the Earth. As seen from an Earth-bound (non-inertial) frame of reference, the explanation of this apparent change in orientation requires the introduction of the fictitious Coriolis force. Another famous example is that of the tension in the string between two spheres rotating about each other.[16][17] In that case, prediction of the measured tension in the string based upon the motion of the spheres as observed from a rotating reference frame requires the rotating observers to introduce a fictitious centrifugal force. In this connection, it may be noted that a change in coordinate system, for example, from Cartesian to polar, if implemented without any change in relative motion, does not cause the appearance of fictitious forces, despite the fact that the form of the laws of motion varies from one type of curvilinear coordinate system to another. ## Fictitious forces in curvilinear coordinates A different use of the term "fictitious force" often is used in curvilinear coordinates, particularly polar coordinates. To avoid confusion, this distracting ambiguity in terminologies is pointed out here. These so-called "forces" are non-zero in all frames of reference, inertial or non-inertial, and do not transform as vectors under rotations and translations of the coordinates (as all Newtonian forces do, fictitious or otherwise). This incompatible use of the term "fictitious force" is unrelated to non-inertial frames. These so-called "forces" are defined by determining the acceleration of a particle within the curvilinear coordinate system, and then separating the simple double-time derivatives of coordinates from the remaining terms. These remaining terms then are called "fictitious forces". More careful usage calls these terms "generalized fictitious forces" to indicate their connection to the generalized coordinates of Lagrangian mechanics. The application of Lagrangian methods to polar coordinates can be found here. ## Relativistic point of view ### Frames and flat spacetime If a region of spacetime is declared to be Euclidean, and effectively free from obvious gravitational fields, then if an accelerated coordinate system is overlaid onto the same region, it can be said that a uniform fictitious field exists in the accelerated frame (we reserve the word gravitational for the case in which a mass is involved). An object accelerated to be stationary in the accelerated frame will "feel" the presence of the field, and they will also be able to see environmental matter with inertial states of motion (stars, galaxies, etc.) to be apparently falling "downwards" in the field along curved trajectories as if the field is real. In frame-based descriptions, this supposed field can be made to appear or disappear by switching between "accelerated" and "inertial" coordinate systems. As the situation is modeled in finer detail, using the general principle of relativity, the concept of a frame-dependent gravitational field becomes less realistic. In these Machian models, the accelerated body can agree that the apparent gravitational field is associated with the motion of the background matter, but can also claim that the motion of the material as if there is a gravitational field, causes the gravitational field - the accelerating background matter "drags light". Similarly, a background observer can argue that the forced acceleration of the mass causes an apparent gravitational field in the region between it and the environmental material (the accelerated mass also "drags light"). This "mutual" effect, and the ability of an accelerated mass to warp lightbeam geometry and lightbeam-based coordinate systems, is referred to as frame-dragging. Frame-dragging removes the usual distinction between accelerated frames (which show gravitational effects) and inertial frames (where the geometry is supposedly free from gravitational fields). When a forcibly-accelerated body physically "drags" a coordinate system, the problem becomes an exercise in warped spacetime for all observers.
1,384
6,794
{"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.28125
3
CC-MAIN-2019-26
latest
en
0.901857
http://techutils.in/tag/mathematics/
1,508,455,881,000,000,000
text/html
crawl-data/CC-MAIN-2017-43/segments/1508187823482.25/warc/CC-MAIN-20171019231858-20171020011858-00732.warc.gz
339,361,363
39,325
#StackBounty: #c# #mathematics #projectile-physics #trajectory #aiming Projectile Aim Prediction with Acceleration Bounty: 50 I’m trying to solve the classic shoot moving object problem but with acceleration attached to that changes it from a quadratic to quartic formula but my math skills are not this good sadly as i prefer to speak in code and not formulas. i found this https://wiki.beyondunreal.com/Legacy:Projectile_Aiming. i ported it and it’s almost what i’m looking for but missing control over the acceleration as its only made for gravity or no gravity and even this i got working only with tricks and modifying it without knowing what i’m doing is getting me only that far. I made myself a Prototype Interface for the minimum of what i’m trying to get out of it public class PredictionResult { public bool IsInRange; // can we even hit the target? public Vector3[] ShotVelocity; // should be up to 4 possible values public float[] ShotImpactTime; // how long each shot takes to arrive at the predicted target public Vector3[] ShotImpactLocation; // somewhat redundant yet still useful if available } // only really the delta between start and target matter but its up to the function // same for startVel and targetVel where startVel is the shooters speed that gets added to the bullet // the bullet and target can have different accelerations (standing on ground => no gravity or bullet is not affect by gravity) public PredictionResult ShootAtTarget(Vector3 start, Vector3 target, Vector3 startVel, Vector3 targetVel, Vector3 bulletAccel, Vector3 targetAccel, float bulletSpeed); any help solving this would be great Get this bounty!!! Introduction I’m creating a game where the player can obtain 1 to 3 stars for each level based on the score it gets (based on the completion time). The levels are grouped in “worlds” each of which is unlocked when the user obtains a given number of stars in the previous levels. For example, world 1 has 5 levels and to unlock world 2 the user needs to gain at least 5 stars (thus at leas one star per level in average). Here is a basic idea of the words -> n° of levels in that world -> stars to unlock 1 -> 5 -> 0 (of course) 2 -> 5 -> 5 / 15 (33%) 3 -> 5 -> 10 / 30 (33%) 4 -> 7 -> 25 / 45 (55%) 5 -> 7 -> 30 / 66 (45%) ... To determine the score you should reach, for each level, to get 0 / 1 / 2 / 3 stars, I recorded some play stats from a bunch of beta-testers obtaining a normal distribution of play times for each level. Given each distribution, I should be able to answer this question for each level: at what score should I reward n stars in order for x% of the player to get n stars overall? Tuning So now I can change the thresholds for each star at each level (or group of levels) in order to filter the percentage of players that will obtain a given number of stars at some point. This way I can set the game difficulty as the difficulty to unlock a given world which is the percentage of people who are good enough to gain enough stars to unlock that world. For example for early world progress difficulty, I chose a base of 1.22 as exponential base of the percentage reduction (difficulty growth), like this: world -> difficulty coeff. -> perc. players 1 -> 0 -> 100% 2 -> 1.22 -> 98.78% 3 -> 1.4884 -> 98.5116% 4 -> 1.815848 -> 98.184152% 5 -> 2.21533456 -> 97.78466544% ... This way, for example, the last world should be reached by about 47% of the players. Now I want to know how to tune percentages of people gaining 1 / 2 / 3 stars in order to stick to this given percentage progression. In order to do this, I found the minimal configurations of possible stars obtained in each world level in order to unlock the next one, for example: world -> n° 1 stars -> n° 2 stars -> n° 3 stars -> stars to unlock next world 1 -> 5 -> 0 -> 0 -> 5 2 -> 10 -> 0 -> 0 -> 10 3 -> 5 -> 10 -> 0 -> 25 4 -> 12 -> 10 -> 0 -> 30 5 -> 18 -> 11 -> 0 -> 40 ... Note that if the user got 10 x 2 stars in the previous world, then it still has those 10 x 2 stars in later worlds, unless it tops them wit 3 stars. My Calculations Now, for example, if I want 98.78% of the players to be able to unlock the second world, given they have to obtain minimum 1 star at each previous level, then p^5 = 0.9878 and p = rad(5, 0.9878) ≈ 0.9975, so 99.75% of the players should be able to get at leas 1 star in each level of the first world. For the third world, things get a little harder, as the 1 star probabilities for the first 5 levels are locked now. Players must be able to obtain at least 1 star in each of the 10 levels of the first two worlds with an overall probability of 98.5116%, but the probability to obtain 1 star in the first 5 levels is locked at 99.75%, with an overall probability of obtaining 1 star in each of the first 5 levels of 98.78%. So I had to solve this equation: p * 0.9878 = 0.985116 so p = 0.985116 / 0.9878 = 0.9973 which is the probability p to get at leas 1 star in all the 5 levels of the second world. So the probability to obtain 1 star for each single level of the second world is p = rad(5, 0.9973) = 0.9995 which is slightly higher than the previous world. Fourth world gets even weirder, as the restrictions shifts on the 10 x 2 stars that players need to obtain in the 15 previous levels. To do this, I used binomial distribution to find the probability to extract at least 10 successes over 15 attempts which gave a probability of 58.79% to obtain 2 stars in each of the 15 levels of the first 3 worlds in order to have a 98.184% probability to finish the third world with at leas 10 x 2 stars. Fifth world differs from fourth only by 7 x 1 star so I just calculated p * 0.98184 = 0.97784 where p is the probability to obtain 1 star in each of the 7 levels of the fifth world, obtaining a probability to obtain 1 star for each single level of the fifth world of 99.50%. Problems Now I’m stuck at world 6 where the user is required to obtain at least 11 x 2 stars. How do I calculate this probability? I can use the binomial distribution, but the probabilities of the events are not the same everywhere as the probability to obtain 2 stars in the first 5 words is locked. Is there any formula to help me with this? Is there any simpler / more direct approach I can fallow? Does any of this make any sense at all? Get this bounty!!! #StackBounty: #books #exercises #mathematics Math book: how to write Exercise and Answers Bounty: 50 EDIT within documentclass[12pt]{book}I want to create chapter-wise exercises and put all the solutions (with or without hints) at the end of the book. The answer should include page No of the exercise as given in the attached jpg file. I want to do this in simple and non-tedious way like: For the input of the questions, I just want to add questionfor each question and similar for answer, but all the answer should come at the end of the book. Exercise style: Solution stype: Get this bounty!!! #HackerRank: Computing the Correlation Problem You are given the scores of N students in three different subjects – MathematicsPhysics and Chemistry; all of which have been graded on a scale of 0 to 100. Your task is to compute the Pearson product-moment correlation coefficient between the scores of different pairs of subjects (Mathematics and Physics, Physics and Chemistry, Mathematics and Chemistry) based on this data. This data is based on the records of the CBSE K-12 Examination – a national school leaving examination in India, for the year 2013. Pearson product-moment correlation coefficient This is a measure of linear correlation described well on this Wikipedia page. The formula, in brief, is given by: where x and y denote the two vectors between which the correlation is to be measured. Input Format The first row contains an integer N. This is followed by N rows containing three tab-space (‘\t’) separated integers, M P C corresponding to a candidate’s scores in Mathematics, Physics and Chemistry respectively. Each row corresponds to the scores attained by a unique candidate in these three subjects. Input Constraints 1 <= N <= 5 x 105 0 <= M, P, C <= 100 Output Format The output should contain three lines, with correlation coefficients computed and rounded off correct to exactly 2 decimal places. The first line should contain the correlation coefficient between Mathematics and Physics scores. The second line should contain the correlation coefficient between Physics and Chemistry scores. The third line should contain the correlation coefficient between Chemistry and Mathematics scores. So, your output should look like this (these values are only for explanatory purposes): 0.12 0.13 0.95 Test Cases There is one sample test case with scores obtained in Mathematics, Physics and Chemistry by 20 students. The hidden test case contains the scores obtained by all the candidates who appeared for the examination and took all three tests (Mathematics, Physics and Chemistry). Think: How can you efficiently compute the correlation coefficients within the given time constraints, while handling the scores of nearly 400k students? Sample Input 20 73 72 76 48 67 76 95 92 95 95 95 96 33 59 79 47 58 74 98 95 97 91 94 97 95 84 90 93 83 90 70 70 78 85 79 91 33 67 76 47 73 90 95 87 95 84 86 95 43 63 75 95 92 100 54 80 87 72 76 90 Sample Output 0.89 0.92 0.81 There is no special library support available for this challenge. What is the difference between linear regression on y with x and x with y? The Pearson correlation coefficient of x and y is the same, whether you compute pearson(x, y) or pearson(y, x). This suggests that doing a linear regression of y given x or x given y should be the same, but that’s the case. The best way to think about this is to imagine a scatter plot of points with y on the vertical axis and x represented by the horizontal axis. Given this framework, you see a cloud of points, which may be vaguely circular, or may be elongated into an ellipse. What you are trying to do in regression is find what might be called the ‘line of best fit’. However, while this seems straightforward, we need to figure out what we mean by ‘best’, and that means we must define what it would be for a line to be good, or for one line to be better than another, etc. Specifically, we must stipulate a loss function. A loss function gives us a way to say how ‘bad’ something is, and thus, when we minimize that, we make our line as ‘good’ as possible, or find the ‘best’ line. Traditionally, when we conduct a regression analysis, we find estimates of the slope and intercept so as to minimize the sum of squared errors. These are defined as follows: In terms of our scatter plot, this means we are minimizing the sum of the vertical distances between the observed data points and the line. On the other hand, it is perfectly reasonable to regress x onto y, but in that case, we would put x on the vertical axis, and so on. If we kept our plot as is (with x on the horizontal axis), regressing x onto y (again, using a slightly adapted version of the above equation with x and y switched) means that we would be minimizing the sum of the horizontal distances between the observed data points and the line. This sounds very similar, but is not quite the same thing. (The way to recognize this is to do it both ways, and then algebraically convert one set of parameter estimates into the terms of the other. Comparing the first model with the rearranged version of the second model, it becomes easy to see that they are not the same.) Note that neither way would produce the same line we would intuitively draw if someone handed us a piece of graph paper with points plotted on it. In that case, we would draw a line straight through the center, but minimizing the vertical distance yields a line that is slightly flatter (i.e., with a shallower slope), whereas minimizing the horizontal distance yields a line that is slightly steeper. A correlation is symmetrical x is as correlated with y as y is with x. The Pearson product-moment correlation can be understood within a regression context, however. The correlation coefficient, r, is the slope of the regression line when both variables have been standardized first. That is, you first subtracted off the mean from each observation, and then divided the differences by the standard deviation. The cloud of data points will now be centered on the origin, and the slope would be the same whether you regressed y onto x, or x onto y. Now, why does this matter? Using our traditional loss function, we are saying that all of the error is in only one of the variables (viz., y). That is, we are saying that x is measured without error and constitutes the set of values we care about, but that y has sampling error. This is very different from saying the converse. This was important in an interesting historical episode: In the late 70’s and early 80’s in the US, the case was made that there was discrimination against women in the workplace, and this was backed up with regression analyses showing that women with equal backgrounds (e.g., qualifications, experience, etc.) were paid, on average, less than men. Critics (or just people who were extra thorough) reasoned that if this was true, women who were paid equally with men would have to be more highly qualified, but when this was checked, it was found that although the results were ‘significant’ when assessed the one way, they were not ‘significant’ when checked the other way, which threw everyone involved into a tizzy. See here for a famous paper that tried to clear the issue up.
3,320
13,663
{"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.890625
3
CC-MAIN-2017-43
latest
en
0.87054
https://www.jiskha.com/members/profile/posts.cgi?name=Liliana
1,501,255,142,000,000,000
text/html
crawl-data/CC-MAIN-2017-30/segments/1500550969387.94/warc/CC-MAIN-20170728143709-20170728163709-00510.warc.gz
805,255,671
8,542
# Posts by Liliana Total # Posts: 87 English please can you help to me with write a news report based in ROcket club sets New launch record. I can not understand how I have to write? MATH #1 is D.divide language arts In which sentence is the italicized word an adjective. A. Evening bats feed GREEDILY on insects. B. They appear in the sky just AFTER sunset. C. These bats are among the SMALLEST of the spacies. D. Their fingers RESEMBLE those of human hands. Math Diameter of the reel is 3cm circumference(C) of the reel = TTD = 3TT cm No.of times the cotton go around the reel= length of the cotton/C = 0.91 m / 3TT cm = 91cm / 3x 3.14 cm---------------> 100cm =1m = 9.66 so,the cotton will go around (approximatly)10 times around the ... help plzz asap Train A leaves Westtown and travels at 50 mph toward Smithville, 330 miles away. At the same time, Train B leaves Smithville and travels at 60 mph toward Westtown. After how many hours do the two trains meet? Enter your answer in the box. math plzz help Train A leaves Westtown and travels at 50 mph toward Smithville, 330 miles away. At the same time, Train B leaves Smithville and travels at 60 mph toward Westtown. After how many hours do the two trains meet? Enter your answer in the box. MATH HELP PLZZ ASAP Julio's father is 4 times as old as Julio. The sum of their ages is no less than 55. Enter an inequality that can be used to represent this situation in the first box, where x represents Julio's age. Enter the youngest age Julio can be in the second box. math help azap Select all of the expressions that are equivalent to 1/3(−5x−6/2)−7/8 . A.−20x−45/24 B.−5x−6/6−7/8 C.−8x/24+21/24 D.5x−6−21/12 algerbra help azap like i want to help her but i might get her the wrong answer algerbra help azap um ms. sue bella's question is very hard i don't know the answer to it could u help her algerbra help azap thank u so soo so much algerbra help azap wat im thinking and i mostly thinking is d algerbra help azap Ten times a number, x, is one-half the sum of the number and three. Which equations represents this situation? A.10x=1/2x+3 B.10x+1/2x+3 C.10x+1/2(x+3) D.10x=1/2(x+3) Algerbra oh ok thank u could u help me with another plz Algerbra so the answer is c im confuse?? Algerbra wat i think is b. Algerbra Which equation represents the situation? The sum of three consecutive even integers is 24. A.x+(x+2)+(x+2)=24 B.x+(x+4)+(x+6)=24 C.x+(x+2)+(x+4)=24 D.x+(x+1)+(x+2)=24 algebra hi damon do u go to brainly gum help asap but ty gum help asap i don't get ur question gum help asap Which best completes the sentence? The damage from the storm is __________ than we thought. A. baddest B. worse C. worst gum help azap!! Which verb correctly completes the sentence? This essay __________ the history of the Olympics. A. describe B. describes gum Which verb correctly completes the sentence? On the magazine cover, a baby with chubby cheeks __________ directly at the camera. A. smile B. smiles math help azap well i think that's the graph that i posted of the vinilla and choclate but im confuse math help azap The two-way table shows poll results for preferred flavor of ice cream, vanilla or chocolate, and preferred topping, sprinkles or nuts. Of the people polled, how many chose vanilla ice cream? Sprinkles Nuts Vanilla 9 2 Chocolate 6 7 Geography of Arabia and Iraq thank you azra i got 100% Global Studies: URGENT thanks i got 100% too. math geometry Help me I don't get this math homework math 5/5 ------ = 1/4 20/5 5*5 ---- = 1/4 20*5 this is only half of it the other answer is 25/100. Science #5 is C math help azap Which expressions are equivalent to 17^5÷(17^6)(17^−3)/17^−2? Select all that are correct. a.1/5^0 b.1/17^1 c.(−1)^5 d.17^1 e.(−1)^2 math ty so much math Which statement is true about the value of (5−n)(5n)? a.For all n, the value of the expression is 0. b.For n<0, the value of the expression is greater than 1. c.For n<0, the value of the expression is less than 1. d.For all n, the value of the expression is 1. What is the least possible value of the expression if two of the values 1, 2, 4, and 8 are substituted in any order for the variables x and y? 1/9^x÷9^y=9^z Enter a power of 9 in the box. math help!!! ty so much math help!!! Which expression is equivalent to (6^5)(6^2)? a.6^3 b.6^7 c.6^10 d.6^13 math The equation y = 1.6x represents the number of laps Henry can swim over time, where y is the number of laps and x is time in minutes. The table shows the number of laps Larry can swim over time. How many laps can each boy complete per minute, and who can swim laps at a faster ... cda thank you, very much!! cda Which of the following is an allergic skin condition? A. Scarlet fever B. Chicken pox C. Contact dermatitis D. German measles my answer is c cda Thank you, Ms.Sue cda I think is A cda For school-age children, the environment must include a separate area where children have _______ to do their homework. A. a library and computer B. tables and chairs C. books and encyclopedias D. pens and pencils my answer is c cda thanks cda The background screening of possible employees should include A. IRS federal income tax payment verification. B. family health history. C. a personal physical fitness assessment. D. Social Security number verification my answer is d cda Thank you. cda . Helping a child adjust to a child care facility is known as A. in loco parentis. B. orientation. C. parenting. D. involvement. My answer is D cda Thank you I appreciate it cda When selecting books for young children, you should avoid those that include A. exaggerated characteristics based on race or gender. B. illustrations depicting strong females and sensitive males. C. unusual characters that deviate from the norm. D. nontraditional roles such ... CDA Thank you, I realized that it is C CDA One of the children in your care asks, "Why can't Sonya walk?" in reference to a four-year-old child with cerebral palsy. The best response is A. "Sonya has special needs so please be kind to her." B. "It doesn't matter, she's still our ... CDA One suggested way to foster both prosocial behavior and self-esteem is the use of A. reasoning. B. verbal aggression. C. role modeling. D. time-out. I choose c homework Ok, Thank you. homework Which one of the following statements is an example of a clear message to a child? A. "Cleanup time. Hurry up." B. "What a rude thing to do!" C. "Stop that right now, and get ready for a nap." D. "Take your dirty dishes to the kitchen."... language arts B D B B A math At noon the temperature was 2°f.By sunset it had dropped 6 degrees. WHAT WAS THE TEMPERATURE AT SUNSET? Calculus-Function sketch the graph of a function in neighborhood x=2 that satisfies these conditions f(2)=3 f'(2)=2 f"(2)=-1 you can find a specific function that satisfies all of the given conditions i know the first derivative gives you critical points, and second derivative gives ... Calculus-Limits i have no clue how to start it. rationalizing it seems to tedious. how do i do this thanks evaluate the limit as h -> 0 ((fourth root(3 + h) - 2(3+h) - fourth root(3) + 6))/h the equatorial radius of the earth is approximately 3960 miles. suppose a wire is wrapped tightly around the earth at the equator. how much must this wire be lengthened if it is to be strung on 10 feet poles above the ground? (1 mile=5280 feet) delta y= dy/dx (2pir) * deltax ... if the sides of a cube are measured with an error of 2% use differentials to estimate the relative error in the volume df= 3x^2 * dx df= 3x^2 * 1/50 df= 3/50*x^2 is this right? estimate cube root of 25 by linear approximation f(x+delta(x))= f(x) + (df(x)/x) * deltax 3 + 1/3x^(-2/3) * -2 3 - 2/3x^(-2/3) 3 - (2/3* ((cube root(9))) is this right? thanks geometry State a conclusion that seems reasonable. Donald is older than Jeanette; Donald is older than Ethel. Donald is older than Allen. Conclusion? US History Thank you so much!!! US History AND What is the name of the Principle in the Constitution that restricts the power of any one branch of the government? US History List 3 responsibilities that we have as American citizens? 1) Citizens must VOTE 2) Citizens must obey the laws 3) Citizens must________ i don't know what is the third one please help!!!! US History Thank you!!!! I got this other question that I need help on List 3 responsibilities that we have as American citizens? 1) Citizens must VOTE 2) Citizens must obey the laws 3) Citizens must________ I don't know what is the third one please help!!! US History 5 Constitutional Convention 3 Northwest Ordinance 4 Shays' Rebellion 1 Articles of Confederation 2 American Revolution end is this right?? US History Put this in order ____ Constitutional Convention ____ Northwest Ordinance ____ Shays' Rebellion ____ Articles of Confederation ____ American Revolution end Please help what does it mean when they ask you "what parts of the book stood out"? Math what is the answer to 3x10=(2x10)+(1x__) Physics: Collison/Momentum Problem A solenoid has a cross-sectional area of 5.80 10-4 m2, consists of 100 turns per meter, and carries a current of 0.6 A. A 10 turn coil is wrapped tightly around the circumference of the solenoid. The ends of the coil are connected to a 0.7 resistor. Suddenly, a switch is ... math Explain why the angle relationship shown are not possible triangle angles 2x-15 3x-17 4x+12 A Number rounded to the nearest tenth is 6.1. The same number rounded to the nearest hundredth is 6.08 and rounded to the nearest thousandth is 6.083. What is the original number? spanish The answer is Yes, they are mine. Si, son mias. for the shirts and mios for the hats. Chemistry The answer is Ti, whoever anonymous is was wrong (and maybe me get my homework too!). accounting On January 2, 2006, Grant Corporation leases an asset to Pippin Corporation under the following conditions: 1. Annual lease payments of \$10,000 for twenty years. 2. At the end of the lease term the asset is expected to have a value of \$2,750. 3. The fair market value of the ... As a newly hired Staff I, you are responsible for analyzing the work papers for one of the clients of your organization. Your client is not clear about why you are asking for information on the following topics: o Adjusting lower of cost or market inventory on valuation o ... Social Studies What are the two strongest and more advanced cultures in Asia? college Algebra how many dimes equal the same total amount as 1,000,000,000 pennies? analyze evidence on biological evolution, utilizing descripcionof existing investigations, computer models, snd fossil records Algebra how many dimes equal the same total amount as 1,000,000,000 pennies? Essay on Marriage and Living Together I need an essay about this subject, it has to include: - Opening paragraph - paragraphs 2,3 present two syrong supporting reasons for the proposition's adoption - paragraph 4 presents one argument of opposition, which you disprove - paragraph 5 presents another supporting...
3,008
11,055
{"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.359375
3
CC-MAIN-2017-30
longest
en
0.921697
https://cstheory.stackexchange.com/questions/27829/maximum-weight-fair-matching/41141
1,624,405,281,000,000,000
text/html
crawl-data/CC-MAIN-2021-25/segments/1623488525399.79/warc/CC-MAIN-20210622220817-20210623010817-00305.warc.gz
185,202,376
41,291
# Maximum weight “fair” matching I'm interested in a variant of the maximum weight matching in a graph, which I call "Maximum Fair Matching". Assume that the graph is full (i.e. $E=V\times V$), has even number of vertices, and that the weight is given by a profit function $p:{V\choose 2}\to \mathbb N$. Given a matching $M$, denote by $M(v)$ the profit of the edge $v$ is matched with. A matching $M$ is a fair matching iff, for any two vertices $u,v\in V$: $$(\forall w\in V:\ \ p(\{w,v\})\geq p(\{w,u\}))\to M(v)\geq M(u)$$ That is, if for any vertex $w\in V$, matching $w$ to a vertex $v$ gives higher profit than matching it to a vertex $u$, a fair matching must suffice $M(v)\geq M(u)$. Can we find a maximum weight fair matching efficiently? An interesting case is when the graph is bipartite and the fairness only applies to one side, that is assume that $G=(L\cup R,L\times R)$, and we are given a profit function $p:L\times R\to \mathbb N$. A Fair Bipartite Matching is a matching in $G$ such that for any two vertices $u,v\in L$: $$(\forall w\in R:\ \ p(\{v,w\})\geq p(\{u,w\}))\to M(v)\geq M(u)$$ How fast can we find a maximum weight fair bipartite matching? The motivation for this problem comes from the bipartite special case. Assume you have $n$ workers and $m$ tasks, and worker $i$ can produce $p_{i,j}$ profit from work $j$. To problem here is to design a reasonable (in a sense workers will not feel "ripped-off''), while maximizing the total payoffs. (There is a tradeoff here between the power of the assignment mechanism and the social benefit). If we define the social-welfare (or the factory profit) of the assignment of workers to jobs as the sum of profits. Looking at different scenarios for the power of the job assigner, we get the following results: • If we are allowed to assign any worker to any job, we can optimize the factory efficiently (just find a maximal-weight matching). • If every worker chooses a task on his own, assuming that his work will be selected (only a single work can be selected for each job) should he be the most qualified worker that chose the task, workers will converge into the ''greedy'' equilibrium. The reason is that the worker that could earn the most ($i=\mbox{argmax}_i \max_j p_{i,j}$) will choose the most profitable job, and so on. By the approximation rate of the greedy algorithm for matching, this should give a 2-approximation of the maximal social-welfare possible. I'm looking for something in-between. Let's assume we could assign workers to jobs, but have to promise them that no "less-qualified" worker earns more than them. How can we find a maximal weight matching promising "fairness" to employees efficiently? • Tangentially, for the second (bipartite) case, it seems easy to construct examples where every "fair" matching gives the first worker profit 1, and the rest zero, even though there are "unfair" matchings giving the first worker profit $1−2\epsilon$ and everybody else profit $1−\epsilon$. Similarly, examples where the maximum-weight fair matching gives each worker profit $2/n$, even though there are unfair matchings giving each worker profit in $\{1-\epsilon,1-2\epsilon\}$. – Neal Young Jul 3 '18 at 3:38 • @NealYoung - am I correct to assume that these scenarios cannot exist if the profits are distinct? – R B Jul 3 '18 at 13:14 • It seems like a standard issue in game theory where the inability to distinguish between alternatives significantly lowers the social welfare. – R B Jul 3 '18 at 13:15 • Whoops, I take back my comment -- I'm not sure those examples are realizable after all! – Neal Young Jul 3 '18 at 16:50 I believe "maximum weight fair bipartite matching" as you've defined it is NP-hard. Even more, determining the existence of a fair bipartite matching is NP-hard. Before I give a proof sketch, for intuition, consider the following small instance. Take $G'=(L, R, E'=L\times R)$ where $L=\{a,b\}$, $R=\{c,d,e,f\}$. Take $p$ such that $p(u,w) = 0$ for $u\in L$ and $w\in\{c,d\}$, while $p(u,w) = 1$ for $u\in L$ and $w\in\{e,f\}$. Then $a$ and $b$ are equivalent, in the sense that $p(a, w) = p(b, w)$ for all $w\in R$, so any fair matching must give $a$ and $b$ the same profit. Hence, the only fair matchings either match $a$ and $b$ to $c$ and $d$, or they match $a$ and $b$ to $e$ and $f$. Using this kind of gadget, we can force coordination of the edges in the matching. This is the basis of the reduction. Here's an attempt at a proof. It's a bit involved. Probably there are some mistakes, but hopefully any mistakes can be fixed. Lemma 1. Given $G'=(L, R, E'=L\times R)$ and $p:E'\rightarrow\mathbb{R}_+$ as described in the problem, determining whether $G'$ contains a fair matching is NP-hard. Proof sketch. The proof is by reduction from Independent Set in cubic graphs. Let $(G=(V,E),k)$ be a given instance of Independent Set where $G'$ is a cubic graph (every vertex has degree 3). We describe how to construct a graph $G'=(L, R, E'=L\times R)$ and profit function $p:E'\rightarrow\mathbb{R}_+$ such that $G'$ has a fair bipartite matching if and only if $G$ has an independent set of size $k$. The vertices in $L$ will come in pairs, called partners. Likewise for the vertices in $R$. For each vertex $v\in L\cup R$, we let $v'$ denote the partner of $v$. Each vertex $\ell\in L$ and its partner $\ell'\in L$ will be equivalent, meaning that we will make $$p(\ell, r) = p(\ell', r) \text{ for all } r\in R.$$ Consequently, any fair matching must assign the same profit to $\ell$ and $\ell'$. In what follows, we use $\pi(\ell, r)$ to denote the value of $p(\ell,r) = p(\ell', r)$. Further, for each pair $\ell$ in $L$, and each pair of partners $r, r'$ in $R$, either we make $$\pi(\ell, r) = \pi(\ell, r')$$ or we make $$\pi(\ell, r) \ne \pi(\ell, r').$$ In the former case, we say we allow $\ell$ and $\ell'$ to be matched to $r$ and $r'$ (because doing so would assign the same profit to $\ell$ and $\ell'$, as required). In the latter case, we say we prevent $\ell$ and $\ell'$ from being (both) matched to $r$ and $r'$ (because doing so would not assign the same profit to $\ell$ and $\ell'$). As the given graph $G=(V,E)$ is cubic, it satisfies $3|V|=2|E|$, and any independent set $I$ of size $k$ in $G$ is incident to exactly $3k$ edges. Assume for ease of notation that $V=\{1,2,\ldots,n\}$. For each edge $\{i, j\}\in E$, do the following. 1. Add a pair of partner vertices $r(\{i,j\}), r'(\{i,j\})$ to $R$. 2. For endpoint $i$, add a pair of partner vertices $\ell(i,j), \ell'(i,j)$ to $L$. Set $$\pi(\ell(i,j), r(\{i,j\})) = \pi(\ell(i,j), r'(\{i,j\}))= i,$$ allowing $\ell(i,j)$ and $\ell'(i,j)$ to be matched to $r(\{i,j\})$ and $r'(\{i,j\})$. 3. Symmetrically, for the other endpoint $j$: add another pair of partner vertices $\ell(j,i), \ell'(j,i)$ to $L$, and set $$\pi(\ell(j,i), r(\{i,j\}) = \pi(\ell(j,i), r'(\{i,j\}))= j,$$ allowing $\ell(j,i)$ and $\ell'(j,i)$ to be matched to $r(\{i,j\})$ and $r'(\{i,j\})$. For every $\ell\in L$ and $r\in R$ added so far, if the pair $\ell, \ell'$ is not explicitly allowed (above) to be matched to $r, r'$, then prevent the match by assigning $\pi(\ell, r)$ and $\pi(\ell, r')$ each some unique number. Next, add $3(|V|-k)$ pairs of filler vertices to $R$. For each filler vertex $r$ and each $\ell(i,j)\in L$, set $\pi(\ell(i,j), r) = 0$. Finally, add two vertices $L_0$ and $L'_0$ (partners) to $L$, along with a two vertices $R_0$ and $R'_0$ (also partners) to $R$. Set $\pi(L_0, R_0) = \pi(L_0, R'_0) = 1$, allowing $L_0$ and $L'_0$ to be matched to $R_0$ and $R'_0$. For every other vertex $r\in R$, set $\pi(L_0, r)$ to some unique number. (Hence, any fair matching must match $L_0$ and $L'_0$ to $R_0$ and $R'_0$.) For every $i\in V$, for every incident edge $\{i,j\}\in E$, set $\pi(\ell(i,j), R_0) = i$ and $\pi(\ell(i,j), R'_0) = |V|-i+1$. That completes the reduction. To finish, we prove it is correct. First consider for what pairs of vertices $\ell(i,j),\ell(i',j')\in L$ the latter dominates the former, that is, $$(\forall r\in R)~\pi(\ell(i,j),r) \le \pi(\ell(i',j'), r).$$ Considering the profits assigned to edges incident to $R_0$ and $R'_0$, this condition can only be met if $i=i'$, and, inspecting the definition of $\pi$ for the remaining edges, the condition $i=i'$ is sufficient. Hence a matching is fair if and only if it assigns $L_0$ and $L'_0$ to $R_0$ and $R'_0$, and also, for each $i\in V$, gives the same profit to all vertices in $$N(i) = \{\ell(i,j) : \{i,j\}\in E\} \cup \{\ell'(i,j) : \{i,j\}\in E\}.$$ First, assume that $G$ has an independent set $I$ of size $k$. Obtain a fair matching for $G'$ from $I$ as follows. Match $L_0$ and $L'_0$ to $R_0$ and $R'_0$. For each vertex $i\in I$, let $\{i,j_1\}, \{i,j_2\}, \{i,j_3\}$ be its three incident edges. For each edge $\{i, j_h\}$, match vertex $\ell(i,j_h)$ and its partner $\ell'(i,j_h)$ to $r(\{i,j_h\})$ and $r'(\{i, j_h\})$. This gives all vertices in $N(i)$ profit $i$. For each of the $|V|-k$ vertices $i\in V\setminus I$, for each of the three edges $\{i,j\}$ incident to $i$, match $\ell(i,j)$ and its partner $\ell'(i,j)$ to some unique pair of filler vertices $r$ and its partner $r'$. This gives all vertices in $N(i)$ profit $0$. Hence, this matching is fair. Next, assume that $G'$ has a fair matching $M$. $M$ must match $L_0$ and $L'_0$ to $R_0$ and $R'_0$. For each $i\in V$, the matching must give each of the vertices in $N(i)$ the same profit. For each $\ell(i,j)\in N(i)$, its partner $\ell'(i,j)$ is also in $N(i)$. So, by inspection of the reduction, the profit of each such vertex must be either $i$ (in which case all six vertices in $N(i)$ are matched to vertices $r(\{i,j\})$ and their partners) or zero (in which case all six vertices in $N(i)$ are matched to filler vertices in $R$). Let $I$ be the set of vertices for which the former case holds. For each edge $\{i,j\}$, the vertex $r(\{i,j\})$, and its partner, are each matched to one vertex. It follows that $I$ is an independent set. Since the number of filler vertices is $6(|V|-k)$, the size of $I$ must be at least $k$. QED (?) I think it's basically correct, if a bit convoluted. Let me know if you see any mistakes, or a way to simplify the proof. The reduction above assumes it's okay to take $|R|>|L|$. If that's undesirable, then I'd guess we can pad $L$ with $|R|-|L|$ filler vertices, assigning profit 0 to all of their edges except the edges to $R_0$ and $R'_0$. We can assign profits to the latter edges to ensure the filler vertices are not dominated by (nor dominate) any other vertex.
3,260
10,615
{"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.46875
3
CC-MAIN-2021-25
latest
en
0.889511
http://deboragemin.it/ocng/bayesian-network-python.html
1,596,611,182,000,000,000
text/html
crawl-data/CC-MAIN-2020-34/segments/1596439735916.91/warc/CC-MAIN-20200805065524-20200805095524-00469.warc.gz
29,295,540
22,913
# Bayesian Network Python These graphical structures are used to represent knowledge about an uncertain domain. However, it is not possible to build a collection of stats that will be based on 100% accuracy and hence the result of Bayesian network dwindles. Bayesian Machine Learning in Python: A/B Testing Download Free Data Science, Machine Learning, and Data Analytics Techniques for Marketing, Digital Media. A Brief Introduction to Graphical Models and Bayesian Networks By Kevin Murphy, 1998. An example of a Bayesian Network representing a student. Moore Peter Spirtes. The edges encode dependency statements between the variables,. See the Notes section for details on this implementation and the optimization of the regularization parameters lambda (precision of the weights) and alpha (precision of the noise). In these types of models, we mainly focus on representing the … - Selection from Mastering Probabilistic Graphical Models Using Python [Book]. 2006 Bayesian Network tools in Java (BNJ) is an open-source suite of software tools for research and development using graphical models of probability. Example Bayesian network. Support for scalable GPs via GPyTorch. A Bayesian Network (BN) is a marked cyclic graph. It implements several Bayesian nonparametric models for clustering such as the Dirichlet Process Mixture Model (DPMM), the Infinite Relational Model (IRM), and the Hierarchichal Dirichlet Process (HDP). Dynamic Bayesian networks In the examples we have seen so far, we have mainly focused on variable-based models. Bayesian networks are ideal for taking an event that occurred and predicting the. However, situations in which continuous and discrete variables coexist in the same problem are common in practice. 1 , and in Sects. Bayesian networks Definition. A Bayesian network, Bayes network, Belief network, Bayes(ian) model or probabilistic Directed Acyclic Graphical model is a probabilistic graphical model (a type of statistical model) that. Bayesian Modelling in Python. Recommended reading Lindley, D. The technique of principal component analysis (PCA) has recently been expressed as the maximum likelihood solution for a generative latent variable model. ,Xn=xn) or as P(x1,. Bayesian Networks: With Examples in R introduces Bayesian networks using a hands-on approach. A Bayesian neural network is a neural network with a prior distribution on its weights (Neal, 2012). This class represents a Bayesian network with CPDs of any type. In this post, we are going to look at Bayesian regression. Inference for Dynamic Bayesian Networks. • d-separation can be computed in linear time using a depth-first-search-like algorithm. Introduction 2. xn) By chain rule of probability theory: ∏ − − = = × × i i 1 i 1 1 2 n 1 2 1 n 1 n 1 P(x | x ,. System Biology. bayes net by example using python and khan academy data Bayesian networks (and probabilistic graphical models more generally) are cool. GitHub Gist: instantly share code, notes, and snippets. A Bayesian network consists of nodes connected with arrows. Holders of data are keen to maximise the value of information held. From each pair of chromosomes, one copy is inherited from father and the other copy is inherited from mother. In Learning in Graphical Models, M. Fit your model using gradient-based MCMC algorithms like NUTS, using ADVI for fast approximate inference — including minibatch-ADVI for scaling to large datasets — or using Gaussian processes to build Bayesian nonparametric models. a data frame containing the data the Bayesian network that will be used to compute the score. The PyMC project is a very general Python package for probabilistic programming that can be used to fit nearly any Bayesian model (disclosure: I have been a developer of PyMC since its creation). It's going to be a bit more technical, but I'm going to try to give the. Prerequisites. Create an empty bayesian model with no nodes and no edges. Bayesian Networks, Introduction and Practical Applications (final draft) 3 structure and with variables that can assume a small number of states, efficient in-ference algorithms exists such as the junction tree algorithm [18, 7]. Learn how to build a Bayesian network with missing data, perform predictions with missing data, and fill-in missing data. BayesPy provides tools for Bayesian inference with Python. I have been using Pomegranate, but that seems to work only for continuous variables. Is it possible to work on Bayesian networks in scikit-learn?. • Sum out all uninstantiated variables from the full joint, • Express the joint distribution as a product of conditionals Computational cost: Number of additions: 15 Number of products: 16*4=64 P(J =T) = ( | ) ( | ) ( | , ) ( ) (), , , ,. I'm searching for the most appropriate tool for python3. Bayes nets represent data as a probabilistic graph and from this structure it is then easy to simulate new data. A key point is that different (intelligent) individuals can have different opinions (and thus different prior beliefs), since they have differing access to data and ways of interpreting it. The goal is to provide a tool which is efficient, flexible and extendable enough for expert use but also accessible for more casual users. Bayesian networks are a probabilistic model that are especially good at inference given incomplete data. — Page 184, Machine Learning, 1997. Provides: Network Architecture. The Bayesian network does pretty well, about as well as the non-Bayesian network! However, there’s one problem with the model: it assumes a constant level of uncertainty. In the examples we have seen so far, we have mainly focused on variable-based models. We'll start of by building a simple network using 3 variables hematocrit (hc) which is the volume percentage of red blood cells in the blood, sport and hemoglobin concentration (hg). 2 Introducing Bayesian Networks A Bayesian network is a statistical model that relates the marginal distributions of “causal” factors, or “attributes” of a risk, to its multivariate distribution. In the first part of this post, I gave the basic intuition behind Bayesian belief networks (or just Bayesian networks) — what they are, what they're used for, and how information is exchanged between their nodes. The data is from the 2011 Behavioral Risk Factor Surveillance System (BRFSS) survey, which is run by the Centers for Disease Control (CDC). Thus, the network expands: This is the network describing a single animal, but actually we have observations of many animals, so the full network would look more like this:. Bayesian network (BN) reconstruction is a prototypical systems biology data analysis approach that has been successfully used to reverse engineer and model networks reflecting different layers of biological organization (ranging from genetic to epigenetic to cellular pathway to metabolomic). The dependency establishes a mathematical relation between both the events, thereby making it possible for the technicians and other scientists to predict the knowledge. Thus, a Bayesian network defines a probability distribution p. The user constructs a model as a Bayesian network, observes data and runs posterior inference. Bayesian Networks: With Examples in R introduces Bayesian networks using a hands-on approach. Introduction to Bayesian Classification The Bayesian Classification represents a supervised learning method as well as a statistical method for classification. In the next tutorial you will extend this BN to an influence diagram. On searching for python packages for Bayesian network I find bayespy and pgmpy. It uses Bayesian spam filter, which is the most robust filter. However, since these are fields in which Bayesian networksfind application, they emerge frequently throughout the text. A Bayesian network classifier is simply a Bayesian network applied to classification, that is, the prediction of the probability P(c | x) of some discrete (class) variable C given some features X. The text ends by referencing applications of Bayesian networks in Chap-ter 11. reference : Ji, Junzhong, et al. Use missing data with Bayesian networks. Either an excessively optimistic or pessimistic expectation of the quality of these prior beliefs will distort the entire network and invalidate the results. , Diagnosing community-acquired pneumonia with a Bayesian network, In: Proceedings of the Fall Symposium of the American Medical Informatics Association, (1998) 632-636. This is often called a Two-Timeslice BN (2TBN) because it says that at any point in time T, the value of a variable can be calculated from the internal regressors and the immediate prior value (time T-1). Now we have all components needed to run Bayesian optimization with the algorithm outlined above. Stan is a state-of-the-art platform for statistical modeling and high-performance statistical computation. 18 Sep 2017 • thu-ml/zhusuan • In this paper we introduce ZhuSuan, a python probabilistic programming library for Bayesian deep learning, which conjoins the complimentary advantages of Bayesian methods and deep learning. F 3 S w p 1 Screen shots of Bayesian networks are from the Netica® Bayesian network package. Daniel Oehm wrote this interesting blog about how to simulate realistic data using a Bayesian network. Bayesian Machine Learning in Python: A/B Testing 4. Understanding your data with Bayesian networks (in python) Bartek Wilczyński [email protected] As far as we know, there's no MOOC on Bayesian machine learning, but mathematicalmonk explains machine learning from the Bayesian perspective. Bayesian networks can be depicted graphically as shown in Figure 2, which shows the well known Asia network. But sometimes, that's too hard to do, in which case we can use approximation. For many reasons this is unsatisfactory. (Columbia is the home of the illustrious Andrew Gelman, one of the fathers of hierarchical models. The first example below uses JPype and the second uses PythonNet. libpgm is one of the few libraries which seems to exist, but it is quite limited in its abilities. The same example used for explaining the theoretical concepts is considered for the. "A Bayesian Network is a directed acyclic graph G = , where every vertex v in V is associated with a random variable Xv, and every edge (u, v) in E represents a direct dependence from the random variable Xu to the random variable Xv. By using a directed graphical model, Bayesian Network describes random variables and conditional dependencies. NET is a framework for running Bayesian inference in graphical models. K2 algorithm is the most famous score-based algorithm in Bayesian netowrk in the last two decades. They provide the much desired complexity in representing the uncertainty of the predicted results of a model. BBNs are chiefly used in areas like computational biology and medicine for risk analysis and decision support (basically, to understand what caused a certain problem, or the probabilities of different effects given an action). This program builds the model assuming the features x_train already exists in the Python environment. Run code on multiple devices. , Diagnosing community-acquired pneumonia with a Bayesian network, In: Proceedings of the Fall Symposium of the American Medical Informatics Association, (1998) 632-636. Back-Propagation Neural Network implemented. Fur-thermore, the learning algorithms can be chosen separately from the statistical criterion they are based on (which is usually not possible in the reference implementation provided by the. Aaron Kramer. They provide the much desired complexity in representing the uncertainty of the predicted results of a model. Bayesian network inference • Ifll lit NPIn full generality, NP-hdhard - More precisely, #P-hard: equivalent to counting satisfying assignments • We can reduceWe can reduce satisfiability to Bayesian network inferenceto Bayesian network inference - Decision problem: is P(Y) > 0? Y =(u 1 ∨u 2 ∨u 3)∧(¬u 1 ∨¬u 2 ∨u 3)∧(u 2. O’Reilly members get unlimited access to live online training experiences, plus books, videos, and digital content from 200+ publishers. This research also uses association rule analysis to assist constructing the Bayesian network structure. Bayesian Regularization for #NeuralNetworks In the past post titled ‘Emergence of the Artificial Neural Network” I had mentioned that ANNs are emerging prominently among all other models. It is a testbed for fast experimentation and research with probabilistic models, ranging from classical hierarchical models on small data sets to complex deep probabilistic models on large data sets. AI in Telecom. In this paper, we introduce PEBL, a Python library and application for learning Bayesian network structure from data and prior knowledge that provides features unmatched by alternative software packages: the ability to use interventional data, flexible specification of structural priors, modeling with hidden variables and exploitation of parallel processing. The structure of a network describing the relationships between variables can be learned from data, or built from expert knowledge. I have been using Pomegranate, but that seems to work only for continuous variables. GitHub Gist: instantly share code, notes, and snippets. A Bayesian network is a directed acyclic graph whose nodes represent random variables. It only takes a minute to sign up. Bayesian networks are probabilistic, because these networks are built from a probability. One conditional probability distribution (CPD) p(xi ∣ xAi) p ( x i ∣ x A i) per node, specifying the probability of xi. Simple yet meaningful examples in R illustrate each step of the modeling process. It implements several Bayesian nonparametric models for clustering such as the Dirichlet Process Mixture Model (DPMM), the Infinite Relational Model (IRM), and the Hierarchichal Dirichlet Process (HDP). You must be lying if you say that you've never wondered how Gmail filters spam emails (unwanted and unsolicited emails. Bayesian optimization with scikit-learn 29 Dec 2016. The model's performance on the MNIST test set and Fashion MNIST is explored. A DBN can be used to make predictions about the. How do I implement a Bayesian network? I have taken the PGM course of Kohler and read Kevin murphy's introduction to BN. That is, as we carry out more coin flips the number of heads obtained as a proportion of the total flips tends to the "true" or "physical" probability. Holders of data are keen to maximise the value of information held. Generally known as Belief Networks, Bayesian Networks are used to show uncertainties using Directed Acyclic Graphs (DAG). Understanding your data with Bayesian networks (in python) Bartek Wilczyński [email protected] Pyro is a universal probabilistic programming language (PPL) written in Python and supported by PyTorch on the backend. Bayesian networks are a type of probabilistic graphical model that uses Bayesian inference for probability computations. Therefore, this class requires samples to be represented as binary-valued feature vectors. Pomegranate is a package for probabilistic models in Python that is implemented in cython for speed. Exporting a fitted Bayesian network to gRain; Importing a fitted Bayesian network from gRain; Interfacing with other software packages. 1 - Section of a singly connected network around node X Propagation Rules. When faced with any learning problem, there is a choice of how much time and effort a human vs. A bayesian network (BN) is a knowledge base with probabilistic information, it can be used for decision making in uncertain environments. There is no point in diving into the theoretical aspect of it. So far, the simplest regression setting, Bayesian Linear Regression with a toy dataset, has been considered, to understand Bayesian Modeling and the mechanics of Pyro. 8 eb b b (Bayesian belief nets) (Markov nets) Alarm network State-space models HMMs Naïve Bayes classifier PCA/ ICA Markov Random Field Boltzmann machine. It is capable of learning continuous multivariate normal models. "A Bayesian network is a probabilistic graphical model which represents a set of variables and their conditional dependencies using a directed acyclic graph. Let’s understand it in detail now. conditioned on its parents’ values. GitHub Gist: instantly share code, notes, and snippets. Stan is a state-of-the-art platform for statistical modeling and high-performance statistical computation. She is so patient, thorough, honest, and she communicates consistently throughout the project. In general, Bayesian Networks (BNs) is a framework for reasoning under uncertainty using probabilities. The user constructs a model as a Bayesian network, observes data and runs posterior inference. G = (N,E) is a directed acyclic graph (DAG) with nodes N. I would work with her again any day and recommend her to anyone. Home¶ pomegranate is a Python package that implements fast and flexible probabilistic models ranging from individual probability distributions to compositional models such as Bayesian networks and hidden Markov models. Aaron Kramer. Bayesian Belief Networks. (Columbia is the home of the illustrious Andrew Gelman, one of the fathers of hierarchical models. Copula Bayesian Networks Gal Elidan Department of Statistics Hebrew University Jerusalem, 91905, Israel [email protected] Users specify log density functions in Stan’s probabilistic programming. A Bayesian network forms a directed-acyclic graph (DAG) by a set of nodes (representing the variables) and a set of directed edges (representing relationships among the variables). Introduction. How do I implement a Bayesian network? I have taken the PGM course of Kohler and read Kevin murphy's introduction to BN. TensorFlow Probability is a library for probabilistic reasoning and statistical analysis in TensorFlow. 2 Bayes Theorem. Inference in Bayesian networks Chapter 14. "The second component of the Bayesian network representation is a set of local probability models that represent the nature of the dependence of each variable on its parents. This framework explicitly represents temporal dynamics and allows us to query the network for the distribution over the time when particular events of in-terest occur. 001, alpha_1=1e-06, alpha_2=1e-06, lambda_1=1e-06, lambda_2=1e-06, alpha_init=None, lambda_init=None, compute_score=False, fit_intercept=True, normalize=False, copy_X=True, verbose=False) [source] ¶. Bayesian network inference • Ifll lit NPIn full generality, NP-hdhard - More precisely, #P-hard: equivalent to counting satisfying assignments • We can reduceWe can reduce satisfiability to Bayesian network inferenceto Bayesian network inference - Decision problem: is P(Y) > 0? Y =(u 1 ∨u 2 ∨u 3)∧(¬u 1 ∨¬u 2 ∨u 3)∧(u 2. x on Windows to create a Bayesian Network, learn its parameters from data and perform the inference. Bayesian Inference in Python with PyMC3. This is often called a Two-Timeslice BN (2TBN) because it says that at any point in time T, the value of a variable can be calculated from the internal regressors and the immediate prior value (time T-1). A Dynamic Bayesian Network (DBN) is a Bayesian network (BN) which relates variables to each other over adjacent time steps. The goal is to provide a tool which is efficient, flexible and extendable enough for expert use but also accessible for more casual users. Spam Filter. A Bayesian Belief Network (BBN), or simply Bayesian Network, is a statistical model used to describe the conditional dependencies between different random variables. A common task for a Bayesian network is to perform inference by computing to determine various probabilities of interest from the model. A Bayesian network is good at classifying based on observations. a computer puts in. In this article, we are going to discuss about Bayesian Network which is a part of directed graph in PGMs. It is designed to get users quickly up and running with Bayesian methods, incorporating just enough statistical background to allow users to understand, in general terms, what. (Note, however, that it is very easy and painless to call C from R, and all the time consuming parts of bnlearn, more than half of its code lines, are written in C. The goal is to provide a tool which is efficient, flexible and extendable enough for expert use but also accessible for more casual users. A Bayesian network representation of portfolio return allows analysts to incorporate new information, to see the effect of that information on the return distributions for the whole network, and to visualize the distribution of returns, not just the summary statistics. And according to the model of bayesian regression, the result can be analysid through numberic values, and turn out to be a boolean result. In the search of a good tool or programming library for Bayesian networks (a. Bayesian statistics turn around the Bayes theorem, which in a regression context is the following: $$P(\theta|Data) \propto P(Data|\theta) \times P(\theta)$$ Where $$\theta$$ is a set of parameters to be estimated from the data like the slopes and Data is the dataset at hand. Going Bayesian; Example Neural Network with PyMC3; Linear Regression Function Matrices Neural Diagram LinReg 3 Ways Logistic Regression Function Matrices Neural Diagram LogReg 3 Ways Deep Neural Networks Function Matrices Neural Diagram DeepNets 3 Ways Going Bayesian. BayesPy - Bayesian Python. Formally, a Bayesian network is a directed graph G = (V,E) A random variable xi. m", here is a simple example for understanding how to use our code. 9; Filename, size File type Python version Upload date Hashes; Filename, size bayesian_networks-. Thompson Hobbs. mathjax: other math package is a…. Module 2: Bayesian Hierarchical Models Francesca Dominici Michael Griswold The Johns Hopkins University Bloomberg School of Public Health 2005 Hopkins Epi-Biostat Summer Institute 2 Key Points from yesterday “Multi-level” Models: Have covariates from many levels and their interactions Acknowledge correlation among observations from. Bayesian network is the graphical model which can represent the Bayesian network is the graphical model which can represent the stochastic dependency of the random variables via the acyclic directed graph [6-8]. , from the vantage point of (say) 2005, PF(the Republicans will win the White House again in 2008) is (strictly speaking) unde ned. Information about events, macro conditions, asset pricing theories, and security-driving forces can serve as useful priors in selecting optimal portfolios. One, because the model encodes dependencies among all variables, it readily handles situations where some data entries are missing. It's newest. NET, R, Matlab). 4{5 Chapter 14. Download Python Bayes Network Toolbox for free. The dependency establishes a mathematical relation between both the events, thereby making it possible for the technicians and other scientists to predict the knowledge. A Bayesian Belief Network (BBN), or simply Bayesian Network, is a statistical model used to describe the conditional dependencies between different random variables. 8 eb b b (Bayesian belief nets) (Markov nets) Alarm network State-space models HMMs Naïve Bayes classifier PCA/ ICA Markov Random Field Boltzmann machine. A library for probabilistic modeling, inference, and criticism. Much like a hidden Markov model, they consist of a directed graphical model (though Bayesian networks must also be acyclic) and a set of probability distributions. Bayesian ridge regression. Apply to Data Scientist, Algorithm Engineer, Entry Level Data Analyst and more!. Bayesian Belief Network provide a graphical model of causal relationship on which learning can be performed. Read Bayesian Network books like Hierarchical Modeling and Inference in Ecology and Bayesian Models for free with a free 30-day trial. So instead, I built a Bayesian network in R using a Java based library at the end and then created a shiny app to let the people to interact with it. Daniel Oehm wrote this interesting blog about how to simulate realistic data using a Bayesian network. A Bayesian network is a representation of a joint probability distribution of a set of Bayesian networks have already found their application in health outcomes. 2 Bayes Theorem. Although visualizing the structure of a Bayesian network is optional, it is a great way to understand a model. datamicroscopes is a library for discovering structure in your data. Given sequences of observations spaced irreg-. Bayesian Networks are probabilistic graphical models and they have some neat features which make them very useful for many problems. Viewed 8k times 6. Going Bayesian; Example Neural Network with PyMC3; Linear Regression Function Matrices Neural Diagram LinReg 3 Ways Logistic Regression Function Matrices Neural Diagram LogReg 3 Ways Deep Neural Networks Function Matrices Neural Diagram DeepNets 3 Ways Going Bayesian. Another question in “Terrorism and Terrorist Threat” course being offered by Dr. Bayesian ridge regression. An example of Bayesian learning: given a prior over the weights of coins, and observed sequences of tosses for two coins, compute the posterior over those coins’ weights. Bayesian networks can be depicted graphically as shown in Figure 2, which shows the well known Asia network. bayes net by example using python and khan academy data Bayesian networks (and probabilistic graphical models more generally) are cool. The user constructs a model as a Bayesian network, observes data and runs posterior inference. For example, in Bayesian optimization algorithms (BOA) can the Bayesian network that is produced be extracted and used separately as a Bayesian classifier? Relevant answer R. and Haug, P. Bayesian Network (ABN) method is a data-driven approach (Lewis and Ward 2013; Kratzer, Pittavino, Lewis, and Furrer 2019b). Choosing the right parameters for a machine learning model is almost more of an art than a science. I am implementing two bayesian networks in this tutorial, one model for the Monty Hall problem and one model for an alarm problem. It implements several Bayesian nonparametric models for clustering such as the Dirichlet Process Mixture Model (DPMM), the Infinite Relational Model (IRM), and the Hierarchichal Dirichlet Process (HDP). hi i try to Learn Genetic Interactions from Saccharomyces cerevisiae, using Dynamic Bayesian Netw compare two files and print unique values to a new file I am trying to compare two (or more) files, containing chromosomal positions in the form 2:282828. An example of a Bayesian Network representing a student. Bayesian Networks¶. Bayesian network provides a more compact representation than simply describing every instantiation of all variables Notation: BN with n nodes X1,. Bayesian networks A simple, graphical notation for conditional independence assertions and hence for compact specification of full joint distributions Syntax: a set of nodes, one per variable a directed, acyclic graph (link ≈ “directly influences”) a conditional distribution for each node given its parents: P(Xi|Parents(Xi)). JPype # __author__ = 'Bayes. Results We proposed a new pathway enrichment analysis based on Bayesian network (BNrich) as an approach in PEA. • This book also benefited from my interactions with Sanjoy Mahajan, espe-cially in fall 2012, when I audited his class on Bayesian Inference at Olin College. For details, please refer to Cooper's published paper Please start from "ControlCentor. Jordan, ed. Stan is a state-of-the-art platform for statistical modeling and high-performance statistical computation. The transactions 7 and 8 have one not observed in the training. We define a 3-layer Bayesian neural network with. BayesPy provides tools for Bayesian inference with Python. Structure Learning. Support for scalable GPs via GPyTorch. It implements several Bayesian nonparametric models for clustering such as the Dirichlet Process Mixture Model (DPMM), the Infinite Relational Model (IRM), and the Hierarchichal Dirichlet Process (HDP). Understanding your data with Bayesian networks (in python) Bartek Wilczyński [email protected] A bayesian network (BN) is a knowledge base with probabilistic information, it can be used for decision making in uncertain environments. For questions related to Bayesian networks, the generic example of a directed probabilistic graphical model. 0 (b) (c) Bayesian Networks (sometimes called belief net-works or causal probabilistic networks) are probabilistic graphical models, widely used for knowledge representation and reasoning under. The likelihood vector is equals to the term-by-term product of all the message passed from the node's children. A Bayesian Belief Network (BBN), or simply Bayesian Network, is a statistical model used to describe the conditional dependencies between different random variables. 1 Ultimately, she would like to know the. For a full example see dynamic discrete bayesian network. xn) By chain rule of probability theory: ∏ − − = = × × i i 1 i 1 1 2 n 1 2 1 n 1 n 1 P(x | x ,. Simple yet meaningful examples in R illustrate each step of the modeling process. This program builds the model assuming the features x_train already exists in the Python environment. Bayesian Belief Network allows class conditional independencies to be defined between subsets of variables. One conditional probability distribution (CPD) p(xi ∣ xAi) p ( x i ∣ x A i) per node, specifying the probability of xi. The structure of a network describing the relationships between variables can be learned from data, or built from expert knowledge. I will also discuss how bridging. As the headline suggests, I am looking for a library for learning and inference of Bayesian Networks. Pyro is a universal probabilistic programming language (PPL) written in Python and supported by PyTorch on the backend. 1 - Section of a singly connected network around node X Propagation Rules. ,Xn=xn) or as P(x1,. BayesPy provides tools for Bayesian inference with Python. Bayesian Analysis of. Submitted by Bharti Parmar, on March 15, 2019. Bayesian network (BN) reconstruction is a prototypical systems biology data analysis approach that has been successfully used to reverse engineer and model networks reflecting different layers of biological organization (ranging from genetic to epigenetic to cellular pathway to metabolomic). The twist will include adding an additional variable State of the economy (with the identifier Economy ) with three outcomes ( Up , Flat , and Down ) modeling the developments in the economy. I could say that this is the marriage of probability theory and graph theory. Bayesian networks Definition. As in the case of our restaurant example, we can use the same network structure for multiple restaurants as they share the same variables. I see that there are many references to Bayes in scikit-learn API, such as Naive Bayes, Bayesian regression, BayesianGaussianMixture etc. Bayesian network is a directed acyclic graph(DAG) that is an efficient and compact representation for a set of conditional independence assumptions about distributions. Interactive version. Bayesian Network Finder (BNFinder) Biolearn. The Bayesian strategy of integration is realized by pre-. A Bayesian Network falls under the classification of Probabilistic Graphical Modelling (PGM) procedure that is utilized to compute uncertainties by utilizing the probability concept. Bayesian inference is quite simple in concept, but can seem formidable to put into practice the first time you try it (especially if the first time is a new and complicated problem). Upon loading, the class will also check that the keys of Vdata correspond to the vertices in V. Link with Machine Learning. The second edition of Bayesian Analysis with Python is an introduction to the main concepts of applied Bayesian inference and its practical implementation in Python using PyMC3, a state-of-the-art probabilistic programming library, and ArviZ, a new library for exploratory analysis of Bayesian models. This project is a competition to find Bayesian network structures that best fit some given data. Bayesian network, the user needs to supply a training data set and represent any prior knowledge available as a Bayesian network. Although not a new activity, it is becoming more popular as the scale of databases increases. This is a text on learning Bayesian networks; it is not a text on artificial intelligence, expert systems, or decision analysis. nucleus of the cell is packed on chromosomes. Many optimization problems in machine learning are black box optimization problems where the objective function f ( x) is a black box function [1] [2]. Recently, I blogged about Bayesian Deep Learning with PyMC3 where I built a simple hand-coded Bayesian Neural Network and fit it on a toy data set. BNOmics is realized as a series of Python scripts. Inference and Learning is done by Gibbs Sampling/Stochastic-EM. conditioned on its parents' values. and Smith, A. Conditional probabilities are specified for every node. Bayesian methods provide exact inferences without resorting to asymptotic approximations. Kaggle competitors spend considerable time on tuning their model in the hopes of winning competitions, and proper model selection plays a huge part in that. Despite its simplicity, the Naive Bayesian classifier often does surprisingly well and is widely used because it often outperforms more sophisticated classification methods. It is designed to be simple for the user to provide a model via a set of parameters, their bounds and a log-likelihood function. A Bayesian network is a directed, acyclic graph whose nodes represent random variables and arcs represent direct dependencies. Bayesian results are easier to interpret than p values and confidence intervals. This program builds the model assuming the features x_train already exists in the Python environment. Ask Question Asked 2 years, 6 months ago. I would work with her again any day and recommend her to anyone. The networks are easy to follow and better understand the inter-relationships of the different attributes of the dataset. Such dependencies can be represented efficiently using a Bayesian Network (or Belief Networks). Bayesian Networks and Probabilistic Network are known as belief network. Lecture 16 • 3. Bayesian Belief Networks in Python: Bayesian Belief Networks in Python can be defined using pgmpy and pyMC3 libraries. The Bayesian network does pretty well, about as well as the non-Bayesian network! However, there’s one problem with the model: it assumes a constant level of uncertainty. BayesianRidge (n_iter=300, tol=0. Bayesian networks (BNs) are being studied in recent years for system diagnosis, reliability analysis, and design of complex engineered systems. Bayesian Regularization for #NeuralNetworks In the past post titled ‘Emergence of the Artificial Neural Network” I had mentioned that ANNs are emerging prominently among all other models. As an example, an input such as "weather" could affect how one drives their car. using Bayesian network based on discrete variables [5]. stand Bayesian methods. Pyro is a universal probabilistic programming language (PPL) written in Python and supported by PyTorch on the backend. Bayesian Reasoning and Machine Learning by David Barber is also popular, and freely available online, as is Gaussian Processes for Machine Learning, the classic book on the matter. Daniel Oehm wrote this interesting blog about how to simulate realistic data using a Bayesian network. Bayesian networks are a type of probabilistic graphical model that uses Bayesian inference for probability computations. The library is a C++/Python implementation of the variational building block framework introduced in our papers. CS 2001 Bayesian belief networks Inference in Bayesian networks Computing: Approach 1. As part of the TensorFlow ecosystem, TensorFlow Probability provides integration of probabilistic methods with deep networks, gradient-based inference using automatic differentiation, and scalability to large datasets and models with hardware acceleration (GPUs) and distributed computation. Copula Bayesian Networks Gal Elidan Department of Statistics Hebrew University Jerusalem, 91905, Israel [email protected] Bayesian Networks (directed graphical models) - not necessarily following a "Bayesian" approach. The post Bayesian Networks vs. Key Features. The second edition of Bayesian Analysis with Python is an introduction to the main concepts of applied Bayesian inference and its practical implementation in Python using PyMC3, a state-of-the-art probabilistic programming library, and ArviZ, a new library for exploratory analysis of Bayesian models. Bayesian Network in R A Bayesian Network (BN) is a probabilistic model based on directed acyclic graphs that describe a set of variables and their conditional dependencies to each other. She is so patient, thorough, honest, and she communicates consistently throughout the project. It is also an useful tool in knowledge discovery as directed acyclic graphs allow representing causal relations between variables. Bayesian network is a data structure which is used to represent the dependencies among variables. Let Deps(v) = {u | (u, v) in E} denote the direct dependences of node v in V. 9-py3-none-any. "A hybrid method for learning Bayesian networ. The python software library Edward enhances TensorFlow so that it can harness both Artificial Neural Nets and Bayesian Networks. Bayesware Discoverer 1. OutlineMotivation: Information ProcessingIntroductionBayesian Network Classi ersk-Dependence Bayesian Classi ersLinks and References Outline 1 Motivation: Information Processing 2 Introduction 3 Bayesian Network Classi ers 4 k-Dependence Bayesian Classi ers 5 Links and References. Bayesian belief networks are a convenient mathematical way of representing probabilistic (and often causal) dependencies between multiple events or random processes. class libpgm. Link with Machine Learning. Introduction¶ BayesPy provides tools for Bayesian inference with Python. The strength of Bayesian network is it is highly scalable and can learn incrementally because all we do is to count the observed variables and update the probability distribution table. This tutorial doesn't aim to be a bayesian statistics tutorial - but rather a programming cookbook for those who understand the fundamental of bayesian statistics and want to learn how to build bayesian models using python. Dynamic Bayesian networks In the examples we have seen so far, we have mainly focused on variable-based models. In this post, we are going to look at Bayesian regression. This course provides an overview of the fundamentals, from performing common calculations to conducting Bayesian analysis with Excel. Bayesian Networks Figure 1. Abstract Structural learning of Bayesian networks (BNs) from observational data has gained increasing applied use and attention from various scientific and industrial areas. The core philosophy behind pomegranate is that all probabilistic models can be viewed as a probability distribution in that. il Abstract We present the Copula Bayesian Network model for representing multivariate continuous distributions, while taking advantage of the relative ease of estimat-ing univariate distributions. a Bayesian network model from statistical independence statements; (b) a statistical indepen- dence test for continuous variables; and nally (c) a practical application of structure learning to a decision support problem, where a model learned from the databaseŠmost importantly its. I could say that this is the marriage of probability theory and graph theory. The Gaussian process in the following example is configured with a Matérn kernel which is a generalization of the squared exponential kernel or RBF kernel. Bayesian Networks and Probabilistic Network are known as belief network. Understanding your data with Bayesian networks (in python) Bartek Wilczyński [email protected] Choosing the right parameters for a machine learning model is almost more of an art than a science. This could be understood with the help of the below diagram. For example, in Bayesian optimization algorithms (BOA) can the Bayesian network that is produced be extracted and used separately as a Bayesian classifier? Relevant answer R. PBNT is defined as Python Bayesian Network Toolbox very rarely. There are currently three big trends in machine learning: Probabilistic Programming, Deep Learning and "Big Data". Run time calculation generates probability estimates for every node, and changes when any node receives a new observed. As an example, an input such as "weather" could affect how one drives their car. A particular value in joint pdf is Represented by P(X1=x1,X2=x2,. Inference (discrete & continuous) with a Bayesian network in Python. One, because the model encodes dependencies among all variables, it readily handles situations where some data entries are missing. Today, we will build a more interesting model using Lasagne, a flexible Theano library for constructing various types of Neural Networks. Bayesian Networks Structured, graphical representation of probabilistic. The basic structure or “architecture” of a Bayesian network is a directed acyclic graph where nodes represent. See network scores for details. Anomaly detection with Bayesian networks Leave a comment Posted by Security Dude on April 10, 2016 Anomaly detection, also known as outlier detection, is the process of identifying data which is unusual. If you were following the last post that I wrote, the only changes you need to make is changing your prior on y to be a Bernoulli Random Variable, and to ensure that your data is. Understand the Foundations of Bayesian Networks―Core Properties and Definitions Explained. Bayesian Networks: With Examples in R introduces Bayesian networks using a hands-on approach. The identical material with the resolved exercises will be provided after the last Bayesian network tutorial. Edward is a Python library for probabilistic modeling, inference, and criticism. So, in this case, we get P(d|c) times P(c|b) times P(b|a) times P(a). It represents the JPD of the variables Eye Color and Hair Colorin a population of students (Snee, 1974). Thompson Hobbs. The data can be an edge list, or any NetworkX graph object. The goal is to provide a tool which is efficient, flexible and extendable enough for expert use but also accessible for more casual users. Bayesian statistical methods are becoming more common, but there are not many resources to help beginners get started. Broemeling, L. Norsys Netica. Holders of data are keen to maximise the value of information held. 0, an automated modeling tool able to extract a Bayesian network from data by searching for the most probable model. Dynamic Bayesian Network in Python. As far I know it is called Bayesian Network, but not sure. The network structure S is a directed acyclic graph A set P of local probability distributions at each node (Conditional Probability Table) Bayesian network represent the efficiently the joint probability distribution of the variables. BayesPy provides tools for Bayesian inference with Python. The transactions 7 and 8 have one not observed in the training. Inference in Bayesian Networks •Exact inference •Approximate inference. Interactive version. - [Instructor] Microsoft Excel worksheets…are very well suited to performing Bayesian analysis. We also analyze the relationship between the graph structure and the independence properties of a distribution represented over that graph. A fairly straightforward extension of bayesian linear regression is bayesian logistic regression. It obeys the likelihood principle. Z in a Bayesian network's graph, then I. Some useful quantities in Bayesian network modelling: Theskeleton:the undirected graph underlying a Bayesian network, i. We'll also see the Bayesian models and the independencies in Bayesian models. Bayesian optimization is an algorithm well suited to optimizing hyperparameters of classification and regression models. Three soldiers were killed and two others were wounded in the […]. In these types of models, we mainly focus on representing the variables of the model. Another question in "Terrorism and Terrorist Threat" course being offered by Dr. A Bayesian network is good at classifying based on observations. 001, alpha_1=1e-06, alpha_2=1e-06, lambda_1=1e-06, lambda_2=1e-06, alpha_init=None, lambda_init=None, compute_score=False, fit_intercept=True, normalize=False, copy_X=True, verbose=False) [source] ¶. • An introduction to Bayesian networks • An overview of BNT. And according to the model of bayesian regression, the result can be analysid through numberic values, and turn out to be a boolean result. By exploiting the structure of a Bayesian network, our algorithm is able to e ciently search for local maxima of data con ict between closely related vari-ables. If you are new to Bayesian networks, please read  the following introductory article. Therefore, this class requires samples to be represented as binary-valued feature vectors. Understanding your data with Bayesian networks (in Python) by Bartek Wilczynski PyData SV 2014 1. 1 , and in Sects. Now I kind of understand, If i can come up with a structure and also If i have data to compute the CPDs I am good to go. The python software library Edward enhances TensorFlow so that it can harness both Artificial Neural Nets and Bayesian Networks. The data can be an edge list, or any NetworkX graph object. 1 Independence and conditional independence Exercise 1. 1 Task Relevant Document Model igur e3. It is a testbed for fast experimentation and research with probabilistic models, ranging from classical hierarchical models on small data sets to complex deep probabilistic models on large data sets. Bayesian Network Models in PyMC3 and NetworkX. PyJAGS - Python; Mocapy++ - A Dynamic Bayesian Network toolkit, implemented in C++ (It supports discrete, multinomial, Gaussian, Kent, Von Mises and Poisson nodes. Bayesian results are easier to interpret than p values and confidence intervals. Native GPU & autograd support. An example of a Bayesian Network representing a student. There are currently three big trends in machine learning: Probabilistic Programming, Deep Learning and "Big Data". It provides a high-level interface to the part of aGrUM allowing to create, model, learn, use, calculate with and embed Bayesian Networks and other graphical models. Learning Bayesian Network Model Structure from Data Dimitris Margaritis May 2003 CMU-CS-03-153 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Submitted in partial fulllment of the requirements for the degree of Doctor of Philosophy Thesis Committee: Sebastian Thrun, Chair Christos Faloutsos Andrew W. Bayesian Statistics Bayesian statistics involves the use of probabilities rather than frequencies when addressing uncertainty. Bayesian Networks are probabilistic graphical models and they have some neat features which make them very useful for many problems. It obeys the likelihood principle. I have already found some, but I am hoping for a recommendation. Bayesian Networks, Introduction and Practical Applications (final draft) 3 structure and with variables that can assume a small number of states, efficient in-ference algorithms exists such as the junction tree algorithm [18, 7]. Dynamic Bayesian networks - Mastering Probabilistic Graphical Models Using Python In the examples we have seen so far, we have mainly focused on variable-based models. • An introduction to Bayesian networks • An overview of BNT. In future posts we will expand on this concept by applying some of the analysis techniques for Bayesian networks to graphs in petersburg, alongside the simulative analysis made possible by the python package: petersburg. Edward is a Python library for probabilistic modeling, inference, and criticism. Now, B can be written as. Thus in the Bayesian interpretation a probability is a summary of an individual's opinion. The arcs represent causal relationships between a variable and outcome. 4 $\begingroup$. C is independent of B given A. conditioned on its parents' values. Bayesian Belief Network provide a graphical model of causal relationship on which learning can be performed. PyJAGS - Python; Mocapy++ - A Dynamic Bayesian Network toolkit, implemented in C++ (It supports discrete, multinomial, Gaussian, Kent, Von Mises and Poisson nodes. Chapter 2 (Duda et al. A broad background of theory and methods have been developed for the case in which all the variables are discrete. How do I implement a Bayesian network? I have taken the PGM course of Kohler and read Kevin murphy's introduction to BN. Bayesian Networks are one of the simplest, yet effective techniques that are applied in Predictive modeling, descriptive analysis and so on. Fit a Bayesian ridge model. This talk will give a high level overview of the theories of graphical models and a practical introduction to and illustration of several available options for implementing graphical models in Python. It represents the JPD of the variables Eye Color and Hair Colorin a population of students (Snee, 1974). Python Bayesian Network Toolbox、webサイトが動かない上に、サポートもされてません。 BayesPy、ベイズ推定。 PyMC、Windows64bit、Python3. In this paper, we introduce pebl, a Python library and application for learning Bayesian network structure from data and prior knowledge that provides features unmatched by alternative software packages: the ability to use interventional data, flexible specification of structural priors, modeling with hidden variables and exploitation of parallel processing. Bayesian deep learning models typically form uncertainty estimates by either placing distributions over model weights, or by learning a direct mapping to probabilistic outputs. Models are the mathematical formulation of the observed events. A Bayesian network representation of portfolio return allows analysts to incorporate new information, to see the effect of that information on the return distributions for the whole network, and to visualize the distribution of returns, not just the summary statistics. Interactive version. Structure Learning. Bayesian networks are powerful tools for handling problems which are specified through a multivariate probability distribution. Andrew Royle and N. A Bayesian Belief Network (BBN) represents variables as nodes linked in a directed graph, as in a cause/effect model. This question is off-topic. This research expects to incorporate the two techniques to improve the shortcoming of a single technique. Bayesian belief networks are a convenient mathematical way of representing probabilistic (and often causal) dependencies between multiple events or random processes. ,Xn=xn) or as P(x1,. There are currently three big trends in machine learning: Probabilistic Programming, Deep Learning and "Big Data". An important part of bayesian inference is the establishment of parameters and models. Do you know how should I do this? I've been looking for tutorials or anyone who has ever done this but nothing so far. Suppose that the net further records the following probabilities:. Bayesian Networks (An Example) From: Aronsky, D. K2 algorithm is the most famous score-based algorithm in Bayesian netowrk in the last two decades. xn) By chain rule of probability theory: ∏ − − = = × × i i 1 i 1 1 2 n 1 2 1 n 1 n 1 P(x | x ,. Why are Bayes nets useful? 1. The goal is to provide a tool which is efficient, flexible and extendable enough for expert use but also accessible for more casual users. To this end, the cycles were eliminated in 187 KEGG human signaling pathways concerning intuitive biological rules and the Bayesian network structures were constructed. (Columbia is the home of the illustrious Andrew Gelman, one of the fathers of hierarchical models. Download Python Bayes Network Toolbox for free. Even though there are many software packages allowing for Bayesian network reconstruction, only few of them are freely available to researchers. Are you confused enough? Or should I confuse you a bit more ?. 2006 Bayesian Network tools in Java (BNJ) is an open-source suite of software tools for research and development using graphical models of probability. In this module, we define the Bayesian network representation and its semantics. A Bayesian network classifier is simply a Bayesian network applied to classification, that is, the prediction of the probability P(c | x) of some discrete (class) variable C given some features X. Bayesian regression. Unlike existing deep learning libraries, which are mainly designed for deterministic neural networks and supervised tasks, ZhuSuan is featured for its deep root into. Bayesian networks A simple, graphical notation for conditional independence assertions and hence for compact specification of full joint distributions Syntax: a set of nodes, one per variable a directed, acyclic graph (link ≈ “directly influences”) a conditional distribution for each node given its parents: P(Xi|Parents(Xi)). Problem In OS X, when trying to compile the tutorial of Bayesian Belief Networks in Python ( using Sphinx ( you get the following error: Extension error: sphinx. BN models have been found to be very robust in the sense of i. However, since these are fields in which Bayesian networksfind application, they emerge frequently throughout the text. A Brief Introduction to Graphical Models and Bayesian Networks By Kevin Murphy, 1998. The Bayesian strategy of integration is realized by pre-. Bayesian network structure learning, parameter learning and inference. In this MATLAB code, Bayesian Neural Network is trained by Genetic Algorithm. Support for scalable GPs via GPyTorch. Another question in “Terrorism and Terrorist Threat” course being offered by Dr. Bayesian Networks are probabilistic graphical models and they have some neat features which make them very useful for many problems. Structure Review. In the search of a good tool or programming library for Bayesian networks (a. Dynamic Bayesian Network library in Python. ZhuSuan is built upon Tensorflow. In this article, I want to give a short introduction of. D is independent of C given A and B. Bayesian network. To get a range of estimates, we use Bayesian inference by constructing a model of the situation and then sampling from the posterior to approximate the posterior. The average performance of the Bayesian network over the validation sets provides a metric for the quality of the network. Although visualizing the structure of a Bayesian network is optional, it is a great way to understand a model. A Bayesian neural network is a neural network with a prior distribution on its weights (Neal, 2012). JPype # __author__ = 'Bayes. GitHub Gist: instantly share code, notes, and snippets. soft evidence • Conditional probability vs. F 3 S w p 1 Screen shots of Bayesian networks are from the Netica® Bayesian network package. reference : Ji, Junzhong, et al. Static Bayesian networks 3. 18 Sep 2017 • thu-ml/zhusuan • In this paper we introduce ZhuSuan, a python probabilistic programming library for Bayesian deep learning, which conjoins the complimentary advantages of Bayesian methods and deep learning. Learning Bayesian Network Model Structure from Data Dimitris Margaritis May 2003 CMU-CS-03-153 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Submitted in partial fulllment of the requirements for the degree of Doctor of Philosophy Thesis Committee: Sebastian Thrun, Chair Christos Faloutsos Andrew W. 9; Filename, size File type Python version Upload date Hashes; Filename, size bayesian_networks-. Here are two interesting packages for performing bayesian inference in python that eased my transition into bayesian inference:. datamicroscopes is a library for discovering structure in your data. I am implementing two bayesian networks in this tutorial, one model for the Monty Hall problem and one model for an alarm problem. Now we have all components needed to run Bayesian optimization with the algorithm outlined above. We define a 3-layer Bayesian neural network with. As in the case of our restaurant example, we can use the same network structure for multiple restaurants as they share the same variables. This is often called a Two-Timeslice BN (2TBN) because it says that at any point in time T, the value of a variable can be calculated from the internal regressors and the immediate prior value (time T-1). Try jSMILE (available from BayesFusion, LLC, free for academic teaching and research use), which is a Java wrapper for SMILE that can be accessed from both Python and R. Create an empty bayesian model with no nodes and no edges. Bayesian Network Modeling using R and Python Pragyansmita Nayak Bayesian Networks (BN) are increasingly being applied for real-world data problems. I could say that this is the marriage of probability theory and graph theory. Bayesian Networks: With Examples in R introduces Bayesian networks using a hands-on approach. Inference Worker: This class is responsible for calculating beliefs for events from the constructed Bayesian network. Bayesian Network: A Bayesian Network consists of a directed graph and a conditional probability distribution associated with each of the random variables. The following topics are covered. It represents the JPD of the variables Eye Color and Hair Colorin a population of students (Snee, 1974). It contains the attributes V, E, and Vdata, as well as the method randomsample. This note provides some user documentation and implementation details. Bayesian network is a data structure which is used to represent the dependencies among variables. BernoulliNB implements the naive Bayes training and classification algorithms for data that is distributed according to multivariate Bernoulli distributions; i. Much like a hidden Markov model, they consist of a directed graphical model (though Bayesian networks must also be acyclic) and a set of probability distributions. We computer geeks can love ‘em because we’re used to thinking of big problems modularly and using data structures. Bayes theorem is built on top of conditional probability and lies in the heart of Bayesian Inference. 9-py3-none-any. However, since these are fields in which Bayesian networksfind application, they emerge frequently throughout the text. The text ends by referencing applications of Bayesian networks in Chap-ter 11. Inference in Bayesian Networks •Exact inference •Approximate inference. Bayes Server, advanced Bayesian network library and user interface. Bayesian Network Models of Portfolio Risk and Return 3 Portfolio risk is divided into two components — diversifiable risk, ww 1 EnE n 22 2 2 1 ss++K , and non-diversifiable risk, bb 1PF kPFk 22 2 2 1 ss+º+. Also, in case you prefer python to R, a python wrapper for bnlearn is in the works. A common task for a Bayesian network is to perform inference by computing to determine various probabilities of interest from the model. Today, we will build a more interesting model using Lasagne, a flexible Theano library for constructing various types of Neural Networks. Bayesian networks using Encog Java and simple logic (Topic: Artificial Intelligence/neural net) 14: Jython/Python. The network structure I want to define. m", here is a simple example for understanding how to use our code. Given n variables, X ={ X. A Bayesian filter is a program that uses Bayesian logic , also called Bayesian analysis, to evaluate the header and content of an incoming e-mail message and determine the probability that it constitutes spam. We define a 3-layer Bayesian neural network with. Learning Bayesian Network Model Structure from Data Dimitris Margaritis May 2003 CMU-CS-03-153 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Submitted in partial fulllment of the requirements for the degree of Doctor of Philosophy Thesis Committee: Sebastian Thrun, Chair Christos Faloutsos Andrew W. Users specify log density functions in Stan’s probabilistic programming. In this post, we are going to look at Bayesian regression. Applications of Bayesian Networks 1. stand Bayesian methods. Theequivalence class:the graph (CPDAG) in which only arcs that are part of av-structure(i. Bayesian Networks are one of the simplest, yet effective techniques that are applied in Predictive modeling, descriptive analysis and so on. Much like a hidden Markov model, they consist of a directed graphical model (though Bayesian networks must also be acyclic) and a set of probability distributions. Now I kind of understand, If i can come up with a structure and also If i have data to compute the CPDs I am good to go. DBNs were developed by Paul Dagum in the early 1990s at Stanford. I agree with him that "Bayesian network" is the preferred term in the literature, so I think your synonym [bayes-network]$\to$[bayesian-network] is correct and can safely be merged (perhaps after a day or two, just in case somebody protests here). In this module, we define the Bayesian network representation and its semantics. I have a larga database of accidents envolving cars in a city, and would like to create a Bayesian Network to infer about how one of these accidents happening in a place causes others in other places. Learn more. This booklet assumes that the reader has some basic knowledge of Bayesian statistics, and the principal focus of the booklet is not to explain Bayesian statistics, but rather to explain how to carry out these analyses using R. The goal is to provide a tool which is efficient, flexible and extendable enough for expert use but also accessible for more casual users. Dynamic Bayesian networks - Mastering Probabilistic Graphical Models Using Python In the examples we have seen so far, we have mainly focused on variable-based models. Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. First of all, through the comparative analysis of seismic hazard factors of the sample building such as building structure types, building floors and years of construction after structure stress research, Bayesian network of structural vulnerability characteristics analysis of buildings based on Python is constructed and then the fitting. a maximum a posteriori) • Exact • Approximate •R packages for Bayesian networks •Case study: protein signaling network. Bayesian network inference • Ifll lit NPIn full generality, NP-hdhard - More precisely, #P-hard: equivalent to counting satisfying assignments • We can reduceWe can reduce satisfiability to Bayesian network inferenceto Bayesian network inference - Decision problem: is P(Y) > 0? Y =(u 1 ∨u 2 ∨u 3)∧(¬u 1 ∨¬u 2 ∨u 3)∧(u 2. Root causes just have an "a priori" probability. ABSTRACT Bayesian Networks are increasingly being applied for real-world data problems. Bayesian network structure learning, parameter learning and inference. Simple yet meaningful examples in R illustrate each step of the modeling process. Dynamic Bayesian Network library in Python [closed] Ask Question Asked 2 years, 6 months ago. Abideen Opeyemi Bello(bideen) in Analytics Vidhya. Bayesian network is a tool that brings it into the real world applications. The Gaussian process in the following example is configured with a Matérn kernel which is a generalization of the squared exponential kernel or RBF kernel. Also appears as Technical Report MSR-TR-95-06, Microsoft Research, March, 1995. The box plots would suggest there are some differences. Bayesian Networks Introductory Examples A Non-Causal Bayesian Network Example. Naive Bayes is a simple multiclass classification algorithm with the assumption of independence between every pair of features. 1 Ultimately, she would like to know the. This method allows for the construction of a Bayesian network with every combination of every type of CPD, provided that the user provides a method for sampling each type of node and stores this method in the proper place, namely as the choose() method of a class in libpgm. The second edition of Bayesian Analysis with Python is an introduction to the main concepts of applied Bayesian inference and its practical implementation in Python using PyMC3, a state-of-the-art probabilistic programming library, and ArviZ, a new library for exploratory analysis of Bayesian models. In this paper, we proposed an alternative approach to model-based fault diagnosis, where Bayesian network is adopted to model the system and diagnose the failures. Create an empty bayesian model with no nodes and no edges. Fit a Bayesian network. For example, Bayesian non-parametrics could be used to flexibly adjust the size and shape of the hidden layers to optimally scale the network architecture to the problem at hand during training. Bayesian Portfolio Analysis This paper reviews the literature on Bayesian portfolio analysis. CausalNex is a Python library that uses Bayesian Networks to combine machine learning and domain expertise for causal reasoning. This propagation algorithm assumes that the Bayesian network is singly connected, ie. Bayesian deep learning models typically form uncertainty estimates by either placing distributions over model weights, or by learning a direct mapping to probabilistic outputs.
13,273
65,433
{"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": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}
2.640625
3
CC-MAIN-2020-34
latest
en
0.877974
https://docs.google.com/spreadsheets/d/1GcjRc2tjgHlSHXB4n23SpohtVSxji-iHz1BH_vZC8Zs/edit
1,561,545,142,000,000,000
text/html
crawl-data/CC-MAIN-2019-26/segments/1560628000266.39/warc/CC-MAIN-20190626094111-20190626120111-00279.warc.gz
409,185,321
76,961
PreCalculus Pacing Guide (2019 Spring) The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss ABCDEFGHIJK 1 DATETOPICDATETOPICDATETOPIC 2 Jan 21NO SCHOOL - MLK HOLIDAY31 3 Jan 22NO SCHOOL - TEACHER WORKDAY 4 Jan 23NO SCHOOL - TEACHER WORKDAY 5 1Jan 24Prerequisite Review 6 2Jan 25Prerequisite Review 7 3Jan 28Prerequisite Review 8 4Jan 29Prerequisite Review 9 5Jan 30Prerequisite Review 10 6Jan 31TEST - Unit P 11 7Feb 1What is a Function?, Graphs of Functions, & Getting Information from the Graph of a Function 12 8Feb 4Getting Info from the Graph of a Function (day 2) & Average Rate of Change of a Function 13 9Feb 5 Graphs of Functions (revisited) & Transformations 14 10Feb 6Combining Functions 15 11Feb 7Functions Review 16 12Feb 8TEST - Unit 1 17 13Feb 11What is a Polynomial Function? & Features of the Graph of a Polynomial Function 18 14Feb 12Features of the Graph of a Polynomial Function (day 2) 19 15Feb 13(Early Release Day) Real Zeroes of Polynomial Functions 20 16Feb 14Quick Review of Algebra & Complex Zeroes of Polynomial Functions 21 17Feb 15Review 22 Feb 18NO SCHOOL - TEACHER WORKDAY 23 18Feb 19TEST - Unit 2 24 19Feb 20ACT DAY 25 20Feb 21What is a Polynomial & Graphs of Polynomials 26 21Feb 22Graphs of Polynomials, continued 27 22Feb 25Features of the Graphs of Polynomials & ISN Notebook 28 23Feb 26Real Zeroes of Polynomials 29 24Feb 27Real Zeroes of Polynomials, continued 30 25Feb 28Division of PolynomailsFINAL EXAMS 31 26Mar 1Complex Zeroes of PolynomialsFINAL EXAMS 32 27Mar 2Complex Zeroes of Polynomials, continuedFINAL EXAMS 33 28Mar 3Writing a Polynomial EquationFINAL EXAMS 34 29Mar 4Writing a Polynomial EquationFINAL EXAMS 35 30Mar 5Graphing a Polynomial Function
544
1,760
{"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-2019-26
latest
en
0.794665
http://www.timbertoolbox.com/Calcs/linepullclc.htm
1,545,208,070,000,000,000
text/html
crawl-data/CC-MAIN-2018-51/segments/1544376831715.98/warc/CC-MAIN-20181219065932-20181219091932-00059.warc.gz
481,974,023
1,953
Line Pull Calculator Hi Don, Assumptions: Tree is hinged at ground level, it has been cut off! Let T = tension in rope in pounds W = weight of tree in pounds H = distance from hinge (ground) to where rope is tied to tree as measured along the tree Theta = angle between tree and ground alpha = angle between rope and tree L = distance from ground to the center of gravity as measured along the tree, this is the point where a cable attached to the tree could lift it in a balanced position???????? Sum torques about the hinge (butt of tree) T = L*W*cos(theta)/( H*sin(alpha)) Checks: IF theta = 90 degrees the tree will fall over Thus T=0 IF alpha= 90 degrees the tension is a minimum The larger H the smaller the tension Hope this helps, Mitch L Distance From Ground to Center of Gravity (feet) W Tree Weight(pounds) theta Angle of Tree to Ground H Height Rope is Tied(feet) alpha Angle of Tree to Rope T Pull Force on Line(lbs) =
221
933
{"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.828125
4
CC-MAIN-2018-51
longest
en
0.952887
https://simplywall.st/stocks/hk/utilities/hkg-1381/canvest-environmental-protection-group-shares/news/is-there-an-opportunity-with-canvest-environmental-protection-group-company-limiteds-hkg1381-49-undervaluation/
1,582,478,912,000,000,000
text/html
crawl-data/CC-MAIN-2020-10/segments/1581875145818.81/warc/CC-MAIN-20200223154628-20200223184628-00376.warc.gz
544,095,049
16,273
# Is There An Opportunity With Canvest Environmental Protection Group Company Limited’s (HKG:1381) 49% Undervaluation? Does the May share price for Canvest Environmental Protection Group Company Limited (HKG:1381) reflect what it’s really worth? Today, we will estimate the stock’s intrinsic value by taking the expected future cash flows and discounting them to their present value. I will use the Discounted Cash Flow (DCF) model. Don’t get put off by the jargon, the math behind it is actually quite straightforward. Companies can be valued in a lot of ways, so we would point out that a DCF is not perfect for every situation. If you want to learn more about discounted cash flow, the rationale behind this calculation can be read in detail in the Simply Wall St analysis model. Want to participate in a short research study? Help shape the future of investing tools and you could win a \$250 gift card! ### The model We’re using the 2-stage growth model, which simply means we take in account two stages of company’s growth. In the initial period the company may have a higher growth rate and the second stage is usually assumed to have a stable growth rate. To start off with, we need to estimate the next ten years of cash flows. Where possible we use analyst estimates, but when these aren’t available we extrapolate the previous free cash flow (FCF) from the last estimate or reported value. We assume companies with shrinking free cash flow will slow their rate of shrinkage, and that companies with growing free cash flow will see their growth rate slow, over this period. We do this to reflect that growth tends to slow more in the early years than it does in later years. Generally we assume that a dollar today is more valuable than a dollar in the future, and so the sum of these future cash flows is then discounted to today’s value: #### 10-year free cash flow (FCF) estimate 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 Levered FCF (HK\$, Millions) HK\$-1.19k HK\$-1.01k HK\$106.33 HK\$1.12k HK\$1.20k HK\$1.27k HK\$1.32k HK\$1.37k HK\$1.41k HK\$1.45k Growth Rate Estimate Source Analyst x1 Analyst x2 Analyst x3 Analyst x1 Analyst x1 Est @ 5.37% Est @ 4.36% Est @ 3.65% Est @ 3.16% Est @ 2.81% Present Value (HK\$, Millions) Discounted @ 7.32% HK\$-1.11k HK\$-875.57 HK\$86.02 HK\$845.71 HK\$843.49 HK\$828.10 HK\$805.21 HK\$777.66 HK\$747.46 HK\$716.04 Present Value of 10-year Cash Flow (PVCF)= HK\$3.67b “Est” = FCF growth rate estimated by Simply Wall St We now need to calculate the Terminal Value, which accounts for all the future cash flows after this ten year period. The Gordon Growth formula is used to calculate Terminal Value at a future annual growth rate equal to the 10-year government bond rate of 2%. We discount the terminal cash flows to today’s value at a cost of equity of 7.3%. Terminal Value (TV) = FCF2029 × (1 + g) ÷ (r – g) = HK\$1.5b × (1 + 2%) ÷ (7.3% – 2%) = HK\$28b Present Value of Terminal Value (PVTV) = TV / (1 + r)10 = HK\$HK\$28b ÷ ( 1 + 7.3%)10 = HK\$13.73b The total value is the sum of cash flows for the next ten years plus the discounted terminal value, which results in the Total Equity Value, which in this case is HK\$17.40b. In the final step we divide the equity value by the number of shares outstanding. This results in an intrinsic value estimate of HK\$7.09. Compared to the current share price of HK\$3.6, the company appears quite good value at a 49% discount to where the stock price trades currently. Remember though, that this is just an approximate valuation, and like any complex formula – garbage in, garbage out. ### The assumptions We would point out that the most important inputs to a discounted cash flow are the discount rate and of course the actual cash flows. You don’t have to agree with these inputs, I recommend redoing the calculations yourself and playing with them. The DCF also does not consider the possible cyclicality of an industry, or a company’s future capital requirements, so it does not give a full picture of a company’s potential performance. Given that we are looking at Canvest Environmental Protection Group as potential shareholders, the cost of equity is used as the discount rate, rather than the cost of capital (or weighted average cost of capital, WACC) which accounts for debt. In this calculation we’ve used 7.3%, which is based on a levered beta of 0.800. Beta is a measure of a stock’s volatility, compared to the market as a whole. We get our beta from the industry average beta of globally comparable companies, with an imposed limit between 0.8 and 2.0, which is a reasonable range for a stable business. ### Next Steps: Whilst important, DCF calculation shouldn’t be the only metric you look at when researching a company. The DCF model is not a perfect stock valuation tool. Rather it should be seen as a guide to “what assumptions need to be true for this stock to be under/overvalued?” If a company grows at a different rate, or if its cost of equity or risk free rate changes sharply, the output can look very different. What is the reason for the share price to differ from the intrinsic value? For Canvest Environmental Protection Group, There are three pertinent factors you should further examine: 1. Financial Health: Does 1381 have a healthy balance sheet? Take a look at our free balance sheet analysis with six simple checks on key factors like leverage and risk. 2. Future Earnings: How does 1381’s growth rate compare to its peers and the wider market? Dig deeper into the analyst consensus number for the upcoming years by interacting with our free analyst growth expectation chart. 3. Other High Quality Alternatives: Are there other high quality stocks you could be holding instead of 1381? Explore our interactive list of high quality stocks to get an idea of what else is out there you may be missing! PS. Simply Wall St updates its DCF calculation for every HK stock every day, so if you want to find the intrinsic value of any other stock just search here. We aim to bring you long-term focused research analysis driven by fundamental data. Note that our analysis may not factor in the latest price-sensitive company announcements or qualitative material. If you spot an error that warrants correction, please contact the editor at editorial-team@simplywallst.com. This article by Simply Wall St is general in nature. It does not constitute a recommendation to buy or sell any stock, and does not take account of your objectives, or your financial situation. Simply Wall St has no position in the stocks mentioned. Thank you for reading.
1,574
6,608
{"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-10
latest
en
0.914504
http://math.stackexchange.com/questions/313875/can-nonzero-polynomials-vanish-identically
1,469,682,625,000,000,000
text/html
crawl-data/CC-MAIN-2016-30/segments/1469257827791.21/warc/CC-MAIN-20160723071027-00239-ip-10-185-27-174.ec2.internal.warc.gz
159,397,321
18,016
# Can nonzero polynomials vanish identically? I know that a nonzero single-variable polynomial over a finite field can vanish identically e.g. take the product $\prod_a(x-a)$ for every $a$ in the field. But I know that for an infinite field this cannot happen since a degree $d$ polynomial has at most $d$ roots. My questions are: 1. Why does a nonzero two-variable or higher polynomial over $\mathbb{R}$ not vanish identically? (In this case I know they can't but I don't know why) 2. What about nonzero multivariate polynomials over other infinite fields? - Have you tried induction on the number of variables? If your polynomial has $n$ variables, view it as polynomial with coefficients from the polynomial ring in $n-1$ variables. By induction hypothesis at least one of the coefficients does not vanish for some choice of values. Then use the base case, $n=1$, that you already know to justify the induction step. – Jyrki Lahtonen Feb 25 '13 at 12:39 Let $F$ be an infinite field, and $f(x, y) \in F[x, y]$ a nonzero polynomial. Regard $f$ as a polynomial $g(y) = f(x, y) \in (F(x))[y]$. This is a polynomial in $y$, with coefficients in the infinite field $F(x)$. Since it has a finite number of distinct roots, there is a $b \in F$ such that $0 \ne g(b) = f(x, b) \in F[x]$. Now apply the result for the univariate case.
349
1,331
{"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}
3.1875
3
CC-MAIN-2016-30
latest
en
0.9008
https://community.toph.co/t/number-crafting/553
1,601,031,133,000,000,000
text/html
crawl-data/CC-MAIN-2020-40/segments/1600400223922.43/warc/CC-MAIN-20200925084428-20200925114428-00082.warc.gz
328,959,326
4,309
# Number Crafting Limits: 1s, 512 MB Game is one type of competency, and when it befalls by any number its really astonish. This is a companion discussion topic for the original entry at https://toph.co/p/number-crafting ``````int t; cin >> t; while (t--) { ll n; ll sum = 0; cin >> n; ll ara[n]; for (ll i = 0; i < n; i++) { cin >> ara[i]; sum += ara[i]; } sort(ara, ara + n); ll res = sum / ara[0]; bool sign = false; for (int i = 0; i < n; i++) { if (ara[i] == res) { cout << i + 1 << " "; sign = true; } } if (!sign) cout << "NULL"; cout << endl; } `````` input output same but saying WA at 1!! ??? i think these types of problems are huge waste of time,it doesnt can teach U anythinG ! if u want to make a tricky problem try to set the trick into problem not into printing spaces or something like that!!! int t; ``````cin >> t; while (t--) { ll n; ll sum = 0; cin >> n; ll ara[n]; for (ll i = 0; i < n; i++) { cin >> ara[i]; sum += ara[i]; } sort(ara, ara + n); ll res = sum / ara[0]; bool sign = false; bool first = false; for (int i = 0; i < n; i++) { if (ara[i] == res) { if (first) cout <<" "; cout << i + 1; first = true; sign = true; } } if (!sign) cout << "NULL"; cout << endl; } `````` last case WA…! Are you there ?
417
1,295
{"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-2020-40
longest
en
0.713314
http://www.edupil.com/question/sin2%CE%B8-cos2%CE%B8/
1,516,402,386,000,000,000
text/html
crawl-data/CC-MAIN-2018-05/segments/1516084888302.37/warc/CC-MAIN-20180119224212-20180120004212-00675.warc.gz
430,038,844
16,342
# What is the Value of (sin2θ – cos2θ) If  tan θ = 3 sin θ then the value of (sin2θ – cos2 θ) is 1. 1 2. 3 3. 1/3 4. None Manish Listener Asked on 18th June 2015 in Explanation:- tanθ = 3 sinθ sinθ/cosθ  = 3 sinθ cosθ = 1/3 cos = 1/9 sinn2θ = 1 – cos sin = 1 – 1/9 sin = (9 – 1)/9 sin = 8/9 Then, sin – cos = 8/9 – 1/9 = 7/9 Hence, the answer is (4) None Anurag Mishra Professor Answered on 19th June 2015.
208
411
{"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.953125
4
CC-MAIN-2018-05
latest
en
0.751475
https://hvtest.cc/shownews_jswz.asp?id=10765
1,722,655,272,000,000,000
text/html
crawl-data/CC-MAIN-2024-33/segments/1722640356078.1/warc/CC-MAIN-20240803025153-20240803055153-00594.warc.gz
249,995,201
6,130
# Power detection technology / Power detection ## Detection Technology ### The DC resistance tester exceeds its limit value The DC resistance tester is mainly composed of precision small signal measurement circuit, high-power switching power supply circuit, protection circuit, high-speed single-chip control circuit and other components. Its function is to check the quality of winding welding and short circuit between windings, and tap switch position Whether it is correct, whether the lead wire is loose or broken, whether the actual position is consistent with the indication, and the winding of the parallel winding has no broken strands, etc. Measuring DC resistance is not only a basic test item for transformer maintenance, pre-testing and tap changer position change, but also a key inspection item after a failure. When using the DC resistance tester, when the measured resistance value exceeds the limit, pay attention to the following points: 1. The resistance value of DC resistance is greatly affected by temperature, so it must be converted to the same temperature (usually 20℃, R20 = (T + 20)/(T + T), T copper = 235) for comparison , And generally based on the oil temperature of the upper layer. 2. First consider whether there is a measurement error (for example, whether the external lead is connected, whether the test lead is too long or too thin, whether the contact is good, whether the battery voltage in the bridge is insufficient). 3. Poor contact of the tap changer leads to high resistance values. For example, the switch is clean and electroplated, insufficient spring pressure, uneven stress, and carbon deposits on the overvoltage contacts will cause the resistance value to conduct. . At this time, the tap changer cover should be opened and rotated several times, usually it can be eliminated. 4. For the three-phase distribution transformers currently in use, the high-voltage winding adopts Y-shaped wiring. When the resistance value exceeds the limit value, the following formula can also be used [RA = (RAB + rac-rbc) / 2, RB = (RAB + rac-rac)/2, RC(RBC + rac-rab)/2] in order to find the defect phase. Copyright description: all articles, pictures, video and other materials on this site belong to wuhan huatian power automation co., LTD. For use, please contact us; Permission to reprint articles, pictures, video and other materials please quote "from: huatian power". Precautions for testing transformer  | 2021/3/14 | reading763time How to choose a relay protection tester  | 2021/3/13 | reading777time return More products More news
542
2,590
{"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-2024-33
latest
en
0.882574
https://www.gradesaver.com/textbooks/math/precalculus/precalculus-mathematics-for-calculus-7th-edition/chapter-3-section-3-4-real-zeros-of-polynomials-3-4-exercises-page-283/8
1,537,904,638,000,000,000
text/html
crawl-data/CC-MAIN-2018-39/segments/1537267162385.83/warc/CC-MAIN-20180925182856-20180925203256-00352.warc.gz
739,736,194
12,726
# Chapter 3 - Section 3.4 - Real Zeros of Polynomials - 3.4 Exercises - Page 283: 8 $-1, 1, -2, 2, -3, 3, -4, 4, -6, 6, -12, 12, -\frac{1}{2}, \frac{1}{2}, -\frac{1}{3}, \frac{1}{3}, -\frac{1}{6}, \frac{1}{6}, -\frac{2}{3}, \frac{2}{3}, -\frac{3}{2}. \frac{3}{2}, -\frac{4}{3}, \frac{4}{3}$ #### Work Step by Step Note that: The factors of $12$ are $\pm1, \pm2, \pm3, \pm4, \pm6, \pm12$. The factors of $6$ are $\pm1, \pm2, \pm3, \pm6$ Thus, The possible values of $p$ are $\pm1, \pm2, \pm3, \pm4, \pm6, \pm12$. The possible values of $q$ are $\pm1, \pm2, \pm3, \pm6$ Therefore the possible rational zeros $\frac{p}{q}$ of $R(x)$ are: $\\-1, 1, -2, 2, -3, 3, -4, 4, -6, 6, -12, 12, -\frac{1}{2}, \frac{1}{2}, -\frac{1}{3}, \frac{1}{3}, -\frac{2}{3}, \frac{2}{3}, -\frac{3}{2}. \frac{3}{2}, -\frac{4}{3}, \frac{4}{3}-\frac{1}{6}, \frac{1}{6}$ After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.
461
1,005
{"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}
4.625
5
CC-MAIN-2018-39
longest
en
0.632139
http://stats.stackexchange.com/questions/41728/getting-positive-definite-matrix-for-chol-update
1,386,325,763,000,000,000
text/html
crawl-data/CC-MAIN-2013-48/segments/1386163051248/warc/CC-MAIN-20131204131731-00080-ip-10-33-133-15.ec2.internal.warc.gz
179,036,620
11,545
# Getting positive definite matrix for chol update I am making a square-root UKF implementation. I also use cholupdate function in Matlab. However cholupdate needs a positive definite matrix. The positive definiteness is tested using [R,p] = chol(A) where p produces 0. Then after running cholupdate, generates an error saying A is not positive definite. My problem is. 1. Does [R,p] = chol(A) return p=0 means A is positive-definite always? 2. What is the best method for making a positive definite matrix. Note that here A is a square-root matrix where $AA^T$ gives a covariance matrix. Any help is greatly appreciated. - the documentation (mathworks.com/help/matlab/ref/chol.html) indicates that p=0 means A is positive definite. For your second question, note that a Gram matrix ($AA^{\top}$) is positive semidefinite, and you can always 'boost' the eigenvalues of any matrix by adding $cI$ to it; for sufficiently large $c$, $cI+A$ will be positive definite. –  shabbychef Dec 3 '12 at 6:49
244
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": 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}
2.71875
3
CC-MAIN-2013-48
latest
en
0.832828
https://www.easycalculation.com/faq/9207/do_the_equations_xy2_and_3x3y6_define_the.php
1,576,237,167,000,000,000
text/html
crawl-data/CC-MAIN-2019-51/segments/1575540553486.23/warc/CC-MAIN-20191213094833-20191213122833-00033.warc.gz
696,369,781
7,929
English Answer Questions and Earn Points !!! You are allowed to answer only once per question. Do The Equations X+y=-2 And 3x+3y=-6 Define The Same Line? - Math Discussion ## Do the equations x+y=-2 and 3x+3y=-6 define the same line? GUEST 2016-01-21 04:26:51 0
85
265
{"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-2019-51
longest
en
0.721161
http://math.stackexchange.com/questions/388738/find-the-residue-of-the-function-frac1-cos-zz3-z-3
1,469,583,406,000,000,000
text/html
crawl-data/CC-MAIN-2016-30/segments/1469257825125.30/warc/CC-MAIN-20160723071025-00127-ip-10-185-27-174.ec2.internal.warc.gz
110,842,881
16,273
# Find the residue of the function $\frac{1 - \cos z}{z^{3} (z-3)}$ I need to find the residue of $\dfrac{1 - \cos z}{z^{3} (z-3)}$ at all its singular points. Is this correct? Also, are there removable singularities? Thanks in advance - Note that $$\dfrac{1-\cos(z)}{z^3(z-3)} = \dfrac{2 \sin^2(z/2)}{z^3(z-3)} = \dfrac12 \dfrac{\left(\dfrac{\sin^2(z/2)}{(z/2)^2}\right)}{z(z-3)}$$ Can you conclude from this?
162
413
{"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.34375
3
CC-MAIN-2016-30
latest
en
0.797269
https://community.cesium.com/t/kriging-on-cesium/8079
1,653,305,544,000,000,000
text/html
crawl-data/CC-MAIN-2022-21/segments/1652662558015.52/warc/CC-MAIN-20220523101705-20220523131705-00109.warc.gz
238,554,781
6,129
# Kriging on Cesium 1. A concise explanation of the problem you're experiencing. I want to interpolate with Kriging. What should be my attention areas in Cesium and how I can proceed? 2. A minimal code example. If you've found a bug, this helps us reproduce and repair it. 3. Context. Why do you need to do this? We might know a better way to accomplish your goal. 4. The Cesium version you're using, your operating system and browser. Do you mean you have a set of points and you’re trying to create and visualize surface geometry approximated by kriging? There’s nothing built-in to CesiumJS to do this, but could do your computations in JavaScript in your app and then have Cesium visualize the results, as geometry or lines in 3D etc. Hi Omar, Yes, the same intent is expected. However, for the time being I am working with kriging datasets as sampled data with easting and northing and then finally implementing the kriging on the points collected from sampleTerrainMostDetailed. But the conversion of points from cartesian to cartographic in cesium, I am always getting the latitudes as 0, var cartesianCoordinate = new Cesium.Cartesian3(8600/*Easting*/,12600/*Northing*/); var cartograhicCoordinate = Cesium.Cartographic.fromCartesian(cartesianCoordinate ); cartograhicCoordinate.latitude is always 0 Cesium’s Cartesian3 coordinates are not a 2 dimensional grid on the surface of the Earth. It’s a 3D coordinate system with the point (0, 0, 0) being in the center of the earth. I think what you’ll need to do is convert your easting and northing values to longitude/latitude, and then create a new Cesium.Cartographic() from that. Hi Omar, I have created a krigging layer on 2D canvas, and bringing it over the cesium in the form of a rectangle, but however when it lays over the cesium globe, the canvas positions do not exact position on the cesium map. What factors do I need to take care for proper alignment? I am using aspect ratio as 1:1 and pixel size as 1 to create krigged map on separate 2d canvas. Thanks, Tushar How are you currently adjusting the position of the rectangle on the 3D globe? Do you have the latitude/longitude of where the corners of the rectangle are supposed to be? You can use this SceneTransforms function to convert from a 3D world position to a 2D position on the screen: https://cesiumjs.org/Cesium/Build/Documentation/SceneTransforms.html#.wgs84ToWindowCoordinates Or for the opposite transformation, there is pickEllipsoid: https://cesiumjs.org/Cesium/Build/Documentation/Camera.html?classFilter=Camera#pickEllipsoid Or if you’re using terrain, then pickPosition: https://cesiumjs.org/Cesium/Build/Documentation/Scene.html?classFilter=scene#pickPosition I have around 10 cartesian positions and I calculated the minimum bounds and maximum bounds from these positions like minBounds = [minLongitude,minLatitude]; maxBounds = [maxLongitude,maxLatutude]; and I calculated the cartesian2 of minBounds and maxBounds using SceneTransforms. I have created a rectangle using these minBounds and maxBounds Now I want to set the canvas image in this rectangle and lay that rectangle on an elevated surface. The positions in the image should collide with the positions on cesium globe. Problem is that when I lay canvas image on this rectangle, only a proportion of image is laid on rectangle, not the complete generated image. I want to frame the complete canvas image in the rectangle. Primitive appearance material is not accepting the canvas image. This is a good reference on the materials in Cesium: https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Materials.html You should be able to pass a canvas as an image. This issue has an example of doing it with entities: https://github.com/AnalyticalGraphicsInc/cesium/issues/2821 If that’s not working for you, can you provide a Sandcastle example with your code that I can run?
901
3,908
{"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.765625
3
CC-MAIN-2022-21
latest
en
0.894842
https://netlib.org/lapack/explore-html/d6/d35/clantb_8f_source.html
1,701,438,107,000,000,000
text/html
crawl-data/CC-MAIN-2023-50/segments/1700679100287.49/warc/CC-MAIN-20231201120231-20231201150231-00672.warc.gz
496,835,329
9,796
LAPACK 3.12.0 LAPACK: Linear Algebra PACKage Searching... No Matches clantb.f Go to the documentation of this file. 1*> \brief \b CLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular band matrix. 2* 3* =========== DOCUMENTATION =========== 4* 5* Online html documentation available at 6* http://www.netlib.org/lapack/explore-html/ 7* 8*> \htmlonly 10*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clantb.f"> 11*> [TGZ]</a> 12*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clantb.f"> 13*> [ZIP]</a> 14*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clantb.f"> 15*> [TXT]</a> 16*> \endhtmlonly 17* 18* Definition: 19* =========== 20* 21* REAL FUNCTION CLANTB( NORM, UPLO, DIAG, N, K, AB, 22* LDAB, WORK ) 23* 24* .. Scalar Arguments .. 25* CHARACTER DIAG, NORM, UPLO 26* INTEGER K, LDAB, N 27* .. 28* .. Array Arguments .. 29* REAL WORK( * ) 30* COMPLEX AB( LDAB, * ) 31* .. 32* 33* 34*> \par Purpose: 35* ============= 36*> 37*> \verbatim 38*> 39*> CLANTB returns the value of the one norm, or the Frobenius norm, or 40*> the infinity norm, or the element of largest absolute value of an 41*> n by n triangular band matrix A, with ( k + 1 ) diagonals. 42*> \endverbatim 43*> 44*> \return CLANTB 45*> \verbatim 46*> 47*> CLANTB = ( max(abs(A(i,j))), NORM = 'M' or 'm' 48*> ( 49*> ( norm1(A), NORM = '1', 'O' or 'o' 50*> ( 51*> ( normI(A), NORM = 'I' or 'i' 52*> ( 53*> ( normF(A), NORM = 'F', 'f', 'E' or 'e' 54*> 55*> where norm1 denotes the one norm of a matrix (maximum column sum), 56*> normI denotes the infinity norm of a matrix (maximum row sum) and 57*> normF denotes the Frobenius norm of a matrix (square root of sum of 58*> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. 59*> \endverbatim 60* 61* Arguments: 62* ========== 63* 64*> \param[in] NORM 65*> \verbatim 66*> NORM is CHARACTER*1 67*> Specifies the value to be returned in CLANTB as described 68*> above. 69*> \endverbatim 70*> 71*> \param[in] UPLO 72*> \verbatim 73*> UPLO is CHARACTER*1 74*> Specifies whether the matrix A is upper or lower triangular. 75*> = 'U': Upper triangular 76*> = 'L': Lower triangular 77*> \endverbatim 78*> 79*> \param[in] DIAG 80*> \verbatim 81*> DIAG is CHARACTER*1 82*> Specifies whether or not the matrix A is unit triangular. 83*> = 'N': Non-unit triangular 84*> = 'U': Unit triangular 85*> \endverbatim 86*> 87*> \param[in] N 88*> \verbatim 89*> N is INTEGER 90*> The order of the matrix A. N >= 0. When N = 0, CLANTB is 91*> set to zero. 92*> \endverbatim 93*> 94*> \param[in] K 95*> \verbatim 96*> K is INTEGER 97*> The number of super-diagonals of the matrix A if UPLO = 'U', 98*> or the number of sub-diagonals of the matrix A if UPLO = 'L'. 99*> K >= 0. 100*> \endverbatim 101*> 102*> \param[in] AB 103*> \verbatim 104*> AB is COMPLEX array, dimension (LDAB,N) 105*> The upper or lower triangular band matrix A, stored in the 106*> first k+1 rows of AB. The j-th column of A is stored 107*> in the j-th column of the array AB as follows: 108*> if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j; 109*> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k). 110*> Note that when DIAG = 'U', the elements of the array AB 111*> corresponding to the diagonal elements of the matrix A are 112*> not referenced, but are assumed to be one. 113*> \endverbatim 114*> 115*> \param[in] LDAB 116*> \verbatim 117*> LDAB is INTEGER 118*> The leading dimension of the array AB. LDAB >= K+1. 119*> \endverbatim 120*> 121*> \param[out] WORK 122*> \verbatim 123*> WORK is REAL array, dimension (MAX(1,LWORK)), 124*> where LWORK >= N when NORM = 'I'; otherwise, WORK is not 125*> referenced. 126*> \endverbatim 127* 128* Authors: 129* ======== 130* 131*> \author Univ. of Tennessee 132*> \author Univ. of California Berkeley 133*> \author Univ. of Colorado Denver 134*> \author NAG Ltd. 135* 136*> \ingroup lantb 137* 138* ===================================================================== 139 REAL function clantb( norm, uplo, diag, n, k, ab, 140 \$ ldab, work ) 141* 142* -- LAPACK auxiliary routine -- 143* -- LAPACK is a software package provided by Univ. of Tennessee, -- 144* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 145* 146* .. Scalar Arguments .. 147 CHARACTER diag, norm, uplo 148 INTEGER k, ldab, n 149* .. 150* .. Array Arguments .. 151 REAL work( * ) 152 COMPLEX ab( ldab, * ) 153* .. 154* 155* ===================================================================== 156* 157* .. Parameters .. 158 REAL one, zero 159 parameter( one = 1.0e+0, zero = 0.0e+0 ) 160* .. 161* .. Local Scalars .. 162 LOGICAL udiag 163 INTEGER i, j, l 164 REAL scale, sum, value 165* .. 166* .. External Functions .. 167 LOGICAL lsame, sisnan 168 EXTERNAL lsame, sisnan 169* .. 170* .. External Subroutines .. 171 EXTERNAL classq 172* .. 173* .. Intrinsic Functions .. 174 INTRINSIC abs, max, min, sqrt 175* .. 176* .. Executable Statements .. 177* 178 IF( n.EQ.0 ) THEN 179 VALUE = zero 180 ELSE IF( lsame( norm, 'M' ) ) THEN 181* 182* Find max(abs(A(i,j))). 183* 184 IF( lsame( diag, 'U' ) ) THEN 185 VALUE = one 186 IF( lsame( uplo, 'U' ) ) THEN 187 DO 20 j = 1, n 188 DO 10 i = max( k+2-j, 1 ), k 189 sum = abs( ab( i, j ) ) 190 IF( VALUE .LT. sum .OR. sisnan( sum ) ) VALUE = sum 191 10 CONTINUE 192 20 CONTINUE 193 ELSE 194 DO 40 j = 1, n 195 DO 30 i = 2, min( n+1-j, k+1 ) 196 sum = abs( ab( i, j ) ) 197 IF( VALUE .LT. sum .OR. sisnan( sum ) ) VALUE = sum 198 30 CONTINUE 199 40 CONTINUE 200 END IF 201 ELSE 202 VALUE = zero 203 IF( lsame( uplo, 'U' ) ) THEN 204 DO 60 j = 1, n 205 DO 50 i = max( k+2-j, 1 ), k + 1 206 sum = abs( ab( i, j ) ) 207 IF( VALUE .LT. sum .OR. sisnan( sum ) ) VALUE = sum 208 50 CONTINUE 209 60 CONTINUE 210 ELSE 211 DO 80 j = 1, n 212 DO 70 i = 1, min( n+1-j, k+1 ) 213 sum = abs( ab( i, j ) ) 214 IF( VALUE .LT. sum .OR. sisnan( sum ) ) VALUE = sum 215 70 CONTINUE 216 80 CONTINUE 217 END IF 218 END IF 219 ELSE IF( ( lsame( norm, 'O' ) ) .OR. ( norm.EQ.'1' ) ) THEN 220* 221* Find norm1(A). 222* 223 VALUE = zero 224 udiag = lsame( diag, 'U' ) 225 IF( lsame( uplo, 'U' ) ) THEN 226 DO 110 j = 1, n 227 IF( udiag ) THEN 228 sum = one 229 DO 90 i = max( k+2-j, 1 ), k 230 sum = sum + abs( ab( i, j ) ) 231 90 CONTINUE 232 ELSE 233 sum = zero 234 DO 100 i = max( k+2-j, 1 ), k + 1 235 sum = sum + abs( ab( i, j ) ) 236 100 CONTINUE 237 END IF 238 IF( VALUE .LT. sum .OR. sisnan( sum ) ) VALUE = sum 239 110 CONTINUE 240 ELSE 241 DO 140 j = 1, n 242 IF( udiag ) THEN 243 sum = one 244 DO 120 i = 2, min( n+1-j, k+1 ) 245 sum = sum + abs( ab( i, j ) ) 246 120 CONTINUE 247 ELSE 248 sum = zero 249 DO 130 i = 1, min( n+1-j, k+1 ) 250 sum = sum + abs( ab( i, j ) ) 251 130 CONTINUE 252 END IF 253 IF( VALUE .LT. sum .OR. sisnan( sum ) ) VALUE = sum 254 140 CONTINUE 255 END IF 256 ELSE IF( lsame( norm, 'I' ) ) THEN 257* 258* Find normI(A). 259* 260 VALUE = zero 261 IF( lsame( uplo, 'U' ) ) THEN 262 IF( lsame( diag, 'U' ) ) THEN 263 DO 150 i = 1, n 264 work( i ) = one 265 150 CONTINUE 266 DO 170 j = 1, n 267 l = k + 1 - j 268 DO 160 i = max( 1, j-k ), j - 1 269 work( i ) = work( i ) + abs( ab( l+i, j ) ) 270 160 CONTINUE 271 170 CONTINUE 272 ELSE 273 DO 180 i = 1, n 274 work( i ) = zero 275 180 CONTINUE 276 DO 200 j = 1, n 277 l = k + 1 - j 278 DO 190 i = max( 1, j-k ), j 279 work( i ) = work( i ) + abs( ab( l+i, j ) ) 280 190 CONTINUE 281 200 CONTINUE 282 END IF 283 ELSE 284 IF( lsame( diag, 'U' ) ) THEN 285 DO 210 i = 1, n 286 work( i ) = one 287 210 CONTINUE 288 DO 230 j = 1, n 289 l = 1 - j 290 DO 220 i = j + 1, min( n, j+k ) 291 work( i ) = work( i ) + abs( ab( l+i, j ) ) 292 220 CONTINUE 293 230 CONTINUE 294 ELSE 295 DO 240 i = 1, n 296 work( i ) = zero 297 240 CONTINUE 298 DO 260 j = 1, n 299 l = 1 - j 300 DO 250 i = j, min( n, j+k ) 301 work( i ) = work( i ) + abs( ab( l+i, j ) ) 302 250 CONTINUE 303 260 CONTINUE 304 END IF 305 END IF 306 DO 270 i = 1, n 307 sum = work( i ) 308 IF( VALUE .LT. sum .OR. sisnan( sum ) ) VALUE = sum 309 270 CONTINUE 310 ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN 311* 312* Find normF(A). 313* 314 IF( lsame( uplo, 'U' ) ) THEN 315 IF( lsame( diag, 'U' ) ) THEN 316 scale = one 317 sum = n 318 IF( k.GT.0 ) THEN 319 DO 280 j = 2, n 320 CALL classq( min( j-1, k ), 321 \$ ab( max( k+2-j, 1 ), j ), 1, scale, 322 \$ sum ) 323 280 CONTINUE 324 END IF 325 ELSE 326 scale = zero 327 sum = one 328 DO 290 j = 1, n 329 CALL classq( min( j, k+1 ), ab( max( k+2-j, 1 ), j ), 330 \$ 1, scale, sum ) 331 290 CONTINUE 332 END IF 333 ELSE 334 IF( lsame( diag, 'U' ) ) THEN 335 scale = one 336 sum = n 337 IF( k.GT.0 ) THEN 338 DO 300 j = 1, n - 1 339 CALL classq( min( n-j, k ), ab( 2, j ), 1, scale, 340 \$ sum ) 341 300 CONTINUE 342 END IF 343 ELSE 344 scale = zero 345 sum = one 346 DO 310 j = 1, n 347 CALL classq( min( n-j+1, k+1 ), ab( 1, j ), 1, scale, 348 \$ sum ) 349 310 CONTINUE 350 END IF 351 END IF 352 VALUE = scale*sqrt( sum ) 353 END IF 354* 355 clantb = VALUE 356 RETURN 357* 358* End of CLANTB 359* 360 END logical function sisnan(sin) SISNAN tests input for NaN. Definition sisnan.f:59 real function clantb(norm, uplo, diag, n, k, ab, ldab, work) CLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,... Definition clantb.f:141 subroutine classq(n, x, incx, scale, sumsq) CLASSQ updates a sum of squares represented in scaled form. Definition classq.f90:124 logical function lsame(ca, cb) LSAME Definition lsame.f:48
3,483
9,663
{"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-2023-50
latest
en
0.410903
https://math.answers.com/math-and-arithmetic/What_is_5_over_2_plus_eight_over_nine_subtracted_by_two_over_three
1,721,913,079,000,000,000
text/html
crawl-data/CC-MAIN-2024-30/segments/1720763858305.84/warc/CC-MAIN-20240725114544-20240725144544-00768.warc.gz
323,959,266
48,270
0 # What is 5 over 2 plus eight over nine subtracted by two over three? Updated: 9/19/2023 Wiki User 13y ago The answer is 49 over 18 or 2 and 13 over 18. Wiki User 13y ago Earn +20 pts Q: What is 5 over 2 plus eight over nine subtracted by two over three? Submit Still have questions? Related questions ### What is nine subtracted by eight over four? 9 - 8/4 = 7 (9 - 8)/4 = 1/4 2/9 5 over 9. 288 ### What is three over eight times eight over nine? 3/8 times 8/9 = 24/72 or 1/3 in its simplest form ### What is eight over nine minus three over four? Five (5) over Thirty six (36). Or, roughly .13888888889. ### Is five over eight bigger than nine over ten? five over eight is less than nine over ten ### What is negative eight over nine divided by two over three? -(8/9) / (2/3) = -1 1/3 ### What is nine over twelve subtracted by four over 5? 9/12 minus 4/5 = -1/20 ### What is three over eight as a decimal? Three over eight as a decimal is 0.375 ### What is eight over nine plus 7 over nine? 17/9 I thought it was 15/9 five over nine
336
1,065
{"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.921875
4
CC-MAIN-2024-30
latest
en
0.952088
https://bigideasmathanswers.com/unit-of-measurement/
1,723,686,256,000,000,000
text/html
crawl-data/CC-MAIN-2024-33/segments/1722641141870.93/warc/CC-MAIN-20240815012836-20240815042836-00627.warc.gz
103,374,587
42,475
# Units of Measurement – Definition, Conversion, Examples | Metric Units of Length, Mass, Volume, Time In the metric system of measurement, the meter is the basic unit of length, a gram is the basic unit of mass and liter is the basic unit of capacity.  We can use a centimeter(cm) to measure the length. Centimeter and Millimeter are very small units to measure the length, so we use another unit called meters. Learn completely about the Units of a Measurement- Definition, Units Conversion, Prefix for Length, Time, Weight, and Volume or Capacity. Get to know the Importance of SI Units, Solved Examples on How to Convert one unit to another, etc. ## Metric System – Introduction The French are widely credited with originating the metric system of measurement, the system is officially adopted in 1795. It was originated in the year 1799. Metric System is basically a system used for measuring distance, length, volume, weight, and temperature. The term metric system is used as another word for SI or the international system of units.  Based on three basic units we can measure almost everything in the world, those are M- Meter, used to measure the length, Kg- Kilogram, used to measure the mass, and S- Second, used to measure time. ### Units of Measurement – Definition The SI system, also called the metric system, is used around the world. SI units stand for standard International System of the units. Seven basic units in the SI  system, give proper definitions for meter, kilogram, and the second. It also specifies and defines remaining four different  units: 1. Kelvin(K)- used to measure the Temperature 2. Ampere(A)- used to measure the Electric current 3. Candela(cd)- used to measure the Luminous Intensity 4. Mole(mol)- used to measure  the Material Quantity ### Units of Measurement Conversion To convert among units in the metric system, identify the unit that you have, the unit that you want to convert to, and then count the number of units between them. Some units are connected with each other by the following relation: 1 Kilometer (km) = 1000 meter (m) 1 meter (m) = 100 centimeter (cm) 1 centimeter (cm) =  10 millimeter (mm) ### Metric Units Prefix A metric prefix is a unit prefix that precedes a basic unit of measure to indicate a multiple or submultiple of the unit. To convert from one unit to another within the metric system usually means moving a decimal point. you can convert within the metric system relatively easily by simply multiplying or dividing the number by the value of prefix. In order to remember the proper movements of units, arrange the prefixes from the largest to the smallest. Now, let us discuss some of the units for length, weight, volume, time. ### Units of Measurement Length The most common unit used to measure the length are as follows. Centimeters and millimeters are very small to measure the length so, we use another unit that is the meter (m). Even meter is too small when we measure the distance between two cities, we use kilometers (km). Kilometer (km) Hectometer (hm) Decameter (dam) Meter (m) Decimeter (dm) Centimeter (cm) Millimeter (mm) 1000 100 10 1 1/10 1/100 1/1000 ### Units of Measurement for Volume or Capacity A liter is a metric unit of volume. The most common units used to measure the capacity or volume of any object are as follows: 1 liter (l) = 1000 milliliters (ml) Kiloliter (kl) Hectoliter (hl) Decaliter(dal) Liter (l) Deciliter (dl) Centiliter(cl) Milliliter(ml) 1000 100 10 1 1/10 1/100 1/1000 ### Units of Measurement for Weight To measure the weight of the compound, we can use a smaller unit called milligrams. The most common units to measure the weight of any object are as follows: 1 kilograms (kg) = 1000 grams (gm) 1 grams (gm) = 1000 milligrams (mg) 1 kilograms (kg) = 1000 × 1000 milligrams (mg) = 1,000,000 milligrams (mg) Kilogram (kg) Hectogram (hg) Decagram (dag) Gram (g) Decigram (dg) Centigram(cg) Milligram (mg) 1000 100 10 1 1/10 1/100 1/1000 ### SI Unit of Measurement for Time The SI unit for the period, as for all the measurements of time, is the Second. The other units of Time are minute, hour, day, week, month, year, and century. Now let us discuss some other units of time. 1 minute = 60 seconds 1 hour = 60 minutes 1day = 24 hours 1 week = 7 days 1 month = 30 or 31 days NOTE: February has 28 days, but in leap year February has 29 days. 1 year = 12 hours or 365 days (in a leap year 366 days) ### Importance of Standard Unit of Measurement We need standard units for measurement, to make our judgment more reliable, accurate, and uniformity.  It is important because it allows scientists to compare data and communicate with each other about their results. To avoid confusion when measuring, scientists use a shared system of measurement called the international system of units (SI). ### Units of Measurement Examples Example 1: Convert  248 centimeters to meters? Solution: We know that, 1 cm = 0.01 mThus , 248 cm = 248 x 0.01 = 2.48 m now , 248 cm = 2. 48 m Therefore, 248 cm is equivalent to 2.48 m. Example 2: Convert  2000 grams to kilograms? Solution: We know that, 1 gram = 0.001 grams Thus , 2000 grams = 2000 x 0.001 = 2 kilogram 2000 grams = 2 kilograms Therefore, 2000 grams is equivalent to 2 kilograms. Example 3: Convert 20 kiloliters to liters? Solution: We know that 1 kiloliter = 1000 liters Thus, 20 litres = 20 x 1000 litres = 20000 liters 20 kiloliters = 20000 liters Therefore, 20 kiloliters are equivalent to 20000 liters. Example 4: Convert  150 kg to milligrams? Solution: We know that, 1 gram = 1000 milligrams and 1 kg = 1000 grams So, first we convert the kg to g as : 1 kg = 1000 g Therefore,  150 kg = 150 x 1000 g = 150,000 grams Now, converting g to mg: 1 g = 1000 mg Therefore , 150,000 g = 150,000 x 1000 mg = 250,000,000 mg. #### FAQ’S on Units of Measurements 1.  What are the base units for Length, Weight, and Volume in a Metric System? The base units for length, weight, and volume in a metric system are meters, grams, and liters respectively. 2. Mention the US Standard Units for Length, Weight, and Volume? In US systems, the units used are: • Distance or length in miles, yards, feet, inches • Mass or weight in pounds, tons, ounces • Capacity or volume in cups, gallons or quarts, pints, fluid ounces. 3. What are the advantages of using a Standard Unit of Measurement? The advantage of the SI unit is, it has only one unit for each quantity. suppose the one and only SI unit of length is the meter (m). 4. Why do we use Measurement? Measurements require tools and provide scientists with a quantity. A quantity describes how much of something there is or how many there are. 5. What is a Standard Unit? Standard units are the units we usually use to measure the weight, length, and volume of the objects.
1,757
6,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.765625
4
CC-MAIN-2024-33
latest
en
0.901199
https://www.inchcalculator.com/convert/week-to-microsecond/
1,726,179,246,000,000,000
text/html
crawl-data/CC-MAIN-2024-38/segments/1725700651498.46/warc/CC-MAIN-20240912210501-20240913000501-00481.warc.gz
770,749,625
15,701
# Weeks to Microseconds Converter Enter the time in weeks below to get the value converted to microseconds. ## Result in Microseconds: 1 wk = 604,800,000,000 µs Do you want to convert microseconds to weeks? ## How to Convert Weeks to Microseconds To convert a measurement in weeks to a measurement in microseconds, multiply the time by the following conversion ratio: 604,800,000,000 microseconds/week. Since one week is equal to 604,800,000,000 microseconds, you can use this simple formula to convert: microseconds = weeks × 604,800,000,000 The time in microseconds is equal to the time in weeks multiplied by 604,800,000,000. For example, here's how to convert 5 weeks to microseconds using the formula above. microseconds = (5 wk × 604,800,000,000) = 3,024,000,000,000 µs ### How Many Microseconds Are in a Week? There are 604,800,000,000 microseconds in a week, which is why we use this value in the formula above. 1 wk = 604,800,000,000 µs ## What Is a Week? One week is a time period of seven days. The following days are a part of a week: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. Weeks can be abbreviated as wk (plural wks); for example, 1 week can be written as 1 wk, and 2 weeks can be written as 2 wks. ## What Is a Microsecond? One microsecond is equal to 1/1,000 of a millisecond or 1,000 nanoseconds. The microsecond is a multiple of the second, which is the SI base unit for time. In the metric system, "micro" is the prefix for millionths, or 10-6. Microseconds can be abbreviated as µs; for example, 1 microsecond can be written as 1 µs. ## Week to Microsecond Conversion Table Table showing various week measurements converted to microseconds. Weeks Microseconds 0.00000000001 wk 6.048 µs 0.00000000002 wk 12.1 µs 0.00000000003 wk 18.14 µs 0.00000000004 wk 24.19 µs 0.00000000005 wk 30.24 µs 0.00000000006 wk 36.29 µs 0.00000000007 wk 42.34 µs 0.00000000008 wk 48.38 µs 0.00000000009 wk 54.43 µs 0.000000000001 wk 0.6048 µs 0.00000000001 wk 6.048 µs 0.0000000001 wk 60.48 µs 0.000000001 wk 604.8 µs 0.00000001 wk 6,048 µs 0.0000001 wk 60,480 µs 0.000001 wk 604,800 µs 0.00001 wk 6,048,000 µs 0.0001 wk 60,480,000 µs 0.001 wk 604,800,000 µs 0.01 wk 6,048,000,000 µs 0.1 wk 60,480,000,000 µs 1 wk 604,800,000,000 µs
754
2,279
{"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.546875
4
CC-MAIN-2024-38
latest
en
0.855664
https://www.physicsforums.com/threads/find-limit-n-xn.338163/
1,611,822,699,000,000,000
text/html
crawl-data/CC-MAIN-2021-04/segments/1610704839214.97/warc/CC-MAIN-20210128071759-20210128101759-00662.warc.gz
909,733,948
13,107
Find LIMIT n→∞ Xn! Consider the sequence xn in which xn = 1/2(xn−1 + (3/xn-1) and x1 = a (a not equals 0). Find lim n →∞ xn
53
124
{"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-2021-04
latest
en
0.786991
https://www.geeksforgeeks.org/electric-motor/?ref=lbp
1,713,056,741,000,000,000
text/html
crawl-data/CC-MAIN-2024-18/segments/1712296816863.40/warc/CC-MAIN-20240414002233-20240414032233-00208.warc.gz
739,666,581
47,678
# Electric Motor Last Updated : 21 Nov, 2022 An electric motor used to generate mechanical power in the form of rotation. Let’s look at an example: What is the purpose of the electric fan in your home? It starts rotating when the switch is turned on and starts blowing air by rotating its blades. So what would be the answer if someone asked about its working? Is it because of electricity? No, electricity is the method to start the electric fan that is the conversion of electrical energy into mechanical energy. But how is the conversion of electrical energy into mechanical energy take place? What happens inside the electric motor? Let’s discuss it. ### What is an Electric Motor? An electric motor is a machine that is used to convert electrical energy into mechanical energy. When a current-carrying conductor is placed in the magnetic field it experiences some forces that help in the rotation of the shaft or axil. A motor is a piece of machinery that transforms electrical energy into mechanical energy. A mixer, for example, has spinning blades that mash and combine ingredients. The electric energy input to the mixer is converted into mechanical energy of the blade rotating, resulting in the desired action. ### Principle of an Electric Motor • A motor operates on the principle of the current magnetic effect. When a current-carrying conductor generates a magnetic field around it then a force acts on a current-carrying conductor when it is placed perpendicular to the magnetic field. • When a rectangular coil is put in a magnetic field and current is transmitted through it, a force acts on the coil, causing it to spin continuously. • Consider the poles of two bar magnets held facing each other, separated by a narrow escape. A small length of conducting wire is formed into a loop and placed in the gap between the magnets so that it is in the magnetic field created by the magnets. As the loop’s ends are wired to the battery terminals, the loop begins to spin. This is due to the magnet’s magnetic field interfering with the electric current passing into the conductor. The induced South Pole is drawn to the North Pole due to the magnetic poles induced in the circle, and vice versa. As the current in the circle reverses, the caused the South Pole becomes the North Pole and is drawn to the magnet’s south pole. This leads the circle to spin indefinitely. Fleming’s Left-Hand Rule The first finger, middle finger, and thumb of your left hand should be stretched perpendicular to each other in such a way that the first finger represents the direction of the magnetic field, the middle finger represents the direction of the current in the conductor, and the thumb indicates the direction of motion of the conductor, according to Fleming’s left-hand rule. ### Construction of an Electric Motor Construction of an Electric Motor Following are the main parts of the motor as shown in the figure above, with their respective functions: 1. Battery: A Battery is the DC power source that is frequently connected to a basic motor. It supplies DC current to the armature coil. 2. Brushes: There are two carbon brushes present in the electric motor which serve as a connection between the commutator and the battery terminals. 3. Permanent magnet: generates a strong magnetic field. 4. Split ring type commutator: The reversal of current in the armature coil is takes place with the help of the commutator. It is made up of two metallic ring halves. The armature coil’s two ends are connected to these two halves’ metallic ring. 5. Armature core: The armature coil is held in place by the armature core and also provides mechanical support to the coil. 6. Armature coil: It is made up of single or multiple rectangle-shaped loops of insulated copper wire. 7. Axle or Shaft: It is the place where the exchange of mechanical power takes place. The armature core and the commutator are mounted on the shaft. ### Working of an Electric Motor Working of an Electric Motor 1. Initially, Brush B1 makes contact with the commutator half-ring R1, whereas brush B2 makes contact with the commutator half-ring R2. Current flows from A to B along coil side l1 of the rectangular coil ABCD, and from C to D along coil side l2. The magnetic field is directed from the magnet’s North pole to its South pole. 2. The force F on the coil side l1 of the coil is in a downward direction, but the force F on the coil side l2 of the coil is in an upward direction, according to Fleming’s Left-hand rule. As a result, the coil’s side l1 is pulled down while its side l2 is pushed up. This causes the coil ABCD to revolve counterclockwise. 3. When the coil reaches a vertical position while rotating, the brushes will contact the gap between the two commutator rings which cut off the flow of the current i in the coil. Despite the fact that the current i to the coil is cut off when it reaches the exact vertical position, the coil continues to rotate because it has momentum and has moved beyond the vertical position. 4. When the coil moves beyond the vertical position after the half revolution, the coil’s side l2 moves to the left, while the coil’s side l1 moves to the right, and the two commutator half rings automatically change contact position from one brush to the other that is Brush B1 makes contact with the commutator half-ring R2, whereas brush B2 makes contact with the commutator half-ring R1. This makes the coil’s current i flow in the other direction. 5. Now, the force acting on the sides l1 and l2 of the coil is reversed when the current i direction is reversed. The coil’s side l2 is now on the left, with a downward force F applied to it, while the side l1 is now on the right, with an upward force F applied to it. As a result, the coil’s side l2 is pulled down and the coil’s side l1 is pushed up. This causes the coil to rotate counterclockwise. 6. After every half rotation, the current in the coil is reversed, and the coil continues to revolve as long as electricity from the battery is transmitted through it. ### Uses of an Electric Motor Electric motors are utilized for a wide range of purposes. The following is a list of some of them. 1. Electric cars: Electric cars used in traveling. and it is pollution-free. 2. Rolling mills: Rolling mills used to decrease the width of the hard material like metals. 3. Electric cranes: Electric cranes used to lift heavy objects. 4. Lifts: Basically used in big buildings. 5. Drilling machine: A drilling machine used to make a hole in the walls or woods 6. Fan: Fans are used for blowing air. 7. Hairdryers: Hairdryers used to dry wet hair. 8. Tape recorder: A tape recorder used to record the audio or video. 9. Washing machine: The washing machine is the wash the clothes. 10. Mixers: Mixers are used to mash and mix things. The efficiency of a motor to be roughly about 70 – 85% as the remaining energy is wasted in heat production and sounds emitted. ### Sample Problems Problem 1: State Fleming’s left-hand rule. Solution: Fleming’s left-hand rule state that the first finger, middle finger, and thumb of your left hand should be stretched perpendicular to each other in such a way that the first finger represents the direction of the magnetic field, the middle finger represents the direction of the current in the conductor, and the thumb indicates the direction of motion of the conductor, according to Fleming’s left-hand rule. Problem 2: What is the principle of an electric motor? Solution: A motor operates on the principle of the current magnetic effect. When a current-carrying conductor generates a magnetic field around it then a force acts on a current-carrying conductor when it is placed perpendicular to the magnetic field. Problem 3: What is the role of the split ring in an electric motor? Solution: The reversal of current in the armature coil takes place with the help of the commutator. It is made up of two metallic ring halves. The armature coil’s two ends are connected to these two halves metallic ring. Problem 4: How will you find out the direction of the magnetic field produced by the current-carrying conductor? Solution: Maxwell’s right-hand thumb rule is used to determine the direction of the magnetic field lines created by a straight wire carrying electricity. Imagine that the current-carrying wire is in the right hand, with the thumb pointing in the direction of the current, and the direction in which the fingers encircle the wire determines the direction of magnetic lines of force around the wire. Problem 5: What is the difference between a bar magnet and an electromagnet. Solution: Following are the difference between a bar magnet and an electromagnet: Previous Next
1,872
8,737
{"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.03125
3
CC-MAIN-2024-18
latest
en
0.930708
https://www.askiitians.com/forums/Mechanics/10/26693/momemtum.htm
1,685,324,286,000,000,000
text/html
crawl-data/CC-MAIN-2023-23/segments/1685224644574.15/warc/CC-MAIN-20230529010218-20230529040218-00095.warc.gz
734,335,980
33,554
# A   shell of mass 10kg flying horizontally with a velocity  of 36kmph  explodes  in air into two  fragments .The larger   fragment   has   a velocity  of 25ms-1 and directed  in the same direction as the initial velocity of the  shell. The smaller fragment  has a  velocity  of  12.5ms-2in the opposite  direction  .      find the masses   of the fragments……………………. SAGAR SINGH - IIT DELHI 879 Points 12 years ago Dear student, Apply conservation of momentum m1u1=m1v1+m2v2 Apply conservation of energy 1/2mu1^2=1/2m1v1^2+1/2m2v2^2 All the best. Win exciting gifts by answering the questions on Discussion Forum. So help discuss any query on askiitians forum and become an Elite Expert League askiitian.
210
713
{"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-2023-23
latest
en
0.486489
http://www.fao.org/Wairdocs/ILRI/x5436E/x5436e05.htm
1,529,929,157,000,000,000
text/html
crawl-data/CC-MAIN-2018-26/segments/1529267867666.97/warc/CC-MAIN-20180625111632-20180625131632-00358.warc.gz
407,732,903
14,988
# 3. The use of descriptive statistics in the presentation of epidemiological data 3.1 Introduction 3.2 Tables and graphs 3.3 Bar and pie charts 3.4 Classification by variable 3.5 Quantification of disease events in populations 3.6 Methods of summarising numerical data ## 3.1 Introduction Evidence of the presence, nature and severity of a disease will usually be contained in statistical data of some kind. These may take the form of counts of the numbers of diseased animals, physical measurements of a sample of animals, the measurement of one or more biological variables that are likely to be affected by the presence of the disease, and so on. Any report on the disease will have to include at least a descriptive presentation of the statistical evidence. There are several basic methods and measures which are commonly used to display and summarise sets of data. The choice of technique used depends mainly on the kind of data involved. Data come in two main categories - categorical (discrete) and continuous (numerical) data. Categorical data are data that can be allocated to distinct categories, and normally take the form of counts. Categorical data found in epidemiology may take the form of dichotomous data i.e. data that can have only two values (e.g. diseased or non-diseased, infected or non-infected). Continuous data consist primarily of measurements, which, although they can be classified into defined categories, have the theoretical possibility of being infinitely subdividable. For example, the weight of a chicken could be 1.45 kg, 1.453 kg, 1.45327856 kg etc. In this chapter we will be looking at some of the more common and useful methods for summarising both categorical and continuous data. ## 3.2 Tables and graphs Table 1 consists of the liveweights of 150 chickens selected randomly in a large market during a day on which approximately 4000 chickens were sold. Table 1. Weights (kg) of a sample of 150 chickens sold in a market. 1.4 1.09 1.74 1.48 1.82 1.09 1.52 1.41 1.83 1.22 1.34 1.68 1.25 1.65 1.14 1.33 1.06 1.71 1.17 1.51 1.36 1.34 1.03 1.24 1.06 1.12 1.15 1.57 1.38 1.4 1.39 1.31 1.5 1.1 1.45 1.34 1.38 1.35 1.49 1.58 1.25 1.42 1.64 1.57 1.53 1.18 1.39 1.34 1.13 1.23 1.17 1.88 1.3 1.27 1.01 1.63 1.47 1.23 1.48 1.48 1.37 1.42 1.22 1.47 1.31 1.05 1.61 1.41 1.17 1.45 1.43 1.22 1.4 1.14 1.53 1.25 1.02 1.3 1.35 1.37 1.69 1.37 1.11 1.3 1.05 1.19 1.36 1.63 1.44 1.29 1.35 1.59 1.94 1.51 1.78 1.37 1.11 1.38 1.53 1.44 1.47 1.39 1.55 1.76 1.43 1.37 1.67 1.36 1.31 1.41 1.36 1.26 1.17 1.15 1.79 1.46 1.35 1.29 1.5 1.26 1.36 1.41 1.36 1.32 1.08 1.28 1.33 1.29 1.42 1.5 1.32 1.39 1.2 1.68 1.2 1.35 1.56 1.57 1.37 1.27 1.25 1.38 1.56 1.6 1.74 1.4 1.11 1.6 1.21 1.44 It is not easy to make sense of these figures displayed in this form. What can we do to make them more intelligible? Perhaps the first thing which will occur to most of us is to calculate the mean (i.e. sample average) by adding all these values and dividing by 150. Doing this, we find that the mean weight of chickens in the sample is 1.3824 kg. How useful is this number? By itself, not very useful. For example, it does not allow us to draw the conclusion that "most of the chickens weighed about 1.38 kg". Adding the information that the lightest chicken weighed 1.01 kg and the heaviest 1.94 kg, we might say that the range of the sample was 0.93 kg (1.94 - 1.01), with a mean weight of 1.3824 kg. However, this does not rule out the possibility that the weights were evenly spread throughout the range, or indeed that about half were at the low end and the remainder at the upper end of the range. In other words, we would like to know precisely how the values were distributed throughout the range. The simplest way to do this is to draw up a frequency table (see Table 2). Table 2. Frequency table of the individual weights of 150 chickens. Grouped interval of chicken weights (kg) Frequencya Relative frequency (%) Cumulative frequencyb Relative cumulative frequency (%) 1.00-1.09 10 (6.7) 10 (6.7) 1.10- 1.19 16 (10.7) 26 (17.3) 1.20- 1.29 21 (14 0) 47 (31.3) 1.30- 1.39 39 (26.0) 86 (57.3) 1.40-1.49 26 (17.3) 112 (74 7) 1.50- 1.59 17 (11.3) 129 (86.0) 1.60 1.69 11 (7.3) 140 (93.3) 1.70-1.79 6 (4 0) 146 (97 3) 1.80-1.89 3 (2.0) 149 (99 3) 1.90-1.99 1 (0 7) 150 (100.0) a Number of values in each interval. b Cumulative number of values up to the end of a particular interval. The relative frequencies (column 3) were obtained by dividing the number of values in each interval by the total number of chickens in the sample and converting the result to a percentage. For example, the relative frequency of the first interval is: (10/150) x 100 = 6.7% Looking down the column of relative frequencies we see that 17.3% of the sampled chickens weighed between 1.40 and 1.49 kg, and over half (57.3%) weighed between 1.20 and 1.49 kg. The cumulative and relative cumulative frequencies also given in the table are useful in answering questions about the extremes or tails of the distribution. For example, 17.3% of chickens in the sample weighed less than 1.20 kg and 14% (100 - 86) weighed at least 1.60 kg. The information in Table 2 can also be presented as a graph (Figure 2). Frequency tables are often presented as special types of graphs called histograms. Figure 2. Histogram of the frequency distribution of chicken weights from Table 1. The area of each block in the histogram should be proportional to the relative frequency of the corresponding interval. Only when the class intervals are all of equal size, as in this case, will the height of each block be proportional to the frequency. Measured to the nearest hundredth of a kilogram, the chicken weights ranged from 1.01 to 1.94 kg i.e. there were 94 possible values in the range. If we had measured the weights to the nearest gram, there would have been 940 possible values in the range. In order to draw up a frequency table like Table 2, it is necessary to collapse the data into classes defined by intervals on the scale of measurement. Sometimes data can take only a limited range of values, and then it may be neither necessary nor desirable to group different values into the same classes. An example is Table 3 which gives the frequency of different parturitions in a herd of 153 cows. Table 3. Frequency of different parturitions in a herd of 153 cows. Parturition number 0 1 2 3 4 Number of cows 26 38 47 24 18 Relative frequency (%) 0.17 0.25 0.31 0.16 0.12 Cumulative relative frequency(%) 0.17 0.42 0.73 0.88 1.00 It does not make sense to try to draw a histogram of this data set. Other possible methods of graphical presentation will be suggested below, though, in this case, the table is by itself a clear method of presenting the data. We could use the data to calculate the mean number of parturitions - [(26x0) + (38x1) + (47x2) + (24x3) + (18x4)]/153= 1.80 - but this is unlikely to be a useful piece of information unless we wanted to compare two different herds. Even then, it would be better to give the complete sets of parturition data for both herds. ## 3.3 Bar and pie charts Categorical data that take only two possible values are often referred to as dichotomous, and we will be interested mainly in the proportions belonging to each category. Note that the use of numerical labels for categorical variables may sometimes be confusing, but it does not deprive the latter of their categorical status. The important question is whether the numerical labels still behave as numbers in the usual sense. This may be demonstrated on the following example. Three common causes of death in chickens are salmonellosis, coccidiosis and Newcastle disease, and their frequencies in a sample of 59 dead birds are shown in Table 4. For convenience of data storage, the variables were given code numbers 1, 2, 3 and 4, as shown in the table. However, these are not numbers in the usual sense. For example, we cannot say that 2 (coccidiosis) is greater than 1 (salmonellosis), and so on. They are just simpler versions of the original labels. It would therefore be silly to try to work out the mean of these coded data; the most we can do is to give tables of frequencies or percentages. Table 4. Frequencies of causes of death in a sample of 59 chickens. Cause Code No. of deaths Relative frequency (%) Salmonellosis (1) 12 0.20 Coccidiosis (2) 7 0.12 Newcastle disease (3) 30 0.51 Other (4) 10 0.17 As was pointed out a histogram would not be a suitable means of presenting the data in Table 3, and this applies also for Table 4. The data in these tables can be presented graphically either in a bar chart or a pie chart. Figure 3 is a bar chart showing the relative frequencies of the different parturition values given in Table 3. Notice the differences between a bar chart and a histogram: there should be a gap between adjacent bars in the bar chart to emphasise that the data can take only the discrete values actually marked on the horizontal axis, and each bar should have exactly the same width, with the height proportional to the relative frequency of the value over which it is centred. Figure. 3 Bar chart of parturition data from Table 3. The data on chicken pathology (Table 4) can also be displayed in a bar chart (Figure 4). However, unlike in Figure 3 where the different parity values have the usual, natural ordering, in Figure 4 the order of the different "values", i.e. diseases, on the horizontal axis is arbitrary. Remember, when there is a natural order, it must be adhered to; when the data are categorical, any ordering may be chosen. Figure 4. Bar chart of data on causes of death in chickens from Table 4 Frequently, it may be helpful to present categorical data in a decreasing order of frequency, as was done in Figure 5. Figure 5. Alternative bar chart of data from Table 4. For purely categorical data, the pie chart is a common alternative to the bar chart. The pie chart is a circle divided into as many sectors as there are categories. The area of each sector is made proportional to the relative frequency of the corresponding category by calculating the angle which the sector makes at the centre of the circle. As the total of all the angles is 360°, we need only to divide the 360° in the correct proportions among the various categories to obtain the corresponding areas. From Table 4 we know, for example, that the relative frequency of salmonellosis is 0.20. The corresponding angle is 360 x 0.20 = 72°. Similarly, the angles corresponding to coccidiosis and Newcastle disease are 43° and 184°, respectively, rounded to the nearest degree. The resulting pie chart is shown in Figure 6. Note that in histograms, pie charts and bar charts the sample size should always be quoted. ## 3.4 Classification by variable All the examples discussed so far have involved observations of a single variable in a single population of animals. However, we may wish to subdivide a population into several subgroups in order to investigate possible differences between them. For example, cattle may be classified by sex, breed, geographic location, disease status etc. In epidemiological investigations, the classificatory variables will usually be categorical and will frequently be referred to as factors or determinants. True numerical variables can also be used as classifying factors, either in the form of the values of the variable, if it takes only a small number of values, or class intervals. Figure 6. Pie chart of relative frequencies of causes of death in 59 chickens based on Table 4. For example, each animal that provided data for Table 3 could be classified by its number of parturitions, thus dividing the sample into five groups, while the chickens whose weights are given in Table 1 could be divided into 10 distinct weight groups, using the class intervals of Table 2 to define the different levels of the factor "liveweight". The choice of factors and the number of levels of each factor will depend on the degree of prior knowledge of the population to be studied, the expected scientific significance of the factors, and the measures available to the investigator. Table 5 is a contrived table displaying counts of ascaris infections in pigs according to three factors: the management system (two levels; raised indoors or outdoors), the occurrence of ascaris eggs in a sample of faeces from each pig (two levels; present or absent), and the degree of whitespot observed in the liver of each pig after slaughter (three levels; absent, slight or severe). Table 5. Contrived table based on evidence of ascaris infection in pigs: An example of a three-factor table with marginal totals. Whitespot Ascaris eggs Management system Any system Indoors Outdoors Absent Absent 503* 112* 615 Present 141* 38* 179 Total 644 150 794 Slight Absent 231* 75* 306 Present 87* 30* 117 Total 318 105 423 Severe Absent 79* 32* 111 Present 71* 17* 88 Total 150 49 199 Absent 813 219 1032 Any whitespot condition Present 299 85 384 Total 1112 304 1416 * Recorded data. In any table, it is often useful to give the marginal totals i.e. to sum the counts over all the levels of the different factors. This makes it easier to extract any subtables that may be of interest, and the marginal tables are needed anyway for the analysis of the data (see Chapter 5). On the other hand, marginal totals can greatly increase the size of a table. In Table 5, for instance, only the values marked with an asterisk are strictly necessary, while the remaining entries (24 out of 36) give supplementary information. The use of marginal totals is a matter of personal judgement: in general, if it is thought that the complete table might confuse rather than clarify the issues, then the totals are better left out. Table 6 shows one of the two-factor tables that can be derived from Table 5. Table 6. Two-factor table derived from Table 5. Whitespot Ascaris eggs Total Absent Present Absent 615 (59)a 179 (47) 794 (56) Slight 306 (30) 117 (30) 423 (30) Severe 111 (11) 88 (23) 199 (14) Total 1032 (100) 384 (100) 1416 (100) a Figures in parentheses give the relative frequencies (%) of whitespot conditions. With multi-factor tables there are always several options for presenting relative frequencies. In Table 6, for example, the relative frequency of the different whitespot conditions is given for each level of the ascaris egg factor. Alternatively, the frequency of each level of ascaris eggs could be given relative to the totals within each level of whitespot severity, or the frequency of each of the six possible whitespot-ascaris egg combinations could be calculated relative to the total number of pigs in the sample. The option chosen will depend on the point that one wants to make, but the table should make it clear which relative frequencies are given. In interpreting tables presented by other investigators care should be taken to clarify which relative frequencies are being presented or discussed. ## 3.5 Quantification of disease events in populations Data used to quantify disease events in populations are often dichotomous in nature i.e. an animal can either be infected with a disease agent or not infected. Such data are frequently presented in the form of an epidemiological rate. In epidemiology, a rate can be defined as the number of individuals having or acquiring a particular characteristic (normally an infection, a disease or a characteristic associated with a disease) during a period of observation, divided by the total number of individuals at risk of having or acquiring that characteristic during the observation period. The expression is then multiplied by a factor, normally a multiple of 10, to relate it to a specified unit of population. Rates are commonly expressed as decimals, percentages, or events per standard units of population e.g. per 1000, 10000 animals etc. This produces a standardised measure of disease occurrence and therefore allows comparisons of disease frequencies over time to be made between or within populations. Note that in a rate, the numerator is always included in the denominator, while in a ratio it is not included. In an epidemiological rate, the period of observation should always be defined. It is difficult to make valid comparisons of disease events between or within populations unless a denominator can be calculated. The use of "dangling numerators" to make comparisons is one of the biggest "crimes" that the epidemiologist can commit, and it should be avoided whenever possible. For example, suppose we were interested in comparing the numbers of cases of infection with a particular disease agent over a particular time period in two herds of cattle of the same breed but under different management systems. We are told that in herd A the number of animals infected with the disease agent in question in the month of June 1983 was 25, while in herd B the number of animals infected with the same disease agent in the same month was 50. We might therefore conclude, erroneously, that the disease was a greater problem in herd B than in herd A. Note that we did not know the denominator i.e. the population of animals at risk of being infected with the disease agent in each herd. Suppose we investigated further and found that the population at risk in herd A during the month of June was 100 while in herd Bit was 500. Then, calculating a rate for each herd, we find that the rate of infection in herd A was 25/100 or 0.25 or 25% or 250 in 1000, while in herd B it was 50/500 or 0.10 or 10% or 100 in 1000. The true position, therefore, is that the disease was a greater problem in herd A! The two main types of rates used in veterinary epidemiology are: · Morbidity rates, which are used to measure the proportion of affected individuals in a population or the risk of an individual in a population of becoming affected. · Mortality rates, which measure the proportion of animals dying in a population. Morbidity rates Morbidity rates include incidence, attack, prevalence and proportional morbidity rates. Incidence rate is the number of new cases of a disease occurring in a specified population during a specified time period, divided by the average number of individuals in that population during the specified time period. For example, suppose that out of an average population of 4000 cattle in a quarantine camp, 600 animals developed symptoms of rinderpest during the month of June. The incidence of rinderpest in that quarantine camp for the month of June was 600/4000 = 0.15 or 15% or 150 new cases per 1000 animals. The incidence rate is a way of measuring the risk that a susceptible individual in a population has of contracting a disease during a specified time period. Therefore, if a susceptible animal had been introduced into the quarantine camp on I June, it would have had a 15% chance of contracting rinderpest by the end of the month. When calculating incidence rates, problems frequently arise in estimating the denominator. Because of births, deaths, sales, movements etc. livestock populations rarely remain stable over periods of time, and such fluctuations in the denominator will obviously affect the calculation of the incidence rate. There are various ways of estimating the denominator in incidence rate calculations. These normally involve measuring the population at various intervals during the study period and averaging the results. For instance, suppose that in our previous example there were 4000 animals present at the beginning of June but that 100 animals died of the disease by the end of the second week and a further 300 by the end of the month. Assuming that no new animals were introduced or born, the animal population in the quarantine camp at the start of the observation period was therefore 4000, at the mid-period 3900 and at the end 3600. We might decide to calculate the denominator by taking the populations present at the beginning and end of the observation period and averaging them: (4000 + 3600)/2 = 3800 The corresponding incidence rate would be 600/3800 = 0.158 or 15.8%. Alternatively, we might take the populations present at the beginning, middle and end of the observation period and average them - (4000 + 3900 + 3600)/3 = 3833 - and the incidence rate in this case would be 600/3833 = 0.156 or 15.6%. Note that the different methods of calculating the denominator have resulted in slightly differing estimates of incidence. Because of this, the method used in calculating the denominator should always be specified when comparisons of incidence are being made, and the same method should be used throughout. Due to difficulties in the calculation of the denominator in incidence rates, another form of morbidity rate, the attack rate, is sometimes used. The attack rate is the total number of cases of a disease occurring in a specified population during a specified time period, divided by the total number of individuals in that population at the start of the specified time period. The denominator, therefore, remains constant throughout the period of observation. Thus, in our previous example, the attack rate would be 600/4000 = 15%. Strictly speaking, the definition of the attack rate requires that all cases of disease, not just new cases, are included in the numerator. Attack rates are normally used, however, to quantify the progress of a disease during an outbreak. In most instances there would have been no cases of the disease in question prior to the onset of the outbreak, so that all the cases are, in fact, new cases, and the attack rate becomes a modified form of incidence rate, sometimes referred to as a cumulative incidence rate. Prevalence rate is the total number of cases of a disease occurring in a specified population at a particular point in time, divided by the total number of individuals in that population present at that point in time. For example, suppose that in a population of 4000 cattle held at a quarantine camp there were 60 cases of rinderpest when the population was examined on June 18. The prevalence of rinderpest at that camp on 18 June would then be 60/4000 = 0.015 or 1.5% or 15 cases per 1000 animals. Note that prevalence is a cross-sectional measure referring to the amount of disease present in a population at a particular point in time, hence the term point prevalence. However, when dealing with large populations, point prevalence becomes almost impossible to obtain, since it is not possible to examine all the individuals in that population at a particular point in time. In general, therefore, measurements of prevalence have to take place over a period of time, and this is known as period prevalence. Provided that the time taken to measure the prevalence remains reasonably short, this parameter retains a fair degree of precision. If, however, the time interval becomes too long, a significant number of new cases of the disease will have occurred since the start of the measurement period. The parameter then becomes a mixture of point prevalence and incidence and, as such, loses precision. The terms incidence and prevalence are frequently confused and misused. Confusion normally arises due to a failure to define accurately the denominator i.e. the actual population being considered. This can result in the population at risk being either ignored or not considered in its entirety. Examples of this can be found in reports from veterinary offices laboratories, in which the term "incidence" is often used to express the number of diagnoses or isolations of a particular disease agent as a percentage of the total number of diagnoses or isolations performed. In this case the denominator is not the population of individuals at risk from the disease, and the rate calculated resembles a form of a proportional morbidity rate. A proportional morbidity rate is the number of cases of a specific disease in a specified population during a specified time period, divided by the total number of cases of all diseases in that population during that time period. For example, suppose that an outbreak of contagious bovine pleuropneumonia (CBPP) occurs in a herd of cattle. During a 6-month period there are 45 cases of different diseases, including 18 cases of contagious bovine pleuropneumonia. The proportional morbidity rate for contagious pleuropneumonia in that herd for the 6 months would then be 18/45 = 0.4 or 40% or 400 cases of CBPP in 1000 cases of all diseases. Mortality rates The most commonly used mortality rates are crude death rate and cause-specific death rate. Crude death rate is the total number of deaths occurring in a specified population during a specified time period, divided by the average number of individuals in that population during the specified time period. The denominator for this rate can be estimated in the same ways as that for an incidence rate. Note, the method of calculating the denominator should always be defined and the same method used throughout to enable meaningful comparisons to be made. Example: Suppose that in a herd of cattle there were 40 deaths in a year. The number of animals in the herd at the start of the year was 400, at mid-year 420, and at the end of the year 390. The average herd size could therefore be either (400 + 390)/2 = 395 or (400 + 420 + 390)/3 = 403 Depending on which method we used to calculate the denominator, the crude death rate would be either 40/395 = 0.101 (10.1%) or 40/403 = 0.099 (9.9%). Cause-specific death rate is a useful mortality rate and can be defined as the total number of deaths occurring from a specified cause in a specified population during a specified time period, divided by the average number of individuals in that population during that time period. The denominator is calculated in the same way as for an incidence or crude death rate, and the same caveats apply in its calculation. Example: Suppose that there were 20 deaths from babesiosis in the herd mentioned above, then the death rate due to babesiosis in that herd would be either 20/395- = 0.051 (5.1 %) or 20/403 = 0.050 (5.0 %). Other useful mortality rates Proportional mortality rate is the total number of deaths occurring from a specified disease in a specified population during a specified time period, divided by the total number of deaths in that population during that time period. Example: Suppose that out of 40 deaths in a herd 20 were from babesiosis, then the proportional mortality rate due to that disease would be 20/40 = 0.5 or 50%. Case fatality rate is the number of deaths from a specified disease in a specified population during a specified period, divided by the number of cases of that disease in that population during that time period. Example: Supppose there were 50 cases of babesiosis in the herd, then the case fatality rate due to babesiosis would be 20/50 = 0.4 or 40%. The rates described above are those that are most likely to be used in epidemiological studies in Africa. Details of other rates, how to calculate them, and their potential uses can be found in Schwabe et al (1977). The use of specific rates In epidemiology, we are nearly always involved in studying the effects of determinants on the frequency of occurrence of disease. This often involves the comparison of some of the rates mentioned previously, either in the same population over time - normally before and after a determinant is added or removed - or between populations - either with or without an added determinant, or with different frequencies of occurrence of the determinant, either at the same point in time or over a period of time. For such comparisons to be valid, the comparison groups should differ from one another only in the presence, absence, or frequency of occurrence of the particular determinant being studied. Since epidemiology usually involves the study of determinants under uncontrolled field conditions, these criteria are extremely difficult to fulfil. Nevertheless, if rates are expressed in such a form as to ignore the different characteristics which may be present within the disease agents or host populations being compared, there is a danger that such rates may give an oversimplified and even false impression of the actual situation. Rates can be made more specific, and the comparisons between them more valid, by taking into account various different characteristics. Differences in subspecies and strains of disease agents can be accounted for by clearly defining the subspecies or strain being studied and by making sure that only those individuals affected by that particular subspecies or strain are included in the numerator. Differences in the characteristics of host populations due to age, breed and sex can be expressed by calculating rates which take these specific characteristics into consideration. Thus, for example, one could calculate an age-specific incidence rate which is defined as the number of new cases of a disease occurring among individuals of a specified age group in a specified population during a specified time period, divided by the average number of individuals in that specified age group in that population during that time period. Alternatively, one could calculate a breed-specific incidence rate which is defined as the total number of new cases of a disease occurring among individuals of a specific breed in a specified population during a specified time period, divided by the average number of individuals of that breed in that population during that time period. One could go even further and calculate an age-breed specific incidence rate which is defined as the total number of new cases of a disease occurring among individuals in a specified age group of a specified breed in a specified population, divided by the average number of individuals of that specific age and breed in that population during that time period. The same procedures can be applied to other morbidity and mortality rates. A large variety of specific rates can thus be calculated by using appropriate definitions of the numerator and the denominator. As a general principle, rates should be made as specific as the data allow, but not so specific as to make the numbers involved too small for statistical analysis. For analytical purposes there is little or no advantage in calculating and comparing age- or breed-specific rates if an age-breed specific rate can be calculated. The following is an example illustrating the advantages of using specific rates in making comparisons. Suppose we wished to assess the efficiency of a tick control programme in two East Coast fever (ECF) endemic areas, where the level of disease challenge, the environmental conditions and the systems of management were approximately the same. In area A there was an average population of 10 000 head of cattle present during a 1-month study period, and 500 animals from that population developed symptoms of ECF during that period. In area B there was an average population of 15 000 head of which 1500 developed symptoms of the disease during the study period. The crude incidence rate of the disease in area A was 500/10 000 = 5 % and in area B 1500/15 000 = 10%. We might conclude, therefore, that the tick control programme in area A was more efficient than in area B. Suppose we also found that the cattle population in area A was made up of 400 crossbred Holsteins and 9600 East African Shorthorned Zebus, while that in area B con xxxsisted of 4500 crossbred Holsteins and 10 500 East African Shorthorned Zebus. We are now able to calculate breed-specific incidence rates as indicated in Table 7. Table 7. Breed-specific incidence rates of East Coast fever in two cattle populations. Area Breed Number of cattle Number of new cases of ECE Incidence (%) A Crossbred Holstein 40.0 97 24.3 East African Shorthorned Zebu 9 600 403 4.2 Total 10 000 500 5.0 B Crossbred Holstein 4 500 1 059 23.5 East African Shorthorned Zebu 10 500 441 4.2 Total 15 000 1 500 10.0 Note that whereas the crude incidence rates remain 5% and 10% respectively, there is no difference in the breed-specific incidence rates for East African Shorthorned Zebus between the two areas and the rate for crossbred Holsteins is, if anything, less in area B than it is in area A. The difference in the crude incidence rates between the two areas is due to the fact that the much more susceptible crossbreds make up only 4% of the cattle population in area A whereas in area B they represent 30% of the cattle population. ## 3.6 Methods of summarising numerical data We have already discussed the (arithmetic) mean and noted that, by itself, the mean gives no indication of how the data are dispersed about the mean value. We resolved this problem by drawing a histogram, but graphical presentation may not be always convenient and we might like to be able to reduce a data set to a few meaningful values. At this stage, it is necessary to introduce some simple algebraic notations to express a set of data values. For example, we could refer to the data in Table 1 as X1, X2,....X150, where X1 = 1.40 and X150 = 1.44. If we wanted to refer to a more general data set without fixing the total number of values it contains, we could write X1, X2.....Xn, and say that the data contain n different values or observations. We will not always use the letter X; when we want to refer to different data sets in the same context, we will use a different letter for each set. The arithmetic mean for a given data set will be expressed by the appropriate letter with a bar over it. For example: (X1 + X2 +.... Xn)/n In statistics it is common to add sets of numbers together, and we shall use a special symbol to denote that operation, namely: which means the sum of all X's from i = 1 to i = n i.e.: n or often we just write S X or S Xi. For example, we can write 1/n S X. We now return to our problem of looking for a way to describe the "scatter" of values about the mean value X. It turns out, for a variety of reasons, that a convenient value is the standard deviation (S), calculated as follows: This formula says: "Find the distance of each individual value X from the mean, square that distance, and then find the average squared distance; finish by taking the square root of the average". Many different formulae can be found in elementary books on statistics for calculating the standard deviation. The best solution is probably to buy a cheap calculator with this calculation built in. Alternatively, the following formula can be used: This formula gives the same answer as the previous one but is easier to manipulate on a calculator. Using this formula, the standard deviation for the data in Table I was calculated as 0.1931. There is a point to be made here about suitable levels of accuracy. A calculator may give S = 0.1930736, but this number has too many decimal places to be intelligible. About four significant figures is the maximum that will be absorbed by most readers of a paper or report, and many will notice only the first two. How to make use of the pair of numbers and S to grasp the main features of a data set will be explained later. One problem with the mean as an indicator of the "centre" of the data is that its value can be markedly affected by the presence of a few extreme values. Suppose, to take an exaggerated case, there are 20 farmers living in a village of whom 19 earn US\$ 1000 per annum and the twentieth earns US\$ 1 000 000 per annum. The average (i.e. per caput) earnings of the 20 individuals is almost US\$ 51 000 per annum, which is very misleading. Data with a few very large or very small values as compared to the remainder of the set, are said to be skewed. An indicator of the "centre" of data which is not affected in this way and which is therefore more likely to give a value typical of the whole data set is the median (m). This is a number so chosen that at least half the data have a value not smaller than m, and, simultaneously, at least half the data have a value not greater than m. The median value of the data in Table I is 1.37 kg, while for Table 3 the median parturition is 2. Of course, to discover the "middle" value in a set of data one has to write all the values in the correct order, and this can be time consuming unless it is done automatically by using a (micro) computer. In most practical contexts it will make little difference which of the indicators is used, and the mean is the most frequently chosen.
8,568
36,530
{"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.09375
4
CC-MAIN-2018-26
latest
en
0.910468
https://www.physicsforums.com/threads/specific-heat-problem-in-celsius.364910/
1,521,495,388,000,000,000
text/html
crawl-data/CC-MAIN-2018-13/segments/1521257647146.41/warc/CC-MAIN-20180319194922-20180319214922-00272.warc.gz
846,801,801
14,109
# Specific Heat Problem in Celsius 1. Dec 21, 2009 ### Ki-nana18 1. The problem statement, all variables and given/known data The specific heat of substance X is 200 J/g*C, how much heat is required to change the temperature of 2.0 kilograms of substance X from 40 degrees Celsius to 55 degrees Celsius? 2. Relevant equations Q=(m)(c)(change T) 3. The attempt at a solution 55 C-40 C= 15 C 2.0kg(1000 g/1 kg)= 2000 g (2000 g)(200 J/g*C)(15 C)= 6000000 J I'm am not sure if this is right at all. :uhh: Is it right? 2. Dec 21, 2009 ### rock.freak667 Looks correct to me. 3. Dec 21, 2009 ### Staff: Mentor Watch significant numbers. -- methods
210
656
{"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.803881
https://physicscatalyst.com/article/newtons-third-law-of-motion/
1,670,003,085,000,000,000
text/html
crawl-data/CC-MAIN-2022-49/segments/1669446710909.66/warc/CC-MAIN-20221202150823-20221202180823-00838.warc.gz
456,296,901
37,978
Home » General » Newton’s Third Law of motion (action-reaction and examples) # Newton’s Third Law of motion (action-reaction and examples) ## Newton’s Third Law of motion Here in this article I presume that you have a introduction of Newtons first law of motion and Newton’s second law of motion.  Now Newtons first law and second law of motion deals with the effect of forces when they acts on a body. First law is about the change in the velocity of the body on the application of unbalanced forces and second law is gives the exact amount of the force needed to produce a given acceleration. Here in this article we shall discuss about the Newton’s Third Law of motion which is the relation between the forces themselves. You must have observed that when a body exerts a force on another body , other body also exerts force on the first body. So here both he bodies are interacting with each other . Now Newton’s third law of motion states that In any interaction between two bodies , force applied by the first body on the second is equal and opposite to the force applied by the second body on the first This means that forces always occur in pairs. Some of the examples of Newton’s third law of motion are 1. Consider a book being placed on a table as shown below in the figure Now you push the book towards th eleft hand side by using your hand to apply force. According to Newton’s Law , the book also exerts force on your hand and the magnitude of the force applied by book on your hand is equal to the magnitude of force applied on the book by your hand. So, $F_{1}=F_{2}$ where $F_{1}$ is the force applied by the hand on the book and $F_{2}$ is the force applied by the book on the hand. 2. When a man jumps from a boat to the shore, the boat moves away from him. The force he exerts on the boat (action) is responsible for its motion and his motion to the shore is due to the force of reaction exerted by the boat on him. 3. If you hit the wall with your fist, the wall also hits your fist with the same force , which you feel. ## Action and Reaction To understand this consider two objects A and B. Whenever object A apply a force on object B , there is also a force applied by object B on object A. These two forces have equal magnitude and have opposite direction. Such a pair of forces , exerted by two bodies on each other , is called an action-reaction pair. Any one of the forces in the pair can be called action force and the other force would be called as reaction force.  Now we can state the Newton’s third law of motion in terms of action and reaction Action and reaction are always equal and opposite. Important thing to note about action -reaction forces is that they are two forces acting on two different bodies. Here I would like to mention one more fact that is any pair of equal and opposite force is not an action reaction pair. For identifying action reaction pair you would have to identify the two interacting objects and deciding who is pushing on whom and in what direction. for further detail consider a book placed on the table as shown below in the figure. From this figure we can see that when a book is placed on the table two equal and opposite forces acts on it. First one is force $W$ that is acting along downward direction and is applied by the earth and second one is $N$ the normal force applied by the table in the upward direction. Now since the book is at rest on the table we can conclude that these two forces are equal in magnitude and opposite in direction. But these two forces are not action reaction pair as these forces are not applied by two bodies on each other. Here the force $N$ is applied by the  table on the book , the reaction to this force would be force applied by the book on the table. Similar is the case with the weight $W$ which is the force applied by the earth on the book and reaction to this force would be force applied by the book on the earth. so here you see that $N$ and $W$ are two equal and opposite forces but they do not form action reaction pair. One more important thing to note about action reaction pair is that the acceleration produced by these forces on interacting objects is not same an the reason behind it is that there might be difference between masses of two interacting objects. ### Other recommended articles For more notes on laws of motion you can consider visiting these links [standout-css3-button href=”https://physicscatalyst.com/Class9/laws_of_motion.php”]Force class 9 notes[/standout-css3-button] [standout-css3-button href=”https://physicscatalyst.com/mech/force.php”]Force class 11/IITJEE notes[/standout-css3-button] Subscribe Notify of This site uses Akismet to reduce spam. Learn how your comment data is processed. 1 Comment Inline Feedbacks
1,050
4,782
{"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}
4.375
4
CC-MAIN-2022-49
longest
en
0.957107
https://infogalactic.com/info/Imaginary_number
1,534,919,959,000,000,000
text/html
crawl-data/CC-MAIN-2018-34/segments/1534221219495.97/warc/CC-MAIN-20180822045838-20180822065838-00444.warc.gz
706,540,158
13,921
# Imaginary number "Imaginary Number" and "Imaginary numbers" redirect here. For the 2013 EP by The Maine, see Imaginary Numbers (EP). ... (repeats the pattern from blue area) i−3 = i i−2 = −1 i−1 = −i i0 = 1 i1 = i i2 = −1 i3 = −i i4 = 1 i5 = i i6 = −1 in = in(mod 4) An imaginary number[note 1] is a complex number that can be written as a real number multiplied by the imaginary unit i,[note 2] which is defined by its property i2 = −1.[1] The square of an imaginary number bi is b2. For example, 5i is an imaginary number, and its square is −25. Except for 0 (which is both real and imaginary[2]), imaginary numbers produce negative real numbers when squared. An imaginary number bi can be added to a real number a to form a complex number of the form a + bi, where the real numbers a and b are called, respectively, the real part and the imaginary part of the complex number.[3][note 3] Imaginary numbers can therefore be thought of as complex numbers whose real part is zero. The name "imaginary number" was coined in the 17th century as a derogatory term, as such numbers were regarded by some as fictitious or useless. The term "imaginary number" now means simply a complex number with a real part equal to 0, that is, a number of the form bi. Some authors use the term pure imaginary number to denote what is called here an imaginary number, and imaginary number to denote any complex number that is not real (i.e. has non-zero imaginary part).[4] ## History An illustration of the complex plane. The imaginary numbers are on the vertical coordinate axis. Although Greek mathematician and engineer Heron of Alexandria is noted as the first to have conceived these numbers,[5][6] Rafael Bombelli first set down the rules for multiplication of complex numbers in 1572. The concept had appeared in print earlier, for instance in work by Gerolamo Cardano. At the time, such numbers were poorly understood and regarded by some as fictitious or useless, much as zero and the negative numbers once were. Many other mathematicians were slow to adopt the use of imaginary numbers, including René Descartes, who wrote about them in his La Géométrie, where the term imaginary was used and meant to be derogatory.[7] The use of imaginary numbers was not widely accepted until the work of Leonhard Euler (1707–1783) and Carl Friedrich Gauss (1777–1855). The geometric significance of complex numbers as points in a plane was first described by Caspar Wessel (1745–1818).[8] In 1843 a mathematical physicist, William Rowan Hamilton, extended the idea of an axis of imaginary numbers in the plane to a three-dimensional space of quaternion imaginaries. With the development of quotient rings of polynomial rings, the concept behind an imaginary number became more substantial, but then one also finds other imaginary numbers such as the j of tessarines which has a square of +1. This idea first surfaced with the articles by James Cockle beginning in 1848.[9] ## Geometric interpretation 90-degree rotations in the complex plane Geometrically, imaginary numbers are found on the vertical axis of the complex number plane, allowing them to be presented perpendicular to the real axis. One way of viewing imaginary numbers is to consider a standard number line, positively increasing in magnitude to the right, and negatively increasing in magnitude to the left. At 0 on this x-axis, a y-axis can be drawn with "positive" direction going up; "positive" imaginary numbers then increase in magnitude upwards, and "negative" imaginary numbers increase in magnitude downwards. This vertical axis is often called the "imaginary axis" and is denoted i, $\scriptstyle\mathbb{I}$, or . In this representation, multiplication by –1 corresponds to a rotation of 180 degrees about the origin. Multiplication by i corresponds to a 90-degree rotation in the "positive" direction (i.e., counterclockwise), and the equation i2 = −1 is interpreted as saying that if we apply two 90-degree rotations about the origin, the net result is a single 180-degree rotation. Note that a 90-degree rotation in the "negative" direction (i.e. clockwise) also satisfies this interpretation. This reflects the fact that i also solves the equation x2 = −1. In general, multiplying by a complex number is the same as rotating around the origin by the complex number's argument, followed by a scaling by its magnitude. ## Multiplication of square roots Care must be used in multiplying square roots of negative numbers. For example,[10] the following reasoning is incorrect: $-1 = i^2 = \sqrt{-1}\sqrt{-1} = \sqrt{(-1)(-1)} = \sqrt{1} = 1$ The fallacy is that the rule xy = xy, where the principal value of the square root is taken in each instance, is generally valid only if x and y are suitably constrained.[note 4] It is not possible to extend the definition of principal values to the square roots of all complex numbers in a way that preserves the validity of the multiplication rule. Hence −1 in such contexts should be regarded either as meaningless, or as a two-valued expression with the possible values i and i. ## Notes 2. j is often used in Engineering 3. Both the real part and the imaginary part are defined as real numbers. 4. When the principal square root is defined to be in (−π/2, π/2] and Arg to be in (−π, π], a suitable constraint is that π < Arg(x) + Arg(y) ≤ π or xy = 0. ## References 1. Uno Ingard, K. (1988). "Chapter 2". Fundamentals of waves & oscillations. Cambridge University Press. p. 38. ISBN 0-521-33957-X. 2. Sinha, K.C. A Text Book of Mathematics XI. Rastogi Publications. p. 11.2. ISBN 8171339123. 3. Aufmann, Richard; Barker, Vernon C.; Nation, Richard (2009). College Algebra: Enhanced Edition (6th ed.). Cengage Learning. p. 66. ISBN 1-4390-4379-5. 4. C.L. Johnston, J. Lazaris, Plane Trigonometry: A New Approach, Prentice Hall, 1991, p. 247. 5. Hargittai, István (1992). Fivefold symmetry (2nd ed.). World Scientific. p. 153. ISBN 981-02-0600-3. 6. Roy, Stephen Campbell (2007). Complex numbers: lattice simulation and zeta function applications. Horwood. p. 1. ISBN 1-904275-25-7. 7. Martinez, Albert A. (2006), Negative Math: How Mathematical Rules Can Be Positively Bent, Princeton: Princeton University Press, ISBN 0-691-12309-8, discusses ambiguities of meaning in imaginary expressions in historical context. 8. Rozenfeld, Boris Abramovich (1988). "Chapter 10". A history of non-euclidean geometry: evolution of the concept of a geometric space. Springer. p. 382. ISBN 0-387-96458-4. 9. James Cockle (1848) "On Certain Functions Resembling Quaternions and on a New Imaginary in Algebra", London-Dublin-Edinburgh Philosophical Magazine, series 3, 33:435–9 and Cockle (1849) "On a New Imaginary in Algebra", Philosophical Magazine 34:37–47 10. Maxwell, E. A. (1959). Fallacies in mathematics. Cambridge University Press. MR 0099907.. Chapter VI, §I.2 ## Bibliography • Nahin, Paul (1998). An Imaginary Tale: the Story of the Square Root of −1. Princeton: Princeton University Press. ISBN 0-691-02795-1., explains many applications of imaginary expressions.
1,770
7,086
{"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": 2, "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.03125
4
CC-MAIN-2018-34
longest
en
0.952264
http://www.openforis.org/support/questions/1799/test-if-attribute-value-is-within-an-array-of-values
1,537,574,750,000,000,000
text/html
crawl-data/CC-MAIN-2018-39/segments/1537267157574.27/warc/CC-MAIN-20180921225800-20180922010200-00036.warc.gz
376,290,668
9,242
# Test if attribute value is within an array of values 0 Dear OF Team, Is there a way to do the following test more nicely/shorter: tree[species=1 or species=8 or species=10 or species=11 or species=12 or species=16 or species=19 or species=22 or species=23] What I'm looking for is something like this (e.g. in R): tree[species %in% c(1,8,10,11,12,16,19,22,23)] Could this be implemented if doesn't exist yet? Thanks! Andras asked 17 May, 11:42 Andras 138●8●8●16 accept rate: 0% 1 Hi András, In the latest version of Collect (3.22.x) there is a new function `idm:array` that you could use in combination with `idm:contains` function to simplify your expression, that will become: ``````idm:contains(idm:array(1,8,10,11,12,16,19,22,23), species) `````` Many thanks, Open Foris Team answered 07 Jun, 10:41 OF Collect ♦♦ 1.9k●5 accept rate: 19% Hi, It seems there is a problem with the expression above. If I try to use it to get a subset of a group of items, it doesn't work: count(parent()/tree[idm:contains(idm:array(1,8,10,11,12,16,19,22,23),species)]) Am I doing something wrong? (26 Jun, 10:26) Andras The species code is an alphanumeric value, so it must be wrapped into single or double quotes. Try to use this expression instead: count(parent()/tree[idm:contains(idm:array('1','8','10','11','12','16','19','22','23'),species)]) However, I would split the expression into 2 separate calculated attributes, one attribute that says if a species in of a specific type and the other one that counts the trees of that species, and I would even move the count outside of the 'tree' entity, since it does not depend on the current tree item. (26 Jun, 14:28) OF Collect ♦♦ toggle preview By Email: Markdown Basics • *italic* or _italic_ • **bold** or __bold__ • image?![alt text](/path/img.jpg "title") • numbered list: 1. Foo 2. Bar • to add a line break simply add two spaces to where you would like the new line to be. • basic HTML tags are also supported Question tags: ×270
584
1,986
{"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-2018-39
longest
en
0.80554
https://community.powerbi.com/t5/Desktop/How-to-create-a-On-Time-measure/m-p/768825
1,576,112,341,000,000,000
text/html
crawl-data/CC-MAIN-2019-51/segments/1575540534443.68/warc/CC-MAIN-20191212000437-20191212024437-00456.warc.gz
320,308,505
126,692
cancel Showing results for Did you mean: Member ## How to create a % On Time measure Hi! I am trying to create a % On Time Delivery measure, but its not working. I have a column (ATS) that shows if an order is Early (negative number), On Time (0), or Late (positive number) by doing a DATEDIFF between planned and actual delivery date. I have another column (ATS On Time) that is `=IF(Sheet[ATS] <= 0, 1, 0)` So it has a 1 if the status is Early or On Time, and a 0 if it is Late I have another column (ATS Count) that is `=IF(NOT ISBLANK(Sheet[ATS]), 1, 0)` So it has a 1 if the row has an order status, and a 0 if it is blank So I tried creating a measure (% On Time) that is `=DIVIDE(SUM(Sheet[ATS On Time]) , SUM(Sheet[ATS Count]))` but it is showing 100% when it definitely should be 50%. What am I doing wrong?! 1 ACCEPTED SOLUTION Accepted Solutions Established Member ## Re: How to create a % On Time measure Hi @sy898661 , I tried with your measure and it works perfectly. I get this output: Dont know if this is what your output should look like. however your formula looks correct. Thanks, Tejaswi 4 REPLIES 4 Established Member ## Re: How to create a % On Time measure Hi @sy898661 , I tried with your measure and it works perfectly. I get this output: Dont know if this is what your output should look like. however your formula looks correct. Thanks, Tejaswi Super User ## Re: How to create a % On Time measure The measure looks correct.  It could be done in one step, without creating the extra tables, but it should work just fine. Do you have an active slicer or filter that could be restricting the dataset? Highlighted Super User ## Re: How to create a % On Time measure There's also the possiblity that you are displaying the result as a whole number.  .5 rounds up to 1, which would give you this behavior.  If you add another late delivery to your data, does the measure drop to zero? Member ## Re: How to create a % On Time measure I'm not sure what I changed but it started working!!! Haha 🙂 Announcements Kudos to you if you earned one of these! Check your inbox for a notification. #### Microsoft Implementation for Communities Wins Award Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities. #### Power Platform World Tour Find out where you can attend! Top Solution Authors Top Kudoed Authors (Last 30 Days) Users online (1,827)
625
2,464
{"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-2019-51
latest
en
0.930668
https://metanumbers.com/255369699999999
1,627,491,874,000,000,000
text/html
crawl-data/CC-MAIN-2021-31/segments/1627046153739.28/warc/CC-MAIN-20210728154442-20210728184442-00171.warc.gz
401,072,914
11,355
## 255369699999999 255,369,699,999,999 (two hundred fifty-five trillion three hundred sixty-nine billion six hundred ninety-nine million nine hundred ninety-nine thousand nine hundred ninety-nine) is an odd fifteen-digits composite number following 255369699999998 and preceding 255369700000000. In scientific notation, it is written as 2.55369699999999 × 1014. The sum of its digits is 108. It has a total of 6 prime factors and 20 positive divisors. There are 157,150,584,614,736 positive integers (up to 255369699999999) that are relatively prime to 255369699999999. ## Basic properties • Is Prime? No • Number parity Odd • Number length 15 • Sum of Digits 108 • Digital Root 9 ## Name Short name 255 trillion 369 billion 699 million 999 thousand 999 two hundred fifty-five trillion three hundred sixty-nine billion six hundred ninety-nine million nine hundred ninety-nine thousand nine hundred ninety-nine ## Notation Scientific notation 2.55369699999999 × 1014 255.369699999999 × 1012 ## Prime Factorization of 255369699999999 Prime Factorization 34 × 13 × 242516334283 Composite number Distinct Factors Total Factors Radical ω(n) 3 Total number of distinct prime factors Ω(n) 6 Total number of prime factors rad(n) 9458137037037 Product of the distinct prime numbers λ(n) 1 Returns the parity of Ω(n), such that λ(n) = (-1)Ω(n) μ(n) 0 Returns: 1, if n has an even number of prime factors (and is square free) −1, if n has an odd number of prime factors (and is square free) 0, if n has a squared prime factor Λ(n) 0 Returns log(p) if n is a power pk of any prime p (for any k >= 1), else returns 0 The prime factorization of 255,369,699,999,999 is 34 × 13 × 242516334283. Since it has a total of 6 prime factors, 255,369,699,999,999 is a composite number. ## Divisors of 255369699999999 20 divisors Even divisors 0 20 10 10 Total Divisors Sum of Divisors Aliquot Sum τ(n) 20 Total number of the positive divisors of n σ(n) 4.10823e+14 Sum of all the positive divisors of n s(n) 1.55453e+14 Sum of the proper positive divisors of n A(n) 2.05411e+13 Returns the sum of divisors (σ(n)) divided by the total number of divisors (τ(n)) G(n) 1.59803e+07 Returns the nth root of the product of n divisors H(n) 12.4321 Returns the total number of divisors (τ(n)) divided by the sum of the reciprocal of each divisors The number 255,369,699,999,999 can be divided by 20 positive divisors (out of which 0 are even, and 20 are odd). The sum of these divisors (counting 255,369,699,999,999) is 410,822,670,277,096, the average is 2,054,113,351,385,4.8. ## Other Arithmetic Functions (n = 255369699999999) 1 φ(n) n Euler Totient Carmichael Lambda Prime Pi φ(n) 157150584614736 Total number of positive integers not greater than n that are coprime to n λ(n) 4365294017076 Smallest positive number such that aλ(n) ≡ 1 (mod n) for all a coprime to n π(n) ≈ 7943606404715 Total number of primes less than or equal to n r2(n) 0 The number of ways n can be represented as the sum of 2 squares There are 157,150,584,614,736 positive integers (less than 255,369,699,999,999) that are coprime with 255,369,699,999,999. And there are approximately 7,943,606,404,715 prime numbers less than or equal to 255,369,699,999,999. ## Divisibility of 255369699999999 m n mod m 2 3 4 5 6 7 8 9 1 0 3 4 3 4 7 0 The number 255,369,699,999,999 is divisible by 3 and 9. • Deficient • Polite ## Base conversion (255369699999999) Base System Value 2 Binary 111010000100000111100100010000010100000011111111 3 Ternary 1020111012002211110200100010000 4 Quaternary 322010013210100110003333 5 Quinary 231432434121144444444 6 Senary 2303043115353245343 8 Octal 7204074420240377 10 Decimal 255369699999999 12 Duodecimal 24784437a03853 20 Vigesimal 14if7bb4jjjj 36 Base36 2iir7xxgxr ## Basic calculations (n = 255369699999999) ### Multiplication n×i n×2 510739399999998 766109099999997 1021478799999996 1276848499999995 ### Division ni n⁄2 1.27685e+14 8.51232e+13 6.38424e+13 5.10739e+13 ### Exponentiation ni n2 65213683678089489260600000001 16653598836768544231948965730766109099999999 4252824538865915456350701025431790102068538978521200000001 1086042526642822917489102749738752258127186746593163219101276848499999999 ### Nth Root i√n 2√n 1.59803e+07 63443.9 3997.54 761.086 ## 255369699999999 as geometric shapes ### Circle Diameter 5.10739e+14 1.60454e+15 2.04875e+29 ### Sphere Volume 6.97584e+43 8.19499e+29 1.60454e+15 ### Square Length = n Perimeter 1.02148e+15 6.52137e+28 3.61147e+14 ### Cube Length = n Surface area 3.91282e+29 1.66536e+43 4.42313e+14 ### Equilateral Triangle Length = n Perimeter 7.66109e+14 2.82384e+28 2.21157e+14 ### Triangular Pyramid Length = n Surface area 1.12953e+29 1.96265e+42 2.08508e+14 ## Cryptographic Hash Functions md5 ba3f2a173d72db6138a9d9d3ed7dfbbd d1ca848c5abc91f44c38787ef28cdab02e1b04d5 515cc289ec65df7ea0bc6a7c582beb665e884da20b831be18a9eeb80ed9817aa c40919c09e1cb7855e9545cb66f14cf4686b8229af4b7886bdd39d9bce0294e0ba97b6ad70bff6ee2015526c83a112bc1f88454eba059c39860011db14f9a89b 7735edc34b863a073a5cb56cb61a946114fd42cd
1,793
5,092
{"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.28125
3
CC-MAIN-2021-31
latest
en
0.751499
http://www.thedailymeal.com/eat/how-many-shots-are-handle-liquor
1,492,985,654,000,000,000
text/html
crawl-data/CC-MAIN-2017-17/segments/1492917118831.16/warc/CC-MAIN-20170423031158-00628-ip-10-145-167-34.ec2.internal.warc.gz
725,543,252
32,425
# How Many Shots Are in a Handle of Liquor? Editor If you’re having a party, this is a crucial piece of information Shutterstock A handle contains 1.75 liters. When we come into possession of a handle of liquor, our first thought is usually, “Damn, that’s a lot of liquor!” and our second thought is usually “I wonder how many shots are in there?” So… how many shots are in a handle of liquor? First things first: A “handle” of liquor isn’t exactly a unit of measurement, but all handles contain the same amount: 1.75 liters, or 59.2 fluid ounces. It’s a little less than half a gallon. Here’s where things get a little dicey, because a “shot” also isn’t a unit of measurement. Some shot glasses contain 1.5 ounces, some contain two ounces, and some contain 50 milliliters. But for today’s purposes, let’s define a shot as 1.5 ounces; this is the size most customers are given when they order a shot of liquor at a bar. If you do the math, one handle of liquor will yield you almost exactly 40 1.5-ounce shots. Just for the record, it’ll also yield you about 30 two-ounce shots, and about 35 50-milliliter shots. Tags
287
1,125
{"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.34375
3
CC-MAIN-2017-17
latest
en
0.919343
https://www.electricalexams.co/frequency-compensating-network-mcq/
1,669,817,530,000,000,000
text/html
crawl-data/CC-MAIN-2022-49/segments/1669446710764.12/warc/CC-MAIN-20221130124353-20221130154353-00177.warc.gz
789,338,834
32,876
# Frequency Compensating Network MCQ [Free PDF] – Objective Question Answer for Frequency Compensating Network Quiz 1. Variation in the operating frequency of op-amp causes A. Variation in gain amplifier B. Variation in gain phase angle C. Variation in gain amplitude and its phase angle D. None of the mentioned The gain of the op-amp is a function of frequency. It will have a specific magnitude as well as a phase angle. 2. A graph of the magnitude of the gain versus frequency is called A. Break frequency B. Frequency response plot C. Frequency stability plot D. Transient response plot A frequency response plot is obtained by plotting the gain of the op-amp responding to different frequencies. 3. In the frequency response plot, the frequency is expressed in A. Anti-logarithmic scale B. Logarithmic scale C. Linear scale D. Exponential scale To accommodate large frequency ranges the frequency is assigned to a logarithmic scale. 4. Why the gain magnitude in the frequency response plot is expressed in decibels (dB. A. To obtain gain > 105 B. To obtain gain < 105 C. To obtain gain = 0 D. To obtain gain = ∞ In the frequency response plot, gain magnitude is assigned a linear scale and is expressed in decibels to accommodate very high gain ( ≅ of the order 105 or higher). 5. Which technique is used to determine the stability of op-amp? A. Frequency response plot B. Transient response plot C. Bode plot D. All of the mentioned Although frequency response and bode plots indicate the effect of frequency variation on gain, the Bode plot is generally used for stability determination and network design. 6. How many types of plots can be obtained in the AC analysis of the network using the Bode plot? A. Five B. Four C. Three Two types of plots can be obtained using the Bode plot. They are magnitude versus frequency and phase angle versus frequency plots. 7. What happens when the operating frequency of op-amp increases? A. Gain of the amplifier decrease B. Phase shift between output and input signal decrease C. Gain and phase shift of amplifier decreases D. None of the mentioned When the operating frequency has increased the gain of the amplifier decrease. As it is linearly related to frequency, the phase shift is logarithmically related to frequency. 8. Which of the following causes change in gain and phase shift? A. Internally integrated Resistor B. Internally integrated inductors C. Internally integrated Capacitor D. All of the mentioned The change in function of frequency is attributed to the internally integrated capacitor as well as a stray capacitor. These capacitors are due to the physical characteristic of the semiconductor device. 9. Which plot is not provided by the manufacturers? A. Magnitude plot B. Phase angle plot C. Frequency response plot D. None of the mentioned Phase angle plots are not generally provided because phase shifts of later generation op-amp are less than 90o even at cross-over frequency. 1. Open-loop bandwidth of an op-amp extends its bandwidth from A. 0 Hz to fo B. 20dB to fo C. 3dB to fo D. 0.704dB to fo The gain of the op-amp remains essentially constant from 0 to the break frequency fo and therefore rolls off at a constant rate of 20dB per decade. Thus, the open-loop bandwidth is the frequency band extending from 0Hz to fo. 2. What happens if 741 op-amps are configured as a closed-loop inverting amplifier? A. Gain increases B. Gain roll-off at a rate of 20dB/decade C. No gain roll-off takes place D. Gain decreases Whether the op-amp is inverting / non-inverting the gain will always roll off at a rate of 20dB/decade, using only resistive components regardless of the value of its closed-loop gain. 3. Op-amp requiring external compensating components is called as A. Tailored frequency response op-amp B. Compensating op-amp C. Transient op-amp D. High-frequency op-amp Op-amps using external components like resistor and capacitor to form the compensating network are sometimes called tailored frequency response op-amps because the user has to provide the compensation if it is needed to tailor the response. 4. In the first generation op-amp 709c, the open-loop bandwidth of gain versus frequency curve A. Increases from the innermost compensated curve to the outermost B. Decrease from the innermost compensated curve to the outermost C. Increases from the outermost compensated curve to the innermost D. Decreases from the outermost compensated curve to the innermost The gain versus frequency curve of 709c decreases from the outermost compensated curve to the innermost. For example, if C1 =10pF, R1 = 0Ω and C2 = 3pF, the bandwidth ≅ 5kHz. While if C1 =5000pF, R1 =1.5Ω and C2= 200pF, the bandwidth will be 100Hz. 5. Which type of op-amp offers relatively broader open-loop bandwidth? A. Compensated op-amp B. Uncompensated op-amp C. Tailored frequency response op-amp D. Non-compensated op-amp The uncompensated op-amps offer broader open-loop bandwidth whereas; the internally compensated op-amps have very small open-loop bandwidth. 6. How the performance of an op-amp circuit can be improved? A. By using a non-compensating network B. By using frequency network C. By using compensating network D. None of the mentioned The compensating networks are used to improve /modify the performance of an op-amp circuit over the desired frequency range by controlling its gain and phase shift. 7. Which op-amp requires an external compensating network? A. Op-amp 771 B. Op-amp 351 C. Op-amp 709 D. Op-amp 741 Op-amp 709 is the first-generation op-amp. Generally, a first-generation op-amp is required for an external compensating network. 8. IC 741c op-amp belongs to A. Compensated op-amp B. Uncompensated op-amp C. Non-compensated op-amp D. None of the mentioned 741c belongs to later generation op-amp and it has an internal compensating network. In an internally compensated op-amp, the compensating network is designed into the circuit to control the gain and phase shift of the op-amp and they are called compensating op-amp. 1. Determine the output voltage for an op-amp with single break frequency. A. VO ={ jXC /[Ro+(iXC)]} × AVid B. VO = = AVid / [1+ j2πfRoC]. C. VO = AVid /(Ro+j2πfC. D. VO = Vid / [Ro-(j2πfRoC.]. The output voltage for an op-amp with single break frequency, VO = {(-jXC) / [(Ro)-(jXC)} ×AVid ∵ -j=1/j & XC =1/2πfC => VO = {(1/j2ΠfC./[Ro + (1/ j2πfC.] } × AVid = AVid / [1+ j2πfRoC]. 2. Compute the break frequency of an op-amp, if the output resistance=10kΩ and the capacitor connected to the output =0.1µF. A. 159.2Hz B. 6.28Hz C. 318.4Hz D. 1000Hz Break frequency of the op-amp is given as fo = 1/(2πRoC.= 1/ (2π×10kΩ×0.1µF) = 1/ (6.28×10-3) = 159.2Hz. 3. The open-loop voltage gain as a function of frequency is defined as A. AOL(f) = VO/Vin B. AOL(f) = VO/Vid C. AOL(f) = VO/Vf D. All of the mentioned The open-loop voltage gain as a function of frequency is defined as the ratio of output voltage to the difference of input voltages. 4. Which of the following factor remain fixed for an op-amp? A. Open loop voltage gain B. Gain of the op-amp C. Operating frequency D. Break frequency of the op-amp Break frequency fo depends on the value of capacitors and on output resistance. Therefore, fo is fixed for an op-amp. 5. Find the gain magnitude and phase angle of the op-amp using the specifications: f= 50Hz; fo=5Hz ; A=140000. A. AOL(f)= 22.92dB , Φ(f) = – 89.99o B. AOL(f)= 66dB , Φ(f) = – 90o C. AOL(f)= 26dB, Φ(f) = – 89.99o D. AOL(f)= 20dB , Φ(f) = – 84.29o The open loop gain magnitude |AOL(f)|= 20log[A/√[1+ f/fo)2] = 20logA-20 log[A/√ [1+(f/fo)2] = 20log(140000)- 20log[√(1+(50,000/5)2)] AOL(f) dB= 102.922-80 = 22.92dB. Phase angle, φ(f) = -tan-1(f/fo) = -tan-1(50000/5) = -89.99o. 6. Consider an op-amp where the inverting input voltage =3.7mv, non-inverting input voltage=6.25mv and open-loop voltage gain =142dB. Find the output voltage. A. 0.21v B. 0.45v C. 0.78v D. 0.36v Open loop voltage gain, AoL(f) = Vo/Vid VO = AOL(f) × (Vin1-Vin2) = 142 dB×(6.25-3.7) = 142×2.55 = 0.36v. 7. Express the open-loop gain of the op-amp in complex form? A. A/√ [1+(f/fo)2 B. 20log{A/√[1+(f/fo)2} C. A/[1+j(f/fo)]. D. None of the mentioned The open-loop gain of the op-amp AOL(f) is a complex quantity and is expressed as AOL(f) = A/[1+ j(f/fo)] . The remaining equations are expressed in polar form. 8. Determine the difference between two AOL(f) at 50Hz and 500Hz frequencies? (Consider the op-amp to be 741C. A. 40dB B. 30dB C. 20dB D. 10dB AOL(f) dB= 20log[√ [1+ (f/fo)2] At f= 50 Hz, AOL(f) dB = 20log(200000)- 20log(√(1+(50/5)2) = 106.02-20.04 ≅ 86dB At f= 500Hz AOL(f) dB =20log(200000)-20log(√(1+(500/5)2) = 106.02-40 ≅ 66dB Therefore, the difference between AOL(f)dB = 86-66 = 20dB. 9. At what frequency, the phase shift between input &output voltage will be zero? A. -40Hz B. 0Hz C. -22Hz D. 20Hz At 0Hz the phase shift between input and output voltage is zero. At f=0Hz φ(f) = – tan-1 (f/fo) = -tan-1(0/5) = 0o 10. At what frequency AOL(f)=A? A. 50Hz B. 10Hz C. 5Hz D. 0Hz
2,722
9,107
{"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-2022-49
latest
en
0.906727
https://www.slidestalk.com/s/classification__performance__measures_pptx_btrt0b
1,544,997,413,000,000,000
text/html
crawl-data/CC-MAIN-2018-51/segments/1544376827998.66/warc/CC-MAIN-20181216213120-20181216235120-00126.warc.gz
1,054,508,391
13,977
Naïve rule: classify all examples as belonging to the most prevalent class. Often used ... For example, with Naïve Bayes the default cutoff value is 0.5. If p(y=1|x) ... Horin发布于2018/06/15 00:00 1.Evaluating Classification Performance Data Mining 1 2.Why Evaluate? Multiple methods are available for classification For each method, multiple choices are available for settings (e.g. value of K for KNN, size of Tree of Decision Tree Learning) To choose best model, need to assess each model’s performance 2 3.Basic performance measure: Misclassification error Error = classifying an example as belonging to one class when it belongs to another class. Error rate = percent of misclassified examples out of the total examples in the validation data (or test data) 3 4.Naive classification Rule Naïve rule : classify all examples as belonging to the most prevalent class Often used as benchmark: we hope to do better than that Exception: when goal is to identify high-value but rare outcomes, we may do well by doing worse than the naïve rule (see “lift” – later) 4 5.Confusion Matrix 201 1’s correctly classified as “1” - True Positives 25 0’s incorrectly classified as “1 ” - False Positives 85 1’s incorrectly classified as “0” - False Negatives 2689 0’s correctly classified as “0”- True Negatives We use TP to denote True Positives . Similarly , FP, FN and TN 6.Error Rate and Accuracy Error rate = (FP + FN)/(TP + FP + FN + TN) Overall error rate = (25+85)/3000 = 3.67% Accuracy = 1 – err = (201+2689) = 96.33% If multiple classes, error rate is: (sum of misclassified records)/(total records) 6 TP = FN = FP = TN = 7.Cutoff for classification Many classification algorithms classify via a 2-step process: For each record, Compute a score or a probability of belonging to class “1” Compare to cutoff value, and classify accordingly For example, with Naïve Bayes the default cutoff value is 0.5 If p(y=1| x ) &gt;= 0.5, classify as “1” If p(y=1| x ) &lt; 0.50, classify as “0” Can use different cutoff values Typically, error rate is lowest for cutoff = 0.50 7 8.Cutoff Table - example If cutoff is 0.50: 13 examples are classified as “1” If cutoff is 0.75: 8 example s are classified as “1” If cutoff is 0.25 : 15 examples are classified as “1” 9.Confusion Matrix for Different Cutoffs Predicted class 0 Predicted class 1 1 11 Actual class 1 8 4 Actual class 0 Cutoff probability = 0.25 Accuracy = 19/24 Cutoff probability = 0.5 (Not shown) Accuracy = 21/24 Cutoff probability = 0.75 Accuracy = 18/24 Predicted class 0 Predicted class 1 5 7 Actual class 1 11 1 Actual class 0 10.Lift 10 11.When One Class is More Important In many cases it is more important to identify members of one class Tax fraud Response to promotional offer Detecting malignant tumors In such cases, we are willing to tolerate greater overall error, in return for better identifying the important class for further attention 12.Alternate Accuracy Measures We assume that the important class is 1 Sensitivity = % of class 1 examples correctly classified Sensitivity = TP / (TP+ FN ) Specificity = % of class 0 examples correctly classified Specificity = TN / (TN+ FP ) True positive rate = % of class 1 examples correctly as class 1 = Sensitivity = TP / (TP+ FN ) False positive rate = % of class 0 examples that were classified as class 1 = 1- specificity = FP / (TN+ FP ) 12 Predicted class 0 Predicted class 1 FN TP Actual class =1 TN FP Actual class =0 13.ROC curve Plot the True Positive Rate versus False Positive Rate for various values of the threshold The diagonal is the baseline – a random classifier Sometimes researchers use the Area under the ROC curve as a performance measure – AUC AUC by definition is between 0 and 1 14.Lift Charts: Goal Useful for assessing performance in terms of identifying the most important class Helps evaluate, e.g., How many tax records to examine How many loans to grant How many customers to mail offer to 14 15.Lift Charts – Cont. Compare performance of DM model to “no model, pick randomly” Measures ability of DM model to identify the important class, relative to its average prevalence Charts give explicit assessment of results over a large number of cutoffs 15 16.Lift Chart – cumulative performance For example: after examining 10 cases (x-axis), 9 positive cases (y-axis) have been correctly identified 16 Positives #Positives #Positives 17.Lift Charts: How to Compute Using the model’s classification scores, sort examples from most likely to least likely members of the important class Compute lift: Accumulate the correctly classified “important class” records (Y axis) and compare to number of total records (X axis) 17 18.Asymmetric Costs 18 19.Misclassification Costs May Differ The cost of making a misclassification error may be higher for one class than the other(s) Looked at another way, the benefit of making a correct classification may be higher for one class than the other(s) 19 20.Example – Response to Promotional Offer Suppose we send an offer to 1000 people, with 1% average response rate (“ 1” = response, “0” = nonresponse) “Naïve rule” (classify everyone as “0”) has error rate of 1 %, accuracy 99% (seems good) Using DM we can correctly classify eight 1’s as 1’s It comes at the cost of misclassifying twenty 0’s as 1’s and two 1’s as 0 ’s . 20 21.The Confusion Matrix Error rate = (2+20) = 2.2% (higher than naïve rate) 21 22.Introducing Costs &amp; Benefits Suppose: Profit from a “1” is \$10 Cost of sending offer is \$1 Then: Under naïve rule, all are classified as “0”, so no offers are sent: no cost, no profit Under DM predictions, 28 offers are sent. 8 respond with profit of \$10 each 20 fail to respond, cost \$1 each 972 receive nothing (no cost, no profit) Net profit = \$60 22 23.Profit Matrix 23 24.Lift (again) Adding costs to the mix, as above, does not change the actual classifications. But it allows us to get a better decision (threshold) Use the lift curve and change the cutoff value for “1” to maximize profit 24 25.Adding Cost/Benefit to Lift Curve Sort test examples in descending probability of success For each case, record cost/benefit of actual outcome Also record cumulative cost/benefit Plot all records X-axis is index number (1 for 1 st case, n for n th case) Y-axis is cumulative cost/benefit Reference line from origin to y n ( y n = total net benefit) 25 26.Lift Curve May Go Negative If total net benefit from all cases is negative, reference line will have negative slope Nonetheless, goal is still to use cutoff to select the point where net benefit is at a maximum 26 27.Negative slope to reference curve 27 Zoom in Maximum profit = 60\$ 28.Multiple Classes Theoretically, there are m ( m -1) misclassification costs, since any case could be misclassified in m -1 ways Practically too many to work with In decision-making context, though, such complexity rarely arises – one class is usually of primary interest For m classes, confusion matrix has m rows and m columns 28 29.Classification Using Triage Instead of classifying as C 1 or C 0 , we classify as C 1 C 0 Can’t say The third category might receive special human review Take into account a gray area in making classification decisions 29 • Horin • do your good at,challenge what do you want to do ### 相关Slides • 视觉任务之间是否有关系,或者它们是否无关?例如,表面法线可以简化估算图像的深度吗?直觉回答了这些问题,暗示了视觉任务中存在结构。了解这种结构具有显著的价值;它是传递学习的基本概念,并提供了一种原则性的方法来识别任务之间的冗余,例如,无缝地重用相关任务之间的监督或在一个系统中解决许多任务而不会增加复杂性。 我们提出了一种完全计算的方法来建模视觉任务的空间结构。这是通过在隐空间中的二十六个2D,2.5D,3D和语义任务的字典中查找(一阶和更高阶)传递学习依赖性来完成的。该产品是用于任务迁移学习的计算分类地图。我们研究了这种结构的后果,例如:非平凡的关系,并利用它们来减少对标签数据的需求。例如,我们表明,解决一组10个任务所需的标记数据点总数可以减少大约2/3(与独立训练相比),同时保持性能几乎相同。我们提供了一套用于计算和探测这种分类结构的工具,包括用户可以用来为其用例设计有效监督策略。 • 尽管最近在生成图像建模方面取得了进展,但是从像ImageNet这样的复杂数据集中成功生成高分辨率,多样化的样本仍然是一个难以实现的目标。为此,我们以最大规模训练了生成性对抗网络,并研究了这种规模所特有的不稳定性。我们发现将正交正则化应用于生成器使得它适合于简单的“截断技巧”,允许通过截断潜在空间来精确控制样本保真度和多样性之间的权衡。我们的修改导致模型在类条件图像合成中达到了新的技术水平。当我们在ImageNet上以128×128分辨率进行训练时,我们的模型(BigGAN)的初始得分(IS)为166.3,Frechet初始距离(FID)为9.6,比之前的最优IS为52.52,FID为18.65有了显著的提升。 • 2017年,以斯坦福大学为首、包括吴恩达、李开复等一众大咖专家团队齐力打造的人工智能指数(AI Index)重磅年度报告首次发布。从学术、业界发展、政府策略等方面对全年的人工智能全球发展进行了回顾,堪称全年人工智能最强报告。 该重点介绍了人工智能领域的投资和工作岗位前所未有的增长速度,尤其是在游戏和计算机视觉领域进展飞速。 • 18年12月12日,哈佛大学,麻省理工学院,斯坦福大学以及OpenAI等联合发布了第二届人工智能指数(AI Index)年度报告。 人工智能领域这一行业的发展速度,不仅仅是通过实际产品的产生以及研究成果来衡量,还要考虑经济学家和政策制定者的预测和担忧。这个报告的目标是使用硬数据衡量人工智能领域的发展。 报告中多次提及了中国人工智能的发展以及清华大学: 美国仅占到全球论文发布内容的17%,欧洲是论文最高产的国家,18年发表的论文在全球范围内占比28%,中国紧随其后,占比25%。; 大学人工智能和机器学习相关课程注册率在全球范围都有大幅提升,其中最瞩目的是清华大学,相关课程2017年的注册率比2010年高出16倍,比2016年高出了将近3倍; 各国对人工智能应用方向重视不同。中国非常重视农业科学,工程和技术方面的应用,相比于2000年,2017年,中国加大了对农业方面的重视。 吴恩达也在今天的推特中重磅推荐了这份报告,称“数据太多了”,并划重点了两个报告亮点:人工智能在业界和学界都发展迅速;人工智能的发展仍需要更加多样包容。
2,790
8,642
{"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.84375
3
CC-MAIN-2018-51
longest
en
0.814361
https://algebra1help.com/www-algebra1-com/roots/math-answers-for-free.html
1,638,241,782,000,000,000
text/html
crawl-data/CC-MAIN-2021-49/segments/1637964358903.73/warc/CC-MAIN-20211130015517-20211130045517-00004.warc.gz
173,580,112
12,981
Free Algebra Tutorials! 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: Related topics: method least common multiple | difference equation matlab | divisible by 5 and 6 "java" | online factorization | aptitude questions with explanation of solutions | algebra homework | investigatory project in math | factoring solver | fifth grade decimal worksheets | graph an algebra equation | simplify polynomial expressions with exponents Author Message banhilspr Registered: 01.01.2005 From: Posted: Thursday 28th of Dec 08:59 I have this test coming and I would really be grateful if anyone can guide math answers for free on which I’m stuck and don’t know how to start from. Can you give me guidance with exponent rules, factoring and subtracting exponents. I would rather get help from you than hire a algebra tutor who are very pricey. Any guidance will be highly appreciated very much. Jahm Xjardx Registered: 07.08.2005 From: Odense, Denmark, EU Posted: Friday 29th of Dec 20:01 Hey. I think I can help you out. Can you elucidate some more on what your problems are? What specifically are your problems with math answers for free? Getting a good quality teacher would have been the finest thing. But do not be troubled . I think there is a way out . I have come across a number of algebra programs. I have tried them out myself. They are pretty smart and good . These might just be what you need. They also do not cost a lot. I believe that what you require is Algebrator. Why not try this out? It could be just be the answer for your problems . MoonBuggy Registered: 23.11.2001 From: Leeds, UK Posted: Saturday 30th of Dec 11:30 Algebrator is one handy tool. I don’t have much interest in math and have found it to be complicated all my life. Yet one cannot always leave math because it sometimes becomes a compulsory part of one’s course work. My younger brother is a math wiz and I found this program in his laptop. It was only then I understood why he finds this subject to be so easy. TihBoasten Registered: 14.10.2002 From: Posted: Sunday 31st of Dec 09:53 I remember having problems with exponential equations, trigonometry and scientific notation. Algebrator is a really great piece of math software. I have used it through several algebra classes - Intermediate algebra, Basic Math and Intermediate algebra. I would simply type in the problem and by clicking on Solve, step by step solution would appear. The program is highly recommended. mesareve Registered: 24.08.2005 From: 42° 3' N 83° 22' W Posted: Sunday 31st of Dec 11:29 Hey! That sounds alright. So where did you find the program ? Dolknankey Registered: 24.10.2003 From: Where the trout streams flow and the air is nice Posted: Tuesday 02nd of Jan 09:22 This is the site you are looking for : https://algebra1help.com/flash/noflash/42.html. They guarantee an unrestricted money back policy. So you have nothing to lose. Go ahead and Good Luck!
883
3,426
{"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-2021-49
latest
en
0.930525
http://research.stlouisfed.org/fred2/graph/?chart_type=line&width=1000&height=600&preserve_ratio=true&s[1][id]=RGDPEQBEA626NUPN
1,409,609,867,000,000,000
text/html
crawl-data/CC-MAIN-2014-35/segments/1409535920694.0/warc/CC-MAIN-20140909053736-00414-ip-10-180-136-8.ec2.internal.warc.gz
461,872,893
17,183
# Graph: Purchasing Power Parity Converted GDP Chain per equivalent adult for Belgium Click and drag in the plot area or select dates: Select date:   1yr | 5yr | 10yr | Max   to Release: Restore defaults | Save settings | Apply saved settings w   h Graph Background: Plot Background: Text: Color: (a) Purchasing Power Parity Converted GDP Chain per equivalent adult for Belgium, 2005 International Dollars per Equivalent Adult, Not Seasonally Adjusted (RGDPEQBEA626NUPN) The equivalent measure used here assigns a weight of 1.0 to all persons over 15, and 0.5 for those under age 15. More information is available at http://pwt.econ.upenn.edu/Documentation/append61.pdf. For proper citation, see http://pwt.econ.upenn.edu/php_site/pwt_index.php Source Indicator: rgdpeqa Purchasing Power Parity Converted GDP Chain per equivalent adult for Belgium Integer Period Range: to copy to all Create your own data transformation: [+] Need help? [+] Use a formula to modify and combine data series into a single line. For example, invert an exchange rate a by using formula 1/a, or calculate the spread between 2 interest rates a and b by using formula a - b. Use the assigned data series variables above (e.g. a, b, ...) together with operators {+, -, *, /, ^}, braces {(,)}, and constants {e.g. 2, 1.5} to create your own formula {e.g. 1/a, a-b, (a+b)/2, (a/(a+b+c))*100}. The default formula 'a' displays only the first data series added to this line. You may also add data series to this line before entering a formula. will be applied to formula result Create segments for min, max, and average values: [+] Graph Data Graph Image Retrieving data. Graph updated. #### Recently Viewed Series Subscribe to our newsletter for updates on published research, data news, and latest econ information. Name:   Email:
453
1,822
{"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-2014-35
latest
en
0.748411
https://vijos.org/p/1577/solution
1,716,084,113,000,000,000
text/html
crawl-data/CC-MAIN-2024-22/segments/1715971057631.79/warc/CC-MAIN-20240519005014-20240519035014-00835.warc.gz
546,890,463
9,065
# 51 条题解 • @ 2017-03-12 15:26:36 ``````#include <cstdio> #include <cstring> #include <algorithm> #define rn 10000 using namespace std; int n,m,f[rn+1]; struct hw_1 { int x,t; }a[rn+1]; int main() { scanf("%d%d",&n,&m); int x=m; for (int i=1;i<=m;i++) scanf("%d%d",&a[i].x,&a[i].t); memset(f,0,sizeof(f)); for (int i=n;i>=1;i--) { if (a[x].x!=i) f[i]=f[i+1]+1; else while (a[x].x==i) { f[i]=max(f[i],f[a[x].t+i]); x--; } } printf("%d\n",f[1]); } `````` • @ 2020-08-28 15:12:55 #include <bits/stdc++.h> using namespace std; int n,k; int f[99999]; struct ha{ int p; int t; }a[99999]; int main(){ cin>>n>>k; int x=k; for(int i=1; i<=k; i++){ cin>>a[i].p>>a[i].t; } for(int i=n; i>=1; i--){ if(a[x].p!=i){ f[i]=f[i+1]+1; } else{ while(a[x].p==i){ f[i]=max(f[i],f[a[x].t+i]); x--; } } } cout<<f[1]; return 0; } //不对的话寄刀片 • @ 2020-05-15 22:01:04 LIS入门 ``````#include<iostream> using namespace std; const int MAXN=10000+1; struct Node { int s; int e; }; bool mymax(int a,int b) { if(a>b) { return true; } else { return false; } } int main() { int t,n; Node hw[MAXN]; int dp[MAXN]={0}; cin>>t>>n; for(int i=0;i<n;i++) { cin>>hw[i].s; cin>>hw[i].e; } for(int i=t;i>0;i--) { bool k=true; int max=0; for(int j=n-1;j>=0;j--) { if(hw[j].s==i) { k=false; if(dp[i+hw[j].e]>max) { max=dp[i+hw[j].e]; } } } if(!k) { dp[i]=max; } if(k) { dp[i]=dp[i+1]+1; } } cout<<dp[1]<<endl; return 0; } `````` • @ 2018-08-08 11:43:50 dp~~~水题 #include<cstdio> #include<cstring> #include<cmath> #include<iostream> #include<algorithm> using namespace std; int n,k,p[11000],t[11000],f[11000]; int main() { scanf("%d%d",&n,&k); for(int i=1;i<=k;i++) { scanf("%d%d",&p[i],&t[i]); } memset(f,0,sizeof(f)); for(int i=n;i>=1;i--) { if (p[k]!=i) f[i]=f[i+1]+1; else while (p[k]==i) { f[i]=max(f[i],f[t[k]+i]); k--; } } printf("%d\n",f[1]); return 0; } • @ 2016-11-10 19:02:32 DP方程: f[i]=f[i+1]+1(p[j]<>i) f[i]=max(f[i],f[t[j]+i])(p[j]=i) ```pascal program pooroi; var n,k,i,j,r,x,y:longint; p,t,f:array[0..10000]of longint; function max(a,b:longint):longint; begin if a>b then exit(a) else exit(b); end; begin for i:=1 to k do f[n+1]:=0; j:=k; for i:=n downto 1 do begin f[i]:=0; if p[j]<>i then f[i]:=f[i+1]+1 else while p[j]=i do begin f[i]:=max(f[i],f[t[j]+i]); dec(j); end; end; writeln(f[1]); end. • @ 2014-08-16 00:29:17 program p1577; var i,n,k,h:longint; a:array[0..10001,1..2] of longint; f:array[1..10001] of longint; // function max(a,b:longint):longint; begin if a>b then exit(a) else exit(b); end; // begin for i:=1 to k do read(a[i,1],a[i,2]); for i:=n downto 1 do begin h:=k; while (h>0) and (a[h,1]>i) do dec(h); if (h<=0) or (a[h,1]<>i) then f[i]:=f[i+1]+1 else begin while (a[h,1]=i) and (h>0) do begin f[i]:=max(f[i+a[h,2]],f[i]);dec(h);end;end; end; write(f[1]); end. • @ 2009-11-19 19:46:36 #include using namespace std; int dp[10001]; int a[10001],c[10001],d[10001]; int n,m; int main () { int i,j; cin>>n>>m; for (i=1;i>a[i]>>c[i]; d[a[i]]=1; } dp[n+1]=0; for (j=n;j>=1;j--) { if (d[j]) { for(int l=1;l • @ 2009-11-04 16:45:58 编译通过... ├ 测试数据 01:答案正确... 0ms ├ 测试数据 02:答案正确... 0ms ├ 测试数据 03:答案正确... 0ms ├ 测试数据 04:答案正确... 0ms ├ 测试数据 05:答案正确... 0ms ├ 测试数据 06:答案正确... 0ms ├ 测试数据 07:答案正确... 0ms ├ 测试数据 08:答案正确... 0ms ├ 测试数据 09:答案正确... 0ms ├ 测试数据 10:答案正确... 0ms ---|---|---|---|---|---|---|---|- Accepted 有效得分:100 有效耗时:0ms O(2nlogm)的算法……秒杀! • @ 2009-11-03 19:41:40 纯水题= =、 • @ 2009-10-26 16:43:31 var i,j,n,k:longint; s,t:array[1..9999]of longint; f:array[1..10000]of longint; begin f[n+1]:=0; for i:=1 to k do read(s[i],t[i]); j:=k; for i:= n downto 1 do begin f[i]:=0; if s[j]i then f[i]:=f+1 else while s[j]=i do begin if f[i+t[j]]>f[i] then f[i]:=f[i+t[j]]; j:=j-1; end; end; writeln(f[1]); end. • @ 2009-10-26 12:28:55 我先做的1634 结果改了两个字交上去 竟然AC了! • @ 2009-10-18 14:26:23 无需排序!鉴定完毕。 • @ 2009-10-11 22:49:24 尼克的任务 • @ 2009-09-25 11:10:38 编译通过... ├ 测试数据 01:答案正确... 0ms ├ 测试数据 02:答案正确... 0ms ├ 测试数据 03:答案正确... 0ms ├ 测试数据 04:答案正确... 0ms ├ 测试数据 05:答案正确... 0ms ├ 测试数据 06:答案正确... 0ms ├ 测试数据 07:答案正确... 0ms ├ 测试数据 08:答案正确... 0ms ├ 测试数据 09:答案正确... 0ms ├ 测试数据 10:答案正确... 0ms ---|---|---|---|---|---|---|---|- Accepted 有效得分:100 有效耗时:0ms var s,t,f:array[0..10000]of integer; n,k,j,i:longint; begin for i:=1 to k do read(s[i],t[i]); fillchar(f,sizeof(f),0);j:=k; for i:=n downto 1 do begin if s[j]i then f[i]:=f+1 else while s[j]=i do begin if f[i] • @ 2009-09-14 20:47:41 异乎寻常的囧,,竟然交了三次。。。。。。。 • @ 2009-09-14 18:13:00 记录号 Flag 得分 记录信息 环境 评测机 程序提交时间 R1530292 Accepted 100 From linyinghao- P1577 FPC Vivid Puppy 2009-9-14 18:12:01 From 1s 可怜的Oliver 冰尘e溶化邀请赛 系列 编译通过... ├ 测试数据 01:答案正确... 0ms ├ 测试数据 02:答案正确... 0ms ├ 测试数据 03:答案正确... 0ms ├ 测试数据 04:答案正确... 0ms ├ 测试数据 05:答案正确... 0ms ├ 测试数据 06:答案正确... 0ms ├ 测试数据 07:答案正确... 0ms ├ 测试数据 08:答案正确... 0ms ├ 测试数据 09:答案正确... 41ms ├ 测试数据 10:答案正确... 0ms ---|---|---|---|---|---|---|---|- Accepted 有效得分:100 有效耗时:41ms program vijos1577; var k,i,j,n:integer; p,t,f:array[1..10000]of integer; q:array[1..10000]of boolean; begin for i:=1 to k do begin q[p[i]]:=true; end; for i:=n downto 1 do if not(q[i]) then f[i]:=f+1 else for j:=1 to k do if p[j]=i then if f[i] • @ 2009-09-11 16:09:21 此题数据非常水,无须排序!! 经鉴定,此题密度近似为1 • @ 2009-09-06 11:20:36 编译通过... ├ 测试数据 01:答案正确... 0ms ├ 测试数据 02:答案正确... 0ms ├ 测试数据 03:答案正确... 0ms ├ 测试数据 04:答案正确... 0ms ├ 测试数据 05:答案正确... 0ms ├ 测试数据 06:答案正确... 0ms ├ 测试数据 07:答案正确... 0ms ├ 测试数据 08:答案正确... 119ms ├ 测试数据 09:答案正确... 338ms ├ 测试数据 10:答案正确... 259ms ---|---|---|---|---|---|---|---|- Accepted 有效得分:100 有效耗时:716ms var p,t,f:array[0..10003]of longint; i,n,k,x,j:longint; function max(x,y:longint):longint; begin if x>y then max:=x else max:=y; end; begin for i:=1 to k do readln(p[i],t[i]); for i:=n downto 1 do begin x:=0; for j:=1 to k do if p[j]=i then x:=1; if x=0 then f[i]:=f+1 else for j:=1 to k do if p[j]=i then f[i]:=max(f[i],f[i+t[j]]); end; writeln(f[1]); end. Flag    Accepted 题号   P1577 类型(?)   动态规划 通过   211人 提交   345次 通过率   61% 难度   1 为什么又一次AC啊.... • @ 2009-08-28 10:13:14 绝对是人品RP有问题,倒推却打成最少的时间=.=|| • @ 2009-08-27 14:24:21 囧... 交了两遍,发现正推比较费劲 ID 1577 3 (无) 1415 741 52% 3
3,045
6,206
{"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.109375
3
CC-MAIN-2024-22
latest
en
0.117191
http://mathhelpforum.com/differential-equations/175218-uniqueness-theorem.html
1,526,888,987,000,000,000
text/html
crawl-data/CC-MAIN-2018-22/segments/1526794863967.46/warc/CC-MAIN-20180521063331-20180521083331-00356.warc.gz
185,071,115
9,413
1. Uniqueness Theorem Hi all, I have the following D.E. $\displaystyle \frac{dy}{dt} = \sqrt{y^2+1},\\ y(t_0) = y_0$ How can i find a value of $\displaystyle y_0$ and a value of $\displaystyle t_0$ such that there is a unique solution to the initial-value problem? 2. The functions $\displaystyle f(t,y)=\sqrt{y^2+1},\;\;\dfrac{\partial f}{\partial y}$ are continuous on $\displaystyle \mathbb{R}^2$ , so for every $\displaystyle (t_0,y_0)\in \mathbb{R}^2$ there exists a unique solution satisfying $\displaystyle y(t_0)=y_0$ .
182
534
{"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}
3.140625
3
CC-MAIN-2018-22
latest
en
0.680641
http://www.chegg.com/homework-help/questions-and-answers/particle-moves-along-curve-shown-figure-distance-meters-along-curve-x-axis-given-s-t-2-6-t-q3569319
1,469,808,553,000,000,000
text/html
crawl-data/CC-MAIN-2016-30/segments/1469257831769.86/warc/CC-MAIN-20160723071031-00085-ip-10-185-27-174.ec2.internal.warc.gz
364,903,294
13,385
A particle moves along a curve as shown in the figure. Its distance in meters from along the curve from the x-axis is given by s = t^2/6 where t is in seconds. The particle is at A when t = 2.0 and at B when t = 3.0. Determine the average acceleration of the particle between A and B, and the magnitude of the average acceleration.
84
331
{"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-2016-30
latest
en
0.975206
https://gamedev.stackexchange.com/questions/4779/is-there-a-faster-sine-function/4793
1,619,010,495,000,000,000
text/html
crawl-data/CC-MAIN-2021-17/segments/1618039544239.84/warc/CC-MAIN-20210421130234-20210421160234-00636.warc.gz
360,995,858
40,558
# Is there a faster sine function? I am working on generation 3d perlin noise. The C# Math library seems like overkill for what I need since most of its functions use double percision. I use Math.Sin() in several places to generate the noise. Does anyone know of a faster sine function? • There is MathF – Brackets Mar 26 '20 at 9:23 You can use a parabola to aproximate the value of the sine function. This has the advantage of having the roots at exactly -pi/2 and pi/2 which is usually not the case with other fast approximations based on the TaylorSeries or MaclaurinSeries. public float Sin(float x) { const float B = 4 / PI; const float C = -4 / (PI*PI); return -(B * x + C * x * ((x < 0) ? -x : x)); } Here is a comparison to the actual sine function: • This is indeed a great solution. Here is an excellent article from devmaster.net which describes why this works and gives some implementation details: devmaster.net/forums/showthread.php?t=5784 – reverbb Oct 23 '10 at 20:25 • I don't know about C#, but the abs() function in most C environments will likely be faster than a branch (the ?: operator), when optimized. – user744 Oct 23 '10 at 20:50 • I removed the Math.Abs() call because I assumed that this code might run on the Xbox 360 or Windows Phone 7. The JIT compiler on Xbox 360 does not inline anything. A call to Math.Abs() is actually more expensive. – zfedoran Oct 23 '10 at 21:09 • @reverbb Link is 404. Here is a cached copy. – Daniel says Reinstate Monica Jan 13 '15 at 0:36 • @zfedoran Why do you negate the return value? It appears to be a negative sine wave. – Daniel says Reinstate Monica Jan 13 '15 at 1:36 What is the range of input values to your sin() function? For what you're using it for, it sounds like they might be limited, which means you could pre-compute the values. For instance, if you're rounding up the input values to the nearest degree, then you only have 360 possible values - just pre-compute them and store in a table. If you need slightly more values, say to one decimal place, you could interpolate from the table - I'm not familiar with perlin noise, but the word "noise" seems to indicate it doesn't require high accuracy. :) (You could also just make a larger table, 3600 entries isn't much space). • If speed is your number-one concern, and you do not mind sacrificing a bit of accuracy, this is the best answer. – AttackingHobo Oct 24 '10 at 21:07 • I don't know about "best" - As shown in another answer, you can get another very good approximation in five ops + abs (the speed of which depends on your arch / compiler, but is often branchless). If the lookup table is not in cache, it's going to be much slower. – user744 Oct 26 '10 at 12:31 You might want to read this too, it's got fast sine and cosine approximations
726
2,791
{"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.953125
3
CC-MAIN-2021-17
longest
en
0.866357
https://moorejustinmusic.com/guidelines/what-should-a-6-2-large-frame-male-weigh/
1,721,503,660,000,000,000
text/html
crawl-data/CC-MAIN-2024-30/segments/1720763517515.18/warc/CC-MAIN-20240720174732-20240720204732-00530.warc.gz
360,474,294
9,254
# What should a 6 2 large frame male weigh? ## What should a 6 2 large frame male weigh? A large-framed man who is 6 feet 2 inches tall has an ideal weight of 209 pounds. What should be the weight for 6.2 height? How Can BMI Be Used to Determine Ideal Weight? Height Weight (based on normal BMI of 19–24) 6’0″ 140–177 lbs. 6’1″ 144–182 lbs. 6’2″ 148–186 lbs. 6’3″ 152–192 lbs. ### What should be the weight for 6.4 height? Ideal Weight Table Height Women Feet & Inches Metres Kg 6′ 3″ 1.905 68 – 86 6′ 3½” 1.918 69 – 88 6′ 4″ 1.930 70 – 89 How do I know if I am big boned? Big boned means wider bones Measure your wrist to find out if you’re really big boned, since “body frame size is determined by a person’s wrist circumference in relation to height,” according to the National Institutes of Health. More than 5 feet 5 inches tall and wrist size larger than 7.5 inches. #### What should a 6’2 male weigh kg? Adults Weight to Height Ratio Chart Height Female Male 6′ 2″ (188 cm) 153/187 lb (69.4/84.8 kg) 171/209 lb (77.5/94.8 kg) 6′ 3″ (191 cm) 158/193 lb (71.6/87.5 kg) 176/216 lb (79.8/98 kg) 6′ 4″ (193 cm) 162/198 lb (73.5/89.8 kg) 182/222 lb (82.5/100.6 kg) What is ideal weight for 6ft male in KG? Ideal Weight : 61.6 Kgs. ## What should a 6ft man BMI be? 18.5 to 24.9 Your Healthy Weight You should aim for a BMI of 18.5 to 24.9, whether you’re male or female. At 6 feet — or 72 inches — this means that your ideal weight range is about 140 to 183 pounds. What should be the weight for 6.3 height? Adults Weight to Height Ratio Chart Height Female Male 6′ 3″ (191 cm) 158/193 lb (71.6/87.5 kg) 176/216 lb (79.8/98 kg) 6′ 4″ (193 cm) 162/198 lb (73.5/89.8 kg) 182/222 lb (82.5/100.6 kg) 6′ 5″ (195 cm) 167/204 lb (75.7/92.5 kg) 187/229 lb (84.8/103.8 kg) ### How much should a male that is 5’9″ weigh? Men who are 5′ 9″ in height can weigh from 142 pounds to 176 pounds – and at times more, such as where weight lifting is involved, and still be considered as within their healthy range of body weight. What is the recommended weight for a man? The Centers for Disease Control and Prevention has a chart that informs men what their ideal weight is if they have a BMI between 18.5 and 25. If you’re a 6-foot man, your ideal weight is 137 to 185 lbs. #### How much should I weigh at 5’9? Based on these general guidelines, a 5-foot-9-inch woman would ideally weigh 130 to 160 pounds, depending on her frame size. For women, frame size is determined using height and wrist circumference. How much should a 6 year old weigh? The average weight for 6 year old boys is 45.8 lbs and 6 year old girls average 44.8 lbs 1 The tables below show the distribution of weight by percentile of the 6 year year old population. Current units = pounds. View this page in kilograms.
897
2,797
{"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-2024-30
latest
en
0.884275
https://www.studypool.com/documents/416/correlation-regression
1,627,584,503,000,000,000
text/html
crawl-data/CC-MAIN-2021-31/segments/1627046153892.74/warc/CC-MAIN-20210729172022-20210729202022-00039.warc.gz
1,071,681,862
436,869
search # Correlation, Regression Statistics Homework ### Rating Showing Page: 1/3 For the following quesons, you can use the SET command to enter the data, the CORR command to calculate correlaon coecients, and the REGR command to do the regression. Type HELP SET , HELP CORR or HELP REGR for informaon on how to use these commands. A student wonders if people of similar heights tend to date each other. She measures herself and &ve other women in her hall of residence. She then measures the height of the next person each woman dates. Here are the data (all heights in inches): Women 66 64 66 65 70 65 Their Dates 72 68 70 68 71 65 Treat the height of the women from the hall of residence as the predictor and the height of their date as the response. Q1 The sample standard deviaon of the y values is closest to: a. b. c. d. A. Q2 A The sample mean of the y values is A. Q3 The sample correlaon of the x and y values is closest to: a. b. c. d. A. Q4 The intercept is a. 28 b. 20 c. 16 d. 24 A. Q5 The slope is closest to 0.68 0.70 0.72 0.78 A. Q6 A new women joins the dorm. If she is 67 inches tall, the predicted height of her next date is a. b. c. d. A. Equaon of regression Y = 24 + 0.682 * X When Value of X=67 then Y = 24 + 0.682 * 67 = 69.694 ~ 69.7 Q7 If the heights were measured in cm rather than inches (note 1 inch is 2.54 cm) the slope would increase by a factor of a. would not change b. 1/2.54 c. 2.54 A. Q8 The coecient of determinaon is closest to 0.23 0.32 0.18 0.29 A. coecient of determinaon ( r^2 ) = (0.5654)^2 = 0.319 ~ 0.32 Q9 The standard deviaon of the residuals is closest to ANSWER – 2.08, Got 2.08 but did not nd in options Q10 The 95% con&dence interval for the true slope is of the form b1 ± where is closest to A. ### Unformatted Attachment Preview For the following questions, you can use the SET command to enter the data, the CORR command to calculate correlation coefficients, and the REGR command to do the regression. Type HELP SET , HELP CORR or HELP REGR for information on how to use these commands.A student wonders if people of similar heights tend to date each other. She measures herself and five other women in her hall of residence. She then measures the height of the next person each woman dates. Here are the data (all heights in inches):Women666466657065Their Dates726870687165Treat the height of the women from the hall of residence as the predictor and the height of their date as the response.Q1The sample standard deviation of the y values is closest to:a.2.09b.2.53c.6.40d.4.40A.ANSWER - 2.53Q2A The sample mean of the y values isA.ANSWER - 69Q3The sample correlation of the x and y v ... Purchase document to see full attachment User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service. Review Review Anonymous Great! Studypool always delivers quality work. Studypool 4.7 Trustpilot 4.5 Sitejabber 4.4
922
2,973
{"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.34375
4
CC-MAIN-2021-31
latest
en
0.868061
http://kottke.org/12/01/the-thing-about-998001-is
1,503,019,329,000,000,000
text/html
crawl-data/CC-MAIN-2017-34/segments/1502886104204.40/warc/CC-MAIN-20170818005345-20170818025345-00473.warc.gz
238,753,700
3,240
## The thing about 998,001 is… If you divide 1 by the number 998,001, you get a list of all the three digit numbers in order except 998. Like so: Math! (via mlkshk)
52
166
{"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-2017-34
latest
en
0.638503
http://oeis.org/A002642
1,369,308,845,000,000,000
text/html
crawl-data/CC-MAIN-2013-20/segments/1368703298047/warc/CC-MAIN-20130516112138-00039-ip-10-60-113-184.ec2.internal.warc.gz
199,014,405
3,731
This site is supported by donations to The OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!) A002642 Numbers n such that (n^2 + n + 1)/13 is prime. (Formerly M4606 N1131) 1 9, 29, 35, 42, 48, 113, 120, 126, 152, 185, 204, 224, 237, 243, 276, 302, 308, 321, 341, 386, 399, 419, 432, 477, 503, 510, 516, 542, 549, 588, 633, 659, 666, 705, 731, 770, 776, 783, 789, 815, 848, 854, 887, 906, 932, 945, 965, 978 (list; graph; refs; listen; history; text; internal format) OFFSET 1,1 COMMENTS All terms are congruent to 3 or 9 (mod 13). [Bruno Berselli, Sep 26 2012] REFERENCES A. J. C. Cunningham, Binomial Factorisations, Vols. 1-9, Hodgson, London, 1923-1929; see Vol. 1, pp. 245-259. N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). LINKS Vincenzo Librandi, Table of n, a(n) for n = 1..1000 MATHEMATICA Select[Range[1000], PrimeQ[(#^2 + # + 1)/13]&] (* Vincenzo Librandi, Sep 25 2012 *) PROG (PARI) forstep(n=9, 1e4, [7, 6], if(isprime((n^2+n+1)/13), print1(n", "))) \\ Charles R Greathouse IV, Sep 25 2012 (MAGMA) I:=[m: m in [1..1000] | m mod 13 in [3, 9]]; [n: n in I | IsPrime( (n^2 + n + 1) div 13 )]; // Bruno Berselli, Sep 26 2012 CROSSREFS Sequence in context: A024121 A205144 A044976 * A032700 A098949 A031296 Adjacent sequences:  A002639 A002640 A002641 * A002643 A002644 A002645 KEYWORD nonn,easy AUTHOR STATUS approved Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc. Content is available under The OEIS End-User License Agreement .
689
1,863
{"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.4375
3
CC-MAIN-2013-20
latest
en
0.574458
http://www.jiskha.com/display.cgi?id=1321235089
1,495,715,724,000,000,000
text/html
crawl-data/CC-MAIN-2017-22/segments/1495463608067.23/warc/CC-MAIN-20170525121448-20170525141448-00096.warc.gz
565,027,136
4,089
# Math posted by on . A car is traveling south at a speed of 68 mi/h from Dallas toward San Antonio. Dallas is about 272 miles north of San Antonio. A truck is traveling north from San Antonio to Dallas at a speed of 71 mi/h. When and where will they pass each other? 1. Create a table to record the highway distance from San Antonio for 0-5 hours in one-hour intervals. 2. Graph the information in your table. Put time on the x-axis.3. What do the y-intercepts on your graph mean? 4. Where do the cars pass each other? 5. Which vehicle reaches its’ destination first? • Math - , I will assume you meant to state that they left at the same time. Let the distance covered by the southbound be x let the distance covered by the northbound be 272-x time for southbound = x/68 time for northbound = (272-x)/71 solve: x/68 = (272-x)/71 71x = 18496 - 68x 139x = 18496 x = 133.06 the southbound car went 133.06 , and the northbound went 138.94 miles when they met time = 133.06/68 = 1.957 hrs ( check: 138.94/71 = 1.957 hrs ) Just follow the instructions for the remaining part of the question.
307
1,101
{"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-2017-22
latest
en
0.928197
https://www.jiskha.com/questions/360544/justin-had-44-dollars-before-spending-n-dollars-on-jeans-how-much-money-remains
1,618,268,694,000,000,000
text/html
crawl-data/CC-MAIN-2021-17/segments/1618038069267.22/warc/CC-MAIN-20210412210312-20210413000312-00530.warc.gz
942,168,861
4,962
# math Justin had 44 dollars before spending n dollars on jeans. How much money remains 1. 👍 2. 👎 3. 👁 1. 44-n = ? 1. 👍 2. 👎 ## Similar Questions 1. ### Algebra 1 The amount of money in an account may increase due to rising stock prices and decrease due to falling stock prices. Nathan is studying the change in the amount of money in two accounts, A and B, over time. The amount f(x), in 2. ### math Identify the dependent variable in this relationship. A person washes c car and earns d dollars. 1.neither c, cars or d, dollars. 2.cars, c. (MY ANSWER) 3.dollars, d. 4.both c, cars and d, dollars 3. ### math greg exchanged 200 canadian dollars for 1/5 fewer u.s dollars. after spending 3/4 of the u.s dollars, how many did he have left? 4. ### Math - algebra Oceanside bike rental shop charges 14 dollars plus 9 dollars an hour for renting a bike. Joan paid 86 dollars to rent a bike. How many hours did she pay to have the bike checked out? X is unknown N= 9h+14 86= 9h+14 86-14 1. ### algebra sam saved his money until he had \$10000 to invest.he invested x dollars into certificate of deposit (cd) with an annual interest rate of 2% and the remaining y dollars into a mutual fund with annual interest of 1.5% total interest 2. ### Math Ryan, Darius, and Mason each have \$15.75. They each spend the same amount (d), in dollars, at the school fair. The total amount of money they will still have can be expressed as 3(15.75 - d). Which expression is equivalent to the 3. ### Algebra 1 thx Antonia is saving for a video game. On the first day, she saves two dollars in her piggy bank. Each day after that, she doubles the number of dollars she saved on the previous day. How many dollars does she save on the sixth day? 4. ### college math A piece of land in Ottawa with an area of 0.4 square kilometers is priced at 5600 Canadian dollars. If there are 1.358 Canadian dollars per (U.S.) dollar, then what is the price in dollars per square mile? 1. ### math I have 200 canadian dollars and exchange them for 1/5 fewer us dollars. After spending 3/4 of my us dollars how much do I have left? 2. ### Algebra In the mall you receive a coupon for 5 dollars off a pair of jeans. When you arrive at the store you find that all jeans are 25 percent off Let x represent the original cost of the jeans 18a.Write a function F(x) that represents 3. ### math On a vacation in cananda steve used his credit card to buy a camera for Can \$250.00 trinirose: What is the value of the camera in Ja \$. a)I know the asnwer is \$18,125 Ja dollars b)steve has a credit limit of Ja \$30,000.00.After 4. ### COLLEGE MATH a manufacture of brand A jeans has daily production costs of C =0.2x^2 -96x+12,095 where C is the total cost in dollars and x is the number of jeans produced. How many jeans should be produced each day in order to minimize costs?
779
2,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.5
4
CC-MAIN-2021-17
latest
en
0.938203
https://esolangs.org/wiki/Pi_Calculus
1,723,008,519,000,000,000
text/html
crawl-data/CC-MAIN-2024-33/segments/1722640682181.33/warc/CC-MAIN-20240807045851-20240807075851-00134.warc.gz
187,189,265
10,095
# Pi Calculus The Pi calculus is a process calculus invented by Robin Milner in 1992. It is based on channels which can be used to transmit data, and processes which determine the behavior of those channels. It is similar to lambda calculus in that there is only one first-class datatype, but pi calculus also allows concurrent execution, stateful functions, and a richer structure for programs. ## Introduction In the basic form of the calculus, processes are built recursively from the following commands: `x(y).P` Input Read from the channel x, then execute P with the result named y `x<y>.P` Output Write y to the channel x, then execute P `(v x).P` Creation new x in P Execute P with a new channel named x `P|Q` Concurrency Par Execute P and Q concurrently `!P` Replication Bang Execute P an infinite number of times concurrently `0` Nil Does nothing Commands in a process are generally separated with `.`, and processes are terminated with a `0` (although this is often omitted to improve readability). Reads implement pattern-matching, meaning that the rest of the process will not execute if the current value taken from the channel does not satisfy the condition. A name acts like a wildcard, and any current value in the channel will match a name. Pattern-matches towards a literal will only be satisfied if the current value in the channel is exactly the literal specified in the read. Importantly, both read and writes will block the current process from continuing further until they complete. In this way, communication can be used to block processes from running until particular conditions are met. Replication is often restricted to just before an input operation, as in `!x(y)` (termed a "replicated read"); this does not weaken the calculus. ### Providers Unlike lambda calculus, which is entirely based around functions, pi calculus does not have any primitive notion of a function. Despite this, it is possible to make a "provider", which behaves similarly to a function. Providers are processes which constantly read from a particular channel and perform some operation whenever data is transmitted. A provider is typically written like this: ``` !provider(a).a(input1).a(input2). P .a<output1>.a<output2>.0 ``` To later invoke this provider: ``` (v a).provider<a>.a<input1>.a<input2>.a(output1).a(output2) ``` Since the provider can be invoked multiple times concurrently, each invocation uses a separate temporary communication channel `a` instead of transmitting the inputs and outputs directly. ## Structural Congruences • `P|0 = P` - Executing parallel with the inert process is the same as executing without the process. • `P|Q = Q|P` - Parallel composition is commutative. • `(P|Q)|R = P|(Q|R)` - Parallel composition is associative. • `!P = !P|P` - Infinite `P` in parallel is the same as adding another P in parallel. • `(v a)(v b)P = (v b)(v a)P` - The definition of new channels is associative. • `(v c)(P|Q) = (v c)P|Q`, if `c` also appears in `Q` • `c<x>.P|c(y).Q = P|Q`, in which all `y` in `Q` is replaced with `x` • `(v x)0 = 0` ## Examples ### Cat program This process endlessly copies anything read from `i`, and writes it to `o`. ```!i(x).o<x>.0 ``` This process will only execute `S` once `P`, `Q`, and `R` have finished. ```(v x). ( P.x<x>.0 | Q.x<x>.0 | R.x<x>.0 | x(y).x(y).x(y).S ) ``` In Rho-calculus, this can be expressed simply as ```( P; Q; R ).S ``` ```!incr(a,x).a<x+1> ``` ## Extensions The pi calculus is sometimes extended for notational convenience, or to make it easier to express certain concepts. One common extension permits read and write operations to accept more than one argument. An example of a polyadic write operation would be `f<x,y,z>`, which can be interpreted as shorthand for `(v a).f<a>.a<x>.a<y>.a<z>`. Likewise, a polyadic read operation `f(x,y,z)` could be interpreted as `f(a).a(x).a(y).a(z)`. ### Nondeterministic choice operator The nondeterministic choice operator `P+Q` will execute one of either `P` or `Q`, but it is unknown which. This could be modeled as `(v a)(a(x).P|a(x).Q|a<a>.0)`. ### Match / Mismatch The operator `if x=y then P` behaves like `P` if `x` and `y` are the same. [1] The operator `if x≠y then P` behaves like `P` if `x` and `y` are not the same. In some variants, `if cond then P` can also be written as `[cond].P`. It is possible to simulate if/else via `if x=y then P + if x≠y then Q`. This can also be written as `if x then P else Q`. If the equality comparison is made between channel names, then it is possible to simulate the comparison without match operators. For example, `[x=y].Q + [x=z].R` can be modeled as `x<0> | (y(a).Q + z(a).R)`. This works because if a value is sent through the channel x, and the channel y recieves the message, then the channels x and y are the same channels; and vice versa. ### Cryptographic primitives As the pi calculus is very good at modeling communication systems, it has been extended to include primitives which cryptographically encrypt and decrypt data streams [2]. ### Arithmetic and common data structures Common data structures is a frequent extension, along with their related operations. This may include, but is not limited to, numbers (and arithmetic), lists(maps, filters), sets, maps, etc. ## Rho calculus Rho calculus is a process calculus invented by Greg Meredith which is based on Pi calculus. One of the most significant differences between the two calculi is that channels can not only recieve values and names, they can recieve processes as well (which, in turn, allow programs to modify itself in a way). Another significant difference is that process replication (`!P`) has been replaced with recursion. In Rho calculus, the syntax `*x` means to evaluate the content in the name `x` as a process in Rho calculus, while the syntax `@x` means to un-evaluate the content in x (does not modify x, just returns the value). The syntax `(P;Q;R).a` means to execute `a` only if the processes `P, Q, and R` have all finished execution. In Rho calculus, there is a way to peek the frontmost value of a channel, store the value to a name, without consuming the value from the channel. One of the ways to express it is `a{x}`, in which the value `x` is being 'peeked' from the channel `a`. Since variables can be easily expressed by channels, this operation can be expressed more simply as `a`. ## Encoding of Lambda Calculus Lambda calculus can be readily encoded using providers. As lambda calculus is functional in nature while pi calculus is procedural in nature, the lambda term must be used as a channel rather than a process. Let `[f]` denote a channel representing the lambda term `f`, and make these substitutions repeatedly: • `c<[λx.f]>.P``(v l)(!l(a).a(x).a<[f]>|c<l>.P)` • `[λx.f]<c>.P``(v l)(!l(a).a(x).a<[f]>|l<c>.P)` • `c<[f(x)]>.P``(v a).[f]<a>.a<[x]>.a(r).c<r>.P` • `[f(x)]<c>.P``(v a).[f]<a>.a<[x]>.a(r).r<c>.P` • `c<[x]>.P``c<x>.P` (where `x` is atomic) • `[x]<c>.P``x<c>.P` (where `x` is atomic) Some care must be taken to ensure that the temporary variables `l`, `a`, `r` don't clash with any other variables created during the expansion, particularly in `[f(x)]` terms.
1,879
7,202
{"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-2024-33
latest
en
0.938469
https://mathematica.stackexchange.com/questions/216134/plot-multi-graphs-in-one-window
1,721,723,310,000,000,000
text/html
crawl-data/CC-MAIN-2024-30/segments/1720763518029.81/warc/CC-MAIN-20240723072353-20240723102353-00600.warc.gz
321,740,011
38,601
# Plot multi graphs in one window I want to plot a graph of a function in one command y=Sin[a+bx+c]+d; for the range of x=[0,10] for the below set of values 1.a=1,b=1,c=1,d=1 2.a=1.5,b=1.5,c=1.5,d=1.5 3.a=2,b=2,c=2,d=2 rules = Thread[{a, b, c, d} -> #] & /@ {1, 1.5, 2}; Plot[Evaluate[Sin[a + b x + c] + d /. rules], {x, 0, 10}, PlotLegends -> ToString /@ rules] rule4 = Thread[{a, b, c, d} -> {1, 2, 4, 3}] {a -> 1, b -> 2, c -> 4, d -> 3} rulesb = Append[rules, rule4]; Plot[Evaluate[Sin[a + b x + c] + d /. rulesb], {x, 0, 10}, PlotLegends -> ToString /@ rulesb] • Thank you. It's great. if values of variables are different from each other then how can plot. like a=1,b=1.2,c=1.4,d=1.6 a=2,b=2.2,c=2.4,d=2.6 a=3,b=3.2,c=3.4,d=3.6 Commented Mar 12, 2020 at 7:04 • @Mathematicain, please see the update. – kglr Commented Mar 12, 2020 at 7:12
381
860
{"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.828125
3
CC-MAIN-2024-30
latest
en
0.617137
https://www.selfgrowth.com/articles/rules-rule
1,627,686,656,000,000,000
text/html
crawl-data/CC-MAIN-2021-31/segments/1627046154032.75/warc/CC-MAIN-20210730220317-20210731010317-00114.warc.gz
985,581,900
14,079
When I was studying in university, I learnt about the game of contract bridge, and played a lot of casual games with other beginners in the university bridge club. After a while, I told other players that I knew something about the game, but a better player disagreed, and instead he asked me: “Well, if you really know how to play the game, can you describe your playing style to us, then?” I was left speechless. I simply did not have a style, because I played with random decisions instead of a plan, so it turned out that I did not actually know how to play the game, at all. This is the same in trading. Although the best traders have different styles, they all have their own rules which they follow religiously to make trades. It is true that some successful traders describe themselves as “discretionary”, but they do not mean they trade on “gut feeling”, instead they just mean they prefer more simple criteria (e.g. patterns, support/resistance) over mathematical indicators. Missing the Trend. The importance of following a trading system is best illustrated by the following story. In 1983, two great traders, Rich Dennis and Bill Eckhart, recruited some volunteering protégés (whom were as later referred to as “Turtles”) and taught them how to trade. Although the rules they taught are simple, Dennis and Eckhart urged the students to always follow their rules, despite of the fact that 70% of the trades would be small losses, because the remaining 30% would capture big trends that might account for all the profit, so they should not miss a trend, or else they might kill the whole year. After that, the students were given real money to trade with, and an opportunity presented itself just a few weeks after the training, when February heating oil rose from about \$0.80 to \$0.84 a few days into the New Year of 1984. Curtis Faith, the best student of the class, wrote about an unforgettable episode in that trade: “[As the heating oil rose,] I followed the system and bought three contracts. The trade was immediately profitable, and in just a few days I had bought the maximum 12 contracts [… at the same time,] I noticed something that struck me as very odd; in fact, it still does. I was the only Turtle with a full position. Every other single Turtle had decided for some unfathomable reason not to follow the system Rich and Bill had outlined.” It turned out that, even though they were reminded to follow the rules just a few weeks ago, many students had already ignored it, because they either thought the trade was too risky as it went up too fast, or the move would not last because there were only a few days to expiration. Faith could not figure out how everyone attended the same training session he did, yet were not buying the February heating oil according to the plan, to which he commented, “We were told over and over not to miss a trend, and here it was only a few weeks later and many of the Turtles had missed the boat on a very significant one.” Backing Out at the Pullback. After that, the heating oil move was volatile. Heating oil dropped in price from a high of about \$0.98 to \$0.94, or about \$1,200 per contract. According to their training, the students should hold on during a brief drop and let the profits run. Faith did hold all 12 contracts as the price dropped and saw his profit drop from about from \$50,000 to \$35,000 in just a couple of days, while the few other students who had significant positions liquidated their contracts. After the brief pullback, the market woke up and rose again, and soon it passed the previous high of \$0.98 and peaked at over \$1.05 right before expiration. Since the uptrend was unseen in the March contract, Dennis told Faith to close his positions immediately and his account was up \$78,000. Later, Dennis visited the class and made it clear to everyone that taking the trade was the correct move, and declared that those who stuck with the rules would be awarded with a \$ 1 million account to trade with. It was therefore very surprising to Faith when he was given a \$2 million trading account, and it was evidently because Dennis liked the way Faith had handled the heating oil move. Faith wrote: “I was rewarded for holding to the methods we were taught by earning almost three times as much on this trade as any of the other Turtles did. The few who had positions of a reasonable size had all exited near the lows of the previous dip and ended up missing half the move. The Turtles who had not entered the trade made nothing.” He also added, “The scenario could not have been better for teaching the class a valuable lesson. Slightly more than one month after training, we had witnessed in actual trading the importance of not missing trends and had that lesson reinforced in such a way that none of us would ever forget it.” The Winners and The Losers. However, not all of the students learnt from the experience. Although some of them developed into winning traders, up to half of the students were much less profitable, and those who lost money were dropped from the program. The difference between the winners and the losers was that the losers got impatient in an inevitable losing streak, and at some point they simply gave up the rules altogether, yet they did not understand that losing is a part of trading success. As Faith wisely pointed out:
1,134
5,372
{"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.640625
3
CC-MAIN-2021-31
latest
en
0.9825
https://gmatclub.com/forum/starting-with-1-positive-integers-are-written-one-after-the-42060.html?kudos=1
1,498,252,109,000,000,000
text/html
crawl-data/CC-MAIN-2017-26/segments/1498128320174.58/warc/CC-MAIN-20170623202724-20170623222724-00456.warc.gz
729,952,880
48,920
It is currently 23 Jun 2017, 14:08 ### 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 # Starting with 1, positive integers are written one after the Author Message Senior Manager Joined: 04 Jan 2006 Posts: 279 Starting with 1, positive integers are written one after the [#permalink] ### Show Tags 10 Feb 2007, 12:33 00:00 Difficulty: (N/A) Question Stats: 0% (00:00) correct 0% (00:00) wrong based on 0 sessions ### HideShow timer Statistics This topic is locked. If you want to discuss this question please re-post it in the respective forum. Starting with 1, positive integers are written one after the other. What is the 40,000th digit that will be written? A. 4 B. 2 C. 1 D. 0 E. 3 SVP Joined: 05 Jul 2006 Posts: 1747 ### Show Tags 10 Feb 2007, 17:29 I CANT UNDERSTAND THE QUESTION , ARE U SURE OF THE WORDING?? OR IS IT ME Intern Joined: 02 Jan 2007 Posts: 41 ### Show Tags 10 Feb 2007, 17:32 Do you mean if you to write very large number like this: 1234567901234567890.... to 40,000 in length, what would the 40,000th digit be??? Wouldn't it be 0? Or that would be too easy. _________________ Beginning with the end in mind. Aiming to join the 700+ club. Senior Manager Joined: 04 Jan 2006 Posts: 279 ### Show Tags 10 Feb 2007, 18:55 yezz wrote: I CANT UNDERSTAND THE QUESTION , ARE U SURE OF THE WORDING?? OR IS IT ME Here is the sample. 1 then 2 then 3 then 4 123456789 10 11 12 13 14 15 16 17 18 19... keep writing and what is number in the 40,000th digit VP Joined: 22 Oct 2006 Posts: 1438 Schools: Chicago Booth '11 ### Show Tags 12 Feb 2007, 11:32 this is probably an 800 level question, i cant imagine anyone solving this in under 2 minutes Senior Manager Joined: 23 Jun 2006 Posts: 387 ### Show Tags 12 Feb 2007, 12:09 the answer would be 1.... however i agree that this is not a GMAT question.... here is the trick: there are 9 1-digit numbers there are 90 2-digit numbers there are 900 3-digit numbers and 9000 4-digit numbers writing them all gives us 38889 digits. so the 38890th digit is 1 of the number 10000, the first 5 digit number. from here on, for the next 10000 numbers (or 50000 digits), each 5th digit would be 1. so 1 is the 38890th digit and 38895th digit etc... and also the 40000th digit. GMAT Instructor Joined: 04 Jul 2006 Posts: 1262 ### Show Tags 12 Feb 2007, 12:12 devilmirror wrote: Starting with 1, positive integers are written one after the other. What is the 40,000th digit that will be written? A. 4 B. 2 C. 1 D. 0 E. 3 1-9 -9 digits total 10-99 -180 digits total ( 2 for each of the 90 two-digit numbers) 100-999 - 2700 digits total (3 for each of the 900 3-digit numbers) 1000-9999 - 36,000 digits total (......) Clearly, the number containing the 40,000th digit will be a five digit number Up to 999, we have written 38889 digits Since 40,000-38,889= 1,111 and 1,111/5 =222 with a remainder of 1, So, the 40,000th digit is the first digit in 10,222 i.e. 1 A tedious solution- has anybody got another? VP Joined: 28 Mar 2006 Posts: 1369 ### Show Tags 12 Feb 2007, 17:31 hobbit wrote: the answer would be 1.... however i agree that this is not a GMAT question.... here is the trick: there are 9 1-digit numbers there are 90 2-digit numbers there are 900 3-digit numbers and 9000 4-digit numbers writing them all gives us 38889 digits. so the 38890th digit is 1 of the number 10000, the first 5 digit number. from here on, for the next 10000 numbers (or 50000 digits), each 5th digit would be 1. so 1 is the 38890th digit and 38895th digit etc... and also the 40000th digit. you rule...........amazing solution hobbit Manager Joined: 12 Feb 2007 Posts: 167 ### Show Tags 12 Feb 2007, 20:56 they would never give this on the GMAT's would they? 12 Feb 2007, 20:56 Display posts from previous: Sort by
1,339
4,304
{"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-2017-26
longest
en
0.862969
https://flatearthsoc.com/rick-davies-obituary-edge-of-the-earth-lyrics-30-seconds-to-mars.html
1,568,717,422,000,000,000
text/html
crawl-data/CC-MAIN-2019-39/segments/1568514573070.36/warc/CC-MAIN-20190917101137-20190917123137-00305.warc.gz
485,601,590
9,985
92) The Notre Dame Antwerp spire stands 403 feet high from the foot of the tower with Strasburg measuring 468 feet above sea level. With the aid of a telescope, ships can be distinguished on the horizon and captains declare they can see the cathedral spire from an amazing 150 miles away. If the Earth were a globe, however, at that distance the spire should be an entire mile, 5,280 feet below the horizon! Aristotle (who made quite a lot of observations about the spherical nature of the Earth) noticed that during lunar eclipses (when the Earth’s orbit places it directly between the Sun and the Moon, creating a shadow in the process), the shadow on the Moon’s surface is round. This shadow is the planet's, and it’s a great clue about the spherical shape of the Earth. 61.) It is plain that a theory of measurements without a measuring-rod is like a ship without a rudder; that a measure that is not fixed, not likely to be fixed, and never has been fixed, forms no measuring-rod at all; and that as modern theoretical astronomy depends upon the Sun's distance from the Earth as its measuring-rod, and the distance is not known, it is a system of measurements without a measuring-rod – a ship without a rudder. Now, since it is not difficult to foresee the dashing of this thing upon the rock on which Zetetic astronomy is founded, i ```For most media and angles of incidence, the light transmits from one medium to the other. However, when passing from a medium of higher index of refraction into a medium of lower index of refraction at a sufficiently high angle of incidence, there may not be a real value for the angle of refraction. When this happens, the light cannot pass into the second medium. Instead, the light is reflected off the interface and back into the first medium. We call this phenomenon total internal reflection. Many devices make use of total internal reflection. Total internal reflection allows a prism with two 45-degree angles and one 90-degree angle to reflect light at a right angle. One could use a mirror mounted at a 45-degree angle to do the same thing, but total internal reflection is nearly 100% efficient, while the best mirrors are perhaps 85% efficient. Many optical devices, such as binoculars and periscopes, make use of this. Fiber optics are thin wires of glass. Being so thin, fiber optics are flexible and as easy to handle as any metal wire. Glass has a relatively high index of refraction, so light shining down a fiber optic is totally reflected internally by the walls of the fiber optic, if the fiber optic is not bent too sharply. We use fiber optics every day with telephone, cable TV, and internet connections. ``` ```53) At places of comparable latitude North and South, the Sun behaves very differently than it would on a spinning ball Earth but precisely how it should on a flat Earth. For example, the longest summer days North of the equator are much longer than those South of the equator, and the shortest winter days North of the equator are much shorter than the shortest South of the equator. This is inexplicable on a uniformly spinning, wobbling ball Earth but fits exactly on the flat model with the Sun traveling circles over and around the Earth from Tropic to Tropic. ``` When the Sun crosses the equator, in March, and begins to circle round the heavens in north latitude, the inhabitants of high northern latitudes see him slimming round their horizon and forming the break of their long day, in a horizontal course, not disappearing again for six months, as he rises higher and higher in the heavens whilst he makes his twenty-four hour circle until June, when he begins to descend and goes on until he disappears beyond the horizon in September. Thus, in the northern regions, they have that which the traveler calls the "midnight Sun," as he sees that luminary at a time when, in his more southern latitude, it is always midnight. If, for one-half the year, we may see for ourselves the Sun making horizontal circles round the heavens, it is presumptive evidence that, for the other half-year, he is doing the same, although beyond the boundary of our vision. This, being a proof that Earth is a plane, is, therefore, a proof that the Earth is not a globe. 5.) The lights which are exhibited in lighthouses are seen by navigators at distances at which, according to the scale of the supposed "curvature" given by astronomers, they ought to be many hundreds of feet, in some cases, down below the line of sight! For instance: the light at Cape Hatteras is seen at such a distance (40 miles) that, according. to theory, it ought to be nine-hundred feet higher above the level of the sea than it absolutely is, in order to be visible! This is a conclusive proof that there is no "curvature," on the surface of the sea – "the level of the sea,"- ridiculous though it is to be under the necessity of proving it at all: but it is, nevertheless, a conclusive proof that the Earth is not a globe. 186) People sensitive to motion sickness feel distinct unease and physical discomfort from motion as slight as an elevator or a train ride. This means that the 1000mph alleged uniform spin of the Earth has no effect on such people, but add an extra 50mph uniform velocity of a car and their stomach starts turning knots. The idea that motion sickness is nowhere apparent in anyone at 1000mph, but suddenly comes about at 1050mph is ridiculous and proves the Earth is not in motion whatsoever. "Oh, but if the Earth is a plane, we could go to the edge and tumble over!" is a very common assertion. This is a conclusion that is formed too hastily, and facts overthrow it. The Earth certainly is, what man by his observation finds it to be, and what Mr. Proctor himself says it "seems" to be. flat - and we cannot cross the icy barrier which surrounds it. This is a complete answer to the objection, and, of course, a proof that Earth is not a globe. of the intervening object. This conclusion is forced upon, us by the evidence; but it involves the admission that the moon shines with light of its own–that it is not a reflector of the sun’s light, but absolutely self-luminous. Although this admission is logically compulsory, it will be useful and strictly Zetetic to collect all the evidence possible which bears upon it.”- Samuel Rowbathom, Zetetic Astronomy (1) 81.) Newtonian philosophers teach us that the Moon goes round: the Earth from west to east. But observation – man's most certain mode of gaining knowledge – shows us that the Moon never ceases to move in the opposite direction – from east to west. Since, then, we know that nothing can possibly move in two, opposite directions at the same time, it is a proof that the thing is a big blunder; and, in short, it is a proof that the Earth is not a globe. 120) The etymology of the word “planet” actually comes from late Old English planete, from Old French planete (Modern French planète), from Latin planeta, from Greek planetes, from (asteres) planetai “wandering (stars),” from planasthai “to wander,” of unknown origin, possibly from PIE *pele “flat, to spread” or notion of “spread out.” And Plane (n) “flat surface,” c. 1600, from Latin planum “flat surface, plane, level, plain,” planus “flat, level, even, plain, clear.” They just added a “t” to our Earth plane and everyone bought it. 54) At places of comparable latitude North and South, dawn and dusk happen very differently than they would on a spinning ball, but precisely how they should on a flat Earth. In the North dawn and dusk come slowly and last far longer than in the South where they come and go very quickly. Certain places in the North twilight can last for over an hour while at comparable Southern latitudes within a few minutes the sunlight completely disappears. This is inexplicable on a uniformly spinning, wobbling ball Earth but is exactly what is expected on a flat Earth with the Sun traveling faster, wider circles over the South and slower, narrower circles over the North. In the next photograph and succeeding photographs, the ship is farther away, as indicated by the decreasing apparent size of the ship. In Figure 5, an inferior mirage is starting to show up. At the edge of the water, you can see a gray line, which is an inferior mirage of the row of gray containers right above the hull. On the right side of the ship, you can see the inferior mirage of the bow. The hull protrudes forward there, and the small white patch just above is a small portion of the forecastle. Notice that the inferior mirage of the bow is inverted, as one would expect. It is difficult to see here, but the lettering on the hull also is undergoing an inferior mirage too. 26) Quoting “Heaven and Earth” by Gabrielle Henriet, “If flying had been invented at the time of Copernicus, there is no doubt that he would have soon realized that his contention regarding the rotation of the earth was wrong, on account of the relation existing between the speed of an aircraft and that of the earth’s rotation. If the earth rotates, as it is said, at 1,000 miles an hour, and a plane flies in the same direction at only 500 miles, it is obvious that its place of destination will be farther removed every minute. On the other hand, if flying took place in the direction opposite to that of the rotation, a distance of 1,500 miles would be covered in one hour, instead of 500, since the speed of the rotation is to be added to that of the plane. It could also be pointed out that such a flying speed of 1,000 miles an hour, which is supposed to be that of the earth’s rotation, has recently been achieved, so that an aircraft flying at this rate in the same direction as that of the rotation could not cover any ground at all. It would remain suspended in mid-air over the spot from which it took off, since both speeds are equal.” 108) The mariner’s compass is an impossible and non-sensical instrument for use on a ball-Earth. It simultaneously points North and South over a flat surface, yet claims to be pin-pointing two constantly moving geomagnetic poles at opposite ends of a spinning sphere originating from a hypothetical molten metal core. If compass needles were actually drawn to the North pole of a globe, the opposing “South” needle would actually be pointing up and off into outer-space. As with the Chicago skyline, there are many images on the internet, usually videos, of ships some distance away in which their hulls are visible. Many of these are taken during warm weather, such as late spring and summer, when the water is likely to be much cooler than the air, producing a temperature inversion. However, what would happen if one were to repeat this experiment over water that is warmer than the air temperature? Since there is no temperature inversion, the hulls of ships ought to disappear. This condition is likely to prevail on cool days in late autumn and early winter, when water temperatures are higher than air temperatures. These conditions also can produce inferior mirages, though not nearly as pronounced as over land on sunny summer days. 42) In the ball-Earth model Antarctica is an ice continent which covers the bottom of the ball from 78 degrees South latitude to 90 and is therefore not more than 12,000 miles in circumference. Many early explorers including Captian Cook and James Clark Ross, however, in attempting Antarctic circumnavigation took 3 to 4 years and clocked 50-60,000 miles around. The British ship Challenger also made an indirect but complete circumnavigation of Antarctica traversing 69,000 miles. This is entirely inconsistent with the ball model. ```How is it possible to see day and night at the same time on a globe? Wouldn't the curve prevent you from seeing the moon since it would be in the other side of the globe? And how can you see the moon over the FLAT ocean while also seeing the sunrise? In the following video you will see day and night clearly divided on a flat plane! You will see an airplane flying level on a flat earth with day and night divided. Watch as it becomes night and the day again as the airplane catches up with the sun. The airplane however never dips is nose down to compensate for the curve. The sun is also shown to be illuminating locally and the light follows is as it moves away on the flat earth, creating day and night. ``` Hey Eric could you write something about Androgynous/(Hermaphroditic) agenda? I saw something about it in book cutting throug the matrix by Allan Watt and I am very interested in this subject. Nowadays all jewish/iluminat governments support transsexualism and indoctrinated children in schools so i think what Allan Watt write about freemasonery plan to build new human, androgynous, brainless, bee-worker is true. 60.) There is no problem more important to the astronomer than that of the Sun's distance from the Earth. Every change in the estimate changes everything. NOW, since modern astronomers, in their estimate of this distance, have gone all the way along the line of figures from three millions of miles to a hundred and four millions – today, the distance being something over 91,000,000; it matters not how much: for, not many years ago, Mr. Hind gave the distance, "accurately," as 95,370,000! – it follows that they don't know, and that it is foolish for anyone to expect that they ever will know, the Sun's distance! And since all this speculation and absurdity is caused by the primary assumption that Earth is a wandering, heavenly body, and is all swept away by a knowledge of the fact that Earth is a, plane, it is a clear proof that Earth is not a globe. Consider a sphere. Since a sphere has a consistent shape, no matter where on it you stand, you have exactly the same amount of sphere under you. (Imagine an ant walking around on a crystal ball. From the insect's point of view, the only indication of movement would be the fact the ant is moving its feet—the shape of the surface would not change at all.) A sphere's center of mass is in the center of the sphere, which means gravity will pull anything on the surface of the sphere straight down toward the center of the sphere. This will occur no matter where on the surface the object is located. ```49) If Earth were a spinning ball heated by a Sun 93 million miles away, it would be impossible to have simultaneously sweltering summers in Africa while just a few thousand miles away bone-chilling frozen Arctic/Antarctic winters experiencing little to no heat from the Sun whatsoever. If the heat from the Sun traveled 93,000,000 miles to the Sahara desert, it is absurd to assert that another 4,000 miles (0.00004%) further to Antarctica would completely negate such sweltering heat resulting in such drastic differences. ``` It is well known that the law, regulating the apparent decrease in the size of objects as we leave them in the distance (or as they leave us) is very different with luminous bodies from what it is in the case of those which are non-luminous. Sail past the light of a small lamp in a row-boat on a dark night, and it will seem to be no smaller when a mile off than it was when close to it. Proctor says, in speaking of the Sun: "his apparent size does not change!" - far off or near. And then he forgets the fact! Mr. Proctor tells us, subsequently, that, if the traveler goes so far south that the North Star appears on the horizon, "the Sun should therefore look much larger" - if the Earth were a plane! Therefore, he argues, "the path followed cannot have been the straight course," - but a curved one. Now, since it is nothing but common scientific trickery to bring forward, as an objection to stand in the way of a plane Earth, the non-appearance of a thing which has never been known to appear at all, it follows that, unless that which appears to be trickery were an accident, it was the only course open to the objector - to trick. (Mr. Proctor, in a letter to the "English Mechanic" for Oct. 20,1871, boasts of having turned a recent convert to the Zetetic Philosophy by telling him that his arguments were all very good, but that "it seems as though [Mark the language!] the sun ought to look nine times larger in summer." And Mr. Proctor concludes thus: "He saw, indeed, that, in his faith in "Parallax," he had "written himself down an ass.") Well, then: trickery or no trickery on the part of the objector, the objection is a counterfeit - a fraud - no valid objection at all; and it follows that the system which does not purge itself of these things is a rotten system, and the system which advocates, with Mr. Proctor at their head, a weapon to use - the Zetetic philosophy of "Parallax" - is destined to live! This is a proof that the Earth is not a globe. The Newtonian theory of astronomy requires that the Moon "borrow" her light from the Sun. Now, since the Sun's rays are hot and the Moon's light sends with it no heat at all, it follows that the Sun and Moon are "two great lights," as we somewhere read; that the Newtonian theory is a mistake; and that, therefore, we have a proof that the Earth is not a globe. 45) On a ball-Earth, Johannesburg, South Africa to Perth, Australia should be a straight shot over the Indian Ocean with convenient re-fueling possibilities on Mauritus or Madagascar. In actual practice, however, most Johannesburg to Perth flights curiously stop over either in Dubai, Hong Kong or Malaysia all of which make no sense on the ball, but are completely understandable when mapped on a flat Earth. The evidence for a flat earth is derived from many different facets of science and philosophy. The simplest is by relying on ones own senses to discern the true nature of the world around us. The world looks flat, the bottoms of clouds are flat, the movement of the Sun; these are all examples of your senses telling you that we do not live on a spherical heliocentric world. This is using what's called an empirical approach, or an approach that relies on information from your senses. Alternatively, when using Descartes' method of Cartesian doubt to skeptically view the world around us, one quickly finds that the notion of a spherical world is the theory which has the burden of proof and not flat earth theory. aking our ideal point of departure to be at Valentia, we consider ourselves at St. John's, the 1665 miles of water between us and Valentia would just as well "curvate" downwards as it did in the other case! Now, since the direction in which the Earth is said to "curvate" is interchangeable – depending, indeed, upon the position occupied by a man upon its surface – the thing is utterly absurd; and it follows that the theory is an outrage , and that the Earth does not "curvate" at all: – an evident proof that the Earth is not a globe. 25.) The surveyor's plans in relation to the laying of the first Atlantic Telegraph cable, show that in 1665 miles – from Valentia, Ireland, to St . John's, Newfoundland – the surface of the Atlantic Ocean is a LEVEL surface – not the astronomers' "level," either! The authoritative drawings, published at the time, are a standing evidence of the fact, and form a practical proof that Earth is not a globe.
4,210
19,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.59375
3
CC-MAIN-2019-39
latest
en
0.936418
http://www.odhady-zlin.cz/AH32-plate/97008ea2704175.html
1,660,400,633,000,000,000
text/html
crawl-data/CC-MAIN-2022-33/segments/1659882571959.66/warc/CC-MAIN-20220813142020-20220813172020-00364.warc.gz
87,602,933
7,456
### Calculate Yardage for a Window Curtain DoItYourself Dec 30, 2009 · If you choose a thick fabric, your curtain width should be 1 ½ times the width of the window. Generally, the fabric is measured two times the width of the window. Calculate the Width You Need Multiply the width of the window by 1½ to 3. Chart for figuring additional yardage for Repeat patternsFor example:The yardage estimate is 8 yards of 54" wide fabric to cover a chair and the pattern on the fabric repeats horizontally every 17" and vertically every 10". Add up the repeats (17" + 10" = 27") and find the appropriate entry - 20% in this example.
154
623
{"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-2022-33
latest
en
0.845892
https://documents.pub/document/programming-c-bca-code-bca-04-i-c-bca-code-bca-04-181-merge-sort-in.html
1,713,427,098,000,000,000
text/html
crawl-data/CC-MAIN-2024-18/segments/1712296817200.22/warc/CC-MAIN-20240418061950-20240418091950-00519.warc.gz
193,487,636
108,063
Home > Documents > PROGRAMMING C BCA CODE: BCA -04 I SEMESTERsaintangelos.com/.../BCA/SEM_I/KSOU_PROGRAMMING_C.pdf ·... # PROGRAMMING C BCA CODE: BCA -04 I SEMESTERsaintangelos.com/.../BCA/SEM_I/KSOU_PROGRAMMING_C.pdf ·... Date post: 28-Mar-2018 Category: View: 245 times 225 1 KSOU PROGRAMMING C St. Angelo’s Professional Education PROGRAMMING C BCA CODE: BCA -04 I SEMESTER Transcript 1 KSOU PROGRAMMING C St. Angelo’s Professional Education PROGRAMMING C BCA CODE: BCA -04 I SEMESTER 2 KSOU PROGRAMMING C St. Angelo’s Professional Education Course writer: C. SUBA VELS UNIVERSITY, ASST. PROFESSOR, DEP. OF COMPUTER SCIENCE, GAYATHRI HOMOEO CLINIC, AYYPATHAGAL, CHENNI-600056 3 KSOU PROGRAMMING C St. Angelo’s Professional Education CONTENTS MODULE 1 Page No. Unit 1 Algorithms and Flowchart 6 Unit 2 Constants Variables and Data Types 29 Unit 3 Operators and Expressions 47 Unit 4 Managing Input and Output Operations 71 MODULE 2 Unit 1 Decision Making and Branching 85 Unit 2 Decision Making and Looping 105 Unit 3 Arrays 122 MODULE 3 Unit 1 User Defined Functions 138 Unit 2 Functions 159 Unit 3 Pointers 171 Unit 4 Structures and Unions 187 Unit 5 File Management in C 205 4 KSOU PROGRAMMING C St. Angelo’s Professional Education PROGRAMMING IN C Subject Code: BCA13 Number of Credit Hours: MODULE 1 UNIT-1 ALGORITHMS AND FLOWCHART Algorithms, flowcharts, Divide and conquer strategy, Writing algorithms and flow charts for simple exercises. UNIT-2 CONSTANTS VARIABLES AND DATA TYPES Character Set, C tokens, Keywords and identifiers, Constants, Variables, Data types, Declaration of variables. OPERATORS AND EXPRESSIONS UNIT-3 Arithmetic Operators, Relational Operators, Logical Operators, Assignment Operators, Increment and Decrement Operators, Conditional Operators, Bitwise Operators, Special Operatrs,Arithmetic Expression, Evaluation of Expression, Precedence of Arithmetic Operators, Type Conversion in Expressions, Operators Precedence and Associatively. MODULE 2 UNIT-1 DECISION MAKING AND BRANCHING Decision Making with If Statements, Simple If Statements, The If Else Statements, Nesting of Else Statements, The Else If Ladder, The Switch Statement, The ?: Operator, The Goto Statement. UNIT-2 DECISION MAKING AND LOOPING The While Statement, The Do Statement, The For Statement, Jumps in Loops. 5 KSOU PROGRAMMING C St. Angelo’s Professional Education ARRAYS UNIT-3 One Dimensional Arrays, Declaration of One Dimensional Array, Initialization of One Dimensional Array, Two-Dimensional Arrays, Declaration of Two Dimensional Arrays, Initialization of Two Dimensional Arrays, Example Programs. MODULE 3 UNIT-1 USER DEFINED FUNCTIONS Need for User-Defined Function, A Multi Function Program, Elements of User Defined Functions, Definition of Functions, Return Values and Their Types, Function Calls, Function Declaration. UNIT-2 FUNCTIONS Category of Functions, No Arguments and No Return Values, Arguments but No Return Values, Argument with Return Values, No Argument but Returns a Value, Function that Return Multiple Values. UNIT-3 POINTERS Understanding Pointers, Accessing the Address Space of a Variable, Declaring and Initialization Pointer Variables, Accessing a Variable through its Pointers, Pointer Example Programs. UNIT-4 STRUCTURES AND UNIONS Definition, Creation, Manipulation. UNIT-5 FILE MANAGEMENT IN C Different File Management Operations in C, Programming Examples. 6 KSOU PROGRAMMING C St. Angelo’s Professional Education MODULE-1 7 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-1 8 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 1 ALGORITHMS AND FLOWCHART CONTENTS 1.1 Aims and Objectives 1.2 Introduction 1.3 What is Algorithm with Example 1.4 Study of Algorithm 1.5 Pseudocode for Algorithm 1.6 Flowchart 1.6.1 Definition of flowchart 1.6.2 Benefits of using flowchart 1.6.3 Symbols used in flowchart 1.6.4 Rules for creating flowchart 1.6.6 Limitations of flowchart 1.7 Pseudocode Example 1.8 Divide and Conquer Strategy 1.8.1 Merge Sort 1.9 Writing algorithms and flow charts for simple exercises 1.10 Let us Sum up 1.11 Lesson and Activity 1.12 Keywords 1.13 Questions for Discussion 9 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.1 AIMS AND OBJECTIVES At the end of this chapter you will learn to, Explain the concept of Algorithms and Pseudocode Define Flowchart, Benefits, and Symbols, Rules for Creating Flowchart, Advantages A Study on Divide and Conquer Strategy with Example Writing algorithms and Flowcharts for Exercises 1.2 INTRODUCTION Algorithm “why do we need to study algorithm”? If you want to be a computer professional, there are both practical and theoretical reasons to study algorithm. From a practical point of view, you should know the standard set of important algorithms from different areas of computing; In addition, you should be able to design new algorithms and analyze their efficiency. From the theoretical standpoint the study of algorithms, sometimes called algorithms. Another reason to study algorithms is the usefulness in developing analytical skills. After that, algorithms can be seen as special kinds of solutions for the problems, but precisely defined procedures for getting answers.Consequently,specific algorithm design techniques can be interpreted and involved course the precision inherently imposed by algorithmic thinking limits the kinds of problems than can be solved with an algorithm. In the 1930s, before the advent of computers, mathematicians worked very actively to formalize and study the notation of simple instructions were given for solving a problem or computer as a solution. Various formal modes of computation were desired and investigated. Much of the emphasis in the early work in this field computability theory was on describing and characterizing those problems that could be solved algorithmically and on exhibiting some problems that could not be solved. One of the important negative results was insolvability of the “halting problem”. The halting problem is to determine whether an arbitrary given algorithm (or computer program) will eventually halt (rather than, say get into an infinite loop) while working on a given input. 1.3 WHAT IS ALGORITHM WITH EXAMPLE An algorithm is a sequence of unambiguous instructions for solving a problem that is a sequence of computational steps that transform them input into the output. 10 KSOU PROGRAMMING C St. Angelo’s Professional Education An algorithm has the following properties: 1. Input: The algorithms get input. 2. Output: The algorithms produce output. 3. Definiteness: Each instruction to represent with clear & unambiguous. 4. Finiteness: The algorithm terminates; that is it terminates after finite number of steps. 5. Correctness: The produced output by the algorithm is correct. NOTATION OF ALGORITHM Problem Problem i/p o/p Computer FIGURE 1.1 EXAMPLE Consider the given algorithm to find the largest of three numbers x, y and z. Step 1: Start the program Step 2: Read the value x, y and z Step 3: To compare ((x>y) and (x>z)) then print x else if(y>z) print y else print z Step 4: Stop the program Thus in the given above algorithm, consider the first step is to start the program, the second step to read the values of x, y and z and after that compare the first number with second number and also compare the first number with third number, if the condition is true then print the value of first number else compare the second number with third number if the condition is satisfied then display the second number otherwise display the third number. 11 KSOU PROGRAMMING C St. Angelo’s Professional Education FUNDAMENTALS OF ALGORITHMIC PROBLEM SOLVING The given figure shows the sequence of steps in arithmetic problem solving Understand the problem Design on algorithm design technique Design an algorithm Prove Correctness Analyse the Algorithm Code the Algorithm FIGURE 1.2 The first step in algorithm problem solving is to understand the complexity of the problem given. The fundamental importance of both algorithms and data structures for computer programming is very userful.An algorithm design techniques(or “strategy” or “paradigm”) is a general approach for solving problems algorithmically that is applicable to a variety of problems from different area of computing. There are two methods used for designing an algorithm. 1. Pseudocode 2. Flowchart A pseudocode is a mixture of a natural language is usually more precise than a natural language and its usage often yields more succient algorithm description.Pseudocode for the statement used such as for, if and while and also used for assignment operation two slashes In the second approach for specifying algorithms was a flowchart, a method of expressing an algorithm by a collection of connected geometic shapes containing descriptions of the algorithms steps. Once an algorithm has been specified, you have to prove its correctness. That is you have to prove that the algorithm yields a required result for every legitimate input in finite amount of time. 12 KSOU PROGRAMMING C St. Angelo’s Professional Education After correctness, by far the most important is efficiency. In fact, there are two kinds of algorithmic efficiency: time efficiency and space efficiency. Time efficiency indicates how fast the algorithm runs; space efficiency indicates how much extra memory the algorithm needs. Another desirable characteristic of an algorithm is simplicity and generality. Two issues have; in generality of the problem the algorithm solves and the range of inputs it accepts. On the first issue, note that it is sometimes easier to design an algorithm for a problem posed in more general terms. Consider for example, the problem for determining whether two integers are relatively prime. Most algorithms are designed to be ultimately implemented as a computer programs. 1.4 STUDY OF ALGORITHM There are four distinct areas to know about algorithms includes, 1. How to devise algorithms 2. How to validate algorithms 3. How to analyze algorithms 4. How to text a program 1. HOW TO DEVISE ALGORITHMS To create an algorithm, it may never fully optimized. One of the major goals of an algorithm is to use variety of designing techniques to yield good algorithms. By using dynamic programming techniques, it is used to devise an algorithm (i.e. devise means divided) in a good manner. 2. HOW TO VALIDATE ALGORITHMS After devising the algorithm, the next field is validating the algorithms. Thus computer will produce correct result for all possible legal inputs. 3. HOW TO ANALYSE ALGORITHMS Analysis of algorithm is an important part of computer system. It is used to determine the amount of resources such as time and storage necessary to execute. An algorithm can be given in many ways. For example, it can be written down in English or French or any other natural language. 4. HOW TO TEST A PROGRAM Testing a program consists of two phases: debugging and profiling (or performance measurement).Debugging means to identify errors in a program. Performance measurement is the process of executing a correct program, it measure time and space it takes to compute the results. 13 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.5 PSEUDOCODE FOR ALGORITHMS Pseudocode is nothing but the actual code of computer languages such as C, C++ and Java. Let us differentiate between the algorithm and program. Algorithm is a sequence of unambiguous instructions but program means it represents more precise and concise notations called a program. Another way to represent pseudocode is one of the tools that can be used to write a preliminary plan that can be developed into a computer program. Pseudocode is a generic way of describing an algorithm without use of any specific programming language syntax. EXAMPLE To write pseudocode for sum of three numbers using sequence structure Step 1: Start the program Step 2: Initialize the variables sum, number1, number2, number3 of type integer Step 3: Read number1, number2 and number3 Step 4: Calculate sum=number1+number2+number3 Step 5: Print sum Step 6: End the program 1. What is an algorithm? Define its properties. ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. Write an algorithm to find largest of three numbers. …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 14 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.6 FLOWCHART 1.6.1 DEFINITIONS OF FLOW CHART A flow chart is a graphical or symbolic representation of a process. Each step in the process is represented by a different symbol and contains a start description of the process. 1.6.2 BENEFITS OF USING FLOWCHART Correct process understanding Provide tools for training Identify problem areas and improvement opportunities To describe the customer-supplier relationships 1.6.3 SYMBOLS USED IN FLOWCHART The following symbols that are commonly used in flowcharts they are, 1. OVAL/TERMINATOR: Ovals indicates both the start and end of the process. 2. BOX/PROCESS: A Rectangular flow shape indicates the activity in the process. 3. DIAMAND/DECISION: Diamonds indicates the decision point, such as yes/no or on/off or go/not go. 4. CIRCLE/CONNECTOR: A circle indicates the particular step is connected to another page or part of the flowchart. 5. TRIANGLE/DATA: A triangle indicates data input or output (I/O) for a process. 6. DOCUMENT: A document is used to indicate a document or report. 7. FLOW LINE/ARROW/CONNECTOR: An Arrow indicates to show the direction that the process flows. 8. PREDEFINED PROCESS: A predefined process is used to indicate a subroutine or interrupt program. 15 KSOU PROGRAMMING C St. Angelo’s Professional Education The given table represents symbol, symbol name and function of flowchart. S.No SYMBOL SYMBOL NAME FUNCTION 1 Start/end Oval/Terminator Start/end 2 Process Box/Process Activity in the Process 3 N D Y Diamond/Decision Indicating a Decision Point 4 C Circle/Connector The Particular Step is Connected to Another Page 5 Data Triangle/Data Data Input/Output(I/O) for a Process 6 Document Document Indicating a Document or Report 7 Arrow/Connector Direction of Process Flow 8 Predefined Process Predefined Process Invoke a Subroutine or Interrupt Program 16 KSOU PROGRAMMING C St. Angelo’s Professional Education The following flow chart shows the symbolic representation of flow diagram. Start Terminator Process No Decision Data Yes Document Stop Terminator 1.6.4 RULES FOR CREATING FLOWCHART 1. All boxes in the flowchart are connected with arrows 2. Flowchart symbols have an entry point on the top of the symbol only. The exit point for all flowchart symbols is on the bottom except for decision making 3. Decision symbol have two exit points: Yes/no or true/false or on/off 4. Flow chart will flow from top to bottom 5. Connectors are used to connect with 3 manners, 1. from one page to another page 2. from the bottom of the page to the top of the same page 3. Upward flow of more than 3 symbols 17 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. COMMUNICATION: Flowchart is used for better way of communication in all connections. 2. EFFECTIVE ANALYSIS: By using flowchart, problems are analyzed in better manner. 3. PROPER DOCUMENTATION: Flowchart serves as good program documentation. 4. EFFICIENT CODING: The flowcharts act as a guideline during the system analysis and development phase. 5. PROPER DEBUGGING: The flowchart helps in debugging process. 6. EFFICIENT PROGRAM MAINTENANCE: The maintenance of operating program Is an easy way for drawing the flowchart. 1.6.5 LIMITATIONS OF FLOWCHART Some of the limitations of flowchart are, 1. COMPLEX LOGIC: The program logic is very complicated; in this manner drawing flowchart is difficult 2. ALTERATIONS AND MODIFICATIONS: Alteration and modifications cannot be made and hence flowchart is very complex process 3. REPRODUCTION: In flowchart, symbols cannot be typed, hence it becomes a problem 1.7 PSEUDOCODE EXAMPLE To write pseudocode for to prepare a student mark sheet processing using control statement Step 1: Start the program Step 2: Initialize the variables rollno, stud_name, m1, m2, total, Average and result Step 3: Read the values for rollno, stud_name, m1, m2 Step 4: To calculate total=m1+m2 Step 5: To calculate average=total/2 18 KSOU PROGRAMMING C St. Angelo’s Professional Education Step 6: To calculate result based on two subjects if(m1>40) and (m2>40) then print result=”pass” else end if print result=”fail” Step 7: Print rollno,stud_name,m1,m2,total,average and result Step 8: Stop the program 1.8 DIVIDE AND CONQUER STRATEGY A divide and conquer strategy process is given below. If the problem is small it‟s solved directly. If the problem is large, it‟s divided into two or more parts called subprograms. Each subprogram is solved after solutions to the subproblems are combined into a solution to the original problem. The divide and conquer strategy is used in same process that is to solve the subproblems are further divided into several subproblems and so on. The solutions to the various subproblems are the combined into a solution to the original problem. Recursion is a method it is used to solve a subprogram. An example is array. An array of two or more elements can be sorted by using a divide and conquer strategy. In this manner to use merge sort method for the sorted array of elements where it combines into original elements. DIVIDE: Divide the n-element sequence to be sorted into two subsequences of n/2 elements each. CONQUER: Sort the two subsequences recursively that is by using merge sort again on the Subsequences. Merge sorts on latter. A COMBINE: Merge the two sorted subsequences to produce the sorted answer. Merge sort follows divide and conquer strategy 1.8.1 MERGE SORT Consider the array of ten element a[1:10]=(17,14,82,12,50,74,68,15).In merge sort method by splitting number of elements into two subarrays each of size is four a[1:4] and a[5:8].The elements in a[1:4] are then split into two subarray of size two (a[1:2]) and another (a[3:4]).The same manner element split into right on the side split into two subarray of size two (a[5:6]) and another (a[7:8]).Sort all the sub array of elements after merging into two sub array of elements. Finally, the elements are resulted in sorting manner. KSOU PROGRAMMING C St. Angelo’s Professional Education 1,8 19 The Structure of Merge Sort: 1,8 1,4 5,8 1,2 3,4 5,6 7,8 1, 1 2, 2 3, 3 4, 4 5,5 6,6 7,7 8,8 Merge Sort-Visual Example Take eight elements in a list 17 14 82 12 50 74 68 15 Divide the list into two sublists 17 14 82 12 50 74 68 15 Sublist1 Sublist2 Splitting sublists into smaller sublists until we can‟t split any further, 17 14 82 12 50 74 68 15 We can swap the element until the sorted order 14 17 12 82 50 74 15 68 We can repeat the process again until two sublists in sorted order Sorted sublist-1 Sorted sublist-2 12 14 17 82 15 50 68 74 20 KSOU PROGRAMMING C St. Angelo’s Professional Education We can merge sorted sub list together so that we can get original list of sorted element 12 14 17 50 68 74 68 82 Merge Sort Pseudocode The mergesort algorithm can be written very simply as given below, Mergesort(list[],leftindex,rightindex) Begin End If leftindex<rightindex then mid=(leftindex+rightindex)/2 mergesort(list[],leftindex,mid) mergesort(list[],mid+1,rightindex) merge(list[],leftindex,mid,rightindex) end if Once the array is recursively split into single elements is recursively split into single element list (14,17,12,82,50,74,15,68) the recursion algorithm with sort the individual arrays and combine them .Here,17,14 are not sorted order. Graphical representation of above example, 17 14 82 12 50 74 68 15 17 14 82 12 50 74 68 15 17 14 82 12 50 74 15 68 14 17 12 82 50 74 15 68 21 KSOU PROGRAMMING C St. Angelo’s Professional Education Once the array is recursively split into two list, first list are(17,14,88,12) and the second list is(50,74,68,15) by using recursion algorithm will sort the individual arrays and combine them are(12,14,15,17,50,68,74,82).Here first sorted element are 14 and 17 in the first sublist after sorted elements are 12 and 82 in the sublist, after sorted the element are 50 74 in the second sublist finally 15 and 68 already sorted order in second sublist. Finally combine the sorted elements. Merging the two sorted elements for graphical representation, 14 17 12 82 50 74 15 68 14 17 12 82 50 74 15 68 12 14 17 82 15 50 68 74 12 14 15 17 50 68 74 82 The final array is the array which contains the sorted elements. SUITABILITY Merge sort is good for data having big memory at once, because its pattern of storage access is very regular. It uses even fewer comparisons than heap sort, and is especially suited for data stored as linked list. Slightly faster than the heap sort for larger sets It is suitable sort It requires twice the memory of the heap sort because the second array is used to store the sorted list. Like the quick sort, the merge sort is recursive which can makes it as a bad choice for applications that run on machines with limited memory. 22 KSOU PROGRAMMING C St. Angelo’s Professional Education COMPLEXITY The sorting method in merge sort involves sorting of two equal parts of array and combing two sorted lists into one sorted list. Let T (N/2) is the time taken to sort each half part of array and N is time required to combine two sorted lists into a single sorted list. Then T(N)=T(N/2)+T(N/2)+N =2T (N/2)+N T(N)/N=T(N/2)/N/2+1 Assume the total number of elements N is power of 2,such that N=2M(i.e., M=log2N),there are M steps to add since the array is divided into exactly half. So, T(N)/N=T(1)/1+Clog2N T(N)=N+CNlog2N =O (Nlog2N) The complexity of merge sort in worst case is O (Nlog2N) 1.9 WRITING ALGORITHMS AND FLOWCHARTS FOR SIMPLE EXERCISES EXAMPLE 1 Write an algorithm to determine a student‟s final grade and indicate whether it is passing or failing. The final grade is calculated as the average of four marks. ALGORITHM Step 1 : Start the program Step 2 : Input m1,m2,m3,m4 Print “FAIL” else Print “PASS” end if Step 5 : Stop the program. 23 KSOU PROGRAMMING C St. Angelo’s Professional Education FLOWCHART START INPUT M1,M2,M3,M4 N IS Y PRINT “PASS” PRINT “FAIL” STOP EXAMPLE 2 Write an algorithm and draw a flowchart that will read the two sides of a rectangle and calculate area. ALGORITHM Step 1: Start the program Step 2 : Input width and length Step 3: Calculate Area- length*width Step 4: Print Area Step 5: Stop the program 24 KSOU PROGRAMMING C St. Angelo’s Professional Education FLOWCHART START INPUT LENGTH,WIDTH AREALENGTH, WIDTH PRINT “AREA” STOP EXAMPLE 3 Write an algorithm that reads two values, determines the largest value and print message largest value. ALGORITHM Step 1: Start the program Step 2 : Input value1,value2 Step 3: if (value1>value2) then maxvalue1 else maxvalue2 end if Step 4: Print “The Largest Value is:”, Max Step 5: Stop the Program 25 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. Define flowchat? And mention the rules for creating flowchart. ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… FLOWCHART START INPUT VALUE1,,VALUE2 IS VALUE1>VAUE2 MAXVALUE1 MAXVALUE2 STOP 1.10 Let us Sum Up An algorithm is a sequence of unambiguous instructions Algorithm has some properties such as input,output,definiteness,finiteness,correcteness Pseduocode is nothing but the actual code of computer languages. Flowchart is a graphical representation of process Divide and Conquer strategy is a process Divide means divide the problem in n-element of sublist 26 KSOU PROGRAMMING C St. Angelo’s Professional Education Conquer means sorting the n-element sequence Merge means two sorted sub list can be combined. 1.11 LESSIONS END ACTIVITIES 1. Fill in the Blanks A. An algorithm is_ . B.Algorithm can be specified in a natural language or a _ . C.Flowchart is a . D. An array of two or more elements can be sorted by using a Strategy. 2.1 Explain different symbols and function of flowchart. 2.2 Write an algorithm and draw flow chart that will be area of circle and square. 2.3 Explain in detail about divide and conquer strategy with example. 2.4 Explain detail about fundamentals of algorithmic problem solving process. 1.12 KEYWORDS An Algorithm is a sequence of no ambiguous instructions for solving a problem in a finite amount of time. Algorithm can be specified in a natural language or a psudocode Several ways to classify algorithms - Algorithms according to types of problems they solve. - Algorithms according to underlying design techniques. Algorithms Design Techniques (or design strategies or paradigms) are general approaches for solving problems algorithmically. A Good Algorithm is usually a result of repeated efforts and rework. Algorithms Operate on data. A Flowchart is a graphical or symbolic representation of a process. Oval Ovals indicates both the start and end of the process. Rectangle A Rectangular flow chart shape indicating activity in the process. Diamond A Diamond indicating decision point. 27 KSOU PROGRAMMING C St. Angelo’s Professional Education Arrow indicates show the direction that the processes flow. Document A Document is used to indicate a document or report. Ans 1 1. An algorithm is a sequence of unambiguous instructions for solving a problem . Algorithm has the following properties: 1. Input: The algorithm get input 2. Ouput: The algorithm produces output 3. Difiniteness: Each instruction to represent with clear and unambiguous 4. Finiteness: The algorithm terminates that is it terminate after finite number of steps 5. Correctness: The produced output by the algorithm is correct 2. Step 1: Read x, y, z Step 2: To compare ((x>y) and (x>z)) print x elseif(y>z) print y Ans 2 else print z 1. A flowchart is a graphical representation Rules for creating Flowchart: 1. All boxes of the flowchart are connected with arrows 2. Flowchat symbols have an entry point and exit point 3. Decision symbol have two exit points 4. Flow chart will flow from top to bottom 5. Connectors are used to connect with same or other pages of flow 2.(i) The advantages of flowchart are, 1. Communication 2.Effective Analysis 3. Proper Communication 4.Effective Coding 4. Proper Debugging 5.Efficient Program (ii)Limitations of flow chart are, 1. Complex Logic 2.Alterations and Modifications 3. Reproduction 28 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.13 QUESTIONS FOR DISCUSSION 1. What is an algorithm? Give its properties and explain with example. 2. Write short notes on: a. Different distinct areas of algorithm b. Steps for creating and designing algorithm 3. What is flowchart? Briefly explain different symbols used in flowchart with Example. 4. Discuss the following a. Rules for creating flowchart c. Limitations of flowchart 5. Briefly explain techniques of divide and conquer strategy. 29 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. Fundamentals of Computer Algorithms-Ellis Horowitz,Sartaj Sahni and Sanguthevar Rajasekaran,Galgotia Publications Pvt Ltd. 2. Computer Algorithms-Sara Baase, Allen Van Gelder,thrid edition-Pearson Education. 3. Algorithms-David Harel, Second Edition-Pearson Education. 4. Introduction to Algorithms, Cormen, Charless E.Leiserson,Ronald L.Rivest,Clifford Stein,PHI. 5. Design and Analysis of Algorithms, Dexter C.Kozen-Springler-Verlag. 30 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-2 31 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 2 CONSTANTS VARIABLES AND DATA TYPES CONTENTS 2.1 Aims and Objectives 2.2 Introduction 2.3 Characteristics of C 2.4 Current uses of C 2.5 Format of C Program 2.6 Features of C 2.7 C Character Set 2.8 C Tokens and Examples 2.9 Identifiers and Keywords 2.10 Constants 2.11 Variables 2.12 Data Types 2.13 Declaration of variables 2.14 Let us Sum up 2.15 Lesson and Activities 2.16 Keywords 2.17 Questions for Discussion 32 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.1 AIMS AND OBJECTIVES At the end of this chapter you will learn, how to: Describe the characteristics and uses of C Understand format of C program with features and examples Describe C Character Set and tokens Identify constants and data types Appreciate the need of declaration of variables. 2.2 INTRODUCTION The C programming language was developed by Dennis Rictchie in Bell Telephone Laboratories in early 1970‟s.Usage of this language was largely confined to Bell Laboratories until 1978, when Brian Kernighan and Dennis Ricthie described the C programming language. The original form of the C language is referred to as K & RC. A programming language is designed to help process certain kinds of data consisting of numbers, characters and string and to provide useful output known as information. The task of processing the data is accomplished by executing a sequence of precise instructions called a program. These instructions are formed using certain symbols and words according to some rigid rules known as syntax rules (or grammar).Every program instruction must confirm precisely to the syntax rules of the language. 2 .3 CHARACTERISTICS OF C C has a variety of language characteristics that contains large consequence of the original constructed development, original constructed development environment and its original applications implementation of an operating system. Some of the most significant characteristics of the languages are listed below: 1. SIZE OF LANGUAGE C is an externally small language does not have any built-in input/output capabilities it contains no string handling functions and arithmetic operations beyond those such as basic addition or subtraction provides this functionality through a rich set of function libraries. Most C implementations include standard libraries for input/output, string manipulations and arithmetic operations is characterized by the ability to write concise source programs program use and extensive usage of function calls programs are highly portable. 33 KSOU PROGRAMMING C St. Angelo’s Professional Education 2. MODERN CONTROL STRUCTURES C contains all the control structures expected in a modern language. For loops, if-else constructs, case (switch) statements, and while loops are all part of the language. 3. BITWISE CONTROL To perform systems programming, it is frequently necessary to manipulate the objects at the bit level.C provides variety of operators for bitwise manipulation of data. 2.4 CURRENT USES OF C C is used for system applications and it is language of choice to most UNIX users. A Systems program forms a portion of the operating system of the computer or its support utilities. System programs include: 1. Operating System 2. Interpreters 3. Editors 4. Assembly Programs 5. Compilers Because of its portability and efficiency C is also used in a variety of applications running under nearly all operating systems. The C language is used for developing Database Systems Graphics Packages Word Processors Office Automations Scientific & Engineering Applications 34 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.5 FORMAT OF C PROGRAM A Program written in the C language must have a few basic components. The format of C program given below, void main() { Variable declaration; Program statements; } Variable Declaration All variable used in C language programs must declared C variable declarations include the name of the variable and its types. Program Statements Program statements or executable statements must have variable declarations. An executable statement is an expression followed by semicolon or a control construct such as IF or a WHILE statement. Most program and supporting functions contain program comments whose purpose is to make the program more understandable. Program comments may contain any message starting with the charter sequence “/* and ending with the sequence “*/”. A SAMPLE C PROGRAM EXAMPLE 1 #include<stdio.h> void main() { printf(“Welcome to C Programming:\n”); } Sample Program Output Welcome to C Programming EXAMPLE 2 #include<stdio.h> void main() { printf(“Programming in C is easy \n”); printf(“and also Programming in C++.”); } 35 KSOU PROGRAMMING C St. Angelo’s Professional Education Sample Program Output Programming in C is easy and also Programming in C++. EXAMPLE 3 #include<stdio.h> void main() { printf(“Hello…\n..Oh my \n when do I stop?. \n”); } Sample Program Output Hello… ..Oh my …when do I stop? 2.6 FEATURES OF C The following features can be listed for popularity of C. 1. Portability 2. Flexibility 3. Wide acceptability 4. Modern Control and flow structures 5. Rich set of operators 1. PORTABILITY Program written in these languages can be executed in different computers and operating systems if compilers are available for these systems. The ability of a program is to run in different environments. A different environment refers to different computers, operating systems or different compilers. Machine language or assembly language various from computer to computer and hence programs written in these languages are not portable can be termed as most portable language. 2. FLEXIBILITY C combines the convenience and portable nature of a high-level language with the flexibility of a low-level language. 36 KSOU PROGRAMMING C St. Angelo’s Professional Education 3. WIDE ACCEPTABILITY This language is suitable for projects both at the system-level (building operating system or compilers) and at the application level (building graphical user interfaces). 4. MODERN CONTROL AND FLOW STRUCTURES In C, it can support set of control and flow structures such as if…statement, select case statement. 5. RICH SET OF OPERATORS Programs written in these languages can be executed using set of operators and expressions such as arithmetic operators, logical operators, bitwise and shift operators etc. 2.7 C CHARACTER SET The C character set consists of upper and lower case alphabets, digits, special characters and white spaces. The alphabets and digits are together called as alphanumeric characters. The character set in C are divided into following types: (1)LETTERS 1. Letters 2. Digits 3. Special Characters 4. White Spaces Uppercase A….Z Lowercase a….z (2)DIGITS All decimal digits 0…..9 (3)SPECIAL CHARACTERS 37 KSOU PROGRAMMING C St. Angelo’s Professional Education , Comma . Period ; Semicolon # Number Sign ` Apostrophe ? Question Mark ! Exclamation Mark | Vertical Bar ~ Tilde < Opening angle bracket - Underscore \$ Dollar sign % Percent sign & Ampersand ^ Caret * Asterisk - Minus Sign + Plus Sign > Closing angle bracket ( Left parenthesis ) Right parenthesis [ Left bracket ] Right bracket ( Left bracket ) Right bracket / Slash \ black slash (4)WHITE SPACES Blank space new line carriage return form feed horizontal tab and vertical tab. 2.8 C TOKENS AND EXAMPLES Individual words and punctuation marks are called tokens. In “C Programming” language smallest individual units are called C tokens. The types of tokens are, C TOKENS Keywords Ex: void, char Constants Ex: 14.4,17.20,30 Special Symbol Ex: (),[] Identifiers Ex: area, NPV String Ex: “kumar”,”kavi” Operators Ex: +,-,*,/,<,>,= FIGURE 1.3 38 KSOU PROGRAMMING C St. Angelo’s Professional Education Character 2.9 IDENTIFIERS AND KEYWORDS In C programming language every word/string is classified as identifier or keyword. All keywords have fixed meaning and these meanings cannot be changed. There are certain rules regarding identifier name, are listed below. 1. First character must be an alphabet or underscore. 2. Identifiers must consists of letters, digits or underscore 3. Identifier name should not be the keyword(such as int,float,double,if,else, Const, for, goto) 4. Only allowed name of variable as 3 characters, C is case sensitive (i.e., upper and lower case letters are treated separately 2.10 CONSTANTS In C programming language the fixed values do not change during the execution of a program. In C supports several types of constants are listed below, Constants Numeric Constants Character Constants Integer Constants Real Constants Single Constants String Constants FIGURE 1.4 39 KSOU PROGRAMMING C St. Angelo’s Professional Education Integer Constants Integer constants refer to a sequence of digits. In integer constants can be specified in three ways, 1. Decimal Numbers 2. Octal Numbers For example 25 is a decimal numbers in base 10.In octal numbers are specified with a leading zero, rest of the digits consists of those lying between 0 and 7.For example, 0125.The hexadecimal numbers are specified with ox or OX the beginning. The digits that follow 0x must be numbers in the range 0-9 or one of the letters a-f or A-F.For example, 0x125. An integer constant can be appended at the end of the constant. The suffix u is used for unsigned int constants for long int constants and s for short int constants. Either of the cases can be used. 1. Unsigned integer constants 47424U 47424u 2. Long integer constants 74524L 74524l 3. The suffixes can be combined in any order 647272UL 647272ul 4. Short integer constants 140S 140s 5. Unsigned short integer constants 170S 170s Real Constant In real constants have a decimal point or an exponential sign or both. Decimal Notation The number is represented as a whole number followed by a decimal point and a fractional part. It is possible to omit digits before or after decimal point. 40 KSOU PROGRAMMING C St. Angelo’s Professional Education Valid floating point constants are: 247.0, 0.416,-0.22 and +0.22 Exponential Notation Exponential Notation is useful in representing numbers whose magnitudes are very large or very small. The exponential notation consists of a mantissa and an exponent. The exponent is positive unless preceded a minus sign. Consider the number 472.45.This can also be written as 0.47245e3 representing the number 0.47245×103 .The sequence of 47245 after the decimal point of the number 0.47245 is the mantissa, and 3 is the exponent. Another example, the number 62000000000 can be written as 62e9 or 0.62e-9.Similarly 0.00000000045 can be written as 0.45e-9. EXAMPLE 20.04 4.7e-4 3E8 Single Character Constant A single constant is enclosed within single quotes. EXAMPLE „a‟ „4‟ „\n‟ Note Character constant represents an integer value; it is also possible to perform arithmetic operations. String Constant A string constant is a sequence of character enclosed in double quotes EXAMPLE “WELCOME” “2009” “XYZ” 41 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.11 VARIABLES Variable is a name that can be used to store data value. A variable can have only one value assigned to it any given time during the execution of the program. EXAMPLE MARKS AVERAGE TOTAL Rules for declaring variables Identifiers are used for name of variable A variable name consists of a sequence of letters or digits (i)Valid variable name (1)student_name (2)emp_name (3)mark (ii)Invalid variable name (1)3a (2)salary# (3)student-name 2.12 DATA TYPES Data types are used to store various types of data that is processed by program. Data type attaches with variable to determine the number of bytes to allocate the variable and valid operations which can be performed. It supports various data types such as character, integer and floating point types. 42 KSOU PROGRAMMING C St. Angelo’s Professional Education DATA TYPES CHARACTER INTEGER FLOATING POINT FIGURE 1.5 (i)Character Data Type C Stores character type internally as an integer. Each character has 8 bits. So we can have 256 different character values 0 to 255. (ii)Integer Data Type Integer data types are used to store numbers and characters. Here is the able of integer data type in various forms: Data Type Memory Allocation Range Signed int 1 byte -27 -1(-128 to 127) Unsigned int 1 byte 0 to 28-1(0 to 255) Short 2 bytes -215 to 215 -1(-32768 to 32767) Unsigned short 2 bytes 0 to 216 -1(0 to 65535) Long int 4 bytes 231 to 231 -1(-2147483648 to 2147423647) int 2 or 4 bytes Ranging for 2 or 4 bytes (iii) Floating point data type The floating point data types are used to represent floating point numbers. Floating point data types come in three sizes. Float (single precision) double (double precision) and long double (extended precision). 2.13 DECLARATION OF VARIABLES Declaration of variables in 2 manners, 1. Primary type declaration 2. User-defined type declaration 43 KSOU PROGRAMMING C St. Angelo’s Professional Education Primary Type Declaration A variable can be used to store a value of any data type. That is the name has nothing to do with any data type. SYNTAX Data-type variable name1,variable name2…variable name; EXAMPLE int marks; int rollno,average; double exam-fees; int and double are keywords to represent integer type and real type data values respectively. In the table given below various data types and their keyword equivalents Data types and their keywords Data Type Keyword Equivalent Character Char Unsigned character Unsigned Signed character Signed char Signed short integer Signed short int (or long int or long) Signed long integer Signed long int (or long int or long) Unsigned integer Unsigned int(or unsigned) Unsigned short integer Unsigned short int (or unsigned short) Unsigned long integer Unsigned long int (or unsigned long) Floating point Float Double precision floating point double Extended double precision floating point Long double 44 KSOU PROGRAMMING C St. Angelo’s Professional Education Declaration C supports a feature known as “type definition” that permits users to define an identifier represents an existing data type. SYNTAX typedef type identifier; where, typedef->keyword type->refers to an data type identifier->refers to the name of variable name EXAMPLE typedef float average; typedef int block; Here average declared as float and block declared as int. They can be classified into further manner as, block unit1, unit2; The main advantage of typedef is can create meaningful data type for increasing the 1. What is constant? Explain its types. ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. What is variable? Define rules for creating variable. …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 45 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.14 LET US SUM UP C Programming language was developed by Dennis Rictchie at Bell Telephone laboratories in early 1970s. Various characteristics of C are size of language, modern control structures and bitwise control. C Language used for developing such as database systems, graphics packages, spread sheets, word processing, office automation, scientific and engineering application. The format of C program are variable declaration and program statements/ The following popularity features of C are portabaility,flexibility,wide acceptability, modern control & flow structures, rich set of operators The c character set are divided into following types such as letters, digits, special characters and white spaces. Individual words and punctuation marks are called tokens such as keywords, identifiers, constants, string, special symbol and operators. In C programming every word/string classified into identifier or keyword. Constants in C programming fixed values that do not change during the execution of a program support several types of constants such as numeric constants and character constant. Variable is a name to store data value assigned to a variable during execution of a program. Data types are used to store various types of data that is processed by program. Variable support various data types such as character, integer and floating point types. In C programming declaration of variable in two manners such as primary type declaration and user-defined type declaration. 2.15 LESSION END ACTIVITIES 1. Fill in the Blanks A.C programming language was developed by . B.The alphabets and digits are together called . 46 KSOU PROGRAMMING C St. Angelo’s Professional Education C.Individual words and punctuation marks are called . 47 KSOU PROGRAMMING C St. Angelo’s Professional Education 2. What is meant by variable? Explain declaration of variables with example. 3. Explain different characters of C 4. What is mean by character set? Explain its types. 5. What is a token? Explain its types with example. 2.16 KEYWORDS Character set: Character set consists of upper and lower case alphabets, digits, special characters and white spaces. C Tokens: Individual words and punctuation marks are called tokens. Identifiers: Every word/string classified as identifier or keyword. Constants: Fixed values that do not change during execution of program. Real Constant: In real constants have a decimal point or exponential sign or both. Decimal Notation: The number is represented followed by decimal point and fractional part. String Constant: A string constant is a sequence of character enclosed in double quotes. Variable: A variable name that can be used to store data value. Data types: Data types are used to store various types of data is processed by the program. Single Character Constant: A single constant is enclosed within single quotes. 2.17 QUESTIONS FOR DISCUSSION 1. What are different data types in C? 2. What do you mean by identifier and keywords? 3. What are the applications of C programming? 4. How can we create a C PROGRAM? 5. Write a C program display a message “Programming in C”. 48 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. C programming language fixed values that do not change during execution of a program. Several types of constants are 1. Numeric Constant 2. Character Constant 2. Variable is a name that can be used to store data value. Rules for creating value: Identifiers are used to name of variable. Variable name consists of a sequence of letters or digits. 1. Mastering C by Venugopal, Prasad – TMH 2. Complete reference with C Tata McGraw Hill 3. C – programming E.Balagurusamy Tata McGray Hill 4. How to solve it by Computer : Dromey, PHI 5. Schaums outline of Theory and Problems of programming with C : Gottfried 6. The C programming language : Kerninghan and Ritchie 7. Programming in ANSI C : Ramkumar Agarwal 8. Mastering C by Venugopal, Prasad – TMH 9. Let Us C by kanetkar 10. An introduction to data structures with applications, Jean-Paul Trembly and Paul Sorenson, (2nd edition), 1884 49 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-3 50 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 3 OPERATORS AND EXPRESSIONS CONTENTS 3.1 Aims and Objectives 3.2 Introduction 3.3 Arithmetic Operators 3.4 Unary Operators 3.5 Relational Operators 3.6 Logical Operators 3.7 Assignment Operators 3.8 Increment and Decrement Operators 3.9 Bitwise Operators 3.10 Comma Operators 3.11 Special Operators 3.12 Arithmetic expression 3.13 Evaluation of Expression 3.14 Precedence of Arithmetic Operators 3.15 Type Conversion in Expression 3.16 Operator Precedence and Associativity 3.17 Let us Sum up 3.18 Lesson and Activities 3.19 Keywords 3.20 Questions for Discussion 51 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to; Describe the operators and its types Identify the need of arithmetic expressions Precedence of arithmetic operators Understand the concept of type conversion Need of operator precedence and associativity 3.2 INTRODUCTION C supports different type of operators. In operators is a symbol that operates certain mathematical or logical operations. These operators are being: 1. Arithmetic operators 2. Unary operators 3. Relational operators 4. Logical operators 5. Assignment operators 6. Increment and Decrement operators 7. Conditional operators 8. Bitwise operators 9. Comma operators 10. Special operators 3.3 ARITHMETIC OPERATORS The arithmetic operators can perform arithmetic operations and can be classified into unary and binary arithmetic operators. (i) Unary Arithmetic Operators The use of unary ± does not serve any purpose by default, numeric constants are assumed to be possible. However it can be used as follows: A=+50 52 KSOU PROGRAMMING C St. Angelo’s Professional Education The unary minus operator can be used to negate the value of variable. It is also used specify a negative number. Here a minus sign (-) is prefixed to the number. The unary minus operation has 0 the effect of multiplying its operand by -1. EXAMPLE 1.int x=10 int y=-x The value of y=10 2.int x=7 int sum=-x The value of sum=-7 (ii) Binary Arithmetic Operators There are five arithmetic operators in C are given below, Operator Meaning - Subtraction * Multiplication / Division % Modulus operators (Remainder after integer division) The operator acted upon by arithmetic operators must represent numeric values. Thus; the operator can be integer values, floating point values or characters. The modulus operator (%) requires both the operands to be integers and the second operand as a non zero. If one of the operand represents negative values, then the addition, subtraction, multiplication and division operators will result in values whose signs are determined by the rules of algebra. EXAMPLE If a and b two integer variables whose values 5 and 10 respectively, then Expression Value a+b 15 a-b 7 a*b 50 53 KSOU PROGRAMMING C St. Angelo’s Professional Education a/b 2 a%b 1 If x and y are two floating point variables whose values are 10.7 and 5.5 then Expression Value x+y 16.2 x-y 5.2 x*y 58.85 x/y 1.9 If c1 and c2 are two characters variables that represent the characters P and T respectively, then Expression Value C1 80 C1+C2 164 C1+C2+5 169 C1+C2+‟5‟ 217 3.4 UNARY OPERATORS Unary operators are another type of operators that act upon a single operand to produce a value. Operator Meaning - Unary minus ++ Increment operator -- Decrement operator size of Size of the operand The unary minus is minus sign which precedes as a numerical constant a value or an expression. Unary minus, negates the value of the number. Examples are -5,-(a+b),-0.5,-root2. If a=-2,b=7,c=-3 then the values of a,b and c would be 2,=7 and 3 respectively. The increment operator ++ causes its operand to be increment by one where as the decrement operator – causes its operand to be decrement by one. These operators can each be utilized in two different ways, depending on whether the operator is written before the operand. If the operator precedes the operand (++i), then the operand will change in value before it is utilized for its intended purpose within the program. These operators are called pre increment and decrement operators. 54 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.5 RELATIONAL OPERATORS The relational operators are used to compare arithmetic, logical and character expressions. We can compare two similar values and depending on their relation take some decision. These comparisons can be done with the help of relational operators. Each of these operators compares their left hand side with their right hand side. The relational operator then evaluates to an integer. If evaluates to zero if he condition is false, and one if it is true. There are six relational operators in C Operator Meaning < Less than > Greater than <= Less than or equal to >= Greater than or equal to != Not equal to If i,j and k integer variables having the values 1,2 and 3 respectively, then Expression Interpretation Value i<j True 1 (i+j)>=k True 1 (i+k)>((i+5) False 0 K!=3 False 0 J==2 True 1 3.6 LOGICAL OPERATORS The C language logical operators allow a programmer to combine simple relational expression to form complex expressions by using AND, OR and NOT. In C have the following three logical operators. Operator Meaning && Logical AND || Logical OR ! Logical NOT (i) Logical AND Taking logical AND when two expressions are added the resulting expression will be true only if both sub expressions are true. Example such as (x>15) && (y<10) will be true only if x is greater than 5 and if y less than 10.The second expression is not evaluated if the first expression is false. 55 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE if(number<0 && number>100) (ii) Logical OR A logical expression is evaluated from any one of the sub expressions are true. Example (x>15) || (y<10) will be true any first expressions is true or second expressions is true. The entire expression will be true or either any expression is true. EXAMPLE if(number<0 || number>100) (iii) Logical NOT The logical !(NOT) operator takes single expression and evaluates to true(1) if the expression is false(zero) and evaluates to false(zero) if the expression is true. EXAMPLE !(x>=y) The expression after the! Operator in this case is x>=y.The not expression evaluates to true only if the value of x is neither greater than nor equal to y that is only if x is less than y. 3.7 ASSIGNMENT OPERATORS In C language assignment operator = (Equal Sign).In this operator evaluates the expression on the right side and assigns the resulting value to the variable of left. Assignment expressions are written in the form SYNTAX Identifier=Expression The arithmetic operators are =, +=,-=,*=,/,/=,%=. EXAMPLE 1. x+=y is equal to x=x+y 2. x-=y is equal to x=x-y 3. x+=y ix equal to x=x*y 4. x/y=y is equal to x=x/y 56 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.8 INCREMENT AND DECREMENT OPERATORS C provides two operators for incrementing and decrementing variables. The increment operator ++ add 1 to its operand, while the decrement operator – subtracts. The increment (++) and decrement (--) operator may be used either as prefix operators (before the variable, as in ++x), or postfix operators (after the variable++).In both cases, the effect is to be increment the value of x.But the expression ++x increments x before its value is used, while x++ increments x after its value has been used. EXAMPLE x=5 then x=x+1, sets x o 5 But x=++x, sets x to 6 In both cases x becomes 6.The increment and decrement operators can only applied to variables. 3.9 CONDITIONAL OPERATORS Conditional operator (? :) is ternary operator to construct conditional expressions, replace string if-else construct. SYNTAX Expression1? Expression2:Expression3 The conditional (?) works as done similar to see ternary operator. If expression1 is evaluated first, if the expression1 is true, expression2 evaluated, if the expression is false, expression3 is evaluated. EXAMPLE a=20; b=25; x= (a>b)? a: b In this example if check the condition if a>b that is 20>25 condition is false so x will be assigned of b. 57 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.10 BITWISE OPERATORS Bitwise operator operates on each bit of data. These operators are used for testing the bits or shifting them either left or right. Generally the bitwise operators are not applicable in the cases of float and double variables. The list of bitwise operators are given below, Operator Meaning & Bitwise AND | Bitwise Or ^ Bitwise XOR << Shift Left >> Shift Right ~ Bitwise Complement EXAMPLE Assume that a,b and c are integers int a=10 b=5 and c According to the my convenience, let us assume that the integer copies 16 bits(2 bytes). The binary representation a: 0000 0000 0000 1010 The binary representation b: 0000 0000 0000 0101 (i)Bitwise AND Consider the statement c=a+b This statement can be executable with the help of bitwise AND operator. After this statement is executed, each bit of c will produce the result 1 only if the corresponding bits in the both the bits a and b are 1.Otherwise it will return to 0.The bitwise AND operator is a binary operator. a: 0000 0000 0000 1010 b: 0000 0000 0000 0101 a+b:0000 0000 0000 0000 (ii)Bitwise OR Consider the statement c=a|b This statement can be executed with the help of bitwise OR operator. After this statement is executed, each bit of c will produce the result 1 whenever at least any one of the bit position as 1.otherwise it will return to 0.The bitwise OR operator is a binary operator. 58 KSOU PROGRAMMING C St. Angelo’s Professional Education a: 0000 0000 0000 1010 b: 0000 0000 0000 0101 a+b:0000 0000 0000 1111 (iii)Bitwise XOR Consider the statement c=a^b This statement can be executed of the bitwise XOR operator. After this statement is executed each bit of c will produce the result 1, whenever the corresponding bits in a and b differ. The bitwise XOR operator is also binary operator. a:0000 0000 0000 1010 b:0000 0000 0000 0101 a+b:0000 0000 0000 1111 (iv) Left shift operator: The left shift operator to use the symbol << is a binary operator. EXAMPLE c=a<<5 The value of c in the integer of a is shifted to the left by one bit position. The result will be assigned to c. To apply left shift << for a, a: 00000000 0000 0101 After executing the left shift operator one zero are inserted in to right. (v) Right shift operator: The right shift operator to use the symbol >> is a binary operator. EXAMPLE c=a>>2 The value of c in the integer of a is shifted to right by one bit position. Finally the result will be assigned to c. 59 KSOU PROGRAMMING C St. Angelo’s Professional Education To apply left shift >> for a, a: 0000 0000 0000 0010 after right shift by 1 placesa,a>>5 a:0000 0000 0000 0001 after executing right shift operator one zero are inserted into left. (vi)Bitwise complement operator The bitwise complement operator (~) is a unary operator. It gives the value complementing each bit to the operand. Consider the statement c=~b Bitwise complements (~) are, b: 0000 0000 0000 0101 after bitwise complement that is ~b c:1111 1111 1111 1010 3.11 COMMA OPERATORS The set of expressions separated by using the operator are called comma operator. If any expression are represented are evaluated from left to right EXAMPLE 1 where, int i,j; i and j are declared by the statement are separated by comma operator EXAMPLE 2 i=(j=2,j+3) In above statement two expressions are separated by comma. If first expression j=2 is evaluated after the expression j+3 is evaluated. In the above statement value 5 is assumed the variable of i. 60 KSOU PROGRAMMING C St. Angelo’s Professional Education Flowchart of the binary operator Text expression Condition expression takes on value of test expression true Condition expression takes on value of expression false FIGURE 1.6 3.12 SPECIAL OPERATORS (i)The size of () operator is denoted as special operators when used an operand it returns the number of bytes the operand occupies. EXAMPLE x=sizeof(m1) y=sizeof(float) z=sizeof(#ol) (ii)The other special operator are(. and ->) which is used with structures and unions. 3.13 ARITHMETIC EXPRESSION An Arithmetic expression represents a numeric value. Other types of expressions can represent character or Boolean values. These arithmetic expressions are made up of variable name, values, binary operators and brakets.An expression represents right hand side and results are stored in left hand side of value using assignment operator. 61 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 1 1. a+b+c*d 2. a*(b-c/d)-e/g In another way to represent arithmetic expression is an expression using addition (+), subtraction (-), multiplication (*), division (/) and exponentials (**). EXAMPLE 2 1+3 is 4 2.23-0.45 is 0.78 3.3*8 is 24 4.-.5**2 is -25 5.12/4 is 3 3.14 EVALUATION OF EXPRESSION In C language the expressions are evaluated using assignment operators. When expression is executed that is evaluated in right side and then the evaluated result is stored in left-side of variable name. EXAMPLE x=(a*b)/b y=(a*b)+(b*a) z=(m/n)/(x+a-b) 3.15 PRECEDENCE OF ARITHMETIC OPERATORS C operators in order of precedence (highest to lowerest) is listed given below, (i)In arithmetic expression is represented without parentheses will be evaluated from left to right. Suppose in expression are represented with parentheses, first evaluated as parentheses of expression, so it is highest priority. (ii)If expression is represented with two or more parentheses appear the expression is evaluated with left-most parentheses of expression after it evaluated with right-most. 62 KSOU PROGRAMMING C St. Angelo’s Professional Education (iii)The next highest priority are *,/ and %. (iv)The last priority that is lowerest priority +.-. EXAMPLE 1 x=5-12/3+5*2+1 5 - 12 / 3 + 5 * 2 + 1 1 2 4 3 5 x=12 63 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 2 x=9-12/(3+3)*(2-1) 9 - 12 / ( 3 + 3) * ( 2 * 1) 2 1 3 4 5 x=8 3.16 TYPE CONVERSIONS IN EXPRESSIONS In C support two types of conversions expressions they are, 1. Implicit type conversion 2. Explicit type conversion (i)Implicit Type Conversion During evaluation automatic type conversion are known as implicit type conversion. In C, it supports automatically type conversion without any intermediate value that is can be evaluated without any loosing of expression. Automatic conversion by the compiler. 64 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE Evaluation of Implicit Type Conversion int a,b float x double m long int=5 x = 5 / a + a * x - m int int long int float float float double int double 65 KSOU PROGRAMMING C St. Angelo’s Professional Education The following are the sequence rules for evaluating expressions: 1. If any one of the operands is long double and the other operand also long double finally the result will be long double. 2. If any of the operand is double and the operand also converted to double and final result will be double. 3. If one operand is float and another operand to float and the result will be float. 4. If one of the operands is unsigned long int and the converted operands also unsigned long int and the result will be unsigned long int. 5. If one operand is long int and other will be unsigned int the unsigned int the unsigned int is first converted into long int so final result will be long int. 6. Suppose we have considered both operands will be unsigned long int final result also unsigned long int. 7. If one operand will be long int so result will be long int. 8. If the operand is unsigned int and the other operand also unsigned int and the result will be unsigned int. 66 KSOU PROGRAMMING C St. Angelo’s Professional Education Hierarchy of Implicit Type Conversion long int double float Unsigned long int long int Unsigned int int short char FIGURE 1.7 (i)Explicit Type Conversion The Explicit type conversion results in explicitly defined with a program (instead of being done by a complier for implicit type conversion). SYNTAX (type-name) expression where, type-name->is the data types expression->it may be constant, variable or expression 67 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 1 x=(int)3.4 Here, the float value 3.4 is converted into integer. EXAMPLE 2 x=float(21) Here the integer value 21 is converted into float type. EXAMPLE 3 x=(int)25.7/(int)4.5 here the value 25.7 is converted to integer and 4.5 is also converted into integer the expression is evaluated result is 25/4 and the result will be stored as 6. 3.17 OPERATOR PRECEDENCE AND ASSOCIATIVITY In C contains many operators operator precedence is the order in which compiler group‟s operands with operators. The C compiler evaluates certain operators and their operands before others. If operands are not grouped using parentheses the compiler group them according to its own rules. Suppose if an expression has more than one operator it is very important know the order in which they will be applied. There are different distinct levels of precedence and an operator may belong to any one of these levels. The operator are given the higher level of precedence are evaluated first. The operator of the same precedence is evaluated either from „left to right‟ or „right to left‟ depending on the level. This is known as the associatively property of an operator. Summary of C operators (i) Function Operator Operator Description Associativity Level ( ) Function call Left to Right 1 [ ] Array Element Reference (ii) Unary Operator 67 KSOU PROGRAMMING C St. Angelo’s Professional Education Operator Description Associativity Level + Unary plus Left to Right 2 - Unary minus ++ Increment -- Decrement ! Logical Negation ~ One‟s Complement Size of(type) Size of type definition (iii) Arithmetic Operators Operator Description Associativity Level * Multiply Left to Right 3 / Divide % Modulus + add Left to Right 4 (iv) Shift Operators Operator Description Associativity Level << Left Shift Left to Right 5 >> Right Shift (v) Relational Operators Operator Description Associativity Level < Left than Left to Right 6 <= Less than or equal to > Greater than >= Greater than or equal to (vi) Equality Operators Operator Description Associativity Level == Equal to Left to Right 7 != Not equal to (vii) Bitwise Operators Operator Description Associativity Level & Bitwise AND Left to Right 8 | Bitwise OR Left to Right 9 ^ Bitwise XOR Left to Right 10 (viii) Logical Operators 68 KSOU PROGRAMMING C St. Angelo’s Professional Education Operator Description Associativity Level && Logical AND Left to Right 11 ^ Logical OR Left to Right 12 (ix) Conditional Operators Operator Description Associativity Level ?: Conditional Expression Right to Left 13 (x) Assignment Operators Operator Description Associativity Level = Assign Right to Left 14 -= Subtract *= Multiply /= Divide %= Modules (i) Comma Operator Operator Description Associativity Level , Comma Left to Right 15 EXAMPLE Consider the variable x,y and z are integer variables having the values 2,3 and 4 respectively. x*=-2*(y+z)/3 The given expression, x=x*(-2*(y+z)/3) Step 1 y+z=3+4=7 Step 2 -2*(y+z)=-2*7=-14 69 KSOU PROGRAMMING C St. Angelo’s Professional Education Step 3 -2*(y+z)/3=-14/3=-4 Step 4 2*-4=-8 x=8 1. What is operator? ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. What is difference between increment and decrement operator? …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 3.19 LET US SUM UP C support different types of operators. In operator is a symbol that operates certain Mathematic or logical operations. Arithmetic operators can perform arithmetic operations. Unary operators are another type of operators that act upon a single operand to a value. The relational operators are used to compare arithmetic, logical and character expression. The logical operator allows a programmer to combine into single relational expression. In C language assignment operator = (Equal sign).In this operator evaluates the expression on the right side and assigns the resulting value to the variable to left. The reaming type of operator conditional operatiors, bitwise operators, comma operators and special operators. In C programming language support arithmetic expression and evaluation of expression. It support precedence of arithmetic operators and type conversion 70 KSOU PROGRAMMING C St. Angelo’s Professional Education In C contains operator precedence. The operator of the same precedence is evaluated either from „left to right‟ or „right to left”. 3.20 LESSION END ACTIVITIES 1. What is output of the following program? void main() { int a=2,b=5,c=8,d; d=a+b*c; printf(“%d”,c) } 2. Explain detail about different types of operator with example? 3. What is use logical || operator? 4. Why do you use conditional operator? Why is called ternary operator? 5. What is use of precedence and associativity of relational operator? 3.21 KEYWORDS Arithmetic Operators: Arithmetic operator can perform arithmetic operations can be classified into unary and binary operator. Relational Operators: The relational operators are used to compare arithmetic, logical and character expressions. Conditional Operators (?:):Conditional operator is ternary operator to construct conditional expressions. Arithmetic Expression: An arithmetic expression that represents a numeric value. Type Conversion: C support two types of conversions expressions such as implicit type conversion and explicit type conversion. 71 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.22 QUESTIONS FOR DISCUSSION 1. What is arithmetic expression? Mention different types of arithmetic expressions. 2. What is type conversion? Explain its types 3. What is use of bitwise operators? Explain with example. 4. Explain detail about operator precedence and associativity with example. 5. Difference between prefixing and post fixing increment and decrement operator. Ans.1 1. C supports different type of operators. In operators is a symbol that operates certain mathematical or logical operations. These operators are being arithmetic operators, unary operators, relational operators, logical operators, increment and decrement operators, conditional operators, bitwise operators, comma operators, special operators. Ans.2 2. C provides two operators for incrementing and decrementing variables. The increment operator ++ 1 to its operand while the decrement operator – subtracts 1. 1. The C Programming Language, B.W. Kernighan, Dennis M.Ritchie, PHI/Pearson Education 2. C Programming with problem solving, J.A. Jones & K. Harrow, Dreamtech Press 3. Programming in C - Stephen G. Kochan, III Edition, Pearson Education. 4. C – programming E.Balagurusamy Tata McGray Hill 5. How to solve it by Computer: Dromey, PHI 6. Schaums outline of Theory and Problems of programming with C : Gottfried 72 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-4 73 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 4 MANAGING INPUT AND OUTPUT OPERATIONS CONTENTS 4.1 Aims and Objectives 4.2 Introduction 4.4 Writing a Character 4.5 Formatted Data Input Function 4.6 Formatted Data Output Function 4.7 Let us Sum Up 4.8 Lesson End Activities 4.9 Keywords 4.10 Questions for Discussion 4.1 AIMS AND OBJECTIVES At the end of this chapter you will learn how to: Describe the structure of reading a character with example Describe the structure of writing a character with example Understand the concept of data input function Understand the concept of data output function 4.2 INTRODUCTION Input/Output functions are used to accept values into variables and printing them after the processing. The input and output of data can be done through the standard input/output statement or data. The function interact with the standard input (Eg: keyboard) and standard output (Eg: screen). 74 KSOU PROGRAMMING C St. Angelo’s Professional Education A header file is a file containing C declarations and macro definition to be shared between several source file. Each header file contains information in support of a group of related library functions. These files are included in the program by giving the #include statement at the beginning of the program. The header file required by the standard input/output library functions is called stdio.h. #include<math.h> Here the library functions used such as cos(x), sin(x), tan(x), sqrt(x) etc, these function used in In C programming all input/output operations are carried out through function as printf and scanf.The scanf function which can read data from keyboard. The printf function which send the result to the monitor or console. Some input/output functions returns the data items whereas others does not return .The function returning data item appear within expressions these expression output are stored in some of the variable name, for example c=(x+b)/(x-a) or x=getchar().On other hand functions not returning data items may be referred as putchar() statement. By using input/output statement is reading a character from „standard input‟ unit (Eg: keyboard) and writing it to the „standard output‟ unit (Eg: Monitor).By using getchar () function The getchar() function representing the following form, variable-name=getchar() where, variable-name is a valid variable name that has been declared as char type. When this standard used to read the single character until anything key pressed and assign this character as a value to getchar() function. In C program contains the statement are, char c; . . . c=getchar(); 75 KSOU PROGRAMMING C St. Angelo’s Professional Education In C language the statement EOF denotes as End Of File, return on integer value an integer defined in the library file <stdio.h>.Typically EOF will assign value=-1 that is EOF=-1.The value vary from one compiler In C language the statement called EOF () is denoted as end of file is an integer defined in the library to another. In pressing the keys CONTROL+Z causes <EOT> (End of Terminal) to be send to the program. In this statement CTRL+Z can be used to denote the statement called EOF. EXAMPLE #include<stdio.h> void main() { int ch; printf(“Enter the character”); c=getchar(); if(c!EOF) printf(“you typed a character not reach end statement”); } 4.4 WRITING A CHARACTER The C library function PUTCHAR() allows the user to display a character by character. The putchar() function is a complement of getchar () function. The PUTCHAR() function to print ASCII value of expression it receives an argument. It receives a single character to a standard output device that is the monitor. SYNTAX PUTCHAR(variable_name); where, variable-name is a name that contains a character. The characters are printed at the terminal called monitor. EXAMPLE 1 char result; result=‟c‟ putchar(result); will display the character „c‟ on the screen 76 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 2 The program displays a character entered in the uppercase into lowercase. #include<stdio.h void main() { int c; printf(“Enter an character with uppercase letter:”); c=getchar(); printf(“Lowercase=”); putchar(c+32); } Sample Program Output Enter an character with uppercase letter: G Lowercase=g EXAMPLE 3 The following program given below, 2. To check while character is not equal to EOF. 3. Display character #include<stdio.h> void main() { int c; printf(“Enter character until to press CTRL+Z”); while(c!=EOF()) { putchar(c); } printf(“\n program terminated”); } 4.5 FORMATED DATA INPUT FUNCTION In C Library function scanf(),is one of the input function. Just like the getchar() function. The scanf() function reads information from the terminal and stores with the particular variable.scanf() can be used to enter any combination of digits, characters and string. 77 KSOU PROGRAMMING C St. Angelo’s Professional Education SYNTAX scanf(“format string”,arg 1,arg 2…arg n) where, format string->string containing certain required formatting information arg 1,arg 2, arg n are the addresses the data items in the memory of the computer. The format string comprises individual group of characters with one character group to begin with a percent sign (%), followed by a conversion character which indicates the type of the corresponding data item to be read from the keyboard. The multiple character groups in the format string can be contiguous or separated by white space characters. If white space characters are used to separate multiple characters groups in the format string, then all consecutive white space characters are in the input data will be read but ignored. Conversion character code Meaning %c Data item read a single character %d Data item read a decimal number %f Data item read a floating point value %h Data item is a decimal, hexadecimal or octal integer %i Data item is a decimal, hexadecimal or octal integer %o Data item is an octal integer %s Data item is a string followed by space character(the null character „\0‟ will automatically %u Data item is an hexadecimal number %x Data item is an hexadecimal number […] Data item is a string which may indicate white space character The arguments are written as variables or string, whose types match the corresponding character group in the control string. Each variable name must be preceded by an ampersand (&) sign. The „&‟ operator give the address of the corresponding variable. The string name should not begin with the ampersand. EXAMPLE #include<stdio.h> void main() { char name[20]; int rollno,marks; printf(“Enter the data for name,roll_no and marks:\n”); scanf(“%s %d %d”,&name,&roll_no,&marks); } 78 KSOU PROGRAMMING C St. Angelo’s Professional Education OUTPUT Enter the data for name, roll_no and marks: Rahul 1001 77 In the given example of scanf statement scanf(“%s %d %d”,&name,&roll_no,&marks); It can be divided into two manners 1. Character groups -> %s %d %d 2. Address of the variables-> &name,&roll_no,&marks In the scanf function the format string is %s %d %d.It can three character groups. %s->indicates that the first argument item which represents a string. %d->indicates that the second argument item which represents an integer. %d->indicates that the third argument item which represent also an integer. scanf() cannot be used to enter a string that includes white spaces characters because it considers the character as the string terminator.Therefore,that part of the string until the first white space is uncounted it will be assign to the array. EXAMPLE #include<stdio.h> void main() { scanf(“%s”,name); } Sample program output The input strings using the scanf functions-type conversion character within the control string replaced by a sequence of characters enclosed in [].The white space character may be included within these brackets. 79 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE #include<stdio.h> void main() { char line[80]; printf(“Enter the phrase:”); scanf(“%d[ABCDEFGHIJKLMNOPQRSTUVWXYZ”],line); printf(“\n The phrase of string has”,line); } Sample Program Output Enter the phrase: I LOVE INDIA The phrase of string has I LOVE INDIA In C programming c support the number of characters in a data item can be limited by specifying a maximum field width for that data item. An unsigned integer indicating the field width is placed within the format string, between the % sign and the conversion character. The data item may consist of fewer characters than specified. However; it cannot exceed the specified field width. EXAMPLE #include<stdio.h> void main() { int a,b,c; scanf(“%3d %3d %3d”,&a,&b,&c); } Given the above program if the data would have been entered as:21 14 17 assignment would be a=11,b=14,c=31.If data entered has been 12345678,then the assignment would be a=123 b=456 and c=789.In further had the data entered as 123456789 then the assignment as a=123,b=4,c=567. Most version of C allows certain conversion character within the control string to be preceded by a single letter prefix. For example, an used to indicate either signed or unsigned long integer argument or double precision argument. Similarly is used to indicate signed or unsigned short integer. scanf() is a function that reads the data with specified format from a given string stream source. 80 KSOU PROGRAMMING C St. Angelo’s Professional Education #include<stdio.h> void main() { short ix,iy; long lx,ly; double dx,dy; scanf(“%d %d %if”,&ix,&ix,&dx); } 4.6 FORMATED DATA OUTPUT FUNCTION The function can be used to show output any combination of numerical values, characters and string. SYNTAX printf(“control string”,arg1,arg2,arg3…argn) where, Control string->consists of three types of items. 1. Character that will be printed on the screen as they appear. 2. Format specifications that define the output format for display of each item 3. Escape sequence character used such as \n,\t and \b. arg 1,arg 2,arg 3…arg n are arguments with represent the individual data items to be displayed. The simple format function has following. EXAMPLE #include<stdio.h> #include<conio.h> void main() { clrscr(); printf(“%8.4f \n”,123.1234567); printf(“%3.8d \n”,1000); printf(“right-justified:%8d\n”,100); printf(“left-justified: %8d\n”,100); printf(“10.15 s\n”,programming in c”); getch(); } 81 KSOU PROGRAMMING C St. Angelo’s Professional Education Sample program output 123.1235 00001000 right-justified: 100 left-justified: 100 programming The argument can be written as constants, single, variable or array names, complex expression and function references. Given the list below represent a conversion characters to be used in conjunction with the printf() function. Conversion character conjunction function Conversion character Meaning c Data item is displayed as a single character d Data item is displayed as a signed decimal integer e Data item is displayed as a floating-point value with an exponent f Data item is a floating point value without an exponent i Data item is displayed s single integer o Data item is displayed as a string s Data item is displayed as a string u Data item is displayed as an unsigned decimal integer x Data item is displayed as a hexadecimal integer, without leading zero. The following program indicates several different data types can be displayed using the printf function. EXAMPLE #include<stdio.h> void main() { char item[20]; int empno; char empname[20]; float salary; scanf(“%d %s %f”,&empno,&empname,&salary); printf(“Employee details are %d %s %f”,empno,empname,salary); } 82 KSOU PROGRAMMING C St. Angelo’s Professional Education within the printf function the control string is “Employee details are: %d %s %f”.It contains three character groups. The first character group “Employee details:” is a string constant which will be displayed on the screen as it. The second character %d indicates that the first argument group is a decimal. The third character group %s indicates that the second argument group is a string. The fourth character %f indicates that the third argument group is a float. The printf() function can also contain escape sequences like „\n‟,‟\t‟,‟\b‟ etc. In C language, it can supports the displayed number in hexadecimal format also.Hence,a,b,c,d,e,f in hexa decimal systems represent the number 10 through15 these letters can displayed in either uppercase or decrease using %X or %x format specifies respectively. EXAMPLE #include<stdio.h> void main() { unsigned int no; scanf(„%u”&a); printf(“The input integer(in decimal)is %u \n”,no); } Sample Output The input integer (in decimal) is 44 The input integer (in hexadecimal) is 4c. Some of the most commonly used placeholders follow, %d->Scan an integer as a signed decimal number %i->Scan an integer as a signed number %f->Scan floating-point number notation %s->Scan a character string %c->Scan a character(char).No null character is added „(space)‟->space scans for white space characters. The format specifies of printf statement are, %i->int(Same as %d) %lf->double %c->char %s->string 83 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. Explain printf() function. ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. Explain scanf() function. …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 4.7 LET US SUM UP Input/output functions are used to accept values into variables and printing them after the processing By using getchar() function reading a single character representing the following manner variable-name=getchar(). In putchar() function it is used to display a character by character. It receives a single character to a standard output devices is called monitor. In C library function scanf() it is one of the input function. Just like the getchar() function. The scanf() function reads information from the terminal stores with the particular variable. The formatted data output function can be used to show the output any combination of numerical values such as character and string. 4.8 KEYWORDS Input/Output Operations: Accepting the required inputs from input devices and displaying produced results on output devices are referred to as input/output operations. Getchar() and Putchar() Functions: getchar() and putchar() are the simplest I/O functions and they are used to perform character input and output respectively. Scanf() and Printf() Functions: The scanf() is used to accept mixed or same types of data through the keyboard.printf() function is used to display data on the screen. 84 KSOU PROGRAMMING C St. Angelo’s Professional Education Formatting of ouputs: Formatting of output is to displays the output in more readable and comprehensible manner. 4.9 QUESTIONS FOR DISCUSSION 1. Write the syntax of using getchar() and putchar() function. 2. What is the output of the following statements: int i=0; printf(“%d %d \n”,i,i++); 3. Describe the different format specifies of scanf(). 4. Write a program to accept length and breadth of a rectangle and find its area. Ans.1 The scanf() is used to accept mixed or same types of data through the keyboard. The syntax of its usage is as follows: scanf(“control string”,arg 1,arg 2,….arg n) Here,arg 1,arg 2,…arg n are the address of the variables into which data are to be accepted. Ans.2 The printf() is used to display data on the screen.The syntax of its usage is similar to that of scanf() printf(“control string”,arg 1,arg 2,…arg n) Here arg 1,arg 2,arg n are the variables,the values of which are to be displayed on the screen. 1. Mastering C by Venugopal, Prasad – TMH 2. Complete reference with C Tata McGraw Hill 3. ANSI C, by Dennis Ritchie 4. Programming in C, by Lipschutz, SCHAUM SERIES OUTLINES 85 KSOU PROGRAMMING C St. Angelo’s Professional Education MODULE-2 86 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-1 87 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 1 DECISION MAKING AND BRANCHING CONTENTS 1.1 Aims and Objectives 1.2 Introduction 1.3 Decision Making with If Statement 1.4 Simple If Statement with Example 1.5 If…Else Statement with Example 1.6 Nesting of If…else Statement with Example 1.7 Else…if Ladder Statement with Example 1.8 Switch…Case Statement with Example 1.9 The Ternary Operator ?= with Example 1.10 Goto Statement with Example 1.11 Let Us Sum Up 1.12 Keywords 1.13 Questions for Discussion 1.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to: Describe the structure of decision making with if statement Identify Switch Case statement Explain the Ternary ?: Operator Describe the Structure of goto Statement 88 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.2 INTRODUCTION In a C program, it is a set of statements which are normally executed sequentially in the Order in which they appear. There are several instances where we have to make decisions. Similarly, when writing a program code, one may come to a point when a decision has to be made by evaluating a given expression as a true or false. Such an expression involves the use of logical or relational operators. Depending on the outcome of the program, execution accordingly branches out. In C language support the following decision-making capabilities, they are, 1. If statement 2. Switch statement 3. Conditional operator statement 4. Goto statement These statements are popularly known as decision-making statements. Since these statements „control‟ the flow of execution, they are also known as control statements. 1.3 DECISION MAKING WITH IF STATEMENT The if statement allows the programmer to execute a statement or series of statements Conditionally. If the condition supplied to the statement is logically true, then the statement that follows it is executed. Else it simply transfers control the next statement. The condition may be any valid C language expression including constants, variables, logical comparisons etc. The condition must be placed with parentheses. Some examples of decision making using if statements are, 1. if (student average greater than 60) 2.if(age is more than 58) person is retired 3.if(employee salary greater than 250000) pay with tax The if statement may be implemented of conditions to be tested. The control statements are four types: 89 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. Simple if statement 2. if…else statement 3. Nested if…else statement 1.4 SIMPLE IF STATEMENT The syntax of a simple if statement is, SYNTAX if(condition) { Statement-block; } Statement-x; The „statement-block‟ may be a single statement or a group of statements. If the condition is true, the statement-block is executed; otherwise statement-block will be jumped and execution will get to the statement-x.When the condition is true both the statement block and statement-x also executed in the sequence. The control flow of the “simple if statement” can be represented using flow chart as follows. 90 KSOU PROGRAMMING C St. Angelo’s Professional Education Entry test expression T statement-block F statement-x next statement FIGURE 1.8 Consider the following statement of program that is written for calculating marks obtained in a university examination. EXAMPLE 1 Write a program whether the given number is positive or not. #include<stdio.h> void main() { float x; printf(“\n Enter a positive number:”); scanf(“%f”,&x); { print(“\n Positive Number:%f”,x); } } 91 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 2 Write a program to enter integer number between 1…10. #include<stdio.h> void main() { int number=0; printf(“\n Enter an integer between 1 and 10:”); scanf(“%d”,&number); if(number>7) printf(“you enter %d which is greater than 7 \n”,number); if(number<3) printf(“you entered %d which is less than 3 \n”,number); } 1.5 IF…ELSE STATEMENT When if…else statement taking a decision there are always two faces that is to do or not to do.Similary,when programming there are two faces to a condition it may evaluates as TRUE or FALSE. To implement such a decision has provided you with the IF…ELSE construct. This construct carries out a logical test and then takes one of the two possible cases of actions, depending on the outside of the condition. SYNTAX if(condition) { Statement 1; } else { Statement 2; } Statement-x; If the condition with in the parentheses evaluates to TRUE, then the statement immediately following it is executed; otherwise the statement following the ELSE clauses is executed. Given below is flowchart description of the “ if…else” construct. 92 KSOU PROGRAMMING C St. Angelo’s Professional Education Entry T test expression F Statement1 Statement2 Statement-x FIGURE 1.9 The program given below illustrate the use of the IF…ELSE construct EXAMPLE 1 Write a program given below illustrate the use of the IF…ELSE construct. #include<stdio.h> void main() { int flg; float side,area; printf(“\n enter for 1 for circle and and 0 for square:”); scanf(“%d”,&flg); if(flg) { printf(“\n Area of Circle=%f”,area); } else { printf(“\n Enter Side:”); scanf(“%f”,&side); area=side*side; 93 KSOU PROGRAMMING C St. Angelo’s Professional Education printf(“\n Area of the square=%f”,area); } } EXAMPLE 2 Write a program to generate magic(random) number. #include<stdio.h> #include<stdlib.h> void main() { int magic; int guess; magic=rand(); printf(“Guess the magic number:”); scanf(guess=magic) { } else { printf(“***** Right ***** “); printf(“*****Wrong*****”); }} 1.6 NESTING OF IF…ELSE STATEMENT The else clause like the IF clause can contain compound statements.Moreever,a clause of the statement may contain another if statement. This feature is known as nesting of if statements. There are several forms that nested if-else statement can take. if(Condition1) { if(Condition2) { } else { Statement 1; Statement 2; } else { Statement 3; } Statement-x; 94 KSOU PROGRAMMING C St. Angelo’s Professional Education If the condition within the parentheses evaluates to TRUE, if the statement immediately following another condition is evaluated if the condition is true is evaluated with the clause else, if evaluated else part if the first part of the condition is else executed statement.othewise executed statement-x. Given below is a flowchart description of nested if construct Entry Condition1 Statement-3 Condition2 Statement-2 Statement-1 Statement-x Next Statement FIGURE 1.10 EXAMPLE 1 Write a program to check whether the integer number is positive or negative. #include<stdio.h> void main() { int num; printf(“Enter an integer:”); 95 KSOU PROGRAMMING C St. Angelo’s Professional Education scanf(“%d”,&num); if(num<0) printf(“number is negative”); if(num>-1) printf(“number is positive”) } EXAMPLE 2 Write a program to find the largest of three numbers. #include<stdio.h> void main() { float a,b,c,large; printf(“Enter the value for a,b and c \n”); scanf(“%f %f %f”,&a,&b,&c); large=a; if(b>big) large=b; if(c>big) large=c; printf(“The largest of three number=%7.2 \n”,large); } They are another way of writing nested if statement using elseif ladder statement. A multipath decision is a chain associated with each else is an if. SYNTAX if(condition 1) statement 1; else if(condition 2) statement 2; else statement 3; statement-x; This type of statements is known as “else if ladder”. It checks the condition, if the condition is true the control is transferred to a corresponding n number of statement otherwise control transferred to the else part statement. 96 KSOU PROGRAMMING C St. Angelo’s Professional Education Given be is a flowchart description of the else if ladder construct. Entry T Condition1 Statement 1 F T Condition2 Statement 2 F Condition3 T Statement 3 Statement-x Next Statement EXAMPLE 1 FIGURE 1.11 Write a program to check whether the given character is upper case or lower case. #include<stdio.h> void main() { int char; printf(“Enter Character”); char=getchar(); if(char!==EOF) { 97 KSOU PROGRAMMING C St. Angelo’s Professional Education printf(“End of file uncounted \n”); } else if (char>‟a‟ && char<=‟z‟) { printf(“lower case character \n”); } else if(char>=‟A‟ && char<=‟Z‟) { printf(“upper case character \n”); } else if(char>=‟0‟ && char<=‟9‟) { printf(“number \n”); } else { printf(“Alpha Numberic”); } } EXAMPLE 2 Write a program to check find a grade of students in a university examinations. #include<stdio.h> void main() { int marks; scanf(“%d”,&marks); if(marks>=75) printf(“Honours \n”); else if(marks>=60 && marks<75) printf(“First Class”); else if(marks>=50 && marks<60) printf(“Second Class”); else if(marks>=40 && marks<50) printf(“third class”); else printf(“fail \n”); } 1.8 SWITCH CASE STATEMENT The Switch Case Statement causes a particular group of statements to be selected from a group of options. The selection is based upon the current value of the expression which is specified with the SWITCH statement. 98 KSOU PROGRAMMING C St. Angelo’s Professional Education SYNTAX Switch(expression) { Case Label 1 Statements; break; Case Label 2 Statements; break; default: Statements; break; } The expression whose value is being compared may be valid expression, including the value of a variable as an arithmetic expression in a logical comparison etc, but not a floating- point expression. The expression value is checked against each of the specified cases and when a match occur the statements following that case is executed. When a break statement is encounted, control proceeds to the end of the switch case statement. The break statement should be included in each case. If the break statement is omitted then the statement for subsequent cases will also be executed. Even through a match has already take place. The values that follow the keyword „case‟ can only be labels; they cannot be expressions. Case labels cannot be repeated within a switch statement. The last case default is selected and the statement following this case is executed if none of cases mentioned earlier are matched. The default case anywhere may or may not be included depending on the program‟s needs. The default group may appear anywhere within the switch statement. 99 KSOU PROGRAMMING C St. Angelo’s Professional Education Given below is a flow chart description of a Switch Case Statement Entry Expression? Block-1 Block-2 Block-3 Statement-x FIGURE 1.12 Write a program to find a grade of students in a university examinations using switch case statement. #include<stdio.h> void main() { case 10: case 9: case 8: break; case 7: case 6: break; 100 KSOU PROGRAMMING C St. Angelo’s Professional Education case 4: break; case else break; } 1.9 THE TERNARY ?: OPERATOR An expression that evaluates conditions is called as conditional expressions. The operator used to evaluate conditional expressions is called as a conditional operator (? :) .It is a simple form of on if-else statement. The conditional operator also referred to as a ternary operator. SYNTAX Expression 1? Expression 2:Expression 3; The expression1 is the condition for evaluation when evaluating a conditional operator, exression1 is evaluated first. If expression is true, expression 2 is alone evaluated. If expression is false, expression 3 is alone evaluated. result=number<5?10:6; EXAMPLE 1 Write a program to find the largest of three numbers using a conditional operator. #include<stdio.h> void main() { int number1,number2,result; printf(“Enter the value of number1 and number2”); scanf(“%d %d”,&number1,&number2); result=number1>number2)?:number1:number2; printf(“The largest number is %d”,result); } 101 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.10 THE GOTO STATEMENT The goto statement is used to alter the normal sequence of program execution by unconditionally transferring control to some other part of the program SYNTAX goto Label; . . . Label Statement; where, Label1 is an identifier used to transfer the control whether label occurs. The Label must followed a colon (:). EXAMPLE 1 Write a program using goto statement #include<stdio.h> void main() { int x,y; x=16; y=12; if(x==y) x++; else goto error; error: printf(“Fatal Error, exiting \n”); } EXAMPLE 1 Write a program to find square of given number. #include<stdio.h> void main() { 102 KSOU PROGRAMMING C St. Angelo’s Professional Education y=sqrt(x); } 1. What is mean by sequential execution? …………………………………………………………………………………………..…… ………………………………………………………………………………………………… ………………………………………………………………………………… 2. Define simple statement and compound statement. …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 1.10 LET US SUM UP In C programs are is a set of statements which normally executed sequentially in the order there are several instance where we have to make decision by changing execution order The If statement allows the programmer to execute statement or series of statement sequentially. The simple if statement the statement-block may be a single statement or group of statement. When if…else statement taking a decision there are always two faces is to do or not do to. Nesting of if…else statement the else clause like the “if clause” can contain compound statement. The else…if ladder statement there are another way of writing result if statement using else if cases. The switch case statement causes a particular group of statements to be selected from a group of option. 103 KSOU PROGRAMMING C St. Angelo’s Professional Education The ternary operator also referred to as a conditional operator, that evaluates conditional is called conditional expression. The goto statement is used to alter the normal sequence of program. 1.11 LESSION END ACTIVITIES 1. Define control statements with an example. 2. Explain the used of if statement with an example. 3. Explain the used of if-else statement with an example. 4. Multiple-if statements. Explain with necessary examples. 5. Nested-if statements. Explain with necessary examples. 6. Explain the syntax and use of the switch statement with an example. 7. Explain the various keywords used in a switch statement with an example. 8. Define fall through in a switch statement with an example. 9. Explain the used of conditional operator with an example. 10. State the used of goto and label statements in C. 11. Write a program to find the largest of three numbers using conditional operator. 1.12 KEYWORDS Branching: One of several possible action will be carried out depending upon the outcome of the logical test is referred as branching. If: C uses the keyword if to implement decision control statement. If-Else Statement: The if-else statement is an extension of an ordinary if statement. The “If statement” by default will execute a single statement or a group of statements when the condition is false. Multiple If-Else Statements: When a series of decisions are involved we have to use more than one “if-else statement” called as multiple ifs. Nested If-Else Statement: One of more if or if-else statements inside an if or if-else statement(s) is called as nested if statements. Switch-Case Statement: The switch statement allows us to make a decision from a number of choices. It is usually referred as the switch-case statement. 104 KSOU PROGRAMMING C St. Angelo’s Professional Education The Conditional Operator: An expression evaluates conditions is called as conditional expressions. The operator used to evaluate conditional expressions is called as a conditional operator. Goto Statement: The goto statement is used to transfer the control in a loop or a function from one point to any other portion in that program. 1.13 QUESTIONS FOR DISCUSSION 1. Write a program to read in four numbers and print out the largest number of the four. 2. In an organization employee is paid as given below: If his basic salary is less than Rs.1500 then HRA=15% of basic salary and DA=25% basic if his salary either equal to or above Rs.1500, then HRA=Rs.1500 and DA=1000 of basic. If the employee‟s salary is input through the keyword write a program to find the gross salary which is the sum of basic salary and HRA and DA. 3. Write the syntax of simple-if structure. 4. Explain nested if-else structure. 5. What is the need for else-if ladder? Give an example of its requirement. 6. Write the syntax of switch structure. 7. Compare else-if ladder and switch structure. 8. Why is the usage of goto statement? 9. Give the syntax the usage of goto statement. Ans.1 All the statements from the first statement till the last statement get executed without fall in a manner. That is, one after the other. This kind of execution of statements in a program is called sequential execution. Ans.2 In a program given by single statement is called a simple statement and a program can contain a set of statements enclosed within a pair of opening and closing braces is called a compound statement. 105 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. The C Programming Language, B.W. Kernighan, Dennis M.Ritchie, PHI/Pearson Education 2. C Programming with problem solving, J.A. Jones & K. Harrow, Dreamtech Press 3. Programming in C - Stephen G. Kochan, III Edition, Pearson Education 4. C – programming E.Balagurusamy Tata McGray Hill 5. How to solve it by Computer: Dromey, PHI 6. Schaums outline of Theory and Problems of programming with C : Gottfried 106 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-2 107 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 2 DECISION MAKING AND LOOPING CONTENTS 2.1 Aims and Objectives 2.2 Introduction 2.3 While Statement with Example 2.4 For…Loop Statement with Example 2.5 do…While Loop Statement with Example 2.6 Jumps in Loops 2.6.1 Break Statement with Example 2.6.2 Continue Statement with Example 2.6.1 Difference between Break and Continue Statement 2.7 Nesting of For Loops with Example 2.8 Break Statement in Nested Loops 2.9 Continue Statement in Nested Loop with Example 2.10 Let Us Sum Up 2.11 Lesson End Activities 2.12 Keywords 2.13 Questions for Discussion 2.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to Describe the structure of determinate loop Describe the structure of indeterminate loop Explain the continue statement in nested loops Identify break statement Identify continue statement 108 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.2 INTRODUCTION A loop is a process of the program to be executed repeatedly until condition is satisfied. When condition becomes false, the loop terminates and the control passes on the statement following the loop. A Loop consists of two segments, one is known as the control statement and the other is the body of the loop. They are three kinds of looping statement in C, 1. The for…loop statement 2. The while statement 3. The do…while statement 2.3 WHILE STATEMENT WITH EXAMPLE The while statements is used to carry out looping operation. Hence, the loop is executed until the expression evaluates be TRUE. SYNTAX while(expression) { Statement; } The condition can be valid C language expression including the value of a variable, a unary or binary expression an arithmetic expression etc. In a “while construct” the condition is evaluated first. The statements given will be continuously executed until the value of the expression is not zero. This cycle continues until the condition evaluates to zero. The “while statements” may be a simple statement or a compound statements. The group of statements usually contain one such statement which determents the value of the expression and ultimately leads to termination of loop. Once the condition evaluates to zero (false), the control is transferred to the statement following this loop. 109 KSOU PROGRAMMING C St. Angelo’s Professional Education The flowchart of the while loop are given below: Entry F Condition1 Exit T Body of Loop FIGURE 1.13 The condition in the while statement evaluates to false and the statement inside the loop are not executed. The condition in the while statement evaluates to true, and the statement inside the loop are executed. EXAMPLE 1 Write a program to displays the integer number between 1 to 10 using while loop #include<stdio.h> void main() { int digit=1; while(digit<=10) { printf(“%d \n”,digits++) } } EXAMPLE 2 Write a program to find the average of the marks. #include<stdio.h> void main() { int i,num=0; 110 KSOU PROGRAMMING C St. Angelo’s Professional Education float sum=0,average; printf(“Enter the marks of student”); scanf(“%d”,&i); { sum=sum+1; num++; scanf(“%d”,&i); } average=sum/num; printf(“The average is % 2f”,average); } 2.4 FOR…LOOP STATEMENT WITH EXAMPLE The for…loop allows us to specify three things about the loop in a single line to construct a loop, initialization, text expression and incrementing or decrementing the value, each represented separated by semicolons and enclosed within a pair of parenthesis. The initialization, test-expression and increments or decrementing can be used in different places like the way used in while and do-while loop. The “for loop” allows us to specify three thing SYNTAX for(initialization;test-expression;increment/decrement) { Statements; } Executions of statement in for…loop as follows; 1. Initialization statement is executed. 2. Test-Expression is evaluated. 3. If the test-expression evaluates true, the statements in the body of the loop executed. 4. Next, control goes to incremented or decremented value. 5. If it condition is true, again the statement of the body of the loop is executed. 6. Otherwise, it exits from the statements. 111 KSOU PROGRAMMING C St. Angelo’s Professional Education The given below flowchart of for loop, Start Initialization Test Expression? T F Stop Body of Loop Increment or Decrement FIGURE 1.14 EXAMPLE 1 Write a program to find sum of first N natural numbers. #include<stdio.h> void main() { int i,n,sum; printf(“Enter a Number \n”); scanf(“%d”,&n); sum=0; for(i=1;i<=n;i++) { sum=sum+i; } printf(“The sum of first n number is %d”,sum); } 112 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 2 Write a program to generate multiplication of a number. #include<stdio.h> void main() { int number,i,product; printf(“Enter a number \n”); scanf(“%d”,&number); for(i=1;i<=10;i++) { product=number*i; printf(“%d * %d=%d \n”,number,i,product); } } 2.5 DO…WHILE STATEMENT WITH EXAMPLE The do…while loop sometimes referred to as “do loop” differs from its counterpart the while loop in checking the condition. The condition of the loop is not tested until the body of the loop has been executed once. If the condition is false, after the first loop iteration the loop terminates. If the test expression evaluates to true then the body of the loop gets executed. This process repeated as long as the test-expression evaluates to true. Once the test-expression evaluates to false, the loop is exited and the control goes to the first statement following looping construct. Start Initialization Statements T Text Expression F FIGURE 1.15 113 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 1 Write a program to find the sum of first natural numbers using for-loop. #include<stdio.h> #include<conio.h> void main() { int n,i,sum; clrscr(); printf(“Enter a number \n”); scanf(“%d”,&n); i=1; sum=0; do { sum=sum+i; i++ ; } while(i<=n) printf(“Sum=%d \n”,sum); } EXAMPLE 2 Write a program to print numbers from 1 to 5. #include<stdio.h> void main() { int x=5; int i=0; do { i++; printf(“%d \n”,i); while(i<=x); } } 114 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.6 JUMPS IN LOOPS Break and Continue statement are represented as jump in looping statement. 2.6.1 Break Statement A break statement is used to terminate or to exit for, switch, while or do-while statement and the execution continues following the break statement. SYNTAX break; The break statement does not have any embedded expressions or arguments. The break statement usually used at the end of each (in a switch statement) and before the start of the next case statement. The keyword “break” breaks the control only from the loop in which it is placed. EXAMPLE Write a program to loop exits only when „Q‟ is pressed. #include <stdio.h> { int main() char c; for(;;) { printf( "\nPress any key, Q to quit: " ); scanf("%c", &c); if (c == 'Q') break; } } 2.6.2 Continue Statement The continue statement is used to transfer the control the beginning of loop, there by terminating the current iteration of the loop and starting again form the next iteration of the same loop. The continue statement can be used within a while or a do-while or a for loop. SYNTAX continue; 115 KSOU PROGRAMMING C St. Angelo’s Professional Education The continue statement does not have any expression or arguments. Unlike break, the loop does not terminate when a continue statement is encounted, but it terminates the current iteration of the loop by skipping the remaining part of the loop and resumes the control to the start of the loop for the next iteration. The continue statement applies only to loops and not for switch statement. EXAMPLE 1 Write programs to loop continue again when the value of i is 3. #include<stdio.h> void main() { int i; for(i=1;i<=5;i++) { if(i==3) continue; printf(“%d”,i); } } EXAMPLE 2 Write a program for sum of positive number using continue statements. #include<stdio.h> void main() { int n,i,sum=0,number; printf(“Enter Number \n”); scanf(“%d”,&n); printf(“Enter %d number one by one \n,n); for(i=1;i<=n;i++) { scanf(“%d”,&number); if(number<0) continue; sum=sum+number; } printf(“Sum of positive number:%d \n”,sum); } 116 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.6.3 Difference between break and continue statement break statement continue statement 1.can be used in switch statement cannot be used in switch statement 2.causes premature exit of the loop causes skipping of the statements following it in the body of the loop 3.The control is transferred to the statement of the loop control is transferred back to the loop 4.The loop may not complete the intended number of iterations The loop completes the intended number of iterations. 2.7 NESTING OF FOR LOOPS WITH EXAMPLE The for loop can be nested within a while loop or another for loop are represented with another manner called nesting of loops. The enclosing loop is called outer-loop and the enclosed loop is called inner-loop. EXAMPLE To write a program to generate multiplication tables #include<stdio.h> #include<conio.h> void main() { int m,n,i,j,p; clrscr(); printf(“enter lower limit \n”); scanf(“%d”,&m); printf(“enter upper limit \n”); scanf(“%d”,&d); for(i=m;i<=n;i++) { for(j=1;j=10;j++) { p=i*j; printf(“%4d”,p); { printf(“\n”); } Getch(); } 117 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.8 BREAK STATEMENT IN NESTED LOOPS Already you know about break statement in single loop. Many programming used break statement with the multiple loops also. In this break statement it affects only the loop in which it is enclosed. SYNTAX for(initialization; test-expression 1;incre/decre) { for(initialization; text-expression 2;incre/decre) { if(test-expressions) { break; } statements; } } for(initialization; test-expression 1;incre/decre) { for(initialization; text-expression 2;incre/decre) { statement; } if(test-expressions) break; } 118 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.9 CONTINUE STATEMENT IN NESTED LOOPS You already see about the working principle of continue statement in single loop. Many programming used for continue statement when the loops are nested. It is important they continue statement affects only within the loop are enclosed. SYNTAX Continue statement enclosed in inner loop for(initialization; test-expression 1;incre/decre) { for(initialization; text-expression 2;incre/decre) { if(test-expressions) { Continue; Statements; } Statements; } Continue statement enclosed in outer loop for(initialization; test-expression 1;incre/decre) { for(initialization; text-expression 2;incre/decre) { Statement; } if(test-expressions) Continue; } Statement; 119 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. Explain for loop with an example. ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. Explain while loop with an example. …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 2.10 LET US SUM UP A loop is a process the program to be executed repeatedly until condition stratified. The while loop executed until the expression evaluates be TRUE. The for…loop allows us to specify three things about the loop in a single line. The do-while loop sometimes referred to as do…loop the condition of the loop is not tested until the body of the loop has been execute. A break statement is used to terminate or to exit a for, switch, while or do-while statement. The continue statement is used to transfer the control to the beginning of loop. The for…loop can be nested within a while loop or another loop are represented with another manner called nesting of loops. 2.11 LESSION END ACTIVITIES 1. Explain do-while with an example. 2. What is the need for looping? 3. Difference between selection and looping. 4. Difference between break and continue statement. 5. Mention the three necessary things required to construct a loop. 6. Explain for loop with its syntax. 7. Explain while loop with its syntax. 8. Difference between while loop and do-while loop. 120 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.12 KEYWORDS Sequence: All the statements from the beginning till the end get executed without fail in the serial order is called sequence. Selection: Selection was sometimes some statements are executed and some are skipped depending on some condition. Looping: The repeat is one of a block of statements as long as some condition is true is called looping. Iteration: Looping is also called iteration. Valid Loop: To execute a block of statements repeatedly as long as some condition is true.i.e. to construct a valid loop. Entry-controlled or pre-tested looping construct: The test-expression is first evaluated before entering into the body of the loop, the looping construct is called entry-controlled or pre-tested looping construct. Break statement: A break statement is used to terminate or to exit a for, switch, while or do- while statement and the execution continues following the break statement. Continue statement: The continue statement is used to transfer the control to the begging of the loop. 2.13 QUESTIONS FOR DISCUSSION 1. Write a program to print N natural numbers. 2. Write a program to generate Fibonacci Series up to N terms. 3. Write a program to generate first N prime numbers. 4. Write a program to generate Armstrong numbers up to 1000. 5. Write a program to reverse a number. 6. Write a program to print the following outputs using for loops. a.1 b. * 2 2 * * 3 3 3 * * * 4 4 4 4 * * * * 5 5 5 5 5 * * * * * 121 KSOU PROGRAMMING C St. Angelo’s Professional Education Ans.1 The “for statement” is one of the most commonly used iteration constructs. The statement includes an expression that specifies an initial value for index, anoter expression that determines whether the loop is to be executed or not and the third which modifies the value of the index at the end of each pass. Like the while statement, testing of condition is done in the begging of the loop. Ans.2 The “while statement” or looping is defined as the repeated execution of a group of statements until the expression evaluates to TRUE. SYNTAX: while(expression) statement; 1. The C Programming Language, B.W. Kernighan, Dennis M.Ritchie, PHI/Pearson Education 2. 1. Turbo C/C++ - The Complete Reference - H.Schidt 3. Programming in C - S.Kochan 4. Born to code in C - H.Schidt 5. The Art of C - H.Schidt 6. C Programming - Keringhan and Ritchie - 2nd Ed. 7. Programming in ANSI C - Agarwal 8. Let us C - Kanitkar 9. Programming in ANSI C - Balguruswamy 122 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-3 123 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 3 ARRAYS CONTENTS 3.1 Aims and Objectives 3.2 Introduction 3.3 One Dimensional Arrays 3.4 Declaration of One Dimensional Array 3.5 Accessing Array Elements 3.6 Initialization of One-Dimensional Arrays 3.7 Example Programs using One-Dimensional Arrays 3.8 Two Dimensional Arrays 3.9 Initializing Two Dimensional Arrays 3.10 Declaration of Two Dimensional Arrays 3.11 Example Programs Using Two Dimensional Arrays 3.12 Let Us Sum Up 3.13 Lesson End Activities 3.14 Keywords 3.15 Questions for Discussion 3.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to: Define and Describe One Dimensional Arrays Example Programs using One Dimensional Arrays Define and Describe Two Dimensional Arrays Example Programs using Two Dimensional Arrays 124 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.2 INTRODUCTION An array is a group of elements (data items) that have common characteristics (Ex: Numeric data, Character data etc.,) and share a common name. The elements of an array are differentiated from one another by their positions within an array. Each array element (i.e., each individual data item) is referred as specifying the array name followed by its subscript enclosed in square brackets. The subscript indicates the position of the particular element with respect to the rest of the element. The subscript must be a non negative number. For example, in the n element array, x, the array elements are x [1], x [2], x [3], x [4]….x[n] and 1,2,3…n are the subscripts x[i] refers to the ith element in a list of n elements. Depending on the number of subscripts used, arrays are classified into one-dimensional arrys, two-dimensional arrays and so on. Definition of Array An array is defined to be a group of logically related data items of similar type stored in contiguous memory location is called array. 3.3 ONE DIMENSIONAL ARRAYS Arrays whose elements are specified by a single subscript are called one-dimensional or single dimensional array. It is used to stored a list of values, all of which share a common names and disguisable by subscripts values. 3.4 DECLARATION OF ONE DIMENSIONAL ARRAYS A single dimensional array is declared as follows: SYNTAX type array-name[n]; where, array name->is the name of an array of n elements of the type specified. The size of an array must be an integer constant. 125 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE int i[100]; char text[80]; float n[12]; The integer array declaration int x[100] creates an array that is 100 elements long with the first element being 0 and the last being 99. The subscript used to declare an array is sometimes called a dimension and the declaration for the array is often referred to as dimensioning. The dimension used to declare an array must always be a positive integer constant, or an expression that can be evaluated to be constant when the program is compiled. It is sometimes convenient to define an array size in terms of the symbolic constant. For example i[20]=124. An individual element in an array can be referred to by means of the subscript, the number In brackets following the array name. A subscript is the number that specifies the elements position in an array. In the C language, subscript begins with zero. Thus the valid subscript value can from 0 to n-1, if n is the dimension of array. The subscript value used to access an array element could a binary expression etc.Thus,i[2] is not the second element of the array I but the third. Properties of an array 1. The type of an array is the data type of its elements. 2. The location of an array is the location of its first element. 3. The length of an array is the number of data elements in an array. 4. The size of the array is the length of the array times the size of the elements, but the size of the array is usually referred as the product of subscript used. 3.5 ACCESSING ARRAY ELEMENTS Once the array is declared, how individual elements in the array are accessed. This is done with the help of subscripts (i.e., number specified in the square brackets following the array name).The subscript specifies the elements position in the array. The array elements are numbered, starting from zero. The first item stored at the address pointed by the array name itself. This can also be referred as position 0.Thus the first element of the array age is referred as age[0].The fourth element of the array is reoffered as age[3]. 126 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.6 INITIALIZATION OF ONE-DIMENSIONAL ARRAYS An array can be initialized when declared by specifying the values of some or all of its elements. Array can be initialized at the time of declaration when their initial values are known in advance. The values to initialize an array must be constants never variables or function calls. The array can be initialized as follows: int array[5]={4,6,5,7,2}; float x[6]={0,0.25,-0.50,0,0}; when an integer array is declared as int array[5]={4,6,5,7,2}; the compiler will reserve ten contiguous bytes in hold the five integer elements as shown in the diagram. 4 6 5 7 2 array[0] array[1] array[2] array[3] array[4] The array size need not be specified explicitly. When initial values are included as a part of an array declaration. With a numerical array, the array size will automatically be set equal to the number initial values included within the declaration. int digits[]={1,2,3,4,5,6} float x[]={0,0.25,0,-0.5} Thus, digits will be a six-element integer array, and x will be a four-element floating-point array. The individual elements will be assigned the following values. The example given below, digits[0]=1;digits[1]=2;digits[2]=3; digits[3]=4;digits[4]=5;digits[5]=6; An array may also be initialized as follows: int xyz[10]={78,23,67,56,87,76} in the above array initialization, although the array size is 10,values where defined only for the first six elements. If fewer then all numbers have values specified, then the rest will have undefined values. 127 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.7 EXAMPLE PROGRAM USING ONE DIMENSIONAL ARRAY EXAMPLE 1 Write a program to get five person ages to calculate average of person age. #include<stdio.h> void main() { int age[5]; int i,n; printf(“Number of Persons:”); scanf(“%d”,&n); if(n<=0||n>5) printf(“Invalid number of persons entered \n”); else { for(i=0;i<n;i++) { printf(“Age:”); scanf(“%d”,&age[i]); sum=sum+age[i]; } printf(“The average of age are: \n”) for(i=0;i<n;i++) printf(“%d \n”,age[i]); printf(“The average is %f,sum); } } EXAMPLE 2 Write a program to get 10 elements, to display any one of the element in the given list. #include<stdio.h> void main() { int array[10]={10,20,30,40,50,60,70,80,90,100}; printf(“which element do you want display? \n”); print(“The element value is:%d \n”,array[getchar()]-„\‟); printf(“\n Do you wish to display another element! (y/n)); if(getchar()=‟Y‟); { printf(“\n Enter element number(1 to 10):”); printf(“The element value is:%d”,array[getchar()-]„\‟); } } 128 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.8 TWO DIMENSIONAL ARRAYS Arrays whose elements are specified by two subscripts are referred as two-dimensional arrays or double dimensional arrays. A two dimensional arrays of size m rows by n columns are declared as follows: type array-name[m][n]; A two dimensional array two dimension of type int, 3 rows and 4 columns is declared as follows: EXAMPLE int twodim[3][4]; Arrays can be stored in the memory in two orders. Row major order and column major order.Multi-dimensioanl arrays are stored in memory using the row major order. Organization of the array named twodim with 3 rows and 4 columns in the row major order is shown here: Column 1 Column2 Column 3 Column 4 Row 1 [0][0] [0][1] [0][2] [0][3] Row 2 [1][0] [1][1] [1][2] [1][3] Row 3 [2][0] [2][1] [2][2] [2][3] Elements in a two dimensional array can be accessed by means of a row and a column. The row subscript generally is specified before the column subscript. For example, twodim [1][3] will access the elements in two number 1(the second row) and in a column number (fourth) of the array. In array notation, twodim [1] represents a row and twodim [1][3] represents a column within that row. When initializing a two dimensional array at the time of array declaration, the elements will be assigned by rows, that are the elements of the first row will be assigned, then the elements of the second and so on. Consider the following array declaration: int values[3][4]={1,2,3,4,5,6,7,8,9,10,11,12} The result of this initial assignment is as follows: values[0][0]=1 values[0][1]=2 values[0][2]=3 values[0][3]=4 values[1][0]=5 values[1][1]=6 values[1][2]=7 values[1][3]=8 values[2][0]=9 values[2][1]=10 values[2][2]=11 values[2][3]=12 The values can also be initialized by forming groups of initial values enclosed within braces. The value within an integer pair of braces will be assigned to the elements of a row. 129 KSOU PROGRAMMING C St. Angelo’s Professional Education For Example, int values[3][4]={ }; {1,2,3,4} {5,6,7,8} {9,10,11,12} NOTE 1. If there are too few values within a pair of braces the reaming elements of that row will be assigned zero. 2. If the number of values in each inner pair of braces exceeds the defined row size, it will result a compilation error. 3.9 INITIALIZING TWO DIMENSIONAL ARRAYS Like single-dimensional array, a double dimensional array can also be initialized. Arrays can be initialized by the following ways, Initializing an array during declaration Initializing an array using loops 3.9.1 Initializing an array during declaration Similar to single dimensional arrays, a double dimensional array can also be initialized with one or more values during its declaration. Storage-type data type array-name[row size][col size]={list of values}; Where the storage type, may be either auto or register or static or extern. The storage type while declaring an array is optional. The datatype specifies the type of elements that will be stored in the array. The array name is the name used to identify the array. The rules for naming array names are same as identifiers .Note that an array should not have the same name as an ordinary variable in the same block or a function. For Example int marks[4][2]; marks[4][2]={82,44}, {92,65}, {73,64}, {65,100}. 130 KSOU PROGRAMMING C St. Angelo’s Professional Education The first subscript ranges from 0 to 3 and the second subscript ranges from 0 to 1.In the first case, the first inner pair of braces are assigned to the array elements in the first row, the value of second inner pair of braces are assigned to the array elements in the row and so on. The array of mark can also be declared as, int marks{82,44,92,65,73,64,65,100}; marks[0][0]=82 marks[0][1]=44 marks[1][0]=92 marks[1][1]=65 marks[2][0]=73 marks[2][1]=64 marks[3][1]=65 marks[3][2]=100 Examples for initializing an array using declaration float amount[2][3]={70.50,90.74,50.75,75.10} In the example, the size o the array is 6(3*2) and the values 1,2,3,4,5,6 are assigned to the variable amount[0][0],amount[0][1]…..amount[2][1],amount[3][1] respectively. In the second example.tje row size is missing. While initializing an array, the second dimension (i.e., colsize) is missing, but the first dimension (i.e., rowsize) is optional. 3.9.2 Initializing an array using loops An array can be initialized by using for loop, a while loop or do-while loop. The given example illustrates the use of initializing an array using for loops. Examples for initializing an array using a for loop, int i,j,mark[5][5] for(i=0;i<0;i++) scanf(“%d”,&mark[i][j]); In the example, the for loop initializes all the program elements of the array to zero.Similary, array elements of the index to zero.Similary, array can also be initialized while loop and do- while loops. 3.10 DECLARATION OF TWO-DIMENSIONAL ARRAYS The syntax of declaring a two-dimensional array is as follows: data-type variable-name[row-size][col-size]; 131 KSOU PROGRAMMING C St. Angelo’s Professional Education where, data-type->refers to any valid c data-type. variable-name->(A valid C identifier),refers to the name of the array row-size->indicates the number of rows and column size indicates the number of elements in each row Row size and column size should be integer consists or convertible into integer values. Total number of locations allocated will be equal to row size* column size. Each element in a 2D array is identified by the array name followed by a pair of square brackets enclosing its row- number, followed by a pair of square brackets enclosing its column-number. Row number ranges from 0 to row-size-1 and column number ranges from 0 to column size-1. EXAMPLE int a[3][3]; Where, a declared to be an array of two dimensions and of data type int.Row size and column size of a 3 and e respectively. Memory gets allocated to accommodate the array are as follows. It is important to note that a is the column name shared by all the elements of the array. column numbers 0 1 2 0 a[0][0] a[0][1] a[0][2] 1 a[1][0] a[1][1] a[1][2] 2 a[2][0] a[2][1] a[2][2] Each data item in the array a is identifiable by specifying the array name a followed by a pair of square brackets enclosing row number, followed by a pair of square brackets enclosing row number followed by a pair of square brackets enclosing column number. Row-number ranges from 0 to 2 that are first row is identified by row-number 0, second row is identified by row- number 1 and so on.Similary, column-number ranges from 0 to 2.First column is identified by column-number 0, second column is identified by column-number 1 and so on. a[0][0] refers to data item in the first row and first column a[0[1] refers to data item in the first row and second column … a[3][3] refers to data item in the fourth row and fourth column a[3][4] refers to data item in the fourth row and fifth column 132 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.11 EXAMPLE PROGRAMS USING TWO-DIMENSIONAL ARRAYS EXAMPLE 1 Write a program to accept and display a matrix. #include<stdio.h> #include<conio.h> void main() { int a[3][4],i ,j; clrscr(); printf(“Enter the elements of matrix a of order 3*4 \n”); for(i=0;i<3;i++) for(j=4;j<4;j++) scanf(“%d”,&a[i][j]); printf(“Matrix a \n”); for(i=0;i<3;i++) { for(j=0;j<4;j++) printf(“%4d”,a[i][j]); printf(“\n”); } getch(); } EXAMPLE 2 Write a program to calculate the sum of all elements in a matrix. #include<stdio.h> void main() { int num[5][5],i,j,m,n,sum=0; printf(“Enter the order of matrix:”); scanf(“%d %d”,&m,&n); printf(“Enter the elements of matrix:”); for(i=0;i<m;i++) for(j=0;j<n;j++) scanf(“%d”,&num[i][j]); for(i=0;i<n;i++) for(j=0;j<n;j++) sum=sum+num[i][j]; printf(“Sum of elements of the matrix is %d:”,sum); } 133 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 3 Write a to add two matrices #include<stdio.h> #include<conio.h> void main() { int a[3][3],b[3][3],c[3][3],I,j,m,n,p,q; printf(“Input Row and Column of n Matrix \n”); scanf(“%d %d”, &m,&n); printf(“Input Row and Column of B Matrix \n”); scanf(“%d %d”,&p,&q); if(n==p) && (m==q) { printf(“Matrices can be added \n”); printf(“Input A-matrix \n”); for(i=0;i<n;++i) for(j=0;j<m;++j) scanf(“%d”,&a[i][j]); printf(“Input B-matrix \n”); for(i=0;i<n++i) for(j=0;j<m;++j) scanf(“%d”,&b[i][j]); for(i=0;i<n;++i) for(j=0;j<m;++j) c[i][j]=a[i][j]+b[i][j]; printf(“Sum of A and B matrices:\n”); for(i=0;i<n;++i) { } else for(j=0;j<m;++j) printf(“%5d”,c[i][j]); printf(“\n”); } printf(“Matrices Cannot be a Added \n”); } 134 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. How to declare an array? ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. How to accessing array elements? …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 3.12 LET US SUM UP An array is a group of elements (data items) that have a common characteristics (Ex: numbeic data, character data etc.,) and share a common name. Arrays whose elements are specified by a single subscript are called one dimensional or single dimensional array. The Subscript used to declare an array is sometimes called a dimension and declaration for it sometimes called the array referred to as dimensioning. An individual element in an array can be referred to by means of the subscript. Arrays whose elements are specified by two subscripts are referred as two-dimensional array or double-dimensional arrays. 3.13 LESSION END ACTIVITIES 1. Define an array, element and subscript. 2. Explain single dimensional arrays with examples. 3. Explain double dimensional arrays with examples. 4. State the rules to be followed for during array initialization. 5. Write a program to sort the numbers in ascending order. 6. Write the syntax of declaring a one-dimensional array? 7. Explain the need of array. 135 KSOU PROGRAMMING C St. Angelo’s Professional Education 8.Find out errors, if any, in the following (a)int at(9)(8); (b)int at(9); (c)int a(3,4); (d)int [3,4]; 9. Explain the syntax of declaring a two-dimensional array with an example. 10. Write a program to generate Fibonacci series using arrays. 3.14 KEYWORDS A Collective Manipulation: A collective manipulation over a group of values is one, which requires access to each value in the group or in its selected subgroup. One-dimensional array or 1-D Array: An array with only one subscript is termed as one- dimensional array. Multidimensional Array: An array with two subscripts is termed as two-dimensional array. Matrix: A two-dimensional array enables us to store multiple rows of elements is called table of values or a matrix. Three-dimensional Array: An array with three subscripts is termed as a three-dimensional array. Elements: The individual values in the array are called as elements. Subscript: Each array element is referred by specifying the array name, followed by a number Within square braces referred as an index or subscript. 1. In C, what is the index of the first element in an array? 2. Can array indexes be negative? 3. Illustrate the initialization of a one dimensional array with an example. 4. Illustrate the initialization of a two dimensional array with an example. 5. Illustrate the declaration of a one dimensional array with an example. 6. Illustrate the declaration of a two dimensional array with an example 7. What is array? Explain. 8. Write a program to add two matrixes. 9. Write a program to multiplication of two matrixes. 10. Write a program to find the inverse of a square matrix. 136 KSOU PROGRAMMING C St. Angelo’s Professional Education Ans.1 In C, that all variables in C must be declared before use. Hence we must first declare the array. It is done at the beginning of the function main () with the statement.Ex int a[5]; this statement states that a is an array of 5 integers. Note the use of square braces after the array name (i.e a) enclosing the integer 5 that gives the number of elements in the array. Ans.2 To access particular element in an array, specify the array name, followed by square braces enclosing an integer, which is called the array index. The array index indicates the particular element of the array which we want to access. The numbering of elements starts from zero. Each element of the array that is each integer occupies two bytes. 1. Mastering C by Venugopal, Prasad – TMH 2. Complete reference with C Tata McGraw Hill 3. C – programming E.Balagurusamy Tata McGray Hill 4. How to solve it by Computer : Dromey, PHI 5. Schaums outline of Theory and Problems of programming with C : Gottfried 6. The C programming language : Kerninghan and Ritchie 7. Programming in ANSI C : Ramkumar Agarwal 137 KSOU PROGRAMMING C St. Angelo’s Professional Education MODULE-3 138 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-1 139 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 1 USER DEFINED FUNCTIONS CONTENTS 1.1 Aims and Objectives 1.2 Introduction 1.3 Need for User-Defined Functions 1.4 A Multi-Function Program 1.5 Elements of User-Defined Functions 1.5.1 Function Definition 1.5.2 Function Call 1.5.3 Function Declaration 1.6 Definition of Functions 1.7 Return Values and their Types 1.7.1 The Return Statement versus exit 1.7.2 Function Prototype 1.7.3 Types of Function 1.8 Function Calls 1.9 Function Declaration 1.10 Let Us Sum Up 1.11 Lesson End Activities 1.12 Keywords 1.13 Questions for Discussion 140 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to: Discuss for user-defined functions Define and function and function declaration Discuss about elements of user-defined function Discuss return values and their types 1.2 INTRODUCTION In the previous units, we used two types of functions such as printf() and scanf().These functions have already been written, compiled and placed in libraries are called library functions. In this unit, you study about user has chosen the function name, return data type and arguments (numbers and type), are called user-defined functions. In C functions can be classified into two categories, 1. Library functions 2. User-defined functions main() is the example of user-defined functions.printf() and scanf() are called the library functions. We already user other library functions such as sqrt(),cos(),sin(),tan(),strcmp(),strcat() etc.This is greatest features in C is that there is no conceptual difference between the user-defined functions and library functions. For example, we can write a series of function to process matrices (such as square of given number, finding cos value, finding sine value, etc).These are user-defined functions they are written by user. After user, they can be compiled into libraries and distributed. To the users of the library, these functions will act as library functions. That is these functions are predefined and precompiled; the users need not worry about the functions work internally. 1.3 NEED FOR USER-DEFINED FUNCTIONS As discussed earlier, main () is a specially recognized pre-defined function in C.In every program we have to use main () function to indicate where the program has been executed. While in any program, does not utilizing the main function, it has face to the number of problems. In C, to write a program to become too large and complex and the result has been debugging, testing, and maintaining becomes difficult. In this situation, if a program it‟s large, program is divided into functional parts, then each part may be independently coded and 141 KSOU PROGRAMMING C St. Angelo’s Professional Education executed each part of program later combined into single unit. These subprograms called function, this way to manipulate, the easier to understand, debug and test. In C, some time we need certain types of operation or calculations is repeated again and again in the program. In this situation, we use user-defined functions. This saves both the time and space. main() Function 1 Function 2 Function Function 2.1 Function 2.2 FIGURE 1.16 1.4 A MULTI-FUNCTION PROGRAM A function is a self-contained block of code that performs a particular task. Once a function has been designed and packed, it can be treated as a „block box‟ that takes some data from the main program. All that the program knows about a function is what goes in and what comes out. Every C program can be designed using a collection of block boxes known as functions. Consider the set of statement given below, #include<stdio.h> void func(); void main() { printf(“Inside the Main Function”); func(); printf(“\n Again Inside Main Function”); } void func() { printf(“\n Inside func Function”); } The above set of statements defined a function called func(), which calls the function main(),its exceeded and print the message is again inside main function. 142 KSOU PROGRAMMING C St. Angelo’s Professional Education This program will print the following output Inside main function Inside func function Again inside main function The above program contains two user-defined functions (i) Main function (ii) func () function The program execution always begins with the main function. During execution of the main, the first statements are printed “inside the main function”. Hence the function is called func().After it calls the user-defined function to print the message inside func function. After again control passes to the main() function, to print the message is called again the inside the main function. Any function calls any other function. A „called function‟ also an another function. A function can be called more than once. This is the main features of using function. Except the starting point, there are no other predefined relationship, rules of precedence, or hierarchies among the function that make up a complete program. The functions can be placed in any order. A called function can be placed in any order. A called function can be placed either before or after the calling function 143 KSOU PROGRAMMING C St. Angelo’s Professional Education The following program shows the flow of control in a multi-function program main() { ………… ………… function1(); …………… …………… function2(); …………… …………… function3() } function1() { ……………. ……………. } function2() { ……………. ……………. function3() …………… …………… } function3() { ……………. ……………. } FIGURE 1.17 144 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.4.1 Modular Programming Modular programming is a software design technique breaking a large program down into a number of functions, each of which performs a specific, well-defined task. This separates task is called modules. These modules are carefully integrated to become a software system that satisfies the system requirements. It is basically a “divide-and-conquer” approach to program solving. Modules are typically incorporated into the program through interfaces. A module interface expresses the elements that are provided and required by the module. The elements defined in the interface are detectable by other modules. The implementation contains the working code that corresponds to the elements declared in the interface. Some Benefits of modular programming are: 1. Distributed Development 2. Modular Applications 3. Versioning 4. Secondary Versioning Implementation 5. Dependancy Management 6. A modular programming Manifesto 7. Using Net Beans to do the modular programming 1.5 ELEMENTS OF USER-DEFINED FUNCTIONS A User-Defined Function, or UDF, is a function provided by the user of a program. C functions can be classified into two categories, namely, library functions and user-defined functions. Main is an example of user defined function. printf and scanf belongs to the category of library functions. The use of functions in C has many advantages: 1. It facilitates top-down modular programming. 2. The length of a source program can be reduced by using functions at a appropriate Places. 3. It is easy to locate and isolate a faulty function for further investigations. 4. A function may be used by many other programs.. 145 KSOU PROGRAMMING C St. Angelo’s Professional Education They are three elements that are related to user defined functions are: 1. Function definition 2. Function call 3. Function declaration The function definition is an independent program module that is specially written to implement the requirements of the function. In order to use this function we need to invoke it at a required place in the program. This is known as the function call. The program (or a function) that calls the function is referred to as the calling program or calling function. The calling program should declare any function (like declaration of a variable).This is known as function declaration or function prototype. 1.5.1 Function Definition A function definition, also known as function implementation it‟s include the following elements. 1. Function name 2. Function type 3. List of parameters 4. Local variable declaration 5. Function statements 6. A return statement All the six elements are grouped into two parts, namely, Function body SYNTAX return-type function-name(parameters) { Declarations; Statements; return value; } 146 KSOU PROGRAMMING C St. Angelo’s Professional Education where, return-type ->type of value returned by function or void if none function-name-> unique name identifying function parameters comma->separated list of types and names of parameters value-> value returned upon termination (not needed if return-type void) The list of parameters is a declaration on the form type1 par1, ..., typen par n And represents external values needed by the function. The list of parameters can be empty. All declarations and statements that are valid in the main program can be used in the Function definition, where they make up the function body. The function header consists of three parts: The function type (also known as return type, the function name and the formal parameters list. Note that a semicolon is not used at the end of the Function Body The function body contains the declarations and statements necessary for performing the required task. The body enclosed in braces, contains three parts, and is given below: 1. Local declarations that specify the variables needed by the function 2. Function statements that perform the task of the function 3. A return statement that returns the value evaluated by the function Example, computing averages double average(double x, double y) { return (x+y)/2; } The return statement forces the function to return immediately, possibly before reaching the end of the function body. 147 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.5.2 Function Call A function can be called by simply using the function name followed by a list of actual parameters (or arguments), if any, enclosed in parentheses. SYNTAX Variable=function-name (arguments); Variable is assigned the return-value of the function. The arguments are values with types corresponding to the function parameters. EXAMPLE int main(int argc, char **argv) { double a=1; double avg; avg = average(a, 3.0); return 0; } Implicit type conversion is used when the types of the arguments and parameters do not agree. When a function is called the value of the argument is copied to the corresponding parameter. Changes made to the parameter inside the function will not affect the argument (call by value). EXAMPLE #include <stdio.h> void decrease(int i) { i--; printf("%d ", i); } void main() { int i=1; printf("%d ", i); decrease(i); printf("%d\n", i); } gives the output 1 0 1. 148 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.5.3 Function Declaration Like variables all function in a C program must be declared, before they are invoked. A function declaration (also known as function prototype) consists of four parts. SYNTAX 1. Function type (return type) 2. Function name 3. Parameter list 4. Terminating semicolon return-type function-name(parameter types); The function body is replaced by a semi-colon. Parameters need not be named, it is sufficient to specify their types. Example declaring average double average(double, double); Declaration is not necessary if the function definition precedes the first call. 1.6 DEFINITION OF FUNCTIONS A function is defined as a self-contained program which is written for the purpose of A function definition consists of two parts. They are, 1. Argument declaration 2. Body of the function The first part of the function specification consists of type specification of the value returned by the function followed by the function name, a set of arguments (may or may not be present) separated by commas and enclosed in parenthesis. If the function definition does not include any arguments, an empty pair of parenthesis must follow the function name. 149 KSOU PROGRAMMING C St. Angelo’s Professional Education SYNTAX returntype functionname(argument list) { declaration(s); statement(s); return(expression); } where returntype->specifies the data type value to be returned by the function. The return type is assumed to be of type int by default if it is not specified. function name-> used to identify the function. The rules for naming a function are Same as identifiers. argument list->specified inside the parenthesis after the function name is optional. Most functions have list of parameters and a return value that provides means for communication between functions. The arguments in the function reference, which defines the data items that are actually transferred, are referred as actual arguments or actual parameters. All variables declared in function definitions are local variables. Their scope is visible known only in the function in which they are defined. Functions arguments are als0 local variables. EXAMPLE Write a program for sum of two numbers and return the sum to the main function. #include<stdio.h> void main() { printf(“\n Enter two number to be summed:”); scanf(“%d %d”,&a,&b); printf(“\n The sum of %d and %d is %d”,a,b,sum); } { int tot; tot=num1+num2; return(tot);} 150 KSOU PROGRAMMING C St. Angelo’s Professional Education Sample program output: Enter two numbers to be summed: 15, 17 The of 15 and 17 is 32 The above program consists of two functions, The required main function The programmer defined function addnum, which sums the two values. The function main reads in two integer values, and assigns them to a and b.Then, main calls addnum, transferring the integer values a and b receiving their sum. The sum is then displayed and the program terminates. The integer values are transferred via the arguments num1 and num2,and their sum tot is returned to the calling portion of the program via the return statement. 1.7 RETURN VALUES AND THEIR TYPES 1.7.1 The return () Statement versus exit() The return statement is used to return the control from the calling function to the next statement of the called portion of the program. The return statement also causes program logically to return to the point from where the function is accessed (called).The return statement returns one value per call. The return statement can be any one of the types as shown below, return; return(); return(constant); return(variable); return(expression); return(conditional expression); return(function); The first and second return() statements, does not return any value, and are just equal to the closing brace of the function. If the function reaches the end without using a return statement, the control is simply transferred back to the calling portion of the program without returning any value. The return() statement returns a value 1 to the calling function. The third return() statements returns a value 1 to the calling function. 151 KSOU PROGRAMMING C St. Angelo’s Professional Education The exit() is build-in function available as part of C library.The common thing shared by both the return statement and the exit() is that both are used to exit the function in which they are used. EXAMPLE 1 if(fact<=1) return(1); This return() statement return a constant q when the condition specified inside the if statement evaluates to true. EXAMPLE 2 return(num1+num2+num3); This return() statement returns a value depending upon the result of the conditional expression specified inside the parenthesis. EXAMPLE 3 return(power(5,2)); This return() statement calls the function specified inside the parenthesis and collects the result obtained from that function, and returns it to the calling function. NOTE The limitation of a return statement is that it can return only one value from the called function to the calling function. The return statement can be present anywhere in the function, not necessarily at the end of the function. Number of return statements used in a function is not restricted, since the return statement which executes first will return the value from the called function to the calling function and the other return statements are left unexpected. If the called function does not return any value, then the keyword void must be used as the return specifier. Parenthesis used around the expression in a return statement is optional. 152 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.7.2 Function Prototypes A C function returns an integer value by default. Whenever a call is made to a function the compiler assumes that this function would return a value of type int.If you decide that a function should return a value other that int, then it is necessary to mention the first line of the function in the program, before it is used, which is called the function prototype also referred as the function declaration. Function prototypes are usually written at the beginning of the program explicitly before all user-defined functions including the main() function. SYNTAX return type function name(dt1 arg1,dt2 arg2…dtn argn) where, return type->represents the data type of the value that is returned by the function dt 1,dt 2…dt n->represents the data types of the arguments arg1,arg2…argn->The data types of the arguments should be specified compulsorily in the Function definition EXAMPLE int sum(int num) where sum is the name of the function,int before the function name sum() indicates that the function returns a value of type int.The variable num inside the parenthesis is the parameter passed to the called function. The data type int before the parameter num indicates that is type integer. 1.7.3 Types of function A function depending upon the arguments present or not and whether a value is returned or not, may be classified as Function with no arguments and no return values Function with return values and no arguments Function with arguments and no return values Function with arguments and return values 153 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.8 FUNCTION CALLS A function can be accessed (i.e., called) by specifying its name, followed by a list of arguments enclosed in parenthesis and separated by commas. If the function call doesn‟t require any argument an empty pair of parentheses must follow the function‟s name. The arguments appearing in the function call are referred to as actual arguments. The actual arguments may be expressed as constants, single variables, or more complex expressions. The number of actual arguments must be the same as the number of formal arguments. Each actual argument must be the same data type as its corresponding formal argument. EXAMPLE To write a program to find maximum of given number using function #include<stdio.h> void main() { int maximum(int,int); int a,b,c,d; printf(“\n a=”); scanf(“%d”,&a); printf(“\n b=”); scanf(“%d”,&b); printf(“\n c=”); scanf(“%d”,&c); d=maximum(a,b); printf(“\n \n maximum=%d”,maximum(c,d)); } int maximum(x,y) int x,y; { int z; z=(x>=y)?x:y; return(z); } Sample program output a=10 b=20 c=30 maximum=30 154 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.9 FUNCTION DECLARATION Whenever a function return a value than an integer, the calling function must declare the return type of the function.Therefore,a function declaration must be present in the calling portion of a program if a function returns a non integer value and the function call precedes the function definition. SYNTAX data-type name arg type1,arg type2…arg type n Where NOTE data-type-> represents the data types of the value returned by the function name->represents the function name and arg type2…arg type n represents the data types of the first argument second argument and so on respectively. The data-types of arguments are optional in the function declaration when the argument data-types are included in the function declaration the complex will convert the value of each argument to the declared data-type(if necessary) and then compare each actual data-type with its corresponding formal argument. A compilation error will result if these data- types do not agree. Thus a function declaration will reveal the data-type inconsistencies detected during the compilation process. so far the functions returning either no value (void) or an (int) have been considered. EXAMPLE To write a program to display power of given number using function #include<stdio.h> void main() { double power(float,int); int exponent; float number; scanf(“%f”,&number); printf(“\n please enter a non-negative number”); scanf(“%d”,&exponent); printf(“\n \n %f raised to the power %d is %f”,number,exponent,power(number,exponenent)); 155 KSOU PROGRAMMING C St. Angelo’s Professional Education } double power(float base,int p) { double result; for(result=1.0;p>0;--p) result=result*base; return(result); } Sample program output 2 raised to the power 3 is 8.000000 As mentioned earlier the use of keyword void for the return data-type in the function indicates that the function does not return anything. Function declarations may also include void in argument list in both function definition and declarations to indicate that a function does not require argument .The general form for this types of functions is data-type func_name (void). 1. What is a function? ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. What is prototyping? Why it is necessary? …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 1.10 LET US SUM UP A function is a self-contained program segment that performs some specific well defined Three steps in using a function are declaring a function, defining a function and calling the function. A function is called by specifying its name, followed by a pair of parenthesis, which contains parameters if needed. 156 KSOU PROGRAMMING C St. Angelo’s Professional Education The argument that represents the names of data items that are transformed into the function from the calling portion of the program are called as formal arguments or formal parameters. The corresponding arguments in the function reference which define the data items that are actually transferred are called as actual arguments or actual parameters. The return statement is used to return the information from the function to the calling function of the program A function may be declared anywhere as long as its declaration is above all reference to the function.So, a function should be declared before it is called. The execution of a function is terminated when it executes the return statement or when the last statement of the function is executed or when it encounters the closing brace of the function. A function prototype declares the return type of the function and declares the number type and the sequence of the parameters that a function will receive. 1.11 LESSONS END ACTIVITIES 1. What is difference between function declaration and function definition? 2. What is the return () statement mandatory in a function? 3. State several advantages to the use of functions. 4. Explain the meaning of the following function declaration: double f(double a,int b); 5. What is the purpose function prototyping? 6. State whether the following statements are true or false. (a)C functions can return only one value under their function name. (b)A function in C should have at least one argument. (c)A function can be defined and placed before the main function (d)A user-defined function must be called at least once; otherwise a warning message will be used. (e)The return type of a function “float” by default. 157 KSOU PROGRAMMING C St. Angelo’s Professional Education 1.12 KEYWORDS main ():main() is a specifically recognized function in C.Every Program must have a main() function to indicate where the program has to begin its execution. Function Definition: function definition is an independent program module that is specially written to implement the requirements of the function. Function Call: The program or a function that calls the function is referred to as the calling program or calling function. Function Definition or Function Prototype: The calling program should declare any function (like declaration of variable) that is to be used later in the program. This is known as the function declaration or function prototype. Function Body: The function body contains the declarations and statements necessary for performing the required task. The body enclosed in braces, contains three parts. return (): A return() statement that returns the value evaluated by the function. Function parameters: Function parameters are the means of communication between the calling and the called functions. Formal parameters: The formal parameters (commonly called parameters) are the parameters given the function declaration and function definition. 1.13 QUESTIONS FOR DISCUSSION 1. What is the need for functions? 2. What is a function? 3. Explain the general form of defining a function. 4. What are formal arguments? 5. What are actual arguments? 7. What do you mean by function call? 8. Difference between build-in functions and user-defined functions. Give examples. 9. Define function prototype. 10. What is calling function? 11. What is called function? 12. Write a program to swap two numbers using functions. 158 KSOU PROGRAMMING C St. Angelo’s Professional Education Ans.1 A function is a self-contained program segment that carries out some specific, well- defined task. Functions break large computing tasks into smaller ones, C has been designed to make a function efficient and easy to use.C programs generally consist of many small functions rather than a few big ones. Ans.2 Whenever a call is made to a function the compiler assumes that this function would return a value of type int.If you decide that a function should return a value other that int, then it is necessary to mention the first line of the function in the program, before it is used, which is called the function prototype also referred as the function declaration. 1. Programming in ANSI C - Agarwal 2. Let us C - Kanitkar 3. Programming in ANSI C - Balguruswamy 4. How to solve it by Computer: Dromey, PHI 5. Schaums outline of Theory and Problems of programming with C : Gottfried 159 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-2 160 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 2 FUNCTIONS CONTENTS 2.1 Aims and Objectives 2.2 Introduction 2.3 Category of Functions 2.4 No Arguments and no return values 2.5 Arguments but no return values 2.6 Argument with return values 2.7 No argument but returns a value 2.8 Function that return multiple values 2.9 Let Us Sum Up 2.10 Lesson end Activities 2.11 Keywords 2.12 Questions for Discussion 2.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to : Discuss for different categories of function Understanding different categories of function with example Define function that return multiple values Discuss arguments with and without values 161 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.2 INTRODUCTION A function in C language is a block of code that performs a specific task. It has a name and it is reusable i.e. it can be executed from as many different parts in a C Program as required. It also optionally returns a value to the calling program. Some of the important properties of function given below, Every function has a unique name. This name is used to call function from “main ()” function. A function can be called from within another function. A function is independent and it can perform its task without intervention from or interfering with other parts of the program. perform as a part of its overall operation, such as adding two or more integer, sorting an array into numerical order, or calculating a cube root etc. A function returns a value to the calling program. This is optional and depends upon the task your function is going to accomplish. Suppose you want to just show few lines through function then it is not necessary to return a value. But if you are calculating area of rectangle and wanted to use result somewhere in program then you have to send back (return) value to the calling function. C language is collection of various inbuilt functions. If you have written a program in C then it is evident that you have used C‟s inbuilt functions. printf, scanf, exit, all are C‟s inbuilt functions. You cannot imagine a C program without function 2.3 CATEGORY OF FUNCTIONS A function depending on whether arguments are present or not and whether a value is returned or not, hence functions are categorized in the following manner: : A function may belong to any one of the following categories: 1. Functions with no arguments and no return values. 2. Functions with arguments and no return values. 3. Functions with arguments and return values. 4. Functions that return multiple values. 5. Functions with no arguments and return values 162 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.4 NO ARGUMENTS AND NO RETURN VALUES When a function has no arguments, it does not receive any data from the calling function, similarly when a function has no return values, the calling function does not receive any data from the called function. There is no data transfer between the calling function and the called function. The given diagram describes no arguments and no return values that is, no data communication between functions. function 1() { ………….. ………….. function 2() ………….. …………… } control no i/p function 2() { ………….. ………….. function42() ………….. …………… } no o/p FIGURE 1.18 EXAMPLE To write a program using function no arguments no return values #include<stdio.h> #include<conio.h> Void main() { display (); } Void display() { char empname[25]; printf(“Enter the Employee Name:”); scanf(“%c”,&empname); printf(“%c Employee Name is:”,empname); } Sample program output Enter the Employee Name: senthil Employee Name is: senthil 163 KSOU PROGRAMMING C St. Angelo’s Professional Education main() is the calling function which calls the function display().The function display() contains no arguments and hence, there are no argument declarations. Note that the called function that is display receives its data that is name of the employee directly from the input terminal that is keyboard and display the contents of a employee name to the output terminal that is screen in the called function itself. No return statement is employed since there is nothing to be returned. The closing brace of the function indicates the end of execution of the function, thus returning the control, back to the calling function. The keyword void is used before the function display () to indicate that there are no return values. 2.5 ARGUMENTS BUT NO RETURN VALUES When a function has arguments, it receives data from the calling function. The main () function will not have any control over the way in which the functions receives its input data. We can also make the calling function to read data from the input terminal and pass it to the called function. This approach seems better because the calling function can check the validity data, before it is passed over to the called function. NOTE Function accepts argument but it does not return a value back to the calling program. It is single (one-way) type communication. Generally output is printed in the called function Here area is called function and main is calling function. EXAMPLE Write a program to find area of circle using function. #include<stdio.h> #include <conio.h> void area; void main() { getch(); } { printf(“Area of circle = %f”,area); } 164 KSOU PROGRAMMING C St. Angelo’s Professional Education Sample program output Enter the radius : 3 Area of circle=28.2640000 The function receives one arguments (i.e area ()) .The argument are of floating type. No return statement is employed since there is nothing to be returned. The closing brace of the function signals the end of the function thus returning the control back to the calling function. The keyword void is used before the function name area() to indicate that there are no return values. FIGURE 1.19 2.6 ARGUMENTS WITH RETURN VALUES When a function has arguments it receives data from the calling function and does some process and then returns the result to the called function. In the way the main() function will have control over the function. This approach seems better because the calling function can check the validity of data before it is passed to the called function and to check the validity of the result before it is sent to the standard output even (.i.e., screen).Note that when a function is called, a copy of the values of actual arguments is passed to the called function. EXAMPLE To write a program to find sum of two numbers. #include<stdio.h> #include<conio.h> { int result; result = x+y; return(result); } 165 KSOU PROGRAMMING C St. Angelo’s Professional Education void main() { int z; clrscr(); printf("Result %d.\n\n",z); getch(); } Sample program output Result 85 Result 1273 FIGURE 1.20 This program sends two integer values (x and y) to the User Defined Function “add()”, “add()” function adds these two values and sends back the result to the calling function (in this program to “main()” function). Later result is printed on the terminal. This int is the return type of the function, means it can only return integer type data to the calling function. If you want any function to return character values then you must change this to char type. You can assign any integer value to experiment with this return which ultimately will change its output. Why we are using integer variable “z” here? You know that our User Defined Function “add()” returns an integer value on calling. To store that value we have declared an integer value. We have passed 952, 321 to the “add()” function, which finally return 1273 as result. This value will be stored in “z” integer variable. Now we can use “z” to print its value or to other function. 166 KSOU PROGRAMMING C St. Angelo’s Professional Education 2.7 NO ARGUMENTS BUT RETURNS A VALUE When a function has no arguments, it does not receive any data from the calling function, but it can do some process and then return the result to the called function. Hence there is data transfer between the calling function and the called function. EXAMPLE To write a program to take one integer from keyboard and display it #include<stdio.h> #include<conio.h> int send() { int no1; printf("Enter a no : "); scanf("%d",&no1); return(no1); } void main() { int z; clrscr(); z = send(); printf("\nYou entered : %d.", z); getch(); } Sample program output Enter a no: 5 You entered: 5 FIGURE 1.21 167 KSOU PROGRAMMING C St. Angelo’s Professional Education In this program we have a User Defined Function which takes one integer as input from keyboard and sends back to the calling function. 2.8 FUNCTION THAT RETURN MULTIPLE VALUES In a function, return statement was able to return only single value. That is because; a return statement can return only one value. But if we want to send back more than one value. We have used arguments to send values to the called function, in the same way we can also use arguments to send back information to the calling function. The arguments that are used to send back data are called Output Parameters. EXAMPLE To write a program to add, subtract of two numbers using function. #include<stdio.h> #include<conio.h> void calc(int x, int y, int *add, int *sub) { *sub = x-y; } void main() { int a=20, b=11, p,q; clrscr(); calc(a,b,&p,&q); printf("Sum = %d, Sub = %d",p,q); getch(); } Sample program output Sum=31, Sub=9 We call User Defined Function “calc ()” and sends argument then it adds and subtract that two values and store that values in their respective pointers. The “*” is known as indirection operator whereas “&” known as address operator. We can get memory address of any variable by simply placing “&” before variable name. In the same way we get value stored at specific memory location by using “*” just before memory address. This User Defined Function is different from all above it implements pointer. Pointer can only store address of the value rather than value but when we add * to pointer variable then we can store value of that address. When we call “calc()” function in the line no. 12 then following assignments occurs. Value of variable “a” is assigned to “x”, value of variable “b” is assigned to 168 KSOU PROGRAMMING C St. Angelo’s Professional Education “y”, address of “p” and “q” to “add” and “sub” respectively. In line no. 5 and 6 we are adding and subtracting values and storing the result at their respective memory location. 1. Define category of functions. ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. What is mean by no arguments and no return values? …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 2.9 LET US SUM UP A return statement can occur anywhere within the body of a function. A function definition may be placed either after or before the main function. When the value returned is assigned to a variable, the value will be converted to the type of the variable receiving it. A function with void return type cannot be used in the right-hand side of an assignment statement. It can be used only as a stand-alone statement. A function that returns a value cannot be used as a stand-alone statement. Where more functions are used, they may be placed in any order. A global variable used in a function will retain its value for future use. A local variable defined inside a function is known only to that function. It is destroyed when the function is exited. 2.10 LESSION END ACTIVITIES 1. Fill in the blanks in the following statements. a. The parameters used in a function call are called_ . b. A variable declared inside a function is called . c. By default, is the return type of a C function. 169 KSOU PROGRAMMING C St. Angelo’s Professional Education d. In prototype declaration, specifying is optional. 170 KSOU PROGRAMMING C St. Angelo’s Professional Education e. A function that calls itself is known as a function. f. If a local variable has to retain its value between calls to the function, it must be declared as . g. A the compiler to check the matching between the actual arguments and the formal ones. 2. Find errors in the following function calls: a. void xyz () b.xyz (void); c.xyz (int x,int y); d.xyz () + xyz (); 2.11 KEYWORDS Category of Functions: A function depending on whether arguments are present or not and whether a valued is returned or not depending on types of function based. No arguments and no return values: When a function has no arguments, it does not receive any data from the calling function. Arguments but no return values: The calling function to read data from the terminal and pass it on to the called function. Arguments with return values: It receives data from the calling function through arguments, but does not send back any value. No arguments but return a value: We may need to design a function that may not take any arguments but return a value to the calling function. Functions that return multiple values: A return statement can return only value, but functions that return multiple values. Output parameters: The arguments than are used to “send out” information are called output parameters. 171 KSOU PROGRAMMING C St. Angelo’s Professional Education Ans.1 A function depending on whether arguments are present or not and whether a value is returned or not based these function categories in the following manner. A function may belong to any one of the following categories: Functions with no arguments and no return values, Functions with arguments and no return values, Functions with arguments and return values, Functions that return multiple values, Functions with no arguments and return values. Ans.2 When a function has no arguments, it does not receive any data from the calling function, similarly when a function has no return values, the calling function does not receive any data from the called function. There is no data transfer between the calling function and the called function. s 2.12 QUESTIONS FOR DISCUSSION 1. What is a function? Define its properties. 2. Explain different categories of functions with example. 3. Explain functions with no arguments and no return values. 4. Explain functions with arguments and no return values. 5. Explain functions with arguments and return values. 6. Explain functions that return multiple values. 7. Functions with no arguments and return values. 1. Structured Programming Approach C.Behrouz A.Forouuzan and Richard F.Gilberg, 2nd Edition, Thomson 2001. 2. Programming with ANSI and Turbo C, Ashok N.Kamathane, Ist Edition, Pearson Education Asia 2002. 3. Beginning C:From Novice to Professional.Ivor Horton,4th Edition,Springer,India 2006. 172 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-3 173 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 3 POINTERS CONTENTS 3.1 Aims and Objectives 3.2 Introduction 3.3 Understanding Pointers 3.4 Accessing the Address of Variable 3.5 Declaring a Pointer Variables 3.6 Initialization of Pointer Variables 3.7 Accessing Variable through its Pointers 3.8 Pointer Example Programs 3.9 Let Us Sum Up 3.10 Lesson End Activities 3.11 Keywords 3.12 Questions for Discussion 3.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to; Discuss for Pointers Definition and Initialization of Pointer Variables Understanding Accessing Variable through its Pointers Define Declaring Pointer Variables Discuss Different example Program for Pointers 174 KSOU PROGRAMMING C St. Angelo’s Professional Education 3.2 INTRODUCTION Pointers are a powerful concept in C and add to its strength. The pointer enable to 1. Write efficient and concise programs 2. Establish inter-program data communication 3. Dynamically allocate and De-Allocate memory 4. Optimize memory space usage 5. Deal with hardware components 6. Pass variable number of arguments to functions The memory (RAM) of a computer is organized as an array of consecutively memory cells. Since there usually will be several thousands of memory location in the RAM, the CPU needs some mechanism to identify and request transfer of data from and to a particular location. Each location in the RAM has been given a unique identification number, called an address of that memory location.Therefore,it is imperative that, every memory location should have only one address and one address should correspond to only one memory location. Every variable and every function has an address and these addresses are distinct for each variable and function. The identifiers used for variables and functions enable the programmer to refer memory locations by name. A variable name is a symbolic reference given to a memory location. Each variable and character string has an address that describes its location. The compiler translates these names into address. For example, consider the statement product=var1*var2. If var1 occupies the address 1000 and var2 occupies the address 1005, and product occupies 1025, the above statement will be interpreted by the compiler as move the contents of the memory location 1000 and 1005 into the CPU registers, multiply them and move the resultant product to the memory location 1020. A pointer is a variable that represents the location (rather than a value) of a data item, such as variable or an array element. 3.3 UNDERSTANDING POINTERS The computer‟s memory is a sequential collection of „Storage Cells‟ as shown in following figure. Each cell, commonly known as a byte, has a number called Address Associated with it. Typically; the addresses are numbered consecutively, starting from zero. 175 KSOU PROGRAMMING C St. Angelo’s Professional Education . . . . . : : : : : : The last address depends on the memory size. A computer system having 64K memory will have its last address as 65535. 0 1 2 : : : : : : : : : : : 1022 1023 1024 We know that variables are to be declared before they are used in a program. Declaration of a variable conveys two things to the compiler. As a result, the compiler 1. Allocates a location in memory. The number of bytes in the location depends on the data type of the variable. 2. Establishes a mapping between the address of the location and the name of the variable. Whenever we declare a variable, the system allocates some location in the memory, an appropriate location to hold the value of the variable. Since every byte has a unique address number, this location will have its own address number. Consider the following declaration of statement: int price=250; This statement tells the system to find a location for the integer variable price and put the value 250 in the location. Let us consider that the system has chosen the address location 4000 for price. Representation of variable in the following figure: 176 KSOU PROGRAMMING C St. Angelo’s Professional Education Quantity Variable 250 Value During execution of the program, the system always associates the name price with the address 5000.We may access to the value 250 by using either the name price or the address 4000.Since memory address are simply numbers, they can be assigned to some variables, which can be stored in memory, like any other variable. Such variables that hold memory address are called pointer variables. A pointer variable is, therefore, nothing but a variable that contains an address, which is a location of another variable in memory. Since a pointer is a variable, its value is also stored in the memory in another location. Suppose, we assign the address of price to a variable p. The link between the variables p and quantity can be visualized as shown in the following figure. The address of p is 4050. price 250 4000 p 5000 4050 Since the value of the variable p is the address of the variable price, we may access the value of price by using the value of p and therefore, the variable p „points‟ to the variable price. Thus p gets the name „pointer‟ Pointers are constructing on the three important concepts as shown below: Pointers Constants Pointers Values Pointers Variables Pointers FIGURE 1.22 177 KSOU PROGRAMMING C St. Angelo’s Professional Education Memory address within a computer is referred to as pointer constants. We cannot change them; we can only use them to store data values. We cannot save the value of a memory address directly. We can only obtain the value through the variable stored there using the address operator (&).The value thus obtained is known as pointer value.the pointer value may change from one program to another. Once we have a pointer value, it can be stored into another variable. The variable that contains a pointer value is called a pointer variable. 3.4 ACCESSING THE ADDRESS OF A VARIABLE We declare a variable; the amount of memory needed is assigned for it at a specific location in memory (its memory address). The address that locates a variable within memory is what we call a reference to that variable. This reference to a variable can be obtained by preceding the identifier of a variable with an ampersand sign (&), known as reference operator, and which can be literally translated as "address of". EXAMPLE p = &quantity; This would assign to ted the address of variable quantity, since when preceding the name of the variable quantity with the reference operator (&) we are no longer talking about the content of the variable itself, but about its reference (i.e., its address in memory). From now on we are going to assume that quantity is placed during runtime in the memory address 2000. This number (2000) is just an arbitrary assumption we are inventing right now in order to help clarify some concepts in this tutorial, but in reality, we cannot know before runtime the real value of address of a variable will have in memory. Consider the following code fragment: 1.quantity = 25; 2.p = quantity; 3.p = &quantity; 178 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE Write a program to print the address of a variable along with its value. #include<stdio.h> #include<conio.h> void main() { char a; int x; float p,q; a=‟A‟; x=125; p=11,q=35.50; printf(“%c is stored at address %u \n”,a,&a); printf(“%d is stored at address %u \n,x,&x”); printf(“%f is stored at address %u \n”,p,&p); printf(“%f is stored at address %u”,q,&q); } 3.5 DECLARING POINTER VARIABLES Declaring pointer variable is quite similar to declaring a normal variable but before insert a star „*‟ operator before it. SYNTAX data-type *pt-name; where 1.The asterisk(*)->represents that the variable pt-name is a pointer variable 2.pt-name->represents memory location 3.pt_name->represents points to a variable of type data-type EXAMPLE 1 int *p; declares the variable p as a pointer variable that points to an integer data type. That the data type int refers to the data type of the variable being pointer by p and not the value of the pointer. 179 KSOU PROGRAMMING C St. Angelo’s Professional Education ? EXAMPLE 2 float *x; Declares x as a pointer to a floating-point variable. The above pointer variable declaration cause the compiler to allocate memory locations for the pointer variable p and x.Since the memory locations have not been assigned any values, these locations may contain some unknown values in them and therefore they point to unknown locations as shown in the following figure given below: int *p; p ? Contains garbage points to unknown location Can we declare the pointer variable in the following type of the manner, 1. int *p; 2. int *p; 3. int *p; In the second type has become most popular because the following reason, 1. It is convenient to declare multiple declarations in the same manner EXAMPLE int *p,x,*q; 2. This type matches with the format used for accessing the target values. EXAMPLE int x,*p,y; x=10; p=&x; y=*p; *p=20; 3.6 INITIALIZATION OF POINTER VARIABLES Like ordinary variables, a pointer variable can also be initialized. Static and external (global) pointer variables are initialized with NULL by default. When the stat „* operator‟ is applied to a pointer variable to which any address has not been assigned, the pointer points to an 180 KSOU PROGRAMMING C St. Angelo’s Professional Education unknown location. So, applying * to such a pointer is dangerous.Therefore, before a pointer variables is used to access an object, the pointer should be made to point at a valid object. Once a pointer variable has been declared we can use the assignment operator to initialize the variable. EXAMPLE int price; int *p; p=&price; We can also possible combine the initialization with the declaration. That is, int *p=&price; Pointers are used to be allowed. The only represent here is the variable price must be declared before the initialization takes place. Pointer variables always point to the corresponding type of data. EXAMPLE float a,b int x,*p; p=*a; b=*p; will result erroneous output because we are trying to assign the address of a float variable to an integer pointer. When we declare a pointer to be int type, the system assumes that any address that the pointer will hold will point to an integer variable. Since the compiler will not detect such errors, care should be taken to avoid wrong pointer assignments. int x,*p=&x; The above statement is perfectly valid. It declares x as an integer variable and p as a pointer variable and then initializes p to the address of x and the following statement is also wrong that the target variable x is decal red first. The statement given below, is not valid. int *p=&x,x; It also defines the pointer variable with an initial value NULL or 0(Zero).The following statement given below, 181 KSOU PROGRAMMING C St. Angelo’s Professional Education int *p=NULL; int *p=0; with the exception of NULL and 0,no other constant value can be assigned to a pointer variable. int *p=5000; It is also possible to pointers are flexible. We can make the same pointer to point to different data variables in different statements. int x,y,z,*p; …………. p=&x; …………. p=&y; ………… p=&z; ……….. x y z p It can also possible for different pointers to point the same data variable. EXAMPLE int x; int *p1=&x; int *p2=&x; int *p3=&y; p1 p2 p3 x 3.7 ACCESSING VARIABLE THROUGH ITS POINTERS Pointers are variables that contain address. Suppose v is a variable that represents some particular data item. The compiler will automatically assign memory cells for this data item. The data item can be accessed if the location (that is the address of the memory cell) is known. The address of v‟s memory location can be determined by the expression &v, where & is a unary operator called an address operator. The address v is assigned to another variable pv as follows: pv=&v.This new variable is called as pointer to v, since it points to the location where v is stored. In above explanation, pv represents v‟s address, not its value.Thus, pv is referred to as a pointer variable. Pointer variables are declared as follows: type *variable_name; For example, a pointer to a character variable is declared as, char *cpt; where the variable‟s name is cpt and the value it holds is a character‟s address. The asterisk preceding the variables name informs the compiler that this variable does not hold the character‟s address and not a 182 KSOU PROGRAMMING C St. Angelo’s Professional Education charcter.The * used above is a unary operator and is known as the indirection or referencing operator. When applied to a pointer, it accesses the object the pointer points to. A Variable that contains integer‟s address is declared as follows: int *ipt; where iptr is the name of the pointer variable. Several pointers can also be declared in a single declaration as: int x, y,*iptr,*jptr; where x and y is regular integers and iptr and jptr are pointers to integer type of variables. Each data type in C has its own associated pointer type. A Pointer is to void the generic pointer and can be used to point any type of object. This implies that a pointer of any type can be assigned to pointers of type void (and vice versa), if appropriate type casts are used. The void pointer is particularly useful when various types of pointers are manipulated by a single routine. The void pointer is declared as follows void *p. To obtain a variable‟s address, the &operator is used. This operator applies only to objects in the memory such as variables and array elements. It cannot apply to expressions or constants. EXAMPLE #include<stdio.h> void main() { int x,*intptr; intptr=&x; printf(“Enter an integer”); scanf(“%d”,intptr); printf(“\n The value entered is %d \n”,x); } Sample program output Enter an integer: 1234 The value entered is: 1234 In the above program, two variables, an integer name x and pointer to an integer name intptr.The variable intptr is set to the address of the variable x.The value of the pointer variable, intptr is passed to the scanf () function instead of &x, the address of x. In the above example, if the variable x is at memory location 2000 and intptr which is also another variable (pointer) has its own memory location. The value assignments and storage locations in the program samepoint.c would be given below: 183 KSOU PROGRAMMING C St. Angelo’s Professional Education After the int x,*intptr; x *intptr 2000 2002 After the line intptr=&x; x *intptr 2000 2002 After the line of scanf(“%d”,input) x *intptr 2000 2002 3.8 POINTER EXAMPLE PROGRAMS EXAMPLE 1 Write a program to swap two numbers using pointers #include<stdio.h> void main() { int a,b; printf(“\n Enter two Numbers…”); scanf(“%d %d”,&a,&b); clrscr(); printf(“\n Before Exchange…%d \t %d”,a,b); exchange(&a,&b); printf(“\n After Exchange…%d \t %d \t”,a,b); getch(); } exchange(m,n) int *m,*n; { int t; t=*m; *m=*n; *n=t; return; } 184 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE 1 Write a program to find largest of two numbers using pointer include <stdio.h> int main () { int data[100]; int* p1; int *p2; for (int i = 0; i <100;i++) { data[i] = i; } p1 = &data [1]; p2 = &data [2]; if (p1 > p2) { printf ("\n\n p1 is greater than p2"); } else { printf ("\n\n p2 is greater than p1"); } } 1. Define a pointer variable. ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. Explain the uses of pointers. …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 3.9 LET US SUM UP A pointer is a variable, which represents the memory location (not the value) of a data items, such as a variable or an array element. 185 KSOU PROGRAMMING C St. Angelo’s Professional Education Like all variables a pointer variable should also be declared before they are used. The ampersand operator (&) gives the address of a variable. The three values that can be used to initialize the pointer are zero, null and address. The pointer that has not been initialized is referred to as the dangling pointer. Only an address of a variable can be stored in a pointer variable. Do not store the address of a variable of one type into a pointer variable of another type. The value of a variable cannot be assigned to a pointer variable. A pointer variable contains garbage until it is initialized. 3.10 LESSON END ACTIVITIES 1. What is the output of the following program? void main() { int a[10],*ap,*bp; ap=a; bp=&a[0]; printf(“%d”,ap,bp); } 2. What is the output of the following program? void main() { int a[10]={1,2,3,17},*ap,*bp; ap=a; bp=&a[3]; printf(“%d %d”,*ap,*bp)); } 3. Fill in the blanks in the following statements: a. A pointer variable contains as its value the of another variable. B.The operator is used with a pointer to de-reference the address Contained in the pointers. 186 KSOU PROGRAMMING C St. Angelo’s Professional Education C.The operator returns the value of the variable to which it has operand points. D.The only integer that can be assigned to a pointer variable is . E.The pointer that is is declared as _cannot be de-referenced. 4. How is a pointer initialized? 5. Explain the uses of pointers. 3.11 KEYWORD Pointers: A pointer is a variable, which represents the location (not the value) of a data item, such as variable or array element. Address: A byte is a basic storage and accessible unit in memory. Indirection operator or deference operator: The indirection operator (*) is also called the dereference operator. When a pointer is dereferenced, the value at the address stored by the pointer is retrieved. Pointer Initialization: A pointer is a variable that contains the memory location of another variable. Pointer Arithmetic: The arithmetic operations that can be performed on pointers are addition and subtraction. You can also use increment or decrement operator. 3.12 QUESTIONS FOR DISCUSSION 1. What is the meaning of the following declaration: int *px; 2. The indirection operator can be applied to type of operand. 3. State the uses of address operator in pointers. 4. State the uses of indirection operator in pointers. 5. State the need for memory allocation in programs. 6. Write a program to find the largest of three number using pointers. 7. Write a program to sort the strings in alphabetical order using pointers. 8. What are the advantages of pointer? 9. Give the significance of & and * operators. 187 KSOU PROGRAMMING C St. Angelo’s Professional Education Ans.1 Pointers are variable that contain address. Suppose v is a variable that represents some particular data item. The compiler will automatically assign memory cells for this data item. The data item can be accessed if the location that is address of the memory cell is known. Ans.2 Usage of pointers result in a more compact and efficient code. Pointers can be used to achieve clarity and simplicity. Pointers are used to pass information back and forth between function and its reference point. They provide a way to return multiple area items from a function using its function arguments pointers also provide an alternate way to access an array element. Pointers enable one to access the memory directly. 1. Programming with C : Bryon Gottfried 2. Let us C: Yashwant Kanetkar. 3. C programming: Dennis Ritchie 4. Programming in ANCI C: Balgurusamy 5. Graphics under C: Yashwant Kanetkar 6. Pointers in C: Yashwant Kanetkar 188 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-4 189 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 4 STRUCTURES AND UNION CONTENTS 4.1 Aims and Objectives 4.2 Introduction 4.3 Declaring a Structure 4.4 Defining a Structure 4.4 Accessing Structure Members 4.5 Initializing a Structure 4.6 Operations on Structures 4.7 Arrays and Structures 4.7.1 Arrays of Structures 4.7.2 Arrays within Structures 4.8 Union 4.9 Difference between Structure and Union 4.10 Let Us Sum Up 4.11 Lesson end Activities 4.12 Keywords 4.13 Questions for Discussion 4.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to: Discuss the structures definition and initialization of structure variables Understanding Accessing Structure Members Define operations and array of structures 190 KSOU PROGRAMMING C St. Angelo’s Professional Education 4.2 INTRODUCTION A Structure is a derived type usually representing a collection of variables of same or different data types grouped together under a single name. The variables or data items in a structure are called as members of a structure. A structure may contain one or more integer variables, floating-point variables characters variables, arrays, pointers, and even other structures can also be included as members. Structures help to organize data, particulary in large programs, because they allow a group of related variable to be treated as a single unit. There are two fundamental differences between structures and arrays.1.An array demands a homogeneous data type, i.e., the elements of an array must be of the same data type, where as structure is a heterogeneous data type, since it can have any data type as its member.2.The difference is that elements in an array are referred by their positions, where as members in a structure are referred by their unique name. 4.3 DECLARING A STRUCTURE A structure within a C program is defined as follows: struct struct-type { Where, member-type1 member-name1; member-type2 member-name2; ……… ………. } struct->is a keyword struct type->is a name (tag) that identifies structures of composition member-type1 member name1.member-type2 member name2…are individual declaration. The individual members can be ordinary variables, pointers, arrays, or other structures. The member names within a particular structure must be distinct from one another; thought a member name can be the same as the name of a variable defined outside the structure. A storage class cannot be assigned to an individual member, and individual members cannot be initialized within a structure type declaration. Unlike the declaration of a variable of array, defining a structure causes no storage to be reserved. By defining a structure the programmers derives a new data type composed of a collection of already known data types and their name. For example, suppose that the information about 10000 business accounts has to be maintained. The information consists of mixed data types, where for each account the following are required. 191 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE account number (int) account type (short) name (30 char array) city/state/zip (30 char array) balance long last payment (long) date struct account { int acct_no; short acct_type; char name[30]; char street[30]; char city_state[30]; long balance; long last_payment; }; 4.4 DEFINING A STRUCTURE Declaring a structure is just a skeleton it merely describes the template. It does not reserve any memory space rather than the declaration creates a new data type. To use the structure you have to define it. Defining a structure means creating variables to access the members in the structure. Creating a structure variable allocates sufficient memory space to hold all the members of the structure. Structures variables can be created during structure declaration or by explicitly using the structure name. SYNTAX struct <structure-name> { data type member1; data type member2; data type member3; : : data type member; }structure variable(s); 192 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE struct employee { int empno; char empname[15]; float salary; }emp1 Where the structure employee declares a variable empl of its type. The structure variable(s) are declared like an ordinary variable is used to access the members of the structure. More than one structure variable can also be declared by placing a comma in between the variables. Once the composition of the structures has been defined, individual structures variables can be declared as follows: storage class struct struct_type variable 1, variable2… variable; A variable of the above type id declared like this: struct account. Where the variable name is customer and the data type is struct account. It is also possible to define a structure and declare a variable of that at the same time: SYNTAX Storage-class struct struct-type { member_type1 memebr_name1; member_type2 memebr_name2; member_type3 memebr_name3; ……….. member_typen memebr_namen; } variable1, variable2….variable n; The following figure shows the memory allocation of structure shown in the following figure: empno 2 bytes empname 15 bytes salary 4 bytes 193 KSOU PROGRAMMING C St. Angelo’s Professional Education NOTE The keyword struct is optional when defining the structure using the structure name. 4.5 INITIALIZING A STRUCTURE Similar to initialization of arrays, we can initialize structure variables also. The initializing a structure variable expressed is expressed as: SYNTAX struct <structure_name> { data type member1; : : : data type member; }structure_variable={value1,value2,…..valueN}; EXAMPLE struct employeedet { int height; float weight; }emp1={165,60}; the above initialization initializes 165 to the structure member height and 60 to the structure member weight. The value to be initialized for the structure members must be enclosed within a pair of braces. NOTE The constants to be initialized to the structure members must be in the same order in which the members are declared in the structure. Write a program to initializing a structure using the structure name. #include<stdio.h> #include<conio.h> struct emp { int empno; char name[20]; float salary; }; 194 KSOU PROGRAMMING C St. Angelo’s Professional Education void main() { struct emp e1,e2; int size; clrscr(); printf(“Enter empno,name and salary \n”); scanf(“%d %s %f”,&e1.empno,e1.name,&e1.salary); size=sizeof(e1); printf(“\n No. of bytes required for e1=%d \n\n”,size); e2=e1; printf(“After assigning e1 to e2 \n\n”); printf(“e2.empno=%d \n”,e2.empno); printf(“e2.name=%s \n”,e2.name); printf(“e2.salry=%8.2f \n\n”,e2.salary); getch(); } Sample Program Output Enter empno, name and salary 123 Nishu 3456 No. of bytes required for e1=26 After assigning e1 to e2 e2.empno=123 e2.name=Nishu e2.salry=3456.00 e1 and e2 are declared to be variables of struct emp type. Both can accommodate details of an employee. Details of an employee are accepted into the variable e1.The number of bytes occupied by a variable of struct emp type is found out with the help of the operator sizeof() by passing e1 to it. The value returned by sizeof() is then displayed. To illustrate the fact that structure variables assignment is permissible, e1 is assigned to e2.The contents of e2 are then displayed. The address of operator & is used with e1 to obtain its address and it is then displayed. 4.6 OPERATIONS ON STRUCUTRES The number of operations which can be performed over structures is limited. Following are the permissible operations: 195 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. Accessing the individual members of a structure variable with the help of members operator (using dot operator) EXAMPLE In the case of a variable of type struct emp, struct emp e; e.empno=10; 10 are assigned to empno number of e. strcpy (e.name,”Kavi”); The string “Kavi” is copied to name number of e. 2. Assigining one structure variable to another of the same type. struct emp e1={12,”Kamal”,4000},e1 e2=e1; e1 has been assigned to e2. 3. Retrieving the size of a structure variable using sizeof() operator. struct emp e int e; s=sizeof(e); 4. Retrieving the address of a structure variable using & (address of) operator. struct emp e; 5. Passing and returning a structure variable value to and from a function. 6. Checking whether two structure variables of same type are equal using ==.If s1 and s2 are two variables of the same structure type, s1==s2 returns 1 and if all the members of s1 are equal to the corresponding members of s2,it returns 0. 7. Checking whether two structure variables of same type and not equal using! =.If s1 and s2 are two variables of the same structure type,s1!=s2 returns 1 and if all the members of s1 are not equal to the corresponding members of s2,it returns 0. 196 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE Write a program to perform operation of structure #include<stdio.h> struct classroom { char name[15]; long int reg_no; }s1; void main() { struct classroom s1={sudhakar”,”5690823”); struct classroom sw=(“ragul”); printf(“Name is %s”,s1.name); printf(\n Reg no is %d”,s1.reg_no); printf(“Name is %s”,s2.name); printf(\n Reg no is %d”,s2.reg_no); s3=s1; printf(“Name is %s”,s3.name); printf(\n Reg no is %d”,s3.reg_no); } Sample program output Name is kavitha Reg no is 5690823 Name is kamal Reg no is 5690853 Name is martin Reg no is 5690821 The values to be initialized of the members of a structure must be enclosed within a pair of braces. NOTE The constants to be defined to the members of the structure must be in the same order in which the members are declared in the structure. The information contained in one structure variable can also be assigned to another structure variable using a single assignment statement. 197 KSOU PROGRAMMING C St. Angelo’s Professional Education s3=s1 to copy of the values in the structure variable s1 to s3.This type of assignment statements will be necessary when many members of the structure are to be to declared. The structure variable can be assigned to another only when they both are of the same structure type. 4.7 ARRAYS AND STRUCTURES 4.7.1 Arrays of Structures An array of structures is simply an array in which each element is a structure of the same type. struct emp e[10]; Hence the array elements e[0],e[1]…e[9] are variables of struct emp type and thus each can accommodate an employee‟s details. Since all the variables share a common name e and are distinguishable by subscript values [0-9], collective manipulation over the structure elements becomes easy. EXAMPLE Write a program to search for an employee in a list of employees #include<stdio.h> #include<conio.h> struct emp { int empno; char name[20]; float salary; }; void main() { struct emp e[10]; int i,n,flag; char sname[20]; float f,*fp; fp=*f; clrscr(); printf(“Enter the no. of employees \n”); scanf(“%d”,&n); printf(“Enter %d employees details \n”,n); scanf(“%d %s %f”,&e[i].empno,e[i].name,&e[i].salary); printf(“Enter name of the employee to be searched \n”); scanf(%s”,&name); printf(“%d employees details \n”,n); for(i=0;i<n;i++) 198 KSOU PROGRAMMING C St. Angelo’s Professional Education printf(“\n %5d %10s %10.2f \n”,e[i].empno,e[i].name,e[i].salary); printf(“Name of the employee to be searched \n”); printf(“\n %10s \n”,sname); flag=0; for(i=0;i<n;i++) if(strcmp(e[i].name,sname==0) { flag=1; break; } if(flag==1) printf(“found”); else getch(); } 4.7.2 Arrays within Structures The array was treated in its entirety. The array name was used to refer to the entire sequence of characters forming a name. An array of int type as a member of structure, where we need to deal with each integer value of the array. Suppose we need to maintain a list of students‟ details (Reg-no, Name, Marks in five subjects) The structure template definition will be: struct student { int regno; char name[20]; int marks [5]; } EXAMPLE Write a program to create a list of student‟s details and display them #include<stdio.h> #include<conio.h> struct student { int reg_no; char name[20]; int marks[5]; int total; float percent; 199 KSOU PROGRAMMING C St. Angelo’s Professional Education }; void main() { struct student s[10]; int i,n,j; clrscr(); printf(“Enter no. of students \n”); scanf(“%d”,&n); for(i=0;i<n;i++) { printf(“Enter reg_no,name of student -%d \n”,i+1); scanf(“%d”,&n); for(i=0;i<n;i++) scanf(“%d”,&s[i].marks[j]); } for(i=0;i<n;i++) { s[i].total=0; for(j=0;j<5;j++) s[i].total+=s[i]marks[j]; s[i].percent=(float)s[i].total/5; } printf(“\n Reg-no Name percentage \n”); for(i=0;i<n;i++) printf(“%6d %15s %7.2f \n”,s[i].reg_no,s[i].name,s[i].percent); getch(); } 4.8 UNION Unions like structure contain members whose individual data types may differ from one another. However the members that compose a union all share the same storage area within the computer‟s memory where as each member within a structure is assigned its own unique storage area. Thus unions are used to observe memory. They are useful for application involving multiple members. Values need not be assigned to all the members at one time. Like structures union can be declared using the keyword union as follows: Before instantiating variables of some union type, the data items which are to share a common name should be grouped together. This is done with the help of union template. 200 KSOU PROGRAMMING C St. Angelo’s Professional Education SYNTAX union tag_name { Where data-type member1; data-type memebr2; : : data-type member n; } union->is a keyword. tag-name->is any user-defined name, which should be valid C identifier. data-type->is any valid data type supported by C or user-defined type. member1,member2…member->are the members of the union The syntax of declaring a variable of union type is: union tag_name variable_name; A memory location gets allocated, the size of which is equal to that of the largest of the members member1,member2,member3,…..member n.Accessing the members of a union is similar to accessing the members of a strucute.Dot operator is used to access each individual member. Dot operator expects union variable to its left and member name to its right. EXAMPLE union item { int m; float p; char c; } code; union item makes a group of three data items of type int, float and char. union item t; A variable t declared to be of type union temp.As a result of this; only one memory location gets allocated. It can be referred to by any one individual member at any point of time. The size of the memory location is four bytes, which happens to be the size of the largest sized data type float in the member list. 201 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE Write a program to demonstrate initialization of an union #include<stdio.h> #include<conio.h> void main() { int roll_no,mark1,mark2,mark3; }ul; void main() { ul.roll_no=459; ul.mark1=87; printf(“Roll Number:%d \n”,ul.roll_no); printf(“Mark 1: %d \n”,ul.mark1); printf(“Mark 2:%d\n”,ul.mark2); printf(“Mark 3:%d\n”,ul.mark3); } Sample program output Roll No:459 Mark 1:87 Mark 2:87 Mark 3:87 Thus the program, even the uninitialized members (that is mark2 and mark3) take the same value as the other members. 4.9 DIFFERENCE BETWEEN STRUCTURE AND UNION 1. Union allocates the memory equal to the maximum memory required by the member of the union but structure allocates the memory equal to the total memory required by the members. 2. In union, one block is used by all the member of the union but in case of structure, each member has their own memory space. 3. Union is best in the environment where memory is less as it shares the memory allocated. But structure cannot implement in shared memory. 4. As memory is shared, ambiguities are more in union, but less in structure. 5. Self referential union cannot be implemented in any data structure, but self referential structure can be implemented. 202 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. Define Structure? ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2.Define Union? …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 4.10 LET US SUM UP A structure is a derived type usually representing a collection of variables of same or different data types grouped together under a single name The keyword struct begins the structure declaration followed by the structure name, the structure members are enclosed in braces, followed by the semicolon which ends the structure declaration. The variable or data items in a structure are called as members of the structure. Usually the structure type declaration appears at the top of the source code file, before any variables or functions are defined. Structure variables may be initialized with a structure variable of the same type. A structure that contains another structure as its member is called as nesting of structures. A union is another compound data type like a structure that may hold the variables of different types and sizes, with the compiler keeping track of the size. The keyword union begins the union declaration followed by the tag (i.e., union name), within the braces, union members are declared. A union may contain many members of different types, but the memory space reserved for a union is large enough to store its largest number. 203 KSOU PROGRAMMING C St. Angelo’s Professional Education 4.11 LET US SUM UP 1. State whether the following statements are true or false A. A struct type in C is a build-in data type. B.The tag name of a structure is optional. C.Structures may contain members of only one data type. D.A Structure cannot have a union as one of its members E.A member in a structure can itself be a structure. 2. Fill in the blanks in the following statements: a. The name of a structure of is referred to as . B.A Same storage. is a collection of data items under one name in which the items share the 3. State which of the following declarations are invalid? Why? A.struct abc v1; B.struct abc v2 [10]; C.struct ABC v3; D.ABC a, b, c E.ABC a [10]; 4. How does a structure differ from an array? 5. Explain the meaning and purpose of the following: a. struct keyword b. sizeof operator c. tag name 4.12 KEYWORDS Attributes: Each entity in the world is described by a number of characteristics. These descriptive characteristics of an entity are called attributes. Structure: A structure is a derived type usually representing a collection of variables of same or different data types grouped together under a single name. Tag: A user defined structure name usually referred to as tag. Nested Structures: Nested structures are nothing but a structure with another structure is called nested structures. 204 KSOU PROGRAMMING C St. Angelo’s Professional Education 4.13 QUESTIONS FOR DISCUSSION 1. Explain the need for the concept of structure. 2. Explain syntax of declaring a structure variable. 3. Can we initialize structure variables while they are declared? If yes, explain the syntax with an example. 4. Differentiate between structure and union. 5. Write a program to create a „list of books‟ details. The details of a book include Title, author, and Publishing year, Number of pages and Price. 6. Explain union with an example, and state the uses of union. 7. Explain the concept of initialization of variables in a union. Ans.1 Structures are collection of unlike data types just as arrays are collection of like data types. A structure is a collection of one or more variables, possibly of different types, grouped together under a single name for convenient handling. The individual structure elements are referred to as members. Ans.2 A union is another compound data type like a structure that may hold objects of different types and sizes, with the compiler keeping track of the size. Unions provide a way to manipulate different kinds of data in a single area of storage. 205 KSOU PROGRAMMING C St. Angelo’s Professional Education 1. Turbo C/C++ - The Complete Reference - H.Schidt 2. Programming in C - S.Kochan 4. Born to code in C - H.Schidt 5. The Art of C - H.Schidt 6. C Programming - Keringhan and Ritchie - 2nd Ed. 7. Programming in ANSI C - Agarwal 8. Let us C - Kanitkar 9. Programming in ANSI C - Balguruswamy 206 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT-5 207 KSOU PROGRAMMING C St. Angelo’s Professional Education UNIT 5 FILE MANAGEMENT IN C CONTENTS 5.1 Aims and Objectives 5.2 Introduction 5.3 Operations on Files 5.4 Opening and Closing of files 5.5 File I/O Functions 5.1 Character Oriented Functions 5.2 String Oriented Functions 5.3 Mixed Data Oriented Functions 5.4 Unformatted Record I/O Functions 5.6 Random Accessing of Files 5.7 Error Handling During File I/O Operations 5.8 Command Line Arguments 5.9 Let Us Sum Up 5.10 Lesson end Activities 5.11 Keywords 5.12 Questions for Discussion 5.1 AIMS AND OBJECTIVES At the end of this chapter, you will learn how to: Discuss different operations of files Understanding different I/O functions Discuss about different operations of files 208 KSOU PROGRAMMING C St. Angelo’s Professional Education 5.2 INTRODUCTION The data was written to the standard output and data was read from the standard input. As long as only small amount of data are being accessed in the form of simple variables, and character strings this type of I/O is sufficient.However, with large amounts of data. The information has to be written to or read from auxiliary storage device. Such information stored on the device in the form of a data file. There are two different categories of data files Stream oriented data files System oriented data files Stream oriented data files are of two types. In the first category, the data files comprised of consecutive characters. These characters can be interpreted as individual data items or as components of strings of numbers .These are called text files. The second category of stream-oriented data files, often referred to as unformatted data files, organizes data into blocks containing contiguous bytes of information. These blocks represent more complex data structures, such as arrays and structures. These file are called binary files. System oriented data files are more closely related to the computer‟s operating system than are stream oriented data files. To perform the I/O from and to files, an extensive set of library functions are available in C.Access to files generally requires four basic operations. Open: This allows access to a file and establishes the position, offset, in the file. number of files that a running program can have any time is limited; by closing file properly these limited facilities can be used more intelligently. Read: This gets information from the file, either in the form of characters strings, or in the form of data (combined integers, characters, floating point numbers, and structures). Write: This adds information to the file or replaces information already in the file. 209 KSOU PROGRAMMING C St. Angelo’s Professional Education 5.3 OPERATIONS ON FILES The commonly performed operations over files are the following: 1. Opening a file 3. Writing a file 4. Appending to a file 5. Updating a file 6. Deleting a file 7. Renaming a file 8. Closing a file These operations are accomplished by means of standard library functions that are provided by C. 5.4 OPENING AND CLOSING OF FILES 5.5fopen () The fopen () is to open a file. Opening a file basically establishes a link between a program and the file being opened. SYNTAX fp=fopen(“filename‟,”mode of opening”); where, filename->is the name of the file being opened(which is remembered by the operating system).Mode of opening can be any one of the following. Mode of opening Purpose w To create a text file. If the file already exits, its contents are destroyed; otherwise it is created, if possible. r To open a text file for reading; the file must exist. a To open a text file for appending (writing at the end); if the file does not exist, it is created, if possible. 210 KSOU PROGRAMMING C St. Angelo’s Professional Education w+ To create a text file both reading and writing; if the file already exists, its contents are destroyed; otherwise it is created, if possible. r+ To open a text file for both reading and writing; the file must exist. a+ To open a text file for both reading and appending; if the file already exists, its contents are retained; if the file does not exist, it is created, if possible. wb To create a file. If the file already exists, its contents are destroyed; otherwise it is created, if possible. rb To open a binary file for reading; the file must exist ab To open a binary file for both reading and writing; if the file already exists, its contents are destroyed; otherwise it is created, if possible. wb+ To create a binary file both reading and writing; if the file already exists, its contents are destroyed; otherwise it is created, if possible. rb+ To open a binary file for both reading and writing; the file must exist. ab+ To open a binary file for reading and appending; if the file already exists, its contents are retained; if the file does not exist, it is created if possible. (ii) fclose () The fclose () is the counterpart of fopen ().This is used to close a file. Closing a file names means de-linking the file from the program and saving the contents of the file. SYNTAX fclose (fp); where fp->is the pointer to FILE type and represents a file. The file represented by fp is closed. 211 KSOU PROGRAMMING C St. Angelo’s Professional Education 5.5 FILE I/O FUNCTIONS When a file opened, we can read data stored in the file or write new data onto it depending on the mode of opening standard library supports a good number of functions which can be used for performing I/O operations. These functions are referred to as file I/O functions. File I/O functions are broadly classified into two types: 1. High level files I/O functions 2. Low level files I/O functions high level file I/O functions are basically C standard library functions and are easy to use. Most of the C programs handling files use these because of their simple nature. Low level file I/O functions are file related system calls of the underlying operating system. These are relatively more complex in nature when compared to high level file I/O functions but efficient in nature. High level file I/O functions can be further classified into the following two types: 1. Unformatted file I/O functions 2. Low level files I/O functions Unformatted file I/O functions fputc() and fgetc()-Character-oriented file I/O functions fputs() and fgets()-String-oriented file I/O functions Formatted file I/O functions fprint() and fscanf()-Mixed data-oriented file I/O functions 5.5.1 Character Oriented Functions-fputc(),fgetc() fputc() is to write a character onto a file. SYNTAX fputc(c,fp); where c-> represents a character and fp,a pointer to FILE, represents a file. The function writes the content of c onto the file represented by fp. 212 KSOU PROGRAMMING C St. Angelo’s Professional Education fgetc() is to read a character from a file. The syntax of its usage is as follows: c=fgetc (fp); c is a variable of char type and fp is a pointer to FILE type. The function reads a character from the file denoted by fp and returns the character value, which is collected by the variable c. EXAMPLE Write a program to create a file consisting of characters #include<stdio.h> #include<conio.h> void main() { FILE *fp; char c; clrscr(); fp=fopen(“text”,”w”); printf(“Keep typing characters, Type „q‟ to terminate \n”); c=getchar(); while(c!=‟q‟) { fputc(c,fp); c=getchar(); } fclose(fp); } Sample program output Keep typing characters. Type q to terminate Akdiekldld here fp is declared to be a pointer variable to FILE type and c is declared to be a variable of char type. The file pointer variable is to represent the file to be created by the program and the variable c of char type is to collect characters one at a time, entered through the standard input device, keyboard.Note that the external file “text” is opened in “w” mode. 5.5.2 String Oriented Functions-fputs(),fgets() The fputc () is to write a string onto a file. SYNTAX fputs (buffer,fp); 213 KSOU PROGRAMMING C St. Angelo’s Professional Education buffer is the name of a character array, size is an integer value,fp is a pointer to FILE type. The function reads a string of maximum size-1 characters from the file pointed to by fp and copies it to the memory area denoted by buffer. EXAMPLE #include<stdio.h> #include<conio.h> void main() { FILE *fp; char name[20]; clrscr(); printf(“Strings are \n”); fp=fopen(“name.dat”,”r”); while(!feof(fp)) { fgets(name,80,fp); puts(name); printf(“\n”); } fclose(fp); } Sample program output Strings are Nisha Devi Kumar Ravichandran The variable fp is declared to be a pointer to FILE type.name is declared to be an array of char type and of size 20.The file variable fp is to denote the file names.dat to be read by the program; the string variable name is to collect a string read from the file. 5.5.3 Mixed Data Oriented Functions-fprintf(),fscanf() fprintf() is to write multiple data items which may or may not be of different types to a file. SYNTAX fprintf(fp,”control string”, arguments-list); fprintf() is similar to that of prinf() except the presence of an extra parameter fp,a pointer to FILE type. The parameter fp represents the file to which data are to be written. 214 KSOU PROGRAMMING C St. Angelo’s Professional Education fscanf() is similar to that of scanf() except the presence of an extra parameter fp.A pointer to FILE type. The parameter fp represents the file from which data are to be read. EXAMPLE Write a program to read a file consisting of employees details #include<stdio.h> #include<conio.h> struct emp { int empno; char name[20]; float salary; }; void main() { FILE *fp; struct emp e; fp=fopen(emp.dat”,”r”); while(!feof(fp)) { fscanf(fp,”%d %s %f”,&e.empno,&e.name,&e.salary); printf(“%6d %15s %7.2f \n”,e.empno,e.name,e.salary); } fclose(fp); } The structure struct emp is defined with the fields empno, name and salary. In the main () variable fp is declared to be a pointer to FILE type and it is to denote the file emp.dat to be created by the program.e is declared to be a variable of struct emp type, which is to collect the employee details accepted through the keyboard. 5.5.4 Unformatted Record I/O Functions-fwrite (), fread () The fwrite () is used to write blocks of data (records) to a file. The contents which are written to the secondary devices are nothing but the exact copy of them in memory. The files of this kind are called binary files. But the fprintf(),another file output function, formats the memory contents according to the format specifies passed to it and then write them onto the secondary storage device. here,buffer_address is the address of the memory area, the contents of which are to be written to the file denoted by the fourth arguments file_pointer.The second argument size specifies the number of bytes of a block(record) and count specifies the number of blocks of data written to the file. 215 KSOU PROGRAMMING C St. Angelo’s Professional Education EXAMPLE #include<stdio.h> #include<conio.h> struct emp { int empno; char name[20]; float salary; }; void main() { struct emp e; FILE *p; int i,n; clrscr(); fp=fopen(“emp.data”,”wb”); printf(“Enter the number of employees \n”); scanf(“%d”,&n); printf(“Enter empno,name and salary of %d employees \n”,n); for(i=1;i<=n;i++) { scanf(“%d %s %f”,&e.empno,&e.name,&e.salary); fwrite(&e,sizeof(e),1,fp); } fclose(fp); getch(); } Sample program output Enter the No. of Employees 2 Enter empno,name and salary of 2 employees 120 kirupa 83832 378 haish 36374 This program is similar t 216 KSOU PROGRAMMING C St. Angelo’s Professional Education 5.6 RANDOM ACCESSING OF FILES-fseek(),ftell(),rewind() Random Access files consist of records that can be accessed in any sequence. This means the data is stored exactly as it appears in memory, thus saving processing time (because no translation is necessary) both in when the file is written and in when it is read.C standard library provides the following build-in functions to support this: (i)fseek() The position fssek() repositions the file pointer. SYNTAX where fseek(fp,offset,position) fp->is a pointer to FILE representing a file offset->is the number of bytes by which the file pointer is to be moved relative to the byte number identified by the third parameter position. position->position can take any one of the following three values 0,1 and 2 Position Symbolic Constants Meaning 0 SEEK_SET Beginning of File 1 SEEK_CUR Current position of File 2 SEEK_END End of file (ii)ftell() The function ftell() returns the current position of the file pointer SYNTAX position=ftell(fp); where fp is a pointer to FILE type representing a file, the current position of the file pointer of the file is returned by the function. 217 KSOU PROGRAMMING C St. Angelo’s Professional Education (iii)rewind() The rewind() positions the file pointer to the beginning of a file. SYNTAX rewind(fp); EXAMPLE Write a program to count the number of records in employee file #include<stdio.h> #include<conio.h> struct emp { int empno; char name[20]; float salary; }; void main() { FILE *fp; int nor,last_byte; clrscr(); fp=fopen(“emp_dat”,”r”); fseek(fp,0,SEEK_END); nor=last_byte/sizeof(struct emp); printf(“No. of records=%d”,nor); fclose(fp); getch(); } Sample program output No. of records=2 The structure struct emp is defined with the fields empno,name and salary. In the main(),variables fp is declared to be a pointer to FILE type. The integer variables nor and 218 KSOU PROGRAMMING C St. Angelo’s Professional Education last_byte are used to collect the number of records in the file emp.dat and the last byte number of file respectively. 5.7 ERROR HANDLING DURING FILE I/O OPERTIONS The file I/O operations cannot always be expected to be smooth sailing. During the course of I/O operations, some errors may be encountered. As a consequence of the error conditions, the underlying program may prematurely terminate or it may produce erroneous results. Following the circumstances under which the file I/O operations fail: 1. Trying to open a file, this does not exist, for reading purpose. 2. Trying to open a file for writing purpose when there is no disk space. 3. Trying to write to a read-only file. 4. Trying to perform an operation over a file when the file has been opened for some other purpose. 5. Trying to read a file beyond its end-of-mark. When we try to open a file, which does not exist, for reading purpose, the fopen() returns NULL. EXAMPLE fp=fopen(“student.dat”,”r”) In case, student.dat does not exist, the function fopen() returns NULL value, which is collected by the variable fp.The segment is used to handle this error situation. if(fp==NULL) { printf(“This file does not exist”); exit(1); } when an attempt to open a file for writing purpose fails. 219 KSOU PROGRAMMING C St. Angelo’s Professional Education Write a program errors handling during file I/O operations #include<stdio.h> #include<conio.h> #include<process.h> void main() { FILE *fp; clrscr(); fp=fopne(“books.dat”,”r”); if(fp==NULL) { printf(“The file books.dat does not exist”); getch(); } fp=fopen(“students.dat”,”w”); if(fp==NULL) { printf(“The read-only file students.dat cannot be opened in write mode”); getch(); } fp=fopen(“text.dat”,”r”); fputc(„a‟,fp); if(ferror(fp)) { printf(“The file text.dat has been opened in read mode”); printf(“but you are writing to it. \n”); getch(); } getch(); } Sample program output The file Books.dat does not exist The read-only file students.dat cannot opened in write mode The file text.dat has been opened in read mode but you are writing to it 220 KSOU PROGRAMMING C St. Angelo’s Professional Education To open the file books.dat, this does not exist. The statement fp=fopen(“books.dat”,”r”); is executed, the file variable fp collects the NULL value. The error is then trapped and the message “the file books.dat does not exist” is displayed. Secondly, an attempt is made to open the file students.dat,a read-only file, in write mode, since opening of the file fails, once again when the statement fp=fopen(“student.dat”,”w”); is executed, the file variable fp would cannot be NULL value. 5.8 COMMAND LINE ARGUMENTS In C it is possible to accept command line arguments. Command-line arguments are given after the name of a program in command-line operating systems like DOS or Linux, and are passed in to the program from the operating system. To establish the data communication between a calling function and a called function. It is done through arguments; a calling function passes inputs to a called function, which perform required manipulations. To display the contents of emp.dat, we use the following command: C:\>type emp.dat here type is the program file name (executable) and emp.dat is the input file, the contents of which are displayed To make main() of a program take command line arguments, the function header will have the following form: void main(int argc,char *argv[]) Here, argc and argv [] are the formal arguments, which provide mechanism for collecting the arguments given at command line when the program is launched for execution. EXAMPLE To write a program using command line arguments-Copying one file to another file. #include<stdio.h> #include<conio.h> #include<process.h> void main(int argc,char *argv[]) { FILE *fin,*fout; 221 KSOU PROGRAMMING C St. Angelo’s Professional Education char c; clrscr(); if(argc!=3) { printf(“Invalid number of arguments”); exit(1); } fin=fopen(argv[1],”r”); fout=fopen(argv[2],”w”); while(!feof(fin)) { c=fgetc(fin); fputc(c,fout); } fclose(fin); fclose(fout); getch(); } Sample program output The program is executed as follows: C:\>copy text.dat text1.dat As a result, the contents of text.dat are copied to text1.dat.we have thus simulated DOS copy command. The purpose of the program is to copy the contents of the file text.dat (source file) to the file text1.dat(target file).The source file and the target files are to be passed as the arguments to the main() itself.So,the main() is defined with two arguments argc(int) and argv[](char*).The argument argc collects the number of arguments passed to the main() while it is launched for execution. In this case, the value of argc would be three. They are: the program file name (executable) (argv [0]), source file (argv [1] and the target file (argv [2]). 1. What is a file? Why do we need the concept of files? ………………………………………………………………………………………….. …………………………………………………………………………………………… …………………………………………………………………………………………… 2. Give the purpose and syntax of fopen() and fclose(). …………………………………………………………………………………………… …………………………………………………………………………………………… …………………………………………………………………………………………… 222 KSOU PROGRAMMING C St. Angelo’s Professional Education 5.9 LET US SUM UP Storage of information is read from or written on a auxiliary memory device is stored in the form of a file. The data structure of a file is defined in stdio.h which creates a buffer area to store data in a file for reading as well as writing. Function fopen() is used to open a specified file and fclose[] is used to close a specified file. Functions fscanf() and fprintf() are used to perform input/output operation in files. Functions fgetc() and fputc() are used to perform character input/output operation in files. Functions fgets() and fputs() are used to perform string input/output operation in files. Functions fseek[] is used used to index a file and can be used to increment or decrement the file pointer. Function we wind[] is used to reset the file pointer to the beginning of the file. 5.10 LESSONS END ACTIVITIES 1. State whether the following statements are true or false: A. A file must be opened before it can be used. B. All files must be explicitly closed. C. Files are always referred by name in C programs. D. Using fseek to position a file beyond the end of the file is an error. E. Function fseek may be used to seek from the beginning of the file only. 2. Fill in the blanks in the following statements. a. The mode is used for opening a file for updating. b.The function _may be used to position a file at the beginning. c.The function gives the current position in the file. d.The function is used to write data randomly to accessed file. 223 KSOU PROGRAMMING C St. Angelo’s Professional Education 3. What is the significance of EOF? 4. Distinguish between the following functions: (a)getc() and getchar() (b)print() and fprintf() 5. Explain the general format of fseek function? 5.11 KEYWORDS FILE:The header file stdio.h defines a new data type called FILE. STDIO.H: Each file used in a program must be associated with a pointer of its type. Three types of file pointers are defined in stdio.h.They are stdin, stdout and stderr. PRINTF () AND SCANF (): printf () and scanf) are used for performing input/output operations in programs(without involving files). FPRINTF () and FSCANF (): fprintf () and fscanf () are used to perform input/output operation in files. FGETC () and FPUTC (): Single character input/output from files are fetc() and fputc(). FGETCHAR () and FPUTCHAR (): Character input/output functions which act on files. END OF FILE:Most of the programs use EOF when reading input from the user or when displaying the output data. FEOF():The feof() function is used to check the end of file condition. 5.12 QUESTIONS FOR DISCUSSION 1. What are standard files that are accessed when a program begins its execution? 2. Explain the functions fopen() and fclose() and with clearly stating its syntax? 3. What are the various file-opening modes in C? 4. Explain the concept of characters input/output in files? 5. Explain the functions fetc() and fputc() with clearly stating its syntax? 6. Explain the use of rewind() function in files? 7. Explain the concept of characters input/output files. 8. Explain the concept of string input/output in files. 9. Write a program to count the number of characters in a text file. 224 KSOU PROGRAMMING C St. Angelo’s Professional Education Ans.1 A file is defined as a collection of related data stored on secondary storage device like disk. It is a named storage on secondary storage devices. The concept of files enables us to store large amount of data permanently on the secondary storage devices. The ability to store large amount of data and the ability to store them permanently are attributed to the physical characteristics of the devices. Ans.2 The commonly performed operations over files are the following: 1. Opening a file 2.Reading from a file 3.Writing a file 4. Appending to file 7. Renaming a file 5.Updating a file 8.Closing a file 6.Deleting a file 1. Let us C-Yashwant Kanetkar. 2. Programming in C- Balguruswamy 3. The C programming Lang., Pearson Ecl – Dennis Ritchie 4. Structured programming approach using C-Forouzah &Ceilberg Thomson learning publication. 5. Pointers in C – Yashwant Kanetkar 6. How to solve it by Computer – R. G. Dromy 7. Introduction to algorithms – Cormen, Leiserson, Rivest, Stein http://www.cs.utexas.edu/users/rpriece 8. Peter Norton‟s Introduction to Computers – Tata MGHill Recommended
57,658
247,111
{"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-2024-18
latest
en
0.651827
http://icpc.njust.edu.cn/Problem/Hdu/6150/
1,603,819,613,000,000,000
text/html
crawl-data/CC-MAIN-2020-45/segments/1603107894426.63/warc/CC-MAIN-20201027170516-20201027200516-00395.warc.gz
57,126,755
10,505
# Vertex Cover Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 256000/256000 K (Java/Others) ## Description As we know, $minimum vertex cover$ is a classical NP-complete problem. There will not be polynomial time algorithm for it unless $P = NP$. You can see the definition of vertex cover in https://en.wikipedia.org/wiki/Vertex_cover. Today, little M designs an "approximate" algorithm for vertex cover. It is a greedy algorithm. The main idea of her algorithm is that always choosing the maximum degree vertex into the solution set. The pseudo code of her algorithm is as follows: We assume that the labels of the vertices are from 1 to n. for (int i = 1; i <= n; ++i) {  use[i] = false; deg[i] = degree of the vertex i;}int ans = 0;while (true) {  int mx = -1, u; for (int i = 1; i <= n; ++i) {   if (use[i])   continue; if (deg[i] >= mx) {   mx = deg[i]; u = i; } } if (mx <= 0)   break; ++ans; use[u] = true; for (each vertex v adjacent to u)   --deg[v];}return ans; As a theory computer scientist, you immediately find that it is a bad algorithm. To show her that this algorithm dose not have a constant approximate factor, you need to construct an instance of vertex cover such that the solution get by this algorithm is much worse than the optimal solution. Formally, your program need to output a simple undirected graph of at most $500$ vertices. Moreover, you need to output a vertex cover solution of your graph. Your program will get Accept if and only if the solution size get by the above algorithm is at least three times as much as yours. ## Input There is no input. ## Output First, output two integer $n$ and $m$ in a line, separated by a space, means the number of the vertices and the number of the edges in your graph. In the next $m$ lines, you should output two integers $u$ and $v$ for each line, separated by a space, which denotes an edge of your graph. It must be satisfied that $1 \leq u,v \leq n$ and your graph is a simple undirected graph. In the next line, output an integer $k(1 \leq k \leq n)$, means the size of your vertex cover solution. Then output $k$ lines, each line contains an integer $u(1 \leq u \leq n)$ which denotes the label of a vertex in your solution. It must be satisfied that your solution is a vertex cover of your graph. ## Sample Output 4 4 1 2 2 3 3 4 4 1 2 1 3 Hint The sample output is just to exemplify the output format. liuyiding ## Source 2017中国大学生程序设计竞赛 - 网络选拔赛
689
2,521
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}
3.34375
3
CC-MAIN-2020-45
latest
en
0.896841
https://mathexamination.com/class/sets-and-relations.php
1,619,050,224,000,000,000
text/html
crawl-data/CC-MAIN-2021-17/segments/1618039554437.90/warc/CC-MAIN-20210421222632-20210422012632-00521.warc.gz
429,147,165
7,018
## Take My Sets And Relations Class A "Sets And Relations Class" QE" is a basic mathematical term for a generalized consistent expression which is used to solve differential equations and has solutions which are regular. In differential Class fixing, a Sets And Relations function, or "quad" is utilized. The Sets And Relations Class in Class type can be expressed as: Q( x) = -kx2, where Q( x) are the Sets And Relations Class and it is an essential term. The q part of the Class is the Sets And Relations consistent, whereas the x part is the Sets And Relations function. There are four Sets And Relations functions with proper service: K4, K7, K3, and L4. We will now take a look at these Sets And Relations functions and how they are solved. K4 - The K part of a Sets And Relations Class is the Sets And Relations function. This Sets And Relations function can also be written in partial portions such as: (x2 - y2)/( x+ y). To fix for K4 we multiply it by the correct Sets And Relations function: k( x) = x2, y2, or x-y. K7 - The K7 Sets And Relations Class has an option of the type: x4y2 - y4x3 = 0. The Sets And Relations function is then increased by x to get: x2 + y2 = 0. We then need to multiply the Sets And Relations function with k to get: k( x) = x2 and y2. K3 - The Sets And Relations function Class is K3 + K2 = 0. We then increase by k for K3. K3( t) - The Sets And Relations function equationis K3( t) + K2( t). We multiply by k for K3( t). Now we multiply by the Sets And Relations function which gives: K2( t) = K( t) times k. The Sets And Relations function is also called "K4" because of the initials of the letters K and 4. K suggests Sets And Relations, and the word "quad" is noticable as "kah-rab". The Sets And Relations Class is among the primary techniques of resolving differential equations. In the Sets And Relations function Class, the Sets And Relations function is first multiplied by the suitable Sets And Relations function, which will give the Sets And Relations function. The Sets And Relations function is then divided by the Sets And Relations function which will divide the Sets And Relations function into a real part and a fictional part. This gives the Sets And Relations term. Lastly, the Sets And Relations term will be divided by the numerator and the denominator to get the ratio. We are left with the right hand side and the term "q". The Sets And Relations Class is an essential principle to comprehend when resolving a differential Class. The Sets And Relations function is just one approach to solve a Sets And Relations Class. The techniques for fixing Sets And Relations equations include: particular value decomposition, factorization, ideal algorithm, numerical service or the Sets And Relations function approximation. ## Pay Me To Do Your Sets And Relations Class If you want to become familiar with the Quartic Class, then you require to very first start by checking out the online Quartic page. This page will reveal you how to use the Class by utilizing your keyboard. The explanation will likewise show you how to create your own algebra equations to help you study for your classes. Before you can comprehend how to study for a Sets And Relations Class, you must initially understand making use of your keyboard. You will find out how to click on the function keys on your keyboard, as well as how to type the letters. There are three rows of function keys on your keyboard. Each row has 4 functions: Alt, F1, F2, and F3. By pressing Alt and F2, you can multiply and divide the worth by another number, such as the number 6. By pressing Alt and F3, you can use the 3rd power. When you press Alt and F3, you will enter the number you are attempting to increase and divide. To increase a number by itself, you will push Alt and X, where X is the number you want to increase. When you press Alt and F3, you will key in the number you are attempting to divide. This works the exact same with the number 6, except you will just enter the two digits that are 6 apart. Finally, when you push Alt and F3, you will use the fourth power. Nevertheless, when you press Alt and F4, you will utilize the real power that you have actually found to be the most suitable for your problem. By utilizing the Alt and F function keys, you can multiply, divide, and then utilize the formula for the 3rd power. If you require to increase an odd variety of x's, then you will require to get in an even number. This is not the case if you are attempting to do something complex, such as increasing 2 even numbers. For example, if you want to multiply an odd number of x's, then you will require to go into odd numbers. This is particularly true if you are trying to determine the response of a Sets And Relations Class. If you want to transform an odd number into an even number, then you will require to push Alt and F4. If you do not know how to multiply by numbers on their own, then you will require to utilize the letters x, a b, c, and d. While you can multiply and divide by utilize of the numbers, they are much easier to use when you can take a look at the power tables for the numbers. You will have to do some research study when you first start to use the numbers, but after a while, it will be second nature. After you have actually produced your own algebra equations, you will have the ability to create your own multiplication tables. The Sets And Relations Solution is not the only way to resolve Sets And Relations formulas. It is very important to learn more about trigonometry, which utilizes the Pythagorean theorem, and after that utilize Sets And Relations solutions to fix issues. With this technique, you can learn about angles and how to solve issues without needing to take another algebra class. It is important to try and type as quickly as possible, because typing will assist you understand about the speed you are typing. This will help you compose your answers much faster. ## Pay Someone To Take My Sets And Relations Class A Sets And Relations Class is a generalization of a linear Class. For instance, when you plug in x=a+b for a given Class, you get the worth of x. When you plug in x=a for the Class y=c, you obtain the worths of x and y, which give you an outcome of c. By applying this basic principle to all the formulas that we have tried, we can now resolve Sets And Relations equations for all the worths of x, and we can do it quickly and effectively. There are many online resources available that supply complimentary or budget friendly Sets And Relations equations to solve for all the worths of x, including the cost of time for you to be able to benefit from their Sets And Relations Class assignment assistance service. These resources usually do not require a subscription fee or any kind of financial investment. The answers offered are the outcome of complex-variable Sets And Relations formulas that have been fixed. This is also the case when the variable used is an unknown number. The Sets And Relations Class is a term that is an extension of a direct Class. One advantage of using Sets And Relations formulas is that they are more general than the direct formulas. They are much easier to solve for all the worths of x. When the variable utilized in the Sets And Relations Class is of the type x=a+b, it is simpler to resolve the Sets And Relations Class since there are no unknowns. As a result, there are fewer points on the line specified by x and a continuous variable. For a right-angle triangle whose base indicate the right and whose hypotenuse indicate the left, the right-angle tangent and curve chart will form a Sets And Relations Class. This Class has one unknown that can be found with the Sets And Relations formula. For a Sets And Relations Class, the point on the line defined by the x variable and a consistent term are called the axis. The existence of such an axis is called the vertex. Because the axis, vertex, and tangent, in a Sets And Relations Class, are a given, we can discover all the values of x and they will sum to the given worths. This is accomplished when we utilize the Sets And Relations formula. The factor of being a continuous factor is called the system of equations in Sets And Relations equations. This is often called the main Class. Sets And Relations formulas can be resolved for other values of x. One way to resolve Sets And Relations equations for other values of x is to divide the x variable into its element part. If the variable is offered as a favorable number, it can be divided into its element parts to get the normal part of the variable. This variable has a magnitude that amounts to the part of the x variable that is a constant. In such a case, the formula is a third-order Sets And Relations Class. If the variable x is negative, it can be divided into the exact same part of the x variable to get the part of the x variable that is increased by the denominator. In such a case, the formula is a second-order Sets And Relations Class. Option help service in fixing Sets And Relations equations. When using an online service for solving Sets And Relations equations, the Class will be fixed quickly.
1,989
9,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}
4.03125
4
CC-MAIN-2021-17
latest
en
0.889787
https://www.edplace.com/worksheet_info/maths/keystage2/year6/topic/14/6028/understand-linear-number-sequences
1,580,256,319,000,000,000
text/html
crawl-data/CC-MAIN-2020-05/segments/1579251783342.96/warc/CC-MAIN-20200128215526-20200129005526-00149.warc.gz
808,803,680
27,986
# Understand Linear Number Sequences In this worksheet, students will be tested on their understanding of linear number sequences by finding the given terms of different sequences and creating expressions that represent linear number sequences. Key stage:  KS 2 Curriculum topic:   Algebra Curriculum subtopic:   Know Linear Number Sequences Difficulty level: ### QUESTION 1 of 10 The nth term is a formula with 'n' in it that enables you to find any term of a sequence without having to go up from one term to the next. n stands for the term number so to find the 10th term, we would just substitute 10 in the formula in place of 'n' In this activity, you will be asked to find the given term. Example 1: Find the 6th term for n + 4= 6 + 4 = 10 So the 6th term is 10. Example 2: Find the 8th term for 2n - 4 (remember to always do the calculation in brackets first, BODMAS): (2 x 8) - 4 = 12 16 - 4 = 12 The 8th term is 12. In this activity, you will also be asked to write an expression using given numbers and letters. Example: The amount received by 6 children when a prize is shared equally between them. Use the bold type letters and numbers to help: We would create the expression: a = p÷6 Now, over to you! Can you write down the next term of the sequence whose nth term is 8n - 5? Can you write the next 2 terms in the sequence whose nth term is 9n? Can you correctly identify the first three terms of a sequence whose nth term is 6n - 5? 1, 6, 12 1, 7, 13 1, 8, 14 Can you write the expression for the length (l) of the lorry? b                               4 Can you choose the two correct expressions for the length (l) of the lorry? 12                            f 12 + f f12 f + 12 12f Choose the correct expression that will represent the following statement. There are c cars in a car park and then 5 more arrive. c5 c - 5 c + 5 c / 5 Can you match the following statements with the correct expression? 1. There are s sweets in a box, then someone eats 6 of them. 2. Tony had 15 stickers. He gave 'g' stickers to his friends. How many stickers does he have left? ## Column B There are s sweets in a box, then someone eats 6 o... (5+n) ÷ 3 Tony had 15 stickers. He gave 'g' stickers to his ... s - 6 15 - g Which one of the following word expressions fails to adequately express the following statement? (Use the letters and numbers in bold to help you.) The total money raised in a sponsored swim at £3 for each length. t = 3l l = 3t Can you find the expressions for the following statement? 2 x 5 x n x 2 (5xn)² (5n)² 2 x - n x 5 The formula for the length left on a 40 m roll of carpet is R = 40 - C Use this formula to work out R for the two questions below and choose the correct answers: a. C = 12 b. C = 19 • Question 1 Can you write down the next term of the sequence whose nth term is 8n - 5? 3 EDDIE SAYS Don't forget, n stands for the term number so to find the 8th term, we would just substitute 8 in the formula in place of 'n'. 8n - 5 = 8 x 1 = 8 - 5 = 3 • Question 2 Can you write the next 2 terms in the sequence whose nth term is 9n? 9 18 EDDIE SAYS The same rule applies. 'n' stands for the term number so to find the 9th term, we would just substitute 9 in the formula in place of 'n'. 9 x 1 = 9 9 x 2 = 18 1st term = 9 2nd term = 18 Got it? No worries if not, let's keep practising. • Question 3 Can you correctly identify the first three terms of a sequence whose nth term is 6n - 5? 1, 7, 13 EDDIE SAYS Did you get it? There were a tricky range of options close to the correct answer! Again, don't forget 'n' stands for the term number so, in order to find the 6th term, we would just substitute 6 in the formula in place of 'n'. 6 x 1 = 6 - 5 = 1 6 x 2 =12 - 5 = 7 6 x 3 = 18 - 5 = 13 1st term = 1 2nd term = 7 3rd term = 13 • Question 4 Can you write the expression for the length (l) of the lorry? b                               4 b + 4 4 + b EDDIE SAYS We can write the expression for the length of the lorry in two ways, either b + 4 or 4 + b both will equal l (length). Simple. • Question 5 Can you choose the two correct expressions for the length (l) of the lorry? 12                            f 12 + f f + 12 EDDIE SAYS We can write the expression for the length of the lorry in two ways, either 12 + f or, f + 12, both will equal l (length). • Question 6 Choose the correct expression that will represent the following statement. There are c cars in a car park and then 5 more arrive. c + 5 EDDIE SAYS For this worded problem, the expression is c + 5. c represents the cars that are already parked in the car park and + 5 shows that 5 extra cars have arrived. You're getting better at this with every attempt! • Question 7 Can you match the following statements with the correct expression? 1. There are s sweets in a box, then someone eats 6 of them. 2. Tony had 15 stickers. He gave 'g' stickers to his friends. How many stickers does he have left? ## Column B There are s sweets in a box, then... s - 6 Tony had 15 stickers. He gave 'g'... 15 - g (5+n) ÷ 3 EDDIE SAYS We had different types of calculations to use to create the correct expressions. 1. There are s sweets in a box, then someone eats 6 of them. s - 6 2. Tony had 15 stickers. He gave 'g' stickers to his friends. How many stickers does he have left? 15 - g 3. Add 5 to n and then divide your answer by 3 = (5 + n) ÷ 3 For this last question, remember BODMAS, it tells which order to do things in. BODMAS = Brackets, Orders, Division, Multiplication, Addition, Subtraction. • Question 8 Which one of the following word expressions fails to adequately express the following statement? (Use the letters and numbers in bold to help you.) The total money raised in a sponsored swim at £3 for each length. t = 3l EDDIE SAYS That made us think! So the short rule can be written in two possible different ways: t = 3 x l t = 3l • Question 9 Can you find the expressions for the following statement? (5xn)² (5n)² EDDIE SAYS As before, we were told the order to complete the equation so we have to use brackets to show this. (5xn)² = (5n)² Remember BODMAS, it tells which order to do things in. BODMAS = Brackets, Orders, Division, Multiplication, Addition, Subtraction. • Question 10 The formula for the length left on a 40 m roll of carpet is R = 40 - C Use this formula to work out R for the two questions below and choose the correct answers: a. C = 12 b. C = 19 EDDIE SAYS Here we had to use our knowledge of the expression of R = 40 - c to find the correct answer. a. R = 40- 12 = 28 b. R = 40 - 19 = 21 Well done! That's another activity completed. Why not have an attempt at another so you feel really confident? ---- OR ---- Sign up for a £1 trial so you can track and measure your child's progress on this activity. ### What is EdPlace? We're your National Curriculum aligned online education content provider helping each child succeed in English, maths and science from year 1 to GCSE. With an EdPlace account you’ll be able to track and measure progress, helping each child achieve their best. We build confidence and attainment by personalising each child’s learning at a level that suits them. Get started
2,057
7,229
{"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-2020-05
longest
en
0.908632
https://www.shaalaa.com/question-bank-solutions/express-the-following-verbal-statement-to-algebraic-statement-t-is-added-to-100-introduction-to-algebra_192613
1,696,022,575,000,000,000
text/html
crawl-data/CC-MAIN-2023-40/segments/1695233510528.86/warc/CC-MAIN-20230929190403-20230929220403-00693.warc.gz
1,085,475,803
8,861
Tamil Nadu Board of Secondary EducationSSLC (English Medium) Class 6 # Express the following verbal statement to algebraic statement ‘t’ is added to 100 - Mathematics Sum Express the following verbal statement to algebraic statement #### Solution t + 100 Is there an error in this question or solution? Chapter 2: Introduction to Algebra - Exercise 2.1 [Page 41] #### APPEARS IN Tamil Nadu Board Samacheer Kalvi Class 6th Mathematics Term 1 Answers Guide Chapter 2 Introduction to Algebra Exercise 2.1 | Q 6. (i) | Page 41 Share
139
536
{"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-2023-40
latest
en
0.778755
https://hunbay.com/qa/question-how-many-cc-is-a-13-hp-engine.html
1,624,306,227,000,000,000
text/html
crawl-data/CC-MAIN-2021-25/segments/1623488289268.76/warc/CC-MAIN-20210621181810-20210621211810-00421.warc.gz
299,289,378
10,674
# Question: How Many Cc Is A 13 Hp Engine? ## How much horsepower is 125cc? 450What is the power measurement for my walk/push mower engine?EngineSeriesGross HP125cc4503.00140cc5003.25140cc5503.75150cc6254.257 more rows. ## How many horsepower is 110 cc’s? 6.8 HPEngine SpecificationsModel110CC (RW157FMJ)TypeVertical, four-stroke, single cylinderDisplacement106.7 cc (6.51 cu-in)Max. horsepower6.9 PS (5.1 KW; 6.8 HP) at 7,500 rpm9 more rows ## How many cc is a 3 hp engine? 79cc3 HP (79cc) OHV Horizontal Shaft Gas Engine EPA. ## How many horsepower is 1600cc? A 1600cc engine can produce 120hp at 5000rpm. The 1600cc V-twin Harley Davidsons have about 90HP while the four cylinder sport bikes have 160 HP. 1600cc engines are capable of generating more than 160hp. ## How many cc is a 15 hp engine? 420Fuel Type: Gasoline. Horse Power: 15. Engine Displacement (CC): 420. ## How do you convert cc’s to horsepower? Use a calculator to multiply your engine’s horsepower by 16. For example, if your engine has 150 horsepower, multiply 150 x 16 = 2,400 cc. This figure represents your engine’s horsepower in cubic centimeters. ## How many cc is a 9 hp engine? 315ccA loose rule-of-thumb for small, 4-cycle utility engines is 35cc/horsepower. This would put your 9 hp engine at approximately 315cc. ## How fast is 1000cc? The fastest 1000cc motorcycles are normally limited to 188 mph by their rev limiter, which protects the vehicle’s engine by restricting its maximum speed. However, if these high-speed motorcycles are being ridden on a track, they can likely break 200 mph. ## How much horsepower is 200cc? 10 horsepowerOn average you could expect around 5–10 horsepower from a 200cc engine, but it can vary hugely. CC is a measurement of volume or size where Engine horsepower is a measurement of power output at certain rpm. ## How many horsepower is 1000 cc’s? 60-70 HPA typical 1000cc car weighs around 700 kgs and for a passenger car market, a 1000cc engine would have power output of 60-70 HP. ## How many cc is a 16 hp engine? 420 ccThis it does with 16hp….Sale Price: \$12.99.SpecificationsBore/Stroke90 X 66Displacement420 ccCompression Ratio8:2:1Max Power16 HP @ 3600 RPM31 more rows ## How much HP is 80cc? HIGH PERFORMANCE: Unlike most standard bicycle engine kits, the BBR Tuning 66/80cc comes standard with high quality components designed to last. This engine puts out 5-6 HP (horse power) and has a top speed of 25-35MPH (miles per hour) stock. ## How many horsepower is 1500 cc’s? Most modern car engines produce around 60 to 75 horsepower per litre, so a 1.5 litre engine would have a power output of 90–112 horsepower or thereabouts unless it is a low-spec engine. A sports motorcycle engine of that capacity would be producing upwards of 175 horsepower however. ## How many HP is a 500cc engine? 18.5500cc/18.5 Gross HP Briggs & Stratton Vertical Engine. ## How many cc’s are in 1 horsepower? 15 CCThe general rule is for every 15 CC there is 1 HP. For example, for a 150 CC engine you would take 150 divided by 15, which equals 10 HP. ## How many cc’s is 14 horsepower? Many people have asked for a relationship between horsepower and cc or how many cc in a hp. The short answer is about 14 to 17cc = 1 hp or about 1 cu.in. ## How many cc is a 12.5 hp engine? 344-ccBriggs & Stratton Intek 344-cc 12.5-HP Briggs & Stratton Replacement Engine for Riding Mower. ## How many HP is 400cc? As an example a 400cc lawn mower engine could produce 5hp whilst a 400cc high performance bike engine could produce 50hp.
977
3,562
{"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.875
3
CC-MAIN-2021-25
latest
en
0.900443
https://www.milliliter.org/pint-dry-to-milliliters-conversion
1,610,811,181,000,000,000
text/html
crawl-data/CC-MAIN-2021-04/segments/1610703506697.14/warc/CC-MAIN-20210116135004-20210116165004-00100.warc.gz
903,060,157
5,771
# Pint (U.S. dry) to Milliliters Conversion Convert Pint (U.S. dry) to Milliliters by entering the Pint (U.S. dry) (dry pt) value in the calculator form. dry pt to mL conversion. dry pt to mL Converter 1 dry pt = 550.6105 mL Milliliters to Pint (U.S. dry) Conversion Pint (U.S. dry) volume unit is equal to 550.6105 Milliliters. ## How Many Milliliters in a Pint (U.S. dry) There are 550.6105 Milliliters in a Pint (U.S. dry). ### Conversion Factors for Milliliters and Pint (U.S. dry) Volume UnitSymbolFactor Pint (U.S. dry) dry pt 5.506105 × 10 -4 Milliliters mL 1 × 10 -6 ### Pint (U.S. dry) to Milliliters Calculation We calculate the base unit equivalent of Pint (U.S. dry) and Milliliters with the base unit factor of volume cubic meter. ```1 dry pt = 5.506105 * 10-4 m³ 1 mL = 1 * 10-6 m³ 1 mL = 1.0E-6 m³ 1 m³ = (1/1.0E-6) mL 1 m³ = 1000000 mL 1 dry pt = 5.506105 * 10-4 * 1000000 mL 1 dry pt = 550.6105 mL``` ### Pint (U.S. dry) to Milliliters Conversion Table Pint (U.S. dry)Milliliters 1 dry pt550.6105 mL 2 dry pt1101.221 mL 3 dry pt1651.8315 mL 4 dry pt2202.442 mL 5 dry pt2753.0525 mL 6 dry pt3303.663 mL 7 dry pt3854.2735 mL 8 dry pt4404.884 mL 9 dry pt4955.4945 mL 10 dry pt5506.105 mL 11 dry pt6056.7155 mL 12 dry pt6607.326 mL 13 dry pt7157.9365 mL 14 dry pt7708.547 mL 15 dry pt8259.1575 mL 16 dry pt8809.768 mL 17 dry pt9360.3785 mL 18 dry pt9910.989 mL 19 dry pt10461.5995 mL 20 dry pt11012.21 mL #### Abbreviations • dry pt : Pint (U.S. dry) • mL : Milliliters • m³ : Cubic Meter Pint (U.S. dry) to Milliliters Conversion ### Related Volume Conversions List all Pint (U.S. dry) Conversions »
628
1,633
{"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-2021-04
longest
en
0.569479
http://wiki.eclipse.org/index.php?title=GEF/GEF4/Geometry&diff=321868&oldid=309439
1,448,599,795,000,000,000
text/html
crawl-data/CC-MAIN-2015-48/segments/1448398447913.86/warc/CC-MAIN-20151124205407-00019-ip-10-71-132-137.ec2.internal.warc.gz
251,421,571
25,777
# Difference between revisions of "GEF/GEF4/Geometry" < GEF‎ | GEF4 Note to non-wiki readers: This documentation is generated from the Eclipse wiki - if you have corrections or additions it would be awesome if you added them in the original wiki page. ## Introduction This is the reference documentation of the GEF 4 Geometry component. It provides classes to store geometric objects and to perform geometric computations based on those objects. Different kinds of abstractions are provided to support different kinds of geometric calculations, within 2-dimensional Euclidean vector space or its related projective space, or based on 2-dimensional planar objects. Furthermore, conversions are supported to import/export from/to related SWT and AWT representations. The API is universally based on double precision calculations. Result values are computed as precise as possible, most of the time. In situations where result values are approximated, the approximation is as precise as required for the related test methods to agree on the values. An imprecision is used in the comparisons of double precision values throughout the implementation. These imprecise comparisons shall ensure consistency with regard to floating point and approximation errors. Planar Euclidean Projective Convert ICurve IShape IMultiShape Path Angle Straight3D Geometry2SWT Arc Ellipse Region   Straight Vector3D SWT2Geometry BezierCurve Pie Ring   Vector   Geometry2AWT CubicCurve Polygon         AWT2Geometry Line Rectangle         SWT2AWT PolyBezier CurvedPolygon Polyline To ease navigation, the following sections are organized around the source code packages (org.eclipse.gef4.geomtry.*) of the API, as they were designed to represent the different domains of abstractions. ## Planar Geometry • package: org.eclipse.gef4.geometry.planar The planar package provides basic abstractions for computations based on 2-dimensional geometric objects. As outlined above, with the exception of the Path abstraction, all objects are classified into either being curves, shapes, or multi shapes by means of respective interfaces. An ICurve is a one dimensional geometry, i.e. the result that you get by drawing a continuous line with a pencil. It has a start and an end point and you can approximate it by a series of BezierCurves. An IShape is a two dimensional geometry, i.e. it continuously encloses a region on the drawing area, without holes. An IMultiShape is a (possibly) non-continuous set of IShapes. An example for an IMultiShape is the Region. A Region represents the area that results from composing multiple Rectangles. Accordingly, a Ring represents the area that results from composing multiple Polygons. It corresponds to the SWT Region. The most general type in the hierarchy is the Path, because every geometric object can be transfered into it. Unfortunately, the Path is incompatible to the rest of the API in that it does not implement the different interfaces, it does not ensure a certain precision for the results of its test and manipulation methods, and it cannot be transferred back into compatible objects. As you can see in this diagram, an ICurve can be approximated by a number of BezierCurves using the toBezier() method. The outline of an IShape can be retrieved using its getOutline() method. Additionally, you can split an IShape into a number of ICurves -- which form the outline -- using the getOutlineSegments() method. IMultiShape provides a getShapes() method to get the individual IShapes that are combined by the IMultiShape. It does provide a getOutlineSegments() method, too, which is used to split the IMultiShape into several ICurves. These transfer methods allow the decomposition of any geometric object into a bunch of BezierCurves: ```BezierCurve[] fromCurve = curve.toBezier(); BezierCurve[] fromShape = shape.getOutline().toBezier(); ICurve[] fromPolyShape = polyShape.getOutlineSegments(); List<BezierCurve> beziers = new ArrayList<BezierCurve>(); for (ICurve c : fromPolyShape) An important part of a geometry API in general, is the possibility to test the relationship of two geometric objects. The GEF 4 Geometry API provides four methods that perform relation tests. Universally usable is the touches() method for planar objects. It tests if two objects have at least one point in common. Additionally, ICurves can be tested for points of intersection using the intersects() method and for an overlap using the overlaps() method, among each other. An IShape provides a contains() method to test if it fully contains a given planar object. Moreover, the point test is available for every geometric object. It tests if a given Point is incidental to the particular object. Supplementary to the intersects() test, a getIntersections() method is offered among ICurves. BezierCurves do also facilitate the extraction of overlapping segments via the getOverlap() method. So, let us consider a few examples: ```boolean contained = arc.contains(point); boolean contained = pie.contains(point); Point[] intersections = line1.getIntersections(line2); Point[] intersections = line.getIntersections(polygon.getOutline()); Point[] intersections = polygon.getOutline().getIntersections(roundedRectangle.getOutline()); boolean contained = ellipse.contains(line); boolean contained = rectangle.contains(ellipse); boolean contained = region.contains(polygon);``` Noticeably, the use of interfaces unifies similar operations on different types. Therefore, the fundamental interfaces (ICurve, IShape, etc.) are complemented by three transformation interfaces. You can either transform your geometric objects via instances of the AffineTransform class, or by using the short-cut methods provided by the ITranslatable, IScalable, and IRotatable interfaces. Transformations can either be directly applied to an object, modifying the object in-place, or to a copy of the original object. This distinction is represented by the names of the short-cut methods. All names starting with 'get' are applied to a copy of the original object. The other methods modify the object in-place. Translating an object means moving the object. You can move an object in x- and y-direction. Scaling an object means resizing the object. You can individually scale the object in x- and y-direction. Additionally, scaling requires a relative Point to scale to/away from. If you omit this Point, the scaling method will appropriately choose the relative Point. Normally, this will be the center Point of the geometric object that you want to scale. Rotation is special in that not all geometric objects can be rotated in-place. Rectangles, for example, are always parallel to the x- and y-axes. That's why the IRotatable interface does only include the getRotated*() short-cut methods which are not directly applied. However, some geometric objects do provide in-place rotation methods. As with scaling, rotation is performed around a relative Point. If you omit this Point, the rotation method will appropriately choose it. Normally, this will be the center Point of the geometric object that you want to rotate. ```Polygon rhomb = new Rectangle(10, 10, 10, 10).getRotatedCCW(Angle.fromDeg(45)); PolyBezier slanted = new Ellipse(100, 100, 100, 50).getRotatedCCW(Angle.fromDeg(30)); Ring rotatedClippingArea = region.getRotatedCCW(Angle.fromDeg(300));``` Augmenting the interface hierarchy, all concrete classes are based on abstract geometry classes, depending on the type of geometry used for constructing the objects (i.e. Ellipse is an AbstractRectangleBasedGeometry, because it is constructed by means of a Rectangle). This classification by the construction type of the individual geometry objects allows the generalization of many operations in a few abstract classes. Those abstract classes implement methods that should return an object of the same type as the inheriting class. Thus, type parameters are used to specify such return types. ### Point Point objects represent a point in 2-dimensional space. For the purpose of imagination, you can assume the coordinate system to be originated in the top left corner of your drawing area, expanding to the right and to the bottom. From a list of Point objects, you can build up most of the planar geometric objects: ```Point p0 = new Point(); // defaults: x=0, y=0 Point p1 = new Point(5, 0); Point p2 = new Point(0, 5); Polygon triangle = new Polygon(p0, p1, p2);``` Additionally, the Point class provides static utility methods to operate on a list of Points: getBounds(Point...), getCentroid(Point...), and getConvexHull(Point...). They construct a bounding box, the centroid, and a convex hull of the given Point list, respectively. `Polygon convexHull = Point.getConvexHull(points);` ### Dimension The Dimension class is the pendant of the org.eclipse.draw2d.geometry.Dimension class. It decouples the location and the width and height of a rectangular object. ```Rectangle bounds = new Rectangle( new Point(50, 50), new Dimension(80, 20) );``` ### Line • extends: BezierCurve • implements: ICurve, ITranslatable, IScalable, IRotatable A Line is the straight connection of two Points: `Line line = new Line(p0, p1);` As it inherits from the BezierCurve class, all the operations for BezierCurves are available for Line objects, too. Because of its frequent use, Line overrides many of those operations to provide faster implementations for the Line/Line and Line/Point cases (equals(), touches(), contains(), intersects(), overlaps(), getIntersections(), and many more). If you want to display a Line using SWT, you can use the Geometry2SWT.toSWTPointArray() method as follows: `gc.drawPolyline(Geometry2SWT.toSWTPointArray(line));` ### Rectangle • extends: AbstractRectangleBasedGeometry • implements: IShape, ITranslatable, IScalable, IRotatable A Rectangle is the axes-parallel rectangle defined by a location (x- and y-coordinates) and a Dimension (width and height): `Rectangle rect = new Rectangle(x, y, w, h);` Rotating a Rectangle results in a Polygon: `Polygon slanted = rect.getRotatedCCW(Angle.fromDeg(30));` Rectangle objects are frequently used, that's why some operations are overridden to provide faster implementations for designated parameter types (equals(), contains(), touches()). If you want to display a Rectangle using SWT, you can use the Geometry2SWT.toSWTRectangle() method as follows: `gc.drawRectangle(Geometry2SWT.toSWTRectangle(rect));` ### Polyline • extends: AbstractPointListBasedGeometry • implements: ICurve, ITranslatable, IScalable, IRotatable A Polyline combines multiple Line segments to address them as a whole. Consecutive Line segments of a Polyline share at least one end Point. The outline of some of the IShape implementations can be represented by a Polyline (Rectangle and Polygon): ```Polyline polyLine = new Polyline(new Line(p0, p1), new Line(p1, p2)); Polyline outline = Polygon.getOutline();``` To render a Polyline with SWT, you can use the Geometry2SWT.toSWTPointArray() method as follows: `gc.drawPolyline(Geometry2SWT.toSWTPointArray(polyline));` ### Polygon • extends: AbstractPointListBasedGeometry • implements: IShape, ITranslatable, IScalable, IRotatable A Polygon represents a simple polygon, i.e one that does not have intersecting sides: `Polygon rhomb = new Polygon(0, 0, 1, -1, 2, 0, 1, 1);` If you need to process self-intersecting polygons, you can use the Ring instead. A Polygon can be rendered with SWT using the Geometry2SWT.toSWTPointArray() method as follows: `gc.drawPolyline(Geometry2SWT.toSWTPointArray(polygon));` ### Ellipse • extends: AbstractRectangleBasedGeometry • implements: IShape, ITranslatable, IScalable, IRotatable An Ellipse is the axes-symmetric oval that can be put into an axes-parallel Rectangle: `Ellipse ellipse = new Ellipse(rect);` Therefore, rotating an Ellipse does not result in another Ellipse, but in a PolyBezier which approximates the rotated Ellipse: `PolyBezier rotatedEllipse = ellipse.getRotatedCCW(Angle.fromDeg(45));` You can always transfrom a PolyBezier into an Ellipse by using the PolyBezier's bounds as the Ellipse's bounds: `Ellipse rotated = new Ellipse(rotatedEllipse.getBounds());` If you want to draw an Ellipse using SWT, you can directly use the GC's drawOval() method as follows: `gc.drawOval((int) ellipse.getX(), (int) ellipse.getY(), (int) ellipse.getWidth(), (int) ellipse.getHeight());` ### Arc • extends: AbstractArcBasedGeometry (which extends AbstractRectangleBasedGeometry) • implements: ICurve, ITranslatable, IScalable, IRotatable An Arc is an open segment of an Ellipse: `Arc arc = new Arc(ellipse, Angle.fromDeg(45), Angle.fromDeg(90));` Rotating an Arc does not necessarily result in another Arc, that's why the rotation methods return PolyBeziers instead: `PolyBezier polyBezier = arc.getRotatedCCW(Angle.fromDeg(15), new Point());` Unfortunately, it is impossible to transfrom a PolyBezier into an Arc. ### Pie • extends: AbstractArcBasedGeometry (which extends AbstractRectangleBasedGeometry) • implements: IShape, ITranslatable, IScalable, IRotatable A Pie is a closed Arc. Closing the Arc is done by creating two segments: one from the mid Point of the related Ellipse to the start Point of the related Arc, the other from the mid Point of the Ellipse to the end Point of the Arc. `Pie pie = new Pie(arc);` Rotating a Pie results in a Path, which, unfortunately, cannot be transformed back into a Pie: `Path rotatedPie = pie.getRotatedCCW(Angle.fromDeg(15), new Point());` ### RoundedRectangle • extends: AbstractRectangleBasedGeometry • implements: IShape, ITranslatable, IScalable, IRotatable A RoundedRectangle is a rectangle with round corners. The corners are 90 degrees Arc objects: `RoundedRectangle rr = new RoundedRectangle(bounds, arcWidth, arcHeight);` Rotating a RoundedRectangle does not result in another RoundedRectangle, but rather in a PolyBezier describing the rotated outline: `PolyBezier rotated = rr.getRotatedCCW();` Unfortunately, it is impossible to transform a PolyBezier into a RoundedRectangle. ### BezierCurve • extends: AbstractGeometry • implements: ICurve, ITranslatable, IScalable, IRotatable A BezierCurve is constructed by a number of control Points: the start Point, an arbitrary number of handle Points, and the end Point. The curve approaches the handle Points. Therefore, the handle Points describe the flow of the curve. The more handle Points used, the more converges the BezierCurve to the Polyline through the control Points: `BezierCurve curve = new BezierCurve(pStart, pHandle0, pHandle1, pHandle2, ..., pEnd);` • extends: BezierCurve • implements: ICurve, ITranslatable, IScalable, IRotatable A QuadraticCurve is a BezierCurve with three control Points: the start Point, one handle Point, and the end Point. ### CubicCurve • extends: BezierCurve • implements: ICurve, ITranslatable, IScalable, IRotatable A CubicCurve is a BezierCurve with four control Points: the start Point, two handle Points, and the end Point. Many geometry objects approximate their round outline segments using a number of CubicCurves (Ellipse, Arc, Pie, and RoundedRectangle). ### PolyBezier • extends: AbstractGeometry • implements: ICurve, ITranslatable, IScalable, IRotatable A PolyBezier combines multiple BezierCurve segments to address them as a whole: `PolyBezier polyBezier = new PolyBezier(line, quadCurve, cubicCurve, arbitraryBezierCurve);` Consecutive BezierCurves are connected with each other, i.e. the end Point of one BezierCurve is the start Point of the subsequent BezierCurve. The outline of several IShape implementations can be represented by a PolyBezier (Ellipse, Pie, and RoundedRectangle): `PolyBezier outline = pie.getOutline();` Besides, the PolyBezier class provides a method to interpolate a number of CubicCurves through a set of Points: `PolyBezier interpolation = PolyBezier.interpolateCubic(p0, p1, p2, p3, ...);` ### CurvedPolygon • extends: AbstractGeometry • implements: IShape, ITranslatable, IScalable, IRotatable A CurvedPolygon is composed by a number of BezierCurves where two subsequent BezierCurves have to share one end Point. Moreover, a CurvedPolygon is always closed, so the end Point of the last BezierCurve has to be equal to the start Point of the first BezierCurve. ### Region • extends: AbstractPolyShape • implements: IMultiShape, ITranslatable, IScalable, IRotatable A Region is build up of multiple Rectangles to address their enclosing area as a unit. The Rectangles that build up the Region do not have to touch each other. If they intersect, the Rectangles are divided into a number of internal Rectangles that do not intersect: `Region region = new Region(rect0, rect1, rect2);` You can use a Region as a clipping area as in the example image above. For this purpose, it can be transfered into a SWT Region using the Geometry2SWT.toSWTRegion() method as follows: `gc.setClipping(Geometry2SWT.toSWTRegion(region));` Rotating a Region results in a Ring: `Ring rotatedRegion = region.getRotatedCCW(Angle.fromDeg(45));` ### Ring • extends: AbstractPolyShape • implements: IMultiShape, ITranslatable, IScalable, IRotatable A Ring is build up of multiple Polygons to address their enclosing area as a unit. The Polygons that build up the Ring do not have to touch each other. They are transfered into an internal number of triangles that do not intersect: `Ring ring = new Ring(poly0, poly1, poly2);` ### Path • extends: AbstractGeometry Using a Path is like drawing the joker. You can transfer every other geometric object into a Path using the toPath() method. But the Path does not implement the GEF 4 Geometry interfaces. It simply delegates to the java.awt.geom.Path2D. That's why you should try to avoid using the Path if you want to perform further computations. On the other hand, a Path is easy to render via SWT: ```gc.drawPath(new org.eclipse.swt.graphics.Path(Display.getCurrent(), Geometry2SWT.toSWTPathData(gef4Path)); gc.fillPath(new org.eclipse.swt.graphics.Path(Display.getCurrent(), Geometry2SWT.toSWTPathData(gef4Path));``` ## Euclidean Geometry • package: org.eclipse.gef4.geometry.euclidean The euclidean package provides core abstractions (Vector, Straight, and Angle) to support calculations within 2-dimensional Euclidean space. ### Angle Considering rotation and the angular relationship of two straight lines, Angle objects come into play. They abstract over the two commonly used angle units, degrees and radians. The user has to specify the unit of the value an Angle object is constructed from. Moreover, the user can read the value of an Angle object in either degrees or radians. Therefore, the use of Angle objects assures that correct values are used in calculations. This indirection is done due to an inconsistency of several APIs, for example, org.eclipse.swt.graphics.Transform vs. org.eclipse.draw2d.geometry.Transform. ```// creates a 75% pie chart Pie chart = new Pie(0, 0, 100, 100, Angle.fromDeg(15), Angle.fromDeg(270));``` ### Vector A Vector has two components x and y. It can be interpreted as a planar Point (toPoint()). The Vector class implements the common arithmetic operations for vectors: addition, multiplication with a scalar, dot product, cross product, and Angle calculation between two Vectors: ```Vector u = new Vector(1, 0); Vector v = new Vector(0, 1); double zero = u.getDotProduct(v);``` ### Straight A Straight is an infinite planar line. You can build it up from either two Points which the Straight passes through, or by specifying a position and a direction Vector: ```Straight diagonal = new Straight(new Point(1, 1), new Point(2, 2)); Straight diagonal = new Straight(new Vector(1, 1), new Vector(1, 1)); // exactly the same Straight``` ## Projective Geometry • package: org.eclipse.gef4.geometry.projective The projective package provides classes (Vector3D, Straight3D) to represent euclidean elements in the projective plane. Projective geometry is an interesting perspective to (planar) geometry. A point and a line can both be represented by a (x, y, z) triple. And, in fact, people speak of the duality between points and lines, because for any relation between points and lines, the inverse relation holds if you substitute point by line and vice versa. To retain the semantic distinction of points and lines, both concepts are separated in the Vector3D and Straight3D classes. You may wonder why 2-dimensional objects are specified by three components. This is the case, because a planar projective point is really a three dimensional euclidean line, that passes through the origin of the three dimensional coordinate system. The x, y, and z values are the components of the direction vector of that line. Similarly, a planar projective line is really a three dimensional euclidean plane, that contains the origin of the three dimensional coordinate system. The x, y, and z components specify that plane's normal vector. Notice that the z = 1 plane is considered to be the 2-dimensional plane. Therefore, a Vector3D with the components (x, y, z) represents a Point with components (x/z, y/z). This approach leads to elegant mathematical solutions to some of the basic planar geometric operations. You want to know if a point lies on a line? Simply substitute its coordinate values into the Straight3D's formula. You want to know the distance of a point to a line? If the Straight3D's vector is normalized (a^2 + b^2 = 1), the formula evaluates to the signed distance of the point to the line, i.e. on one side of the line it is positive and on the other side it is negative. You want to know where two lines are intersecting? Simply compute the cross product of two (x, y, z) triples. These operations are packed in appropriately named methods. ```Straight3D s = Straight3D.through(new Vector3D(s0), new Vector3D(s1)); // s0, s1 are Points double signedDistance = s.getSignedDistanceCW(p); // Math.abs() => absolute distance Straight3D r = Straight3D.through(new Vector3D(r0), new Vector3D(r1)); // r0, r1 are Points Vector3D intersection = s.getIntersection(r); Point poi = intersection.toPoint();``` ### Vector3D A Vector3D consists of three components (x, y, z). It represents the Point (x/z, y/z) in 2-dimensional space. You can use the common arithmetic operations for vectors on a Vector3D object: ```Vector3D v = new Vector3D(1, 2, 3); Vector3D u = v.getAdded(new Vector3D(3, -6, 1)); double zero = v.getDotProduct(u);``` ### Straight3D A Straight3D consists of three components (x, y, z). It represents the line ax + by + z = 0 in 2-dimensional space, where (a, b) is a planar Point. You can use a Straight3D to calculate the distance of a Vector3D to the Straight3D. Moreover, you can compute the point of intersection of two Straight3Ds: ```Straight3D s = Straight3D.through(new Vector3D(1, 1, 1), new Vector3D(2, 1, 1)); double one = s.getSignedDistanceCW(new Vector3D(1.5, 2, 1));``` ## Conversions • package: org.eclipse.gef4.geometry.convert The convert package contains helper classes to transfer data from AWT/SWT/Geometry to one another. ### From Geometry to SWT Path, Point, Line, Polygon, Polyline, Rectangle, Region, and Ring objects can be transfered into their SWT pendants using the toSWT*() methods provided by the Geometry2SWT class: ```Rectangle rect = new Rectangle(10, 10, 100, 50); org.eclipse.swt.graphics.Rectangle rectSWT = Geometry2SWT.toSWTRectangle(rect);``` Using the IGeometry#toPath() method, you can easily convert any GEF4 Geometry object into an SWT PathData representation: ```CubicCurve curve = new CubicCurve(0, 0, 50, 0, 0, 50, 50, 50); PathData pd = Geometry2SWT.toSWTPathData(curve.toPath());``` ### From SWT to Geometry The SWT2Geometry class contains methods to transfer SWT objects into GEF4 representations. ### From Geometry to AWT Point, Line, Rectangle, RoundedRectangle, and AffineTransform objects can be transfered into their AWT pendants using the toAWT*() methods of the Geometry2AWT class: `RoundRectangle2D rr2d = Geometry2AWT.toAWTRoundedRectangle(rr);` ### From AWT to Geometry Correspondingly, the AWT2Geometry class provides methods to transfer AWT objects into GEF 4 Geometry objects: `RoundedRectangle rr = AWT2Geometry.toRoundedRectangle(rr2d);` ### From SWT to AWT The SWT2AWT class contains a toPathIterator() method which transfers an SWT PathData into an AWT PathIterator. `PathIterator pathIterator = SWT2AWT.toPathIterator(pathData, windingRule);` ### From AWT to SWT The AWT2SWT class contains a toSWTPathData() method which transfers an AWT PathIterator into an SWT PathData. Consider that the winding rule of the AWT PathIterator is not kept in the SWT PathData, because the latter does not store this information. Instead, it is provided by an SWT Path or by the SWT GC that is used to draw the SWT PathData object: `PathData pathData = AWT2SWT.toSWTPathData(pathIterator);`
5,813
24,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}
2.609375
3
CC-MAIN-2015-48
longest
en
0.870596
https://www.coursehero.com/tutors-problems/Computer-Science/8827136-Calculating-the-Factorial-of-a-Number-In-mathematics-the-notation-n/
1,591,237,522,000,000,000
text/html
crawl-data/CC-MAIN-2020-24/segments/1590347436828.65/warc/CC-MAIN-20200604001115-20200604031115-00289.warc.gz
664,996,079
30,369
Calculating the Factorial of a Number In mathematics, the notation n! represents the factorial of the nonnegative integer n. View the step-by-step solution to: Question # Calculating the Factorial of a Number<br/>In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of all the nonnegative integers from 1 up through n. For example: 7! = 1 x 2 x 3 x 4 x 5 x 6 x 7 = 5,040 and 4! = 1 x 2 x 3 x 4 = 24 Design a program, in Python, that asks the user to enter a nonnegative integer and then displays the factorial of that number. # Program calcualte the factorial of a number. number = int(input(&quot;Please enter a non-negative integer: &quot;)) factorial = 1 # check for valid input if number &lt; 0:... ### Why Join Course Hero? Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors. • ### - Study Documents Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access. Browse Documents
282
1,126
{"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-2020-24
latest
en
0.809536
https://tutorialcup.com/leetcode-solutions/shuffle-string-leetcode-solution.htm
1,723,324,345,000,000,000
text/html
crawl-data/CC-MAIN-2024-33/segments/1722640822309.61/warc/CC-MAIN-20240810190707-20240810220707-00401.warc.gz
472,700,239
18,746
# Shuffle String Leetcode Solution Difficulty Level Easy algorithms coding Interview interviewprep LeetCode LeetCodeSolutions SortingViews 8318 ## Problem statement In the problem ” Shuffle String” we are given a String and an array. The array contains the new indices of the character of the string. So array[i] represents a new position of character at ith position of the string. In “Shuffle String”  we need to shuffle the characters of the string in such a way that ith character of the string is moved to indices[i]th position and return the new shuffled string. ### Example `s = "art", indices = [1,0,2]` `rat` Explanation: the new position of characters are as follows: a->1 r->0 t->2 So after shuffling the characters shuffled string is rat. ## Approach for Shuffle String Leetcode Solution The ” Shuffle String ” problem is basically an implementation problem where we need to focus more on the implementation part. Here we have to assign a character that is present at the ith position to indices[i]th position. This will be more clear from the below image. As it is shown in the image “a” is moved to index number 1, “r” is moved to index number 0, and “t” is moved to index number 2. So the final string after performing shuffle operation it becomes “rat”. So we will use a new string variable to store the result and initialize it with the original string. let’s call it result string. Now we will traverse the indices array and will assign character at ith position to result[indices[i]]. At the end, the result string will contain the new shuffled string. ### C++ code for Shuffle String ```#include <bits/stdc++.h> using namespace std; string restoreString(string s, vector<int>& indices) { string res = s; for(int i =0; i < indices.size(); ++i) res[indices[i]] = s[i]; return res; } int main() { string s="art"; vector<int> arr = { 1,0,2 }; cout<<restoreString(s,arr)<<endl; return 0; }``` `rat` ### Java code for Shuffle String ```import java.util.Arrays; public class Tutorialcup { public static String restoreString(String s, int[] indices) { StringBuilder res = new StringBuilder(s); for(int i =0; i < indices.length; ++i) res.setCharAt(indices[i],s.charAt(i)); return res.toString(); } public static void main(String[] args) { String s="art"; int [] arr = {1,0,2}; String ans= restoreString(s,arr); System.out.println(ans); } }``` `rat` ## Complexity Analysis of Shuffle String Leetcode Solution ### Time complexity The time complexity of the above code is O(n) because we are traversing the indices only once. Here n represents the number of characters in the string. ### Space complexity The space complexity of the above code is O(1) because we are using only a variable to store answer. References Translate »
653
2,766
{"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-2024-33
latest
en
0.751522
https://www.coursehero.com/tutors-problems/C++-Programming/11521888-Deitels-How-to-Program-C-622-Use-a-double-subscripted-array-to-solve/
1,544,553,158,000,000,000
text/html
crawl-data/CC-MAIN-2018-51/segments/1544376823674.34/warc/CC-MAIN-20181211172919-20181211194419-00341.warc.gz
866,237,287
23,341
View the step-by-step solution to: # Deitel's How to Program C 6.22 Use a double-subscripted array to solve the following problem. A company has four salespeople (1 to 4) who sell five... Deitel's How to Program C 6.22 Use a double-subscripted array to solve the following problem. A company has four salespeople (1 to 4) who sell five different products (1 to 5). Each salesperson passes in slips for each different type of product sold. Each slip contains the following: a) The salesperson number b) The product number c) The total dollar value of that product sold that day Thus, each salesperson passes in between 0 and 5 sales slips per day. Assume that the information from all of the slips for last month are available. I need to write a program that reads all this information for last month's sales and summarize the total sales by salesperson by product. All totals should be stored in the two-dimensional array sales. After processing all the information for last month, print the results in tabular format with each of the columns representing a particular salesperson and each of the rows representing a particular product. Cross total each row to get the total sales of each product for last month; cross total each column to get the total sales by salespersonfor last month. Your tabular printout should include these cross totals to the right of the totaled rows and to the bottom of the totaled columns. #### Top Answer Sample output: Enter The Sales Person Enter The Products with price. Example: 1 2 12 Enter -9 to exit the data entry and to... View the full answer #### Other Answers Let me explain the... View the full answer :fli tl'ifi 5! Iififlfiflfiflflflfififilfiflfiflfiflfiifi Fiiifi‘ifiu um&quot;: a. uni-— .I&quot; 55.11159 [LE3 fin-Iu‘tinr 'I fllfllfi «EMILE- ”i l. :5 F mun... ### Why Join Course Hero? Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors. ### - Educational Resources • ### - Study Documents Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access. Browse Documents • ### - Question & Answers Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed! Ask a Question Ask a homework question - tutors are online
604
2,418
{"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-2018-51
latest
en
0.854609
https://qaalot.com/how-do-you-stop-swivel-rocker-swiveling/
1,716,497,837,000,000,000
text/html
crawl-data/CC-MAIN-2024-22/segments/1715971058671.46/warc/CC-MAIN-20240523204210-20240523234210-00343.warc.gz
420,827,828
19,700
1. Flip over the recliner so the bottom faces upward. 2. Spin the bottom of the chair in order that the holes on the swivel final analysis up with holes on the bottom of the chair. 3. Place spacer bushings, if needed, within the area between the holes. Apart from, how do you lock a swivel rocker? How to Lock a Swivel Glider Recliner 1. Sit within the chair and lean again to acquire a snug place for you. Elevate the lever on the within of the suitable arm to lock within the reclining place. 2. Attain underneath the left arm of the chair close to the bottom. 3. Flip the knob ahead to unlock the chair’s swivel movement. Subsequently, query is, how do you repair a swivel chair base? How to Restore an Workplace Swivel Chair 1. Step 1 – Degree Chair and Take away Base. Degree the workplace swivel chair on a flat floor and ensure it’s in a horizontal place. 2. Step 2 – Examine the Inside of the Chair. 3. Step 3 – Take away Present Gasoline Cylinder. 4. Step 4 – Set up New Gasoline Cylinder. 5. Step 5 – Re-Assemble the Chair. Simply so, how do you stop a rocker glider from rocking? If you wish to stop your recliner from rocking, you should set up a wedge between the body for the chair and the body of the hinges field. 1. Measure the peak between the underside of the chair body and the highest of the hinged field together with your tape measure. 2. Lower a chunk of hardwood to match the peak and the size. How do you stabilize a swivel chair? Conserving a swivel chair from turning requires a couple of fundamental instruments. 1. Examine the bottom of the chair. 2. Tighten any screws or brackets on the bottom of the chair or on the backside of the stand to see if that impedes the chair from turning. 3. Match a small rubber wedge underneath the chair, between the bottom and the swiveling pole. Associated Query Solutions ## How does a swivel glider chair work? swivel glider? I’ve been taking a look at glider chairs not too long ago and from what I’ve discovered a ‘swivelchair simply means it may rotate, so you can spin round side-to-side, like turning, but it surely stays flat. A glider chair will shuttle, type of like a rocking chair. ## What’s tilt lock in a chair? Tilt Lock. Locks out tilt operate when chair is in upright place. Advantages. Tilt lock permits the consumer to sit down in an upright place for keyboarding, whereas offering a snug rocking/reclining movement throughout conferences, telephone calls and studying actions. ## What’s a swivel recliner? Swivel recliners are designed on a round base that permits them to swivel left and proper in addition to recline backwards. These recliners have a full vary of movement that many individuals desire to the extra restricted movement of different recliners. ## Do swivel chairs lock? The Chair swivel lock permits for locking and unlocking of the swivel function on nearly any chair. This creates a safe seat when getting out and in of the chair – ultimate for a variety of disabilities. With a simple to achieve lever, the swivel lock can be activated from a seated place. ## Can you lock a glider chair? Glider Chair lock. A Glider Lock is an elective piece that will maintain your glider stationary. Simple to put in so you can change your glider to a stationary bench in seconds. ## How do you stop a rocking chair from creaking? How to Repair a Squeaky Rocking Chair 1. Isolate the squeak if doable. 2. Flip the chair over and test every dowel for looseness on the joint the place it suits right into a rocker or the seat. 3. Apply a brief burst of cooking oil spray to the squeaking joint and take a look at the chair to see whether or not this solves the issue. 4. Pour a half tsp. ## Can you stop a Lazy Boy recliner from rocking? La-ZBoy L. If you have a recliner that’s non movement, then you can stop the rocking movement by ‘locking the rock‘. If you have a Energy Recliner sadly you can‘t stop the rocking movement. ## How do you repair a squeaky swivel rocker? Sit within the glider and rock if transferring it by itself produces no squeaks. If the chair nonetheless squeaks, a lubricant is important. Apply a sprig lubricant akin to a silicone spray to the elements that appear to be squeaking, getting the spray between the elements as a lot as doable. Friction is commonly the reason for a squeak. ## How do you repair a rocker recliner mechanism? Discover Your Recliner Pull Deal with HERE 1. If the footrest is open, press or push it right into a closed place. 2. Flip the recliner the wrong way up. 3. Search for the screw or mechanism that holds the deal with in place. 4. Detach the outdated deal with from the recliner. 5. Put the retaining screw into the brand new pull deal with and fasten it. ## How do you repair a glider rocker? Making use of fixes to a glider chair are straightforward for a nonprofessional do-it-yourselfer. ## Can you lock a rocker recliner? Use your new wedge to dam between the chairs body and the field; this will stop the recliner from rocking. After you have ensured the recliner is now safe and nonetheless, you can screw within the block of wooden with a screwdriver. Merely screw in 2-inch wooden screws and the block ought to keep put. ## Are workplace chair cylinders common? Our workplace chair cylinders are usually common. The one distinction between all normal cylinders is what peak they make your seat. ## Does lazyboy make a swivel rocker recliner? Do not accept simply any seat, lounge into consolation with the swivel base recliner chair that options plush padding, an ergonomic design, a 360-degree swivel base, and reclining leg relaxation. Swivel and recline as much as 135 levels with the extendable footrest. ## How do you repair a sagging recliner seat? How to Repair a Recliner That Is Sagging 1. Unzip the covers from the cushions and take away them. Slide them again on over a recent cushion of equal dimension. 2. Tighten the screws and bolts contained in the chair with a screwdriver or Allen wrench. 3. Add a chunk of plywood underneath the seat cushion so as to add firmness to it. 4. Lower open a seam within the aspect cushions with a razor blade. ## How do you disassemble a Lazy Boy recliner? How to Take away the Again of a La-Z-Boy Sofa 1. Pull the La-Z-Boy sofa far sufficient from any partitions so you can comfortably get behind. 2. Peel the material protecting strips away to disclose the lock levers. 3. Pry the lever up with a screwdriver so it’s pointing towards you. 4. Grasp the again of the sofa on the sides with each fingers.
1,509
6,556
{"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-22
latest
en
0.869078
https://online-code-generator.com/diffie-hellman-key-exchange/
1,675,407,900,000,000,000
text/html
crawl-data/CC-MAIN-2023-06/segments/1674764500044.16/warc/CC-MAIN-20230203055519-20230203085519-00065.warc.gz
443,684,937
16,259
# Diffie-Hellman Key Exchange This post presents the Diffie-Hellman Key Exchange (DHKE) – an important part of today’s practical cryptography. Whenever you’re accessing an HTTPS website, it’s very likely that your browser and the server negotiated a shared secret key using the DHKE under the hood. ## Mathematical prerequisites The understand the math behind DHKE, you should be familiar with basic group theory . A group is a set with a binary operation, such that any two items in the set combined with the operation produce another item in the set, the operation is associative, the set has an identity element w.r.t the operation and each set element has an inverse. The group we’re most interested in for the sake of understanding Diffie Hellman is mathbb{Z}_{p}^{*} – the positive integers that are relatively prime to p, with the “multiplication modulo p” operation (another common notation for this group is (mathbb{Z}/pmathbb{Z})^*). This is a finite group. By definition, its cardinality is phi(p), where phi is Euler’s totient function. As an example, mathbb{Z}_{9}^{*}={1,2,4,5,7,8}. The cardinality of this group is phi(9)=6. We can multiply members of the group modulo 9 to get other elements of the group: 2*5equiv 1pmod 9, 8*4equiv 5pmod 9 etc. For a prime p, the group contains all the integers from 1 to p-1 and its cardinality is p-1. ### Cyclic groups Given a group G with the operator odot, we define the order of an element g in the group – ord(g) – as the smallest positive integer k such that: [g^k=underbrace{godot godotcdotsodot g}_{k times}=1] Where 1 is the identity element of G. Note that we use the exponent notation g^k for convenience, even though odot is not necessarily a multiplication – this would work for any group. For example, in the group mathbb{Z}_{9}^{*} shown above, ord(8) is 2, and ord(2) is 6. A group G which contains an element a with the maximal order ord(a)=left|Gright| is called a cyclic group. Elements in a cyclic group that have maximal orders are called generators or primitive elements . These elements can generate all the other elements of the group by repeated application of the group operation. In other words, given a generator g, every ain G can be expressed as g^k for some k. For example, mathbb{Z}_{9}^{*} is cyclic and its primitive elements are 2, 5 and 8. It can be shown that for a prime p, the group mathbb{Z}_{p}^{*} is always cyclic and has phi(p-1) primitive elements, though there’s no easy way to find them – we just have to test them one by one. The proof of this theorem is quite technical, so I’ll leave it for another time. ## The Discrete Logarithm Problem The mathematical problem at the heart of the DHKE is the Discrete Logarithm Problem (DLP). In this discussion I’m going to focus on the DLP in the multiplicative group of integers modulo a prime – mathbb{Z}^{*}_{p}, and will mention the general DLP later on. Given a finite cyclic group mathbb{Z}^{*}_{p} with a prime p, a primitive element g in mathbb{Z}^{*}_{p} and another element b in mathbb{Z}^{*}_{p}, the DLP problem is finding an integer 1le xle p-1 such that: [g^xequiv bpmod{p}] We’ve seen earlier that such an integer must exist because g is a primitive element of the group. The DLP is hard – no one knows how to solve it efficiently. This doesn’t mean that such a solution doesn’t exist – it wasn’t proven to not exist. In this, DLP is similar to factoring, which is essential for the security of RSA. ## Diffie-Hellman Key Exchange (DHKE) The protocol starts with a setup stage, where the two parties agree on the parameters p and g to be used in the rest of the protocol. These parameters can be entirely public, and are specified in RFCs, such as RFC 7919. For the main key exchange protocol, let’s assume that Alice and Bob want to compute a shared secret they could later use to send encrypted messages to one another. They know p and g already. Stage 1 Alice does: Choose a random b_{alice}in{{2,dots,p-2}} compute B_{alice}equiv g^{b_{alice}} mod p Bob does: Choose a random b_{bob}in{{2,dots,p-2}} compute B_{bob}equiv g^{b_{bob}} mod p These Bs are Alice’s and Bob’s public keys, while bs are their private keys. Note that due to the DLP, it’s hard to compute b from B. Stage 2 Alice sends B_{alice} to Bob, while Bob sends B_{bob} to Alice. Stage 3 Now, Bob can compute B_{alice}^{b_{bob}}equiv (g^{b_{alice}})^{b_{bob}}equiv g^{b_{alice}b_{bob}}mod p. Alice can compute B_{bob}^{b_{alice}}equiv (g^{b_{bob}})^{b_{alice}}equiv g^{b_{bob}b_{alice}}mod p. These are equal, and serve as a shared key between Alice and Bob. They can now use it to encrypt a strong symmetric cipher key (say, AES-256) and use that to communicate in complete privacy. ## Authenticated DHKE The basic DHKE protocol, as descibed above, is easily vulnerable to a man-in-the-middle (MITM) attack. When Alice and Bob exchange their public keys in stage 2, nothing guarantees to Alice that the key she received comes from Bob. Eve could place herself between Alice and Bob and set up an exchange with each one of them separately, while making them beleive they are talking to each other. Then she could read all the traffic, while Alice and Bob suspect nothing. The solution to this problem is to use authenticated DHKE instead. The core protocol remains the same, but when Alice and Bob exchange messages, these are signed with a strong signature algorithm. For example, Alice and Bob can use their RSA private keys to sign these messages. Then the MITM attack is impossible because Eve can’t send a message to Bob pretending she’s Alice, without access to Alice’s private RSA key. ## Forward secrecy In the RSA post we’ve seen how the RSA algorithm can be used to create a shared secret between two parties and thus for secret communication. RSA has a serious flaw when used like that, though. There’s a lot of traffic using a single key, which may help breaking it. Once broken, this key can be used to read all past communications that used the same key. DHKE, on the other hand, has forward secrecy. A new DHKE shared secret is generated for every session. Breaking this key will expose the secrets of this session, but won’t enable the attacker to read all past correspondence. Such keys are called ephemeral. You may ask – can’t RSA be made ephemeral? Can’t we use a “master” RSA key to authenticate the key exchange, and generate a fresh public/private key pair for each communication? Yes, that’s absolutely possible, but DHKE is still preferred because it’s more efficient. While generating an RSA key pair requires finding two large primes with certain characteristics, generating a new DHKE public key is simply choosing a random integer and computing a single modular exponent – this is much faster. ## Choosing “safe” primes We’ve seen before that the p and g parameters for DHKE are public. How are these chosen? Can we choose any p and g and have strong security? Turns out that the answer is no, due to some interesting math. Algorithms like Index Calculus can be used to crack the DLP in sub-exponential time. It’s so powerful that we’ll need primes of 1024 bits to have 80-bit security (meaning the equivalent of brute-forcing a 80-bit symmetric key). When coupled with the Pohlig-Hellman attack, we may get in trouble. This attack uses the CRT to break the DLP in time proportional to the factors of |G| [1]. Note that when p is a prime, p-1 is composite, so it will end up having some factors. Which factors? Hard to say, but we want to maximize them. The best way to maximize them is to pick primes of the form 2q+1, where q is a prime. Then |G|=p-1=2q, and its factors are 2 and q. g is chosen such that it generates a sub-group of size q, which ensures we have a large prime |G|. Primes of the form 2q+1 are called safe primes. For example, RFC 7919 recommends several parameters, presenting them thus: The hexadecimal representation of p is: FFFFFFFF FFFFFFFF ADF85458 A2BB4A9A AFDC5620 273D3CF1 D8B9C583 CE2D3695 A9E13641 146433FB CC939DCE 249B3EF9 7D2FE363 630C75D8 F681B202 AEC4617A D3DF1ED5 D5FD6561 2433F51F 5F066ED0 85636555 3DED1AF3 B557135E 7F57C935 984F0C70 E0E68B77 E2A689DA F3EFE872 1DF158A1 36ADE735 30ACCA4F 483A797A BC0AB182 B324FB61 D108A94B B2C8E3FB B96ADAB7 60D7F468 1D4F42A3 DE394DF4 AE56EDE7 6372BB19 0B07A7C8 EE0A6D70 9E02FCE1 CDF7E2EC C03404CD 28342F61 9172FE9C E98583FF 8E4F1232 EEF28183 C3FE3B1B 4C6FAD73 3BB5FCBC 2EC22005 C58EF183 7D1683B2 C6F34A26 C1B2EFFA 886B4238 611FCFDC DE355B3B 6519035B BC34F4DE F99C0238 61B46FC9 D6E6C907 7AD91D26 91F7F7EE 598CB0FA C186D91C AEFE1309 85139270 B4130C93 BC437944 F4FD4452 E2D74DD3 64F2E21E 71F54BFF 5CAE82AB 9C9DF69E E86D2BC5 22363A0D ABC52197 9B0DEADA 1DBF9A42 D5C4484E 0ABCD06B FA53DDEF 3C1B20EE 3FD59D7C 25E41D2B 66C62E37 FFFFFFFF FFFFFFFF The generator is: g = 2 The group size is: q = (p-1)/2 The parameters in this RFC are the only ones approved for the newest TLS standard – version 1.3, which also removes the support for custom groups. The safety of the primes used for DHKE is not a purely theoretical concern! Real attacks have been (and are probably still being) mounted against unsafe choices. See CVE-2016-0701 for example, and the paper Measuring small subgroup attacks against Diffie-Hellman for more technical details. ## A word on elliptic curves Elliptic curves are all the rage in cryptography in the past couple of decades, and for a good reason. They provide similar security to the “classical” multiplicative modular groups with much smaller keys. If you’re using TLS 1.3, the key exchange protocol will most likely be ECDHE – Elliptic Curve Diffie-Hellman Exchange. Explaining elliptic curves is a huge topic of its own, so I’ll just briefly mention them w.r.t. the material presented in this post. The beauty of abstract algebra is that you can develop mathematics that will apply in the same way to very different groups. We’ve seen the DLP defined for multiplicative modular groups, but it can also be defined for different groups. Elliptic curves are pairs of points which fullfill certain polynomial equations [2], and when set up properly these points can form cyclic groups under certain operations. A DLP can be defined for these groups, and it’s as hard to solve as the classical DLP. Much of the math remains the same – generators, subgroups, and so on. DHKE looks the same as well – Alice and Bob both pick a random group member, and compute an “exponent” (repeated application of the group operation), sending it on the wire. They combine their exponents to get a shared secret key, while Eve cannot reconstruct their private exponents from the transmitted information because of the infeasibility of the DLP. Elliptic curve groups are great because – compared to classical multiplicative modular groups – they are less susceptible to sub-exponential attacks. Therefore, to gain ~128 bits of security (i.e. make attacks equivalent to brute-forcing 128-bit values) we can use a key of size 256 bits (as opposed to 3072 bits for classical DH). This makes cryptographic protocols much faster. [1] Specifically, it’s proportional to the sizes of the subgroup which the generator generates. The size of subgroups are related to the factors of |G|, per Lagrange’s Theorem. [2] y^2=x^3+ax+b, which should look familiar from analytic geometry in middle school.
3,174
11,373
{"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.21875
4
CC-MAIN-2023-06
latest
en
0.872882
https://slidetodoc.com/punnett-squares-page-19-punnett-squares-punnett-square/
1,680,036,669,000,000,000
text/html
crawl-data/CC-MAIN-2023-14/segments/1679296948871.42/warc/CC-MAIN-20230328201715-20230328231715-00150.warc.gz
604,214,862
11,515
# PUNNETT SQUARES Page 19 PUNNETT SQUARES Punnett Square • Slides: 18 Download presentation PUNNETT SQUARES Page 19 PUNNETT SQUARES Punnett Square – model for predicting all possible genotypes resulting from a cross (mating) Used to calculate the probability of inheriting a particular trait § Probability – The chance that a given event will occur MONOHYBRID CROSSES Monohybrid Crosses – involve only one trait The “normal” Punnett Square MONOHYBRID CROSS Parent 1: Aa Parent 2: Aa Parent 1’s Gametes Parent 2’s Gametes Offspring HOW TO COMPLETE A PUNNETT SQUARE a Aa aa Genotypes: 1 AA : 2 Aa : 1 aa We can use the Punnett Square above to figure out the ratios of genotypes and phenotypes. Let’s say A = black and a = albino (no color). This means there is a 25% chance of inheriting the AA genotype, a 50% chance of inheriting the Aa genotype, and a 25% chance of inheriting the aa genotype. Phenotypes: 3 Black : 1 Albino We can use the Punnett Square above to figure out the ratios of genotypes and phenotypes. Let’s say A = black and a = albino (no color). This means there is a 75% chance of inheriting the black phenotype, and a 25% chance of inheriting the white phenotype. YOU TRY IT NOW! Give the genotype and phenotype ratios for the following cross: TT x tt (T = Tall and t = Short) Step One: Set Up Punnett Square (put one parent on the top and the other along the side) T t t T Step Two: Complete the Punnett Square T T t Tt Tt Step Three: Write the genotype and phenotype T T t Tt Tt Remember: Each box is 25% Genotype: 4 - Tt Phenotype: 100% Tall YOU TRY IT NOW! Give the genotype and phenotype ratios for the following cross: Tt x tt Step One: Set Up Punnett Square (put one parent on the top and the other along the side) T t t t Step Two: Complete the Punnett Square T t t Tt tt Step Two: Complete the Punnett Square t t Tt tt Genotype: Tt - 2 (50%) tt - 2 (50%) Phenotype: 50% Tall 50% Short Remember: Each box is 25% COMPLETE THE PUNNETT SQUARE Round seeds are dominant to wrinkled: § Cross Rr x Rr § What are the possible genotypes? § What are the possible phenotypes? § What’s the probability the offspring will be round? § What’s the probability the offspring will be wrinkled? MONOHYBRID CROSS PRACTICE 1. Which one represents a dominant allele? G g 2. Which one represents a recessive allele? F f 3. Which one represents a homozygous dominant genotype? TT Tt tt 4. Which one represents a homozygous recessive genotype? RR Rr rr 5. Which one represents a heterozygous genotype? WW Ww ww 6. If purple eyes are dominant to pink eyes, which genotype(s) would result in purple eyes? PP Pp pp 7. If an organism is heterozygous and has brown fur, which trait is dominant? brown fur white fur
753
2,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}
4.09375
4
CC-MAIN-2023-14
latest
en
0.748258
http://en.wikipedia.org/wiki/Theil%E2%80%93Sen_estimator
1,416,861,705,000,000,000
text/html
crawl-data/CC-MAIN-2014-49/segments/1416400381177.56/warc/CC-MAIN-20141119123301-00048-ip-10-235-23-156.ec2.internal.warc.gz
103,557,297
22,691
# Theil–Sen estimator The Theil–Sen estimator of a set of sample points with outliers (black line) compared to the simple linear regression line for the same set (blue). The dashed green line represents the ground truth from which the samples were generated. In non-parametric statistics, there is a method for robust linear regression that chooses the median slope among all lines through pairs of two-dimensional sample points. It has been called Theil–Sen estimator, Sen's slope estimator,[1][2] slope selection,[3][4] the single median method,[5] Kendall robust line-fit method,[6] and Kendall–Theil robust line[7] It is named after Henri Theil and Pranab K. Sen, who published papers on this method in 1950 and 1968 respectively. It can be computed efficiently, and is insensitive to outliers; it can be significantly more accurate than simple linear regression for skewed and heteroskedastic data, and competes well against non-robust least squares even for normally distributed data in terms of statistical power.[8] It has been called "the most popular nonparametric technique for estimating a linear trend".[2] ## Definition As defined by Theil (1950), the Theil–Sen estimator of a set of two-dimensional points (xi,yi) is the median m of the slopes (yjyi)/(xjxi) determined by all pairs of sample points. Sen (1968) extended this definition to handle the case in which two data points have the same x-coordinate. In Sen's definition, one takes the median of the slopes defined only from pairs of points having distinct x-coordinates. Once the slope m has been determined, one may determine a line through the sample points by setting the y-intercept b to be the median of the values yimxi.[9] As Sen observed, this estimator is the value that makes the Kendall tau rank correlation coefficient comparing the values of xi with the residual for the i-th observation become approximately zero.[10] A confidence interval for the slope estimate may be determined as the interval containing the middle 95% of the slopes of lines determined by pairs of points,[11] and may be estimated quickly by sampling pairs of points and determining the 95% interval of the sampled slopes. According to simulations, approximately 600 sample pairs are sufficient to determine an accurate confidence interval.[8] ## Variations A variation of the Theil–Sen estimator due to Siegel (1982) determines, for each sample point (xi,yi), the median mi of the slopes (yjyi)/(xjxi) of lines through that point, and then determines the overall estimator as the median of these medians. A different variant pairs up sample points by the rank of their x-coordinates (the point with the smallest coordinate being paired with the first point above the median coordinate, etc.) and computes the median of the slopes of the lines determined by these pairs of points.[12] Variations of the Theil–Sen estimator based on weighted medians have also been studied, based on the principle that pairs of samples whose x-coordinates differ more greatly are more likely to have an accurate slope and therefore should receive a higher weight.[13] For seasonal data, it may be appropriate to smooth out seasonal variations in the data by considering only pairs of sample points that both belong to the same month or the same season of the year, and finding the median of the slopes of the lines determined by this more restrictive set of pairs.[14] ## Statistical properties The Theil–Sen estimator is an unbiased estimator of the true slope in simple linear regression.[15] For many distributions of the response error, this estimator has high asymptotic efficiency relative to least-squares estimation.[16] Estimators with low efficiency require more independent observations to attain the same sample variance of efficient unbiased estimators. The Theil–Sen estimator is more robust than the least-squares estimator because it is much less sensitive to outliers: It has a breakdown point of $1-\frac{1}{\sqrt 2}\approx 29.3\%$, meaning that it can tolerate arbitrary corruption of up to 29.3% of the input data-points without degradation of its accuracy.[9] However, the breakdown point decreases for higher-dimensional generalizations of the method.[17] A higher breakdown point, 50%, holds for the repeated median estimator of Siegel.[9] The Theil–Sen estimator is equivariant under every linear transformation of its response variable,[18] but is not equivariant under affine transformations of both the predictor and response variables.[17] ## Algorithms The median slope of a set of n sample points may be computed exactly by computing all O(n2) lines through pairs of points, and then applying a linear time median finding algorithm, or it may be estimated by sampling pairs of points. It is equivalent, under projective duality, to the problem of finding the crossing point in an arrangement of lines that has the median x-coordinate among all such crossing points. The problem of performing slope selection exactly but more efficiently than the brute force quadratic time algorithm has been extensively studied in computational geometry. Several different methods are known for computing the Theil–Sen estimator exactly in O(n log n) time, either deterministically[3] or using randomized algorithms.[4] Siegel's repeated median estimator can also be constructed efficiently in the same time bound.[19] In models of computation in which the input coordinates are integers and bitwise operations on integers take constant time, the problem can be solved even more quickly, in randomized expected time $O(n\sqrt{\log n})$.[20] An estimator for the slope with approximately median rank, having the same breakdown point as the Theil–Sen estimator, may be maintained in the data stream model (in which the sample points are processed one by one by an algorithm that does not have enough persistent storage to represent the entire data set) using an algorithm based on ε-nets.[21] ## Applications Theil–Sen estimation has been applied to astronomy due to its ability to handle censored regression models.[22] In biophysics, Fernandes & Leblanc (2005) suggest its use for remote sensing applications such as the estimation of leaf area from reflectance data due to its "simplicity in computation, analytical estimates of confidence intervals, robustness to outliers, testable assumptions regarding residuals and ... limited a priori information regarding measurement errors". For measuring seasonal environmental data such as water quality, a seasonally adjusted variant of the Theil–Sen estimator has been proposed as preferable to least squares estimation due to its high precision in the presence of skewed data.[14] In computer science, the Theil–Sen method has been used to estimate trends in software aging.[23] ## Notes 1. ^ 2. ^ a b 3. ^ a b 4. ^ a b 5. ^ 6. ^ 7. ^ 8. ^ a b 9. ^ a b c Rousseeuw & Leroy (2003), pp. 67, 164. 10. ^ 11. ^ For determining confidence intervals, pairs of points must be sampled with replacement; this means that the set of pairs used in this calculation includes pairs in which both points are the same as each other. These pairs are always outside the confidence interval, because they do not determine a well-defined slope value, but using them as part of the calculation causes the confidence interval to be wider than it would be without them. 12. ^ 13. ^ 14. ^ a b 15. ^ Sen (1968), Theorem 5.1, p. 1384; Wang & Yu (2005). 16. ^ Sen (1968), Section 6; Wilcox (1998). 17. ^ a b 18. ^ Sen (1968), p. 1383. 19. ^ 20. ^ 21. ^ 22. ^ 23. ^
1,632
7,561
{"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": 2, "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.3125
3
CC-MAIN-2014-49
longest
en
0.912454
http://mathhelpforum.com/algebra/68188-graphing-number-line-question.html
1,526,901,312,000,000,000
text/html
crawl-data/CC-MAIN-2018-22/segments/1526794864063.9/warc/CC-MAIN-20180521102758-20180521122758-00575.warc.gz
185,723,991
10,455
# Thread: Graphing on a number line Question 1. ## Graphing on a number line Question Hello; I'm sorry Im trying to learn to use Latex while simultaneously mastering precalc so far it's not working. I'm currently going over, graphing numbers on a number line and my book is doing only a fair job in explaining specific rules. I understand that; [1<4] but why do I have to write the answer as; 1< or equal to x < or equal to 4 $\displaystyle 1\1eqx\1eq4$ if I can understand this reasoning, it would make the rest of my homework easier. Thank You Carolyn 2. Originally Posted by Carolyng66 Hello; I'm sorry Im trying to learn to use Latex while simultaneously mastering precalc so far it's not working. I'm currently going over, graphing numbers on a number line and my book is doing only a fair job in explaining specific rules. I understand that; [1<4] but why do I have to write the answer as; 1< or equal to x < or equal to 4 $\displaystyle 1\1eqx\1eq4$ if I can understand this reasoning, it would make the rest of my homework easier. Thank You Carolyn Hello Carolyn, I think, maybe, you're talking about "interval notation" and "set builder notation". Let's see if I can explain. If you want to graph all the elements between and including 1 and 4, we can write the solution set in two ways. Interval Notation: [1, 4] The brackets mean the endpoints are included in the graph. Had they not been included, we would have used parentheses. Set Builder Notation: $\displaystyle \{x | 1 \leq x \leq 4\}$ This is read "The set of all x, such that x is greater than or equal to 1 and less than or equal to 4". Does this help? If not, post specific examples. 3. Originally Posted by Carolyng66 I understand that; [1<4] but why do I have to write the answer as; 1< or equal to x < or equal to 4 If you mean that you understand that the notation "[1, 4]" indicates the interval from 1 to 4 inclusive, but are wondering why you "have to write the answer" also in the form "$\displaystyle 1\, \leq\, x\, \leq\, 4$", I think the reason is simply that you be able to understand the various notations. Not all books use the same notation, so you need to be able to read each of them.
583
2,195
{"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}
4.03125
4
CC-MAIN-2018-22
latest
en
0.943695
https://www.thestudentroom.co.uk/showthread.php?t=3047351&page=135
1,521,369,128,000,000,000
text/html
crawl-data/CC-MAIN-2018-13/segments/1521257645604.18/warc/CC-MAIN-20180318091225-20180318111225-00058.warc.gz
884,302,911
44,194
x Turn on thread page Beta You are Here: Home >< Physics # AQA Physics PHYA5 - Thursday 18th June 2015 [Exam Discussion Thread] watch 1. anyone doing astro get 15m diameter for the cassegrain and poor detail? 2. (Original post by k9000) The turning points question on measuring light speed.. Anyone do distance over time? Other than that it was fine, some answers i got: 24V 11m 250 muons First box 4.69x10^5V I'm pretty sure I got 24V, 11m and the first box! I had no idea what to do for that muon question, and I can't remember what I got for the last question :") 3. (Original post by 000alex) Feel sorry for the examiner that gets my papers, both of my 6 markers had 20% full of scribble and crossed out We were supposed to do this? Yeah, with pressure or volume on the y-axis. 4. how was section a 5. Easy paper 6. Anyone else get 47233 so 47000 on the latent heat one 7. (Original post by sophiebeth100) Posted from TSR Mobile That sounds much more logical, but I expected to screw up the lens equation anyway. how did you find the rest of the medical paper? I thought it was pretty good, I did kinda panic on the question about sound, but ended up guessing that the straight line was the dB scale because intensity is uniform across the whole range of frequencies and the curved line was dBA because it accounts for the sensitivity of the ear, one of the points on the curve was the threshold of hearing at 1000Hz and the other point was the frequency at which the human ear is most sensitive 8. (Original post by wat a wizard) anyone doing astro get 15m diameter for the cassegrain Yep 9. (Original post by 000alex) Feel sorry for the examiner that gets my papers, both of my 6 markers had 20% full of scribble and crossed out We were supposed to do this? yeah but i didnt draw graph explained it 10. (Original post by 000alex) Feel sorry for the examiner that gets my papers, both of my 6 markers had 20% full of scribble and crossed out We were supposed to do this? I did this but with volume against tempt as it is easier to measure than pressure 11. (Original post by wat a wizard) anyone doing astro get 15m diameter for the cassegrain Yep, I think so 12. Now I'm far from the best student so DON'T go by these values but I just want to see if anyone got any the same as me..... Nuclear and thermal: 0.05, 5.00 1.4*10-15 m 5.3*10-15 m 1.3*10^17 kgm-3 3.3*10-6 s-1 8.2*10^11 47000J 160000 319 K Astro: 2.4*10^11 15m -82 5000 K 97*10^6 8.8*10^21 4.9*10^17 13. (Original post by StarvingAutist) -8.7*10^-3 seems wrong but whatever I got that 14. (Original post by wat a wizard) anyone doing astro get 15m diameter for the cassegrain and poor detail? Pretty sure you're supposed to use llamda = 1.0 micrometer because they gave the smallest resolving power of the telescope. 15. (Original post by HenryHein) Yes, like 000alex' sketch but in words (also explained you could plot P against T as well), so with V against t pressure was constant and P against T, V was constant What a guess! 16. How did you find the radius of that nucleus we were given? Anyone else get 47233 so 47000 on the latent heat one yeah 18. (Original post by bwr19) Yes that's what I got! A very small negative. Think I put this in my calc: 1.981 - 5log(25/10) ?? That's what I did too 19. I ****ed up the absolute mag question because I thought the 0.009 or whatever value was too low and wasn't sure whether to use metres of parsecs for d Really pisses me off that I had it but chose to write some other ****ed up value using metres.... 20. (Original post by dominicwild) How did you find the radius of that nucleus we were given? use the formula? TSR Support Team We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out. This forum is supported by: Updated: September 30, 2017 Today on TSR ### Any tips for freshers... who are introverts? ### More snow?! Discussions on TSR • Latest Poll Useful resources Can you help? Study help unanswered threadsStudy Help rules and posting guidelinesLaTex guide for writing equations on TSR ## Groups associated with this forum: View associated groups Discussions on TSR • Latest The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd. Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE
1,213
4,483
{"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.78125
3
CC-MAIN-2018-13
latest
en
0.977162
http://www.mathskey.com/homework-help/algebra-2-2008/book/11/page/827
1,516,439,492,000,000,000
text/html
crawl-data/CC-MAIN-2018-05/segments/1516084889542.47/warc/CC-MAIN-20180120083038-20180120103038-00478.warc.gz
490,539,065
14,652
Algebra 2, 2008 12 PAGE: 827 SET: Exercises PROBLEM: 12 The function is . The above function compare with , here the amplitude is , and the period is The amplitude is                    (The coefficent of is 3) The period is       (Substitute ) Use the amplitute and period to graph the function. Draw a coordinate plane Draw the function . The amplitude is 3 and period is . TESTIMONIALS "I want to tell you that our students did well on the math exam and showed a marked improvement that, in my estimation, reflected the professional development the faculty received from you. THANK YOU!!!" June Barnett "Your site is amazing! It helped me get through Algebra." Charles "My daughter uses it to supplement her Algebra 1 school work. She finds it very helpful." Dan Pease Tweets by @mathskeydotcom QUESTIONS? LET US HELP.
202
836
{"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-05
longest
en
0.947896
https://www.wmbriggs.com/post/44928/
1,716,520,957,000,000,000
text/html
crawl-data/CC-MAIN-2024-22/segments/1715971058677.90/warc/CC-MAIN-20240524025815-20240524055815-00478.warc.gz
950,002,549
32,642
# How To Gamble If You Must Listen to the podcast at YouTube, BitChute, or Gab. Our title comes from a famous book by Lester Dubbins and Leonard Savage, which appeared at the beginning of the Bayesian Theoretical Resurgence (late 1970s), a movement which has by now infiltrated nearly all of academia. The next logical step (a pun!) on this road to a complete understanding of uncertainty is full-on logical probability. Academia is now far too distracted to venture down that road, so this trip will be some time coming. Games of chance are always logical. Prove this by picking up any undergraduate text in statistics and find the chapter on probability. You will see examples like this: “A die has probability 1/6 of showing a 6; therefore, the probability of two die (or one die thrown twice) showing two 6s is 1/6 x 1/6 = 1/36.” Valid answer, but an invalid, or at least incomplete, argument. Close enough, however, because of the implicit recognition that logic allowed us to deduce the probability of the die showing 1/6. Which comes from the statistical syllogism: an object has six states, and only one of which must obtain; therefore, the probability it is in any state is 1/6. Notice we didn’t have to say a “fair” or “unweighted” object! Once that deduction is in hand, we can prove theories of what will happen to that die (or object) under named scenarios, which come in two flavors. Simple gambles are those where the premises of the game allow us to deduce the probabilities of events of interest. Examples: “Two 6s on two throws”, “A pair of jacks showing from a poker deck”, “00 showing on a roulette wheel”, “Three cherries showing on a slot machine”, and so on. Casinos provide simple gambles. Complex gambles are different from simple ones because we cannot deduce the probability of the events of interest. Events do not have probabilities! We can only deduce probabilities after premises are given. For these events, we can’t (usually) agree on all the premises of the gambles. For instance, what are the premises for these gambles? “The person to my left in this poker game holds a hand superior to mine”, “Horse A will win the race or at least come in third”, “Stock B will increase in price over the next week”, or “The Detroit Tigers will win tomorrow’s game.” We don’t know: nobody knows. The ideal premises are those which give us the complete cause of each event. We haven’t any idea how to get the complete causes of such complex events. Best we can hope for are, maybe, some causes, and good correlations—which recognize cause somewhere in a chain of causes of the event. Now, unless you are the owner of a casino, or are a bookie, it is impossible to consistently (the key word) make money with simple gambles. You might, but probably will not, consistently make money with complex gambles. Unless you’re good at identifying causal or cause-like premises. Here’s why: because all know all the relevant premises for simple gambles, but not for complex gambles. Any casino game that does not involve the intelligences of other human beings can be analyzed as simple gambles. This means we can, without error, compute the probability of any outcome of any game, which we can call A, for example A = “The roulette wheel shows red” given the premises of the gamble. We will always know, given the properties and setup of the game, the probability A will be true, because we know the premises. For ease, call that probability Pr(A|gamble premises), which I emphasize all know. (Or should know: not every gambler is savvy.) It costs you D dollars to bet on A, and you will win with probability Pr(A|gamble premises) and will be paid W dollars if A happens. The casino sets the required bet D so that it is more than W x Pr(A|gamble premises) (alternatively, W is set less than 1/Pr(A|gamble premises) for every dollar bet). They do this on all simple gambles. An example: if A = “7 shows on an American roulette wheel” then we can deduce that Pr(A|gamble premises) = 1/38 (the numbers 0-36 and the symbol “00” are on the wheel). It costs (say) 1 Dollar to play. If you win, you receive 35 Dollars. In this case, W x Pr(A|gamble premises) = 35/38 which is less than the 1 Dollar it costs to play. On average, the casino takes in 8 cents for every dollar bet, meaning you lose 8 cents on average. This “on average” is also a deduction, given the gamble premises. We can calculate the exact probabilities of winning for the casino given an assumed number of bets and amounts; the probability the casino is in the black is nearly 1 for even a modest number of bets. Meaning you will go hungry if you make gambling on these games a career. Exceptions are gambles like blackjack, where strategies exist to edge the bet in your favor. But that is because D < W x Pr(A|gamble premises) is not equivalent to D < W x Pr(A|card sequence & gamble premises). Indeed, it can be that Pr(A|card sequence & gamble premises) > Pr(A|gamble premises), for instance, in card counting schemes. If there is a single deck of cards (which is rare), and you have seen all the aces have already been played, then, if you are paying attention and are good at simple math, Pr(A|card sequence & gamble premises) > Pr(A|gamble premises). You can make money. But because casinos have more money than you, and politicians desire to have that money, casinos are able to buy laws that make these card-counting strategies illegal. Just as you go to Walmart to purposely part with your cash, you are meant to go to a casino to lose money. Money can be made with complex gambles. That doesn’t mean it’s easy, only that it can be done. In simple gambles, everybody has the same information about Pr(A|gamble premises). This isn’t true in complex gambles where to win, you need to have better information (premises) about A than the person or persons betting against you. That is, Pr(A|my gamble premises) ≠ Pr(A|your gamble premises), except only rarely when you and I agree on all premises—actual, tacit, and implicit. That all these three sets of premises exist, and often can scarcely be articulated, is why probability is sometimes thought to be subjective, which it isn’t. Because if we agree on all premises, we must necessarily agree on the probability. Back to complex gambles. Those cigarette-wielding guys huddled around the Off Track Betting entrance aren’t just dosing themselves with nicotine. They’re trying to gain an advantage in information by subtle probes of their compatriots. Brokerages ponder quarterly reports for the same reason. And so on. It’s all gambling. Problem is, everybody else is trying to gain an edge the same time you are, which usually means your information is not much better than the next person’s. Plus, in betting horse races and the stock market, there are those darn transaction fees. Tracks skim a percent off the top and set the payouts by the amounts bet, making it extremely difficult to win money. Brokers and banks charge transaction fees which cause the same difficulties. Besides bar bets, insider trading, and outright cheating, a gamble with real potential is poker (and its business equivalents) which depends on bluffing and the ability to detect it. Being able to read tics and tells of others is a great skill; but it’s a rare talent and expensive to acquire. The lesson is: stay away from simple gambles and only take bets where you are sure of your information. This is an update and clarification to a post which originally ran in June 2009, written before I had come to a full, or at least fuller, understanding on probability. Subscribe or donate to support this site and its wholly independent host using credit card click here. For Zelle, use my email: matt@wmbriggs.com, and please include yours so I know who to thank. 1. L Ron Hubbard alias John B() Just heard a joke this morning A Protestant preacher was at the tracks betting on horses He noticed that there was a Roman Catholic priest blessing horses by the gates. He further noticed that those horses the priest prayed over won. He spied the priest praying over a long shot and placed all of his money on that horse. The horse quickly moved out of the gate ahead of everyone else but dropped dead at the first turn. The preacher went to the priest and demanded to know what happened. “You PRAYED over that horse” The priest replied, “That’s your problem … you don’t knothe difference between a Blessing and Last Rites” 2. Robin Simple gambles, complex gambles. Casino’s don’t care. If a punter consistently beats the house, that punter’s face and identity will be distributed to every casino in the country. Permanent ban; just like being on the FBI’s most wanted list. 3. @Robin Mostly true, but casinos don’t care if you’re a winning poker player, you’re winning from your opponents, not the house. The house just collects a rake from each pot (the transaction cost in Dr. Briggs’ schema). For blackjack, you’re correct, a player who consistently wins by skilled play will be barred and have his/her face distributed. For, essentially, all other games, if you’re consistently winning, you are in fact cheating. 4. Pouncer Jimmy the Greek — anecdotally at least — made his money on casino side-bets. For instance, he’d approach a crowd cheering a craps shooter seemingly enjoying a “hot streak”, and solicit a bet from a neighboring member of the audience that the shooter would fail in the next round to make his point. The house advantage, and regression to the mean, and the sad fact that “streaks” are a perception and a hope rather than a reality led to the Greek collecting his winnings on most such bets. 5. Hagfish Bagpipe Speaking of gambling, Steve Kirsch just posted an interesting wager. He’ll put up \$10 for every \$1 dollar betting against his statistical analysis which he claims prove that the COVID vexxines are leading to premature death in anyone who takes them, no matter what age. He uses an interesting methodology inspired by John Beaudoin’s analysis of Massachusetts death certificates. If anyone around here is statistically savvy maybe you can find a flaw in Kirsch’s model and scoop up some easy cash: https://stevekirsch.substack.com/p/death-reports-prove-that-the-covid 6. Doghouse Riley Next to the roulette table is a column displaying recent history of winning colors (black or red). Sometimes you’ll see one color coming up 4 or 5 or more times in a row. Would it make sense to bet the opposite color and if you lose, keep doubling down until you win? 7. Dividualist My take. Treat it as a game you pay money to play. Put one dollar or red or black, half the time you will get the psychological joy of winning, the other half the time you are paying the cost of playing a game, go home when you lost 50 dollars.
2,430
10,795
{"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.09375
4
CC-MAIN-2024-22
latest
en
0.938532
http://math.eretrandre.org/tetrationforum/showthread.php?tid=54&pid=734&mode=threaded
1,603,203,002,000,000,000
text/html
crawl-data/CC-MAIN-2020-45/segments/1603107872746.20/warc/CC-MAIN-20201020134010-20201020164010-00212.warc.gz
70,153,961
9,216
Thread Rating: • 1 Vote(s) - 3 Average • 1 • 2 • 3 • 4 • 5 Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) Ivars Long Time Fellow Posts: 366 Threads: 26 Joined: Oct 2007 11/09/2007, 08:30 AM bo198214 Wrote:Quote:So the problem is now turned to the properties of continuous application of logarithms with base e^pi/2 on -1? Which in turn is calculated in each step via normal logarithms by formula: log b (z) = (ln (z) + 2pik)/ ln (b)? Yes, yes So now we need analytic expressions for that infinite taking of logarithms with base e^pi/2 of (-1) as a function of k. Any ideas? I am searching as well. if we put e^(pi/2) = e^((sqrt(pi)/sqrt(2))^(sgrt(pi)/sqrt(2) ) then we can use Gamma(1/2) = sqrt(pi), so e^(pi/2) = e^(Gamma^2 (1/2)/2) and ln (e^pi/2) = Gamma^2 (1/2) /2 +- 2pik next ln would be 2 lnGamma(1/2) - ln 2 next ln2+ ln*lnGamma(1/2) - lnln2 etc. ln2 and lnln2 will cancel out, so in the end we will have lnln............ln (Gamma(1/2) when n-> infinity. « Next Oldest | Next Newest » Messages In This Thread Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 09/08/2007, 09:07 AM RE: The Complex Inverse h of x^(1/x) - by Gottfried - 09/10/2007, 01:59 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 09/11/2007, 12:18 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 09/19/2007, 05:17 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by GFR - 09/21/2007, 02:01 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 09/21/2007, 04:57 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by GFR - 09/21/2007, 05:11 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 09/22/2007, 07:36 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 10/20/2007, 01:49 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 10/30/2007, 06:00 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/02/2007, 08:43 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/03/2007, 12:10 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/03/2007, 12:54 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/03/2007, 03:17 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/03/2007, 08:33 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/03/2007, 09:09 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/07/2007, 12:30 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/03/2007, 10:12 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/04/2007, 12:10 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/04/2007, 12:42 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/04/2007, 02:17 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/04/2007, 02:38 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/04/2007, 04:31 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/04/2007, 05:00 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/04/2007, 10:15 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/04/2007, 10:53 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/05/2007, 05:50 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/06/2007, 01:34 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/06/2007, 10:14 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/07/2007, 12:12 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/07/2007, 10:12 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/07/2007, 11:59 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/07/2007, 12:58 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/07/2007, 01:48 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by andydude - 11/14/2007, 05:38 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/07/2007, 10:03 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/07/2007, 10:26 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/08/2007, 02:31 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/08/2007, 02:51 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/09/2007, 08:30 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/09/2007, 08:43 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/09/2007, 11:51 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by bo198214 - 11/12/2007, 08:23 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/13/2007, 11:01 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/14/2007, 05:04 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/14/2007, 02:10 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/14/2007, 02:14 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/14/2007, 02:49 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/14/2007, 04:52 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/14/2007, 08:57 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/14/2007, 10:10 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/15/2007, 06:16 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/15/2007, 09:40 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/15/2007, 04:15 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/15/2007, 10:45 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/16/2007, 09:09 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/16/2007, 12:06 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/16/2007, 02:02 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/16/2007, 03:17 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/16/2007, 05:28 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/17/2007, 11:01 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/20/2007, 10:11 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/22/2007, 01:01 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 11/22/2007, 06:29 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/29/2007, 10:37 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 12/09/2007, 03:18 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by andydude - 12/10/2007, 03:14 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 12/10/2007, 07:27 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 12/16/2007, 12:02 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 12/16/2007, 02:22 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 12/16/2007, 05:53 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by andydude - 04/14/2008, 01:01 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 04/14/2008, 10:35 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by andydude - 04/25/2008, 11:25 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 12/10/2007, 07:37 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by andydude - 12/10/2007, 04:11 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by jaydfox - 11/15/2007, 07:21 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/15/2007, 09:44 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 11/22/2007, 10:36 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 12/30/2007, 01:09 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 12/30/2007, 03:37 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 12/30/2007, 05:33 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by andydude - 01/05/2008, 08:00 PM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 01/06/2008, 02:55 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 02/07/2008, 10:49 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 04/28/2008, 08:11 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Ivars - 05/09/2008, 06:32 AM RE: Imaginary zeros of f(z)= z^(1/z) (real valued solutions f(z)>e^(1/e)) - by Gottfried - 03/03/2011, 03:16 PM RE: Tetration below 1 - by Gottfried - 09/09/2007, 07:04 AM RE: The Complex Lambert-W - by Gottfried - 09/09/2007, 04:54 PM RE: The Complex Lambert-W - by andydude - 09/10/2007, 06:58 AM Possibly Related Threads... Thread Author Replies Views Last Post Constructing real tetration solutions Daniel 4 2,081 12/24/2019, 12:10 AM Last Post: sheldonison b^b^x with base 0 Users browsing this thread: 1 Guest(s)
4,390
11,077
{"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-2020-45
latest
en
0.828057
https://www.mathhomeworkanswers.org/246625/3-integers-add-up-to-234-what-are-the-3-numbers?show=246645
1,537,446,054,000,000,000
text/html
crawl-data/CC-MAIN-2018-39/segments/1537267156471.4/warc/CC-MAIN-20180920120835-20180920141235-00035.warc.gz
798,512,443
12,160
I need some help on my homework There are lots of positive integers that add up to 234. If the integers are all the same, then they would be 234/3=78. So we have 78+78+78=234. But we can adjust these to get three different integers: 77+78+79, for example. I subtracted 1 from one of the integers and added one to another. I could have chosen 75+79+80. And so on. answered Oct 11, 2017 by Top Rated User (569,800 points)
123
422
{"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-2018-39
latest
en
0.944389
https://math.stackexchange.com/questions/1989305/a-question-around-liouvilles-theorem
1,566,786,666,000,000,000
text/html
crawl-data/CC-MAIN-2019-35/segments/1566027330962.67/warc/CC-MAIN-20190826022215-20190826044215-00081.warc.gz
538,024,702
30,332
# A question around Liouville's Theorem Liouville's theorem of complex analysis states that a bounded entire function is constant. This means that for a non-constant entire function $f$ there exists a sequence $z_n \in \mathbb{C}$ such that $|z_n| \to \infty$ and $f(z_n) \to \infty$. I am trying to understand if a sort of converse holds in the following sense: consider a closed set $S \subset \mathbb{C}$ ($S$ may be unbounded) such that $\mathbb{C} \setminus S$ is unbounded. Can one construct a non-constant entire function $f$ such that $f$ is bounded on $S$ ? Comment: Cross-posted on MO here. • Try the Maximum modulus principle. But see math.stackexchange.com/questions/894304/…. – lhf Oct 28 '16 at 17:14 • What if $S= \{0\}?$ – zhw. Oct 28 '16 at 17:21 • @lhf What if the maximum is attained at some boundary point of $S$? – user346998 Oct 28 '16 at 17:53 • Yes, for every curve $\gamma$ such that $\gamma(t) \to \infty$, there exists a function bounded everywhere except in the neighborhood of the curve, search for the Alice Roth's theorems on entire functions – reuns Oct 30 '16 at 9:49
328
1,103
{"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.734375
3
CC-MAIN-2019-35
latest
en
0.85843
http://mathhelpforum.com/discrete-math/160699-set-theory-super-problem.html
1,477,671,620,000,000,000
text/html
crawl-data/CC-MAIN-2016-44/segments/1476988722951.82/warc/CC-MAIN-20161020183842-00374-ip-10-171-6-4.ec2.internal.warc.gz
162,395,102
10,245
1. ## Set Theory................Super-Problem. S is the set of all (h, k) with h, k non-negative integers such that h + k < n. Each element of S is colored red or blue, so that if (h, k) is red and h ≤ h, k ≤ k, then (h , k ) is also red. A type 1 subset of S has n blue elements with different first member and a type 2 subset of S has n blue elements with different second member. Show that there are the same number of type 1 and type 2 subsets. It is always true that $h\le h~\&~k\le k$.
160
490
{"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": 1, "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-2016-44
longest
en
0.906807
https://www.esaral.com/q/prove-the-following-by-using-the-principle-of-mathematical-induction-for-all-n-n-x2n-y2n-is-divisible-by-x-y-95032
1,726,239,833,000,000,000
text/html
crawl-data/CC-MAIN-2024-38/segments/1725700651523.40/warc/CC-MAIN-20240913133933-20240913163933-00383.warc.gz
691,088,537
12,057
# Prove the following by using the principle of mathematical induction for all n ∈ N: x2n – y2n is divisible by x + y. Question: Prove the following by using the principle of mathematical induction for all $n \in N: x^{2 n}-y^{2 n}$ is divisible by $x+y$. Solution: Let the given statement be $P(n)$, i.e., $P(n): x^{2 n}-y^{2 n}$ is divisible by $x+y .$ It can be observed that $\mathrm{P}(n)$ is true for $n=1$. This is so because $x^{2} \times 1-y^{2} \times 1=x^{2}-y^{2}=(x+y)(x-y)$ is divisible by $(x+y)$. Let P(k) be true for some positive integer k, i.e., $x^{2 k}-y^{2 k}$ is divisible by $x+y$ $\therefore x^{2 k}-y^{2 k}=m(x+y)$, where $m \in \mathbf{N}$   (1) We shall now prove that P(k + 1) is true whenever P(k) is true. Consider $x^{2(k+1)}-y^{2(k+1)}$ $=x^{2 k} \cdot x^{2}-y^{2 k} \cdot y^{2}$ $=x^{2}\left(x^{2 k}-y^{2 k}+y^{2 k}\right)-y^{2 k} \cdot y^{2}$ $=x^{2}\left\{m(x+y)+y^{2 k}\right\}-y^{2 k} \cdot y^{2} \quad[U \operatorname{sing}(1)]$ $=m(x+y) x^{2}+y^{2 k}+x^{2}-y^{2 k} \cdot y^{2}$ $=m(x+y) x^{2}+y^{2 k}\left(x^{2}-y^{2}\right)$ $=m(x+y) x^{2}+y^{2 k}(x+y)(x-y)$ $=(x+y)\left\{m x^{2}+y^{2 k}(x-y)\right\}$, which is a factor of $(x+y)$. Thus, P(k + 1) is true whenever P(k) is true. Hence, by the principle of mathematical induction, statement P(n) is true for all natural numbers i.e., n.
550
1,349
{"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}
4.59375
5
CC-MAIN-2024-38
latest
en
0.667514
https://www.teachoo.com/1132/1887/Ex-5.1--2---Give-a-definition-for-each-of-following-terms/category/Chapter-5-Class-9th-Introduction-to-Euclid-s-Geometry/
1,679,573,863,000,000,000
text/html
crawl-data/CC-MAIN-2023-14/segments/1679296945144.17/warc/CC-MAIN-20230323100829-20230323130829-00067.warc.gz
1,148,167,211
33,679
Chapter 5 Class 9 Introduction to Euclid's Geometry Class 9 Important Questions for Exam - Class 9 Get live Maths 1-on-1 Classs - Class 6 to 12 ### Transcript Ex 5.1, 2 Give a definition for each of the following terms. Are there other terms that need to be defined first? What are they, and how might you define them? parallel lines Perpendicular lines Line Segment Radius of circle Square For the desired definition, we need the following terms : Point Line (c) Plane (d) Angle (e) Circle (f) Quadrilateral. First we define them, and then the other definitions Point (b) line (c) plane (d) angle (e) circle (f) quadrilateral. (a) Point: A small dot made by a sharp pencil on a sheet paper gives an idea about a point. A point has no dimension, it has only a position (b) Line: It should be straight & should extend infinitely in both directions. (c) Plane: The surface of a smooth wall or the surface of a sheet of paper is a plane. (d) Angle: Space between two intersecting lines. (f) Circle: A circle is the set of all those points in a plane whose distance from a fixed point remains constant. The fixed point is called the centre of the circle. (g) Quadrilateral: A closed figure made of four line segments is called a quadrilateral. Ex 5.1, 2 Give a definition for each of the following terms. Are there other terms that need to be defined first? What are they, and how might you define them? Parallel lines Two lines are said to be parallel when They are not intersecting They are coplanar (in the same plane) In figure, the two lines L1 and L2 are parallel. Ex 5.1, 2 Give a definition for each of the following terms. Are there other terms that need to be defined first? What are they, and how might you define them? (ii) Perpendicular lines Two lines AB and CD lying the same plane are said to be perpendicular, if They lie in the same plane They intersect to form a right angle sssHere AB is perpendicular to CD . Ex 5.1, 2 Give a definition for each of the following terms. Are there other terms that need to be defined first? What are they, and how might you define them? (iii) Line segment Line segment : A line segment is a part of line We truncate the line by making two points. Here AB is a line segment. Ex 5.1, 2 Give a definition for each of the following terms. Are there other terms that need to be defined first? What are they, and how might you define them? (iv) Radius of a circle The distance from the centre to a point on the circle is called the radius of the circle. Here O is centre of circle & OP is the radius. Ex 5.1, 2 Give a definition for each of the following terms. Are there other terms that need to be defined first? What are they, and how might you define them? (v)square A quadrilateral in which all the four angles are right angles and four sides are equal is called a square. Here ABCD is a square
693
2,846
{"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.40625
4
CC-MAIN-2023-14
longest
en
0.910715
https://www.physicsforums.com/threads/gausss-law-and-divergence.772132/
1,513,430,427,000,000,000
text/html
crawl-data/CC-MAIN-2017-51/segments/1512948588072.75/warc/CC-MAIN-20171216123525-20171216145525-00637.warc.gz
767,763,595
18,130
# Gauss's law and divergence 1. Sep 21, 2014 ### EnchantedEggs Has anyone read the book by Daniel Fleisch, 'A Student's Guide to Maxwell's Equations'? I'm having some trouble with Chapter 1, page 36. He's talking about the divergence of an electric field originating from a point charge. Apparently, the divergence of the vector electric field is zero, because the spreading out of the field lines (as they get further away from the origin) is compensated for by the 1/R^2 reduction in the amplitude of the field. I don't really understand this? When I picture it, the field lines spread out so it must be diverging? How does the decreased amplitude help here? Last edited: Sep 21, 2014 2. Sep 21, 2014 ### EnchantedEggs Also, if someone could tell me how to make LaTeX code work in these posts, I'd love you forever 3. Sep 21, 2014 ### Maharshi Roy First of all, the physical significance of divergence is not just spreading out. Refer the following pictures:- The above picture has 2 parts. In (b) part, the vectors are not spreading out from a point but as they approach more their magnitude increases (length of the arrow). Divergence is not just spreading, a vector space is said to be divergent if the vectors on average have an increase or decrease in magnitude along a particular direction. In (a) part, the vectors have 0 divergence thus. for the second pic, Interpret based on the above principle. Now, coming back to electric field, it is an inverse square field, by plotting we find that the vectors spread out, but notice that their magnitude too decreases proportionally with increasing radial distance, that's why, there is 0 divergence. divergence is non-zero when magnitude of vectors increase/decrease without proportion to decreasing/increasing distance respectively. Otherwise, it is 0. Divergence is far more from just spreading. 4. Sep 21, 2014 ### A.T. It's a misleading name. Divergence at some point basically tells you if there are field lines stating/ending at that point. Think in terms of sink/source of flux. If you consider a infinitesimal volume around a point, then divergence at that point is the net flux into/out of that volume. For the electric field near a point charge this is zero. Only at the point charge position there is a non-zero flux into/out of the infinitesimal volume around it. It means that the density of the field lines is higher on one side of the infinitesimal volume, but the amount of field lines going in still equals the amount going out. They are just spread over different areas. Last edited: Sep 21, 2014 5. Sep 22, 2014 ### EnchantedEggs So, even though for a radial field the vectors are spreading out spatially (getting wider and wider apart), because they are also decreasing in magnitude this is effectively 'cancelled out' and so the divergence is zero? Because the overall vector field through an area further away from the origin will be the same because it's spread over a larger area? 6. Sep 22, 2014 ### EnchantedEggs The net flux around a point charge is zero? I thought it was nonzero (depending on the sign of the charge, positive or negative flux)? 7. Sep 22, 2014 ### A.T. Not "around a point charge", but "around a point near a point charge". If your infinitesimal volume includes the point charge, the net flux it's not zero. But for any point that isn't exactly the point charge position, a infinitesimal volume around it doesn't contain any charge, so the incoming flux equals the outgoing flux. 8. Sep 22, 2014 ### EnchantedEggs Ohhhhh. Right, got it. That makes more sense! 9. Sep 22, 2014 ### EnchantedEggs Let me see if I've got this straight in my brain: Flux is the 'amount' of the vector field flowing though a surface in unit time. (Rate of flow.) Divergence is the net flux through a unit volume. The reason that a radial vector field with $$$\frac{1}{r^2}$$$ amplitude reduction is zero is because the net flux per unit volume is not changing. Although the field lines are decreasing in amplitude, the summing over the larger volume compensates for this reduction and so the divergence is zero. Is that right? 10. Sep 22, 2014 ### vanhees71 First of all, one should define all quantities discussed properly. The flux of a vector field through a closed surface, $\partial V$, which is the boundary of a volume in space, $V$ is given by the surface integral $$\Phi(\vec{E},\partial V)=\int_{\partial V} \mathrm{d}^2 \vec{F} \cdot \vec{E}.$$ By convention, the surface-normal vectors $\mathrm{d}^2 \vec{f}$ are always pointing outwards, way from the volume $V$. The divergence of a vector field at a point $\vec{r}_0$ is given by the limit $$\vec{\nabla} \cdot \vec{E}(\vec{r}_0)=\lim_{V(\vec{r}_0) \rightarrow \{\vec{r}_0 \}} \frac{1}{\Delta V(\vec{r}_0)} \int_{\partial V(\vec{r}_0)} \mathrm{d}^2 \vec{F} \cdot \vec{E}.$$ In some sense you can say that the divergence is the local form of the flux per unit volume through a closed surface around the point in question. For the Coulomb field, $$\vec{E}=\frac{q}{4 \pi r^2} \frac{\vec{r}}{r}$$ you can easily figure out that for any $\vec{r} \neq \vec{0}$ $$\vec{\nabla} \cdot \vec{E}(\vec{r})=0$$ but that the divergence at the origin (i.e., the place where the point charge sits) it's diverging to infinity. What you also can easily calculate (at least for spheres around the origin) is that $$\Phi(\vec{E},\partial V)=q,$$ for any volume containing the origin, while this flux vanishes for any volume that does not contain the origin. For an arbitrary charge distribution this leads to Gauss's Law, which reads in integral form $$\int_{\partial V} \mathrm{d}^2 \vec{F} \cdot \vec{E}=\int_V \mathrm{d}^3 \vec{r} \rho$$ and in local form, by just using the definition of the divergence given above $$\vec{\nabla} \cdot \vec{E}=\rho.$$
1,519
5,818
{"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": 1, "x-ck12": 0, "texerror": 0}
3.671875
4
CC-MAIN-2017-51
longest
en
0.936946
http://mathhelpforum.com/algebra/41007-complete-square.html
1,495,697,347,000,000,000
text/html
crawl-data/CC-MAIN-2017-22/segments/1495463608004.38/warc/CC-MAIN-20170525063740-20170525083740-00516.warc.gz
237,022,198
10,845
1. ## complete the square I know these are simple but these 2 are eating me up. I am having a real problem with complete the square when it envolves fractions for some reason. These 2 problems must be solved completing the square and please show me all the steps so that I can see where I have been messing up. Thanx X^2+7x+12=0 2X^2+X-10=0 2. Use the general formula and you won't have trouble. $a(x+\frac{b}{2a})^{2}+\underbrace{c-\frac{b^{2}}{4a}}_{\text{constant}}$ Enter in your values and you have it built. Try the first one: a=1, b=7, c=12 3. Originally Posted by whiteowl I know these are simple but these 2 are eating me up. I am having a real problem with complete the square when it envolves fractions for some reason. These 2 problems must be solved completing the square and please show me all the steps so that I can see where I have been messing up. Thanx X^2+7x+12=0 2X^2+X-10=0 1. $x^2+7x+12=0$ Step1: Move +12 to right side of the equation. $x^2+7x+ \;\;=-12+ \;\;$ Step 2: Take half the coefficient of x, square it, and add it to both sides. $x^2+7x+\frac{49}{4}=-12+\frac{49}{4}$ Step 3: Left side is now a perfect square trinomial. $(x+\frac{7}{2})^2=\frac{-48}{4}+\frac{49}{4}$ Step 4: Combine right side $(x+\frac{7}{2})^2=\frac{1}{4}$ Step 5: Take square root of both sides. $x+\frac{7}{2}=\pm \frac{1}{2}$ Step 6: Finish up. $x+\frac{7}{2}=\frac{1}{2} \; \; or \; \; x+\frac{7}{2}=\frac{-1}{2}$ Step 7: Finally $x=-3 \; \; or \; \; x=-4$ 4. Originally Posted by whiteowl I know these are simple but these 2 are eating me up. I am having a real problem with complete the square when it envolves fractions for some reason. These 2 problems must be solved completing the square and please show me all the steps so that I can see where I have been messing up. Thanx X^2+7x+12=0 2X^2+X-10=0 Take a look at Glactus' method. You might like it better. 2. $2x^2+x-10=0$ Before you begin with the steps I showed you, you must make the coefficient of $x^2$ to be 1. Divide everything by 2. $x^2+\frac{1}{2}x-5=0$ Step 1: Move -5 to right side of the equation. $x^2+\frac{1}{2}+ \; \; =5+$ Step 2: See if you can finish the other steps. 5. Thanx for the help. When you see it worked out it seems so simple. Thanx again
759
2,251
{"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": 13, "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-2017-22
longest
en
0.872779
https://oneclass.com/homework-help/physics/4332994-given-fn-n2-vf-if-the.en.html
1,653,710,352,000,000,000
text/html
crawl-data/CC-MAIN-2022-21/segments/1652663012542.85/warc/CC-MAIN-20220528031224-20220528061224-00386.warc.gz
500,049,356
52,957
1 0 watching 41 views 23 Nov 2019 # Given fn = n/2? vF/µ , if the mass density µ of a violin string oflength ? is doubled, how should you adjust the tension F topreserve the same tune? a) 1/2 F b) v2F c) 2F d) 4F Hubert KochLv2 16 Nov 2019 Get 1 free homework help answer.
104
277
{"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-2022-21
longest
en
0.726701
http://www.w3.org/1999/07/REC-MathML-19990707/chap6/ISOAMSR2.html
1,501,174,732,000,000,000
text/html
crawl-data/CC-MAIN-2017-30/segments/1500549428325.70/warc/CC-MAIN-20170727162531-20170727182531-00628.warc.gz
585,875,968
5,396
Prev: ISOAMSO Glyphs Up: Chapter 6 Next: ISOTECH Glyphs REC-MathML-19980407; revised 19990707 ISOAMSR Characters alphabetically, with glyphs Added Math Symbols: Relations Name Unicode Glyph Description apE E315 approximately equal or equal to ape 224A approximate, equals apid 224B approximately identical to asymp 224D asymptotically equal to Barv E311 vert, double bar (over) bcong 224C reverse congruent bepsi E420 such that bowtie 22C8 bowtie bsim 223D reverse similar bsime 22CD reverse similar, equals bsolhsub E34D reverse solidus, subset bump 224E bumpy equals bumpe 224F bumpy equals, equals cire 2257 circle, equals Colon 2237 /Colon, two colons Colone E30E double colon, equals colone 2254 colon, equals congdot E314 congruent, dot csub E351 subset, closed csube E353 subset, closed, equals csup E352 superset, closed csupe E354 superset, closed, equals cuepr 22DE curly equals, precedes cuesc 22DF curly equals, succeeds Dashv E30F double dash, vertical dashv 22A3 dash, vertical easter 225B equal, asterisk above ecir 2256 circle on equals sign ecolon 2255 equals, colon eDDot E309 equal with four dots eDot 2251 equals, even dots efDot 2252 equals, falling dots eg E328 equal-or-greater egs 22DD equal-or-gtr, slanted egsdot E324 equal-or-greater, slanted, dot inside el E327 equal-or-less els 22DC eq-or-less, slanted elsdot E323 equal-or-less, slanted, dot inside equest 225F equal with questionmark equivDD E318 equivalent, four dots above erDot 2253 equals, rising dots esdot 2250 equals, single dot above Esim E317 equal, similar esim 2242 equals, similar fork 22D4 pitchfork forkv E31B fork, variant frown 2322 down curve gap 2273 greater, approximate gE 2267 greater, double equals gEl 22DB gt, double equals, less gel 22DB greater, equals, less ges E421 gt-or-equal, slanted gescc E358 greater than, closed by curve, equal, slanted gesdot E31E greater-than-or-equal, slanted, dot inside gesdoto E320 greater-than-or-equal, slanted, dot above gesdotol E322 greater-than-or-equal, slanted, dot above left gesl E32C greater, equal, slanted, less gesles E332 greater, equal, slanted, less, equal, slanted Gg 22D9 triple gtr-than gl 2277 greater, less gla E330 greater, less, apart glE E32E greater, less, equal glj E32F greater, less, overlapping gsim 2273 greater, similar gsime E334 greater, similar, equal gsiml E336 greater, similar, less Gt 226B double greater-than sign gtcc E356 greater than, closed by curve gtcir E326 greater than, circle inside gtdot 22D7 greater than, with dot gtquest E32A greater than, questionmark above gtrarr E35F greater than, right arrow homtht 223B homothetic lap 2272 less, approximate lat E33A larger than late E33C larger than or equal lates E33E larger than or equal, slanted lE 2266 less, double equals lEg 22DA less, double equals, greater leg 22DA less, equals, greater les E425 less-than-or-equals, slant lescc E357 less than, closed by curve, equal, slanted lesdot E31D less-than-or-equal, slanted, dot inside lesdoto E31F less-than-or-equal, slanted, dot above lesdotor E321 less-than-or-equal, slanted, dot above right lesg E32B less, equal, slanted, greater lesges E331 less, equal, slanted, greater, equal, slanted lg 2276 less, greater lgE E32D less, greater, equal Ll 22D8 triple less-than lsim 2272 less, similar lsime E333 less, similar, equal lsimg E335 less, similar, greater Lt 226A double less-than sign ltcc E355 less than, closed by curve ltcir E325 less than, circle inside ltdot 22D6 less than, with dot ltlarr E35E less than, left arrow ltquest E329 less than, questionmark above ltrie 22B4 left triangle, equals mcomma E31A minus, comma above mDDot 223A minus with four dots, geometric properties mid 2223 mid mlcp E30A transversal intersection models 22A7 models mstpos 223E most positive Pr E35C double precedes pr 227A precedes prap 227E precedes, approximate prcue 227C precedes, curly equals prE 227C precedes, double equals pre 227C precedes, equals prsim 227E precedes, similar prurel 22B0 element precedes under relation ratio 2236 ratio rtrie 22B5 right triangle, equals rtriltri E359 right triangle above left triangle Sc E35D double succeeds sc 227B succeeds scap 227F succeeds, approximate sccue 227D succeeds, curly equals scE 227E succeeds, double equals sce 227D succeeds, equals scsim 227F succeeds, similar sdote E319 equal, dot below sfrown E426 small down curve simg E30C similar, greater simgE E338 similar, greater, equal siml E30B similar, less simlE E337 similar, less, equal smid E301 shortmid smile 2323 up curve smt E339 smaller than smte E33B smaller than or equal smtes E33D smaller than or equal, slanted spar E302 short parallel sqsub 228F square subset sqsube 2291 square subset, equals sqsup 2290 square superset sqsupe 2292 square superset, equals ssmile E303 small up curve Sub 22D0 double subset subE 2286 subset, double equals subedot E34F subset, equals, dot submult E343 subset, multiply subplus E341 subset, plus subrarr E33F subset, right arrow subsim E345 subset, similar subsub E349 subset above subset subsup E347 subset above superset Sup 22D1 double superset supdsub E34C superset, subset, dash joining them supE 2287 superset, double equals supedot E350 superset, equals, dot suphsol E34E superset, solidus suphsub E34B superset, subset suplarr E340 superset, left arrow supmult E344 superset, multiply supplus E342 superset, plus supsim E346 superset, similar supsub E348 superset above subset supsup E34A superset above superset thkap E306 thick approximate thksim E429 thick similar topfork E31C fork with top trie 225C triangle, equals twixt 226C between Vbar E30D double vert, bar (under) vBar E310 vert, double bar (under) vBarv E312 double bar, vert over and under VDash 22AB double vert, double dash Vdash 22A9 double vertical, dash vDash 22A8 vertical, double dash vdash 22A2 vertical, dash Vdashl E313 vertical, dash (long) vltri 22B2 left triangle, open, variant vprop 221D proportional, variant vrtri 22B3 right triangle, open, variant Vvdash 22AA triple vertical, dash
1,769
6,033
{"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-2017-30
longest
en
0.523866