1. How the "weight" variable is actually computed?
So - there is a # in each block and a math op is performed with this # + the account # of the "forger" to provide a new #. You can just think of that # as being the "best account #" so the account who's # is closest to the "best" would be the "best choice" to forge the next block (so would have the max. "weight").
If that account doesn't forge then an account "near" it can forge it instead (how near is increased over time to ensure that a block should always appear every minute). So "later forgers" have less weight (the exact weight being determined by their account #).
OK, but, if we want to be able to
calculate probabilities, there must be a good math model of how these weights can be
simulated (i.e., something like this: "one can assume that weights of accounts are independent Exponential random variables with expectations equal (or proportional?) to their balances"). Without such a model, it would be difficult to proceed...
3. Assume that a node sees at least one neighbor with a different version of the blockchain (from the blockchain that our node has). How does it decide, which is the "correct" one?
The "correct" one is simply that with the most weight - so at any point a node could ask another node for the "height and weight" of their blockchain and if that answer is better than their own then they would ask for those blocks in order to "switch chains".
How the "weight of the blockchain" is defined? Do you just add the weights of all blocks? Or, say, last k blocks? Can it be a weighted sum?
Also, a question about the network topology: how is it decided, who will connect to who? In particular, can a "bad guy" just choose, to which nodes it will be connected?