text:
# Estes Crossbow SST

### Help Support The Rocketry Forum:

#### tonypv

##### And so it begins...
I was at the Salem NH Wal Mart this morning and they had all four.
I picked up the Ricochet and Star Stryker.

#### Mikus

##### Well-Known Member
Lucky you!!! And, the Hobby Lobby at Jones Road/FM 1960 seems to be the
best I've seen (out of the others closer to me) when it comes to model rocketry stuff, so you're in great hands, John!
Yeah a Michaels, Hobby Lobby, Home Depot and Wal-Mart within 2 miles of each other. Plus another Michaels, Wal-Mart and Hobby Lobby over on Hwy 6.

Too bad for John it's almost all directly on my way home from work. :wave:

Although that Michaels on Hwy 6 south of 529 appears to have gotten out of the model rocket business. They sold off all their inventory at clearance prices.

#### Mikus

##### Well-Known Member
*And* it's just down the Beltway from my office! (which is on Clay Rd. just inside the Beltway)
It's out of $3 C6-5's... now. :headbang: #### jbuscaglia ##### Rusty-eyed Missile Man John, I went to the Northbridge Walmart today and they had the Taser Twin, Ricochet and Star Stryker but not the Crossbow SST so I didn't get you one. Did you want any of the others or just the Crossbow SST? Thanks, Bob, but I found them in Framingham. I ended up buying all four. #### dwmzmm ##### Well-Known Member Although that Michaels on Hwy 6 south of 529 appears to have gotten out of the model rocket business. They sold off all their inventory at clearance prices. What!?!? I was going to drop in there this afternoon (but didn't, as I was too hungry to eat and then went home). I bought modroc stuff there from time to time (mostly engines, since they're open on Sundays this makes it convenient to get the kind of engines that Wal - Mart doesn't carry -- a big plus on some NAR Contest days that runs through Sundays). Thanks for the heads up. #### Mikus ##### Well-Known Member What!?!? I was going to drop in there this afternoon (but didn't, as I was too hungry to eat and then went home). I bought modroc stuff there from time to time (mostly engines, since they're open on Sundays this makes it convenient to get the kind of engines that Wal - Mart doesn't carry -- a big plus on some NAR Contest days that runs through Sundays). Thanks for the heads up. No problem. Yeah I was surprised as well. I walked in the week before last and what was previously a 4 ft section of aisle dedicated to model rockets was down to about 18" of merchandise. Then I noticed the motor prices:$4.99. Then the prices on the remaining kits.

I picked up 1 Patriot, 2 Screaming Eagles, 1 Bullpup and 3 Hi-Flyers (gonna be outboards) for no more than $7.99 a piece. The Hi-Flyers went for$2.99 a pop. I got all of the 18mm motors that were left and there were not many.

The last I saw there were some T motors left plus some Swifts, Quarks, and a couple each of the small SpaceShip One and Bullpup kits left. Probably all gone now.

#### kelltym88

##### Well-Known Member
Well I picked up a Crossbow and a Taser Twin at my local WM today. That's in La Habra, Ca. The Crossbow was $6.96 and the TT$5.96 for a total of \$14 and change. Not bad. I don't understand the boxes, I know for WM shelves and all that. Seems at those prices, a plastic bag could bring it down even lower. Anyway, I got 2 of 'em. That didn't take long for them to get all across the country.

#### n3tjm

##### Papa Elf
I like the cardboard boxes, although I do agree they are a bit large (overkill). Maybe they are that big to attract attention? Maybe Estes had to buy back to many blistered kits because ppl opened them to see what was inside them? I to picked up the Crossbow and Taser Twin at my local Super Wally World.

The Sustainer of the Taser Twin reminds me of the Skyhook? Anyone else notice this?

#### JRThro

##### Well-Known Member
TRF Supporter
Cardboard is biodegradable, plastic bags are not. Another reason for the Sustainables name.

#### RoyAtl

##### Well-Known Member
The Sustainer of the Taser Twin reminds me of the Skyhook? Anyone else notice this?

#### Donaldsrockets

##### Well-Known Member
I picked up the Star Stryker yesterday to go with the Ricochet I already have.

At first I thought the Crossbow either had or was a glider until I looked at it more closely.

I however, due to the very high altitudes it will reach, see a lot of lost Taser Twin sustainers.

#### n3tjm

##### Papa Elf
I however, due to the very high altitudes it will reach, see a lot of lost Taser Twin sustainers.
Estes needs to reintroduce the 1/2A6-0 now . I have a couple of those.

#### Boosterdude

##### Well-Known Member
I started building my Crossbow yesterday. The minimum diameter doesn't really excite me, it just looks to small to me. Actually the main reason I bought the kit was to upscale it to a BT-80.

Back to this kit, it was great to see the balsa nose cone and the BT's supplied are of very good quality. The fins/wings are laser cut balsa, but my kit the wood was low quality and very rough on one side. Not really a big deal. I built the body tube/motor mount leaving off the motor hook since it's on the outside. Plus, friction fitting the motor will work fine.

#### SCIGS30

##### Well-Known Member
I have been real busy but I was able to find time and finish these four rockets. All and all these are fantastic kits. The decals are thick and easy to work with, I did not treat with anything just dipped in water and applied.

#### Indiana

##### Well-Known Member
Great all around! I haven't even started yet

#### judo

##### Well-Known Member
HEY! FOUL!

No one said anything about a BBZ. Or didn't I get the memo?

Kidding.

Great finishes on all 4!

#### Dr.Zooch

##### Well-Known Member
Okay- not to go OT too far, but yer' mostly correct about the chutes. One fact needs to be added, I learned about how bad white was for a chute from my OWN experience. I shot a IB in the winter and it landed in a plowed field with lots of snow blobs in it. As I waled around searching for the white chute and the black and white rocket I said to myself "those guys on TRF were right... white ain't a good color for a parachute." Listen to the customers... they know a lot.

Interesting tidbit about the chutes... I find that a bit amusing actually...

Dr. Zooch used to use plain white trash bags cut into hexes for his kit chutes, and folks griped that they were too hard to see in the air (blend with clouds, low contrast, whatever) and on the ground (looks like, well, a W/M bag or other trash lying around) so he managed to get his hands on some red trash bags, which worked better. Then he found his source of red trash bags was sort of a happy accident or something like that, because red trash bags are sort of a no-no in the trash bag industry, because red is reserved for BIO-HAZARD medical waste type stuff. So, now he's using yellow trash bags for chutes, and I think I've heard some guys say they got an orange one, though I haven't.

Now due to the nanny state, Estes can't print their parachutes anymore (or time being, whatever) and are using plain white 'trash bag' chutes... I think I'd toss it and just send some nickels to Evil Ed and get some of those cool Hartle Engineering parachutes... WAY better chute than Estes would ever put in their kit anyway...

Yall have a good one! OL JR

#### markschnell

##### Well-Known Member
TRF Supporter
Scigs30,

Your work on these rockets is excellent! Just a few quick questions about your technique: What kind of glue do you use on the fin attachment? What do you do extra to get such clean fillets? Lastly, what do you do to fill the balsa?

I am very impressed and whatever you're doing I want to do!!

Thanks

#### SCIGS30

##### Well-Known Member
Scigs30,

Your work on these rockets is excellent! Just a few quick questions about your technique: What kind of glue do you use on the fin attachment? What do you do extra to get such clean fillets? Lastly, what do you do to fill the balsa?

I am very impressed and whatever you're doing I want to do!!

Thanks
I use plain old Elmers White Glue All for all the construction and fillets. I use Midwest Aerogloss balsa sealer, 3 coats.


text:
### Occupation Densities

Donald Geman and Joseph Horowitz
Source: Ann. Probab. Volume 8, Number 1 (1980), 1-67.

#### Abstract

This is a survey article about occupation densities for both random and nonrandom vector fields $X: T \rightarrow \mathbb{R}^d$ where $T \subset \mathbb{R}^N$. For $N = d = 1$ this has previously been called the "local time" of $X$, and, in general, it is the Lebesgue density $\alpha(x)$ of the occupation measure $\mu(\Gamma) =$ Lebesgue measure $\{t\in T: X(t)\in \Gamma\}$. If we restrict $X$ to a subset $A$ of $T$ we get a corresponding density $\alpha(x, A)$ and we will be interested in its behavior both in the space variable $x$ and the set variable $A$. The first part of the paper deals entirely with nonrandom, nondifferentiable vector fields, focusing on the connection between the smoothness of the occupation density and the level sets and local growth of $X$. The other two parts are concerned, respectively, with Markov processes $(N = 1)$ and Gaussian random fields. Here the emphasis is on the interplay between the probabilistic and real-variable aspects of the subject. Special attention is given to Markov local times (in the sense of Blumenthal and Getoor) as occupation densities, and to the role of local nondeterminism in the Gaussian case.

First Page:
Primary Subjects: 26A27
Secondary Subjects: 60G15, 60G17, 60J55
Full-text: Open access

format: plain


text:
Looking for Arithmetic worksheets?
Check out our pre-made Arithmetic worksheets!
 Tweet

Browse Questions
• Arts (164)
• English Language Arts (5672)
• English as a Second Language ESL (4415)
• Health and Medicine (59)
• Life Skills (3)
• Math (2540)

• Subtraction with Regrouping

• Statistics and Probability Concepts

• Physical Education (80)
• Science (1848)
• Social Studies (1416)
• Technology (3)

You can create printable tests and worksheets from these Grade 3 Subtraction with Regrouping questions! Select one or more questions using the checkboxes above each question. Then click the add selected questions to a test button before moving to another page.

Previous Next
Choose the correct difference.

$125 - 72 = ?$
1. 54
2. 53
3. 50
4. 49
Choose the correct difference.

$125 - 72 = ?$
1. 53
2. 51
3. 42
4. 54
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
$ul({:( ,237),(-,94):})$
1. 186
2. 287
3. 187
4. 143
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2, MP3
92 people ride the train to work each day. After the train stops at the train station, only 36 people are still on the train. How would you justify the number of people who were dropped off at the train station?
1. 65 people were dropped off at the train station because 92 - 36 = 65.
2. 56 people were dropped off at the train station because 92 + 36 = 56.
3. 56 people were dropped off at the train station because 92 - 36 = 56.
4. 56 people were dropped off at the train station because 92 - 36 = 92 + 36.
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
What is the difference?

700 - 419
1. 281
2. 291
3. 319
4. 391
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
How many pages does he have left to read?
1. 316
2. 216
3. 125
4. 548
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
$307-123=$
1. 184
2. 194
3. 84
4. 430
Grade 3 Subtraction with Regrouping CCSS: 3.OA.D.8
Jacob's mom had 567 apples. Jacob ate 34, and then gave 89 away. How many apples were left?
1. 444
2. 533
3. 441
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
Solve:

284 - 178 =
1. 200
2. 120
3. 100
4. 106
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
625 - 406 =
1. 298
2. 219
3. 118
4. 119
72 - 48 = ?
1. 120
2. 37
3. 24
4. 19
Trenton and Keyante each have a bag of marbles.
Trenton has 912 marbles. Keyante has 387 marbles.
How many more marbles does Trenton have than Keyante?
1. 625
2. 635
3. 1,299
4. 525
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
568 - 349 =
1. 199
2. 219
3. 345
4. 483
Solve:

924 - 760 =
1. 1600
2. 100
3. 200
4. 300
5. 164
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
Carrie and John have been on summer vacation for 28 days. If there are 90 days of vacation total, how many days are left?
1. 62
2. 78
3. 118
4. 68
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
700 - 436 =
1. 645
2. 164
3. 264
4. 24
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
A store purchased 531 fish. 179 of the fish are black.

How many fish are not black?
1. 710
2. 352
3. 448
4. 179
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
Cookie has 312 stickers. Calla has 236 stickers. How many more stickers does Cookie have than Calla?
1. 75
2. 547
3. 76
4. 79
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
Find the difference.

612 - 141 =
1. 581
2. 481
3. 531
4. 471
Grade 3 Subtraction with Regrouping CCSS: 3.NBT.A.2
504 - 132 =
1. 372
2. 432
3. 472
4. 362
Previous Next
You need to have at least 5 reputation to vote a question down. Learn How To Earn Badges.


text:
## Jokes in the sense of Littlewood: examples? [closed]

First, let me make it clear that I do not mean jokes of the "abelian grape" variety. I take my cue from the following passage in A Mathematician's Miscellany by J.E. Littlewood (Methuen 1953, p. 79):

I remembered the Euler formula $\sum n^{-s}=\prod (1-p^{-s})^{-1}$; it was introduced to us at school, as a joke (rightly enough, and in excellent taste).

Without trying to define Littlewood's concept of joke, I venture to guess that another in the same category is the formula

$1+2+3+4+\cdots=-1/12$,

which Ramanujan sent to Hardy in 1913, admitting "If I tell you this you will at once point out to me the lunatic asylum as my goal."

Moving beyond zeta function jokes, I would suggest that the empty set in ZF set theory is another joke in excellent taste. Not only does ZF take the empty set seriously, it uses it to build the whole universe of sets.

Is there an interesting concept lurking here -- a class of mathematical ideas that look like jokes to the outsider, but which turn out to be important? If so, let me know which ones appeal to you.

-
Don't think it's exactly the same concept but Scott Aaronson has a post on something similar here: scottaaronson.com/blog/?p=392 – Harry Altman Sep 15 2010 at 18:40
In regard to the empty set being a joke, Frank Harary and Ronald Read wrote a 1974 paper entitled "Is the null graph a pointless concept?". – Richard Stanley Sep 15 2010 at 22:29
It's amazing to see how many such jokes involve geometric series. – Thierry Zell Sep 16 2010 at 12:16
I just noticed that there are two puns in "abelian grape variety," as variety can associate with abelian or with grape. Too bad this is the kind of joke you don't mean. – Gerry Myerson Sep 26 2010 at 6:34
The two most recent answers have been more-or-less duplicates of previous answers. Time to close? – Gerry Myerson Oct 3 2010 at 12:25


text:
Turning sum to integral representation

I'd like to turn this sum: \begin{align}\sum_{n=0}^{\infty} \frac{x^{n+1}}{3^{n+1}(n+1)} \end{align} into an integral $\displaystyle \int_{a}^{b} g(x) \space dx$.

There seems to be many methods to either change or approximate sums as integrals. So I've become confused which approach would work.

In Is it possible to write a sum as an integral to solve it? robjohn used $\int_0^\infty e^{-nt}\,\mathrm{d}t=\frac1n$ which looks similar to a Laplace Transforms.

I can't see how he gets rid of the n's so I'm not able to apply it here otherwise it seems promising. But looking elsewhere there are also approximations methods such as: Turning infinite sum into integral which even more obscure at least to me.

How do I convert this sum to an integral?

• He got rid of the $n$'s by pulling the sum inside the integral. The sum with the exponentials was an easier problem than the original sum. – John Dec 19 '17 at 20:28

Well, you could write $$\frac{1}{n+1} = \int_0^1 t^n\; dt$$ so (for $|x| < 3$) your sum becomes \eqalign{\sum_{n=0}^\infty &\left(\frac{x}{3}\right)^{n+1} \int_0^1 t^n\; dt\cr = & \frac{x}{3} \int_0^1 \sum_{n=0}^\infty \left(\frac{xt}{3}\right)^n \; dt\cr = & \frac{x}{3} \int_0^1 \frac{dt}{1-xt/3}\cr = & \ln\left(\frac{3}{3-x}\right)\cr }
Recall that $$\frac{x^{n+1}}{3^{n+1}(n+1)} = \int_0^{x/3} t^n \ \mathrm{d}t$$ Hence $$\sum_{n=0}^{\infty} \frac{x^{n+1}}{3^{n+1}(n+1)} = \sum_{n=0}^{\infty} \int_0^{x/3} t^n \ \mathrm{d}t = \int_0^{x/3} \sum_{n=0}^{\infty} t^n \ \mathrm{d}t = \int_0^{x/3} \frac{1}{1-t} \mathrm{d}t = -\ln \left( \frac{3-x}{3} \right)$$
This holds for $|x|<3$.
If you differentiate it you will get a geometric series \begin{align} \frac d{dx}\sum_{n=0}^\infty \frac {x^{n+1}}{3^{n+1}(n+1)} &=\sum_{n=0}^\infty\frac d{dx}\frac 1{(n+1)}\left(\frac x3\right)^{n+1}\\ &=\sum_{n=0}^\infty\left(\frac x3\right)^n\\ &=\frac 1{1-\frac x3}\\ &=\frac 3{3-x}\\ \text{Integrating:} \qquad \sum_{n=0}^\infty \frac {x^{n+1}}{3^{n+1}(n+1)}&=-\ln\left(\frac {3-x}3\right)=\ln\left(\frac 3{3-x}\right)\end{align}


text:
## §2.3: Total influence

A very important quantity in the analysis of a boolean function is the sum of its influences.

Definition 26 The total influence of $f : \{-1,1\}^n \to {\mathbb R}$ is defined to be $\mathbf{I}[f] = \sum_{i=1}^n \mathbf{Inf}_i[f].$

[...]


text:
## Re: Webmention support for static sites

Oh, yes, and it’s great; I just wanted something much simpler. I took a look at it, but some requirements (like my ATOM feed needing WebSub compliance, which I didn’t know the meaning of, and other things that I sincerely didn’t understand) made me wish for something more straightforward. I run my script on the same computer that stores my atom.xml file, so I have no need for download support and/or caching further than knowing the timestamp of the file.

Ah, just to clarify, WebSub isn’t required, it’s just supported — it’s just one of the things Pushl supports. I hadn’t considered offline support as something that someone might want, so for that use case Gruta is definitely a better choice.

I’ll consider making it more clear what’s optional in the documentation, since I can see that being a point of confusion!


text:
# A particle with a charge of -5.0 micro C and a mass of 4.3 x 10^{-6} kg is released from rest at...

## Question:

A particle with a charge of {eq}\rm -5.0 \ \mu C {/eq} and a mass of {eq}\rm 4.3 \times 10^{-6} \ kg {/eq} is released from rest at point A and accelerates toward point B, arriving there with a speed of 18 m/s. The only force acting on the particle is the electric force. What is the potential difference between A and B?

## Conservation of Mechanical Energy

As we know that electrostatic force is a conservative force, so for a charged particle in an electric field, the total mechanical energy of the system remains conserved, i.e. change in the potential energy of the system is equal to the change in the kinetic energy of the system.

{eq}\begin{align} \Delta KE = \Delta PE \end{align} {/eq}

Data Given

• Charge on the particle {eq}q = 5 \ \rm \mu C = 5 \times 10^{-6} \ \rm C {/eq}
• Mass of the particle {eq}m = 4.3 \times 10^{-6} \ \rm kg {/eq}
• Speed of the particle at A {eq}v_i = 0 \ \rm m/s {/eq}
• Speed of the particle at B {eq}v_f = 18 \ \rm m/s {/eq}

Using the conservation of mechanical energy

{eq}\begin{align} \Delta KE = \Delta PE \end{align} {/eq}

{eq}\begin{align} KE_B - KE_A = q. \Delta V \end{align} {/eq}

{eq}\begin{align} \frac{1}{2}mv_f^2 - \frac{1}{2}mv_i^2 = q. \Delta V \end{align} {/eq}

{eq}\begin{align} \Delta V = \frac{m (v_f^2 - v_i^2)}{2q} \end{align} {/eq}

{eq}\begin{align} \Delta V = \frac{ 4.3 \times 10^{-6} \ \rm kg \times ((18 \ \rm m/s )^2 - (0 \ \rm m/s)^2)}{2 \times 5 \times 10^{-6} \ \rm C } \end{align} {/eq}

{eq}\begin{align} \color{blue}{\boxed{ \ \Delta V \ = \ 139.3 \ \rm V}} \end{align} {/eq}


text:
## Algebra and Trigonometry 10th Edition

False. $\sqrt {f(x)}\ne\frac{1}{2}f(x)$
Use the Power Property: $\frac{1}{2}f(x)=\frac{1}{2}\ln x=\ln x^{\frac{1}{2}}=\ln\sqrt x=f(\sqrt x)\ne\sqrt {f(x)}=\sqrt {\ln x}$


text:
# Black Holes

Apologies for the lengthiness between posts all!  We had a combination of immense amounts of work and a slightly confusing topic (though, mainly the former).  But wait, that’s a perfect progenitor to create the title object!

Black holes—one of the great mysteries of the universe. They made Stephen Hawking’s head hurt, helped spawn relativistic theory…they are, indeed, wonderful objects that may or may not confuse the heck out of you.

In general terms, black holes are warped regions in spacetime where singularity points (singularities) with infinite density have enough gravity to pull in anything—including light, which means that we can’t see them. It is infinitely dense because density = mass/volume, and the volume of a singularity is a point or zero. There are a lot of technicalities in black holes—we’ll cover them one by one.

Firstly, let’s look at how black holes are formed. They are giant—maybe even supergiant—stars that explode into a supernova and then collapse in on themselves. Normally, they would turn into a neutron star and stay there, but if the neutron star exceeds the Tolman-Oppenheimer-Volkoff limit, then it collapses and turns into—drumroooooll…a black hole.

An illustration of Cygnus X-1, widely thought to be a black hole. Credit: CXO

Now we’ll go over general black hole anatomy. The fabric of spacetime is usually smooth and even, with paths going out equally in all directions that can be traveled on. A black hole warps that—it makes a hole, essentially, that pulls everything in. The paths don’t go equally in all directions anymore, but instead all lead towards the center of the black hole. The centre of a black is a singularity of no mass, which warps spacetime to an infinite degree. Around it, there is this thing called an event horizon, which is the “point of no return”. Once an object goes past the event horizon, it cannot escape the black hole’s gravitational pull. A black hole may grow in size by accreting other objects of mass (contrary to popular belief, black holes do not “suck”), slowly growing larger and larger.

A black hole has three independent physical properties (which means properties that can be observed from outside the black hole): mass, charge, and angular momentum. Any two black holes found to have the same values for all of these are said to be indistinguishable and therefore black hole “twins”, if you will. This is what we call the no-hair theorem. There are two main kinds of black holes—the kind that rotate, and the kind that don’t.

The ones that don’t rotate are called Schwarzschild black holes. These black holes have no electric charge or angular momentum, but only mass. They are as simple as you get—unmoving, gravitational vortexes in the spacetime continuum. These are also just about the only objects in the universe that are perfect—and I mean perfect—spheres. They’re also special in another way—once you get past the event horizon, there is absolutely no way you will be able to avoid getting sucked into the singularity. None. You don’t stand a chance against the forces of a black hole.

Kerr black holes, on the other hand, do rotate. There is a theory—just a theory, mind—that states that it is possible, under perfect conditions, for matter to travel through its rotating ring of a singularity. The theory says that when you exit the black hole, you will most likely end up in another universe, with the black hole acting as an Einstein-Rosen bridge, or wormhole.  This is because the spinning produces what’s called frame dragging, producing an ergosphere.  This actually spins the fabric of space time, making objects able to travel around the black hole, and sometimes around the singularity as we said.

Theoretically, charged black holes exist as well, but in reality, the charge tends to attract particles of the opposite charge, which quickly cancel it out. Charged black holes that don’t rotate are called Reissner-Nordström black holes, and the ones that do rotate are called Kerr-Newman black holes.

The event horizon (Schwarzschild Radius) of a black hole. Credit: University of Colorado, Center for Astrophysics and Space Astronomy

The Schwarzschild radius (derived from escape velocity for those who are curious) is given by the equation ${ R }_{ s }=\frac { 2GM }{ { c }^{ 2 } }$ , where G is the gravitational constant, M is the mass of the black hole, and c is the speed of light.

Another way to change up black holes is by mass, which is shown with that there Schwarzschild radius.  Black holes are normally created by stars with masses between lower and upper mass limits of about 3 to 100 solar masses.  In real life…weird results have come up with impossibly massive stars or stars very close to the lower limit).  But even then, there are all sorts, theoretical or not. The types include:

• Micro black holes—Hawking theorized that low-mass black holes could be formed by high pressures in the early universe, if these exist, they might emit bursts of Hawking radiation in the (relatively) near future as they evaporate.  They also may, for an instant, be created here on Earth in the LHC!  Alternatively, we hear of work being done with lasers to make them (oh, how science is awesome).
• Stellar-mass black holes—3 to 15 solar masses, the major example used is usually Cygnus X-1, and they can form high energy X-ray binaries.
• Intermediate mass black holes—100 to 1000 solar masses, theoretically the center of globular clusters, may form from mergers of stellar-mass black holes, and may eventually merge into a supermassive black hole.
• Supermassive black holes—10^5 to 10^9 solar masses, the theoretical centers of spiral galaxies, thought to explain AGNs and quasars.
• Primordial black holes—very large and small ones that formed in the early universe, 10^-8 to 10^5 solar masses.  They aren’t fully understood.

Black holes also have another effect called gravitational lensing, which is when gravity causes light to bend so much that we can see multiple images of the same object. We follow the light rays in a straight path (which is normally what’s done with lenses), so we can see their apparent locations. Cool, huh? And if the black hole is perfectly symmetrical with respect to the line from Earth to whatever object we’re viewing, well, we can see an entire ring of the object. It looks something like this:

Credit: NASA Goddard Space Flight Center

Unfortunately, however, the black hole is rarely ever perfectly in line with Earth and the object we’re trying to view. So, instead, we see two images, like this:

Credit: NASA Goddard Space Flight Center

So what happens if you fall into a black hole, you ask? Well, it’s really not pretty. Once you get past the event horizon, you’re basically dead meat. There are ways to slow your descent into the singularity, but really…it’s hopeless. Once you get to a certain point, you just get sucked into the singularity, where your body is crushed into infinite density and added to the mass of the black hole. Right before that, however, you get torn apart by tidal forces of gravity and turn into a long, noodle-ish looking thing. That’s called spaghettification. It is really not pleasant. I would advise you to never try that.

But wait! There’s more! How do we know black holes exist if we can’t see them? The answer is this: Even though we can’t see them, they have effects on the surrounding regions that lets us know that they are indeed there. Their gravity is still great enough that they have effects on surrounding objects, though really, it’s not obvious enough that we’d be able to find it. But the most obvious thing they do? Because they accrete so much stuff, they radiate X-rays and energy like you wouldn’t believe. Just tons and tons of X-rays and energy—and best of all? Usually, they’re accompanied by these giant relativistic jets of gas, spouting from either end of the black hole. We don’t know why, or how, but there you go. Huge jets of glowing gas blowing out of black holes. And that is how we know they’re there.

Active galaxy Cen A, with jets powered by the supermassive black hole residing at its center. Credit: European Southern Observatory

There’s also something else called a naked singularity, which technically isn’t a black hole because it lacks an event horizon, but for all other purposes and intents, is the same thing. It is a massless singularity of infinite density that sucks in just about everything around it—it just doesn’t have an event horizon. However, no naked singularities have been discovered yet, so it seems that black holes like to stay clothed (as stated by the Cosmic Censorship Theory).

We mentioned Hawking radiation earlier in the post, but what exactly is it? Well, the real explanation is beyond the comprehension of any of your resident astro geeks, but we’ll just say that sometimes particle-antiparticle pairs are created at the event horizon, and one escapes and one does not. These particles result in evaporation, which takes away energy and therefore mass from the black hole.  Hawking radiation increases as the black hole loses mass, so at the very end of a black hole’s life, it releases a powerful burst of high-energy radiation.  In fact, some primordial black holes are thought to be going through this right about now.

Another point to make is what happens when “stuff” falls into a black hole. This “stuff” has various properties that are dubbed information. From there, there is a debate.  Perhaps not the Great Debate, but a fairly important one that has resulted in the black hole information loss paradox. This pretty much debates whether information is lost by a black hole. Some say it is, some say it isn’t (cue the Thorne-Hawking-Preskill debate). It is a paradox because two scientists, Hawking and Bekenstein, found that with Hawking radiation, a black hole evaporating information thrown into it would make that information permanently disappear. Forever. But then this violates some more quantum mechanics that are somewhat difficult to comprehend. Some say that the information should also exist just in a slightly…changed form. Again, we don’t even pretend to really understand these theories, but it just goes to show how complicated these strange astronomical objects are.

____________________________________

TL;DR: Black holes are the condensed remnants of extremely massive stars. Their density is so high that all sorts of pressures that would normally oppose gravity can’t fight anymore, and the battle for equilibrium is over.  So the mass basically condenses down to a point with many properties that aren’t fully understood. First of all, black holes technically can’t directly be seen, as light would warp around it.  But we can still manage to infer properties with this major disadvantage!  For example, properties of a black hole can be focused to mass, charge, and spin—these factors result in different types of black holes, but that’s beside the point (see what we did there?).  Black holes also have tons of anatomy to them, even if this isn’t biology.  Most importantly, their “size” is defined by a Schwarzschild radius, which defines the event horizon, the outer limit where the black hole’s effects exists. Hawking radiation is where black holes lose mass through some fancy quantum physics that we don’t pretend to begin to fully comprehend, but it does show that black holes don’t actually last forever.  Interestingly, they also end with a bang.


text:
Compute Lie algebra cohomology - MathOverflow most recent 30 from http://mathoverflow.net 2013-06-19T10:05:17Z http://mathoverflow.net/feeds/question/43665 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/43665/compute-lie-algebra-cohomology Compute Lie algebra cohomology Michele Torielli 2010-10-26T13:51:13Z 2011-01-05T15:26:02Z
Is there a computer algebra system that is able to compute the Lie algebra cohomology in a given representation?what if the Lie algebra is finite dimensional? In my case I would like to be able to compute the the cohomology in the following situation: let \$\mathfrak{g}\subset \mathfrak{h}\$ be an inclusion of finite dimensional complex Lie albebras, I'd like to compute the cohomology of \$Hom(\mathfrak{g}, \mathfrak{h}/\mathfrak{g})\$.
 http://mathoverflow.net/questions/43665/compute-lie-algebra-cohomology/43691#43691 Answer by mathphysicist for Compute Lie algebra cohomology mathphysicist 2010-10-26T16:55:37Z 2010-10-26T16:55:37Z
In the Maple computer algebra system you have the package LieAlgebraCohomology which should do what you want.
 http://mathoverflow.net/questions/43665/compute-lie-algebra-cohomology/51207#51207 Answer by Pasha Zusmanovich for Compute Lie algebra cohomology Pasha Zusmanovich 2011-01-05T15:26:02Z 2011-01-05T15:26:02Z
I have looked at this question a few years ago (with some more recent sporadic gilmpses), so I am definitely not uptodate. Here it goes, anyway, what I have learned back then:

GAP.
 GAP is a wonderful tool, but I would not call its cohomology computation capabilities efficient. As far I understand, it implements a straightfoward approach by constructing appropriate matrices and solve a linear algebra problem. One sees easily how the matrix size grows prohibitively with the dimension of an algebra. Seems to be not suitable for anything beyond "toy" problems.

Mathematica.
 Mathematica-based package "SuperLie" for computations in Lie (super)algebras, including cohomology, written by Pavel Grozman and used by Dimitry Leites and his collaborators in their recent papers (see arXiv): http://www.equaonline.com/math/SuperLie/ . Seems to have a very steep learning curve but looks quite impressive. Seems to outperform GAP, but how far - I don't know.

C.
 There is program (constantly evolving as far I understand) for computations of cohomology of Lie (super)algebras by Vladimir Kornyak (see arXiv). He is doing things beyond straightforward linear algebra approach - for example, he tries to split the cochain complex to smaller subcomplexes and perform reduction modulo an appropriate prime (in the case of zero characteristic). Seems to be comparable with "SuperLie" (as far as cohomology is concerned). It is written in plain C and does not have overheads of computer algebra systems. Unfortunately, Kornyak does not disclose (at least publically) sources or even binaries.

REDUCE.
 N. v.d Hijligenberg and G. Post, Computation by computer of Lie superalgebra homology and cohomology, Acta Appl. Math. 41 (1995), 123-134 http://dx.doi.org/10.1007/BF00996108 - haven't looked at it.

LiE
 J. Silhan, Algorithmic computations of Lie algebras cohomologies, Proceedings of the 22nd Winter School ``Geometry and Physics'', Rend. Circ. Mat. Palermo Suppl. No. 71 (2003), 191-197 http://dml.cz/handle/10338.dmlcz/701718 . A more specific program, implemented in LiE, for computation of cohomology of parabolic subalgebras of classical Lie algebras and related, basing on celebrated Kostant's work. Haven't looked at it thoroughly.

Magma.
 I never bothered with this commercial package which seems to be comparable with GAP.

?
 D.V. Reshetnikov, Computation of cohomology groups of the Lie algebras of type \$B_n\$ and \$C_n\$, Russian Math. (Izv. VUZ) 53 (2009), N8, 58-59 http://dx.doi.org/10.3103/S1066369X0908009X . Here the author reports (quite uselessly, I should admit, as no further details are given) about a program for computation of Lie algebra cohomology developed by him.

I personally think that there is a big unexplored area here - one should use heavily sparsity of occuring matrices (currently none of the programs described above seems to use it). Which kind of sparsity it is, is not clear apriori, and, moreover, I suspect that for different algebras and modules one will have different kinds of sparsity. This makes an interesting connection with methods and tricks from numerical linear algebra.

Again, take all this with a grain of salt, as things may have changed since I looked at them.


text:
### Pebbles

Place four pebbles on the sand in the form of a square. Keep adding as few pebbles as necessary to double the area. How many extra pebbles are added each time?

### Pythagorean Triples

How many right-angled triangles are there with sides that are all integers less than 100 units?

### Paving the Way

A man paved a square courtyard and then decided that it was too small. He took up the tiles, bought 100 more and used them to pave another square courtyard. How many tiles did he use altogether?

# Isometric Areas

##### Stage: 3 Challenge Level:

Here is an equilateral triangle with sides of length 1.

Let's define a unit of area, $T$, such that the triangle has area $1T$.

Here are some parallelograms whose side lengths are whole numbers.

Can you find the area, in terms of $T$, of each parallelogram?
Compare the results with the lengths of their edges.

What do you notice?
Can you explain what you've noticed?

Can you find a similar result for trapeziums in which all four lengths are whole numbers?

You might like to try More Isometric Areas next.


text:
ANOVA

## Basic Goal of ANOVA

Compare the means of groups that have been sampled randomly, to test whether or not they differ.

The different levels of the categorical variable representing different groups are called treatments.

Each observation is called a replicate and is assumed to be independent from all other replicates.

So how do we compare group means?

Confusingly, it's all about variances (hence ANOVA).

## Intuitive Picture of ANOVA

Colored bars at top represent variances within groups.

Black bars at top represent variances ignoring groups.

## The ANOVA linear model

$Y_{ij}=\mu + A_i + \epsilon_{ij}$

$$\mu$$ is the population grand mean ($$\bar{Y_{ij}}$$ an unbiased estimator of $$\mu$$)

$$A_i$$ is the additive linear effect compared to the grand mean for a given treatment $$i$$ ($$A_i$$‘s sum to 0).

$$\epsilon_{ij}$$ is the error variance (the variance of individual points around their treatment group means. These are assumed to be distributed as $$N(0,\sigma^2)$$).

## ANOVA linear model - Simulation

$Y_{ij}=\mu + A_i + \epsilon_{ij}$

Let's see how changing model parameters affects the y variable. We will start a few variables that will be kept constant.

grandMean <- 10
groups <- rep(c("A", "B"), 100)
myError <- rnorm(200, mean = 0, sd=3)

## ANOVA linear model - Simulation

y <- grandMean + c(-5, 5) + myError
qplot(groups, y, geom="boxplot", fill=groups)

## ANOVA linear model - Simulation

y <- grandMean + c(-0.3, 0.3) + myError
qplot(groups, y, geom="boxplot", fill=groups)

## The steps in a one-way ANOVA

1. Calculate the Total SS
2. Calculate the Within-group SS
3. Calculate the Between-group SS
4. Calculate Mean Squares using appropriate df.
5. Calculate the F ratio
6. Calculate the p-value

As you could tell from your reading, calculating the appropriate sum of squares is complicated, and depends on your experimental design. Be careful (or just use Monte Carlo)!

## Walking through the ANOVA

Example data from Gotelli Table 10.1

##   unmanipulated control treatment
## 1            10       9        12
## 2            12      11        13
## 3            12      11        15
## 4            13      12        16

These data represent 12 experimental plots to see the effect of soil temperature on the flowering period in larkspur flowers. The treatment plots had heating coils installed and activated. The control plot had heating coils installed but never turned on. The unmanipulated plots were untouched.

We want to know if there is a difference in mean flowering length between these groups.

## Walking through the ANOVA

Source degrees freedom SS Mean Square (MS) Expected Mean Square F-ratio
Among groups a-1 $$\sum\limits_{i=1}^a\sum\limits_{j=1}^n(\bar{Y}_i - \bar{Y})^2$$ $$\frac{SS_{among_groups}}{(a-1)}$$ $$\sigma^2 + n\sigma^2_A$$ $$\frac{MS_{among}}{MS_{within}}$$
within groups (residual) a(n-1) $$\sum\limits_{i=1}^a\sum\limits_{j=1}^n(Y_{ij} - \bar{Y}_i)^2$$ $$\frac{SS_{within}}{a(n-1)}$$ $$\sigma^2$$
Total an-1 $$\sum\limits_{i=1}^a\sum\limits_{j=1}^n(Y_{ij} - \bar{Y})^2$$ $$\frac{SS_{total}}{(an-1)}$$ $$\sigma^2_Y$$

## Assumptions of ANOVA

1. The samples are independent and identically distributed
2. The residuals $$\epsilon_i$$ are normally distributed
3. Within-group variances are similar across all groups (‘homoscedastic”)
4. Observations are properly categorized in groups

## Supporting assumptions

1. Main effects are additive (no strong interactions).
2. Balanced design (equal number of observations in all groups). If you are going to do a lot of ANOVA, you need to read about the ANOVA controversy in R and other models for calculating SS that are more appropriate for unbalanced designs.

## ANOVA in R

myMod <- lm(iris$Petal.Length~iris$Species)
summary(myMod)
##
## Call:
## lm(formula = iris$Petal.Length ~ iris$Species)
##
## Residuals:
##    Min     1Q Median     3Q    Max
## -1.260 -0.258  0.038  0.240  1.348
##
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)
## (Intercept)             1.46200    0.06086   24.02   <2e-16 ***
## iris$Speciesversicolor 2.79800 0.08607 32.51 <2e-16 *** ## iris$Speciesvirginica   4.09000    0.08607   47.52   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4303 on 147 degrees of freedom
## Multiple R-squared:  0.9414, Adjusted R-squared:  0.9406
## F-statistic:  1180 on 2 and 147 DF,  p-value: < 2.2e-16

## ANOVA in R

anova(myMod)
## Analysis of Variance Table
##
## Response: iris$Petal.Length ## Df Sum Sq Mean Sq F value Pr(>F) ## iris$Species   2 437.10 218.551  1180.2 < 2.2e-16 ***
## Residuals    147  27.22   0.185
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

## Checking assumptions

plot(iris$Petal.Length ~ iris$Species)

#Homogeneity of variances
bartlett.test(iris$Petal.Length ~ iris$Species)
##
##  Bartlett test of homogeneity of variances
##
## data:  iris$Petal.Length by iris$Species
## Bartlett's K-squared = 55.423, df = 2, p-value = 9.229e-13

## Checking assumptions

plot(myMod)

## Two-Way ANOVA

Life gets more complicated when we are considering more than one factor

$Y_{ij}=\mu + A_i + B_j + AB_{ij} + \epsilon_{ij}$

With more than one factor, we have the possibility of non-additive effects of one factor on the other. These are called interaction terms

## Simple model (no interaction)

data(warpbreaks)
model <- lm(warpbreaks$breaks ~ warpbreaks$tension + warpbreaks$wool) anova(model) ## Analysis of Variance Table ## ## Response: warpbreaks$breaks
##                    Df Sum Sq Mean Sq F value   Pr(>F)
## warpbreaks$tension 2 2034.3 1017.13 7.5367 0.001378 ** ## warpbreaks$wool     1  450.7  450.67  3.3393 0.073614 .
## Residuals          50 6747.9  134.96
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

## Two-way ANOVA

Have possibility of non-additive effects, where value of factor A influences value of factor B


text:
# Not really LÖVING it

So I spent yesterday playing around with LÖVE, a really cute little platform for writing 2D games. It got linked on reddit on friday, and it looked neat so I thought I’d give it a try.

As you can tell from the title, this is not going to be a very positive post. So in order to brighten the mood I’m going to start by saying positive things about it:

• I’ve been saying for ages that I wanted to play around with creating little games. I’ve never gotten around to doing so. LÖVE made it sufficiently easy for me to get started that I no longer had an excuse for not doing so.
• It’s really very good at getting all the annoying cruft of creating a basic game out of the way.
• I had a lot of fun playing with it.
• I’m really glad I gave it a try, and if you’ve never written a game before and want to, you probably should too.

Also, the website is adorable.

Unfortunately, that’s about where the positive side of things stops.

First off, the biggest problem with it is that it’s really unreliable. It will sit on a CPU and eat 100% of it, for even the smallest of games. It seemed very crashy – on my work PC it tended to randomly crash other applications. People who tried to play my games said that it seems to crash itself and other things when you try to close it (this was under both macs and windows. I never had this problem under linux). Between these two factors I’d basically never consider it for a real game. Hopefully both will be fixed at some point. (Yes, yes, I know, open source, I should look into it. Unfortunately it seems to be written in C++, which I have approximately zero interest in writing).

The other major problem with it is that it’s actually not very powerful. What it basically comes down to is an infrastructure for loading files, an ok graphics API and fairly basic physics and sound APIs (there’s also an animation API which I didn’t bother to look at. It may be better than the others, I don’t know). So although it helps you get started it doesn’t really do much for you once you have.

As an example to illustrate the above: I had a bit of a play with the physics engine. Basically I created a green square that could jump about (he’s a very abstract representation of Victoria’s very abstract representation of a frog). That worked quite nicely – he could jump, he could move from side to side, he could land on stuff.

The point at which it stopped working nicely was when I wanted him to not be able to jump while already in mid air. See, it turns out that the physics engine has no way (or rather no way exposed in the API) of detecting if two bodies were in contact, so I couldn’t easily detect if he was on the ground or not. I asked in #loveclub on freenode (a much less dubious channel than the name might suggest), and various things were suggested. The best idea I encountered was checking vertical distance from the point of contact. This unfortunately proves to have a bunch of problems as well. The method I eventually settled on was that he could only jump if his vertical speed was already zero (actually, < 0.001) and hope that the player’s reactions weren’t good enough to jump during hang time.

At this point I more or less decided I’d had enough of the physics engine. I went back to the first game I’d made, turned it into something that was actually a proper game (it hadn’t previously been possible to lose. Now it’s only really hard to lose) and declared myself all out of LÖVE. It was a fun little encounter, and I do hope they do well, but unfortunately I’m not really left with any desire to use it.

If you want to check out the code I wrote for this, it’s available from the github repo. Be warned though: It’s really bad. It started out slightly crummy because I was just exploring the API, and then in that last “right, let’s get something actually playable” push I started factoring things out nicely before I realised that I was never going to touch the code again and just brutally copied and pasted and hacked until it worked. I should also warn you that the games themselves are correspondingly lame. :-)

(As an aside, also in that repo are today’s experiments at recreating something like the Love API but more reliable and/or powerful in Scala. But more on those later)

This entry was posted in programming and tagged , on by .

# Lessons learned in class

(Warning: I’m half asleep, and this post is somewhere between a brain dump and a rant. Coherency is strictly optional).

So, my latest random personal project has turned into a bit of a debacle.

I decided I wanted a Java bytecode manipulation library with a decent Scala API. The options were either “Write my own” or “Write bindings to an existing one”. I chose something of a middle ground: “Port an existing one”. Rather than go for any of the normal big names I went for an obscure little internal library at EPFL called FJBG (Fast Java Bytecode Generator). It’s basically a low level interface onto the classfile format, and I’d used it before for code generation (e.g. for the structural proxies stuff) and found it pretty straightforward. Kindof hard to debug programming errors, but otherwise pretty robust.

One slight flaw: No test suite to speak of. But that’s ok, it’s used as part of the compiler backend for scalac, so I assume it gets relatively well covered by the scalac test suite. And it’s been around for quite a while, so has had itme to stabilise. Should be fine.

Right?

Right?

Anyway, the initial porting process went pretty smoothly. I was astonished at how smoothly in fact – after about 6 hours of work I had the bytecode generation code working in Scala and prettified to have nicer method names, etc. Pretty good going. I was frankly astonished – I basically ran it through jatran, spent about 6 hours fixing compiler errors and then at the end it took about 10 minutes of bug fixing before it just worked. Not bad. The only slight problem was that the class file parsing code wasn’t working.

The problem was that the way the code worked there was a fairly deeply nested inheritance strategy, and maintained two constructor hierarchies – one for creating things in memory, one for creating them from a DataInputStream. because of the way Scala handles constructors this is essentially impossible to do in Scala.

I’ve never thought this was a problem before, but this seemed to me to be quite a reasonable thing to do and I started to have doubts about Scala’s approach to constructors. I still have some, but not to the point that I previously had. The thing is, this approach is really fragile. It means that each constructor needs to balance the class’s invariants in different ways – you’ve given yourself twice as many opportunities to screw up.

Anyway, after some struggling with approaches I eventually (took me several times as long as the previous part of the porting) got this ported in a reasonably straightforward way. It wasn’t the prettiest code ever, but the mapping onto the original wasn’t bad. So I tried it out on a few simple tests – generate a class file, read it back in again, compare them to make sure you got approximately the same thing.

Hm. And it didn’t work. How curious.

I stared at the implementation for a bit, stared at the original Java, couldn’t see a difference. So I ran the same test on the original Java and it broke in the same way. Great.

That turned out to be an easy fix. But it was an easy fix to a problem very definitely caused by the multiple constructor hierarchy. Oh well, that worked now.

Next part of the test. Write the newly read class file to a file, load it and try to run it.

Oops. It NPEs when I try to write the file. Guess I did something wrong – I wonder why that array is null there. Looks like the logic for initialising it is rather complex, lets see how the original Java version handles this. So I wrote a simplified test case using the original which took a class file, read it to the in memory representation and wrote it out again and tested it against a random class file. It broke. In a totally different way to the way my version did – it didn’t even manage to read the file (I think the difference here is that this was a classfile found in the wild rather than one generated by FJBG). Tried it on a different, simpler one – Specifically the class generated by the obvious HelloWorld.java. That broke too.

So at this point I was forced to conclude that the class file reading code in FJBG just didn’t work at all. What the hell? Wasn’t this used in the Scala compiler? Clearly it has to be able to parse class files in order to know what’s available on the classpath to compile against!

So, some digging through the compiler source later: scalac doesn’t use FJBG’s class reading code at all. It has its own entirely separate code for that. So this code which I thought was part of a fairly mature and robust compiler backend was in fact completely and utterly untested and unused. No wonder it was broken.

So, new rule (to many of you, a very old rule): If it’s library code and it’s not tested, it’s broken. An application you can judge by “Does it do the right thing?” to at least get some sense of how not broken it is. Besides, I only have to use it, no code against it. But if my code is going to depend on yours, yours better be tested.

I’m usually pretty bad at tests actually. Applications I’ve written are certainly woefully undertested. SBinary’s tests are… well, adequate. And I don’t really recommend depending on any other libraries I’ve written – they’re all a bit incomplete and half assed. :-) Hopefully this will teach me to be better.

At this point I was already rather upset with FJBG’s object model – too mutable, too many back references. So on top of fixing the reading code I was going to have to fix that. At this point I decided that it was time to cut my losses, so I’m going to go back to option 1: Write my own. I’ll certainly reuse what I can salvage from the FJBG code (assuming some worries I have about licensing are resolved), but honestly the class file format is pretty easy. The overarching format took me two hours to write a parser for (I did it the same night as discovering that . The bytecode format for method bodies is harder, but I expect to be able to reuse FJBG code for this bit (and probably write a fair bit of my own).

Anyway, hopefully this will turn out to be a good thing and I’ll end up with something much more scalic than a straight port of FJBG would have been. We’ll see. Watch this space to see if anything comes of this, and watch this repo to keep an eye on the code.

This entry was posted in programming and tagged , , on by .

# Scala arrays

Update: Note that this is about the old implementation and no longer applies.

There’s been a thread on Scala debate in the last day or two about breaking the current array implementation. It’s in most regards a very tedious thread, but one thing that’s emerged in the course of the thread is that people don’t really understand how Scala arrays work. This isn’t surprising – they’re a bit confusing. It looks like they must be horribly inefficient, but actually they’re only mildly inefficient and much of the time the compiler can remove even that and treat them as normal Java arrays.

This post is basically a “What’s going on here?” post. I’ll explain some of the basics of how Scala arrays work and what you can expect in terms of performance. Warning: This post will contain JVM bytecode. If that scares you… well, close your eyes while reading or something. :-)

There are essentially two distinct cases here. The case where the arrays are polymorphic (depend on a type parameter we don’t know the class of. e.g. an Array[T]) and the case where they’re monomorphic (depend on a fully realised type parameter. e.g. an Array[Int] or an Array[String]. I’m also going to count things like Array[List[T]], where the class is known even though the actual type depends on a parameter. This is technically wrong, but works for the purpose of this discussion).

The issue here is that Scala supports polymorphic arrays where the type parameter ranges across both object and value types. This is interesting, because the JVM doesn’t. Consequently it comes with some overhead in the implementation. Occasionally this is a significant performance hit.

Ok. So, Scala is boxing arrays to make them appear polymorphic. It must be generating horribly inefficient code to do so, right? Let’s take a look to see what happens:

Consider the following method:

def foo = {
val bar = new Array[Int](3);
bar(0) = 1;
bar;

}

So, we’re expecting something involving boxing ints to and from objects. Let’s use javap to look at the generated bytecode.

 public int[] foo(); Code: 0: iconst_3 1: newarray int 3: astore_1 4: aload_1 5: iconst_0 6: iconst_1 7: iastore 8: aload_1 9: areturn

Oh, um. So, not much boxing huh?If you can’t read bytecode, what this is doing is basically exactly what a Java compiler using the corresponding code for int[] would generate. It’s using the correct instructions for creating and storing things into a primitive int array.

Object arrays behave similarly:

 def foo = { val bar = new Array[String](3); bar(0) = "fish"; } public java.lang.String[] foo(); Code: 0: iconst_3 1: anewarray #14; //class java/lang/String 4: astore_1 5: aload_1 6: iconst_0 7: ldc #16; //String fish 9: aastore 10: aload_1 11: areturn

This correctly generates a String[] as you’d expect.

When you have a primitive array, Scala generates pretty efficient bytecode for it – it just uses a native Java primitive array. Similarly when you have an object array of a known class type.

Note that it’s specifically the classtype that has to be known. The actual type is of no importance.Here’s another example of it doing the right thing:

def foo[T] = {
val bar = new Array[List[T]](3);
bar(0) = Nil;
bar
}

public scala.List[] foo();
Code:
0:    iconst_3
1:    anewarray    #14; //class scala/List
4:    astore_1
6:    iconst_0
7:    getstatic    #20; //Field scala/Nil$.MODULE$:Lscala/Nil$; 10: aastore 11: aload_1 12: areturn  Multidimensional arrays behave similarly:  def foo = { val bar = new Array[Array[Int]](10, 10); bar(0)(3) = 1; bar; } public int[][] foo(); Code: 0: ldc #13; //int 10 2: ldc #13; //int 10 4: multianewarray #15, 2; //class "[[I" 8: astore_1 9: aload_1 10: iconst_0 11: aaload 12: iconst_3 13: iconst_1 14: iastore 15: aload_1 16: areturn  So far, nothing very interesting to see here. It works exactly like you’d expect it to. Where the magic starts to happen is when you have an Array[T]. So, what happens if we use one of these things polymorphically?   def foo = { val baz = new Array[Int](3); bar(baz, 3); } def bar[T](ts : Array[T], t : T) = ts(0) = t; Clearly we need to do something. In Java this would just work by using an Object[] under the scenes, but for Scala we can’t do that as we need to be able to pass it an array of primitives. So what we do is we box the array. We create a standard wrapper which can take both a primitive array and an object array and present an array like API for both. This is in fact the thing you’re seeing when you see the API for scala.Array – all the methods like map, flatMap, projection, etc. belong to the BoxedArray wrapper class (or one of its superclasses). Let’s see how this looks at the bytecode level:    public void bar(scala.runtime.BoxedArray, java.lang.Object); Code: 0: aload_1 1: iconst_0 2: aload_2 3: invokevirtual #18; //Method scala/runtime/BoxedArray.update:(ILjava/lang/Object;)V 6: return public void foo(); Code: 0: iconst_3 1: newarray int 3: astore_1 4: aload_0 5: new #28; //class scala/runtime/BoxedIntArray 8: dup 9: aload_1 10: invokespecial #31; //Method scala/runtime/BoxedIntArray."":([I)V 13: iconst_3 14: invokestatic #37; //Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; 17: invokevirtual #41; //Method bar:(Lscala/runtime/BoxedArray;Ljava/lang/Object;)V 20: return  So, the method bar just generates the expected code using the BoxedArray class. On calling this code, we first create an int[] as normal, we box it with a BoxedIntArray (an implementation of BoxedArray for wrapping an int[]) and call the method as expected. There’s a bit of boxing overhead, but it’s not too bad. The main point is that at the backend we are still using a primitive array for storage. Ok. This is all very well, but what happens if we need to create a polymorphic array? How can I do new Array[T](3) if I don’t know what T is so don’t know whether it needs to be a primitive or an object array how can I create this? The key observation here is that as long as we are polymorphic in the array type we must box anyway. So you never have to expose a native Java array until a point where you know what the actual type is. Until that point we use a custom boxed array implementation called BoxedAnyArray. What happens here is that it starts out using an Object[] until it knows what type it is. At the point where we request it as a Java native array we now have a concrete array type we want it as. Consequently we create an array of that type at that point, populate it from the Object[] and change the BoxedAnyArray in place to now be backed by that array instead of the Object[] it originally had. The Object[] is now discarded. Because the BoxedAnyArray’s backing store is now the newly created (possibly primitive) array, any updates to and from the boxed version will now point to this new array. Hence the native array and the boxed array will remain in synch, even though this isn’t the array it started out with. Further, and this is important, after this point we have a native array in our hands and can treat it accordingly. Anything that was using the BoxedAnyArray continues to do so, but there is no “taint” associated with our newly created array and in particular no additional overhead. Unfortunately this trick doesn’t come for free. BoxedAnyArray is kindof a slow beast (I think some of this can be fixed with an additional level of indirection actually, but it currently isn’t). It does a lot of checking in the apply and update methods and, additionally, they’re synchronized. While you continue to use BoxedAnyArray your performance will suffer much more than the other BoxedArray implementations. Let’s read some more bytecode:   def newarray[T] = new Array[T](3); def foo = { val x = newarray[Int] x(0) = 3; x } public scala.runtime.BoxedArray newarray(); Code: 0: new #14; //class scala/runtime/BoxedAnyArray 3: dup 4: iconst_3 5: invokespecial #17; //Method scala/runtime/BoxedAnyArray."":(I)V 8: areturn public int[] foo(); Code: 0: getstatic #25; //Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
4:    invokevirtual    #29; //Method newarray:()Lscala/runtime/BoxedArray;
7:    getstatic    #35; //Field java/lang/Integer.TYPE:Ljava/lang/Class;
10:    invokevirtual    #39; //Method scala/runtime/ScalaRunTime$.arrayValue:(Lscala/runtime/BoxedArray;Ljava/lang/Class;)Ljava/lang/Object; 13: astore_2 14: aload_2 15: instanceof #41; //class scala/runtime/BoxedArray 18: ifeq 37 21: getstatic #25; //Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
25:    checkcast    #41; //class scala/runtime/BoxedArray
28:    getstatic    #35; //Field java/lang/Integer.TYPE:Ljava/lang/Class;
31:    invokevirtual    #39; //Method scala/runtime/ScalaRunTime$.arrayValue:(Lscala/runtime/BoxedArray;Ljava/lang/Class;)Ljava/lang/Object; 34: goto 38 37: aload_2 38: checkcast #43; //class "[I" 41: astore_1 42: aload_1 43: iconst_0 44: iconst_3 45: iastore 46: aload_1 47: areturn It’s generating slightly redundant bytecode here, in that it’s testing to see if the local variable is a BoxedArray or an int[] before unboxing it despite the fact that it’s always a BoxedArray, but that’s not a big deal. The key point here is that we had a BoxedAnyArray and we end up with an int[]. Here’s an example combining the two instances of polymorphism we’ve seen so far:   def foo = { val x = newarray[Int] bar(x, 3); } public void foo(); Code: 0: getstatic #39; //Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
4:    invokevirtual    #43; //Method newarray:()Lscala/runtime/BoxedArray;
7:    getstatic    #49; //Field java/lang/Integer.TYPE:Ljava/lang/Class;
10:    invokevirtual    #53; //Method scala/runtime/ScalaRunTime$.arrayValue:(Lscala/runtime/BoxedArray;Ljava/lang/Class;)Ljava/lang/Object; 13: astore_2 14: aload_2 15: instanceof #21; //class scala/runtime/BoxedArray 18: ifeq 37 21: getstatic #39; //Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
25:    checkcast    #21; //class scala/runtime/BoxedArray
28:    getstatic    #49; //Field java/lang/Integer.TYPE:Ljava/lang/Class;
31:    invokevirtual    #53; //Method scala/runtime/ScalaRunTime\$.arrayValue:(Lscala/runtime/BoxedArray;Ljava/lang/Class;)Ljava/lang/Object;
34:    goto    38
38:    checkcast    #55; //class "[I"
41:    astore_1
43:    new    #57; //class scala/runtime/BoxedIntArray
46:    dup
48:    invokespecial    #60; //Method scala/runtime/BoxedIntArray."":([I)V
51:    iconst_3
52:    invokestatic    #66; //Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
55:    invokevirtual    #68; //Method bar:(Lscala/runtime/BoxedArray;Ljava/lang/Object;)V   58:    return

Note how the BoxedAnyArray gets unboxed and reboxed into a BoxedIntArray before being passed anywhere. This is a good thing – BoxedIntArray is a much lighter weight thing.

### Summary:

• When used monomorphically, Scala arrays are Java arrays.
• When used polymorphically, Scala arrays are scala.runtime.BoxedArray instances. There is a separate subclass of BoxedArray for each primitive type and one for object. When a monomorphic method receives a BoxedArray it will usually unbox it rather than call its apply and update methods.
• There is also BoxedAnyArray. This has a fairly high overhead and is used *only* for creating polymorphic arrays. The compiler will get rid of it at the earliest possible opportunity and rebox as other forms.

So, what does this mean in terms of performance?

Firstly, if you use arrays monomorphically, they will be Java arrays and have no additional overhead associated with them (you’ll need to box them for invoking methods on Array like map, projection, etc, but this isn’t too bad). So if you want really high performance code, only use monomorphic arrays.

At the next level, you can still get reasonably high performance code if you use polymorphic arrays but only create them monomorphically. You’ll get a boxing overhead for primitives, but that’s true of any polymorphic code in Scala.

Slowest of all is when you create an array polymorphically and continue to use it polymorphically. Once you’re in monomorphic code it will regain normal performance characteristics and future uses of it will behave as if it had been instantiated monomorphically (but previously stored references to it will continue to pass through a BoxedAnyArray and have the associated overhead).

One final point of warning. Consider the following code:

class Foo[T]{
private[this] val arr = new Array[T](2);
def apply(i : Int) = arr(i);
def update(i : Int, t : T) = arr(i) = t;
}

Note that the Array never escapes this. So there’s no way to unbox it!

Looking at the bytecode confirms:

public class arrays.Foo extends java.lang.Object implements scala.ScalaObject{
public arrays.Foo();
Code:
1:    invokespecial    #12; //Method java/lang/Object."":()V
5:    new    #14; //class scala/runtime/BoxedAnyArray
8:    dup
9:    iconst_2
10:    invokespecial    #17; //Method scala/runtime/BoxedAnyArray."":(I)V
13:    putfield    #21; //Field arr:Lscala/runtime/BoxedArray;
16:    return

public void update(int, java.lang.Object);
Code:
1:    getfield    #21; //Field arr:Lscala/runtime/BoxedArray;
6:    invokevirtual    #27; //Method scala/runtime/BoxedArray.update:(ILjava/lang/Object;)V
9:    return

public java.lang.Object apply(int);
Code:
1:    getfield    #21; //Field arr:Lscala/runtime/BoxedArray;
5:    invokevirtual    #38; //Method scala/runtime/BoxedArray.apply:(I)Ljava/lang/Object;
8:    areturn
}

The array never gets unboxed and consequently continues to use the higher overhead BoxedAnyArray forever. If you instead use an Array[AnyRef] here and cast your code will run noticably faster (which was the observation which sparked this whole discussion)

This entry was posted in programming and tagged , , on by .

# Random linear algebra hackery in Scala

One of my random pet projects at the moment is putting together a prettified linear algebra API for Scala. I’m not implementing the linear algebra routines myself, but am instead implementing it as a wrapper over Colt. This isn’t really any sort of stable release or project. It’s more of a “If you want this sort of thing you might find it useful” comment.

The basic design is:

• Everything is mutable, but the API encourages using it in an immutable way.
• Makes no attempt to hide its colt origins. If you want to use it with Colt proper, it will cheerfully let you do so, and you will often have to explicitly use colt classes.
• API loosely inspired by matlab/Octave
• Hideous abuses of overloading, implicits, functional programming and symbolic method names abound in order to get an API that allows for very compact code.  If you don’t like this sort of thing you may want to steer clear. :-)

It’s currently available from my misc hg repository, but it’s getting large enough that I’ll probably factor it out into its own soon.

This entry was posted in programming and tagged , , on by .

# SBinary 0.2

I quietly uploaded SBinary 0.2 last night. I was going to write up some documentation for it today and do an official announcement, but it’s now coming up to 19:00 and I still haven’t written any documentation so I have a sneaking suspicion it ain’t happening today. So, if you want to have a play with it there’s a new jar and scaladoc up there.

Changes from 0.1:

• Improved API which is less closely tied to java.io
• Supports a wider range of collections and standard types (not the entire standard library as I’d originally said I was going to do. There are some issues surrounding collections and open unions which I want to resolve before I do that).
• A limited amount of support for lazy IO using Stream. (Specifically, Stream is read lazily from an input. However there are a lot of limitations on this at the moment). The design is such that it should be impossible to incorrectly interleave IO actions (i.e. reading something else from the input will force pending lazy reads to complete).
• Improved some performance stupidities (nonbuffered reading/writing to files, unspecialised reading/writing of byte arrays)
• Improved generic combinators for building binary instances (although the “case classes for free” one I want to add is waiting on a compiler bug before I can add it)

I hope to write up some proper documentation soon, and when I do I’ll send an announcement to the mailing list. In the meantime, feel free to have a play.

This entry was posted in programming and tagged , , , on by .


text:
# mmwave.clustering.clustering¶

mmwave.clustering.clustering.associate_clustering(new_cluster, pre_cluster, max_num_clusters, epsilon, v_factor, use_elevation=False)

Associate pre-existing clusters and the new clusters.

The function performs an association between the pre-existing clusters and the new clusters, with the intent that the cluster sizes are filtered.

Parameters: new_cluster – pre_cluster – max_num_clusters – epsilon – v_factor – use_elevation –
mmwave.clustering.clustering.radar_dbscan(det_obj_2d, weight, doppler_resolution, use_elevation=False)

DBSCAN for point cloud. Directly call the scikit-learn.dbscan with customized distance metric.

DBSCAN algorithm for clustering generated point cloud. It directly calls the dbscan from scikit-learn but with customized distance metric to combine the coordinates and weighted velocity information.

Parameters: det_obj_2d (ndarray) – Numpy array containing the rangeIdx, dopplerIdx, peakVal, xyz coordinates of each detected points. Can have extra SNR entry, not necessary and not used. weight (float) – Weight for velocity information in combined distance metric. doppler_resolution (float) – Granularity of the doppler measurements of the radar. use_elevation (bool) – Toggle to use elevation information for DBSCAN and output clusters. Numpy array containing the clusters’ information including number of points, center and size of the clusters in x,y,z coordinates and average velocity. It is formulated as the structured array for numpy. clusters (np.ndarray)


text:
### Top 2 Arxiv Papers Today in Chaotic Dynamics

##### #1. Gyrotactic phytoplankton in laminar and turbulent flows: a dynamical systems approach
###### Massimo Cencini, Guido Boffetta, Matteo Borgnino, Filippo De Lillo
Gyrotactic algae are bottom heavy, motile cells whose swimming direction is determined by a balance between a buoyancy torque directing them upwards and fluid velocity gradients. Gyrotaxis has, in recent years, become a paradigmatic model for phytoplankton motility in flows. The essential attractiveness of this peculiar form of motility is the availability of a mechanistic description which, despite its simplicity, revealed predictive, rich in phenomenology, easily complemented to include the effects of shape, feed-back on the fluid and stochasticity (e.g. in cell orientation). In this review we consider recent theoretical, numerical and experimental results to discuss how, depending on flow properties, gyrotaxis can produce inhomogeneous phytoplankton distributions on a wide range of scales, from millimeters to kilometers, in both laminar and turbulent flows. In particular, we focus on the phenomenon of gyrotactic trapping in nonlinear shear flows and in fractal clustering in turbulent flows. We shall demonstrate the usefulness...
more | pdf | html
###### Tweets
NonperiodicFlow: Gyrotactic phytoplankton in laminar and turbulent flows: a dynamical systems approach https://t.co/U49SmBJQYu https://t.co/NZbmdpRhId
SciencePapers: Gyrotactic phytoplankton in laminar and turbulent flows: a dynamical systems approach. https://t.co/KR5OkSYAs5
HarrisonHartle: RT @SciencePapers: Gyrotactic phytoplankton in laminar and turbulent flows: a dynamical systems approach. https://t.co/KR5OkSYAs5
TonyPershin: RT @SciencePapers: Gyrotactic phytoplankton in laminar and turbulent flows: a dynamical systems approach. https://t.co/KR5OkSYAs5
None.
None.
###### Other stats
Sample Sizes : None.
Authors: 4
Total Words: 12378
Unqiue Words: 3402

##### #2. Towards a semiclassical understanding of chaotic single- and many-particle quantum dynamics at post-Heisenberg time scales
###### Daniel Waltner, Klaus Richter
Despite considerable progress during the last decades in devising a semiclassical theory for classically chaotic quantum systems a quantitative semiclassical understanding of their dynamics at late times (beyond the so-called Heisenberg time $T_H$) is still missing. This challenge, corresponding to resolving spectral structures on energy scales below the mean level spacing, is intimately related to the quest for semiclassically restoring quantum unitarity, which is reflected in real-valued spectral determinants. Guided through insights for quantum graphs we devise a periodic-orbit resummation procedure for quantum chaotic systems invoking periodic-orbit self encounters as the structuring element of a hierarchical phase space dynamics. We propose a way to purely semiclassically construct real spectral determinants based on two major underlying mechanisms: (i) Complementary contributions to the spectral determinant from regrouped pseudo orbits of duration $T < T_H$ and $T_H-T$ are complex conjugate to each other. (ii) Contributions...
more | pdf | html
None.
###### Tweets
SciencePapers: Towards a semiclassical understanding of chaotic single- and many-particle quantum dynamics at post-Heisenberg time scales. https://t.co/VRLBZOXP4T
None.
None.
###### Other stats
Sample Sizes : None.
Authors: 2
Total Words: 8482
Unqiue Words: 2088

Assert is a website where the best academic papers on arXiv (computer science, math, physics), bioRxiv (biology), BITSS (reproducibility), EarthArXiv (earth science), engrXiv (engineering), LawArXiv (law), PsyArXiv (psychology), SocArXiv (social science), and SportRxiv (sport research) bubble to the top each day.

Papers are scored (in real-time) based on how verifiable they are (as determined by their Github repos) and how interesting they are (based on Twitter).

To see top papers, follow us on twitter @assertpub_ (arXiv), @assert_pub (bioRxiv), and @assertpub_dev (everything else).

To see beautiful figures extracted from papers, follow us on Instagram.

Tracking 100,376 papers.

###### Search
Sort results based on if they are interesting or reproducible.
Interesting
Reproducible
Online
###### Stats
Tracking 100,376 papers.


text:
29 days ago

introduction to probability models 11th edition pdf

introduction to probability 2nd edition pdf

introduction to probability and statistics 14th edition pdf

introduction to probability and statistics third canadian edition

introduction to probability models 10th edition pdf

introduction to probability and statistics 14th edition

introduction to probability bertsekas 2nd edition pdf

introduction to probability models 11th edition

introduction to probability models 11th edition solutions

introduction to probability models 9th edition pdf

introduction probability models 10th edition pdf

introduction to probability 2nd edition solutions

introduction to probability second edition pdf

introduction to probability 2nd edition problems

introduction to probability 2nd edition ebook

introduction to probability 2nd edition by grinstead and snell

introduction probability models solutions 10th edition