GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 18 Aug 2018, 03:58

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# Inequalities trick

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics
Author Message
TAGS:

### Hide Tags

CEO
Status: Nothing comes easy: neither do I want.
Joined: 12 Oct 2009
Posts: 2653
Location: Malaysia
Concentration: Technology, Entrepreneurship
Schools: ISB '15 (M)
GMAT 1: 670 Q49 V31
GMAT 2: 710 Q50 V35

### Show Tags

Updated on: 26 Apr 2018, 03:34
128
283
I learnt this trick while I was in school and yesterday while solving one question I recalled.
Its good if you guys use it 1-2 times to get used to it.

Suppose you have the inequality

$$f(x) = (x-a)(x-b)(x-c)(x-d) < 0$$

Just arrange them in order as shown in the picture and draw curve starting from + from right.

now if f(x) < 0 consider curve having "-" inside and if f(x) > 0 consider curve having "+" and combined solution will be the final solution. I m sure I have recalled it fully but if you guys find any issue on that do let me know, this is very helpful.

Don't forget to arrange then in ascending order from left to right. $$a<b<c<d$$

So for f(x) < 0 consider "-" curves and the ans is: $$(a < x < b)$$, $$(c < x < d)$$
and for f(x) > 0 consider "+" curves and the ans is: $$(x < a)$$, $$(b < x < c)$$, $$(d < x)$$

If f(x) has three factors then the graph will have - + - +
If f(x) has four factors then the graph will have + - + - +

If you can not figure out how and why, just remember it.
Try to analyze that the function will have number of roots = number of factors and every time the graph will touch the x axis.

For the highest factor d if x>d then the whole f(x) > 0 and after every interval of the roots the signs will change alternatively.

Attachment:

1.jpg [ 6.73 KiB | Viewed 64801 times ]

Attachment:

Untitled.png [ 12.08 KiB | Viewed 4936 times ]

_________________

Fight for your dreams :For all those who fear from Verbal- lets give it a fight

Money Saved is the Money Earned

Jo Bole So Nihaal , Sat Shri Akaal

Support GMAT Club by putting a GMAT Club badge on your blog/Facebook

GMAT Club Premium Membership - big benefits and savings

Gmat test review :
http://gmatclub.com/forum/670-to-710-a-long-journey-without-destination-still-happy-141642.html

Originally posted by gurpreetsingh on 16 Mar 2010, 10:11.
Last edited by Bunuel on 26 Apr 2018, 03:34, edited 1 time in total.
Edited.
Senior Manager
Status: Upset about the verbal score - SC, CR and RC are going to be my friend
Joined: 30 Jun 2010
Posts: 301
Re: Inequalities trick  [#permalink]

### Show Tags

17 Oct 2010, 16:14
gurpreetsingh wrote:
I learnt this trick while I was in school and yesterday while solving one question I recalled.
Its good if you guys use it 1-2 times to get used to it.

So for f(x) < 0 consider "-" curves and the ans is : (a < x < b) , (c < x < d)
and for f(x) < 0 consider "+" curves and the ans is : (x < a), (b < x < c) , (d < x)

I don't understand this part alone. Can you please explain?
_________________

My gmat story
MGMAT1 - 630 Q44V32
MGMAT2 - 650 Q41V38
MGMAT3 - 680 Q44V37
GMATPrep1 - 660 Q49V31
Knewton1 - 550 Q40V27

CEO
Status: Nothing comes easy: neither do I want.
Joined: 12 Oct 2009
Posts: 2653
Location: Malaysia
Concentration: Technology, Entrepreneurship
Schools: ISB '15 (M)
GMAT 1: 670 Q49 V31
GMAT 2: 710 Q50 V35
Re: Inequalities trick  [#permalink]

### Show Tags

17 Oct 2010, 17:19
Dreamy wrote:
gurpreetsingh wrote:
I learnt this trick while I was in school and yesterday while solving one question I recalled.
Its good if you guys use it 1-2 times to get used to it.

So for f(x) < 0 consider "-" curves and the ans is : (a < x < b) , (c < x < d)
and for f(x) < 0 consider "+" curves and the ans is : (x < a), (b < x < c) , (d < x)

I don't understand this part alone. Can you please explain?

Suppose you have the inequality

f(x) = (x-a)(x-b)(x-c)(x-d) < 0 you will consider the curve with -ve inside it.. check the attached image.

f(x) = (x-a)(x-b)(x-c)(x-d) > 0 consider the +ve of the curve
_________________

Fight for your dreams :For all those who fear from Verbal- lets give it a fight

Money Saved is the Money Earned

Jo Bole So Nihaal , Sat Shri Akaal

Support GMAT Club by putting a GMAT Club badge on your blog/Facebook

GMAT Club Premium Membership - big benefits and savings

Gmat test review :
http://gmatclub.com/forum/670-to-710-a-long-journey-without-destination-still-happy-141642.html

Veritas Prep GMAT Instructor
Joined: 16 Oct 2010
Posts: 8188
Location: Pune, India
Re: Inequalities trick  [#permalink]

### Show Tags

22 Oct 2010, 06:33
85
107
Yes, this is a neat little way to work with inequalities where factors are multiplied or divided. And, it has a solid reasoning behind it which I will just explain.

If (x-a)(x-b)(x-c)(x-d) < 0, we can draw the points a, b, c and d on the number line.
e.g. Given (x+2)(x-1)(x-7)(x-4) < 0, draw the points -2, 1, 7 and 4 on the number line as shown.

Attachment:

doc.jpg [ 7.9 KiB | Viewed 63852 times ]

This divides the number line into 5 regions. Values of x in right most region will always give you positive value of the expression. The reason for this is that if x > 7, all factors above will be positive.

When you jump to the next region between x = 4 and x = 7, value of x here give you negative value for the entire expression because now, (x - 7) will be negative since x < 7 in this region. All other factors are still positive.

When you jump to the next region on the left between x = 1 and x = 4, expression will be positive again because now two factors (x - 7) and (x - 4) are negative, but negative x negative is positive... and so on till you reach the leftmost section.

Since we are looking for values of x where the expression is < 0, here the solution will be -2 < x < 1 or 4< x < 7

It should be obvious that it will also work in cases where factors are divided.
e.g. (x - a)(x - b)/(x - c)(x - d) < 0
(x + 2)(x - 1)/(x -4)(x - 7) < 0 will have exactly the same solution as above.

Note: If, rather than < or > sign, you have <= or >=, in division, the solution will differ slightly. I will leave it for you to figure out why and how. Feel free to get back to me if you want to confirm your conclusion.
_________________

Karishma
Veritas Prep GMAT Instructor

Save up to $1,000 on GMAT prep through 8/20! Learn more here > GMAT self-study has never been more personalized or more fun. Try ORION Free! Manager Joined: 29 Sep 2008 Posts: 105 Re: Inequalities trick [#permalink] ### Show Tags 22 Oct 2010, 11:45 19 20 if = sign is included with < then <= will be there in solution like for (x+2)(x-1)(x-7)(x-4) <=0 the solution will be -2 <= x <= 1 or 4<= x <= 7 in case when factors are divided then the numerator will contain = sign like for (x + 2)(x - 1)/(x -4)(x - 7) < =0 the solution will be -2 <= x <= 1 or 4< x < 7 we cant make 4<=x<=7 as it will make the solution infinite correct me if i am wrong Manager Joined: 10 Nov 2010 Posts: 142 Re: Inequalities trick [#permalink] ### Show Tags 11 Mar 2011, 06:29 VeritasPrepKarishma wrote: vjsharma25 wrote: How you have decided on the first sign of the graph?Why it is -ve if it has three factors and +ve when four factors? Check out my post above for explanation. I understand the concept but not the starting point of the graph.How you decide about the graph to be a sine or cosine waveform?Meaning graph starts from the +ve Y-axis for four values and starts from -ve Y-axis for three values. What if the equation you mentioned is (x+2)(x-1)(x-7)<0,will the last two ranges be excluded or the graph will also change? Retired Moderator Joined: 20 Dec 2010 Posts: 1877 Re: Inequalities trick [#permalink] ### Show Tags 11 Mar 2011, 06:49 24 15 vjsharma25 wrote: VeritasPrepKarishma wrote: vjsharma25 wrote: How you have decided on the first sign of the graph?Why it is -ve if it has three factors and +ve when four factors? Check out my post above for explanation. I understand the concept but not the starting point of the graph.How you decide about the graph to be a sine or cosine waveform?Meaning graph starts from the +ve Y-axis for four values and starts from -ve Y-axis for three values. What if the equation you mentioned is (x+2)(x-1)(x-7)<0,will the last two ranges be excluded or the graph will also change? I always struggle with this as well!!! There is a trick Bunuel suggested; (x+2)(x-1)(x-7) < 0 Here the roots are; -2,1,7 Arrange them in ascending order; -2,1,7; These are three points where the wave will alternate. The ranges are; x<-2 -2<x<1 1<x<7 x>7 Take a big value of x; say 1000; you see the inequality will be positive for that. (1000+2)(1000-1)(1000-7) is +ve. Thus the last range(x>7) is on the positive side. Graph is +ve after 7. Between 1 and 7-> -ve between -2 and 1-> +ve Before -2 -> -ve Since the inequality has the less than sign; consider only the -ve side of the graph; 1<x<7 or x<-2 is the complete range of x that satisfies the inequality. _________________ Veritas Prep GMAT Instructor Joined: 16 Oct 2010 Posts: 8188 Location: Pune, India Re: Inequalities trick [#permalink] ### Show Tags 11 Mar 2011, 19:57 10 2 vjsharma25 wrote: I understand the concept but not the starting point of the graph.How you decide about the graph to be a sine or cosine waveform?Meaning graph starts from the +ve Y-axis for four values and starts from -ve Y-axis for three values. What if the equation you mentioned is (x+2)(x-1)(x-7)<0,will the last two ranges be excluded or the graph will also change? Ok, look at this expression inequality: (x+2)(x-1)(x-7) < 0 Can I say the left hand side expression will always be positive for values greater than 7? (x+2) will be positive, (x - 1) will be positive and (x-7) will also be positive... so in the rightmost regions i.e. x > 7, all three factors will be positive. The expression will be positive when x > 7, it will be negative when 1 < x < 7, positive when -2 , x < 1 and negative when x < -2. We need the region where the expression is less than 0 i.e. negative. So either 1 < x < 7 or x < -2. Now let me add another factor: (x+8)(x+2)(x-1)(x-7) Can I still say that the entire expression is positive in the rightmost region i.e. x>7 because each one of the four factors is positive? Yes. So basically, your rightmost region is always positive. You go from there and assign + and - signs to the regions. Your starting point is the rightmost region. Note: Make sure that the factors are of the form (ax - b), not (b - ax)... e.g. (x+2)(x-1)(7 - x)<0 Convert this to: (x+2)(x-1)(x-7)>0 (Multiply both sides by '-1') Now solve in the usual way. Assign '+' to the rightmost region and then alternate with '-' Since you are looking for positive value of the expression, every region where you put a '+' will be the region where the expression will be greater than 0. _________________ Karishma Veritas Prep GMAT Instructor Save up to$1,000 on GMAT prep through 8/20! Learn more here >

GMAT self-study has never been more personalized or more fun. Try ORION Free!

Manager
Joined: 06 Apr 2011
Posts: 52
Location: India
Re: Inequalities trick  [#permalink]

### Show Tags

07 Aug 2011, 07:24
gurpreetsingh wrote:
ulm wrote:
if we have smth like (x-a)^2(x-b)
we don't need to change a sign when jump over "a".

yes even powers wont contribute to the inequality sign. But be wary of the root value of x=a

This way of solving inequalities actually makes it soo much easier. Thanks gurpreetsingh and karishma

However, i am confused about how to solve inequalities such as: (x-a)^2(x-b) and also ones with root value.

could someone please explain.
_________________

Regards,
Asher

Veritas Prep GMAT Instructor
Joined: 16 Oct 2010
Posts: 8188
Location: Pune, India
Re: Inequalities trick  [#permalink]

### Show Tags

08 Aug 2011, 11:59
2
3
Asher wrote:
gurpreetsingh wrote:
ulm wrote:
if we have smth like (x-a)^2(x-b)
we don't need to change a sign when jump over "a".

yes even powers wont contribute to the inequality sign. But be wary of the root value of x=a

This way of solving inequalities actually makes it soo much easier. Thanks gurpreetsingh and karishma

However, i am confused about how to solve inequalities such as: (x-a)^2(x-b) and also ones with root value.

could someone please explain.

When you have (x-a)^2(x-b) < 0, the squared term is ignored because it is always positive and hence doesn't affect the sign of the entire left side. For the left hand side to be negative i.e. < 0, (x - b) should be negative i.e. x - b < 0 or x < b.

Similarly for (x-a)^2(x-b) > 0, x > b

As for roots, you have to keep in mind that given $$\sqrt{x}$$, x cannot be negative.

$$\sqrt{x}$$ < 10
implies 0 < $$\sqrt{x}$$ < 10
Squaring, 0 < x < 100
Root questions are specific. You have to be careful. If you have a particular question in mind, send it.
_________________

Karishma
Veritas Prep GMAT Instructor

Save up to $1,000 on GMAT prep through 8/20! Learn more here > GMAT self-study has never been more personalized or more fun. Try ORION Free! Manager Joined: 06 Apr 2011 Posts: 52 Location: India Re: Inequalities trick [#permalink] ### Show Tags 08 Aug 2011, 22:22 Quote: When you have (x-a)^2(x-b) < 0, the squared term is ignored because it is always positive and hence doesn't affect the sign of the entire left side. For the left hand side to be negative i.e. < 0, (x - b) should be negative i.e. x - b < 0 or x < b. Similarly for (x-a)^2(x-b) > 0, x > b Thanks Karishma for the explanation. Hope you wouldn't mind clarifying a few more doubts. Firstly, in the above case, since x>b could we say that everything with be positive. would the graph look something like this: positive.. b..postive.. a.. positive On the other hand if (x-a)^2(x-b) < 0, x < b, (x-a)^2 would be positive and for (x-b) if x<b the the left side would be negative. would the graph look something like this: negative.. b..postive.. a.. postive Am i right? If it is not too much of a trouble, could you please show the graphical representation. problems with \sqrt{x}.. this is all i could find (googled actually ): 1. √(-x+4) ≤ √(x) 2. x^\sqrt{x} =< (\sqrt{x})^x {P.S.: i tried to insert the graphical representation that i came up with, but i am a bit technically challenged in this area it seems} _________________ Regards, Asher Veritas Prep GMAT Instructor Joined: 16 Oct 2010 Posts: 8188 Location: Pune, India Re: Inequalities trick [#permalink] ### Show Tags 09 Aug 2011, 03:28 1 2 Asher wrote: Firstly, in the above case, since x>b could we say that everything with be positive. would the graph look something like this: positive.. b..postive.. a.. positive On the other hand if (x-a)^2(x-b) < 0, x < b, (x-a)^2 would be positive and for (x-b) if x<b the the left side would be negative. would the graph look something like this: negative.. b..postive.. a.. postive So when you have $$(x - a)^2(x - b) < 0$$, you ignore x = a and just plot x = b. It is positive in the rightmost region and negative on the left. So the graph looks like this: negative ... b ... positive Am i right? If it is not too much of a trouble, could you please show the graphical representation. problems with \sqrt{x}.. this is all i could find (googled actually ): 1. √(-x+4) ≤ √(x) 2. x^\sqrt{x} =< (\sqrt{x})^x {P.S.: i tried to insert the graphical representation that i came up with, but i am a bit technically challenged in this area it seems} Squared terms are ignored. You do not put them in the graph. They are always positive so they do not change the sign of the expression. e.g. $$(x-4)^2(x - 9)(x+11) < 0$$ We do not plot x = 4 here, only x = -11 and x = 9. We start with the rightmost section as positive. So it looks something like this: positive... -11 ... negative ... 9 ... positive Since we need the region where x is negative, we get -11 < x < 9. Basically, the squared term is like a positive number in that it doesn't affect the sign of the expression. I would be happy to solve inequalities questions related to roots but please put them in a separate post and pm the link to me. That way, everybody can try them. _________________ Karishma Veritas Prep GMAT Instructor Save up to$1,000 on GMAT prep through 8/20! Learn more here >

GMAT self-study has never been more personalized or more fun. Try ORION Free!

Intern
Joined: 14 Apr 2011
Posts: 11
Re: Inequalities trick  [#permalink]

### Show Tags

10 Aug 2011, 07:00
hey ,
can u please tel me the solution for this ques

a car dealership sells only sports cars and luxury cars and has atleast some of each type of car in stock at all times.if exactly 1/7 of sports car and 1/2 of luxury cars have sunroofs and there are exactly 42 cars on the lot.what is the smallest number of cars that could have roofs?

ans -11
Manager
Status: On...
Joined: 16 Jan 2011
Posts: 170
Re: Inequalities trick  [#permalink]

### Show Tags

10 Aug 2011, 17:01
11
24
WoW - This is a cool thread with so many thing on inequalities....I have compiled it together with some of my own ideas...It should help.

1) CORE CONCEPT
@gurpreetsingh -
Suppose you have the inequality

f(x) = (x-a)(x-b)(x-c)(x-d) < 0

Arrange the NUMBERS in ascending order from left to right. a<b<c<d
Draw curve starting from + from right.

now if f(x) < 0 consider curve having "-" inside and if f(x) > 0 consider curve having "+" and combined solution will be the final solution. I m sure I have recalled it fully but if you guys find any issue on that do let me know, this is very helpful.

So for f(x) < 0 consider "-" curves and the ans is : (a < x < b) , (c < x < d)
and for f(x) > 0 consider "+" curves and the ans is : (x < a), (b < x < c) , (d < x)

If f(x) has three factors then the graph will have - + - +
If f(x) has four factors then the graph will have + - + - +

If you can not figure out how and why, just remember it.
Try to analyze that the function will have number of roots = number of factors and every time the graph will touch the x axis.

For the highest factor d if x>d then the whole f(x) > 0 and after every interval of the roots the signs will change alternatively.

Note: Make sure that the factors are of the form (ax - b), not (b - ax)...

example -
(x+2)(x-1)(7 - x)<0

Convert this to: (x+2)(x-1)(x-7)>0 (Multiply both sides by '-1')
Now solve in the usual way. Assign '+' to the rightmost region and then alternate with '-'
Since you are looking for positive value of the expression, every region where you put a '+' will be the region where the expression will be greater than 0.

2) Variation - ODD/EVEN POWER
@ulm/Karishma -
if we have even powers like (x-a)^2(x-b)
we don't need to change a sign when jump over "a".
This will be same as (x-b)

We can ignore squares BUT SHOULD consider ODD powers
example -
2.a
(x-a)^3(x-b)<0 is the same as (x-a)(x-b) <0
2.b
(x - a)(x - b)/(x - c)(x - d) < 0 ==> (x - a)(x - b)(x-c)^-1(x-d)^-1 <0
is the same as (x - a)(x - b)(x - c)(x - d) < 0

3) Variation <= in FRACTION
@mrinal2100 -
if = sign is included with < then <= will be there in solution
like for (x+2)(x-1)(x-7)(x-4) <=0 the solution will be -2 <= x <= 1 or 4<= x <= 7

BUT if it is a fraction the denominator in the solution will not have = SIGN

example -
3.a
(x + 2)(x - 1)/(x -4)(x - 7) < =0
the solution will be -2 <= x <= 1 or 4< x < 7
we cant make 4<=x<=7 as it will make the solution infinite

4) Variation - ROOTS
@Karishma -
As for roots, you have to keep in mind that given $$\sqrt{x}$$, x cannot be negative.

$$\sqrt{x}$$ < 10
implies 0 < $$\sqrt{x}$$ < 10
Squaring, 0 < x < 100
Root questions are specific. You have to be careful. If you have a particular question in mind, send it.

Refer - inequalities-and-roots-118619.html#p959939
Some more useful tips for ROOTS....I am too lazy to consolidate

<5> THESIS -
@gmat1220 -
Once algebra teacher told me - signs alternate between the roots. I said whatever and now I know why Watching this article is a stroll down the memory lane.

I will save this future references....
Please add anything that you feel will help.

Anyone wants to add ABSOLUTE VALUES....That will be a value add to this post

_________________

Labor cost for typing this post >= Labor cost for pushing the Kudos Button
http://gmatclub.com/forum/kudos-what-are-they-and-why-we-have-them-94812.html

Veritas Prep GMAT Instructor
Joined: 16 Oct 2010
Posts: 8188
Location: Pune, India
Re: Inequalities trick  [#permalink]

### Show Tags

11 Aug 2011, 22:57
1
3
sushantarora wrote:
hey ,
can u please tel me the solution for this ques

a car dealership sells only sports cars and luxury cars and has atleast some of each type of car in stock at all times.if exactly 1/7 of sports car and 1/2 of luxury cars have sunroofs and there are exactly 42 cars on the lot.what is the smallest number of cars that could have roofs?

ans -11

Please put questions in new posts. Put it in the same post only if it is totally related or a variation of the question that we are discussing.

Now for the solution:

There are 42 cars on the lot. 1/7 of sports cars and 1/2 of luxury cars have sunroofs. This means that 1/7 of number of sports cars and 1/2 of number of luxury cars should be integers (You cannot have 1.5 cars with sunroofs, right?)
We want to minimize the sunroofs. Since 1/2 of luxury cars have sunroofs and only 1/7 of sports cars have them, it will be good to have fewer luxury cars and more sports cars. Best would be to have all sports cars. But, the question says there are some of each kind at any time. So let's say there are 2 luxury cars (since 1/2 of them should be an integer value). But 1/7 of 40 (the rest of the cars are sports cars) is not an integer number. Let's instead look for the multiple of 7 that is less than 42. The multiple of 7 that is less than 42 is 35. So we could have 35 sports cars. But then, 1/2 of 7 (since 42 - 35 = 7 are luxury cars) is not an integer. The next smaller multiple of 7 is 28. This works. 1/2 of 14 (since 42 - 28 = 14 are luxury cars) is 7. So we can have 14 luxury cars and 28 sports cars. That is the maximum number of sports cars that we can have.
1/7 of 28 sports cars = 4 cars have sunroofs
1/2 of 14 luxury cars = 7 cars have sunroofs

So at least 11 cars will have sunroofs.
_________________

Karishma
Veritas Prep GMAT Instructor

Save up to $1,000 on GMAT prep through 8/20! Learn more here > GMAT self-study has never been more personalized or more fun. Try ORION Free! Manager Joined: 16 Feb 2012 Posts: 193 Concentration: Finance, Economics Re: Inequalities trick [#permalink] ### Show Tags 22 Jul 2012, 03:03 VeritasPrepKarishma wrote: mrinal2100: Kudos to you for excellent thinking! Correct me if I'm wrong. If the lower part of the equation$$\frac {(x+2)(x-1)}{(x-4)(x-7)}$$ were $$4\leq x \leq 7$$, than the lower part would be equal to zero,thus making it impossible to calculate the whole equation. _________________ Kudos if you like the post! Failing to plan is planning to fail. Veritas Prep GMAT Instructor Joined: 16 Oct 2010 Posts: 8188 Location: Pune, India Re: Inequalities trick [#permalink] ### Show Tags 23 Jul 2012, 03:13 2 Stiv wrote: VeritasPrepKarishma wrote: mrinal2100: Kudos to you for excellent thinking! Correct me if I'm wrong. If the lower part of the equation$$\frac {(x+2)(x-1)}{(x-4)(x-7)}$$ were $$4\leq x \leq 7$$, than the lower part would be equal to zero,thus making it impossible to calculate the whole equation. x cannot be equal to 4 or 7 because if x = 4 or x = 7, the denominator will be 0 and the expression will not be defined. _________________ Karishma Veritas Prep GMAT Instructor Save up to$1,000 on GMAT prep through 8/20! Learn more here >

GMAT self-study has never been more personalized or more fun. Try ORION Free!

Veritas Prep GMAT Instructor
Joined: 16 Oct 2010
Posts: 8188
Location: Pune, India
Re: Inequalities trick  [#permalink]

### Show Tags

25 Jul 2012, 22:21
pavanpuneet wrote:
Hi Karishma,

Just for my reference, say if the equation was (x+2)(x-1)/(x-4)(x-7) and the question was for what values of x is this expression >0, then the roots will be -2,1,4,7 and by placing on the number line and making the extreme right as positive...

----(-2)----(1)----(4)---(7)----then x>7, 1<x<4 and x<-2...Please confirm..
However, is say it was >=0 then x>7, 1<=x<4 and x<=-2; given that the denominator cannot be zero. Please confirm

Yes, you are right in both the cases.

Also, if you want to verify that the range you have got is correct, just plug in some values to see. Put x = 0, the expression is -ve. Put x = 2, the expression is positive.
_________________

Karishma
Veritas Prep GMAT Instructor

Save up to \$1,000 on GMAT prep through 8/20! Learn more here >

GMAT self-study has never been more personalized or more fun. Try ORION Free!

Manager
Joined: 26 Dec 2011
Posts: 96
Re: Inequalities trick  [#permalink]

### Show Tags

26 Jul 2012, 07:59
Thankyou Karishma.

Further, say if the same expression was (x+2)(1-x)/(x-4)(x-7) and still the question was for what values of x is the expression positive, then ... make it x-1 and with the same roots, have the rightmost as -ve. Then we look for the +ve intervals and check for those intervals if the expression is positive. for examples, in this case, -2<x<1 and 4<x<7 both depict positive interval but only first range satisfies the condition. Please confirm

However, if for the same equation as mentioned, say the expression was (x+2)(x-1)/(x-4)(x-7) >0 and then we were asked to give the range where this is valid, then we would also multiply the -ve sign and make is <0 and then make the range after extreme right root -ve and provide all the intervals where it is negative. Please confirm
Senior Manager
Joined: 23 Oct 2010
Posts: 361
Location: Azerbaijan
Concentration: Finance
Schools: HEC '15 (A)
GMAT 1: 690 Q47 V38
Re: Inequalities trick  [#permalink]

### Show Tags

26 Jul 2012, 09:47
VeritasPrepKarishma wrote:

When you have (x-a)^2(x-b) < 0, the squared term is ignored because it is always positive and hence doesn't affect the sign of the entire left side. For the left hand side to be negative i.e. < 0, (x - b) should be negative i.e. x - b < 0 or x < b.
.

IMHO, it should be x<b and also x is not equal to a .
so, one shouldn't totally ignore the squared term. We can ignore it, if the expression is <=0
correct me, if I am wrong

my question is -
do we always have a sequence of + and - from rightmost to the left side. I mean is it possible to have + and then + again ?
_________________

Happy are those who dream dreams and are ready to pay the price to make them come true

I am still on all gmat forums. msg me if you want to ask me smth

Re: Inequalities trick &nbs [#permalink] 26 Jul 2012, 09:47

Go to page    1   2   3   4   5    Next  [ 95 posts ]

Display posts from previous: Sort by

# Inequalities trick

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics

# Events & Promotions

 Powered by phpBB © phpBB Group | Emoji artwork provided by EmojiOne Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®.


# De Broglie wavelength of 30keV electron

1. Dec 23, 2008

### catkin

1. The problem statement, all variables and given/known data
The question is from Advanced Physics by Adams and Allday, section 8 Practice Exam Questions, question 30.

Estimate the de Broglie wavelength of an electron that has been emitted thermionically in a vacuum from a filament and then accelerated through a p.d. of 30.0 kV

2. Relevant equations
λde Broglie = h / p
E2 - p2c2 = m02c4
ETotal = m0c2 + K.E.

3. The attempt at a solution
I think the solution is valid; my concern is whether there is a better (= more elegant) way to do it.

The de Broglie wavelength is given by
λde Broglie = h / p
Where h is Planck's constant and p is momentum.
p could be found from p = γm0v but this would require finding v. More conveniently
E2 - p2c2 = m02c4
Where E is the total energy (E = m0c2 + K.E.)
Expanding E:
p2c2 = 2m0c2K.E. + K.E.2
Rearranging:
p = (1/c) √(2m0c2K.E. + K.E.2)
Substituting this p:
λde Broglie = hc / √(2m0c2K.E. + K.E.2)
Substituting values using SI units (including eV to J conversion factor 1.60E-19)
= 6.63E-34 * 3.00E+8 / Sqrt(( 2 * 9.11E-31 * 3.00E+8^2 * 30E+3 * 1.60E-19) + (( 30E+3 * 1.60E-19)^2 ))
= 7.0e-12 m ct2sf

2. Dec 23, 2008

### Redbelly98

Staff Emeritus
Looks good.

By the way, this is a little easier using eV energy units. That way you won't have all those 1.6e-19's to contend with:

hc = 1240 eV-nm (a good number to remember in the future)
moc2 = 511 keV or 511e3 eV
KE = 30.0e3 eV

so that

λdB = 1240 eV-nm / √[2 × 511e3 × 30.0e3 eV2 + (30.0e3)2eV2]
= 0.00698 nm
= 6.98 pm

3. Dec 23, 2008

### Andrew Mason

Since it is asking only for an estimate, I would first determine whether the electron is moving at relativistic speeds. If it is not, you can use classical mechanics to determine p:

A 30 kV potential difference gives the electron 30keV of kinetic energy. Since it has about 500 keV as rest mass, the relativisitic effect will be small (since you are only estimating) so I would use a non-relativistic approach.

As suggested by Redbelly, use the formula:

$$\lambda_{DeB} = \frac{hc}{pc}$$

For non-relativistic speeds,

$$pc = \sqrt{2 KE m_0c^2}$$ (this is just a fancy rearrangment of $v = \sqrt{2 KE/m}$).

where KE is in units of eV. Note $m_0c^2$ = 511 KeV. and hc = 1240 eV nm

Use that to work out the Debroglie wavelength, in nm:

$$\lambda_{DeB} = hc/pc = 1240/\sqrt{2 x 3x10^4 x 5.11 x 10^5} = 1240/1.75 x 10^5 = 7 x 10^{-3}nm$$

AM

4. Dec 23, 2008

### Redbelly98

Staff Emeritus
Excellent point.

5. Jan 18, 2009

### catkin

Thanks Redbelly and Andrew.

Sorry it has taken me so long to get back here.

Helpful points, both about choice of unit and working out early on that the extra complexity of a relativistic approach is unnecessary.

What is the rest mass to K.E. ratio heuristic that allows deciding a relativistic approach is unnecessary and how does it arise?

Best

Charles

6. Jan 19, 2009

### Redbelly98

Staff Emeritus
Loosely speaking: when the KE is small compared to the rest mass energy, non-relativistic approximations may be used. Or equivalently, when v is small compared to c.

I'm not aware of any universally-accepted cutoff point, such as "when KE is x% of the rest mass energy". But as you saw, with KE equal to 6% of mc2, the non-relativistic result was pretty close, within 2%, of the actual de Broglie wavelength.

7. Feb 3, 2009

### catkin

Thanks Redbelly :)

The relativistic/Newtonian choice is something of a judgement call on this one. In our studies so far we have chosen 1% discrepancy in the result as the (arbitrary) determinant. On that basis, we found the cut of point for electrons is ~25keV acceleration. This is consonant with 2% error for an electron accelerated through 30 keV.

The thing that troubled me was that the question is from an old exam paper and the time to answer (based on the marks available) don't allow for my solution except the examinee be very good!

Perhaps that introduces an new relativistic/Newtonian choice determinant -- the time available to answer. :)

Best

Charles


# Probability for a specific value for sum of normally distributed random variables

I am trying to solve an exercise using the probability density function for a sum of n random variables with the same mean and variance. I need to find the probability for the specific value of the sums of r.v.s:

Player B uses a fair coin to earn points, if it lands on heads he collects 1 point, if tails he collects 8 points. When he flips the coin 50 times, these points will add up cumulatively.

What is the probability that player B will have exactly 225 points?

I was thinking I could take the $PDF$ probability for $\sum^n_{i=1}(X_i)=225$ with a mean of $n*µ=225$ and standard deviation of $\sqrt{\sigma^2*n}=24.75$, which gives the value 0.016, as can be seen on the PDF plot:

However, my teacher solved this by looking at it logically, and counting any situation where Player B gets exactly 25 heads and 25 tails:

$P=($$50\atop25$$)*\frac{1}{2^{50}}=0.112$

I see that his answer makes sense and is correct, but I doubt I would be able to think logically in an exam situation.

Why is my answer not correct, is it because the r.v. is only approximately normally distributed?

Is there another general way of solving such an exercise if the amount of flips and the total sum of points had been different?

• Another user reminded me that i can use binomial PDF to solve this issue, which is a bit of a help. But I do still have the same questions as mentioned. – user102937 Jun 3 '18 at 11:28
• By binomial distribution there is no PDF (probability density function) but there is a PMF (probability mass function). Your teacher used this PMF and calculated $f(25)$ where $f$ denotes this PMF. It is defined by $f(x)=\binom{50}{x}p^x(1-p)^{50-x}$ where $p=0.5$ and $x$ takes values in $\{0,1,\dots,50\}$ – drhab Jun 3 '18 at 11:35
• Your method works fine, but you have to remember the continuity correction. You are approximating a discrete distribution with a continuous one. If you are working with the scores, then for $(24,25,26)$ tails you get $(218,225,232)$ as scores...so for your continuous variant you need to look between $225-3.5$ and $225+3.5$. If you do that you get $0.112462916$ as opposed to the exact value of $0.112275173$. – lulu Jun 3 '18 at 12:02

Your method works fine, but you have to remember the continuity correction. You are approximating a discrete distribution with a continuous one. Thus, for instance, your method gives a non-zero chance of getting $224$ points (say) though that is in fact impossible.

As you are working with the scores, then for $(24,25,26)$ tails you get $(218,225,232)$ as scores...so for your continuous variant you need to look between $225-3.5$ and $225+3.5$. If you do that you get $0.112462916$ as opposed to the exact value of $0.112275173$ ... not bad at all!

The first thing to notice is that $B$ throws 50 coins and makes 225 points. If $n_H$ and $n_T$ are the numbers of heads and tails, 50 throws make it so that $$n_H + n_T = 50.$$ Given that a heads gives 1 point and a tails 8 points, we can set up the equation $$1 \cdot n_H + 8 \cdot n_T = 225.$$

Solving the two equations together gives $n_t = 25$; so we are after the probability tha 25 tails pop up in 50 throws. You can either do it with combinations and permutations (as your teacher did), or plainly use the pmf for the binomial distribution that represents your situation solving for 25 successes in 50 trials.

If you want the graphics, below is the plot of the distribution $B(50,0.5)$ with a line through $0.11227...$ which is the required probability.

While it is true that the binomial distribution tends to a normal distribution, you cannot interpret the values of a probability density function as the probability of an event.

• I would not speak of the PDF of binomial distribution but of the PMF. It does concern a density, but this wrt the counting measure. Usually PDF's refer to densities wrt Lebesgue measure and PMF's to densities wrt counting measure. – drhab Jun 3 '18 at 11:40
• Agreed! It was a typo – Riccardo Sven Risuleo Jun 3 '18 at 21:23

The values $f(x)$ where $f$ denotes a PDF cannot be interpreted as probabilities (as you seem to think). Note for instance that they can take values that exceed $1$.

That is the mistake you made.

We have the equalities $H+T=50$ and $H+8T=225$ here leading to $H=25=T$, so the question can be rephrased as:

"By $50$ throws of a fair coin what is the probability on $25$ tails?"

This is the route taken by your teacher.

• Yes, okay i see. So i can use binomial distribution to check whether i get 25 successes. How about if i take the cdf for the value 225.5 and subtract the value for the cdf of 224.5? As far as i know, that cannot exceed 1. (Sorry that i keep sticking to the normal distribution assumption, i would just like to know) – user102937 Jun 3 '18 at 11:40
• You could calculate $P(\sum_{i=1}^{50}X_i=225)$ where $X_i$ takes values in $\{1,8\}$ by approaching it with normal distribution. If $\sum_{i=1}^{50}X_i\approx Y$ where $Y$ has normal distribution then an estimate of the probability would be $P(224.5<Y<225.5)$ as you suggest. – drhab Jun 3 '18 at 11:50


How to speed up my Project Euler code

The evaluation speed of Mathematica often depresses me. It did it again when I wrote a code to solve a Project Euler problem. https://projecteuler.net/problem=206

Here's my code:

ClearAll[a];
a =
Compile[{},
NestWhile[# + 1 &, 10^9, ! MatchQ[
IntegerDigits[#^2], {1, _, 2, _, 3, _, 4, _, 5, _, 6, _, 7, _,8, _, 9, _, 0}] &],
CompilationTarget -> "C"]

I think it is the simplest solution. I can't find other solutions which are simpler. But my Mathematica runs a long time before getting the answer. How can I speed this up? I've run into similar problems while I was solving other problems.

• Pattern matching is often slow, you might try something like IntegerDigits[#^2][[ ;; ;; 2]] == {1,2,3,4,5,6,7,8,9,0} instead. – C. E. Sep 3 '14 at 7:16
• #+1 can be replaced by #+10, because a square number ends with "0" must ends with "00" – wuyingddg Sep 3 '14 at 8:20
• If you realize that the maximum solution is 10 Floor[Ceiling[Sqrt[1929394959697989990]]/10] and step down by 10 from there, you'll get the solution almost immediately. – Mark McClure Sep 3 '14 at 12:38
• @MarkMcClure Yes but this is because you know the answer. It could also be very close to 102030405060708090. – anderstood Oct 21 '15 at 20:00

Compilation is a certainly a good idea if you're going the brute-force route. So let's first tackle that, which will get us the answer in roughly 30 seconds computation time. Afterwards we'll come up with better strategy, which can do it in 0.3 seconds.

Compilation

A performance pitfall when compiling functions is that sometimes the compiled function just calls the main evaluation loop, effectively gaining nothing. We can check this with CompilePrint:

Needs["CompiledFunctionTools"]

a // CompilePrint

      (...)
Result = I3

1    I3 = MainEvaluate[(...)]
2    Return

The call to MainEvaluate is the culprit here.

So let's rewrite your function such that it does compile properly. Using Pickett's and wuyingddg suggestions, we end up with:

PerformSearch = Compile[
{
{startValue, _Integer},
{increment,  _Integer}
},
NestWhile[
# + increment &,
startValue,
IntegerDigits[#^2][[-1 ;; 1 ;; -2]] =!= {9, 8, 7, 6, 5, 4, 3, 2, 1} &
]
]

Let's check if this did compile ok:

PerformSearch // CompilePrint

      (...)

1    I4 = I0
2    I3 = I4
3    I7 = Square[ I3]
4    T(I1)2 = IntegerDigits[ I7, I5]]
5    T(I1)0 = Part[ T(I1)2, T(I1)1Span]
6    B0 = CompareTensor[ I6, R2, T(I1)0, T(I1)3]]
7    if[ !B0] goto 12
8    I3 = I4
9    I7 = I3 + I1
10   I4 = I7
11   goto 2
12   Return

Ok, that looks much better. We can now perform the search, but not after we've determined the range of possible solutions:

max =   Floor @ Sqrt @ FromDigits @ Riffle[Range[9], 9] (* 138902662 *)
min = Ceiling @ Sqrt @ FromDigits @ Riffle[Range[9], 0] (* 101010102 *)

As an aside, note that max^2 is below $MaxMachineInteger on 64-bit systems. But on 32-bit it isn't, which causes PerformSearch to switch back to the uncompiled code. Keeping Mark McClure's comment in mind, we'll cheat a bit and start from the maximum to find immediately: result = PerformSearch[max, -1]  138901917  How much faster is this than starting from the minimum? (result - min)/(max - result) // N  50861.5  Roughly 50 thousand times faster, not bad! Starting from the minimum takes about 30 seconds on my machine. Last but not least, let's double-check if we've obtained the correct number: result^2  19293742546274889  If you multiply this with 100, you've got your desired integer. Non-brute-force The approach above scanned roughly 38 million (!) integers in the worst-case scenario (starting from the minimum). Other answers to the OP's question have shown that you can and should go one better than that. Here's my take on an efficient general solution, using an iterative step-by-step process: ClearAll[ FindIntegerRoots, CheckIfEmpty, SelectDigitSequences, InsertNewDigits, ConvertPattern ]; FindIntegerRoots[ pattern : { (0|1|2|3|4|5|6|7|8|9|Verbatim[_]).. }, power_Integer: 2 ] /; power > 1 := With[ { maxRoot = Floor[FromDigits[pattern /. Verbatim[_] -> 9]^(1/power)] }, FromDigits /@ SelectDigitSequences[ Fold[ CheckIfEmpty @ SelectDigitSequences[ InsertNewDigits @ #1, maxRoot, power, ConvertPattern[pattern, #2] ] &, {{}}, Range @ IntegerLength @ maxRoot ], maxRoot, power, ConvertPattern[pattern, Length @ pattern] ] ~Quiet~ {CompiledFunction::cfnlts} ~Catch~ "isEmpty" ]; CheckIfEmpty[{}] := Throw[{}, "isEmpty"]; CheckIfEmpty[nonEmpty_] := nonEmpty; SelectDigitSequences = Compile[ { {digitSequences, _Integer, 2}, {maxRoot, _Integer }, {power, _Integer }, {numDigits, _Integer }, {positions, _Integer, 1}, {compareDigits, _Integer, 1} }, Module[ { powersOfTen = 10^# & /@ Range[Length @ First @ digitSequences - 1, 0, -1] }, Select[ digitSequences, And[ # <= maxRoot, IntegerDigits[#^power, 10, numDigits][[positions]] == compareDigits ] & @ ( powersOfTen.# ) & ] ] ]; InsertNewDigits = With[ { range = List /@ Range[0, 9] }, Compile[ { {digitSequences, _Integer, 2} }, Outer[#1 ~Join~ #2 &, range, digitSequences, 1] ~Flatten~ 1 ] ]; ConvertPattern[pattern_, length_] := With[ { trimmed = pattern[[Length@pattern - length + 1 ;; -1]] }, Sequence @@ { length, Flatten @ Position[trimmed, _Integer], DeleteCases[trimmed, Verbatim[_]] } ];  While the code might be long, it is nevertheless fast: FindIntegerRoots @ Riffle[Range[9], _] // AbsoluteTiming  {0.284622, {138901917}}  A performance increase of 100 over the above brute-force method! But how efficient is it? Here's a nice graph of the amount of checks it performs in this case: That's about 296 thousand checks in total; certainly much less than 38 million! Some more concealed squares The nice thing about FindIntegerRoots is that it works on any pattern, not just the OP's case: FindIntegerRoots @ {_, 9}  {3, 7}  FindIntegerRoots @ { 1, _, 4}  {12}  FindIntegerRoots @ { 1, _, 6}  {14}  And if you're adventurous, you may even ask for roots of different powers: FindIntegerRoots[{_, _, _, 5}, 3]  {5, 15}  So let's have a bit of fun and search for more concealed squares. First, are there any partial concealed squares (i.e. of the form 1_2, 1_2_3, 1_2_3_4, etc)? FindIntegerRoots @ Riffle[Range @ #, _] & /@ Range @ 9  {{1}, {}, {}, {1312}, {}, {115256, 127334, 135254}, {}, {}, {138901917}}  Flatten[%]^2   {1, 1721344, 13283945536, 16213947556, 18293644516, 19293742546274889}  How about reverse concealed squares (i.e. 2_1, 3_2_1, 4_3_2_1, etc)? FindIntegerRoots @ Riffle[Reverse @ Range @ #, _] & /@ Range @ 9  {{1}, {}, {}, {}, {24171}, {}, {2657351, 2713399}, {}, {}}  Flatten[%]^2  {1, 584237241, 7061514337201, 7362534133201}  And finally, are there squares of the form 1_1_(...)_1_1? FindIntegerRoots @ Riffle[ConstantArray[1, #], _] & /@ Range[2, 9]  {{11}, {119, 131}, {}, {}, {110369}, {}, {10065739}, {}}  Flatten[%]^2  {121, 14161, 17161, 12181316161, 101319101616121}  It seems there are many nice squares. If you happen to find a particularly nice one, let me know :) • Which version of Mathematica are you using? It's quite strange that your code generates the CompiledFunction::cfn warning in my v8 (Win 32bit & 64bit) and v9 (Win 32bit), but it does work without warning on Wolfram Cloud! – xzczd Sep 3 '14 at 14:15 • @xzczd I've checked this on v9 on a Mac. The issue here is 32 vs 64 bit; $MaxMachineInteger should namely be bigger than FromDigits@Riffle[Range[9], 9], which it isn't on 32 bit. – Teake Nutma Sep 3 '14 at 16:06
• That seems to be the reason, BTW the \$MaxMachineInteger in my v8 (Win 64 bit) is the same as that in 32 bit, not sure if it's just the nature of v8… – xzczd Sep 4 '14 at 1:56
• Is using Big O notation in "Roughly O(10^4) times faster" a correct statement? It is surely 10^4 times faster in this example, but what exactly does O(10^4) times faster mean? – user Sep 4 '14 at 15:29
• @bruce14 What I meant here is that it's roughly 4 orders of magnitude faster; faster than 10^3 and slower than 10^5. – Teake Nutma Sep 4 '14 at 17:15

This non-paralell strategy takes less than 4 seconds in my stone age laptop (and doesn't use the "reverse searching" trick)-

First we check for the possible 6 digits endings (after discounting the final "00" ending in the squared number):

set= 2 Position[IntegerDigits[Range[10^5 + 1, 10^6-1, 2]^2][[All, -5;; -1;; 2]], {7,8,9}]+ 10^5 - 1;

Then we complete the whole set of numbers to check by adding all the possible "heads" between the max and min:

fullSet = Total[Tuples[{Range[101, 138] 10^6, Flatten@set}], {2}];

And then a quick search gets our number:

Cases[IntegerDigits[fullSet^2], {1, _, 2, _, 3, _, 4, _, 5, _,  6, _, 7, _, 8, _, 9}]

(*{{1, 9, 2, 9, 3, 7, 4, 2, 5, 4, 6, 2, 7, 4, 8, 8, 9}}*)

(* 1929374254627488900 *)

Edit

We can still cut the time in half if we see that the number should end in 3 or 7 for its square to end in 9:

set = Join[10 (Position[IntegerDigits[Range[10^5 + #, 10^6, 10]^2][[All, -5 ;; -1 ;; 2]],
{7, 8, 9}] - 1) + # & /@ {3, 7}] + 10^5;
fullSet = Total[Tuples[{Range[101, 138] 10^6, Flatten@set}], {2}];
Cases[IntegerDigits[fullSet^2], {1, _, 2, _, 3, _, 4, _, 5, _,  6, _, 7, _, 8, _, 9}]

• +1 Very concise and fast (~1.3 times faster than mine!). – Teake Nutma Sep 4 '14 at 20:31
• @TeakeNutma Thanks! I halved the time in the edit.Less than 2 secs now on my poor man's machine :) – Dr. belisarius Sep 5 '14 at 2:41
• That's pretty fast. But alas, I've updated my answer and now it's 2x faster than yours :). – Teake Nutma Sep 5 '14 at 10:11

There is a method by using Catch and Throw, and it gives result in about 90s. I think it can be improve a lot by Paralilize or ParallelEvaluate, but failed to finish that.

i = 10^9 + {30, 70};
isMatchQ =
If[IntegerDigits[#^2][[1 ;; -1 ;; 2]] ==  {1, 2, 3, 4, 5, 6, 7, 8,
9, 0}, Throw[#]] &;
Catch[Do[isMatchQ /@ i; i += 100, {10^9}]]

Edit

I have found a way to speed up it by ParallelTable, this is the code:

len = ((Sqrt[1.93*10^16] - 1*10^8)/40 // IntegerPart)*10;
isMatchQ =
If[IntegerDigits[#^2][[1 ;; -1 ;; 2]] ==  {1, 2, 3, 4, 5, 6, 7, 8,
9}, Throw[#]] &;
ParallelTable[n = 10^8 + {3, 7} + len*i;
Catch[Do[isMatchQ /@ n; n += 10, {len / 10}]], {i, 0,
3}] // AbsoluteTiming
(*{42.523432, {Null, Null, Null, 138901917}}*)

I divided the whole range of n which makes 10^16 <= n^2 <= 1.93*10^16 into 4 parts, the length of each part is len. And I calculate these 4 parts in 4 kernels at the same time by ParallelTable, then get the result in a much shorter time, only 42.5s. (Sorry for my poor English....)

Here's a slight improvement of @wuyingddg's Catch&Throw method. The key point is to make Throw working inside ParallelDo using the method mentioned in this post:

SetSharedFunction[pThrow];
pThrow[expr_] := Throw[expr]
isMatchQ =
If[IntegerDigits[#^2][[1 ;; -1 ;; 2]] == {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, pThrow[#]] &;
Catch[ParallelDo[
isMatchQ /@ (i + {30, 70}), {i, 10^9, Sqrt[193 10^16], 100}]] // AbsoluteTiming
`
• It is much more brief than the ParallelTable one and spend nearly same time, pretty good! – wuyingddg Sep 3 '14 at 14:21


lazy

Description

example

lc = lazy(mc) transforms the discrete-time Markov chain mc into the lazy chain lc with an adjusted state inertia.

example

lc = lazy(mc,w) applies the inertial weights w for the transformation.

Examples

collapse all

Consider this three-state transition matrix.

$P=\left[\begin{array}{ccc}0& 1& 0\\ 0& 0& 1\\ 1& 0& 0\end{array}\right].$

Create the irreducible and periodic Markov chain that is characterized by the transition matrix P.

P = [0 1 0; 0 0 1; 1 0 0];
mc = dtmc(P);

At time t = 1,..., T, mc is forced to move to another state deterministically.

Determine the stationary distribution of the Markov chain and whether it is ergodic.

xFix = asymptotics(mc)
xFix = 1×3

0.3333    0.3333    0.3333

isergodic(mc)
ans = logical
0

mc is irreducible and not ergodic. As a result, mc has a stationary distribution, but it is not a limiting distribution for all initial distributions.

Show why xFix is not a limiting distribution for all initial distributions.

x0 = [1 0 0];
x1 = x0*P
x1 = 1×3

0     1     0

x2 = x1*P
x2 = 1×3

0     0     1

x3 = x2*P
x3 = 1×3

1     0     0

sum(x3 == x0) == mc.NumStates
ans = logical
1

The initial distribution is reached again after several steps, which implies that the subsequent state distributions cycle through the same sets of distributions indefinitely. Therefore, mc does not have a limiting distribution.

Create a lazy version of the Markov chain mc.

lc = lazy(mc)
lc =
dtmc with properties:

P: [3x3 double]
StateNames: ["1"    "2"    "3"]
NumStates: 3

lc.P
ans = 3×3

0.5000    0.5000         0
0    0.5000    0.5000
0.5000         0    0.5000

lc is a dtmc object. At time t = 1,..., T, lc "flips a fair coin". It remains in its current state if the "coin shows heads" and transitions to another state if the "coin shows tails".

Determine the stationary distribution of the lazy chain and whether it is ergodic.

lcxFix = asymptotics(lc)
lcxFix = 1×3

0.3333    0.3333    0.3333

isergodic(lc)
ans = logical
1

lc and mc have the same stationary distributions, but only lc is ergodic. Therefore, the limiting distribution of lc exists and is equal to its stationary distribution.

Consider this theoretical, right-stochastic transition matrix of a stochastic process.

$P=\left[\begin{array}{ccccccc}0& 0& 1/2& 1/4& 1/4& 0& 0\\ 0& 0& 1/3& 0& 2/3& 0& 0\\ 0& 0& 0& 0& 0& 1/3& 2/3\\ 0& 0& 0& 0& 0& 1/2& 1/2\\ 0& 0& 0& 0& 0& 3/4& 1/4\\ 1/2& 1/2& 0& 0& 0& 0& 0\\ 1/4& 3/4& 0& 0& 0& 0& 0\end{array}\right].$

Create the Markov chain that is characterized by the transition matrix P.

P = [ 0   0  1/2 1/4 1/4  0   0 ;
0   0  1/3  0  2/3  0   0 ;
0   0   0   0   0  1/3 2/3;
0   0   0   0   0  1/2 1/2;
0   0   0   0   0  3/4 1/4;
1/2 1/2  0   0   0   0   0 ;
1/4 3/4  0   0   0   0   0 ];
mc = dtmc(P);

Plot the eigenvalues of the transition matrix on the complex plane.

figure;
eigplot(mc);
title('Original Markov Chain')

Three eigenvalues have modulus one, which indicates that the period of mc is three.

Create lazy versions of the Markov chain mc using various inertial weights. Plot the eigenvalues of the lazy chains on separate complex planes.

w2 = 0.1;                                 % More active Markov chain
w3 = 0.9;                                 % Lazier Markov chain
w4 = [0.9 0.1 0.25 0.5 0.25 0.001 0.999]; % Laziness differs between states

lc1 = lazy(mc);
lc2 = lazy(mc,w2);
lc3 = lazy(mc,w3);
lc4 = lazy(mc,w4);

figure;
eigplot(lc1);
title('Default Laziness');

figure;
eigplot(lc2);
title('More Active Chain');

figure;
eigplot(lc3);
title('Lazier Chain');

figure;
eigplot(lc4);
title('Differing Laziness Levels');

All lazy chains have only one eigenvalue with modulus one. Therefore, they are aperiodic. The spectral gap (distance between inner and outer circle) determines the mixing time. Observe that all lazy chains take longer to mix than the original Markov chain. Chains with different inertial weights than the default take longer to mix than the default lazy chain.

Input Arguments

collapse all

Discrete-time Markov chain with NumStates states and transition matrix P, specified as a dtmc object. P must be fully specified (no NaN entries).

Inertial weights, specified as a numeric scalar or vector of length NumStates. Values must be between 0 and 1.

• If w is a scalar, lazy applies it to all states. That is, the transition matrix of the lazy chain (lc.P) is the result of the linear transformation

${P}_{\text{lazy}}=\left(1-w\right)P+wI.$

P is mc.P and I is the NumStates-by-NumStates identity matrix.

• If w is a vector, lazy applies the weights state by state (row by row).

Data Types: double

Output Arguments

collapse all

Discrete-time Markov chain, returned as a dtmc object. lc is the lazy version of mc.

collapse all

Lazy Chain

A lazy version of a Markov chain has, for each state, a probability of staying in the same state equal to at least 0.5.

In a directed graph of a Markov chain, the default lazy transformation ensures self-loops on all states, eliminating periodicity. If the Markov chain is irreducible, then its lazy version is ergodic. See graphplot.

References

[1] Gallager, R.G. Stochastic Processes: Theory for Applications. Cambridge, UK: Cambridge University Press, 2013.


# Is this relation symmetric? I think it is but my professor claims it isn't.

Is the relation $$R = \{(a,b),(a,c),(b,a),(b,c),(c,a),(c,b),(d,d)\}$$ symmetric?

My professor claims that if $$(d,d)$$ was not included, it would be symmetric, but the inclusion of $$(d,d)$$ ruins it because $$d$$ has to connect to another element of the relation.

• Two of the defining properties of equivalence relations are that they are both reflexive and symmetric, which would be useless if they were mutually exclusive :-P Sep 24 '21 at 4:12
• Hope your professor is willing to get corrected in this case! Sep 24 '21 at 8:39
• You could tell your professor that $(d,d)\in R$ "connects" to itself, ie, for the element $(\color{red}d,\color{green}d)$ in $R$, we have the element $(\color{green}d,\color{red}d)$ in $R$. There is no restriction that it must "connect" to a distinct element in $R$. As an example, the relation $R=\{(a,a)\}$ on the singleton set $\{a\}$ is an equivalence relation: reflexive, symmetric and transitive. Sep 24 '21 at 19:16

A very simple way to see if a relation $$R$$ is symmetric is to check its inverse relation $$R^{-1}$$, where $$(x,y)\in R\Leftrightarrow (y,x)\in R^{-1}$$

Since for the given relation, $$R=R^{-1}$$, it is symmetric.

$$\color{green}{\text{YOU ARE CORRECT.}}$$

Yes, that relation is symmetric. The definition of symmetry does not require each element to be connected to some other element; $$R$$ is symmetric iff for every $$x,y$$ such that $$(x,y)\in R$$ it is also the case that $$(y,x)\in R$$.

One way to see if a relation is symmetric is to draw the table what is in relation to what:

$$\begin{array}{r|c|c|c|c}R&a&b&c&d\\\hline a&F&T&T&F\\b&T&F&T&F\\c&T&T&F&F\\d&F&F&F&T\end{array}$$

and just see if the table is symmetrical across the main diagonal.

And - in this case it is. Thus, the relation is symmetric. Having $$(d,d)$$ in it has nothing to do with it, it would be symmetric either way (i.e. whether the entry for $$(d,d)$$ is "true" or "false").