I think it does add up. The OP has used the example (see post #32) of the number of tosses "expected" to get 1000 heads. According to what I have proposed, the expected value in that case would be 2000.This doesn't match what you would expect from a few different perspectives.
First, the odds that a given coin survives 19 tosses without coming up heads at least once is less than two in a million. But that is what is required to even need a 20th toss.
Second, if we only have ten coins but it takes twenty tosses to get them all heads up, that means that we expect to get a single coin to land heads-up every other toss. That means that we expect ALL of the remaining coins to land tails-up on half of the tosses. Does that sound reasonable?
Third, , just playing it on paper, you would expect something like this (and rounding half a tail to a full tail to make the number of tosses higher until we get to a single coin, then I'll let it land tails the first time and finally heads the second time):
Toss 1: 5 tails
Toss 2: 3 tails
Toss 3: 2 tails
Toss 4: 1 tail
Toss 5: 1 tail
Toss 6: 0 tails
So that's just 6 tosses even though things were biased in favor of a higher toss count.
As @joeyd999 correctly surmised in the original post, this process is clearly O(log(n)) where n is the number of coins/resistors.
Imports System.IO
Module Module1
Sub Main()
Console.WriteLine(vbCrLf + "Start ")
Dim nheads
Dim ntails
Dim ntosses
Dim draw
Dim trials
Dim sw As StreamWriter
sw = New StreamWriter("cointossdata012345.txt")
trials = 0
Do
nheads = 0
ntosses = 0
ntails = 0
Do
Randomize()
draw = Int(10 * Rnd() + 1)
ntosses += 1
If draw > 5 Then
nheads += 1
Else
ntails += 1
End If
Loop Until (nheads = 1000)
Console.Write("tosses=")
Console.Write(ntosses)
Console.Write(" heads=")
Console.Write(nheads)
Console.Write(" tails=")
Console.Write(ntails)
Console.Write(vbCrLf)
sw.WriteLine(ntosses)
trials += 1
Loop Until (trials = 1000)
Console.Write(vbCrLf + "finished... ")
sw.Close()
'Console.Write(vbCrLf + "Press any key to exit... ")
Console.ReadKey(True)
End Sub
End Module
You seem to be adding only one head or one tail each toss. This is not the problem.I think it does add up. The OP has used the example (see post #32) of the number of tosses "expected" to get 1000 heads. According to what I have proposed, the expected value in that case would be 2000.
So, let's simulate using some hastily constructed VB.net code. This code will output a distribution of the number of tosses required to get 1000 heads. NOTE: It will write the data to a text file.
A sample txt file of output is attached.
The simple statistics for a run are as follows:Code:Imports System.IO Module Module1 Sub Main() Console.WriteLine(vbCrLf + "Start ") Dim nheads Dim ntails Dim ntosses Dim draw Dim trials Dim sw As StreamWriter sw = New StreamWriter("cointossdata012345.txt") trials = 0 Do nheads = 0 ntosses = 0 ntails = 0 Do Randomize() draw = Int(10 * Rnd() + 1) ntosses += 1 If draw > 5 Then nheads += 1 Else ntails += 1 End If Loop Until (nheads = 1000) Console.Write("tosses=") Console.Write(ntosses) Console.Write(" heads=") Console.Write(nheads) Console.Write(" tails=") Console.Write(ntails) Console.Write(vbCrLf) sw.WriteLine(ntosses) trials += 1 Loop Until (trials = 1000) Console.Write(vbCrLf + "finished... ") sw.Close() 'Console.Write(vbCrLf + "Press any key to exit... ") Console.ReadKey(True) End Sub End Module
mean=2001.8590
median=1987.5000
standard deviation=137.0886
standard error=4.3351
95% CI=8.5071
99% CI= 11.1887
Very close to what I expected.
I have no idea what you mean. If you toss a coin, you only get either one head or one tail. The problem would be if you are getting something else.You seem to be adding only one head or one tail each toss. This is not the problem.
In the specification, I declared that tossing a group of heads-down coins was to be consider a single toss. Therefore, if you have n heads-down coins, from 0 to n of them can become heads-up on a single toss.I have no idea what you mean. If you toss a coin, you only get either one head or one tail. The problem would be if you are getting something else.
I think the difference is I only need one head in each of N coins, not N heads out of one coin. You are trying to serialize a parallel problem, and are assuming equivalence where none should be expected.Calculating the number of tosses of ONE coin to get 10 heads. Let's say it took 32 tosses of that one coin to get 10 heads. It is exactly the same situation probability-wise as:
OMG! I don't even know how to respond to that. So, you define a toss as containing some varying number of coins. If you toss 10, 20, or 1, each event counts as just one toss. Ok, got ya, my mistake, I should have known better.In the specification, I declared that tossing a group of heads-down coins was to be consider a single toss. Therefore, if you have n heads-down coins, from 0 to n of them can become heads-up on a single toss.
You called?
Get your ears checked, I didn't say free ethanol.You called?
I don't think this means what you think it means.with all due respect...
I hear ya knocking but, once again, you can't come in.I don't think this means what you think it means.
This is the way I originally described the problem, and the only way it makes sense in context.OMG! I don't even know how to respond to that. So, you define a toss as containing some varying number of coins. If you toss 10, 20, or 1, each event counts as just one toss. Ok, got ya, my mistake, I should have known better.
I take an even more primitive approach. I like to be able to work under a binocular microscope and so I put the parts I need in the general area of the PCB that I will be using them. I seldom have more than a couple dozen components on the board at a time and almost never more than ten or so in a given region. So it is a simple matter for me to just use my tweezers to turn over any components that are face down when I get to that section of the board. Since I need to pick up each component sooner or later, it's virtually the same amount of effort. I generally place the components that are face up first (being lazy) and then pick up a face-down component at one end, turn it over, and then move it to where it needs to go.Very interesting thread. And the probability calculations done by Bahn and Joey seem pretty much spot-on. Following the line of Joey's OCD for neatness and soldering all of the labeled smt components face up (a practice that I wholeheartedly agree with), in practice what I do is I peel the plastic film off the cardboard strip containing the smt components, and drop them on a petri dish. Then I start picking those that landed face up and solder them. And after those run out, I simply gently tap the dish against the table, and a little less than half (as Joey pointed out) of them land face up, and continue to work.
The annoying part comes when only 6 or 7 components are left in the dish, and have to tap more than once sometimes for at least one of them to land face up.
Here we go.... where you go overboard and want to fight, you want to troll, you want to get into it ...as usual.This is the way I originally described the problem, and the only way it makes sense in context.
What should you have known better?
And quit editing the content of your posts after they have been replied to without indicating such. It's getting annoying.
How the hell can I troll my own thread? Look in the mirror, dammit.Here we go.... where you go overboard and want to fight, you want to troll, you want to get into ...as usual.
As I have stated previously, it is difficult for me to express how disinterested I am in any problem you have with my behavior. Again, as I have suggested, if you don't like something I have posted or edited, than don't read it. Beyond that, and with all due respect, your comments at this point are likely to only get the usual *yawn*.
That's a bold assumption. But I'll stipulate simply because I don't want to deal.Let's move on with the discussion of the problem now that everyone is on the same page.