text:
Find all School-related info fast with the new School-Specific MBA Forum

 It is currently 06 Dec 2013, 13:22

# Events & Promotions

###### Events & Promotions in June
Open Detailed Calendar

# Is root{(x-3)^2}=3-x?

Author Message
TAGS:
Senior Manager
Joined: 12 Mar 2009
Posts: 318
Followers: 1

Kudos [?]: 22 [2] , given: 1

Is root{(x-3)^2}=3-x? [#permalink]  02 Apr 2010, 12:45
2
KUDOS
00:00

Difficulty:

35% (medium)

Question Stats:

54% (02:04) correct 45% (01:07) wrong based on 225 sessions
Is \sqrt{(x-3)^2}=3-x?

(1) x\neq{3}
(2) -x|x| >0
[Reveal] Spoiler: OA
Math Expert
Joined: 02 Sep 2009
Posts: 15073
Followers: 2519

Kudos [?]: 15466 [7] , given: 1552

Re: gmat prep Q [#permalink]  02 Apr 2010, 12:59
7
KUDOS
Expert's post
Is \sqrt{(x-3)^2}=3-x?

Remember: \sqrt{x^2}=|x|. Why?

Couple of things:

The point here is that square root function can not give negative result: wich means that \sqrt{some \ expression}\geq{0}.

So \sqrt{x^2}\geq{0}. But what does \sqrt{x^2} equal to?

Let's consider following examples:
If x=5 --> \sqrt{x^2}=\sqrt{25}=5=x=positive;
If x=-5 --> \sqrt{x^2}=\sqrt{25}=5=-x=positive.

So we got that:
\sqrt{x^2}=x, if x\geq{0};
\sqrt{x^2}=-x, if x<0.

What function does exactly the same thing? The absolute value function! That is why \sqrt{x^2}=|x|

Back to the original question:

So \sqrt{(x-3)^2}=|x-3| and the question becomes is: |x-3|=3-x?

When x>3, then RHS (right hand side) is negative, but LHS (absolute value) is never negative, hence in this case equations doesn't hold true.

When x\leq{3}, then LHS=|x-3|=-x+3=3-x=RHS, hence in this case equation holds true.

(1) x\neq{3}. Clearly insufficient.

(2) -x|x| >0, basically this inequality implies that x<0, hence x<3. Sufficient.

Hope it helps.
_________________
Manager
Joined: 24 Mar 2010
Posts: 104
Followers: 1

Kudos [?]: 29 [0], given: 12

Re: gmat prep Q [#permalink]  03 Apr 2010, 10:40
I think there's a slight flaw in the solution. Is sqrt((x-3)^2) = |x-3|? Arent we eliminating the negative square root here?

I think the answer is D. Substitute -5 as an example, LHS is + -8 and RHS is +8

(or am I missing something here?)
_________________

Please do consider giving kudos if you like my posts

Math Expert
Joined: 02 Sep 2009
Posts: 15073
Followers: 2519

Kudos [?]: 15466 [3] , given: 1552

Re: gmat prep Q [#permalink]  03 Apr 2010, 11:15
3
KUDOS
Expert's post
iambroke wrote:
I think there's a slight flaw in the solution. Is sqrt((x-3)^2) = |x-3|? Arent we eliminating the negative square root here?

I think the answer is D. Substitute -5 as an example, LHS is + -8 and RHS is +8

(or am I missing something here?)

First of all \sqrt{x^2} does equal to |x|, so \sqrt{(x-3)^2}=|x-3|.

Next GMAT is dealing only with Real Numbers: Integers, Fractions and Irrational Numbers.

When the GMAT provides the square root sign for an even root, such as \sqrt{x} or \sqrt[4]{x}, then the only accepted answer is the positive root.

That is, \sqrt{25}=5, NOT +5 or -5. In contrast, the equation x^2=25 has TWO solutions, +5 and -5. Even roots have only a positive value on the GMAT.

Odd roots will have the same sign as the base of the root. For example, \sqrt[3]{125} =5 and \sqrt[3]{-64} =-4.

And finally (1) can not be sufficient as if you try x=5\neq{3}, then LHS=\sqrt{(x-3)^2}=\sqrt{(5-3)^2}=2\neq{RHS}=3-x=3-5=-2.

Hope it's clear.
_________________
Manager
Joined: 24 Mar 2010
Posts: 104
Followers: 1

Kudos [?]: 29 [0], given: 12

Re: gmat prep Q [#permalink]  03 Apr 2010, 14:01
Quote:
When the GMAT provides the square root sign for an even root, such as \sqrt{x} or \sqrt[4]{x}, then the only accepted answer is the positive root.

Ok, that was news to me, but loks like you are right, just read through the OG for the first time just to confirm this. I hope the OG covers all such limitations that the test itself imposes(If not, please let me know). Thanks for the clarification though.
_________________

Please do consider giving kudos if you like my posts

Intern
Joined: 22 Jul 2010
Posts: 5
Followers: 0

Kudos [?]: 0 [0], given: 0

Re: Root (x - 3) squared [#permalink]  09 Aug 2010, 23:31
You have to remember that taking the root of a square effectively makes the term positive.

So if you choose numbers x =/= 3, f.e. x=4, the LHS = +1, but the RHS = -1

if you choose x = -4 then the LHS = +7 and the RHS also = +7.

NOT SUFFICIENT

Answer 1 would have to be x <= 3 to be sufficient alone because then the RHS remains zero or positive.

Last edited by freedom on 10 Aug 2010, 07:56, edited 3 times in total.
Manager
Joined: 26 May 2005
Posts: 210
Followers: 2

Kudos [?]: 50 [0], given: 1

Re: explaination to a DS question.....plz help [#permalink]  07 Dec 2010, 00:45
dc123 wrote:
is ((X-3)^2)^1/2 = 3-X ?

1) X does not = 3

2) -X|X| > 0

Help me plzz...Want to Master the GMAT HAHA!

((X-3)^2)^1/2 = X-3 is X>=3 OR
((X-3)^2)^1/2 = 3-X if X<=3

st 1) x!=3, not sufficient as we dont know if x is greater than 3 or less than 3
st 2) -X|X| > 0 .. as |X| is always postive, X has to be negative. so ((X-3)^2)^1/2 = 3-X. sufficient

B
Manager
Status: I rest, I rust.
Joined: 04 Oct 2010
Posts: 121
Schools: ISB - Co 2013
WE 1: IT Professional since 2006
Followers: 14

Kudos [?]: 96 [1] , given: 8

Re: explaination to a DS question.....plz help [#permalink]  07 Dec 2010, 01:42
1
KUDOS
dc123 wrote:
is ((X-3)^2)^1/2 = 3-X ?

1) X does not = 3

2) -X|X| > 0

Help me plzz...Want to Master the GMAT HAHA!

For {\sqrt{(X-3)^2} = 3-X to be true, 3-X will always have to be positive or 0, because in GMAT a root can not be negetive. So 3-X>0 or X<3.

S1:X =! 3, but is it less than 3? we dont know. Not sufficient.
S2: -X|X|>0, so either both (-X and |X|) are -ive or both are +ive. |X| can not be negetive so -X must be +ive, or X must be negetive, which would clearly be less than 3. Sufficient.

_________________

Respect,
Vaibhav

PS: Correct me if I am wrong.

Manager
Joined: 13 Jul 2010
Posts: 172
Followers: 1

Kudos [?]: 11 [0], given: 7

Re: explaination to a DS question.....plz help [#permalink]  07 Dec 2010, 22:48
vaibhavtripathi wrote:
dc123 wrote:
is ((X-3)^2)^1/2 = 3-X ?

1) X does not = 3

2) -X|X| > 0

Help me plzz...Want to Master the GMAT HAHA!

For {\sqrt{(X-3)^2} = 3-X to be true, 3-X will always have to be positive or 0, because in GMAT a root can not be negetive. So 3-X>0 or X<3.

S1:X =! 3, but is it less than 3? we dont know. Not sufficient.
S2: -X|X|>0, so either both (-X and |X|) are -ive or both are +ive. |X| can not be negetive so -X must be +ive, or X must be negetive, which would clearly be less than 3. Sufficient.

I like your simple way of solving but how do you know ((X-3)^2)^1/2 = 3-X ? the question is asking us if this is true not to take it as true. Unless you believe that in order for the equation to be true this has to be the case.
Veritas Prep GMAT Instructor
Joined: 16 Oct 2010
Posts: 3741
Location: Pune, India
Followers: 804

Kudos [?]: 3175 [0], given: 137

Re: gmat prep Q [#permalink]  09 Dec 2010, 04:25
Expert's post
mrcrescentfresh wrote:
I am having a hard time grasping why we cannot simplify the problem as:

((X-3)^2)^1/2 = (3 - X) to (X - 3)^2 = (3 - X)^2?

I know I have worked problems before where we have been able to solve it by squaring both sides, but when done in this scenario the answer is entirely different than the OA.

That is because if the question says:
Is 5 = -5?
And you do not know but you square both sides and get 25 = 25
Can you say then that 5 = -5? No!

I understand that you would have successfully used the technique of squaring both sides before but that would be in conditions like these:
Given equation: \sqrt{X} = 3
Squaring both sides: X = 9
Here you already know that the equation holds so you can square it. It will still hold. This is like saying:
It is given that 5 = 5.
Squaring both sides, 25 = 25 which is true.

This question is similar to the first case. It is asked whether \sqrt{((X-3)^2)} = (3 - X)?

LHS is positive because \sqrt{((X-3)^2)} = |X-3|
and by definition of mod, we know that
|X| = X if X is positive or zero and -X if X is negative (or zero).
Since |X-3| = - (X - 3), we can say that X - 3 <= 0 or that X <= 3
So the question is: Is X <= 3?
Stmnt 1 not sufficient.
But stmnt 2 says -X|X| > 0
This means -X|X| is positive.
Since |X| will be positive, X must be negative to get rid of the extra negative sign in front. So this statement tells us that X < 0. Then X must be definitely less than 3. Sufficient.
_________________

Karishma
Veritas Prep | GMAT Instructor
My Blog

Save $100 on Veritas Prep GMAT Courses And Admissions Consulting Enroll now. Pay later. Take advantage of Veritas Prep's flexible payment plan options. Veritas Prep Reviews Veritas Prep GMAT Instructor Joined: 16 Oct 2010 Posts: 3741 Location: Pune, India Followers: 804 Kudos [?]: 3175 [0], given: 137 Re: gmat prep Q [#permalink] 09 Dec 2010, 04:32 Expert's post iambroke wrote: Quote: When the GMAT provides the square root sign for an even root, such as \sqrt{x} or \sqrt[4]{x}, then the only accepted answer is the positive root. Ok, that was news to me, but loks like you are right, just read through the OG for the first time just to confirm this. I hope the OG covers all such limitations that the test itself imposes(If not, please let me know). Thanks for the clarification though. This is not GMAT specific! It is the convention. Given x = \sqrt{9}, x = 3 only Given x^2 = 9, x can be 3 or -3 _________________ Karishma Veritas Prep | GMAT Instructor My Blog Save$100 on Veritas Prep GMAT Courses And Admissions Consulting
Enroll now. Pay later. Take advantage of Veritas Prep's flexible payment plan options.

Veritas Prep Reviews

Veritas Prep GMAT Instructor
Joined: 16 Oct 2010
Posts: 3741
Location: Pune, India
Followers: 804

Kudos [?]: 3175 [0], given: 137

Re: explaination to a DS question.....plz help [#permalink]  09 Dec 2010, 04:38
Expert's post
vaibhavtripathi wrote:
dc123 wrote:
is ((X-3)^2)^1/2 = 3-X ?

1) X does not = 3

2) -X|X| > 0

Help me plzz...Want to Master the GMAT HAHA!

For {\sqrt{(X-3)^2} = 3-X to be true, 3-X will always have to be positive or 0, because in GMAT a root can not be negetive. So 3-X>0 or X<3.

S1:X =! 3, but is it less than 3? we dont know. Not sufficient.
S2: -X|X|>0, so either both (-X and |X|) are -ive or both are +ive. |X| can not be negetive so -X must be +ive, or X must be negetive, which would clearly be less than 3. Sufficient.

A word of caution: This works only because left side of the equation has X - 3.
If I twist the question a little:
Is {\sqrt{(X-1)^2} = 3-X
I get: |X - 1| = 3 - X
This has only one solution X = 2. So now the question is: Is X = 2? (Not Is X < 3?) It is a more specific question now.
_________________

Karishma
Veritas Prep | GMAT Instructor
My Blog

Save $100 on Veritas Prep GMAT Courses And Admissions Consulting Enroll now. Pay later. Take advantage of Veritas Prep's flexible payment plan options. Veritas Prep Reviews Manager Joined: 10 Sep 2010 Posts: 133 Followers: 2 Kudos [?]: 9 [0], given: 7 Re: gmat prep Q [#permalink] 13 Dec 2010, 14:49 Bunuel wrote: Remember: \sqrt{x^2}=|x|. Why? I am confused. I thought there was some kind of agreement that square root sign indicates a positive number. (For example, \sqrt{25}=5 and not "-5"). On the other hand, if x^2=25, then x can be 5 or -5. Math Expert Joined: 02 Sep 2009 Posts: 15073 Followers: 2519 Kudos [?]: 15466 [0], given: 1552 Re: gmat prep Q [#permalink] 13 Dec 2010, 15:23 Expert's post Fijisurf wrote: Bunuel wrote: Remember: \sqrt{x^2}=|x|. Why? I am confused. I thought there was some kind of agreement that square root sign indicates a positive number. (For example, \sqrt{25}=5 and not "-5"). On the other hand, if x^2=25, then x can be 5 or -5. Frankly speaking I don't see contradiction between the fact that \sqrt{x^2}=|x| and that even roots give non-negative result, as absolute value also gives non-negative result. Anyway: Square root function can not give negative result: wich means that \sqrt{some \ expression}\geq{0}, or \sqrt{x}\geq{0}. So, when the GMAT provides the square root sign for an even root, such as \sqrt{x} or \sqrt[4]{x}, then the only accepted answer is the non-negative root. That is, \sqrt{25}=5, NOT +5 or -5. In contrast, the equation x^2=25 has TWO solutions, +5 and -5. Even roots have only non-negative value on the GMAT. On the other hand absolute value is also non-negative |some \ expression|\geq{0}, or |x|\geq{0} (absolute value of x, |x|, is a distance between point x on a number line and zero, so distance can not be negative). As for \sqrt{x^2}=|x|: Consider following examples: If x=5 --> \sqrt{x^2}=\sqrt{25}=5=x=positive; If x=-5 --> \sqrt{x^2}=\sqrt{25}=5=-x=positive. So we got that: \sqrt{x^2}=x, if x\geq{0}; \sqrt{x^2}=-x, if x<0. Which exactly what the absolute value function does: |x|=x if x\geq{0} and |x|=-x if x\leq{0}. So, \sqrt{x^2}=|x|. Is this still confusing? _________________ Kaplan GMAT Instructor Joined: 21 Jun 2010 Posts: 148 Location: Toronto Followers: 32 Kudos [?]: 97 [1] , given: 0 Re: Algebra DS question [#permalink] 18 Dec 2010, 01:03 1 This post received KUDOS rahuljaiswal wrote: 20. Is \sqrt{(x-3)^2} = 3 - x ? (1) x ≠ 3 (2) – x | x | > 0 Did not understand Statement 2 at all..is that a product? Kindly help P.S: the question reads as " Is square root of square of (x-3) equal to (3 - x) ?" [Reveal] Spoiler: B Hi! Statement (2) reads as "the product of (negative x) and (absolute value of x) is positive". Since |x| is always non-negative (i.e. |x|=0 when x=0 and is positive for all other values of x), in order for statement (2) to be true, x must be negative, giving us: -(-) * |-| > 0 + * + > 0 which is true. So, basically, (2) is a fancy way of saying: x < 0. Now that you know how to interpret (2), try the question again - if you still need a hand, let us know where you get stuck! _________________ Stuart Kovinsky stuart.kovinsky@kaplan.com Kaplan Test Prep & Admissions Toronto Office 1-800-KAP-TEST http://www.kaptest.com/GMAT Prepare with Kaplan and save$150 on a course!

Kaplan Reviews

Intern
Joined: 09 Oct 2011
Posts: 20
GMAT Date: 10-01-2013
GPA: 3
Followers: 1

Kudos [?]: 2 [0], given: 4

GMAT Prep1 Question: IS sqrt(an expression) >= 0 always ?? [#permalink]  15 Jan 2013, 22:01
There is a DS question on GMAT Prep1 test that I came across:

\sqrt{(x-3)^2} = 3-x

1. x !=3
2. -x|x| >0.

I looked at Bunuel's solution: is-sqrt-x-3-2-3-x-1-x-not-equal-to-3-2-x-x-62992.html

He says that sqrt(expression) will always return >=0, is this right?

I thought that sqrt(25) for instance would be +- 5, and not just 5. Can anyone please help me with understanding this?

VP
Joined: 02 Jul 2012
Posts: 1010
Location: India
Concentration: Strategy
GMAT 1: 740 Q49 V42
GPA: 3.8
WE: Engineering (Energy and Utilities)
Followers: 41

Kudos [?]: 402 [0], given: 71

Re: GMAT Prep1 Question: IS sqrt(an expression) >= 0 always ?? [#permalink]  15 Jan 2013, 22:22
soods26 wrote:
There is a DS question on GMAT Prep1 test that I came across:

\sqrt{(x-3)^2} = 3-x

1. x !=3
2. -x|x| >0.

I looked at Bunuel's solution: is-sqrt-x-3-2-3-x-1-x-not-equal-to-3-2-x-x-62992.html

He says that sqrt(expression) will always return >=0, is this right?

I thought that sqrt(25) for instance would be +- 5, and not just 5. Can anyone please help me with understanding this?

As far as gmatclub is concerned, when Bunuel says something, I take it as my final source for that bit of information. So you can rest assured that he is right.

if x^2 = 25, then x = + or - 5

However, if x = \sqrt{25}, then x = 5
_________________

Did you find this post helpful?... Please let me know through the Kudos button.

Thanks To The Almighty - My GMAT Debrief

Submit Your Own Verbal Questions - Get Kudos Reward

Intern
Joined: 09 Oct 2011
Posts: 20
GMAT Date: 10-01-2013
GPA: 3
Followers: 1

Kudos [?]: 2 [0], given: 4

Re: GMAT Prep1 Question: IS sqrt(an expression) >= 0 always ?? [#permalink]  15 Jan 2013, 22:42
MacFauz wrote:
As far as gmatclub is concerned, when Bunuel says something, I take it as my final source for that bit of information. So you can rest assured that he is right.

if x^2 = 25, then x = + or - 5

However, if x = \sqrt{25}, then x = 5

Thank you for your reply, I have been around in hiding on GMAT Club long enough to know the "demi-god" that Bunuel is

However coming to:

x^2 = 25,

the next step in solving the above equation, is taking roots both sizes, which gives us:

x = \sqrt{25}, which according to you above gives x = 5 and not +- 5.

So there lies my confusion ...
VP
Joined: 02 Jul 2012
Posts: 1010
Location: India
Concentration: Strategy
GMAT 1: 740 Q49 V42
GPA: 3.8
WE: Engineering (Energy and Utilities)
Followers: 41

Kudos [?]: 402 [0], given: 71

Re: GMAT Prep1 Question: IS sqrt(an expression) >= 0 always ?? [#permalink]  15 Jan 2013, 22:51
soods26 wrote:
MacFauz wrote:
As far as gmatclub is concerned, when Bunuel says something, I take it as my final source for that bit of information. So you can rest assured that he is right.

if x^2 = 25, then x = + or - 5

However, if x = \sqrt{25}, then x = 5

Thank you for your reply, I have been around in hiding on GMAT Club long enough to know the "demi-god" that Bunuel is

However coming to:

x^2 = 25,

the next step in solving the above equation, is taking roots both sizes, which gives us:

x = \sqrt{25}, which according to you above gives x = 5 and not +- 5.

So there lies my confusion ...

x^2 = 25 does not mean the same as x = \sqrt{25}

The radical(square root) symbol is just another operator similar to a + or -. Hence \sqrt{25} can only take one value and that is the positive one.

While x^2 = 25 is an equation that needs to be solved, x = \sqrt{25} emphatically gives the value of x and is just a roundabout way of saying x = 5.

Hope it is clear.
_________________

Did you find this post helpful?... Please let me know through the Kudos button.

Thanks To The Almighty - My GMAT Debrief

Submit Your Own Verbal Questions - Get Kudos Reward

Math Expert
Joined: 02 Sep 2009
Posts: 15073
Followers: 2519

Kudos [?]: 15466 [0], given: 1552

Re: GMAT Prep1 Question: IS sqrt(an expression) >= 0 always ?? [#permalink]  16 Jan 2013, 02:34
Expert's post
soods26 wrote:
There is a DS question on GMAT Prep1 test that I came across:

\sqrt{(x-3)^2} = 3-x

1. x !=3
2. -x|x| >0.

I looked at Bunuel's solution: is-sqrt-x-3-2-3-x-1-x-not-equal-to-3-2-x-x-62992.html

He says that sqrt(expression) will always return >=0, is this right?

I thought that sqrt(25) for instance would be +- 5, and not just 5. Can anyone please help me with understanding this?

Merging similar topics. Please refer to the solutions above.

As for your doubt check here: is-root-x-3-2-3-x-92204.html#p832971

P.S. Please read carefully and follow: rules-for-posting-please-read-this-before-posting-133935.html Pay attention to the rule #3: the name of a topic (subject field) MUST be the first 40 characters (~the first two sentences) of the question.
_________________
Re: GMAT Prep1 Question: IS sqrt(an expression) >= 0 always ??   [#permalink] 16 Jan 2013, 02:34
Display posts from previous: Sort by


text:
If the image looks very grey, you could also try applying the equalizeHist on YUV image - Y channel, note that this will change the colours of the image but it might make it visually/computationally better (in some sense). A code snippet to try quickly (all _ptr are pointers to IplImage):
cvCvtColor( RGB_image_ptr, YUV_image_ptr, CV_RGB2YUV );

format: plain


text:
# do you blame Mrs. crater for what happens to lucynell? why or why not?

OEQ

I suppose Mrs. Crater bears a part of the blame. I don't think, however, that her motives are malicious. Mrs. Carter desperately wants Lucynell to get married. This would be a near miracle considering her daughter is "deaf and dumb." Mrs. Crater extols the only thing that she feels that Lucynell is worth, her youthful age. We can surmise that Mrs., Crater feels a marriage to Tom T. Shiftlet is the best prospect for her daughter. Mrs. Crater pretty much gives Tom everything allot of money, $17.50, including the car he covets. In the context of the times we can appreciate that the old lady thought she was doing a good thing. The major blame must be put on Shiftlet for he is indeed a shifty character. Shiftlet's plan to obtain the car and money were premeditated. Tom uses everyone, finally dumping Lucynell at a road stop diner. So, although Mrs. Carter should have been able to see through Shiftlet (even his name sounds Shifty), one really has to put the blame on Tom. I suppose Mrs. Crater bears a part of the blame. I don't think, however, that her motives are malicious. Mrs. Carter desperately wants Lucynell to get married. This would be a near miracle considering her daughter is "deaf and dumb." Mrs. Crater extols the only thing that she feels that Lucynell is worth, her youthful age. We can surmise that Mrs., Crater feels a marriage to Tom T. Shiftlet is the best prospect for her daughter. Mrs. Crater pretty much gives Tom everything allot of money,$ 17.50, including the car he covets. In the context of the times we can appreciate that the old lady thought she was doing a good thing. The major blame must be put on Shiftlet for he is indeed a shifty character. Shiftlet's plan to obtain the car and money were premeditated. Tom uses everyone, finally dumping Lucynell at a road stop diner. So, although Mrs. Carter should have been able to see through Shiftlet (even his name sounds Shifty), one really has to put the blame on Tom.


text:
# QuantLib: How to change polynomial order in MCAmericanBasketEngine?

My goal is to price American basket put options using the Least squares Monte Carlo, or Longstaff-Schwartz algorithm.

I currently have the one-dimensional case working with the Python file below (I am using the SWIG package), but I would like to change the number of basis functions used by the AmericanBasketEngine to make sure the price is accurate. How do I do this?

Looking at the C++ source, I found the polynomOrder keyword argument with default value 2 of the class AmericanBasketPathPricer. However, I do not know how this class is connected to the MCAmericanBasketEngine, which does not have such a keyword argument. (I never programmed in either C or C++, so I am quite lost in the source.)

Maybe is the polynomial order determined automatically, based on the requiredTolerance? That would be ideal, but I couldn't find a description of what the MCAmericanBasketEngine does exactly anywhere.

from QuantLib import *

d=1 #To be increased...
todaysDate = Date(15,May,1998)
Settings.instance().evaluationDate = todaysDate
settlementDate = Date(17,May,1998)
riskFreeRate = FlatForward(settlementDate, 0.05, Actual365Fixed())

payoff = PlainVanillaPayoff(Option.Put, 100.0)

underlying1 = SimpleQuote(100.0)
volatility1 = BlackConstantVol(todaysDate, TARGET(), 0.30, Actual365Fixed())
dividendYield1 = FlatForward(settlementDate, 0.00, Actual365Fixed())
process1 = BlackScholesMertonProcess(QuoteHandle(underlying1),
YieldTermStructureHandle(dividendYield1),
YieldTermStructureHandle(riskFreeRate),
BlackVolTermStructureHandle(volatility1))
procs = StochasticProcessVector()
procs.push_back(process1)

matrix = Matrix(1,1)
matrix[0][0] = 1.0
process = StochasticProcessArray(procs, matrix)
american_exercise = AmericanExercise(Date(17,May,1998),Date(17,May,1999))
process,
'pseudorandom',
polynomOrder = 2,#keyword does not exist
timeStepsPerYear = 100,
requiredTolerance = 0.01,
#seed = 42))
)
)

As per QuantLib's lead developer, polynomOrder is indeed not currently exposed. There is now a GitHub issue about this.


text:
Plot the points A(2, 5), B(–2, 2) and C(4, 2) on a graph paper. Join AB, BC and AC. Calculate the area of ∆ABC.
Question:

Plot the points A(2, 5), B(–2, 2) and C(4, 2) on a graph paper. Join AB, BC and AC. Calculate the area of ∆ABC.

Solution:

Abscissa of D = Abscissa of A = 2
Ordinate of D = Ordinate of B = 2

Now,
BC = (2 + 4) units = 6 units
AD = (5 – 2) units = 3 units

Area of $\Delta A B C=\frac{1}{2} \times$ Base $\times$ Height

$=\frac{1}{2} \times B C \times A D$

$=\frac{1}{2} \times 6 \times 3$

$=9$

Hence, area of ∆ABC is 9 square units.


text:
# [test summary] ZROI-21-NOIP sprint - TEST9 summary

## #T1 red black tree

Time Limit: 1s | Memory Limit: 512MiB

### #Brief description of topic meaning

Given a tree with \ (n(n\leq10^6) \) nodes, each node has two colors: red and black. Each time, the connected blocks with the same color can be dyed into another color. Ask the minimum steps to change the whole tree into the same color.

### #General idea

It is not difficult to find that the changes of points with the same color in the initial state must be synchronous, so we can combine a connected block with the same color into a point to get a new tree. Then we find that our optimal strategy must start from the center and change the whole tree into the same color bit by bit. It is not difficult to find that the number of operations required is\ (\ left\lfloor\frac {len} 2\right\rfloor \), where \ (len \) is the diameter of the new tree. It is proved that the odd and even cases of \ (len \) can be considered and discussed separately. The time complexity is \ (O(n) \)

### #Code

#define ll long long
#define mset(l, x) memset(l, x, sizeof(l))

const int N = 2000010;
const int INF = 0x3fffffff;

template <typename T> inline void read(T &x) {
x = 0; int f = 1; char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
x *= f;
}

template <typename T> inline T Max(T a, T b) {return a > b ? a : b;}
template <typename T> inline T Min(T a, T b) {return a < b ? a : b;}

struct Edge {int u, v, nxt;} e[N], ne[N];
struct DSU {
int fa[N], siz[N], num;

inline void init(int x) {
num = x;
for (int i = 1; i <= num; ++ i)
fa[i] = i, siz[i] = 1;
}

inline int find(int x) {
while (x != fa[x]) x = fa[x] = fa[fa[x]]; return x;
}

inline void merge(int x, int y) {
x = find(x), y = find(y);
if (x == y) return;
if (siz[x] > siz[y]) swap(x, y);
siz[y] += siz[x], fa[x] = y;
}
} dsu;

inline void add_edge(int u, int v) {
e[ecnt].u = u, e[ecnt].v = v;
}

inline void connect(int u, int v) {
ne[ncnt].u = u, ne[ncnt].v = v;

ne[ncnt].u = v, ne[ncnt].v = u;
}

void combine(int x, int fa) {
vis[x] = 1;
for (int i = head[x]; i; i = e[i].nxt) {
if (e[i].v == fa) continue;
if (col[e[i].v] == col[x])
dsu.merge(e[i].v, x), combine(e[i].v, x);
}
}

void build(int x, int fa) {
for (int i = head[x]; i; i = e[i].nxt) {
if (e[i].v == fa) continue;
if (col[e[i].v] != col[x])
connect(dsu.find(x), dsu.find(e[i].v));
build(e[i].v, x);
}
}

int res;

void dfs(int x, int fa) {
d[x] = d[fa] + 1;
for (int i = nhead[x]; i; i = ne[i].nxt) {
if (ne[i].v == fa) continue;
dfs(ne[i].v, x);
}
if (d[x] > d[res]) res = x;
}

int main() {
for (int i = 1; i <= n; ++ i) {
char c; cin >> c;
if (c == 'R') col[i] = 1;
else col[i] = 0;
}
for (int i = 1; i < n; ++ i) {
}
for (int i = 1; i <= n; ++ i)
if (!vis[i]) combine(i, 0);
int st = 0, ed = 0;
build(1, 0); dfs(dsu.find(1), 0);
mset(d, 0); st = res; res = 0;
dfs(dsu.find(st), 0); ed = res;
printf("%d", d[ed] / 2);
return 0;
}

## #T2 operation sequence

Time Limit: 1s | Memory Limit: 512MiB

### #Brief description of topic meaning

Give a sequence with a length of \ (k(k\leq10^5) \), and then give \ (n(n\leq10^5) \) operations:

There are three types of operations:

1. $$a_i=b$$；
2. Add \ (b \) to \ (a_i \);
3. Multiply \ (a_i \) by \ (b \);

Where \ (i,b \) is given, and each operation can only be used once. At most \ (m(m\leq10^5) \) operations are used to maximize the product of the whole sequence and give the result after the maximum product modulus \ (10 ^ 9 + 7 \).

### #General idea

Obviously, for the same position, the assignment operation will only be used once, and then we can convert the winning assignment operation into addition operation. Then for addition operation, we must first add the one with the largest contribution, and then we can convert all addition operations into multiplication operation. Note that each addition operation must be the basis of one-step addition operation at the same position Up conversion to get a new weight - how many times can the answer be increased by this operation.

Then all multiplication operations can be sorted according to the new weight.

### #Code

#define ll long long
#define pbk(x) push_back(x)

const int N = 100010;
const ll MOD = 1e9 + 7;
const int INF = 0x3fffffff;

template <typename T> inline void read(T &x) {
x = 0; int f = 1; char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
x *= f;
}

struct Node {
int id; double val;

inline Node() {}
inline Node(int _id, double _val) {id = _id, val = _val;}
};
struct action {int op, pos; ll val;} p[N];

int k, n, m; ll a[N], ans = 1, cov[N];

vector <int> fnl;

inline double calc(int pos, double val) {
return (1.0 * a[pos] + val) / (1.0 * a[pos]);
}

inline bool cmp(Node x, Node y) {return x.val > y.val;}

inline bool cmp2(int x, int y) {
if (p[x].pos != p[y].pos) return p[x].pos < p[y].pos;
else if (p[x].op != p[y].op) return p[x].op < p[y].op;
else return p[x].val < p[y].val;
}

int main() {
for (int i = 1; i <= k; ++ i) read(a[i]);
for (int i = 1; i <= n; ++ i) {
int op, pos; ll val;
p[i].op = op, p[i].pos = pos, p[i].val = val;
if (op == 1) {
if (!cov[pos]) cov[pos] = i;
else if (p[cov[pos]].val < val)
cov[pos] = i;
}
else if (op == 2) v[pos].pbk(Node(i, 1.0 * val));
else mul.pbk(Node(i, 1.0 * val));
}
for (int i = 1; i <= k; ++ i) if (cov[i])
v[i].pbk(Node(cov[i], 1.0 * (p[cov[i]].val - a[i])));
for (int i = 1; i <= k; ++ i) sort(v[i].begin(), v[i].end(), cmp);
for (int i = 1; i <= k; ++ i) {
double sum = 1.0 * a[i];
for (auto x : v[i]) {
mul.pbk(Node(x.id, (sum + x.val) / sum));
sum += x.val;
}
}
sort(mul.begin(), mul.end(), cmp);
for (int i = 0; i < m && i < mul.size(); ++ i) fnl.pbk(mul[i].id);
sort(fnl.begin(), fnl.end(), cmp2);
for (auto x : fnl) {
if (p[x].op == 1) a[p[x].pos] = max(a[p[x].pos], p[x].val);
else if (p[x].op == 2) (a[p[x].pos] += p[x].val) %= MOD;
else (a[p[x].pos] *= p[x].val) %= MOD;
}
for (int i = 1; i <= k; ++ i) (ans *= a[i]) %= MOD;
printf("%lld", ans); return 0;
}

## #T3 eat snacks

Time Limit: 1s | Memory Limit: 256MiB

### #Brief description of topic meaning

For an permutation \ (p_i \) of \ (n(n\leq10^6) \), its contribution is \ (s=\sum(i\bmod p_i) \), now known \ (s(s\leq10^{18}) \), please give a combination method \ (p_i \), and if there is no solution, output SPFA is dead!.

### #General idea

First, it is obvious that the upper bound of \ (s \) is

$\sum_{i=0}^{n-1}i=\dfrac{n\cdot(n-1)}2$

Then, consider the following construction:

Initially, \ (a_n=1,a_i=i+1(i\in\{2,3,\dots,n-1 \}) \), it is obvious that the sum of such contributions is \ (S=\frac{n\cdot(n-1)}2 \). We consider \ (\ Delta s=S-s \), enumerating \ (I \) from large to small. For \ (i\leq\Delta s \), we exchange \ (a_i \) and \ (a_{i-1} \) each time. Obviously, this will reduce \ (\ Delta s \) by \ (I \), which can be proved by induction

$[3,\dfrac {n\cdot(n-1)}2 - 2]\cup\{\dfrac{n\cdot(n - 1)}2\}$

All numbers in, and the rest can be constructed separately.

### #Code

#define ll long long

const int N = 2000010;
const int INF = 0x3fffffff;

template <typename T> inline void read(T &x) {
x = 0; int f = 1; char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
x *= f;
}

ll n, s, a[N];

int main() {
if (s == 0) {
for (int i = 1; i <= n; ++ i)
printf("%d\n", i);
return 0;
} else if (s == 1) {
if (n < 2) printf("SPFA is dead!\n");
else {
printf("2\n1\n");
for (int i = 3; i <= n; ++ i)
printf("%d\n", i);
}

} else if (s == 2) {
if (n < 3) printf("SPFA is dead!\n");
else {
printf("3\n1\n2\n");
for (int i = 4; i <= n; ++ i)
printf("%d\n", i);
}
} else {
if (s > n * (n - 1) / 2) {puts("SPFA is dead!\n"); return 0;}
ll rest = n * (n - 1) / 2 - s;
for (int i = 1; i < n; ++ i) a[i] = i + 1; a[n] = 1;
if (rest == 1) {
if (n & 1) a[1] = 3, a[2] = 1, a[n] = 2;
else swap(a[1], a[n]);
} else {
for (int i = n - 1; i; -- i) if (rest >= i)
rest -= i, swap(a[i], a[i - 1]);
}
for (int i = 1; i <= n; ++ i) printf("%lld ", a[i]);
}
return 0;
}

## #T4 number tree

Time Limit: 3s | Memory Limit: 512MiB

Goo Goo ~

Posted by mdiane at Oct 28, 2021 - 6:45 PM Tag: C++


text:
Public Group

This topic is 3204 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all, I am trying to add an automatic texture option to my terrain editor. The terrain is rendered (and saved) using a colourmap (r,g,b,a channels so four textures to work with, I'm thinking grass, dirt, stone/rock, and snow (r,g,b,a respectively) I am just having trouble thinking out the algorithm to achieve this, I have access to the mesh data per vertex (height and normal). I'm thinking :
...
if(height < stoneStartHeight)
use grass
else if(height < grassEndheight)
use blend of grass and stone
else if(height < stoneEndHeight)
use stone
...

How should I go about blending the texture over the overlap for a smooth transition between textures? How should the normal data be incorporated? (e.g. grass will not grow on steep slopes so use dirt, same for snow and stone). Is there anything else I'm overlooking? I am tied to just the four textures due to the use of a colourmap, I know more can be done with a shader, but I really want to keep the colourmap for simplicities sake. (I also know I could have another texture for r+g+b+a = 0, but again for simplicity I don't want to alter any code outside the function for altering the colourmap. I have tried searching but cannot find any relevant sources for this (the ones I can find all seem to go too far in depth, or keep it too simple). Any help/advice would be appreciated. Thanks!

##### Share on other sites
Quote:
 Original post by p0is0nHow should the normal data be incorporated? (e.g. grass will not grow on steep slopes so use dirt, same for snow and stone).

Use the normal's up component (e.g. normal.y or normal.z depending on which way is "up" for you) as one of your rules.
e.g.
if( normal.y > 0.5 )  use rockelse if( height < 100 )  use grasselse  use snow
Quote:
 How should I go about blending the texture over the overlap for a smooth transition between textures?
Instead of writing the rule as "if this condition is true, use this texture", generate a weighting for "how true" each rule is.

In the code below, saturate is a function like:
float saturate( float in ) { return min( 1, max( 0, in ) ); }
e.g. Instead of a grass/snow transition at height==100, make the weights blend from 90 to 110.
grassWeight = saturate( (height-90) / (110-90) )snowWeight = 1 - saturate( (height-90) / (110-90) )
You can do the same for the slope rule to get a nice blend:
rockWeight = saturate( (normal.y-0.5) / 0.01 )
Lets say you want the slope rule to override the height rules. We can multiply the height-based weights by the inverse slope-weight.
invRockWeight = 1-rockWeight;grassWeight *= invRockWeight;snowWeight *= invRockWeight;
Finally, you normalise all your weights:
totalWeight = grassWeight + snowWeight + rockWeight;grassWeight /= totalWeight;snowWeight /= totalWeight;rockWeight /= totalWeight;

##### Share on other sites
I really liked Ysaneya's terrain texturing solution in his dev journal. Linky

##### Share on other sites
Thanks a lot for the help.

I ended up using :
//Declare and initialise the weightsfloat dirtWeight(0.0f), grassWeight(0.0f), snowWeight(0.0f), rockWeight(0.0f);//Set the weightings based on heightsif(height < 190.0f)	dirtWeight = 1.0f;else if(height > 190.0f && height < 250.0f){	dirtWeight = 1 - Saturate((height - 190.0f) / (250.0f - 190.0f));	grassWeight = Saturate((height - 190.0f) / (250.0f - 190.0f));}else if(height < 440.0f)	grassWeight = 1.0f;else if(height > 440.0f && height < 490.0f){	grassWeight = 1 - Saturate((height - 440.0f) / (490.0f - 440.0f));	snowWeight = Saturate((height - 440.0f) / (490.0f - 440.0f));}else if(height > 490.0f)	snowWeight = 1.0f;//Set the weightings based on normalsrockWeight = Saturate((0.6f - normal) / 0.01f);//Override the height rules with the normal rulesfloat invRockWeight = 1 - rockWeight;dirtWeight *= invRockWeight;grassWeight *= invRockWeight;snowWeight *= invRockWeight;//Get the final weightingsfloat totalWeight = dirtWeight +  grassWeight + snowWeight + rockWeight;dirtWeight /= totalWeight;grassWeight /= totalWeight;snowWeight /= totalWeight;rockWeight /= totalWeight;

I have played about with the values and found that these values give the best results, although I might make the grass section end higher up.

Thanks for the help, I was confused about the weightings and first but think I've got a handle on it now.

1. 1
2. 2
frob
15
3. 3
Rutin
12
4. 4
5. 5

• 13
• 12
• 58
• 14
• 15
• ### Forum Statistics

• Total Topics
632124
• Total Posts
3004237

×


text:
Illustration: Alan Stonebraker

Figure 1: (Top left) Atomic arrangement in bilayer graphene, with the two main hopping parameters, $γ0$ and $γ1$, between carbon $π$ orbitals within and between layers, respectively. (Top right) Electronic bands of bilayer graphene. Single-layer graphene features Dirac cones with sharp neutrality points, whereas bilayer graphene exhibits parabolic dispersion as shown. There are two valence and conduction bands, as each layer contributes with one set of bands. (Bottom) Feynman diagrams, such as the example shown, are used to calculate the electron-hole polarizability. This diagram depicts the dynamics of an electron-hole pair, obtained from the convolution of electron (red) and hole (blue) propagators. The calculation gives gives a logarithmically divergent polarizability.


text:
# Married couple raffle question.

• March 7th 2010, 06:49 PM
Kakariki
Married couple raffle question.
Hey, I don't think I am doing this question correctly, my solutions just seem to simple.

Question:
There are 8 opposite-sex married couples at a party. Two people are chosen at random to win a door prize.
a) What is the probability that the 2 people will be married to each other?
b) What is the probability that the 2 people will be of the same sex?
c) If 6 people are chosen, what is the probability that they are 3 married couples?

Solution:
a) $n(s) = 8C2 = 120$
$n(married couples) = 8$
So, that means that it's 8/120, or 1/15.

b) $(\frac {8}{16})(\frac {7}{15})$
$= \frac {7}{30}$

c) $n(s) = 16C6 = 8008$
There are 8 married couples, so 8C3.
$\frac {56}{8008}$
$\frac {1}{143}$

I am unsure if any of these are correct, as I am not used to doing these sorts of problems with things like married couples.
• March 7th 2010, 08:41 PM
Soroban
Hello, Kakariki!

The problems are simple, but require some careful thinking.
And you did fine!

Quote:

There are 8 opposite-sex married couples at a party.
Two people are chosen at random to win a door prize.

a) What is the probability that the 2 people will be married to each other?

Solution:

$n(s) \:=\: _8C_2 \:=\: 120$

$n(\text{married couples}) \:=\: 8$

So, that means that it's: . $\frac{8}{120} \:=\:\frac{1}{15}$ . . Right!

Quote:

b) What is the probability that the 2 people will be of the same sex?
The first person can be any of the 16 people: . $\frac{16}{16} \:=\:1$

The second must be one of the other 7 people of the same sex: . $\frac{7}{15}$

Therefore: . $P(\text{same sex}) \;=\;\frac{7}{15}$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Another approach . . .

There are 120 possible outcomes.

$\text{We want: }\:\begin{Bmatrix} \text{2 men:} & _8C_2 \:=\:28\text{ ways} \\

\text{or} \\ \text{2 women: } & _8C_2\:=\:28\text{ ways} \end{Bmatrix}$

Therefore: . $P(\text{same sex}) \;=\;\frac{56}{120} \;=\;\frac{7}{15}$

Quote:

c) If 6 people are chosen, what is the probability that they are 3 married couples?

$n(s) \:=\:_{16}C_6 \:=\:8008$

There are 8 married couples, so: . $_8C_3 \:=\:56$

Therefore: . $\frac{56}{8008} \:=\:\frac{1}{143}$ . . Yes!


text:
# Failing to read tables in R

##### Posted on April 20, 2014

Badly disappointed with R by finding out that read.table() cannot read a file with a very simple structure… that Python is able to read.

## A very simple file structure

Imagine you have some data in a text file having a very simple structure like the following one:

As you can tell, we only have 5 lines each one containing 4 fields: a number, a name, a gender, and a class. Notice how the fields are separated with 2 colons ::. Here’s a question for you: How would you read this data in R?

## Some background

Before we start solving the previous question, let me tell you a bit about how I discovered this challenging problem.

It all started when I was reading the book Python for Data Analysis by Wes McKinney. Being an enthusiast useR, I naturally felt tempted to replicate in R some of the case studies described in Wes’ book, in particular the introductory case studies described in chapter 2.

One of the python examples required reading data from a text file that uses double colons (::) as a separator. For illustrating purposes I will use the made-up toy dataset already shown above:

In Python we can use the pandas library to import that kind of data without any problems. We just need to use the function read_table() and specify the separator sep='::'. But what about R?

If we try reading the data using one of the standard ways (e.g. read.table()) I’m afraid we will be terribly dissapointed:

If you prefer, you can try reading the file fakedata.dat, which has exactly the same content as the previous example, like so:

In both cases, you should get a heartbreaking error like this one:

"Error in scan(file, what = "", sep = sep, quote = quote, nlines = 1:
invalid 'sep' value: must be one byte"

### One byte separtors

If we had just one colon : as a separator, then R would not complain whatsoever:

But the problem is that we do have two colons ::, and R accepts only one byte separators. Of course, we could use readLines() to read the data as a character vector, do some transformations to get rid of the colons, and then shape the data into a data frame. In some cases this option could be acceptable. But with the type of data like the one described in Wes’s book, using readLines() was not an elegant option for me.

## My solution

The solution I found was to do the job outside of R. Yes, I know this is kind of dissapointing but it’s part of the data analysis game. Sometimes you just have go outside R to get the job done.

### Using a text editor

One solution is to use a text editor (e.g. vim, emacs, text wrangler, notepad ++, sublime text, etc). You just need to use the find-replace functionality to substitute all double colons into commas:

### Using sed

In my case I work on a mac so I decided to use sed (stream editor). The idea is the same as if you were using a text editor: to substitute all the double colons by a comma.

Here’s how: open the terminal, go to the directory where the data file is, and simply run the following command:

sed 's/::/,/g' fakedata.dat > newfakedata.txt

Alternatively, you can use the system() function within R to pass it the same command:

What we’re doing is substituting all the :: by , in the file fakedata.dat and then saving the results in a new file newfakedata.dat. If we open the new file we should be able to see nice comma-separated fields:

which is perfectly readable in R with read.table() and/or read.csv().

Published in categories how-to  Tagged with file  read  data


text:
# Math Help - Help with implicit differentiation

1. ## Help with implicit differentiation

Hi there, I need help with the following problem:

For the curve (x^2/25) - (y^2/36) = -1, find the equation of the tangent at the given point: (5√3, -12)

I get stuck by the fractions here- any help finding the derivative and solving would be greatly appreciated Thank you!

2. $\frac{x^{2}}{25}-\frac{y^{2}}{36}=-1$

Differentiate:

$\frac{2}{25}x-\frac{1}{18}y\frac{dy}{dx}=0$

Solve for dy/dx:

$\frac{dy}{dx}=\frac{36x}{25y}$

Now, enter in your values and find the slope at that point. Then you can use

y=mx+b.


text:
The LISMOD Model and Submodels

As a statistical model, the LISMOD modeling language is derived from the LISREL model proposed by Jöreskog and others (see Keesling 1972; Wiley 1973; Jöreskog 1973). But as a computer language, the LISMOD modeling language is quite different from the LISREL program. To maintain the consistence of specification syntax within the CALIS procedure, the LISMOD modeling language departs from the original LISREL programming language. In addition, to make the programming a little easier, some terminological changes from LISREL are made in LISMOD.

For brevity, models specified by the LISMOD modeling language are called LISMOD models, although you can also specify these LISMOD models by other general modeling languages that are supported in PROC CALIS.

The following descriptions of LISMOD models are basically the same as those of the original LISREL models. The main modifications are the names for the model matrices.

The LISMOD model is described by three component models. The first one is the structural equation model that describes the relationships among latent constructs or factors. The other two are measurement models that relate latent factors to manifest variables.

Structural Equation Model

The structural equation model for latent factors is

where: is a random vector of endogenous latent factors is a random vector of exogenous latent factors is a random vector of errors is a vector of intercepts is a matrix of regression coefficients of variables on other variables is a matrix of regression coefficients of on

There are some assumptions in the structural equation model. To prevent a random variable in from regressing directly on itself, the diagonal elements of are assumed to be zeros. Also, is assumed to be nonsingular, and is uncorrelated with .

The covariance matrix of is denoted by and its expected value is a null vector. The covariance matrix of is denoted by and its expected value is denoted by .

Because variables in the structural equation model are not observed, to analyze the model these latent variables must somehow relate to the manifest variables. The measurement models, which are discussed in the subsequent sections, provide such relations.

Measurement Model for

where: is a random vector of manifest variables is a random vector of errors for is a vector of intercepts for is a matrix of regression coefficients of on

It is assumed that is uncorrelated with either or . The covariance matrix of is denoted by and its expected value is the null vector.

Measurement Model for

where: is a random vector of manifest variables is a random vector of errors for is a vector of intercepts for is a matrix of regression coefficients of on

It is assumed that is uncorrelated with , , or . The covariance matrix of is denoted by and its expected value is a null vector.

Covariance and Mean Structures

Under the structural and measurement equations and the model assumptions, the covariance structures of the manifest variables are expressed as

The mean structures of the manifest variables are expressed as

Model Matrices in the LISMOD Model

The parameters of the LISMOD model are elements in the model matrices, which are summarized as follows.

Matrix

Name

Description

Dimensions

Row Variables

Column Variables

_ALPHA_

Intercepts for

(ETAVAR=)

N/A

_BETA_

Effects of on

(ETAVAR=)

(ETAVAR=)

_GAMMA_

Effects of on

(ETAVAR=)

(XIVAR=)

_PSI_

Error covariance matrix for

(ETAVAR=)

(ETAVAR=)

_PHI_

Covariance matrix for

(XIVAR=)

(XIVAR=)

_KAPPA_

Mean vector for

(XIVAR=)

N/A

_NUY_

Intercepts for

(YVAR=)

N/A

_LAMBDAY_

Effects of on

(YVAR=)

(ETAVAR=)

_THETAY_

Error covariance matrix for

(YVAR=)

(YVAR=)

_NUX_

Intercepts for

(XVAR=)

N/A

_LAMBDAX_

Effects of on

(XVAR=)

(XIVAR=)

_THETAX_

Error covariance matrix for

(XVAR=)

(XVAR=)

There are twelve model matrices in the LISMOD model. Not all of them are used in all situations. See the section LISMOD Submodels for details. In the preceding table, each model matrix is given a name in the column Name, followed by a brief description of the parameters in the matrix, the dimensions, and the row and column variables being referred to. In the second column of the table, the LISMOD matrix names are used in the MATRIX statements when specifying the LISMOD model. In the last two columns of the table, following the row or column variables is the variable list (for example, ETAVAR=, YVAR=, and so on) in parentheses. These lists are used in the LISMOD statement for defining variables.

Specification of the LISMOD Model

The LISMOD specification consists of two tasks. The first task is to define the variables in the model. The second task is to specify the parameters in the LISMOD model matrices.

Specifying Variables

The first task is accomplished in the LISMOD statement. In the LISMOD statement, you define the lists of variables of interest: YVAR=, XVAR=, ETAVAR=, and XIVAR= lists, respectively for the -variables, -variables, -variables, and the -variables. While you provide the names of variables in these lists, you also define implicitly the numbers of four types of variables: , , , and . The variables in the YVAR= and XVAR= lists are manifest variables and therefore must be present in the analyzed data set. The variables in the ETAVAR= and XIVAR= lists are latent factors, the names of which are assigned by the researcher to represent their roles in the substantive theory. After these lists are defined, the dimensions of the model matrices are also defined by the number of variables on various lists. In addition, the variable orders in the lists are referred to by the row and column variables of the model matrices.

Unlike the LINEQS model, in the LISMOD model you do not need to use the 'F' or 'f' prefix to denote factors in the ETAVAR= or XIVAR= list. You can use any valid SAS variable names for the factors, especially those names that reflect the nature of the factors. To avoid confusion with other names in the model, some general rules are recommended. See the section Naming Variables and Parameters for these general rules about naming variables and parameters.

Specifying Parameters in Model Matrices

The second task is accomplished by the MATRIX statements. In each MATRIX statement, you specify the model matrix by using the matrix names described in the previous table. Then you specify the parameters (free or fixed) in the locations of the model matrix. You can use as many MATRIX statements as needed for defining your model. But each model matrix can be specified only in one MATRIX statement, and each MATRIX statement is used for specifying only one model matrix.

An Example

In the section LISMOD Model, the LISMOD modeling language is used to specify the model described in the section A Structural Equation Example. In the LISMOD statement, you define four lists of variables, as shown in the following statement:

lismod
yvar  = Anomie67 Powerless67 Anomie71 Powerless71,
xvar  = Education SEI,
etav  = Alien67 Alien71,
xivar = SES;

Endogenous latent factors are specified in the ETAVAR= list. Exogenous latent factors are specified in the XIVAR= list. In this case, Alien67 and Alien71 are the -variables, and SES is the only -variable in the model. Manifest variables that are indicators of endogenous latent factors in are specified in the YVAR= list. In this case, they are the Anomie and Powerless variables, measured at two different time points. Manifest variables that are indicators of exogenous latent factors in are specified in the XVAR= list. In this case, they are the Education and the SEI variables. Implicitly, the dimensions of the model matrices are defined by these lists already; that is, , , , and .

The MATRIX statements are used to specify parameters in the model matrices. For example, in the following statement you define the _LAMBDAX_ () matrix with two nonzero entries:

matrix _LAMBDAX_ [1,1] = 1.0,
[2,1] = lambda;

The first parameter location is for [1,1], which is the effect of SES (the first variable in the XIVAR= list) on Education (the first element in the XVAR= list). A fixed value of 1.0 is specified there. The second parameter location is for [2,1], which is the effect of SES (the first variable in the XIVAR= list) on SEI (the second variable in the XVAR= list). A parameter named lambda without an initial value is specified there.

Another example is shown as follows:

matrix _THETAY_  [1,1] = theta1,
[2,2] = theta2,
[3,3] = theta1,
[4,4] = theta2,
[3,1] = theta5,
[4,2] = theta5;

In this MATRIX statement, the error variances and covariances (that is, the matrix) for the -variables are specified. The diagonal elements of the _THETAY_ matrix are specified by parameters theta1, theta2, theta1, and theta2, respectively, for the four -variables Anomie67, Powerless67, Anomie71, and Powerless71. By using the same parameter name theta1, the error variances for Anomie67 and Anomie71 are implicitly constrained. Similarly, the error variances for Powerless67 and Powerless71 are also implicitly constrained. Two more parameter locations are specified. The error covariance between Anomie67 and Anomie71 and the error covariance between Powerless67 and Powerless71 are both represented by the parameter theta5. Again, this is an implicit constraint on the covariances. All other unspecified elements in the _THETAY_ matrix are treated as fixed zeros.

In this example, no parameters are specified for matrices _ALPHA_, _KAPPA_, _NUY_, or _NUX_. Therefore, mean structures are not modeled.

LISMOD Submodels

It is not necessary to specify all four lists of variables in the LISMOD statement. When some lists are unspecified in the LISMOD statement, PROC CALIS analyzes submodels derived logically from the specified lists of variables. For example, if only - and -variable lists are specified, the submodel being analyzed would be a multivariate regression model with manifest variables only. Not all combinations of lists lead to meaningful submodels, however. To determine whether and how a submodel (which is formed by a certain combination of variable lists) can be analyzed, the following three principles in the LISMOD modeling language are applied:

• Submodels with at least one of the YVAR= and XVAR= lists are required.

• Submodels that have an ETAVAR= list but no YVAR= list cannot be analyzed.

• When a submodel has a YVAR= (or an XVAR=) list but without an ETAVAR= (or a XIVAR=) list, it is assumed that the set of -variables (-variables) is equivalent to the -variables (-variables). Hereafter, this principle is referred to as an equivalence interpretation.

Apparently, the third principle is the same as the situation where the latent factors (or ) are perfectly measured by the manifest variables (or ). That is, in such a perfect measurement model, () is an identity matrix and () and () are both null. This can be referred to as a perfect measurement interpretation. However, the equivalence interpretation stated in the last principle presumes that there are actually no measurement equations at all. This is important because under the equivalence interpretation, matrices (), () and () are nonexistent rather than fixed quantities, which is assumed under the perfect measurement interpretation. Hence, the -variables are treated as exogenous variables with the equivalence interpretation, but they are still treated as endogenous with the perfect measurement interpretation. Ultimately, whether -variables are treated as exogenous or endogenous affects the default or automatic parameterization. See the section Default Parameters for more details.

By using these three principles, the models and submodels that PROC CALIS analyzes are summarized in the following table, followed by detailed descriptions of these models and submodels.

Presence of Lists

Description

Model Equations

Nonfixed Model Matrices

Presence of Both - and -variables

1

YVAR=, ETAVAR=,

Full model

,,

XVAR=, XIVAR=

,,,,

,,,

2

YVAR=,

Full model with

,,,,

XVAR=, XIVAR=

,,,

3

YVAR=, ETAVAR=,

Full model with

,,

XVAR=

,,,,,

4

YVAR=,

Regression

, or

,,,,,

XVAR=

()

()

Presence of -variables and Absence of -variables

5

XVAR=, XIVAR=

Factor model

,,,,

for

6

XVAR=

-structures

,

()

Presence of -variables and Absence of -variables

7

YVAR=, ETAVAR=

Factor model

,,

for

,,

8

YVAR=

-structures

, or

,,

()

9

YVAR=, ETAVAR=,

Second-order

,,

XIVAR=

factor model

,,,,,

10

YVAR=,

Factor model

, or

,,,,,

XIVAR=

()

Models 1, 2, 3, and 4—Presence of Both - and -Variables

Submodels 1, 2, 3, and 4 are characterized by the presence of both - and -variables in the model. In fact, Model 1 is the full model with the presence of all four types of variables. All twelve model matrices are parameter matrices in this model.

Depending on the absence of the latent factor lists, manifest variables can replace the role of the latent factors in Models 2–4. For example, the absence of the ETAVAR= list in Model 2 means is equivalent to (). Consequently, you cannot, nor do you need to, use the MATRIX statement to specify parameters in the _LAMBDAY_, _THETAY_, or _NUY_ matrices under this model. Similarly, because is equivalent to () in Model 3, you cannot, nor do you need to, use the MATRIX statement to specify the parameters in the _LAMBDAX_, _THETAX_, or _NUX_ matrices. In Model 4, is equivalent to () and is equivalent to (). None of the six model matrices in the measurement equations are defined in the model. Matrices in which you can specify parameters by using the MATRIX statement are listed in the last column of the table.

Describing Model 4 as a regression model is a simplification. Because can regress on itself in the model equation, the regression description is not totally accurate for Model 4. Nonetheless, if is a null matrix, the equation describes a multivariate regression model with outcome variables and predictor variables . This model is the TYPE 2A model in LISREL VI (Jöreskog and Sörbom, 1985).

You should also be aware of the changes in meaning of the model matrices when there is an equivalence between latent factors and manifest variables. For example, in Model 4 the and are now the covariance matrix and mean vector, respectively, of manifest variables , while in Model 1 (the complete model) these matrices are of the latent factors .

Models 5 and 6 — Presence of -Variables and Absence of -Variables

Models 5 and 6 are characterized by the presence of the -variables and the absence of -variables.

Model 5 is simply a factor model for measured variables , with representing the factor loading matrix, the error covariance matrix, and the factor covariance matrix. If mean structures are modeled, represents the factor means and is the intercept vector. This is the TYPE 1 submodel in LISREL VI (Jöreskog and Sörbom, 1985).

Model 6 is a special case where there is no model equation. You specify the mean and covariance structures (in and , respectively) for the manifest variables directly. The -variables are treated as exogenous variables in this case. Because this submodel uses direct mean and covariance structures for measured variables, it can also be handled more easily by the MSTRUCT modeling language. See the MSTRUCT statement and the section The MSTRUCT Model for more details.

Note that because -variables cannot exist in the absence of -variables (see one of the three aforementioned principles for deriving submodels), adding the ETAVAR= list alone to these two submodels does not generate new submodels that can be analyzed by PROC CALIS.

Models 7, 8 ,9 and 10—Presence of -Variables and Absence of -Variables

Models 7–10 are characterized by the presence of the -variables and the absence of -variables.

Model 7 is a factor model for -variables (TYPE 3B submodel in LISREL VI). It is similar to Model 5, but with regressions among latent factors allowed. When is null, Model 7 functions the same as Model 5. It becomes a factor model for -variables, with representing the factor loading matrix, the error covariance matrix, the factor covariance matrix, the factor means, and the intercept vector.

Model 8 (TYPE 2B submodel in LISREL VI) is a model for studying the mean and covariance structures of -variables, with regression among -variables allowed. When is null, the mean structures of are specified in and the covariance structures are specified in . This is similar to Model 6. However, there is an important distinction. In Model 6, the -variables are treated as exogenous (no model equation at all). But the -variables are treated as endogenous in Model 8 (with or without ). Consequently, the default parameterization would be different for these two submodels. See the section Default Parameters for details about the default parameterization.

Model 9 represents a modified version of the second-order factor model for . It would be a standard second-order factor model when is null. This is the TYPE 3A submodel in LISREL VI. With being null, represents the first-order factors and represents the second-order factors. The first- and second-order factor loading matrices are and , respectively.

Model 10 is another form of factor model when is null, with factors represented by and manifest variables represented by . However, if is indeed a null matrix in applications, you might want to use Model 5, in which the factor model specification is more direct and intuitive.

Default Parameters in the LISMOD Model

When a model matrix is defined in a LISMOD model, you can specify fixed values or free parameters for the elements of the matrix by the MATRIX statement. All other unspecified elements in the matrix are set by default. There are two types of default parameters for the LISMOD model matrices: one is free parameters; the other is fixed zeros.

The following sets of parameters are free parameters by default:

• the diagonal elements of the _THETAX_, _THETAY_, and _PSI_ matrices; these elements represent the error variances in the model

• all elements of the _PHI_ matrix; these elements represent the variances and covariance among exogenous variables in the model

• all elements in the _NUX_ and _NUY_ vectors if the mean structures are modeled; these elements represent the intercepts of the observed variables

• all elements in the _ALPHA_ vector if a YVAR= list is specified but an ETAVAR= list is not specified and the mean structures are modeled; these elements represent the intercepts of the -variables

• all elements in the _KAPPA_ vector if an XVAR= list is specified but an XIVAR= list is not specified and the mean structures are modeled; these elements represent the means of the -variables

PROC CALIS names the default free parameters with the _Add prefix and a unique integer suffix. You can override the default free parameters by explicitly specifying them as free, constrained, or fixed parameter in the MATRIX statements for the matrices.

Parameters that are not default free parameters in the LISMOD model are fixed zeros by default. You can override almost all of these default fixed zeros of the LISMOD model by using the MATRIX statements for the matrices. The only set of default fixed zeros that you cannot override is the set of the diagonal elements of the _BETA_ matrix. These fixed zeros reflect a model restriction that precludes variables from having direct effects on themselves.


text:
# What would it cost to bring a 1 gram payload to the CMBR rest frame (i.e. Δv 368 km/s ?)

Suppose we wanted to do a very small experiment in (or very close to) the Cosmic Microwave Background Radiation rest frame, which we are travelling at 368 ± 2 km/s relative to. Without considering the complexity of measuring and transmitting the results back home, how would we get a 1 gram payload to such a high delta-v in the first place? What would it cost?

Is there a way to naively extrapolate costs based on required delta-v?

• 368km/s is far beyond our current capabilities, even using ion engines or other in-development high efficiency engines. So assigning a monetary value to it will be fairly meaningless, but maybe still a fun exercise! – Jack Aug 25 '18 at 7:30
• It can't be done by rocket engines currently. You can exercize yourself using Rocket equation en.wikipedia.org/wiki/Tsiolkovsky_rocket_equation. Note that main problem is we can't reach high enouth exhaus velocity, even with ion engines. I guess maybe some magnetic levitatgion loop in vacuum theoretically could... – Heopps Aug 25 '18 at 7:52
• @Jack I think you are overstating the hopelessness/meaninglessness situation. While it's not something you can order out of a catalog yet, there should be enough work on practical realizations of solar sails to make a guesstimate. See How will The Planetary Society's LightSail 2 Spacecraft's retroreflectors be used? It is also possible to estimate how thin the sail would be to reach this speed (about 0.1% c) based on this answer. – uhoh Aug 25 '18 at 8:27
• @Jack This speed is way way lower than the speeds considered by the Breakthrough Starshot project, so if done with a laser instead of sunlight, it wouldn't need anything near as big as Breakthrough Starshot's 100 Gigawatt laser array - what's the current thinking how this might work? – uhoh Aug 25 '18 at 8:29
• @uhoh Agreed, but these technologies are still in development so extrapolating beyond the very small data set of tested prototypes and giving a monetary value would be speculative, I believe. I'm writing an answer for conventional engines, you could write one covering the techs you mentioned? – Jack Aug 25 '18 at 8:44

With current technologies, this is unfortunately well outside our reach. However, there is promise on the horizon!

Chemical Engines

The Tsiolkovsky equation is always your friend when calculating Δv for conventional engines (or your enemy, depending how you look at it!):

$$\Delta v = I_{sp} \times g \times \ln \frac {Mass_{full}} {Mass_{dry}}$$

Rearranging to solve for fuel ratio gives us:

$$Ratio = \frac {Mass_{full}} {Mass_{dry}} = e^{\frac{\Delta v}{I_{sp} \times g}}$$

It's that exponential that causes us problems. Even if we use one of the most efficient chemical engines in history, the Space Shuttle Main Engine ($I_{sp}$ ~ 452s), ignore its mass and ignore the mass of all the tanks/plumbing/other structure, we get a lower-bound of $Mass_{full}\approx10^{33}$kg or 1000 times the mass of the Sun. When we include all the required structure to hold all this fuel, this gets even worse!

We could cut this number significantly by making use of staging, but it's clearly not going to give us anything possible, let alone affordable. So we have to go for higher efficiency.

High-efficiency engines

If we use one of the highest efficiency engines flown, Dawn's ion thruster ($I_{sp}$ ~ 3100s), and include the mass of the engine and tanks (8.2kg engine, tanks based on square-cube from 450kg fuel : 19kg tanks), we get $Mass_{full}\approx 5\times10^{14}$kg - still totally unfeasible.

But we can do better.

ESA's in-development Dual-stage Gridded Ion Thruster (DS4G) has been calculated as achieving an $I_{sp}$ of around 20000s.

Swapping Dawn's ion propulsion ion engine for one of the same mass with an $I_{sp}$ of 20000s will get us an enormous 82km/s! If we add more fuel and scale the tank's mass accordingly, we can achieve our 368km/s with a total craft mass of ~6000kg - totally achievable!

Dawn cost around \$450m, so I'd speculate a very rough conservative cost of \$1b for building and launching our hypothetical craft. Economy of scale saves us money on the larger mass and the launch costs won't be significantly more. This obviously ignores any costs from developing the dual-stage technology which would be very difficult to estimate.

Other technologies

We can see that whatever we try, the rocket equation is always going to bite us at some point, so why don't we try something that doesn't require propellant?

Breakthrough Starshot is a proof-of-concept technology that can supposedly achieve speed far in excess of our 368km/s - on the order of 0.1c! It uses Gigawatt (read: peak power draw comparable to large countries) ground-based lasers to propel tiny crafts with extremely high acceleration.

This kind of propulsion would be ideal for your proposal - the craft would reach the required speed in a very short time, minimising corrections needed for gravitational influences and negating the need for large transmission systems.

The kind of infrastructure infrastructure would clearly be incredibly expensive - probably on the magnitude of the infrastructure budget of whole countries - \$100b - \$1t.

However, Breakthrough Starshot is relying on the costs of components dropping significantly and efficiencies increasing as the technologies progress. Some estimates give a single mission cost of $5-10b in 2036, with speculative drops in cost. Again, this doesn't account for the cost of research and development. Note - I've tried to make some speculation and estimates on the costs involved, but they should all be taken with a pinch of salt. Also, since the 1g payload is unspecified, I'm assuming it can be modified to suit the requirements of the craft • Assuming everything is in orbit already (having used staging and an extreme amount of launches to assemble in orbit), using the STS main engine, and a 10% tank weight (that's nominal, right?), how much fuel to get to Δv 368 km/sec? And how many Saturn Vs (or today's equivalent; w\e is better) would it take to put all that fuel into orbit? – Mazura Aug 25 '18 at 15:56 • @Mazura significantly more than$10^{33}$kg which is the lower bound for the fuel mass assuming a massless engine and massless tank! If you give them both masses, the fuel requirements get even larger. If we just include the mass of the engine (3500kg) and ignore the tank, the required fuel already jumps to$10^{39}\$kg! See here – Jack Aug 25 '18 at 17:21
• Only 368 km/s? I thought that was just in range of Ole Boom Boom. They got as far as building and launching a test vehicle. – Joshua Aug 26 '18 at 4:11
• I suspect a powered gravitational slingshot maneuver around the Sun could do it. The top speed of the Parker Solar Probe will be 200 km/s, probably it wouldn't be very hard to tune it to 368 km/s and into the correct orbital plane. – peterh says reinstate Monica Aug 26 '18 at 18:42
• This simple form of the Tsiolkovsky equation can cause trouble that you allude to: "When we include all the required structure to hold all this fuel, this gets even worse!" I see you've wisely deleted reference to the square-cube law, which doesn't hold for tanks of a specified internal pressure. My answer to the question, "Is there a ∆V limit for a single-stage rocket with propellant tank mass proportional to propellant mass?" treats this. (There is a limit that cannot be exceeded!) – Tom Spilker Aug 27 '18 at 19:54

Jack did a great job describing how to do it using propulsive engines. I have a different answer:


text:
2014
02-21

# Digits on the Floor

Taro attempts to tell digits to Hanako by putting straight bars on the floor. Taro wants to express each digit by making one of the forms shown in Figure 2.

Since Taro may not have bars of desired lengths, Taro cannot always make forms exactly as shown in Figure 2. Fortunately, Hanako can recognize a form as a digit if the connection relation between bars in the form is kept. Neither the lengths of bars nor the directions of forms affect Hanako� perception as long as the connection relation remains the same. For example, Hanako can recognize all the awkward forms in Figure 3 as digits. On the other hand, Hanako cannot recognize the forms in Figure 4 as digits. For clarity, touching bars are slightly separated in Figures 2, 3 and 4. Actually, touching bars overlap exactly at one single point.

In the forms, when a bar touches another, the touching point is an end of at least one of them. That is, bars never cross. In addition, the angle of such two bars is always a right angle.

To enable Taro to represent forms with his limited set of bars, positions and lengths of bars can be changed as far as the connection relations are kept. Also, forms can be rotated. Keeping the connection relations means the following.

?Separated bars are not made to touch.

?Touching bars are not made separate.

?When one end of a bar touches another bar, that end still touches the same bar. When ittouches a midpoint of the other bar, it remains to touch a midpoint of the same bar on the same side.

?The angle of touching two bars is kept to be the same right angle (90 degrees and −90 degrees are considered different, and forms for 2 and 5 are kept distinguished). Your task is to find how many times each digit appears on the floor. The forms of some digits always contain the forms of other digits. For example, a form for 9 always contains four forms for 1, one form for 4, and two overlapping forms for 7. In this problem, ignore the forms contained in another form and count only the digit of the �argest?form composed of all mutually connecting bars. If there is one form for 9, it should be interpreted as one appearance of 9 and no appearance of 1, 4, or 7.

The input consists of a number of datasets. Each dataset is formatted as follows.

n
x1a y1a x1b y1b

x2a y2a x2b y2b

xna yna xnb xnb

In the first line, n represents the number of bars in the dataset. For the rest of the lines, one line represents one bar. Four integers xa, ya, xb, yb, delimited by single spaces, are given in each line. xa and ya are the x- and y-coordinates of one end of the bar, respectively. xb and yb are those of the other end. The coordinate system is as shown in Figure 5. You can assume 1 ≤ n ≤ 1000 and 0 ≤ xa; ya; xb; yb ≤ 1000. The end of the input is indicated by a line containing one zero.

You can also assume the following conditions.

More than two bars do not overlap at one point.

Every bar is used as a part of a digit. Non-digit forms do not exist on the floor.

A bar that makes up one digit does not touch nor cross any bar that makes up another digit.

There is no bar whose length is zero.

The input consists of a number of datasets. Each dataset is formatted as follows.

n
x1a y1a x1b y1b

x2a y2a x2b y2b

xna yna xnb xnb

In the first line, n represents the number of bars in the dataset. For the rest of the lines, one line represents one bar. Four integers xa, ya, xb, yb, delimited by single spaces, are given in each line. xa and ya are the x- and y-coordinates of one end of the bar, respectively. xb and yb are those of the other end. The coordinate system is as shown in Figure 5. You can assume 1 ≤ n ≤ 1000 and 0 ≤ xa; ya; xb; yb ≤ 1000. The end of the input is indicated by a line containing one zero.

You can also assume the following conditions.

More than two bars do not overlap at one point.

Every bar is used as a part of a digit. Non-digit forms do not exist on the floor.

A bar that makes up one digit does not touch nor cross any bar that makes up another digit.

There is no bar whose length is zero.

9
60 140 200 300
300 105 330 135
330 135 250 215
240 205 250 215
298 167 285 154
30 40 30 90
30 90 150 90
150 90 150 20
30 40 150 40
8
320 20 300 60
320 20 380 50
380 50 240 330
10 50 40 20
10 50 110 150
110 150 180 80
40 20 37 17
37 17 27 27
20
72 222 132 182
204 154 204 54
510 410 520 370
404 54 204 54
530 450 410 450
204 68 404 68
80 110 120 30
130 160 180 60
520 370 320 320
310 360 320 320
120 30 180 60
60 100 80 110
404 154 204 154
80 60 60 100
430 550 590 550
510 410 310 360
430 450 430 550
404 54 404 154
232 202 142 262
142 262 102 202
0

0 1 0 1 0 0 0 0 0 1
0 0 0 0 0 1 0 1 0 0
1 0 1 0 2 0 0 0 1 0

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <map>
#include <string>
using namespace std;
#define LL long long
#define M 1005

int a[M][M];
int equ, var;

void ini () { memset (a, 0, sizeof(a)); }

int Gauss ()
{
int i, j, k;
int col = 0;
for (k = 0; k < equ && col < var; k++, col++)
{
for (i = k+1; i < equ; i++) while (a[i][col])
{
LL tp = a[k][col] & a[i][col];
for (j = col; j <= var; j++)
{
a[k][j] = a[k][j] ^ (a[i][j]&tp);
swap (a[k][j], a[i][j]);
}
}
if (a[k][col] == 0) { k--; continue; };
}
for (i = k; i < equ; i++)
if (a[i][col] != 0)
return -1;
return var-k;
}

int p[65] = {
2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
283, 293};

int main()
{
int t, cc = 0, n, i, j, k = 62;
LL x;
scanf ("%d", &t);
while (t--)
{
scanf ("%d", &n);
ini ();
equ = k; var = n;
for (i = 0; i < n; i++)
{
scanf ("%lld", &x);
for (j = 0; j < k && x >= p[j]; j++)
{
while (x % p[j] == 0)
{
a[j][i] = !a[j][i];
x /= p[j];
}
}
}
int fn = Gauss ();
LL ans = 1;
if (fn == -1) ans = 0;
else
{
int mod = 1000000007;
while (fn--) ans = (ans<<1) % mod;
ans = (ans-1+mod) % mod;
}
printf ("Case %d: %lld\n", ++cc, ans);
}
return 0;
}

1. 学算法中的数据结构学到一定程度会乐此不疲的，比如其中的2－3树，类似的红黑树，我甚至可以自己写个逻辑文件系统结构来。

2. 我没看懂题目
2
5 6 -1 5 4 -7
7 0 6 -1 1 -6 7 -5
我觉得第一个应该是5 6 -1 5 4 输出是19 5 4
第二个是7 0 6 -1 1 -6 7输出是14 7 7
不知道题目例子是怎么得出来的

3. Gucci New Fall Arrivals

This is really nice to know. I hope it will be successful in the future. Good job on this and keep up the good work.


text:
Is $(x^2+y^2-1, z^2+w^2-1)$ a prime ideal in $\mathbb Q[x,y,z,w]$?

$$\newcommand{\Q}{\mathbb Q}$$ I saw an argument that the ideal $$I=(x^2+y^2-1, z^2+w^2-1)$$ is a prime ideal in $$\Q[x,y,z,w]$$ but I cannot see why. I tried to find a surjective homomorphism from $$\Q[x,y,z,w]$$ onto some integral domain with kernel $$I$$ but in vain. Or should I consider to show the set $$\{(x,y,z,w)\mid x^2+y^2=1,z^2+w^2=1\}\subset\Q^4$$ being irreducible?

• Hm, if we were working over an algebraically closed field $k$, we could write $\frac{k[x,y,z,w]}{(x^2+y^2-1, z^2+w^2-1)} \cong \frac{k[x,y]}{(x^2 + y^2 - 1)} \otimes_k \frac{k[z,w]}{(z^2+w^2-1)}$ and then use the fact that the product of irreducible varieties is a variety. But since $\mathbb{Q}$ is not algebraically closed, I'm not sure that will work... – André 3000 Nov 2 '18 at 14:54
• Maybe, there is a general result like this. "Let $A$ and $B$ be associative algebras over $K$ (an integral domain or a field, I don't know). If $A$ and $B$ are themselves integral domains, then $A\otimes_K B$ is also an integral domain." If there is something like that then we can use $$\mathbb{Q}[x,y,z,w]/(x^2+y^2-1,z^2+w^2-1)\cong \big(\mathbb{Q}[x,y]/(x^2+y^2-1)\big)\otimes_\mathbb{Q}\big(\mathbb{Q}[z,w]/(z^2+w^2-1)\big)$$ @André3000 suggested. Can anybody confirm or contradict the quote? – user593746 Nov 2 '18 at 17:15
• @Zvi I think your conjecture is false in that level of generality because of varieties that are irreducible, but not geometrically irreducible. Take $K = \mathbb{R}$, $A = \mathbb{R}[x,y]/(x^2 + y^2)$ and $B = \mathbb{C}$. Then $A$ and $B$ are domains, but since $x^2 + y^2 = (x + iy) (x-iy)$ factors over $\mathbb{C}$, then $A \otimes_\mathbb{R} B$ is not a domain. – André 3000 Nov 2 '18 at 19:23
It is well known that the product of geometrically irreducible varieties is again geometrically irreducible (this is equivalent to the statement that if $$A,B$$ are $$k$$-algebras for $$k$$ algebraically closed and $$A,B$$ have no zero-divisors, then $$A\otimes_k B$$ has no zero divisors). We show that $$\operatorname{Spec}\Bbb Q[x,y]/(x^2+y^2-1)$$ is geometrically irreducible.
Base changing to the algebraic closure $$\overline{\Bbb Q}$$, we get that our variety is $$\operatorname{Spec}\overline{\Bbb Q}[x,y]/(x^2+y^2-1)$$. So it suffices to show that $$x^2+y^2-1$$ is irreducible over $$\overline{\Bbb Q}$$. Up to the linear change of coordinates $$x=x+iy,y=x-iy$$, this polynomial factors as $$xy-1$$, which can quickly be shown to be irreducible (it could only factor as a product of linear polynomials, but you can see for yourself that it doesn't).


text:
## Myisha_94 Group Title simplify 3/-4i one year ago one year ago

• This Question is Open
1. __assassin__

well if you want to get rid of the i just square both top and bottom 3^2 -4^2 i^2

2. __assassin__

you should come up with 9/16(-1) = 9/-16 = - 9/16 , simplify and thats your answer

3. satellite73

hmmm

4. satellite73

it is asking you to divide, not square multiply top and bottom by $$i$$ get $\frac{3}{-4i}=\frac{3}{-4i}\times \frac{i}{i}=\frac{3i}{-4i^2}=\frac{3i}{(-4)(-1)}=\frac{3i}{4}$

5. jishan

|dw:1355150501470:dw|


text:
# ESP Biography

## DAVID GRABOVSKY, Columbia senior studying math and physics

Major: Physics, Mathematics

College/Employer: Columbia University

Not Available.

## Past Classes

(Clicking a class title will bring you to the course's section of the corresponding course catalog)

M772: All of Linear Algebra in Splash Fall 2018 (Oct. 28, 2018)
This class will be my attempt to do the entirety of an advanced undergraduate course in linear algebra in less than two hours. We will develop the theory of finite-dimensional vector spaces, starting with vectors and linear combinations and moving on to linear transformations, isomorphisms, and the change of basis. Then we'll introduce eigenvectors and eigenvalues and discuss inner products as an excuse to define linear functionals and the dual space. Finally, we will finish off with the crowning glory of linear algebra, the spectral theorem. The goal of the class is to show you a wild ride through linear algebra, and to "give away the trade secrets" of a beautiful subject.

M773: False Theorems and Fake Proofs in Splash Fall 2018 (Oct. 28, 2018)
In this introductory “math” class, we will “prove” some entirely false claims in surprisingly convincing ways. For example, we'll show that 1 is the largest natural number, but that all natural numbers are equal to zero. Come find out why the Pythagorean theorem is a lot simpler than you thought (spoiler: $$c = a+b$$), why all functions are equal to zero, and why $$1 = 2$$. (I'll offer as many proofs of this "fact" as I have time for!) The emphasis will be on making math ridiculous and funny, as well as on discovering what really makes standard methods of proof tick. Come ready to participate!

S777: Poetry for Physicists in Splash Fall 2018 (Oct. 28, 2018)
In this class, I will wax poetic on the beauty of physics by writing down an inordinate number of equations. Forgoing technical derivations in favor of physical argument, I will try to describe the glorious apparatus of modern theoretical physics, from classical mechanics to the quantum theory of fields. We will start by scrapping Newton's laws (because they're boring), and we'll spend most of the class discussing two beautiful reformulations of classical mechanics. Among our poetic vistas will be Hamilton's least-action principle, the Euler-Lagrange equations of motion, Noether's theorem relating symmetries to conservation laws, canonical conjugate momenta, Hamilton's equations of motion, Poisson brackets, and Liouville's theorem. Time permitting, we may also discuss classical field theory or symplectic geometry. At the end of class, I will try to convince you that classical and quantum physics are really the same, and that commutators, Heisenberg's uncertainty principle, and path integrals are all really part of the same poetic physical structure.

M649: All of Linear Algebra in Splash Spring 18 (Mar. 31, 2018)
This class will be my attempt to do the entirety of an advanced undergraduate course in linear algebra in less than two hours. We will develop the theory of finite-dimensional vector spaces, starting with vectors, linear combinations, and bases. We'll talk about the kernel and image of linear transformations before moving onto isomorphisms and changes of basis. We will introduce eigenvectors, discuss inner products, linear functionals, and the dual space, and finish off with self-adjoint operators and the spectral theorem. The goal of the class is to show you a wild ride through linear algebra, and to "give away the trade secrets" of a beautiful subject.

M650: False Theorems and Fake Proofs in Splash Spring 18 (Mar. 31, 2018)
In this introductory “math” class, we will “prove” some entirely false claims in surprisingly convincing ways. For example, we'll show that 1 is the largest natural number, but that all natural numbers are equal to zero. Come find out why the Pythagorean theorem is a lot simpler than you thought (spoiler: $$c = a+b$$), why all functions are equal to zero, and why $$1 = 2$$. (I'll offer as many proofs of this "fact" as I have time for!) The emphasis will be on making math ridiculous and funny, as well as on discovering what really makes standard methods of proof tick. Come ready to participate!

S652: Poetry for Physicists in Splash Spring 18 (Mar. 31, 2018)
In this class, I will wax poetic on the beauty of physics by writing down an inordinate number of equations. Forgoing technical derivations in favor of physical argument, I will try to describe the glorious apparatus of modern theoretical physics, from classical mechanics to the quantum theory of fields. We will start by scrapping Newton's laws and postulating a principle of stationary action to govern the dynamics of classical particles. After writing down the Euler-Lagrange equations of motion, we will discuss the truly poetic theorem of Noether relating symmetries to conservation laws. We will then rewrite mechanics in the Hamiltonian formalism and pause to discuss phase space. Next, we will change gears and give the basic postulates of quantum mechanics. We will solve the harmonic oscillator, and then discuss unitary dynamics in the Schrödinger and Heisenberg pictures. Having laid down our "basic" formalism, we will start the second hour by making the transition to classical field theory, where Noether's theorem reappears more powerful than ever. We will embark on the project of quantizing the free scalar field, which will turn out to satisfy the Klein-Gordon equation. Time permitting, I will also talk about interacting quantum field theories, Feynman diagrams, and the path integral formulation of QFT.

M568: All of Linear Algebra in Splash Fall 2017 (Nov. 04, 2017)
This class will be my attempt to do the entirety of an advanced undergraduate course in linear algebra in less than two hours. We will develop the theory of finite-dimensional vector spaces, starting with vectors, linear combinations, and bases. We'll talk about the kernel and image of linear transformations before moving onto isomorphisms and changes of basis. We will introduce eigenvectors, discuss inner products, linear functionals, and the dual space, and finish off with the self-adjoint operators and the spectral theorem. The goal of the class is to show you a wild ride through linear algebra, and to "give away the trade secrets" of a beautiful subject. After this class, consider taking my "All of Quantum Mechanics" sequence for a spectacular application of the ideas developed in this class.

M576: False Theorems and Fake Proofs in Splash Fall 2017 (Nov. 04, 2017)
In this introductory “math” class, we will “prove” some entirely false results in surprisingly convincing ways. For example, we'll show that 1 is the largest natural number, but that all natural numbers are equal to zero. Come find out why the Pythagorean theorem is a lot simpler than you thought (spoiler: $$c = a+b$$), how all functions integrate to zero, and as many proofs that $$1 = 2$$ as I have time for. The emphasis will be as much on making math hilarious as on introducing the methods of “proof” that make these results tick—and why they’re wrong. After this class, consider taking Theo's "Things you Think should be False but Aren't" for some more serious examples of the counterintuitive element in mathematics.

S581: All of Quantum Mechanics (Part I) in Splash Fall 2017 (Nov. 04, 2017)
Part I of an intense introduction to one of the most ridiculous and ridiculously beautiful physical theories ever invented. We will cover Hilbert space and quantum states, Dirac's bra-ket notation, observables and hermitian operators, quantum measurement and collapse, the spectral theorem, probabilities and the Born rule, and commuting observables. We will conclude with the Stern-Gerlach experiment as a stunning demonstration of the quantum formalism.

S582: All of Quantum Mechanics (Part II) in Splash Fall 2017 (Nov. 04, 2017)
Part II of an intense introduction to one of the most ridiculous and ridiculously beautiful physical theories ever invented. We will start with the double-slit experiment, cover quantum wavefunctions, position and momentum eigenstates, the canonical commutator identity, and conclude with a derivation of the Schrodinger equation. This class is not to be taken without first taking Part I of this sequence! After this class, consider taking Ben Church's and Ryan Abbott's "Relativistic Quantum Theory" for a serious introduction to relativity of quantum mechanics.

M501: False Theorems and Fake Proofs in Splash Spring 2017 (Mar. 25, 2017)
In this introductory “math” class, we will “prove” some entirely false results in surprisingly convincing ways. For example, we’ll show that 1 is the largest natural number, that it’s actually equal to both -1 and 2, and that all natural numbers are a whole lot less than a million. Come find out why the Pythagorean theorem is a lot simpler than you thought (spoiler: $$c = a+b$$), why all infinite sets are the same, and more. The emphasis will be as much on making math hilarious as on introducing the methods of “proof” that make these results tick—and why they’re wrong.

M502: All of Linear Algebra in Splash Spring 2017 (Mar. 25, 2017)
This class will be my attempt to do the entirety of an undergraduate course in linear algebra in less than an hour. We will rapidly develop the theory of finite-dimensional vector spaces, starting with vectors and the notions of linear combination, basis, and dimension. Moving on to linear transformations, we will discuss the kernel, image, rank, and nullity of linear maps before diving into determinants and invertibility. From there, we’ll talk about change of basis, introduce eigenvectors, and finish off with self-adjoint operators and the mathematical fireworks of the spectral theorem. The goal of the class is to introduce a new way of thinking about mathematical structures, and to show you a wild ride through a beautiful subject.

M503: Groups and Representations in Splash Spring 2017 (Mar. 25, 2017)
Group theory and linear algebra are two of the most stunningly beautiful areas of mathematics, and representation theory is what happens when you put them together. In this class, we will start by introducing groups and some cool stuff you can do with them (e.g. homomorphisms, group actions, etc.) before moving to vector spaces and discussing invariant subspaces and maps. We'll define representations, talk briefly about irreducibility, and then prove the cute but powerful lemma of Schur. If there's time, we can then move on to direct sums and discuss the decomposition of representations into irreducible pieces.

S413: Quantum Mechanics I: A Mathematical Perspective in Splash Fall 2016 (Nov. 05, 2016)
In this class, we will attempt to build quantum mechanics up from the ground. We start with the mathematical formalism that describes wave functions, the strange inhabitants of an infinite-dimensional world known as the Hilbert space $$L^2$$, as well as a special class of the linear operators that roam this space. We will go on to discuss the physical meaning of this formalism, along the way exploring probability and the measurement problem. And for the grand finale, we will prove Heisenberg's uncertainty principle and show, using the spectral theorem, that no two incompatible observables admit a simultaneous eigenbasis. While this class is not for the faint of heart and relies on some pretty powerful mathematical machinery, it does not assume any previous experience with quantum mechanics, or even physics for that matter. We have a lot to cover and will be moving fast, but I hope you will enjoy the ride! This class is the first in a two-part sequence of quantum mechanics. The second class approaches quantum mechanics from a completely different perspective and covers completely different material focused on the Schrödinger equation, its origins, solutions, and limitations. Students are encouraged to take both classes, but each one is self-contained and can be taken independently.

S414: Quantum Mechanics II: A Physical Perspective in Splash Fall 2016 (Nov. 05, 2016)
In this class, we will attempt to invent quantum mechanics. We begin with empty space, governed classically by Maxwell's equations. We will derive the wave equation and start shooting electromagnetic plane waves at a conducting surface, discovering (with Einstein's help) the photoelectric effect. On a whim, we will reformulate the wave equation in terms of its energy and momentum; by considering a massive particle from this perspective, we will find ourselves face to face with the Schrödinger equation. For the rest of the class, we will discuss some consequences, solutions, and limitations of the equation. As a grand finale—time permitting—we will break free of Schrödinger's non-relativistic limit and discover the Klein-Gordon equation, which describes all relativistic spinless particles. This class is certainly not for the faint of heart, and relies on powerful mathematical machinery in addition to a considerable amount of classical physics. We have a lot to cover and will be moving fast, but I hope you will enjoy the ride! This class is the second in a two-part sequence of quantum mechanics. The first class approaches quantum mechanics from a completely different perspective and covers completely different material focused on the mathematical formalism governing quantum mechanics. Students are encouraged to take both classes, but each one is self-contained and can be taken independently.

M312: How to Break Math in Splash Splash Fall 2015 (Nov. 14, 2015)
You read the title correctly. In this fast-paced mathematical adventure, we will start by destroying the notions of truth and self-consistency in mathematical systems through Russell's Paradox and Gödel's Incompleteness Theorems. Next, we will do away with counting and size by measuring infinities against each other. Finally, we will gather what's left of mathematics just to demolish it, ending class with an astounding proof that a single ball can turn into two. Needless to say, this class is not for the faint of heart. There is a good bit of mathematical abstraction, but if you are willing to join me in deconstructing the foundations of everything we know, I think you will enjoy the ride and perhaps get a glimpse of the true beauty of mathematics.