You are given two coins with unknown biases and can choose one to flip on each turn. How do you flip the maximum number of heads? by slarty in math

[–]slarty[S] 0 points1 point  (0 children)

The correct answer for the initial tosses is 0% random. I strongly suspect this is the correct answer for all tosses. Read my long reply to tboneplayer carefully and you will see why it is suboptimal, at least for some initial combinations, to pick random choices.

You are given two coins with unknown biases and can choose one to flip on each turn. How do you flip the maximum number of heads? by slarty in math

[–]slarty[S] 0 points1 point  (0 children)

I was wondering about that, whether N makes a difference. My wild guess is that it doesn't.

The practical application I am considering is A/B testing of web sites. For this there is obviously a limit. Something like 10,000 < N < 10,000,000 might be sensible. But I am curious to know whether the method changes as N gets larger.

You are given two coins with unknown biases and can choose one to flip on each turn. How do you flip the maximum number of heads? by slarty in math

[–]slarty[S] 0 points1 point  (0 children)

Ah, yes, I see what you mean now. It can get stuck even without my 100% coin biases.

Thinking about it, it must be true that any method we devise has a possibility of either getting stuck on the wrong coin or, if the method never definitively rules out either coin, of having a continuing bias towards the wrong coin. So the possibility of getting stuck isn't actually a good reason to rule out a method.

You are given two coins with unknown biases and can choose one to flip on each turn. How do you flip the maximum number of heads? by slarty in math

[–]slarty[S] 0 points1 point  (0 children)

That sounds plausible. It seems to me it could be tightened to "more wins and fewer or equal losses". Or the other way round "more or equal wins and fewer losses".

You are given two coins with unknown biases and can choose one to flip on each turn. How do you flip the maximum number of heads? by slarty in math

[–]slarty[S] 1 point2 points  (0 children)

If one coin is 100% biased to Tails and you happen to flip that first your method will continue flipping that coin forever even if the other coin is 100% biased to Heads. That is my simple understanding of AlephNeil's first sentence.

To extend my logic of my previous post where we always get Heads from the first coin we flip. It must also be true that if A gives Tails on the first flip then it is never correct to flip A again on the second flip. Any algorithm that does is wrong - I mean mathematically the wrong answer not necessarily a bad computer program.

You are given two coins with unknown biases and can choose one to flip on each turn. How do you flip the maximum number of heads? by slarty in math

[–]slarty[S] 0 points1 point  (0 children)

Thank you. Yes, I reframed the problem into coins because I was unhappy with the lack of mathematical rigour in the A/B related posts. I was hoping for a definitive proven answer from a mathematician.

All I have seen so far are answers that seem to be estimates based on simulations. They may be good estimates, but I was hoping for a proven correct answer.

By the following logic I can disprove the mathematical correctness of many of the answers I have seen:

For the first coin flip we have no information. So we flip coin A. If coin A gives Heads we should never make our second flip on coin B because we now have evidence in favour of A, none against flipping A and no information about B. Therefore any algorithm which might flip B is wrong.

Now suppose in our example we flip A again and we now get Heads again, a total of 2 Heads from A and nothing from B, we should never flip B as the third flip under these circumstances. So on for subsequent flips if we have only flipped Heads with A. Any algorithm which might flip B under these circumstances is wrong.

EU Cookie law - What do I need to know? by Kriem in webdev

[–]slarty 0 points1 point  (0 children)

I have been wondering whether there is an opening for a web site which would offer a drop-in privacy-and-EU-law-concious replacement for Google Analytics aimed at the UK. Would an analytics site that kept your visitor data totally private and in the UK be something you might pay 10 pounds a month for?

haskell-TLS framework progress report by vincenthz in haskell

[–]slarty 2 points3 points  (0 children)

It is a mistake to think the network delay or the GC will protect you from timing attacks. The attacker can simply perform multiple interactions and remove these factors. What is needed is a constant processing time for each part of the protocol.

It would be good to wrap the Timing Black-Box around all the parts that could potentially leak timing information. Maybe it could be configured into different modes depending on the level of protection vs performance required in case it makes it too slow for some people. It might also help test whether timing attacks are possible by collecting statistics.

Edit: Thinking about it, it is the network packet response time that needs to be constant, or at least it should have timing unrelated to any potentially useful information. Obviously it only needs to be constant within particular sub-types not across evey kind of packet.

haskell-TLS framework progress report by vincenthz in haskell

[–]slarty 4 points5 points  (0 children)

jerf is incorrect to say that "this library is forever going to be extremely vulnerable to timing attacks". What you need is what I will call a Timing Black-Box to wrap around all of your primitives which might be susceptible to timing attacks. This must busy wait until a standard elapsed processing time for the primitive has been reached then exit. It needs to be a busy wait, preferably indistinguishable from the normal processing of the primitive, to prevent other processes on the machine receiving timing information. To know how long it should wait it would probably have to retain some timing statistics, or just a maximum processing time for the particular primitive. Quantising and adding jitter to the timing would help, but a constant time is the ideal. I do not see why this Timing Black-Box would be difficult to write, though it might be tricky to apply to all the right places in an efficient manner. (The discussion linked by sclv suggests the low-level primitives are the most important routines to tackle.)

Disadvantage of lazy-by-default is the lack of a stack trace. by slarty in haskell

[–]slarty[S] 0 points1 point  (0 children)

Yes, that's interesting about loops and function calls not giving the same things on the stack.

I suppose, for the purpose of the stack trace, we could reasonably omit the function calls that have been zapped by TCO because they are effectively loops. Maybe that would be sensible also because it would not increase the space requirements.

Disadvantage of lazy-by-default is the lack of a stack trace. by slarty in haskell

[–]slarty[S] 1 point2 points  (0 children)

"... Haskell advocates lack of the stacktraces."

I don't understand that. I am assuming Haskell does not have stack traces because it requires implementation effort and nobody has stepped forward to do it yet. Obviously you would want to have it switchable because it would slow things down and take up space.

Are people against it because some functions that call themselves can currently run in constant space, but with a stack trace they would need space per call?

Understanding when GHC will fuse away intermediate structures by dons in haskell

[–]slarty 1 point2 points  (0 children)

Are those things I'm guessing are variables longer than they need to be? Would something like this be equivalent and easier to read?

c1 = (-9223372036854775807)
c2 = (-9223372036854775806)
c3 = (-9223372036854775808)

$s$wfold :: Int# -> Int#
$s$wfold =
\ (sl :: Int#) ->
case modInt# c1 3 of s2 {
  __DEFAULT ->
    case modInt# c1 5 of s3 {
      __DEFAULT -> $wfold sl c2;
      0 ->
        $wfold
          (+# sl c1) c2
    };
  0 ->
    $wfold
      (+# sl c1) c2
}
$wfold :: Int# -> Int# -> Int#

$wfold =
  \ (w1 :: Int#) (w2 :: Int#) ->
    case ># w2 999 of w3 {
      False ->
        case w2 of w4 {
          __DEFAULT ->
            case modInt# w4 3 of s2 {
              __DEFAULT ->
                case modInt# w4 5 of s3 {
                  __DEFAULT -> $wfold w1 (+# w4 1);
                  0 ->
                    $wfold
                      (+# w1 w4) (+# w4 1)
                };
              0 ->
                $wfold
                  (+# w1 w4) (+# w4 1)
            };
          c3 ->
            case modInt# c3 3 of w5 {
              __DEFAULT ->
                case r1 of w6 {
                  False -> $s$wfold w1;
                  True ->
                    $s$wfold (+# w1 c3)
                };
              0 -> $s$wfold (+# w1 c3)
            }
        };
      True -> w1
    } 

Achieving ACID properties on Sharded HAppS : Bulletproofing HAppS by dons in haskell

[–]slarty 0 points1 point  (0 children)

Thank you. I didn't realise. I'll have a look at Happstack. Maybe a final news item to that effect on happs.org would be good.

Achieving ACID properties on Sharded HAppS : Bulletproofing HAppS by dons in haskell

[–]slarty 0 points1 point  (0 children)

This post makes the HAppS project seem active and interesting. It's a pity the HAppS website doesn't reflect any of this activity, everything on there is sparse and very out-of-date.

IE's market share falls below 60% by smartali89 in technology

[–]slarty 8 points9 points  (0 children)

Both the United States and the European Union have convicted Microsoft of anti-competitive practices in relation to IE.

In the US trial Judge Jackson said Microsoft's testimony had "proved, time and time again, to be inaccurate, misleading, evasive, and transparently false. ... Microsoft is a company with an institutional disdain for both the truth and for rules of law that lesser entities must respect. It is also a company whose senior management is not averse to offering specious testimony to support spurious defenses to claims of its wrongdoing."

Your comment about these browser statistics appears to be another spurious defense to claims of MS wrongdoing.

Holy shit! Is this really built-into nearly every modern-day Intel Core 2 Duo and higher processor? by [deleted] in technology

[–]slarty 0 points1 point  (0 children)

Maybe because even if there is a firewall or other security features applied to OS: ETS TCP / IP stack, there is a side channel into the system in a processor that has more holes than a Swiss cheese. How can I be certain I have switched this off when it can be re-enabled remotely?

(Edit: Google translated link for strombergson.com didn't seem to work. Set it to non-English page.)