[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 42 KB, 395x462, 1010507-_29.jpg [View same] [iqdb] [saucenao] [google]
9266972 No.9266972 [Reply] [Original]

What are some logic based riddles you like?

>> No.9266995

>>9266972
>Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

99.5% of CS can't solve it.

>> No.9266999
File: 133 KB, 500x647, 9ptiJ.jpg [View same] [iqdb] [saucenao] [google]
9266999

>>9266995
for i in range(1, 101): print('FizzBuzz'[i*i%3*4:8--i**4%5] or i)

>> No.9267000

>>9266995
Not a riddle

>> No.9267019

>>9266995
I could have programmed that when I was seven

>> No.9267126

>>9267019
Yes but could you have done it with my dick in your mouth?

>> No.9267300

Bump

>> No.9268518

>>9267019
Enough with this CS is easy meme. If it's so easy then why are programmers paid 100K starting?

>> No.9268547

>>9268518
They're not

>> No.9270259

Bump

>> No.9270274

>>9267126
hot af

>> No.9270311
File: 34 KB, 476x360, birthday.jpg [View same] [iqdb] [saucenao] [google]
9270311

>> No.9270351
File: 54 KB, 620x465, 1507733637517.jpg [View same] [iqdb] [saucenao] [google]
9270351

>>9268518

>> No.9270359

>>9270311
July 14th?

>> No.9270385

>>9270359
July 16.
If it was July 14 then how would Bernard have figured out the month?

>> No.9270399

The gettier problem. Apparently nobody has yet to solve it in epistemology just yet.

>> No.9270414

>>9268518
its $71,500 starting with the hopes of getting $102,000. All values are averages

>> No.9270668

>>9266972
*123
13 2*
*23 1
2 13*
123*

>> No.9271066

>>9270311
The thought that there is anyone who could get this wrong makes me reee.

>> No.9271070

>>9266995
for x in range(1,101):print(x%3==0)*"Fizz"+(x%5==0)*"Buzz"or x

>> No.9271716

>>9271066
The majority of people can't even give you an answer

Also check'd

>> No.9271740

>>9266972
Why would a farmer help a wolf cross a river? I mean I get the sheep and the sheep food but why the wolf?

>> No.9271746

>>9270351
>Talking about CS replies with an image of an EE.

>> No.9271846

>>9268518
Normal places start at
40k , sjw places start higher and you move up based on skill

>> No.9272014

The Einstein Puzzle:
FACTS:
1. There are 5 houses in 5 different colours.
2. In each house lives a person with a different nationality.
3. These 5 owners drink a certain beverage, smoke a certain brand of cigarette and keep a certain pet.
4. No owners have the same pet, brand of cigaratte, or drink.

CLUES:
1. The Brit lives in a red house
2. The Swede keeps a dog
3. The Dane drinks tea
4. The green house is on the left of the white house.
5. The green house owner drinks coffee.
6. The person who smokes Pall Mall keeps birds.
7. The owner of the yellow house smokes Dunhill.
8. The man living in the house right in the center drinks milk
9. The Norwegian lives in the first house.
10. The man who smokes Blend lives next to the one who keeps cats
11. The man who keeps horses lives next to the man who smokes Dunhill
12. The owner who smokes Camel drinks beer
13. The German smokes Marlborough.
14. The Norwegian lives next to the blue house
15. The man who smokes Blend has a neighbour who drinks water.

The question is, who keeps the fish?

(Protip: There're two right answers)

>> No.9272094

>>9270351
>Mike penis
Sick nazi idolatry /b/ro

>> No.9272141 [DELETED] 

>>9266995
N = 100
for n in range(1,N+1):
if n % 15 == 0:
print("FizzBuzz")
elif n % 3 == 0:
print("Fizz")
elif n % 5 == 0:
print("Buzz")
else:
print(n)

>> No.9272142

>>9266995
N = 100
for n in range(1,N+1):
____if n % 15 == 0:
________print("Fizz Buzz")
____elif n % 3 == 0:
________print("Fizz")
____elif n % 5 == 0:
________print("Buzz")
____else:
________print(n)

>> No.9272205

>>9272014
nobody owns the fish

>> No.9272229

>>9272014
That's just a glorified sudoku

>> No.9272235

>>9272229
kek

>> No.9272244

the ages of three children is pretty good, it usually takes 3 beers for people to solve it correctly

>> No.9272250

Imagine you're in a boat. If you grab a rock from your boat and throw it into the water does the water level rise, stay or fall? What if you threw a balloon? What if you threw water?


Another less logical puzzle:
Write a program that prints its own code.
(it's cheating if the program reads the code directly from its own file to print it)

>> No.9272262

>>9272014
What does "first" mean?

>> No.9272267

>>9272250
Quines are lame, IOCCC is much better if you want to test your "clever" tricks.

>> No.9272817

>>9272014
>there's two right answers
Dropped

>> No.9273191

>>9272094
triggered lefty detected

>> No.9273884

>>9272262
Houses are in order 1 2 3 4 5. So The Norwegian lives in house number 1, the occupant of house number 3 drinks milk, etc.
>>9272229
I hadn't thought of it like that, but you're right.

>> No.9274070

In this puzzle, every person either always tells the truth, or always lies. Those who drink plain tea or milky coffee always tell the truth, while those who drink milky tea or plain coffee always lie. Also remember that if X is false and Y is true:
"X and Y" is a false statement.
"X or Y" is a true statement.

Now that the set-up is done, you run a cafe. One day, three men walk in and approach your counter to order their favoured hot drinks. They make the following statements:
A: I drink Coffee and B drinks Milk.
B: I drink no milk and C drinks Tea.
C: I drink Coffee and A drinks no milk.
You try to solve this problem to no avail, until one of your baristas exclaims that he has solved it! You ask him how he did it, and he sheepishly admits that he recognises one of the three men, and remembered his preferred drink. He offers to share the information he started with, but you smile and tell him he needn't bother. You already know what to serve all three men.

What do the three men drink?

>> No.9275451

>>9274070
A:tea with milk
B:tea
C:tea with milk