[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Logic and Math Puzzles

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 53
Thread images: 10

File: edYor.gif (85KB, 260x274px) Image search: [Google]
edYor.gif
85KB, 260x274px
Post all the logic and math puzzles you know, or post your solutions to the following ones.

>You want to buy a dog so you call the owner of the pet store. You ask the owner if they have any dogs and he says yes we have two. You then ask him if one is a male, he says yes. Assuming all dogs are either male or female, what is the probability the other dog is male.

>A bacteria culture in a petri dish doubles every hour. If the dish is full 8 hours after the experiment starts, when was it half full?

>How many bit strings of length 10 contain either 5 consecutive 1s or 5 consecutive 0s

>Suppose 21 boys and 21 girls enter a math contest. Furthermore, suppose that each entrant answers at most 6 questions, and for every boy-girl pair, there is at least one question they both solved. Show that there is a question that is solved by at least 3 girls and 3 boys

>How many ways are there for a four horse race to finish if draws are allowed?

>The amount of particles in the universe was estimated to be 33*2^257, how many digits are in this number?

>Find a constant time algorithm which sums the digits of an inputed positive integer.

>Given an nxn chessboard where n is a positive integer, write a constant time algorithm which determines the number of squares on this chessboard.

>Given a mxn rectangular grid where m and n are positive integers, how many rectangles does it contain?

>What is the probability that a five card poker hand contains cards of five different kinds and does not contain a flush or straight?
>>
File: Screenshot_2017-03-31-00-14-25.png (110KB, 480x854px) Image search: [Google]
Screenshot_2017-03-31-00-14-25.png
110KB, 480x854px
>>8819042
if you are looking for more puzzles, some anon suggested these
>>
>>8819042
>1/3
>7 hours
>222
>Answer too long to fit here
>75
>79
>Impossible
>Return: ((1/3) n^3 + (1/2) n^2 + (1/6) n)
>[math] {m \choose 2} {n \choose 2} [/math]
>~50%
>>
>>8819084
Assume + - * / and % are all constant time
>>
File: circles.png (78KB, 1094x548px) Image search: [Google]
circles.png
78KB, 1094x548px
I'm trying to tackle a problem posted in the previous puzzles thread :

find the area of the sequence of circles tangent to the two semi-circles, and tangent to each previous circle (the first one, drawn in blue, is tangent to the 0x line), going toward A.

I could find the parameters of the first circle (by solving the equation saying that A1 is at the same distance of the two semi-circles and the 0x line.

I tried to derive a general formula to get the coordinates of the center of the next circle, but wolframalpha just gave me an overly complicated answer.

Maybe I could find the equation of the line containing the center of the circles.
>>
>>8819098
https://www.wolframalpha.com/input/?i=solve%28+1+-+sqrt%28x%C2%B2++%2B+y%C2%B2%29+%3D+sqrt%28+%28x+%2B+1%2F2%29%C2%B2+%2B+y%C2%B2%29+-+1%2F2+%3D+sqrt%28%28x-a%29%C2%B2+%2B+%28y-b%29%C2%B2%29+-+%281-sqrt%28a%C2%B2+%2B+b%C2%B2%29%29,+x,+y%29

a and b are the coordinates of the center of a circle, and x and y the coordinates of the next one.
>>
File: circles2.png (96KB, 850x472px) Image search: [Google]
circles2.png
96KB, 850x472px
>>8819101
Finding the coordinates of A2 just seems impossible...
>>
33*2^257 has 79 digits
>>
>>8819173
How'd you get this answer?
>>
>>8820186
[math]\texttt{33 * 2^257 // IntegerDigits // Length}[/math]
>>
>>8820330
So you used a built in function defined for the purpose of counting an integer?
>>
https://www.ocf.berkeley.edu/~wwu/riddles/intro.shtml

Have at it, m8s
>>
>>8820738
excellent post
>>
>>8820449
Number of digits of a number N is equal to
[eqn] \left\lceil {\frac{\log(N+1)}{\log(10)}} \right\rceil [/eqn]
>>
>>8821523
nicely done
>>
>>8821688
That's pretty common knowledge.
>>
>>8819042
P(both male|one is male) = P(both male)/P(one is male) = 1/3

7

9

...

4! + 4C2*3! + 4C2*2!+ 4C3*2! + 1 = 85

floor(257/log2(10) + log10(33)) + 1 = 79

...

N^2 + (N-1)(N-1) + (N-2)(N-2) + ... 1 = n(n+1)(2n+1)/6

m(m+1)n(n+1)/4

...
>>
File: download.jpg (10KB, 276x182px)
download.jpg
10KB, 276x182px
So the earth is flat?
>>
>>8820449
Why do people on /g/ and /sci/ do this?

>LOL U USED A BUILT IN TO IMPLEMENT A TRIVIAL THING?
>>
>>8822465
they think reinventing the wheel makes them hardcore
[spoiler]obviously they didn't read SICP[/spoiler]
>>
>>8822471
>WOOOOW You made Prolog in LISP. Anyone can do that. Now try to implement it from scratch
>>
>>8821695
There's a type of joy and wonder that comes from discovering this type of answer for oneself.
>>
File: 57ed36711b00000d0cef326c.jpg (40KB, 630x419px) Image search: [Google]
57ed36711b00000d0cef326c.jpg
40KB, 630x419px
>>8821523
>divided by log base 10 of 10
>>
>>8822662
He made no indication that he did.
>>
>>8822671
[eqn] \log(x) = \int_0^x \frac{dt}{t} [/eqn]
>>
>>8822682
Typo. The lower bound of the integral should be 1.
>>
>>8819042
>>Given an nxn chessboard where n is a positive integer, write a constant time algorithm which determines the number of squares on this chessboard.
wouldn't this just be n^2? sorry for brainlet
>>
>>8822690
it's [math] \Sigma_{k = 1}^n \left( \begin{array}{c}n \\ k \end{array} \right) [/math]
Squares can be 1x1, 2x2, etc.
>>
>>8822701
ohhh i see now, thanks. I thought it meant only the little black and white squares.
>>
>>8819042
>Find a constant time algorithm which sums the digits of an inputed positive integer.

Inputed into what? If we use a (limited size) variable, we could calculate the value for all possible digits even when they are zero, and get an equal running time for all possible inputs. This could arguably be done even if we read the input as a string. Memory is not unlimited.

The cheat would be to define the algorithm to calculate all digits up to infinity. The definition of the algorithm would be constant time, even if it could never finish.
>>
>>8822701
There are n^2 squares of the size 1x1.
There are (n-1)^2 squares of the size 2x2.
...
There is 1 square of the size nxn.

Total number is thus
[eqn]\sum_{k=1}^n k^2 [/eqn]
>>
>>8819042
>>How many bit strings of length 10 contain either 5 consecutive 1s or 5 consecutive 0s

Fun problem.

First consider a string of 5 consecutive 1s. There are 5 possible configurations for the 5 consecutive 1s, but all of them leave 5 open spots.

For each configurative of consecutive 1s, we can add the possibilities for the remaining parts as such:

5 choose 0 + 5 choose 1 + 5 choose 2 + 5 choose 3 + 5 choose 4 + 5 choose 5.

Because in 5 choose 0 we are choosing 0 1s, which generates the string 00000
In 5 choose 1 we are choosing 1 1s so we generate strings like 10000, 01000, etc.

And so on. And my trustworthy calculator tells me that sum equals 32.

But for each configuration of 11111s, we have 5 arrangements of empty spots, so we multiply 32*5 = 160

For the case of 5 consecutive 0s it is the same. We get 160 configurations.

Then to find the total we add them but we need to substract one of each configuration which occurs in both lists. So we need to remove every list that contains 5 consecutive 1s and 5 consecutive 0s.

Luckily we can generate those lists easily: 0000011111 and 1111100000 and they are only two se we compute
160 + 160 - 2= 328
>>
>>8822726
You're counting the strings with 6 or more consecutives 1s several times.
>>
Here's a nice one: if you write down all the numbers from 1 to 1 million, how many times will you write down the number 2?
>>
>>How many bit strings of length 10 contain either 5 consecutive 1s or 5 consecutive 0s
I'll try to take on it.

Let's count only zeroes:

First case, the string is in the beginning:
00000***** => 32 possibilities
Second case. The sequence starts at second element, but we have to exclude the first, therefore:
100000**** => 16 possibilities

Third:
*100000*** => 16
Fourth:
**1000000** = > 16
Fifth:
***100000* => 16
Sixth:
*****100000 => 16
To sum: 32 + 16 * 5 = 112

Same with ones: 112. However, some cases still overlap, them being 0000011111 and 1111100000.

So, the answer is 112 * 2 - 2 = 222
>>
>>8822902
From 1 to 10:
1
From 10 to 100:
Each time 2 is in the first digit (10 times: 12, 22, 32...) and each time 2 is in the second digit (10 times: 20,21,22...) = 20
From 100 to 1000:
First digit: 100
Second digit: 100
Third digit: 100
= 300
Et cetera.
So, the answer:
654321 times.
>>
>>8819042
>>You want to buy a dog so you call the owner of the pet store. You ask the owner if they have any dogs and he says yes we have two. You then ask him if one is a male, he says yes. Assuming all dogs are either male or female, what is the probability the other dog is male.

Single events dont have probability. Genderdistribution is not specified.

>>A bacteria culture in a petri dish doubles every hour. If the dish is full 8 hours after the experiment starts, when was it half full?

Could have been full one hour after start, unless it was first full after exactly eight hours.
>>
>>8822958
>Single events dont have probability.
Look! It's a frequrntist! Let's laugh at him!
>>
>>8819084
>>1/3
no its not
>>
>>8822964
axiomatic-math-fag
>>
>>8822914
Nope
>>
Oh whoops that's 10 million

Still nope though
>>
>>8822682
>instead of log base 10 of X+1 over log base 10 of 10, which equals log base 10 of X+1, we consider log base e of X+1 over log base e of 10, which equals log base 10 of X+1 by a well-known result
Fuck off
>>
>>8823043
Oh yeah, I fucked up. From 10 to 100 in the first digit 2 appears only 9 times, that is, 19 times.
To fix:
1..10: 1
1..100: 20
1..1000:300
...
1..1000000: 600000
>>
>>8822465
Because it defeats the purpose of the challenge. All you did was look up the answer. These questions aren't asked because they're open problems without solution, they're asked to see if you can puzzle it out on your own.
>>
>>8822914
>>8823736
You wouldn't get the job. There's a much more direct elegant way of getting this which also shows that it doesn't depend on the digit (could be 3 instead of 2), and also immediately shows how to generalise. You should immediately see that the answer in the case 1 to 1 million is 6*10^5 for any digit other than 1. More generally in the case of 1 to 10^k it's k*10^(k-1).
>>
File: 1474516161306.jpg (29KB, 403x392px) Image search: [Google]
1474516161306.jpg
29KB, 403x392px
>>8819084
>1/3
what?
genders = 2
probably of 1 over the other is 1/2
first dog is established as male, meaning that the probably of both being male is 1/2 x 1/2 = 1/4
>>
>>8823850
Every problem is either a solved problem, in which case you can google the solution, or an unsolved problem.
>>
>>8823937
found the stack exchange coder
>>
>>8823901
That is exactly what I've shown, I just didn't explicitly write the formula.
>>
File: Hans_Landa_IB_2009.jpg (18KB, 331x326px) Image search: [Google]
Hans_Landa_IB_2009.jpg
18KB, 331x326px
>>8823935
>genders = 2
Anon, I'm from the bureau of social justice and I'd like to ask you some questions about a post you made on an online forum. I was hoping you could invite me into your home and we could have a discussion.
>>
>>8823937
You are the reason why some textbooks have foregone including solutions to problems.
>>
>>8825376
PREACH
Thread posts: 53
Thread images: 10


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

If you need a post removed click on it's [Report] button and follow the instruction.
If you like this website please support us by donating with Bitcoin at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties. Posts and uploaded images are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that website. If you need information about a Poster - contact 4chan. This project is not affiliated in any way with 4chan.