Binlogs
27 subscribers
18 photos
125 links
Download Telegram
Combination is "permutation with repetition where there are only 2 kinds"

Combination can be expressed using binomial cofficient

Multinomial coefficient is "permutation with repetition"

Multinomial coefficient can expressed using the product of prefix binomials.

also
C(n, r) = C(n-1, r-1) + C(n-1, r)

#lessons
community course has been empty (on the english version) for a while, but now they have added some lessons to it. you can access them here.

https://codeforces.com/edu/course/3
👍3
Forwarded from Dagmawi Babi 🇪🇹
Lee Robinson's course on how to use and understand AI in dev. A pretty quality resource.

AI (in dev) Foundations
• cursor.com/learn

Or on YouTube
• youtube.com/playlist?list=PLuI2ZfvGpzwCEXrl_K6bW5OqNpZq3HkMa

#Resources #Cursor #Tutorials
@Dagmawi_Babi
how to know if a node is an ancestor of another node in a tree?

first let's have a global variable that tracks time, which starts from zero.
when traversing the tree using dfs, track the "in" and "out" time of each node.

- "in" time = is the time at which the recursive dfs function is on that node.
- "out" time = is the time after the dfs function traversed every child and grand children of the current node.

to show it in code.

def dfs(node):
# "in" time is here

for child in graph[node]:
dfs(child)

# "out" time is here


let "x" be a node and "y" be another that node. then we can check "x" is an ancestor of "y",
if in(x) < in(y) < out(x).


#lessons