Message Boards Message Boards

0
|
4342 Views
|
6 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Are these two methods of generating coin tosses equivalent?

Posted 2 years ago

POSTED BY: David Ameneyro
6 Replies
Posted 2 years ago

Jim, Definitely some ambiguity in the question! I use it for more of a fun excuse to exercise my Wolfram language skills. With that in mind I chose to interpret it more broadly. Ended up learning a couple things and got to post this question to the community, which I always enjoy doing. David

POSTED BY: David Ameneyro
Posted 2 years ago

I'm not so sure that the coin-tossing question as proposed by @MichaelHarrisNY is well-formulated. For example, the ratio is exactly 1 if HHHHH and HHTT comprise the first two sets of tosses. This happens with probability 1/128 (= 2*(1/16)^2).

The issue is what is meant by "converges". A more well-defined proposal is maybe determining the mean number of sets of 4 tosses that first results in the ratio being between 0.99 and 1.01.

POSTED BY: Jim Baldwin
Posted 2 years ago

Thanks Martin! I am going to try this method -David

POSTED BY: David Ameneyro

POSTED BY: Martijn Froeling
Posted 2 years ago

Daniel,

Thanks a ton for your response! The memory factor is the biggest for me since I am using an old laptop and/or WolframCloud on the "Personal" plan, both of which are highly constrained.

Converting between the two also makes sense.

-David

POSTED BY: David Ameneyro

They are equivalent. I would expect the second to be faster, and it will cut memory by a factor of 4 since the same amount of memory is needed to store 1 bit integers as 4 bit integers (I think the smallest granularity supported, even by the relatively new integer types, is at least a byte).

As for the problem at hand, you'd check the ratio of 12s to 15s I guess.

As for equivalence in principle, one can convert the second representation to the first using IntegerDigits[...,2,4] and the first to the second using FromDigits[...,2].

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract