This repository has been archived by the owner on Dec 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qlog.txt
40 lines (32 loc) · 2.61 KB
/
qlog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
QOD 1. Find the numbers in ? cell.
1 5 1 8 2
12 3 22 ? 28
8 58 13 ? ?
131 ? ? 55 309
89 267 ? 432 233
QOD 2. Write a program to generate unique compositions with following - (a) Exactly one random concave polygon of atleast 6 sides, (b) Exactly two random circular sectors with different central angles, (c) At least 5 and at most 15 lines randomly placed with both terminals in the canvas, (d) One random shape of your choice. The program should generate unique composition each time it is run. Each shape has random fill and stroke color. (Suggested medium: p5.js, Est. time: 30-60min)
QOD 3. Who owns the fish? (via https://web.stanford.edu/~laurik/fsmbook/examples/Einstein%27sPuzzle.html)
The situation
1. There are 5 houses in five different colors.
2. In each house lives a person with a different nationality.
3. These five owners drink a certain type of beverage, smoke a certain brand of cigar and keep a certain pet.
4. No owners have the same pet, smoke the same brand of cigar or drink the same beverage.
The question is: Who owns the fish?
Hints
- the Brit lives in the red house
- the Swede keeps dogs as pets
- the Dane drinks tea
- the green house is on the left of the white house
- the green house's owner drinks coffee
- the person who smokes Pall Mall rears birds
- the owner of the yellow house smokes Dunhill
- the man living in the center house drinks milk
- the Norwegian lives in the first house
- the man who smokes blends lives next to the one who keeps cats
- the man who keeps horses lives next to the man who smokes Dunhill
- the owner who smokes BlueMaster drinks beer
- the German smokes Prince
- the Norwegian lives next to the blue house
- the man who smokes blend has a neighbor who drinks water
QOD 4. Write a program to (a) render atleast 100 random points on the screen, and (b) draw lines from current cursor position to points whose distance is less than some threshold value (say 150px). The program should redraw every time cursor moves to a new location and older lines should disappear if the distance between cursor and the point exceeds the threshold. (Suggested medium: p5.js, Est. time: 30-60min)
QOD 5. Take any random number (read natural number >= 1). If your number is even, half it; and if it is odd, triple it and add 1 to it. And repeat the procedure with obtained number. You can stop when you reach at 1. Strangely, you will come back to 1 for most numbers. Through hit and trial, find such a number which cannot be reduced to 1 through above process. If you want to take it a step further, you can try finding such a number using your computer program.