Search Results


9 matches found for 'formula'

Math Formulas for C.S.

Sum of the first \(n\) integers \(1 + 2 + 3 + ... + n = \) $$\sum_{k=1}^n k = \frac{1}{2}n(n+1)$$ Use cases: Finding a missing number from \(1 ... n\) Sum of the squares of the first \(n\) integers \(1^2 + 2^2 + 3^2 + .


Quick Numbers in Software Engineering Cheatsheet

... counts (for a month) usually range from millions to billions, so having this back-of-the-envelope formula should get you started for easy conversions. Availability 99.9% availability - three 9s Duration Acceptable downtime Downtime per year 8h 45min 57s Downtime per month 43m 50s Downtime per week 10m 5s Downtime per day 1m 26s 99.


Rotate a 2D Matrix

... this idea is straightforward, it will take a bit more effort to translate this into a formula. One way to build up this formula is to try a few more example cases.


Coin Change Denominations

... with the following recurrence relation: \[T(n){i}=T(n-coins[i]){i}+ T(n)_{i+1}\] What the formula above means is that we choose to add together our two choices here: spend the current coin at index \(i\), or refrain from using this coin and instead, choose the next coin at index \(i+1\).


NumPy vs. Pandas, and other flavors (Dask, Modin, Ray)

... types. Computations and Tables Working with NumPy gives you tools for many mathematical formulas that are used in Linear Algebra. The n-dimensional data structures are built for fast and optimal data access and storage.


Perfect Squares

... of opting for recursion, we use a 2D array to pre-compute values, and use the recurrence relation formula above as the basis to populate the entire 2D array. Solution Note: We can improve this DP solution even further.


Distributed scaling with Relational Databases

... in practice. Strong Consistency and Distributed Nodes Quorum consensus is a popular formula to determine how many writes or reads (minimum) it takes to say that a transaction is valid.


How to convert a PPM image to grayscale in C++

... 3 - The grayscale function The way the grayscale function works is simple enough. The important formula/equation is the following: newRed = (oldRed * 0.299) + (oldGreen * 0.587) + (oldBlue * 0.


Buy and Sell Two Stocks

... optimum at each index. When two stocks are involved, things can get drastically tricky. With the formula above, you may be able to greedily find the highest profit obtainable in one sequence, but the second stock option might not be so rewarding.