Category "math"

Find the nth character of an increasing sequence

Recently i saw a competitive coding question, the bruteforce approach doesn't meet the time complexity, Is there any other solution for this, Question: An expan

Trying to use math function: sgn... error : sgn is not declared

hmm... I imported:System.math... test as integer=sgn(100) I get the error: sgn is not declared. Other math functions work. So Why? Might Visual Studio not be

Is floating point math broken?

Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen?

How to create TradingView indicators that look like this?

I've been trying to create similar indicator to this This is the reference I have the code for RSI, Stochastic RSI, MACD and 50/100/200 MA (with crosses), but I

How to create TradingView indicators that look like this?

I've been trying to create similar indicator to this This is the reference I have the code for RSI, Stochastic RSI, MACD and 50/100/200 MA (with crosses), but I

E-olymp: Profit. 90% gives, one test wrong answer

Description of my code: For example, take n = 3, and let p [i] be 1 2 3. For beginnings, max = 0. I take in this order the sequences: 1, 1 + 2, 1 + 2 + 3, 2, 2

How to solve a math sequence in R?

EDIT: I could not come up with a more precise question title but please let me know what better title I could use, thanks! I have a "basic" math problem that I

Error plotting symbolic variable in MATLAB?

I am trying to learn fourier transform from book"signals and systems laboratory with matlab alex palamides" On page 312, following code is given which demonstra

Display Math calculation on a HTML Element with Javascript

I got the following code that calculates a percentage and I want to show the correct result on a html element (p). This is what I have but it's not displaying a

find the smallest integer N, such that

I am stuck for quite a while now on the following task: find the smallest integer N, such that A^N < N! I want to do this in C# and A can be so big that ther

mXparser's iff() conditional does not support equality test

I'm using the Java/.NET symbolic math library mXparser (5.0.2) to support user-provided math expressions in my app. Problem I found that the conditional clause

Does modulo (%) operation applied to part of the sum and applied to whole sum equal?

Is the LHS = RHS ? ((((i + k) % nums.length) + k) % nums.length) == ((i + k + k) % nums.length) What is this property called? Does it hold true for multiplica

Adaline AI results in an overflow

I made an AI that uses the Adaline algorythm. It seemed to work but it results in an overflow if it's used with my own dataset. Here's the code: import sys imp

How to bitwise rotate left and rotate right on arbitrary sized number ranges?

How to rotate right and left over an arbitrary number of bits. So say I am looking at 5 bits. How do I rotate around 5 bits, though I am in JavaScript. Or 8 bit

Calculate Decay Rate in Python

I have dataset which somewhat follows an exponentional decay df_A Period Count 0 1600 1 894 2 959 3 773 4 509 5 206 I want

Delta operator in sympy

Is it possible to make a delta operator like this in sympy? Im not really sure how to code it. Should be really eazy if there exists a method.

name 'DiracDelta' is not defined in calculating the hessian

I'm working on a project and trying to calculate the gradient and the hessian using this symbolic library but I'm getting an error NameError: name 'DiracDelta'

Non Linear Decision boundary SVM

I need you guys help to find a non linear decision boundary. I have 2 features with numerical data, I made a simple linear decision boundary (see picture below)

Mathematics Mod Function

I would love if someone can try to explain the difference between the two equations below and why they equal different values but from what i can see are the sa

I think I'm expressing this summation incorrectly in MATLAB?

I'm trying to code the following sum (which is the solution for a functional DE): This sum is valid for t in [nT, (n+1)T], where T is a constant number (found