Posts

Showing posts with the label math

Bendy's Basics in Education and Learning

Video Channel: Baldi Basic GAME Bendy's Basics in Education and Learning Baldi's Basics, Baldi's Basics MOD, Baldi's Basics Update, Baldi's Basics Edition is what you will find on my let’s play gaming channel. Looking for scares, Baldi and animatronics then you are in the right place. All the games from Baldi's Basics in Education and learning to Arcade and of course Playtime from Baldi's Basics. const player = new window.Plyr('#player', {keyboard: {global: true,},tooltips: {controls: true,},captions: {active: true,},iconUrl: '/js/plyr.svg',autoplay: true});player.source = {type: 'video',sources: [{src: '//youtube.com/watch?v=IdRqvUKX96I',provider: 'youtube',}],}; Bendy's Basics in Education and Learning Download var switchTo5x=true;stLight.options({publisher: "8370abff-a8c4-40e1-9890-b965a65c3b93", doNotHash: false, doNotCopy: false, hashAddressBar: false}); Bendy's Basics in Education and Learning...

Exponent of a summation

Image
Exponent of a summation I am a very new python user. I am trying to calculate an exponent of a summation. The array has more parameters. import math a = [[1, 2, 3, 4], [5, 6, 7, 8]] def y(i): p = 2 total = 0 for j in range (4): total += math.exp(a[i][j] * (p**j)) return total Answer from this method: 7.89629603455e+13 7.89629603455e+13 The answer is way different than manual calculation below: y = math.exp(1*(2**0) + 2*(2**1) + 3*(2**2) + 4*(2**3)) Answer: 1.9073465725e+21 1.9073465725e+21 Can you post expected answer for this – Venkata Gogu Jun 29 at 17:47 The expected output has the sum inside the exponential, while in the loop you take the exponential first and then sum. These aren't the same. – Jay Calamari Jun 29 at 17:50 ...

Interfacing octave with C#

Interfacing octave with C# I have developed a program in Octave to which I would like to add a GUI layer. I want to create an executable program in C# that I can distribute but want to stick with the linear algebra constructs of Octave without having to implement them on my own. Particularly, I want basic matrix, vector operations and optimization functions (like fminunc and fmincg ). fminunc fmincg What is the best way to achieve this? Appropriate C# linear algebra library, perhaps? You should edit your title to match your question, you might get more people interested. – jv42 Nov 6 '11 at 12:32 5 Answers 5 There are lots of math libraries for c#. Math.NET Numerics seems to be a good free alternative. There are also commercial implementations. Anot...

Maximal unique continuous subsequence

Maximal unique continuous subsequence Given a sequence of integer numbers: a[0], a[1], a[2], ..., a[n] Subsequence a[i]...a[j] is unique if the following is true: a[i]...a[j] for each x, y between i and j and x != y: a[x] != a[y] I need to find length of maximal unique , continuous subsequence My approaches: I tried many heuristic approaches, but they didn't work. Then I wrote bruteforce, it gave O(n^3) complexity, which is impossible to calc if n = 10^6 O(n^3) n = 10^6 ans = 1 for i in [0, n] for j in [i, n] if unique a[i]...a[j] ans = max(ans, j-i+1) I think it is typical dp problem, but don't know how to proceed dp 4 Answers 4 Create hashmap (or use boolean array if range of values is rather short). Make two indexes - left and right , set them in the beginning. left right Move right index. At every step check if t = A[right] already is in map. Stop when ...

What function(s) determine the max or min of two integers?

What function(s) determine the max or min of two integers? Which _STD function(s) return the max, or min of 2 integers, signed or unsigned? Is it the max, min in the math.h header library or what could they be? Possible duplicate of Use of min and max functions in C++ – Radiodef 2 days ago 3 Answers 3 std::min and std::max in the <algorithm> library. As they're templates they return the min and max for every type that implements the < operator (or you can supply a functor for your custom comparison). std::min std::max <algorithm> < See Algorithms library (link to cppreference.com). You can use the new algorithm introduced in C++11( template<class T> pair<const T&, const T&> minmax(const T& a, const T...