latex

This wiki has very good and detailed infos: Latex guide 3.
and this too

Latex code begins with: \\(\)( and ends with: \)
to center it u can use: \[ and \]

short Latex-test 200\lfloor \approx 200\rfloor
3\boxed{3} \(\boxed{3}\) to write this as text use: \\(\)(\boxed{3}\\)

Note by Num Ic
8 months ago

No vote yet
1 vote

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

i found some interesting TedEx video about coding: Episode10. i found the last episode first, but i assume it's better to watch them from the start ;-) think like a coder

num IC - 4 months, 4 weeks ago

Log in to reply

ah, that, I've already watched the whole series before ;)

Jonathan Eshetu - 4 months, 4 weeks ago

Nice & helpful discussion @num IC

SRIJAN Singh - 8 months ago

;-) ty. i didnt meant to make an official post. by accident i pressed save instead of edit.
thanks to u i know how to use notes. since then i use notes to test latex before i post it.
before i discovered this, my latex posts had a lot of post-edit-post-edit-post chains.

num IC - 8 months ago

Log in to reply

I have deleted the chatbot discussion .Is there any problem or it is fine?

SRIJAN Singh - 8 months ago

Log in to reply

Your welcome.

SRIJAN Singh - 8 months ago

OΔ   ΘΞΦΩ\large{\boldsymbol{ \Box \oplus} \nabla \boldsymbol{ \oslash \mathbb{O} \Diamond} \Delta \boldsymbol{ \ominus \otimes \odot ~~~ \ast \circ \triangle \Theta \Xi \Phi \Omega} }
OΔ   ΘΞΦΩ\large{ \Box \oplus \nabla \oslash \mathbb{O} \Diamond \Delta \ominus \otimes \odot ~~~ \ast \circ \triangle \Theta \Xi \Phi \Omega }

num IC - 7 months, 1 week ago

its all fine. ty again for the idea of creating a chatbot. when i find some spare time i ll try to implement it, like it is shown in the video.

num IC - 8 months ago

Log in to reply

Your huge welcome!

SRIJAN Singh - 8 months ago

andendswith:200 and ends with: 200 lol

Half pass3 - 8 months ago

Log in to reply

Very simple latex

SRIJAN Singh - 8 months ago

;-) and can be copied (-;

num IC - 8 months ago

@num IC i noticed you have been having problems with this Oren-Ben-Dov guy can you png me as a reply to one of his messages for me and i will leave a nice suprise making sure he does not do that again

NSCS 747 - 7 months, 2 weeks ago

Log in to reply

i just wrote to him. i assume he just have no idea how to have a fruitful discusion.
i dont want you to "send a surprise". i assume talking to him makes more sense.
but it would be nice if you could teach me, how to surprise someone. ;-)

num IC - 7 months, 2 weeks ago

Log in to reply

no it is solely on;y for me and percy as hamza has disgraced us and leaked it to another person specificly going against what it is for

NSCS 747 - 7 months, 2 weeks ago

@mention[10644076:Toska Pi] i cannot see your post since i m no premium member, if you have a question, please feel free to post it here.

num IC - 7 months, 2 weeks ago

Log in to reply

@Num Ic – Thank you, I'll remember that. This was what my post said from the shifting supports challenge: Hi again! This was a very helpful reply and it answered my question. Thank you for helping me out (even though my question was confusing to understand) :):)

Toska Pi - 7 months, 2 weeks ago

Log in to reply

as i remember: the question was about "fixed CoM". you are welcome, i m glad that i could help

num IC - 7 months, 2 weeks ago

Latex is a bit confusing, to be honest. I don't really get it, but I don't think I need it much for Brilliant solution posting.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu nice, you found the page ;-)
since you know how to code, latex will be easy for you. when u wanna try it, i offer my help.
but anyway i just refered to this page, so we can communicate.

num IC - 7 months, 1 week ago

Log in to reply

Thanks! :)

Can I also chat to you on here about python, instead of just latex? Just in case I have any questions.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu ;-) here you can chat about everything. there is no off-topic delete like in the daylies.
feel free to ask. there are better coders here, but i will help as good as i can.
i created this page by accident. i just wanted to test the latex output to avoid a post-change-post-chain.
but now i keep it bcs its convenient.

num IC - 7 months, 1 week ago

Heyo, someone give me a problem to solve with python.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

what about the daily challenges?

num IC - 7 months, 1 week ago

Log in to reply

I've already completed most of the ones that you could solve with programming...but thanks for the suggestion.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu for starters: find the greatest common divisor for two numbers, without using the python gcd-function

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
print("Pick two numbers to find the greatest common divisor")
a = input()
b = input()
cd = 0
a = int(a)
b = int(b)
if a > b:
    for i in range(1, b+1):
        if a%i == 0 and b%i == 0:
            if i > cd:
                cd = i
else:
    for i in range(1, a+1):
        if a%i == 0 and b%i == 0:
            if i > cd:
                cd = i

print(cd)

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu Is that good?

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu overal nice. some improvements: a = int(input())

i = min(a,b)
while a%i !=0 or b%i !=0:
    i -= 1
cd = i
print(cd)

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Wow, I didn't think of that approach, I'm so used to for loops. I feel so stupid for not thinking of using min() too.

I'm assuming you meant b%i by the way.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu ty i corrected it.
its not my intention to make u feel stupid.

num IC - 7 months, 1 week ago

@Jonathan Eshetu what is the difference between the condition that i used and your condition?
there is an algorithm from euklid for gcd.
can you implement it as recursive function?

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Sorry, I lost you at euklid.

What does euklid and recursive mean?

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu i assume u will get that in school soon too.
its about a/b = x + remainder and then divide by the remainder and repeat until the final remainder is 0.
i propose to check the web to find it. i can explain it here, but one approach to programming is to find algorithms and implement them.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Oh ok, so I did some research. I knew about the euclidean algorithm for finding the gcd, I just didn't know that was the name. So you want me to implement the euclid approach in python, using recursion (calling a function within itself)? I'll try.

Jonathan Eshetu - 7 months, 1 week ago

@Num Ic

1
2
3
4
5
6
7
def euclidGCD(a, b):
    if a == 0:
        print(b)
    elif b == 0:
        print(a)
    else:
       euclidGCD(b, a%b)

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu one change:

def euclidGCD(a, b):
    if a == 0:
        return(b)
    elif b == 0:
        return(a)
    else:
       return(euclidGCD(b, a%b))

very good. you are fast. i would return the gcd, so it can be used instead of print, but as i said: very good and quick

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic I used return at first, but I accidentally put return a instead of return(a) And nothing outputted when I called the function, so I got confused.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu hm, as far as i know, "return a" and "return(a)" should return the same value. how did u do the box around the return ?
return just returns a value ;-).
to print it, call print(euclidGCD(34, 4))

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Ohhh, that's my mistake. I didn't add the print, I just called the function.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu yeah, print is mainly for checking.
to use it, it would be like:
g = euclidGCD(8, 4)

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Yeah, that makes sense. To be fair though, in an actual program you could just use the actual gcd function.

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu yeah, the calling of your own functions is used the same way as built-in functions.
since you already created code for the daily challenges, you can also check the coding solves by other users. its a good way to get some coding experience just to read coding done by others.
carsten kaminski writes very impressive code. it sometimes took me a while to understand his cool solutions.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Ah, I've seen some of his solutions. They're very hard to understand, but I try.

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu in your text, the return is in a little box. how did you do that?

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic just put three tick marks ` before and after. like this

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu ok thank you, i didnt know that

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic You're most certainly welcome. I found it out on accident :)

Jonathan Eshetu - 7 months, 1 week ago

@Num Ic Thank you though!

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu so check the other codes first. all reading of code helps to get new ideas. (i proposed carstens code just if u wanted to have a challenge.)

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic It does. You can learn a lot by reading others solutions on brilliant, one of my favorite features.

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu i did the free course on this page: coursera.org
it is in russian, but i translated the pages (i ignored the videos)

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic I'll check that out, thanks!

I've just been using Brilliant's python course and self-study, but that seems better.

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu we used different conditions. can you explain what the difference between those conditions is?

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic I might have the wrong definition of condition, but essentially you checked if it DIDN'T work (a%i != 0 or b%i != 0), from the top down (i -= 1). This allows the program to stop when it finds a value. In my case, I checked if it DID work (a%i == 0 and b%i == 0) and went from the bottom up (for i in range(1, b+1)). Since we're looking for the GREATEST common divisor, going from the top down allows you to stop when you find a value, because that value is already the greatest possible number.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu very good. you got it and you also explained it very well.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Thanks! These mini-exercizes/explanations are helping a lot.

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu you can also use "python" in the search bar. some users post python quests.
i just found this: Using Recursion (Python loop) and this: Break the Code

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic The first problem I got pretty easily, but I'm still confused over the second...

Could you please explain, if you got it? I'm just scratching my head right now...

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu nice solution for the first problem.
for the second: its a nice example to show that it might cause problems if a function is used as argument for the function itself.
the return value is 3 + something. so i checked what happened if n=3.
_ = 4 will result in return 0 -> no problem
_ = 3 will result in return 0 -> no problem
_ = 2 will result in return 3+something -> might cause a problem
but you can also use a loop and call the function with different values to check the results. i do this sometimes to figure out if there might be an error.
have u checked the russian course?

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Wait...but by that logic, don't all values not work?

If n = 5, then 4 3 and 2 all result in leaving something....right?

And no, I haven't checked the course out, sorry! I'll get to that soon.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu ;-) it was no "task" to check that course. just a proposal.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic :) But still, wouldn't all values be correct for the problem?

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu you can just create the code for all 3 _ values and then check it for 1 to 100 as input.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic I'll get back to you in the morning on this, because my head is hurting a little too much right now. Good night!

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu np. take care

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Ok, so I think I get it now.

The reason it's 2 is because eventually, the program will simplify to

3 + rec(3)

Because when you keep subtracting the number, it will eventually go below 0, and then everything will simplify to the above equation. But when you calculate the return value, it becomes 3 + 3 + rec(rec(3-_), and if the blank is less than 3, it will result in rec(natural number), which causes an infinite loop. Eg. 3 + rec(rec(5-3)); 3 + rec(rec(2)); 3 + rec(3 + rec(rec(2-3))); 3 + rec(3 + rec(rec(-1))); 3 + rec(3 + 0); 3 + rec(3) (it always simplifies to this); 3 + rec(rec(3-3))) (since the blank is 3, the rec function goes down to 0); 3 + 0; 3; However, if it was say 2; 3 + rec(3); 3 + rec(rec(3-2)); 3 + rec(rec(1)); 3 + rec(3 + rec(rec(1-3))); 3 + rec(3 + rec(rec(-2))); 3 + rec(3 + 0); 3 + rec(3); Hence the infinite loop.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu very good, you got it.
u can also test it in the coding environment here.
nothing bad will happen. there will just be a message that there are too much recursions.
i did the test with _=4 and n=10000.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Oh wow. I just used IDLE to play around and see what happened. I set a variable that increased 1 for ever recursion. and then made it stop at 20 so I could review the loop.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu yeah for local test, i used idle too. but here i use the brilliant coding environment.
have u seen that carsten proposed two webpages?
have u checked the community for coding problems, that are posted by the members?

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic I've looked around here and there for problems posted by members, but everything is either WAY too easy or WAY too hard.

A website I just found out, that I'm going to use a lot now, is edabit.com. It has a bunch of different challenges anywhere from Very Easy -Expert, with a ton of different languages.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu thats a great hint ty

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic I also didn't see the websites carsten proposed. Could you please send a link?

Jonathan Eshetu - 7 months, 1 week ago

@Jonathan Eshetu @num IC this explanation was actually a bit off, as the pattern goes:

3 + rec(3)
3 + 3 + rec(rec(3-3))
3 + 3 + 0
6

or in some cases;

3 + rec(3 + rec(3))
3 + rec(3 + 3 + rec(rec(3-3)))
3 + rec(6)
3 + 3 + rec(rec(6-3)
3 + 3 + rec(rec(3))
3 + 3 + rec(3 + rec(rec(3-3)))
3 + 3 + rec(3)
3 + 3 + 3 + rec(rec(3-3))
3 + 3 + 3 + 0
9

But I'm assuming you see the pattern by now.

Jonathan Eshetu - 7 months, 1 week ago

@Num Ic Sorry that it's cramped, I can't do line breaks for some reason. You don't need to read it, I just think I understand now.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu i do linebreaks by two spaces and then return. 4 spaces should create a linebreak too.
i had four spaces before the 4, but it seems not to work.
btw: u can test such things by creating a note.
but u can do it here too ;-) (if the others in this chat are annoyed, they will unsubscribe this chat)

num IC - 7 months, 1 week ago

@Jonathan Eshetu you can just try this ;-) :

def rec(n):
    print(n)
    if n <= 0:
        return 0
    return 3 + rec(rec(n - 2))

N = 5
for i in range(1, N):
    print(i, rec(i))

the recursion depth is limited, so big input values will cause a problem even with _=3 and _=4.

task: create a short code to find the max recursion depth.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Hm, what do you mean by recursion depth? Sorry if that's a stupid question...

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu questions are rarely stupid. if the factorial function is called with the input 10, then it calls itself 10 times, if it is called with 100, then it calls itself 100 times. the recursion depth is how often a function calls itself until it finishes.
eg factorial 4:

remember the 4 and call f(3)  
    remember the 3 and call f(2)  
        remember the 2 and call f(1)
            return 1
        return the remembered 2 multiplied by 1 (=2) 
    return the remembered 3 multiplied by 2 (=6)
return the remembered 4 multiplied by 6 (=24)

-> recursion depth 4

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Ohhh, ok. That makes a ton more sense now. I'll do that program tmrw morning. :)

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Num Ic Well uhh....I already solved it intuition wise accidentally....

Jonathan Eshetu - 7 months, 1 week ago

@Num Ic Now that sounds fun. Though, I'm a bit busy with schoolwork rn, so I'll make the recursion depth program and solve that problem when I get s'more work done.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu sure. schoolwork first.
this is a proposal for a coding environment: repl.it
this is for learning: realpython.com
(the 2nd seems to be similar to your edabit.com)

num IC - 7 months, 1 week ago

I need to test my programming skills.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

i can sure propose something, but i would prefer if people use "please" when they ask for something.

num IC - 7 months, 1 week ago

Log in to reply

Sorry about that.

I was a bit....impatient when I wrote that. Completely my fault. Could you please?

Jonathan Eshetu - 7 months, 1 week ago

@Mahdi Raza hello Mahdi Raza , you created a very nice animation in this daily problem: Sum These Segments. what tool can be used to create such an animation? or did you move the lines by hand, step-by-step?

num IC - 7 months, 1 week ago

Log in to reply

Hi, I have used Keynote. I grouped the lines and then rotated. Refer this if you have any more questions

Mahdi Raza - 7 months, 1 week ago

Log in to reply

this is great ty. i checked your pentagon. there you mentioned keynote. i thought that was only a kind of a powerpoint clone. but you are creating very impressive animations. ty for that and ty for the hint.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Thank you, would like to see your animations too...

Mahdi Raza - 7 months, 1 week ago

@num IC It was getting cramped earlier, so I'm just making a new post to continue our conversation.

1) I checked out repl.it, it seems pretty helpful, but realpython seems like basically pay to python.

2) Still working on those 2 problems by the way (smallest 10-digit number and recursion depth.) :)

3) I was thinking earlier, isn't there a much easier factorial function?

1
2
3
4
5
6
7
8
9
def factorial(n):
    nFac = 1
    for i in range(1, n+1):
        nFac *= i
    return nFac
# 5 => 120
# 7 => 5040
# 10 => 3628800
# 300 => 306057512216440636035370461297268629388588804173576999416776741259476533176716867465515291422477573349939147888701726368864263907759003154226842927906974559841225476930271954604008012215776252176854255965356903506788725264321896264299365204576448830388909753943489625436053225980776521270822437639449120128678675368305712293681943649956460498166450227716500185176546469340112226034729724066333258583506870150169794168850353752137554910289126407157154830282284937952636580145235233156936482233436799254594095276820608062232812387383880817049600000000000000000000000000000000000000000000000000000000000000000000000000 ;)

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

yeah. and it is faster, since a function call takes more time than a loop.
it is just used as a simple way to understand recursions.
you can also use carstens codes to understand recursions ;-)
ty, i didnt check realpython. i just saw that one did recommend it.
for recursion depth, a simple code is enough. just dont be affraid.

num IC - 7 months, 1 week ago

Log in to reply

Here's the program I used for the 10 digit problem:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Input
import itertools
import math
nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in itertools.permutations(nums):
    if i[0] == 0:
        continue
    i = int(''.join(map(str, i)))
    if math.sqrt(i).is_integer():
        print(i)
        break

# Output
1026753849

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu nice. i knew that was too easy for you, since you already used permutations. ;-)

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Thanks :D

Jonathan Eshetu - 7 months, 1 week ago

And isn't the recursion depth infinite?

As for any number, it would keep subtracting _ until the number became <= 0, and the number could be infinitely large...

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu in theory it is infinite. but that would create an endless loop. there is a limit.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Ok, my mind is blown.

For starters, I edited the function a little bit, so that it measures how many times the function is called.

 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Input
a = [] # This is an array so we can print the values if needed
def rec(n):
    a.append(n)
    if n <= 0:
        return 0

    return 3 + rec(rec(n - 3))

for x in range(1, 50):
    print(x, "-", rec(x), len(a))
    a.clear()

# Output
1 - 3 3
2 - 3 3
3 - 3 3
4 - 6 7
5 - 6 7
6 - 6 7
7 - 9 15
8 - 9 15
9 - 9 15
10 - 12 31
11 - 12 31
12 - 12 31
13 - 15 63
14 - 15 63
15 - 15 63
16 - 18 127
17 - 18 127
18 - 18 127
19 - 21 255
20 - 21 255
21 - 21 255
22 - 24 511
23 - 24 511
24 - 24 511
25 - 27 1023
26 - 27 1023
27 - 27 1023
28 - 30 2047
29 - 30 2047
30 - 30 2047
31 - 33 4095
32 - 33 4095
33 - 33 4095
34 - 36 8191
35 - 36 8191
36 - 36 8191
37 - 39 16383
38 - 39 16383
39 - 39 16383
40 - 42 32767
41 - 42 32767
42 - 42 32767
43 - 45 65535
44 - 45 65535
45 - 45 65535
46 - 48 131071
47 - 48 131071
48 - 48 131071
49 - 51 262143

Jonathan Eshetu - 7 months, 1 week ago

@Num Ic After analyzing:
1) Since it's steadily increasing, isn't the depth infinite?
2) This is crazy. If you add 1 to each of the depths, you end up with a very noticeable pattern.
4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64... Why would powers of 2 appear here?

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu i have to think about the logic to understand why the powers of 2 occure here.
but there is a missunderstanding. my intention was not to check the depth of this particular function. (50 is much too low to test this one).
its more easy to use a simple function that just increases the given value.

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Oh, you want me to create a simple function and then test the recursion depth with another program?

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu hm, no. just a small code, that continuously calls itself and then you run it and check the error message

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic

1
2
3
4
5
6
7
8
9
a = 0
def letsBreakIDLE():
    global a
    a += 1
    print(a)
    letsBreakIDLE()

letsBreakIDLE()
# Output stops at 1012

Jonathan Eshetu - 7 months ago

Log in to reply

@Jonathan Eshetu nice. mine stopped at 997 when i tried this in brilliant:

def rec(n):
    print(n)
    rec(n+1)

rec(1)

num IC - 7 months ago

@Num Ic Even in IDLE, the function starts to slow down at around 60.

Jonathan Eshetu - 7 months, 1 week ago

Log in to reply

@Jonathan Eshetu hm yeah it was just an idea. i thought it might be interesting for you to know how to check the limits of python (or any ide).
currently i feel a bit incapable bcs i am not able to express that intention clear enough.
have you found some interesting tasks on edabit.com?

num IC - 7 months, 1 week ago

Log in to reply

@Num Ic Sorry about this, I had my hands full of schoolwork last night.

Don't feel incapable, if anything my limited python vocab is stopping me from understanding.

I've just been doing easy tasks for now on edabit, but I've started switching a bit more to repl.it

Jonathan Eshetu - 7 months ago

Log in to reply

@Jonathan Eshetu ok. i have tried none of them.
do you reccomend them? do you have questions?

num IC - 7 months ago

Log in to reply

@Num Ic There was 1 problem, something like "create a stutter function that gets a parameter, and returns the first 2 letters, ..., the first 2 letters again, ..., and then the full word with a question mark.
Ex. stutter(python) -> py...py...python?
I have the idea, I just don't exactly know how to code it.

Jonathan Eshetu - 7 months ago

Log in to reply

@Jonathan Eshetu t="hello"
print(t[:2]) what did u use to get the first 2 letters?

num IC - 7 months ago

Log in to reply

@Num Ic That's the thing, I didn't know what to use. Thank you!

Jonathan Eshetu - 7 months ago

@Num Ic I thought [num:num] only worked on arrays.

Jonathan Eshetu - 7 months ago

@Jonathan Eshetu this works in brilliant:

t="hello"
print(t[:2],"...",t[:2],"...",t, sep='')

a string is an array, just filled with chars

num IC - 7 months ago

Log in to reply

@Num Ic Ah, I didn't think about it that way. Completely forgot about [:] and sep. Thanks!

Jonathan Eshetu - 7 months ago

Log in to reply

@Jonathan Eshetu yw. i had to google sep bcs i usually dont use it. its also possible to use a formated print, but i dont know how that works.

num IC - 7 months ago

this is a good idea to train using strings and dictionaries:
https://brilliant.org/problems/you-ninja-name/

num IC - 7 months ago

Log in to reply

sorry this is so late.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
def ninjaToEnglish(phrase):
    engText = []
    ninjaDict = {"a": "ka","b": "u","c": "mi","d": "te","e": "ku","f": "lu","g": "ji","h": "ri","i": "ki","j": "zu","k": "me","l": "ta","m": "rin","n": "to","o": "mo","p": "no","q": "ke","r": "shi","s": "ari","t": "chi","u": "do","v": "ru","w": "mei","x": "na","u": "fu","z": "zi"," ": " ",}
    phrase = phrase.split('~')
    for i in phrase:
        for key, value in ninjaDict.items():
            if i == value:
                engText.append(key)
    engText = ''.join(engText)
    return engText

print(ninjaToEnglish("chi~ri~ku~ ~ka~to~ari~mei~ku~shi~ ~chi~mo~ ~chi~ri~ki~ari~ ~no~shi~mo~u~ta~ku~rin~ ~ki~ari~ ~ari~ki~na~ ~te~ki~ru~ki~te~ku~te~ ~u~fu~ ~ri~ka~ta~lu"))

#output: the answer to this problem is six divided by half (I almost put 3)

Jonathan Eshetu - 7 months ago

Log in to reply

@Jonathan Eshetu nice

num IC - 7 months ago

Log in to reply

@Num Ic thx

Jonathan Eshetu - 7 months ago

@Jonathan Eshetu what does this?: engText = ''.join(engText)
and ty: i was not aware that there is no direct access from value to key.
i assume that is why they created that reverse dict in the solution.

num IC - 7 months ago

Log in to reply

@Num Ic changes it from ['e', 'x', 'a', 'm', 'p', 'l', 'e'] to 'example'

Jonathan Eshetu - 7 months ago

Log in to reply

@Jonathan Eshetu cool trick. ty

num IC - 7 months ago

Log in to reply

@Num Ic welcome.

Jonathan Eshetu - 7 months ago

@Jonathan Eshetu i would have used:
engText = ""
and then:
engText += key

but good to know how to convert an array into a string.

num IC - 7 months ago

Log in to reply

@Num Ic true, i didn't think of that.

Jonathan Eshetu - 7 months ago

@Num Ic I had to do a bit of searching up, since I wasn't familiar with dictionaries.

Jonathan Eshetu - 7 months ago

Log in to reply

@Jonathan Eshetu yeah thats where i struggled with the online course: i had no experience with python dictionaries.

num IC - 7 months ago

Hey @num IC, I finally made a one liner!

Basically, it takes a number, returns its divisors, the sum of its divisors, and if it's a perfect number (a number where the sum of its divisors equals itself) or not.

1
2
def perfectNumberCheck(n):
    print(n, "\n", "divisors:", ' '.join(map(str, [i for i in range(1, n) if n%i == 0] + [n])), "\n", "sum of divisors (aside from itself):", sum([i for i in range(1, n) if n%i == 0]), "\n", "Perfect number:", "True" if sum([i for i in range(1, n) if n%i == 0]) == n else "False", "\n", "\n")

Try it out!

Jonathan Eshetu - 6 months, 4 weeks ago

Log in to reply

very cool.
its possible to skip long lines by using \
and i know that for some ppl it is a challenge to solve problems in few lines, but it is more easy to read code if it is split into several commands.
and i m impressed: you already know more about how to use the print command than i do.
so i should try to catch up again ;-)

num IC - 6 months, 4 weeks ago

Log in to reply

I knew I could make the code a lot more compact if it was in several lines, but I wanted to see if I could do it in one, yknow?

Jonathan Eshetu - 6 months, 4 weeks ago

Log in to reply

@Jonathan Eshetu Here it is a bit..neater, because I assigned the divisors array so I wouldn't have to spam it.

1
def perfectNumberCheck(n): divisors = [i for i in range(1, n) if n%i == 0] + [n]; print(n, "\n", "divisors:", ' '.join(map(str, divisors)), "\n", "sum of divisors (aside from itself):", sum(divisors) - n, "\n", "Perfect number:", "True" if sum(divisors) - n == n else "False", "\n")

Jonathan Eshetu - 6 months, 4 weeks ago

Log in to reply

@Jonathan Eshetu this is great !! i wanted to say that repeating the same is not efficient, but this 2nd thing is very good

num IC - 6 months, 4 weeks ago

Log in to reply

@Num Ic Thank you! I appreciate it :)

Jonathan Eshetu - 6 months, 4 weeks ago

@Num Ic Hey Num Ic, could you please give me a coding challenge? It can be on brilliant, or anything really. Thanks!

Jonathan Eshetu - 6 months, 3 weeks ago

Log in to reply

@Jonathan Eshetu hm, i had to find some.
i really recommend the corrected coursera page that i posted.
coursera learn python
that was one task i liked:
korovay
it has to return correct russian word for cow (korov, korova or korovy):
For a given number n <100, finish the phrase “Grazing in the meadow ...” with one of the possible continuation: “n cows”, “n cow”, “n cows”, correctly declining the word “cow”.

Input format
A natural number is entered.

Output format
The program should print the entered number n and one of the words: korov, korova or korovy. There must be exactly one space between the number and the word.

Note
If Russian is not your native language and you find it difficult to cope with this task, you can find a hint on declensions here: https://www.coursera.org/learn/python-osnovy-programmirovaniya/programming/rsYze/korovy/discussions/threads/-FJYlWcKEeiMwRLm6nkdwA .
"n коров" if 10 <n <20 or the last digit of n is one of 0, 5, 6, 7, 8, 9.
"n корова" if the last digit n == 1.
"n коровы" in all other cases.

num IC - 6 months, 3 weeks ago

Log in to reply

@Num Ic wait, there's no difference between "n cows" and "n cows"?

Jonathan Eshetu - 6 months, 3 weeks ago

@Num Ic oh wait nvm.

Jonathan Eshetu - 6 months, 3 weeks ago

@Num Ic it translated to english for some reason.

Jonathan Eshetu - 6 months, 3 weeks ago

Log in to reply

@Jonathan Eshetu ;-) yeah, the same happened to me when i translated the page.
its a double challenge to code, when the task is given in a foreign language ;-)
i saved some of the tasks, but i saved them translated to german not english ;-(

num IC - 6 months, 3 weeks ago

@Percy Jackson you asked for sides to learn python.
i did the free course on this page: coursera.org
it is in russian, but i translated the pages (i ignored the videos)

a member here recommended edabit.com (it seems to be a free page to learn python).
other pages:
realpython.com (might be pay to use) repl.it (online coding environment)

num IC - 6 months, 3 weeks ago

Log in to reply

@Percy Jackson ty for showing your javascript code for the candy problem.
it helped me a lot to understand javascript.
i found a nice solution to change the speed.
if you want to see it, i can post it here.

num IC - 6 months, 3 weeks ago

Log in to reply

Ok, you can post it here. Thanks :)

A Former Brilliant Member - 6 months, 3 weeks ago

Thanks :)

A Former Brilliant Member - 6 months, 3 weeks ago

Log in to reply

javascript:

var img1Load, img2Load;
var total = '';
var customColor, customWeight, customSpeed;
var linecolor, weight, speed;

function preload() {
  img1Load = loadImage('PicCandy.JPG');
  img2Load = loadImage('Colour.png');
}

function restar() {
  image(img1Load, 220, 200, 440, 400);
  lastFrame = frameCount;
  waitFrame = true;
  state = 0;
}

function setup() {
  createCanvas(650, 450);
  background('white');
  imageMode(CENTER);
  image(img1Load, 220, 200, 440, 400);
  image(img2Load, 535, 140, 160, 20);

  customColor = createSlider(0, 360, 0);
  customWeight = createSlider(2, 15, 5);
  customSpeed = createSlider(1, 120, 60);
  cButton = createButton("Restart");

  customColor.position(450, 100);
  customWeight.position(450, 210);
  customSpeed.position(450, 300);
  cButton.position(500, 380);
  cButton.mousePressed(restar);

  lastFrame = 0;
  waitFrame = true;
  state = 0;

  textAlign(CENTER);
  strokeWeight(5);
  noStroke();
  textSize(19);
  text('Path Color', 530, 100);
  text('Path Width', 535, 210);
  text('Animation Speed', 535, 300);

  textSize(15);
  text('Thin', 455, 250);
  text('Thick', 605, 250);
  text('Low', 605, 340);
  text('High', 455, 340);
}

function draw() {
  //frameCount = 0;

  linecolor = customColor.value();
  weight = customWeight.value();
  speed = customSpeed.value();

  textAlign(CENTER);
  strokeWeight(weight);
  noStroke();
  textSize(19);
  rect(0, 400, 500, 50);
  text('Total : ' + total, 250, 430);
  colorMode(HSB);
  stroke(360 - linecolor, 100, 100);
  colorMode(RGB);

  if (waitFrame) {
    if (frameCount >= lastFrame + speed) {
      waitFrame = false;
      lastFrame = frameCount;
    }
  } else {

    if (state <= 15) {
      state = state + 1;
      waitFrame = true;
    }

    if (state === 1) {
      line(200, 268, 358, 151);
      total = '10';
    }

    if (state === 2) {
      line(358, 151, 358, 268);
      total = '10 + 9';
    }

    if (state === 3) {
      line(358, 268, 200, 268);
      total = '10 + 9 + 7';
    }

    if (state === 4) {
      line(200, 268, 40, 385);
      total = '10 + 9 + 7 + 4';
    }

    if (state === 5) {
      line(40, 385, 40, 268);
      total = '10 + 9 + 7 + 4 + 4';
    }

    if (state === 6) {
      line(40, 268, 200, 268);
      total = '10 + 9 + 7 + 4 + 4 + 6';
    }

    if (state === 7) {
      line(200, 268, 200, 151);
      total = '10 + 9 + 7 + 4 + 4 + 6 + 4';
    }

    if (state === 8) {
      line(200, 151, 358, 151);
      total = '10 + 9 + 7 + 4 + 4 + 6 + 4 + 8';
    }

    if (state === 9) {
      line(358, 151, 358, 36);
      total = '10 + 9 + 7 + 4 + 4 + 6 + 4 + 8 + 6';
    }

    if (state === 10) {
      line(358, 36, 40, 36);
      total = '10 + 9 + 7 + 4 + 4 + 6 + 4 + 8 + 6 + 7';
    }

    if (state === 11) {
      line(40, 36, 40, 151);
      total = '10 + 9 + 7 + 4 + 4 + 6 + 4 + 8 + 6 + 7 + 5';
    }

    if (state === 12) {
      line(40, 151, 200, 151);
      total = '10 + 9 + 7 + 4 + 4 + 6 + 4 + 8 + 6 + 7 + 5 + 7';
    }

    if (state === 13) {
      line(200, 151, 358, 36);
      total = '10 + 9 + 7 + 4 + 4 + 6 + 4 + 8 + 6 + 7 + 5 + 7 + 7';
    }

    if (state === 14) {
      total = '84';
    }

  }

}

num IC - 6 months, 3 weeks ago

Log in to reply

@Num Ic Thanks for the code, it works :)

A Former Brilliant Member - 6 months, 3 weeks ago

I wish you success with your exams.

num IC - 6 months, 3 weeks ago

Log in to reply

@Num Ic Thanks :)

A Former Brilliant Member - 6 months, 3 weeks ago

@Percy Jackson @Jonathan Eshetu
i m not sure if i linked the correct coursera course.
this is the one i did: https://www.coursera.org/learn/python-osnovy-programmirovaniya/home/welcome

num IC - 6 months, 3 weeks ago

@Mitch Connor
I have deleted my solution for the problem, but I apologize for the incorrect equation. I got them mixed up, which is completely my bad. Thanks for telling me!

Jonathan Eshetu - 6 months, 3 weeks ago

Hey @num IC , I have a quick question, if you're here

Jonathan Eshetu - 6 months ago

Log in to reply

hi. i m here now.
but since i still have to understand some of the lines from your cool code, i m not sure if i really still can help you ;-)

num IC - 6 months ago

Log in to reply

haha, thanks ;-)

I can't stay for long, so sorry if i don't respond, but say I was making a text rpg in python

in this rpg, i plan to have an effects system, ex. an attack inflicting the opponent with burn, poison, freeze, etc. etc.

what would you say is the most efficient way to do this? the player has a class, so you can add attributes if necessary. here is the class code (done by me)

 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
41
42
43
44
45
46
47
48
49
class RPGclass:

      def __init__(self, strength, defense, agility, magic, gold, health, MaxMP, name, wins, EXP):
        self.atksDict = {}
        self.strength = strength
        self.defense = defense
        self.agility = agility
        self.magic = magic
        self.gold = gold
        self.health = health
        self.currenthealth = health
        self.MaxMP = MaxMP
        self.currentMP = MaxMP
        self.name = name
        self.wins = wins
        self.EXP = 0
        self.level = 0

      def add_atk(self, atk, str, cooldown=0, manacost=0, effects=None):
        self.atksDict[atk] = [str, cooldown, manacost, effects]




    Rogue = RPGclass(2, 1, 2, 0, 0, 90, 40, "Rogue", 0, 0) #edit strength, defense,agility, and magic here

    Warrior = RPGclass(3, 1, 1, 0, 0, 110, 20, "Warrior", 0, 0)

    Knight = RPGclass(2, 2, 1, 0, 0, 120, 30, "Knight", 0, 0)

    Mage = RPGclass(1, 1, 1, 3, 0, 100, 70, "Mage", 0, 0)

    Rogue.add_atk("Needles", [i for i in range(round(1/3*Rogue.strength + 2/3*Rogue.agility), round(2/3*Rogue.strength+Rogue.agility)+1)], 0, 0)



    Rogue.add_atk("Surprise Attack!", round(Rogue.strength+2*Rogue.agility), 5,0)

    Warrior.add_atk("Sword Strike", [i for i in range(round(Warrior.strength*0.75), round(Warrior.strength*1.5)+1)],0,0)

    Warrior.add_atk("Whirlwind", Warrior.strength*2, 7,0)

    Knight.add_atk("Shield Bash", [i for i in range(round(1/2*Knight.strength + 1/2*Knight.defense), round(2/3*Knight.strength+Knight.defense)+1)],0,0)

    Knight.add_atk("The More, the Stronger!", 0, 5,0)

    Mage.add_atk("Staff Strike", [i for i in range(round(Mage.strength*1.5), round(Mage.strength*2.6)+1)],0,0)

    Mage.add_atk("Fireball", [i for i in range(round(Mage.magic*1.5), round(Mage.magic*2)+1)], 3, 15, "Burned")

Jonathan Eshetu - 6 months ago

as you can see, i have effects in the attack setting, but how should i go about adding it in an actual battle? going through a bunch of if statements (if attack[2] =="Burned", if attack[2] == "Freezed", etc. etc.) making a dict to match effect name with effects? thank you in advance! I have to go now, so i'll respond tmrw morning!

Jonathan Eshetu - 6 months ago

Log in to reply

@Jonathan Eshetu if they cause the same effect then you could use if attack[2] in ....
if the effects are different then a dict sounds like a good idea.

num IC - 6 months ago

@Jonathan Eshetu and i would add something like: "inflictedWith" and "inflictedTimer" to the character stats.

num IC - 6 months ago

Log in to reply

@Num Ic You're obviously more advanced at this then me, lol
so this is all being done on repl.it (remember that), so if you have an account, I can invite you to the repl ;)
however, i'm not the owner, so i'll have to wait until the owner gets online.

Jonathan Eshetu - 6 months ago

@Num Ic plus, a lot of the other code was done by me and therefore isn't that clean, so not only this, any help with the rpg would be appreciated!

Jonathan Eshetu - 6 months ago

Log in to reply

@Jonathan Eshetu i have no exp in creating a rpg, but i m glad when i can contribute some help

num IC - 6 months ago

Log in to reply

@Num Ic it's not only rpg, you're just advanced in coding in general.
so would you like to join? i'd invite you some time tmrw, and we could really use the help lol. i understand if you say no ;-)

Jonathan Eshetu - 6 months ago

Log in to reply

@Jonathan Eshetu oh, i love to join. its just that seeing you young guys doing all this cool stuff makes me feel i miss a lot that i should have done when i was younger.
i ll try to find some energy to create an repl acc.

num IC - 6 months ago

Log in to reply

@Num Ic it's never too late :).
Life's sometimes that way, but who says you can't do all those things this year, or maybe more?

Plus, you don't have to worry about final exams ;-)

Jonathan Eshetu - 6 months ago

Log in to reply

@Jonathan Eshetu yeah. i wish all i had to worry about were final exams. ;-)

num IC - 6 months ago

@Num Ic just respond whenever you make an account, and i'll ask the owner to add you asap.

Jonathan Eshetu - 6 months ago

Log in to reply

@Jonathan Eshetu ty i ll do.
could you do me a favour and check what brilliant has written here? https://brilliant.org/daily-problems/circles-parallelogram/?from_notification=15616976#!/dispute-comments/36816/
i cant check because i dont have premium

num IC - 6 months ago

Log in to reply

@Num Ic sorry this is late, they said: "Thank you for your feedback. I've updated the problem statement to reflect this.

I've marked this report as resolved."

Jonathan Eshetu - 6 months ago

Log in to reply

@Jonathan Eshetu ty for checking. its not late. i was just curious bcs they updated the wording already some days ago, so i was wandering if there was more then just marking it as resolved. ty again

num IC - 6 months ago

Log in to reply

@Num Ic yeah yeah, yw!
don't forget to tell me if you make a repl acc lol

Jonathan Eshetu - 6 months ago

i checked if your nice solutions runs in bril env.
i used that as input:

eq = "aaaa - bbb + cc - d = 8765"
leading0 = "false"

and it worked well. i tried this too:

eq = "aaaa-bbb+cc-d=8765"
leading0 = "false"

and got 0 solutions.

it does not matter for the designed purpose, but i assume u will process input data in the future too.

num IC - 6 months ago

Log in to reply

Yeah, I set it to .split(" + "), .split(" - "), and .split(" = "), so that's why it does that. If I remove the spaces, it might count them as numbers...

Jonathan Eshetu - 6 months ago

Log in to reply

@Jonathan Eshetu yeah input processing can be become very complicated. thats one reason why i'm so impressed by your code.

num IC - 6 months ago

Log in to reply

@Num Ic Thank you, that really means a lot coming from you ;-)

Jonathan Eshetu - 6 months ago

@Paul Romero Bello sry for the deleted msg, i tried to get your mention id, to "invite" you to this note.
the 2 links in this note are very helpful. i found some more too. and i can help whenever you are ready to try some latex.
additional: an idea to post a solution without pictures would be:
51234
23451
12345
34512
45123

lol, the numbers where just cycling. i have not recognized that before.

num IC - 5 months, 2 weeks ago

Log in to reply

You are very kind. Thank you :)

Paul Romero - 5 months, 2 weeks ago

Log in to reply

you are very welcome.
first "challenge": copy the next line and send it as reply
\(\boxed{\LaTeX}\)

num IC - 5 months, 2 weeks ago

Log in to reply

@Num Ic LaTeX\boxed{\LaTeX}

Paul Romero - 5 months, 2 weeks ago

Log in to reply

@Paul Romero Cooool!!!! :)

Paul Romero - 5 months, 2 weeks ago

@Paul Romero great !!
voila, your first latex post :)
did you check how it works? or maybe you know it without reading the links.

num IC - 5 months, 2 weeks ago

Log in to reply

@Num Ic Yeah, I realized how it works by myself. Now, I am taking notes from your post. I hope to post a solution for tomorrows problem, if I get it right, of course!!!

Paul Romero - 5 months, 2 weeks ago

Log in to reply

@Paul Romero you are very good. do you know how to post a picture?

num IC - 5 months, 2 weeks ago

@Num Ic wait, i'm a bit confused on LaTeX\boxed{\LaTeX}

how exactly does it work?

Jonathan Eshetu - 5 months, 2 weeks ago

@Num Ic ohhh, wait I think I got it

so what if I...

LaTeX\textbf{\LaTeX}

Jonathan Eshetu - 5 months, 2 weeks ago

Log in to reply

@Jonathan Eshetu Nice!

Jonathan Eshetu - 5 months, 2 weeks ago

Log in to reply

@Jonathan Eshetu abcdefghija_{b_{c_{d_{e_{f_{g_{h_{i_{j}}}}}}}}}

Jonathan Eshetu - 5 months, 2 weeks ago

Log in to reply

@Jonathan Eshetu Amazing!!!

Paul Romero - 5 months, 2 weeks ago

Log in to reply

@Paul Romero Thank you!

Jonathan Eshetu - 5 months, 2 weeks ago

@Jonathan Eshetu very good. can you do this?: upmiddlelow ^{\text {up}} \text{middle} _{\text {low}}

num IC - 5 months, 2 weeks ago

Log in to reply

@Num Ic hm....upmiddlelow{up}^middle_{low} ?

Jonathan Eshetu - 5 months, 2 weeks ago

@Num Ic oh no, that's not it

Jonathan Eshetu - 5 months, 2 weeks ago

@Num Ic upmiddlelow ^{up}middle_{low}

Jonathan Eshetu - 5 months, 2 weeks ago

@Num Ic got it! sorry for the 4 pings, lol

Jonathan Eshetu - 5 months, 2 weeks ago

@Num Ic highesthigherhighmiddlelowlowerlowest ^{ ^{ ^{highest_{higher_{high}}}}}middle_{low_{lower_{lowest}}}

Jonathan Eshetu - 5 months, 2 weeks ago

Log in to reply

@Jonathan Eshetu i have to try that highesthigherhighmiddlelowlowerlowest ^{ ^{ ^{highest_{higher_{high}}}}}middle_{low_{lower_{lowest}}}

num IC - 5 months, 2 weeks ago

@Jonathan Eshetu very nice. ty for that idea.
i don't mind the pings. i enjoy the interaction with you two.
@Paul Romero Bello please feel free to try it too.
if you don't want to get pings from this note, then you can click "unsubscribe", but i'm not sure what kind of notifications you will still get then.

num IC - 5 months, 2 weeks ago

maybe you want to use this. just an alternative to using percy's ;-)
i'm still curious. i assume a mac has a screenshot function?
else you might have something similar like snip&sketch:
when the "print" button is pressed, it offers some screen capture options.

num IC - 5 months, 1 week ago

i don't have a mac, but the web says shift-command-3 create a screenshot.
u said u use a pc-keyboard, so i assume the command key is different from the funktion key. is it?

num IC - 5 months, 1 week ago

Thanks for the link. The way I interpreted it was this: take any group of two students, there are 60/2=30 and there are 60 x 3 = 180 possible answers of which 60 x 2 =120 correct whatever the distribution. 60 answers are either all right, all wrong, or a combination of right and wrong. Person A could get Q1 right, and person B could get Q2 right. That's 2 questions right between 2 students. Or, A and B both got Q1 right but C and D got Q2 right. Or, if person A got Q1 right, B got Q2 right, and C got Q3 right, then D could have gotten Q1 or Q2 right or even Q3. I'm probably making too much out of this.

A Former Brilliant Member - 5 months, 1 week ago

Log in to reply

i just copy the statement, so it's more easy to compare.
"During an examination, 60 students had to answer 3 questions. After the examination, it's shown that for any two students, there is always at least 1 question which both students could solve."

num IC - 5 months, 1 week ago

it deprnds on the original wording but 60/2 is dividing the 60 students into groups of 2. but any two students would be 60*59/2 (combinatorics: pick 2 out of 60).
so this is much more than 30.

regarding the 1 question that both could solve. the wording indicates that both had the same question correct.

and as i said: the total number of questions is not stated. it could be the 3 same questions for all 60 students, but it could be more depending on the conditions of the problem.

the problem like you described it sounds more like:
60 students are divided into groups of 2.
each group had to answer 3 questions. both students answered individually.
every student gave at least one correct answer.

num IC - 5 months, 1 week ago

i was used to program in basic and c, but python is very nice.
i'm still on my way to understand how to use python-goodies like range and permutation.
but please feel free to ask questions regarding coding. it would be a pleasure for me to help you.

num IC - 5 months, 1 week ago

Log in to reply

Thank you. Long ago (30 years) I used Fortran, Watfive, Pascal and Pascal took the lead. I got into a lot of Finite Element modeling with programming but quickly canned programs came on the scene in the form of software. So, I drifted away from programming and relied on software. But I'm impressed with the flexibility Python offers and want to learn it. Been doing a little here and there but get lost in the goodies (permutations and other libraries). I'll be sure to take you up on that with questions as they arise. Thanks again!

A Former Brilliant Member - 5 months, 1 week ago

Log in to reply

@A Former Brilliant Member nice i used pascal too. i have seen fortran but never used it. is/was it fun to work with it?
i dont know watfive. i will search that.
you said you'r a bridge engineer. that sounds very interesting.

num IC - 5 months, 1 week ago

Log in to reply

@Num Ic Watfiv had some additional features over Fortran but as Fortran indicates "formula translation" was its main feature. With advent of Pascal working with arrays took on new meaning. Bridges are fun because they encompass so many aspects of civil engineering, structural, hydraulic, highway, geotechnical and it all has to be designed around those criteria. Kind of like a puzzle with constraints.

A Former Brilliant Member - 5 months, 1 week ago

@A Former Brilliant Member i could find some fortran code samples. i'm glad that i could mainly understand them.
fortran whatF iv was harder to find, they looked a bit like assembler code.

num IC - 5 months, 1 week ago

Thank you! I didn't even consider that there could be more than 180 questions. Just assumed they were the same 3 questions.

A Former Brilliant Member - 5 months, 1 week ago

Log in to reply

hm i assume 180 is the maximum if all student get different questions.
(there might be more but that should be mentioned like: ... had to answer 3 questions out of a set of questions.)
my first assumption was: all students get the same 3 questions.
i still assume this is the idea. but i have no idea what the question behind that setting is.

is this the original wording or is it just a draft for a challenge that you prepare?

num IC - 5 months, 1 week ago

Log in to reply

It's the actual wording of a problem in the challenges community I believe under logic. The writer intended for the groups of two to get the same question right. But I thought there could be different interpretations.

A Former Brilliant Member - 5 months, 1 week ago

Log in to reply

@A Former Brilliant Member ok nice. can you post a link here?
just use this without the blanks: [ some text ] ( html )

num IC - 5 months, 1 week ago

Log in to reply

@Num Ic https://brilliant.org/problems/during-an-examination/

A Former Brilliant Member - 5 months, 1 week ago

Log in to reply

@A Former Brilliant Member Hahaha, I got that wrong actually. I took the second point literally, when I should be doing 60 x 2 / 3 = 40.

Saya Suka - 5 months, 1 week ago

@A Former Brilliant Member that was a nice problem. ty for showing it.

num IC - 5 months, 1 week ago

Log in to reply

@Num Ic You're welcome.

A Former Brilliant Member - 5 months, 1 week ago

"there is always at least 1 question which both students could solve."
--> implies that each student had at least 1 question solved.
--> if even one of them only scored 1/3, then that particular question must be solved by 59 others to make this claim true. We can see this in just a group of three, let ABC be the students and 123 the questions. Say q1 is the easiest one, so average students A and B could only manage that one. But even when brilliant C solved the other difficult two, but made careless mistake / ran out of time on q1, the claim will be invalid (A1, B1, C23).
--> if there are no 'easy' question which is scored by ALL the students, then all 60 must have solved AT LEAST 2 questions each.

Saya Suka - 5 months, 1 week ago

Log in to reply

Thanks! I knew you'd make sense of this one. You are both a logician and mathematician.

A Former Brilliant Member - 5 months, 1 week ago

Log in to reply

Thank you, Joe, but that compliment is too high for me. I am still struggling when confronted with questions under category group theory. Too much lines and nodes than I can handle. And sorry I didn't think deeper than taking it as the 60 are just the usual class of hs students answering the same 3 questions. Perhaps the assumptions brought along from Three Questions problem we just had around Xmas.

Saya Suka - 5 months, 1 week ago

Log in to reply

@Saya Suka I liked that problem around Xmas but then there was more information to give a certain exactness. My approach is always to flesh out the knowns so when confronted with abstractions I'm in unchartered territory.

A Former Brilliant Member - 5 months, 1 week ago

if you love math then you might like this question: Minimum value of equation - Exam Edition
i got scrambled so i used wolfram alpha to solve it.

num IC - 5 months, 1 week ago

regarding 'beating a dead horse': hint: each char is coded as 2 digit number.
meaning: to waste effort on something when there is no chance of succeeding.
(beat a dead horse)
(i assume he wants to say that there is no benefit in discussing the different ways of solving the challenges. - in my opinion the expression does not fit here very well.)
in old times some riders did beat a horse to make it run faster, but if the horse is already done then this will have no effect.

num IC - 4 months, 1 week ago

Log in to reply

Expression means "We've discussed this so much and in so many ways but aren't making any progress." I value different approaches and don't understand why people think they have the ultimate solution. It's like asking, "who's better - the republican or democratic nominee? Obviously it depends on what you value. So, I'm advocating that all approaches that yield the correct answer are valuable. The lengthy one that experts find redundant appeals to the person who lacks that knowledge to solve. The programmer who has solved many cryptograms and is honing his programming skills is saving time but providing knowledge to those who don't know programming. Etc.

A Former Brilliant Member - 4 months, 1 week ago

Log in to reply

@A Former Brilliant Member good point. i assumed by 'beating a dead horse' you meant that that discussion has no positive effect.
my hope is that the discussion helps the critic to understand that there is a value in presenting different solutions (even coded ;-).

num IC - 4 months, 1 week ago

i can tell you how the first coding was done, but i assume you want to try it by yourself first.

num IC - 4 months, 1 week ago

Log in to reply

Thanks, num IC! For the horse proverbs explanation and the hint, but still I'm getting no progress. I don't understand 2 parts there, one is the many 7 there (though your reply had an almost balanced quantity of 6 & 7), and the other is why there are abcd included there too.

Saya Suka - 4 months, 1 week ago

Log in to reply

@Saya Suka 67736c6876 2068766576 6d68206b6 66f6f767720 626c66207a 6f686c206c 7575206769 7a78702072 20687676

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez Thank you, Jason & num! Now that I got the one to one exchange, I have four more questions. 1) why does space represented by a number far away (or it's just up to the encoder)? 2) is it usual for the alphabet not jumbled up in true encryption, like with this we have too many 7s & 6s, but it could be made 0 ~ 9 in balance somehow? 3) spy action movies always mentioned something like key, but is that the word the encoder will spell first in their encryption? 4) the length of the blocks, can we make it in odd length?

Sorry if these are stupid questions, but I don't know where to find the answers online. Sometimes what's provided isn't answering all my queries. Thanks for the hexadecimals, both of you!

Saya Suka - 4 months, 1 week ago

Log in to reply

@Saya Suka I think the space was up to the encoder or maybe has something to do with ASCII values but not required

In true encryption, alphabets are completely jumbled and the position of the alphabet matters and what lies next to the alphabet matters… u get the point I think, but Broekhuis had to make one which was crackable

The key is what is required to decrypt the sequence, without it becomes too hard to decrypt, in this example my post down below has a key which is the dictionary and the key can be sent with the message, but only knowing how to use the key can decrypt the message

U can do anything in encryption until it is possible to decrypt to a single message back again, if that can’t happen, that’s not an encryption, that’s data loss scheme

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez 7a6d772062766820647620647669 766d67207a796f7620676c2078697a78 70206773726820767a686220766d78 69626b67726c6d20647267736c66 672073766f6b20686c2079696c767073 66726820787a6d6720737a657620 6e7a7776207267207a6d626e 6c697620737a69777669

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez True cryptography, as opposed crypto-arithmetic would be a good question for Brilliant to post. You had asked for a crytoarimthym that would be hard to solve without a computer and I came up with this: ABCDE x FGH = HCFIIAJ. What do you think?

A Former Brilliant Member - 4 months, 1 week ago

Log in to reply

@A Former Brilliant Member I will reply after three hours cause I have something important to do now, but it seems good since I am unable to get any info at first glance

Jason Gomez - 4 months, 1 week ago

@A Former Brilliant Member Ok I have been trying to solve this monster but to no avail, I am not even able to eliminate enough to get the idea of assuming and checking for contradictions, this is truly requires a computer @num IC did u try this

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez i looked at it and decided that there are too less chances to solve it by hand.
Joe did select it very well to make us use a computer.

num IC - 4 months, 1 week ago

@A Former Brilliant Member U just put them in ascending order (blinking face emoji)

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez Nice joke played @Joe Byrne u completely got me

Jason Gomez - 4 months, 1 week ago

@Jason Gomez But yeah since there is just one solution you must be applauded, even itertools took five seconds to go through all combinations

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez I kept thinking why is this code not finding me the answer and just showing me the order in which I had put the numbers in

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez Lol! That's funny.

A Former Brilliant Member - 4 months, 1 week ago

@Jason Gomez i think in line 2 there is one digit too much

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic Yes I have edited it now I think I had mistakenly deleted a 7 so it lost a t

Jason Gomez - 4 months, 1 week ago

@Saya Suka I used to use ternary for encryption when I was small A-001 B-002 C-010… Z-222 (used to confuse my friends a lot) so hexadecimal isn’t the only thing u can use for encryption but it’s nice to have the decrypted data and encrypted data to have the same size, mine was way too inefficient in that way

Jason Gomez - 4 months, 1 week ago

@Saya Suka yeah there are different ways to encrypt something.
the sample was easy bcs he said: here is the text and this is the encryption.
but without the original text or other hints it can be very difficult to decode something.

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic There was a course on this exact topic in brilliant, premium though, they had a frequency chart of how frequently the alphabets were used ( that’s how I came to my conclusion for e and a, although the a was wrong because I didn’t expect spaces but 7a was actually my next target ) so if I encrypt a message large enough, using that table u can practically decode it if there is just a one-one encryption or at least find out most of the words and with some guessing find the rest, but I was unable to find the table no matter how much I tried otherwise I would have shared it.

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez yeah one-one encryptions can be cracked by the frequency of the letters if the message is long enough.

num IC - 4 months, 1 week ago

@Num Ic Right...like how about you take a phrase in English, translate it to Persian in English, then do a simple Caesar's Shift (English alphabet)? Even that would be difficult.

A Former Brilliant Member - 4 months, 1 week ago

Log in to reply

@A Former Brilliant Member Your intended target audience has to have the ability to decrypt the code…

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez I see. Thanks.

A Former Brilliant Member - 4 months, 1 week ago

jason gave a good hint: i'm used to treat hexadecimals as numbers.
(so i refer to a, b, c, d, e, f as numbers too)
with this you can decode every two "numbers" to represent a char.
so "beating a dead horse" = 79767a67 726d7420 7a207776 7a772073 6c696876
decrypts by: 79='b', 76='e', 7a='a', ...

num IC - 4 months, 1 week ago

@Ömer Ertürk please feel free to join the discussion here if you have some questions regarding python

num IC - 5 months ago

@Andrew Last i have never posted a zip-file on brilliant, but would it be ok for you to post a link to your python code for the Decanting Decision animation here?
or maybe the code is short enough, so you could just put it here as a normal post?
(i just downloaded manim, so your code would be a good introduction to understand that tool.)
it's fully ok if you don't want to post it.

num IC - 5 months ago

@Zakaria Sabbagh i propose to discuss programming items here, to not disturb the challenge posts.
can you tell me what kind of program you already have coded? eg: do you know how to add two variables and print the result?

num IC - 5 months ago

Log in to reply

Thanks you for your invitation.

I am a new member in Brillant.org I joined two days ago for the first time and was amazed to see programming solve complex equations and wanted to try to learn, but I feel drown into a maze and I do not know where to start !

In fact, I still did not get the first course in programming yet but I have the desire to learn. I am specifically interested in programming that solves mathematical equations

Log in to reply

ok. what kind of programming have you done already?
have you opened the brilliant coding environment?

num IC - 5 months ago

Log in to reply

@Num Ic I have no initial experience or knowledge of any programming before.

I didn't know there is anything called coding environment here, i only open when you share for me, in fact I spent all yesterday searching specifically for these coding side, where I can print codes, on the internet! and I couldn't understand why it was so difficult to get it as if it were a miracle!!

And after a long suffering I found these two links:

https://ide.geeksforgeeks.org/wlPGBtBkJB

https://www.programiz.com/python-programming/online-compiler/

Then I tried to solve a new equation by copying and modifying from some answers here that used python. I finally succeeded in writing correctly the new equation code but I did not get result and it seems that the program I use is not very developed and it said : time limit exceed!

Unfortunately, I do not know how to add and code two variables and I want to learn from zero

Log in to reply

@A Former Brilliant Member Hi Zakaria, I think I have a couple websites that might help. Consider checking these out:

https://inventwithpython.com/ (This website has several programming books, I recommend "Invent Your Own Computer Games with Python, 4th Edition", not only for games but because it generally teaches you)

https://edabit.com/challenges/python3 (This website has numerous different challenges, ranging from very easy to expert)

From there, I recommend you just start programming! 99% of any questions you have have been asked before online, so just search it up! This is more or less how I started programming.

Jonathan Eshetu - 5 months ago

Log in to reply

@Jonathan Eshetu Hi Jonathan, It sounds great, I just snapped a quick glance and I can say I got a good dose of stimulitions.

Thanks a lot!

Log in to reply

@A Former Brilliant Member You're very welcome! Tell me how it goes!

Jonathan Eshetu - 5 months ago

@A Former Brilliant Member Jonathan gave some good advice.
please feel free to ask if you have more questions or if we can help with some programming issues.

even if it sounds strange: it's a good idea to start with a simple "Hello World" program,
this makes sure the coding environment and the output works.

a disadvantage of the brilliant coding environment is that it cannot handle the input function (so at each run, the input has to be set manually. but i use it mainly to create solutions, so no input is required) and the brilliant environment is very slow compared to other coding environments.
but it's nice, because it is already here ;-)

num IC - 5 months ago

Log in to reply

@Num Ic This is very kind of you :))

Yes you are right and nothing strange if I start with "Hello world", i am not just interested in learning some codes and how to enter it, but I tend for Intense understanding and i need understand how these codes and programming fundamentally work

i have read the free introduction of brillant python programming courses and i find it great, now i would like to go more deeper i think i want to read the "Python Crash Course: A Hands-On, Project-Based Introduction to Programming" by Eric Matthes which I found in the link that Jonathan recommend

I don't face problems till now, i am still in the beginning and before diving but i will provide with your pinwheels so i am not afraid of drowning! I really feel grateful for your interest and your encouragement

thank you all

Log in to reply

@A Former Brilliant Member sounds great. did you implement some local coding environment? or do you use a web based one?

num IC - 5 months ago

Log in to reply

@Num Ic I do not understand well what you mean but I use brillant coding environment, I applied many codes that i learned outside, specifically related turtle library, and everything work fine

But if you mean my PC python program so I do not have PC and it does not matter

Log in to reply

@A Former Brilliant Member ok i'm glad to hear that. as i said: the brilliant environment has some limitations and is slow. so if you experience some performance issues, just ask here and we can propose some other online coding environments.

num IC - 5 months ago

Log in to reply

@Num Ic Yes, I think I understand now what you are referring to, but I found that I still could dispense some initial necessary codes in brillant coding env. which is required in some others env. outside, I do not know maybe they are always developing it!

yes.. thank you very much

@num IC.Hi, I m working on quite good Python projects Would yu mind if you take part in it?

SRIJAN Singh - 5 months ago

Log in to reply

oh ty for that. i forgot to create an account. was it repl.it?

num IC - 5 months ago

Log in to reply

hmm

SRIJAN Singh - 5 months ago

I would be glad to be involved in interesting Python projects if you invited me :)

Paul Romero - 4 months, 4 weeks ago

Same here :) @SRIJAN Singh I already have a repl.it account created, and i've been waiting for num IC to create one for a while too, haha

Jonathan Eshetu - 4 months, 4 weeks ago

Hi,

I am working on a small python program that has not finished yet, I reach there..

But i have thousands of outputs and look separated like this:

27

9

36

etc.

how can I combine the outputs in one tuple or one list to continue working on the variable y?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import random

for n in range(0,10**10):

    string_n = str(n)

    shuffle_string = ''.join(random.sample(string_n, len(string_n)))

    united_string = "".join(shuffle_string)

    n1 = int(united_string)

    x = n - n1

    y = sum(map(int, str(x).lstrip('-')))

    print(y)

A Former Brilliant Member - 4 months, 2 weeks ago

Log in to reply

ok. what shall this code do?
ty for using 3 of these ` before and after your code :-)
does that out-variable solve your request?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import random
out=[]
for n in range(0,10**1): 
    string_n = str(n) 
    shuffle_string = ''.join(random.sample(string_n, len(string_n))) 
    united_string = "".join(shuffle_string) 
    n1 = int(united_string) 
    x = n - n1 
    y = sum(map(int, str(x).lstrip('-'))) 
    print(y)
    out.append(y)
print(out)

num IC - 4 months, 2 weeks ago

Log in to reply

Thanks for you note.

I am trying to prove a mathematical issue which is if you take whatever number and subtract it from another number composed of same digits the result is always multiple of 9 e. g.:

759 812 − 285 917 = 473,895 equal 9 * 52,655 (mean multiple of 9)

or 759 812 − 571 289 = 188 523 equal 9 * 20,947 (mean multiple of 9)

A Former Brilliant Member - 4 months, 2 weeks ago

Log in to reply

@A Former Brilliant Member oh nice idea.
(there is a mathematical proof but i like the idea to brute force it)

num IC - 4 months, 2 weeks ago

Log in to reply

@Num Ic Sorry for being late, I was testing your code..

You are shrewd 😃 and I did not think the answer was so simple, I should have ask from before 🙃, thank you very much

And here is the sequel:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
import random
out=[]
for n in range(0,10**10): 
    string_n = str(n) 
    shuffle_string = ''.join(random.sample(string_n, len(string_n))) 
    united_string = "".join(shuffle_string) 
    n1 = int(united_string) 
    x = n - n1 
    y = sum(map(int, str(x).lstrip('-'))) 
    out.append(y)
    import functools as f
    A = out
    g = lambda a,b:a if b==0 else g(b,a%b)
    common_factor = f.reduce(lambda x,y:g(x,y),A)
    print(common_factor)

A Former Brilliant Member - 4 months, 2 weeks ago

@A Former Brilliant Member i propse to use a smaller range, like for n in range(12345,12355): while u are evaluating the code

num IC - 4 months, 2 weeks ago

Log in to reply

@Num Ic Of course you right and I do, but at the end it doesn't matter, cause finally I only need to print the common factor as output

But I don't know why I still have many 9s instead of one 9 output!

A Former Brilliant Member - 4 months, 2 weeks ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
def translator(text):
    dit={"a":"7a","b":"79","c":"78","d":"77","e":"76","f":"75","g":"74","h":"73","i":"72","j":"71","k":"70","l":"6f","m":"6e","n":"6d","o":"6c","p":"6b","q":"6a","r":"69","s":"68","t":"67","u":"66","v":"65","w":"64","x":"63","y":"62","z":"61"," ":"20"}
    text=text.lower()
    s=""
    for i in range(len(text)):
        s+=dit[text[i]]
    return s

def detranslator(text):
    dir={"7a":"a","79":"b","78":"c","77":"d","76":"e","75":"f","74":"g","73":"h","72":"i","71":"j","70":"k","6f":"l","6e":"m","6d":"n","6c":"o","6b":"p","6a":"q","69":"r","68":"s","67":"t","66":"u","65":"v","64":"w","63":"x","62":"y","61":"z","20":" "}
    s=""
    text=text.replace(" ","")
    for i in range(0,len(text),2):
        s+=dir[text[i]+text[i+1]]
    return s

Jason Gomez - 4 months, 1 week ago

Log in to reply

I think this will be helpful to anyone who sees num ic’s encrypted text

Jason Gomez - 4 months, 1 week ago

Log in to reply

very helpful. ty.

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic Is there a note you have made specifically on this discussion?

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez the first purpose was to just use it for me to collect some latex docu.
now i use it for several discussions (mainly python).

num IC - 4 months, 1 week ago

@Jason Gomez oh, you meant regarding that crypting.
no, just the reply that i gave to Saya.

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic Oh wow so you found out what Broekhuis did

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez yeah. hex-numbers appear quite often in programming.

num IC - 4 months, 1 week ago

ty for that idea. since i'm to lazy to input the dict, i would use this detranslator:

inp="67736c6876 2068766576 6d68206b6 66f6f767720 626c66207a 6f686c206c 7575206769 7a78702072 20687676"
z=int("61", 16)
out=""
text2=inp.replace(" ","")
for i in range(0,len(text2),2):
    s=text2[i]+text2[i+1]
    if s=="20":
        c=32
    else:
        c=122+z-int(s, 16)
    out+=chr(c)

print(out)

num IC - 4 months, 1 week ago

Log in to reply

I did know there will be an iterative solution but I was too lazy to go and find the ASCII values back again lol

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez Do you know a way to invert a dictionary directly, without loops and storing in another variable ( I really need to learn about dicts a lot ), I had to print out the inverted dictionary and copy it back it into the code

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez i don't thing so, but when i did a python course, i stopped at dictionaries bcs i had no idea how to use them.
but it should be easy with a loop. why don't you want to use a loop?

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic It’s possible I know but python always comes up with these shortcuts, I didn’t want to use a loop because I wanted everyone to see the contents of the dictionary easily ( includes me I will be using this or something similar on a cryptogram daily challenge soon )

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez As a solution, my chief aim will be to get as many downvotes as possible

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez ;-) maybe you can achieve this by posting the first solution and just write: "coding will follow"

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic "I completed this solution using a 200 line efficient python program which I was too lazy to write. Program will be posted some time in the future."

Jonathan Eshetu - 4 months, 1 week ago

Log in to reply

@Jonathan Eshetu ;-) nice idea too

num IC - 4 months, 1 week ago

@Num Ic Nah I would prefer people solving the whole puzzle then seeing literal gibberish in the solution

Jason Gomez - 4 months, 1 week ago

Log in to reply

@Jason Gomez ok. if your chief aim will be to get as many downvotes as possible, then it seems that your solution has to be one of the first that are posted. since they get the most downvotes (independent from the content)

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic 🤣😂🤣😂🤣 Your conversation is much too interesting that I got funny looks from the family with the loud laughing!

Saya Suka - 4 months, 1 week ago

Log in to reply

@Saya Suka i'm glad to hear that. so i'm done with my good task for today ;-)

num IC - 4 months, 1 week ago

@Jason Gomez i found an easy code to create an inverted dict:
ivd = {v: k for k, v in dec.items()}

dec={"7a":"a","79":"b","78":"c","77":"d","76":"e","75":"f","74":"g","73":"h","72":"i","71":"j","70":"k","6f":"l","6e":"m","6d":"n","6c":"o","6b":"p","6a":"q","69":"r","68":"s","67":"t","66":"u","65":"v","64":"w","63":"x","62":"y","61":"z","20":" "}  
ivd = {v: k for k, v in dec.items()}  
print(ivd)

but you have to be careful if two keys refer to the same value.

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic Yes one-one mapping is a must or some values will be lost I understand

Jason Gomez - 4 months, 1 week ago

i would use this to create the both dict:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dec={}
z=int("61", 16) #coded z
for i in range(26):
    dec[hex(z+25-i)[2:]]=chr(97+i)
dec['20']=' '

ivd = {v: k for k, v in dec.items()} # create inverted dict

print(dec)
print(ivd)

num IC - 4 months, 1 week ago

Log in to reply

Oh this works for dictionaries as well I thought it did only for lists, well it’s easy to see the contents are being reversed/inverted so I will use it, thanks

Jason Gomez - 4 months, 1 week ago

@Saya Suka you can use this Latex code to make the look of your todays formula more 'chemical':
\(\ce{4Fe + 3O2 + 6H20 -> 4Fe(OH)3}\)
\(\ce{O2}\)

num IC - 4 months, 1 week ago

Log in to reply

Thank you for this offering, num IC! I am gladly accepting this, humbly. Ty again!

Saya Suka - 4 months, 1 week ago

Log in to reply

you are very welcome

num IC - 4 months, 1 week ago

Log in to reply

@Num Ic @Saya Suka @num IC Can you guys solve this? I posted this but took it down b/c nobody got it right. I want to be sure I'm correct and you are both good at probability problems. It could be as simple as the wording is confusing.

Family, “A”, goes to a restaurant on any given night 2 times every week at 5 or 6PM. Family, “B”, goes to the same restaurant 3 times every week between the hours of 5, 6, or 7PM. What is the chance they will meet during a specific 1 hour period of time? What is the chance they will meet during any one hour window of time? In these cases each family stays for one hour. What is the chance they will meet during any consecutive 2 hour period of time if they stay for the two hours? List you answer as the sum of these probabilities in percent to the nearest 1/100th.

Log in to reply

@A Former Brilliant Member I think you should mention whether they just show their heads in the restaurant or they stay for one hour or stay for two hour

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez I think your idea is good. How about rephrasing to "during a specific one hour window of time" and "during any one hour window of time" and "during any consecutive 2 hour window of time"?

Log in to reply

@A Former Brilliant Member Umm.. that works but you should mention with it how much time they spend in the restaurant(is it one hour?)

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Yes, that's what I meant but need to clarify by saying they stay for one hour. So, the latest family A could go is 6PM in order to stay an hour. And family B must arrive at 7PM to stay an hour at the latest. Thanks!

Log in to reply

@A Former Brilliant Member Just edited it above.

@A Former Brilliant Member I think Jason is talking about how long a time the families spend in that restaurant, the width of window of opportunity between them? And I think that you meant for "specific XX hour" to be that time (total time for getting seated + orders taken + orders received + eat + pay), but it wasn't very clear to some. I actually saved this question, because I'm never good with this and planned to get it right for the first time but have to reread similar solutions first. The others are mostly about police catching a criminal or two spies / informers meeting at the park or something.

Saya Suka - 4 months ago

Log in to reply

@Saya Suka I edited above. Did you see that version after Jason's comments? They are stay for a one hour period and the specific case is a conditional probability.

Log in to reply

@A Former Brilliant Member Yes it has been added

Jason Gomez - 4 months ago

@Saya Suka that sounds interesting. can you post the links to that problems?

num IC - 4 months ago

Log in to reply

@Num Ic https://brilliant.org/problems/detective-x-need-a-promotion/

https://brilliant.org/problems/some-more-probability/

Saya Suka - 4 months ago

@Num Ic https://brilliant.org/problems/a-question-of-time/

https://brilliant.org/problems/i-prefer-that-you-wait/

Saya Suka - 4 months ago

Log in to reply

@Saya Suka great. thank you

num IC - 4 months ago

@A Former Brilliant Member Ok taking that they stayed for an hour I think the first probability is 10/63

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Forget about this I calculated the wrong probability

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez There's no hurry and I appreciate you taking the time to look into/solve.

@A Former Brilliant Member I think you have to mention which specific one hour period you are talking about

5:00-6:00 has less probability of A coming but 5:30 to 6:30 has a higher chance(A has to be in this time period for 30 mins atleast if he comes on that day)

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Or you have to mention if u want the average probability for a specific one hour period

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez I edited it again taking your comments into consideration. Hopefully, this clears it up.

@A Former Brilliant Member Ok so first probability should be 149\frac{1}{49} and the second should be 17189\frac{17}{189}

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Is it?

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Our answers are close, within 1% both cases. Mine is higher in the 1st case, and lower in the 2nd. But I don't want to provide methods until @num IC and @Saya Suka have a chance to solve, or I may influence their thinking. And I could be wrong.

Log in to reply

@A Former Brilliant Member Oh ok, I just wanted to check whether my answer was right, no need to put up the correct method now.

Jason Gomez - 4 months ago

@A Former Brilliant Member i would start by calculating the chance that they are on the same day in the restaurant.
for the chance that they pic all different(!) days i got:
2/7 * 1/6 = 1/21, so the chance that they have at least one day in common is 20/21,
which seems to be quite high.
anyway i assume we have to calculate the chance that they have 2 days in common too.

but i struggle to understand this 'they meet during a specific 1 hour'.
in my understanding this means they are at the location at the exact same time.
but what is the granularity?
do they either arrive at 5 and leave exactly at 6 or arrive at 6 and leave at 7?
what happens if they arrive at 5:15? do they leave at 6:15?
does that mean the other family has to arrive at 5:15 too bcs all stay for exactly one hour?
what happens if the granularity is one second? or even smaller?
a finer granularity would decrease the chances.

if the granularity is 1 minute and the stay-time is exactly one hour,
then (if both are on the same day at the restaurant) both can arrive at
5:00, 5:01 ..., 5:59 or 6:00,
so the chance that they are in the restaurant at the exaxt same hour would be 1/61.

is my understanding so far correct?

num IC - 4 months ago

Log in to reply

@Num Ic Saya's probably done for the day given that she's in Malaysia. You're in Germany right?

Log in to reply

@A Former Brilliant Member yeah, this part of my profile is correct.

num IC - 4 months ago

Log in to reply

@Num Ic this may be a bit dumb, but assuming that they arrive only at 5/6/7 and stay for exactly one hour..I got 6/147?

If you take a random day, the chances that family A is there is 2/7 and family B is there is 3/7.
multiply them to get 6/49.
from there, the chances that they have the same time is...
A has 2 possible times.
B has 3 possible times.
2*3 = 6, only 2 times actually work (5 to 5, 6 to 6).
2/6 = 1/3.

multiply the possibility of them being on the same day and them being on the same time (6/49 * 1/3) and I got 6/147

Jonathan Eshetu - 4 months ago

Log in to reply

@Jonathan Eshetu i agree on that 1/3 part if both have to arrive at 5 or 6 to meet.
i have to re-think that 2/7 and 3/7 part (i hope you are right bcs that would be easy to calculate), but i assume it misses the part when they have two days in common.

num IC - 4 months ago

Log in to reply

@Num Ic The way I was thinking is that we don't know which days they will go. It could be M&T or M&TH or Th&F. It's not like there are 2 red balls and 5 blue balls so probability red is 2/7. There are many ways for 2 days to occur. That's why I though 2C7=21 and 3C7=35. When it comes to the hour, 1C3=3 or 1/3 and 1C2=2 or 1/2. Not saying I'm right. More minds are better than 1. The other thing for the specific times a) and c), Family A arrives, so it's a conditional probability of Family B meeting Family A given that Family A is there (like your holding a card, what is the chance of getting another card of the same suit.

@Num Ic Oh, you're right...This is hurting my head LOL

Jonathan Eshetu - 4 months ago

@Num Ic I started off trying to understand Zakaria worked numbers with his many weeks considering 0, 1 and 2 common days. The ratio I got was 2 : 4 : 1, so the 6 from (2/7)(3/7) = 6/49 came from 0(2) + 1(4) + 2(1) = 6, and nothing is left behind.

Saya Suka - 4 months ago

Log in to reply

@Saya Suka damn, i could have been first on todays problem, but i mixed 0.3 as 3%.
but it is 0.03

num IC - 4 months ago

Log in to reply

@Num Ic Well I already solved the problem num ic at 4:30 right when it appeared …

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez oh. i was not aware that it appears at different times. here it just appeared 20 min ago.

num IC - 4 months ago

Log in to reply

@Num Ic Well it appeared for me 20 mins ago too (forgot that in Germany time is different compared to India)

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Actually more of,forgot you were not in my timezone

Jason Gomez - 4 months ago

@Num Ic Different local time, mine at 1900. I didn't understand what null hypothesis is and went to read the whole intro first.

Saya Suka - 4 months ago

@Jason Gomez I solved it in one minute of it appearing

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez ;-) it took me longer. and i got it wrong by a factor of 10

num IC - 4 months ago

@Jason Gomez But that was just a silly mistake, and btw don’t you think reading the word null hypothesis will make people want to read the explanations, I never had learned of this before the new statistics chapter came out, so this problem should rated higher

Jason Gomez - 4 months ago

@Jason Gomez you can use {N\choose k} in latex to write NCk.
(Nk){N\choose k}

num IC - 4 months ago

Log in to reply

@Num Ic Thanks for the tip

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez I will use it for solutions I write in community problems

Jason Gomez - 4 months ago

@Num Ic I think I won’t change it as I just remembered how I used to struggle with the notation change two years ago, which stopped me from learning a lot of maths

Jason Gomez - 4 months ago

@Num Ic I did the same thing. Rushed through that one. I considered the difference in P instead of < 0.03. Can't win them all. :-)

@Num Ic When does Brilliant post the daily problems?

Jonathan Eshetu - 4 months ago

Log in to reply

@Jonathan Eshetu 11:00 utc

num IC - 4 months ago

Log in to reply

@Num Ic oh well, that's 5 am here, so I doubt I'm ever going to be early LOL

Jonathan Eshetu - 4 months ago

Log in to reply

@Jonathan Eshetu You could get up at 6 and do(If you like putting explanations up the glorious time is between one and two hours after the challenge has been posted, anytime before and you will be hit with the confused, anytime after your solution won’t be seen unless you are David Vreken, Chew-Seong Cheong or other respected people)

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez It's funny how you've perfectly memorized the norms of Brilliant's daily problem posting. Don't forget Percy Jackson, Frisk something-or-other, and Siddarth something-or-other. And I can barely wake up at 7:45 without a headache, so I don't think that plan will work, LOL

Jonathan Eshetu - 4 months ago

@Num Ic The granularity is one hour

Jason Gomez - 4 months ago

@Num Ic Granularity sounds like food, but I believe you're talking about the smallest time division that's taken into account. I've only seen the solutions using hour, half or quarter blocks of time, so I guess they use one minute granularity? For the day part, I would guess p(same day) = 1 - (1 - 2/7)(1 - 3/7) = 1 - (5/7)(4/7) = 29/49. I'll go look for the similar ones later.

Saya Suka - 4 months ago

Log in to reply

@Saya Suka Here Joe Byrne has used granularity of one hour

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Thanks Jason. I truly missed that, must have been that was my assumption when I read Joe's original question there and didn't read them again here. So I take it that one family could have passed the other by on the same welcome doormat outside & that doesn't count as a meeting, right? Then the time slots should be 2 & 3 blocks for each family (5.00 ~ 6.59 & 5.00 ~ 7.59). Thank you again for this, Jason!

Saya Suka - 4 months ago

@A Former Brilliant Member Hi, I see there is not enough information to solve the problem and the basis here confuses the concept of probability, average and also relativity!

The first question raises two dilemmas:

First dilemma is based on days and regardless of timing and related to the total number of times to go to the restaurant and from whose point of view, family A or family B or me? e.g. in 35 weeks (family B possible combinations) they meet 30 times (20 times one meeting a week and 5 times two meetings a week) but the total number of visits is 70, 105 and 175 respectively from the family A, B and my point of view!!

Second dilemma is related to timing i mean the question by itself: what is the chance they will meet during a specific 1 hour period of time?!!! but this period should be fixed and precised, and there are four different cases for timing:

5 to 6

between 5~6 to 6~7

6 to 7

between 6~7 to 7~8

And there is different probabilities: 1/1 for second case and 1/2 for other cases and a confusion with the average concept happen here!

And the complications increase for the second and third questions...

Log in to reply

@A Former Brilliant Member Hi, Family A b/c they have the shortest window of time. 2 times on average per week or 7 days/ 3 times on average per week or 7 days. Not 35 weeks, the number of combinations if you averaged 3 times per week would result in 35 combinations or ways that 3 days may occur, thus, 3/35 and 2/21. Relativity, the clock on the wall is the measure of time - it's objective - standard. Their watches are synched or they have GPS on their phones. They meet, having watches/phones in hand they agree on the time. They spend an hour of time. If Family A is there at 5PM they are also there on a specific day. P=1. What is the probability that Family B will visit the restaurant given that Family A is there. If Family B were to go there at 7PM, there would be no chance of meeting Family A because Family A leaves at 7PM. One hour of time is reasonable to order food, eat, drink coffee. The longer you stay, the greater the chances you will meet. Your English is hard to understand, seems you put very little thought into the matter. I can hardly take you seriously given your proposal.

Log in to reply

@A Former Brilliant Member That's a harsh criticism, anyway I do not claim genius, but I want to tell you that I enumerate one by one, all combinations for both families then I check all common possibilities, also one by one, and the above notes are strictly based on this examination

Maybe you are right, I overreacted in the forms but in context I still see that what I mentioned above are real obstacles

Sorry for my language, this is the best I can speak

Log in to reply

@A Former Brilliant Member Don't take it personally. There is a 25% chance we will understand each other anyway even if your English was good. Based on what you have written in your response the 1st time, I find it hard to believe you even grasp what the problem is about. Your talking about weeks of time. The data provided was for a small increment of time of one week. Your introducing more error by extrapolating months ahead. While it's true they meet 70 times in 35 weeks, that doesn't say on which days they meet. If I meet 2 times every 4 days, that does not say on which days I meet. So using combinations takes into account all the ways you can meet by chance - it introduces variability. Two consecutive days MT, TW, WTH, M-W, M-TH, T-TH, one day apart, etc. Furthermore, the problem was brought up to collaborate with others because it is a confusing problem - the English required to state the problem needs to be clear and precise. As it is it is rough. Thus, the collaboration. So, if you want to collaborate, happy to hear your opinion.

Log in to reply

@A Former Brilliant Member @num IC

Yet, I am only dealing with the first question and should be solved in the help of the following points :

  • the chance they go to the restaurant in same days and regardless the timing per hours

  • In the next stage , the chance they will meet together in the time by hours

First of all, Family A has 7C2 = 21 combinations and family B has 7C3 = 35.  For the first point, whatever are the 2 days family A go to the restaurant, there are 5 chances they meet family B in both days and 20 chances they meet only one day. e.g. family A go on (W, F) they meet family B both days as following: (M, W, F), (T, W, F), (W, TH, F), (W, F, SA), (W, F, SU) and only one day as following: (M, TU, W), (M, TU, F), (M, W, TH), (M, W, SA), (M, W, SU), (M, TH, F), (M, F, SA), (M, F, SU), (TU, W, TH), (TU, W, SA), (TU, W, SU), (TU, TH, F), (TU, F, SA), (TU, F, SU), (W, TH, SA), (W, TH, SU), (W, SA, SU), (TH, F, SA), (TH, F, SU), (F, SA, SU), however in the first 5 cases they meets in both days and it should be calculated as 10 chances because when the second point above is discussed, the timing by hours depends on every day and they can not meet or they meet one time or two times, and the total is 10+20=30 chances. the penultimate note, whatever family A combination is, such as (M, SA) or (TU, TH) etc. there are always 30 chances. now is the probability 30/42 or 30/70 or 30/105 or what??? I have no answer and i need to finish this issue before moving to the second point

Log in to reply

@A Former Brilliant Member It’s 5 in a 105 and 20 in 105 chances when I did my calculations

Jason Gomez - 4 months ago

@A Former Brilliant Member I do not know exactly what you have done, as you have not clearly explained your procedure, but I assume you have not used the information that a week has 7 days

Jason Gomez - 4 months ago

@A Former Brilliant Member If I am dealt a King of spades, what is the chance I will be dealt another King from the deck of cards? P(K)=(1)(3/51). In order for them to meet, one family has to be there. If I start with Family A, Family B could come at 7PM and they would never meet. So, if Family A comes 1st, P=(1)(1/3)(3/35) and the chance they never meet is factored in. Provided Family B is there at 5-7, then P=(1)(1/2)(2/21)=1/21. So, it's between 1/35 and 1/21.

@A Former Brilliant Member regarding the weeks: you are right: if we check 1000 weeks then the chance is 1000 times the chance of one week.
so the question is just about the chance to meet in one week, not in x weeks.

regarding the time: i had the same question.
i learned that the idea is that they can only arrive at 5:00, 6:00 or 7:00,
(they cannot arrive at 5:15)

num IC - 4 months ago

Log in to reply

@Num Ic The following was mentioned in the problem: "In these cases each family stays for one hour" and I guess it relates to the first and second questions and given a third question

@A Former Brilliant Member Probabilities don’t change no matter whose point of view you take, it’s a basic approach always taken in calculating probability(classically speaking)

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez i did the calculation in two different ways and got two different outcomes.
this is my way to check if i did something wrong.

num IC - 4 months ago

@A Former Brilliant Member For the specific one hour period of time, since the granularity is one hour and it’s obvious that A can’t come after 7, he means that the specific one hour period of time is 5-6 or 6-7 , and they both have equal probabilities, so need to consider the average

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez And how you dealt with the word "between" here: "between the hours of 5, 6, or 7PM." in difference of the previous expression "at 5 or 6PM"? for me, it goes without saying that there is reason to use two different expressions

@A Former Brilliant Member

This was my reasoning for the two parts

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Posted it because I did want to see if there was any mistake on my part (I waited for a whole day for Saya Suka to post an explanation but she (if the gender is wrong, I am sorry, I am really bad at figuring out gender from names most of the time) didn’t post one, so if this influenced her thinking I am sorry.

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Thanks for posting, Jason! How do you post a picture in Latex? I don't use Latex at all and there is no picture option.

Log in to reply

@A Former Brilliant Member ![description](link)

it is similar to posing a link but has a '!' as first symbol.
here is a short description at line 8

num IC - 4 months ago

Log in to reply

@Num Ic thank you! will make use of that.

@A Former Brilliant Member I use the daily challenge explanation posting area to make links of my pictures, then copy and paste them whenever required, it’s the third button from the left, but then how do you paste pictures on the explanations you make??

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez @Joe Byrne Can mathcad solve simultaneous non-linear six variable equations?

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Let me tell you, Mathcad is powerful. Does matrices, solve-blocks, roots, calculus, routine algebraic manipulations, programming and much more. My first boss used it in a bridge consulting firm and instructed me to learn it back in 1987. We were small, but competed with the big boys. Back then it was prime for making templates which could later be used in design. Initially, you spent time making the template, but on later bridges it became efficient and you only had to enter variables. There is a version that is freeware:

https://en.smath.com/view/SMathStudio/summary

Doesn't have the level of support but has examples. It's tailored after Mathcad...probably written by one of their software engineers. So, I could help you if you have any questions about use. Or, if you buy Mathcad, you will get plenty of clear examples on how to use.

Log in to reply

@A Former Brilliant Member Could you solve the six equations posted in my discussion here I’ll put the equations here also but there isn’t much space so it might not come fully

(i=16pi2)(xj=1x1pj+j=x+16jpj)=2pxj=26jpji=1j1pi,x{1,2,3,4,5,6}\displaystyle \bigg(\sum_{i=1}^6 p_i^2 \bigg) \bigg(x\sum_{j=1}^{x-1}p_j + \sum_{j=x+1}^6jp_j \bigg) = 2p_x \sum_{j=2}^6jp_j \sum_{i=1}^{j-1}p_i , \forall x \in \big\{1,2,3,4,5,6\big\}

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez p1,p2,p3,p4,p5,p6p_1,p_2,p_3,p_4,p_5,p_6 are the variables

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Yes, it can do it.

@Jason Gomez You'll have to create a vector for p values and keep track of indexing, for example p(0,6)=(1, 2, 3, 4, 5, 6) and p(6,0)= (1) (2) (3) (4) (5) (6)

Log in to reply

@A Former Brilliant Member Could you solve it and give as I do not know how to use mathcad, and this will probably be the only time when I would I use it(I am not an engineer yet and seeing how you use it astounds me, knowing how many nails to use was not calculable I thought, I have never done such computational work), so I am not very eager to learn it as I think I am fine with what tools I have (python does most of my computation work which isn’t much)

Jason Gomez - 4 months ago

Log in to reply

@Jason Gomez Sure, I'll look into it later. Because it's a WYSIWYG program, it's much easier to use than Python, or excel b/c the language of math is in front of you. You invest a little time learning, but you can capitalize on that investment later by saving time. If you're a student they have a student version for like $500.

Log in to reply

@A Former Brilliant Member That’s 36000 in rupees and that’s a lot(it’s half of my annual tution fee)

Jason Gomez - 4 months ago

@A Former Brilliant Member Just remembered US has schooling free in most places

Jason Gomez - 4 months ago

@A Former Brilliant Member It’s a lot of money in Indian terms for a student

Jason Gomez - 4 months ago

@Jason Gomez Tried to send Mathcad image per

![Description](link)

but it wouldn't work.

Log in to reply

@A Former Brilliant Member Mathcad Example Mathcad Example

@A Former Brilliant Member you can try to upload your pic to imgur first.
like shown here
can you tell what u did? maybe we can help.

num IC - 4 months ago

Log in to reply

@Num Ic It's been one of those weeks for me. Right now time is an issue. If you take a look at the Mathcad website and run through some examples, you can see quickly its capabilities. It's like programming but you see what you've done - the trade off is learning how to speak in Mathcad.

Log in to reply

@A Former Brilliant Member ty for the mathcad link. i will try to find some time time to check it.
regarding posting pics: whenever u want to do it: just ask when u want us to give some more explanations.

num IC - 4 months ago

@Jason Gomez I use Mathcad for most or Excel or Acad, then screen clip an image. Then I insert image under 3rd button.

Log in to reply

@A Former Brilliant Member That’s the same thing I do and did, I just cut the link from there and copy it here

Jason Gomez - 4 months ago

@A Former Brilliant Member Hi, Joe! By this "What is the chance they will meet during a specific 1 hour period of time", you mean for "what is the total probability for the two families to be 'dining together' in any given week?" or "what is the probability that a mutual acquaintance will meet both families on day X at time Y at the restaurant?"? When I reread the word specific, I have a feeling it could be the second, so I guess I'll just ask for confirmation.

Saya Suka - 4 months ago

Log in to reply

@Saya Suka I see your point...I guess I was thinking conditionally for the 1st part a). Given event A or B, what is the P(A/B) or P(B/A). The 2nd part b) is supposed to take into consideration the total chance. Looking forward to see the conclusions you draw from this.

Log in to reply

@A Former Brilliant Member I guess you should take the liberty to solve in a way that you can, and the question should be reframed to answer what is determinable.

Log in to reply

@A Former Brilliant Member This is what my Venn told me :
1) we have P(A dining there) = 2/7
2) we also have P(B dining there) = 3/7

P(both families dining there on the same day) = (2/7)(3/7) = 6/49
So, 49 days is 7 weeks, and in that time A would have been there twice a week for a total of 14 times, while B with 7 weeks x thrice a week = 21 times.

Total days in 7 weeks that the restaurant have at least one of the families there
= (14 - 6) + 6 + (21 - 6)
= 8 + 6 + 15
= 29
Days that neither went = 49 - 29 = 20

Saya Suka - 4 months ago

Log in to reply

@Saya Suka Thanks Saya! I'll look into later today.

@Saya Suka I didn't get the numbers straight away. Zakaria mentioned the many weeks he considered so I tried to understand what did he calculate, and from where did the numbers came. I found that his numbers only account for same days probability and the timing wasn't accounted in there yet. So I went with the different ways for the day's could be chosen by both families, but in the end, after all the simplification has been done, it turned out exactly like how it'd happen if I just multiplied the original 2/7 & 3/7 together. It kind of makes sense if you think that even when A is already there, the day could or not be the day B will join them too. It could happen with 3/7 probability or not with 4/7 probability.

Saya Suka - 4 months ago

Log in to reply

@Saya Suka Good thinking!

@Saya Suka For timing family A has 2 1-hour blocks and family B with 3.
For a) & b), the divisions are depicted as below :
A ==> 1/2 + 1/2 + 0
B ==> 1/3 + 1/3 + 1/3

For c), the divisions are depicted as below :
A ==> 1 + 0
B ==> 1/2 + 1/2

I took your a) as that mutual acquaintance situations, so it would be the same 1/49 for both the first and second hour, p(at 5) = p(at 6) = 1/49 but
p(at 7) = p(A at 7) x p(B at 7)
= (2/7) x (0) x (3/7) x (1/3) = 0

For c), p(spending 2 hours together)
= (2/7) x (1) x (3/7) x (1/2) = 3/49

Saya Suka - 4 months ago

Log in to reply

@Saya Suka Makes sense! Thanks.

@A Former Brilliant Member With the above, I just rationalize that they can only meet if both went the same day and the same time slot. P(dining together)
= P(both choose same day) x P(both choose same time slot)
= (6/49)(2/6) = 2/49

Saya Suka - 4 months ago

Log in to reply

@Saya Suka That makes sense too me. It has to be between 1/21 and 1/35 if you assumed conditionally one family was already there when the other popped in by chance.

@Saya Suka Going to put this up, but need you guys to weigh in: Family "A" dines at a restaurant two times for one hour between the times of 5-7PM. Family "B" dines at the same restaurant three times a week for one hour between the times of 5-8PM. a) If Family "A" goes to the restaurant at 5PM on Wednesday, what is the probability they will meet Family "B"? b) What is the probability that Family "A" and Family "B" will meet at any one hour window of time on any given day? Please provide your answer as the sum of parts a) and b) to the nearest 1/1000th.

Here's what I got:

a) Pa=1, Pb=(15/35)(1/3), Pa*Pb=(1)(3/7)(1/3)=1/7 b) P=(1/2)(6/21)(15/35)(1/3)=1/49

Please tell me what you get. Thanks!

A Former Brilliant Member - 3 months, 3 weeks ago

Log in to reply

@A Former Brilliant Member ah you changed a) to just meet and not meet for one hour. good idea

num IC - 3 months, 3 weeks ago

Log in to reply

@Num Ic Might make this more challenging and ask for total days there. I get 49 days which is 7 weeks. Family A is there 2 x 7=14 days and Family B is there 3 x 7=21 days. They are in there 6 times on same day. They miss each other 23 days (21+14-6-6). Total days one or both Families are there = 29 (23+6). Days they meet at certain time of 1 hour = 1. Total days neither there 20 (49-29).

A Former Brilliant Member - 3 months, 3 weeks ago

are you aware that mod in programming is different than in maths?
i saw that 10.5 % 3 is 1.5
afaik in maths mod is defined only for whole numbers.

num IC - 4 months, 1 week ago

just a test

num IC - 3 months, 4 weeks ago

Log in to reply

@Chelsea Saunders hello, i assume you posted a video-solution to the yesterdays daily problem (Double the Fun).
i just wanted you to be aware that the video shows the tabs of your browser.
nothing to worry about this time (the sherlock video seems to be interesting :-)
but please be careful to avoid showing some personal data in future videos.

num IC - 3 months, 4 weeks ago

Log in to reply

Thank you, but I checked what was visible and saw that it was nothing secret

Chelsea Saunders - 3 months, 4 weeks ago

Log in to reply

@Chelsea Saunders ok. it relieves me that you were aware of it.

btw: what tool did u use to record this video?

num IC - 3 months, 4 weeks ago

Log in to reply

@Num Ic it's a thing on windows 10. i found it in the video in one of the other tabs. press windows key + G and it brings up an app to record screen and your voice.

Chelsea Saunders - 3 months, 4 weeks ago

Log in to reply

@Chelsea Saunders this is very cool. thank you. i was not aware that this exists.
i don't know why it says xbox.

num IC - 3 months, 4 weeks ago

Nice of you to warn him :)

Jason Gomez - 3 months, 4 weeks ago

@Jason Gomez FYI - you can get a student license for Mathcad for $60 from PTC Web Store for one year. And Maple Soft has a similar product student license for $99 for a year. Both require Student ID verification. If I weren't so used to Mathcad I'd probably switch to Maple Soft. Worth looking into.

A Former Brilliant Member - 3 months, 3 weeks ago

It's said that this problem is unsolvable! can you prove the opposite?

A teacher randomly distributes to his 25 students their 25 papers. Calculate the probability of the following events:

A - "each students gets his paper"

B - "only Samir gets his paper"

C - "a single student does not get his paper"

A Former Brilliant Member - 3 months, 2 weeks ago

Log in to reply

A- 125! \frac 1{25!}

Jason Gomez - 3 months, 2 weeks ago

C- 0

Jason Gomez - 3 months, 2 weeks ago

B- D2425!125e\frac{D_{24}}{25!} ≈ \dfrac 1{25e}

Jason Gomez - 3 months, 2 weeks ago

Log in to reply

What does it mean! Can you write it again in more simpler form?

A Former Brilliant Member - 3 months, 2 weeks ago

Log in to reply

@A Former Brilliant Member It’s full form is quite big to write, easy to approximate(really good accuracy)

Jason Gomez - 3 months, 2 weeks ago

It means de-arrangement and this one exactly means the number of ways to de-arrange 24 objects such that none of them remain in their original position, check this wiki out

Jason Gomez - 3 months, 2 weeks ago

Log in to reply

@Jason Gomez Okay! ty very much, that's a good information. I will find the exact number and post it as own problem in my account;)

A Former Brilliant Member - 3 months, 2 weeks ago

Log in to reply

@A Former Brilliant Member D2425!=125(10!11!+12!13!++124!)\frac{D_{24}}{25!}=\frac 1{25}(\frac 1{0!} - \frac 1{1!} + \frac 1{2!} - \frac 1{3!} + … + \frac 1{24!} ) it’s a really bad number to calculate

Jason Gomez - 3 months, 2 weeks ago

@A Former Brilliant Member The approximation is good to about 20 decimal places I think

Jason Gomez - 3 months, 2 weeks ago

@Jason Gomez the algorithm by itself cannot give a discount, but i assume if you ask the staff they might be able to check that for you.
you could tell them that your premium abo ended. and if there currently is a discount available for you.
if they don't make an offer, you could also ask if you should wait until the next season offer (easter time is close).

sorry i try to avoid giving advices without beeing asked for. please tell me if this advice is unwanted, then i'll avoid that in the future.

num IC - 3 months, 1 week ago

Log in to reply

No I really want advice, I don’t want to sound like some cheapskate not wanting to pay more, when ofc this website is worth more than its weight in gold, so it’s really hard for me to ask as well, free advice given is always accepted by me especially in this situation when it’s quite awkward

I didn’t know there were season offers, I was pondering on my option of not subscribing because I may go (mostly infact) inactive after May

Jason Gomez - 3 months, 1 week ago

Log in to reply

i saw some offers but i don't really know if there are season offers.
if you rich then i apprechiate if you support brilliant even when you are inactive.
i'm poor so use only the free access, and thb: this already has a lot of content.
so if u are not rich, then why not pause the sub while u are not active.

num IC - 3 months, 1 week ago

Log in to reply

@Num Ic I am sort of the middle guy, who can afford this but still would mind his expenses. As said I might stop in May but may restart after September/October depending on the course I have chosen for college, so it may become very useful that time.

Jason Gomez - 3 months, 1 week ago
×

Problem Loading...

Note Loading...

Set Loading...