Logic Puzzles

Started by alfonz1986, July 16, 2011, 03:34:55 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Clam

Nice puzzle, and a curious bit of psychology http://www.lemmingsforums.com/Smileys/lemmings/smiley.gif" alt=":)" title="Smiley" class="smiley" />

Quote from: spoiler just in case this spoils it
Make it a serious crime to serve circles to red cards and ask again (:

The social setting is quite strong here, because of the legal implications. So while it is a question of logic, people will simply memorise each case in the bar situation for fear of the consequences. The cards are unimportant, unless you actually have the job in (1) and could get fired for screwing up. So while logically-minded people like us on LF will (should?) get this, sadly most people either can't apply the logic or just don't care enough to think it through.

chaos_defrost

Question that came up recently on Skype:

I flip a coin 100 times. All 100 times, the coin comes up heads. On the 101st flip, is the probability of heads coming up:

1) more than 50%
2) exactly 50%
3) less than 50%

Lemmings forum you people are very good at problems like this, make me proud  http://www.lemmingsforums.com/Smileys/lemmings/thumbsup.gif" alt=":thumbsup:" title="Thumbs Up" class="smiley" />
"こんなげーむにまじになっちゃってどうするの"

~"Beat" Takeshi Kitano

ccexplore

Technically you never said anything about the coin being fair.  Therefore as a betting man, given the information as provided here, I'd argue it is more likely than not that your coin is crocked and thus the 101st flip is more likely than not to also come up heads. http://www.lemmingsforums.com/Smileys/lemmings/winktounge.gif" alt=";P" title="Wink-Tongue" class="smiley" />

Yes, I know what the "real" answer is, but don't say you didn't see this coming. ;p

chaos_defrost

Quote from: spoiler just in case this spoils it
Yep, exactly correct. One of those things that bothers me way too much as a statistician is the perfect of the populous who picks 3) because "tails is due OBVIOUSLY DUUUUH"  http://www.lemmingsforums.com/Smileys/lemmings/sad.gif" alt=":(" title="Sad" class="smiley" />
"こんなげーむにまじになっちゃってどうするの"

~"Beat" Takeshi Kitano

GuyPerfect

Along those statistics lines...

The game Earthbound (aka Mother 2) has a few rare items that have a 1/128 chance to drop after defeating particular enemies. Heck, it has some common items that are also that likely to drop from certain enemies. But the most notorious of these items is the Sword of Kings, the only weapon Poo can equip that won't lower his stats.

The Sword of Kings can be found only by defeating an enemy called Starman Super, and at a 1/128 rate at that. Starman Super only appears in one dungeon in the game, and they're gone forever after you complete that dungeon. So, unsurprisingly, people spend a lot of time in that dungeon to get that sword.

Last time I played the game, I counted how many Starman Supers I defeated. I went through exactly 256 of them and did NOT get my Sword of Kings. What is the likelihood, as a percentage, of that happening?

chaos_defrost

The number of Starman Supers required to get the Sword of Kings is geometrically distributed with P(X >= x) = 1 - (1-p)^x. given p = 1/128, the odds of requiring 256 or more Starman Supers is 13.43% or so. Geometric drop rates have no memory and can be very cruel sometimes  http://www.lemmingsforums.com/Smileys/lemmings/cry.gif" alt=":'(" title="Cry" class="smiley" />
"こんなげーむにまじになっちゃってどうするの"

~"Beat" Takeshi Kitano

GuyPerfect

Okay, Mr. Mathy Pants. (-:

Let's say that I wanted to have a less than 1% chance of leaving that dungeon empty-handed. How many Starman Supers would that take?

Proxima

The chance of not getting the sword after n attempts is (127/128)^n.

This equals .01 when n = ln .01 / ln (127/128) = 587.156. Since you can only try an integer number of times, take the next higher integer, 588.

GuyPerfect

Another correct answer! In case you're wondering why I'm using math questions, it's because there are many real-world situations that you'll need to know how to solve. Often times, this means math. It doesn't matter how clever you may be; sometimes the only way to know something is to calculate it.

Here's one I came up with last night, and this one I don't already know the answer to, so surprise me!

I'm currently working on http://bulbapedia.bulbagarden.net/wiki/Save_data_structure_in_Generation_III" class="bbc_link" target="_blank">hacking the GBA Pokémon games and a brief statistical curiosity comes to mind. Within the data structure for individual Pokémon is an encrypted 48-byte section comprised of four 12-byte chunks. The order of the chunks is determined by examining another value in the data structure, which is entirely random.

Let's call the four data chunks A, B, C and D. They can appear in any order, such as ABCD, ABDC, ACBD, ACDB, ADBC, etc. There are 24 such combinations. The order is determined by taking that randomly-generated field from elsewhere in the data structure, and taking the remainder of its division by 24. Or "modulus 24", despite that actually being the wrong word for the operation. (-: Since the value that determines the chunk order is entirely random and generated when a Pokémon is encountered in the wild, there's effectively a 1/24 chance of a Pokémon having any particular chunk order. (This isn't entirely true, because the randomized value is 32 bits and 4294967296 doesn't divide evenly by 24, but let's just pretend that it does)

As part of my practical testing, I'm going to go into the game and keep catching Pokémon until I have at least one with every one of those 24 chunk orderings. The problem in its simplest form is that I have a 1-in-X chance of getting something, and I want to get X of them. Pretending I could start out with 0 Pokémon and begin catching from there, about how many would I have to encounter to get all 24 orders? Let's use a 99% likelihood as the target.

Proxima

That's a tough one. For each individual order, the chance of not catching it in n attempts is (23/24)^n, so as a first approximation, the chance of catching all 24 is 1 - 24 x (23/24)^n. But then you've double-counted all the scenarios in which you miss out on two orders, but if you subtract those, you're triple-counting all the scenarios in which you miss out on three orders, and so on.

I don't know of a simple way to calculate the exact answer, so I'll be lazy and use the first approximation.

1 - 24 x (23/24)^ n = .01 =>

n = ln .0004 / ln (23/24) = 183.837

Let's check the accuracy of this approximation. Let n = 183, then:

24 x (23/24)^183 = 0.00994828
24C2 x (22/24)^183 = 0.00003354
24C3 x (21/24)^183 = 0.00000005

The terms become small very quickly, so it looks like the total will still be under 0.01.

Simon

#160
I haven't done the following myself yet. I don't know how difficult this is, but it looks harder than the previous triplet-freeness problem.

Thue-Morse Sequence

Construct a sequence (an) for n natural, an taking values only in the two distinct symbols A and B, in the following way. Begin with a0 = A. Repeat the following forever: Take the already constructed initial word, duplicate it, and append that to the end of itself. Flip all values of the inserted block, i.e., all A become B, all B become A.

The construction process thus starts with A, AB, ABBA, ABBABAAB, ABBABAABBAABABBA, ...

Prove that the entire sequence (an) is triplet-free. A triplet is a substring anywhere in the sequence together with two repetitions of itself immediately following it. So, ABABAB is a triplet, but BBAB is not.

-- Simon

chaos_defrost

bump for a simplish but kind of interesting maths puzzle

I am thinking of an integer > 10, which I will call x.

Let a be the conversion of x expressed as a number in base 10 to hexadecimal.
Let b be the conversion of x expressed as a number in hexadecimal back to base 10.

x is the geometric mean of a (expressed as a string of digits in base 10) and b.

Solve for x. There should be 2 solutions (thanks, Simon!).

To clarify, if, for example, you thought x = 24:

a = the representation of 24 in base 16, which is 0x18 (or 18).
b = the representation of 24, as a number in base 16, as a number in base 10, which is 36.

We want x to equal the geometric mean of 18 and 36, both expressed in base 10. Since 24 is not the geometric mean of 18 and 36, this is not the answer.

EDIT: @Simon's last puzzle, this is definitely not a rigorous solution but strikes me as the major block here:

The conjecture is true iff every step ends with a string of two different letters. The string starts with AB, so no appending will add two of the same letter to the end of the previous block. The string appended will always end with the pattern AB, BA, AB, BA, AB, BA, etc. satisfying the first statement.

Rigor can bite me  http://www.lemmingsforums.com/Smileys/lemmings/tongue.gif" alt=":P" title="Tongue" class="smiley" />
"こんなげーむにまじになっちゃってどうするの"

~"Beat" Takeshi Kitano

mobius

Here's a quick one I found in my local newspaper:

which of the following does not belong?

a - large green square
b - large red circle
c - large green circle
d - small green circle
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain


Simon

I guess c (large green circle), for it shares each property with another item, unlike the other items.

This of course has no logical solution and we can only guess what the problem author wants.

-- Simon

mobius

correct!

You don't consider this a logical puzzle? Strictly speaking; C  can only be correct as all the others 'do belong' since they share things. But I guess it's more of a lateral puzzle
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain