#discrete-math
1 messages Β· Page 140 of 1
okay thanks anyways
Thank you @lyric pumice
How many ways can n elements be chosen from a collection of 2n elements where n are different and n are identical
i have no clue how to even start with this
i mean, i know its 2^n
i just dont know why
Since you are choosing n elements, each element is either from the set of distinct elements or from the set of identical elements.
This implies that you are choosing whether or not an element is from the distinct set.
but if theyre from the "distinct elements set" its not irrelevant which element i choose, right?
In other words, for each element of the distinct set, you are deciding whether or not it is chosen.
and if its not chosen, it gets replaced with one from the identical set
That is correct.
HOLY SHIT
thats so smart
oh my god
i would not have thought of that
thats clever
So, since you must make a decision for each of n elements and only for those n elements, there must be 2^n possibilities for choosing n elements.
The simplicity of 2^n comes from the convenient fact that the number of distinct elements is the same as the number of elements that you must choose from.
theres one thing that doesnt make sense to me about that
if im going element by element and deciding wether it is chosen or not
isnt that for one order of those n pairs of elements?
wouldnt i have to to n*2^n?
Order doesn't matter in this problem because an element from the set of those that are distinct is is either part of those that you choose or not.
Moreover, the problem implicitly asks about choosing to make a set of elements.
And in a set, by definition, the order of the elements given does not matter.
thank you so much
so if i have an integer written as the product of prime factors I can use the (exponent + 1) in the prime factors to find the number of divisors of the integer
is there a proof for this?
i don't understand why it works otherwise
it is easy to "prove" with counting principles
the divisors of an integer are built out of the primes
so given a prime factorization
for each unique prime p, we could choose p^0 or p^1 or ... p^n (whatever the order is)
this gives n+1 options
by the multiplication principle
similarly, by the MP, multiply together all the options for the other primes
example
for 18=2β
3^2
we could choose 2^0 and 3^0, this gives the divisor 1
2^1 and 3^0 gives 2
2^0 and 3^2 gives 9
each different choice of exponents gives a unique divisor
for each unique prime p, we could choose p^0 or p^1 or ... p^n (whatever the order is)
@weary tiger what is this mean?
to be a little more clear on the example
the choices are
2^0 and 3^0
2^0 and 3^1
2^0 and 3^2
2^1 and 3^0
2^1 and 3^1
2^1 and 3^2
does that help?
it will help to have a good familiarity with the multiplication principle, if you don't already
yes that makes sense!
yeah i gotta learn it properly
thanks so much for the help
great explanation
no problem
it's very hard to figure this out own my own
but when someone explains i get it
its insane how can you figure this out on your own lol
lol, I tried to figure it out on my own once and ended up having to look it up
yea
I never forget it, if that gives you any hope
but I've worked with it a few times so that helps
when it says n is a positive integer
does that include 0 ?
is there like universal acceptance on 0 being a positive integer?
Positive integer means integer 1 or greater
Natural numbers may include 0, or they may not
ok thank you
fucking excuse me
this is quite possibly the most clapped notation i have ever seen
wdym
Clapped?
0 because students shouldn't be drinking beer
Combinatorics is so hard π©
I need to practice.
I can figure out some of this problem but not all.
Yeah practice is best for this type of stuff
have you learned stars and bars?
Me? No
imagine the k beers as stars in a row
then put dividing bars in the row
so between bars is how many beers a student gets
there are n-1 bars you have to place, like for instnace
let's say there are 5 beers and 3 students
oh yea I've seen this before.
xx | |xxx
this means the first student gets 2 beers, the second gets 0 beers, and the last gets 3
so now it's a matter of asking how many ways are there of arranging just these two kinds of symbols in a row
Ohh yeah ive seen this with binary numbers
same
6 ways?
nope
here's an easier problem that's not fundamentally different
how many ways are there of rearranging the letters of this word: AAB
there's ABA and BAA
but you should know of a way to count this combinatorically
maybe do AABB or ABBB
4!
Hm actually nvm
Cause AABB is same as AABB
6 ways
4 choose 2 multiply by 2 choose 2
@obtuse lance
No it is just 4C2
Picking 2 determines where the others go
Also another way, which is basically equivalent, is doing 4! Divided by 2!2!
As out of the 4! permutations, 2! where the red are swapped are the same and also for 2! Of blue; so you are overcointing by a factor of 4
The problem does not require stars-and-bars techniques.
Picking 2 determines where the others go
@sick swallow true
do you see how to solve the original problem now @copper ore ?
a proof of what
Of why this works
the dividers represent separations and you're always guaranteed the correct number of people and beers
What are you counting?
scroll up
It looks like you've done this all wrong.
The answer should be n^k.
I did the problem assuming the beer bottles were indistinguishable
Can you explain why its n^k
Since there is no restriction on how many bottles a student may get, the bottles can be assigned to students freely.
Each bottle must be given to some student.
So, for each bottle, there are n students to choose from.
Thus you are making k choices.
So, the combination of choices is given by multiplications of n.
There are k of these multiplications.
Hi, I got competitive programming excercise about graphs/trees. I got weighted vertices and undirected edges. I have to find minimal cost of takeover entire graph.
With every chosen vertex you add its weight to the sum and you got it and every neighbour considered as "marked". You have to mark all vertices with minimal cost.
Maybe you know how to name this problem
It's not a Minimum Spanning Tree. It's similar, but not MST
It looks like it involves independent sets.
I found only this
it's really similar, excluding that I got constant weight of nodes (and there are increased by 1 with every neighboring or semi-neighboring)
and I need to know which vertices to get, not only the " minimum strenght"
It looks like you are trying to solve a weighted set cover problem.
Let f β₯ 2, m β₯ 2, and k β₯ 2 be integers such that k β€ f and k β€ m.
The Computer Science program has f female students and m male
students. The Computer Science Society has a Board of Directors
consisting of k students. At least one of the board members is female and at
least one of the board members is male. Determine the number of ways in
which a Board of Directors can be chosen.
${k \choose 1} * {k-1 \choose 1} * {(m+f)-2 \choose k-2}$
The-Elite:
i was thinking the answer is this
That appears to be incorrect.
aw damn
yeah ... you can ... "ignore" ... some info there or manipulate it a bit.
Simplify with what you know. (a common math trick). What do you know for sure?
Moreover, start simply. How many ways can you choose a Board of Directors if you disregard the condition of choosing at least one male and at least one female?
How many 4 letter words can be made with the letters of TOPOLOGIA, where all words must contain at least one vowel?
The correct answer is ||1020||
I did the total amount on possible 4 letter words minus the amount that dont have any vowels
and that amount is 4! = 24
Now, I know that for the amount of words that can be made with the letters of TOPOLOGIA is 9!/3!
i dont know how to restrict that to 4 letter words, though
Could anyone point me in the right direction
The number of 4-letter words depends on the number of times a letter appears in a word.
try counting the number of words with 0,1,2, and 3 o's separately
for 0 o's we would have P(5,4)
for 1 o... P(5,3)β 4?
for 3 o's, 5β 4 I think
I will need to work out 2
I have the solution.
oh I thought the word had 8 letters, not 9
I need to redo this
ok my solution is complete
||the total number of words we can make is
N = [6P4] + [6P3 β
4] + [6P2 β
6] + [6β
4]
this is given by cases of 0, 1, 2, and 3 o's
final answer is N-4! = 1020||
Or,
explain
There are 6 choose i ways to choose i letters that are not O.
Then there are 4 choose i ways to choose the positions for those i letters in a 4-letter word.
Then there are i! ways to permute those i letters in the word.
ahhh
4! 4-letter words do not contain a vowel.
The number of letters that are not O is at least 1 and at most 4.
How many contain no even numbers
n/2
How many k-element sunsets contain no even numbers though
n/2 choose k
Okay, how many contain 1 even integer
And you can put this together to work out your answer
n/2 choose 1
okay i think i see where this is going
is it just
(n choose k) - (n/2 choose k) - (n/2 choose 1)
Why n/2 choose 1?
n/2 choose 1 is choosing 1 even number, sure, but you aren't considering the different combinations of odd numbers than can go with it
First choose the odd numbers, then multiply by how many even numbers can go with it
so the odd numbers are n/2 choose k
But if your set has one even number in it, why are you choosing k odd numbers?
no the set has n/2 even numbers
Wut
Okay, how many contain 1 even integer
I'm talking about the subsets
You are trying to find the subsets with 1 even integer
So then they only have k-1 odd integers in them
So then they only have k-1 odd integers in them
@quaint star sorry dont get what that means
If you are trying to take a subset with k elements, with exactly one of the k elements even, then the other k-1 elements must be odd
yeah
So if you are choosing the odd numbers for these subsets, it would be n/2 choose (k-1)
yeah true
And then with each of these combinations, you can add any of the even numbers
So if you are choosing the odd numbers for these subsets, it would be n/2 choose (k-1)
@quaint star so this finds all sub sets that have all odd except for 1 even?
Well, you still have to multiply by something
Because for each of those, you can choose any of the even numbers to go with it
Yes, which is just n/2
Practice
could never figure this out on my own
You'll get better at it
thanks man i hope so
my school starts in september but i am just practicing right now cause i know this stuff is hard
The more problems you do, you learn what to focus on and how to think about different kinds of problems
That's really good of you to work ahead. I'm sure you will be fine.
Manan:
My question: Is a recursive definition simply a function which depends on the value assigned to the base number, i.e., 0(or 1, based on definition of N)?
a recursive definition always defines a function
Is the converse true- can every function on N be defined as a recursive definition?
sure
How??
let $F:\bN \to \bN$ be an arbitrary function and define $c = F(0)$ and $f_n(m) = m + F(n+1) - F(n)$, in keeping with the notation from your excerpt
Ann:
Manan:
Ah, I see
f(0) = 0, f(n+1) = f(n) + 4n^3 + 9n^2 + 7n + 4
This is enlightening, thank you!
I don't think it's true for an arbitrarily defined function
That's the same doubt I had, but elementary functions on N are rather well behaved
Like,f(0)=3,f(1)=2,.. and so on, without a pattern
What would happen in case of piecewise functions @stray reef ?
in general f(n) does not need to depend on f(m) for m != n, so you can't just use a recursive definition for that
So recursive definitions are only a subset of functions on N?
unless you do something stupid like define the recursion as a_n = f(n) + f(0) - f(0)
Lmao
tbf i don't have a clear definition of what a recursive definition is
From what I've read so far, I guess recursion means backtracking to a base value which is explicitly highlighted. So given how the recursive definitions behaves and its base value, one can, in principle, deduce all subsequent values
i mean, then a_0 = f(0) and a_n = f(n) + f(0) - f(0) works for any function f: N -> N
This only seems more perplexing than the good ol' function, which simply assigns a value to every element in domain 
i mean, then a_0 = f(0) and a_n = f(n) + f(0) - f(0) works for any function f: N -> N
Given this definition, I cannot deduce a_(n+1)
The point of recursion is to establish some relation between successors in N
ok, then there must not exist such a relation for arbitrary functions
That's what I think too.
For example, a function dependent on parity of input may not behave well in a recursion
at least not one you can write down in finitely many symbols
I guess I could try framing a simple piecewise function of the sort
anything you can reasonably write down you can probably define recursively in some way
At the very least, I can safely assume there are some functions which can't be listed as recursions, right?
for some it'd be impractical to do so
the thing is
After decimal
Seems credible enough to me
if you want f(n) to somehow depend on f(m) for all m < n, then you cannot do it
That's it, that's what I wanted to know :p
like, if that is your definition of recursion
you would have to further formalize what "depends on" means though
if you want f(n) to somehow depend on f(m) for all m < n, then you cannot do it
@pale epoch yea,Define "depends on" that way
Well as long as I'm assured there exists a function f(k) such that f(k+1) can't be deduced in terms of either k or f(k), I'm good
Ah
I can say a function which doesn't depend on induction fits this
Every recursive definition is simply a consequence of induction; functions which don't depend on induction should be independent of recursion too.
what does "depend on induction" mean
f(k+1) follows from f(k)
what does follow mean
I don't think I can explain it very well, I just started with Peano Axioms :3
Hmmm but you're right, 'follow' is rather a hand-waving term
like if you want f(k+1) = p(f(k)) for some polynomial p and all k in N, its easy to see that this is wrong
f(n)=f(n/2)+1 is also a recursion
if you replace p by any function, it's true, you can do it
but i am not sure if that is "depends on"
Hmmmm, makes sense. I need more clarification on the definition itself it seems.
It looks like you are trying to solve a weighted set cover problem.
@lyric pumice Thank you. It seems that my problem is called: "Minimum Weighted Vertex Cover problem"
Was wondering if I got this proof correct? I.e is it valid, anything I could clarify...
is it sqrt(a)b or sqrt(ab) ?
sqrt(ab). Thanks)
doesn't look like it, otherwise it looks good π
those are just possible examples that satisfy the statement from above
a = -14, b = 3, q = -3, r = -5 and it holds that -5 < 3
but this is garbage, right? Which is the reason why it's not enough to only require r < b but we actually want 0 <= r < b
where it says r < b then that means r can be any negative numbers up to 2?
hm i guess we are testing numbers to see which of them satisfy?
It tries to show you why the rule 0 <= r < b is needed, because if you don't have lower bound of 0 then your solution is not unique
but you want to have a unique solution
okay, how would you read that " o </ r <b"
can that be broken up into two inequalities?
this means that 0 <= r AND r < b AND 0 <= b
the third bit there is redundant
but the last isn't necessary because of the second. If 0 <= r and r < b then by definition 0 <= b
@weary tiger @lyric pumice sorry, i fell asleep last night and didnt get to thank you two. Thanks a lot! I eventually figured it out near 3 am and fell asleep on my notebook haha
lol np
Certainly.
can someone help me with this problem?
That answer appears to be correct.
so like that answer is equivalent to
but i'm not sure how
hmm seems like (n choose k) - (n-1 choose k) = (n-1 choose k-1) ?
didn't see it anywhere just assuming
wow looks like it is an actual identity lol
wait actually i'm not sure if it is an identity
is it true that ${n \choose k} - {n-1 \choose k} = {n-1 \choose k-1}$
The-Elite:
this is basically how you construct Pascal's triangle
you look in the n-1 row and add the k and k-1 entries to get the entry in the kth number in the nth row below those two
ah yes ! ^^ thank you
you're welcome
may i suggest first obtaining the generating function for the sequence (0, a_1, a_2, a_3, ...)?
i.e. the original sequence {a_n} but where the 0'th term has been zeroed out
@small kayak
Oh i get it π’ , tks a lot
But the requirement is expressing in terms of A so i wonder what is the relation between the generating function for the sequence (0, a_1, a_2, a_3, ... ) and A(x) ?
the generating function for $(0, a_1, a_2, ...)$ is just... $A(x) - a_0$
Ann:
Oh okay tks a lot
I"m taking this class and I"m trying to understand this could someone point me in the right direction for a simple example https://www.coursera.org/lecture/what-is-a-proof/n-queens-brute-force-search-OPyaT?utm_source=link&utm_medium=in_course_lecture&utm_content=page_share&utm_campaign=overlay_button
did you understand the problem? @oblique oracle
not exactly
Not how we go through permutations to check
I tried to code and and print the code but I'm not sure what to print
okay, you understand what we want to find? And how the queens can move?
I understand the concept of the queen but not how we find the solution
okay, so the queen can move in 3 different directions: horizontal, vertical, and diagonal
they give you a link to a site to try it out http://dm.compsciclub.ru/app/quiz-n-queens
but I don't understand mathematically how to think about the problem
oh wow, it's super hard to find the solution for 8 manually haha
would this be considered combinatorics?
so the queen can move in those 3 directions. This means that you can never have two queens on a vertical or on a horizontal line
not really
so instead of all the possible (i,j) permutations, you now only consider a subset of them
where you already exclude the possibilities that two or more queens are on the same horizontal/vertical line
to do this you start by placing a queen on each column, now you only have one dimension, the vertical one, where you can move them around
Is there a simpler idea that builds to this?
and you have $n$ vertical positions for each. To guarantee that no two queens are on the same horizontal position, you just take the permutation of this, which guarantees that no two cross
lyinch:
euhm I don't now
use a chess board or a piece of paper and try it yourself
for n=4 or something small
so that it "makes sense". There's really not much theory behind it
the concept makes sense the best way to find a solution doesn't and I don't understand itertools and how that work
if they gave me a for while loop I could probably understand it
this just gives you all the possible permutations
a permutation is a shuffling of your data
meaning try every possible data combination?
yes
but it's a bit smarter
instead of trying all the permutations of the possible board combinations
which would also mean that you could place two queens in the same row, you make some restrictions
and already fix one of the two coordinates for each queen
that reduces your search space
it's still brute force, but a smarter solution than randomly placing your queens, or trying every single field
The first i1, i2, perm[i1], perm[i2] is 0101 I don't know that that mean
is it the position of two queenfs?
are you familiar with python?
yes
okay, yes this particular example is for 2 queens
check what combinations does in the docs https://docs.python.org/3/library/itertools.html#itertools.combinations
i understand what it gives but not what it represents
it gives you the y coordinate of your queens
you know the x coordinates of your queens, right?
i1, i2 = x1, x2? perm[i1], perm[i2] = y1, y2?
I feel like I'm detecting a collision here?
what do you mean?
like if two things occupy the same space like in hashing
but that doesn't happen
like if I put a queen here she occupies this space and i put the next queen down and if
by construction, you don't place two queens at the same spot
meaning she occupies 22 spaces
for a board of size nxn, each queen can only go on n different places
and even less, because once you have the positions of n-1 queens, the last one is already determined by the fact that you're using a permutation
try to do the example by hand on paper, before you use the code maybe
Okay thank you.
try it out a bit and you can ping me if you're stuck again or still need help
I'll try to explain it differently then π
@oblique oracle https://repl.it/repls/SereneWastefulCleantech I commented the code, maybe that helps
WOW thank you soooo much!!!!
I was trying this https://repl.it/@Michaelmikey/KnobbyUltimateAmpersand#main.py
so when we check for vertical we are by default checking for horizontal because the abs will still be the same?
we don't check for vertical
there is exactly one queen on each column
so all we do is check for horizontal, which are the permutations
but to see if they diagonally collide, we need to also get the vertical coordinate somehow, which is what the it.combinations does
Do you think a statistics course would be a prerequisite for this really its my first time working with "combinations" and "permutations"
at the start of the class they stated you need no background
no
this has absolutely nothing to do with statistics
don't worry mate, there were times where I spent 2 weeks trying to solve an algorithm problem
and looking back, it's not like those were difficult problems. You'll get better at this the more you do it
Thank you. I'll google permutations more all I find is in statistics
You don't need to know much about permutations
Just that you rearrange, and try all the shuffles
He couod have explained the algorithm without ever using the word permutation
Im thinking the ugly way is a nested for loop 3 times?
For what?
Use python itertools to create the permutations, it's not trivial to do it efficient yourself and will be a new algorithm to learn. It really doesn t matter for this problem how you get the permutations
what does that mean?
that's not a permutation, in a permutation you don't duplicate
because if you have 0111 then this means that you have queens at (0,0), (1,1), (2,1), (3,1) which is wrong because they are all horizontally aligned
okay I think thats the idea I'm missing thank you
good π
2^(n-(n/2)Ck)
try to explain what you think it's saying, that might help, just do your best even if you know what you're saying is wrong
Can someone look at my attempted proof: http://mathb.in/44609
@weary tiger Start by disregarding conditions like "minimum" and think about what n could be.
What does it mean for students to receive the same grade?
@south marten it's-->its
The set X has at most n elements.
ahhh okay thank you I struggled with that proof π
@lyric pumice other than that the argument is okay right ?
That statement changes the entire proof.
You cannot color 1 element red and n other elements blue because that would imply that X has n+1 elements, which contradicts the assumption that X has n-r elements.
ahhh okay that makes sense π¦
Can someone help me with a pigeonhole principle problem?
This is the problem
this was my solution but i dont think it is corrent
*correct
@lyric pumice how bad was my attempt because I spent hours racking over it
Either come up with a counterexample or prove that there is such an isomorphism.
@worthy palm
What does it mean for students to receive the same grade?
@lyric pumice students grade map to the same grade value?
i kind of think of it as a function
I mean how come you can't just take 4 students and let them all get the same grade lol
4 students don't all have to have the same grade.
Having 4 students does not require that all 4 of them must have the same grade.
true
but what's stopping all n amount of students from having the same grades
i dont see that restriction in the question
so it's kinda confusing
Nothing is stopping all n of the students from having the same grades.
hm okay i think i get it now maybee
im thinking of something
i think minimum is 16
n = 16
but i just used a book shelf analogy from another similar question, I want to maybe find formula for this
if thats possible
@worthy palm I presume that the size of the cycle space of a graph is preserved under subdivision.
Well, the cycles are not technically the same, but the vertices of the old Eulerian trails appear in the new ones.
@weary tiger Good.
is there a way to do it with a formulA?
Almost certainly.
i just drew this:
A | | |
B | | |
C | | |
D | | |
F | | |
and like the next one has to be the 16th |
so that's how i got my answer
but not sure how to do the formula way
Hey I have this question I am stuck on which goes as follow
"How many words, of length 10, can we form if we are to use exactly one 'a', two 'b',
three 'c' and four 'd'? "
I am unsure how to start of doing this so any help would be appreciated π
there's a way to do it by deliberate overcounting
if you pretend all the b's, c's and d's are distinct from each other then you get 10! words
but then to factor in the fact that the d's are distinct you need to divide by 4!
then by 3! for the c's and 2! for the b's
Ann:
probably because language but delibirate overcounting is a word I am not familiar to what is the idea of that ?
makes sense cause it's a term i just made up
hahah
basically it's overcounting but in a controlled manner
one that can be accounted for
like counting everything exactly twice
or exactly three times
,calc 10!/(4! * 3! * 2!)
Result:
12600

Another question anyone familiar with Dijkstra's Algorithm? I am suppose to find the shortest path from the corner "d" to all other corner in the graf G below with help of Dijkstras algorithm.
@weary tiger what exactly you need
i mean have you read pseudocode of dijkstra's algo?
Sorry should of explained better I am not super familiar with dijkstras Algorithm just started learning about it and wonderd if I can get some help understanding
alright, but have you at least read pseudocde for it?
Yes I have
so you have to find shortest path from d to which vertices?
to all other corners in the Graf
wdym by corner
Like shortest path to a,f,i,u etc
do you need to find paths or only their cost?
Path and cost I think i looked at an exampel and he started from "e" and went to "u".
Wrote it like this
why
look
initially all your vertices are labeled with infinity
except for starting one d
then look what you do
you will have two sets
(or label on vertices)
what you do is i will write down pseudocode
or no

alright i will just copy pseudocode here
and we will do it step by step together
you can pm if you want to leave chat open for other questions
ok
Your roles have been updated!
Say I am looking for a combination of 3 numbers, from the possible values of 5 numbers (0,1,2,3,4), that would equal 4. Is there a formula to find this, or what would I need to do?
i think this is what you need?
@steady axle
actually yours seems a bit different
soz
Would you like me to share the actual problem?
sure
Something like this word problem
I say 5 numbers (0,1,2,3,4), because I would like to account for empty throws (0) when a value of 4 is hit
Zophike1:
Is it possible to improve the worst-case performance of bucket sort algorithm?
hello everyone can I ask a question?
what does it mean when the elements of a set is meaningful and unambiguous
@vital wyvern essentially it means for elements of a set to be unambigious is if that element is define clearly
what would be an example of an unclear definition?
There should be no confusion on whether or not a given element is in a set
It either is, or is not
thanks!
Np. Feel free to ask if you have anything else
will do! :p
could i prove this by showing that the cardinality of A is less than P(a) using the proof that that elements of set A is n and P(a) is 2^n so n < 2^n for all natural numbers. and since the cardinality is less is it not surjective ?
i need to make my own proof for it so cant use that
i was wondering if it was possible to show through proving the cardinality is less
that |A| = n and P(A) = 2^n wont work if set is infinite
even if the set is infinite wouldnt 2^n be larger and still a smaller cardinality
rationals intuitively are larger then naturals but there is bijection between them
more than intuitively, the naturals are a proper subset of the rationals
|N| = |Q|
so my proof would only work if the set A is finite?
yes, when A is finite you just say that |P(A)| > |A| and that's all
gotcha.. im doing a presentation to my professor tomorrow on this theorem and i cant use the proof from the book and have to present my own so i was trying to figure out a different approach to it
this also works with A infinite
maybe i could do the proof my way then do a separate proof given A is infinite ?
rn i just skimmed through google and all proofs base on russel paradox mhm
this is the proof that my textbook used
ah gotcha, so yeah i was told i could use the idea of the textbook but needed to be phrased different and i was struggling to do that so i decided to try and take a completely different approach and try to go through cardinality
but if that doesnt work than maybe i can reevaluate
1010 and five elements remain
in fact you have just to find number of bitstrings of 5 symbols for second prop
what
if bitstring starts with 1010 you already know first 4 bits
now you have to find remaining 5
how would you find amount of bitstring of length n?
without any additional constraints?
2^n
so plugging n = 5?
32
so there are 32 bit strings?
with that property
how come the answers im getting isn't one of the options
for the first property, i got 16
so i did 16+32
but there's no option for that answer
@weary tiger because look
101010101
satisfies both properties
you need to trace that satisfy both
but it says or
yes, but look
suppose i have 101010000
which is in first set
1010111111
which in second
and 101010101
by simple + you will get that you have 4 strings
whereas in fact you have 3
and are u sure that for first property there is 16?
and 101010101
@last timber this would be in both sets yeah?
ye
truee
so u have 64 but you have to trace string in intersection
so in terms of sets whats the goal? take out the duplicates?
yes
ok i see
@last timber this would be in both sets yeah?
@weary tiger wait i thought it starts at position 0
@last timber
?
what
bits are numbered 1, 2,3
why did you say "ye" to this
oh okay in computer science it starts at 0 so i thought it started at 0 here too
because 101010101 has both first property (0's at even bits) and second one
well, if it start from 0 it is equivalent to 0's at odd bits
answer should not change
hmm ok
this is not intuitive at alll for me lol
wait i dont get this... If the bits are numbered 1,2,3 then wouldn't there be 4 even positions and 5 odd positions @last timber
but if started at 0 itd be 5 ,4 respective
look
if you number from 0
you have 0's at odd positions
-0-0-0-0- where - for unknown bit
if you number from 1 you have 0's at even position
but nevertheless, the amount of -'s, that is, the amount of unknowns bits is still the same
oh i thought ur example was saying someting else
i dont get it
if your start position is different, the number of odd,even positions will be different too
lol
if your start position is different you would have to restate the whole task
like if n = odd number
what is n?
yes
what problem are y'all doing again
i dont really care
@weary tiger if you would start enumeration from 0, you should restate first property as "the bit at each odd position is 0"
but in both statements the amount of unknown bits is the same
i mean like ok let $A$ be the set of bitstrings with 0's at all even positions and let $B$ be the set of bitstings beginning with 1010
Ann:
@weary tiger if you would start enumeration from 0, you should restate first property as "the bit at each odd position is 0"
@last timber okay that makes sense then
we're looking for $|A \cup B|$, and for this we need $|A|$, $|B|$ and $|A \cap B|$
Ann:
none of which is particularly hard to calculate imo
yeah im working on (A n B) now
the problem as far as i see was even not in method of calculation
but the-elite was confused by enumeration
$A \cap B = { 1010x0y0z \mid x,y,z \in {0,1} }$
Ann:
wow writing it out like that makes it so much easier
thank you all @stray reef @last timber
is the reverse of cantors theorem true? is P(A) onto A? i can see that it is for finite sets but wanted to be sure it was the case with infinite as well
are you asking whether or not there always exists a surjection of P(A) onto A?
i believe you might need choice to prove it for sets any larger than N
before i spend a very long time working on writing this out i was wondering if someone could look over my idea and see if it makes sense to
this is what i have to prove. I was planning on breaking it into two cases, If A is finite or infinite. If finite I plan on writing that A has n elements and P(A) has 2^n so by cardinality it wouldnt be onto.
then if A was infinite, I was going to use this argument
that argument applies regardless of the finitude of A
so would it be wasteful to include the finite part? this is for a presentation so i want to make sure that its clear to my professor that i understand and am not just copying a proof online
yes it'd be a waste of time
you can mention that the argument applies regardless of whether or not A is finite
ok sounds good thank you
Wow, pretty slick
I have a challenge if you can do the last one without cheating http://dm.compsciclub.ru/app/quiz-clock-game
||Isn't it just binary search?||
it is
It is not truly random
I don't know I can't get it and the instructor insists its solvable
It's easy to do, but the number they give you is not random at all
I think it is programmed explicitly so that you can only solve it if you do binary search
?
you should start by comparing to 1,048,576
and go up/down in descending powers of two
that's how you avoid falling one question short
,w log_2 (2097151)
ye 21 question is enough
2^20 = 1048576
2^20 + 2^19 = 1572864
2^20 + 2^29 + 2^18 = 1835008
...
Carry on with this pattern and I assure you that at the end the number will be 2097151
so we can't split it 21 times and guess it in one try?
You can split it in half 21 times and get the answer for sure
see my answer wasn't even close to the split though
That's the theory
the number changes as you guess
The thing is that this website is not picking a random number, it is cheating and you can only beat it by binary search, which is what you said
oh finally they didn't give me maximal possible range value
@last timber but that only happened because you went above the half point in that third guess, so now the range of possibilities is too large and you cannot win (because the game cheats)
Try it, any third guess below 1835008 will tell you that x is larger, and any third guess above said number will tell you that x is smaller
right I can beat it by binary search but rounding it killing me to get the actual values
1 number off and you don't get it
You can even do this on your first guess: anything below 1048576 will tell you x is larger, and anything above it will tell you x is smaller
i did nt manage to catch them on explicit cheating tho
did you solve it?
how?
Did you read my previous message?
write my own binary search lol
Input the values 2^20, 2^20+2^19, 2^20+2^19+2^18...
2^20 = 1048576
2^20 + 2^19 = 1572864
2^20 + 2^29 + 2^18 = 1835008
...Carry on with this pattern and I assure you that at the end the number will be 2097151
@warped mica this?
And I guarantee you will win and the final answer will be 2097151 = 2^22-1
Yes, that one
Is that the source?
the final answer should be 1618235
yes the javascript is cheating
Yeah, that's the explicit cheating l
I set an alert to tell me what the answer was
Could anyone confirm whether this takes the order into account?
Because the first part is getting all the permutations of the drawn objects but removing the permutations of each kind of object
It does not take order into account.
It gives the probility of obtaining k1 objects of the first kind, in whatever order you got them
What would it even mean for it to take order into account?
Ok but is my interpretation of the first part correct? Like we have n! which is the permutations of the n drawn. Then we are removing the permutations for each object as they are the same
why are we doing that?
Yeah I guess youre right that it does not make sense to take the orderings into account hahah
but what should I make of the first part before the second product sign?
Like for two objects of amount a and b we have that
Combinatorics is not my strong suit lol
Ok but I will try to make sense of it and you tell me where I go wrong
we have 'n' spots to fill, we want 'k' of them to be the desired outcome. That is, all the k-subsets of n (nCk) give the possible orderings in which we can have our desired outcome. We multiply it (why???) with having the desired a/(a+b) in k spots and the undesired in the rest (n-k) spots
I got even more confused after writing that, it isnt my strong suit either haha lol
Oh it's right
Hahahah
Let's find the probability of drawing k objects of type a
Each draw has a probability of (a/(a+b)) of being of type a
So if you want k draws in a row to be of type a, it is (a/(a+b))^k
Do you agree?
Yep so far im with you
Then if you want the next n-k draws to all be of type b, you have to multiply by (b/(a+b))^(n-k)
Shhh
heheh
So (a/(a+b))^k (b/(a+b))^(n-k) is the probability of a specific draw happening with k items of type a and n-k items of type b
Yes sir
By a specific draw, I mean the order matters: did you draw aabb or abab
So now to find the probability of any such draw, you have to multiply by how much such draws there are
And there are nCk many of them
nah here I dont understand why tbh
like first of all wouldnt the number of all such draws be nPk instead?
Wait
Let's take a small example
5 objects. 3 of type a, 2 of type b
Let's say we draw 3 objects and want 2 of type a and one of type b
The probability of getting aab is $(3/5)^2 \times (2/5)$.
Lunasong:
yes with that I would agree
But you could also draw aba or baa
And those have the same probability of occurring
So the probability of getting any of these is $3 \times (3/5)^2 \times (2/5)$
Lunasong:
Where the 3 is there because that's in how many ways you can draw it
Does that make sense?
Yeah ok that does actually make a lot of sense
Ok oceans of thanks man
so we are multiplying the probability of both events happening with the number of times it happens
kind of
i.e. addition principle?
Yeah exactly
thanks I really needed your help to see it
If you want to understand why it's nCk. Think of there being n possible positions for the k objects of type a and you have to choose k of them. There are nCk ways to make that choice.
Would it make sense to see it as all the "subsets" of the positions?
ok but if I can bother you just a second more, for the general case I posted first
We aren't really doing nCk
but does this:
Because the first part is getting all the permutations of the drawn objects but removing the permutations of each kind of object
@void valve
make sense?
The last part is the product of the probabilities
Yep that one I get
but like the first part is like the ways you can rewrite "hello" (5!/2!) right?
The $\frac{n ! } {\prod_1^r k_i!} $ is the number of ways you can draw it
Lunasong:
It's the equivalent of nCk in the general case
but like the first part is like the ways you can rewrite "hello" (5!/2!) right?
@void valve
is it the same as this?
because then I think I understand it fully
if not Im not sure
rewrite as in jumble the letters up uniquely
Thank you alot, seriously I really couldnt grasp it π
Np
The question can be either.
it is combinations
If you don't treat switches as distinct, then it would be combinations.
but they are all the same thing
and it just wants total postitions which satisfy the condition, and two positiions are equivalent through permutations
I don't get how to find strings with at least 1 lowercase letter
so far i have 52^15 - 26^15
I think you should calculate how many have exactly 0 or 1 and remove that from the total
yes
I don't get how to find strings with at least 1 lowercase letter
so far i have 52^15 - 26^15
note that KD said "exactly 0 or 1", not at least 1 lowercase letter
?
I was wondering if anyone had a clue with this one
The property he's hinting at would be demorgan's theorem
but ive got not clue how that could be used for simplification here
rip Reckful π¦
yes
Are plane graph planar?
plane graphs?
yeah that's a planar graph
Gotcha
I was confused because
The definition for planar graph is like itβs a graph that can be redrawn with no edge crossed
But if plane graph is already redrawn
I thought it didnβt make sense to call it planar
Or Iβm just being dumb, but either way thank you for your confirmation!
Then it is still planar right?
I did this proof, but was wondering if this is directly related to the Cauchy-Schwartz inequality?
this looks written backwards
I agree
yeah it is written backwards and also the assumption of a, b, c β Z is frankly unnecessary
hell you don't even need them to be positive.
and also the "for all positive integers a, b, c" should have been formatted as a line of plaintext rather than as a formula
Thanks, Ill remember to write the text as a plaintext next time.) Ironically the problem has this form and its from the book " How to think like a Mathematician" which is supposed to illustrate good proper form one would think haha. Anyway couldnt one see this as some sort of variance of the Cauchy inequality? It looks at least pretty similar, no?
yeah it's cauchy with the vectors (a,b,c) and (b,c,a) basically
thanks
Also it should be spelt "practice"
Could somebody help me "see" that formula or explain in words?
For probabilities of the events A and B
Like it makes total sense if we divide both sides with P(A), P(A) becomes the new sample space and B happening given A has happened leaves their intersection as favourable outcomes
but I can't see why it makes sense when we rearrange it like this, help would be appreciated π
P(B|A) is probability of B occuring,if A occurs. P(A) is Probability of A occuring.
So,We see if A occurs and in that case,we see if B occurs
Which is same as seeing A and B occuring at same time
Ah yeah ok I think I get it actually, A occurs, given that A has occured we see if B occurs we multiply them and that gives the intersection
Yea
What would the formula become if they are disjoint? Like P(B|A) has to be zero as B can't happen i A has happened?
Like if they are disjoint we dont have P(A intersection B)
what on the right hand side makes it zero?
Is it that B can't happen given that A has happened in P(B|A)
I mean I guess
may i suggest first think about equivalent
P(B|A) = P(A n B)/P(A)
Yeah vimes, that one I can visualize perfectly
P(A) becomes the sample space as A has already happened
And what remains would be their intersection if B also has to happen
It is just that I cant visualize it when we multiply both sides with P(A)
but then if we know result of multiplication of probabilities of events including A and of events where B happens in sample space of A we are able to find P(A n B)
Sorry what do you mean exactly?
Multiplication is intersection more or less, right?
Of two probabilities
I mean algebraically I get it, it isn't that
i mean that P(A n B) is like product of probability that event A happens and event B happens when A does so
But would it be possible to draw a venn diagram or something? It being normal multiplication trips me up I guess
Is multiplication of probabilities always them both happening at the same time?
Hahah nice, I mean P(B|A) being the ratio is the formula but why is it + green also?
But P(B|A) = P(AnB)/P(A) where is the plus green?
Shit I think I just became more confused now
perhaps Im overthinking it
yes
P(B|A) = green / (red + green)
Therefore P(A n B) = green / sample space (???)
Ah ok yes that makes sense hahah π
Yeah ok it feels like multiplying the formula still but I have a much better picture of it now, thanks π
Just another perhaps somewhat embarrasing question, is P(A) * P(B) (as in normal multiplication) always P(A n B) ?
only if A and B are independent
i mean that is definition of independept events P(A n B) = P(A)P(B)
They are dependent if there is a conditional probability P(B|A)?
like consider when P(B|A) = P(B) or in words probability of B = probability of B given A
That only happens if they are independent?
Otherwise we have P(B|A) = P(A n B)/P(A)?
Like is independent = disjoint sets in this case?
Ok thanks that is a great example describing it, so when they have no connection their probability can easily just be multiplied
What is relevant to determining whether there is an euler path that is not a circuit on a graph?
This is for discrete structures, but I am not sure if it falls under this
@frank zinc if all vertices are of even degree graph contains circuit
if exactly two vertices are of odd degree it contains path but not circuit
So basically a circuit is not a subset of a path
