Open Side Menu Go to the Top
Register
The Official Math/Physics/Whatever Homework questions thread The Official Math/Physics/Whatever Homework questions thread

10-25-2017 , 02:30 AM
Risk of ruin problem. Target is +2 loss is -2. He starts from 2 and wins at 4 or loses at 0. p= 0.46

Feller page 345 the classical risk of ruin problem;

qz=((q/p)^a-(q/p)^z)/((q/p)^a-1)

a is bankroll position target exit (win). z is bankroll position now. p is win probability, q=1-p is loss probability.

so here p=0.46, q=0.54, a=4, z=2.

hence qz=((0.54/0.46)^4-(0.54/0.46)^2)/((0.54/0.46)^4-1)=57.95% So win 1 minus that. Since here its only 2 its easy to see that geometric series arguments like your previous post can deliver it fast too.
The Official Math/Physics/Whatever Homework questions thread Quote
10-25-2017 , 06:20 AM
Quote:
Originally Posted by Raziel26
Tennis question that I'm stuck on ...

A couple of years ago I developed for fun (and because it's easy) a small library in R that allows to calculate the probability of winning a tennis match from any given score, assuming that the probabilities pA and pB of the two players winning a point on their own serve are fixed (player A has pA to win a point on their serve and 1-pB to win the point while B serving). The founding block of the library is the probability of winning from a deuce score. As you showed, this is:

P(D) = P(A wins from Deuce on their serve) = pA^2/(pA^2 + (1-pA)^2)

Next, to get the chance of holding a serve you just need the binomial distribution and its cumulative. They are implemented through dbinom and pbinom in R and defined as such:

b(k,n,p) = C(n,k) p^k * (1-p)^(n-k)
B(k,n,p) = \sum_{i=k}^{n} C(n,i) p^i * (1-p)^(n-i)

and represent the probability of winning exactly k points out of n (b function) and at least k points (B function) respectively.

You can now imagine to play 6 points for each service game. Player A wins the game if they win at least 4 points or if they win exactly 3 points and then goes on to win from deuce. In formula:

P(A wins a game while serving) = B(4,6,pA) + b(3,6,pA)*P(D)

Using the same logic as above, you can calculate the probability of winning the game from any score (for instance if the score is 15-0, you imagine to play other 5 points; A needs to win at least 3 of them or just 2 and then win from deuce).

You can do the same for the chance of B holding.

The probability of winning a set is slightly more difficult because you have to take into account that the probabilities of Player A winning a game (PGA, PGB) depend on who's serving. You imagine to play the first 10 games, 5 on each serve. Player A wins the set if:

- holds once and breaks 5 times;
- holds twice and breaks at least 4 times;
- ....
- holds always (5 times) and breaks at least once.

You can calcualate the above using the b and B functions easily. Player A can win also if after the first 10 games the score is 5-5 and wins the next two games or if wins just one of them and wins the tiebreaker.

To calculate the probability of winning a tiebreaker, you proceed as above and see what happens after 12 points.

Hope to have given you some hints to approach the general problem.
The Official Math/Physics/Whatever Homework questions thread Quote
10-25-2017 , 10:01 AM
Quote:
Originally Posted by Raziel26
Combos of 6-3 in exactly 9 games = 9C6 - 8C6 - 7C6 - 6C6 = 84-28-7-1 = 48
This line is wrong. You made other analogous errors earlier with how games are won, but if you can get this one fixed, you should be able to fix your earlier errors. You are massively miscounting here. You start with 9C6 which is all the ways you can distribute 9 6 wins over 9 games and you subtract off 8C6 which removes all the ways you could have won 6 games over the first 8. But this includes the sequence WWWWWLWL, so you have already subtracted that sequence off when you go and subtract off the 7C6 so you have now subtracted off every way to win in 7 games twice. Then you go and subtract off the lone way to win in 6 games which you subtracted off as part of the 8C6 and again as part of the 7C6.

Instead of counting ways to win 6 games out of 9, we know that the player has to win the 9th game. That is fixed. If they don't win this game, they can never win the set 6-3. It is much easier to think about how a player can win 5 of the first 8 games and then multiply that by the probability that by the single probability of winning the 9th game
The Official Math/Physics/Whatever Homework questions thread Quote
10-25-2017 , 12:49 PM
Thanks posters for your help, got to the correct solution with your pointers

@reno expat: I originally had it written down as '5 points played, A wins 4, B wins one including the final point' but I thought that the combinatorics stuff satisfied that condition so thanks for pointing out the fix
The Official Math/Physics/Whatever Homework questions thread Quote
11-08-2017 , 07:08 AM
Trying to work out some calculations for expected ROI in a certain poker tournament using Sharkscope abilities.

If a tournament on Sharkscope has an av. ability of 70, and my ability is 80 - can I work out my expected ROI in that tourney?

I had a little go, but my maths knowledge really isn't great so there's a massive probability I'm going off on the wrong tangent here.

So here's what I did.
Avg ability is 70 - I think you need to work out what every 1 more on avg ability is as a percentage. So if your ability is 71, then your ROI is going to be 1.6% because 50 (average ability over 100) - 30 (difference between this tourneys avg ability and 100) is 1.6?

So if my ability is 80, and avg tourney ability is 70, then it's 10 x 1.6 = 16% expected ROI?

There's a huge possibility I've worked this out wrong, so please correct me!
The Official Math/Physics/Whatever Homework questions thread Quote
11-09-2017 , 10:42 AM
Is anyone here advanced in mathematical finance/stochastic calculus? I specifically need to understand a (sub)chapter from this book: https://www.elsevier.com/books/advan...-0-12-047682-4

No assignment/homework problems, no cheating for a take-home exam, there are just a lot of steps I don't understand in the text itself. Willing to pay for help if we could cover 10 pages over the next day or so. I'll give you an example of something I'm struggling with (picture below, wrote some stuff first so there's some direction before seeing the page)

We start with a simple stochastic process, trying to figure out transitional densities. We need to solve the kolmogorov forwards and backwards equations (why? seems intuitive but I don't know why that specifically).

But then those equations don't have dt, dWt/dBt etc. I know ito's lemma. I've solved a bunch of SDEs before by guessing the form and matching coefficients. I don't know how to reach this solution, and there's another one just after with an initial condition.

Are we using the diract delta mass (second line after 3.8) so that we can treat it as a probability distribution when we're starting at a specific point?

The Official Math/Physics/Whatever Homework questions thread Quote
11-11-2017 , 05:07 PM
Hello everyone,

I have to implement an 8-bit signed divider in Verilog (a hardware description language). I already did it with Booth's algorithm, but we get extra points if we use an algorithm that converges faster than 8 iterations. The way I implemented it takes 8.

Does anyone have any idea on an algorithm that is faster for 8-bit signed division? If you do, please elaborate on how you would do it, Google is not that useful. I tried looking up Goldschmidt and Newton-Rapshon, but they look impossible to implement until Monday when my homework is due.

Look-up table method is a no-go, because I have to use a multiplier and signed multiplication in Verilog is a mess. Maybe you have another way of using look-up tables that doesn't need a multiplier or doesn't care that it multiplies signed numbers.

I'll post what I implemented with Booth's algorithm just in case you need a refresher.

Thanks.

EDIT: Forgot to mention some restrictions on what I can use: I'm not allowed to use the following operators: /, %, *. Any algorithm that takes more than 8 iterations is heavily penalized.

Code:
`timescale 1ns / 1ps

module divider(q, r, a, b);

	input [7:0] a;
	input [7:0] b;
	output [8:0] q;
	output [7:0] r;
	reg [8:0] q = 0; 
	reg [7:0] r = 0;
	reg [7:0] dvd; //divider
	reg [7:0] div; //divisor
	reg [7:0] rest;//remainder
	integer i; // iteration
	
	always@(a or b) begin
	   //initializing variables
		dvd = a;
		div = b;
		rest = 0;
		
		if (dvd[7] == 1) begin //makes "a" positive if negative
			dvd = 0 - dvd;
		end
		
		if (div[7] == 1) begin
			div = 0 - div;      // same with "b"
		end
		
		if ((div[7] == 1) && (dvd[7] == 1)) begin // if both are negative, makes them positive
			dvd = 0 - dvd;
			div = 0 - div;
		end
		
		for(i = 0; i < 8; i = i + 1) begin
			rest = {rest[6:0], dvd[7]}; //shift remainder
			dvd[7:1] = dvd[6:0];        //shift dividend
			rest = rest - div;
			
			if ( rest[7] == 1) begin    //check if remainder < 0
				dvd[0] = 0;
				rest = rest + div;
			end
			else begin
				dvd[0] = 1;
			end
		end
		
		if ((a[7] == 1) && (b[7] == 0)) begin
			q = 0 - dvd;
			r = 0 - rest;
		end
		
		else if ((a[7] == 0) && (b[7] == 1)) begin
			q = 0 - dvd;
			r = rest;
		end
		
		else if ((a[7] == 1) && (b[7] == 1)) begin
			q = dvd;
			r = 0 - rest;
		end
		
		else begin
			q = dvd;
			r = rest;
		end
		
	end
	
endmodule

Last edited by woe; 11-11-2017 at 05:17 PM. Reason: forgot restrictions
The Official Math/Physics/Whatever Homework questions thread Quote
12-03-2017 , 02:14 PM
Having trouble with my QM assignment.



I'm not even sure how to begin doing this transformation. Can someone please point me in the right direction?
The Official Math/Physics/Whatever Homework questions thread Quote
12-03-2017 , 02:29 PM
This is kind of a foundational linear algebra idea that is very important. What do you know about the eigenvectors of a Hermitian operator?

Any observable (ish) has an Hermitian operator that acts on the wavefunction. Hence, we can show that we can represent the wavefunction in the eigenvector representation of that Hermitian operator. So, this problem wants you to put together what you know about a complete orthonormal basis.

The hint is that whenever you project your function into a different basis, you get an integral or, in Dirac notation, a bra-ket pair. So you'll need to know something about the basis of eigenvectors from your operator and then you'll have to use something similar to your identity operator.
The Official Math/Physics/Whatever Homework questions thread Quote
12-03-2017 , 04:26 PM
I know the eigenfunctions are orthonormal. Not sure what you mean by using the identity operator.
The Official Math/Physics/Whatever Homework questions thread Quote
12-03-2017 , 04:51 PM
Wait i think I'm getting somewhere.
The Official Math/Physics/Whatever Homework questions thread Quote
12-04-2017 , 12:47 AM
You have the identity equation in your question. It can be thought of as multiplying by 1. Really, it's showing that the basis is orthonormal in the space it spans.

So, really, you're just going to have < | > integrals -- these are actually numbers since it's an integration rather than a basis function, one of the bra or kets by themselves.
The Official Math/Physics/Whatever Homework questions thread Quote
03-13-2018 , 01:41 PM
nvm

Last edited by H&F-log; 03-13-2018 at 01:54 PM. Reason: figured it out
The Official Math/Physics/Whatever Homework questions thread Quote
03-13-2018 , 02:26 PM
I am trying to solve Laplace's equation on a rectangle in which the boundary conditions are mixed. The two horizontal boundaries are zero and the the vertical boundaries are Neumann conditions with u(0,y) = 0 and u(2,y) = cos(3 pi y/4). I found the general solution, which has two constants, and I imagine I am supposed to use the u_x conditions to solve for the constants. However, after taking u_x and plugging in the x=0 and x=2 I am getting stuck, and I don't see anything simplifying like it was in the heat equation and the wave equation. How exactly do I use the two conditions on u_x to find the constants?

PS:
For completeness, I'm including the problem here, but note that I am not just looking for someone to tell me the answer. I want to know how to do this in general.

Here's the problem:

Solve u_xx + u_yy = 0, for x on [0,2], y on [0,4], u(x,0) = u(x,4) = 0, u_x(0,y) = 0, u_x(2,y) = cos(3 pi y/4).

Thanks

Edit:
The general solution I got is: u(x,y) = sum(1..infinity) [A_n e^{n pi x/4} + B_n e^{-n pi x/4}]C_n sin(n pi y/4).

I really wish I could write TeX code in here. Sorry about the horrible formatting.
The Official Math/Physics/Whatever Homework questions thread Quote
03-31-2018 , 04:53 PM
Basic calc problem I'm sure someone can help with:

"Max wrote an algorithm that searches for a specific term within a large set of terms. The length of the search, in number of steps, over a set with n terms is given by the following function:

S(n)=1.6*ln(0.9n)

What is the instantaneous rate of change of the search length for a set of 10 terms?"


I got stuck and looked up the answer including the steps:



Everything looks straightforward to me except the third line which I don't really get at all, particularly where 1/0.9n comes from. Can someone shed some light on this? Thanks
The Official Math/Physics/Whatever Homework questions thread Quote
03-31-2018 , 05:22 PM
d/dx[ln(x)] = 1/x, so by the chain rule d/dn[ln(.9n)] = 1/.9n * d/dn[.9n]
The Official Math/Physics/Whatever Homework questions thread Quote
03-31-2018 , 06:18 PM
Quote:
Originally Posted by reno expat
d/dx[ln(x)] = 1/x, so by the chain rule d/dn[ln(.9n)] = 1/.9n * d/dn[.9n]
Thanks. The problem was that I didn't know (or wasn't able to figure out) that the derivative of ln(x) = 1/x.
The Official Math/Physics/Whatever Homework questions thread Quote
05-02-2018 , 05:12 AM
I have a homework question relating to logic circuits and I'm scratching my head as to the answer.

We are presented with a logic circuit and asked to draw a truth table. I have included both below.



I think my truth table is correct. We are asked what is the function of the circuit and this is where I am stumped. I don't think it is a half adder or full adder and after this I am not sure what to say.

Any thoughts are appreciated.

Last edited by sheeprustler; 05-02-2018 at 05:19 AM.
The Official Math/Physics/Whatever Homework questions thread Quote
05-02-2018 , 05:21 AM
I have a homework question relating to logic circuits and I'm scratching my head as to the answer.

We are presented with a logic circuit and asked to draw a truth table. I have included both below.



I think my truth table is correct. We are asked what is the function of the circuit and this is where I am stumped. I don't think it is a half adder or full adder and after this I am not sure what to say.

Any thoughts are appreciated.
The Official Math/Physics/Whatever Homework questions thread Quote
05-06-2018 , 04:40 AM
Not an expert of the field by any mean, but it seems to me that the circuit performs X-Y (with B being the most significative digit). Indeed:

Code:
X | Y | Res 
0 | 0 |  00
1 | 0 |  01
1 | 1 |  00
0 | 1 |  11
Notice that 11 is the way to represent -1 in the almost universal two's complement method of representing signed integers.
The Official Math/Physics/Whatever Homework questions thread Quote
09-06-2018 , 03:32 AM
Ok lets have the math challenge here.

Prove that no equilateral triangle can exist with vertices on a grid of unit 1 (integer coordinates) or find a solution counterexample.

(hint, think of area)
The Official Math/Physics/Whatever Homework questions thread Quote
09-06-2018 , 06:28 PM
Quote:
Originally Posted by masque de Z
Ok lets have the math challenge here.

Prove that no equilateral triangle can exist with vertices on a grid of unit 1 (integer coordinates) or find a solution counterexample.

(hint, think of area)
Pretty nice.
Spoiler:
boils down to sqrt(3) being irrational

Spoiler:
move a vertex to 0, draw a square containing the triangle, compute the areas of the other triangles and subtract them out to get the area of the equilateral. Also, you know what the area of the equilateral triangle is...
The Official Math/Physics/Whatever Homework questions thread Quote
09-13-2018 , 06:12 PM
I can't tell if I did this right or if I have confused myself in the process.

This is from Intro to Real Analysis.

The Official Math/Physics/Whatever Homework questions thread Quote
09-13-2018 , 06:27 PM
Not necessary to make it a proof by contradiction. Just (lim b_n)(lim b_n) = lim (b_n)(b_n) = lim a_n = A, therefore lim b_n = sqrt(A).
The Official Math/Physics/Whatever Homework questions thread Quote
09-13-2018 , 06:53 PM
Quote:
Originally Posted by lastcardcharlie
Not necessary to make it a proof by contradiction. Just (lim b_n)(lim b_n) = lim (b_n)(b_n) = lim a_n = A, therefore lim b_n = sqrt(A).
Thanks. Superfluous is my pitfall in all these.
The Official Math/Physics/Whatever Homework questions thread Quote

      
m