Cannabis Sativa

Content deleted Content added
Line 230: Line 230:
:An alternative is to use [[numerical method]]s. That is, use 3 sample points close enough together so that the [[average curvature]] for that region will be an acceptable approximation of the [[instantaneous curvature]] at the middle point, but not so close that [[round-off error]] will throw off the results. If calculating the curvature on computer, this may be the easier way to go. [[User:StuRat|StuRat]] ([[User talk:StuRat|talk]]) 20:58, 21 October 2017 (UTC)
:An alternative is to use [[numerical method]]s. That is, use 3 sample points close enough together so that the [[average curvature]] for that region will be an acceptable approximation of the [[instantaneous curvature]] at the middle point, but not so close that [[round-off error]] will throw off the results. If calculating the curvature on computer, this may be the easier way to go. [[User:StuRat|StuRat]] ([[User talk:StuRat|talk]]) 20:58, 21 October 2017 (UTC)


{{hat|Off topic.}}
:: Oh FFS did you even read the question? Please stop with the self-indulgent ramblings. --[[User:Joel B. Lewis|JBL]] ([[User_talk:Joel_B._Lewis|talk]]) 21:09, 21 October 2017 (UTC)
:: Oh FFS did you even read the question? Please stop with the self-indulgent ramblings. --[[User:Joel B. Lewis|JBL]] ([[User_talk:Joel_B._Lewis|talk]]) 21:09, 21 October 2017 (UTC)

:::I assume you mean that my response does not use a partial derivative solution. If that's really the only answer the OP wants, then they have it already, and my reply does not spoil that answer. However, this could be a case of the [http://xyproblem.info XY Problem], where they really want any solution, but heard a partial derivative solution exists, so asked for that one. If this is the case, then my response may be helpful. I would ask you to remain civil, in any case. [[User:StuRat|StuRat]] ([[User talk:StuRat|talk]]) 01:22, 22 October 2017 (UTC)
{{hab}}


::Thanks, seems like it should be in the Curvature article but I didn't see it. --[[User:RDBury|RDBury]] ([[User talk:RDBury|talk]]) 00:18, 22 October 2017 (UTC)
::Thanks, seems like it should be in the Curvature article but I didn't see it. --[[User:RDBury|RDBury]] ([[User talk:RDBury|talk]]) 00:18, 22 October 2017 (UTC)

Revision as of 01:22, 22 October 2017

Welcome to the mathematics section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

Main page: Help searching Wikipedia

   

How can I get my question answered?

  • Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
  • Post your question to only one section, providing a short header that gives the topic of your question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Don't post personal contact information – it will be removed. Any answers will be provided here.
  • Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
See also:


October 17

Absolute vs. Relative units

This is mostly just a question about nomenclature.

Consider temperatures. Everybody knows that to convert Celsius to Fahrenheit, you multiply by 9/5 and add 32. But that's not always correct: if today was 5 degrees hotter than yesterday in Celsius, that doesn't mean it was 41 Fahrenheit degrees hotter, it was only 9 degrees hotter. It's as if there are two different kinds of temperatures, absolute and relative. The difference between two absolute temperature is a relative temperature. To convert relative Celsius to relative Fahrenheit, you multiply by 9/5 and don't add 32. So, furthermore, it's as if these two different kinds of temperatures, absolute and relative, also have different sets of units. (And, yes, speaking of "absolute temperatures", I do know about Kelvin and Rankine, but I'm overlooking them for the moment.)

Or, consider date/timestamps. Again, these come in absolute and relative flavors. The difference between two absolute date/timestamps is a relative time. And, again, there's something different about the units. The difference between January 1, 2017 at 12:00 and November 29, 2016 at 11:00 is 33 days and one hour, or 793 hours, or 47580 minutes, or maybe 2854800 seconds. The calculation isn't trivial: to come up with that 33 day number, we had to know that there are 30 days in November and 31 days in December. Instead of saying "33 days", we might have said "one month and two days", although in that case it's more than a little bit difficult to decide how many days there are in a relative month, that is, whether it should have been "one month and two days" or "one month and three days" or something else. (And to make things worse, there was a leap second in there, too, so the 2854800 number is suspect as well.)

Or, yet again, consider pointers in the C programming language. (Apologies if I'm drifting too close to RD/C territory, here.) If I have two pointer values, say, 0x12345abc and 0x1234bcde, I can subtract them, but the answer I get depends on circumstances. If they're byte pointers I'll likely get the obvious answer 25122 (0x6222), but if they're pointers to 4-byte integers they're scaled by the size of the pointed-to objects, so the answer will be 6280, since there are only 6280 4-byte ints encompassed by the two pointers. Finally, if they are void pointers, or if they do not both point within the same "object", strictly speaking it is not meaningful to subtract them at all. And, in any case, the units are clearly different: the difference between two pointers is not a pointer; it is an integer of type ptrdiff_t.

So my question is simply, is there a general theory of, or a well-known term for, this distinction between "absolute" and "relative" measurements? They all have the same properties: the difference between two absolutes is a relative, an absolute plus a relative is another absolute, you can add and subtract relatives all you want, but adding two absolutes is meaningless.

From a group theoretical point of view, I guess it's clear that absolute numbers are not closed under subtraction.

P.S. Sometimes you can cheat. Old-time C programmers liked to assume that pointers were integers, meaning that you could do any kind of arithmetic on them you wanted. Unix to this day likes to represent both absolute and relative times as monotonically-increasing counts of seconds, and this almost works, except for those pesky leap seconds.)

P.P.S. In either Surely You're Joking, Mr. Feynman! or What Do You Care What Other People Think?, Richard Feynman rails against a science textbook problem that asked you to find the average total temperature of several stars. His complaint was that it's an artificial, scientifically meaningless thing to do; mine is that it may not even be numerically meaningful if, as I claim, addition of absolute numbers is ill-defined. This was brought home to me when I discovered that a certain unit-agnostic scientific quantity library that I work with has actual problems with this: if you try to add two temperatures, the sum ends up being significantly off. Not just by 32, but by 273.15. Where that number comes from is left as an exercise for the reader.

P.P.P.S. And if you think there's no problem adding absolute numbers, what's 32°C + 32°F? Or if that's too easy, what's January 1 + February 2? Or if that's too easy, what should it mean to say int a, b, *p = &a + &b; in C?

Steve Summit (talk) 02:45, 17 October 2017 (UTC) [edited 04:22, 18 October 2017 (UTC), per comment][reply]

This has to do with UNITS. Basically in both advance calculators and CAS (Computer Assisted Symbolic), units are kind of a problem to be deal with. Basically there are two types of units, one where all units agree at zero. For example, 0 kilogram is equal to 0 pounds is equal to 0 grams. In this case the absolute unit is the same as the unit difference. Example: one absolute kilogram is the same as one kilogram difference.
In the units where all the units disagree at zero, for example: Kelvin and Celsius , you have the problem where one absolute unit is not the same as one unit difference. This also means that in any formula that involves that unit, you must specify if it is absolute unit or unit difference.
That's why for temperature, there are two type of units
  • AbsTemp
  • TempDiff
110.22.20.252 (talk) 05:39, 17 October 2017 (UTC)[reply]
Steve is misremembering in his PPS. The passage is in Surely You're Joking, in the chapter "Judging Books by their Covers". The textbook asked the student to compute, not the average, but the "total temperature" of some stars. And Feynman's comment was:
...I would explode in horror.
My wife would talk about the volcano downstairs. That's only an example: it was perpetually like that. Perpetual absurdity! There's no purpose whatsoever in adding the temperature of two stars. Nobody ever does that except, maybe, to then take the average temperature of the stars, but not to find out total temperature of the stars! It was awful! All it was was a game to get you to add, and they didn't understand what they were talking about. It was like reading sentences with a few typographical errors, and then suddenly a whole sentence is written backwards. The mathematics was like that. Just hopeless!
The thing is that since temperature scales are offset by the simple addition of a constant, even though adding temperatures to produce a total is meaningless, you still get a valid average if you then divide the total by the appropriate number, because the offsets cancel. --69.159.60.147 (talk) 09:30, 17 October 2017 (UTC)[reply]
  • The answer to the OP's first conundrum is that he's messed up order of operation. To convert ΔT in Celsius to ΔT in Farenheit, you need to first convert the individual end temperatures, THEN take the difference function. If you do it in that order you always get the right answer. So, if it was 20C yesterday and 25C today, you convert those individually to F and then take the difference. You'll always get the right answer, and you'll always get the SAME right answer, so you get ΔT = 9F if ΔT = 5C whether the temperature went from 20C --> 25C OR 30C --> 35C OR 179C --> 184C. --Jayron32 14:36, 17 October 2017 (UTC)[reply]
I think you slightly misunderstood the OP's question. He's saying that if you are given a temperature difference, say ΔT = 5C and you want to convert that to a difference in Fahrenheit, you simply multiply by 9/5 without adding 32. You may not even know the original absolute Celsius temperatures, so your solution to change the order of operations and do the conversion of the original two temperatures first may not be possible. It's perfectly reasonable to have a difference of two unknown temperatures and want to express that difference in another scale.
I'll note that the OP's three examples are actually three completely unrelated issues. The first (temperature conversions) is an issue with a different zero point, as noted by 110 above. The second, subtracting dates, is an artifact of the use of mixed units (year, month, day) in our common calendar. It's similar to the problem you would have subtracting lengths expressed in miles, feet and inches, except it's somewhat worse since not all months are the same length and not all years are the same length. The third example, subtracting pointers in C, doesn't seem to be a problem at all, it's just a fact of the C language that needs to be understood: when you subtract two pointers to a type of object, you get the number of such objects between the two pointers, not the number of bytes between the two pointers. CodeTalker (talk) 18:07, 17 October 2017 (UTC)[reply]
Yes, but you only make the mistake of adding the 32 if you blindly apply formulas without understanding how math works (a common mistake, to be sure). From an analysis point of view, addition means "shift the number line" and multiplaction means "stretch the number line". Since a thermometer is just a number line, the math works the same; a shift is only needed where the zero point is relevent. ΔT is the same regardless of how far you are shifted from the zero point, so we can ignore the +32 bit. (incidentally, this is why a differential in say calculus allows you to "drop" any constants when you perform a derivative function]]. Differentials are just arbitrarily small difference (subtraction) functions, which means you can ignore any number line shifts (+ or - a constant). But I digress) Stretches of the number line don't go away when you take a difference, so that's why the 5/9 or 9/5 still needs to be done. --Jayron32 11:45, 18 October 2017 (UTC)[reply]
It's not completely clear whether the temperatures being added in the Feynman quote are in a scale like Fahrenheit/Celsius, which has an arbitrary zero point, or in an absolute temperature scale like Kelvin or Rankine, where the zero is not arbitrary and absolute numbers are in fact meaningful. That would be the point most relevant to Steve Summit's question.
But I suspect that Feynman was likely talking about a completely different point. Temperature is an intensive property, not an extensive one. Very very very roughly (sometimes people make the mistake of ignoring how rough this is), temperature is the average kinetic energy per particle. Adding the temperatures of two stars is as meaningless as, say, adding the average household income of the United States to that of Switzerland. --Trovatore (talk) 18:22, 17 October 2017 (UTC)[reply]
Yes, Feynman's consternation has nothing to do with which temperature scale is being used, rather it's on the problem of choosing the wrong math while not understanding the physics. Still happens all the time. Read #5 on this real math worksheet. That's the same issue that causes Feynman's rage. The writers of the worksheet knew this was a trick problem, but most students still try to answer it. Disheartening.--Jayron32 11:52, 18 October 2017 (UTC)[reply]
I think you're being quite unfair there: the writers clearly knew that #5 wasn't like the other questions, because they warned the solver at the top of the page that there was "one trick question". Feynman was angry because the writers of the book he was reading didn't understand that the question they were asking didn't make sense. (There are some other quibbles about the worksheet, such as the assumption that the price of Internet usage must be exactly proportional to duration, but that's minor.) --69.159.60.147 (talk) 23:20, 18 October 2017 (UTC)[reply]

You should read Level of measurement which addresses basically just that. Temperature on an arbitrary scale like Celsius or Farenheit are on an interval scale. Temperature differences, as well as temperatures on an absolute scale like Kelvin, are on a ratio scale.
That said, the Celsius in "Today is 10C" and the Celsius in "Today is 5C hotter than yesterday" are the same Celsius. They're not different units. It's what you do with those units that differs. -- Meni Rosenfeld (talk) 19:09, 17 October 2017 (UTC)[reply]
PS. Calculating average temperatures of two objects is fine, even if the given temps and the resulting average are Celsius. Adding (and other arbitrary linear combinations) temperatures on an interval scale is meaningless, but taking a convex combination (a fancy term for weighted average) is perfectly meaningful. It's probably a mistake to think, in this context, of average as "adding, then dividing by 2". Though, as Trovatore mentions temperature is intensive, so in most cases where you would want to calculate an average temperature, you'd want it to be a weighted average, with the weights being thermal masses or something like that. -- Meni Rosenfeld (talk) 19:13, 17 October 2017 (UTC)[reply]
As everyone knowns, the result of int a, b, *p = &a + &b; in C? is nasal demons (if your compiler lets you get away with it). Adding two pointers is not correct C. We all "know" that pointers in C are kinda integers (and vice versa), and maybe one can coax some compiler to emit corresponding code, but it's still undefined. --Stephan Schulz (talk) 19:30, 17 October 2017 (UTC)[reply]
The OP didn't mention adding pointers, they only referred to subtracting pointers. Adding pointers is undefined. Subtracting pointers is defined only if they point to the same type of object in the same array. And since void pointers don't point to any type of object, subtracting them is also undefined. CodeTalker (talk) 20:21, 17 October 2017 (UTC)[reply]
Well, you are right on the C, but wrong on the OP. Note that my code example is a copy and paste from Steve's original post. --Stephan Schulz (talk) 21:16, 17 October 2017 (UTC)[reply]
Oh sorry, you're right. I was looking at the paragraph where he discussed C, not all the way down to his P.P.P.S. CodeTalker (talk) 21:47, 17 October 2017 (UTC)[reply]

You can also read about what Wolfram/Mathematica thinks about Temperature Unit here. [TemperatureUnit] 110.22.20.252 (talk) 00:12, 18 October 2017 (UTC)[reply]

Thanks for the answers. Meni Rosenfeld is exactly right: the "absolute" and "relative" units I was talking about are what Stanley Smith Stevens calls "interval" and "ratio" measurements. That's exactly the sort of taxonomy of measurements I was looking for.
CodeTalker suggests that my three examples are "actually three completely unrelated issues", but I believe they do have in common that they're all what Stevens calls "interval measurements".
110.22.20.252, thanks for the Wolfram/Mathematica link, that's fascinating. (Is that also where the "AbsTemp" and "TempDiff" you mentioned earlier come from?) —Steve Summit (talk) 04:45, 18 October 2017 (UTC)[reply]


What is the formula for an osculating Circle at a point on a curve, given radius of curvature  ? יהודה שמחה ולדמן (talk) 19:10, 17 October 2017 (UTC)[reply]

The same as for any other circle: , where the is the position of its center, is the curvature radius and is a unity vector orthogonal to the curve at point . Ruslik_Zero 20:40, 17 October 2017 (UTC)[reply]
About another method of finding the radius of curvature, given by Norman J. Wildberger:
The radius of a circle due to an inscribed triangle with sides is .
He uses this to find the radius of curvature formula of .
But he uses the cross product for the area:
Now
But when I tried using Heron's formula and plugging it in, it did not work and I did not get any cancellation terms:
Can anyone tell me why? יהודה שמחה ולדמן (talk) 19:03, 19 October 2017 (UTC)[reply]
Because you mis-typed the last factor in the square root - you wanted (a+b-c). --catslash (talk) 12:05, 20 October 2017 (UTC)[reply]
That of course is a mistake – but only here; already before I asked here I did it on a paper and the formula did not work. יהודה שמחה ולדמן (talk) 14:24, 20 October 2017 (UTC)[reply]


The radius of the circumcircle is

Henon's formula for the area of a triangle

so

Take any three points on the curve

The sides of the triangle formed from these points are

so (assuming < < (but that only affects the sign of )), the sides are

so

--catslash (talk) 14:35, 20 October 2017 (UTC)[reply]

October 19

Using COUNTIF in Excel

Assume I have an Excel spreadsheet with data like this:

A B
1 Mon 4.25
2 Tue 5.75
3 Wed
4 Thu 5.5
5 Fri
6 Mon 5.25
7 Tue
8 Wed 3.25
9 Thu 5.5
10 Fri 2.7

I can find out the total for any given day of the week as the formula =SUMIF(A1:A10,"Mon",B1:B10) (which returns 9.5) but how do I find out the count of non-blank entries in column B for a given day? I thought of COUNTIF, as in the formula =COUNTIF(A1:A10,"Mon",B1:B10) but it only accepts two arguments. What I want is something that for the example above will return a value of 2 for Monday and Thursday, and a value of 1 for Tuesday, Wednesday and Friday. --Redrose64 🌹 (talk) 21:16, 19 October 2017 (UTC)[reply]

Are you aware of the COUNTIFS function? It is just COUNTIF but with multiple conditions. You should be able to use =COUNTIFS(A1:A10,"Mon",B1:B10,">0") to count how many Mondays there are with a positive value associated with them. AlfonsoAnonymous (talk) 01:33, 20 October 2017 (UTC)[reply]
Thank you, that worked. --Redrose64 🌹 (talk) 11:14, 20 October 2017 (UTC)[reply]

Location of question

Just wondering (and not angrily), is there any guidance to whether questions like this should be placed here or at RD:Computing? I'm thinking that Excel gurus might be more likely to watch RD:Computing (though apparently at least one watches here... :) ) Naraht (talk) 13:44, 20 October 2017 (UTC)[reply]

October 20

Defined card deals

I want to be able to deal a pack of cards in random but repeatable ways. Is the following algorithm a sensible means of doing this? Take a maximal length PRBS (Eg PRBS-31) and preload it with the deal number. Then for each card, step the PRBS by its length (Eg 31 times) and inspect the end 6 bits. If a valid card, deal it otherwise repeat. The 6bits would be 2 bits for the suit and 1 through 13 for ace through king. An invalid card is outside this range or a card already dealt. - - SGBailey (talk) 13:54, 20 October 2017 (UTC)[reply]

Acronym expansion: PRBS is Pseudorandom binary sequence. -- ToE 14:17, 20 October 2017 (UTC)[reply]
  • What you are looking for is a pseudorandom permutation. (Assign 1-52 to the cards and shuffle the integers.) A bit of hunting around digs up [1]. I speculate that you will spend more time checking that your homemade implementation is kosher (as in, your hand does not leak any information about others' hands) than actually finding an established solution, but admittedly I failed to find code in my limited search. TigraanClick here to contact me 14:45, 20 October 2017 (UTC)[reply]
The dealing step -- repeating the process when the card has already been dealt -- sounds inefficient, particularly toward the end of your deck. You might do better with a Knuth shuffle, though your algorithm will have to handle the desired range of your random number shifting with each step. -- ToE 20:28, 20 October 2017 (UTC)[reply]
I have just found http://bridge.thomasoandrews.com/impossible/ which looks like a fine method of referencing a specific deal and of getting from deal to index and back. Also 52!/(13!^4) < 2^96. So if I use a PRBS of 96 bits, I can get all deals. -- SGBailey (talk) 10:16, 21 October 2017 (UTC)[reply]
Were you specifically looking for a bridge deal (order unimportant, only care about distribution of 13 cards to each of four players)? -- ToE 15:13, 21 October 2017 (UTC)[reply]
Yes -- SGBailey (talk) 17:03, 21 October 2017 (UTC)[reply]

October 21

Curvature from partial derivatives

Every formula for curvature I've seen assumes that the curve is given parametrically. (Curves of the form y=f(x) are included since you can take the parameter to be x.) I'm trying to determine if there is a formula for the curvature of an implicit curve f(x, y)=0 at x0, y0, assuming f(x0, y0)=0 and either f1(x0, y0) or f2(x0, y0) is not 0, given in terms of f1, f2, f11, f12, f22. Here fi is the partial derivative of f wrt the ith variable and f is assumed to be "sufficiently nice". If no such formula is possible then there should be f and g which agree up to the second derivatives but where the corresponding curves have different curvatures. --RDBury (talk) 17:24, 21 October 2017 (UTC)[reply]

Implicit curve#Curvature says:
Due to clarity of the formulas the arguments are omitted:
is the curvature at a regular point.
Loraof (talk) 18:45, 21 October 2017 (UTC)[reply]
An alternative is to use numerical methods. That is, use 3 sample points close enough together so that the average curvature for that region will be an acceptable approximation of the instantaneous curvature at the middle point, but not so close that round-off error will throw off the results. If calculating the curvature on computer, this may be the easier way to go. StuRat (talk) 20:58, 21 October 2017 (UTC)[reply]
Off topic.
The following discussion has been closed. Please do not modify it.
Oh FFS did you even read the question? Please stop with the self-indulgent ramblings. --JBL (talk) 21:09, 21 October 2017 (UTC)[reply]
I assume you mean that my response does not use a partial derivative solution. If that's really the only answer the OP wants, then they have it already, and my reply does not spoil that answer. However, this could be a case of the XY Problem, where they really want any solution, but heard a partial derivative solution exists, so asked for that one. If this is the case, then my response may be helpful. I would ask you to remain civil, in any case. StuRat (talk) 01:22, 22 October 2017 (UTC)[reply]
Thanks, seems like it should be in the Curvature article but I didn't see it. --RDBury (talk) 00:18, 22 October 2017 (UTC)[reply]

October 22

Pro-centrism / anti-centrism of ranked-preference voting systems

I've read that when the political ideology of candidates is more or less on a one-dimensional scale, some ranked-preference voting systems (Condorcet methods, Borda count, Bucklin voting) tend to favor centrists and disfavor extremists compared to plurality voting, whereas instant-runoff voting does the opposite (as was demonstrated by the Burlington mayoral election, 2009). Have any studies been done to quantify or rank the favorability of different ranked-preference voting systems to a centrist (ideally taking into account that voter ideology will be sometimes unimodal and sometimes bimodal)? NeonMerlin 01:20, 22 October 2017 (UTC)[reply]

Leave a Reply