Homework 911, v. 2012
For times when you need HELP!!!
(You can read the 2011 edition here.)
Date: April 19, 2012
Categories: Life
Thursday, 16 May 2024
Life, the universe, pies, hot-pink bunnies, world domination, and everything
For times when you need HELP!!!
(You can read the 2011 edition here.)
Date: April 19, 2012
Categories: Life
Okay.
Who likes trig? (This question is accompanied by a desperate grin).
Could someone explain to me how to prove the identity secθ(sinθ+2cosθ)=2cos^2θ+tanθ(cosθ+sinθ)^2?
I’ve been working on it for a while and have a sheet full of random algebraic paths that aren’t really getting me anywhere… Any hints or tips would be much appreciated.
remember, sin^2 x + cos^2 x = 1
here’s the full calculation, refer to it only if necessary
using x instead of theta, doing multiple things at once, doing things to both sides at once — a real proof you’d keep one side the same throughout, so just imagine after I prove the second side equal to tanx+2 that I let 1 = cosx / cosx etc.
secx = 1/cosx
secx(sinx + 2cosx) = 2cos^2 x + tanx(cosx + sinx)^2
sinx/cosx + 2cosx/cosx = 2cos^2 x + tanx(cos^2 x + 2sinxcosx + sin^2 x)
tanx + 2 = 2 cos^2 x + tanx(1 + 2sinxcosx)
tanx + 2 = 1 cos^2 x + tan x + 2 sin^2 x
tanx + 2 = tanx + 2
Very helpful – thank you very much!
(joins in flailing)
I’m doing trig. (desperate flail)
Thanks, Dodecahedron, because that was helpful for me as well.
I have NO IDEA what all of that means. And my math teacher says we’re going to learn some of this sometime soon. * flail party*
In my experience, learning is never interesting when you understand it beforehand, anyway. You’ll probably be fine. Good luck.
I hate inductive proofs- we never did them in school and now they’re having their revenge.
Could someone explain how I’m supposed to prove that when you cut a pizza into segments using straight, edge-to-edge lines, you can’t end up with more than (1/2) (n^2 + n + 2) pieces?
*gah*
I hate being semi-sick and trying to work and getting stuck on problems that are supposed to be so easy because inductive proofs make so much sense and I’m behind on my stupid schedule because I had to lay down for a while when I thought I was going to barf again and I’m not making any progress *headwall* </rant
Do the line segments have to pass through the center of the pizza?
No, at least not as far as I know… the formula’s correct but I can’t figure out how I’m supposed to inductively prove why, since I don’t have an equation or anything.
Well, if n line segments have been drawn, a new one can intersect them in at most n points and add (n+1) new slices. So if S(n) is less than or equal to (n^2 + n + 1)/2 and S(n+1) is less than or equal to S(n) + n +1 , a little algebra gives you S(n+1) < = [(n+1)^2 + (n+1) + 1]/2. Only problem is, I haven't proved that first observation.
Thanks anyway
Alright, please tell me you guys all love java, because I hate it, never wanted to take the class in the first place but need it to graduate. Anyway, I’m trying to write a program that calculates a bunch of values (got that part) and then prints out the results. Except for some reason, I have to put “+” in between the words or I get an error message. I ended up doing this:
System.out.println(k +” Kilometer, ”
+m2+” Meter, ”
+c+” Centimeter, ”
+ili+” Milimeter und ”
+ikro+” Mikrometer. “)
Which looks a little awkward but works. So my question is, why do I need the “+” and can I make it work without them? (I get an error if I try to use spaces instead.) Oh, and k, m2, c, ili and ikro are int, int, int, int and long (respectively) variables I defined before, they’re behaving well.
I would not say I “love” Java, but it’s probably the language I’m most proficient with (despite not having used it in 6+ months)
short explanation: the + is the right way to do it
long explanation:
When you’re printing non-String variables as Strings, you have to convert them to Strings. This happens automatically if you put them in a system function such as println (explaining why would take longer than is really necessary; why it works depends on the syntax when you do it). However, the bits of String don’t combine on their own. So you have to concatenate the strings together to make one big string. The operator + is the way to do this in Java. (In other languages string concatenation is a different operator, for example . in PHP)
Some fun trivia:
In C (which is not precisely the parent language of Java, but Java is categorized as a “C- type” language), the default way to do what you want would be the following syntax:
printf(“%d kilometer %d meter %d centimeter %d millimeter %d micrometer”, k, m2, c, ili, ikro);
As you can see, the printf (f stands for “formatted”) command takes one string and several variables as arguments. The % in the output string signals that the character immediately following it is going to be representative of a variable from the list in the arguments, and the d signals that the variable is a decimal integer. A sample output for printf as I wrote above (using random numbers) would be:
5 kilometer 120 meter 6 centimeter 9 millimeter 30 micrometer
(I believe Java does have a System.out.printf, but you’re fine doing it with System.out.println too, especially at this level)
Thank you!!! *squids* This just made my week.
(forgive me if I use this thread for old times’ sake)
I’m giving a presentation at a conference this weekend about character encoding (and emoji). One of my slides has an Arabic example. I do not speak Arabic and I am looking for a sanity check for what I’ve got now. I don’t actually know anyone who speaks Arabic, but then I thought, maybe Robert does?
Here’s the content of the slide in question:
ZWJ + ت + ZWJ = ـتـ‎
ZWJ + ـت = ت
ت + ZWJ = تـ‎
ZWJ is short for “zero width joiner” – the character which is the subject of my talk. I say some words about how it can be used to show Arabic letters in various forms, and to combine them, and I have this up as an example. I also say that the slide is meant to be read left to right, and that Arabic words are only correctly written as words when they’re combined, and they should combine automatically but the ZWJ can force their joined form.
My question is: does this example make visual sense if you know Arabic? (secondary question is it offensive in some other way)
thank you! ♥
Hi, Dodec! I’ve studied Arabic, and your example makes sense to me. The script is cursive, so letters link to the letters on either side of them (except when it’s visually impossible; some combinations don’t exist).
It does feel slightly unintuitive that a command to the left of the character creates a connector to the right, when Arabic is written right-to-left. Are the letters input left-to-right as well? That would be consistent, at least.
Nothing offensive that I can see. Good luck!
Dodecahedron: How did the presentation go?
(By the way, “Dodecahedron” anagrams to “D’oh! A code nerd.” and “Hard code done.”)
Thank you so much for your reply, I didn’t have a chance to respond when I saw it this morning but it did make me feel much better about my example slide.
The presentation was this afternoon and it seems like it was well received! A lot of people told me that they liked it! The person who I follow on Twitter who inspires me the most about localization of Arabic specifically was in the audience and he came up to me during a break later in the day specifically to say that he liked my talk!!!
It was recorded and livestreamed – once the video is processed it should be available online. I’ll try to show a link though be warned that it ruins the mystery of my alter ego, as it shows my face and I say my full name in it.
Mystery is overrated. I’m glad to hear your presentation went well.