Like I said, this is only for people who don't tremble at the sight of X's and Y's. If you do much math, OTOH, this is pretty low-level stuff - basic matrix math that you can bang out on your TI-83.
That said, let's get down to it.
We're simultaneously solving 3 equations in 3 unknowns. The unknowns are the percentages (in decimal form) of Dems, Reps, and Inds in a given poll's sample. We'll call these unknowns D, R, and I, respectively.
One of the three equations is automatic: D+R+I=1. Or (to format it the way we'll want it later) 1.00D + 1.00R + 1.00I = 1.00.
The other two depend on the poll's providing how the vote is split by party. For example, the most recent Pew poll has Kerry leading 85%-9% among Democrats, Bush leading 90%-3% among Republicans, and Bush leading 42%-39% among independents, for an overall 48%-41% Bush lead.
So here's how we set up the other two equations:
Bush has 9% of the Dems, 90% of the Reps, and 42% of the Inds in this poll, for 48% total.
That's 0.09D + 0.90R + 0.42I = 0.48.
Similarly, Kerry has 85% of the Dems, 3% of the Reps, and 39% of the Inds in this poll, for 41% total.
That's 0.85D + 0.03R + 0.39I = 0.41.
So that gives us three equations in three unknowns:
1.00D + 1.00R + 1.00I = 1.00
0.09D + 0.90R + 0.42I = 0.48
0.85D + 0.03R + 0.39I = 0.41
In matrix form, that's
1.00 1.00 1.00 | 1.00
0.09 0.90 0.42 | 0.48
0.85 0.03 0.39 | 0.41
Then you do Gaussian row reduction in the usual way, whether you do it by hand or by software.
In this case, you get (approximately):
D = .306
R = .335
I = .359
So this Pew poll contains the underlying assumption that Republicans outnumber Democrats by 3%.
If we weight for 39% Dems, 35% Reps, and 26% Inds, Bush's lead shrinks to 45.9% to 44.3%.