|
-
02-12-2016, 10:33 PM #6241
-
02-13-2016, 07:52 AM #6242
-
02-13-2016, 08:25 AM #6243
-
02-13-2016, 08:28 AM #6244
LaTeX problem!
I want to type that:
cos^{2}(1/n) - 2cos(1/n) + 1 <=> (cos(1/n)-1)*(cos(1/n)-1) <=> (cos(1/n)-1)^{2}
and that
cos^{3}(1/n) - cos^{2}(1/n) - cos(1/n) + 1 <=> (cos(1/n)-1)*(cos(1/n)-1)*(cos(1/n)+1) <=> (cos(1/n)-1)^{2}*(cos(1/n)+1)
in LaTeX in a nice way, but it fukks up when I do it (not aligned etc). I barely know anything about this program, feels bad man. Could anyone show me how?
I use \usepackage{amsmath} if that helps lulz
-
-
02-13-2016, 08:42 AM #6245
-
02-13-2016, 08:55 AM #6246
-
02-13-2016, 11:10 AM #6247
-
02-13-2016, 02:13 PM #6248
- Join Date: Jan 2010
- Location: California, United States
- Age: 32
- Posts: 5,682
- Rep Power: 6924
Maybe someone here can help with this.
I'm transcribing audio and looking for key phrases that must be grouped.
For instance, I tell it to look for "in the end", but instead of looking for the whole string it looks for "in", "the", "end" and returns all instances of the words.
I figured I could use their start and end times to rule out any extra occurrences.
It looks like this
even 0.45 0.65
even 4.92 5.25
doesn't 4.51 4.92
it 3.16 3.45
it 4.36 4.51
http://puu.sh/n6OMy.png
Any clever way to find the closest n points? In this case it would be the closest three.
As you can see, the three closest points are what I actually want.
atm just thinking of getting rid of the y coordinate, iterating through the inner points, and comparing their difference.
Should return the smallest distance and keep those three points.Last edited by SCAR-H; 02-13-2016 at 02:32 PM.
War is Peace; Freedom is Slavery; Ignorance is Strength.
-
-
02-13-2016, 03:46 PM #6249
If I'm understanding correctly, given a point P, you are trying to find the closest n points to P, i.e. the famous https://en.wikipedia.org/wiki/K-near...bors_algorithm ?
If so, there are many solutions available online, a quick Google search yields http://stackoverflow.com/questions/2...ensional-plane
-
02-13-2016, 03:52 PM #6250
- Join Date: Jan 2010
- Location: California, United States
- Age: 32
- Posts: 5,682
- Rep Power: 6924
I came across that but thought it was too complex for what I am doing. I don't think I'll ever have more than ten data points.
'Find the n nearest points to each other' and not to a specific point
{a, b, c, d, e, f}
I'm not trying to find the n closest points to a, or b, c, d, etc. I'm trying to find just the n (in this case three) closest points to each other.
Might be {a, b, c} or {b,c,d}, but it will never be {a,c,f} etc.
Currently working but might be really slow
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
current distance 0.65, min distance 0.65
current distance 1.92, min distance 0.65
[[u'it', 0.44, 0.69], [u'starts', 0.69, 1.09], [u'with', 1.09, 1.2]]
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
[[u'one', 0.98, 1.18], [u'thing', 1.18, 1.42]]
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
[[u'why', 0.96, 1.24]]
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
current distance 3.91, min distance 3.91
current distance 1.35, min distance 3.91
current distance 0.56, min distance 1.35
[[u'it', 4.36, 4.51], [u"doesn't", 4.51, 4.92], [u'even', 4.92, 5.25]]
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
[[u'matter', 2.03, 2.29], [u'how', 2.29, 2.51]]
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
[]
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
current distance 0.37, min distance 0.37
[[u'keep', 1.23, 1.43], [u'that', 1.43, 1.6], [u'in', 1.6, 1.69]]
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
[[u'mind', 0.36, 0.56], [u'I', 0.56, 0.59]]
[MoviePy] Writing audio in TEMPsound.wav
[MoviePy] Done.
[]
[MoviePy] >>>> Building video Final/clip_0.mp4
[MoviePy] Writing audio in clip_0TEMP_MPY_wvf_snd.mp3Last edited by SCAR-H; 02-13-2016 at 04:01 PM.
War is Peace; Freedom is Slavery; Ignorance is Strength.
-
02-13-2016, 04:27 PM #6251
Ah I see now. I would conjecture that a triplet of points p1,p2,p3 among a set of points P are closest to one another if and only if the triangle formed by the vertices p1,p2, and p3 has the smallest area. So exploiting this idea coupled with Heron's Formula (https://people.richland.edu/james/le...lications.html) it seems like you can easily find the closest 3 points in linear time.
General pseudo-code could look like this:
Code:minArea = infinity startIndex = 0 for index i = 0 ... N - 2 p1 = points[i] p2 = points[i + 1] p3 = points[i + 2] area = HeronsFormula(p1,p2,p3) if area < minArea startIndex = i minArea = area
I haven't tested this yet though give me a sec and I'll see whether it worksLast edited by Chesssbrah; 02-13-2016 at 04:49 PM.
-
02-13-2016, 04:28 PM #6252
- Join Date: Jan 2010
- Location: California, United States
- Age: 32
- Posts: 5,682
- Rep Power: 6924
That's exactly what I was thinking but I went about it more programatically.
Data looks like [ [word, start_time, end_time], ... ]
Code:#this gets you the distance between start_time and end_time for each list minDistance = elm[size(elm)-1][2] - elm[0][1] for element in dataset: distance = elm[size(elm)-1][2] - elm[0][1] if distance <= minDistance: minDistance = distance
I can make it 1 dimensional since the data is already ordered, and that's sort of what I did above
Need to buy more RAM for this :'(
EDIT: saw your psuedo code. We're essentially doing the same thing just in different dimensions. looks good.Last edited by SCAR-H; 02-13-2016 at 04:38 PM.
War is Peace; Freedom is Slavery; Ignorance is Strength.
-
-
02-13-2016, 04:44 PM #6253
Yeah I think you can take advantage of the fact that the points are all ordered that way... although I wonder if you could do this in logarithmic time... Is linear time too slow for your application? I was going to say you can get rid of expressions like sqrt when computing norms/areas which make a difference in practice, but it seems like your code doesn't have any of those as it is.
-
02-13-2016, 04:47 PM #6254
- Join Date: Jan 2010
- Location: California, United States
- Age: 32
- Posts: 5,682
- Rep Power: 6924
There's a lot I still need to do to make this more efficient.
Product: https://streamable.com/qjly
Using Bluemix speech recognition doesn't match all keywords, so the clips that are too long had no matches.
Hundreds of non-matches
Last edited by SCAR-H; 02-13-2016 at 05:32 PM.
War is Peace; Freedom is Slavery; Ignorance is Strength.
-
02-13-2016, 11:28 PM #6255
- Join Date: May 2006
- Location: Farmingville, New York, United States
- Age: 35
- Posts: 31,833
- Rep Power: 171998
-
02-14-2016, 08:43 AM #6256
I'm not sure why they would give you information on car phones, then talk exclusively about cell phones/cell towers. That's what threw me off, and I kept re-reading the problem. The only thing I can think of is (provided they didn't give you any other information) is they want you to look up the frequency? And then assume the gains are 1, not 100% sure
PC + PS4
PSN : Shadafaka
Mech E crew
-
-
02-15-2016, 10:23 AM #6257
Okay so I'm a little confused w/ stats, so I feel like I have an answer, but we haven't covered confidence intervals in this class and it's been forever since I took the first part of this sequence so let me just run something by this thread real quick:
"Suppose that the waiting time for a bus, in minutes, has the uniform in (0,10) distribution. In five months a person catches the bus 120 times. Find an approximation to the 95th percentile of the total waiting time. "
There's no way to do this other than w/ standard confidence intervals right? This is in a chapter where I'm not seeing anything like this so I'm a little confused, but on a surface level I think I'm fine, this just happens to be a problem w/o an answer in the back.
Isn't it just a 95% CI?
So xi~U(0,10)
Let T= x1+x2+...+x120
By CLT, T~N(600,1000)
CI = 600 +/- 1.96*sqrt(1000)
I feel this a dumb question, but this is what they want right?
EDIT:
Actually I think they want a single number, is that what they're looking for?
P(T<x)=.95
P[z<((x-600)/sqrt(1000))]=.95
Say phi(y)=.95 => y=1.645
1.645=(x-600)/sqrt(1000) => x=652.02Last edited by ctownballer04; 02-15-2016 at 10:47 AM.
Trading/Investing Thread Crew
Math Thread Crew
Poker & Sports Betting crew
**1st Team All Sports Misc**
Portland Trail Blazers Crew
Oregon Ducks Crew
RIP ThePrimeSalmon
-
02-15-2016, 02:18 PM #6258
One last question if someone has a sec, I tried going to the stats tutoring in the math lab but the person could only tutor the 200 level intro course.
"Components that are critical for the operation of electrical systems are replaced immediately upon failure. Suppose that the life time of a certain such component has mean and standard deviation of 100 and 30 time units, respectively. How many of these components must be in stock to ensure a probability of at least 0.95 for the system to be in continuous operation for at least the next 3000 time units? (Hint: If T= x1+x2+...+xn is the combined duration of n components, we want P(T>3000)=0.95. This means that 3000 is the 5th percentile of T. Using the CLT to approximate the 5th percentile of T leads to a quadratic equation for the square root of n, that is, an equation of the form ax^2+bx+c=0, with x being the square root of n."
Now this is what I have:
T~N(100n,900n)
P(T>3000)=.95 => [1-P(T<3000)]=.95
[1-P(z<(3000-100n)/sqrt(900n))] =.95
[1-Phi(y)]=.95 => -1.645
-1.645= (3000-100n)/sqrt(900n)
Which gives me 32.83, but the answer says just 33. Is this just rounding or am I actually wrong?Trading/Investing Thread Crew
Math Thread Crew
Poker & Sports Betting crew
**1st Team All Sports Misc**
Portland Trail Blazers Crew
Oregon Ducks Crew
RIP ThePrimeSalmon
-
02-15-2016, 07:33 PM #6259
I'm in a four hour finance lecture atm, so don't have my book, but doesn't the central limit theorem essentially say that the sum and arithmetic average of a large number of iid random variables is approximately normal regardless of the underlying distribution?
Yeah just estimation. I think I'm okay, I just figured I'd run it by this thread in case anyone had any insight. Thanks man.Trading/Investing Thread Crew
Math Thread Crew
Poker & Sports Betting crew
**1st Team All Sports Misc**
Portland Trail Blazers Crew
Oregon Ducks Crew
RIP ThePrimeSalmon
-
02-15-2016, 08:53 PM #6260
-
-
02-16-2016, 08:03 AM #6261
-
02-16-2016, 08:30 AM #6262
Just to follow up w/ my books definition, it just says the following:
CLT: Let X1, X2, ... , Xn be iid w/ mean mu and finite variance sigma^2= s^2. Then, for large enough n
1) xbar has approximately a normal distribution w/ mean mu and variance s^2/n
2) T= X1 + X2 +...+ Xn has approximately a normal distribution with mean n*mu and variance n*s^2.Trading/Investing Thread Crew
Math Thread Crew
Poker & Sports Betting crew
**1st Team All Sports Misc**
Portland Trail Blazers Crew
Oregon Ducks Crew
RIP ThePrimeSalmon
-
02-16-2016, 08:34 PM #6263
-
02-16-2016, 08:56 PM #6264
-
-
02-16-2016, 11:14 PM #6265
-
02-16-2016, 11:18 PM #6266
-
02-16-2016, 11:29 PM #6267
-
02-16-2016, 11:32 PM #6268
Make sure there are parenthesis too. The way the computer interprets it is that you're in the numerator unless there are parenthesis in the denominator. Going off your picture, that's interpreted by the computer as (1/64)*w6. So even if you put a carot in there in that format, it's still wrong. (1/64)*(w^6) wouldn't be correct, you need the w^6 in the denominator.
Trading/Investing Thread Crew
Math Thread Crew
Poker & Sports Betting crew
**1st Team All Sports Misc**
Portland Trail Blazers Crew
Oregon Ducks Crew
RIP ThePrimeSalmon
-
-
02-16-2016, 11:42 PM #6269
-
02-16-2016, 11:48 PM #6270
Similar Threads
-
First time cutting, and have some quesitons.
By K.C. Sparrow in forum Workout ProgramsReplies: 5Last Post: 06-15-2003, 08:40 PM -
First time cutting and have some questions.
By K.C. Sparrow in forum NutritionReplies: 2Last Post: 06-15-2003, 05:02 PM
Bookmarks