Go Back   Naruto & Bleach Mania Forums > General Discussion > General Discussion & News
User CP Rules & Info Arcade Gallery

http://www.narutomania.com/forums/New Month, New Problems
For these forums to remain up we need $480 within 7 days. Please donate HERE We need this amount no matter what to keep this website up. Thank you for your support.

Reply
 
Thread Tools
Old 31-08-2008, 03:00 AM   #1241
A://Stocks
 
Tammy's Avatar


Join Date: Nov 2004
Location: cali
Posts: 2,310
My Mood:
Rep Power: 666
Tammy has a reputation beyond reputeTammy has a reputation beyond reputeTammy has a reputation beyond reputeTammy has a reputation beyond reputeTammy has a reputation beyond reputeTammy has a reputation beyond repute

Basic Gold Superior Red Award Unsung Hero 
Total Awards: 3

Send a message via AIM to Tammy
Default Re: Homework Help v1.3

Quote:
Originally Posted by waqo View Post
Ok the solution is through integration by parts as I assume you already got. The bit where you get lost is a very simple manipulation of the equation in order to make the integration simple. Essentially by adding and subtracting 1 from the denominator (the net effect of which is zero) and grouping the 2x+1 in both the numerator and denomiator kinda like doing the reverse of say for instance if we had 2/7+1/7=3/7. By splitting the fraction into two parts [2x+1 and -1] the first one then simplifies to 1 and the second one becomes -1/(2x+1).

The following step is the actual integration and it is a standard solution for both [integral of 1 is x +c and ln(2x+1) is 1/2 ln(2x+1) + c, where combining the constants of integration gives C]. Finally, all the ln(2x+1) terms are gathered and the common factor is removed, then as an additional step the x+1/2 is rewritten as 1/2(2x+1) and you have your final solution.

Hope that made sense, if anything doesn't lemme know =]
Wow ya that made perfect sense, thank you.
__________________




AnimeStocks.com | awesome anime gallery, go check it
Tammy is offline   Reply With Quote
Old 31-08-2008, 04:35 PM   #1242
Raitei
 
Keerua's Avatar


Join Date: Nov 2004
Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21
Keerua is a splendid one to beholdKeerua is a splendid one to behold
Default Re: Homework Help v1.3

Dealing with complex numbers

Z = a + ib
W = c + id

Assume that both Z+W and Z*W are real (meaning not a complex number? ie ib & id = 0 ?). Show (prove) that either Z and W are real or that they are the conjugate of one another.

Is this as straightforward as it sounds? Like I mentioned earlier proofs are completely new to me and I m not sure how I should formulate it.

So if Z + W AND Z * W = real number then it Z and W can be either real numbers or the conjugate of one another.

If they are the conjugate of one another I get that Z+W = 2a and Z * W = a**2 + bd
If Z and W are real numbers I get that that Z + W = a+c and Z*W = ac

Is this a proof?

Edit 1 : Anyone here familiar with python? I am "neat" freak and I can't stand the fact that my print statement isn't nicely formated, how the hell do I get a linebreak in python? (not the code, the output, like </br> in html)

Edit 2: Another python problem that is eating away at me, this is supposed to compute a sum going from 1 to m for the function (1/k)

I am supposed to correct this program

s = 0; k = 1; M = 100
while k < M:
s+= 1/k
print s

This program returns nothing, it has three errors apparantely

So I tried translating to an algorithm

We have variables s = 0, k = 1, M = 100
As long as k is less than M repeat this process
Define S as the S in the previous loop (0 in the first loop) + 1/k
Print the value of S

Now I can see a problem with the variable k as I will be getting an integer division and if k>1 we are fucked, so i changed it into a float

Next problem (I think) is the loop itself, it just defines S over and over again and does nothing with it since the print statement is outside the loop it will print the global value of S, being 0, or so i thought, turns out it prints nothing, when I put it inside the loop it generates an infinite amount of increasingly bigger numbers (you would expect the 1/k making it smaller...).

I dont understand why, isn't the condition for the loop very clear, as long as K is less than M which is 100? Shouldn't even the faulty loop stop at 100? Gah I have an obsession disorder, I need to know why something doesn't work
__________________
All I am about to do is strike you 8 times okay?

Last edited by Keerua; 31-08-2008 at 09:21 PM.
Keerua is offline   Reply With Quote
Old 01-09-2008, 06:05 AM   #1243
Administrator
 
o({})o's Avatar


Join Date: Sep 2004
Location: Yuritopia!
Posts: 2,895
My Mood:
Rep Power: 666
o({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond repute

Basic Bronze Basic Bronze Basic Gold Intermediate Silver Award Basic Gold 
Total Awards: 5

Send a message via ICQ to o({})o Send a message via Yahoo to o({})o
Default Re: Homework Help v1.3

Quote:
Originally Posted by San Gohan View Post
Dealing with complex numbers

Z = a + ib
W = c + id

Assume that both Z+W and Z*W are real (meaning not a complex number? ie ib & id = 0 ?). Show (prove) that either Z and W are real or that they are the conjugate of one another.

Is this as straightforward as it sounds? Like I mentioned earlier proofs are completely new to me and I m not sure how I should formulate it.

So if Z + W AND Z * W = real number then it Z and W can be either real numbers or the conjugate of one another.

If they are the conjugate of one another I get that Z+W = 2a and Z * W = a**2 + bd
If Z and W are real numbers I get that that Z + W = a+c and Z*W = ac

Is this a proof?
You can only start by assuming that the given is true. In this case, you are given:

Z = a + bi
W = c + di
Z + W and Z * W are Real numbers.

You are looking to prove that Z and W are Real numbers or conjugates. I'm not sure if that "or" is exclusive or not. Also, note that the b and the d should be in front of the i's (this isn't required, but you will get strange looks if you reverse it). You will want to set your proof up as follows:

To Prove:
Z and W are Real numbers or conjugates (Z = a + 0i and W = c + 0i or Z = m + ni and W = m - ni)
Given:
Z = a + bi
W = c + di
Z + W and Z * W are Real numbers.



Quote:
Originally Posted by San Gohan View Post
Edit 1 : Anyone here familiar with python? I am "neat" freak and I can't stand the fact that my print statement isn't nicely formated, how the hell do I get a linebreak in python? (not the code, the output, like </br> in html)
Should probably be the same as in most other languages: \n

Quote:
Originally Posted by San Gohan View Post
Edit 2: Another python problem that is eating away at me, this is supposed to compute a sum going from 1 to m for the function (1/k)

I am supposed to correct this program

s = 0; k = 1; M = 100
while k < M:
s+= 1/k
print s

This program returns nothing, it has three errors apparantely

So I tried translating to an algorithm

We have variables s = 0, k = 1, M = 100
As long as k is less than M repeat this process
Define S as the S in the previous loop (0 in the first loop) + 1/k
Print the value of S

Now I can see a problem with the variable k as I will be getting an integer division and if k>1 we are fucked, so i changed it into a float

Next problem (I think) is the loop itself, it just defines S over and over again and does nothing with it since the print statement is outside the loop it will print the global value of S, being 0, or so i thought, turns out it prints nothing, when I put it inside the loop it generates an infinite amount of increasingly bigger numbers (you would expect the 1/k making it smaller...).

I dont understand why, isn't the condition for the loop very clear, as long as K is less than M which is 100? Shouldn't even the faulty loop stop at 100? Gah I have an obsession disorder, I need to know why something doesn't work
I see three syntax errors and 1 logic error (some people call syntax errors "compile-time errors"). The syntax errors are missing semicolons. The logic error is a loop in which there is no chance of the ending condition ever being satisfied (infinite loop). The loop changes the value of s, but does not modify either k or M which are in the ending condition.
__________________
Yuri FTW! - Created by: gooserapids
o({})o is offline   Reply With Quote
Old 02-09-2008, 07:00 PM   #1244
Raitei
 
Keerua's Avatar


Join Date: Nov 2004
Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21
Keerua is a splendid one to beholdKeerua is a splendid one to behold
Default Re: Homework Help v1.3

Thank you all problems solved, I am grateful, hope I am not being a pest lol

Edit: Hebe what is the point of de Moivres in this situation? Express Cos 4n and Sin 4n as cos n and sin n (where n = Ø (theta))

The end result being: cos^4Ø + sin^4Ø - 6cos^2Øsin^2Ø + i (4cos^3ØsinØ - 4cosØsin^3Ø)

I dont know about my professor but I sure as hell like Cos 4n + Sin 4n alot more lol.
__________________
All I am about to do is strike you 8 times okay?

Last edited by Keerua; 02-09-2008 at 07:17 PM.
Keerua is offline   Reply With Quote
Old 03-09-2008, 02:07 AM   #1245
Administrator
 
o({})o's Avatar


Join Date: Sep 2004
Location: Yuritopia!
Posts: 2,895
My Mood:
Rep Power: 666
o({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond repute

Basic Bronze Basic Bronze Basic Gold Intermediate Silver Award Basic Gold 
Total Awards: 5

Send a message via ICQ to o({})o Send a message via Yahoo to o({})o
Default Re: Homework Help v1.3

The reason is very simple: cos(mØ) + sin(mØ) * i is hard to work with. That second expression might be ugly, but it is a lot easier to work with in many cases than the alternative as the functions need not be broken up.

Wait... Are you sure it was cos(4Ø) + sin(4Ø)? That's a whole hell of a lot easier and has no imaginary part. O.o
__________________
Yuri FTW! - Created by: gooserapids
o({})o is offline   Reply With Quote
Old 03-09-2008, 07:43 AM   #1246
Raitei
 
Keerua's Avatar


Join Date: Nov 2004
Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21
Keerua is a splendid one to beholdKeerua is a splendid one to behold
Default Re: Homework Help v1.3

Yeah that is exactly what it says here cos4n and sin 4n, this is an example from the book

"Express Cos 3Ø and Sin 3 Ø as Sin Ø and Cos Ø"

It starts off like this: cos 3Ø + isin 3 Ø = (Cos Ø + iSinØ)^3

Now all of a sudden my calculus pulls out an i from god knows where, but in the end result they just forget the i and express sin 3 Ø = 3sinØ - 4sin^3 Ø
and cos 3 Ø = 4cos^3Ø - 3 cos Ø

obviously the imaginery part is not 0 or sin 3 Ø would be 0....

I thought only physicists could pull things out of their ass in an equation just to make it work
__________________
All I am about to do is strike you 8 times okay?

Last edited by Keerua; 03-09-2008 at 07:44 AM.
Keerua is offline   Reply With Quote
Old 03-09-2008, 01:08 PM   #1247
Monorailpilot provisional


Join Date: Nov 2005
Posts: 1,458
Rep Power: 25
waqo has a reputation beyond reputewaqo has a reputation beyond reputewaqo has a reputation beyond reputewaqo has a reputation beyond repute

Basic Bronze Basic Gold 
Total Awards: 2

Default Re: Homework Help v1.3

^ i's usually disappear when squared, and physicists do nothing of the sort, except we do! for more information look up colour forces in particle physics
__________________
Don't forget the Sports Arena! Share views, celebrations, frustrations of all your favourite sports@ http://www.narutomania.com/forums/sports-arena/
waqo is offline   Reply With Quote
Old 03-09-2008, 04:48 PM   #1248
Raitei
 
Keerua's Avatar


Join Date: Nov 2004
Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21
Keerua is a splendid one to beholdKeerua is a splendid one to behold
Default Re: Homework Help v1.3

UNIVERSAL CONSTANT FTW


Waqo you study physics? That is so awesome dude, I am majoring in physics & astronomy, look forward to mass PM spam next semester as I will be needing you to do my homework
__________________
All I am about to do is strike you 8 times okay?
Keerua is offline   Reply With Quote
Old 03-09-2008, 05:15 PM   #1249
Monorailpilot provisional


Join Date: Nov 2005
Posts: 1,458
Rep Power: 25
waqo has a reputation beyond reputewaqo has a reputation beyond reputewaqo has a reputation beyond reputewaqo has a reputation beyond repute

Basic Bronze Basic Gold 
Total Awards: 2

Default Re: Homework Help v1.3

I'm a physics grad, but yeh if you're ok with poor performance pm away =] I'll be glad to help where I can but admittedly i'm not the best physics student out there.

I might be able to help in some relativity stuff ( special not general!!) basic quantum stuff, and my foray into astronomy despite a distinct interest in the theory was a massive failure. Lol I may actually prove much more useful in economics and finance questions (I also majored in Finance and actually did well)
__________________
Don't forget the Sports Arena! Share views, celebrations, frustrations of all your favourite sports@ http://www.narutomania.com/forums/sports-arena/
waqo is offline   Reply With Quote
Old 05-09-2008, 03:27 AM   #1250
Akatsuki
 
Ice(v)an's Avatar


Join Date: Nov 2004
Location: Urahara Store
Posts: 9,394
My Mood:
Rep Power: 36
Ice(v)an has a brilliant futureIce(v)an has a brilliant futureIce(v)an has a brilliant futureIce(v)an has a brilliant future

Basic Bronze 
Total Awards: 1

Default Re: Homework Help v1.3

List the octal and hexadecimal numbers from 16 to 32. Using A and B for the last two digits, list the numbers from 10 to 26 in base 12.
__________________



thanks to Tom, ~Mrge and Simonarturo, EE
Ice(v)an is offline   Reply With Quote
Old 06-09-2008, 01:09 AM   #1251
Administrator
 
o({})o's Avatar


Join Date: Sep 2004
Location: Yuritopia!
Posts: 2,895
My Mood:
Rep Power: 666
o({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond repute

Basic Bronze Basic Bronze Basic Gold Intermediate Silver Award Basic Gold 
Total Awards: 5

Send a message via ICQ to o({})o Send a message via Yahoo to o({})o
Default Re: Homework Help v1.3

Quote:
Originally Posted by Ice(v)an View Post
List the octal and hexadecimal numbers from 16 to 32. Using A and B for the last two digits, list the numbers from 10 to 26 in base 12.
You really need help with this? This seems like it should be relatively easy for you compared to some of the questions you've asked. >_<

I'll do the base 12 as an example:

Code:
Base 10:  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26
Base 12:   a,  b, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1a, 1b, 20, 21, 22
__________________
Yuri FTW! - Created by: gooserapids
o({})o is offline   Reply With Quote
Old 06-09-2008, 06:37 PM   #1252
Akatsuki
 
Ice(v)an's Avatar


Join Date: Nov 2004
Location: Urahara Store
Posts: 9,394
My Mood:
Rep Power: 36
Ice(v)an has a brilliant futureIce(v)an has a brilliant futureIce(v)an has a brilliant futureIce(v)an has a brilliant future

Basic Bronze 
Total Awards: 1

Default Re: Homework Help v1.3

Yeah, lol, I just needed the base 12, typical me types out the whole question, so there wouldn't be any confusion?

Can you explain how you got those numbers?
__________________



thanks to Tom, ~Mrge and Simonarturo, EE
Ice(v)an is offline   Reply With Quote
Old 06-09-2008, 06:57 PM   #1253
Administrator
 
o({})o's Avatar


Join Date: Sep 2004
Location: Yuritopia!
Posts: 2,895
My Mood:
Rep Power: 666
o({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond repute

Basic Bronze Basic Bronze Basic Gold Intermediate Silver Award Basic Gold 
Total Awards: 5

Send a message via ICQ to o({})o Send a message via Yahoo to o({})o
Default Re: Homework Help v1.3

In any base, each digit of a number is comprised of 0 through the number one under the base.

In base 10, this means 0-9 are used for each place value in the number. In base 12, we use 0-b.

In every base system, numbers can be converted to base 10 using this method:
base^0 * first digit + base^1 * second digit + base^2 * third digit

For a number like 1337 in base 10:
10^0 * 7 + 10^1 * 3 + 10^2 * 3 + 10^3 * 1
__________________
Yuri FTW! - Created by: gooserapids
o({})o is offline   Reply With Quote
Old 09-09-2008, 04:27 AM   #1254
Chuunin
 
narutodbz's Avatar


Join Date: Nov 2004
Posts: 235
Rep Power: 16
narutodbz will become famous soon enough
Default Re: Homework Help v1.3

(a^2+2ab+b^2-c^2)/(a+b-c)

thx in advance
is so i would apreciate if u explain me how you got to the answer
i know how to do these type of equations but i was stuck on this one
__________________

narutodbz is offline   Reply With Quote
Old 09-09-2008, 07:52 AM   #1255
Raitei
 
Keerua's Avatar


Join Date: Nov 2004
Location: Noway
Posts: 1,417
My Mood:
Rep Power: 21
Keerua is a splendid one to beholdKeerua is a splendid one to behold
Default Re: Homework Help v1.3

The first part can be written as (a+b-c)*(a+b+c)
Dividing that by (a+b-c) we get (a+b-c)*(a+b+c)/(a+b-c) = a+b+c


I figured it can be written like that because there is only one c in the original equation (-c^2), I dont know the name of this rule in English.

Basically:

(a+b-c)(a+b+c) = a^2 + 2ab + ac + b ^2 + bc - ac -bc - c^2 = a^2 + 2ab + b^2 - c^2
__________________
All I am about to do is strike you 8 times okay?
Keerua is offline   Reply With Quote
Old 13-09-2008, 04:26 PM   #1256
Ero
Elite Jounin


Join Date: Sep 2004
Location: NYC
Posts: 6,279
My Mood:
Rep Power: 59
Ero has a reputation beyond reputeEro has a reputation beyond reputeEro has a reputation beyond reputeEro has a reputation beyond reputeEro has a reputation beyond reputeEro has a reputation beyond reputeEro has a reputation beyond reputeEro has a reputation beyond reputeEro has a reputation beyond repute

Basic Silver Basic Gold Basic Bronze High Bronze Award 
Total Awards: 4

Send a message via AIM to Ero Send a message via MSN to Ero
Default Re: Homework Help v1.3

Need some quick C++ help:

description:
Quote:
I'm taking an intro to C++ class and the assignment is such:

i have a program that asks for your name, then asks for a character to use as a border then prints out text with the character as a top and bottom border.

in other words: it looks like this when run:
Code:
Please enter your name: you enter a name....so say I put Ero
Please enter a character to use as a border:  You give it a character...so say I put #

#####################################
              Welcome Ero!
               text
               text
               text
#####################################


what I need to make it to do is
Code:
Please enter your name: you enter a name....so say I put Ero
Please enter a character to use as a border:  You give it a character...so say I put #

#####################################
#           Welcome Ero!            #
#            text                   #
#            text                   #
#            text                   #
#####################################
EXCEPT LINED UP TO FORM A BOX AROUND THE TEXT -- i CAN'T GET IT TO LINE UP ON THE FORUMS

I'm avoiding putting the source code in case my professor is some kinda net ninja, but if it's needed then put up it shall be.
this is my code so far:

Code:
#include <iostream>
#include <string>

using namespace std;

 

int 

main()

{

string name;

char b;
int choice;
int border = 1;
 

 cout << "Please enter your name: "; //prompts user for name
 cin >> name;
 cout << "Please enter a character to use as a border: "; // prompt for border character
 cin >> b;
 cout <<endl;
 
	for (border=1; border<51; border++) // Loop that prints the top border
{
	 cout <<b ;
	}
 	cout <<"\n\t\tWelcome " <<name <<"!";
    cout << "\nPlease choose a number from the following options: \n\n";
	cout << "\t1. Play the game! \n\t2. Demo the game! \n\t3. Exit \n\n";

	for (border=1; border<51; border++) // Loop that prints the bottom border
{
	 cout <<b ;
	}
	 cout <<endl <<endl;

	 cout << "Please make a game selection! ";

	 cin >> choice;

	 cout << "You have entered selection " <<choice <<"!" <<endl;
	
    return 0;

}
__________________
Remember me?

Last edited by Ero; 13-09-2008 at 04:34 PM.
Ero is offline   Reply With Quote
Old 13-09-2008, 08:44 PM   #1257
Administrator
 
o({})o's Avatar


Join Date: Sep 2004
Location: Yuritopia!
Posts: 2,895
My Mood:
Rep Power: 666
o({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond reputeo({})o has a reputation beyond repute

Basic Bronze Basic Bronze Basic Gold Intermediate Silver Award Basic Gold 
Total Awards: 5

Send a message via ICQ to o({})o Send a message via Yahoo to o({})o
Default Re: Homework Help v1.3

Rather than give you the code for it, I will explain what I would do...

I would write a separate function called displayMenu which takes two arguments: a string and an array of strings. The single string is the border character. Note that it should be a string and not a character despite its length. The first string in the array is the menu title, and each subsequent string is an option for the menu.

displayMenu will run through all of the array entries and find the longest one by checking the length of each and storing it if it is bigger than the previous length. It will then call another function called padMenuOption which takes a string argument and an integer length and pads the string out on each side with spaces until it reaches the desired length (a few more spaces beyond the length of the longest menu item). It then returns this string and it can be stored in place of the original menu option in the array (you could use pointers as well in theory, but this is often more annoying than just overwriting the original value).

Once all of the strings in the string array are paded, displayMenu will run through the array and add the border string to the front and back of each item. Finally, it will check how long any of the menu items is (they should all be the same length at this point) and it will make a string of border characters that is that length by using a loop.

Displaying the menu is the last thing displayMenu should do and would involve simply outputting the border character string it just formed, followed by each entry in the array, followed by outputting the border character string it just formed again.

There you have it: a simple, scalable menu system that you can use over again in any program you ever make again in the future instead of it being hard-coded for this specific program.
__________________
Yuri FTW! - Created by: gooserapids
o({})o is offline   Reply With Quote
Old 14-09-2008, 12:19 AM   #1258
A://Stocks
 
Tammy's Avatar


Join Date: Nov 2004
Location: cali
Posts: 2,310
My Mood:
Rep Power: 666
Tammy has a reputation beyond reputeTammy has a reputation beyond reputeTammy has a reputation beyond reputeTammy has a reputation beyond reputeTammy has a reputation beyond reputeTammy has a reputation beyond repute

Basic Gold Superior Red Award Unsung Hero 
Total Awards: 3

Send a message via AIM to Tammy
Default Re: Homework Help v1.3

CalcB Partial fractions

integ [(x^3-x-8)/(x^2-x-6)] dx

ok so I did the long division and at some point i get this

4x-2 = a(x-3) + b(x+2)

I'm a little lost on what to do next, I'm confused how theyre even determining the coefficients. I mean what do I do with the 4x-2

-----------------

different problem, gathering the terms? for some reason I'm not getting sonething so simple?

a(x+2) + b(x-1)

somehow they get (a+b)x + (2a-b)

what did they factor and expand to get to there?
__________________




AnimeStocks.com | awesome anime gallery, go check it
Tammy is offline   Reply With Quote