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

 It is currently 12 Nov 2019, 23:38

### 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

### Show Tags

22 Jun 2018, 02:04
1
26
00:00

Difficulty:

55% (hard)

Question Stats:

62% (01:43) correct 38% (01:32) wrong based on 942 sessions

### HideShow timer Statistics

Is the sum of the prices of the 3 books that Shana bought less than $48 ? (1) The price of the most expensive of the 3 books that Shana bought is less than$17.

### Show Tags

22 Jun 2018, 03:20
12
3
Is the sum of the prices of the 3 books that Shana bought less than $48 ? (1) The price of the most expensive of the 3 books that Shana bought is less than$17.
The price could be 16.99$, then the price of three books could be between 59 and 51..so NO not <48 If the price is 15$ each, total =45, so yes <48
Insufficient

(2) The price of the least expensive of the 3 books that Shana bought is exactly $3 less than the price of the second most expensive book. Nothing about the actual cost.. Insufficient.. Combined Let's see the max possible cost.. Least expensive ~17-13 =~14, slightly less than 14 Let the other two be same so ~17.. So total can be just less than 17+17+14=48.. So just less than 48.. Thus always <48 Sufficient C NEW question from GMAT® Official Guide 2019 (DS13949) _________________ e-GMAT Representative Joined: 04 Jan 2015 Posts: 3134 Re: Is the sum of the prices of the 3 books that Shana bought less than$4  [#permalink]

### Show Tags

22 Jun 2018, 06:30
5
5

Solution

To find:
• Whether the sum of the prices of the 3 books that Shana bought less than $48 Analysing Statement 1 • As per the information given in statement 1, the price of the most expensive book that Shana bought is less than$17

There are 3 possible scenarios in this case:
Case 1: when the sum of the prices is greater than $48 • Example: if the books are priced at$16.x, $16.y, and$16.z, where all x, y, and z are positive integers

Case 2: when the sum of the prices is equal to $48 • Example: if the books are priced at$16.5, $16, and$15.5

Case 3: when the sum of the prices is less than $48 • Example: if all the books are priced at less than$16

As there are multiple possible cases exist, which satisfy the given condition in statement 1, we cannot conclude whether the sum of the prices of 3 books that Shana bought is less than $48 or not Hence, statement 1 is not sufficient to answer the question Analysing Statement 2 • As per the information given in statement 2, the price of the least expensive of the 3 books that Shana bought is exactly$3 less than the price of the second most expensive book
o The two least expensive books can have any price, with a gap of $3 o Moreover, no information was given about the most expensive book’s price Hence, statement 2 is not sufficient to answer the question Combining Both Statements If we combine both the statements, we can say: • The most expensive book costs less than$17
• The least expensive book costs $3 less than the second most expensive book As the most expensive book costs less than$17, we can say
• The second most expensive book will cost less than $17 • The least expensive book will definitely cost less than (17 – 3) =$14

Therefore, the possible sum of prices of all the books = (less than $17 + less than$17 + less than $14) = less than$48

Hence, the correct answer is option C.

_________________
##### General Discussion
GMAT Club Legend
Joined: 12 Sep 2015
Posts: 4055
Re: Is the sum of the prices of the 3 books that Shana bought less than $4 [#permalink] ### Show Tags 23 Jun 2018, 06:39 1 Top Contributor Bunuel wrote: Is the sum of the prices of the 3 books that Shana bought less than$48 ?

(1) The price of the most expensive of the 3 books that Shana bought is less than $17. (2) The price of the least expensive of the 3 books that Shana bought is exactly$3 less than the price of the second most expensive book.

Target question: Is the sum of the prices of the 3 books less than $48 ? Let A = price of the LEAST expensive book (in dollars) Let B = price of the mid-priced expensive book (in dollars) Let C = price of the MOST expensive book (in dollars) So, A < B < C Statement 1: The price of the most expensive of the 3 books that Shana bought is less than$17.
So, C < 17
Let's TEST some values.
There are several cases that satisfy statement 1. Here are two:
Case a: A = $1, B =$2 and C = $3, in which case A + B + C = 1 + 2 + 3 = 6. In this case, the answer to the target question is YES, the sum of the prices IS less than$48
Case b: A = $16.25, B =$16.50 and C = $16.75, in which case A + B + C = 16.25 + 16.50 + 16.75 = 49.50. In this case, the answer to the target question is NO, the sum of the prices is NOT less than$48
Since we cannot answer the target question with certainty, statement 1 is NOT SUFFICIENT

Statement 2: The price of the least expensive of the 3 books that Shana bought is exactly $3 less than the price of the second most expensive book. In other words, A = B - 3 Let's TEST some values again. There are several cases that satisfy statement 1. Here are two: Case a: A =$1, B = $4 and C =$10, in which case A + B + C = 1 + 4 + 10 = 15. In this case, the answer to the target question is YES, the sum of the prices IS less than $48 Case b: A =$1, B = $4 and C =$100, in which case A + B + C = 1 + 4 + 100 = 105. In this case, the answer to the target question is NO, the sum of the prices is NOT less than $48 Since we cannot answer the target question with certainty, statement 2 is NOT SUFFICIENT Statements 1 and 2 combined Statement 1 tells us that C < 17 Statement 2 tells us that A = B - 3 Let's MAXIMIZE ALL of the values If C <$17, then the greatest possible value of C = $16.99 Since B must be less than C, the greatest possible value of B =$16.98
Since A is $3 less than B, greatest possible value of A =$12.98
So, when we MAXIMIZE all 3 values, A + B + C = $16.99 +$16.98 + $12.98 =$46.95, which is less than $48 If if the GREATEST values of A, B and C have a sum that's less than$48, we can conclude that is must be the case that A + B + C < 48
In other words, the answer to the target question is YES, the sum of the prices IS less than $48 Since we can answer the target question with certainty, the combined statements are SUFFICIENT Answer: C Cheers, Brent _________________ Test confidently with gmatprepnow.com Manager Joined: 14 Apr 2017 Posts: 70 Location: Hungary GMAT 1: 760 Q50 V42 WE: Education (Education) Is the sum of the prices of the 3 books that Shana bought less than$4  [#permalink]

### Show Tags

08 Nov 2018, 08:49
1
Bunuel wrote:
Is the sum of the prices of the 3 books that Shana bought less than $48 ? (1) The price of the most expensive of the 3 books that Shana bought is less than$17.
(2) The price of the least expensive of the 3 books that Shana bought is exactly $3 less than the price of the second most expensive book. Let $$x_1, x_2, x_3$$ be the prices in increasing order and let $$S$$ be the sum of the prices. The original question: Is $$S<48$$ ? 1) Using that $$x_3<17$$, we can determine an upper bound for $$S$$. $$S\leq 3x_3<51$$ $$S<51$$ We can't get a definite answer to the original question. $$\implies$$ Insufficient 2) We know that $$x_1=x_2-3$$, but no information is given about $$x_3$$. Thus, we can't get a definite answer to the original question. $$\implies$$ Insufficient 1&2) Using all statement information, we can determine an upper bound for $$S$$. $$S\leq x_3-3+x_3+x_3$$ $$S\leq 3x_3-3<48$$ $$S<48$$ Thus, the answer to the original question is a definite Yes. $$\implies$$ Sufficient Answer: C _________________ My book with my solutions to all 230 PS questions in OG2018: Zoltan's solutions to OG2018 PS Is the sum of the prices of the 3 books that Shana bought less than$4   [#permalink] 08 Nov 2018, 08:49
Display posts from previous: Sort by


text:
# Derivation of Wormhole Mouth Mass/Charge?

1. Jun 15, 2009

### Julian M

It is said that the mouths of a wormhole can have mass or charge; I can't follow the arguments used to support this conclusion and would be very grateful if anyone could help clarify the issue for me. In fact, not to put too fine a point on it, this question is driving me nuts: the conclusion is apparently uncontroversial, but the argument(s) seem absurd, so clearly the fundamental problem is my ignorance of something essential. What am I missing?

Apologies if this seems an over-long enquiry, though I may have failed miserably I have striven for clarity and conciseness.

What should be the technical level of the answer? The basic GR concepts are understood, but as for the math... I'm happy with manifolds, metrics, etc. but My tensor math is decrepit; I can however probably follow the steps of a mathematical exposition provided the steps are small enough. On the other hand, if you start talking about homologies etc. my eyes will probably just glaze over.

I've used Matt Visser's book "Lorentzian Wormholes – from Einstein to Hawking" (Springer Verlag, New York Inc.; 1996) ["MV"] as a convenient source for a specific argument, but I've also referenced some other papers/books as follows

MTY = M. S. Morris, K.S. Thorne, U. Yurtsever, Wormholes, Time Machines, and the Weak Energy Condition (Phys. Rev. Lett. 61(13), 1446-1449; 1988) available online at http://authors.library.caltech.edu/9262/
RP = Roger Penrose The Road to Reality (Jonathan Cape, London; 2004)
KT = Kip Thorne, Black Holes and Time Warps – Einstein’s Outrageous Legacy, (Norton, [n. p.]; 1994)
LB = Leo Brewin, A simple expression for the ADM mass (Gen. Rel. Grav. 39(2007) pp.521-528) available online at http://users.monash.edu.au/~leo/research/papers/files/lcb07-01.pdf

So, here goes.

I am most particularly interested in the mass/charge of the mouths of traversable wormholes, i.e. wormholes without horizons.

MV argues [MV pp111-113] for the existence of mass by reference to ADM Mass, beginning with a wormhole between two universes and then extending the argument to an intra-universe wormhole as follows.

Consider the ADM mass of two separate universe; ADM mass is defined with reference to the asymptotically flat region where spacetime has become "sufficiently" flat; ADM mass is conserved. Join the two universes with a wormhole. "There are now two asymptotically flat regions and thus two ADM masses" [MV, p111]

Why are there now two regions? I can only see one: from any point in either "universe" one can reach any point in either universe (including infinity). Against that however, I can also see that within the wormhole throat there is a unique (circumferential) direction in which motion gets you nowhere (so to speak) - as a result of which it would seem that there is no asymptotic flatness in this direction. Is it the existence of this direction that leads to the existence of two distinct regions? (If the resultant manifold is no longer asymptotically flat in all directions, presumably the ADM Mass cannot be defined for the connected universes as a whole.)

But - if it were the existence of such a special geodesic direction that created a region boundary, it should apply in other contexts e.g. around any mass, and since extra regions are not apparently created around "ordinary" masses this argument would seem to be undermined.

[Side thought: suppose we consider the region of the wormhole in which the geodesics are closed - can we excise this region from the joined universes? Whilst each universe is asymptotically flat, it would seem that the curvature of the wormhole mouth also extends "to infinity" (being everywhere non-zero except "at infinity" itself, so it does not seem obvious that one could excise the offending region and actually have anything left. But even if one could, would the remaining region still satisfy the requirements for having a defined ADM Mass? This might be what LB was doing (in another context) with reference to the Weyl-Lewy embedding theorem, but I'm not actually wiser yet. NB I haven't read LB thoroughly - I only just stumbled across it when looking for a good definition of ADM Mass.]

MV also [p112] shows a Penrose (conformal) diagram of a Morris-Thorne wormhole which contains "two asymptotically flat regions" either side of a dashed line representing the wormhole throat; according to Penrose [RP, p725] such dashed lines represents an axis of symmetry, so whilst I can't disagree about the symmetry I can't see why the existence of the symmetry would create two regions [c.f. RP p725 Fig. 27.16 (b)]. Furthermore, Penrose [RP, p833 Fig 30.10 (b)] illustrates such a hypothetical wormhole (held open by negative energy) without the axis of symmetry... and where it seems that there is only one region.

Moving beyond the inter-universe case MV extends the argument to intra-universe wormholes with the additional qualifications [MV, p111]

i) The two wormhole mouths are sufficiently far apart that their mutual gravitational interaction can be neglected
ii) the initial and final positions of an object traversing the wormhole are sufficiently far away from both mouths

i) seems reasonable at first if the reasoning requires a flat background, but why should the argument only work in flat space? ii) probably ditto, but if infinity is always flat, what does it matter what happens in a finite region around the wormhole mouths etc.?

However, most fundamentally, since one has by definition only one ADM mass for a single universe how can the inter-universe argument be extended to the intra-universe case, unless it is again by virtue of the unique the circumferential direction, which now creates two regions instead of merely maintaining them?

With regard to charge, MV says "One can phrase the argument either in terms of the imprint at infinity or in terms of a more physical picture using flux lines" [MV, p113].

However, according to the flux line picture it would seem that charge on a wormhole mouth is an illusion. Speaking in the context of Wheeler's "charge without charge" via trapped flux lines, MTW note that an observer having constructed a "boundary" around a region that appears to be the "seat of charge" may "incorrectly apply the theorem of Gauss… it isn't a boundary" [MTW, p1200] - because there isn't an "inside", the nominal interior can be reached by another path within the same universe. Furthermore, in the absence of horizons there is nowhere for any apparent charge to reside.

Your patience and understanding are much appreciated...

Yours, confused and ignorant,

Julian

2. Jun 18, 2009

### George Jones

Staff Emeritus
There are two regions because the asymptotically flat part of spacetime is a disconnected set that consists of two path-connected components.
But any such path passes through a region of spacetime that is not asymptotically flat.

3. Jun 18, 2009

### Julian M

Many, many thanks George... I feel I'm making (slow) progress but if you can clarify a little further that would be great. Please forgive me for apparent quibblings in places... what brain there is not taken up with thoughts of hunny I have to try and keep tidy. We're on the right track and I hope you are willing to bear with me... I also hope you can forgive the inevitable mathematical errors (and a bit of rambling...)
Quoting Wikipedia (http://en.wikipedia.org/wiki/Connected_space" [Broken], the redirect from "Disconnected Set")

If I have understood you correctly, I would rephrase your statement as:

"There are two regions because the asymptotically flat path-connected parts of spacetime are disconnected." i.e. (hence confusion) that the parts are disjoint. (is that fair?)

Disjoint sets = empty intersection; in our context re connectedness a space is disconnected if it is the union of at least two disjoint non-empty open sets. It seems to me that mathematically I could carve (any?) spacetime into three parts: two open and disjoint sets abutting a single closed set, but where is the physical justification for any particular decomposition? If I were to carve up a universe in such a way total mass is still conserved and I could say that as an object moved from one region to another the mass of one decreased and the other increased but the mass won't act as though it is located at the boundary (he asserted hesitantly).

In the case under consideration I agree that the union of the two universes is originally disconnected, and that the union remains technically disconnected even after the addition of a third closed set (the wormhole) if the union is defined only wrt to those two parts. (considering a spherical wormhole mouth from the perspective its boundary, spacetime outside is an open set; spacetime inside is an open set; the boundary is a closed set). However, the union of all three still seems connected to me.

i.e. unfortunately I still don't see where/how the disconnection arises.
In other words, to be asymptotically flat one must be able to reach flatness in all directions not merely from any point? But what constitutes a valid "direction" - I can't see that it could be other than a geodesic, in which case doesn't the original objection apply? In the presence of any (spherically symmetric) massive object there are closed geodesics, so any "non-empty" spacetime (by which I mean a horizonless spacetime containing masses but not e.g. a uniform Van Stockum dust or a fluid filled spacetime) would contain at least one such direction and therefore be disjoint... wouldn't it?

In the presence of a horizon I could be persuaded there are physically reasonable disjoint sets (from outside the horizon some geodesics fall in and reach the singularity rather than flatness, and from inside none reach out) but traversable wormholes don't have horizons.

Er... </ramble> Over to you?

Last edited by a moderator: May 4, 2017
4. Jun 19, 2009

### Julian M

Aha. A search for the definition of asymptotic flatness turned up something useful in General Relativity by Malcolm Ludvigsen (http://books.google.co.uk/books?id=...-kK&dq=define "Asymptotic flatness"&pg=PA115", see also attached quote JPG; copyrighted material, minimal quote) where he says that a spacetime is flat if the metric tends to Minkowskian along any spacelike or null direction. (He does however go on to say that the geometric definition of asymptotic flatness is "a whole branch of relativity in itself"... this is seriously non-trivial.)

However, keeping it simple for the moment, in the case under discussion, the wormhole joined universe(s) (i.e. universe(s) + wormhole) is/are not asymptotically flat because nowhere along the null direction around the wormhole throat (i.e. the path of a light ray that circulates around the throat) is spacetime Minkowskian.

It seems to me therefore that this suggests not that ADM Mass is separately conserved in the universe(s) to either side the wormhole but that the ADM Mass cannot be defined for this topology.

Whilst it might seem that each universe is separately asymptotically flat, to reach some null infinities one must pass through the wormhole. If there are two universes one might say either

A) that each "is" a universe - in which case along certain null directions there is no infinity (??) because the other end is not in the same universe and therefore that the ADM Mass cannot be defined, or

B) that the joined universes (less wormhole) taken together constitute a spacetime - in which case all null directions reach infinity (even those that pass through the wormhole) and the ADM Mass is defined for the union of the two, which seems to lead to a contradiction when we consider a mass traversing the wormhole: while the mass is within the wormhole it is not in the ADM Mass conserving spacetime at all, so somehow that spacetime has lost mass whilst at the same time conserving it; this would tend to suggest that the ADM Mass is not definable for the union of two spacetimes that are not joined by a mass conserving (at least ADM Mass) region

In case A, without ADM Mass mass can't be ascribed to a wormhole mouth because it isn't defined for either universe. And in case B, ADM Mass can't be ascribed to a wormhole mouth because it isn't defined for the union of the universes.

Having already dismissed the case of U+U+W above, it would seem that there isn't a meaningful ADM Mass for this topology (however, with nowhere to go common sense - which may be unreliable - suggests that U+U+W should conserve mass... which leads to the question: what is the appropriate equivalent of ADM Mass for this topology?)

The only downside to all this is that Visser et al are perfectly happy with ADM Mass in this context...

How do these arguments stack up with you... how do I reconcile myself to the POV of Visser et al?

#### Attached Files:

• ###### Asymptotic Flatness Defined (in 'General Relativity', by Malcolm Ludvigsen).JPG
File size:
19.9 KB
Views:
69
Last edited by a moderator: Apr 24, 2017
5. Jun 19, 2009

### George Jones

Staff Emeritus
I agree with Visser that a wormhole spacetime can have two asymptotically flat regions, that each region separately defines an ADM mass, and that Figure 11.3 is a Penrose diagram for a wormhole spacetime. Over the last few days I have been looking at Ludvigsen (I got my copy shortly after it was published) and several other books that are on my shelf.

Ludvigsen is an interesting character; see

Plan of action:

1) write down a specific wormhole metric;

2) use metric and (something like) Ludvigsen's preliminary definition definition of asymptotic flatness to find the two asymptotically flat regions;

3) use metric and (something like) equation (11.64) in Visser to find the ADM masses.

Even if you don't find my arguments convincing, it will be good for me to write them down.

First, though, I want to get to at least a couple of other threads. Also, I will be somewhat distracted by the Twenty20 semi-final that just started, and my weekends are taken up by family activities, so this likely won't happen until sometime next week.

6. Jun 19, 2009

### Julian M

George - thanks for making me think about the right things.

Having posted a short while ago, on the way home I suddenly thought, "I've answered my own question...!"

That having been said (I'll think it through more carefully and post longer later) I have to disagree with the statement that each universe has separately defined ADM mass: the joined spacetimes (less wormhole) do have a defined ADM Mass and so as a mass enters the wormhole it leaves an imprint behind ("the mass of the wormhole mouth"), and when it emerges from the other mouth it must imbue the exit mouth with the equivalent negative mass (but now I'm worrying about conservation of 4-momentum...)

I am however still uncomfortable with the situation; despite this making sense of the argument and apparently correctly applying the definition of ADM Mass, I can't help wondering whether mathematically the ADM definition is applicable to disjoint spacetimes. Would love to know there's an accepted proof of that!

More later. Thanks

Regards

Julian

7. Jun 19, 2009

### Julian M

No.... I retract... sort of.

I think I now understand why Visser et al say - by application of the ADM Mass definition - that wormhole mouths acquire/lose mass as mass passes through the wormhole.

However, attending carefully to the definition of asymptotic flatness in terms of null lines required for the ADM Mass to be defined there is only one physically justifiable decomposition of wormhole joined universes into regions for which ADM Mass can be defined - and that decomposition is not to "spherically cap" the wormhole mouths.

Hint: Think about where the asymptotic flatness breaks down... excise it. Two disjoint regions will then exist and taken together they will satisfy the requirements for having an ADM Mass (IFF it applies to disjoint regions), but the mass gain/loss regions will in fact be the same and they will cancel out. Wormhole mouths will not acquire/lose mass... but I can see how it might seem as if they do.

I'll write it up as carefully as I can over the weekend... then you can tear it to pieces.

PS The reason each separate universe on its own does not have a defined ADM mass is that neither the (implied/inferred) Visser decomposition (or the alternative) satisfy the asymptotic flatness condition: excise a closed region (e.g. the sphere of a wormhole mouth) and one is left with an open set whose curvature does not tend to zero as one approaches the boundary.

8. Jun 19, 2009

### George Jones

Staff Emeritus
Are you arguing that (11.66) and (11.67) in Visser are true, or that they are false? I can't tell from what you've written.
Which boundary? The boundary of the stuff that was removed? Curvature does not have to tend to zero as this boundary is approached.

9. Jun 20, 2009

### Julian M

Hmmm.... I do tend to have a "shoot first, ask questions later approach." This would be so much easier at a whiteboard where as soon as I open my mouth you could tell me I've put my foot in it. (NB - I can't work out to "multiquote" properly)

To be honest, I was saying that 11.66 and 11.67 are false. However, on a closer reading I see that Visser is clear that the appropriate criterion for ADM mass is spatial infinity. Ludvigsen's statement re asymptotic flatness "along any spacelike or null direction" refers to two different forms of flatness. With reference to spacelike infinity one has the ADM Mass to work with; with reference to null infinity one has the Bondi energy (this I have only just discovered). I was considering only null infinity... thus conflating the ADM Mass (used by Visser) and the Bondi energy (which he didn't). Whether the choice of criterion for flatness ultimately makes any difference I don't know

And to say why I was disputing 11.66/67: I thought that (imagining the wormhole to progressively narrow and grow along its length) there was only one place where the null direction never became flat: around the narrowest point of the throat. I thought that if that infinitesimally thin region were excised - so as to leave a disjoint but asymptotically flat pair of universes either side, a traversing mass would deposit mass on one side of this region and take it away on the other side, and being infinitesimally thin the effects would cancel out.

However I am no longer sure of the shape of the region within the wormhole where the asymptotic flatness condition(s) are broken, i.e. what would need to be excised. I am though still of the opinion that the "spherical cap" of either mouth is not physically justifiable as the boundary of that region: I see no problem (this could be just poor sight, I admit) reaching spatial or null infinity from within either mouth.

With regard to the "which boundary" question - boundaries being the crux of the issue - that the curvature does not have to tend to zero approaching the boundary was the point I was making.

If we divide out joined universes into three parts - universes A & B, and the wormhole - and, say, bound the wormhole with a closed region, then each universe is an open region but, as we agree, approaching the interface of the open/closed from within A (or B) the curvature does not tend to zero and thus the asymptotic flatness requirement of ADM Mass is not met for either universe on its own.

With your facility with real math you might be able to shed some more light on these questions... but I would hesitate to ask after making such a (repeated) fool of myself... though if you're already on it - don't stop!

PS I have just found a reprint of Arnowitt, Deser, Misner's original work on the Hamiltonian that led to the derivation of ADM mass... it was reprinted at arXiv; from the abstract
the pdf is http://lanl.arxiv.org/PS_cache/gr-qc/pdf/0405/0405109v1.pdf". Alas the math is orders of magnitude beyond me, but you would get a lot out of it I'm sure. Ah... you already have the book

Last edited by a moderator: Apr 24, 2017
10. Jun 20, 2009

### Julian M

PS... I'm off to have a look at http://relativity.livingreviews.org/Articles/lrr-2004-1/" [Broken] on Conformal Infinity at Living Reviews in Relativity

Last edited by a moderator: May 4, 2017
11. Jun 20, 2009

### Julian M

Just for info... at the Living Reviews in Relativity article on Conformal Infinity http://relativity.livingreviews.org/open?pubNo=lrr-2004-1&page=articlesu3.html" [Broken], esp the point about 1 screen down where it says

Last edited by a moderator: May 4, 2017
12. Jun 20, 2009

### George Jones

Staff Emeritus
Condition (3) is satisfied by spherically symmetric traversable wormholes. Condition (3) is not satisfied by spherically symmetric black holes because of the null geodesics on the photon sphere,

Embedding diagrams for wormholes, like, for example, the diagram on Visser's cover, represent one instant of "time". Consequently, any curve drawn on such a diagram is necessarily spacelike (never lightlike or timelike).

Last edited by a moderator: May 4, 2017
13. Jun 20, 2009

### DrGreg

Press "multiquote" in each of the messages you want to quote from. The button turns blue to indicate you have selected that message for multiquoting. When you've selected them all, press "quote" in one of them. You can even do a quote-within-a-quote with a bit of copy-&-paste inside a multiquote.

14. Jun 20, 2009

### Julian M

Thanks Dr Greg

15. Jun 20, 2009

### Julian M

You mean light would not circle around the wormhole at its narrowest point? Ah. I must confess I have great difficulty visualising wormholes so intuition has led me very astray - can you help me to understand why? (apart from the embedding diagram limitations).

Second point though - if a wormhole spacetime is properly asymptotically flat (as opposed to weakly asymptotically flat) then isn't the whole universe + wormhole + universe asymptotically flat? And why then is it described as separate regions?

I don't know whether things are becoming clearer or murkier, but the input is much appreciated George.

16. Jun 21, 2009

### Julian M

Two points about the spacelike nature of the embedding diagram... My hardcopy of Visser is in storage in England - I'm in Budapest - but the cover can be seen at Matt Visser's pages http://homepages.ecs.vuw.ac.nz/~visser/book.shtml"

1. Agreed, it is a view at an instant - but if the wormhole is static it is surely also a view at all instants, isn't it? So could I not draw a line on it and label it with t intervals to indicate movement?

2. Though I would still like to understand why there is no closed null geodesic in the wormhole throat, accepting this for the moment it occurs to me that, http://relativity.livingreviews.org/open?pubNo=lrr-2004-1&page=articlesu3.html" [Broken], this would lead to the wormhole being asymptotically null flat whereas for ADM Mass to be defined we require asymptotic spacelike flatness.

Agreeing that any interval drawn on the standard embedding diagram when viewed at an instant is spacelike, do we not have a closed spacelike curve if we cut the throat with a plane perpendicular to the axis of symmetry? If this is a closed spacelike curve, it is nowhere flat and does not reach infinity, and we would not seem to have asymptotic spacelike flatness for the combination of universe + wormhole + universe. This does not go against the ADM Mass argument for wormhole mouths per se, it merely returns us to the status quo ante of having >2 regions to consider.

Visser acknowledges that use of the ADM Mass neglects radiation to infinity,
but the argument is given in terms of ADM Mass, yet if the wormhole is null flat, and the universes either side are too, then isn't the whole is null flat? In which case, wouldn't the argument in terms of Bondi energy suggest conservation for the whole, in apparent contradiction to the ADM perspective?

I am going away now to do the promised re-write ab initio...

Last edited by a moderator: May 4, 2017
17. Jun 24, 2009

### George Jones

Staff Emeritus
If done with mathematical care, yes; if done arbitrarily, maybe, no.
My intuition that wormhole spacetime is not "curved enough" to allow circular light orbits was wrong. A calculation that I did yesterday morning showed that there is exactly one (unstable) circular light orbit located at the throat minimum (and nowhere else). Not trusting my calculation, I looked through the literature and found two papers by Thomas Muller that verify this:

"Visual appearance of a Morris-Thorne-Wormhole," American Journal of Physics 72, 1045-1050 (2004);

"Exact geometric optics in a Morris-Thorne wormhole spacetime," Physical Review D 77, 044043 (2008).

I have not found any freely available on-line versions of these papers, but I haven't looked very hard.
I'm not sure what you mean here. There are two asymptotically flat regions, and I hope to soon post a mathematical demonstration of this using a simple definition of asymptotically flat.
ADM and Bondi masses are the same for all stationary spacetimes, and hence for all static spacetimes as well.

Last edited: Jun 24, 2009
18. Jun 24, 2009

### Julian M

You beat me to it: I had also looked again at the metric and for constant theta, l=0, phi seemed to cancel out the dt... suggesting precisely what I had "intuited" (an unreliable source at the best of times) but I was hesitant - unpacking old calculus etc. one wonders whether what seemed automatic was right. I still want to work it out/see it explicitly but it's nice to have confirmation that the throat (precisely) is a null geodesic. Yes it's unstable but we are being purely classical here... (if we went quantum then there would probably definitely be nowhere that violated the flatness conditions, so the whole system would be a single mass conserving region).

[I'll see if I can find any of those papers online... some good places are not indexed; the original MTY 1988 paper took ages to track down]

Yes, I understand that the Bondi-Sachs energy is most often used in considering radiation, so from POV of a static spacetime they would be equivalent.

I do see that there are two asymptotically flat "regions" in the broadest sense of the term "region" (for a pair of conjoined universes): in the sense that there are two values for l ($$\pm\infty$$) at which spacetime is flat, but I am hoping that your calculation would show where the boundaries are and established why the regions meet the criteria for flatness required to define ADM Mass.

I do note however on reading around further that the "location of the mouth" is not well defined, so I am beginning to suspect that "mass of the wormhole mouth" refers to the mass attributed to the wormhole per se as seen from either side.

Still working on (intermittently - more of a weekend task) the overall argument, but since the throat (r = rmin) of the wormhole is the source of non-flatness - both spacelike and null - if that alone is excised the mass ought, I feel to be attributed to the two sides of this excision... at which point I would start repeating myself, and I'm leaving that for the re-write.

We shall see.

Very glad you're on the case George.

19. Jun 26, 2009

### Julian M

I thought it was worth looking for these but after employing the "usual techniques" was unable to find them freely available.

I did however recall on seeing Muller's home page that I have a another paper by him. For anyone who is interested, this one is freely available.

"How computers can help us in creating an intuitive access to relativity" Hanns Ruder, Daniel Weiskopf, Hans-Peter Nollert and Thomas Müller

Online at http://www.njp.org/ doi:10.1088/1367-2630/10/12/125014

With regard to the visualisation of null geodesics within a wormhole Fig 15 shows null lines equally inclined either side the d$$\phi$$ direction emerging symmetrically from opposite mouths...

format: plain


text:
# A slab of insulating material of uniform thickness d, lying between \frac{-d}{2} to \frac{d}{2} along the x axis, extends infinitely in the y and z directions, as shown in the figure. The slab has a uniform charge density \rho. The electric field is zero in the middle of the slab, at x=0. Which of the following statements is true of the electric field E_{vec} at the surface of one side of the slab?

Question
Other
A slab of insulating material of uniform thickness d, lying between $$\displaystyle{\frac{{-{d}}}{{{2}}}}$$ to $$\displaystyle{\frac{{{d}}}{{{2}}}}$$ along the x axis, extends infinitely in the y and z directions, as shown in the figure. The slab has a uniform charge density $$\displaystyle\rho$$. The electric field is zero in the middle of the slab, at x=0. Which of the following statements is true of the electric field $$\displaystyle{E}_{{{\vec}}}$$ at the surface of one side of the slab?

2021-04-15
(a) Both the magnitude and the direction of Electric Field (E) are constant across the entire surface.
(b) $$\displaystyle\theta={1.57}\ {r}{a}{d}$$
(c) As implied by the fact that E(out) is not given as a function of x, this magnitude is constant everywhere outside the slab, not just at the surface.
$$\displaystyle{E}_{{{o}{u}{t}}}={\frac{{{d}\rho}}{{{2}\cdot\epsilon_{{0}}}}}$$
(d) $$\displaystyle{E}_{{\in}}={p}{h}{o}\cdot{\frac{{{X}}}{{\epsilon_{{0}}}}}$$

### Relevant Questions

A long, straight, copper wire with a circular cross-sectional area of $$\displaystyle{2.1}{m}{m}^{{2}}$$ carries a current of 16 A. The resistivity of the material is $$\displaystyle{2.0}\times{10}^{{-{8}}}$$ Om.
a) What is the uniform electric field in the material?
b) If the current is changing at the rate of 4000 A/s, at whatrate is the electric field in the material changing?
c) What is the displacement current density in the material in part (b)?
d) If the current is changing as in part (b), what is the magnitude of the magnetic field 6.0cm from the center of the wire? Note that both the conduction current and the displacement currentshould be included in the calculation of B. Is the contribution from the displacement current significant?
Assume that a ball of charged particles has a uniformly distributednegative charge density except for a narrow radial tunnel throughits center, from the surface on one side to the surface on the opposite side. Also assume that we can position a proton any where along the tunnel or outside the ball. Let $$\displaystyle{F}_{{R}}$$ be the magnitude of the electrostatic force on the proton when it islocated at the ball's surface, at radius R. As a multiple ofR, how far from the surface is there a point where the forcemagnitude is 0.44FR if we move the proton(a) away from the ball and (b) into the tunnel?
A charged wire of negligible thickness has length 2L units and has a linear charge density ?. Consider the electric field E? at the point P, a distance d above the midpoint of the wire.
Nerve cells are long, thin cylinders along which electric disturbances (nerve impulses) travel. The cell membrane if a typical nerve cell consists of an inner and outer wall separated by a distance of $$\displaystyle{0.10}\mu{m}$$. The electric field within the cell membrane is $$\displaystyle{7.0}\cdot{10}^{{{5}}}$$ N/C. Approximating the cell membrane as a parallel plate capacitor, determine the magnitude of the charge density on the inner and outer cell walls.
An infinitely long rod of radius R carries a uniform volume charge density PKS\rho\ (\rho > 0)ZSK.
a) Show how to use Gauss' Law to prove that the electric field inside this rod points radially outward and has magnitude.
$$\displaystyle{E}={\frac{{\rho\cdot{r}}}{{{2}\cdot\epsilon_{{0}}}}}$$
b) Integrate the electric field over an appropriate displacement to find the potential difference from the rod's surface to its axis. State explicity which of those two locations is at the higher potential.
The student engineer of a campus radio station wishes to verify the effectivencess of the lightning rod on the antenna mast. The unknown resistance $$\displaystyle{R}_{{x}}$$ is between points C and E. Point E is a "true ground", but is inaccessible for direct measurement because the stratum in which it is located is several meters below Earth's surface. Two identical rods are driven into the ground at A and B, introducing an unknown resistance $$\displaystyle{R}_{{y}}$$. The procedure for finding the unknown resistance $$\displaystyle{R}_{{x}}$$ is as follows. Measure resistance $$\displaystyle{R}_{{1}}$$ between points A and B. Then connect A and B with a heavy conducting wire and measure resistance $$\displaystyle{R}_{{2}}$$ between points A and C.Derive a formula for $$\displaystyle{R}_{{x}}$$ in terms of the observable resistances $$\displaystyle{R}_{{1}}$$ and $$\displaystyle{R}_{{2}}$$. A satisfactory ground resistance would be $$\displaystyle{R}_{{x}}{<}{2.0}$$ Ohms. Is the grounding of the station adequate if measurments give $$\displaystyle{R}_{{1}}={13}{O}{h}{m}{s}$$ and R_2=6.0 Ohms?
A 0.30 kg ladle sliding on a horizontal frictionless surface isattached to one end of a horizontal spring (k = 500 N/m) whoseother end is fixed. The ladle has a kinetic energy of 10 J as itpasses through its equilibrium position (the point at which thespring force is zero).
(a) At what rate is the spring doing work on the ladle as the ladlepasses through its equilibrium position?
(b) At what rate is the spring doing work on the ladle when thespring is compressed 0.10 m and the ladle is moving away from theequilibrium position?
$$\displaystyle{E}={5.0}\times{10}^{{3}}\frac{{N}}{{C}}$$


text:
# Solenoid and toroid inductance puzzle

## Main Question or Discussion Point

Im working with building a reluctance motor and ive posed a problem to myself that i cannot answer without questioning some long accepted facts about the inductance of a solenoid.

The simple solenoid and toroidal solenoid are two shapes that seem to have simple equations for calculating the inductance/B field.
e.g:
http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/indtor.html
http://hyperphysics.phy-astr.gsu.edu/hbase/electric/indsol.html

for my puzzle see attachment...

Panel 1:
I start with the inductance of a toroid, a completed magnetic circuit which has a inductance and B field for which I agree with the online equation as quoted.

Panel 2:
I add an airgap in the toroid. The magnetic circuit now has a break in it, so the complete circuit needs to take into account for the air and the iron that it passes through. This is done using the reluctance of the two materials, the metal and the air. the result presented as i understand it, now 1/4 of the flux path is in air.

Panel 3:
A 'simple' solenoid where over half the flux path must be through the air. since the relative permeability of the air is so much smaller this part should be the dominent term. making the B field considerably smaller than the value normally quoted!

I have not neglected to include effects of the obvious change in area that the flux is passing through when it is not 'confined' to the metal, so this is oversimplified... BUT this does not explain away the piece of physics that I am questioning here.

Have I made a foolish mistake here or has virtually every physicist/engineer in history learnt something thats fundamentally wrong? which i find hard to believe.

This has confused me for far too long, which is it?

Woody

#### Attachments

• 21.1 KB Views: 708

Related Electrical Engineering News on Phys.org
The inductance of a gapped toroid can be calculated by equating the stored electrical energy ½LI2 and the stored magnetic energy ½∫BH dV:

$$\frac{1}{2}LI^2=\frac{1}{2}\int_V BHdV = \frac{\mu\mu_0}{2}\frac{A_i_r_o_nN^2I^2}{\ell_i_r_o_n}+\frac{\mu_0}{2}\frac{A_g_a_pN^2I^2}{\ell_g_a_p}$$

where $$H=NI/\ell$$ and B = μH in gap and μμ0H in iron, Airon and Agap are the cross sectionional areas of the flux, and volume V =2 πrA, and $$2\pi r = \ell_g_a_p + \ell_i_r_o_n$$. Rewriting, we get

$$L = \mu_0N^2[\frac{\mu A_i_r_o_n}{\ell_i_r_o_n}+\frac{A_g_a_p}{\ell_g_a_p}]$$

Agap is larger than Airon because Blongitudinal is continuous in the iron and gap, while Hparallel is continuous across the iron-gap boundary.
This leades to "refraction" and Snell's Law across the iron-gap boundary, just like light in glass.

Bob S

Last edited:
$$L = \mu_0N^2[\frac{\mu A_i_r_o_n}{\ell_i_r_o_n}+\frac{A_g_a_p}{\ell_g_a_p}]$$
So.. If we imagine that lgap is very small, then the equation should become equal to the original toroid equation. Agap will approximately equal to Airon. So... the second term in that equation appears to blow up rather than diminish to zero as should be expected.

and yes... I had an equation that produced that mistake at some point, which I think is in part what lead me to the original problem described.

You are right. The correct solution is shown in the thumbnail. Basically, although

$$\int_C H d\ell = NI$$

H is not continuous around the loop C, so H≠ NI/ l. Only B is continuous. Equation (5) in the thumbnail shows the correct result.

Bob S

#### Attachments

• 52.6 KB Views: 601
So... back to my original question:

Does this imply that the inductance of a solenoid, frequently quoted in textbooks, is actually wrong? as in panel 3 in my original post

Calculating the inductance of a solenoid with iron is very difficult, but for a magnetic circuit with a small gap like the thumbnail in my previous post, the calculation is the following. Use the relation

$$\frac{1}{2}LI^2=\frac{1}{2\mu\mu_0}\int_VB^2\;dV_v_o_l=\frac{1}{2\mu\mu_0}\int_VB^2\;dV_i_r_o_n+\frac{1}{2\mu_0}\int_VB^2\;dV_g_a_p$$

for the stored energy in the iron and a small gap, and use (from the thumbnail in my previous post)

$$B=\frac{\mu\mu_0NI}{\ell_i_r_o_n+\mu\ell_g_a_p}$$

for the magnetic field in both the iron and the gap. Here, $$\ell = \ell_i_r_o_n +\ell_g_a_p$$. Turn the crank and get an expression for the inductance L.
This does not correctly handle the fringe field in the gap for a large gap, but an adjustment in the cross sectional area in the gap should improve the accuracy.

In an air-filled solenoid, half the stored magnetic energy is inside the solenoid, and half outside. For a solenoid with the interior filled with iron, nearly all the magnetic energy is outside.

Here is the on-axis field inside a short air-filled solenoid.

http://www.netdenizen.com/emagnettest/solenoids/?solenoid

For short air-filled solenoids (single-turn loops), you should look at Smythe Static and Dynamic Electricity (Third Edition) page 339. For N turns, multiply by N2.

[added] For the integration, use $$V_i_r_o_n=A_i_r_o_n\ell_i_r_o_n\;\;and\;\;V_g_a_p=A_g_a_p\ell_g_a_p$$

For small gaps, $$\;\;\;A_i_r_o_n=A_g_a_p$$

Bob S

Last edited:


text:
# Math Help - Don't understand question

1. ## Don't understand question

The weight of a large herd of goats was found to have a distribution that is approximately normal with mean 70.8 kg and standard deviation 6.4 kg. What is the probability that the sum of their weights is less than 145 kg?

Do I use cumulative probability? I don't know how to get a probability of a sum of values.

2. ## Re: Don't understand question

Hey yvonnehr.

Recall that the sum of normal distributions is a normal distribution where the final variance is the sum of all individual variances (if they are all independent) and the mean is the sum of all the means.

If you have n independent observations with variance sigma^2 and mean mu then the sum will be distributed Normal(n*mu,n*sigma^2) which means you can use this to calculate a probability of the sum of the weights.


text:
# Question about the depth buffer

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

## Recommended Posts

After doing exhaustive research on the issue and not finding any definitive answers, I was hoping somebody here could clear up a few things about the depth buffer... From what I read, pixel z-values are stored in the depth buffer relative to the viewer's eye position, and scaled relative to the near and far clipping planes, with a final value somewhere between 0.0 and 1.0. What I have is 2 cubes in 3D space. For simplicity, say their width's are 10 units, with cube1's center at (0,0,0) and cube2's at (0,0,-100). Cube1 is drawn before cube2. I have the following flags set: glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); Of course, I'm clearing the depth buffer with 1.0. Here's the problem - currently I have implemented a camera with 6 degrees of freedom, so the player is free to move around these cubes in any orientation. If the viewer's eye is looking at the cubes down the -z axis at a slight angle, both cubes appear correctly (cube2 being slightly hidden by cube1). However, if the viewer now moves to the opposite side of the cubes and looks up the +z axis, cube1 is not properly hidden behind cube2. In fact, some weird graphical artifacts occur depending on how you are looking at the cubes (in some cases it looks like a poor attempt at blending even though blending is not enabled). In fact, if I draw the first cube with the depth buffer enabled, and draw the second with the depth buffer disabled, the first cube is visible at all times, no matter where the viewer is positioned. Now my thoughts are, if the depth buffer value for each pixel really IS relative to the viewer's current position and viewing frustrum, why is one cube visible at all times and only one cube properly hidden? If the depth value is relative to the objects actual position in space then this makes sense. Does the order objects are drawn really matter? I though the whole point of the depth buffer was to eliminate the need for a specific drawing order. An proper explanation of the depth buffer and why I'm seeing the errors I am would be greatly appreciated. -Q

##### Share on other sites
Your context may not have a depth buffer, in which case enabling depth testing does nothing.

How did you create the context?

##### Share on other sites
I created the context the usual way:

hRC=wglCreateContext(hDC)

as well as

wglMakeCurrent(hDC,hRC)

I also made use I set depth buffer bits to 16 in the PFD. Depth testing does seem to be functioning properly from a certain angle, just not every angle.

##### Share on other sites
What is your projection matrix? I have the slight suspicion you have set your near plane to 0.0

##### Share on other sites
Depth testing is done in eye-coords. So the position of your camera matters.
If you have blending on(you said no) then you have to draw from back to front.
To speed some things up you want to draw opaque things from front to back.

That said, the depth buffer should let you draw opaque things in any order and get the correct
output from the program.
You could try changing the order of things, GL_GEQUAL and clear to 0.0 ... but I doubt that will change anything.

##### Share on other sites
I've set my near plane to .001, far to 100000. I know that seems a bit excessive, but for the time being I'm rendering a rather large 'grid world' that I was using to debug camera movement. The odd thing is that if I set the near plan to .1, and the far plane to 1000 and just render the cubes, I can't see them no matter where I'm positioned. Even stranger, every definition of gluPerspective I've read states that the near plane MUST be a positive number, but I've experimented with mine at -1.0 and everything renders just fine.

I'm thinking the drawing order of objects for my case does matter, regardless of depth buffer setting. What I'm trying to avoid is being able to see a projectile (like a laser or a missle) on screen if it is behind a player or another object; the object still needs to show up if it flies in front of another player or object from the viewer's perspective. This is easy if the player doesn't move, but the engine I'm building is designed to support space-combat simulation type games.

##### Share on other sites
So I read NeHe's lesson 32 again for the 12th time or so, and I think the solution to my problem lies in the order my objects are being drawn. I know my depth buffer works fine when the cube that is supposed to be furthest away is drawn first, and the closer cube is drawn last. NeHe's tutorial talks about sorting (picking) of objects, which seems like a simple solution to this problem.

If any body uses another method of object sorting, especially in large open spaces, please share.

##### Share on other sites
The depth buffer definately does not need any object sorting in order to work right. That's not your problem, but I really don't know what it is. There must be something wrong with your matrix setup, but I can't say without looking at the code.

##### Share on other sites
Quote:
 From msdn:Depth-buffer precision is affected by the values specified for znear and zfar. The greater the ratio of zfar to znear is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. If r = far / nearroughly log (2) r bits of depth buffer precision are lost. Because r approaches infinity as znear approaches zero, you should never set znear to zero.

It sounds like your depth buffer is working, but because of the huge ratio between far and near (100000/0.001 = 100000000!) it lacks precision.
Try setting the far plane to something like 1000 and the near plane to 1.
This will reduce the ratio to 1000 while increasing the precision. For your scene it will hardly make a difference, as both cubes will still between far and near.
Alternatively, you could increase the precision of the depth buffer by setting its bits to 24 or 32 in the PFD. I'd prefer my first solution though.

##### Share on other sites
Quote:
 Original post by mikemanThe depth buffer definately does not need any object sorting in order to work right. That's not your problem, but I really don't know what it is. There must be something wrong with your matrix setup, but I can't say without looking at the code.

Are you certain about that? Don't forget that the viewer in my app has complete freedom of movement, so even if the depth buffer works fine when the viewer is looking straight at the cubes, what is supposed to happen when the viewer moves behind the cubes and looks at them from the opposite direction?

Thanks for the MSDN reference...I'll have to play around with my near/far clipping planes some more.

1. 1
2. 2
JoeJ
20
3. 3
frob
17
4. 4
5. 5

• 10
• 10
• 11
• 13
• 9
• ### Forum Statistics

• Total Topics
632197
• Total Posts
3004728

×


text:
Main Content

Control System with Tunable Components

This example shows how to create a tunable model of the control system in the following illustration.

The plant response is $G\left(s\right)=1/\left(s+1{\right)}^{2}$. The model of sensor dynamics is $S\left(s\right)=5/\left(s+4\right)$. The controller $C$ is a tunable PID controller, and the prefilter $F=a/\left(s+a\right)$ is a low-pass filter with one tunable parameter, $a$.

Create models representing the plant and sensor dynamics. Since the plant and sensor dynamics are fixed, represent them using numeric LTI models zpk and tf.

G = zpk([],[-1,-1],1);
S = tf(5,[1 4]);

Create a tunable representation of the controller $C$.

C = tunablePID('C','PID');

C is a tunablePID object, which is a Control Design Block with a predefined proportional-integral-derivative (PID) structure.

Create a model of the filter $F=a/\left(s+a\right)$ with one tunable parameter.

a = realp('a',10);
F = tf(a,[1 a]);

a is a realp (real tunable parameter) object with initial value 10. Using a as a coefficient in tf creates the tunable genss model object F.

Connect the models together to construct a model of the closed-loop response from $r$ to $y$.

T = feedback(G*C,S)*F
T =

Generalized continuous-time state-space model with 1 outputs, 1 inputs, 5 states, and the following blocks:
C: Tunable PID controller, 1 occurrences.
a: Scalar parameter, 2 occurrences.

Type "ss(T)" to see the current value, "get(T)" to see all properties, and "T.Blocks" to interact with the blocks.

T is a genss model object. In contrast to an aggregate model formed by connecting only Numeric LTI models, T keeps track of the tunable elements of the control system. The tunable elements are stored in the Blocks property of the genss model object.

Display the tunable elements of T.

T.Blocks
ans = struct with fields:
C: [1x1 tunablePID]
a: [1x1 realp]

You can use tuning commands such as systune to tune the free parameters of T to meet design requirements you specify.

Control System Toolbox Documentation

Learn how to automatically tune PID controller gains

Download code examples


text:
# Gambling Strategies for Penny Slot Players¶

Note: If you or anyone else you know has a gambling problem, call the National Problem Gambling hotline: 1-800-522-4700

My girlfriend and I like to hit the casino from time to time, and we get a kick out of the penny slots. We place small bets and aim to spend no more than 100 dollars total per session. Now - any "real" gambler would say that the slot machines are a waste of time because they favor the house much more than table games, where you actually make decisions that affect the outcome. And they'd be correct. But what can I say. We like slots!

The slots at the casino we go to roughly pay out 95% of the money they take in over an infinite amount of time. This long-term percentage of payback is known as the RTP, or Return to Player. But we're not gambling for infinitely long and we don't have an infinite pool of money. Rather than thinking in these terms, we will consider a more realistic scenario. The question is: is there a superior strategy for someone gambling with hard spending and time limits? Or is everything so random under these constraints that you might as well do whatever you want?

We will study two kinds of machines that vary in what is called volatility - basically the payout variance. Highly volatile machines pay out big but rarely, while low-volatility machines distribute small payouts more often but the jackpot is not as large. Low-volatility machines have become quite popular with casino owners in Vegas as the small payouts keep people hooked and playing for longer.

We will run many simulations on these types of machines, and see how the results change with our betting strategies. We will also consider what happens if we change the bet size as we win, to see if we can improve our average returns.

## Games and Probability Distributions¶

### Low-Medium Volatility Game: 20-Line Cleopatra¶

Cleopatra is an egyptian-themed game by IGT. The odds have been broken down by The Wizard Of Odds and Casino Guru, so we can simulate our winnings quite realistically!

Photo from The Wizard of Odds

20-Line is best explained in contrast with 1-Line (which we will get to later as the high volatility version of this game). With only one line, your only way to win is to get multiple symbols in a row horizontally. This is your "line". But when you play more lines, you can get wins in more directions (diagonally, vertically, etc.). 20 lines is your maximum in Cleopatra.

Below we will enter and visualize the probability distribution for 20-line Cleopatra.

(Note that while there is a bonus/free spin feature, the probability distribution is constructed such that the payout structure is the same, but free spins are not included in simulations. This makes life easier.)

In [1]:
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as st
%matplotlib inline
In [2]:
# Possible intervals you could fall into
# [0, 0.2] is losing, the rest are winning intervals
# If you fall in an interval, multiply your total bet by a random number in the interval to get your winnings
# For example, for a 30 cent bet: you land in [2., 5.]. Select a random number "x" from a uniform dist. in [2,5].
# Your winnings are 0.3 * x in dollars
intervals20 = np.array([
[0., 0.2],
[0.2, 0.5],
[0.5, 1.],
[1., 2.],
[2., 5.],
[5., 10.],
[10., 20.],
[20., 50.],
[50., 100.],
[100., 200.],
[200., 500.],
[500., 1000.]])

# This is a scaled version of the winning probability distribution from Casino Guru.
# This corresponds to all entries in "intervals20" except the first entry, which is the losing interval.
# The multiplication factor 0.798... ensures that expected return is 95.025%
cleopatra20_prob = 0.7987446566693283 * np.array(
[929482, 740452, 563289, 1031867, 149001, 92050, 58006, 17450, 3538, 505, 20]
) / 10000000.

# The first entry is the probability of losing and corresponds to the interval [0., 0.2]
cleopatra20_prob = np.array([1-np.sum(cleopatra20_prob), *cleopatra20_prob])

# construct probability distribution
xk20 = np.arange(len(cleopatra20_prob))
cleopatra20_model = st.rv_discrete(name='cleopatra', values=(xk20, cleopatra20_prob))

# Confirm that expected return from winnings is 95.025%
interval20_avg = np.array([np.mean(x) for x in intervals20[1:]])
print('Expected return is {}%'.format(100 * np.dot(cleopatra20_prob[1:], interval20_avg)))
Expected return is 95.02499999999999%
In [3]:
# plot probability distribution
fig, ax = plt.subplots(1, 1, figsize=(15,4))
labels20 = ['->{}x'.format([entry[-1] if entry[-1] < 1 else int(entry[-1])][0]) for entry in intervals20]
ax.plot(xk20, cleopatra20_model.pmf(xk20), 'ro', ms=8, mec='r')
labels20[0] = 'Loss'
ax.set_xticks(xk20)
ax.set_ylabel('Probability')
ax.set_xlabel('Win Category (multiples of wager)', labelpad=15)
tmp = ax.set_xticklabels(labels20)

So we have roughly a 70% chance of losing. It helps to look at the winnings on a log scale.

In [4]:
# And the winnings on a log scale
fig, ax = plt.subplots(1, 1, figsize=(15,4))
ax.plot(xk20[1:], cleopatra20_model.pmf(xk20)[1:], 'bo', ms=8, mec='b')
ax.set_xticks(xk20[1:])
tmp = ax.set_xticklabels(labels20[1:])
ax.set_yscale('log')
ax.set_ylabel('Probability')
ax.set_xlabel('Win Category (multiples of wager)', labelpad=15)
Out[4]:
Text(0.5, 0, 'Win Category (multiples of wager)')

### High Volatility Game: 1-Line Cleopatra¶

The alternative to playing all 20 lines on Cleopatra is playing just 1 line. The 1-line version of the game is much more volatile. The payouts are less frequent, but no payout is less than double what you paid, and the max payout goes up to 20,000 times your bet!

The RTP is the same as before: 95.025%.

In [5]:
# [0., 2.] is the losing interval
intervals1 = np.array([
[0., 2.],
[2., 5.],
[5., 10.],
[10., 20.],
[20., 50.],
[50., 100.],
[100., 200.],
[200., 500.],
[500., 1000.],
[1000., 2000.],
[2000., 5000.],
[5000., 10000.],
[10000., 20000.]
])

# Payout is 95.025% with this scaling
cleopatra1_prob = 0.7233308569575265 * np.array(
[8761210, 628815, 1008567, 544354, 273149, 82322, 52222, 8952, 1532, 411, 21, 6]
) / 100000000.

cleopatra1_prob = np.array([1-np.sum(cleopatra1_prob), *cleopatra1_prob])

# construct probability distribution
xk1 = np.arange(len(cleopatra1_prob))
cleopatra1_model = st.rv_discrete(name='cleopatra', values=(xk1, cleopatra1_prob))

# Confirm that expected return from winnings is 95.025%
interval1_avg = np.array([np.mean(x) for x in intervals1[1:]])
print('Expected return is {}%'.format(100 * np.sum(cleopatra1_prob[1:] * interval1_avg)))
Expected return is 95.02499999999998%

Let's now compare the two probability distributions.

In [6]:
p20_win = np.sum(cleopatra20_prob[1:])
p1_win = np.sum(cleopatra1_prob[1:])
print('The probability of winning in 20-Line Cleopatra is {}%'.format(100 * p20_win))
print('The probability of winning in 1-Line Cleopatra is {}%'.format(100 * p1_win))
The probability of winning in 20-Line Cleopatra is 28.64026765632943%
The probability of winning in 1-Line Cleopatra is 8.218167654505212%

So you have a greater chance of winning something back in the 20-line game than the 1-line game. But when you do win, the winnings will be much higher in 1-Line than 20-Line Cleopatra.

In [7]:
avgwin_20 = np.sum(interval20_avg * cleopatra20_prob[1:]) / np.sum(cleopatra20_prob[1:])
avgwin_1 = np.sum(interval1_avg * cleopatra1_prob[1:]) / np.sum(cleopatra1_prob[1:])
print('Your average earnings in 20-Line Cleopatra are {} per win'.format(avgwin_20))
print('Your average earnings in 1-Line Cleopatra are {} per win'.format(avgwin_1))
Your average earnings in 20-Line Cleopatra are 3.3178810037761535 per win
Your average earnings in 1-Line Cleopatra are 11.56279647664612 per win

The product between the probability of winning and average earnings per win gives you the return of 95.025% in both games.

In [8]:
print(p20_win * avgwin_20)
0.95025
In [9]:
print(p1_win * avgwin_1)
0.9502499999999998

Here's a visualization of the two distributions.

In [10]:
fig, ax = plt.subplots(1, 1, figsize=(17,4))
labels = list(labels20)

# these were all the intervals between two distributions
# 0, 1, 2, 3 are losing for the 1-line game
# 0 is losing for the 20-line game
all_intervals = np.array([
[0., 0.2],
[0.2, 0.5],
[0.5, 1.],
[1., 2.],
[2., 5.],
[5., 10.],
[10., 20.],
[20., 50.],
[50., 100.],
[100., 200.],
[200., 500.],
[500., 1000.],
[1000., 2000.],
[2000., 5000.],
[5000., 10000.],
[10000., 20000.]
])
labels = ['->{}x'.format([entry[-1] if entry[-1] < 1 else int(entry[-1])][0]) for entry in all_intervals]
labels[0] = 'Loss'
ax.plot(xk20, cleopatra20_model.pmf(xk20), 'ro', ms=8, mec='r', label='20 Lines')
ax.plot([0] + list(range(4, 16)), cleopatra1_model.pmf(xk1), 'bo', ms=8, mec='b', label='1 Line')
ax.set_xticks(range(len(labels)))
ax.legend()
tmp = ax.set_xticklabels(labels)
ax.set_ylabel('Probability')
ax.set_xlabel('Win Category (multiples of wager)', labelpad=15);

It's easier to see the difference between winnings on a log scale

In [11]:
fig, ax = plt.subplots(1, 1, figsize=(15,4))
y20 = cleopatra20_model.pmf(xk20)
y1 = cleopatra1_model.pmf(xk1)
ax.plot(xk20[1:], y20[1:], '-r', label='20 Lines')
ax.fill_between(xk20[1:], 0, y20[1:], alpha=0.5, color='red')
ax.plot(list(range(4, 16)), y1[1:], '-b', label='1 Line')
ax.fill_between(list(range(4, 16)), 0, y1[1:], alpha=0.5, color='blue')
ax.set_xticks(range(len(labels)))
labels[0] = ''
tmp = ax.set_xticklabels(labels)
ax.set_yscale('log')
ax.legend()
ax.set_ylabel('Probability')
ax.set_xlabel('Win Category (multiples of wager)', labelpad=15);

So the 1-line distribution allows for bigger wins with a lower probability.

## Simulations: Fixed Strategies¶

Finally - let's get to some simulations! In general we'll model our casino sessions as follows:

• We bet until we run out of money, or we're at or beyond the 3 hour mark.
• Each game takes 5 seconds. Switching machines takes 30 seconds.
• We both switch when we hit a big win (arbitrarily defined as 10 dollars).
• Lori only switches when she hits a big win, while Ben also switches when he dips below 90 cents on a game (aka three times his bet).

The last bullet point takes into account our different gambling styles. It means I end up playing fewer games than Lori because I spend more time hopping around. We'll see what effect this has on the results!

For each scenario, 1000 simulations are run. The maximum number of games played per session is the number of seconds in three hours, divided by the number of seconds it takes to play a game:

In [12]:
max_num_games = 60 * 60 * 3 / 5
max_num_games
Out[12]:
2160.0

The minimum number of games depends on the amount of money one has to spend. With 100 dollars to spend, for example, Lori could be done in as soon as 333 games, or under a half hour of play.

### Scenario 1 (S1): Lori and I have 100 dollars to spend on 30 cent bets¶

In an example scenario, Lori and I are willing to lose the same amount of money and wager the same amount per game. The only difference between the two competitors is that I end up playing less than Lori.

In this scenario, both of us have a relative wager of 0.003: \begin{align} r_w &= \frac{\text{wager}}{\text{total to spend}} = \frac{0.3}{100} = 0.003 \end{align}

We will normalize the distribution of net winnings such that the maximum loss is 1.

#### 20-Line Game¶

Let's look at the distribution of net winnings for the 20-line game. The simulations take a long time to run, so we'll simply load the output. The scripts to run these simulations are located in the repository.

In [13]:
import seaborn as sns
import matplotlib

num_sims = 1000

won = results['avg_won']  # avg money won per trip
time = results['avg_time']  # avg time played per trip
plays = results['avg_plays']  # avg number of plays per trip
spent = results['avg_spent']  # avg money lost per trip
return won, time, plays, spent

# We will call this function often to visualize the distribution of earnings for each set of simulations
def plot_earnings_dist(mats, inds, labels, colors=None, lines_played='20 Lines', nbins=20, normalize=None,
kde=False, hist=True, title='Earnings Distribution', alphas=None, ax=None):
if ax is None:
fig, ax = plt.subplots(1, 1)
ax.set_title('{} ({})'.format(title, lines_played))
ax.set_xlabel('Earnings')
for i in range(len(labels)):
won = mats[i][0]
spent = mats[i][-1]
money = won - spent

if normalize is not None:
money = money / normalize[i]
hist_kws = {'alpha': alphas[i]} if alphas is not None else None
ind = inds[i]
bins = nbins if isinstance(nbins, (int, float)) else nbins[i]
sns.distplot(money[ind, :], bins=bins, kde=kde, hist=hist, label=labels[i], ax=ax, hist_kws=hist_kws)
lines = [r for r in ax.get_children() if type(r) == matplotlib.lines.Line2D]
if colors:
[r.set_color(colors[i]) for i,r in enumerate(lines)]
ax.legend()
labels = [str(float(int(x)/num_sims)) for x in ax.get_yticks()]
ax.set_yticklabels(labels)
ax.set_ylabel('Probability')

return lines

plot_earnings_dist([samestart_20, samestart_20], [0, 1], ['Lori', 'Ben'], normalize=[100, 100], nbins=[25, 20]);

The distributions are as we would expect. They are right-skewed, so that the average earnings are negative but we have a tail of wins. Lori loses all her money more often, but she is more likely to have bigger wins. On average, she wins more than I do.

In [14]:
time_max = 60 * 60 * 3  # 3 hours, in seconds
plays_max = 12 * 60 * 3  # 5 seconds per bet => 12 bets per minute

# the RTP (return to player, or what we get back for every dollar spent)
def pct_calc(output):
return 100 * np.mean(output[0] / output[-1], axis=1)
In [15]:
print(r'On average, Lori made back {}% of what she spent.'.format(pct_calc(samestart_20)[0]))
print(r'On average, Ben made back {}% of what he spent.'.format(pct_calc(samestart_20)[1]))
On average, Lori made back 94.40410542868808% of what she spent.
On average, Ben made back 93.95656975043978% of what he spent.

#### 1-Line Game¶

For the 1-line game, neither of us end up playing often enough, or have enough money, to trigger the volatile jackpots. I do better simply because I take more breaks with my gambling style. From the graph below, we can see that I lose all my money roughly 45% of the time, while Lori loses it all 65% of the time.

In [16]:

plot_earnings_dist([samestart_1, samestart_1], [0, 1], ['Lori', 'Ben'], lines_played='1 Line', nbins=50, normalize=[100, 100])
plt.xlim([-1, 5]);

Here's what we earn back.

In [17]:
print(r'On average, Lori made back {}% of what she spent.'.format(pct_calc(samestart_1)[0]))
print(r'On average, Ben made back {}% of what he spent.'.format(pct_calc(samestart_1)[1]))
On average, Lori made back 83.10102843275847% of what she spent.
On average, Ben made back 90.27372411175419% of what he spent.

For the next few scenarios, I am going to adjust my own betting conditions. I still switch machines when I'm down 3 times my bet and when I'm up ten dollars in a single session, for the sake of consistency. But I doubt this matters very much.

### Scenario 2 (S2): What if I only have 40 dollars?¶

This scenario is closer to reality. I'm not usually comfortable spending more than 40 dollars at the casino. I feel too much guilt otherwise! So this means I'm likely to run out of money faster. My relative wager has more than doubled, because I'm spending more relative to what I have:

\begin{align} r_w &= \frac{0.3}{40} = \frac{0.75}{100} > \frac{0.3}{100} \end{align}

How does this affect the resulting distribution? We will compare the runs using "relative wager" units, so that the losses for S1 and S2 are normalized to 1.

#### 20-Line Game¶

In [18]:

print(r'In S1, Ben makes back {}% of what he spent.'.format(pct_calc(samestart_20)[1]))
print(r'In S2, Ben makes back {}% of what he spent.'.format(pct_calc(diffstart_20)[0]))
print(r'In S1, Lori makes back {}% of what she spent.'.format(pct_calc(samestart_20)[0]))
In S1, Ben makes back 93.95656975043978% of what he spent.
In S2, Ben makes back 86.20097578506063% of what he spent.
In S1, Lori makes back 94.40410542868808% of what she spent.

You can see from the distribution plot below that I run out of money more quickly, compared to when I start with 100 dollars. I have more than a 60% chance of losing it all, compared with 10% before.

In [19]:
lines = plot_earnings_dist([samestart_20, diffstart_20], [1, 0], ['100 Start (S1)', '40 Start (S2)'],
lines_played='20 Lines', normalize=[100, 40], hist=True, nbins=[20, 40]);
plt.xlim([-1, 4]);

#### 1-Line Game¶

Same with the 1 line game. I lose all my money more often, and make back only about 72 percent of what I spend on average. I lose it all almost 80% of the time!

In [20]:

print(r'In S1, Ben makes back {}% of what he spent.'.format(pct_calc(samestart_1)[1]))
print(r'In S2, Ben makes back {}% of what he spent.'.format(pct_calc(diffstart_1)[0]))
print(r'In S1, Lori makes back {}% of what she spent.'.format(pct_calc(samestart_1)[0]))
In S1, Ben makes back 90.27372411175419% of what he spent.
In S2, Ben makes back 72.28880419359893% of what he spent.
In S1, Lori makes back 83.10102843275847% of what she spent.
In [21]:
lines = plot_earnings_dist([samestart_1, diffstart_1], [1, 0], ['100 Start (S1)', '40 Start (S2)'],
lines_played='1 Line', nbins=[65, 70], normalize=[100, 40], hist=True)
plt.xlim([-1, 4]);

## Optimal Wagers¶

The results we've seen beg the question: is there an optimal wager, given the amount of money you're willing to lose and time you're willing to spend at the casino? Well - that depends how we define optimal.

### Fixed Wager¶

Let's say we want to decide on a single wager to place on every bet that gives us a decent chance of doubling our money and a relatively small chance of losing it all early. Let:

• $\alpha$ = the probability of losing $x$ - all the money a gambler is willing to risk parting with
• $\beta$ = the probability of winning at least $y$, a "big" win in the eyes of the gambler.
• $\gamma$ = the minimum value of $\beta$ we desire

Then our optimal (absolute) wager is: \begin{align} w^{\text{opt}}(x,y) &= \arg\limits_{w}\min \left\{\alpha(x,w)\;|\;\beta(y,w) > \gamma \right\} \end{align}

Basically, we want to risk the least amount of money as possible to achieve whatever goal we desire.

#### 1 Line¶

Consider the result of placing 1, 10, and 30 cent bets on the 1-line game with a max loss of 40 dollars.

In [22]:
lines = plot_earnings_dist([diffstart_1, diffstart_ben10_1, diffstart_ben1_1],
[0, 0, 0],
['40 Start, 30 cents', '40 Start, 10 cents', '40 Start, 1 cent'],
lines_played='1 Line',
normalize=[40, 40, 40], nbins=[100, 100, 20], alphas=[0.7, 0.5, 1.])

plt.xlim([-1, 3]);

With the 1 cent bet, you never lose all of your money, because it is impossible to lose 40 dollars in three hours with one cent bets. But the chances of winning anything substantial are minimal compared with the 10 cent or 30 cent wagers. The tradeoff between risk and reward is clear.

Let's look at the probabilities of doubling our money versus losing it all for these wagers. Because we start with 40 dollars, we're looking to leave the casino with 80. We would like at least a 10% chance of achieving this outcome, so $\gamma=0.1$.

In [23]:
def pcalc(output, cond_function, ind=0):
money = output[0] - output[-1]
loss = len(money[ind, cond_function(money[ind, :])])
return loss / len(money[ind, :])

lose40 = lambda x: x <= -40
gain40 = lambda x: x >= 40

# probability of losing it all
print('P(lose 40|30 cent wager) = {}'.format(pcalc(diffstart_1, lose40)))
print('P(lose 40|10 cent wager) = {}'.format(pcalc(diffstart_ben10_1, lose40)))
print('P(lose 40|1 cent wager) = {}'.format(pcalc(diffstart_ben1_1, lose40)))

print('\n')

# probability of winning 40
print('P(gain 40|30 cent wager) = {}'.format(pcalc(diffstart_1, gain40)))
print('P(gain 40|10 cent wager) = {}'.format(pcalc(diffstart_ben10_1, gain40)))
print('P(gain 40|1 cent wager) = {}'.format(pcalc(diffstart_ben1_1, gain40)))
P(lose 40|30 cent wager) = 0.517
P(lose 40|10 cent wager) = 0.226
P(lose 40|1 cent wager) = 0.0

P(gain 40|30 cent wager) = 0.14
P(gain 40|10 cent wager) = 0.115
P(gain 40|1 cent wager) = 0.002

The 10 cent wager is clearly superior. Compared to the 30 cent wager, there is a 2.5% smaller chance of winning 40 dollars, but there is also a 29.1% smaller chance of losing all your money! Note that the risk-reward ratio would be 0 for the 1 cent wager, but the probability of winning is only 0.2%. Thus, we discard this entry.

Is there an even better wager than 10 cents for having at least a 10 percent chance of doubling our money? Let's find out.

In [24]:
s = sweep1[0].shape
inds = list(range(s[0]))
pv = np.vectorize(pcalc, excluded={0, 1})

pwins = pv(sweep1, gain40, inds)
plosses = pv(sweep1, lose40, inds)

wagers = np.linspace(.05, 0.3, 26)

# the optimal wager has a winning probability of at least 10%
print('optimal wager: ${}'.format(wagers[(pwins > 0.1)][0])) fig, ax = plt.subplots(1, 1) ax.plot(wagers, pwins, label='2x') ax.plot(wagers, plosses, label='Lose it all') ax.set_title('Win/Loss Probabilities') ax.set_ylabel('Probability') ax.set_xlabel('Wager') ax.fill_between(wagers[:4], pwins[:4], plosses[:4], alpha=0.5, color='red') ax.legend(); ax.scatter([0.08], [pwins[3]], s=50, color='red', zorder=100) ax.text(0.095, pwins[3]-.03, s='Optimal Wager'); optimal wager:$0.08

The optimal wager for turning 40 dollars into 80 dollars is 8 cents, because it requires the least risk for the desired outcome. The shaded region indicates where the probability of winning is greater than the probability of losing it all. Note that the probability of losing it all increases much faster with the wager than the probability of doubling your money. Ideally, the optimal wager should be near the shaded region, or the risk outweighs the reward.

We'll see for the 20-line game that we need to adjust our expectations.

#### 20-Line¶

In the 20-line case, the probability of doubling your money doesn't reach 10% until you're far from the intersection of the win and loss curves. This is because of the smaller average payouts on the 20-line machines vs the 1-line machines. Instead, if we can accept winning 1.5 times our bet, we will achieve an optimal wager in the shaded region.

In [25]:

pwins = pv(sweep20, gain40, inds)
plosses = pv(sweep20, lose40, inds)
pwins1pt5 = pv(sweep20, lambda x: x >= 20, inds)

wagers = np.linspace(.05, 0.3, 26)

# the optimal wager has a winning probability of at least 10%
print('optimal wager: $0.09') fig, ax = plt.subplots(1, 1) ax.plot(wagers, pwins, label='2x') ax.plot(wagers, plosses, label='Lose it all') ax.plot(wagers, pwins1pt5, label='1.5x') ax.set_title('Win/Loss Probabilities') ax.set_ylabel('Probability') ax.set_xlabel('Wager') ax.legend() ax.fill_between(wagers[:9], pwins1pt5[:9], plosses[:9], alpha=0.4, color='red') ax.scatter([0.09], [pwins1pt5[4]], s=70, color='red', zorder=100) ax.scatter([0.21], [pwins[16]], s=70, color='red', zorder=100) ax.text(0.06, pwins1pt5[4]+.08, s='Optimal Wager', rotation=40); optimal wager:$0.09

With a 9 cent wager, we have about a 10% chance of bringing home 1.5x what we started with, and only a 0.4% chance of losing all our money! If we wanted to double our money, we would place a 21 cent wager, but we would be 3x more likely to lose it all.

## Dynamic Strategy: Changing Wagers¶

This last section is dedicated to changing wagers. When I go to the casino, I'll reduce my bet size when I win big, in an attempt to leave with a net win. Lori will often use the extra winnings to take a larger risk, in the hopes of hitting a big win on a large wager. How does this affect our winnings?

For these simulations, we both start with 100 dollars and set the following rules:

• When Lori is up 30 dollars or more, she'll start betting 50 cents instead of 30.
• When Ben is up 30 dollars or more, he'll start betting 10 cents instead of 30.

If we fall below our initial 100 dollars, we'll switch back to 30 cent bets. We'll keep our initial switching strategies (Lori switches only on big wins, while I switch if I'm down 3x my wager).

Note: Neither of us are betting optimally here. For me, an optimal bet on 100 dollars is 20 cents, and an optimal bet on 130 dollars is 26 cents. So we're betting larger than we should be to begin with, Lori is further increasing her risk-reward ratio at 130 dollars, and I'm pulling back to a low risk, low yield wager when I'm up. But these are our actual habits, and I'd like to see how they play out!

#### 20 Lines¶

For Lori, the larger dynamic wager has the effect of shifting the mass of the probability distribution to the left, so she is more likely to run out of cash. But she has a slightly better chance of winning big. Overall, it is a losing strategy for the 20 line game.

In [26]:

fig, ax = plt.subplots(1, 1)
plot_earnings_dist([samestart_20, dynamic_20], [0, 0], ['Fixed Wager', 'Dynamic Wager'], normalize=[100, 100],
nbins=[30, 40], title = 'Lori\'s Earnings Distributions', ax=ax)
ax.set_xlim([-1, 5]);
In [27]:
print('Lori\'s fixed wager strategy makes back {}% of what she spent.'.format(pct_calc(samestart_20)[0]))
print('Lori\'s dynamic wager strategy makes back {}% of what she spent.'.format(pct_calc(dynamic_20)[0]))
Lori's fixed wager strategy makes back 94.40410542868808% of what she spent.
Lori's dynamic wager strategy makes back 92.13186993257884% of what she spent.

For the 20-line game, my dynamic wager strategy shifts the mass of the distribution towards the break-even point, so I'm less likely to lose all my money and most likely to encounter smaller losses. Overall I beat the RTP with 95.36% of my money returned, but I have a smaller chance of bigger winnings.

In [28]:
plot_earnings_dist([samestart_20, dynamic_20], [1, 1], ['Fixed Wager', 'Dynamic Wager'], normalize=[100, 100],
title = 'Ben\'s Earnings Distributions')
plt.xlim([-1, 4]);
In [29]:
print('Ben\'s fixed wager strategy makes back {}% of what he spent.'.format(pct_calc(samestart_20)[1]))
print('Ben\'s dynamic wager strategy makes back {}% of what he spent.'.format(pct_calc(dynamic_20)[1]))
Ben's fixed wager strategy makes back 93.95656975043978% of what he spent.
Ben's dynamic wager strategy makes back 95.36116121132994% of what he spent.

#### 1 Line¶

For the 1 line game, Lori faces the same situation. Wins are rare.

In [30]:

plot_earnings_dist([samestart_1, dynamic_1], [0, 0], ['Fixed Wager', 'Dynamic Wager'], normalize=[100, 100],
title = 'Lori\'s Earnings Distributions', nbins=[60, 55], lines_played='1 Line')
plt.xlim([-1, 4]);
In [31]:
print('Lori\'s fixed wager strategy makes back {}% of what she spent.'.format(pct_calc(samestart_1)[0]))
print('Lori\'s dynamic wager strategy makes back {}% of what she spent.'.format(pct_calc(dynamic_1)[0]))
Lori's fixed wager strategy makes back 83.10102843275847% of what she spent.
Lori's dynamic wager strategy makes back 81.2179027783589% of what she spent.

In the 1 line game, my results are extremely surprising! I earn back 99.2% of what I spend! My hypothesis is that because the 1 line games yield bigger winnings on average, I get to play a sufficient number of games with my 30 dollar winnings to trigger a big win.

In [32]:
plot_earnings_dist([samestart_1, dynamic_1], [1, 1], ['Fixed Wager', 'Dynamic Wager'], normalize=[100, 100],
title = 'Ben\'s Earnings Distributions', nbins=[42, 60], lines_played='1 Line')
plt.xlim([-1, 4]);
In [33]:
print('Ben\'s fixed wager strategy makes back {}% of what he spent.'.format(pct_calc(samestart_1)[1]))
print('Ben\'s dynamic wager strategy makes back {}% of what he spent.'.format(pct_calc(dynamic_1)[1]))
Ben's fixed wager strategy makes back 90.27372411175419% of what he spent.
Ben's dynamic wager strategy makes back 99.2652943583449% of what he spent.

## Conclusions¶

From the experiments above, we come to the following conclusions:

• High volatility games pay out less often, but the average payouts are larger, while low-volatility games pay out more often with smaller average winnings.
• The optimal wager gives you a sufficiently large probability of achieving a desired outcome (e.g. doubling your money) while minimizing the probability of losing it all.
• Reducing your wager when you're up is a great way to improve your odds of leaving the casino with a win.
• Don't take these results too seriously: You're going to lose money no matter what!


text:
# Math Help - Analytic Geometry - General Equation of a Circle - please check my work

1. ## Analytic Geometry - General Equation of a Circle - please check my work

I am trying to teach myself analytic geometry and ran across a book with lots of problems but unfortunately it does not have a lot of answers. So can you guys please check my work and tell me if I got anything wrong (and where I got something wrong).

Thanks!

1. "Find the center and radius of each of the following circles"

x^2 + y^2 - 4x + 6y = 12

I rearranged the terms, added parentheses and then added the squaring terms:

(x^2 - 4x +4) + (y + 6y + 9) = 12

then added 9 + 4 to 12, and then arranged the equation in the squared form to get

(x-2)^2 + (y-(-3))^2 = 25

so r = sqrt(25)
and the center is: 2,-3

2. ## Re: Analytic Geometry - General Equation of a Circle - please check my work

Originally Posted by Principia11
1. "Find the center and radius of each of the following circles"
x^2 + y^2 - 4x + 6y = 12
I rearranged the terms, added parentheses and then added the squaring terms:

(x^2 - 4x +4) + (y + 6y + 9) = 12

then added 9 + 4 to 12, and then arranged the equation in the squared form to get
(x-2)^2 + (y-(-3))^2 = 23
$12+4+9=25$

3. ## Re: Analytic Geometry - General Equation of a Circle - please check my work

sorry >.< wrote it wrong once and then just copied from there, forgot to check it multiple times... except for that is it right? so r = 5 ?

4. ## Re: Analytic Geometry - General Equation of a Circle - please check my work

That's correct.

5. ## Re: Analytic Geometry - General Equation of a Circle - please check my work

Originally Posted by Principia11
I am trying to teach myself analytic geometry and ran across a book with lots of problems but unfortunately it does not have a lot of answers. So can you guys please check my work and tell me if I got anything wrong (and where I got something wrong).

Thanks!

1. "Find the center and radius of each of the following circles"

x^2 + y^2 - 4x + 6y = 12

I rearranged the terms, added parentheses and then added the squaring terms:

(x^2 - 4x +4) + (y + 6y + 9) = 12 + 4 + 9

then added 9 + 4 to 12, and then arranged the equation in the squared form to get

(x-2)^2 + (y-(-3))^2 = 25

so r = sqrt(25)
and the center is: 2,-3


text:
# How can I create an “afterimage” effect like this one?

How can I make an effect like this? With a particle system?

• Create a new particle system
• In the general settings:
• "Start Lifetime" reduce a lot. The lower, the lower the length of the particle trail. In my example I am using 0.2.
• "Start Speed" to 0, so the particles don't move from where they were created.
• "Simulation Space" to "World" so the particles don't move when the parent moves
• "Emission":
• Controls the number of after-images in the trail. In my example I increased it to 100. Should be at least 5 / StartLifetime to avoid flickering.
• "Shape"
• Uncheck this module, so all particles are spawned at exactly the position of the particle system
• set the gradient to fade from 255 alpha to 0 alpha so the trail-sprites fade out over time
• In Renderer
• Create a new material with the shader "Particles/Alpha Blended"
• Set the desired sprite as the sprite of that material
• Assign that material to the Renderer
• Optional: Adjust start lifetime and emission amount to taste to control length and density of the trail.

Result when you move the object:

• i cant set the color over lifeime – jojo Mar 25 '16 at 15:40
• thanks! is there any tutorial in the material part? because i really dont know how to implement one. Sorry newbie here – jojo Mar 25 '16 at 15:48
• @JarellGabon Creating the material is quite straight-forward, actually. In the assets folder structure, Right-Click->Create->Material, select the new material, under "Shader" pick Particles->Alpha-Blended and then drag your sprite to "Texture". – Philipp Mar 25 '16 at 15:53
• @JarellGabon Regarding setting the alpha property of the gradient: In the gradient-editor, click the upper-right arrow and then drag the alpha-slider to zero. Screenshot. – Philipp Mar 25 '16 at 15:58
• @FSic Maybe you would like to post an own answer explaining how to do this with the TrailRenderer component? – Philipp Jul 3 at 7:56

You can achieve this sort of effect pretty easily. You don't have to use a particle system to do so, but it can work pretty well. The structure is:

• You want a system that emits a single stationary particle (zero velocity) at a fixed interval.
• Configure the particle so that it decays over whatever period of time you want (this will be the time it takes each afterimage to "fade out"), and is spawned with whatever the current animation frame is.
• Tie the decay of the particle to it's opacity, so it gets more transparent as it approaches the end of its lifetime.
• Hi dude, i get your point but im new to unity, can you give me specifics? thanks – jojo Mar 25 '16 at 15:39
• Add unity tag then. – Ocelot Mar 25 '16 at 16:26
• No, don't add the Unity tag. There's nothing about the question that is Unity specific; we don't want to have tons of "how do I do <the same thing> in <fifteen slightly different tools>" questions floating around. Toolset-specific answers like @Phillip's excellent post on this question are fine, and address that need well without making it exceedingly difficult to deal with duplicate questions. – Josh Mar 25 '16 at 16:28
• @JoshPetrie Just because your answer isn't unity-specific doesn't mean the question isn't either. I find it quite unfair of you that you remove the Unity tag after I gave a very unity-specific answer. – Philipp Mar 25 '16 at 17:28
• @Philipp I removed the tag before I saw your post, and there is still nothing in the post that is specific to Unity, nor should there be. Your answer is still perfectly valid. I'll make a post on meta about the large issue, since I can't find the discussion I thought we had on this already. – Josh Mar 25 '16 at 17:32